portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r758136 [1/2] - in /portals/jetspeed-2/portal/trunk: components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/ components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/ components/jetspeed-portal/s...
Date Wed, 25 Mar 2009 03:30:51 GMT
Author: ate
Date: Wed Mar 25 03:30:49 2009
New Revision: 758136

URL: http://svn.apache.org/viewvc?rev=758136&view=rev
Log:
Second part of the big bang commit for JS2-938: Create flyweight PortletWindow instances for each request, the handle to access and store all portlet interaction data and drop the PortletEntityImpl usage
specifically concerning JS2-939: Portlet URL/Navigation State JSR-286 Portlet API 2.0 Support
This second commit is split off the first commit to provide an easier to review and separate set of changes for Randy on JS2-939
 
See: http://issues.apache.org/jira/browse/JS2-939
and: http://issues.apache.org/jira/browse/JS2-938

Added:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/ValuesAndWindowUsage.java   (with props)
Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletRequestContextImpl.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletResourceRequestContextImpl.java
    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/   (props changed)
    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/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/PathNavigationalState.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowBaseNavigationalState.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/SessionFullExtendedNavigationalState.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/test/java/org/apache/jetspeed/container/state/   (props changed)
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/test/java/org/apache/jetspeed/window/   (props changed)
    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

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletRequestContextImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletRequestContextImpl.java?rev=758136&r1=758135&r2=758136&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletRequestContextImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletRequestContextImpl.java Wed Mar 25 03:30:49 2009
@@ -24,7 +24,6 @@
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Locale;
 import java.util.Map;
@@ -43,7 +42,6 @@
 import org.apache.jetspeed.om.portlet.LocalizedField;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.jetspeed.request.JetspeedRequestContext;
-import org.apache.jetspeed.request.RequestContext;
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletRequestContext;
 import org.apache.jetspeed.container.PortletWindow;
@@ -67,9 +65,9 @@
     private ServletContext servletContext;
     private Cookie cookies[];
     private JetspeedRequestContext requestContext;
-    private Map<String, Object> windowAttributes;
     
     private Map<String, String[]> privateParameters;
+    private Map<String, String[]> publicRenderParameters;
     
     public PortletRequestContextImpl(PortletContainer container, HttpServletRequest containerRequest,
                                      HttpServletResponse containerResponse, PortletWindow window)
@@ -78,8 +76,7 @@
         this.containerRequest = containerRequest;
         this.containerResponse = containerResponse;
         this.window = window;
-        this.requestContext = (JetspeedRequestContext)containerRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
-        windowAttributes = requestContext.getPortletWindowAttributes(window);
+        this.requestContext = (JetspeedRequestContext)window.getRequestContext();
     }
     
     protected JetspeedRequestContext getRequestContext()
@@ -112,7 +109,7 @@
     
     protected boolean isPublicRenderParameter(String name)
     {
-        List<String> publicRenderParameterNames = window.getPortletEntity().getPortletDefinition().getSupportedPublicRenderParameters();
+        List<String> publicRenderParameterNames = window.getPortletDefinition().getSupportedPublicRenderParameters();
         return publicRenderParameterNames.isEmpty() ? false : publicRenderParameterNames.contains(name);
     }
         
@@ -136,37 +133,23 @@
             privateParameters = new HashMap<String, String[]>();
             NavigationalState ns = requestContext.getPortalURL().getNavigationalState();
             mergeRequestParameters = ns.getPortletWindowOfAction() != null || ns.getPortletWindowOfResource() != null;
-            Iterator<String> iter = ns.getParameterNames(getPortletWindow());
-            while (iter.hasNext())
-            {
-                String name = iter.next();
-                String[] values = ns.getParameterValues(getPortletWindow(), name);
-                privateParameters.put(name, values);
-            }
+            privateParameters.putAll(ns.getParameterMap(window));
             
-            PortletDefinition portletDef = window.getPortletEntity().getPortletDefinition();
-            if(portletDef != null)
+            PortletDefinition portletDef = window.getPortletDefinition();
+            GenericMetadata metaData = portletDef.getMetadata();
+            if (!mergeRequestParameters)
             {
-                GenericMetadata metaData = portletDef.getMetadata();
-                if (!mergeRequestParameters)
-                {
-                    mergeRequestParameters = 
-                        getMetaDataBooleanValue(
-                            metaData,
-                            PortalReservedParameters.PORTLET_EXTENDED_DESCRIPTOR_MERGE_PORTAL_PARAMETERS_WITH_PORTLET_PARAMETERS,
-                            mergePortalParametersWithPortletParameters.booleanValue());
-                }
-                mergeRequestParametersBefore = 
+                mergeRequestParameters = 
                     getMetaDataBooleanValue(
                         metaData,
-                        PortalReservedParameters.PORTLET_EXTENDED_DESCRIPTOR_MERGE_PORTAL_PARAMETERS_BEFORE_PORTLET_PARAMETERS,
-                        mergePortalParametersBeforePortletParameters.booleanValue());
-                
-            }
-            else
-            {
-                // This happens when an entity is referencing a non-existent portlet
+                        PortalReservedParameters.PORTLET_EXTENDED_DESCRIPTOR_MERGE_PORTAL_PARAMETERS_WITH_PORTLET_PARAMETERS,
+                        mergePortalParametersWithPortletParameters.booleanValue());
             }
+            mergeRequestParametersBefore = 
+                getMetaDataBooleanValue(
+                    metaData,
+                    PortalReservedParameters.PORTLET_EXTENDED_DESCRIPTOR_MERGE_PORTAL_PARAMETERS_BEFORE_PORTLET_PARAMETERS,
+                    mergePortalParametersBeforePortletParameters.booleanValue());
             
             //get request params
             if (mergeRequestParameters)
@@ -220,22 +203,8 @@
                 }
             }
         }
-        if (!privateParameters.isEmpty())
-        {
-            Map<String, String[]> result = new HashMap<String, String[]>(privateParameters.size());
-            for (Map.Entry<String,String[]> entry : privateParameters.entrySet())
-            {
-                if (entry.getValue() != null)
-                {
-                    result.put(entry.getKey(), entry.getValue().clone());
-                }
-            }
-            return Collections.unmodifiableMap(result);
-        }
-        else
-        {
-            return Collections.emptyMap();
-        }
+        // no need to clone: container is supposed to do so
+        return privateParameters;
     }
 
     public PortletContainer getContainer()
@@ -308,7 +277,7 @@
     public Object getAttribute(String name)
     {
         Object value = servletRequest.getAttribute(name);        
-        return value != null ? value : windowAttributes.get(name);
+        return value != null ? value : window.getAttribute(name);
     }
 
     @SuppressWarnings("unchecked")
@@ -327,7 +296,7 @@
                 // ignore potential concurrent changes when run in parallel mode
             }
         }
-        for (String name : windowAttributes.keySet())
+        for (String name : window.getAttributes().keySet())
         {
             names.add(name);
         }
@@ -338,11 +307,11 @@
     {
         if (value == null)
         {
-            windowAttributes.remove(name);
+            window.removeAttribute(name);
         }
         else
         {
-            windowAttributes.put(name,value);
+            window.setAttribute(name,value);
         }
     }
 
@@ -369,7 +338,11 @@
 
     public Map<String, String[]> getPublicParameterMap()
     {
-        // TODO: waiting for public parameters implementation
-        return Collections.emptyMap();
+        if (publicRenderParameters == null)
+        {
+            publicRenderParameters = requestContext.getPortalURL().getNavigationalState().getPublicRenderParameterMap(window);
+        }
+        // no need to clone: the container is supposed to do so
+        return publicRenderParameters;
     }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletResourceRequestContextImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletResourceRequestContextImpl.java?rev=758136&r1=758135&r2=758136&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletResourceRequestContextImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletResourceRequestContextImpl.java Wed Mar 25 03:30:49 2009
@@ -38,22 +38,19 @@
     {
         super(container, containerRequest, containerResponse, window);
     }
-
+    
     public String getCacheability()
     {
-        //TODO
-        return null;
+        return getRequestContext().getPortalURL().getNavigationalState().getCacheLevel(getPortletWindow());
     }
 
     public Map<String, String[]> getPrivateRenderParameterMap()
     {
-        //TODO
-        return null;
+        return getRequestContext().getPortalURL().getNavigationalState().getPrivateRenderParameterMap(getPortletWindow());
     }
 
     public String getResourceID()
     {
-        //TODO
-        return null;
+        return getRequestContext().getPortalURL().getNavigationalState().getResourceID(getPortletWindow());
     }
 }

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=758136&r1=758135&r2=758136&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 Wed Mar 25 03:30:49 2009
@@ -169,8 +169,7 @@
     {
         PortalURL.URLType urlType;
         Map<String, String[]> privateRenderParms = null;
-        Map<String, String[]> renderParms = new HashMap<String, String[]>();
-        Map<String, String[]> publicRenderParms = new HashMap<String, String[]>();
+        Map<String, String[]> renderParms = null;
         if (TYPE.ACTION == type)
         {
             urlType = PortalURL.URLType.ACTION;
@@ -189,38 +188,62 @@
         }
         if (renderParameters != null)
         {
-            for (Map.Entry<String,String[]> entry : renderParameters.entrySet())
+            if (publicRenderParameters == null)
             {
-                if (publicRenderParameters == null || !publicRenderParameters.containsKey(entry.getKey()))
-                {
-                    renderParms.put(entry.getKey(), entry.getValue());
-                }
+                renderParms = renderParameters;
             }
-        }
-        if (publicRenderParameters != null)
-        {
-            for (Map.Entry<String,String[]> entry : publicRenderParameters.entrySet())
+            else
             {
-                publicRenderParms.put(entry.getKey(), entry.getValue() != null ? entry.getValue() : new String[]{null});
+                renderParms = new HashMap<String,String[]>();
+                for (Map.Entry<String,String[]> entry : renderParameters.entrySet())
+                {
+                    if (publicRenderParameters == null || !publicRenderParameters.containsKey(entry.getKey()))
+                    {
+                        renderParms.put(entry.getKey(), entry.getValue());
+                    }
+                }
             }
         }
         
         if (toURL)
         {
-            return url.createPortletURL(portletWindow, renderParms, actionScopeID, actionScopeRendered, cacheLevel, resourceID, privateRenderParms, publicRenderParms, portletMode, windowState, urlType, secure);
+            return url.createPortletURL(portletWindow, renderParms, actionScopeID, actionScopeRendered, cacheLevel, resourceID, privateRenderParms, publicRenderParameters, portletMode, windowState, urlType, secure);
         }
         else
         {
             MutableNavigationalState navState = (MutableNavigationalState)url.getNavigationalState();
-            navState.setMode(portletWindow, portletMode);
-            navState.setState(portletWindow, windowState);
-            navState.setParametersMap(portletWindow, renderParms);
-            navState.setActionScopeId(portletWindow, actionScopeID);
-            navState.setActionScopeRendered(portletWindow, actionScopeRendered);
-            navState.setCacheLevel(portletWindow, cacheLevel);
-            navState.setResourceId(portletWindow, resourceID);
-            navState.setPrivateRenderParametersMap(portletWindow, privateRenderParms);
-            navState.setPublicRenderParametersMap(portletWindow, publicRenderParms);
+            // block possible other concurrent processEvent trying to do the same
+            synchronized (navState)
+            {
+                navState.setTargetted(portletWindow);
+                navState.setMode(portletWindow, portletMode);
+                navState.setState(portletWindow, windowState);
+                navState.setActionScopeId(portletWindow, actionScopeID);
+                navState.setActionScopeRendered(portletWindow, actionScopeRendered);
+                navState.setCacheLevel(portletWindow, cacheLevel);
+                navState.setResourceId(portletWindow, resourceID);
+                navState.setPrivateRenderParametersMap(portletWindow, privateRenderParms);                
+                if (publicRenderParameters == null)
+                {
+                    navState.setParametersMap(portletWindow, renderParms);
+                }
+                else
+                {
+                    if (renderParameters == null)
+                    {
+                        navState.setParametersMap(portletWindow, null);
+                    }
+                    else
+                    {
+                        for (String key : publicRenderParameters.keySet())
+                        {
+                            renderParameters.remove(key);
+                        }
+                        navState.setParametersMap(portletWindow, renderParameters);
+                    }
+                    navState.setPublicRenderParametersMap(portletWindow, publicRenderParameters);
+                }
+            }
             return null;
         }
     }

Propchange: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Wed Mar 25 03:30:49 2009
@@ -1,2 +1,2 @@
-target
+target
 surefire*.properties

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=758136&r1=758135&r2=758136&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 Wed Mar 25 03:30:49 2009
@@ -17,10 +17,9 @@
 package org.apache.jetspeed.container.state.impl;
 
 import java.io.UnsupportedEncodingException;
-import java.util.Collections;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
-import java.util.Set;
 
 import javax.portlet.PortletMode;
 import javax.portlet.WindowState;
@@ -31,6 +30,7 @@
 import org.apache.jetspeed.container.state.MutableNavigationalState;
 import org.apache.jetspeed.container.url.PortalURL;
 import org.apache.jetspeed.om.portlet.PortletApplication;
+import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.container.PortletWindow;
 
 /**
@@ -67,57 +67,94 @@
         }
     }
     
-    protected PortletWindowRequestNavigationalStates getPortletWindowRequestNavigationalStates()
-    {
-        return requestStates;
-    }
-    
-    public boolean getActionScopedRequestAttributes(PortletWindow 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 QName getPublicRenderParameterQName(PortletWindow window, String identifier)
-    {
-        // utilize codec to access portlet application public render parameter
-        return codec.getPublicRenderParameterQName(window, identifier);
-    }
-    
-    public QName getPublicRenderParameterQName(String windowId, String identifier)
+    protected boolean resolvePortletWindows(RequestContext requestContext)
     {
-        // utilize codec to access portlet application public render parameter
-        return codec.getPublicRenderParameterQName(windowId, identifier);
+        boolean targetResolved = true;
+        for (Iterator<Map.Entry<String,PortletWindowRequestNavigationalState>> entryIter = requestStates.getPortletWindowRequestNavigationalStates().entrySet().iterator(); entryIter.hasNext(); )
+        {
+            Map.Entry<String,PortletWindowRequestNavigationalState> entry = entryIter.next();
+            PortletWindow window = requestContext.resolvePortletWindow(entry.getKey());
+            if (window == null)
+            {
+                entryIter.remove();
+                if (requestStates.getTargetWindowId() != null && entry.getKey().equals(requestStates.getTargetWindowId()))
+                {
+                    requestStates.setTargetWindowId(null);
+                    targetResolved = false;
+                }
+            }
+            else
+            {
+                if (requestStates.getTargetWindowId() != null && entry.getKey().equals(requestStates.getTargetWindowId()))
+                {
+                    if (PortalURL.URLType.ACTION == requestStates.getURLType())
+                    {
+                        requestStates.setActionWindow(window);
+                    }
+                    else
+                    {
+                        requestStates.setResourceWindow(window);
+                    }
+                }
+                WindowState windowState = entry.getValue().getWindowState();
+                if (windowState != null && (windowState.equals(WindowState.MAXIMIZED) || windowState.equals(JetspeedActions.SOLO_STATE)))
+                {
+                    if (requestStates.getMaximizedWindow() == null)
+                    {
+                        requestStates.setMaximizedWindow(window);
+                    }
+                    else
+                    {
+                        // multiple maximized windows not possible: corrupted or hacked url?
+                        entry.getValue().setWindowState(null);
+                    }
+                }
+            }
+        }
+        return targetResolved;
     }
     
-    public Map<String, QName> getPublicRenderParameterNamesMap(PortletWindow window)
+    protected void resolvePublicParametersMap()
     {
-        // utilize codec to access portlet application public render parameter names
-        return codec.getPublicRenderParameterNamesMap(window);
+        HashMap<QName, String[]> map = null;
+        for (PortletWindowRequestNavigationalState state : requestStates.getPortletWindowRequestNavigationalStates().values())
+        {
+            if (state.getPublicRenderParametersMap() != null)
+            {
+                state.resolvePublicRenderParametersMapping();
+                for (Iterator<Map.Entry<String, String[]>> iter = state.getPublicRenderParametersMap().entrySet().iterator(); iter.hasNext(); )
+                {
+                    Map.Entry<String, String[]> entry = iter.next();
+                    QName qname = state.getPublicRenderParameterQNameByIdentifier(entry.getKey());
+                    if (qname != null)
+                    {
+                        if (map == null)
+                        {
+                            map = new HashMap<QName, String[]>();
+                        }
+                        map.put(qname, entry.getValue());
+                    }
+                    else
+                    {
+                        iter.remove();
+                    }
+                }
+            }
+        }
+        requestStates.setPublicRenderParametersMap(map);
     }
-    
-    public Map<String, QName> getPublicRenderParameterNamesMap(String windowId)
+       
+    protected void resetRequestPortletWindowPublicRenderParameters()
     {
-        // utilize codec to access portlet application public render parameter names
-        return codec.getPublicRenderParameterNamesMap(windowId);
+        for (PortletWindowRequestNavigationalState state : requestStates.getPortletWindowRequestNavigationalStates().values())
+        {
+            state.setPublicRenderParametersMap(null);
+        }
     }
 
-    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)
+    protected PortletWindowRequestNavigationalStates getPortletWindowRequestNavigationalStates()
     {
-        // utilize codec to access portlet application public render parameter names
-        return codec.hasPublicRenderParameterQNames(windowId, qnames);
+        return requestStates;
     }
     
     public WindowState getMappedState(String windowId)
@@ -144,7 +181,7 @@
         WindowState state = getMappedState(window.getId().toString());
         if (state != null && !JetspeedActions.getStandardWindowStates().contains(state))
         {
-            PortletApplication pa = (PortletApplication)window.getPortletEntity().getPortletDefinition().getApplication();
+            PortletApplication pa = window.getPortletDefinition().getApplication();
             state = pa.getCustomWindowState(state);
         }
         return state;
@@ -166,7 +203,7 @@
         {
             if (!JetspeedActions.getStandardWindowStates().contains(windowState))
             {
-                PortletApplication pa = (PortletApplication)window.getPortletEntity().getPortletDefinition().getApplication();
+                PortletApplication pa = window.getPortletDefinition().getApplication();
                 windowState = pa.getMappedWindowState(windowState);
             }
             String windowId = window.getId().toString();
@@ -177,7 +214,9 @@
             }
             else
             {
-                state = new PortletWindowRequestNavigationalState(windowId, getActionScopedRequestAttributes(window));
+                state = new PortletWindowRequestNavigationalState(windowId);
+                state.setPortletDefinition(window.getPortletDefinition());
+                state.resolveActionScopedRequestAttributes();
                 requestStates.addPortletWindowNavigationalState(windowId, state);
                 state.setWindowState(windowState);
             }
@@ -212,7 +251,7 @@
         PortletMode mode = getMappedMode(window.getId().toString());
         if (mode != null && !JetspeedActions.getStandardPortletModes().contains(mode))
         {
-            PortletApplication pa = (PortletApplication)window.getPortletEntity().getPortletDefinition().getApplication();
+            PortletApplication pa = window.getPortletDefinition().getApplication();
             mode = pa.getCustomPortletMode(mode);
         }
         return mode;
@@ -229,7 +268,7 @@
         {
             if (!JetspeedActions.getStandardPortletModes().contains(portletMode))
             {
-                PortletApplication pa = (PortletApplication)window.getPortletEntity().getPortletDefinition().getApplication();
+                PortletApplication pa = window.getPortletDefinition().getApplication();
                 portletMode = pa.getMappedPortletMode(portletMode);
             }
             String windowId = window.getId().toString();
@@ -240,40 +279,15 @@
             }
             else
             {
-                state = new PortletWindowRequestNavigationalState(windowId, getActionScopedRequestAttributes(window));
+                state = new PortletWindowRequestNavigationalState(windowId);
+                state.setPortletDefinition(window.getPortletDefinition());
+                state.resolveActionScopedRequestAttributes();
                 requestStates.addPortletWindowNavigationalState(windowId, state);
                 state.setPortletMode(portletMode);
             }
         }
     }
 
-    @SuppressWarnings("unchecked")
-    public Iterator<String> getParameterNames(PortletWindow window)
-    {
-        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
-        if ( state != null && state.getParametersMap() != null )
-        {
-            return state.getParametersMap().keySet().iterator();
-        }
-        else
-        {
-            return Collections.EMPTY_LIST.iterator();
-        }
-    }
-
-    public String[] getParameterValues(PortletWindow window, String parameterName)
-    {
-        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
-        if ( state != null && state.getParametersMap() != null )
-        {
-            return (String[])state.getParametersMap().get(parameterName);
-        }
-        else
-        {
-            return null;
-        }
-    }
-
     public Map<String, String[]> getParameterMap(PortletWindow window)
     {
         PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
@@ -356,7 +370,7 @@
         }
     }
 
-    public String getResourceId(PortletWindow window)
+    public String getResourceID(PortletWindow window)
     {
         PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
         return ((state != null) ? state.getResourceId() : null);
@@ -371,19 +385,6 @@
         }
     }
 
-    @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());
@@ -399,32 +400,76 @@
         }
     }
 
-    @SuppressWarnings("unchecked")
-    public Iterator<String> getPublicRenderParameterNames(PortletWindow window)
+    public Map<String, String[]> getPublicRenderParameterMap(PortletWindow window)
     {
         PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
-        return (((state != null) && (state.getPublicRenderParametersMap() != null)) ? state.getPublicRenderParametersMap().keySet().iterator() : Collections.EMPTY_LIST.iterator());
+        if (state != null)
+        {
+            return requestStates.getPublicRenderParametersMap(window.getWindowId());
+        }
+        return null;
     }
     
-    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)
+    public void setPublicRenderParametersMap(PortletWindow window, Map<String, String[]> publicRenderParametersMap)
     {
-        PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
-        return ((state != null) ? state.getPublicRenderParametersMap() : null);
+        if (publicRenderParametersMap != null)
+        {
+            PortletWindowRequestNavigationalState targetState = requestStates.getPortletWindowNavigationalState(window.getId().toString());
+            if (targetState != null)
+            {
+                synchronized (requestStates)
+                {
+                    Map<String, String[]> targets = new HashMap<String, String[]>();
+                    Map<QName, String[]> qtargets = new HashMap<QName, String[]>();
+                    for (Map.Entry<String,String[]> entry : publicRenderParametersMap.entrySet())
+                    {
+                        QName qname = targetState.getPublicRenderParameterQNameByIdentifier(entry.getKey());
+                        if (qname != null)
+                        {
+                            qtargets.put(qname, entry.getValue());
+                            targets.put(entry.getKey(),entry.getValue());
+                            if (entry.getValue() == null)
+                            {
+                                requestStates.getPublicRenderParametersMap().remove(qname);
+                            }
+                            else
+                            {
+                                requestStates.getPublicRenderParametersMap().put(qname, entry.getValue());
+                            }
+                        }
+                    }
+                    targetState.setTargetPublicRenderParametersMap(targets);
+                    // now symc with the requestStates publicParametersMap and other possible targetted states
+                    
+                    for (PortletWindowRequestNavigationalState state : requestStates.getPortletWindowRequestNavigationalStates().values())
+                    {
+                        if (state != targetState)
+                        {
+                            if (state.getTargetPublicRenderParametersMap() != null)
+                            {
+                                for (Map.Entry<QName, String[]> entry : qtargets.entrySet())
+                                {
+                                    String identifier = state.getPublicRenderParameterIdentifierByQName(entry.getKey());
+                                    if (identifier != null && state.getTargetPublicRenderParametersMap().containsKey(identifier))
+                                    {
+                                        // update outgoing value
+                                        state.getTargetPublicRenderParametersMap().put(identifier, entry.getValue());
+                                    }
+                                }
+                            }
+                        }
+                    }
+                }
+            }
+        }
     }
     
-    public void setPublicRenderParametersMap(PortletWindow window, Map<String, String[]> publicRenderParametersMap)
+    public void setTargetted(PortletWindow window)
     {
         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);
+            state.setTargetted(true);
         }
     }
     
@@ -467,14 +512,14 @@
             PortletApplication pa = null;
             if (mode != null && !JetspeedActions.getStandardPortletModes().contains(mode))
             {
-                pa = (PortletApplication)window.getPortletEntity().getPortletDefinition().getApplication();
+                pa = window.getPortletDefinition().getApplication();
                 mode = pa.getMappedPortletMode(mode);
             }
             if (state != null && !JetspeedActions.getStandardWindowStates().contains(state))
             {
                 if ( pa == null )
                 {
-                    pa = (PortletApplication)window.getPortletEntity().getPortletDefinition().getApplication();
+                    pa = window.getPortletDefinition().getApplication();
                 }
                 state = pa.getMappedWindowState(state);
             }
@@ -486,20 +531,16 @@
     public String encode(PortletWindow window, PortletMode mode, WindowState state)
     throws UnsupportedEncodingException
     {
+        String windowId = window.getWindowId();
         if ( mode != null || state != null )
         {
-            PortletApplication pa = null;
+            PortletApplication pa = window.getPortletDefinition().getApplication();
             if (mode != null && !JetspeedActions.getStandardPortletModes().contains(mode))
             {
-                pa = (PortletApplication)window.getPortletEntity().getPortletDefinition().getApplication();
                 mode = pa.getMappedPortletMode(mode);
             }
             if (state != null && !JetspeedActions.getStandardWindowStates().contains(state))
             {
-                if ( pa == null )
-                {
-                    pa = (PortletApplication)window.getPortletEntity().getPortletDefinition().getApplication();
-                }
                 state = pa.getMappedWindowState(state);
             }
         }
@@ -513,7 +554,7 @@
             currentWindowStates = ((SessionNavigationalState)this).getCurrentPageWindowStates();
             if (currentWindowStates != null)
             {
-                windowNavState = (PortletWindowExtendedNavigationalState)currentWindowStates.get(window.getId().toString());
+                windowNavState = (PortletWindowExtendedNavigationalState)currentWindowStates.get(windowId);
                 if (windowNavState != null)
                 {
                     if (targetMode == null)
@@ -535,8 +576,9 @@
             {
                 if (windowNavState == null)
                 {
-                    windowNavState = new PortletWindowExtendedNavigationalState(getActionScopedRequestAttributes(window));
-                    currentWindowStates.put(window.getId().toString(), windowNavState);
+                    windowNavState = new PortletWindowExtendedNavigationalState();
+                    windowNavState.setActionScopedRequestAttributes(requestStates.getPortletWindowNavigationalState(windowId).isActionScopedRequestAttributes());
+                    currentWindowStates.put(windowId, windowNavState);
                 }
                 windowNavState.setDecoratorActionEncoding(targetMode, targetState, encodedState);
             }

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=758136&r1=758135&r2=758136&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 Wed Mar 25 03:30:49 2009
@@ -18,14 +18,11 @@
 
 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;
@@ -33,12 +30,7 @@
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.PortalContext;
 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
@@ -63,20 +55,18 @@
     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 ACTION_SCOPE_ID_KEY = 'k';
+    protected static final char PUBLIC_RENDER_PARAM_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";
     protected final PortletMode[] portletModes;
     protected final WindowState[] windowStates;
-    private final PortletWindowAccessor windowAccessor;
     
-    public JetspeedNavigationalStateCodec(PortalContext portalContext, PortletWindowAccessor windowAccessor)
+    public JetspeedNavigationalStateCodec(PortalContext portalContext)
     {
         ArrayList<PortletMode> modesList = new ArrayList<PortletMode>();
-        this.windowAccessor = windowAccessor;
         
         // ensure standard modes will be first in the portletModeNames array
         // this ensures those modes are never lost from a bookmarked url when new modes are added somewhere in the
@@ -121,36 +111,9 @@
             while ( (position = decodeArgument(position, decodedParameters, buffer, PARAMETER_SEPARATOR )) != -1 )
             {
                 parameter = buffer.toString();
-                currentState = decodeParameter( windowAccessor, states, currentState, parameter);
+                currentState = decodeParameter( 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() )
             {
@@ -169,7 +132,7 @@
     {
         PortletWindowRequestNavigationalState currentState;
         buffer.setLength(0);
-        String actionWindowId = states.getActionWindow() != null ? states.getActionWindow().getId().toString() : "";
+        String targetWindowId = states.getTargetWindowId();
         Iterator<String> iter = states.getWindowIdIterator();
         while ( iter.hasNext() )
         {
@@ -184,9 +147,9 @@
             currentState = states.getPortletWindowNavigationalState(iter.next());
             buffer.append("window:"+currentState.getWindowId());
             
-            if ( currentState.getWindowId().equals(actionWindowId))
+            if ( targetWindowId != null && currentState.getWindowId().equals(targetWindowId))
             {
-                buffer.append(",action:true");
+                buffer.append(","+states.getURLType()+":true");
             }
             if (currentState.getPortletMode() != null) 
             {
@@ -267,29 +230,35 @@
                          WindowState windowState, boolean navParamsStateFull, boolean renderParamsStateFull)
     throws UnsupportedEncodingException
     {
-        String windowId = window.getId().toString();
+        String windowId = window.getWindowId();
         PortletWindowRequestNavigationalState currentState = states.getPortletWindowNavigationalState(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);
+        if (currentState == null)
+        {
+            // inject a new (clean) requestState for this window to optimize for possible following encode url request for it
+            currentState = new PortletWindowRequestNavigationalState(windowId);
+            currentState.setPortletDefinition(window.getPortletDefinition());
+            currentState.resolveActionScopedRequestAttributes();
+            states.addPortletWindowNavigationalState(windowId, currentState);
+        }
+        PortletWindowRequestNavigationalState targetState = new PortletWindowRequestNavigationalState(windowId);
+        targetState.setPortletDefinition(window.getPortletDefinition());
+        targetState.setPortletMode(portletMode != null ? portletMode : currentState.getPortletMode());
+        targetState.setWindowState(windowState != null ? windowState : currentState.getWindowState());
 
         // never retain actionRequest parameters nor session stored renderParameters
-        if ( currentState != null && !renderParamsStateFull )
+        if ( !renderParamsStateFull )
         {
             // retain current request parameters if any
-            if ( currentState.getParametersMap() != null )
+            targetState.setParametersMap(currentState.getParametersMap());
+            targetState.setPublicRenderParametersMap(currentState.getParametersMap());
+            if (currentState.isActionScopedRequestAttributes())
             {
-                Iterator<Map.Entry<String, String[]>> parametersIter = currentState.getParametersMap().entrySet().iterator();
-                Map.Entry<String, String[]> entry;
-                while ( parametersIter.hasNext())
-                {
-                    entry = parametersIter.next();
-                    targetState.setParameters(entry.getKey(), entry.getValue());
-                }
+                targetState.setActionScopeId(currentState.getActionScopeId());
+                targetState.setActionScopeRendered(currentState.isActionScopeRendered());
             }
         }
         // encode as requestURL parameters
-        return encode(states, windowId, targetState, PortalURL.URLType.RENDER, navParamsStateFull, renderParamsStateFull);
+        return encode(states, targetState, PortalURL.URLType.RENDER, navParamsStateFull, renderParamsStateFull);
     }
 
     public String encode(PortletWindowRequestNavigationalStates states, PortletWindow window, Map<String, String[]> parameters,
@@ -299,119 +268,60 @@
                          boolean renderParamsStateFull)
     throws UnsupportedEncodingException
     {
-        String windowId = window.getId().toString();
+        String windowId = window.getWindowId();
         PortletWindowRequestNavigationalState currentState = states.getPortletWindowNavigationalState(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);
+        if (currentState == null)
+        {
+            // inject a new (clean) requestState for this window to optimize for possible following encode url request for it
+            currentState = new PortletWindowRequestNavigationalState(windowId);
+            currentState.setPortletDefinition(window.getPortletDefinition());
+            currentState.resolveActionScopedRequestAttributes();
+            states.addPortletWindowNavigationalState(windowId, currentState);
+        }
+        PortletWindowRequestNavigationalState targetState = new PortletWindowRequestNavigationalState(windowId);
+        targetState.setPortletMode(portletMode != null ? portletMode : currentState.getPortletMode());
+        targetState.setWindowState(windowState != null ? windowState : currentState.getWindowState());
         targetState.setParametersMap(parameters);
-        targetState.setActionScopeId(actionScopeId);
-        targetState.setActionScopeRendered(actionScopeRendered);
+        if (currentState.isActionScopedRequestAttributes())
+        {
+            targetState.setActionScopedRequestAttributes(true);
+            targetState.setActionScopeId(actionScopeId);
+            targetState.setActionScopeRendered(actionScopeRendered);
+        }        
         targetState.setCacheLevel(cacheLevel);
         targetState.setResourceId(resourceId);
         targetState.setPrivateRenderParametersMap(privateRenderParameters);
-        setStatePublicRenderParametersMap(states, targetState, publicRenderParameters);
+        targetState.setPublicRenderParametersMap(publicRenderParameters);
         if ( renderParamsStateFull && parameters == null )
         {
             // Indicate that the saved (in the session) render parameters for this PortletWindow must be cleared
             // and not copied when synchronizing the state (encoded as CLEAR_PARAMS_KEY)
             targetState.setClearParameters(true);
         }
-        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);
+        return encode(states, targetState, urlType, navParamsStateFull, renderParamsStateFull);
     }
-        
-    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);
+        return encode(states, null, PortalURL.URLType.RENDER, navParamsStateFull, renderParamsStateFull);
     }
     
-    protected String encode(PortletWindowRequestNavigationalStates states, String targetWindowId, 
+    protected String encode(PortletWindowRequestNavigationalStates states, 
                             PortletWindowRequestNavigationalState targetState, PortalURL.URLType urlType,
                             boolean navParamsStateFull, boolean renderParamsStateFull)
     throws UnsupportedEncodingException
     {
         StringBuffer buffer = new StringBuffer();
         boolean haveState = false;
-        boolean encodeTargetWindowPublicRenderParams = true;
+        String targetWindowId = targetState != null ? targetState.getWindowId() : null;
         
-        // skip other states if all non-targeted PortletWindow states are kept in the session
-        if (!navParamsStateFull || !renderParamsStateFull)
-        {
-            // encode individual request states, (skip target request state encoded below)
-            Iterator<String> iter = states.getWindowIdIterator();
-            while (iter.hasNext())
-            {
-                String windowId = iter.next();
-                PortletWindowRequestNavigationalState requestState = states.getPortletWindowNavigationalState(windowId);
-                if ((targetWindowId == null) || !windowId.equals(targetWindowId))
-                {
-                    encodeTargetWindowPublicRenderParams = false;
-                    String encodedState = encodePortletWindowNavigationalState(windowId, requestState, PortalURL.URLType.RENDER, navParamsStateFull, renderParamsStateFull, false);
-                    if (encodedState.length() > 0)
-                    {
-                        if ( !haveState )
-                        {
-                            haveState = true;
-                        }
-                        else
-                        {
-                            buffer.append(PARAMETER_SEPARATOR);
-                        }
-                        buffer.append(encodedState);
-                    }
-                }
-            }
-        }
-        // encode target request state
-        if (targetWindowId != null)
+        if (targetState != null)
         {
-            String encodedState = encodePortletWindowNavigationalState(targetWindowId, targetState, urlType, false, false, encodeTargetWindowPublicRenderParams);
+            String encodedState = encodePortletWindowNavigationalState(targetState, 
+                                                                       urlType, 
+                                                                       targetState.getTargetPublicRenderParametersMap(),
+                                                                       false, false);
             if (encodedState.length() > 0)
             {
                 if (!haveState)
@@ -425,155 +335,65 @@
                 buffer.append(encodedState);
             }
         }
-        // encode shared public render parameter request states
-        // if they have not been encoded on the target window
-        if (haveState && !encodeTargetWindowPublicRenderParams)
+        
+        // encode individual request states, (skip target request state encoded below)
+        Iterator<String> iter = states.getWindowIdIterator();
+        while (iter.hasNext())
         {
-            String encodedState = encodePublicRenderParameterState(states, urlType, navParamsStateFull, renderParamsStateFull);
-            if (encodedState.length() > 0)
+            String windowId = iter.next();
+            PortletWindowRequestNavigationalState requestState = states.getPortletWindowNavigationalState(windowId);
+            if (!navParamsStateFull || !renderParamsStateFull || requestState.isTargetted())
             {
-                if ( !haveState )
+                if (!(targetWindowId != null && windowId.equals(targetWindowId)))
                 {
-                    haveState = true;
+                    Map<String, String[]> publicRenderParametersMap = null;
+                    if (requestState.isTargetted())
+                    {
+                        publicRenderParametersMap = requestState.getTargetPublicRenderParametersMap();
+                    }
+                    String encodedState = encodePortletWindowNavigationalState(requestState, 
+                                                                               PortalURL.URLType.RENDER, 
+                                                                               publicRenderParametersMap, 
+                                                                               navParamsStateFull, renderParamsStateFull);
+                    if (encodedState.length() > 0)
+                    {
+                        if ( !haveState )
+                        {
+                            haveState = true;
+                        }
+                        else
+                        {
+                            buffer.append(PARAMETER_SEPARATOR);
+                        }
+                        buffer.append(encodedState);
+                    }
+
+                    
                 }
                 else
                 {
-                    buffer.append(PARAMETER_SEPARATOR);
                 }
-                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;
-        }
-        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)
-        {
-            return getPublicRenderParameterNamesMap(window);
-        }
-        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 encodePublicRenderParams)
+    protected String encodePortletWindowNavigationalState(PortletWindowRequestNavigationalState state, 
+                                                          PortalURL.URLType urlType, 
+                                                          Map<String, String[]> publicRenderParametersMap,
+                                                          boolean navParamsStateFull, boolean renderParamsStateFull)
     {
         // encode required url type
+        String windowId = state.getWindowId();
         StringBuffer buffer = new StringBuffer();
         buffer.append(URLTYPE_ID_KEYS[urlType.ordinal()]);
         buffer.append(windowId);
         boolean encoded = !PortalURL.URLType.RENDER.equals(urlType);
-
+        
         // encode portlet mode and window state
-        if (PortalURL.URLType.ACTION.equals(urlType) || !navParamsStateFull)
+        if (!navParamsStateFull || state.isTargetted() || PortalURL.URLType.ACTION.equals(urlType))
         {
             if (state.getPortletMode() != null)
             {
@@ -592,11 +412,11 @@
         }
 
         // encode render parameters, (can be optionally be held in session state)
-        if ((PortalURL.URLType.ACTION.equals(urlType) || !renderParamsStateFull))
+        if (!renderParamsStateFull || state.isTargetted() || PortalURL.URLType.ACTION.equals(urlType))
         {
             if (state.getParametersMap() != null)
             {
-                encoded = encodeParameterMap(encoded, PARAM_KEY, state.getParametersMap(), buffer);
+                encoded = encodeParameterMap(encoded, PARAM_KEY, false, state.getParametersMap(), buffer);
             }
             if (state.isActionScopedRequestAttributes())
             {
@@ -616,7 +436,7 @@
                 }
             }
         }
-
+        
         // encode resource urls specific parameters
         if (PortalURL.URLType.RESOURCE.equals(urlType))
         {
@@ -625,7 +445,7 @@
                 encoded = true;
                 buffer.append(PARAMETER_SEPARATOR);
                 buffer.append(CACHE_LEVEL_KEY);
-                buffer.append(encodeArgument(state.getActionScopeId(), PARAMETER_SEPARATOR));
+                buffer.append(encodeArgument(state.getCacheLevel(), PARAMETER_SEPARATOR));
             }
             if (state.getResourceId() != null)
             {
@@ -636,7 +456,7 @@
             }
             if (state.getPrivateRenderParametersMap() != null)
             {
-                encoded = encodeParameterMap(encoded, PRIVATE_RENDER_PARAM_KEY, state.getPrivateRenderParametersMap(), buffer);
+                encoded = encodeParameterMap(encoded, PRIVATE_RENDER_PARAM_KEY, false, state.getPrivateRenderParametersMap(), buffer);
             }
         }
 
@@ -651,48 +471,50 @@
             buffer.append(CLEAR_PARAMS_KEY);            
             encoded = true;
         }
-
+        
         // encode public render parameters for single state, (can be optionally be held in session state)
-        if (encodePublicRenderParams && (state.getPublicRenderParametersMap() != null) && (PortalURL.URLType.ACTION.equals(urlType) || !renderParamsStateFull))
+        if (!renderParamsStateFull || state.isTargetted() || PortalURL.URLType.ACTION.equals(urlType))
         {
-            // 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);
-                }
+            if (publicRenderParametersMap != null)
+            {
+                encoded = encodeParameterMap(encoded, PUBLIC_RENDER_PARAM_KEY, true, publicRenderParametersMap, buffer);
             }
-            encoded = encodeParameterMap(encoded, PUBLIC_RENDER_PARAM_KEY, publicRenderParams, buffer);
         }
-
+        
         // return encoded result if state other than url type is encoded
         return encoded ? buffer.toString() : "";
     }
     
-    protected boolean encodeParameterMap(boolean encoded, char paramsKey, Map<? extends Object, String[]> params, StringBuffer buffer)
+    protected boolean encodeParameterMap(boolean encoded, char paramsKey, boolean allowNullValues, Map<String, String[]> params, StringBuffer buffer)
     {
         StringBuffer paramBuffer = new StringBuffer();
-        for (Map.Entry<? extends Object, String[]> entry : params.entrySet())
+        for (Map.Entry<String, String[]> entry : params.entrySet())
         {
+            String parameterName = entry.getKey();
+            String [] parameterValues = entry.getValue();
+            
+            if (parameterValues == null && !allowNullValues)
+            {
+                continue;
+            }
             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++ )
+            if (parameterValues != null)
             {
-                paramBuffer.append(PARAMETER_ELEMENT_SEPARATOR);
-                paramBuffer.append(encodeArgument(parameterValues[i], 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));
+                }
+            }
+            else
+            {
+                paramBuffer.append('0');
             }
 
             buffer.append(paramsKey);
@@ -701,7 +523,7 @@
         return encoded;
     }
     
-    protected PortletWindowRequestNavigationalState decodeParameter(PortletWindowAccessor accessor, PortletWindowRequestNavigationalStates states, PortletWindowRequestNavigationalState currentState, String parameter)
+    protected PortletWindowRequestNavigationalState decodeParameter(PortletWindowRequestNavigationalStates states, PortletWindowRequestNavigationalState currentState, String parameter)
     {
         char parameterType = parameter.charAt(0);
         PortalURL.URLType urlType = null;
@@ -718,22 +540,10 @@
             currentState = states.getPortletWindowNavigationalState(windowId);
             if ( currentState == null )
             {
-                PortletWindow window = accessor.getPortletWindow(windowId);
-                if ( window == null )
-                {
-                    window = accessor.createPortletWindow(windowId);
-                }
-                currentState = new PortletWindowRequestNavigationalState(windowId, getActionScopedRequestAttributes(window));
-                states.addPortletWindowNavigationalState(windowId, currentState);
-                if ( parameterType == ACTION_WINDOW_ID_KEY )
-                {
-                    states.setActionWindow(window);
-                }
-                else if (parameterType != RENDER_WINDOW_ID_KEY )
-                {
-                    states.setResourceWindow(window);
-                }
                 states.setURLType(urlType);
+                currentState = new PortletWindowRequestNavigationalState(windowId);
+                states.addPortletWindowNavigationalState(windowId, currentState);
+                states.setTargetWindowId(windowId);
             }
         }
         else if (currentState != null)
@@ -755,15 +565,6 @@
                     if ( windowState != null )
                     {
                         currentState.setWindowState(windowState);
-                        if (windowState.equals(WindowState.MAXIMIZED) || windowState.equals(JetspeedActions.SOLO_STATE))
-                        {
-                            PortletWindow window = accessor.getPortletWindow(currentState.getWindowId());
-                            if ( window == null )
-                            {
-                                window = accessor.createPortletWindow(currentState.getWindowId());
-                            }                                    
-                            states.setMaximizedWindow(window);
-                        }
                     }
                     break;
                 }
@@ -795,10 +596,13 @@
                             case PUBLIC_RENDER_PARAM_KEY:
                             {
                                 // set public render parameter states
-                                QName parameterQName = decodeQName(parameterName[0]);
-                                if (parameterQName != null)
+                                if (parameterValues[0] == null || parameterValues[0].length == 0)
                                 {
-                                    states.setPublicRenderParameters(parameterQName, parameterValues[0]);
+                                    currentState.setPublicRenderParameters(parameterName[0], (String[])null);
+                                }
+                                else
+                                {
+                                    currentState.setPublicRenderParameters(parameterName[0], parameterValues[0]);
                                 }
                                 break;
                             }
@@ -856,27 +660,6 @@
                 }
             }
         }
-        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;
     }
 
@@ -1049,52 +832,4 @@
         }
         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=758136&r1=758135&r2=758136&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 Wed Mar 25 03:30:49 2009
@@ -18,11 +18,9 @@
 
 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;
@@ -45,19 +43,4 @@
 
     String encode(PortletWindowRequestNavigationalStates states, boolean navParamsStateFull, boolean renderParamsStateFull) 
         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/PathNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PathNavigationalState.java?rev=758136&r1=758135&r2=758136&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PathNavigationalState.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PathNavigationalState.java Wed Mar 25 03:30:49 2009
@@ -16,6 +16,8 @@
  */
 package org.apache.jetspeed.container.state.impl;
 
+import javax.servlet.http.HttpSession;
+
 import org.apache.jetspeed.cache.JetspeedContentCache;
 import org.apache.jetspeed.request.RequestContext;
 
@@ -34,8 +36,21 @@
         super(codec, cache);
     }
 
-    public void sync(RequestContext context)
+    public boolean sync(RequestContext context)
     {        
+        HttpSession session = context.getRequest().getSession();
+        Object syncLock = session;
+        if (syncLock == null)
+        {
+            syncLock = new Object();
+        }
+        synchronized (syncLock)
+        {
+            boolean result = resolvePortletWindows(context);
+            resolvePublicParametersMap();
+            resetRequestPortletWindowPublicRenderParameters();
+            return result;
+        }
     }
 
     public boolean isNavigationalParameterStateFull()

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowBaseNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowBaseNavigationalState.java?rev=758136&r1=758135&r2=758136&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowBaseNavigationalState.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowBaseNavigationalState.java Wed Mar 25 03:30:49 2009
@@ -32,6 +32,7 @@
     private static final long serialVersionUID = 4188214497281562619L;
     private String modeName;
     private String stateName;
+    private boolean actionScopedRequestAttributes;
     
     private transient PortletMode portletMode;
     private transient WindowState windowState;
@@ -65,4 +66,14 @@
         this.windowState = windowState;
         this.stateName = windowState == null ? null : windowState.toString();
     }
+
+    public void setActionScopedRequestAttributes(boolean actionScopedRequestAttributes)
+    {
+        this.actionScopedRequestAttributes = actionScopedRequestAttributes;
+    }
+    
+    public boolean isActionScopedRequestAttributes()
+    {
+        return actionScopedRequestAttributes;
+    }
 }

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=758136&r1=758135&r2=758136&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 Wed Mar 25 03:30:49 2009
@@ -64,15 +64,8 @@
         }
     }
     
-    public PortletWindowExtendedNavigationalState(boolean actionScopedRequestAttributes)
-    {
-        this.actionScopedRequestAttributes = actionScopedRequestAttributes;
-    }
-    
     private Map<String, String[]> parametersMap;
 
-    private boolean actionScopedRequestAttributes;
-    
     private String actionScopeId;
     
     private boolean actionScopeRendered;
@@ -98,11 +91,6 @@
         this.parametersMap = parametersMap;
     }
     
-    public boolean isActionScopedRequestAttributes()
-    {
-        return actionScopedRequestAttributes;
-    }
-    
     public String getActionScopeId()
     {
         return actionScopeId;



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