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 2008/11/21 17:00:14 UTC
svn commit: r719613 - in
/portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade:
components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/
jetspeed-commons/src/main/java/org/apache/jetspeed/container/
Author: ate
Date: Fri Nov 21 08:00:10 2008
New Revision: 719613
URL: http://svn.apache.org/viewvc?rev=719613&view=rev
Log:
Adjust portlet invoker handling to latest Pluto changes (which were needed to be TCK 2.0 compliance)
Modified:
portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.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/providers/PortletURLProviderImpl.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/providers/PortletURLProviderImpl.java?rev=719613&r1=719612&r2=719613&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java (original)
+++ portals/jetspeed-2/portal/branches/JS2-871-pluto-2.0-upgrade/components/jetspeed-portal/src/main/java/org/apache/jetspeed/container/providers/PortletURLProviderImpl.java Fri Nov 21 08:00:10 2008
@@ -44,6 +44,7 @@
private boolean secure = false;
private Map<String, String[]> privateParameters = null;
private Map<String, String[]> publicParameters = null;
+ private Map<String, String[]> requestParameters = null;
private boolean resource = false;
private PortalURL url;
@@ -132,14 +133,12 @@
public Map<String, String[]> getRenderParameters()
{
- if (this.privateParameters == null)
- this.privateParameters = new HashMap<String, String[]>();
- return this.privateParameters;
+ return this.requestParameters;
}
public Map<String, String[]> parseRenderParameters(Map<String, String[]> parentMap, String queryString)
{
- return this.privateParameters;
+ return this.requestParameters = parentMap;
}
}
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=719613&r1=719612&r2=719613&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 Fri Nov 21 08:00:10 2008
@@ -26,6 +26,7 @@
import javax.portlet.ActionRequest;
import javax.portlet.ActionResponse;
+import javax.portlet.PortletRequest;
import javax.portlet.RenderRequest;
import javax.portlet.RenderResponse;
import javax.portlet.UnavailableException;
@@ -35,6 +36,7 @@
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletRequestWrapper;
import javax.servlet.http.HttpServletResponse;
import org.apache.jetspeed.container.session.PortalSessionsManager;
@@ -55,6 +57,7 @@
*/
public class JetspeedContainerServlet extends HttpServlet
{
+ private static final long serialVersionUID = -7900846019170204195L;
private String contextName;
private boolean started = false;
private Timer startTimer = null;
@@ -236,6 +239,12 @@
{
return;
}
+ // Inject the current webcontainer provided request *above* the PortletRequest wrapped Jetspeed portlet specific servletRequest (o.a.j.engine.servlet.ServletRequestImpl).
+ // This makes it possible to access the path encoded portlet parameters using the servlet.getParameterMap() which the jetspeed servlet takes care of.
+ // Injecting the webcontainer provided request *above* it is needed to ensure the "cross-context" specific state and handling is still provided correctly
+ PortletRequest portletRequest = (PortletRequest)request.getAttribute(ContainerConstants.PORTLET_REQUEST);
+ HttpServletRequestWrapper jetspeedServletWrapper = (HttpServletRequestWrapper)((HttpServletRequestWrapper)portletRequest).getRequest();
+ jetspeedServletWrapper.setRequest(request);
if (isParallelMode)
{
portlet = (PortletInstance) CurrentWorkerContext.getAttribute(ContainerConstants.PORTLET);
@@ -252,10 +261,8 @@
{
ActionRequest actionRequest = (ActionRequest) request.getAttribute(ContainerConstants.PORTLET_REQUEST);
ActionResponse actionResponse = (ActionResponse) request.getAttribute(ContainerConstants.PORTLET_RESPONSE);
- ((InternalPortletRequest)actionRequest).init(portlet.getConfig().getPortletContext(), request);
- ((InternalPortletRequest)actionRequest).setIncluded(true);
- // inject the current request into the actionRequest handler (o.a.j.engine.servlet.ServletRequestImpl)
-// ((HttpServletRequestWrapper)((HttpServletRequestWrapper)actionRequest).getRequest()).setRequest(request);
+ ((InternalPortletRequest)actionRequest).init(portlet.getConfig().getPortletContext(), jetspeedServletWrapper);
+ ((InternalPortletRequest)actionRequest).setIncluded(true);
portlet.processAction(actionRequest, actionResponse);
}
else if (method == ContainerConstants.METHOD_RENDER)
@@ -274,9 +281,7 @@
renderResponse = (RenderResponse) request.getAttribute(ContainerConstants.PORTLET_RESPONSE);
}
- // inject the current request into the renderRequest handler (o.a.j.engine.servlet.ServletRequestImpl)
- ((InternalPortletRequest)renderRequest).init(portlet.getConfig().getPortletContext(), request);
-// ((HttpServletRequestWrapper)((HttpServletRequestWrapper)renderRequest).getRequest()).setRequest(request);
+ ((InternalPortletRequest)renderRequest).init(portlet.getConfig().getPortletContext(), jetspeedServletWrapper);
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