portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r758134 [2/5] - in /portals/jetspeed-2/portal/trunk: applications/jetspeed/src/main/webapp/WEB-INF/templates/layout/html/solo/ applications/jetspeed/src/main/webapp/decorations/layout/blueocean/ applications/jetspeed/src/main/webapp/decorat...
Date Wed, 25 Mar 2009 03:25:00 GMT
Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/JetspeedPortletContainerWrapper.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/JetspeedPortletContainerWrapper.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/JetspeedPortletContainerWrapper.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/JetspeedPortletContainerWrapper.java Wed Mar 25 03:24:47 2009
@@ -25,8 +25,6 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.apache.jetspeed.engine.servlet.ServletRequestFactory;
-import org.apache.jetspeed.engine.servlet.ServletResponseFactory;
 import org.apache.pluto.container.OptionalContainerServices;
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletContainerException;
@@ -43,13 +41,9 @@
 {
     private boolean initialized = false;
     private static final Log log = LogFactory.getLog(JetspeedPortletContainerWrapper.class);
-    private final String INVALID_WINDOW_TYPE = "Window is not of valid type: ";    
     private final PortletContainer pluto;
     private final String containerId;
     
-    private ServletRequestFactory requestFactory;
-    private ServletResponseFactory responseFactory;
-
     public JetspeedPortletContainerWrapper(PortletContainer pluto, String containerId)
     {
         this.pluto = pluto;
@@ -71,45 +65,25 @@
     }
     
     public void doRender(PortletWindow portletWindow, HttpServletRequest servletRequest, HttpServletResponse servletResponse)
-        throws PortletException, IOException, PortletContainerException
+    throws PortletException, IOException, PortletContainerException
     {                
-        if(portletWindow.getPortletEntity() == null)
-        {
-            log.warn("Could not render PortletWindow "+ portletWindow.getId() + " as it has no PortletEntity defined.");
-            return;
-        }        
-        
-        if(portletWindow.getPortletEntity().getPortletDefinition() == null)
-        {
-            log.warn("Could not render PortletWindow"+ portletWindow.getId() + " as it has no PortletDefintion defined.");
-            return;
-        }
         pluto.doRender(portletWindow, servletRequest, servletResponse);
     }
 
-    public void doAction(
-        PortletWindow portletWindow,
-        HttpServletRequest servletRequest,
-        HttpServletResponse servletResponse)
-        throws PortletException, IOException, PortletContainerException
+    public void doAction(PortletWindow portletWindow, HttpServletRequest servletRequest, HttpServletResponse servletResponse)
+    throws PortletException, IOException, PortletContainerException
     {
         pluto.doAction(portletWindow, servletRequest, servletResponse);
     }
-
     
     public void doLoad(PortletWindow portletWindow, HttpServletRequest servletRequest, HttpServletResponse servletResponse)
-        throws PortletException, IOException, PortletContainerException
+    throws PortletException, IOException, PortletContainerException
     {
-        if (portletWindow instanceof org.apache.jetspeed.container.PortletWindow)
-            throw new PortletException(INVALID_WINDOW_TYPE + org.apache.jetspeed.container.PortletWindow.class);
-        org.apache.jetspeed.container.PortletWindow jpw = (org.apache.jetspeed.container.PortletWindow)portletWindow;
-        pluto.doLoad(portletWindow, 
-            requestFactory.getServletRequest(servletRequest, jpw),
-            responseFactory.getServletResponse(servletResponse));
+        pluto.doLoad(portletWindow, servletRequest, servletResponse);
     }
 
     public void doAdmin(PortletWindow portletWindow, HttpServletRequest servletRequest, HttpServletResponse servletResponse)
-        throws PortletException, IOException, PortletContainerException
+    throws PortletException, IOException, PortletContainerException
     {
         pluto.doAdmin(portletWindow, servletRequest, servletResponse);
     }
@@ -120,6 +94,12 @@
         pluto.doServeResource(portletWindow, servletRequest, servletResponse);
     }
 
+    public void doEvent(PortletWindow portletWindow, HttpServletRequest request, HttpServletResponse response, Event event)
+    throws PortletException, IOException, PortletContainerException
+    {
+        pluto.doEvent(portletWindow, request, response, event);
+    }
+                
     public String getName()
     {
         return this.containerId;
@@ -135,36 +115,8 @@
         return pluto.getRequiredContainerServices();
     }
 
-    
-    /**
-     * <p>
-     * isInitialized
-     * </p>
-     *
-     * @see org.apache.pluto.PortletContainer#isInitialized()
-     * @return
-     */
     public boolean isInitialized()
     {
         return initialized;
     }
-
-    public void setRequestFactory(ServletRequestFactory requestFactory)
-    {
-        this.requestFactory = requestFactory;
-    }
-
-    public void setResponseFactory(ServletResponseFactory responseFactory)
-    {
-        this.responseFactory = responseFactory;
-    }
-
-    public void doEvent(PortletWindow window, HttpServletRequest request,
-            HttpServletResponse response, Event event)
-            throws PortletException, IOException, PortletContainerException
-    {
-        pluto.doEvent(window, request, response, event);
-    }
-    
-
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletRenderResponseContextImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletRenderResponseContextImpl.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletRenderResponseContextImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletRenderResponseContextImpl.java Wed Mar 25 03:24:47 2009
@@ -29,7 +29,6 @@
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletRenderResponseContext;
 import org.apache.pluto.container.util.PrintWriterServletOutputStream;
-import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.aggregator.PortletContent;
 import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.services.title.DynamicTitleService;
@@ -50,7 +49,7 @@
                                             HttpServletResponse containerResponse, PortletWindow window, DynamicTitleService titleService)
     {
         super(container, containerRequest, containerResponse, window);
-        this.portletContent = (PortletContent)getRequestContext().getPortletWindowAttributes(getPortletWindow()).get(PortalReservedParameters.PORTLET_CONTENT_ATTRIBUTE);
+        this.portletContent = window.getFragment().getPortletContent();
     }
 
     public void flushBuffer() throws IOException

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletResponseContextImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletResponseContextImpl.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletResponseContextImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/impl/PortletResponseContextImpl.java Wed Mar 25 03:24:47 2009
@@ -23,7 +23,6 @@
 
 import org.apache.pluto.container.PortletContainer;
 import org.apache.pluto.container.PortletResponseContext;
-import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.container.providers.ResourceURLProviderImpl;
 import org.apache.jetspeed.request.JetspeedRequestContext;
@@ -53,7 +52,7 @@
         this.containerRequest = containerRequest;
         this.containerResponse = containerResponse;
         this.window = window;
-        this.requestContext = (JetspeedRequestContext)containerRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
+        this.requestContext = (JetspeedRequestContext)window.getRequestContext();
     }
     
     protected JetspeedRequestContext getRequestContext()

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/DefaultPortletRequestResponseUnwrapper.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/DefaultPortletRequestResponseUnwrapper.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/DefaultPortletRequestResponseUnwrapper.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/DefaultPortletRequestResponseUnwrapper.java Wed Mar 25 03:24:47 2009
@@ -20,12 +20,12 @@
 import javax.portlet.PortletResponse;
 import javax.servlet.ServletRequest;
 import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequestWrapper;
-import javax.servlet.http.HttpServletResponseWrapper;
+
+import org.apache.jetspeed.Jetspeed;
 
 /**
  * DefaultPortletRequestResponseUnwrapper implements PortletRequestResponseUnwrapper
- * and finds servlet request or servlet response by simple unwrapping.
+ * and finds servlet request or servlet response
  *
  * @author <a href="mailto:woonsan@apache.org">Woonsan Ko</a>
  * @version $Id: $
@@ -34,13 +34,11 @@
 {
     public ServletRequest unwrapPortletRequest(PortletRequest portletRequest)
     {
-        ServletRequest servletRequest = ((HttpServletRequestWrapper)((HttpServletRequestWrapper)((HttpServletRequestWrapper)portletRequest).getRequest()).getRequest()).getRequest();
-        return servletRequest;
+        return Jetspeed.getCurrentRequestContext().getCurrentPortletWindow().getPortletRequestContext().getContainerRequest();
     }
     
     public ServletResponse unwrapPortletResponse(PortletResponse portletResponse)
     {
-        ServletResponse servletResponse = ((HttpServletResponseWrapper) portletResponse).getResponse();
-        return servletResponse;
+        return Jetspeed.getCurrentRequestContext().getCurrentPortletWindow().getPortletRequestContext().getContainerResponse();
     }
 }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvoker.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvoker.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvoker.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvoker.java Wed Mar 25 03:24:47 2009
@@ -25,7 +25,9 @@
 
 import org.apache.jetspeed.factory.PortletFactory;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
-import org.apache.pluto.container.FilterManager;
+import org.apache.jetspeed.container.FilterManager;
+import org.apache.jetspeed.container.PortletWindow;
+import org.apache.pluto.container.PortletRequestContext;
 
 /**
  * JetspeedPortletInvoker extends Pluto's portlet invoker model and extends it
@@ -60,15 +62,17 @@
     boolean isActivated();
 
     /**
-     * Invoke a method
+     * Invoke an action
+     * @param requestContext
      * @param portletRequest
      * @param portletResponse
-     * @param method
+     * @param action
      * @param filter
      * @throws PortletException
      * @throws IOException
      */
-    void invoke(PortletRequest portletRequest, PortletResponse portletResponse, Integer method, FilterManager filter)
+    void invoke(PortletRequestContext requestContext, PortletRequest portletRequest, PortletResponse portletResponse, 
+                PortletWindow.Action action, FilterManager filter)
         throws PortletException, IOException;
     
-}
+}
\ No newline at end of file

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvokerService.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvokerService.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvokerService.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/JetspeedPortletInvokerService.java Wed Mar 25 03:24:47 2009
@@ -32,13 +32,12 @@
 import javax.servlet.ServletConfig;
 
 import org.apache.jetspeed.PortalContext;
-import org.apache.jetspeed.container.ContainerConstants;
+import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.factory.PortletFactory;
 import org.apache.jetspeed.om.portlet.PortletApplication;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.pluto.container.PortletContainerException;
 import org.apache.pluto.container.PortletRequestContext;
-import org.apache.pluto.container.PortletWindow;
 import org.apache.pluto.container.FilterManager;
 import org.apache.pluto.container.PortletInvokerService;
 
@@ -71,118 +70,79 @@
     
     private ServletConfig servletConfig;
     private PortletFactory portletFactory;
-    private PortletRequestResponseUnwrapper unwrapper;
     private String servletMappingName;
     
-    public JetspeedPortletInvokerService(ServletConfig servletConfig, PortalContext portalContext, 
-            PortletFactory portletFactory, PortletRequestResponseUnwrapper unwrapper)
+    public JetspeedPortletInvokerService(ServletConfig servletConfig, PortalContext portalContext, PortletFactory portletFactory)
     {
         this.servletConfig = servletConfig;
         this.portletFactory = portletFactory;
-        this.unwrapper = unwrapper;
         this.servletMappingName = portalContext.getConfigurationProperty(INVOKER_SERVLET_MAPPING_NAME, DEFAULT_MAPPING_NAME);                                
     }
     
-    public void action(PortletRequestContext ctx, ActionRequest req, ActionResponse res, FilterManager filterManager)
+    public void action(PortletRequestContext requestContext, ActionRequest request, ActionResponse response, FilterManager filterManager)
     throws IOException, PortletException, PortletContainerException
     {
-        // TODO Auto-generated method stub
+        getInvoker(requestContext).invoke(requestContext, 
+                                          request, response, 
+                                          PortletWindow.Action.ACTION, 
+                                          (org.apache.jetspeed.container.FilterManager)filterManager);
     }
 
-    public void admin(PortletRequestContext ctx, PortletRequest req, PortletResponse res)
+    public void admin(PortletRequestContext requestContext, PortletRequest request, PortletResponse response)
     throws IOException, PortletException, PortletContainerException
     {
-        // TODO Auto-generated method stub
+        throw new PortletContainerException("Unsupported action ADMIN");
     }
 
-    public void event(PortletRequestContext ctx, EventRequest request, EventResponse response, FilterManager filterManager)
+    public void event(PortletRequestContext requestContext, EventRequest request, EventResponse response, FilterManager filterManager)
     throws IOException, PortletException, PortletContainerException
     {
-        // TODO Auto-generated method stub
+        getInvoker(requestContext).invoke(requestContext, 
+                                          request, response, 
+                                          PortletWindow.Action.EVENT, 
+                                          (org.apache.jetspeed.container.FilterManager)filterManager);
     }
 
-    public void load(PortletRequestContext ctx, PortletRequest req, PortletResponse res)
+    public void load(PortletRequestContext requestContext, PortletRequest request, PortletResponse response)
     throws IOException, PortletException, PortletContainerException
     {
-        // TODO Auto-generated method stub
+        getInvoker(requestContext).invoke(requestContext, 
+                                          request, response, 
+                                          PortletWindow.Action.LOAD, null);
     }
 
-    public void render(PortletRequestContext ctx, RenderRequest req, RenderResponse res, FilterManager filterManager)
+    public void render(PortletRequestContext requestContext, RenderRequest request, RenderResponse response, FilterManager filterManager)
     throws IOException, PortletException, PortletContainerException
     {
-        // TODO Auto-generated method stub
+        getInvoker(requestContext).invoke(requestContext, 
+                                          request, response, 
+                                          PortletWindow.Action.RENDER, 
+                                          (org.apache.jetspeed.container.FilterManager)filterManager);
     }
 
-    public void serveResource(PortletRequestContext ctx, ResourceRequest req, ResourceResponse res, FilterManager filterManager)
+    public void serveResource(PortletRequestContext requestContext, ResourceRequest request, ResourceResponse response, FilterManager filterManager)
     throws IOException, PortletException, PortletContainerException
     {
-        // TODO Auto-generated method stub
+        getInvoker(requestContext).invoke(requestContext, 
+                                          request, response, 
+                                          PortletWindow.Action.RESOURCE, 
+                                          (org.apache.jetspeed.container.FilterManager)filterManager);
     }
 
-    public void action(ActionRequest request,
-            ActionResponse response, PortletWindow window, FilterManager filter)
-            throws IOException, PortletException
+    protected JetspeedPortletInvoker getInvoker(PortletRequestContext requestContext)
     {
-        JetspeedPortletInvoker invoker = getInvoker(window);
-        invoker.invoke(request, response, ContainerConstants.METHOD_ACTION, filter);
-    }
-
-    public void admin(PortletRequest request,
-            PortletResponse response, PortletWindow window) throws IOException,
-            PortletException
-    {
-        JetspeedPortletInvoker invoker = getInvoker(window);
-        invoker.invoke(request, response, ContainerConstants.METHOD_ADMIN, null);        
-    }
-
-    public void event(EventRequest request,
-            EventResponse response, PortletWindow window, FilterManager filter)
-            throws IOException, PortletException
-    {
-        JetspeedPortletInvoker invoker = getInvoker(window);
-        invoker.invoke(request, response, ContainerConstants.METHOD_EVENT, filter);
-    }
-
-    public void load(PortletRequest request,
-            PortletResponse response, PortletWindow window) throws IOException,
-            PortletException
-    {
-        JetspeedPortletInvoker invoker = getInvoker(window);
-        invoker.invoke(request, response, ContainerConstants.METHOD_NOOP, null);
-    }   
-    
-    public void render(RenderRequest request,
-            RenderResponse response, PortletWindow window, FilterManager filter)
-            throws IOException, PortletException
-    {
-        JetspeedPortletInvoker invoker = getInvoker(window);
-        invoker.invoke(request, response, ContainerConstants.METHOD_RENDER, filter);
-    }
-
-    public void serveResource(ResourceRequest request,
-            ResourceResponse response, PortletWindow window, FilterManager filter)
-            throws IOException, PortletException
-    {
-        JetspeedPortletInvoker invoker = getInvoker(window);
-        invoker.invoke(request, response, ContainerConstants.METHOD_RESOURCE, filter);
-    }
-    
-    protected JetspeedPortletInvoker getInvoker(PortletWindow window)
-    {
-        PortletDefinition portletDefinition = (PortletDefinition)window.getPortletEntity().getPortletDefinition();
-        PortletApplication app = (PortletApplication)portletDefinition.getApplication();
         JetspeedPortletInvoker invoker;
-        if (app.getApplicationType() == PortletApplication.LOCAL)
+        PortletDefinition portletDefinition = (PortletDefinition)requestContext.getPortletWindow().getPortletEntity().getPortletDefinition();
+        if (portletDefinition.getApplication().getApplicationType() == PortletApplication.LOCAL)
         {
             invoker = new LocalPortletInvoker();
         }
         else
         {
-            invoker =  new ServletPortletInvoker(this.unwrapper, servletMappingName);
+            invoker =  new ServletPortletInvoker(servletMappingName);
 
         }
         invoker.activate(portletFactory, portletDefinition, servletConfig);
         return invoker;        
     }
-    
-}
+}
\ No newline at end of file

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java Wed Mar 25 03:24:47 2009
@@ -28,18 +28,18 @@
 import javax.portlet.UnavailableException;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletRequestWrapper;
 
 import org.apache.jetspeed.PortalReservedParameters;
-import org.apache.jetspeed.container.ContainerConstants;
-import org.apache.jetspeed.container.PortletRequestContext;
+import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.factory.PortletFactory;
 import org.apache.jetspeed.factory.PortletInstance;
-import org.apache.jetspeed.om.portlet.PortletApplication;
-import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
-import org.apache.pluto.container.FilterManager;
+import org.apache.jetspeed.om.window.impl.PortletWindowImpl;
+import org.apache.jetspeed.request.JetspeedRequestContext;
+import org.apache.jetspeed.container.FilterManager;
+import org.apache.pluto.container.PortletInvokerService;
+import org.apache.pluto.container.PortletRequestContext;
+import org.apache.pluto.container.PortletResponseContext;
 
 /**
  * LocalPortletInvoker invokes local (internal) portlet applications.
@@ -64,9 +64,11 @@
     protected PortletDefinition portletDefinition;
     protected boolean activated = false;
     
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.container.invoker.JetspeedPortletInvoker#activate(PortletFactory,org.apache.pluto.container.om.portlet.PortletDefinition, javax.servlet.ServletConfig)
-     */
+    public LocalPortletInvoker()
+    {
+        activated = false;
+    }
+    
     public void activate(PortletFactory portletFactory, PortletDefinition portletDefinition, ServletConfig servletConfig)
     {
         this.portletFactory = portletFactory;
@@ -76,79 +78,67 @@
         activated = true;        
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.container.invoker.JetspeedPortletInvoker#passivate()
-     */
     public void passivate()
     {
         activated = false;    
     }
     
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.container.invoker.JetspeedPortletInvoker#isActivated()
-     */
     public boolean isActivated()
     {
         return activated;
     }
     
-    public LocalPortletInvoker()
-    {
-        activated = false;
-    }
-    
     /**
      * Invokes the specific request denoted by the <code>method</code> parameter on a portlet.
      * The portlet is invoked with a direct method call on the portlet. It is not invoked in another web application.
      * This requires manipulation of the current thread's classpath.
      * 
+     * @param requestContext
      * @param portletRequest
      * @param portletResponse
-     * @param methodID
+     * @param action
+     * @param filter
      * @throws PortletException
      * @throws IOException
      */
-    public void invoke(PortletRequest portletRequest, PortletResponse portletResponse, Integer method, FilterManager filter)
+    public void invoke(PortletRequestContext requestContext, PortletRequest portletRequest, PortletResponse portletResponse,
+                       PortletWindow.Action action, FilterManager filter)
             throws PortletException, IOException
     {
-        ClassLoader paClassLoader = portletFactory
-                .getPortletApplicationClassLoader((PortletApplication) portletDefinition.getApplication());
-        PortletInstance portletInstance = portletFactory.getPortletInstance(jetspeedContext, portletDefinition);
-        if (method == ContainerConstants.METHOD_NOOP)
+        if (PortletWindow.Action.NOOP == action)
         {
             return;
         }
-        HttpServletRequest servletRequest = (HttpServletRequest)((HttpServletRequestWrapper) portletRequest).getRequest();
+        
+        PortletWindowImpl window = (PortletWindowImpl)requestContext.getPortletWindow();
+        
+        ClassLoader paClassLoader = portletFactory.getPortletApplicationClassLoader(portletDefinition.getApplication());
+        PortletInstance portletInstance = portletFactory.getPortletInstance(jetspeedContext, portletDefinition);
+        
         ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
         try
         {
-            PortletRequestContext.createContext(portletDefinition, portletInstance, portletRequest, portletResponse);
-
-            servletRequest.setAttribute(ContainerConstants.PORTLET_CONFIG, portletInstance.getConfig());
-            servletRequest.setAttribute(ContainerConstants.PORTLET_REQUEST, portletRequest);
-            servletRequest.setAttribute(ContainerConstants.PORTLET_RESPONSE, portletResponse);
-            RequestContext requestContext = (RequestContext) servletRequest
-                    .getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
-            servletRequest
-                    .setAttribute(ContainerConstants.PORTAL_CONTEXT, requestContext.getRequest().getContextPath());
-
+            PortletResponseContext responseContext = (PortletResponseContext)portletRequest.getAttribute(PortletInvokerService.RESPONSE_CONTEXT);
+            ((JetspeedRequestContext)window.getRequestContext()).setCurrentPortletWindow(window);
+            window.setInvocationState(action, requestContext, responseContext, portletRequest, portletResponse, portletInstance);
+            window.setAttribute(PortalReservedParameters.FRAGMENT_ATTRIBUTE, window.getFragment());
+            window.setAttribute(PortalReservedParameters.PORTLET_WINDOW_ATTRIBUTE, window);
+            window.setAttribute(PortalReservedParameters.PORTLET_DEFINITION_ATTRIBUTE, portletDefinition);
+            
             Thread.currentThread().setContextClassLoader(paClassLoader);
             
-//TODO            
-//            ((InternalPortletRequest)portletRequest).init(portletInstance.getConfig().getPortletContext(), servletRequest);
-
-            if (method == ContainerConstants.METHOD_ACTION)
+            if (PortletWindow.Action.ACTION == action)
             {
                 ActionRequest actionRequest = (ActionRequest) portletRequest;
                 ActionResponse actionResponse = (ActionResponse) portletResponse;
 
                 portletInstance.processAction(actionRequest, actionResponse);
             }
-            else if (method == ContainerConstants.METHOD_RENDER)
+            if (PortletWindow.Action.RENDER == action)
             {
                 RenderRequest renderRequest = (RenderRequest) portletRequest;
                 RenderResponse renderResponse = (RenderResponse) portletResponse;
-                renderResponse.setContentType(requestContext.getMimeType());
+                renderResponse.setContentType(window.getRequestContext().getMimeType());
                 portletInstance.render(renderRequest, renderResponse);
             }
         }
@@ -181,22 +171,8 @@
         }
         finally
         {
-            PortletRequestContext.clearContext();
-            servletRequest.removeAttribute(ContainerConstants.PORTLET_CONFIG);
-            servletRequest.removeAttribute(ContainerConstants.PORTLET_REQUEST);
-            servletRequest.removeAttribute(ContainerConstants.PORTLET_RESPONSE);
-            servletRequest.removeAttribute(ContainerConstants.PORTAL_CONTEXT);
-
+            ((JetspeedRequestContext)window.getRequestContext()).setCurrentPortletWindow(null);
             Thread.currentThread().setContextClassLoader(oldLoader);
         }
     }
-
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.container.invoker.JetspeedPortletInvoker#activate(PortletFactory,org.apache.pluto.container.om.portlet.PortletDefinition, javax.servlet.ServletConfig, java.lang.String)
-     */
-    public void activate(PortletFactory portletFactory, PortletDefinition portletDefinition, ServletConfig servletConfig, String servletMappingName)
-    {
-        activate(portletFactory, portletDefinition, servletConfig);
-    }
-    
-}
+}
\ No newline at end of file

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=758134&r1=758133&r2=758134&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 Wed Mar 25 03:24:47 2009
@@ -24,22 +24,21 @@
 import javax.servlet.RequestDispatcher;
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-import javax.servlet.http.HttpServletRequest;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.PortalReservedParameters;
-import org.apache.jetspeed.aggregator.CurrentWorkerContext;
-import org.apache.jetspeed.container.ContainerConstants;
-import org.apache.jetspeed.container.PortletRequestContext;
+import org.apache.jetspeed.container.FilterManager;
+import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.factory.PortletFactory;
 import org.apache.jetspeed.factory.PortletInstance;
 import org.apache.jetspeed.om.portlet.PortletApplication;
-import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
-import org.apache.pluto.container.FilterManager;
+import org.apache.jetspeed.om.window.impl.PortletWindowImpl;
+import org.apache.jetspeed.request.JetspeedRequestContext;
+import org.apache.pluto.container.PortletInvokerService;
+import org.apache.pluto.container.PortletRequestContext;
+import org.apache.pluto.container.PortletResponseContext;
 
 /**
  * ServletPortletInvoker invokes portlets in another web application, calling a 
@@ -72,46 +71,30 @@
     protected boolean activated = false;
     protected String servletMappingName;
     
-    /**
-     * requestResponseUnwrapper used to unwrap portlet request or portlet response
-     * to find the real servlet request or servlet response.
-     */
-    protected PortletRequestResponseUnwrapper requestResponseUnwrapper;
-    
-    public ServletPortletInvoker(PortletRequestResponseUnwrapper requestResponseUnwrapper, String servletMappingName)
+    public ServletPortletInvoker(String servletMappingName)
     {
-        this.requestResponseUnwrapper = requestResponseUnwrapper;
         this.servletMappingName = servletMappingName;
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.container.invoker.JetspeedPortletInvoker#passivate()
-     */
+    public void activate(PortletFactory portletFactory, PortletDefinition portletDefinition, ServletConfig servletConfig)
+    {
+        this.portletFactory = portletFactory;
+        this.jetspeedConfig = servletConfig;
+        jetspeedContext = servletConfig.getServletContext();
+        this.portletDefinition = portletDefinition;
+        activated = true;
+    }
+
     public void passivate()
     {
         activated = false;
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.container.invoker.JetspeedPortletInvoker#isActivated()
-     */
     public boolean isActivated()
     {
         return activated;
     }
 
-    /* (non-Javadoc)
-     * @see org.apache.jetspeed.container.invoker.JetspeedPortletInvoker#activate(PortletFactory,org.apache.pluto.container.om.portlet.PortletDefinition, javax.servlet.ServletConfig)
-     */
-    public void activate(PortletFactory portletFactory, PortletDefinition portletDefinition, ServletConfig servletConfig)
-    {
-        this.portletFactory = portletFactory;
-        this.jetspeedConfig = servletConfig;
-        jetspeedContext = servletConfig.getServletContext();
-        this.portletDefinition = portletDefinition;
-        activated = true;
-    }
-
     /**
      * Creates a servlet request dispatcher to dispatch to another web application to render the portlet.
      * NOTE: this method requires that your container supports cross-context dispatching.
@@ -123,27 +106,12 @@
      * @throws PortletException
      * @throws IOException
      */
-    public void invoke(PortletRequest portletRequest, PortletResponse portletResponse, Integer methodID, FilterManager filter)
+    public void invoke(PortletRequestContext requestContext, PortletRequest portletRequest, PortletResponse portletResponse, 
+                       PortletWindow.Action action, FilterManager filter)
         throws PortletException, IOException
     {
-        // In case of parallel mode, the portletDefinition member is not thread-safe.
-        // So, hide the member variable by the following local variable.
-        PortletDefinition portletDefinition = null;
-
-        // In case of parallel mode, get portlet definition object from the worker thread context.
-        // Otherwise, refer the member variable.
-        boolean isParallelMode = CurrentWorkerContext.getParallelRenderingMode();
-
-        if (isParallelMode)
-        {
-            portletDefinition = (PortletDefinition) CurrentWorkerContext.getAttribute(PortalReservedParameters.PORTLET_DEFINITION_ATTRIBUTE);
-        }
-        
-        if (portletDefinition == null)
-        {
-            portletDefinition = this.portletDefinition;
-        }
-        
+        PortletWindowImpl window = (PortletWindowImpl)requestContext.getPortletWindow();
+        PortletDefinition portletDefinition = window.getPortletDefinition();
         PortletApplication app = portletDefinition.getApplication();
 
         String appContextPath = app.getContextPath();
@@ -159,103 +127,43 @@
         RequestDispatcher dispatcher = appContext.getRequestDispatcher(servletMappingName);
         if (null == dispatcher)
         {
-            String message =
-                "Failed to get Request Dispatcher for Portlet Application: "
-                    + appContextPath
-                    + ", servlet: "
-                    + servletMappingName;
+            String message = "Failed to get Request Dispatcher for Portlet Application: "+appContextPath+", servlet: "+servletMappingName;
             log.error(message);
             throw new PortletException(message);
         }
 
-        // 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;
+        boolean useForward = window.getAttribute(PortalReservedParameters.PORTLET_CONTAINER_INVOKER_USE_FORWARD) != null;
 
         try
         {
-            RequestContext requestContext = (RequestContext) servletRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
-            
-            if (isParallelMode)
-            {
-                synchronized (servletRequest)
-                {
-                    servletRequest.setAttribute(ContainerConstants.PORTLET, portletInstance);
-                    servletRequest.setAttribute(ContainerConstants.PORTLET_CONFIG, portletInstance.getConfig());
-                    servletRequest.setAttribute(ContainerConstants.PORTLET_REQUEST, portletRequest);
-                    servletRequest.setAttribute(ContainerConstants.PORTLET_RESPONSE, portletResponse);
-                    servletRequest.setAttribute(ContainerConstants.METHOD_ID, methodID);
-                    servletRequest.setAttribute(ContainerConstants.PORTLET_NAME, app.getName()+"::"+portletDefinition.getPortletName());
-                    servletRequest.setAttribute(ContainerConstants.PORTAL_CONTEXT, ((HttpServletRequest) servletRequest).getContextPath());
-                }
-            }
-            else
-            {
-                servletRequest.setAttribute(ContainerConstants.PORTLET, portletInstance);
-                servletRequest.setAttribute(ContainerConstants.PORTLET_CONFIG, portletInstance.getConfig());
-                servletRequest.setAttribute(ContainerConstants.PORTLET_REQUEST, portletRequest);
-                servletRequest.setAttribute(ContainerConstants.PORTLET_RESPONSE, portletResponse);
-                servletRequest.setAttribute(ContainerConstants.METHOD_ID, methodID);
-                servletRequest.setAttribute(ContainerConstants.PORTLET_NAME, app.getName()+"::"+portletDefinition.getPortletName());
-                servletRequest.setAttribute(ContainerConstants.PORTAL_CONTEXT, requestContext.getRequest().getContextPath());
-            }
+            PortletResponseContext responseContext = (PortletResponseContext)portletRequest.getAttribute(PortletInvokerService.RESPONSE_CONTEXT);
+            ((JetspeedRequestContext)window.getRequestContext()).setCurrentPortletWindow(window);
+            window.setInvocationState(action, requestContext, responseContext, portletRequest, portletResponse, portletInstance);
+            window.setAttribute(PortalReservedParameters.FRAGMENT_ATTRIBUTE, window.getFragment());
+            window.setAttribute(PortalReservedParameters.PORTLET_WINDOW_ATTRIBUTE, window);
+            window.setAttribute(PortalReservedParameters.PORTLET_DEFINITION_ATTRIBUTE, portletDefinition);
 
-            // Store same request attributes into the worker in parallel mode.
-            if (isParallelMode)
-            {
-                CurrentWorkerContext.setAttribute(ContainerConstants.PORTLET, portletInstance);
-                CurrentWorkerContext.setAttribute(ContainerConstants.PORTLET_CONFIG, portletInstance.getConfig());
-                CurrentWorkerContext.setAttribute(ContainerConstants.PORTLET_REQUEST, portletRequest);
-                CurrentWorkerContext.setAttribute(ContainerConstants.PORTLET_RESPONSE, portletResponse);
-                CurrentWorkerContext.setAttribute(ContainerConstants.METHOD_ID, methodID);
-                CurrentWorkerContext.setAttribute(ContainerConstants.PORTLET_NAME, app.getName()+"::"+portletDefinition.getPortletName());
-                CurrentWorkerContext.setAttribute(ContainerConstants.PORTAL_CONTEXT, ((HttpServletRequest) servletRequest).getContextPath());                
-            }
 
-            PortletRequestContext.createContext(portletDefinition, portletInstance, portletRequest, portletResponse);
             if (useForward)
             {
-                dispatcher.forward(servletRequest, servletResponse);
+                dispatcher.forward(requestContext.getContainerRequest(), requestContext.getContainerResponse());
             }
             else
             {
-                dispatcher.include(servletRequest, servletResponse);
+                dispatcher.include(requestContext.getContainerRequest(), requestContext.getContainerResponse());
             }
             
         }
         catch (Exception e)
         {
             String message =
-                "Failed to dispatch."+(useForward?"forward":"include")+" for Portlet Application: " + appContextPath + ", servlet: " + servletMappingName;
+                "Failed to dispatch."+(useForward?"forward":"include")+" for Portlet Application: "+appContextPath+", servlet: "+servletMappingName;
             log.error(message, e);
             throw new PortletException(message, e);
         }
         finally
         {
-            PortletRequestContext.clearContext();
-
-            // In parallel mode, remove all attributes of worker context.
-            if (isParallelMode)
-            {
-                CurrentWorkerContext.removeAttribute(ContainerConstants.PORTLET);
-                CurrentWorkerContext.removeAttribute(ContainerConstants.PORTLET_CONFIG);
-                CurrentWorkerContext.removeAttribute(ContainerConstants.PORTLET_REQUEST);
-                CurrentWorkerContext.removeAttribute(ContainerConstants.PORTLET_RESPONSE);
-                CurrentWorkerContext.removeAttribute(ContainerConstants.METHOD_ID);
-                CurrentWorkerContext.removeAttribute(ContainerConstants.PORTLET_NAME);
-                CurrentWorkerContext.removeAttribute(ContainerConstants.PORTAL_CONTEXT);
-            }
-
-            servletRequest.removeAttribute(ContainerConstants.PORTLET);
-            servletRequest.removeAttribute(ContainerConstants.PORTLET_CONFIG);
-            servletRequest.removeAttribute(ContainerConstants.PORTLET_REQUEST);
-            servletRequest.removeAttribute(ContainerConstants.PORTLET_RESPONSE);
-            servletRequest.removeAttribute(ContainerConstants.METHOD_ID);
-            servletRequest.removeAttribute(ContainerConstants.PORTLET_NAME);
-            servletRequest.removeAttribute(ContainerConstants.PORTAL_CONTEXT);
+            ((JetspeedRequestContext)window.getRequestContext()).setCurrentPortletWindow(null);
         }
-
     }
-
-}
+}
\ No newline at end of file

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedFilterManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedFilterManager.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedFilterManager.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedFilterManager.java Wed Mar 25 03:24:47 2009
@@ -34,7 +34,7 @@
 import org.apache.jetspeed.om.portlet.Filter;
 import org.apache.jetspeed.om.portlet.FilterMapping;
 import org.apache.jetspeed.om.portlet.PortletApplication;
-import org.apache.pluto.container.FilterManager;
+import org.apache.jetspeed.container.FilterManager;
 
 public class JetspeedFilterManager implements FilterManager
 {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedFilterManagerService.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedFilterManagerService.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedFilterManagerService.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/services/JetspeedFilterManagerService.java Wed Mar 25 03:24:47 2009
@@ -18,7 +18,7 @@
 
 import org.apache.jetspeed.factory.PortletFactory;
 import org.apache.jetspeed.om.portlet.PortletApplication;
-import org.apache.pluto.container.FilterManager;
+import org.apache.jetspeed.container.FilterManager;
 import org.apache.pluto.container.FilterManagerService;
 import org.apache.pluto.container.om.portlet.PortletApplicationDefinition;
 
@@ -36,5 +36,4 @@
     {
         return new JetspeedFilterManager(this.portletFactory, (PortletApplication) portletAppDD, portletName, lifeCycle);
     }
-    
 }

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=758134&r1=758133&r2=758134&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 Wed Mar 25 03:24:47 2009
@@ -29,7 +29,6 @@
 import org.apache.jetspeed.container.url.BasePortalURL;
 import org.apache.jetspeed.desktop.JetspeedDesktop;
 import org.apache.jetspeed.container.PortletWindow;
-import org.apache.jetspeed.container.PortletEntity;
 
 /**
  * DesktopEncodingPortalURL encodes action URLs to target desktop specific /action pipeline,
@@ -186,9 +185,8 @@
         {
         	if ( ! desktopRequestNotAjax )
             {
-        		PortletEntity pe = window.getPortletEntity();
-        		buffer.append( "?entity=" ).append( pe.getId() );
-        		buffer.append( "&portlet=" ).append( pe.getPortletDefinition().getUniqueName() );
+                buffer.append( "?entity=" ).append( window.getId().toString() );
+                buffer.append( "&portlet=" ).append( window.getPortletDefinition().getUniqueName() );
             }
         }
         else

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationValve.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationValve.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationValve.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/decoration/DecorationValve.java Wed Mar 25 03:24:47 2009
@@ -33,10 +33,7 @@
 import org.apache.jetspeed.cache.CacheElement;
 import org.apache.jetspeed.cache.ContentCacheKey;
 import org.apache.jetspeed.cache.JetspeedContentCache;
-import org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException;
 import org.apache.jetspeed.container.url.PortalURL;
-import org.apache.jetspeed.container.window.FailedToRetrievePortletWindow;
-import org.apache.jetspeed.container.window.PortletWindowAccessor;
 import org.apache.jetspeed.decoration.caches.SessionPathResolverCache;
 import org.apache.jetspeed.om.page.ContentFragment;
 import org.apache.jetspeed.om.page.ContentPage;
@@ -76,8 +73,6 @@
     
     private final DecorationFactory decorationFactory;
 
-    private final PortletWindowAccessor windowAccessor;
-    
     private HashMap decoratorActionsAdapterCache = new HashMap();
     
     private DecoratorActionsFactory defaultDecoratorActionsFactory;
@@ -107,23 +102,22 @@
       */
      protected SecurityAccessController accessController;
 
-     public DecorationValve(DecorationFactory decorationFactory, PortletWindowAccessor windowAccessor,SecurityAccessController accessController)
+     public DecorationValve(DecorationFactory decorationFactory, SecurityAccessController accessController)
      {
-         this(decorationFactory, windowAccessor, accessController, null);
+         this(decorationFactory, accessController, null);
      }
      
-     public DecorationValve(DecorationFactory decorationFactory, PortletWindowAccessor windowAccessor,
+     public DecorationValve(DecorationFactory decorationFactory,
                             SecurityAccessController accessController, JetspeedContentCache cache)
      {    
-         this(decorationFactory, windowAccessor, accessController, cache, false);
+         this(decorationFactory, accessController, cache, false);
      }
      
-     public DecorationValve(DecorationFactory decorationFactory, PortletWindowAccessor windowAccessor,
+     public DecorationValve(DecorationFactory decorationFactory,
                                  SecurityAccessController accessController, JetspeedContentCache cache,
                                  boolean useSessionForThemeCaching)
      {       
         this.decorationFactory = decorationFactory;
-        this.windowAccessor = windowAccessor;
         this.defaultDecoratorActionsFactory = new DefaultDecoratorActionsFactory();        
         //added the accessController in portlet decorater for checking the actions
         this.accessController = accessController;        
@@ -329,23 +323,20 @@
      * @param requestContext RequestContext of the current portal request.
      * @param fragment Fragment to initialize modes and states for.
      * @return
-     * @throws PortletEntityNotStoredException 
-     * @throws FailedToRetrievePortletWindow 
      */
     protected boolean initActionsForFragment(RequestContext requestContext, 
                                              ContentFragment fragment, 
                                              PageActionAccess pageActionAccess, 
                                              Decoration decoration,
-                                             boolean isAjaxRequest) throws FailedToRetrievePortletWindow, PortletEntityNotStoredException
+                                             boolean isAjaxRequest)
     {
         boolean fragmentSupportsActions = false;
-        PortletWindow window = windowAccessor.getPortletWindow(fragment); 
-        PortletDefinition portlet = (PortletDefinition) window.getPortletEntity().getPortletDefinition();
-        
-        if (null == portlet)
+        PortletWindow window = requestContext.getPortletWindow(fragment); 
+        if (window == null)
         {
             return fragmentSupportsActions; // allow nothing
         }
+        PortletDefinition portlet = window.getPortletDefinition();
 
         List actions = Collections.EMPTY_LIST;
         
@@ -362,7 +353,7 @@
         {
             fragmentSupportsActions = true;
             String fragmentId = fragment.getId();
-            PortletApplication pa = (PortletApplication)window.getPortletEntity().getPortletDefinition().getApplication();
+            PortletApplication pa = window.getPortletDefinition().getApplication();
 
             String portletName = portlet.getUniqueName();
 
@@ -474,7 +465,6 @@
      * @param window
      * @param fragment
      * @return <code>java.util.List</code> of modes excluding the current one.
-     * @throws PortletEntityNotStoredException 
      */
     protected List getPageModes(RequestContext requestContext, PortletWindow window, List<Supports> supports, 
                                 PortletMode mode, WindowState state, PageActionAccess pageActionAccess, Decoration decoration,
@@ -509,8 +499,6 @@
                     : portalURL.createPortletURL(window, parameters, PortletMode.VIEW, WindowState.NORMAL, true, portalURL.isSecure()).toString() );
                 pageModes.add(new DecoratorAction(targetMode, requestContext.getLocale(), decoration.getResource("images/" + targetMode + ".gif"), action,DecoratorActionTemplate.ACTION_TYPE_MODE));
                 
-                //window.getPortletEntity().getPortletDefinition().getInitParameterSet().get( "xxxx" );
-                
                 if (supportsPortletMode(supports,PortletMode.HELP))
                 {
                     if ( pageActionAccess.isEditing() )

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/JetspeedServlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/JetspeedServlet.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/JetspeedServlet.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/engine/JetspeedServlet.java Wed Mar 25 03:24:47 2009
@@ -284,7 +284,7 @@
                 }
                 finally
                 {
-                    contextComponent.release(context);
+                    contextComponent.setRequestContext(null);
                 }
             }
 

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/events/EventCoordinationServiceImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/events/EventCoordinationServiceImpl.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/events/EventCoordinationServiceImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/events/EventCoordinationServiceImpl.java Wed Mar 25 03:24:47 2009
@@ -38,11 +38,9 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.jetspeed.JetspeedActions;
-import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.aggregator.PortletTrackingManager;
 import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.container.providers.EventProviderImpl;
-import org.apache.jetspeed.container.window.PortletWindowAccessor;
 import org.apache.jetspeed.om.page.Fragment;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.jetspeed.request.RequestContext;
@@ -71,17 +69,15 @@
 {
     private static Log log = LogFactory.getLog(EventProviderImpl.class);
 
-    private final PortletWindowAccessor windowAccessor;
     private final PortalStatistics statistics;
     private final PortletTrackingManager portletTracking;
     private final SecurityAccessController accessController;
     private boolean checkSecurityConstraints = true;
 
-    public EventCoordinationServiceImpl(final PortletWindowAccessor windowAccessor, final PortletEventQueue eventQueue,
+    public EventCoordinationServiceImpl(final PortletEventQueue eventQueue,
             final PortalStatistics statistics, PortletTrackingManager portletTracking, SecurityAccessController accessController,
             boolean checkSecurityConstraints)
     {
-        this.windowAccessor = windowAccessor;
         this.statistics = statistics;
         this.portletTracking = portletTracking;
         this.accessController = accessController;
@@ -132,10 +128,9 @@
      * @see org.apache.jetspeed.events.JetspeedEventCoordinationService#processEvents(org.apache.pluto.container.PortletContainer, org.apache.pluto.container.PortletWindow, javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse, java.util.List)
      */
     public void processEvents(PortletContainer container, org.apache.pluto.container.PortletWindow wnd,
-                              HttpServletRequest servletRequest, HttpServletResponse response, List<Event> events)
+                              HttpServletRequest servletRequest, HttpServletResponse servletResponse, List<Event> events)
     {
         PortletWindow portletWindow = (PortletWindow)wnd;
-        RequestContext rc = (RequestContext) servletRequest.getAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE);
         long start = System.currentTimeMillis();        
         for (Event portletEvent : events)
         {
@@ -143,16 +138,12 @@
             if (event.isProcessed())
                 continue;
             event.setProcessed(true);
-            List<PortletWindow> windows = getAllPortletsRegisteredForEvent(rc, event);
+            List<PortletWindow> windows = getAllPortletsRegisteredForEvent(portletWindow.getRequestContext(), event);
             for (PortletWindow window : windows)
             {
-                HttpServletRequest request = rc.getRequestForWindow(window);
-                request.setAttribute(PortalReservedParameters.PAGE_ATTRIBUTE, rc.getPage());
-                request.setAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE, rc);
-                request.setAttribute(PortalReservedParameters.REQUEST_CONTEXT_OBJECTS, rc.getObjects());
                 try
                 {
-                    container.doEvent(window, request, rc.getResponseForWindow(window), event);
+                    container.doEvent(window, servletRequest, servletResponse, event);
                 }
                 catch (Exception e)
                 {
@@ -163,13 +154,14 @@
         long end = System.currentTimeMillis();        
         if (statistics != null)
         {
-            statistics.logPortletAccess(rc, portletWindow.getPortletEntity().getPortletDefinition().getUniqueName(), PortalStatistics.HTTP_EVENT, end - start);
+            statistics.logPortletAccess(portletWindow.getRequestContext(), portletWindow.getPortletDefinition().getUniqueName(), 
+                                        PortalStatistics.HTTP_EVENT, end - start);
         }
     }
 
     private boolean isDeclaredAsPublishingEvent(PortletWindow portletWindow, QName qname)
     {
-        PortletDefinition pd = portletWindow.getPortletEntity().getPortletDefinition();
+        PortletDefinition pd = portletWindow.getPortletDefinition();
         List<? extends EventDefinitionReference> events = pd.getSupportedPublishingEvents();
         if (events != null)
         {
@@ -189,7 +181,7 @@
 
     private boolean isValueInstanceOfDefinedClass(PortletWindow portletWindow, QName qname, Serializable value)
     {
-        PortletApplicationDefinition app = portletWindow.getPortletEntity().getPortletDefinition().getApplication();
+        PortletApplicationDefinition app = portletWindow.getPortletDefinition().getApplication();
         List<? extends EventDefinition> events = app.getEventDefinitions();
         if (events != null)
         {
@@ -213,24 +205,24 @@
     {
         Fragment root = rc.getPage().getRootFragment();
         List<PortletWindow> eventTargets = new LinkedList<PortletWindow>();
-        return getPortletsRegisteredOnPage(root, event, eventTargets);
+        return getPortletsRegisteredOnPage(rc, root, event, eventTargets);
     }
 
-    private List<PortletWindow> getPortletsRegisteredOnPage(Fragment fragment, Event event, List<PortletWindow> eventTargets)
+    private List<PortletWindow> getPortletsRegisteredOnPage(RequestContext rc, Fragment fragment, Event event, List<PortletWindow> eventTargets)
     {
         List<Fragment> fragments = fragment.getFragments();
         if (fragments != null && fragments.size() > 0)
         {
             for (Fragment child : fragments)
             {
-                getPortletsRegisteredOnPage(child, event, eventTargets);
+                getPortletsRegisteredOnPage(rc, child, event, eventTargets);
             }
         }
-        PortletWindow portletWindow = windowAccessor.getPortletWindow(fragment.getId());
+        PortletWindow portletWindow = rc.getPortletWindow(fragment.getId());
         if (portletWindow == null)
             return eventTargets;
 
-        PortletDefinition portlet = portletWindow.getPortletEntity().getPortletDefinition();
+        PortletDefinition portlet = portletWindow.getPortletDefinition();
 
         if (checkSecurityConstraints && !checkSecurityConstraint(portlet, fragment)) 
         {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/ChangePortletAction.java Wed Mar 25 03:24:47 2009
@@ -31,7 +31,6 @@
 import org.apache.jetspeed.ajax.AjaxAction;
 import org.apache.jetspeed.ajax.AjaxBuilder;
 import org.apache.jetspeed.container.state.MutableNavigationalState;
-import org.apache.jetspeed.container.window.PortletWindowAccessor;
 import org.apache.jetspeed.decoration.PageActionAccess;
 import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
 import org.apache.jetspeed.om.page.ContentFragment;
@@ -60,28 +59,24 @@
     protected String action;
     protected Map validWindowStates = new HashMap();
     protected Map validPortletModes = new HashMap();
-    protected PortletWindowAccessor windowAccessor;
     
     public ChangePortletAction(String template, 
             String errorTemplate, 
-            String action,
-            PortletWindowAccessor windowAccessor)            
+            String action)            
     throws AJAXException    
     {
-        this(template, errorTemplate, action, null, windowAccessor, null);
+        this(template, errorTemplate, action, null, null);
     }
     
     public ChangePortletAction(String template, 
                              String errorTemplate, 
                              String action,
                              PageManager pageManager,
-                             PortletWindowAccessor windowAccessor,                             
                              PortletActionSecurityBehavior securityBehavior)
     throws AJAXException
     {
         super(template, errorTemplate, pageManager, securityBehavior);
         this.action = action;
-        this.windowAccessor = windowAccessor;
         
         // Build the maps of allowed (internal) modes and states
         Iterator modes = JetspeedActions.getStandardPortletModes().iterator();        
@@ -157,13 +152,19 @@
             		throw new Exception( "cannot change action for root layout fragment due to null PageActionAccess object" );
             	}
             	//pageActionAccess.
-            	PortletWindow window = windowAccessor.getPortletWindow(fragment);
+            	PortletWindow window = requestContext.getPortletWindow(fragment);
+            	if (window == null)
+            	{
+            	    throw new Exception("Portlet Window creation failed for fragment: "+ fragment.getId() + ", " + fragment.getName());
+            	}
             	PortletMode currentMode = requestContext.getPortalURL().getNavigationalState().getMode( window );
             	WindowState currentState = requestContext.getPortalURL().getNavigationalState().getState( window );
             	
             	boolean requestedModeAlreadySet = false;
             	if ( requestedMode == null )
+            	{
             		requestedModeAlreadySet = true;
+            	}
             	else
             	{
             		if ( requestedMode.equals( PortletMode.EDIT.toString() ) )
@@ -226,7 +227,7 @@
 	            
 	            // Now Change the transient navigational state
 	            MutableNavigationalState navState = (MutableNavigationalState)requestContext.getPortalURL().getNavigationalState();
-	            PortletWindow portletWindow = windowAccessor.getPortletWindow(fragment);
+	            PortletWindow portletWindow = requestContext.getPortletWindow(fragment);
 	            if (portletWindow != null)
 	            {
 	                oldState = navState.getState(portletWindow).toString();

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/layout/impl/UpdatePageAction.java Wed Mar 25 03:24:47 2009
@@ -25,10 +25,6 @@
 import org.apache.jetspeed.ajax.AJAXException;
 import org.apache.jetspeed.ajax.AjaxAction;
 import org.apache.jetspeed.ajax.AjaxBuilder;
-import org.apache.jetspeed.components.portletentity.PortletEntityAccessComponent;
-import org.apache.jetspeed.components.portletentity.PortletEntityNotStoredException;
-import org.apache.jetspeed.container.window.FailedToRetrievePortletWindow;
-import org.apache.jetspeed.container.window.PortletWindowAccessor;
 import org.apache.jetspeed.layout.PortletActionSecurityBehavior;
 import org.apache.jetspeed.om.folder.Folder;
 import org.apache.jetspeed.om.page.ContentFragment;
@@ -38,7 +34,6 @@
 import org.apache.jetspeed.page.PageManager;
 import org.apache.jetspeed.page.document.Node;
 import org.apache.jetspeed.request.RequestContext;
-import org.apache.jetspeed.container.PortletWindow;
 
 /**
  * Update Page action -- updates various parts of the PSML page
@@ -66,20 +61,14 @@
     implements AjaxAction, AjaxBuilder, Constants
 {
     protected Log log = LogFactory.getLog(UpdatePageAction.class);
-    protected PortletWindowAccessor windowAccess;
-    protected PortletEntityAccessComponent entityAccess;
     
     public UpdatePageAction(String template, 
                             String errorTemplate, 
                             PageManager pm,
-                            PortletWindowAccessor windowAccess,
-                            PortletEntityAccessComponent entityAccess,
                             PortletActionSecurityBehavior securityBehavior)                            
                             
     {
         super(template, errorTemplate, pm, securityBehavior);
-        this.windowAccess = windowAccess;
-        this.entityAccess = entityAccess;
     }
     
     public boolean run(RequestContext requestContext, Map resultMap)
@@ -255,7 +244,6 @@
     }
     
     protected int updatePortletDecorator(RequestContext requestContext, Map resultMap, Page page, String fragmentId, String portletDecorator)
-    throws PortletEntityNotStoredException, FailedToRetrievePortletWindow
     {
     	int count = 0;
     	Fragment fragment = page.getFragmentById(fragmentId);
@@ -268,7 +256,6 @@
     }
     
     protected int updateFragment(RequestContext requestContext, Map resultMap, Page page, String fragmentId, String layout)
-    throws PortletEntityNotStoredException, FailedToRetrievePortletWindow
     {
         int count = 0;
         String sizes = getActionParameter(requestContext, SIZES);
@@ -278,24 +265,17 @@
             if (!layout.equals(fragment.getName()))
             {
                 fragment.setName(layout);
-                ContentFragment contentFragment = new ContentFragmentImpl(fragment, new HashMap());                    
-                PortletWindow window = windowAccess.getPortletWindow(contentFragment);
-                if (window != null)
+                ContentFragment contentFragment = new ContentFragmentImpl(fragment, new HashMap());
+                count++;
+                if ( isBlank(sizes) )
                 {
-                    entityAccess.updatePortletEntity(window.getPortletEntity(), contentFragment);
-                    entityAccess.storePortletEntity(window.getPortletEntity());
-                    windowAccess.createPortletWindow(window.getPortletEntity(), contentFragment.getId());
-                    count++;
-                    if ( isBlank(sizes) )
-                    {
-                        fragment.setLayoutSizes(null);
-                    }
-                    else
-                    {
-                        fragment.setLayoutSizes(sizes);
-                    }
-                    count++;
+                    fragment.setLayoutSizes(null);
+                }
+                else
+                {
+                    fragment.setLayoutSizes(sizes);
                 }
+                count++;
             }
             else
             {

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginServlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginServlet.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginServlet.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/login/LoginServlet.java Wed Mar 25 03:24:47 2009
@@ -81,7 +81,7 @@
             {
                 if (contextComponent != null)
                 {
-                    contextComponent.release(context);
+                    contextComponent.setRequestContext(null);
                 }
             }
         }

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java?rev=758134&r1=758133&r2=758134&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/pipeline/valve/impl/ActionValveImpl.java Wed Mar 25 03:24:47 2009
@@ -18,8 +18,6 @@
 
 import java.io.IOException;
 import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
 
 import javax.portlet.PortletException;
 import javax.servlet.http.HttpServletRequest;
@@ -30,16 +28,11 @@
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.cache.ContentCacheKey;
 import org.apache.jetspeed.cache.JetspeedContentCache;
-import org.apache.jetspeed.container.PortletEntity;
 import org.apache.jetspeed.container.PortletWindow;
-import org.apache.jetspeed.container.state.MutableNavigationalState;
-import org.apache.jetspeed.container.window.PortletWindowAccessor;
 import org.apache.jetspeed.exception.JetspeedException;
 import org.apache.jetspeed.om.page.ContentFragment;
-import org.apache.jetspeed.om.page.ContentFragmentImpl;
 import org.apache.jetspeed.om.page.ContentPage;
-import org.apache.jetspeed.om.page.Fragment;
-import org.apache.jetspeed.om.page.Page;
+import org.apache.jetspeed.om.portlet.LocalizedField;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
 import org.apache.jetspeed.pipeline.PipelineException;
 import org.apache.jetspeed.pipeline.valve.AbstractValve;
@@ -68,21 +61,18 @@
 
     private static final Log log = LogFactory.getLog(ActionValveImpl.class);
     private PortletContainer container;
-    private PortletWindowAccessor windowAccessor;
     private boolean patchResponseCommitted = false;
     private JetspeedContentCache portletContentCache;
 
-    public ActionValveImpl(PortletContainer container, PortletWindowAccessor windowAccessor, JetspeedContentCache portletContentCache)
+    public ActionValveImpl(PortletContainer container, JetspeedContentCache portletContentCache)
     {
         this.container = container;
-        this.windowAccessor = windowAccessor;
         this.portletContentCache = portletContentCache;
     }
     
-    public ActionValveImpl(PortletContainer container, PortletWindowAccessor windowAccessor, JetspeedContentCache portletContentCache, boolean patchResponseCommitted)
+    public ActionValveImpl(PortletContainer container, JetspeedContentCache portletContentCache, boolean patchResponseCommitted)
     {
         this.container = container;
-        this.windowAccessor = windowAccessor;
         this.portletContentCache = portletContentCache;        
         this.patchResponseCommitted = patchResponseCommitted;
     }
@@ -98,61 +88,14 @@
             PortletWindow actionWindow = request.getActionWindow();
             if (actionWindow != null)
             {
-                // If portlet entity is null, try to refresh the actionWindow.
-                // Under some clustered environments, a cached portlet window could have null entity.
-                if (null == actionWindow.getPortletEntity())
-                {
-                    try 
-                    {
-                        Fragment fragment = request.getPage().getFragmentById(actionWindow.getId().toString());
-                        
-                        if (fragment != null)
-                        {
-                            ContentFragment contentFragment = new ContentFragmentImpl(fragment, new HashMap());
-                            actionWindow = this.windowAccessor.getPortletWindow(contentFragment);
-                        }
-                    } 
-                    catch (Exception e)
-                    {
-                        log.error("Failed to refresh action window.", e);
-                    }
-                }
-                
-                if (actionWindow.getPortletEntity() == null)
-                {
-                    // a session is expired and the target actionWindow doesn't have portlet entity.
-                    // Redirect the user back to the target page (with possibly retaining the other windows navigational state).
-                    log.warn("Portlet action was canceled because the session was expired. The actionWindow's id is " + actionWindow.getId());
-                    
-                    request.setActionWindow(null);
-                    MutableNavigationalState state = (MutableNavigationalState) request.getPortalURL().getNavigationalState();
-                    
-                    if (state != null)
-                    {
-                        state.removeState(actionWindow);
-                        state.sync(request);
-                        request.getResponse().sendRedirect(request.getPortalURL().getPortalURL());
-                        return;
-                    }
-                }
-
-                initWindow(actionWindow, request);
-                HttpServletResponse response = request.getResponseForWindow(actionWindow);
-                HttpServletRequest requestForWindow = request.getRequestForWindow(actionWindow);
-                requestForWindow.setAttribute(PortalReservedParameters.REQUEST_CONTEXT_ATTRIBUTE, request);
-                
-                //PortletMessagingImpl msg = new PortletMessagingImpl(windowAccessor);
+                HttpServletRequest servletRequest = request.getRequest();
+                HttpServletResponse serlvetResponse = request.getResponse();
                 
-                requestForWindow.setAttribute("JETSPEED_ACTION", request);
-                container.doAction(
-                    actionWindow,
-                    requestForWindow,
-                    response);
+                actionWindow.setAttribute("JETSPEED_ACTION", request);
+                container.doAction(actionWindow,servletRequest,serlvetResponse);
                 // The container redirects the client after PortletAction processing
                 // so there is no need to continue the pipeline
                 
-                //msg.processActionMessage("todo", request);
-                
                 // clear the cache for all portlets on the current page
                 clearPortletCacheForPage(request, actionWindow);
                 
@@ -162,7 +105,7 @@
                 }
                 else
                 {
-                    responseCommitted = response.isCommitted();
+                    responseCommitted = serlvetResponse.isCommitted();
                 }
                 request.setAttribute(PortalReservedParameters.PIPELINE, null); // clear the pipeline
             }
@@ -228,7 +171,7 @@
             
             // if the fragment is rendered from a decorator template, the target cache would not be cleared by the above notification.
             // so, let's clear target cache of action window directly again.
-            String fragmentId = actionWindow.getId().toString();
+            String fragmentId = actionWindow.getWindowId();
             if (page.getFragmentById(fragmentId) == null)
             {
                 clearTargetCache(fragmentId, request);
@@ -236,7 +179,7 @@
         }
         else
         {
-            ContentFragment fragment = page.getContentFragmentById(actionWindow.getId().toString());
+            ContentFragment fragment = page.getContentFragmentById(actionWindow.getWindowId());
             
             if (fragment != null)
             {
@@ -260,24 +203,11 @@
      */    
     protected boolean isNonStandardAction(PortletWindow actionWindow)
     {
-        PortletEntity entity = actionWindow.getPortletEntity();
-        if (entity != null)
+        PortletDefinition portletDefinition = actionWindow.getPortletDefinition();
+        Collection<LocalizedField> actionList = portletDefinition.getMetadata().getFields(PortalReservedParameters.PORTLET_EXTENDED_DESCRIPTOR_NON_STANDARD_ACTION);
+        if (actionList != null && !actionList.isEmpty()) 
         {
-            PortletDefinition portletDefinition = (PortletDefinition)entity.getPortletDefinition();
-            if (portletDefinition != null)
-            {
-                Collection actionList = null;
-        
-                if (portletDefinition != null)
-                {
-                    actionList = portletDefinition.getMetadata().getFields(PortalReservedParameters.PORTLET_EXTENDED_DESCRIPTOR_NON_STANDARD_ACTION);
-                }
-                if (actionList != null) 
-                {
-                    if (!actionList.isEmpty())
-                        return true;
-                }
-            }
+            return true;
         }
         return false;
     }
@@ -286,15 +216,13 @@
     {
         if (f.getContentFragments() != null && f.getContentFragments().size() > 0)
         {
-            Iterator children = f.getContentFragments().iterator();
-            while (children.hasNext())
+            for (Object child : f.getContentFragments())
             {
-                ContentFragment child = (ContentFragment) children.next();
                 if (!"hidden".equals(f.getState()))
                 {
-                    notifyFragments(child, context, page);
+                    notifyFragments((ContentFragment)child, context, page);
                 }
-            } 
+            }
         }    
         ContentCacheKey cacheKey = portletContentCache.createCacheKey(context, f.getId());
         if (portletContentCache.isKeyInCache(cacheKey))
@@ -328,22 +256,4 @@
         // TODO Auto-generated method stub
         return "ActionValveImpl";
     }
-    
-    /**
-     * Makes sure that this PortletWindow's PortletEntity is set to have the
-     * current requests fragment.
-     * @param window
-     * @param request
-     */
-    protected void initWindow(PortletWindow window, RequestContext request)
-    {
-        Page page = request.getPage();
-        Fragment fragment = page.getFragmentById(window.getId().toString());
-        
-        if (fragment != null)
-        {
-            window.getPortletEntity().setFragment(fragment);
-        }
-    }
-
 }



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