Foren

Share attributes between portlets deployed as individual WARs

Rolf Lehnert, geändert vor 9 Jahren.

Share attributes between portlets deployed as individual WARs

New Member Beiträge: 5 Beitrittsdatum: 30.08.13 Neueste Beiträge
Hi all ,

I try to share attributes between 2 portlets in different WAR archives.
For this, I have found this documentation, but it does'nt work: share attributes between portlets

I have tried the "Method 1 - Sharing attributes in between portlets" from this instructions.
For this I have coded a master portlet (simple PrimeFaces form), that should set a attribute in the session.
Then I have coded a client portlet, which should retrieve this attribute from the session.
But it doesn't work and I have no idea :-(

I have append both portlets as an Maven project.
Can anyone help me?

Kind regrads
Rolf
thumbnail
Neil Griffin, geändert vor 9 Jahren.

RE: Share attributes between portlets deployed as individual WARs (Antwort)

Liferay Legend Beiträge: 2655 Beitrittsdatum: 27.07.05 Neueste Beiträge
I haven't tried this in a long time, but I would recommend that you try "Method 2 - Sharing attributes from the portal to portlets" and make sure that you get/set attributes using PortletSession.APPLICATION_SCOPE.
thumbnail
saleem khan, geändert vor 9 Jahren.

RE: Share attributes between portlets deployed as individual WARs (Antwort)

Junior Member Beiträge: 71 Beitrittsdatum: 16.11.13 Neueste Beiträge
hi..
I am unable to download the attachment dont no y,

Here i will tell you how to do it shown below

Step1:Add the following line in liferay-portlet.xml
<private-session-attributes>false</private-session-attributes>

Step2: Set the attribute as below
portletSession.setAttribute("DATA",value, PortletSession.APPLICATION_SCOPE);

Step3: get the attribute
portletSession.getAttribute("DATA",PortletSession.APPLICATION_SCOPE);
Rolf Lehnert, geändert vor 9 Jahren.

RE: Share attributes between portlets deployed as individual WARs

New Member Beiträge: 5 Beitrittsdatum: 30.08.13 Neueste Beiträge
Hi,

thank you both and sorry for the late feedback.
Unfortunately, I was busy with other urgent problem in the last few days.
You are both right.
I have set the attribute by using "PortletSession.APPLICATION_SCOPE", but I have forgotten it while reading the attribute back.
Now it works.

Thanks again
Regards
Rolf
Suresh Gurusamy, geändert vor 9 Jahren.

RE: Share attributes between portlets deployed as individual WARs

New Member Beiträge: 2 Beitrittsdatum: 27.08.14 Neueste Beiträge