Author: mwringe
Date: 2010-03-31 16:41:25 -0400 (Wed, 31 Mar 2010)
New Revision: 2424
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
Log:
GTNPORTAL-905: use a TransitiveApplicationState instead of a ClonedApplicationState when
adding new portlets to a page. This prevents an issue when multiple portlets loaded on a
page share the same state instead of having individual values.
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2010-03-31
19:42:57 UTC (rev 2423)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/portal/UIPortalComponentActionListener.java 2010-03-31
20:41:25 UTC (rev 2424)
@@ -25,6 +25,7 @@
import org.exoplatform.portal.application.PortalRequestContext;
import org.exoplatform.portal.config.UserACL;
import org.exoplatform.portal.config.UserPortalConfigService;
+import org.exoplatform.portal.config.model.ApplicationState;
import org.exoplatform.portal.config.model.ApplicationType;
import org.exoplatform.portal.config.model.CloneApplicationState;
import org.exoplatform.portal.config.model.Container;
@@ -376,7 +377,18 @@
}
else
{
- CloneApplicationState state = new
CloneApplicationState<Object>(app.getStorageId());
+ ApplicationState state;
+ // if we have a new portlet added to the page we need for it to have
its own state.
+ // otherwise all new portlets added to a page will have the same
state.
+ if (newComponent)
+ {
+ state = new
TransientApplicationState<Object>(app.getContentId());
+ }
+ // if the portlet is not new, then we should clone it from the original
portlet
+ else
+ {
+ state = new
CloneApplicationState<Object>(app.getStorageId());
+ }
uiPortlet.setState(new PortletState(state, applicationType));
}
uiPortlet.setPortletInPortal(uiTarget instanceof UIPortal);