with the IPC (inter portlet communication), let’s go with an
example that explains how to create a link in one portlet that points
to another portlet located on a different page (editor’s note: wow!! –
editor’s hint: portlets are not pages)
To do this we have to use the tlds :
and the concepts of
plid: referenced page layout id
The renderURL and the actionURL are tags provided by Liferay
that extend the standard tlds. Note: this kind of communication is not
part of the standard of the portlets JSR168 and JSR286.
- The plid is the id of the page where we deploy one portlet, we can
use LayOutLocalService to seek the id, or query it in the database directly.
- The portletName is the identifier of the portlet and is part of
the deployment descriptor of the portlet. This id is composed by
optionally the _INSTANCE_ if the portlet is instanciable.
If we have one portlet, and we use this tld into the jsp:
and this portlet creates a link to other portlet, in this case,
mynews_WAR_myresourcesportlet located in the page with plid 13605.
This link is a render link.
The next sample shows how to create an actionURL:
We can also pass parameters:
If the plid is not used, the portal assumes that the portlets are
located into the same page.