portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject svn commit: r713326 - in /portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade: components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/ jetspeed-commons/src/main/java/org/apache/jetspeed/container/
Date Wed, 12 Nov 2008 09:14:05 GMT
Author: ate
Date: Wed Nov 12 01:14:03 2008
New Revision: 713326

URL: http://svn.apache.org/viewvc?rev=713326&view=rev
Log:
Fix for requirement of Pluto PorletRequestImpl to be initialized before usage.
NB: not yet sure this actually is/would be needed at Pluto side (commenting out the check
there seems also to work)

Modified:
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java
    portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java?rev=713326&r1=713325&r2=713326&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/invoker/LocalPortletInvoker.java
Wed Nov 12 01:14:03 2008
@@ -29,6 +29,8 @@
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
 
 import org.apache.jetspeed.PortalReservedParameters;
 import org.apache.jetspeed.container.ContainerConstants;
@@ -38,6 +40,7 @@
 import org.apache.jetspeed.om.portlet.PortletApplication;
 import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.om.portlet.PortletDefinition;
+import org.apache.pluto.internal.InternalPortletRequest;
 import org.apache.pluto.spi.FilterManager;
 
 /**
@@ -117,7 +120,7 @@
         {
             return;
         }
-        ServletRequest servletRequest = ((javax.servlet.http.HttpServletRequestWrapper) portletRequest).getRequest();
+        HttpServletRequest servletRequest = (HttpServletRequest)((HttpServletRequestWrapper)
portletRequest).getRequest();
         ClassLoader oldLoader = Thread.currentThread().getContextClassLoader();
         try
         {
@@ -132,6 +135,8 @@
                     .setAttribute(ContainerConstants.PORTAL_CONTEXT, requestContext.getRequest().getContextPath());
 
             Thread.currentThread().setContextClassLoader(paClassLoader);
+            
+            ((InternalPortletRequest)portletRequest).init(portletInstance.getConfig().getPortletContext(),
servletRequest);
 
             if (method == ContainerConstants.METHOD_ACTION)
             {

Modified: portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java?rev=713326&r1=713325&r2=713326&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java
(original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/jetspeed-commons/src/main/java/org/apache/jetspeed/container/JetspeedContainerServlet.java
Wed Nov 12 01:14:03 2008
@@ -26,7 +26,6 @@
 
 import javax.portlet.ActionRequest;
 import javax.portlet.ActionResponse;
-import javax.portlet.Portlet;
 import javax.portlet.RenderRequest;
 import javax.portlet.RenderResponse;
 import javax.portlet.UnavailableException;
@@ -40,12 +39,14 @@
 import javax.servlet.http.HttpServletResponse;
 
 import org.apache.jetspeed.container.session.PortalSessionsManager;
+import org.apache.jetspeed.factory.PortletInstance;
 import org.apache.jetspeed.request.RequestContext;
 import org.apache.jetspeed.services.JetspeedPortletServices;
 import org.apache.jetspeed.services.PortletServices;
 import org.apache.jetspeed.tools.pamanager.PortletApplicationManagement;
 import org.apache.jetspeed.util.DirectoryHelper;
 import org.apache.jetspeed.aggregator.CurrentWorkerContext;
+import org.apache.pluto.internal.InternalPortletRequest;
 
 /**
  * Jetspeed Container entry point.
@@ -216,7 +217,7 @@
     {
         String portletName = null;
         Integer method = ContainerConstants.METHOD_NOOP;
-        Portlet portlet = null;
+        PortletInstance portlet = null;
         boolean destroyPortlet = false;
         boolean isParallelMode = false;
         
@@ -238,12 +239,12 @@
             }
             if (isParallelMode)
             {
-                portlet = (Portlet) CurrentWorkerContext.getAttribute(ContainerConstants.PORTLET);
+                portlet = (PortletInstance) CurrentWorkerContext.getAttribute(ContainerConstants.PORTLET);
                 portletName = (String) CurrentWorkerContext.getAttribute(ContainerConstants.PORTLET_NAME);
             }
             else
             {
-                portlet = (Portlet)request.getAttribute(ContainerConstants.PORTLET);
+                portlet = (PortletInstance)request.getAttribute(ContainerConstants.PORTLET);
                 portletName = (String)request.getAttribute(ContainerConstants.PORTLET_NAME);
                 request.removeAttribute(ContainerConstants.PORTLET);
             }
@@ -252,9 +253,9 @@
             {
                 ActionRequest actionRequest = (ActionRequest) request.getAttribute(ContainerConstants.PORTLET_REQUEST);
                 ActionResponse actionResponse = (ActionResponse) request.getAttribute(ContainerConstants.PORTLET_RESPONSE);
-                // TODO: 2.2 actionRequest.init(, request);                
+                ((InternalPortletRequest)actionRequest).init(portlet.getConfig().getPortletContext(),
request);
                 // inject the current request into the actionRequest handler (o.a.j.engine.servlet.ServletRequestImpl)
-                ((HttpServletRequestWrapper)((HttpServletRequestWrapper)actionRequest).getRequest()).setRequest(request);
+//                ((HttpServletRequestWrapper)((HttpServletRequestWrapper)actionRequest).getRequest()).setRequest(request);
                 portlet.processAction(actionRequest, actionResponse);
             }
             else if (method == ContainerConstants.METHOD_RENDER)
@@ -273,9 +274,9 @@
                     renderResponse = (RenderResponse) request.getAttribute(ContainerConstants.PORTLET_RESPONSE);
 
                 }
-                // TODO: 2.2 renderRequest.init(, request);               
                 // inject the current request into the renderRequest handler (o.a.j.engine.servlet.ServletRequestImpl)
-                ((HttpServletRequestWrapper)((HttpServletRequestWrapper)renderRequest).getRequest()).setRequest(request);
+                ((InternalPortletRequest)renderRequest).init(portlet.getConfig().getPortletContext(),
request);
+//                ((HttpServletRequestWrapper)((HttpServletRequestWrapper)renderRequest).getRequest()).setRequest(request);
                 portlet.render(renderRequest, renderResponse);
             }
 



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