Total Pageviews

Saturday, May 30, 2015

Liferay: IPC via Server Side Events

IPC (Inter Portlet Communication) in Liferay can be implemented in different ways and  I've already written an article on Public render parameter mechanism. In this article, we'll see Event based IPC. As Public Render Parameters, this concept was also introduced in JSR 286.

As per IPC using Events, portlet can publish/send and process/receive the event. This mechanism works flawlessly with inter and intra WARs.

1. Event deceleration in Event Publisher Portlet's portlet.xml
Full portlet.xml will look like as follows:

2. Event definition in Event Receiver Portlet's portlet.xml
Full portlet.xml will look like as follows:
3. Event Publishing Portlet's Controller Class

Invoking Publish Event method

4. Event Processing Portlet's Controller Class and fethching parameter's value
Note: 'QName' is a nothing but a qualified name of the parameter. Usage of QName minimizes chances of having two identical events.

3 comments:

  1. Awesome..You have clearly explained ...Its very useful for me to know about new things..Keep on blogging..
    Java Training in Chennai

    ReplyDelete

  2. Another great articles and very interesting to read,thanks for sharing that wonderful useful information,given programming coding was very excellent and easily observe all provided information.


    SEO Training in Chennai

    ReplyDelete
  3. Your blog is more informative..Its very interesting to know about new things..Keep on sharing.
    Dotnet training in chennai

    ReplyDelete