The Source for Java Technology Collaboration
User: Password:



Masoud Kalali's Blog

Community: NetBeans Archives


NetBeans Platform Certification and training.

Posted by kalali on May 20, 2008 at 02:43 AM | Permalink | Comments (1)

Netbeans is well known for beeing a great IDE for developing Java SE, Java EE, C++, Java ME, Sun SPOT, Ruby on Rail, PHP, Groovy, ... but NetBeans has more to offer when it come to developing highly modular desktop applications. The desktop application can be from any possible category like Business oriented, scientific, utilities, development tools, entertinement, etc. You can find a list of applications based on NetBeans platform here And it is provided by the NetBeans platform which what NetBeans IDE and all of its complementary packs and plugins are developed based on it.

If you are a Platform developer you may already know that there are many valuable resources like books and articles already available to start with developing applications on top of NetBeans platform. In addition to all of there resources, NetBeans provides you with another option, NetBeans Platform Certified Training, through this program you can freely attend training courses and get certification based on the level of knowledge and experience that you demonestrate at the end or through the program.




110x32_anim_v1.gif Locations of visitors to this page


The train starts running, NetBeans Innovators Grants has just announced.

Posted by kalali on January 29, 2008 at 07:41 AM | Permalink | Comments (0)

The train start running, NetBeans Innovators Grants has just announced.

  • Are you an RCP developer looking for some financial support to implenent some modules on top of NetBeans RCP?
  • Are you familiar with NetBeans IDE and also you have some ideas in your sleeve, ideas to enhance the IDE functionalitis, ideas about new functionalities, etc?
  • Do you know some bugs/ RFEs in issuzilla which you can fix them, but you were looking for financial support?
  • Do you have some cool ideas about some sample projects or blueprints showing How one can develop Java/ J2EE/ J2ME/ Ruby/ C++ projects using NetBeans IDE and its capabilities?

If you fit into one of the above categories, you can join the NetBeans Innovators Grants, a sub program of SUN Microsystems US$ 1 million Program which is intended to help people develop open source projects sponsored by SUN Microsystems.

Take a look at NetBeans Innovators Grants Home Page, read it carefully, check SubMission Details page to gain some understanding of what is expected in your submission, and after you prepared your project proposal you can come to Proposal Submission page and file in the forms with your project details in order to jump into the contest train.

Another item which could be the subject of a project is contributing articles, tutorials and sample codes to NetBeans Zone located at Netbeans Zone, this web site. it is intended to be the most complete source of articles, links,.... for NetBeans platform and IDE.

P.S: Make sure that you read the legal page located at: Legal information






SHIFT+ALT+ENTER, a cool NetBeans shortcut

Posted by kalali on June 14, 2007 at 11:14 AM | Permalink | Comments (4)

Today accidentally I find a coll shortcut in NetBeans, it do something fun, if you press ALT+SHIFT+ENTER IDE switch to full screen, it will remove Title bar, status bar, and toolbar to give you a little more space when you are writing your code.

Here is an image of netbeans in this mode, you will find it usefull.

full-screen-thumb.png

Also If you are looking for some NetBeans sample you can take a look at NetBeans IDE Sample Applications which is a good start point for you to find some ready to run samples for different platform from java SE to RoR which is fully supported in NetBeans 6.




A scenario based tutorial about using NetBeans BPEL, JBI and Web service developemt features

Posted by kalali on May 11, 2007 at 01:33 PM | Permalink | Comments (3)

NetBeans Enterprise pack 5.5.1 provides several new features in as well as those ones in version 5.5. One of the most important features is related to ESB. In this article I will cover some of NetBeans capabilities to develop application based on the SOA paradigm.

You will see what ESB is and how it can ease development and deployment. I will also show what BPEL is and how it can affect your development, while demonstrating NetBeans’ level of support for ESB and BPEL. Building a scenario-based sample which uses some of NetBeans Enterprise Pack features in the BPEL and ESB area is the final things I will demonstrate.

What can an ESB do for us?

An ESB which can act as a JBI compliant is an infrastructure that manages, monitors or enhances service's capabilities in several ways like providing more connectivity mechanisms which has been added to ESB by binding components. Binding components can interact with resources outside the ESB. For example a JDBC binding component can act like a consumer and poll a database table for new records and whenever new records become available transforms them to a standard message named Normalized Message and sends it to the other participants by using a message router named Normalized Message Router or NMR. Messages that are produced by binding components may require transformation in order to meet business rules or making usable messages for other binding components or service engines. A service engine provides and consumes services within ESB. BPEL service engine which hosts long running business process based on BPEL standard is as a sample of service engine.

JBI compliant ESBs are based on XML-web services standards and usually support several WS-I standards like WS-Addressing, WS-Security and etc. When you install NetBeans enterprise pack you are adding a wide range of capabilities to your IDE for developing composite applications which are equal to JBI service assemblies. At the same time, installing Enterprise pack will install a version of glassfish integrated with Open-ESB 2.0 that addresses all your needs.

What is BPEL role in your SOA?

I am not going to talk about technical details of BPEL; I would prefer to say what it can do. BPEL allows us to orchestrate some fine grained web services to perform a more coarse grained long lived asynchronous or short lived synchronous business operations. For example you can develop a web service that persists data based on some meta-data which are attached to your data, a web service that check validation against pre-defined rules, a service that sends email to some recipients. Now you can use BPEL and some other features that are provided by BPEL engine to perform a business operation like order saving and customer registration; so BPEL provides us with features that can highly reduce amount of fine grained web services that we develop in our entire enterprise.

What does NetBeans as a development tools?

NetBeans enterprise pack provides us with a first class designer for BPEL, WSDL and XSD. Another very good feature that is introduced in Enterprise pack 5.5.1 is CASA editor. Composite Application Service Assembly editor let developers to see a high-level view of how the Service Assembly is connected and configured. More importantly, users can modify connections between elements within the Service Assembly. The routing of Service Units and Binding Components can be easily tweaked, or completely redone as it provide visual editor enriched with a component palette for all available artifacts like binding components and service units.

Continue Reading...



NetBeans 6 M7 released. There are some cool features available and cool modules in UC.

Posted by kalali on February 22, 2007 at 02:41 AM | Permalink | Comments (1)

Netbeans 6 M7 released and some NetBeans 6 milestone 7  has released and you can download it from NetBeans web site by at least two methods
  • Traditional setup file for separate packs
  • using new NetBeans installer which allows you to customize your package before you download it.
Traditional method for downloading NetBeans 6 which is a development build is using http://www.netbeans.info/downloads/dev.php and the new installer which I am going to talk about is available at http://nbi.netbeans.org/ .
Google pack installer is somehow similar to new NetBeans installer. In one simple paragraph it allows you to customize what you need in one mega installer and then you can download your customized package to your local machine to install those components into your system.
features that new installer has and I really like them are as follow (sure you may find some there feature that I have not mentioned )

  • Download what you need by customizing the download package.
Download section.
  • From bundle that you have download you may not install all of them at the same time.
Installer first round

When you choose to install glassfish you have option to select its path, ports, and default JDK which are important options.

  • You are allowed to uninstall some of components when you do not need them by running the installer again.

Uninstalling
  • Installer register any component that you install into other components (Application server, mobility features,....).
  • Tight integration with windows add or remove programs.
  • And many other features that I do not noticed yet.
But there are some other cool changes in NetBeans IDE, look what we have as our icon set, it remind me some of Firefox themes with fantasy icons. I hope we could see some modularity mechanism for icons which will allows NetBeans fans to develop some new icon set or use older version of icon set.
new icons

Based on NetBeans 6 Feature Plan  we will have RoR and JavaScript support in NetBeans 6 M7, so this features should be inside our downloaded IDE or in update center, lets look and see what does we have in NetBeans new project and file and also in update centers.
Yes, we have JavaScript and ROR support built-in.




Lets see what else we can find in update center that is not available for 5.5.* or in NetBeans 6 M7 out of the box.
RoR  As you can see RoR support is available in update center. 
If you are one of those RoR fans you should be happy now.
Languages  Ok, there are tens of new language support based on new common scripting language support.
Support for this languages is in several levels, from syntax highlight to code completion.
you can try one that you need and if you find it useful you can vote for this future. NetBeans development team will value community inputs.
Maven support  There are some other good module which i have selected to be installed. As you can see Maven support is there too.

OK, what that really amazed me about new modules for NetBeans IDE is Jasper Report Visual designer, Its really cool to see a report designer for jasper report integrated into NetBeans.

I know that it has some basic integration but it is the initial release of this really cool module. here are some images of Jasper report designer integrated into NetBeans.


jarvis

the project home page is https://jarvis.dev.java.net/ credits goes to developer of this really required module.

NetBeans 6 release is as amazing as NetBeans 5 release was.



110x32_anim_v1.gif Locations of visitors to this page Whats Your Google PageRank?


Hibernate dynamic mapping and Dom4J enabled sessions

Posted by kalali on February 11, 2007 at 03:53 PM | Permalink | Comments (3)

Hibernate from version 3.0? provide a very useful feature for people who develop application frameworks. Indeed this feature allows you to work directly with XML documents and elements which represent entities.
Imagine that you have an application or an SDK which help users to manipulate data from different RDBMSs. Hibernate provide rich configuration facilities which help you configure  Hibernate dynamically in term of adding mapping data or other configuration artifacts that usually stores in hibernate.cfg.xml or equal properties files.

As we are planning to use Hibernate dynamic mapping and Dom4J entity mode i am going to blog about it during my evaluation.
OK, Hibernate provide 3 kinds of entity mode
  • POJO
  • DOM4J
  • MAP
Default mode sets to be POJO as it is most commonly used mode. This modes tell session how it should handle entities. We can configure a session to use any of this modes when we need that mode, but we can configure it in hibernate configuration file for by adding a property like

 <property name="default_entity_mode">dom4j</property>
To hibernate.cfg.xml . but for our sample we will create a session with dom4j entity mode. you can find a complete sample for this blog entry here . Make sure that you read readme file in project folder before you go toward executing it. For this sample I used Netbeans 6.0 M6 (which really rules) and Hibernate 3.2.1 . I wont tell steps to create project, XML file or ... but just actions and core required for hibernate side. you can see project structure in the following  image.

Hibernate dom4j session project structure

As you can see it is a basic ant based project.
Let me give you content of each file and explain about it as much as i could. First of all lets see what we have in hibernate.cfg.xml

 <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE hibernate-configuration
PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory >
        <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost/hiberDynamic</property>
        <property name="hibernate.connection.username">root</property>
        <property name="hibernate.connection.password">root</property>
        <property name="hibernate.c3p0.min_size">5</property>
        <property name="hibernate.c3p0.max_size">20</property>
        <property name="hibernate.c3p0.timeout">300</property>
        <property name="hibernate.c3p0.max_statements">50</property>
        <property name="hibernate.c3p0.idle_test_period">3000</property>
        <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
        <!--<property name="default_entity_mode">dom4j</property> -->
        <mapping resource="dynamic/Student.hbm.xml"/>
    </session-factory>
</hibernate-configuration>


The configuration file is a simple and traditional hibernate configuration file with pooling enabled and  dialect sets to MySQL ones.
We have one mapping file which is named student.hbm.xml so we include it into the configuration file. If you do not have MySQL around then use Derby which is included into NetBeans ;-) .

 Log4J configuration is another traditional one, as you see
log4j.appender.stdout=org.apache.log4j.FileAppender
log4j.appender.stdout.File=messages_dynamic.log
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
log4j.rootLogger=WARN, stdout

We used a file appender which send formatted log entry into a file named messages_dynamic.log in project root directory. next file which we are going to take a look is Student.hbm.xml  it is our mapping file, where we define the student as a dynamic entity.

 <?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class  entity-name="Student" table="Student">
        <id name="id" column="STUDENT_ID" type="long">
            <generator class="native"/>
        </id>
        <property  name="name" type= "string"  column="STUDENT_NAME"/>
        <property name="lastName" type="string" column="STUDENT_LAST_NAME" />
    </class>
</hibernate-mapping>

As you  can see there is just one change in  mapping file, we have entity-name attribute instead of class attribute. You should know that can have both class and entity-name attribute so an entity could be dynamic or mapped to a concrete class.

Next step is looking at our HibernateUtil which is known to the community for Hibernate booting and  hibernate instance management.
here is its code:
 
package persistence;
import org.hibernate.*;
import org.hibernate.cfg.*;

public class HibernateUtil {
  
    private static SessionFactory sessionFactory;
    static {
        try {
            sessionFactory = new Configuration().configure().buildSessionFactory();
       } catch (Throwable ex) {
            throw new ExceptionInInitializerError(ex);
        }
    }
   
    public static SessionFactory getSessionFactory() {
        return sessionFactory;
    }
    public static void shutdown() {
       
        getSessionFactory().close();
    }
}

Noting extra here. lets look at last part in which we try to use dom4j session to manipulate our data.


 package dynamic;
import java.util.*;
import org.hibernate.EntityMode;
import org.hibernate.Query;
import org.hibernate.Session;
import org.hibernate.Transaction;
import persistence.HibernateUtil;
import org.dom4j.*;


public class DynamicMapping {
   
    public static void main(String[] args) {
        Session session = HibernateUtil.getSessionFactory().openSession().getSession(EntityMode.DOM4J);
        Transaction tx = session.beginTransaction();
Query deleteQuery = session.createQuery("delete from Student");
deleteQuery.executeUpdate();
tx.commit();

tx = session.beginTransaction();
        //create some some student and save them
        {
            Element anStudent = DocumentHelper.createElement("Student");
            Element nameElement = DocumentHelper.createElement("name");
            nameElement.setText("Alice");
           
            Element lastNameElement = DocumentHelper.createElement("lastName");
            lastNameElement.setText("Cooper");
           
            anStudent.add(nameElement);
            anStudent.add(lastNameElement);
            session.save(anStudent);
        }
        {
            Element anStudent = DocumentHelper.createElement("Student");
            Element nameElement = DocumentHelper.createElement("name");
            nameElement.setText("Lea");
           
            Element lastNameElement = DocumentHelper.createElement("lastName");
            lastNameElement.setText("Connor");
           
            anStudent.add(nameElement);
            anStudent.add(lastNameElement);
            session.save(anStudent);
        }
       
        tx.commit();
        //List all student
        Query q = session.createQuery("from Student ");
       
        List students = q.list();
        org.dom4j.Element el = (org.dom4j.Element)students.get(0);
        System.out.println(el.getText());
        for (Iterator it = students.iterator(); it.hasNext();) {
            org.dom4j.Element student = (org.dom4j.Element)it.next();
           
           
            System.out.println("Printing an Student details: ");
           
            for ( Iterator i = student.elementIterator(); i.hasNext(); ) {
                Element element = (Element) i.next();
                System.out.println( element.getName()+":  "+ element.getText());
            }
        }
        //retrieve an student, update and save it
       
        q = session.createQuery("from Student where  name =:studentName ");
        q.setParameter("studentName", "Alice");
        Element alice = (Element) q.uniqueResult();
       
        alice.element("name").setText("No Alice any more");
        tx=session.beginTransaction();
        session.save(alice);
        tx.commit();
       
        session.close();
        HibernateUtil.shutdown();
    }
}

In the begging we create a session with dom4j entity mode. so it will return Dom4J elements as our entities. in next two blocks i have create two students one is Alice Cooper and the other is John connor  (what does this name remind you? ;-) . we simply ask our session to save them as we do for usual POJO mode. Session know what to do with dom4j elements as it is configured as a DOM4J session.
In Second block we query our table and retrieve all entities into a list, but this list is not a list of Student POJOs instead it is a list of DOM4J elements. so we need to do some XML processing when we want to extract our entity properties. you can learn more about DOM4J at Here .

Next step we retrieve a single row, edit and save it into our database, Its all simple DOM4J operation which you should use over some elements to manipulate your data.

Build file that i used contains two target that we will use during this project. first one is hbm2ddl which will create our database structure and the second one is run target which will execute our main class. it is not required to include build file here  you can download the sample and check it yourself. make sure you look at readme file before digging into execution of application.

In next few days I will try to do a simple benchmark for some simple CRUD operation to have a basic clue about DOM4J entity mode in our environment.






110x32_anim_v1.gif Locations of visitors to this page Whats Your Google PageRank?


Jonas Joins to Netbeans supported application servers

Posted by kalali on September 17, 2006 at 01:22 PM | Permalink | Comments (1)

Jonas Joins to Netbeans supported Application servers
By release of first public version of JOnbAS List of netbeans supported application servers growth to
  1. Sun java application server (Glassfish)
  2. JBoss application server
  3. Tomcat servlet container
  4. WebLogic application server
  5. JonAs application server
and im sure this is a growing list.
by my experiences , Netbeans has very good support for application server.
specially its support for Glassfish (Sun microsystem itself application server) outstanding.
with the current module you can :
  • Starting and stopping the server
  • Java and JSP debugging
  • Generating the default server specific deployment descriptors
  • Deploying, undeploying the Web, EJB and EAR modules
  • Browsing the deployed WAR, EJB and EAR modules
which is almost enough.

I think sooner or later we will see good support for Geronimo , Resin and Jetty as contributed or independed modules, and it is that time which Netbeans application server support has no reason not be the best.







Netbeans 5.5 and Jdeveloper 10.1.3.1 both sounds very good...

Posted by kalali on August 25, 2006 at 07:15 AM | Permalink | Comments (0)

Netbeans 5

Netbeans 5.5 and Jdeveloper 10.1.3.1 which one ?
Both Jdeveloper and Netbeans that i am talking about them are in beta and developer preview stage.
Netbeans as an Opensource IDE has its own fast growing user community.

Netbeans 5.5 beta 2 let features include :

  • develop and deploy on tomcat / Glassfish and Jboss out of the box.
  • As core features it has many code generation facilitis which can help to bootstrap an application ,it has code generation for CMPs , session facades ,ws client stub....
  • Having an almost first class profiler , first class J2me development pack
  • New c/c++ development pack
  • good support for SVN and CVS
  • very good Swing designer
  • developer collaboration module
  • Heavy support of SUN by giving the source codes for some of its extra pack

which Made NetBeans a good choice for developers.

One of the packs that donated by sun· is Enterprise pack , Enterprise pack features in brief are as follow :

  • UML 2 compliant modeler
  • visual BPEL
  • visual WSDL designer
  • xml visual tools for xml schema declaration ...
  • facilities to develop web service and apply security on them.
Sun announced that it will add Java Studio creator to NetBeans Stack as another package.
having Creator can attract many users to Netbeans as it provide a rich set of feature for web application developers.

but what about Oracle JDeveloper 10.1.3.1?
some times ago Oracle announced that it will let developers to use JBeveloper for free . so Jdeveloper and Netbeans from one point of view are the same ,You will not pay any penny for them.
Oracle really boosts JDeveloper in recent years which made JDeveloper a choice for j2ee application developers
JDeveloper Editor has changed to a very powerful editor with a good refactoring support.
opposite to Netbeans which you need to download several package to gain most of its feature you will not need to download any extra package to make use of jdeveloper as it is appropriated.
·
  • Oracle have much more code generation falsities that Netbeans .
  • visual ESB modeling allows you to assemble you ESB component visually (its ESB is not JBI compliant)
  • visual WSDL designer
  • visual xml development tools
  • good swing designer and data binding using oracle ADF
  • good JSF / Struts support , indeed Jdeveloper JSF support with its ADF faces is brilliant.
  • WYSIWYG for HTML and jsp pages with support of third party jsf libraries like Myfaces.
  • first class database development facilities ( for oracle database mostly).
  • Only you can use oracle server suite as development server there is no support for other application servers.
  • No support for c/c++ development (AFAIK).
  • built-in profiler
  • very powerful web page generation which can bootstrap a data driven web page design.
  • UML modeler (1.4 compliant)
  • very rich set of facilities for Web service development
  • ...

I think JDeveloper (for now) is ahead of NetBeans as it provide much more facilities for developers , but for later version we can not tell anything because NetBeans people are unpredictable , as they prove their credibility by release of NetBeans 5.

What you have read is my opinion which might be biased. we never can say that one IDE is 100% better than another , it is just context oriented and the users view point. but one thing is completely obvious that JDeveloper and NetBeans both are going to provide rich facilities for SOA. NetBeans by means of· Enterprise pack and using glassfish with integrated BPMS from intalio and· what it has acquired from seebyond.
and oracle with its SOA suite and JDeveloper , both are going to make choice harder for developers.







Develop web application with netbeans ,seam and Glassfish

Posted by kalali on August 15, 2006 at 05:05 AM | Permalink | Comments (1)

Register New User register.jsp

In this two part series I will try to show you how easily you can  build applications using NetBeans 5.5 based on  seam , facelets , jsf and new EJB 3 standard.

I will not discuss any of framework in details as you can find detailed information about each of them in their homepage and some other articles.
I want just show , How you can use NetBeans with some leading frameworks to build your web based applications. I will not discuss NetBeans specific tasks in details .
I will more focus on leveraging this stuff together using NetBeans IDE.

What you will need to follow  this series :

  • NetBeans enterprise edition 5.5 , you will need Glassfish or JBoss to continue with this series. check and make sure that your NetBeans has application server bundled otherwise get a copy of glassfish from its website.
  • seam 1.0.1 GA  or newer.

seam distribution contain Facelets too , but i strongly suggest you get Facelets distribution separately and take a look at its samples and very good documentation. indeed both Facelets and seam has very good documentation.

In this entry I will introduce each of this frameworks in very brief  to make the series stand alone , and i will show you how to setup the development environment and we will go with first part which is developing seam layer codes.

JBoss seam is created to leverage maximum possible feature of Java EE 5 standards like JSF and EJB3.
seam , seamlessly integrate EJB3 as a backend with JSF as presentation , meanwhile provide management of long running process
by using JBPM . and give you ability to focus on your business logic rather than silly data providing stuff. By leveraging Facelets helps you to do even more with seam and JSF.

To name its features I can say:

  • Lesser XML, More Annotation. (please do not blame me for naming annotation and XML in one line :-))
  • it let you go with your business logic rather thinking and resolving some common issue like user conversation state.
  • seam has a more flexible context model , it has 8 context , by means of this context you can manage your application more effective. for example a business process live in business process context .
  • Accessing each component in entire seam context with one unique name.
  • Managing workplaces and conversations .
  • It easily will let you develop Portlet by providing a Portlet context . we will discuss this item in latter parts

With many more features.

But about JSF , JSF is  a web framework , it is  Standard and  Developed under JSR 127.
Some of JSF features are as follow:

  •  User interface framework
  •  Server-side UI components
  •  Event model , something like desktop applications event model , but very reduced.
  •  Component state
  •  Renderers , Render Kits , for example ADF faces has a telnet render which make it possible to render a ADF faces application for a  telnet client.
  •  Validation
  •  Type conversion
  •  Internationalization

about Facelets , we will discuss more in next articles , but for now you should know that Facelets bring some view related enhancement and features to JSF community .
To name some of features :

  • Facelets make it possible to develop your entire web pages using your favorite page designer like Dream weaver or Microsoft FrontPage. to achieve this feature it introduce a new attribute, jsfc ,that make it possible to change each html element  to a JSF equal component. it is similar to Tapestry 's jwcid attribute. So you can use all binding and event handling stuff of JSF and availability and ease of use of html WYSIWYG.
  • Facelets provide a template-ing  features like Velocity's for JSF . it allows you to test JSF views out of container.
  • Some decoration features like what tile bring to struts community and SiteMesh ,generally, to all java based web application.

lets start the job of creating simplest sample ;) .

I assume that you download seam and extract it in seam_home Also your NetBeans 5.5 is running and an application server capable of  containing ejb3 (Glassfish) is configured with your IDE.

for sake of simplicity we make one   Library in our NetBeans IDE to make our job easier. as you know each library could contain some jar files, etc...
 

Create a library name it seam and add the following jar files to it , the first
seam_home\jboss-seam.jar
seam_home\jboss-seam-ui.jar
seam_home\hibernate-all.jar
seam_home\thirdparty-all.jar

add seam library  to Registeration-EJBModule and Registeration-WebModule

Switch to runtime view (CTRL+5).Extend database node  , if you have no database created in your embedded derby  then create a database and create a table with following  characteristics
Table Name: users
Fields :

username varcahr(255) , primary key
password varchar(255) , not null
name varcahr(255) , not null

after you create this table , create a new enterprise application project by going to , file>new project>enterprise application
name it Registeration. make sure that you have selected the Java EE 5 as j2ee version.

go to project view (CTRL+1) And select Registeration-ejbModule , right click on it and select CMP entity bean from database...
Now you should be able to select the JDBC connection that you have made in above step and give it a package name.
click next and select users table from left column and add it to right column.
click finish.
That's it , you have your CMP ready to go.

  • what we need to add to the CMP bean class in addition to its created structure
  • another constructor with all the CMP  fields.
  • some annotation for getters , to help us in validation

final shape of users CMP will be like :


package cmps;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;

import org.hibernate.validator.Length;
import org.hibernate.validator.NotNull;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Scope;
/**
 *
 * @author Masoud Kalali
 */
@Entity
@Name("user")
@Scope(org.jboss.seam.ScopeType.SESSION)
@Table(name="users")
public class Users implements Serializable{
   private static final long serialVersionUID = 1881413500711441951L;
    private String username;

    private String password;

    private String name;
    
    /** Creates a new instance of Users */
    public Users() {
    }

    
    public  Users(String name, String password, String username)
 {
this.name = name;
this.password = password;
this.username = username;
}
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    @Column(name = "username", nullable = false)
     @Length(min=5, max=15) 
    public String getUsername() {
        return this.username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    @Column(name = "password", nullable = false)
     @Length(min=5, max=15) 
    public String getPassword() {
        return this.password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    @Column(name = "name", nullable = false)
     @Length(min=5, max=15) 
    public String getName() {
        return this.name;
    }

    public void setName(String name) {
        this.name = name;
    }
    
}

we are finished with our POJO EJB :-) , now lets go and handle web layer stuff , from now we are working with seam view layer and JSF , I will talk about Facelets later in other articles of this series.

as I said in sample scenario we have just one action , so we can use a  managed bean or plain java object or whatever that is useable here as action listener or use a stateless session bean (using session bean is what JBoss offer) so we will use a stateless session bean to implement our action listener , it will also helps you to see how an stateless session bean is implemented in java EE 5.
so create a session bean by using , file > new > session bean , now you can select session bean type to be stateless , and change the package name to be sbeans
click finish  , editor will open up and show you the stateless seasion bean class.   
change the class body , in a way that final class looks like :

import cmps.Users;
import java.util.List;

import javax.ejb.Stateless;
import javax.faces.application.FacesMessage;
import javax.faces.context.FacesContext;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.hibernate.validator.Valid;
import org.jboss.seam.annotations.Factory;


import org.jboss.seam.annotations.IfInvalid;
import org.jboss.seam.annotations.In;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.annotations.Outcome;
import org.jboss.seam.annotations.datamodel.DataModel;
import org.jboss.seam.core.FacesMessages;
import org.jboss.seam.ejb.SeamInterceptor;

@Stateless
@Name("")
public class ActionBean implements sbeans.ActionLocal
{
   
   @IfInvalid(outcome=Outcome.REDISPLAY)
   public String ()
   {
      List existing = em.createQuery("select username from User where username=:username")
         .setParameter("username", user.getUsername())
         .getResultList();
      if (existing.size()==0)
      {
         em.persist(user);
         return "success";
      }
      else
      {
         FacesMessages.instance().add("User #{user.username} already exists");
         return "success";
      }
   }

}

we will need to add same method signature to our session bean local interface , so add the method signature to ActionLocal class. it will looks like :
package sbeans;


/**
 * This is the business interface for Action enterprise bean.
 */
public interface ActionLocal {
      public String ();
}
now we are finished with the action , you may ask what are those annotation stuff in the session bean , so I should ask you to take a look at seam reference or wait until next part of this series. I should say that it is a very same version of seam sample that is implemented again in NetBeans IDE.
we are finished with EJBModule for now , lets take a look at what we will have in web module. first of all you need to add JSF framework to web module to do this , right click on web module and select properties , go to frameworks node and add JSF framework to the project. In web module we just have 2 JSF pages , one to , one to show the that s/he ed . Create following JSF files ,
register.jsp same as seam sample register.jsp , used for registering purpose
registered.jsp same as seam sample registered.jsp , used for showing the user that he/she is ed

we need to add some navigation case to our faces-config.xml , so extend web module note and under configuration files open the faces-config.xml we should add 4 navigation case to it , so right click inside the editor ,which show content of faces-config.xml, and select add navigation rule. a dialog will open , just fill the dialog as following table show
Rule From View /register.jsp

Now right click in the editor and add 4 new navigation case , these cases will handle navigating from one view to another.

From View From Outcome To view
/register.jsp success registered.jsp

lets code with the register.jsp , open the register.jsp in your NetBeans editor change the content to :

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib prefix="s" uri="http://jboss.com/products/seam/taglib"%>
<html>
<head>
<title> New User</title>
</head>
<body>
<f:view>
<h:form>
<table border="0">
              <s:validateAll>
<tr>
<td>Username</td>
<td><h:inputText id="username" value="#{user.username}" required="true" /></td>
<td>      <h:message for="username"/>       </td>
</tr>
<tr>
<td>Real Name</td>
<td><h:inputText  id="name" value="#{user.name}" required="true" /></td>
<td>      <h:message for="name"/>       </td>
</tr>
<tr>
<td>Password</td>
<td><h:inputSecret id="password" value="#{user.password}"  required="true" /></td>
<td>      <h:message for="password"/>       </td>
</tr>
          </s:validateAll>
</table>
<h:messages globalOnly="true"/>
<h:commandButton type="submit" value="" action="#{.}"/>
</h:form>
</f:view>
</body>
</html>


No we need to create the registered.jsp which show that our user is registered. open the file in your editor and change its content to looks like :

<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<html>
<head>
<title>Successfully ed New User</title>
</head>
<body>
<f:view>
Welcome, <h:outputText value="#{user.name}"/>,
you are successfully ed as <h:outputText value="#{user.username}"/>.
</f:view>
</body>
</html>

Now we are almost finished with JSf files , there are some changes that we should make in web.xml and faces-config.xml.first open web.xml and add the following lines to it.make sure the you add them directly inside <web-app> node.

 <context-param>
		<description>
		</description>
		<param-name>org.jboss.seam.core.init.jndiPattern</param-name>
		<param-value>java:comp/env/registration/#{ejbName}/local</param-value>
</context-param>

<listener>
	<listener-class>org.jboss.seam.servlet.SeamListener</listener-class>
</listener>

<ejb-local-ref>
	<ejb-ref-name>registration/RegisterActionBean/local</ejb-ref-name>
	<ejb-ref-type>Session</ejb-ref-type>
	<local>sbeans.RegisterActionLocal</local>
<	ejb-link>RegisterActionBean</ejb-link>
</ejb-local-ref>

Now open faces-config.xml and add the following lines to it.
<lifecycle> <phase-listener>org.jboss.seam.jsf.SeamPhaseListener</phase-listener> </lifecycle>

That's it , you are finished creating your first seam sample in netbeans , lets execute the application and see the result. press f6 and wait until your browser opens , navigate to http://localhost:8080/Registration-WebModule/faces/register.jsp enter some information and then press register button.

You can check whether it applied or not by switching to runtime view and checking your Users table data . you can find complete explanation of jsp/java codes in Seam tutorial chapter 1 at : http://docs.jboss.com/seam/1.0.0.GA/reference/en/html/tutorial.html





Locations of visitors to this page Whats Your Google PageRank?


Step by Step toward a jms sample in NetBeans and yes GlassFish. part 2 : Remote Client

Posted by kalali on May 10, 2006 at 06:01 AM | Permalink | Comments (0)

In previous part you saw that how easy is to make an MDB to consume messages and a jsp/Servlet Front End to send message to a queue.
in this part i will show you how you can send message to a queue from a remote j2se client. you should know that in jms sending and reciving mesages has similar steps , some small changes require to consume message from a j2se client instead of sending messages.
to make it more clear , the main purpose of an MDB is to consume messages as they arrive , The MDB onMessage(..) is called whenever a message become available in destination that MDB is binded to it.

sure we can do what ever we want after message recieved. for example you can send the message that you recive from a queue to several topics , you can process it to do some database operation.... usually we use JMS for executing Asynchronous operations ,bringing more decoupling of a system components....

but lets come to our own steps to create a simple remote client that will sends some messages to tQueue that we made in first part of this series. then we will see that our messages are reciveing by TMDB. As you know we used a context object to locate the Queue and ConnectionFactory . the servlet code was like:
...
  Context ctx = new InitialContext();
...
By default a JNDI client assume that it is in a correctly configured environment , so when we do not pass a HatshTable to IinitialContext , the InitialContextFactory will return a context configured with that environment .In server environment we do not need to explicity pass parameters to InitialContext unless we need to initiate a context for another environment.
But, what are this parameters and how we can use them to initiate a context for none default environemtn or in places that there is no default environemt pre-configured , situation like standalone remote clients?
in a such situation we should configure the InitialContext using a HashTable that contain some parameters, There are several parameter that can be used to configure the initialContext but Two most important ones are :
  • provider url , for glassfish in iiop format it is : iiop://127.0.0.1:3700
  • We can use a key like Context.PROVIDER_URL to put its value into hashtable , also we may use java.naming.provider.url String to put value of this parameter into HashTable . this parameter is vendor dependent.
  • initial context factory , for glassfish it is : com.sun.appserv.naming.S1ASCtxFactory
  • This is another important parameter that we must set before we can access a JNDI Tree , indeed it is totaly vendor dependent because each vendor has its own implementation for its JNDI access. This factory will create the context object along with the url that you put into the hashtable. we may use Context.INITIAL_CONTEXT_FACTORY or "java.naming.factory.initial" string as a key to put this value into the hashtable
As i said there are some other parameters that you can set , like security parameters for authentication and .... but those are not necessary.
I should tell that we can also make this parameter to be the jvm default parameter and allows the Initialcontext to return a context without need to pass any arguments. in this way we need to pass parameters to java command when we want to start it. for example you can use :
java -Djava.naming.provider.url="iiop://127.0.0.1:3700" -Djava.naming.factory.initial="com.sun.appserv.naming.S1ASCtxFactory" to start our application. this way you allows the Initialcontext to return a context without need to configure it by a HashTable. For our Sample we will use a hashtable to configure the InitialContext , but you can try to pass parameters to java instead and observ the execution of your application.
To create a j2se remote client we need to add some jar files to our project , NetBeans provide its own way to manage jar files that may be used in more than one project. it is Libraries....
Run NetBeans, From Tools menu select Library Manager , create a new library and name it jms . Now you can add as much jar files to this library as you need , then it will be reuseable for your other projects.
add following jar files to this library , I use glassfish_home as installation directory of glassfish.
  • glassfish_home/lib/appserv-rt.jar
  • glassfish_home/lib/javaee.jar
  • glassfish_home/lib/install/applications/jmsra/jmsra.jar
  • glassfish_home/lib/install/applications/jmsra/imqbroker.jar
  • glassfish_home/imq/lib/imq.jar
  • glassfish_home/lib/appserv-admin.jar
  • glassfish_home/imq/lib/jms.jar

Create a j2se project using , File > new project > general > java application. name the application jmsClient and allow the IDE to create a Main class for you.
You shoud add that library that you create to this project. to do this , expand the project node , right click on the libraries and select add library Now from the library list select jms .
Up to now you have done 30% of creating an stand alone remote client to interact with your jms resources like connectionFactories and destinations.
Now we need to code the main method of main class . expand the jmsClient node , expand the source packages and finally open the main class of your project.
The overall look of your code shoul be like the following :
public class JmsClient {
    Context ctx;
    public JmsClient() {
        Hashtable properties = new Hashtable(2);
        properties.put(Context.PROVIDER_URL,"iiop://127.0.0.1:3700");
        properties.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.appserv.naming.S1ASCtxFactory");
        try {
            ctx = new InitialContext(properties);
        } catch (NamingException ex) {
            ex.printStackTrace();
        }
    }
   public Object lookup(String name){
        try {
            return ctx.lookup(name);
        } catch (NamingException ex) {
            ex.printStackTrace();
        }
        return null;
    }

    public static void main(String[] args) {
        JmsClient client = new JmsClient();
        try{
            ConnectionFactory     connectionFactory = (ConnectionFactory)client.lookup("jms/tConnectionFactory");
            Queue     queue = (Queue)client.lookup("jms/tQueue");
            javax.jms.Connection  connection = connectionFactory.createConnection();
            javax.jms.Session        session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
            MessageProducer messageProducer = session.createProducer(queue);
            for(int i=0;i<5;i++) {
                TextMessage message = session.createTextMessage("It is a message from main class "+  ": "+ i);
                System.out.println( "It come from main class:"+ message.getText());
                messageProducer.send(message);
            }
        } catch(Exception ex){
            ex.printStackTrace();
        }
    }
}
Now lets see what the above code means , i will not go indepth because JMS APIs are discussed too much :-) .
In constructor we configured a context object named ctx
we encapsulate the lookpu task in a method named lookup(...) we usually use a service locator or cached service locator to locate our objects in JNDI because JNDI lokups are time consumer
In main method:
  • we create a ConnectionFactory by looking it up in the jndi by using our context and dummy lookup(...) method.
  • we create a Queue by looking it up in the jndi by using our context and dummy lookup(...) method.
  • Then we create a connection using that ConnectionFactory
  • we obtain a Session (jms Session) using our connection
  • we made the messageproducer which is our tools to send message to that Queue ,
  • in a loop we create and sent 5 text message to the queue.

Now lets run the program and see the result , to run the application you nedd to complete the first part of this series , then you should run the application server , and if you like to have a demonestration like what i will show you , you should deploy the application that we made in first part.
i assume you have completed first part and you have the application server running , Now run the client that we made and what you will see in output window should be like :



and if you take a look at application server log file (in runtime tab , expand the servers node and rigt click on the glassfish instance , now select view server log..) what you should see in the server log should be something like :



messages that we send via standalone client will reach the queue that the MDB is listening on it , as soon as we send a message MDB will pick it up and start processing it.
you can download the standalone client project from here




Step by Step toward a jms sample in NetBeans and yes GlassFish

Posted by kalali on May 05, 2006 at 06:40 AM | Permalink | Comments (4)

Java EE 5 brings many ease of use in EJB development world and certainly it is one of biggest step ahead in java EE land.
NetBeans 5.5 is another big step toward making development on top Java EE some easier. NetBeans is a very easy to learn and use because it does not bring many stuff on the screen to "Occupy all the space" instead it provide maximum useability by means of limited number of views.
GlassFish as Reference implementation of JAVA EE 5 , provide you with all service that are named in java EE spec but it is not similar to older RI version of J2EE ,just remember J2EE 1.3 RI
it is much more better in term of functionality, performance, ease of use and ...
here I will tell you steps that you need to follow to build a simple MDB , a web based message producer and a remote message producer.

when you follow this entry you will be able to deal with basic aspect of JMS in Action and not only on your papers. but what do we need to have our JMS application running ?
  • A JMS implementation that is configured with our server , it can be done using embedded servers that are shipped with application servers or using remote / local MQ servers.
    GlassFish uses Sun message Queue , which is going to be available under the same license that GlassFish is provided. You can find more information about open source version at : http://mq.dev.java.net
  • You also need to setup a Queue and a connection factory in your application server.*
  • you should Create an MDB , and then implement the onMessage() method in way that you like.
*I should tell you that you can create your Queue and connection factory in many ways , yes more than two ways .
  • use GlassFish server web based administration console
  • use GlassFish command line console
  • using NetBeans 5.5 , yes NetBeans provide you some wizard thingy to make JMS / JDBC resources from withing NetBeans and then registering them to Application server.
I assume you know NetBeans and you registered GlassFish as an application server in NetBeans server manager
To create Queue and connection follow these steps :
  • Run The IDE and go to runtime tab , expand server node and start the GlassFish instance.
  • right click on GlassFish node and select view admin console
  • login to admin console ,In left side navigation panel , expand the resources and expand JMS resources
  • click on connection factories and from main frame click on new button , fill in the values as following ones
    • JNDI Name: jms/tConnectionFactory
    • Type: javax.jmsConnectionFactory **
    • Description: some description here
    • give it a name like : tConnectionFactory
    • Click OK button
    ** in JMS 1.1 we can use same factory for both publish/subscribe and point-to-point messaging
  • now we need to create a queue to be our messages destination, click on destination resources from main frame click on new and fill in the values as following ones
    • JNDI Name: jms/tQueue
    • Type: javax.JMS.Queue
    • Description: some description here
    • give it a name like : tQueue
    • Click Save button
Now we have our JMS Configuration ready to serve some MDB and remote client. Create a new enterprise application with two kind of modules , one EJB module and one web module , name it whatever you want but I named this sample jms
go to project view , right click on EJB module and select NewMessage-Driven Bean...
a window will open and ask you for some attributes of this MDB fill in the names like :
  • EJB Name : TMDB
  • package : mdbs
  • Mapped Name : jms/tQueue***
click finish and you are done , your MDB skeleton is ready and you just need to implement the onMessage(...) method.
*** This is where our MDB is assigned to , whether it is a topic in publish/subscribe scenario or a queue in point-to-point scenario.
Now change the implementation of your onMessage(...) as following , we also add one private object to our class , make sure that you include it too.
  @Resource
    private MessageDrivenContext mdc;
    public void onMessage(Message message) {
     
        TextMessage msg = null;
        try {
            if (message instanceof TextMessage) {
                msg = (TextMessage) message;
System.out.println("A Message received in TMDB: " +
                        msg.getText());
            } else {
               System.out.println("Message of wrong type: " +
                        message.getClass().getName());
                
            }
        } catch (JMSException e) {
            e.printStackTrace();
            mdc.setRollbackOnly();
        } catch (Throwable te) {
            te.printStackTrace();
        }
    }

we just made one more change in class skeleton and that is our MessageDrivenContext variable , we usually use this to call setRollbackOnly(...) when we use an MDB in a transactional scenario for this sample you simpley can ignore it.
Now lets make our web application to send some messages to that Queue and let the MDB fetch and process them.
wxpand web application node , and double click on index.jsp after it opens , change its content like the following , sure you can use component platte to drag and drop items to jsp source file :-)

<%@page contentType="text/html"%>

<%@page pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>

        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>

    </head>
    <body>
<center>        
<form action="sendMessage">
            <table  cellspacing="20" >

                <tbody>
                    <tr>
                        <td>Enter some message: </td>
                        <td><input type="text" name="message" value="Enter your message here" width="30" /></td>

                    </tr>
                </tbody>
            </table>
            
                <input type="submit" value="Send The message" name="send" />

            </center>
        </form>
    </body>
</html>



Now we need to build a servlet , which will send messages to our Queue , for this task you need to do these steps :
  1. Right click on web application node and select New > Servlet...
  2. change its Name to sendMessage give it a package name and click finish
  3. change the processRequest(..) method body as following list
 protected void processRequest(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        //start the jms stuff

        try{
            Context ctx = new InitialContext();
            ConnectionFactory     connectionFactory = (ConnectionFactory)ctx.lookup("jms/tConnectionFactory");
            Queue     queue = (Queue)ctx.lookup("jms/tQueue");
            javax.jms.Connection  connection = connectionFactory.createConnection();
            javax.jms.Session        session = connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
            MessageProducer messageProducer = session.createProducer(queue);
            TextMessage message = session.createTextMessage();
            message.setText(request.getParameter("message"));
            System.out.println( "It come from Servlet:"+ message.getText());
            messageProducer.send(message);

//message sent , it was all
            
            //show what we have done in this servlet
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Servlet sendMessage</title>");
            out.println("</head>");
            out.println("<body>");
            out.println("<center>");
            out.print("Servlet Send this message <h2>"+request.getParameter("message") + "</h2>  to this Queue : <h2>"+queue.getQueueName()+"</h2>");
            out.println("</center>");
            out.println("</body>");
            out.println("</html>");
            
        } catch(Exception ex){
            ex.printStackTrace();
        }
        
        out.close();
    }


It was all you should do to create a JMS point to point sample.
to view what you have Done , press F6 , if you did all the above as i said you will see a page like :



Now just give it a message and press the button , what you will see should looks like the following image , in case that your praise the NetBeans and GlassFish as i did ;-)



and if you look at Application server log file , you will see something similar to : (to view the application server log file go to runtime view , right click on glassfish node and select view log file)



You can download the project from here but make sure that you build the connection factory and queue because project will need them .
In next part i will show you how easily you can make a remote client to deal with your jms destinations.



A New Module for Netbeans IDE , an statistical CVS Reporter...

Posted by kalali on March 07, 2006 at 01:01 PM | Permalink | Comments (4)

2 weeks ago I was looking at www.sourceforge.Net for a utility that allows me to get some statistical information from CVS repositories. There are some commercial products that do this job in a very perfect manner , but those are commercial and feature over loaded.after some search I find VCS Report , I get the package and get some chart from my CVS repositories.
Some days ago I get the source code of the project and looked at the source ,Amazing , it uses a NetBeans library to connect to CVS servers , but there is no NetBeans plugin available in the download section , so I start and create a plugin for NetBeans , although it is in very early step and throw some exceptions some times but it works fine with NetBeans . I will put it in my UC in next few days after i make sure that i change it to comply with NetBeans in some acceptable degrees.
so far I create a TopComponent that contain the reporting stuff ,you can View image .
Now Configuration system (saving and loading your previous settings) and CVS setup dialog are ordinary swing dialogs instead of NetBeans specific dialogs, indeed these are exact clone of original VCS Report dialogs.
CVS setup dialog is like :

Password request dialog for CVS is like :

Current Feature of plugin Comply with VCS Report features , and sure the plugin will contain all features that VCSreport implements in future as soon as possible.
  1. Customizable filters
  2. History table
  3. Statistical charts
  4. HTML reports
  5. CSV (Comma delimited) reports
For next steps(before I make this plugin public) I thought to add at least half of the following features and enhancements.
  1. Both panels which are lied in north section should be converted into a wizard , so you start a wizard and it helps you to prepare a report step by step
  2. CVS setup dialog should be converted to NetBeans Standard CVS setup dialog
  3. It should be able to read CVS profiles that you have made in your NetBeans IDE. Like some other articles , blog posts ,... That contain an integration issue this plugin need more integration ;-)
  4. Configuration files should be NetBeans standard configuration
  5. Tasks , should be converted to NetBeans standard Tasks
  6. Nor original software nor this plugin contain a progress bar , I think it should have some indicator that tell it is processing , even for very small portion of time
  7. Change i18n to comply with NetBeans i18n standards
I have some long term feature list which are depended on 3rd party softwares (at least I think that they depend on 3rd party softwares like NetBeans and VCS Report )
  1. SVN (Subversion) support
  2. CVS SSH support
  3. More statistical charts
  4. XML reports
  5. Also I thought about using JFree Chart instead of Charts that created by the software author , Jfree Chart has much more advanced charting engine and it gives user more feature to build better software , but it will make the module bigger in download size

i made this post because i am looking for some comments from developers who have knowledge about CVS internal mechanism. so if any one from the community have any suggestion , then let me know. I will add it to my ToDo list for future releases , and sure try to use your advice / comments , i will be more happy if my first release has more useability.


A Simple Netbeans Module , a Gmail Checker...

Posted by kalali on March 04, 2006 at 01:15 PM | Permalink | Comments (0)

Some times ago I participate in NetCat 50 - a process for NetBeans IDE version 5 QA -During NetCat I find that NetBeans RCP is something that I can Pick for later Swing based clients.

I start learning NetBeans RCP platform during NetCat 50 , and to evaluate my learnings I write a simple Module for NetBeans IDE .

The module is a GMail Checker , Module make it possible for you to see your new emails within your IDE and allows you to rotate between subjects.

I write Down a Tutorial on building NetBeans Module and as a Case study I showed how user can build GMail checker him/herself.

To build that module I used another Open Source project , http://g4j.SourceForge.Net, which is Java library to access GMail service.

After installing the module you will see a new toolbar in your IDE , the toolbar will be like following image :



by clicking on toolbar , it will start connection to Gmail. a NetBeans Standard progress bar will show the the progress in IDE bottom line



a NetBeans Standard progress bar will show the the progress in IDE bottom line



after it fetch information from GMail it will show you a something like



which tell you how much new email you have , and how much space of your GMail is occupied Now you can allow GMail Checker to rotate between subjects or do it yourself using provided buttons



You can configure the GMail checker Options trough Its configuration panel which is an standard NetBeans configuration panel.

Configuration panel is something like the following image. Gmail Checker Option Dialog

I set up an update center for my further NetBeans module , right now , you can check this UC and get your GMail Checker from there.
http://www.Solarisict.com/updates.xml
If you prefer to install the module from your local drive then , you can download all in one archive which contains all required modules for GMail checker.

you can get the source code for GMail checker from NetBeans web site , this archive contain all source code , sound files and images that I used to build this module the link to get the zip archive is here

To add a new update center to NetBeans IDE and many other NetBeans Tips and tricks take a look at Geertjan Weblog and for more NetBeans related information look at another big blog , Roumen Weblog

Locations of visitors to this page




Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds