A Techno Blog, mainly about Java

Portlet Programming

This entry will document my learning on programming with Portlets. First link is an introduction on Portlets by two IBMers. Also, referenced is an article on Understanding the Portal Specification. The JSR168 spec and JavaPassion slides [1] [2].

Three main components:
portal (server): presentation layer, or an application which aggregates portlet applications together in a presentable format. Portals provide a secure, single point of interaction with diverse information, business processes, and people, personalized to a user’s needs and responsibilities. A portal server provides common services such as application connectivity, integration, administration, and presentation that would be required across all portal environments.

portlets: a portlet is a Java servlet that operates inside a portal. In other words, it is an individual web component that is made accessible to users via the portal.

portal container: sits between a portal and its portlets. The portlet container manages the lifecycle of the portlets. Controls portlet mode (View, Edit, and Help ) and window state (how much content should appear).

1) Users issue requests against portlets from the portal.
2) The portlet container receives requests from the portal server (instead of a web browser) and invokes the portlet’s “doView” and “doEdit” .
3)The portlet returns the generated markup.
4) The portal server aggregates the portlet makup for display.
5)The client displays the markup.

Portlet exposes four lifecycle methods:

– init(PortletConfig config)
– processAction(ActionRequest request, ActionResponse response)
– render(RenderRequest request, RenderResponse response)
– destroy()

* GenericPortlet: implements the render method and defines three empty methods, doView, doEdit, and doHelp. Your subclass of GenericPortlet can implement any of these methods.

* The ActionListener turns user clicks in your pages into action events…the WindowListener notifies your portlet of window events from the portal, such as when your portlet is maximixed, minimized, and restored. The MessageListener lets you handle messages sent from one portlet to another.

*PortletPreferences is an object that can be used to store persistent data for a portlet user.

*PortletSession : storing information within a user’s session.

*PortletRequestDistpacher: works in the same way a RequestDispatcher would in servlets.

*PortalContext: object can be used to query information about a portals supported extensions.

Onto Developing the Portlets:

July 27, 2004 - Posted by | Portals

No comments yet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: