portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r757118 [2/2] - in /portals/jetspeed-2/portal/trunk: components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/ components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/state/impl/ components/jetspeed-po...
Date Sun, 22 Mar 2009 02:50:29 GMT
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=757118&r1=757117&r2=757118&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
Sun Mar 22 02:50:28 2009
@@ -24,6 +24,7 @@
 
 import javax.portlet.PortletMode;
 import javax.portlet.WindowState;
+import javax.xml.namespace.QName;
 
 import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.cache.ContentCacheKey;
@@ -44,14 +45,18 @@
         public Map<String, PortletWindowBaseNavigationalState> windowStates = Collections.synchronizedMap(new
HashMap<String, PortletWindowBaseNavigationalState>());
         public String maximizedWindowId;
     }
-    
+
+    private final SessionNavigationalState navState;
     private final boolean storeParameters;
     private Map<String, PageState> pageStates = new HashMap<String, PageState>();
+    private Map<QName, String[]> publicRenderParametersMap = Collections.synchronizedMap(new
HashMap<QName, String[]>());
 
-    public PortletWindowSessionNavigationalStates(boolean storeParameters)
+    public PortletWindowSessionNavigationalStates(SessionNavigationalState navState, boolean
storeParameters)
     {
+        this.navState = navState;
         this.storeParameters = storeParameters;
     }
+    
     /*
      * JS2-806 patch
      * <p>
@@ -63,11 +68,15 @@
         final PortletMode viewMode = PortletMode.VIEW;
         final WindowState normalWindowState = WindowState.NORMAL;
         
-        PageState pageState = (PageState)pageStates.get(page.getId());
-        if ( pageState == null )
+        PageState pageState = null;
+        synchronized (pageStates)
         {
-            pageState = new PageState();
-            pageStates.put(page.getId(), pageState);
+            pageState = pageStates.get(page.getId());
+            if (pageState == null)
+            {
+                pageState = new PageState();
+                pageStates.put(page.getId(), pageState);
+            }
         }
         
         PortletWindowRequestNavigationalState requestState = null;
@@ -81,58 +90,62 @@
             removeFromCache(context, pageState.maximizedWindowId, decorationCache);     
                  
             pageState.maximizedWindowId = null;
         }
-        synchronized(pageState.windowStates){
-        Iterator<String> iter = requestStates.getWindowIdIterator();
-        iter = pageState.windowStates.keySet().iterator();
-        String windowId;
-        while ( iter.hasNext() )
+        synchronized (pageState.windowStates)
         {
-            windowId = (String)iter.next();
-            requestState = requestStates.getPortletWindowNavigationalState(windowId);
-            if ( requestState == null )
-            {
-                requestState = new PortletWindowRequestNavigationalState(windowId);
-            }
-            //regardless, reset portlet mode and window state
-            requestState.setPortletMode(viewMode);
-            requestState.setWindowState(normalWindowState);
-            // get the session case just in case and create a new one
-            sessionState = (PortletWindowBaseNavigationalState)pageState.windowStates.get(requestState.getWindowId());
-            if ( sessionState == null )
-            {
-                if ( storeParameters )
+            Iterator<String> iter = requestStates.getWindowIdIterator();
+            iter = pageState.windowStates.keySet().iterator();
+            String windowId;
+            while ( iter.hasNext() )
+            {
+                windowId = (String)iter.next();
+                requestState = requestStates.getPortletWindowNavigationalState(windowId);
+                if ( requestState == null )
+                {
+                    requestState = new PortletWindowRequestNavigationalState(windowId, navState.getActionScopedRequestAttributes(windowId));
+                }
+                //regardless, reset portlet mode and window state
+                requestState.setPortletMode(viewMode);
+                requestState.setWindowState(normalWindowState);
+                // get the session case just in case and create a new one
+                sessionState = (PortletWindowBaseNavigationalState)pageState.windowStates.get(requestState.getWindowId());
+                if ( sessionState == null )
                 {
-                    sessionState = new PortletWindowExtendedNavigationalState();
-                }
-                else
-                {
-                    sessionState = new PortletWindowBaseNavigationalState();
+                    if ( storeParameters )
+                    {
+                        sessionState = new PortletWindowExtendedNavigationalState(requestState.isActionScopedRequestAttributes());
+                    }
+                    else
+                    {
+                        sessionState = new PortletWindowBaseNavigationalState();
+                    }
+                    pageState.windowStates.put(requestState.getWindowId(),sessionState);
                 }
-                pageState.windowStates.put(requestState.getWindowId(),sessionState);
-            }
-            //Now, sync up. NOTE we should not be in this method if there is an portlet action
request.
-            boolean changed = syncStates(false, requestState,(PortletWindowBaseNavigationalState)pageState.windowStates.get(windowId));
-            if (changed)
-            {
-                removeFromCache(context, requestState.getWindowId(), cache);
-                removeFromCache(context, page.getId(), decorationCache);                
   
-                if (storeParameters)
+                //Now, sync up. NOTE we should not be in this method if there is an portlet
action request.
+                boolean changed = syncStates(false, requestStates, requestState, (PortletWindowBaseNavigationalState)pageState.windowStates.get(windowId));
+                if (changed)
                 {
-                    ((PortletWindowExtendedNavigationalState)sessionState).resetDecoratorActionEncodings();
+                    removeFromCache(context, requestState.getWindowId(), cache);
+                    removeFromCache(context, page.getId(), decorationCache);            
       
+                    if (storeParameters)
+                    {
+                        ((PortletWindowExtendedNavigationalState)sessionState).resetDecoratorActionEncodings();
+                    }
                 }
-            }
-            
-        }      
+            }      
         } 
     }
     
     public void sync(RequestContext context, Page page, PortletWindowRequestNavigationalStates
requestStates, JetspeedContentCache cache, JetspeedContentCache decorationCache)    
     {
-        PageState pageState = (PageState)pageStates.get(page.getId());
-        if ( pageState == null )
+        PageState pageState = null;
+        synchronized (pageStates)
         {
-            pageState = new PageState();
-            pageStates.put(page.getId(), pageState);
+            pageState = (PageState)pageStates.get(page.getId());
+            if (pageState == null)
+            {
+                pageState = new PageState();
+                pageStates.put(page.getId(), pageState);
+            }
         }
         
         PortletWindowRequestNavigationalState requestState = null;
@@ -199,10 +212,10 @@
             pageState.maximizedWindowId = requestStates.getMaximizedWindow().getId().toString();
         }
         
+        // now synchronize requestStates and sessionStates
         Iterator<String> iter = requestStates.getWindowIdIterator();
         String actionWindowId = requestStates.getActionWindow() != null ? requestStates.getActionWindow().getId().toString()
: null;
         boolean actionRequestState = false;
-        // now synchronize requestStates and sessionStates
         while ( iter.hasNext() )
         {
             requestState = requestStates.getPortletWindowNavigationalState((String)iter.next());
@@ -211,7 +224,7 @@
             {
                 if ( storeParameters )
                 {
-                    sessionState = new PortletWindowExtendedNavigationalState();
+                    sessionState = new PortletWindowExtendedNavigationalState(requestState.isActionScopedRequestAttributes());
                 }
                 else
                 {
@@ -221,7 +234,7 @@
             }
 
             actionRequestState = actionWindowId != null && actionWindowId.equals(requestState.getWindowId());
-            boolean changed = syncStates(actionRequestState, requestState, sessionState);
     
+            boolean changed = syncStates(actionRequestState, requestStates, requestState,
sessionState);      
             if (changed)
             {
                 removeFromCache(context, requestState.getWindowId(), cache);
@@ -232,32 +245,146 @@
                 }
             }
         }
-        
+
         // now copy missing requestStates from the pageState
-        synchronized(pageState.windowStates){
-        iter = pageState.windowStates.keySet().iterator();
-        String windowId;
-        while ( iter.hasNext() )
+        synchronized (pageState.windowStates)
+        {
+            iter = pageState.windowStates.keySet().iterator();
+            String windowId;
+            while ( iter.hasNext() )
+            {
+                windowId = (String)iter.next();
+                requestState = requestStates.getPortletWindowNavigationalState(windowId);
+                if ( requestState == null )
+                {
+                    requestState = new PortletWindowRequestNavigationalState(windowId, navState.getActionScopedRequestAttributes(windowId));
+                    boolean changed = syncStates(false, requestStates, requestState, (PortletWindowBaseNavigationalState)pageState.windowStates.get(windowId));
+                    requestStates.addPortletWindowNavigationalState(windowId, requestState);
+                    if (changed)
+                    {
+                        removeFromCache(context, requestState.getWindowId(), cache);
+                        removeFromCache(context, page.getId(), decorationCache);        
           
+                        if (storeParameters)
+                        {
+                            sessionState = pageState.windowStates.get(windowId);
+                            ((PortletWindowExtendedNavigationalState)sessionState).resetDecoratorActionEncodings();
+                        }
+                    }
+                }
+            }
+        }        
+
+        // sync session states public render parameters
+        Map<QName, String[]> changedPublicRenderParametersMap = null;
+        requestStates.setPublicRenderParametersMap(new HashMap<QName, String[]>());
+        iter = requestStates.getWindowIdIterator();
+        while (iter.hasNext())
         {
-            windowId = (String)iter.next();
+            String windowId = iter.next();
             requestState = requestStates.getPortletWindowNavigationalState(windowId);
-            if ( requestState == null )
+            if (requestState.getPublicRenderParametersMap() != null)
             {
-                requestState = new PortletWindowRequestNavigationalState(windowId);
-                boolean changed = syncStates(false, requestState,(PortletWindowBaseNavigationalState)pageState.windowStates.get(windowId));
-                requestStates.addPortletWindowNavigationalState(windowId, requestState);
-                if (changed)
+                // determine changed session states public render parameters
+                for (Map.Entry<String, String[]> parameter : requestState.getPublicRenderParametersMap().entrySet())
                 {
-                    removeFromCache(context, requestState.getWindowId(), cache);
-                    removeFromCache(context, page.getId(), decorationCache);            
       
-                    if (storeParameters)
+                    String parameterName = parameter.getKey();
+                    String[] requestParameterValues = parameter.getValue();
+                    // get qname for request public render parameter name
+                    QName parameterQName = navState.getPublicRenderParameterQName(windowId,
parameterName);
+                    if (parameterQName != null)
                     {
-                        ((PortletWindowExtendedNavigationalState)sessionState).resetDecoratorActionEncodings();
+                        String[] sessionParameterValues = publicRenderParametersMap.get(parameterQName);
+                        if (changedParameterValues(requestParameterValues, sessionParameterValues))
+                        {
+                            // track changed public render parameter qnames and values
+                            if (changedPublicRenderParametersMap == null)
+                            {
+                                changedPublicRenderParametersMap = new HashMap<QName,
String[]>();
+                            }
+                            changedPublicRenderParametersMap.put(parameterQName, requestParameterValues);
+                        }
+                    }
+                }
+            }
+        }
+        
+        // sync session states public render parameter changes
+        if (changedPublicRenderParametersMap != null)
+        {
+            for (Map.Entry<QName, String[]> parameterChange : changedPublicRenderParametersMap.entrySet())
+            {
+                QName changedParameterQName = parameterChange.getKey();
+                String[] changedParameterValues = parameterChange.getValue();
+                if (changedParameterValues != null)
+                {
+                    // sync new or updated public render parameter value
+                    publicRenderParametersMap.put(changedParameterQName, changedParameterValues);
+                }
+                else
+                {
+                    // null public render parameter value implies delete
+                    publicRenderParametersMap.remove(changedParameterQName);            
       
+                }
+            }
+        }
+        
+        // clear cached contexts and encodings if public render parameters have changed
+        if (changedPublicRenderParametersMap != null)
+        {
+            // find pages and windows in session state that have public render parameters
+            synchronized (pageStates)
+            {
+                for (Map.Entry<String, PageState> sessionPageState : pageStates.entrySet())
+                {
+                    String pageId = sessionPageState.getKey();
+                    Map<String, PortletWindowBaseNavigationalState> windowStates =
sessionPageState.getValue().windowStates;
+                    for (Map.Entry<String, PortletWindowBaseNavigationalState> windowState
: windowStates.entrySet())
+                    {
+                        String windowId = windowState.getKey();
+                        sessionState = windowState.getValue();
+                        // test window for changed public render parameter qnames
+                        if (navState.hasPublicRenderParameterQNames(windowId, changedPublicRenderParametersMap.keySet()))
+                        {
+                            // clear cached items associated with window
+                            removeFromCache(context, windowId, cache);
+                            removeFromCache(context, pageId, decorationCache);          
         
+                            if (storeParameters)
+                            {
+                                ((PortletWindowExtendedNavigationalState)sessionState).resetDecoratorActionEncodings();
+                            }                            
+                        }
+                    }
+                }
+            }
+        }
+        
+        // reset and sync request states public render parameters
+        requestStates.setPublicRenderParametersMap(null);
+        iter = requestStates.getWindowIdIterator();
+        while (iter.hasNext())
+        {
+            String windowId = iter.next();
+            requestState = requestStates.getPortletWindowNavigationalState(windowId);
+            requestState.setPublicRenderParametersMap(null);
+            // get all public render parameter names for window
+            Map<String, QName> parameterNames = navState.getPublicRenderParameterNamesMap(windowId);
+            if (parameterNames != null)
+            {
+                // get synced session public render parameter values 
+                for (Map.Entry<String, QName> parameterNamesEntry : parameterNames.entrySet())
+                {
+                    QName parameterQName = parameterNamesEntry.getValue();
+                    String[] parameterValues = publicRenderParametersMap.get(parameterQName);
+                    if (parameterValues != null)
+                    {
+                        // refresh request state and states public render parameters
+                        String parameterName = parameterNamesEntry.getKey();
+                        requestState.setPublicRenderParameters(parameterName, parameterValues);
+                        requestStates.setPublicRenderParameters(parameterQName, parameterValues);
                     }
                 }
             }
         }
-        }        
     }
     
     private boolean modeChanged(PortletMode req, PortletMode ses)
@@ -301,13 +428,15 @@
     }
 
     
-    private boolean syncStates(boolean actionRequestState, PortletWindowRequestNavigationalState
requestState, PortletWindowBaseNavigationalState sessionState)
+    private boolean syncStates(boolean actionRequestState, PortletWindowRequestNavigationalStates
requestStates, PortletWindowRequestNavigationalState requestState, PortletWindowBaseNavigationalState
sessionState)
     {
         boolean changed = false;
         
-        if (modeChanged(requestState.getPortletMode(), sessionState.getPortletMode())
-                || stateChanged(requestState.getWindowState(), sessionState.getWindowState()))
+        if (modeChanged(requestState.getPortletMode(), sessionState.getPortletMode()) ||
+            stateChanged(requestState.getWindowState(), sessionState.getWindowState()))
+        {
             changed = true;
+        }
                        
         if ( requestState.getPortletMode() != null )
         {
@@ -351,6 +480,7 @@
         
         if (storeParameters)
         {
+            // sync parameters
             PortletWindowExtendedNavigationalState extendedSessionState = (PortletWindowExtendedNavigationalState)sessionState;
             if ( requestState.getParametersMap() != null )
             {
@@ -364,48 +494,98 @@
                     if (changedParameters(requestState.getParametersMap(), extendedSessionState.getParametersMap()))
                     {
                         changed = true;
+                        extendedSessionState.setParametersMap(new HashMap<String, String[]>(requestState.getParametersMap()));
                     }
-                    extendedSessionState.setParametersMap(new HashMap<String, String[]>(requestState.getParametersMap()));
                 }
             }
             else if ( requestState.isClearParameters() )
             {
                 extendedSessionState.setParametersMap(null);
-                requestState.setClearParameters(false);
-                //changed = true;
             }            
             else if ( extendedSessionState.getParametersMap() != null )
             {
                 requestState.setParametersMap(new HashMap<String, String[]>(extendedSessionState.getParametersMap()));
             }
+            
+            // sync action scope parameter
+            if (requestState.isActionScopedRequestAttributes() && extendedSessionState.isActionScopedRequestAttributes())
+            {
+                if (requestState.getActionScopeId() != null)
+                {
+                    if (changedActionScope(requestState.getActionScopeId(), extendedSessionState.getActionScopeId()))
+                    {
+                        changed = true;
+                    }
+                    extendedSessionState.setActionScopeId(requestState.getActionScopeId());
+                    extendedSessionState.setActionScopeRendered(requestState.isActionScopeRendered());
+                }
+                else if (requestState.isClearParameters())
+                {
+                    extendedSessionState.setActionScopeId(null);
+                    extendedSessionState.setActionScopeRendered(false);
+                }
+                else if (extendedSessionState.getActionScopeId() != null)
+                {
+                    requestState.setActionScopeId(extendedSessionState.getActionScopeId());
+                    requestState.setActionScopeRendered(extendedSessionState.isActionScopeRendered());
               
+                }
+            }
+
+            // reset clear parameters
+            if (requestState.isClearParameters())
+            {
+                requestState.setClearParameters(false);
+            }            
         }
         return changed;
     }    
 
     protected boolean changedParameters(Map<String, String[]> requestMap, Map<String,
String[]> sessionMap)
     {
-        if (sessionMap == null || requestMap == null)
+        if (requestMap == null || sessionMap == null)
+        {
             return true;
+        }
         if (requestMap.size() != sessionMap.size())
+        {
             return true;
+        }
         Iterator<Map.Entry<String, String[]>> ri = requestMap.entrySet().iterator();
-        Iterator<Map.Entry<String, String[]>> si = sessionMap.entrySet().iterator();
-        while (ri.hasNext() && si.hasNext())
+        while (ri.hasNext())
         {
             Map.Entry<String, String[]> r = ri.next();
-            Map.Entry<String, String[]> s = si.next();
-            if (!r.getKey().equals(s.getKey()))
+            if (changedParameterValues(r.getValue(), sessionMap.get(r.getKey())))
+            {
                 return true;
-            String[] rvals = r.getValue();
-            String[] svals = s.getValue();            
-            for (int ix = 0; ix < rvals.length; ix++)
+            }
+        }
+        return false;
+    }
+    
+    protected boolean changedParameterValues(String[] requestValues, String[] sessionValues)
+    {
+        if ((requestValues == null) || (sessionValues == null) || (requestValues.length !=
sessionValues.length))
+        {
+            return true;
+        }
+        for (int ix = 0; ix < requestValues.length; ix++)
+        {
+            if (!requestValues[ix].equals(sessionValues[ix]))
             {
-                if (!rvals[ix].equals(svals[ix]))
-                    return true;
+                return true;
             }
         }
         return false;
     }
+
+    protected boolean changedActionScope(String requestActionScope, String sessionActionScope)
+    {
+        if ((requestActionScope == null) || (sessionActionScope == null))
+        {
+            return true;
+        }
+        return !requestActionScope.equals(sessionActionScope);
+    }
     
     protected void removeFromCache(RequestContext context, String id, JetspeedContentCache
cache)
     {

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=757118&r1=757117&r2=757118&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
Sun Mar 22 02:50:28 2009
@@ -109,7 +109,7 @@
                 PortletWindowSessionNavigationalStates sessionStates = (PortletWindowSessionNavigationalStates)session.getAttribute(NavigationalState.NAVSTATE_SESSION_KEY);
                 if ( sessionStates == null )
                 {
-                    sessionStates = new PortletWindowSessionNavigationalStates(isRenderParameterStateFull());
+                    sessionStates = new PortletWindowSessionNavigationalStates(this, isRenderParameterStateFull());
                     session.setAttribute(NavigationalState.NAVSTATE_SESSION_KEY, sessionStates);
                 }
                 Page page = context.getPage();

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=757118&r1=757117&r2=757118&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
Sun Mar 22 02:50:28 2009
@@ -104,14 +104,25 @@
     
     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);
+        return createNavigationalEncoding(window, parameters, null, false, null, null, null,
null, 
+                                          mode, state, action ? URLType.ACTION : URLType.RENDER);
     }
     
     public String createNavigationalEncoding(PortletWindow window, Map<String, String[]>
parameters, PortletMode mode, WindowState state, URLType urlType)
     {
+        return createNavigationalEncoding(window, parameters, null, false, null, null, null,
null, 
+                                          mode, state, urlType);
+    }
+
+    public String createNavigationalEncoding(PortletWindow window, Map<String, String[]>
parameters, String actionScopeId, boolean actionScopeRendered,
+                                             String cacheLevel, String resourceId, Map<String,
String[]> privateRenderParameters, Map<String, String[]> publicRenderParameters,
+                                             PortletMode mode, WindowState state, URLType
urlType)
+    {
         try
         {
-            return getNavigationalStateParameterName() + ":" + getNavigationalState().encode(window,
parameters, mode, state, urlType);
+            String ns = getNavigationalState().encode(window, parameters, actionScopeId,
actionScopeRendered, cacheLevel, resourceId, privateRenderParameters, publicRenderParameters,
+                                                      mode, state, urlType);
+            return getNavigationalStateParameterName() + ":" + ns;
         }
         catch (UnsupportedEncodingException e)
         {
@@ -124,7 +135,8 @@
     {
         try
         {
-            return getNavigationalStateParameterName() + ":" + getNavigationalState().encode(window,
mode, state);
+            String ns = getNavigationalState().encode(window, mode, state);
+            return getNavigationalStateParameterName() + ":" + ns;
         }
         catch (UnsupportedEncodingException e)
         {
@@ -259,14 +271,25 @@
 
     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);
+        return createPortletURL(window, parameters, null, false, null, null, null, null,
+                                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)
     {
+        return createPortletURL(window, parameters, null, false, null, null, null, null,
+                                mode, state, urlType, secure);
+    }
+    
+    public String createPortletURL(PortletWindow window, Map<String, String[]> parameters,
String actionScopeId, boolean actionScopeRendered,
+                                   String cacheLevel, String resourceId, Map<String, String[]>
privateRenderParameters, Map<String, String[]> publicRenderParameters,
+                                   PortletMode mode, WindowState state, URLType urlType,
boolean secure)
+    {
         try
         {
-            return createPortletURL(navState.encode(window,parameters,mode,state,urlType),
secure);
+            String ns = getNavigationalState().encode(window, parameters, actionScopeId,
actionScopeRendered, cacheLevel, resourceId, privateRenderParameters, publicRenderParameters,
+                                                      mode, state, urlType);
+            return createPortletURL(ns, secure);
         }
         catch (UnsupportedEncodingException e)
         {
@@ -281,7 +304,8 @@
     {
         try
         {
-            return createPortletURL(navState.encode(window,mode,state), secure);
+            String ns = navState.encode(window,mode,state);
+            return createPortletURL(ns, 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=757118&r1=757117&r2=757118&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
Sun Mar 22 02:50:28 2009
@@ -199,12 +199,9 @@
         return buffer.toString();
     }        
     
-    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)
+    public String createPortletURL(PortletWindow window, Map<String, String[]> parameters,
String actionScopeId, boolean actionScopeRendered,
+            String cacheLevel, String resourceId, Map<String, String[]> privateRenderParameters,
Map<String, String[]> publicRenderParameters,
+            PortletMode mode, WindowState state, URLType urlType, boolean secure)
     {
         try
         {
@@ -214,7 +211,9 @@
             	desktopRequestNotAjax = true;
             	parameters.remove(JetspeedDesktop.DESKTOP_REQUEST_NOT_AJAX_PARAMETER);
             }
-            return createPortletURL(this.getNavigationalState().encode(window,parameters,mode,state,urlType),
secure, window, urlType, desktopRequestNotAjax);
+            String ns = getNavigationalState().encode(window, parameters, actionScopeId,
actionScopeRendered, cacheLevel, resourceId, privateRenderParameters, publicRenderParameters,
+                                                      mode, state, urlType);
+            return createPortletURL(ns, secure, window, urlType, desktopRequestNotAjax);
         }
         catch (UnsupportedEncodingException e)
         {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/window/impl/PortletWindowImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/window/impl/PortletWindowImpl.java?rev=757118&r1=757117&r2=757118&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/window/impl/PortletWindowImpl.java
(original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/window/impl/PortletWindowImpl.java
Sun Mar 22 02:50:28 2009
@@ -25,6 +25,8 @@
 import org.apache.jetspeed.container.PortletEntity;
 import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.container.PortletWindowID;
+import org.apache.jetspeed.om.portlet.ContainerRuntimeOption;
+import org.apache.jetspeed.om.portlet.PortletDefinition;
 
 /**
  * <P>

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/state/MutableNavigationalState.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/state/MutableNavigationalState.java?rev=757118&r1=757117&r2=757118&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/state/MutableNavigationalState.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/container/state/MutableNavigationalState.java
Sun Mar 22 02:50:28 2009
@@ -62,6 +62,11 @@
     void setState(PortletWindow window, WindowState windowState);
     
     /**
+     * Remove state for the given (possibly invalid) portlet window
+     */
+    void removeState(PortletWindow window);
+    
+    /**
      * Sets the portlet mode for the given portlet window.
      * 
      * @param window
@@ -76,10 +81,17 @@
      */
     void clearParameters(PortletWindow window);
     
-    /**
-     * Remove state for the given (possibly invalid) portlet window
-     */
-    void removeState(PortletWindow window);
-    
     void setParametersMap(PortletWindow window, Map<String, String[]> parametersMap);
+
+    void setActionScopeId(PortletWindow window, String actionScopeId);
+    
+    void setActionScopeRendered(PortletWindow window, boolean actionScopeRendered);
+
+    void setCacheLevel(PortletWindow window, String cacheLevel);
+
+    void setResourceId(PortletWindow window, String resourceId);
+    
+    void setPrivateRenderParametersMap(PortletWindow window, Map<String, String[]>
privateRenderParametersMap);
+
+    void setPublicRenderParametersMap(PortletWindow window, Map<String, String[]> publicRenderParametersMap);
 }

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=757118&r1=757117&r2=757118&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
Sun Mar 22 02:50:28 2009
@@ -140,7 +140,29 @@
     String[] getParameterValues(PortletWindow window, String parameterName);
 
     Map<String, String[]> getParameterMap(PortletWindow window);
+
+    boolean isActionScopedRequestAttributes(PortletWindow window);
+    
+    String getActionScopeId(PortletWindow window);
+    
+    boolean isActionScopeRendered(PortletWindow window);
+
+    String getCacheLevel(PortletWindow window);
+
+    String getResourceId(PortletWindow window);
+    
+    Iterator<String> getPrivateRenderParameterNames(PortletWindow window);
     
+    String[] getPrivateRenderParameterValues(PortletWindow window, String parameterName);
+
+    Map<String, String[]> getPrivateRenderParameterMap(PortletWindow window);
+    
+    Iterator<String> getPublicRenderParameterNames(PortletWindow window);
+    
+    String[] getPublicRenderParameterValues(PortletWindow window, String parameterName);
+
+    Map<String, String[]> getPublicRenderParameterMap(PortletWindow window);
+
     PortalURL.URLType getURLType();
     
     PortletWindow getPortletWindowOfAction();
@@ -162,13 +184,21 @@
      * 
      * @param window the PortalWindow
      * @param parameters the new request or action parameters for the PortalWindow
+     * @param actionScopeId the new action scope for the PortalWindow
+     * @param actionScopeRendered the new action scope rendered flag for the PortalWindow
+     * @param cacheLevel the new cache level for the PortalWindow resource
+     * @param resourceId the new resource id for the PortalWindow resource
+     * @param privateRenderParameters the new private render parameters for the PortalWindow
resource
+     * @param publicRenderParameters the new request, action, or resource public render parameters
for the PortalWindow
      * @param mode the new PortletMode for the PortalWindow
      * @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;
+    String encode(PortletWindow window, Map<String, String[]> parameters, String actionScopeId,
boolean actionScopeRendered,
+                  String cacheLevel, String resourceId, Map<String, String[]> privateRenderParameters,
Map<String, String[]> publicRenderParameters,
+                  PortletMode mode, WindowState state, boolean action) throws UnsupportedEncodingException;
 
     /**
      * Encodes the Navigational State with overrides for a specific PortletWindow into a
string to be embedded within a 
@@ -176,12 +206,20 @@
      * 
      * @param window the PortalWindow
      * @param parameters the new request or action parameters for the PortalWindow
+     * @param actionScopeId the new action scope for the PortalWindow
+     * @param actionScopeRendered the new action scope rendered flag for the PortalWindow
+     * @param cacheLevel the new cache level for the PortalWindow resource
+     * @param resourceId the new resource id for the PortalWindow resource
+     * @param privateRenderParameters the new private render parameters for the PortalWindow
resource
+     * @param publicRenderParameters the new request, action, or resource public render 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<String, String[]> parameters, PortletMode
mode, WindowState state, PortalURL.URLType urlType) throws UnsupportedEncodingException;
+    String encode(PortletWindow window, Map<String, String[]> parameters, String actionScopeId,
boolean actionScopeRendered,
+                  String cacheLevel, String resourceId, Map<String, String[]> privateRenderParameters,
Map<String, String[]> publicRenderParameters,
+                  PortletMode mode, WindowState state, PortalURL.URLType urlType) throws
UnsupportedEncodingException;
 
     /**
      * 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=757118&r1=757117&r2=757118&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
Sun Mar 22 02:50:28 2009
@@ -133,10 +133,34 @@
      * @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
+     * @deprecated
      */
     String createPortletURL(PortletWindow window, Map<String, String[]> parameters,
PortletMode mode, WindowState state, URLType urlType, 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 actionScopeId the new action scope for the PortalWindow
+     * @param actionScopeRendered the new action scope rendered flag for the PortalWindow
+     * @param cacheLevel the new cache level for the PortalWindow resource
+     * @param resourceId the new resource id for the PortalWindow resource
+     * @param privateRenderParameters the new private render parameters for the PortalWindow
resource
+     * @param publicRenderParameters the new request, action, or resource public render 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<String, String[]> parameters,
String actionScopeId, boolean actionScopeRendered,
+                            String cacheLevel, String resourceId, Map<String, String[]>
privateRenderParameters, Map<String, String[]> publicRenderParameters,
+                            PortletMode mode, WindowState state, URLType urlType, boolean
secure);
+
+    /**
      * Create a new PortletURL for a PortletWindow retaining its (request) parameters.
      * <br>
      * The Portal Navigational State is encoded within the URL
@@ -185,8 +209,31 @@
      * @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
+     * @deprecated
      */
     String createNavigationalEncoding(PortletWindow window, Map<String, String[]> parameters,
PortletMode mode, WindowState state, URLType urlType);
+
+    /**
+     * 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 actionScopeId the new action scope for the PortalWindow
+     * @param actionScopeRendered the new action scope rendered flag for the PortalWindow
+     * @param cacheLevel the new cache level for the PortalWindow resource
+     * @param resourceId the new resource id for the PortalWindow resource
+     * @param privateRenderParameters the new private render parameters for the PortalWindow
resource
+     * @param publicRenderParameters the new request, action, or resource public render 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<String, String[]> parameters,
String actionScopeId, boolean actionScopeRendered,
+                                      String cacheLevel, String resourceId, Map<String,
String[]> privateRenderParameters, Map<String, String[]> publicRenderParameters,
+                                      PortletMode mode, WindowState state, URLType urlType);
     
     /**
      * Creates the navigational encoding for a given window

Modified: portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/ContainerRuntimeOption.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/ContainerRuntimeOption.java?rev=757118&r1=757117&r2=757118&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/ContainerRuntimeOption.java
(original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-api/src/main/java/org/apache/jetspeed/om/portlet/ContainerRuntimeOption.java
Sun Mar 22 02:50:28 2009
@@ -24,4 +24,5 @@
  */
 public interface ContainerRuntimeOption extends org.apache.pluto.container.om.portlet.ContainerRuntimeOption,
Serializable
 {
-}
\ No newline at end of file
+    public static final String ACTION_SCOPED_REQUEST_ATTRIBUTES_OPTION = "javax.portlet.actionScopedRequestAttributes";
+}



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