-
1. Re: Unable to persist preferences.
roy.russo Jul 19, 2006 6:05 PM (in response to peterj)This is working in CVS Head, so I'm thinking its probably fixed in CR2.
I have modified the zip in the weatherportlet when logged in, and now it shows the weather in ATL... after login.
I have modified the newsportlet as well (http://finance.yahoo.com/rss/headline?s=MCD) and it shows me mcdonalds news when logged in. -
2. Re: Unable to persist preferences.
peterj Jul 19, 2006 6:34 PM (in response to peterj)I didn't say that the weather portlet was not working. I can see the local weather with it just fine. But the reason that it works is that the processAction methods sets "newZip" in the response parameters and then redirects to the view. The view then uses the "newZip" parameter, and not the value from the preferences. If there is no "newZip" parameter, then the weather in Miami shows, which is what is set in portlet.xml.
I have been digging through the code and have come to the conclusion that this problem is all related to a configuration setting. That is, if the portlet is configured to treat preferences as read-only, it will ignore all changes. Code in PortletPreferencesImpl.sotre():if (prefs.isReadOnly() == false) { PropertyChange[] changes = (PropertyChange[])updates.values().toArray(new PropertyChange[updates.size()]); prefs.update(changes); }
But I have not yet found where the "isReadOnly()" value of "prefs" originates. Seems that every class is getting it from somewhere else. Someone someplace must be setting the original value, but I haven't tracked it down yet.
This is not to be confused with the user not having write privileges on the preferences, in which case an exception gets thrown when the PortletPreferences.setvalue() method is called (such as when you are not logged into the portal). -
3. Re: Unable to persist preferences.
peterj Jul 19, 2006 7:10 PM (in response to peterj)I downloaded jboss-portal-2.4 from CVS, built and deployed it, and then deployed my modified weather portlet, and now the log shows the proper data:
newZip=92691 RssXml=http://xml.weather.yahoo.com/forecastrss?p=92691
So you are correct, Roy, it is fixed in CR2. Thanks for the help.