X

Subscribe to BloggerHow updates..

Recommend us on Google+

Get updates in your mail

New posts will get delivered to your mail box directly.Its free and we never spam you. Enter your mail here and click on subscribe. Check your mail box for a confirmation mail.

Get updates in your RSS reader

Subscribe using RSS and read updates using your favorite RSS reader..
RSS

Like us on Facebook

Get updates directly on your Facebook wall.

Follow us on Twitter

Get updates as tweets..

Circle me on Google plus

Add me to your circle and get new post updates in Google plus stream.

Sender Portlet
1.Add below parameter in Portlet.xml

 <supported-publishing-event>
           <qname xmlns:x="http://liferay.com/events">x:ipc-parameters</qname>
  </supported-publishing-event>

2.Get the values from the sender jsps and  Set Events in your action class

@Override
public void processAction(ActionRequest actionRequest,
ActionResponse actionResponse) throws IOException, PortletException {
// TODO Auto-generated method stub
QName qName = new QName("http://liferay.com/events", "ipc-parameters");
String name = ParamUtil.getString(actionRequest, "name","");
int age = ParamUtil.getInteger(actionRequest, "age");
double salary = ParamUtil.getDouble(actionRequest, "salary");
String parameters=name+','+String.valueOf(age)+','+String.valueOf(salary);

actionResponse.setEvent(qName, parameters.toString());

}

Receiver Portlet:
1.Add below parameter in Portlet.xml of receiver portlet
 <supported-processing-event>
            <qname xmlns:x="http://liferay.com/events">x:ipc-parameters</qname>
 </supported-processing-event>

and add below parameter after end of </portlet> and before end of </portlet-app>

<event-definition>
    <qname xmlns:x="http://liferay.com/events">x:ipc-parameters</qname>
</event-definition>  

2.Get the events values in process Events Method

@Override
@javax.portlet.ProcessEvent(qname = "{http://liferay.com/events}ipc-parameters")
public void processEvent(EventRequest request, EventResponse response)
throws PortletException, IOException {
Event event = request.getEvent();
String paramtervalues = (String) event.getValue();
response.setRenderParameter("parameters", paramtervalues);
}
Share article
Older Post Newer Post

0 comments:

Post a Comment

To Top