You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by at...@apache.org on 2009/03/30 23:08:38 UTC

svn commit: r760174 - in /portals/jetspeed-2/portal/trunk: components/jetspeed-portal/src/main/java/org/apache/jetspeed/ jetspeed-commons/src/main/java/org/apache/jetspeed/container/ jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/

Author: ate
Date: Mon Mar 30 21:08:37 2009
New Revision: 760174

URL: http://svn.apache.org/viewvc?rev=760174&view=rev
Log:
Fixing the ServletContextProviderImpl and PortalRequestContext callback access to the currently (threadlocal) processed PortletApplication

Removed:
    portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/container/PortletRequestContext.java
Modified:
    portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/JetspeedPortalContext.java
    portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/ServletContextProviderImpl.java

Modified: portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/JetspeedPortalContext.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/JetspeedPortalContext.java?rev=760174&r1=760173&r2=760174&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/JetspeedPortalContext.java (original)
+++ portals/jetspeed-2/portal/trunk/components/jetspeed-portal/src/main/java/org/apache/jetspeed/JetspeedPortalContext.java Mon Mar 30 21:08:37 2009
@@ -26,9 +26,8 @@
 import javax.portlet.WindowState;
 
 import org.apache.jetspeed.administration.PortalConfiguration;
-import org.apache.jetspeed.container.PortletRequestContext;
+import org.apache.jetspeed.container.PortletWindow;
 import org.apache.jetspeed.engine.Engine;
-import org.apache.jetspeed.om.portlet.PortletApplication;
 
 /**
  * Implementation of Portal Context associated with running thread of the engine
@@ -220,11 +219,10 @@
     
     private Collection getSupportedModes()
     {
-        PortletRequestContext ctx = PortletRequestContext.getContext();
-        if ( ctx != null )
+        PortletWindow window = Jetspeed.getCurrentRequestContext().getCurrentPortletWindow();
+        if (window != null)
         {
-            PortletApplication pa = ((PortletApplication)ctx.getPortletDefinition().getApplication());
-            return pa.getSupportedPortletModes();
+            return window.getPortletDefinition().getApplication().getSupportedPortletModes();
         }
         return JetspeedActions.getStandardPortletModes();
     }
@@ -244,11 +242,10 @@
 
     private Collection getSupportedStates()
     {
-        PortletRequestContext ctx = PortletRequestContext.getContext();
-        if ( ctx != null )
+        PortletWindow window = Jetspeed.getCurrentRequestContext().getCurrentPortletWindow();
+        if (window != null)
         {
-            PortletApplication pa = ((PortletApplication)ctx.getPortletDefinition().getApplication());
-            return pa.getSupportedWindowStates();
+            return window.getPortletDefinition().getApplication().getSupportedWindowStates();
         }
         return JetspeedActions.getStandardWindowStates();
     }

Modified: portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/ServletContextProviderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/ServletContextProviderImpl.java?rev=760174&r1=760173&r2=760174&view=diff
==============================================================================
--- portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/ServletContextProviderImpl.java (original)
+++ portals/jetspeed-2/portal/trunk/jetspeed-commons/src/main/java/org/apache/jetspeed/portlet/ServletContextProviderImpl.java Mon Mar 30 21:08:37 2009
@@ -23,9 +23,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.jetspeed.Jetspeed;
 import org.apache.jetspeed.container.JetspeedPortletContext;
-import org.apache.pluto.container.PortletInvokerService;
-import org.apache.pluto.container.PortletRequestContext;
 import org.apache.portals.bridges.common.ServletContextProvider;
 
 /**
@@ -36,10 +35,6 @@
  */
 public class ServletContextProviderImpl implements ServletContextProvider 
 {
-    private PortletRequestContext getRequestContext(PortletRequest request)
-    {
-        return ((PortletRequestContext)request.getAttribute(PortletInvokerService.REQUEST_CONTEXT));
-    }
     public ServletContext getServletContext(GenericPortlet portlet) 
     {
         return ((JetspeedPortletContext)portlet.getPortletContext()).getServletContext();
@@ -47,11 +42,11 @@
 
     public HttpServletRequest getHttpServletRequest(GenericPortlet portlet, PortletRequest request) 
     {
-        return getRequestContext(request).getServletRequest();
+        return Jetspeed.getCurrentRequestContext().getCurrentPortletWindow().getPortletRequestContext().getServletRequest();
     }
 
     public HttpServletResponse getHttpServletResponse(GenericPortlet portlet, PortletResponse response) 
     {
-        return getRequestContext(org.apache.jetspeed.container.PortletRequestContext.getContext().getRequest()).getServletResponse();
+        return Jetspeed.getCurrentRequestContext().getCurrentPortletWindow().getPortletRequestContext().getServletResponse();
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org