-
1. Re: How to access portlet preferences when not logged in
peterj Aug 24, 2007 11:17 AM (in response to andersf)Preferences are stored based on the logged-in user, therefore they can be changed only if there is a user is logged in. When not logged in, only the default preference settings in portlet.xml, or in portlet-instances.xml, can be used.
-
2. Re: How to access portlet preferences when not logged in
andersf Sep 4, 2007 11:35 AM (in response to andersf)Thank you, Peter!
Now I know that it is only possible to use the programmatically stored preferences if you're logged in. -
3. Re: How to access portlet preferences when not logged in
tomstrummer Mar 26, 2008 4:51 PM (in response to andersf)So if I created a portlet instance via the management portlet there's absolutely no way to assign 'default preferences' for non-logged-in users?
-
4. Re: How to access portlet preferences when not logged in
theute Mar 26, 2008 5:08 PM (in response to andersf)default preferences are those at the portlet instance level or portlet level
-
5. Re: How to access portlet preferences when not logged in
tomstrummer Mar 26, 2008 5:19 PM (in response to andersf)Right... So can I access the "portlet instance level" preferences through the management portlet? Or do I have to edit a portlet-instances.xml file? Because normally that file won't have a record of instances I've created through the management applet, right?
Thanks. -
6. Re: How to access portlet preferences when not logged in
theute Mar 26, 2008 9:18 PM (in response to andersf)Both ways, look at the "Instances" tab of the admin portlet
-
7. Re: How to access portlet preferences when not logged in
tomstrummer Mar 27, 2008 8:40 AM (in response to andersf)I see; when I go to the instances tab, a few have a preferences link, but most of the others do not.
Namely, I'm using the iframe portlet, which definitely uses the portlet preferences API. But there is no preferences link in the admin portlet for any of the iframe instances I've created.
Can you explain the difference between how the iframe portlet uses preferences and how, for instance, the news portlet or weather portlet uses them?
Thanks again.
-Tom -
8. Re: How to access portlet preferences when not logged in
tomstrummer Apr 2, 2008 9:19 AM (in response to andersf)"tomstrummer" wrote:
I see; when I go to the instances tab, a few have a preferences link, but most of the others do not.
Namely, I'm using the iframe portlet, which definitely uses the portlet preferences API. But there is no preferences link in the admin portlet for any of the iframe instances I've created.
Can you explain the difference between how the iframe portlet uses preferences and how, for instance, the news portlet or weather portlet uses them?
*bump*
Any ideas? I would love to know the answer to this. Thanks. -
9. Re: How to access portlet preferences when not logged in
tomstrummer Apr 8, 2008 4:26 PM (in response to andersf)Finally figured out the answer.
Put something like the following in portlet.xml:<portlet-preferences> <preference> <name>expires</name> <value>180</value> </preference> <preference> <name>RssXml</name> <value>http://xml.weather.yahoo.com/forecastrss?p=33145</value> <read-only>false</read-only> </preference> </portlet-preferences> </portlet> </portlet-app>
The names have to match what's being used in your code when you pull preference values. But anything that's defined there shows up on a "preferences" page in the admin portlet once you've created a portlet instance.
See also Portlet 1.0 spec, section PLT.14.3 (bottom of p58, 59)