Search This Blog

Tuesday, January 27, 2009

ProcessAction Method

ProcessAction() Method

The JSR-168 Specification defines a portlet container that manages portlets.Each portlet’s life cycle contain some specific methods as per JSR-168 namely init(),ProcessAction(),destroy() method etc. . The portlet developer can implement these methods to provide the desired functionality.Among all the life-cycle methods of a portlet one of the most important method is the ProcessAction() method.This ProcessAction() method is Called after the user submits changes to a jsr-168 compliant portlet. It is Intended to process input from a user Interaction.The user must interact with the portlet giving some or the other kind of data to it which must be processed by a portlet.This way we can say that the portlet processing is done in the ProcessAction() method.Even if one tries to maximize the size of the portlet window it calls the ProcessAction() method.

public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException
{
}

The processAction() method is called only by the ActionURL. The other URL i.e RenderURL doesnt invoke the processAction() method.When the form submit button is pressed, the action url is used. The action url indicates to the portal that it is an action request. Responding to the action request, the portal invokes the processAction() method before invoking the render() method.

The request values are obtained from the actionURL in the following way

public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException
{
// get the values submitted with the form

String identity = request.getParameter("parameter1");
String color = request.getParameter("parameter2");

......
}

the way we set the render parameters for the render() method is

public void processAction(ActionRequest request, ActionResponse response)
throws PortletException, IOException
{

......

response.setRenderParameter("parameter1", value1);
response.setRenderParameter("parameter2", value2);
}

Thursday, January 22, 2009

List of some of the most Popular Portal Servers

List of Popular Portal servers
• Liferay - Liferay deploy portlets that adhere to the Portlet API (JSR 168).Its one of the most popular and most talked upon potal server in the recent market. It has lots of portlets bundled with the portal (Mail,Workflow, Document Library, Calendar, Message Boards,Wiki, to name a few) and can be used to develop for adding your own custom portlets.The Ext environment in the portal server is used for extending the portal towith custom generated portlets and make it compatible with newer additions of incremental development.

• Exo - The eXo platform is a one of the major Open Source - JSR 168 compliant - enterprise portal built from various modules.It provides virtualization of the work space through an advanced WebOS interface.

• Pluto - Reference Implementation of the JSR168.It now supports JSR286 also. Apache Pluto is a subproject of the Apache Portals Project.

• JA-SIG uPortal - uPortal is a free, sharable portal under development by institutions of higher-education. Community tools, such as chat, forums, survey, and so on, build relationships among campus constituencies. uPortal is an open-standard effort using Java, XML, JSP and J2EE.

• ByLine - Byline is an open source (LGPL) content management, portal, and collaboration system built on top of a sophisticated web development framework. Byline includes content authoring, versioning, workflow, categorization, and lifecycle management capabilities. Byline has been used to build sophisticated content and document management systems for customers such as the APLAWS consortium, FranceTV (www.france2.fr), Deutsche Post, the United Nations, and many others. Byline has been used to power systems that have over 400GB of data, thousands of content contributors, and tens of thousands of content visitors.

• Jakarta Jetspeed 2 Enterprise Portal - Jetspeed-2 is the next-generation enterprise portal at Apache. Jetspeed-2 offers several architectural enhancements and improvements over Jetspeed 1.0. First, Jetspeed-2 is conformant to the Java Portlet Standard and provides a standard mechanism for the deployment of portlets. Second, Jetspeed-2 has matured to a more scalable architecture featuring multi-threaded functionality. Third, Jetspeed-2 is decoupled from several legacy open source projects. Fourth, Jetspeed-2 is based on a component architecture.

• JBoss Portal - JBoss Enterprise Portal Platform provides an integrated open source platform for hosting and serving a portal's web interface, aggregating, publishing, and managing its content, and personalizing its experience.

• Websynergy-project WebSynergy SB 2 is the next-generation web aggregation and presentation platform from SunTM Microsystems. This platform includes developer tools and an enterprise-grade presentation runtime based on Liferay Portal Server, GlassFishTM version 3, and MySQLTM software.

• Portals in Cocoon - The portal framework is a portal server that runs inside Cocoon - or to be more precise inside the Cocoon servlet. It contains a portlet container that is called coplet container. Coplet stands for Cocoon Portlet and is the Cocoon equivalent to portlet.Due to the highly extensible nature of Cocoon, the portal is configurable and extensible as well and provides many hooks and switches to easily adapt the portal for specific needs. As the portal is integrated in Cocoon it has the advantage that all features of Cocoon can easily be used. Cocoon is very strong in fetching data from various source and delivering it in the various output formats requested by different clients (like HTML, WML, PDF etc.).

Wednesday, January 21, 2009

JSR 168 Portlet Specifications

Agenda

What are JSR and JCP?
• What is a Portlet as per JSR 168?
• JSR168 Specifications
  1. Portlet Lifecycle Methods
  2. Portlet Modes
  3. Portlet Window States
  4. Portlet Data Models
  5. Dispatching requests
  6. Caching and Security.
• A sample Portlet.


What are JSR and JCP?

JCP – Java Community Process

The international Java community develops and evolves Java™ technology specifications using the Java Community Process (JCP).The community is involved in the definition of future versions and features of the Java platform. Since its introduction in 1998 as the open, participative process to develop and revise the Java™ technology specifications, reference implementations, and test suites, the Java Community Process (JCP) program has fostered the evolution of the Java platform in cooperation with the international Java developer community.

JSR-Java Specification Request

A JSR is a Java Specification Request. This is the document submitted to the PMO (The Program Management Office is the group within Sun designated to oversee the Java Community Process and manage the daily running of the program. The actual development of the specification occurs within the Expert Groups.) by one or more members to propose the development of a new specification or significant revision to an existing specification.

Courtesy- http://www.jcp.org/en/introduction/faq
http://en.wikipedia.org/wiki/Java_Community_Process

What is a Portlet as per JSR 168?

General Perception
– A portal is a webpage with many different links to various applications.

• Programmer’s View
– “A portal is a web based application that –commonly- provides personalization, single-sign on, content aggregation from different sources and hosts the presentation layer of Information Systems.”- JSR 168 spec

Now we must come across a series of questions..for better understanding.

A series questions (3W and 1H)
1. What is a Portlet?
2. What is Portal Page?
3. What is the difference between a portal page with many links and a portal page with portlets?
4. How is it different from a page with lots of links?

Portlet

• “A portlet is a Java technology based web component, managed by a portlet container, which processes requests and generates dynamic content.”
-- JSR 168 spec
• A portlet is itself an application having its own lifecycle.

Portlets and relationship with Portals

• “Portlets are used by portals as pluggable user interface components that provide a presentation layer to Information Systems.”
--JSR 168 spec
• So now we know how its entirely different from a website containing a lots of links apparently called portals

So it’s obvious that portlets are the basic building block of a successful web Portal where each portlet is assigned to do some specific task and the user is able to gather maximum information on a single page. The portal itself provides the user management capability and users have the facility to single sign on to use all the facilities provided by the entire portal. Personalization is also one of the most important features a portal provides. All these things are much more difficult and developed separately on a traditional portal page which is just a page with bunch of links. Ease of “plug in and run” concept and ease of removal from the portal page gives a new age portal a winning edge over traditional portals

JSR168 Specification
• Portlet Lifecycle Methods
• Portlet Modes
• Portlet Window States
• Portlet Data Models


Portlet Lifecycle Methods

This life cycle of a portlet is expressed through the init (), processAction(),
Render() and destroy() methods of the Portlet interface. The Portal calls the init() method to instantiate the portlet. Then the browser requests are handled by the portlet using ProcessAction() method if the request involves some kind of data processing. Else the render method takes care of it by rendering the page using either doView(),doEdit() or doHelp().Remember the render method is called whenever

a. the processAction() method is called by action request.

b. the renderRequest() comes into picture which doesn’t involve data processing.

c. any other portlet on the same portal page calls the render() method.

Portlet Modes
Generally a portlet has three modes
a. View mode –normal mode to show the content.

b. Help Mode –to show a help page about the application.

c. Edit mode –to show edit page for editing the portlet preferences.

d. But a portal can also have a “custom mode” if the manufacturer wishes to have.

Portlet Window States

• NORMAL

• MAXIMIZED

• MINIMIZED

• CUSTOM –based on manufacturer discretion.

Portlet Data Models

• Portlet to store view information in the “render parameters.”

• Session related information in “portlet session”

• User persistent data in the “portlet preferences”

Portlet Request Dispatcher

• It dispatches the request to other portlets or servlets using the Portlet request Dispatcher with the only Include () method.

Caching and Security

• Portlets that want their content to be cached using expiration cache must define the duration (in seconds) of the expiration cache in the deployment descriptor.
• Security constraints are a declarative way of annotating the intended protection of portlets. A constraint consists of the following elements:
  1. Portlet collection
  2. User data constraint

Can We Design a sample Portlet with the basic knowledge about portlets….???

Monday, January 19, 2009

Portlets ....why ? (part 1)

AGENDA

• Traditional Web Application
• Shortcomings of traditional Web Application
• What is needed?
• What are Portlets? Portals?....
• The New Generation answer …..


Traditional Web Application


The “W W W” --The world wide web ,subset of internet is responsible for information sharing.

The Website Approach ---each application is developed separately like a website and deployed singly on a server.

The Client Server --the usual client server architecture involves synchronous request response paradigm.

The Users' Perspective --the user access the
website ,using the browser and can work with a single website at a time.A single application to interact with.A single repository of information.

The Developers' Perspective --separation of work and single handed workaround with no plug and play feature.A huge effort is required to maintain,re-enginee
r or add a new application to an existing one.

The Business ….Market….Bottom-line --
a huge cost incurred as the project is nearly developed from scratch (or even if component reuse ).In these hard times market and bottom line are the deciding factors for the fate of the project,people and even the company.

Traditional Web Application -Drawbacks

• Lack of Personalized Matter --the content is hard to personalize,lack of personalized matter means lack of edge on the business for traditional web application.

• Segregated Approach --the development is done in separation,a foreign developer body cant collaborate and no plug and play features included,developed by an external developer.

• Difficult for technology up gradation --a technology update in an existing web application is difficult to inherit.

• Single Handed Approach --a traditional web application i
s developed singlehandedly by a certain community of users and are deployed on a web/application server with no specific way to incremental upgradation.

• Difficult to Maintain --as the development goes on and one it becomes very hard to maintain and at a time the entire application can collapse for a simple and difficult to trace fault.

• Difficult to Re-engineer --very difficult to re-engineer and maintain stuff.

• Separate User Management --the entire user management is separately developed and no inbuilt support is given by the web server.

We Need…..

• Personalized Matter
• Integrated Approach….
• Ease of technology Upgradation….
• Community and collaboration framework ……
• Application Repository……
• Easy to Re-engineer…….
• Painless User Management….
• Hassel Free Maintenance

What are Portlets? Portals?....






















What did u understand from the
above image. Look closely at the image and u can find that each and every application is associated with a portlet window which can be minimized , maximized, closed or removed form the portal page . It means that each and every portlet is a small application which can be arranged on the portal page as we like and also it has inbuilt support of personalization and user management.The entire thing is asynchronous also also conforms to web2.0.....its like magic!
a close look at the skeleton of a portal page along with portlets which show contents called fragments











The New Generation answer …..
what is the new generation answer to the drawbacks of traditional web applications its Portlets and Portals..

My Blog List