This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Michaello Maier
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic