Author: chris.laprun(a)jboss.com
Date: 2009-10-30 14:31:16 -0400 (Fri, 30 Oct 2009)
New Revision: 463
Modified:
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
Log:
- Use public navigational state updates given by the portlet container instead of
inferring it from the portal state.
- Removed now unused getRenderParameterMap method on UIPortlet.
Modified:
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java
===================================================================
---
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2009-10-30
15:47:22 UTC (rev 462)
+++
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortlet.java 2009-10-30
18:31:16 UTC (rev 463)
@@ -49,7 +49,6 @@
import org.gatein.common.i18n.LocalizedString;
import org.gatein.common.net.media.MediaType;
import org.gatein.pc.api.Mode;
-import org.gatein.pc.api.ParametersStateString;
import org.gatein.pc.api.Portlet;
import org.gatein.pc.api.PortletContext;
import org.gatein.pc.api.PortletInvoker;
@@ -151,7 +150,7 @@
private List<String> supportedPublicParams_;
private boolean portletInPortal_ = true;
private StateString navigationalState;
-// private Map<String, String[]> publicNavigationalStateChanges;
+ private Map<String, String[]> publicNavigationalStateChanges;
public UIPortlet()
{
@@ -650,11 +649,10 @@
}
// Navigational state
- StateString navigationalState =
ParametersStateString.create(getRenderParameterMap());
invocation.setNavigationalState(navigationalState);
// Public navigational state
- invocation.setPublicNavigationalState(this.getPublicParameters());
+ invocation.setPublicNavigationalState(publicNavigationalStateChanges);
// Mode
invocation.setMode(Mode.create(getCurrentPortletMode().toString()));
@@ -717,44 +715,6 @@
return invocation;
}
- /** This method returns all the parameters supported by the targeted portlets, both
the private and public ones */
- private Map<String, String[]> getRenderParameterMap()
- {
- Map<String, String[]> publicParams = getPublicParameters();
- Map<String, String[]> renderParams;
-
- if (navigationalState == null)
- {
- return publicParams;
- }
- else
- {
- if (navigationalState instanceof ParametersStateString)
- {
- // if the navigational state is not opaque, retrieve the parameter map
- ParametersStateString parametersStateString =
(ParametersStateString)navigationalState;
- renderParams = parametersStateString.getParameters();
- }
- else
- {
- // if we have an opaque navigation state, just add it as it to the param map
under the proper key
- renderParams = new HashMap<String, String[]>(publicParams.size() + 1);
- renderParams.put(ExoPortletInvocationContext.NAVIGATIONAL_STATE_PARAM_NAME,
new String[]{navigationalState.getStringValue()});
- }
-
- /*
- * handle public params to only get the one supported by the targeted
- * portlet
- */
- Map<String, String[]> allParams = new HashMap<String,
String[]>(renderParams);
- allParams.putAll(publicParams);
-
- return allParams;
- }
- }
-
- //
-
public void update(PropertyChange... changes) throws Exception
{
PortletContext portletContext = getPortletContext();
@@ -880,8 +840,8 @@
this.navigationalState = navigationalState;
}
- /*void setPublicNavigationalStateUpdates(Map<String, String[]>
publicNavigationalStateUpdates)
+ void setPublicNavigationalStateUpdates(Map<String, String[]>
publicNavigationalStateUpdates)
{
this.publicNavigationalStateChanges = publicNavigationalStateUpdates;
- }*/
-}
+ }
+}
\ No newline at end of file
Modified:
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java
===================================================================
---
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2009-10-30
15:47:22 UTC (rev 462)
+++
portal/branches/wsrp-integration/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletActionListener.java 2009-10-30
18:31:16 UTC (rev 463)
@@ -153,8 +153,7 @@
setNextMode(uiPortlet, mode);
// set the public params
- HttpServletRequest request = prcontext.getRequest();
- setupPublicRenderParams(uiPortlet, request.getParameterMap());
+ setupPublicRenderParams(uiPortlet,
navStateResponse.getPublicNavigationalStateUpdates());
/*
* Cache the render parameters in the UI portlet component to handle the
@@ -166,10 +165,8 @@
//
StateString navigationalState = navStateResponse.getNavigationalState();
uiPortlet.setNavigationalState(navigationalState);
+
uiPortlet.setPublicNavigationalStateUpdates(navStateResponse.getPublicNavigationalStateUpdates());
- // todo: this might be needed for a proper handling of PRPs but need to
understand UIPortlet behavior better first
-//
uiPortlet.setPublicNavigationalStateUpdates(navStateResponse.getPublicNavigationalStateUpdates());
-
//
/*