Developing cooperative portlets

 

+

Search Tips   |   Advanced Search

 

The term cooperative portlets refers to the capability of portlets on a page to interact with each other by sharing information. One or more cooperative portlets can automatically react to changes from a source portlet triggered by an action or event in the source portlet. Portlets that are targets of the event can react so that users are not required to make repetitive changes or actions in other portlets. This provides a coordinated and consistent behavior between the portlets and enhances users' overall experience.

Cooperative portlets can now subscribe to a server side model (IBM and JSR 168 API portlets ) or to a client side model (IBM API and JSR API portlets targeted on WebSphere® Portal V6.1) for declaring, publishing, and sharing information.

Server side model portlets (IBM API portlets and JSR 168 API portlets) communicate with each other using the WebSphere Portal property broker. Such portlets subscribe to the broker by publishing typed data items, or properties, that they can share, either as a provider or as a recipient.

Cooperative portlets can be source portlets, target portlets, or both.

Currently, Rational tools support two methods for developing cooperative portlets:

  1. Click-to-Action (server side or client side processing)

  2. Wires (sever side processing only)

 

Click-to-Action support (server side or client side processing)

A user launches a Click-to-Action event from an icon on the source portlet. The icon presents a menu containing the list of targets for the action. After the user selects a specific target, data is delivered to the target in the form of the corresponding portlet action.

In previous versions of the product, the Click-to-Action technique was only available to IBM Portlet API portlets using server-side processing; however, if you target a WebSphere Portal V6.1 sever, you can now use a client-side tagging technique that provides Click-to-Action capability for JSR portlets as well IBM API portlets.

Using the Click-to-Action delivery method, you can transfer data with a simple click from a source portlet to one or more target portlets, causing the target to react to the action and display a new view with the results. You can also broadcast the property to all portlets on the page that have declared an action associated with a matching input property.

The following two tables shows the type of Click-to-Action support that is available by portlet type.

Server Side Click-to-Action support is available for basic, Faces, and Struts portlets as follows:

Portlet Type WebSphere Portal 5.1.x and 6.0 only
JSR 168 API JSR 286 API IBM portlet API
Basic portlet Not supported

Note: For JSR 168 API, you can use the generic WebSphere Portal cooperative portlet capability. It is based on WebSphere property broker and wires.

Not Supported Supported
Faces portlet Not Supported Supported
Struts portlet Not supported Supported

Client Side Click-to-Action tagging support is available for basic, Faces, and Struts portlets, provided you have targeted a WebSphere Portal 6.1 server

Table 2. Client Side Click-to-Action tag support by portlet type
Portlet Type WebSphere Portal 6.1 only
JSR 168 API JSR 286 API IBM portlet API
Basic portlet Supported Supported Supported
Faces portlet Supported Supported
Struts portlet Supported Supported

 

Wires support (server side tagging only)

Wiring is a technique for connecting cooperative portlets so that changes in the source portlet automatically update the target portlets without any user interaction. A wire is used to automatically transfer properties to target portlets without a prompt (as opposed to the menu provided by the Click-to-Action mechanism).

The basic wiring capabilities provided by the portal tooling support both IBM API and JSR 168 portlets. These capabilities are equivalent to those provided by the Portlet Wiring Tool in WebSphere Portal versions 6.0 and higher.

The following general limitations exist for portlet wiring in this product:

 

Cooperative portlet icons

Table 3. Cooperative portlet icons in Project Explorer view, Palette view, and Page Designer
Icon Description Appears in
Cooperative Source Trigger Palette view
Cooperative Source Portlet Project Explorer view and the Portlet Deployment Descriptor editor
Cooperative Target Portlet Project Explorer view and the Portlet Deployment Descriptor editor
Cooperative Source and Target Portlet Project Explorer view and the Portlet Deployment Descriptor editor

Click-to-Action Output Property (encodeProperty) JSP Pages in Page Designer and the Palette view
Click-to-Action Output Properties (encodeProperties) JSP Pages in Page Designer and the Palette view

 

Related concepts

Faces portlet communication

Wiring portlets

 

Related tasks

Enabling existing portlets for cooperation

Enabling cooperative sources

Enabling cooperative targets

Enabling existing portlets for cooperation

Disabling a cooperative target for a target portlet

Enabling cooperative sources

Enabling cooperative targets

Inserting Click-to-Action encodeProperty

Inserting Click-to-Action encodeProperties

Editing Click-to-Action encodeProperty

Editing Click-to-Action encodeProperties

 

Related reference

Faces direct portlet messaging