[
https://jira.jboss.org/jira/browse/JBPORTAL-2232?page=com.atlassian.jira....
]
Thomas Heute resolved JBPORTAL-2232.
------------------------------------
Resolution: Done
Assignee: Thomas Heute (was: Chris Laprun)
Thanks a lot for digging into this ! Looks like this wasn't tested by the TCK
I've also added EventInvocation because preferences can also be change during the
event phase.
Changes made to PortletPreferences do not persist during a JSR 286
serveResource method call
--------------------------------------------------------------------------------------------
Key: JBPORTAL-2232
URL:
https://jira.jboss.org/jira/browse/JBPORTAL-2232
Project: JBoss Portal
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Portal Portlet
Affects Versions: 2.7.0 Final
Environment: N/A
Reporter: Philip Kedy
Assignee: Thomas Heute
Fix For: 2.7.1 Final
When executing the code below from a serveResource method the value is not persisted. No
exceptions show up in the log.
PortletPreferences preferences = request.getPreferences();
preferences.setValue("test", "set from resource");
preferences.store(); // Does not work
Of course the same code works as expected from an action request.
PortletPreferences preferences = request.getPreferences();
preferences.setValue("test", "set from action");
preferences.store(); // Works
I believe I have tracked down the issue by stepping through the JBP 2.7 and Portlet
Container 2.0 source code.
Problem:
In org.jboss.portal.portlet.state.producer.ProducerPortletInvoker - around line
232:
The invocation object is missing an instanceof test for ResourceInvocation.
Current code:
if (invocation instanceof ActionInvocation && status ==
AbstractPropertyContext.UPDATE_SUCCESSFUL)
Proposed code:
if ((invocation instanceof ActionInvocation || invocation instanceof
ResourceInvocation) && status == AbstractPropertyContext.UPDATE_SUCCESSFUL)
I tested this by patching portal-portlet-lib.jar with the revision above and it seems to
work.
Hope this helps.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira