portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r738286 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/ components/jetspeed-portal/src/...
Date Tue, 27 Jan 2009 22:40:58 GMT
Author: ate
Date: Tue Jan 27 22:40:57 2009
New Revision: 738286

URL: http://svn.apache.org/viewvc?rev=738286&view=rev
Log:
JS2-926: Adding JSR-286 ResourceURL and ResourceServingPortlet support
See: https://issues.apache.org/jira/browse/JS2-926

TODO: ResourceID and Resource specific CacheControl 

Removed:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/RequestPropertyProviderImpl.java
Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.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/services/JetspeedPortalCallbackServices.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/JetspeedNavigationalStateComponent.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/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/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-portal/src/main/java/org/apache/jetspeed/resource/BufferedHttpServletResponse.java
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/resource/ResourceValveImpl.java
    portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.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-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java
    portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletObjectProxy.java
    portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletResourceURLFactoryImpl.java
    portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pluto-services.xml

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ServletPortletInvoker.java Tue Jan 27 22:40:57 2009
@@ -171,6 +171,7 @@
         // gather all required data from request and response
         ServletRequest servletRequest = this.requestResponseUnwrapper.unwrapPortletRequest(portletRequest);
         ServletResponse servletResponse = this.requestResponseUnwrapper.unwrapPortletResponse(portletResponse);
+        boolean useForward = servletRequest.getAttribute(PortalReservedParameters.PORTLET_CONTAINER_INVOKER_USE_FORWARD) != null;
 
         try
         {
@@ -213,13 +214,20 @@
             }
 
             PortletRequestContext.createContext(portletDefinition, portletInstance, portletRequest, portletResponse);
-            dispatcher.include(servletRequest, servletResponse);
+            if (useForward)
+            {
+                dispatcher.forward(servletRequest, servletResponse);
+            }
+            else
+            {
+                dispatcher.include(servletRequest, servletResponse);
+            }
             
         }
         catch (Exception e)
         {
             String message =
-                "Failed to dispatch.include for Portlet Application: " + portletApplicationName + ", servlet: " + servletMappingName;
+                "Failed to dispatch."+(useForward?"forward":"include")+" for Portlet Application: " + portletApplicationName + ", servlet: " + servletMappingName;
             log.error(message, e);
             throw new PortletException(message, e);
         }

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=738286&r1=738285&r2=738286&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 Tue Jan 27 22:40:57 2009
@@ -17,6 +17,7 @@
 package org.apache.jetspeed.container.providers;
 
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 
 import javax.portlet.PortletMode;
@@ -37,15 +38,14 @@
  */
 public class PortletURLProviderImpl implements PortletURLProvider
 {
+    private PortalURL.URLType urlType = PortalURL.URLType.RENDER;
     private PortletWindow portletWindow = null;
     private PortletMode mode = null;
     private WindowState state = null;
-    private boolean action = false;
     private boolean secure = false;
     private Map<String, String[]> privateParameters = null;
     private Map<String, String[]> publicParameters = null;
     private Map<String, String[]> requestParameters = null;
-    private boolean resource = false;
 
     private PortalURL url;
     
@@ -81,7 +81,7 @@
     public String toString()
     {
         // TODO: handle publicParameters, resource url, resourceID, cacheability (last two needs to be added to the PortletURLPRovider interface)
-        return url.createPortletURL(portletWindow,privateParameters,mode,state,action,secure);
+        return url.createPortletURL(portletWindow,privateParameters,mode,state,urlType,secure);
     }
     
     public void setParameters(Map parameters)
@@ -102,7 +102,7 @@
 
     public boolean isResourceServing()
     {
-        return resource;
+        return PortalURL.URLType.RESOURCE.equals(urlType);
     }
 
     public boolean isSecureSupported()
@@ -118,7 +118,7 @@
 
     public void setAction(boolean isAction)
     {
-        action = isAction;
+        urlType = isAction ? PortalURL.URLType.ACTION : PortalURL.URLType.RENDER;
     }
 
     public void setPublicRenderParameters(Map parameters)
@@ -128,7 +128,7 @@
 
     public void setResourceServing(boolean isResourceServing)
     {
-        resource = isResourceServing;
+        urlType = isResourceServing ? PortalURL.URLType.RESOURCE : PortalURL.URLType.RENDER;
     }
 
     public Map<String, String[]> getRenderParameters()
@@ -140,5 +140,13 @@
     {
         return this.requestParameters = parentMap;
     }
-    
+
+    public Map<String, List<String>> getProperties()
+    {
+        return null;
+    }
+
+    public void setProperties(Map<String, List<String>> properties)
+    {
+    }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedPortalCallbackServices.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedPortalCallbackServices.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedPortalCallbackServices.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedPortalCallbackServices.java Tue Jan 27 22:40:57 2009
@@ -30,7 +30,7 @@
 import org.apache.pluto.spi.PortalCallbackService;
 import org.apache.pluto.spi.PortletURLListener;
 import org.apache.pluto.spi.PortletURLProvider;
-import org.apache.pluto.spi.RequestPropertyProvider;
+import org.apache.pluto.spi.PropertyManager;
 import org.apache.pluto.spi.ResourceURLProvider;
 
 /**
@@ -42,15 +42,15 @@
  */
 public class JetspeedPortalCallbackServices implements PortalCallbackService
 {
-    RequestPropertyProvider propertyProvider;   
+    PropertyManager propertyManager;   
     EventProvider eventProvider; 
     FilterManager filterManager;
     PortletURLListener urlListener;
     
-    public JetspeedPortalCallbackServices(RequestPropertyProvider propertyProvider,
+    public JetspeedPortalCallbackServices(PropertyManager propertyManager,
             EventProvider eventProvider, FilterManager filterManager, PortletURLListener urlListener)
     {
-        this.propertyProvider = propertyProvider;
+        this.propertyManager = propertyManager;
         this.eventProvider = eventProvider;
         this.filterManager = filterManager;
         this.urlListener = urlListener;
@@ -72,9 +72,9 @@
         return new ResourceURLProviderImpl(rc, portletWindow);
     }
 
-    public RequestPropertyProvider getRequestPropertyProvider()
+    public PropertyManager getPropertyManager()
     {
-        return propertyProvider;
+        return propertyManager;
     }
         
 

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=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/AbstractNavigationalState.java Tue Jan 27 22:40:57 2009
@@ -27,6 +27,7 @@
 import org.apache.jetspeed.JetspeedActions;
 import org.apache.jetspeed.cache.JetspeedContentCache;
 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.container.PortletWindow;
 
@@ -196,7 +197,8 @@
         return requestStates.getMaximizedWindow();
     }
 
-    public Iterator getParameterNames(PortletWindow window)
+    @SuppressWarnings("unchecked")
+    public Iterator<String> getParameterNames(PortletWindow window)
     {
         PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
         if ( state != null && state.getParametersMap() != null )
@@ -233,6 +235,11 @@
             return null;
     }
     
+    public PortalURL.URLType getURLType()
+    {
+        return requestStates.getURLType();
+    }
+    
     public PortletWindow getPortletWindowOfAction()
     {
         return requestStates.getActionWindow();
@@ -243,7 +250,13 @@
         return requestStates.getResourceWindow();
     }
 
-    public String encode(PortletWindow window, Map parameters, PortletMode mode, WindowState state, boolean action)
+    public String encode(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, boolean action)
+    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
     {
         if ( mode != null || state != null )
@@ -263,7 +276,7 @@
                 state = pa.getMappedWindowState(state);
             }
         }
-        return codec.encode(requestStates, window, parameters, mode, state, action, isNavigationalParameterStateFull(),
+        return codec.encode(requestStates, window, parameters, mode, state, urlType, isNavigationalParameterStateFull(),
                 isRenderParameterStateFull());
     }
 
@@ -288,7 +301,7 @@
             }
         }
         String encodedState = null;
-        Map currentWindowStates = null;
+        Map<String, PortletWindowBaseNavigationalState> currentWindowStates = null;
         PortletWindowExtendedNavigationalState windowNavState = null;
         PortletMode targetMode = mode;
         WindowState targetState = state;
@@ -333,7 +346,7 @@
         return codec.encode(requestStates, isNavigationalParameterStateFull(), isRenderParameterStateFull());
     }
 
-    public Iterator getWindowIdIterator()
+    public Iterator<String> getWindowIdIterator()
     {
         return requestStates.getWindowIdIterator();
     }
@@ -343,7 +356,7 @@
         PortletWindowRequestNavigationalState state = requestStates.getPortletWindowNavigationalState(window.getId().toString());
         if (state != null)
         {
-            Map map = state.getParametersMap();
+            Map<String, String[]> map = state.getParametersMap();
             if (map != null)
             {
                 map.clear();

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=738286&r1=738285&r2=738286&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 Tue Jan 27 22:40:57 2009
@@ -26,6 +26,7 @@
 
 import org.apache.jetspeed.cache.JetspeedContentCache;
 import org.apache.jetspeed.container.PortletWindow;
+import org.apache.jetspeed.container.url.PortalURL;
 
 /**
  * HybridNavigationalState
@@ -45,21 +46,26 @@
         this.prefix = prefix;
     }
     
-    public String encode(PortletWindow window, Map parameters, PortletMode mode, WindowState state, boolean action)
+    public String encode(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, boolean action)
     throws UnsupportedEncodingException
     {
-        Map subset = new HashMap();
-        Iterator params = parameters.keySet().iterator();
+        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())
         {
-            String key = (String)params.next();
+            String key = params.next();
             if (key.startsWith(prefix))
             {
                 // only encode params that start with prefix
                 subset.put(key, parameters.get(key));
             }
         }
-        return super.encode(window, subset, mode, state, action);
+        return super.encode(window, subset, mode, state, urlType);
     }
 
     public boolean isNavigationalParameterStateFull()
@@ -71,6 +77,4 @@
     {
         return false;
     }
-    
-    
 }

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=738286&r1=738285&r2=738286&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 Tue Jan 27 22:40:57 2009
@@ -30,6 +30,7 @@
 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;
 
@@ -53,6 +54,7 @@
     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[] URLTYPE_ID_KEYS = { 'b', 'g', 'a' };
     
     protected static final String keytable = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
     protected final PortletMode[] portletModes;
@@ -61,30 +63,29 @@
     
     public JetspeedNavigationalStateCodec(PortalContext portalContext, PortletWindowAccessor windowAccessor)
     {
-        ArrayList list = new ArrayList();
+        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
         // middle
-        list.addAll(JetspeedActions.getStandardPortletModes());
-        list.addAll(JetspeedActions.getExtendedPortletModes());
+        modesList.addAll(JetspeedActions.getStandardPortletModes());
+        modesList.addAll(JetspeedActions.getExtendedPortletModes());
         
-        portletModes = (PortletMode[])list.toArray(new PortletMode[list.size()]);
+        portletModes = modesList.toArray(new PortletMode[modesList.size()]);
         if (portletModes.length > keytable.length())
         {
             throw new UnsupportedOperationException("Too many supported PortletModes found. Can only handle max: "+keytable.length());
         }
         
-        list.clear();
-        
         // ensure standard states will be first in the windowStateNames array
         // this ensures those states are never lost from a bookmarked url when new states are added somewhere in the
         // middle
-        list.addAll(JetspeedActions.getStandardWindowStates());
-        list.addAll(JetspeedActions.getExtendedWindowStates());
+        ArrayList<WindowState> statesList = new ArrayList<WindowState>();
+        statesList.addAll(JetspeedActions.getStandardWindowStates());
+        statesList.addAll(JetspeedActions.getExtendedWindowStates());
         
-        windowStates = (WindowState[])list.toArray(new WindowState[list.size()]);        
+        windowStates = statesList.toArray(new WindowState[statesList.size()]);        
         if (windowStates.length > keytable.length())
         {
             throw new UnsupportedOperationException("Too many supported WindowModes found. Can only handle max: "+keytable.length());
@@ -128,7 +129,7 @@
         PortletWindowRequestNavigationalState currentState;
         buffer.setLength(0);
         String actionWindowId = states.getActionWindow() != null ? states.getActionWindow().getId().toString() : "";
-        Iterator iter = states.getWindowIdIterator();
+        Iterator<String> iter = states.getWindowIdIterator();
         while ( iter.hasNext() )
         {
             if ( buffer.length() == 0 )
@@ -139,7 +140,7 @@
             {
                 buffer.append(",[");
             }
-            currentState = states.getPortletWindowNavigationalState((String)iter.next());
+            currentState = states.getPortletWindowNavigationalState(iter.next());
             buffer.append("window:"+currentState.getWindowId());
             
             if ( currentState.getWindowId().equals(actionWindowId))
@@ -160,7 +161,7 @@
                 {
                     buffer.append(",parameters:[");
                     boolean first = true;
-                    Iterator parIter = currentState.getParametersMap().keySet().iterator();
+                    Iterator<String> parIter = currentState.getParametersMap().keySet().iterator();
                     while ( parIter.hasNext() ) 
                     {
                         if ( first )
@@ -171,9 +172,9 @@
                         {
                             buffer.append(",");
                         }
-                        String name = (String)parIter.next();
+                        String name = parIter.next();
                         buffer.append(name+":[");
-                        String[] values = (String[])currentState.getParametersMap().get(name);
+                        String[] values = currentState.getParametersMap().get(name);
                         for ( int i = 0; i < values.length; i++ )
                         {
                             if ( i > 0 )
@@ -206,21 +207,21 @@
             // retain current request parameters if any
             if ( currentState.getParametersMap() != null )
             {
-                Iterator parametersIter = currentState.getParametersMap().entrySet().iterator();
-                Map.Entry entry;
+                Iterator<Map.Entry<String, String[]>> parametersIter = currentState.getParametersMap().entrySet().iterator();
+                Map.Entry<String, String[]> entry;
                 while ( parametersIter.hasNext())
                 {
-                    entry = (Map.Entry)parametersIter.next();
-                    targetState.setParameters((String)entry.getKey(), (String[])entry.getValue());
+                    entry = parametersIter.next();
+                    targetState.setParameters(entry.getKey(), entry.getValue());
                 }
             }
         }
         // encode as requestURL parameters
-        return encode(states, windowId, targetState, false, false, navParamsStateFull, renderParamsStateFull);
+        return encode(states, windowId, targetState, PortalURL.URLType.RENDER, navParamsStateFull, renderParamsStateFull);
     }
 
-    public String encode(PortletWindowRequestNavigationalStates states, PortletWindow window, Map parameters, 
-            PortletMode portletMode, WindowState windowState, boolean action, boolean navParamsStateFull, 
+    public String encode(PortletWindowRequestNavigationalStates states, PortletWindow window, Map<String, String[]> parameters, 
+            PortletMode portletMode, WindowState windowState, PortalURL.URLType urlType, boolean navParamsStateFull, 
             boolean renderParamsStateFull)
     throws UnsupportedEncodingException
     {
@@ -229,45 +230,23 @@
         PortletWindowRequestNavigationalState targetState = new PortletWindowRequestNavigationalState(windowId);
         targetState.setPortletMode(portletMode != null ? portletMode : currentState != null ? currentState.getPortletMode() : null);
         targetState.setWindowState(windowState != null ? windowState : currentState != null ? currentState.getWindowState() : null);
-        
-        Iterator parametersIter = parameters.entrySet().iterator();
-        
-        boolean resource = false;
-
-        Map.Entry entry;
-        String parameter;
-        // fill in the new parameters
-        while ( parametersIter.hasNext())
-        {
-            entry = (Map.Entry)parametersIter.next();
-            parameter = (String)entry.getKey();
-            if (!resource && !action && PortalReservedParameters.PORTLET_RESOURCE_URL_REQUEST_PARAMETER.equals(parameter))
-            {
-                resource = true;
-                navParamsStateFull = true;
-                renderParamsStateFull = true;
-            }
-            else
-            {
-                targetState.setParameters(parameter, (String[])entry.getValue());
-            }
-        }
-        if ( renderParamsStateFull && targetState.getParametersMap() == null )
+        targetState.setParametersMap(parameters);
+        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, action, resource, navParamsStateFull, renderParamsStateFull);
+        return encode(states, windowId, targetState, urlType, navParamsStateFull, renderParamsStateFull);
     }
 
     public String encode(PortletWindowRequestNavigationalStates states, boolean navParamsStateFull, boolean renderParamsStateFull)
     throws UnsupportedEncodingException
     {
-        return encode(states, null, null, false, false, navParamsStateFull, renderParamsStateFull);
+        return encode(states, null, null, PortalURL.URLType.RENDER, navParamsStateFull, renderParamsStateFull);
     }
     protected String encode(PortletWindowRequestNavigationalStates states, String targetWindowId, 
-            PortletWindowRequestNavigationalState targetState, boolean action, boolean resource, boolean navParamsStateFull, 
+            PortletWindowRequestNavigationalState targetState, PortalURL.URLType urlType, boolean navParamsStateFull, 
             boolean renderParamsStateFull)
     throws UnsupportedEncodingException
     {
@@ -280,10 +259,10 @@
         {
             PortletWindowRequestNavigationalState pwfns;
             String windowId;
-            Iterator iter = states.getWindowIdIterator();
+            Iterator<String> iter = states.getWindowIdIterator();
             while ( iter.hasNext() )
             {
-                windowId = (String)iter.next();
+                windowId = iter.next();
                 pwfns = states.getPortletWindowNavigationalState(windowId);
                 if ( targetWindowId != null && windowId.equals(targetWindowId))
                 {
@@ -291,7 +270,7 @@
                 }
                 else
                 {
-                    encodedState = encodePortletWindowNavigationalState(windowId, pwfns, false, false, navParamsStateFull, 
+                    encodedState = encodePortletWindowNavigationalState(windowId, pwfns, PortalURL.URLType.RENDER, navParamsStateFull, 
                             renderParamsStateFull);
                     if ( encodedState.length() > 0 )
                     {
@@ -310,7 +289,7 @@
         }
         if (targetWindowId != null)
         {
-            encodedState = encodePortletWindowNavigationalState(targetWindowId, targetState, action, resource, false, false); 
+            encodedState = encodePortletWindowNavigationalState(targetWindowId, targetState, urlType, false, false); 
             if ( encodedState.length() > 0 )
             {
                 if ( !haveState )
@@ -333,14 +312,14 @@
     }
     
     protected String encodePortletWindowNavigationalState(String windowId, PortletWindowRequestNavigationalState state, 
-            boolean action, boolean resource, boolean navParamsStateFull, boolean renderParamsStateFull)
+                                                          PortalURL.URLType urlType, boolean navParamsStateFull, 
+                                                          boolean renderParamsStateFull)
     {
         StringBuffer buffer = new StringBuffer();
-        buffer.append(action ? ACTION_WINDOW_ID_KEY : resource? RESOURCE_WINDOW_ID_KEY: RENDER_WINDOW_ID_KEY);
+        buffer.append(URLTYPE_ID_KEYS[urlType.ordinal()]);
         buffer.append(windowId);
-        boolean encoded = action || resource;
-        
-        if ( action || !navParamsStateFull )
+        boolean encoded = !PortalURL.URLType.RENDER.equals(urlType);
+        if ( PortalURL.URLType.ACTION.equals(urlType) || !navParamsStateFull )
         {
             if (state.getPortletMode() != null)
             {
@@ -359,20 +338,20 @@
             }
         }
 
-        if (state.getParametersMap() != null && (action || !renderParamsStateFull) )
+        if (state.getParametersMap() != null && (PortalURL.URLType.ACTION.equals(urlType) || !renderParamsStateFull) )
         {
-            Map.Entry entry;
+            Map.Entry<String, String[]> entry;
             String   parameterName;
             String[] parameterValues;
 
             StringBuffer paramBuffer = new StringBuffer();
-            Iterator iter = state.getParametersMap().entrySet().iterator();
+            Iterator<Map.Entry<String,String[]>> iter = state.getParametersMap().entrySet().iterator();
             while ( iter.hasNext() )
             {
                 encoded = true;
-                entry = (Map.Entry)iter.next();
-                parameterName = (String)entry.getKey();
-                parameterValues = (String[])entry.getValue();
+                entry = iter.next();
+                parameterName = entry.getKey();
+                parameterValues = entry.getValue();
                
                 buffer.append(PARAMETER_SEPARATOR);
                 buffer.append(PARAM_KEY);
@@ -406,7 +385,15 @@
     protected PortletWindowRequestNavigationalState decodeParameter(PortletWindowAccessor accessor, PortletWindowRequestNavigationalStates states, PortletWindowRequestNavigationalState currentState, String parameter)
     {
         char parameterType = parameter.charAt(0);
-        if (parameterType == RENDER_WINDOW_ID_KEY || parameterType == ACTION_WINDOW_ID_KEY || parameterType == RESOURCE_WINDOW_ID_KEY )
+        PortalURL.URLType urlType = null;
+        
+        switch (parameterType)
+        {
+            case RENDER_WINDOW_ID_KEY: urlType = PortalURL.URLType.RENDER; break;
+            case ACTION_WINDOW_ID_KEY: urlType = PortalURL.URLType.ACTION; break;
+            case RESOURCE_WINDOW_ID_KEY: urlType = PortalURL.URLType.RESOURCE; break;
+        }
+        if (urlType != null)
         {            
             String windowId = parameter.substring(1);
             currentState = states.getPortletWindowNavigationalState(windowId);
@@ -423,10 +410,11 @@
                 {
                     states.setActionWindow(window);
                 }
-                else if (parameterType == RESOURCE_WINDOW_ID_KEY )
+                else if (parameterType != RENDER_WINDOW_ID_KEY )
                 {
                     states.setResourceWindow(window);
                 }
+                states.setURLType(urlType);
             }
         }
         else if ( currentState != null )

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateComponent.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateComponent.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateComponent.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/JetspeedNavigationalStateComponent.java Tue Jan 27 22:40:57 2009
@@ -49,8 +49,8 @@
     
     // maps containing allowed PortletMode and WindowState objects on their lowercase name
     // ensuring only allowed, and always the same objects are returned and allowing comparision by value
-    private final Map supportedPortletModes = Collections.synchronizedMap(new HashMap());
-    private final Map supportedWindowStates = Collections.synchronizedMap(new HashMap());
+    private final Map<String, PortletMode> supportedPortletModes = Collections.synchronizedMap(new HashMap<String, PortletMode>());
+    private final Map<String, WindowState> supportedWindowStates = Collections.synchronizedMap(new HashMap<String, WindowState>());
 
     private BeanFactory beanFactory;
     
@@ -75,18 +75,18 @@
         this.urlBeanName = urlBeanName;
         this.desktopUrlBeanName = desktopUrlBeanName;
 
-        Enumeration portletModesEnum = portalContext.getSupportedPortletModes();
+        Enumeration<PortletMode> portletModesEnum = portalContext.getSupportedPortletModes();
         PortletMode portletMode;
         while ( portletModesEnum.hasMoreElements() )
         {
-            portletMode = (PortletMode)portletModesEnum.nextElement();
+            portletMode = portletModesEnum.nextElement();
             supportedPortletModes.put(portletMode.toString(), portletMode);
         }
-        Enumeration windowStatesEnum = portalContext.getSupportedWindowStates();
+        Enumeration<WindowState> windowStatesEnum = portalContext.getSupportedWindowStates();
         WindowState windowState;
         while ( windowStatesEnum.hasMoreElements() )
         {
-            windowState = (WindowState)windowStatesEnum.nextElement();
+            windowState = windowStatesEnum.nextElement();
             supportedWindowStates.put(windowState.toString(), windowState);
         }
     }

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=738286&r1=738285&r2=738286&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 Tue Jan 27 22:40:57 2009
@@ -23,6 +23,7 @@
 import javax.portlet.WindowState;
 
 import org.apache.jetspeed.container.PortletWindow;
+import org.apache.jetspeed.container.url.PortalURL;
 
 public interface NavigationalStateCodec
 {
@@ -31,8 +32,8 @@
     String encode(PortletWindowRequestNavigationalStates states, PortletWindow window, PortletMode portletMode,
             WindowState windowState, boolean navParamsStateFull, boolean renderParamsStateFull) throws UnsupportedEncodingException;
 
-    String encode(PortletWindowRequestNavigationalStates states, PortletWindow window, Map parameters,
-            PortletMode portletMode, WindowState windowState, boolean action, boolean navParamsStateFull, 
+    String encode(PortletWindowRequestNavigationalStates states, PortletWindow window, Map<String, String[]> parameters,
+            PortletMode portletMode, WindowState windowState, PortalURL.URLType urlType, boolean navParamsStateFull, 
             boolean renderParamsStateFull) throws UnsupportedEncodingException;
 
     String encode(PortletWindowRequestNavigationalStates states, boolean navParamsStateFull, boolean renderParamsStateFull) 

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=738286&r1=738285&r2=738286&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 Tue Jan 27 22:40:57 2009
@@ -29,6 +29,7 @@
  */
 public class PortletWindowBaseNavigationalState implements Serializable
 {
+    private static final long serialVersionUID = 4188214497281562619L;
     private String modeName;
     private String stateName;
     

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=738286&r1=738285&r2=738286&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 Tue Jan 27 22:40:57 2009
@@ -31,8 +31,12 @@
  */
 public class PortletWindowExtendedNavigationalState extends PortletWindowBaseNavigationalState
 {
+    private static final long serialVersionUID = -504769105830572875L;
+
     private static final class ModeStateKey implements Serializable
     {
+        private static final long serialVersionUID = 1419744882315564633L;
+        
         private final String mode;
         private final String state;
         private final int hashCode;
@@ -62,7 +66,7 @@
     
     private Map<String, String[]> parametersMap;
     
-    private Map decoratorActionEncodings;
+    private Map<ModeStateKey, String> decoratorActionEncodings;
         
     public Map<String, String[]> getParametersMap()
     {
@@ -95,7 +99,7 @@
     {
         if (decoratorActionEncodings == null)
         {
-            decoratorActionEncodings = new HashMap(4);
+            decoratorActionEncodings = new HashMap<ModeStateKey, String>(4);
         }
         decoratorActionEncodings.put(new ModeStateKey(mode,state), encoding);
     }
@@ -104,7 +108,7 @@
     {
         if (decoratorActionEncodings != null)
         {
-            return (String)decoratorActionEncodings.get(new ModeStateKey(mode,state));
+            return decoratorActionEncodings.get(new ModeStateKey(mode,state));
         }
         return 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=738286&r1=738285&r2=738286&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 Tue Jan 27 22:40:57 2009
@@ -24,6 +24,8 @@
  */
 public class PortletWindowRequestNavigationalState extends PortletWindowExtendedNavigationalState
 {
+    private static final long serialVersionUID = 3807035638733358425L;
+
     private String  windowId;
     
     /**

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=738286&r1=738285&r2=738286&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 Tue Jan 27 22:40:57 2009
@@ -21,11 +21,13 @@
 import java.util.Map;
 
 import org.apache.jetspeed.container.PortletWindow;
+import org.apache.jetspeed.container.url.PortalURL;
 
 public class PortletWindowRequestNavigationalStates
 {
     private String characterEncoding;
-    private Map pwnStates = new HashMap();
+    private Map<String, PortletWindowRequestNavigationalState> pwnStates = new HashMap<String, PortletWindowRequestNavigationalState>();
+    private PortalURL.URLType urlType;
     private PortletWindow maximizedWindow;
     private PortletWindow actionWindow;
     private PortletWindow resourceWindow;
@@ -40,7 +42,7 @@
         return characterEncoding;
     }
     
-    public Iterator getWindowIdIterator()
+    public Iterator<String> getWindowIdIterator()
     {
         return pwnStates.keySet().iterator();
     }
@@ -65,6 +67,16 @@
         }
     }
     
+    public PortalURL.URLType getURLType()
+    {
+        return urlType;
+    }
+    
+    public void setURLType(PortalURL.URLType urlType)
+    {
+        this.urlType = urlType;
+    }
+    
     public PortletWindowRequestNavigationalState getPortletWindowNavigationalState(String windowId)
     {
         return (PortletWindowRequestNavigationalState)pwnStates.get(windowId);

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowSessionNavigationalStates.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowSessionNavigationalStates.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowSessionNavigationalStates.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/PortletWindowSessionNavigationalStates.java Tue Jan 27 22:40:57 2009
@@ -34,14 +34,18 @@
 
 public class PortletWindowSessionNavigationalStates implements Serializable
 {
+    private static final long serialVersionUID = -2891442112700830546L;
+
     private static final class PageState implements Serializable
     {
-        public Map windowStates = new HashMap();
+        private static final long serialVersionUID = -2730733728229116932L;
+        
+        public Map<String, PortletWindowBaseNavigationalState> windowStates = new HashMap<String, PortletWindowBaseNavigationalState>();
         public String maximizedWindowId;
     }
     
     private final boolean storeParameters;
-    private Map pageStates = new HashMap();
+    private Map<String, PageState> pageStates = new HashMap<String, PageState>();
 
     public PortletWindowSessionNavigationalStates(boolean storeParameters)
     {
@@ -77,7 +81,7 @@
             pageState.maximizedWindowId = null;
         }
 
-        Iterator iter = requestStates.getWindowIdIterator();
+        Iterator<String> iter = requestStates.getWindowIdIterator();
         iter = pageState.windowStates.keySet().iterator();
         String windowId;
         while ( iter.hasNext() )
@@ -193,7 +197,7 @@
             pageState.maximizedWindowId = requestStates.getMaximizedWindow().getId().toString();
         }
         
-        Iterator iter = requestStates.getWindowIdIterator();
+        Iterator<String> iter = requestStates.getWindowIdIterator();
         String actionWindowId = requestStates.getActionWindow() != null ? requestStates.getActionWindow().getId().toString() : null;
         boolean actionRequestState = false;
         // now synchronize requestStates and sessionStates
@@ -357,7 +361,7 @@
                     {
                         changed = true;
                     }
-                    extendedSessionState.setParametersMap(new HashMap(requestState.getParametersMap()));
+                    extendedSessionState.setParametersMap(new HashMap<String, String[]>(requestState.getParametersMap()));
                 }
             }
             else if ( requestState.isClearParameters() )
@@ -368,28 +372,28 @@
             }            
             else if ( extendedSessionState.getParametersMap() != null )
             {
-                requestState.setParametersMap(new HashMap(extendedSessionState.getParametersMap()));
+                requestState.setParametersMap(new HashMap<String, String[]>(extendedSessionState.getParametersMap()));
             }
         }
         return changed;
     }    
 
-    protected boolean changedParameters(Map requestMap, Map sessionMap)
+    protected boolean changedParameters(Map<String, String[]> requestMap, Map<String, String[]> sessionMap)
     {
         if (sessionMap == null || requestMap == null)
             return true;
         if (requestMap.size() != sessionMap.size())
             return true;
-        Iterator ri = requestMap.entrySet().iterator();
-        Iterator si = sessionMap.entrySet().iterator();
+        Iterator<Map.Entry<String, String[]>> ri = requestMap.entrySet().iterator();
+        Iterator<Map.Entry<String, String[]>> si = sessionMap.entrySet().iterator();
         while (ri.hasNext() && si.hasNext())
         {
-            Map.Entry r = (Map.Entry)ri.next();
-            Map.Entry s = (Map.Entry)si.next();
+            Map.Entry<String, String[]> r = ri.next();
+            Map.Entry<String, String[]> s = si.next();
             if (!r.getKey().equals(s.getKey()))
                 return true;
-            String[] rvals = (String[])r.getValue();
-            String[] svals = (String[])s.getValue();            
+            String[] rvals = r.getValue();
+            String[] svals = s.getValue();            
             for (int ix = 0; ix < rvals.length; ix++)
             {
                 if (!rvals[ix].equals(svals[ix]))
@@ -411,7 +415,7 @@
         cache.invalidate(context);
     }
     
-    protected Map getWindowStates(Page page)
+    protected Map<String, PortletWindowBaseNavigationalState> getWindowStates(Page page)
     {
         PageState pageState = (PageState)pageStates.get(page.getId());
         return pageState != null ? pageState.windowStates : null;

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/SessionNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/SessionNavigationalState.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/SessionNavigationalState.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/SessionNavigationalState.java Tue Jan 27 22:40:57 2009
@@ -44,7 +44,7 @@
 public class SessionNavigationalState extends AbstractNavigationalState
 {   
     protected final Log log = LogFactory.getLog(getClass());    
-    private Map currentPageWindowStates;
+    private Map<String, PortletWindowBaseNavigationalState> currentPageWindowStates;
     private boolean clearPortletsModeAndWindowStateEnabled = false;
     
     public SessionNavigationalState(NavigationalStateCodec codec, JetspeedContentCache cache)
@@ -130,7 +130,7 @@
         }
     }
     
-    public Map getCurrentPageWindowStates()
+    public Map<String, PortletWindowBaseNavigationalState> getCurrentPageWindowStates()
     {
         return currentPageWindowStates;
     }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/AbstractPortalURL.java Tue Jan 27 22:40:57 2009
@@ -102,11 +102,16 @@
         return navStateParameter;
     }
     
-    public String createNavigationalEncoding(PortletWindow window, Map parameters, PortletMode mode, WindowState state, boolean action)
+    public String createNavigationalEncoding(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, boolean action)
+    {
+        return createNavigationalEncoding(window, parameters, mode, state, action ? URLType.ACTION : URLType.RENDER);
+    }
+    
+    public String createNavigationalEncoding(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, URLType urlType)
     {
         try
         {
-            return getNavigationalStateParameterName() + ":" + getNavigationalState().encode(window, parameters, mode, state, action);
+            return getNavigationalStateParameterName() + ":" + getNavigationalState().encode(window, parameters, mode, state, urlType);
         }
         catch (UnsupportedEncodingException e)
         {
@@ -252,11 +257,16 @@
         return navState;
     }
 
-    public String createPortletURL(PortletWindow window, Map parameters, PortletMode mode, WindowState state, boolean action, boolean secure)
+    public String createPortletURL(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, boolean action, boolean secure)
+    {
+        return createPortletURL(window, parameters, mode, state, action ? URLType.ACTION : URLType.RENDER, secure);
+    }
+    
+    public String createPortletURL(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, URLType urlType, boolean secure)
     {
         try
         {
-            return createPortletURL(navState.encode(window,parameters,mode,state,action), secure);
+            return createPortletURL(navState.encode(window,parameters,mode,state,urlType), secure);
         }
         catch (UnsupportedEncodingException e)
         {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/url/impl/DesktopEncodingPortalURL.java Tue Jan 27 22:40:57 2009
@@ -25,14 +25,11 @@
 import javax.servlet.http.HttpServletRequest;
 
 import org.apache.jetspeed.PortalContext;
-import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.container.state.NavigationalState;
 import org.apache.jetspeed.container.url.BasePortalURL;
 import org.apache.jetspeed.desktop.JetspeedDesktop;
-import org.apache.jetspeed.om.portlet.PortletApplication;
 import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.container.PortletEntity;
-import org.apache.pluto.om.portlet.PortletDefinition;
 
 /**
  * DesktopEncodingPortalURL encodes action URLs to target desktop specific /action pipeline,
@@ -94,7 +91,7 @@
             desktopRenderPipelinePath = desktopRenderPipelinePath.substring( 0, desktopRenderPipelinePath.length() -1 );
         
         this.desktopRenderPipelinePath = desktopRenderPipelinePath;
-        this.desktopActionPipelinePath = desktopActionPipelinePath;        
+        this.desktopActionPipelinePath = desktopActionPipelinePath;
     }
 
     protected void decodeBasePath(HttpServletRequest request)
@@ -152,26 +149,27 @@
 
     protected String createPortletURL(String encodedNavState, boolean secure)
     {
-        return createPortletURL(encodedNavState, secure, null, false);
+        return createPortletURL(encodedNavState, secure, null, URLType.RENDER, false);
     }
     
-    protected String createPortletURL(String encodedNavState, boolean secure, PortletWindow window, boolean action)
-    {   
-        return createPortletURL(encodedNavState, secure, window, action, false, false);
-    }
-    
-    protected String createPortletURL(String encodedNavState, boolean secure, PortletWindow window, boolean action, boolean resource, boolean desktopRequestNotAjax)
+    protected String createPortletURL(String encodedNavState, boolean secure, PortletWindow window, URLType urlType, boolean desktopRequestNotAjax)
     {   
         StringBuffer buffer = new StringBuffer("");
         buffer.append(getBaseURL(secure));
-        if (action)
+        boolean desktopEncoder = false;
+        
+        if (URLType.ACTION.equals(urlType))
         {
             buffer.append(this.baseActionPath);
         }
         else
         {
-            buffer.append(this.baseRenderPath);        
-        }            
+            buffer.append(this.baseRenderPath);
+            if (URLType.RESOURCE.equals(urlType))
+            {
+                desktopEncoder = true;
+            }            
+        }
         if ( encodedNavState != null )
         {
             buffer.append("/");
@@ -184,17 +182,13 @@
             buffer.append(getPath());
         }
         
-        if ( !resource )
+        if ( !desktopEncoder )
         {
         	if ( ! desktopRequestNotAjax )
             {
         		PortletEntity pe = window.getPortletEntity();
         		buffer.append( "?entity=" ).append( pe.getId() );
-            
-        		PortletDefinition portlet = pe.getPortletDefinition();
-        		PortletApplication app = (PortletApplication)portlet.getApplication();
-        		String uniqueName = app.getName() + "::" + portlet.getPortletName();
-        		buffer.append( "&portlet=" ).append( uniqueName );
+        		buffer.append( "&portlet=" ).append( pe.getPortletDefinition().getUniqueName() );
             }
         }
         else
@@ -205,18 +199,22 @@
         return buffer.toString();
     }        
     
-    public String createPortletURL(PortletWindow window, Map parameters, PortletMode mode, WindowState state, boolean action, boolean secure)
+    public String createPortletURL(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, boolean action, boolean secure)
+    {
+        return createPortletURL(window, parameters, mode, state, action ? URLType.ACTION : URLType.RENDER ,secure);
+    }
+    
+    public String createPortletURL(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, URLType urlType, boolean secure)
     {
         try
         {
-            boolean resource = !action && parameters.containsKey(PortalReservedParameters.PORTLET_RESOURCE_URL_REQUEST_PARAMETER);
             boolean desktopRequestNotAjax = false;
             if ( parameters.containsKey(JetspeedDesktop.DESKTOP_REQUEST_NOT_AJAX_PARAMETER) )
             {
             	desktopRequestNotAjax = true;
             	parameters.remove(JetspeedDesktop.DESKTOP_REQUEST_NOT_AJAX_PARAMETER);
             }
-            return createPortletURL(this.getNavigationalState().encode(window,parameters,mode,state,action), secure, window, action, resource, desktopRequestNotAjax);
+            return createPortletURL(this.getNavigationalState().encode(window,parameters,mode,state,urlType), secure, window, urlType, desktopRequestNotAjax);
         }
         catch (UnsupportedEncodingException e)
         {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/resource/BufferedHttpServletResponse.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/resource/BufferedHttpServletResponse.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/resource/BufferedHttpServletResponse.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/resource/BufferedHttpServletResponse.java Tue Jan 27 22:40:57 2009
@@ -22,9 +22,8 @@
 import java.io.PrintWriter;
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.Locale;
-import java.util.Map.Entry;
+import java.util.Map;
 
 import javax.servlet.ServletOutputStream;
 import javax.servlet.http.Cookie;
@@ -70,8 +69,8 @@
     private CharArrayWriterBuffer charOutputBuffer;
     private ServletOutputStream outputStream;
     private PrintWriter printWriter;
-    private HashMap headers;
-    private ArrayList cookies;
+    private HashMap<String, ArrayList<String>> headers;
+    private ArrayList<Cookie> cookies;
     private int errorCode;
     private int statusCode;
     private String errorMessage;
@@ -82,6 +81,7 @@
     private Locale locale;
     private boolean closed;
     private String characterEncoding;
+    private boolean setContentTypeAfterEncoding;
     private int contentLength = -1;
     private String contentType;
     private boolean flushed;
@@ -99,61 +99,51 @@
         }
         flushed = true;
         
+        if (cookies != null)
+        {
+            for (Cookie cookie : cookies)
+            {
+                response.addCookie(cookie);
+            }
+            cookies = null;
+        }
         if (locale != null)
         {
             response.setLocale(locale);
         }        
+        
         if (contentType != null)
         {
-            response.setContentType(contentType);
-        }
-        if (characterEncoding != null)
-        {
-            // setCharacterEncoding only available on Servlet Spec 2.4+
-            try
-            {
-                response.getClass().getMethod("setCharacterEncoding", new Class[]{String.class}).invoke(response, new Object[]{characterEncoding});
-            }
-            catch (NoSuchMethodException nsme)
+            if (characterEncoding != null)
             {
-                // servlet spec 2.3
+                if (setContentTypeAfterEncoding)
+                {
+                    response.setCharacterEncoding(characterEncoding);
+                    response.setContentType(contentType);
+                }
+                else
+                {
+                    response.setContentType(contentType);
+                    response.setCharacterEncoding(characterEncoding);
+                }
             }
-            catch (Exception e)
+            else
             {
-                throw new RuntimeException(e);
+                response.setContentType(contentType);
             }
         }
-        if (cookies != null)
+        else if (characterEncoding != null)
         {
-            for (int i=0,size=cookies.size(); i<size; i++)
-            {
-                response.addCookie((Cookie)cookies.get(i));
-            }
-            cookies = null;
+            response.setCharacterEncoding(characterEncoding);
         }
+        
         if (headers != null)
         {
-            Iterator iter = headers.entrySet().iterator();
-            while (iter.hasNext())
+            for (Map.Entry<String, ArrayList<String>> entry : headers.entrySet())
             {
-                Entry e = (Entry)iter.next();
-                String name = (String)e.getKey();
-                ArrayList values = (ArrayList)e.getValue();
-                for (int i=0, size=values.size(); i < size; i++ )
+                for (String value : entry.getValue())
                 {
-                    Object value = values.get(i);
-                    if (value instanceof Integer)
-                    {
-                        response.addIntHeader(name, ((Integer)value).intValue());
-                    }
-                    else if (value instanceof Long)
-                    {
-                        response.addDateHeader(name, ((Long)value).longValue());
-                    }
-                    else
-                    {
-                        response.addHeader(name, (String)value);
-                    }
+                    response.addHeader(entry.getKey(), value);
                 }
             }
             headers = null;
@@ -215,16 +205,16 @@
         }
     }
     
-    private ArrayList getHeaderList(String name, boolean create)
+    private ArrayList<String> getHeaderList(String name, boolean create)
     {
         if ( headers == null )
         {
-            headers = new HashMap();
+            headers = new HashMap<String, ArrayList<String>>();
         }
-        ArrayList headerList = (ArrayList)headers.get(name);
+        ArrayList<String> headerList = headers.get(name);
         if ( headerList == null && create )
         {
-            headerList = new ArrayList();
+            headerList = new ArrayList<String>();
             headers.put(name,headerList);
         }
         return headerList;
@@ -247,7 +237,7 @@
         {
             if ( cookies == null )
             {
-                cookies = new ArrayList();
+                cookies = new ArrayList<Cookie>();
             }
             cookies.add(cookie);
         }
@@ -260,8 +250,7 @@
     {
         if (!committed)
         {
-            ArrayList headerList = getHeaderList(name, true);
-            headerList.add(new Long(date));
+            addHeader(name, Long.toString(date));
         }
     }
 
@@ -272,8 +261,7 @@
     {
         if (!committed)
         {
-            ArrayList headerList = getHeaderList(name, true);
-            headerList.add(value);
+            getHeaderList(name, true).add(value);
         }
     }
 
@@ -284,8 +272,7 @@
     {
         if (!committed)
         {
-            ArrayList headerList = getHeaderList(name, true);
-            headerList.add(new Integer(value));
+            addHeader(name, Integer.toString(value));
         }
     }
 
@@ -336,9 +323,7 @@
     {
         if (!committed)
         {
-            ArrayList headerList = getHeaderList(name, true);
-            headerList.clear();
-            headerList.add(new Long(date));
+            setHeader(name, Long.toString(date));
         }
     }
 
@@ -349,7 +334,7 @@
     {
         if (!committed)
         {
-            ArrayList headerList = getHeaderList(name, true);
+            ArrayList<String> headerList = getHeaderList(name, true);
             headerList.clear();
             headerList.add(value);
         }
@@ -362,9 +347,7 @@
     {
         if (!committed)
         {
-            ArrayList headerList = getHeaderList(name, true);
-            headerList.clear();
-            headerList.add(new Integer(value));
+            setHeader(name, Integer.toString(value));
         }
     }
 
@@ -537,6 +520,7 @@
         if (charset != null && !committed && printWriter == null)
         {
             characterEncoding = charset;
+            setContentTypeAfterEncoding = false;
         }
     }
 
@@ -568,6 +552,7 @@
         if (!committed)
         {
             contentType = type;
+            setContentTypeAfterEncoding = false;
             if (printWriter == null)
             {
                 // TODO: parse possible encoding for better return value from getCharacterEncoding()
@@ -583,9 +568,6 @@
         if (!committed)
         {
             this.locale = locale;
-            /* NON-FIXABLE ISSUE: defaulting the characterEncoding from the Locale
-               This feature cannot be implemented/wrapped as it might depend on web.xml locale settings
-             */
         }
     }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/resource/ResourceValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/resource/ResourceValveImpl.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/resource/ResourceValveImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/resource/ResourceValveImpl.java Tue Jan 27 22:40:57 2009
@@ -96,9 +96,15 @@
                 request.setAttribute(PortalReservedParameters.REQUEST_CONTEXT_OBJECTS, request.getObjects());                        
                 request.setAttribute(PortalReservedParameters.PATH_ATTRIBUTE, request.getAttribute(PortalReservedParameters.PATH_ATTRIBUTE));
                 request.setAttribute(PortalReservedParameters.PORTLET_WINDOW_ATTRIBUTE, resourceWindow);
-                BufferedHttpServletResponse bufferedResponse = new BufferedHttpServletResponse(response);
-                container.doRender(resourceWindow, requestForWindow, bufferedResponse);
-                bufferedResponse.flush(response);
+                request.setAttribute(PortalReservedParameters.PORTLET_CONTAINER_INVOKER_USE_FORWARD, Boolean.TRUE);
+                if (resourceWindow.getPortletEntity().getPortletDefinition().getApplication().getVersion().equals("1.0"))
+                {
+                    container.doRender(resourceWindow, requestForWindow, response);
+                }
+                else
+                {
+                    container.doServeResource(resourceWindow, requestForWindow, response);
+                }
             }
             catch (PortletContainerException e)
             {

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/PortalReservedParameters.java Tue Jan 27 22:40:57 2009
@@ -70,6 +70,7 @@
     public static final String PAGE_LAYOUT_HELP = "org.apache.jetspeed.layout.help";
     public static final String PAGE_LAYOUT_EDIT = "org.apache.jetspeed.layout.edit";
     public static final String PAGE_LAYOUT_SOLO = "org.apache.jetspeed.layout.solo";
+    public static final String PORTLET_CONTAINER_INVOKER_USE_FORWARD = "org.apache.jetspeed.portlet.container.invoker.useForward";
 
     /**
      * Setting this as a session attribute will override all themes declared in
@@ -139,14 +140,4 @@
      *  </p>
      */
      public static final String PORTLET_EXTENDED_DESCRIPTOR_MERGE_PORTAL_PARAMETERS_BEFORE_PORTLET_PARAMETERS = "merge.portal.parameters.before.portlet.parameters";
-     
-     /**
-      * Preliminary Portlet API 2.0 ResourceURL support.
-      * By setting the RenderURL parameter PORTLET_RESOURCE_URL_REQUEST_PARAMETER (with whatever value) the Jetspeed encoded PortletURL
-      * will be marked as a ResourceURL (the parameter itself will not be stored).
-      * By invoking such a Render/ResourceURL, NavigationalState.getPortletWindowOfResource() will be set, and with an custom Valve 
-      * (example implementation o.a.j.resource.ResourceValveImpl) this PortletWindow can be invoked directly,
-      * similar as an ActionURL but as a direct Portlet Render request.
-      */
-     public static final String PORTLET_RESOURCE_URL_REQUEST_PARAMETER = "org.apache.jetspeed.portlet.resource.url";
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/state/NavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/state/NavigationalState.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/state/NavigationalState.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/state/NavigationalState.java Tue Jan 27 22:40:57 2009
@@ -25,6 +25,7 @@
 
 import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.container.PortletWindow;
+import org.apache.jetspeed.container.url.PortalURL;
 
 /**
  * NavigationalState gives readonly access to the state of the Portal URL and all navigational state context
@@ -134,12 +135,14 @@
      */
     PortletWindow getMaximizedWindow();
         
-    Iterator getParameterNames(PortletWindow window);
+    Iterator<String> getParameterNames(PortletWindow window);
     
     String[] getParameterValues(PortletWindow window, String parameterName);
 
     Map<String, String[]> getParameterMap(PortletWindow window);
     
+    PortalURL.URLType getURLType();
+    
     PortletWindow getPortletWindowOfAction();
     
     PortletWindow getPortletWindowOfResource();
@@ -151,7 +154,7 @@
      * the PortletWindowOfAction.
      * @return iterator of portletWindow ids (String)
      */
-    Iterator getWindowIdIterator();
+    Iterator<String> getWindowIdIterator();
     
     /**
      * Encodes the Navigational State with overrides for a specific PortletWindow into a string to be embedded within a 
@@ -163,8 +166,22 @@
      * @param state the new WindowState for the PortalWindow
      * @param action indicates if to be used in an actionURL or renderURL
      * @return encoded new Navigational State
+     * @deprecated
+     */
+    String encode(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, boolean action) throws UnsupportedEncodingException;
+
+    /**
+     * Encodes the Navigational State with overrides for a specific PortletWindow into a string to be embedded within a 
+     * PortalURL.
+     * 
+     * @param window the PortalWindow
+     * @param parameters the new request or action parameters for the PortalWindow
+     * @param mode the new PortletMode for the PortalWindow
+     * @param state the new WindowState for the PortalWindow
+     * @param urlType indicates if to be used in an actionURL, ResourceURL or renderURL
+     * @return encoded new Navigational State
      */
-    String encode(PortletWindow window, Map parameters, PortletMode mode, WindowState state, boolean action) throws UnsupportedEncodingException;
+    String encode(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, PortalURL.URLType urlType) throws UnsupportedEncodingException;
 
     /**
      * Encodes the Navigational State with overrides for a specific PortletWindow while retaining its (request) 

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/url/PortalURL.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/url/PortalURL.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/url/PortalURL.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/url/PortalURL.java Tue Jan 27 22:40:57 2009
@@ -39,6 +39,8 @@
  */
 public interface PortalURL
 {
+    enum URLType { ACTION, RESOURCE, RENDER }
+
     /** HTTP protocol. */
     public static final String HTTP = "http";
 
@@ -115,8 +117,24 @@
      * @param action indicates if an actionURL or renderURL is created
      * @param secure indicates if a secure url is required 
      * @return a new actionURL or renderURL as String
+     * @deprecated
+     */
+    String createPortletURL(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, boolean action, boolean secure);
+    
+    /**
+     * Create a new PortletURL for a PortletWindow including request or action parameters.
+     * <br>
+     * The Portal Navigational State is encoded within the URL
+     * 
+     * @param window the PortalWindow
+     * @param parameters the new request or action parameters for the PortalWindow
+     * @param mode the new PortletMode for the PortalWindow
+     * @param state the new WindowState for the PortalWindow
+     * @param urlType indicates if an actionURL, Resource or renderURL is to created
+     * @param secure indicates if a secure url is required 
+     * @return a new actionURL or renderURL as String
      */
-    String createPortletURL(PortletWindow window, Map parameters, PortletMode mode, WindowState state, boolean action, boolean secure);
+    String createPortletURL(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, URLType urlType, boolean secure);
 
     /**
      * Create a new PortletURL for a PortletWindow retaining its (request) parameters.
@@ -152,8 +170,23 @@
      * @param action indicates if an actionURL or renderURL is created
      * @param secure indicates if a secure url is required 
      * @return a new navigational state as String
+     * @deprecated
+     */
+    String createNavigationalEncoding(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, boolean action);
+    
+    /**
+     * Creates the navigational encoding for a given window
+     * Similiar to createPortletURL above
+     * 
+     * @param window the PortalWindow
+     * @param parameters the new request or action parameters for the PortalWindow
+     * @param mode the new PortletMode for the PortalWindow
+     * @param state the new WindowState for the PortalWindow
+     * @param urlType indicates if an actionURL, Resource or renderURL is to created
+     * @param secure indicates if a secure url is required 
+     * @return a new navigational state as String
      */
-    String createNavigationalEncoding(PortletWindow window, Map parameters, PortletMode mode, WindowState state, boolean action);
+    String createNavigationalEncoding(PortletWindow window, Map<String, String[]> parameters, PortletMode mode, WindowState state, URLType urlType);
     
     /**
      * Creates the navigational encoding for a given window

Modified: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java Tue Jan 27 22:40:57 2009
@@ -29,6 +29,9 @@
 import javax.portlet.PortletRequest;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
+import javax.portlet.ResourceRequest;
+import javax.portlet.ResourceResponse;
+import javax.portlet.ResourceServingPortlet;
 import javax.portlet.UnavailableException;
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletConfig;
@@ -262,7 +265,6 @@
                 ActionRequest actionRequest = (ActionRequest) request.getAttribute(ContainerConstants.PORTLET_REQUEST);
                 ActionResponse actionResponse = (ActionResponse) request.getAttribute(ContainerConstants.PORTLET_RESPONSE);
                 ((InternalPortletRequest)actionRequest).init(portlet.getConfig().getPortletContext(), jetspeedServletWrapper);
-                ((InternalPortletRequest)actionRequest).setIncluded(true);
                 portlet.processAction(actionRequest, actionResponse);
             }
             else if (method == ContainerConstants.METHOD_RENDER)
@@ -284,6 +286,25 @@
                 ((InternalPortletRequest)renderRequest).init(portlet.getConfig().getPortletContext(), jetspeedServletWrapper);
                 portlet.render(renderRequest, renderResponse);
             }
+            else if (method == ContainerConstants.METHOD_RESOURCE && portlet.getRealPortlet() instanceof ResourceServingPortlet)
+            {
+                ResourceRequest resourceRequest = null;
+                ResourceResponse resourceResponse = null;
+
+                if (isParallelMode)
+                {
+                    resourceRequest = (ResourceRequest) CurrentWorkerContext.getAttribute(ContainerConstants.PORTLET_REQUEST);
+                    resourceResponse = (ResourceResponse) CurrentWorkerContext.getAttribute(ContainerConstants.PORTLET_RESPONSE);
+                }
+                else
+                {
+                    resourceRequest = (ResourceRequest) request.getAttribute(ContainerConstants.PORTLET_REQUEST);
+                    resourceResponse = (ResourceResponse) request.getAttribute(ContainerConstants.PORTLET_RESPONSE);
+
+                }
+                ((InternalPortletRequest)resourceRequest).init(portlet.getConfig().getPortletContext(), jetspeedServletWrapper);
+                ((ResourceServingPortlet)portlet.getRealPortlet()).serveResource(resourceRequest, resourceResponse);
+            }
 
             // if we get this far we are home free
             return;

Modified: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletObjectProxy.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletObjectProxy.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletObjectProxy.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletObjectProxy.java Tue Jan 27 22:40:57 2009
@@ -20,14 +20,17 @@
 import java.lang.reflect.Method;
 import java.lang.reflect.Proxy;
 import java.lang.reflect.Modifier;
+import java.util.HashSet;
 import java.util.List;
 
 import java.io.IOException;
 
+import javax.portlet.EventPortlet;
 import javax.portlet.Portlet;
 import javax.portlet.GenericPortlet;
 import javax.portlet.PortletException;
 import javax.portlet.PortletMode;
+import javax.portlet.ResourceServingPortlet;
 import javax.portlet.WindowState;
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
@@ -103,21 +106,34 @@
     
     public static Object createProxy(Object proxiedObject, boolean autoSwitchEditDefaultsModeToEditMode, boolean autoSwitchConfigMode, String customConfigModePortletUniqueName)
     {
-        Class proxiedClass = proxiedObject.getClass();
-        ClassLoader classLoader = proxiedClass.getClassLoader();
-        Class [] proxyInterfaces = null;
-        
-        if (proxiedObject instanceof SupportsHeaderPhase)
+        HashSet<Class> interfaces = new HashSet<Class>();
+        interfaces.add(Portlet.class);
+        Class current = proxiedObject.getClass();
+        while (current != null)
         {
-            proxyInterfaces = new Class [] { Portlet.class, SupportsHeaderPhase.class };
-        }
-        else
-        {
-            proxyInterfaces = new Class [] { Portlet.class };
+            try
+            {
+                Class[] currentInterfaces = current.getInterfaces();
+                for (int i = 0; i < currentInterfaces.length; i++)
+                {
+                    if (currentInterfaces[i] != Portlet.class)
+                    {
+                        interfaces.add(currentInterfaces[i]);
+                    }
+                }
+                current = current.getSuperclass();
+            }
+            catch (Exception e)
+            {
+                current = null;
+            }
         }
         
+        Class proxiedClass = proxiedObject.getClass();
+        ClassLoader classLoader = proxiedClass.getClassLoader();
+        
         InvocationHandler handler = new PortletObjectProxy(proxiedObject, autoSwitchEditDefaultsModeToEditMode, autoSwitchConfigMode, customConfigModePortletUniqueName);
-        return Proxy.newProxyInstance(classLoader, proxyInterfaces, handler);
+        return Proxy.newProxyInstance(classLoader, interfaces.toArray(new Class[interfaces.size()]), handler);
     }
 
     private PortletObjectProxy(Object portletObject, boolean autoSwitchEditDefaultsModeToEditMode, boolean autoSwitchConfigMode, String customConfigModePortletUniqueName)
@@ -150,7 +166,7 @@
         boolean handledHere = false;
         Class declaringClass = method.getDeclaringClass();
         
-        if (declaringClass == Portlet.class)
+        if (declaringClass == Portlet.class || declaringClass == ResourceServingPortlet.class || declaringClass == EventPortlet.class)
         {
             if (renderMethod.equals(method))
             {

Modified: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletResourceURLFactoryImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletResourceURLFactoryImpl.java?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletResourceURLFactoryImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/PortletResourceURLFactoryImpl.java Tue Jan 27 22:40:57 2009
@@ -20,11 +20,10 @@
 
 import javax.portlet.PortletConfig;
 import javax.portlet.PortletException;
-import javax.portlet.PortletURL;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
+import javax.portlet.ResourceURL;
 
-import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.portals.bridges.common.PortletResourceURLFactory;
 
 /**
@@ -44,13 +43,12 @@
      */
     public String createResourceURL(PortletConfig config, RenderRequest request, RenderResponse response, Map parameters)
             throws PortletException
-    {
-        PortletURL url = response.createRenderURL();
+    {        
+        ResourceURL url = response.createResourceURL();
         if (parameters != null)
         {
             url.setParameters(parameters);
         }
-        url.setParameter(PortalReservedParameters.PORTLET_RESOURCE_URL_REQUEST_PARAMETER, "");
         return url.toString();
     }
 }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pluto-services.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pluto-services.xml?rev=738286&r1=738285&r2=738286&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pluto-services.xml (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-portal-resources/src/main/resources/assembly/pluto-services.xml Tue Jan 27 22:40:57 2009
@@ -71,15 +71,15 @@
 <!--   <constructor-arg><ref bean="org.apache.pluto.services.PortletURLProviderImpl"/></constructor-arg> (currently doing a 'new')
        <constructor-arg><ref bean="org.apache.pluto.services.ResourceURLProviderImpl"/></constructor-arg> (currently doing a 'new')
 -->
-		<constructor-arg><ref bean="org.apache.pluto.services.RequestPropertyProvider"/></constructor-arg>
+		<constructor-arg><ref bean="org.apache.pluto.services.PropertyManager"/></constructor-arg>
 		<constructor-arg><ref bean="org.apache.pluto.services.EventProvider"/></constructor-arg>
 		<constructor-arg><ref bean="org.apache.pluto.services.FilterManager"/></constructor-arg>
 		<constructor-arg><ref bean="org.apache.pluto.services.PortletURLListener"/></constructor-arg>
     </bean>
 
 
-	<bean id='org.apache.pluto.services.RequestPropertyProvider'
-		  class="org.apache.jetspeed.container.providers.RequestPropertyProviderImpl">
+	<bean id='org.apache.pluto.services.PropertyManager'
+		  class="org.apache.pluto.core.DefaultPropertyManager">
       <meta key="j2:cat" value="default" />		  
 	</bean>
 	



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