Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Anonymous
How to decide which way to implement IPC?
September 12, 2008 2:32 AM
Answer

Anonymous

I am new to IPC. I found that there are many ways to implement IPC as shown below:

JSR-286 introduces two methods of Inter Portlet Communication:

* Shared render parameters: allows portlets to set params that can be read by other portlets. This rather simple mechanism will probably be enough for all but the most complex communication needs.
* Events: needed for complex scenarios. The main advantage of this second method is that it allows a fully decoupled communication. A portlet issues an event and doesn't have to care if there is anyone listening for it.

a new mechanism introduced in Liferay v5.0 and provides a very lightweight and decoupled mechanism to communicate portlets purely in the browser through a JavaScript events mechanism.

Icefaces AJAX PUSH for IPC

I am confused which one to use and when.

My IPC requirements:
1. portal server independent
2. easy to implement and maintain
3. can handle event based IPC that pushes data to different portlets.

Overall, how stable IPC for production system? Is it hard to implement?
Manish Kumar Gupta
RE: How to decide which way to implement IPC?
September 12, 2008 8:17 AM
Answer

Manish Kumar Gupta

LIFERAY STAFF

Rank: Liferay Master

Posts: 535

Join Date: May 15, 2008

Recent Posts

Since one of your requirement is portal server independence, I think, you should first try using JSR 286 features. If there is some thing which can't be achieved using Portlet 2.0 features, then you can definitely use liferay specific features.
Anonymous
RE: How to decide which way to implement IPC?
October 3, 2008 3:04 AM
Answer

Anonymous

I forgot to mention one of my very important requirements is JSF portlet support and support ajax porlet update instead of refresh the whole page.

Can JSR 286 support all these?
Ranga Rao Bobbili
RE: How to decide which way to implement IPC?
October 7, 2010 9:44 PM
Answer

Ranga Rao Bobbili

Rank: Regular Member

Posts: 147

Join Date: July 20, 2007

Recent Posts

Hi Manish,

I am facing issue with Inter Portlet Communication using events. Please find my below steps

My Steps:
Step1
portlet.xml
<portlet-app>
<portlet>
<portlet-name>SourceConnect</portlet-name>
<display-name>SourceConnect</display-name>
<portlet-class>com.liferay.portlet.StrutsPortlet</portlet-class>
<init-param>
<name>view-action</name>
<value>/source/connect/view</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<portlet-info>
<title>SourceConnect</title>
<short-title>SourceConnect</short-title>
<keywords>SourceConnect</keywords>
</portlet-info>
<supported-publishing-event>
<qname xmlns:x="http://www.metamarket.com
/mmuserevent">x:MMUserEvent</qname>
</supported-publishing-event>

</portlet>
<portlet>
<portlet-name>MetaSignUp</portlet-name>
<display-name>MetaSignUp</display-name>
<portlet-class>com.liferay.portlet.StrutsPortlet</portlet-class>
<init-param>
<name>view-action</name>
<value>/signup/signup</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<portlet-info>
<title>MetaSignUp</title>
<short-title>MetaSignUp</short-title>
<keywords>MetaSignUp</keywords>
</portlet-info>
<supported-publishing-event>
<qname xmlns:x="http://www.metamarket.com
/mmuserevent">x:MMUserEvent</qname>
</supported-publishing-event>


</portlet>
<event-definition>
<qname xmlns:x="http://www.metamarket.com/mmuserevent">x:MMUserEvent</qname>
<value-type>com.mmkt.publicrender.events.MMUserEvent</value-type>
</event-definition>

</portlet-app>

Step2
Created MMUserEvent bean as per the JAXB Specification.

Step3

CustCreateAction.java extends PortletAction
public void processAction(ActionMapping mapping, ActionForm form,
PortletConfig portletConfig, ActionRequest actionRequest,
ActionResponse actionResponse) throws Exception
{
QName qname = new QName("http://www.metamarket.com/mmuserevent" , "MMUserEvent");
MMUserEvent mmUserEvent=new MMUserEvent();
mmUserEvent.setSContactId(contactId);
actionResponse.setEvent(qname,mmUserEvent);
}

Step3
AddExpAction.java extends PortletAction

public void processEvent(EventRequest eventRequest, EventResponse eventResponse) {
Event event = eventRequest.getEvent();
if(event.getName().equals("MMUserEvent")){
MMUserEvent payload = (MMUserEvent)event.getValue();
eventResponse.setRenderParameter("mmContactId",
String.valueOf(payload.getSContactId()));
}
}

The main issue is my processEvent method is not invoking in AddExpAction.

Could you please let me know the implementation steps to develop IPC using events.
Thanks in advance.........

Regards,
Ranga Rao B
Adaequare Info Pvt ltd.
Ranga Rao Bobbili
RE: How to decide which way to implement IPC?
October 8, 2010 5:33 AM
Answer

Ranga Rao Bobbili

Rank: Regular Member

Posts: 147

Join Date: July 20, 2007

Recent Posts

Hi All,

It seems processEvent method is not available in PortletAction class.

Could you please let me know the alternative solution to implement events concept in struts portlets.

Thanks in advance.................

Regards,
Ranga Rao B
Adaequare Info Pvt ltd.
Vasanth Kumar
RE: How to decide which way to implement IPC?
July 11, 2012 11:32 PM
Answer

Vasanth Kumar

Rank: New Member

Posts: 8

Join Date: July 9, 2012

Recent Posts

Hi

I am trying to implementing IPC by event based in Liferay 6.1.0 ce.

Plz find my requirement :

http://www.liferay.com/community/forums/-/message_boards/message/14782969

Plz share any sample portlet code.

Appreciate your help!!

Thanks
Vasanth