portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r757118 [1/2] - in /portals/jetspeed-2/portal/trunk: components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/ components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/ components/jetspeed-po...
Date Sun, 22 Mar 2009 02:50:29 GMT
Author: rwatler
Date: Sun Mar 22 02:50:28 2009
New Revision: 757118

URL: http://svn.apache.org/viewvc?rev=757118&view=rev
Log:
Initial Coding for JS2-925->JS2-939
---------------------------------------------------
- added actionScopeId, actionScopeRendered, cacheLevel, resourceId, privateRenderParameters, and publicRenderParameters
  render parameters support to request and session navigation state and portal urls
- integrated additional parameters with PortletURLProvider used with Pluto 2.0 interfaces
- supported action scoped request attributes container runtime option

- TODO: ServletRequestImpl needs to merge new render parameters
- TODO: Review rules used to determine when new render parameters are encoded on Portlet/Portal URLs
- TODO: Investigate optimization of public render parameter names on Portlet/Portal URLs using persistently stored short/numeric ids
- TODO: Extend unit test cases to test new render parameters


Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/NavigationalStateCodec.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowExtendedNavigationalState.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowRequestNavigationalState.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowRequestNavigationalStates.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowSessionNavigationalStates.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/SessionNavigationalState.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/window/impl/PortletWindowImpl.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/state/MutableNavigationalState.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/state/NavigationalState.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/url/PortalURL.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/ContainerRuntimeOption.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java?rev=757118&r1=757117&r2=757118&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java Sun Mar 22 02:50:28 2009
@@ -51,6 +51,8 @@
     private Map<String, String[]> renderParameters;
     private Map<String, String[]> publicRenderParameters;
     private Map<String, List<String>> properties;
+    private String actionScopeID;
+    private boolean actionScopeRendered;
 
     private PortalURL url;
     
@@ -132,6 +134,26 @@
     {
         this.resourceID = resourceID;
     }
+
+    public String getActionScopeID()
+    {
+        return actionScopeID;
+    }
+    
+    public void setActionScopeID(String actionScopeID)
+    {
+        this.actionScopeID = actionScopeID;
+    }
+    
+    public boolean isActionScopeRendered()
+    {
+        return actionScopeRendered;
+    }
+    
+    public void setActionScopeRendered(boolean actionScopeRendered)
+    {
+        this.actionScopeRendered = actionScopeRendered;
+    }
     
     public void apply()
     {
@@ -185,8 +207,7 @@
         
         if (toURL)
         {
-            // TODO: handle public and private render parameters, resourceID, cacheLevel, actionScopeID
-            return url.createPortletURL(portletWindow,renderParms,portletMode,windowState,urlType,secure);
+            return url.createPortletURL(portletWindow, renderParms, actionScopeID, actionScopeRendered, cacheLevel, resourceID, privateRenderParms, publicRenderParms, portletMode, windowState, urlType, secure);
         }
         else
         {
@@ -194,7 +215,12 @@
             navState.setMode(portletWindow, portletMode);
             navState.setState(portletWindow, windowState);
             navState.setParametersMap(portletWindow, renderParms);
-            // TODO: privateRenderParms, publicRenderParms, resourceID, cacheLevel, actionScopeID
+            navState.setActionScopeId(portletWindow, actionScopeID);
+            navState.setActionScopeRendered(portletWindow, actionScopeRendered);
+            navState.setCacheLevel(portletWindow, cacheLevel);
+            navState.setResourceId(portletWindow, resourceID);
+            navState.setPrivateRenderParametersMap(portletWindow, privateRenderParms);
+            navState.setPublicRenderParametersMap(portletWindow, publicRenderParms);
             return null;
         }
     }

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=757118&r1=757117&r2=757118&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 Sun Mar 22 02:50:28 2009
@@ -20,9 +20,11 @@
 import java.util.Collections;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Set;
 
 import javax.portlet.PortletMode;
 import javax.portlet.WindowState;
+import javax.xml.namespace.QName;
 
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.cache.JetspeedContentCache;
@@ -70,58 +72,54 @@
         return requestStates;
     }
     
-    public void setState(PortletWindow window, WindowState windowState)
+    public boolean getActionScopedRequestAttributes(PortletWindow window)
     {
-        if ( windowState != null )
-        {
-            if (!JetspeedActions.getStandardWindowStates().contains(windowState))
-            {
-                PortletApplication pa = (PortletApplication)window.getPortletEntity().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
-            {
-                state = new PortletWindowRequestNavigationalState(windowId);
-                requestStates.addPortletWindowNavigationalState(windowId, state);
-                state.setWindowState(windowState);
-            }
-            if (windowState.equals(WindowState.MAXIMIZED))
-            {
-                requestStates.setMaximizedWindow(window);
-            }
-        }
+        // utilize codec to access portlet definition runtime options
+        return codec.getActionScopedRequestAttributes(window);
+    }
+    
+    public boolean getActionScopedRequestAttributes(String windowId)
+    {
+        // utilize codec to access portlet definition runtime options
+        return codec.getActionScopedRequestAttributes(windowId);
     }
 
-    public void setMode(PortletWindow window, PortletMode portletMode)
+    public QName getPublicRenderParameterQName(PortletWindow window, String identifier)
     {
-        if ( portletMode != null )
-        {
-            if (!JetspeedActions.getStandardPortletModes().contains(portletMode))
-            {
-                PortletApplication pa = (PortletApplication)window.getPortletEntity().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
-            {
-                state = new PortletWindowRequestNavigationalState(windowId);
-                requestStates.addPortletWindowNavigationalState(windowId, state);
-                state.setPortletMode(portletMode);
-            }
-        }
+        // utilize codec to access portlet application public render parameter
+        return codec.getPublicRenderParameterQName(window, identifier);
+    }
+    
+    public QName getPublicRenderParameterQName(String windowId, String identifier)
+    {
+        // utilize codec to access portlet application public render parameter
+        return codec.getPublicRenderParameterQName(windowId, identifier);
+    }
+    
+    public Map<String, QName> getPublicRenderParameterNamesMap(PortletWindow window)
+    {
+        // utilize codec to access portlet application public render parameter names
+        return codec.getPublicRenderParameterNamesMap(window);
+    }
+    
+    public Map<String, QName> getPublicRenderParameterNamesMap(String windowId)
+    {
+        // utilize codec to access portlet application public render parameter names
+        return codec.getPublicRenderParameterNamesMap(windowId);
     }
 
+    public boolean hasPublicRenderParameterQNames(PortletWindow window, Set<QName> qnames)
+    {
+        // utilize codec to access portlet application public render parameter names
+        return codec.hasPublicRenderParameterQNames(window, qnames);
+    }
+    
+    public boolean hasPublicRenderParameterQNames(String windowId, Set<QName> qnames)
+    {
+        // utilize codec to access portlet application public render parameter names
+        return codec.hasPublicRenderParameterQNames(windowId, qnames);
+    }
+    
     public WindowState getMappedState(String windowId)
     {
         WindowState windowState = null;
@@ -157,6 +155,39 @@
         return getMappedState(window.getId().toString());
     }
 
+    public void removeState(PortletWindow window)
+    {
+        requestStates.removePortletWindowNavigationalState(window.getId().toString());
+    }
+    
+    public void setState(PortletWindow window, WindowState windowState)
+    {
+        if ( windowState != null )
+        {
+            if (!JetspeedActions.getStandardWindowStates().contains(windowState))
+            {
+                PortletApplication pa = (PortletApplication)window.getPortletEntity().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
+            {
+                state = new PortletWindowRequestNavigationalState(windowId, getActionScopedRequestAttributes(window));
+                requestStates.addPortletWindowNavigationalState(windowId, state);
+                state.setWindowState(windowState);
+            }
+            if (windowState.equals(WindowState.MAXIMIZED))
+            {
+                requestStates.setMaximizedWindow(window);
+            }
+        }
+    }
+
     public PortletMode getMappedMode(String windowId)
     {
         PortletMode portletMode = null;
@@ -192,9 +223,28 @@
         return getMappedMode(window.getId().toString());
     }
 
-    public PortletWindow getMaximizedWindow()
+    public void setMode(PortletWindow window, PortletMode portletMode)
     {
-        return requestStates.getMaximizedWindow();
+        if ( portletMode != null )
+        {
+            if (!JetspeedActions.getStandardPortletModes().contains(portletMode))
+            {
+                PortletApplication pa = (PortletApplication)window.getPortletEntity().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
+            {
+                state = new PortletWindowRequestNavigationalState(windowId, getActionScopedRequestAttributes(window));
+                requestStates.addPortletWindowNavigationalState(windowId, state);
+                state.setPortletMode(portletMode);
+            }
+        }
     }
 
     @SuppressWarnings("unchecked")
@@ -234,12 +284,160 @@
         else
             return null;
     }
+        
+    public void clearParameters(PortletWindow window)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        if (state != null)
+        {
+            Map<String, String[]> map = state.getParametersMap();
+            if (map != null)
+            {
+                map.clear();
+                state.setClearParameters(true);
+            }
+        }
+    }
+    
+    public void setParametersMap(PortletWindow window, Map<String, String[]> parametersMap)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        state.setParametersMap(parametersMap);
+    }
+    
+    public boolean isActionScopedRequestAttributes(PortletWindow window)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        return ((state != null) ? state.isActionScopedRequestAttributes() : false);
+    }
+    
+    public String getActionScopeId(PortletWindow window)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        return ((state != null) ? state.getActionScopeId() : null);
+    }
+    
+    public void setActionScopeId(PortletWindow window, String actionScopeId)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        if (state != null)
+        {
+            state.setActionScopeId(actionScopeId);
+        }
+    }
+
+    public boolean isActionScopeRendered(PortletWindow window)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        return ((state != null) ? state.isActionScopeRendered() : false);
+    }
+
+    public void setActionScopeRendered(PortletWindow window, boolean actionScopeRendered)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        if (state != null)
+        {
+            state.setActionScopeRendered(actionScopeRendered);
+        }
+    }
+
+    public String getCacheLevel(PortletWindow window)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        return ((state != null) ? state.getCacheLevel() : null);
+    }
+
+    public void setCacheLevel(PortletWindow window, String cacheLevel)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        if (state != null)
+        {
+            state.setCacheLevel(cacheLevel);
+        }
+    }
+
+    public String getResourceId(PortletWindow window)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        return ((state != null) ? state.getResourceId() : null);
+    }
+    
+    public void setResourceId(PortletWindow window, String resourceId)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        if (state != null)
+        {
+            state.setResourceId(resourceId);
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public Iterator<String> getPrivateRenderParameterNames(PortletWindow window)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        return (((state != null) && (state.getPrivateRenderParametersMap() != null)) ? state.getPrivateRenderParametersMap().keySet().iterator() : Collections.EMPTY_LIST.iterator());
+    }
+    
+    public String[] getPrivateRenderParameterValues(PortletWindow window, String parameterName)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        return (((state != null) && (state.getPrivateRenderParametersMap() != null)) ? state.getPrivateRenderParametersMap().get(parameterName) : null);
+    }
+
+    public Map<String, String[]> getPrivateRenderParameterMap(PortletWindow window)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        return ((state != null) ? state.getPrivateRenderParametersMap() : null);
+    }
+    
+    public void setPrivateRenderParametersMap(PortletWindow window, Map<String, String[]> privateRenderParametersMap)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        if (state != null)
+        {
+            state.setPrivateRenderParametersMap(privateRenderParametersMap);
+        }
+    }
+
+    @SuppressWarnings("unchecked")
+    public Iterator<String> getPublicRenderParameterNames(PortletWindow window)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        return (((state != null) && (state.getPublicRenderParametersMap() != null)) ? state.getPublicRenderParametersMap().keySet().iterator() : Collections.EMPTY_LIST.iterator());
+    }
+    
+    public String[] getPublicRenderParameterValues(PortletWindow window, String parameterName)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        return (((state != null) && (state.getPublicRenderParametersMap() != null)) ? state.getPublicRenderParametersMap().get(parameterName) : null);
+    }
+
+    public Map<String, String[]> getPublicRenderParameterMap(PortletWindow window)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        return ((state != null) ? state.getPublicRenderParametersMap() : null);
+    }
+    
+    public void setPublicRenderParametersMap(PortletWindow window, Map<String, String[]> publicRenderParametersMap)
+    {
+        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+        if (state != null)
+        {
+            // utilize codec to set/update public render parameters on request state and states
+            codec.setStatePublicRenderParametersMap(requestStates, state, publicRenderParametersMap);
+        }
+    }
     
     public PortalURL.URLType getURLType()
     {
         return requestStates.getURLType();
     }
     
+    public PortletWindow getMaximizedWindow()
+    {
+        return requestStates.getMaximizedWindow();
+    }
+
     public PortletWindow getPortletWindowOfAction()
     {
         return requestStates.getActionWindow();
@@ -250,13 +448,18 @@
         return requestStates.getResourceWindow();
     }
 
-    public String encode(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, boolean action)
+    public String encode(PortletWindow window, Map<String, String[]> parameters, String actionScopeId, boolean actionScopeRendered,
+                         String cacheLevel, String resourceId, Map<String, String[]> privateRenderParameters, Map<String, String[]> publicRenderParameters,
+                         PortletMode mode, WindowState state, boolean action)
     throws UnsupportedEncodingException
     {
-        return encode(window, parameters, mode, state, action ? PortalURL.URLType.ACTION : PortalURL.URLType.RENDER);
+        return encode(window, parameters, actionScopeId, actionScopeRendered, cacheLevel, resourceId, privateRenderParameters, publicRenderParameters,
+                      mode, state, action ? PortalURL.URLType.ACTION : PortalURL.URLType.RENDER);
     }
 
-    public String encode(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, PortalURL.URLType urlType)
+    public String encode(PortletWindow window, Map<String, String[]> parameters, String actionScopeId, boolean actionScopeRendered,
+                         String cacheLevel, String resourceId, Map<String, String[]> privateRenderParameters, Map<String, String[]> publicRenderParameters,
+                         PortletMode mode, WindowState state, PortalURL.URLType urlType)
     throws UnsupportedEncodingException
     {
         if ( mode != null || state != null )
@@ -276,8 +479,8 @@
                 state = pa.getMappedWindowState(state);
             }
         }
-        return codec.encode(requestStates, window, parameters, mode, state, urlType, isNavigationalParameterStateFull(),
-                isRenderParameterStateFull());
+        return codec.encode(requestStates, window, parameters, actionScopeId, actionScopeRendered, cacheLevel, resourceId, privateRenderParameters, publicRenderParameters,
+                            mode, state, urlType, isNavigationalParameterStateFull(), isRenderParameterStateFull());
     }
 
     public String encode(PortletWindow window, PortletMode mode, WindowState state)
@@ -332,7 +535,7 @@
             {
                 if (windowNavState == null)
                 {
-                    windowNavState = new PortletWindowExtendedNavigationalState();
+                    windowNavState = new PortletWindowExtendedNavigationalState(getActionScopedRequestAttributes(window));
                     currentWindowStates.put(window.getId().toString(), windowNavState);
                 }
                 windowNavState.setDecoratorActionEncoding(targetMode, targetState, encodedState);
@@ -350,29 +553,4 @@
     {
         return requestStates.getWindowIdIterator();
     }
-    
-    public void clearParameters(PortletWindow window)
-    {
-        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
-        if (state != null)
-        {
-            Map<String, String[]> map = state.getParametersMap();
-            if (map != null)
-            {
-                map.clear();
-                state.setClearParameters(true);
-            }
-        }
-    }
-    
-    public void removeState(PortletWindow window)
-    {
-        requestStates.removePortletWindowNavigationalState(window.getId().toString());
-    }
-    
-    public void setParametersMap(PortletWindow window, Map<String, String[]> parametersMap)
-    {
-        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
-        state.setParametersMap(parametersMap);
-    }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java?rev=757118&r1=757117&r2=757118&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/HybridNavigationalState.java Sun Mar 22 02:50:28 2009
@@ -46,26 +46,56 @@
         this.prefix = prefix;
     }
     
-    public String encode(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, boolean action)
+    public String encode(PortletWindow window, Map<String, String[]> parameters, String actionScopeId, boolean actionScopeRendered,
+                         String cacheLevel, String resourceId, Map<String, String[]> privateRenderParameters, Map<String, String[]> publicRenderParameters,
+                         PortletMode mode, WindowState state, PortalURL.URLType urlType)
     throws UnsupportedEncodingException
     {
-        return encode(window, parameters, mode, state, action ? PortalURL.URLType.ACTION : PortalURL.URLType.RENDER);
-    }
-    public String encode(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, PortalURL.URLType urlType)
-    throws UnsupportedEncodingException
-    {
-        Map<String, String[]> subset = new HashMap<String, String[]>();
-        Iterator<String> params = parameters.keySet().iterator();
-        while (params.hasNext())
+        // only encode render parameters that start with prefix
+        Map<String, String[]> paramsSubset = null;
+        if (parameters != null)
+        {
+            paramsSubset = new HashMap<String, String[]>();
+            Iterator<String> params = parameters.keySet().iterator();
+            while (params.hasNext())
+            {
+                String key = params.next();
+                if (key.startsWith(prefix))
+                {
+                    paramsSubset.put(key, parameters.get(key));
+                }
+            }
+        }
+        Map<String, String[]> privateRenderParamsSubset = null;
+        if (privateRenderParameters != null)
+        {
+            privateRenderParamsSubset = new HashMap<String, String[]>();
+            Iterator<String> params = privateRenderParameters.keySet().iterator();
+            while (params.hasNext())
+            {
+                String key = params.next();
+                if (key.startsWith(prefix))
+                {
+                    privateRenderParamsSubset.put(key, privateRenderParameters.get(key));
+                }
+            }
+        }
+        Map<String, String[]> publicRenderParamsSubset = null;
+        if (publicRenderParameters != null)
         {
-            String key = params.next();
-            if (key.startsWith(prefix))
+            publicRenderParamsSubset = new HashMap<String, String[]>();
+            Iterator<String> params = publicRenderParameters.keySet().iterator();
+            while (params.hasNext())
             {
-                // only encode params that start with prefix
-                subset.put(key, parameters.get(key));
+                String key = params.next();
+                if (key.startsWith(prefix))
+                {
+                    publicRenderParamsSubset.put(key, publicRenderParameters.get(key));
+                }
             }
         }
-        return super.encode(window, subset, mode, state, urlType);
+        // encode using subsets
+        return super.encode(window, paramsSubset, actionScopeId, actionScopeRendered, cacheLevel, resourceId, privateRenderParamsSubset, publicRenderParamsSubset, mode, state, urlType);
     }
 
     public boolean isNavigationalParameterStateFull()

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java?rev=757118&r1=757117&r2=757118&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateCodec.java Sun Mar 22 02:50:28 2009
@@ -18,21 +18,27 @@
 
 import java.io.UnsupportedEncodingException;
 import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
+import java.util.Set;
 
 import javax.portlet.PortletMode;
 import javax.portlet.WindowState;
+import javax.xml.namespace.QName;
 
 import org.apache.commons.codec.binary.Base64;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.PortalContext;
-import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.container.url.PortalURL;
 import org.apache.jetspeed.container.window.PortletWindowAccessor;
 import org.apache.jetspeed.container.PortletWindow;
+import org.apache.jetspeed.om.portlet.ContainerRuntimeOption;
+import org.apache.jetspeed.om.portlet.PortletApplication;
+import org.apache.jetspeed.om.portlet.PortletDefinition;
+import org.apache.jetspeed.om.portlet.PublicRenderParameter;
 
 /**
  * JetspeedNavigationalStateCodec
@@ -54,6 +60,12 @@
     protected static final char PARAM_KEY = 'e';
     protected static final char CLEAR_PARAMS_KEY = 'f';
     protected static final char RESOURCE_WINDOW_ID_KEY = 'g';
+    protected static final char CACHE_LEVEL_KEY = 'h';
+    protected static final char RESOURCE_ID_KEY = 'i';
+    protected static final char PRIVATE_RENDER_PARAM_KEY = 'j';
+    protected static final char PUBLIC_RENDER_PARAM_KEY = 'k';
+    protected static final char ACTION_SCOPE_ID_KEY = 'l';
+    protected static final char RENDERED_ACTION_SCOPE_ID_KEY = 'm';
     protected static final char[] URLTYPE_ID_KEYS = { 'b', 'g', 'a' };
     
     protected static final String keytable = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
@@ -91,18 +103,19 @@
             throw new UnsupportedOperationException("Too many supported WindowModes found. Can only handle max: "+keytable.length());
         }
     }
-    
+
     public PortletWindowRequestNavigationalStates decode(String parameters, String characterEncoding)
     throws UnsupportedEncodingException
     {
         PortletWindowRequestNavigationalStates states = new PortletWindowRequestNavigationalStates(characterEncoding);
         if ( parameters != null && parameters.length() > 0 ) 
         {
+            // decode parameters
             String decodedParameters = decodeParameters(parameters, characterEncoding);
-            
+
+            // decode arguments and parameters into states
             int position = 0;
-            StringBuffer buffer = new StringBuffer();
-            
+            StringBuffer buffer = new StringBuffer();            
             PortletWindowRequestNavigationalState currentState = null;
             String parameter;
             while ( (position = decodeArgument(position, decodedParameters, buffer, PARAMETER_SEPARATOR )) != -1 )
@@ -110,7 +123,35 @@
                 parameter = buffer.toString();
                 currentState = decodeParameter( windowAccessor, states, currentState, parameter);
             }
-            
+
+            // propagate public parameter state to states
+            if (states.getPublicRenderParametersMap() != null)
+            {
+                Iterator<String> windowIdIter = states.getWindowIdIterator();
+                while (windowIdIter.hasNext())
+                {
+                    PortletWindowRequestNavigationalState state = states.getPortletWindowNavigationalState(windowIdIter.next());
+                    PortletWindow window = windowAccessor.getPortletWindow(state.getWindowId());
+                    if (window != null)
+                    {
+                        PortletApplication pa = window.getPortletEntity().getPortletDefinition().getApplication();
+                        if (pa.getPublicRenderParameters() != null)
+                        {
+                            for (PublicRenderParameter publicRenderParameter : pa.getPublicRenderParameters())
+                            {
+                                QName parameterQName = publicRenderParameter.getQName();
+                                String[] parameterValues = states.getPublicRenderParametersMap().get(parameterQName);
+                                if (parameterValues != null)
+                                {
+                                    state.setPublicRenderParameters(publicRenderParameter.getIdentifier(), parameterValues);
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+
+            // debug decode
             if ( log.isDebugEnabled() )
             {
                 logDecode(states, buffer);
@@ -155,49 +196,80 @@
             {
                 buffer.append(",state:"+currentState.getWindowState());
             }
+            if (currentState.getCacheLevel() != null )
+            {
+                buffer.append(",cache level:"+currentState.getCacheLevel());
+            }
+            if (currentState.getResourceId() != null )
+            {
+                buffer.append(",resource id:"+currentState.getResourceId());
+            }
+            if (currentState.isActionScopedRequestAttributes())
+            {
+                if (currentState.getActionScopeId() != null )
+                {
+                    buffer.append(",action scope id:"+currentState.getActionScopeId());
+                    buffer.append(",action scope rendered:"+currentState.isActionScopeRendered());
+                }
+            }
             if (!currentState.isClearParameters())
             {
                 if (currentState.getParametersMap() != null)
                 {
-                    buffer.append(",parameters:[");
-                    boolean first = true;
-                    Iterator<String> parIter = currentState.getParametersMap().keySet().iterator();
-                    while ( parIter.hasNext() ) 
-                    {
-                        if ( first )
-                        {
-                            first = false;
-                        }
-                        else
-                        {
-                            buffer.append(",");
-                        }
-                        String name = parIter.next();
-                        buffer.append(name+":[");
-                        String[] values = currentState.getParametersMap().get(name);
-                        for ( int i = 0; i < values.length; i++ )
-                        {
-                            if ( i > 0 )
-                            {
-                                buffer.append(",");
-                            }                                    
-                            buffer.append(values[i]);
-                        }
-                        buffer.append("]");
-                    }
+                    logDecode("parameters", currentState.getParametersMap(), buffer);
+                }
+                if (currentState.getPrivateRenderParametersMap() != null)
+                {
+                    logDecode("private render parameters", currentState.getPrivateRenderParametersMap(), buffer);
+                }
+                if (currentState.getPublicRenderParametersMap() != null)
+                {
+                    logDecode("public render parameters", currentState.getPublicRenderParametersMap(), buffer);
                 }
             }
             buffer.append("]");
         }
     }
     
+    private void logDecode(String parameterNameMap, Map<String, String[]> parametersMap, StringBuffer buffer)
+    {
+        buffer.append(",");
+        buffer.append(parameterNameMap);
+        buffer.append(":[");
+        boolean first = true;
+        Iterator<String> parIter = parametersMap.keySet().iterator();
+        while ( parIter.hasNext() ) 
+        {
+            if ( first )
+            {
+                first = false;
+            }
+            else
+            {
+                buffer.append(",");
+            }
+            String name = parIter.next();
+            buffer.append(name+":[");
+            String[] values = parametersMap.get(name);
+            for ( int i = 0; i < values.length; i++ )
+            {
+                if ( i > 0 )
+                {
+                    buffer.append(",");
+                }                                    
+                buffer.append(values[i]);
+            }
+            buffer.append("]");
+        }        
+    }
+
     public String encode(PortletWindowRequestNavigationalStates states, PortletWindow window, PortletMode portletMode, 
-            WindowState windowState, boolean navParamsStateFull, boolean renderParamsStateFull)
+                         WindowState windowState, boolean navParamsStateFull, boolean renderParamsStateFull)
     throws UnsupportedEncodingException
     {
         String windowId = window.getId().toString();
         PortletWindowRequestNavigationalState currentState = states.getPortletWindowNavigationalState(windowId);
-        PortletWindowRequestNavigationalState targetState = new PortletWindowRequestNavigationalState(windowId);
+        PortletWindowRequestNavigationalState targetState = new PortletWindowRequestNavigationalState(windowId, getActionScopedRequestAttributes(window));
         targetState.setPortletMode(portletMode != null ? portletMode : currentState != null ? currentState.getPortletMode() : null);
         targetState.setWindowState(windowState != null ? windowState : currentState != null ? currentState.getWindowState() : null);
 
@@ -220,17 +292,25 @@
         return encode(states, windowId, targetState, PortalURL.URLType.RENDER, navParamsStateFull, renderParamsStateFull);
     }
 
-    public String encode(PortletWindowRequestNavigationalStates states, PortletWindow window, Map<String, String[]> parameters, 
-            PortletMode portletMode, WindowState windowState, PortalURL.URLType urlType, boolean navParamsStateFull, 
-            boolean renderParamsStateFull)
+    public String encode(PortletWindowRequestNavigationalStates states, PortletWindow window, Map<String, String[]> parameters,
+                         String actionScopeId, boolean actionScopeRendered, String cacheLevel, String resourceId,
+                         Map<String, String[]> privateRenderParameters, Map<String, String[]> publicRenderParameters,
+                         PortletMode portletMode, WindowState windowState, PortalURL.URLType urlType, boolean navParamsStateFull, 
+                         boolean renderParamsStateFull)
     throws UnsupportedEncodingException
     {
         String windowId = window.getId().toString();
         PortletWindowRequestNavigationalState currentState = states.getPortletWindowNavigationalState(windowId);
-        PortletWindowRequestNavigationalState targetState = new PortletWindowRequestNavigationalState(windowId);
+        PortletWindowRequestNavigationalState targetState = new PortletWindowRequestNavigationalState(windowId, getActionScopedRequestAttributes(window));
         targetState.setPortletMode(portletMode != null ? portletMode : currentState != null ? currentState.getPortletMode() : null);
         targetState.setWindowState(windowState != null ? windowState : currentState != null ? currentState.getWindowState() : null);
         targetState.setParametersMap(parameters);
+        targetState.setActionScopeId(actionScopeId);
+        targetState.setActionScopeRendered(actionScopeRendered);
+        targetState.setCacheLevel(cacheLevel);
+        targetState.setResourceId(resourceId);
+        targetState.setPrivateRenderParametersMap(privateRenderParameters);
+        setStatePublicRenderParametersMap(states, targetState, publicRenderParameters);
         if ( renderParamsStateFull && parameters == null )
         {
             // Indicate that the saved (in the session) render parameters for this PortletWindow must be cleared
@@ -240,39 +320,80 @@
         return encode(states, windowId, targetState, urlType, navParamsStateFull, renderParamsStateFull);
     }
 
+    public void setStatePublicRenderParametersMap(PortletWindowRequestNavigationalStates requestStates, PortletWindowRequestNavigationalState requestState, Map<String, String[]> publicRenderParametersMap)
+    {
+        // set public render parameters map for state
+        boolean resetStatesPublicRenderParameters = (requestState.getPublicRenderParametersMap() != null);
+        requestState.setPublicRenderParametersMap(publicRenderParametersMap);
+        if (resetStatesPublicRenderParameters)
+        {
+            // reset request states public render parameters map
+            requestStates.setPublicRenderParametersMap(null);
+            // repopulate request states public render parameters map
+            Iterator<String> iter = requestStates.getWindowIdIterator();
+            while (iter.hasNext())
+            {
+                String iterWindowId = iter.next();
+                PortletWindowRequestNavigationalState iterRequestState = requestStates.getPortletWindowNavigationalState(iterWindowId);
+                if (iterRequestState != requestState)
+                {
+                    updateStatesPublicRenderParametersMap(requestStates, iterRequestState, iterRequestState.getPublicRenderParametersMap());
+                }
+            }
+        }
+        // update request states public render parameters map
+        updateStatesPublicRenderParametersMap(requestStates, requestState, publicRenderParametersMap);
+    }
+        
+    public void updateStatesPublicRenderParametersMap(PortletWindowRequestNavigationalStates requestStates, PortletWindowRequestNavigationalState requestState, Map<String, String[]> publicRenderParametersMap)
+    {
+        if (publicRenderParametersMap != null)
+        {
+            // update request states public render parameters map
+            String windowId = requestState.getWindowId();
+            for (Map.Entry<String, String[]> parameter : publicRenderParametersMap.entrySet())
+            {
+                String parameterName = parameter.getKey();
+                String[] parameterValues = parameter.getValue();
+                // get qname for request public render parameter name
+                QName parameterQName = getPublicRenderParameterQName(windowId, parameterName);
+                if (parameterQName != null)
+                {
+                    requestStates.setPublicRenderParameters(parameterQName, parameterValues);
+                }
+            }
+        }            
+    }
+        
     public String encode(PortletWindowRequestNavigationalStates states, boolean navParamsStateFull, boolean renderParamsStateFull)
     throws UnsupportedEncodingException
     {
         return encode(states, null, null, PortalURL.URLType.RENDER, navParamsStateFull, renderParamsStateFull);
     }
+    
     protected String encode(PortletWindowRequestNavigationalStates states, String targetWindowId, 
-            PortletWindowRequestNavigationalState targetState, PortalURL.URLType urlType, boolean navParamsStateFull, 
-            boolean renderParamsStateFull)
+                            PortletWindowRequestNavigationalState targetState, PortalURL.URLType urlType,
+                            boolean navParamsStateFull, boolean renderParamsStateFull)
     throws UnsupportedEncodingException
     {
         StringBuffer buffer = new StringBuffer();
-        String encodedState;
         boolean haveState = false;
+        boolean encodeTargetWindowPublicRenderParams = true;
         
         // skip other states if all non-targeted PortletWindow states are kept in the session
-        if ( !navParamsStateFull || !renderParamsStateFull )
+        if (!navParamsStateFull || !renderParamsStateFull)
         {
-            PortletWindowRequestNavigationalState pwfns;
-            String windowId;
+            // encode individual request states, (skip target request state encoded below)
             Iterator<String> iter = states.getWindowIdIterator();
-            while ( iter.hasNext() )
+            while (iter.hasNext())
             {
-                windowId = iter.next();
-                pwfns = states.getPortletWindowNavigationalState(windowId);
-                if ( targetWindowId != null && windowId.equals(targetWindowId))
+                String windowId = iter.next();
+                PortletWindowRequestNavigationalState requestState = states.getPortletWindowNavigationalState(windowId);
+                if ((targetWindowId == null) || !windowId.equals(targetWindowId))
                 {
-                    // skip it for now, it will be encoded as the last one below
-                }
-                else
-                {
-                    encodedState = encodePortletWindowNavigationalState(windowId, pwfns, PortalURL.URLType.RENDER, navParamsStateFull, 
-                            renderParamsStateFull);
-                    if ( encodedState.length() > 0 )
+                    encodeTargetWindowPublicRenderParams = false;
+                    String encodedState = encodePortletWindowNavigationalState(windowId, requestState, PortalURL.URLType.RENDER, navParamsStateFull, renderParamsStateFull, false);
+                    if (encodedState.length() > 0)
                     {
                         if ( !haveState )
                         {
@@ -287,10 +408,29 @@
                 }
             }
         }
+        // encode target request state
         if (targetWindowId != null)
         {
-            encodedState = encodePortletWindowNavigationalState(targetWindowId, targetState, urlType, false, false); 
-            if ( encodedState.length() > 0 )
+            String encodedState = encodePortletWindowNavigationalState(targetWindowId, targetState, urlType, false, false, encodeTargetWindowPublicRenderParams);
+            if (encodedState.length() > 0)
+            {
+                if (!haveState)
+                {
+                    haveState = true;
+                }
+                else
+                {
+                    buffer.append(PARAMETER_SEPARATOR);
+                }
+                buffer.append(encodedState);
+            }
+        }
+        // encode shared public render parameter request states
+        // if they have not been encoded on the target window
+        if (haveState && !encodeTargetWindowPublicRenderParams)
+        {
+            String encodedState = encodePublicRenderParameterState(states, urlType, navParamsStateFull, renderParamsStateFull);
+            if (encodedState.length() > 0)
             {
                 if ( !haveState )
                 {
@@ -302,24 +442,136 @@
                 }
                 buffer.append(encodedState);
             }
+        }            
+        // return encoded state
+        return (haveState ? encodeParameters(buffer.toString(), states.getCharacterEncoding()) : null);
+    }
+    
+    public boolean getActionScopedRequestAttributes(PortletWindow window)
+    {
+        // get action scoped request attributes option from portlet definition
+        PortletDefinition pd = window.getPortletEntity().getPortletDefinition();
+        ContainerRuntimeOption actionScopedRequestAttributesOption = pd.getContainerRuntimeOption(ContainerRuntimeOption.ACTION_SCOPED_REQUEST_ATTRIBUTES_OPTION);
+        if (actionScopedRequestAttributesOption == null)
+        {
+            actionScopedRequestAttributesOption = pd.getApplication().getContainerRuntimeOption(ContainerRuntimeOption.ACTION_SCOPED_REQUEST_ATTRIBUTES_OPTION);                    
+        }
+        return ((actionScopedRequestAttributesOption != null) && (actionScopedRequestAttributesOption.getValues() != null) && (actionScopedRequestAttributesOption.getValues().size() > 0) && "true".equals(actionScopedRequestAttributesOption.getValues().get(0)));
+    }
+    
+    public boolean getActionScopedRequestAttributes(String windowId)
+    {
+        // access portlet window and get action scoped request attributes option
+        PortletWindow window = windowAccessor.getPortletWindow(windowId);
+        if ( window != null )
+        {
+            return getActionScopedRequestAttributes(window);
+        }
+        return false;
+    }
+
+    public QName getPublicRenderParameterQName(PortletWindow window, String identifier)
+    {
+        // get public render parameter qname from portlet application
+        PortletApplication pa = window.getPortletEntity().getPortletDefinition().getApplication();
+        PublicRenderParameter publicRenderParameter = pa.getPublicRenderParameter(identifier);
+        return publicRenderParameter.getQName();
+    }
+    
+    public QName getPublicRenderParameterQName(String windowId, String identifier)
+    {
+        // access portlet window and get public render parameter qname
+        PortletWindow window = windowAccessor.getPortletWindow(windowId);
+        if (window != null)
+        {
+            return getPublicRenderParameterQName(window, identifier);
+        }
+        return null;
+    }
+
+    public Map<String, QName> getPublicRenderParameterNamesMap(PortletWindow window)
+    {
+        // get public render parameter names from portlet application
+        PortletApplication pa = window.getPortletEntity().getPortletDefinition().getApplication();
+        if (pa.getPublicRenderParameters() != null)
+        {
+            Map<String, QName> parameterNames = new HashMap<String, QName>();
+            for (PublicRenderParameter publicRenderParameter : pa.getPublicRenderParameters())
+            {
+                parameterNames.put(publicRenderParameter.getIdentifier(), publicRenderParameter.getQName());
+            }
+            return parameterNames;
         }
-        String encodedNavState = null;
-        if ( haveState )
+        return null;
+    }
+    
+    public Map<String, QName> getPublicRenderParameterNamesMap(String windowId)
+    {
+        // access portlet window and get public render parameter names
+        PortletWindow window = windowAccessor.getPortletWindow(windowId);
+        if (window != null)
         {
-            encodedNavState = encodeParameters(buffer.toString(), states.getCharacterEncoding());
+            return getPublicRenderParameterNamesMap(window);
         }
-        return encodedNavState;
+        return null;
+    }
+
+    public boolean hasPublicRenderParameterQNames(PortletWindow window, Set<QName> qnames)
+    {
+        // test public render parameter qnames from portlet application
+        PortletApplication pa = window.getPortletEntity().getPortletDefinition().getApplication();
+        if (pa.getPublicRenderParameters() != null)
+        {
+            for (PublicRenderParameter publicRenderParameter : pa.getPublicRenderParameters())
+            {
+                if (qnames.contains(publicRenderParameter.getQName()))
+                {
+                    return true;
+                }
+            }
+        }
+        return false;
     }
     
+    public boolean hasPublicRenderParameterQNames(String windowId, Set<QName> qnames)
+    {
+        // access portlet window and test public render parameter qnames
+        PortletWindow window = windowAccessor.getPortletWindow(windowId);
+        if (window != null)
+        {
+            return hasPublicRenderParameterQNames(window, qnames);
+        }
+        return false;
+    }
+
+    protected String encodePublicRenderParameterState(PortletWindowRequestNavigationalStates states, 
+                                                      PortalURL.URLType urlType, boolean navParamsStateFull, 
+                                                      boolean renderParamsStateFull)
+    {
+        StringBuffer buffer = new StringBuffer();
+        boolean encoded = false;
+        
+        if ((PortalURL.URLType.ACTION.equals(urlType) || !renderParamsStateFull))
+        {
+            if (states.getPublicRenderParametersMap() != null)
+            {
+                encoded = encodeParameterMap(encoded, PARAM_KEY, states.getPublicRenderParametersMap(), buffer);
+            }
+        }
+        
+        return encoded ? buffer.toString() : "";
+    }
+
     protected String encodePortletWindowNavigationalState(String windowId, PortletWindowRequestNavigationalState state, 
                                                           PortalURL.URLType urlType, boolean navParamsStateFull, 
-                                                          boolean renderParamsStateFull)
+                                                          boolean renderParamsStateFull, boolean encodePublicRenderParams)
     {
         StringBuffer buffer = new StringBuffer();
         buffer.append(URLTYPE_ID_KEYS[urlType.ordinal()]);
         buffer.append(windowId);
         boolean encoded = !PortalURL.URLType.RENDER.equals(urlType);
-        if ( PortalURL.URLType.ACTION.equals(urlType) || !navParamsStateFull )
+        
+        if (PortalURL.URLType.ACTION.equals(urlType) || !navParamsStateFull)
         {
             if (state.getPortletMode() != null)
             {
@@ -328,7 +580,6 @@
                 buffer.append(encodePortletMode(state.getPortletMode()));
                 encoded = true;
             }
-
             if (state.getWindowState() != null)
             {
                 buffer.append(PARAMETER_SEPARATOR);
@@ -338,38 +589,50 @@
             }
         }
 
-        if (state.getParametersMap() != null && (PortalURL.URLType.ACTION.equals(urlType) || !renderParamsStateFull) )
+        if ((PortalURL.URLType.ACTION.equals(urlType) || !renderParamsStateFull))
         {
-            Map.Entry<String, String[]> entry;
-            String   parameterName;
-            String[] parameterValues;
-
-            StringBuffer paramBuffer = new StringBuffer();
-            Iterator<Map.Entry<String,String[]>> iter = state.getParametersMap().entrySet().iterator();
-            while ( iter.hasNext() )
+            if (state.getParametersMap() != null)
             {
-                encoded = true;
-                entry = iter.next();
-                parameterName = entry.getKey();
-                parameterValues = entry.getValue();
-               
-                buffer.append(PARAMETER_SEPARATOR);
-                buffer.append(PARAM_KEY);
-                
-                paramBuffer.setLength(0);
-                paramBuffer.append(encodeArgument(parameterName, PARAMETER_ELEMENT_SEPARATOR));
-                paramBuffer.append(PARAMETER_ELEMENT_SEPARATOR);
-                paramBuffer.append(Integer.toHexString(parameterValues.length));
-                for ( int i = 0; i < parameterValues.length; i++ )
+                encoded = encodeParameterMap(encoded, PARAM_KEY, state.getParametersMap(), buffer);
+            }
+            if (state.isActionScopedRequestAttributes())
+            {
+                if (state.getActionScopeId() != null)
                 {
-                    paramBuffer.append(PARAMETER_ELEMENT_SEPARATOR);
-                    paramBuffer.append(encodeArgument(parameterValues[i], PARAMETER_ELEMENT_SEPARATOR));
+                    encoded = true;
+                    buffer.append(PARAMETER_SEPARATOR);
+                    if (state.isActionScopeRendered())
+                    {                        
+                        buffer.append(RENDERED_ACTION_SCOPE_ID_KEY);
+                    }
+                    else
+                    {
+                        buffer.append(ACTION_SCOPE_ID_KEY);
+                    }
+                    buffer.append(encodeArgument(state.getActionScopeId(), PARAMETER_SEPARATOR));
                 }
-                
-                buffer.append(encodeArgument(paramBuffer.toString(),PARAMETER_SEPARATOR));
+            }
+            if (state.getCacheLevel() != null)
+            {
+                encoded = true;
+                buffer.append(PARAMETER_SEPARATOR);
+                buffer.append(CACHE_LEVEL_KEY);
+                buffer.append(encodeArgument(state.getActionScopeId(), PARAMETER_SEPARATOR));
+            }
+            if (state.getResourceId() != null)
+            {
+                encoded = true;
+                buffer.append(PARAMETER_SEPARATOR);
+                buffer.append(CACHE_LEVEL_KEY);
+                buffer.append(encodeArgument(state.getResourceId(), PARAMETER_SEPARATOR));
+            }
+            if (state.getPrivateRenderParametersMap() != null)
+            {
+                encoded = encodeParameterMap(encoded, PRIVATE_RENDER_PARAM_KEY, state.getPrivateRenderParametersMap(), buffer);
             }
         }
-        else if ( state.isClearParameters() )
+        
+        if (state.isClearParameters())
         {
             // Special case: for a targeted PortletWindow for which no parameters are specified 
             // indicate its saved (in the session) request parameters must be cleared instead of copying them when
@@ -379,9 +642,54 @@
             buffer.append(CLEAR_PARAMS_KEY);            
             encoded = true;
         }
+        
+        if (encodePublicRenderParams && (state.getPublicRenderParametersMap() != null) && (PortalURL.URLType.ACTION.equals(urlType) || !renderParamsStateFull))
+        {
+            // generate subset of public render parameters for this state
+            Map<QName, String[]> publicRenderParams = new HashMap<QName, String[]>();
+            for (Map.Entry<String, String[]> publicRenderParam : state.getPublicRenderParametersMap().entrySet())
+            {
+                String parameterName = publicRenderParam.getKey();
+                String[] parameterValues = publicRenderParam.getValue();
+                QName parameterQName = getPublicRenderParameterQName(windowId, parameterName);
+                if (parameterQName != null)
+                {
+                    publicRenderParams.put(parameterQName, parameterValues);
+                }
+            }
+            encoded = encodeParameterMap(encoded, PUBLIC_RENDER_PARAM_KEY, publicRenderParams, buffer);
+        }
+        
         return encoded ? buffer.toString() : "";
     }
     
+    protected boolean encodeParameterMap(boolean encoded, char paramsKey, Map<? extends Object, String[]> params, StringBuffer buffer)
+    {
+        StringBuffer paramBuffer = new StringBuffer();
+        for (Map.Entry<? extends Object, String[]> entry : params.entrySet())
+        {
+            encoded = true;
+            buffer.append(PARAMETER_SEPARATOR);
+
+            Object parameterNameObject = entry.getKey();
+            String parameterName = ((parameterNameObject instanceof QName) ? encodeQName((QName)parameterNameObject): parameterNameObject.toString());
+            String [] parameterValues = entry.getValue();
+            paramBuffer.setLength(0);
+            paramBuffer.append(encodeArgument(parameterName, PARAMETER_ELEMENT_SEPARATOR));
+            paramBuffer.append(PARAMETER_ELEMENT_SEPARATOR);
+            paramBuffer.append(Integer.toHexString(parameterValues.length));
+            for ( int i = 0; i < parameterValues.length; i++ )
+            {
+                paramBuffer.append(PARAMETER_ELEMENT_SEPARATOR);
+                paramBuffer.append(encodeArgument(parameterValues[i], PARAMETER_ELEMENT_SEPARATOR));
+            }
+
+            buffer.append(paramsKey);
+            buffer.append(encodeArgument(paramBuffer.toString(),PARAMETER_SEPARATOR));
+        }
+        return encoded;
+    }
+    
     protected PortletWindowRequestNavigationalState decodeParameter(PortletWindowAccessor accessor, PortletWindowRequestNavigationalStates states, PortletWindowRequestNavigationalState currentState, String parameter)
     {
         char parameterType = parameter.charAt(0);
@@ -404,7 +712,7 @@
                 {
                     window = accessor.createPortletWindow(windowId);
                 }
-                currentState = new PortletWindowRequestNavigationalState(windowId);
+                currentState = new PortletWindowRequestNavigationalState(windowId, getActionScopedRequestAttributes(window));
                 states.addPortletWindowNavigationalState(windowId, currentState);
                 if ( parameterType == ACTION_WINDOW_ID_KEY )
                 {
@@ -417,9 +725,9 @@
                 states.setURLType(urlType);
             }
         }
-        else if ( currentState != null )
+        else if (currentState != null)
         {
-            switch ( parameterType )
+            switch (parameterType)
             {
                 case MODE_KEY:
                 {
@@ -449,33 +757,35 @@
                     break;
                 }
                 case PARAM_KEY:
+                case PRIVATE_RENDER_PARAM_KEY:
+                case PUBLIC_RENDER_PARAM_KEY:
                 {
-                    int position = 1;
-                    StringBuffer buffer = new StringBuffer();
-                    String parameterName = null;
-                    int parameterValueCount = -1;
-                    String parameterValues[] = null;
-                    int parameterValueIndex = -1;
-                    while ( (position = decodeArgument(position, parameter, buffer, PARAMETER_ELEMENT_SEPARATOR)) != -1 )
+                    String [] parameterName = new String[1];
+                    String [][] parameterValues = new String[1][1];
+                    if (decodeParamsParameter(parameter, parameterName, parameterValues))
                     {
-                        if ( parameterName == null )
+                        switch (parameterType)
                         {
-                            parameterName = buffer.toString();
-                            parameterValueCount = -1;                        
-                        }
-                        else if ( parameterValueCount == -1 )
-                        {
-                            parameterValueCount = Integer.parseInt(buffer.toString(), 16);
-                            parameterValues = new String[parameterValueCount];
-                            parameterValueIndex = 0;
-                        }
-                        else
-                        {
-                            parameterValues[parameterValueIndex++] = buffer.toString();
-                            parameterValueCount--;
-                            if ( parameterValueCount == 0 )
+                            case PARAM_KEY:
+                            {
+                                // set parameter state
+                                currentState.setParameters(parameterName[0], parameterValues[0]);
+                                break;
+                            }
+                            case PRIVATE_RENDER_PARAM_KEY:
                             {
-                                currentState.setParameters(parameterName, parameterValues);
+                                // set private render parameter state
+                                currentState.setPrivateRenderParameters(parameterName[0], parameterValues[0]);
+                                break;
+                            }
+                            case PUBLIC_RENDER_PARAM_KEY:
+                            {
+                                // set public render parameter states
+                                QName parameterQName = decodeQName(parameterName[0]);
+                                if (parameterQName != null)
+                                {
+                                    states.setPublicRenderParameters(parameterQName, parameterValues[0]);
+                                }
                                 break;
                             }
                         }
@@ -485,11 +795,97 @@
                 case CLEAR_PARAMS_KEY:
                 {
                     currentState.setClearParameters(true);
+                    break;
+                }
+                case CACHE_LEVEL_KEY:
+                case RESOURCE_ID_KEY:
+                case ACTION_SCOPE_ID_KEY:
+                case RENDERED_ACTION_SCOPE_ID_KEY:
+                {
+                    parameter = parameter.substring(1);
+                    switch (parameterType)
+                    {                        
+                        case CACHE_LEVEL_KEY:
+                        {
+                            currentState.setCacheLevel(parameter);
+                            break;
+                        }
+                        case RESOURCE_ID_KEY:
+                        {
+                            currentState.setResourceId(parameter);
+                            break;                            
+                        }
+                        case ACTION_SCOPE_ID_KEY:
+                        {
+                            currentState.setActionScopeId(parameter);
+                            currentState.setActionScopeRendered(false);
+                            break;
+                        }
+                        case RENDERED_ACTION_SCOPE_ID_KEY:
+                        {
+                            currentState.setActionScopeId(parameter);
+                            currentState.setActionScopeRendered(true);
+                            break;
+                        }
+                    }
+                    break;
                 }
             }
         }
+        else
+        {
+            switch (parameterType)
+            {
+                case PUBLIC_RENDER_PARAM_KEY:
+                {
+                    String [] parameterName = new String[1];
+                    String [][] parameterValues = new String[1][1];
+                    if (decodeParamsParameter(parameter, parameterName, parameterValues))
+                    {
+                        // set public render parameter states
+                        QName parameterQName = decodeQName(parameterName[0]);
+                        if (parameterQName != null)
+                        {
+                            states.setPublicRenderParameters(parameterQName, parameterValues[0]);
+                        }
+                    }
+                    break;
+                }
+            }            
+        }
         return currentState;
-        
+    }
+
+    protected boolean decodeParamsParameter(String parameter, String [] parameterName, String [][] parameterValues)
+    {
+        int position = 1;
+        StringBuffer buffer = new StringBuffer();
+        int parameterValueCount = -1;
+        int parameterValueIndex = -1;
+        while ( (position = decodeArgument(position, parameter, buffer, PARAMETER_ELEMENT_SEPARATOR)) != -1 )
+        {
+            if ( parameterName[0] == null )
+            {
+                parameterName[0] = buffer.toString();
+                parameterValueCount = -1;                        
+            }
+            else if ( parameterValueCount == -1 )
+            {
+                parameterValueCount = Integer.parseInt(buffer.toString(), 16);
+                parameterValues[0] = new String[parameterValueCount];
+                parameterValueIndex = 0;
+            }
+            else
+            {
+                parameterValues[0][parameterValueIndex++] = buffer.toString();
+                parameterValueCount--;
+                if ( parameterValueCount == 0 )
+                {
+                    return true;
+                }
+            }
+        }
+        return false;
     }
     
     protected PortletMode decodePortletMode(char mode)
@@ -629,4 +1025,52 @@
         }
         return buffer.length() > 0 ? position : -1; 
     }
+    
+    protected QName decodeQName(String qnameString)
+    {
+        int namespacePrefixSeparator = qnameString.indexOf("//:");
+        if (namespacePrefixSeparator != -1)
+        {
+            int prefixLocalpartSeparator = qnameString.indexOf(":", namespacePrefixSeparator+3);
+            if (prefixLocalpartSeparator != -1)
+            {
+                String namespace = (namespacePrefixSeparator > 0) ? qnameString.substring(0, namespacePrefixSeparator) : null;
+                String prefix = (prefixLocalpartSeparator-namespacePrefixSeparator > 3) ? qnameString.substring(namespacePrefixSeparator+3, namespacePrefixSeparator): null;
+                String localpart = (namespacePrefixSeparator+1 < qnameString.length()) ? qnameString.substring(namespacePrefixSeparator+1) : null;
+                if (localpart != null)
+                {
+                    if (namespace == null)
+                    {
+                        return new QName(localpart);
+                    }
+                    else if (prefix == null)
+                    {
+                        return new QName(namespace, localpart);                    
+                    }
+                    else
+                    {
+                        return new QName(namespace, localpart, prefix);                        
+                    }
+                }
+            }
+        }
+        return null;
+    }
+
+    protected String encodeQName(QName qname)
+    {
+        String namespace = qname.getNamespaceURI();
+        namespace = (namespace != null) ? namespace : "";
+        String prefix = qname.getPrefix();
+        prefix = (prefix != null) ? prefix : "";
+        String localpart = qname.getLocalPart();
+        
+        StringBuilder builder = new StringBuilder();
+        builder.append(namespace);
+        builder.append("//:");
+        builder.append(prefix);
+        builder.append(":");
+        builder.append(localpart);
+        return builder.toString();
+    }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/NavigationalStateCodec.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/NavigationalStateCodec.java?rev=757118&r1=757117&r2=757118&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/NavigationalStateCodec.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/NavigationalStateCodec.java Sun Mar 22 02:50:28 2009
@@ -18,24 +18,46 @@
 
 import java.io.UnsupportedEncodingException;
 import java.util.Map;
+import java.util.Set;
 
 import javax.portlet.PortletMode;
 import javax.portlet.WindowState;
+import javax.xml.namespace.QName;
 
 import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.container.url.PortalURL;
 
 public interface NavigationalStateCodec
 {
-    PortletWindowRequestNavigationalStates decode(String parameters, String characterEncoding) throws UnsupportedEncodingException;
+    PortletWindowRequestNavigationalStates decode(String parameters, String characterEncoding)
+        throws UnsupportedEncodingException;
 
     String encode(PortletWindowRequestNavigationalStates states, PortletWindow window, PortletMode portletMode,
-            WindowState windowState, boolean navParamsStateFull, boolean renderParamsStateFull) throws UnsupportedEncodingException;
+                  WindowState windowState, boolean navParamsStateFull, boolean renderParamsStateFull)
+        throws UnsupportedEncodingException;
 
     String encode(PortletWindowRequestNavigationalStates states, PortletWindow window, Map<String, String[]> parameters,
-            PortletMode portletMode, WindowState windowState, PortalURL.URLType urlType, boolean navParamsStateFull, 
-            boolean renderParamsStateFull) throws UnsupportedEncodingException;
+                  String actionScopeId, boolean actionScopeRendered, String cacheLevel, String resourceId,
+                  Map<String, String[]> privateRenderParameters, Map<String, String[]> publicRenderParameters,
+                  PortletMode portletMode, WindowState windowState, PortalURL.URLType urlType, boolean navParamsStateFull, 
+                  boolean renderParamsStateFull)
+        throws UnsupportedEncodingException;
 
     String encode(PortletWindowRequestNavigationalStates states, boolean navParamsStateFull, boolean renderParamsStateFull) 
-            throws UnsupportedEncodingException;
+        throws UnsupportedEncodingException;
+
+    void setStatePublicRenderParametersMap(PortletWindowRequestNavigationalStates requestStates, PortletWindowRequestNavigationalState requestState, Map<String, String[]> publicRenderParametersMap);
+    void updateStatesPublicRenderParametersMap(PortletWindowRequestNavigationalStates requestStates, PortletWindowRequestNavigationalState requestState, Map<String, String[]> publicRenderParametersMap);
+
+    boolean getActionScopedRequestAttributes(PortletWindow window);
+    boolean getActionScopedRequestAttributes(String windowId);
+
+    QName getPublicRenderParameterQName(PortletWindow window, String identifier);
+    QName getPublicRenderParameterQName(String windowId, String identifier);
+
+    Map<String, QName> getPublicRenderParameterNamesMap(PortletWindow window);
+    Map<String, QName> getPublicRenderParameterNamesMap(String windowId);
+
+    boolean hasPublicRenderParameterQNames(PortletWindow window, Set<QName> qnames);
+    boolean hasPublicRenderParameterQNames(String windowId, Set<QName> qnames);
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowExtendedNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowExtendedNavigationalState.java?rev=757118&r1=757117&r2=757118&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowExtendedNavigationalState.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowExtendedNavigationalState.java Sun Mar 22 02:50:28 2009
@@ -64,10 +64,21 @@
         }
     }
     
+    public PortletWindowExtendedNavigationalState(boolean actionScopedRequestAttributes)
+    {
+        this.actionScopedRequestAttributes = actionScopedRequestAttributes;
+    }
+    
     private Map<String, String[]> parametersMap;
+
+    private boolean actionScopedRequestAttributes;
+    
+    private String actionScopeId;
+    
+    private boolean actionScopeRendered;
     
     private Map<ModeStateKey, String> decoratorActionEncodings;
-        
+
     public Map<String, String[]> getParametersMap()
     {
         return parametersMap;
@@ -87,6 +98,31 @@
         this.parametersMap = parametersMap;
     }
     
+    public boolean isActionScopedRequestAttributes()
+    {
+        return actionScopedRequestAttributes;
+    }
+    
+    public String getActionScopeId()
+    {
+        return actionScopeId;
+    }
+    
+    public void setActionScopeId(String actionScopeId)
+    {
+        this.actionScopeId = actionScopeId;
+    }
+    
+    public boolean isActionScopeRendered()
+    {
+        return actionScopeRendered;
+    }
+    
+    public void setActionScopeRendered(boolean actionScopeRendered)
+    {
+        this.actionScopeRendered = actionScopeRendered;
+    }
+    
     public void resetDecoratorActionEncodings()
     {
         if (decoratorActionEncodings != null)

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowRequestNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowRequestNavigationalState.java?rev=757118&r1=757117&r2=757118&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowRequestNavigationalState.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowRequestNavigationalState.java Sun Mar 22 02:50:28 2009
@@ -16,6 +16,9 @@
  */
 package org.apache.jetspeed.container.state.impl;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * PortletWindowRequestNavigationalState
  *
@@ -26,7 +29,11 @@
 {
     private static final long serialVersionUID = 3807035638733358425L;
 
-    private String  windowId;
+    private String windowId;
+    private String cacheLevel;
+    private String resourceId;
+    private Map<String, String[]> privateRenderParametersMap;
+    private Map<String, String[]> publicRenderParametersMap;
     
     /**
      * true if for a targeted PortletWindow using StateFullParameters the saved (in the session) render parameters
@@ -37,8 +44,9 @@
      */
     private boolean clearParameters;
 
-    public PortletWindowRequestNavigationalState(String windowId)
+    public PortletWindowRequestNavigationalState(String windowId, boolean actionScopedRequestAttributes)
     {
+        super(actionScopedRequestAttributes);
         this.windowId = windowId;
     }
 
@@ -47,6 +55,64 @@
         return windowId;
     }
         
+    public String getCacheLevel()
+    {
+        return cacheLevel;
+    }
+
+    public void setCacheLevel(String cacheLevel)
+    {
+        this.cacheLevel = cacheLevel;
+    }
+
+    public String getResourceId()
+    {
+        return resourceId;
+    }
+
+    public void setResourceId(String resourceId)
+    {
+        this.resourceId = resourceId;
+    }
+
+    public Map<String, String[]> getPrivateRenderParametersMap()
+    {
+        return privateRenderParametersMap;
+    }
+
+    public void setPrivateRenderParameters(String name, String[] values)
+    {
+        if (privateRenderParametersMap == null)
+        {
+            privateRenderParametersMap = new HashMap<String, String[]>();
+        }
+        privateRenderParametersMap.put(name, values);
+    }    
+    
+    public void setPrivateRenderParametersMap(Map<String, String[]> privateRenderParametersMap)
+    {
+        this.privateRenderParametersMap = privateRenderParametersMap;
+    }
+    
+    public Map<String, String[]> getPublicRenderParametersMap()
+    {
+        return publicRenderParametersMap;
+    }
+
+    public void setPublicRenderParameters(String name, String[] values)
+    {
+        if ( publicRenderParametersMap == null )
+        {
+            publicRenderParametersMap = new HashMap<String, String[]>();
+        }
+        publicRenderParametersMap.put(name, values);
+    }    
+    
+    public void setPublicRenderParametersMap(Map<String, String[]> publicRenderParametersMap)
+    {
+        this.publicRenderParametersMap = publicRenderParametersMap;
+    }
+    
     public boolean isClearParameters()
     {
         return clearParameters;

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowRequestNavigationalStates.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowRequestNavigationalStates.java?rev=757118&r1=757117&r2=757118&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowRequestNavigationalStates.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowRequestNavigationalStates.java Sun Mar 22 02:50:28 2009
@@ -20,6 +20,8 @@
 import java.util.Iterator;
 import java.util.Map;
 
+import javax.xml.namespace.QName;
+
 import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.container.url.PortalURL;
 
@@ -31,6 +33,7 @@
     private PortletWindow maximizedWindow;
     private PortletWindow actionWindow;
     private PortletWindow resourceWindow;
+    private Map<QName, String[]> publicRenderParametersMap;
     
     public PortletWindowRequestNavigationalStates(String characterEncoding)
     {
@@ -113,4 +116,32 @@
     {
         return resourceWindow;
     }
+
+    public Map<QName, String[]> getPublicRenderParametersMap()
+    {
+        return publicRenderParametersMap;
+    }
+
+    public void setPublicRenderParametersMap(Map<QName, String[]> publicRenderParametersMap)
+    {
+        this.publicRenderParametersMap = publicRenderParametersMap;
+    }
+
+    public void setPublicRenderParameters(QName qname, String[] values)
+    {
+        if (publicRenderParametersMap == null)
+        {
+            publicRenderParametersMap = new HashMap<QName, String[]>();
+        }
+        publicRenderParametersMap.put(qname, values);
+    }    
+    
+    public void addPublicRenderParametersMap(Map<QName, String[]> publicRenderParametersMap)
+    {
+        if (this.publicRenderParametersMap == null)
+        {
+            this.publicRenderParametersMap = new HashMap<QName, String[]>();
+        }
+        this.publicRenderParametersMap.putAll(publicRenderParametersMap);
+    }
 }



---------------------------------------------------------------------
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