Monday, April 20, 2009

JSR 168 (Portlet Specification)

What is The Portlet Specification?
The Java™ Specification Request 168 Portlet Specification (JSR 168) standardizes how components for portal servers are to be developed. This standard has industry backing from major portal server vendors.

• The portlet container contract and portlet life cycle management
• The definition of window states and portlet modes
• Portlet preferences management
• User information
• Packaging and deployment
• Security
• JSP tags to aid portlet development
















Container Contract
•init()
•destroy()
•processAction()
•render()
GenericPortlet can be extended (called by render())
•doView()
•doEdit()
•doHelp()

The processAction(), render(), and specialized methods called by render() accept portlet requests and response objects similar to those passed to the Servlet service() method. Using these objects, the portlet class can do the following:
• Maintain state and communicate with other portlets, servlets, and JSP’s using the portlet session facilities.
• Receive user input from forms displayed in the portlet.
• Create the content for display by the Portal desktop that is sent back to the client via the response object.
• Query portal and portlet state information.

Portlet Mode and Window State
•Portlet Mode – current mode (View, Edit, Help)
•Window state – Amount of portal page space assigned to a portlet (minimized, maximized, normal)

Portlet Preferences
•Name-value pairs.
•Access - PortletPreferences interface, getValues(), setValues()
•Validate – PreferencesValidator interface, store() method invokes validate()

User Information
•In deployment descriptor; unmodifiable Map object (retrieved through USER_INFO in Request interface)
•Packaging and deployment as WAR
•In addition to web.xml, has portlet.xml

Security
•Flag to restrict to HTTPS
•Authentication (user, role)

JSP Tag Library
•A JSP Tag library is included to help display portlet pages with JSP technology.
•For example, a custom JSP tag automatically declares the portlet request and response objects so they can be used within the JSP
•Another JSP tag helps construct URL’s that refer back to the portlet.

Initialization Sequence Diagram

No comments:

Post a Comment