Author: julien(a)jboss.com
Date: 2008-01-23 10:23:47 -0500 (Wed, 23 Jan 2008)
New Revision: 9577
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletController.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java
Log:
- fixed some state management bug for resource serving
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletController.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletController.java 2008-01-23
14:39:46 UTC (rev 9576)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletController.java 2008-01-23
15:23:47 UTC (rev 9577)
@@ -180,40 +180,52 @@
PortletResourceRequest portletResourceRequest =
(PortletResourceRequest)containerRequest;
//
- Mode mode;
- WindowState windowState;
+ Mode mode = null;
+ WindowState windowState = null;
+ PageNavigationalState pageNS = null;
+ ParameterMap publicNS = null;
+ StateString portletNS = null;
CacheabilityType cacheability;
- ParameterMap publicNS;
- StateString portletNS;
- PageNavigationalState pageNS;
+
+ //
if (portletResourceRequest instanceof PortletScopedPortletResourceRequest)
{
PortletScopedPortletResourceRequest portletScopedRequest =
(PortletScopedPortletResourceRequest)portletResourceRequest;
mode = portletScopedRequest.mode;
windowState = portletScopedRequest.windowState;
portletNS = portletScopedRequest.navigationalState;
+
+ //
if (portletResourceRequest instanceof PageScopedFullPortletResourceRequest)
{
PageScopedFullPortletResourceRequest pageScopedRequest =
(PageScopedFullPortletResourceRequest)portletResourceRequest;
pageNS = pageScopedRequest.pageState;
- publicNS = pageNS.getPublicNavigationalState(portlet);
cacheability = CacheabilityType.PAGE;
+
+ //
+ if (pageNS != null)
+ {
+ publicNS = pageNS.getPublicNavigationalState(portlet);
+ }
}
else
{
- publicNS = new ParameterMap();
cacheability = CacheabilityType.PORTLET;
- pageNS = null;
}
}
else
{
- publicNS = new ParameterMap();
cacheability = CacheabilityType.FULL;
+ }
+
+ //
+ if (mode == null)
+ {
mode = Mode.VIEW;
+ }
+ if (windowState == null)
+ {
windowState = WindowState.NORMAL;
- portletNS = null;
- pageNS = null;
}
//
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java 2008-01-23
14:39:46 UTC (rev 9576)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java 2008-01-23
15:23:47 UTC (rev 9577)
@@ -208,22 +208,25 @@
//
if (cacheability != CacheabilityType.FULL)
{
- StateString portletNS = windowNS.getPortletNavigationalState();
- if (portletNS != null)
+ if (windowNS != null)
{
- parameters.put("navigationalstate",
windowNS.getPortletNavigationalState().getStringValue());
- }
+ StateString portletNS = windowNS.getPortletNavigationalState();
+ if (portletNS != null)
+ {
+ parameters.put("navigationalstate",
windowNS.getPortletNavigationalState().getStringValue());
+ }
- //
- parameters.put("mode", windowNS.getMode().toString());
+ //
+ parameters.put("mode", windowNS.getMode().toString());
- //
- parameters.put("windowstate",
windowNS.getWindowState().toString());
+ //
+ parameters.put("windowstate",
windowNS.getWindowState().toString());
- //
- if (cacheability == CacheabilityType.PAGE)
- {
- parameters.put("context", context);
+ //
+ if (cacheability == CacheabilityType.PAGE)
+ {
+ parameters.put("context", context);
+ }
}
}
}
Show replies by date