« Back to Using Liferay

Portlet Communication Configuration

Table of Contents [-]

Introduction #

Liferay implements several communication mechanisms across portlets including those specified by the JSR-286 standard: public render parameters and events. Public render parameters are very easy to use, but are nevertheless quite powerful when used in the right situations. Liferay also provides a configuration UI that allows getting the best out of this communication mechanism.

The UI to configure the communication across portlets can be accessed by clicking the configuration icon in the upper right corner of the portlets (note that the exact position might vary depending on the theme being used). Once in the configuration UI, if the portlet supports comunication through public render parameters a screen similar to the following will be shown.

This screenshot in particular is for the wiki portlet, which has four public render parameters: nodeId, title, categoryId and tag. For each of this parameter the configuration UI allows the administrator to:

  • Ignore the values for this parameter that come from other portlets. For example, the wiki portlet can be used along with the tags navigation portlet so that when a user clicks on a tag of the latter, the wiki portlet shows the list of pages with that tag. In some cases an administrator may want the wiki portlet to always show the front page independently of any tag navigation done through other portlets. This can be achieved by checking the ignore checkbox so that the values of the parameter coming from those other portlets are ignored.
  • Read the value from the parameter from other portlet. This is an advanced but very powerful option that allows communicating portlets even if their developers didn't think of it. For example, imagine that the wiki portlet is used to publish information about certain countries. Also in the same page there is another portlet that allows browsing countries for administrative reasons. That second portlet has a public render parameter called "country" with the name of the country and we want the wiki to show the information from the country being browsed through the administration portlet. This can be achieved going through the portlet communication configuration UI for wiki and set it up so that the value for the title param is read from the country param (of the other portlet). Cool, isn't it?
1 Attachment
Average (0 Votes)
The average rating is 0.0 stars out of 5.
Threaded Replies Author Date
And what if I want to pass parameters from a... Alessandro Cosenza August 23, 2010 6:54 AM
It looks as if it isn't just the parameter of... Brian Scott Schupbach April 24, 2012 1:13 PM

And what if I want to pass parameters from a JournalContentFriendlyURLMapper (from populateParams method I guess) to An AssetPublisher portlet?
Posted on 8/23/10 6:54 AM.
It looks as if it isn't just the parameter of "categoryId" that is passed in the URL but also an instance ID of the portlet. I have a custom portlet and I can get the categoryId but I cannot get the instance ID of the asset publisher. So, even though I'm passing in the categoryId under the parameter "categoryId" it doesn't work. Is there a way to communicate between portlets without needing to pass the instance Id along with the cateogryID?
Posted on 4/24/12 1:13 PM.