« Back

Inter Portlet Communication: One size does not fit all

July 3, 2008 By Jorge Ferrer

Inter Portlet Communication (IPC) is a hot topic nowadays. This was probably the most missed feature of the first version of the portlet spec (JSR-168), but has made it to the second version (JSR-286, supported since Liferay 5.0). Maybe this is the reason why more and more people are becoming interestind in IPC, and even in portlets in General.

As I've mentioned in previous posts, JSR-286 provides two very good methods for communicating portlets: shared render parameters and events. But this post is not about them, it's about the fact that while having standards is very good, it should not inhibit us from using other solutions when they fit. In particular, I think IPC is a very broad topic. There are lots of different scenarios and communication needs for a single solution to be the best for all IPC problems.

If the solutions provided by JSR-286 fit your needs, by all means use them. But it's also good to know other alternatives. In particular I'd like to highlight today a method provided by Liferay to communication portlets using a super-lightweigth JavaScript events system that runs completely in the browser. This method has been available for some time, and it's now documented in Client-side Inter-Portlet Communication. Take a look and let us know how it works for you.

Showing 8 Comments

7/3/08 4:35 AM

[...] Inter-Portlet communication is probably one of the problems every portlet developer has faced. In the first version of portlet spec (JSR-168) there wasn’t really any standard way the only one way of doing it was through the shared portlet session... [...] Read More

Rainer Schmitz
7/3/08 7:54 AM

This "Client-side Inter-Portlet Communication" seems to be very similar to the Open Ajay approach (http://www.openajax.org/member/wiki/OpenAjax_Hub_1.0_Specification_PublishSubsc­ribe).

Is there a special reason for inventing your own system?

Jorge Ferrer
7/3/08 11:59 AM

Hi Rainer,

I didn't implement our current system, but I'm pretty sure it's been done this way because the developer either didn't know about the OpenAjax solution or because it wasn't final or stable enough.

In any case we are keeping an eye on all of the standards of OpenAjax so we'll be glad to implement all of those that catch up. There has been some concerns in the past with their implementation of their hub which is probably why they haven't been so successful yet, but I guess they have already fixed that or will soon.

Björn Ryding
7/5/08 5:22 AM

Hi Jorge,

<a href="http://www.liferay.com/web/guest/community/forums/-/message_boards/message­/1036340">I just wrote a few lines in the forums</a> about why it might be a good idea to have a separate Liferay solution. If I have understood the motivation behind your decision correctly, I consider the two solutions complementary.

Rajesh Thekkadath
7/29/08 5:26 AM

The link doesnt seems to work properly. Can you please edit the page for
(a) Client Side Inter Portlet Communication
(b) Other alternatives

The working link for Client Side Interportlet Communication is http://www.liferay.com/web/guest/community/wiki/-/wiki/1071674/Client-side+Inter­-Portlet+Communication

Jorge Ferrer
7/29/08 9:37 AM

Fixed, thanks Rajesh.

Peter Shin
7/30/08 2:53 AM

This was really helpful to read. Thanks Jorge! btw, the new Liferay Wiki looks great!

1/14/09 3:16 AM

[...] Your url was recorded with keywords portlet! [...] Read More