Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Inter Portlet Communication (IPC) for Portlets on Different Page Dawn Yang August 20, 2008 12:32 PM
Re: [Liferay Forums][3. Development] Inter Portlet Communication (IPC) for Deepak Gothe August 20, 2008 10:48 PM
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication ( Dawn Yang August 21, 2008 11:32 AM
Re: [Liferay Forums][3. Development] Inter Portlet Communication ( Deepak Gothe August 21, 2008 10:32 PM
Re: [Liferay Forums][3. Development] Inter Portlet Communication (IPC) for Ray Augé August 22, 2008 9:57 PM
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication ( Alf Høgemark October 16, 2008 6:43 AM
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication ( Alf Høgemark October 16, 2008 7:21 AM
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication ( Jens Meinecke March 23, 2009 9:03 AM
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication ( Manish Kumar Gupta March 23, 2009 9:42 AM
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication ( domingo l hilario March 26, 2009 5:47 AM
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication ( Rémi Gauthier April 8, 2009 1:17 AM
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication (IPC) Nicolas Tamayo January 11, 2013 1:21 PM
RE: Inter Portlet Communication (IPC) for Portlets on Different Page Ahamed Hasan September 22, 2009 5:11 AM
RE: Inter Portlet Communication (IPC) for Portlets on Different Page abdul quddhus January 1, 2011 10:08 PM
RE: Inter Portlet Communication (IPC) for Portlets on Different Page ankit yakkundi March 17, 2011 5:24 AM
RE: Inter Portlet Communication (IPC) for Portlets on Different Page Thiago Leão Moreira March 17, 2011 7:10 AM
RE: Inter Portlet Communication (IPC) for Portlets on Different Page ankit yakkundi March 19, 2011 10:43 PM
Dawn Yang
Inter Portlet Communication (IPC) for Portlets on Different Page
August 20, 2008 12:32 PM
Answer

Dawn Yang

Rank: New Member

Posts: 7

Join Date: May 13, 2008

Recent Posts

I am trying to do IPC between two portlets on different page. Anyone has any examples or documentation on this topic? Thanks!
Deepak Gothe
Re: [Liferay Forums][3. Development] Inter Portlet Communication (IPC) for
August 20, 2008 10:48 PM
Answer

Deepak Gothe

Rank: Junior Member

Posts: 44

Join Date: May 19, 2008

Recent Posts

You can achieve this by adding the following properties to
portal-ext.properties.

portlet.container.impl=sun
portlet.event.distribution=ALL_PORTLETS

Currently it works for only those portlets that are in "Undefined"
category. This will be fixed shortly so that it will work for all
portlets irrespective of its category.
After the above change you may need to deploy the portlets again.

Regards,
Deepak
Dawn Yang
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication (
August 21, 2008 11:32 AM
Answer

Dawn Yang

Rank: New Member

Posts: 7

Join Date: May 13, 2008

Recent Posts

Hi,

This works for both JSR-286 Shared render parameters and Events? Or just for Liferay's Client-side Inter-Portlet Communication?

Thanks!
Deepak Gothe
Re: [Liferay Forums][3. Development] Inter Portlet Communication (
August 21, 2008 10:32 PM
Answer

Deepak Gothe

Rank: Junior Member

Posts: 44

Join Date: May 19, 2008

Recent Posts

The distribution of events and public render parameters works across the
tabs. For public render parameters you need to use the following property.
portlet.public.render.parameter.distribution=ALL_PORTLETS


Regards,
Deepak
Ray Augé
Re: [Liferay Forums][3. Development] Inter Portlet Communication (IPC) for
August 22, 2008 9:57 PM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1195

Join Date: February 7, 2005

Recent Posts

I'm not sure I understand the problem of using the OOTB support for
shared render parameters.

These work across pages!

Once they are configured (using the JSR-286 definitions for
configuration) they will work for any portlet on any page as long as the
portlet supports the parameter and the param is in the request (POST|GET
doesn't matter).

I just did some examples for a client, everything worked perfectly.

Is someone seeing an issue?
Alf Høgemark
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication (
October 16, 2008 6:43 AM
Answer

Alf Høgemark

Rank: Junior Member

Posts: 34

Join Date: May 24, 2008

Recent Posts

Hi

I also do not see the need for changing portlet event delivery configurations for this to work.

My only questions is how do I know the name of the parameter to pass in the URL ?

I have one portlet page A, with two portlets that both have defined that they support the "product_id" public render parameter.

Then on page B, I want to construct an URL and print that URL in an <a href""> tag. When the user clicks the tag, he should see the portlet page A, with the two portlets displaying the info for the specified product id.

Currently, I see that I must name my URL parameter "p_r_p_-868126208_product_id",
so the URL I generate look like this <a href="test_view_product?p_r_p_-868126208_product_id=1">Read more</a>

Clearly, I do not want to hardcode this "p_r_p_-868126208_" prefix to my parameter name.
I do not know how that prefix is generated.


How do I construct the proper name of a public render parameter on one page, so that it can be used in an URL pointing to another page, so that the value is readable for portlets on that other page ?

Regards
Alf Hogemark
Alf Høgemark
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication (
October 16, 2008 7:21 AM
Answer

Alf Høgemark

Rank: Junior Member

Posts: 34

Join Date: May 24, 2008

Recent Posts

Hi again

Looking at the Liferay source code itself helped me out this time as well.

I now use the following code in my JSP page:
<%
QName produktIdQName = new QName("http://www.bouvet.no/loop/sortere/params", "produkt_id");
%>
<c:set var="produkt_id_public_param_name" value="<%= QNameUtil.getPublicRenderParameterName(produktIdQName)%>"/>
<p><a href="test_vis_produkt?${produkt_id_public_param_name}=${produktType.produktTypeId}">Read more</a></p>


and my portlet-ext.xml looks like this :
<public-render-parameter>
<description>The ID for a single produkt of type ProduktType</description>
<identifier>produkt_id</identifier>
<qname xmlns:bouvet="http://www.bouvet.no/loop/sortere/params">bouvet:produkt_id</qname>
</public-render-parameter>

This works, and to me it also seems like the correct way of doing this.

But it would be nice to get a confirmation from someone.

Regards
Alf Hogemark
Jens Meinecke
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication (
March 23, 2009 9:03 AM
Answer

Jens Meinecke

Rank: Junior Member

Posts: 43

Join Date: September 1, 2008

Recent Posts

I implemented it different ways with Liferay 5.2.2. Actullay nothing works.. Neither event distribution nor public render parameter. I'm looking for concrete examples. The sample sun jsr 286 portlets doesnot contain sources. Can anybody help me?
Manish Kumar Gupta
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication (
March 23, 2009 9:42 AM
Answer

Manish Kumar Gupta

LIFERAY STAFF

Rank: Liferay Master

Posts: 535

Join Date: May 15, 2008

Recent Posts

You can see source code as well as binary for eventing and public render parameter portlets here.
domingo l hilario
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication (
March 26, 2009 5:47 AM
Answer

domingo l hilario

Rank: Junior Member

Posts: 46

Join Date: February 5, 2009

Recent Posts

I did that and now all my portlets says null
Rémi Gauthier
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication (
April 8, 2009 1:17 AM
Answer

Rémi Gauthier

Rank: New Member

Posts: 10

Join Date: February 13, 2009

Recent Posts

You just need to undeploy and redeploy your portlets with the new container sun to avoid the "null".
Ahamed Hasan
RE: Inter Portlet Communication (IPC) for Portlets on Different Page
September 22, 2009 5:11 AM
Answer

Ahamed Hasan

Rank: Expert

Posts: 306

Join Date: April 13, 2007

Recent Posts

We have done this quite elegantly.

Go to http://www.inikah.com.

On the home page, you give some search criteria (in the quick search portlet) and the results are diplayed in another portlet in another page.

Ok, i am sure that you are excited to see this in action.

Now coming to the implementation part, see the code for the "Quick Search" portlet here.

We have written the URL for the IPC here,

long layoutId = CommonUtil.getLayoutIdByFriendlyURL("qs-result");
PortletURL url = new PortletURLImpl(request, "quicksearchresults", layoutId , PortletRequest.RENDER_PHASE);


You should also notice that we have written a simple method to get the layout Id of the different page that needs to be invoked,

public static long getLayoutIdByFriendlyURL(String friendlyURLSuffix) {

long layoutId = 0l;

DetachedCriteria dCriteria = DetachedCriteria.forClass(Layout.class);
dCriteria.add(Restrictions.eq("friendlyURL", "/" + friendlyURLSuffix));
DynamicQuery dynamicQuery = new DynamicQueryImpl(dCriteria);

try {
List lOutList = LayoutLocalServiceUtil.dynamicQuery(dynamicQuery);

if (!lOutList.isEmpty()) {
layoutId = ((Layout)lOutList.get(0)).getPlid();
}
} catch (SystemException se) {
// ignore
}

return layoutId;
}


Hope this helps. If you find a better approach keep me informed. But this solution works perfectly well for us.

For any help feel free to contact me,

Ahmed Hasan
CTO, TransIT mPower Labs (P) Ltd.
info@mpowerglobal.com
mPower Global
A Liferay expert company.
abdul quddhus
RE: Inter Portlet Communication (IPC) for Portlets on Different Page
January 1, 2011 10:08 PM
Answer

abdul quddhus

Rank: New Member

Posts: 6

Join Date: January 19, 2010

Recent Posts

Dears, we are using JSF porlet - Myfaces, how to submit form which is in pageA (with portlet A1) to another pageB (having portlet B1).
ankit yakkundi
RE: Inter Portlet Communication (IPC) for Portlets on Different Page
March 17, 2011 5:24 AM
Answer

ankit yakkundi

Rank: Regular Member

Posts: 221

Join Date: March 4, 2010

Recent Posts

hi..
I am using liferay 5.2.3 with tomcat 6.
I am able to achieve IPC when both the portlets are on the same page,but when it is on different page,then it does not work.
I am attaching the source code of the portlet(built using plug in sdk) as well as the war file.

I wanted to know whether there is any change in creation of IPC in Liferay 6 from 5??

Please tell me what i need to do ,so that portlets can communication when they are on different pages..

Any idea or suggestions are welcome..

Thanks in advance...
Attachments: ipc-baseball-portlet-5.2.3.1.war (19.8k), ipc-baseball-portlet.zip (30.4k)
Thiago Leão Moreira
RE: Inter Portlet Communication (IPC) for Portlets on Different Page
March 17, 2011 7:10 AM
Answer

Thiago Leão Moreira

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1431

Join Date: October 10, 2007

Recent Posts

Hi Ankit,

You can use public render parameters feature to achieve that.
ankit yakkundi
RE: Inter Portlet Communication (IPC) for Portlets on Different Page
March 19, 2011 10:43 PM
Answer

ankit yakkundi

Rank: Regular Member

Posts: 221

Join Date: March 4, 2010

Recent Posts

hi..
thanks for the reply.
I would be using struts portlet ie 168JSR.
can you help me on this???

any idea or suggestions are welcome..
thanks in advance..
Nicolas Tamayo
RE: Re: [Liferay Forums][3. Development] Inter Portlet Communication (IPC)
January 11, 2013 1:21 PM
Answer

Nicolas Tamayo

Rank: Junior Member

Posts: 29

Join Date: October 3, 2012

Recent Posts

Deepak Gothe:
You can achieve this by adding the following properties to
portal-ext.properties.

portlet.container.impl=sun
portlet.event.distribution=ALL_PORTLETS

Currently it works for only those portlets that are in "Undefined"
category. This will be fixed shortly so that it will work for all
portlets irrespective of its category.
After the above change you may need to deploy the portlets again.

Regards,
Deepak


Thanks Deepak, this code is very very helpful, this code has solved my issue. thanks.
Nicolas, regards.