Meaningless Drivel is fun!*
The moose likes Portals and Portlets and the fly likes share (user/preference) data between portlets (ipc with jsr 286 ?) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Portals and Portlets
Bookmark "share (user/preference) data between portlets (ipc with jsr 286 ?)" Watch "share (user/preference) data between portlets (ipc with jsr 286 ?)" New topic
Author

share (user/preference) data between portlets (ipc with jsr 286 ?)

Michaello Maier
Greenhorn

Joined: Jun 22, 2010
Posts: 2
Hello all,
i am new to that great forum and a newbie in developing portlets. I hope you can help me.

I have two portlets. The first one should be the peferences Portlet.
There i use the 'PortletPreferences' Class to store user specific preferences.

The second portlet needs access to those preferences.
I tried it with the PortletSession.APPLICATION_SCOPE
In the doView() Method of portlet 1 i get the preferences and set the Attribute in the Application_Scope.

But this solution only works with an refresh of the page.
But i need those information (from the first portlet) at the first renderPhase of the second portlet.

I use Liferay 5.2.0 on Tomcat as portlet container.
So far i know liferay 5.2.0 is compatible to jsr 286 (portlet 2.0 api).
So how can i send an Message from the first portlet to the second portlet in the doview() method?

Or exist other solution of my problem? Maybe userscope/usersession/userattribute and how to use it?

Is there any description of ipc(interportlet communication)?

Sorry, for my bad english.

Thanks a ton in advance!
Best regards,
Sunny
UdayKiran Pamu
Greenhorn

Joined: Jul 20, 2010
Posts: 1
Hi Sunny,

Could you please let me know whether you are able to solve your issue. I am also having similar issue. I need to share portlet preferances with another portlet.

Regards
Uday
Michaello Maier
Greenhorn

Joined: Jun 22, 2010
Posts: 2
Hi Uday,
i find a solution which is working for me. But i think it could exist a better one. Hope somewone else have a better solution.

I still use the PortletSession.APPLICATION_SCOPE
For those preferences i want to set i set these preferences in all portlets.

So, if i change some values in the settings of one Portlet i define the settings within the Applicationscope in the processAction() Method.
After this method the whole page render again.

So i can access in all other portlets the attribute in the ApplicationScope and test it if it is !=null.

Then i can set the preferences for these portlets who need this preference and save it.
When you sign in, all the portlets have this setting.

Hope i could help,

best regards,
sunny


 
Consider Paul's rocket mass heater.
 
subject: share (user/preference) data between portlets (ipc with jsr 286 ?)