There has been lot of queries asking me how to send/receive events with portlets that are not on same page. So I thought let me blog about this.

In order to provide coordination between portlets the Java Portlet Specification, JSR 286 introduces Eventing and Public Render Parameters

Eventing:

   By default portlets can send and receive events with other portlets that are on the same page. This can be changed to enable portlets to send and receive events from other portlets that are on different pages. This can be done by adding the following property in portal-ext.properties in Web Space server and Liferay Portal 5.2.x.

portlet.event.distribution=ALL_PORTLETS


Public Render Parameters:

   By default portlets can share render states with other portlets that are on the same page. This can be changed to enable portlets to share render states with other portlets that are on different pages. This can be done by adding the following property in portal-ext.properties in Web Space server and Liferay Portal 5.2.x.

portlet.public.render.parameter.distribution=ALL_PORTLETS


Preventing infinite loops in Eventing:

    The following property is used to specify the maximum number of events that can be generated from portlets to prevent infinite loops. If a portlet sends an event to other portlets, it is considered as one event generation. If the other portlets send events, that is considered as two event generations and so on. The default value is 3.

portlet.event.max.generation=3

Comments:

Hi,

I´m developing with liferay 5.2.3, tomcat 6.0.18 and JDK 1.6 update 16.
I have two portlet with events communication. When I use default portlet container implementation(portlet.container.impl). It works ok, but when I change to sun implementation (portlet.container.impl=sun) I can send the event but the portlets can´t receive the event. The portlets are in the same page (next level will be send events with portlets in differents pages).
Maybe I have wrong versions?, There isn´t any exception in the console.
Please could you help me?

Posted by Miguel on September 14, 2009 at 03:13 PM IST #

When you change to sun implementation, you need to redeploy the portlet wars. Once you have done that you can switch between the implementations.

Posted by Deepak on September 14, 2009 at 03:24 PM IST #

Post a Comment:
  • HTML Syntax: NOT allowed

This blog copyright 2009 by deepakg