portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r760400 - /portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java
Date Tue, 31 Mar 2009 11:29:08 GMT
Author: ate
Date: Tue Mar 31 11:29:06 2009
New Revision: 760400

URL: http://svn.apache.org/viewvc?rev=760400&view=rev
Log:
Ensure settting a PortletMode/WindowState to a null value actually is applied

Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java?rev=760400&r1=760399&r2=760400&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java
Tue Mar 31 11:29:06 2009
@@ -80,7 +80,10 @@
                 if (requestStates.getTargetWindowId() != null && entry.getKey().equals(requestStates.getTargetWindowId()))
                 {
                     requestStates.setTargetWindowId(null);
-                    targetResolved = false;
+                    if (PortalURL.URLType.RENDER != requestStates.getURLType())
+                    {
+                        targetResolved = false;
+                    }
                 }
             }
             else
@@ -207,24 +210,29 @@
                 PortletApplication pa = window.getPortletDefinition().getApplication();
                 windowState = pa.getMappedWindowState(windowState);
             }
-            String windowId = window.getId().toString();
-            PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(windowId);
-            if (state != null && (state.getWindowState() == null || !state.getWindowState().equals(windowState)))
-            {
-                state.setWindowState(windowState);
-            }
-            else
+        }
+        String windowId = window.getId().toString();
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(windowId);
+        if (state != null)
+        {
+            if ((state.getWindowState() == null && windowState != null) || 
+                (windowState == null && state.getWindowState() != null) || 
+                (windowState != null && !state.getWindowState().equals(windowState)))
             {
-                state = new PortletWindowRequestNavigationalState(windowId);
-                state.setPortletDefinition(window.getPortletDefinition());
-                state.resolveActionScopedRequestAttributes();
-                requestStates.addPortletWindowNavigationalState(windowId, state);
                 state.setWindowState(windowState);
             }
-            if (windowState.equals(WindowState.MAXIMIZED))
-            {
-                requestStates.setMaximizedWindow(window);
-            }
+        }
+        else
+        {
+            state = new PortletWindowRequestNavigationalState(windowId);
+            state.setPortletDefinition(window.getPortletDefinition());
+            state.resolveActionScopedRequestAttributes();
+            requestStates.addPortletWindowNavigationalState(windowId, state);
+            state.setWindowState(windowState);
+        }
+        if (windowState != null && windowState.equals(WindowState.MAXIMIZED))
+        {
+            requestStates.setMaximizedWindow(window);
         }
     }
 
@@ -272,21 +280,26 @@
                 PortletApplication pa = window.getPortletDefinition().getApplication();
                 portletMode = pa.getMappedPortletMode(portletMode);
             }
-            String windowId = window.getId().toString();
-            PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(windowId);
-            if (state != null && (state.getPortletMode() == null || !state.getPortletMode().equals(portletMode)))
-            {
-                state.setPortletMode(portletMode);
-            }
-            else
+        }
+        String windowId = window.getId().toString();
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(windowId);
+        if (state != null)
+        {
+            if ((state.getPortletMode() == null && portletMode != null) || 
+                (portletMode == null && state.getPortletMode() != null) || 
+                (portletMode != null && !state.getPortletMode().equals(portletMode)))
             {
-                state = new PortletWindowRequestNavigationalState(windowId);
-                state.setPortletDefinition(window.getPortletDefinition());
-                state.resolveActionScopedRequestAttributes();
-                requestStates.addPortletWindowNavigationalState(windowId, state);
                 state.setPortletMode(portletMode);
             }
         }
+        else
+        {
+            state = new PortletWindowRequestNavigationalState(windowId);
+            state.setPortletDefinition(window.getPortletDefinition());
+            state.resolveActionScopedRequestAttributes();
+            requestStates.addPortletWindowNavigationalState(windowId, state);
+            state.setPortletMode(portletMode);
+        }
     }
 
     public Map<String, String[]> getParameterMap(PortletWindow window)



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message