Saturday, October 30, 2010

Ajax to JSR 168 Portlets


Good article on Best Practices for Applying AJAX to JSR 168 Portlets http://developers.sun.com/portalserver/reference/techart/ajax-portlets.html


Friday, October 29, 2010

JSR 286 Portlet filters


The new portlet filter functionality allows you to plug filters around any life-cycle call of the portlet. Following the common decorator pattern, filters can do pre- or post-processing, and they can modify or wrap the request and response objects that are passed to the portlet. Typical applications of portlet filters could include these:

Passing information from additional sources to the portlet as attributes or parameters
Output filtering for security enforcement or markup compliance
Collecting diagnostic information
Bridging between Web application frameworks, for example, uses a filter approach to augment the markup of portlets with additional semantic information for client-side click-to-action.

The portlet filter programming model is modeled on the servlet filter model:

Define the filters in the deployment descriptor. This definition is done using the element, where you also need to state the life-cycle call to which the filter should be applied.
Implement the corresponding Filter interface in your filter. You can also list multiple life-cycle entries and implement multiple Filter interfaces with your class.
Provide a filter-mapping element where you describe to which portlets your filter should be applied (you can also use an asterisk as a wildcard if it should be applied to all portlets in the application).
The order of the filter-mapping elements in the deployment descriptor also defines the order of the filters that are applied to the portlet.


Thursday, October 28, 2010

JSR-168 Portlet Specification



JSR-286 Portlet Specification (Portlet 2.0)


JSR 286 Specification (Portlet 2.0) is available to download from the JCP website. Here is the direct link - http://jcp.org/aboutJava/communityprocess/final/jsr286/index.html


JSR 168 Tutorial - part I


What is JSR 168?

•From the portletdevelopment point of view, it is really very simple:

–You write a java class that extends GenericPortlet.

–You override/implement several methods inherited from GenericPortlet.

–You use some supporting classes/interfaces

•Many are analogous to their servletequivalents

•Some (portletsession) actually seem to be trivial wrappers around servletequivalents in Pluto.

Some Terminology

Portlet: Java code that manages a piece of web content and which may invoke services.

PortletContainer: Manages the lifecycle of the portlets (inits, invokes,destroys).

Portal: Displays the portal content provided by the container. The portal is responsible for the actual layout.

Portlet Application: A webappcontaining a group of related portlets, content, supporting jars, etc.