Author: chris.laprun(a)jboss.com
Date: 2009-01-30 14:43:36 -0500 (Fri, 30 Jan 2009)
New Revision: 12733
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerResponseFactory.java
Log:
- JBPORTAL-2273: real fix: when we get an OpaqueStateString just transmit it as is since
chances are it cannot be interpreted
(unless it was encoded by a Portal producer) and we cannot use the information locally to
mix in the public navigational
state anyway.
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerResponseFactory.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerResponseFactory.java 2009-01-30
19:37:25 UTC (rev 12732)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/controller/portlet/ControllerResponseFactory.java 2009-01-30
19:43:36 UTC (rev 12733)
@@ -1,6 +1,6 @@
/******************************************************************************
* JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * Copyright 2009, Red Hat Middleware, LLC, and individual *
* contributors as indicated by the @authors tag. See the *
* copyright.txt in the distribution for a full listing of *
* individual contributors. *
@@ -86,37 +86,35 @@
StateString state = renderResult.getNavigationalState();
- Map<String, String[]> stringMap;
+ // if we are in the local case, decode the parameters and mix in public
navigational state if needed
+ // in the WSRP case, we get an OpaqueStateString that we just pass along as is
if (state instanceof ParametersStateString)
{
- stringMap = ((ParametersStateString)state).getParameters();
- }
- else
- {
- stringMap = StateString.decodeOpaqueValue(state.getStringValue());
- }
- Map<String, String[]> parameters = new HashMap<String,
String[]>(stringMap);
+ Map<String, String[]> stringMap =
((ParametersStateString)state).getParameters();
- if (pns != null)
- {
+ Map<String, String[]> parameters = new HashMap<String,
String[]>(stringMap);
- //
- for (ParameterInfo parameterInfo :
portletInfo.getNavigation().getPublicParameters())
+ if (pns != null)
{
- String key = parameterInfo.getId();
-
//
- String[] values = pns.getParameter(parameterInfo.getName());
-
- //
- if (values != null)
+ for (ParameterInfo parameterInfo :
portletInfo.getNavigation().getPublicParameters())
{
- parameters.put(key, values);
+ String key = parameterInfo.getId();
+
+ //
+ String[] values = pns.getParameter(parameterInfo.getName());
+
+ //
+ if (values != null)
+ {
+ parameters.put(key, values);
+ }
}
}
+ state = ParametersStateString.create(parameters);
}
- return new PortletWindowActionResponse(targetId, windowState, mode,
ParametersStateString.create(parameters));
+ return new PortletWindowActionResponse(targetId, windowState, mode, state);
}
else
{