• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

regulate preferences

 
Randy Daal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to know how I could regulate the preferences in a JSR168,
so that there is a similar situation with the PortletData & PortletConfig
objects from theIBM API.

Because what I'm missing is a preference object by user (edit mode) like
in the IBM API.

At the moment this is solved by putting the userid in the preference
name, but I thought there had to be a better solution for this.

I hope I gave you a clear explanation and you (or someone you know)
could help me with this.
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Randy Randy",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted, often without warning

thanks,
Dave
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
PortletPreferences are pretty much the same as PortletData, with the exception of being able to use APPLICATION_SCOPE, which is actually a benefit.

This best practices guide provides a little bit of insight on when it is appropriate to use PortletPreferences in a JSR-168 portlet, and when it is not.

The Dangers of Using PortletPreferences: Best Practices for JSR-168 Portlet Development with JetSpeed2 and WebSphere Portal Server


What are you trying to do with PortletConfig? The PortletContext provides a portlet-application wide scope, which is kewl. If you really need a preference like that, you could just throw a Portlet ID into a database table, and store information the same way you would have with PortletConfig.

PortletConfig was overrated, and rarely used properly, from what I saw. Nobody really understood it (you and me exclueded, of course).

What is the goal you're tyring to achieve? Got a scenario? Maybe I could help you out more if you did.

Cheers!

-Cameron McKenzie
[ March 03, 2007: Message edited by: Cameron W. McKenzie ]
 
Randy Daal
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your reaction,

I will try to give a clear scenario

The portlet i'm am building is going to be used by 300/400 people.
When they log on they all have a unique user id and they
al can manage there own portlet.

When the jsp is called the portlet has to know wich userpreferences it has to cal (links on the left or the right,large fonts small fonts etc.).
I now solved this by putting the user id in front of the preference (userid.preference).
But i just wanted to know if there was a better solution for this.

hope this clears things up a bit.
thanks already.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic