ShowTable of Contents
The IBM® Connections Portlets internally uses IBM WebSphere® Portal features like Page Properties (Page Parameters), Property Broker events, and Public Render Parameters to interact among each other, and these features can also be used to interact with other Portal applications.
This article describes all three approaches and uses a sample out-of-box portlet (attached below) to help demonstrate these various integration points and debugging. The attachment also contains the source code of the sample portlet that can help developers extend these integration points to their applications.
As the name suggests, Page Parameters are used to set various type of parameters on the Portal page. When setting up pages for Connections Portlets, you can use various Page Parameters, which Connections Portlets reads and, based on that, shows the data in the portlets.
For example, when a parameter named "ibm.community.id" that has a value of Connections community id is set to a page, then all the Connections Portlets read this community ID and, based on that, all the portlets on that page show the data of that Connections community.
Another scenario is that, if the portlets must show the data related to any particular tag, then that tag can be added to a page as a parameter. For more details, refer to the product documentation topics.
“Mapping a community page to a community
,” and and “Pinning portlet content to a tag
All these Page Parameters can be read by use of JavaTM code (sample attached); therefore, any custom portal application may read it and, based on the parameters, that application may react and show the view or data in conjunction with a Connections Portlet.
For example, if a tag named “finance” is added to the Page Parameter, then the Connections Portlet will show the content related to the tag “finance,” and users can also add finance applications or finance products links to that page. A custom application may also modify the Page Parameters to show corresponding view/data in the portlets.
Property Broker events
These events are used in Connections portlet to communicate between the tag cloud portlet and the detail portlet of various services like Blogs, Wikis, Activities, and Forums. There are two main types of wires used in these events; the first one, called "Tags Payload," is fired from the detail service portlets when they are initially loaded or if their view is changed.
For example, moving from Latest Entries to the All Blogs view will fire an event from the Blogs portlet that tells the tag cloud portlet to show the tags related to the All Blogs view. In this wire argument the detail portlets send the Representational State Transfer (REST) URL of the tags related to the view that portlet is showing. This REST URL tag is used by the tag cloud portlet to invoke that REST service and to show all the tags provided in the response.
The second type of wire used in these events is called "Selected Tag." This event is fired by the tag cloud portlet and has a tag value of just the tag that the user clicks on the tag cloud portlet. Usually the Selected Tag event is read by the details service portlets to filter their data corresponding to that tag. For more details, refer to the topic, “Configuring and wiring the Tags portlet
Property Broker events are used to create cooperative portlets that can be wired together for communicating with other portlets. Connections Portlets also expose the tag-related data through these events. Any custom portlet can register for these events to receive as well send the events to the Connections portlet.
To use Property Broker events, the portlets must be wired; that is, the source portlet sends the data, and a wired receiver portlet receives that data.
Public Render Parameters
Public Render Parameters, or PRP, are used to show the appropriate view in the details service portlet. All the details service portlets read the PRP and, based on that, PRP portlets render the view in the portlet.
The PRP is set by the Piece of Content servlet (POC) and, besides setting the PRP, the POC also navigates users to the appropriate page. The Connections portlet uses this feature to navigate from the Summary portlet to the details portlet; for example, when a user clicks on any entry in the Blogs Summary portlet, they will be navigated to the Blogs details portlet with that entry already open.
We can extend this by adding these kind of links in the custom content. For example, a product detail may exist on a wiki page or a blog entry of the Connections Portlet, so by using a proper link we can invoke the POC and navigation can occur. For more information on creating a link, refer to “Configuring navigation between portlets.
About the attachment file
The attachment is a .zip file containing the sample portlet .war file, the source code of the Portlet, and a Readme file. Make sure to review the Readme file to set up the source code.
The sample portlet demonstrates how to read the data produced by all three methods described above. It creates a table showing all the names of Page Parameters and their values and also shows the last Property Broker event name and its value.
If a user has navigated to a page where the sample portlet is deployed, then the sample portlet will also show that PRP's value. As the sample portlet can be placed on any page where these integration points must be inspected, it can also act as a debugging tool for monitoring these integration points.
Note that, in order to see the Property Broker Events data in the sample portlet, we need to wire this portlet as a receiver from the Tags (Tag Cloud) portlet and any Detail service portlet. Figure 1 is a screen shot of the sample portlet showing how it displays the data when placed on a Portal page.
Figure 1. Sample portlet displaying data on Portal page
This article covered various integration points provided in the IBM Connections portlets, briefly describing how these integration points can be used in custom scenarios. Included is a sample portlet, to help you test these integration points, along with the sample portlet's source code, to help you get started in adding these functionality to any custom scenario.
Tell us what you think
Please visit this link to take a one-question survey about this article:
developerWorks Connections product page:
developerWorks WebSphere Portal zone:
About the author
Chitresh Sirohi is based at IBM's India Software Labs, working in the domain of ICS for the past 8.5 years. His technical expertise lies in WebSphere Portal platform and application development on WebSphere Portal using Web Experience Factory. You can reach him at Chitresh.Sirohi@in.ibm.com