What are the key features provided by JSR 168 portlet specification?

0 comments



The Java Standardization Request 168 (JSR 168) defines a portlet specification, including a contract between the portlet container and the portlet. Below are some of the features that this API provides:

Portlet Modes

A portlet mode advises the portlet what task it should perform and what content it should generate. When invoking a portlet, the portlet container provides the current portlet mode to the portlet. Portlet Specs define following portlet modes:
Different Portlet Modes
Different Portlet Modes

View: When a portlet is initially constructed on the portal page for a user, it is displayed in its view mode. This is the port let's normal mode of operation

Edit: If this mode is supported by a portlet, the portlet provides a page for users to customize the portlet for their own needs. For example, a portlet can provide a page for users to specify their location for obtaining local weather and events. Users must be logged into the portal to access edit mode.

Help: If this mode is supported by a portlet, the portlet provides a help page for users to obtain more information about the portlet

Modes can be specified on a per mime-type basis. Custom modes can be defined by the portal to provide more mode.

Optional custom modes

About : Display the portlets purpose, origin, version, and other information.
Config : Display one or more configuration views that let administrators configure portlet settings which are valid for all users.
Edit_defaults : Set the default values for the modifiable preferences that are typically changed in the EDIT screen.
Preview : Render output without the need to have back-end connections or user specific data available.
Print : Display a view which is suitable for printing.
Different Portlet Modes
Different Portlet Modes and States

Portal vendor specific modes : These modes are only available in a specific vendor portal.

Window States

A window state is an indicator of the amount of portal page space assigned to the content generated by a portlet. The portlet container provides the current window state to the portlet, and the portlet uses the window state to decide how much information it should render. However, portlets can also programmatically change their window state while processing an action request.
Normal: When a portlet is initially constructed on the portal page, it is displayed in its normal state – arranged on the page along with other portlets.
Maximized: When a portlet is maximized, it is displayed in the entire body of the portal, replacing the view of other portlets.
Minimized: When a portlet is minimized, only the portlet title bar is displayed on the portal page.

Portlet Session
  • The Portlet Session holds user-specific, transient data for the concrete portlet instance.
  • Portlet Session is not available on an anonymous page.During login, a Portlet Session is automatically created for each portlet on a page.
Portlet Life Cycle

A portlet is managed through a well defined life cycle that defines how it is loaded, instantiated, initialized and how it handles requests from clients.

Life cycle of a portlet is expressed through following methods of Portlet interface:

–init,
–process Action,
–render and
–destroy

Portlet Preferences
  • When defined within the portlet.xml file, these are default values for the per-user run time preferences.
  • Preference values may be set as read-only.
  • Essentially a variable initialization mechanism for run time user preferences.

Initialization parameters (i.e. Site dependant constants) specified in portlet.xml

init-params
<name>defaultZipCode
<value>27705
</init-param>

Readable from a PortletConfig object available in all init methods
String zipCode = config.getInitParameter(“defaultZipCode”);

No comments:

Post a Comment

Recent Posts

Popular Posts

© 2011-2019 Web Portal Club