Sunday, August 22, 2010

JSF portlet application directory structure and required JAR files

You can see directory structure of basic JSF portlet application in picture below,
















In this diagram, you can see ‘src’ folder which contains all the source code and WebContent folder which contains the web pages and WEB-INF directory. In WEB-INF directory, we do have three required files these are,

1) faces-config.xml file
2) portlet.xml file
3) web.xml file

and we do have four required JAR files. These are,

1) icu4j_3_4_1.jar
2) jsf-ibm.jar
3) jsf-impl-messages.jar
4) jsf-portletbridge.jar

JSF portlet development using RAD 7.0

IBM RAD 7.0 provides integrated feature for developing JSF based portlets.
Through RAD, you can develop basic JSF portlet.
Let’s see, how can we develop JSF portlet using RAD 7.0? First you need to open the RAD 7.0 and come into File>New>Project option. You can see the picture below.

 While creating new project, please select portlet project option and press Next button.
 You will get ‘New Portlet Project’ wizard where you need to mention project name, portal server version, portlet API and portlet type. Press Next once you fill all the required information.

 Now you need to add portlet modes and press finish button and you will get a basic JSF portlet application with required JAR file and configuration files.


Wednesday, July 7, 2010

How portlet modes work in portal environment?

I have one JSR-168 based portlet in which I am using all kinds of modes. These are,

1) View Mode
2) Edit Mode
3) Help Mode
4) Edit-Default Mode
5) Config Mode

Now, I have one question in my mind. What is the use of these modes? If we take an example of any web-based application which is deployed on web container and this application does not have any kind of mode. Here I am going to describe a brief description of portlet modes which are helpful to understand the benefits of portlet application over web-based J2EE application.

View Mode -
This is the landing page of the portlet.

Edit Mode -
This is the different page of the portlet for storing personalized settings. These settings allowed for a particular instance of the portlet for particular portal user. If we make another instance of portlet in another page, personalized variable is not allowed to accessible.

Edit - Default Mode -
This is also different page of the portlet. We are using this mode for storing the configuration parameters of the portlet which are accessible for all portal users for the same portlet instances. For Example. An admin stores some parameters in edit-default mode of portlet and check the availability of these parameters in other portal users. These parameters are available for all portal users for a particular instance of the portlet suppose you add same portlet in different page, you will not allowed to see stored parameters for different instances of portlet.

Config Mode -
This is also different page of the portlet. We are using this mode for storing the configuration parameters of portlets which is accessible for all portal users for all portlet instances.

Now we have a big picture, how these modes are working in portal environment? We have tested this procedure for IBM Web Sphere portal server 6.0 using RAD 7.0 and JSR 168 specification.