Inter Portlet Communication, using public render parameters in Liferay

Let's go with an example of Inter Portlet Communication (IPC) of portlets in Liferay Portal 5.x. The tags navigation and the category navigation portlet in Liferay use the public render param to communicate with other portlets. In the portlet deployment descriptor we can see a portlet section:

 <display-name>Tags Navigation</display-name>

that defines the public render parameters supported by the 141 portlet id.

 <qname xmlns:x=" ">x:folksonomy</qname>
 <qname xmlns:x=" ">x:tag</qname>

and the definition of their corresponding parameters.

If we build a JSP portlet sample with the plugin SDK, adding to the portlet deployment descriptor the above commented definition and supported tags, we can use this render public parameters for inter portlet comunication.

To demostrate this functionality, we create a new page in the guest community and we add 3 portlets:

  • Tags Navigation Portlet
  • Categories Navigation Portlet
  • IPC render public (you can download the code from this link)

Then, just create some categories and tags, and then go to the created page and click into the link for the categories or tags. The render public parameters will appear into the IPC render public portlet.



More Blog Entries