Saturday, September 5, 2009

Portal JSR

Portlet JSRs

The Portlet specification will define a Portlet API that provides means for aggregating several content sources and applications front ends. It will also address how the security and personalization is handled.

Portlets are web components -like Servlets- specifically designed to be aggregated in the context of a composite page. Usually, many Portlets are invoked to in the single request of a Portal page. Each Portlet produces a fragment of markup that it s combined with the markup of other Portlets, all within the Portal page markup.

The Portlet specification will define the different components for Portal Computing, their interaction, lifecycle and semantics. These components will comprise -but they will not be restricted to-: Portlets, Deployment descriptor, Portlet APIs. In addition, APIs for vendor extensions, APIs for security, user customization and layout management will be considered. Also, it will define the minimum set of possible window states for a Portlet such as normal, minimized, maximized, etc.-, the valid state transitions and Portlet modes (such as view, edit, help, configure) per markup language.

This first version of the Portlet specification will concentrate in the following design goals:

  • Client agnostic
  • Support for multiple types of clients (multi-device)
  • Simple Portlet API
  • Support for Localization and Internationalization
  • Hot deployment and re-deployment of Portal applications
  • Declarative security (same as to the mechanism found in Servlet and EJB specs)
  • Architected to support remote execution of Portlets
The Portlet specification will be based on the Servlet specification. It is envisioned that the developer API will be similar to the Servlet API. The Portlet specification will restrict the use of functions provided by the Servlet API to a subset that makes sense for components providing fragments of a markup page. Portlets would be able to obtain from their context -via the Portlet API- functions like access to user profile information for the current user, participation in the portal window and action event model, access to web client information, sharing of information with other Portlets and a standard way of storing and retrieving per-user/per-instance Portlet data persistently. The API will provide a URL-rewriting mechanism for creating links to trigger actions within a Portlet without requiring knowledge on how URLs are structured in the particular web application. Portlets would be grouped in a Portal Application by bundling them in a single WAR with a Portlet deployment descriptor file. In addition, the API will provide a mean for sharing data among Portlets of the same Portal Application. Like the Servlet specification, the Portlet specification will allow access to Enterprise Information Systems without imposing restrictions on the type of protocols. It is an important goal that the design of the Portlet specification would allow implementations to support remote Portlet execution. This design would not address the transport protocol for the remote execution of Portlets, leaving to the specific Portal implementations the support for Portlet remote execution. For example, a proxy Portlet could be used to invoke a remote Portlet.
JSR 168

The Java Portlet Specification V1.0 introduces the basic portlet programming model with:

  • two phases of action processing and rendering in order to support the Model-View-Controller pattern.
  • portlet modes, enabling the portal to advise the portlet what task it should perform and what content it should generate
  • window states, indicating the amount of portal page space that will be assigned to the content generated by the portlet
  • portlet data model, allowing the portlet to store view information in the render parameters, session related information in the portlet session and per user persistent data in the portlet preferences
  • a packaging format in order to group different portlets and other J2EE artifacts needed by these portlets into one portlet application which can be deployed on the portal server.

JSR 286

JSR-286 is the Java Portlet specification v2.0 as developed under the JCP and created in alignment with the updated version 2.0 of WSRP.[1] It was developed to improve on the short-comings on version 1.0 of the specification, JSR-168. Some of its major features include:[2]

  • Inter-Portlet Communication through events and public render parameters
  • Serving dynamically generated resources directly through portlets
  • Serving AJAX or JSON data directly through portlets
  • Introduction of portlet filters and listeners