Portlet coordination
You can use either the events mechanism or the public render parameters mechanism to coordinate portlets within a portal.
JSR 286 defines these two mechanisms as follows:
- Events: Loose-coupling of portlets during action phase.
- Public render parameters: Sharing of view state between portlets.
The WebSphere® Application Server portlet container supports both concepts with one exception. The wiring of events on a portal level is not supported.
To make use of the public render parameters on a portal page defined
with the aggregation tag library, you must explicitly declare the
portal scope:
<%@ taglib uri="http://ibm.com/portlet/aggregation" prefix="portlet" %>
<%@ page isELIgnored ="false"%>
<!-- define portal scope for public render parameters -->
<portlet:scope>
<portlet:portlet context="/simpleportlet" portletname="SimplePortlet1" windowId="id1"/
<portlet:portlet context="/simpleportlet2" portletname="SimplePortlet2" windowId="id2"/>
</portlet:scope>
<portlet:init portletURLPrefix="/my-webapp-context/my-portal-jsp-url-pattern/">
<!-- insert your portlets here, wrapped with your html markup -->
...
<portlet:insert url="simpleportlet/SimplePortlet1" windowId="id1" titleVar="portlettitle_1"/>
...
<portlet:insert url="simpleportlet2/SimplePortlet2" windowId="id2" titleVar="portlettitle_1"/>
...
</portlet:init>
The public render parameters are only visible to the portlet windows mentioned within this defined scope. This condition assumes, as a prerequisite, that the corresponding portlets have also declared support for a given public render parameter in their portlet.xml file, according to the JSR 286 specification:
...
<portlet>
<portlet-name>portlet_name1</portlet-name>
...
<supported-public-render-parameter>foo</supported-public-render-parameter>
</portlet>
<portlet>
<portlet-name>portlet_name2</portlet-name>
...
<supported-public-render-parameter>foo</supported-public-render-parameter>
</portlet>
<public-render-parameter>
<identifier>foo</identifier>
<qname xmlns:x="http://example.com/params">x:foo2</qname>
</public-render-parameter>
...