
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?