Author: julien(a)jboss.com
Date: 2008-04-19 10:21:09 -0400 (Sat, 19 Apr 2008)
New Revision: 10652
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletController.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletControllerContext.java
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/AbstractPortletControllerContext.java
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerContextSupport.java
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PortalRenderResponse.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractClientContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractRendererContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RendererContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RendererContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKRendererContext.java
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/controller/StateControllerContextTestCase.java
Log:
refactor portlet window rendition code into the portlet controller so it can be reused
easily
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletController.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletController.java 2008-04-19
02:00:15 UTC (rev 10651)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletController.java 2008-04-19
14:21:09 UTC (rev 10652)
@@ -24,11 +24,23 @@
package org.jboss.portal.portlet.controller;
import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.controller.request.ControllerRequest;
import org.jboss.portal.portlet.controller.request.PortletRequest;
import org.jboss.portal.portlet.controller.request.PortletResourceRequest;
import org.jboss.portal.portlet.controller.response.ControllerResponse;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import javax.servlet.http.Cookie;
+import java.util.Map;
+import java.util.List;
+
/**
* <p>The portlet controller which handles the page state management and the
interactions between the action phase and the
* event phase. It really only does that and not more.</p>
@@ -166,4 +178,61 @@
//
return handler.handle(controllerContext, controllerRequest);
}
+
+ public PortletInvocationResponse render(
+ PortletControllerContext controllerContext,
+ List<Cookie> cookies,
+ PortletPageNavigationalState pageNavigationalState,
+ String windowId) throws PortletInvokerException
+ {
+ PortletWindowNavigationalState windowNS = null;
+ if (pageNavigationalState != null)
+ {
+ windowNS = pageNavigationalState.getPortletWindowNavigationalState(windowId);
+ }
+
+ //
+ Map<String, String[]> publicNS = null;
+ if (pageNavigationalState != null)
+ {
+ publicNS = pageNavigationalState.getPortletPublicNavigationalState(windowId);
+ }
+
+ //
+ Mode mode = Mode.VIEW;
+ WindowState windowState = WindowState.NORMAL;
+ StateString portletNS = null;
+
+ //
+ if (windowNS != null)
+ {
+ if (windowNS.getMode() != null)
+ {
+ mode = windowNS.getMode();
+ }
+ if (windowNS.getWindowState() != null)
+ {
+ windowState = windowNS.getWindowState();
+ }
+ if (windowNS.getPortletNavigationalState() != null)
+ {
+ portletNS = windowNS.getPortletNavigationalState();
+ }
+ }
+
+ //
+ PortletInvocationContext renderContext =
controllerContext.createPortletInvocationContext(windowId, pageNavigationalState);
+
+ //
+ RenderInvocation render = new RenderInvocation(renderContext);
+
+ //
+ render.setMode(mode);
+ render.setWindowState(windowState);
+ render.setNavigationalState(portletNS);
+ render.setPublicNavigationalState(publicNS);
+
+ //
+ return controllerContext.invoke(cookies, render);
+ }
}
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletControllerContext.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletControllerContext.java 2008-04-19
02:00:15 UTC (rev 10651)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/PortletControllerContext.java 2008-04-19
14:21:09 UTC (rev 10652)
@@ -30,6 +30,7 @@
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.EventInvocation;
import org.jboss.portal.portlet.invocation.ResourceInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
@@ -62,10 +63,12 @@
*/
PortletInvocationContext createPortletInvocationContext(String windowId,
PortletPageNavigationalState pageNavigationalState);
- PortletInvocationResponse invoke( ActionInvocation actionInvocation) throws
PortletInvokerException;
+ PortletInvocationResponse invoke(ActionInvocation actionInvocation) throws
PortletInvokerException;
PortletInvocationResponse invoke(List<Cookie> requestCookies, EventInvocation
eventInvocation) throws PortletInvokerException;
+ PortletInvocationResponse invoke(List<Cookie> requestCookies, RenderInvocation
renderInvocation) throws PortletInvokerException;
+
PortletInvocationResponse invoke(ResourceInvocation resourceInvocation) throws
PortletInvokerException;
EventControllerContext getEventControllerContext();
Modified:
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/AbstractPortletControllerContext.java
===================================================================
---
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/AbstractPortletControllerContext.java 2008-04-19
02:00:15 UTC (rev 10651)
+++
modules/portlet/trunk/controller/src/main/java/org/jboss/portal/portlet/controller/impl/AbstractPortletControllerContext.java 2008-04-19
14:21:09 UTC (rev 10652)
@@ -43,6 +43,7 @@
import org.jboss.portal.portlet.invocation.EventInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.ResourceInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.spi.PortalContext;
@@ -168,6 +169,28 @@
return invoke(eventInvocation);
}
+ public PortletInvocationResponse invoke(List<Cookie> requestCookies,
RenderInvocation renderInvocation) throws PortletInvokerException
+ {
+ ControllerPortletInvocationContext context =
(ControllerPortletInvocationContext)renderInvocation.getContext();
+
+ //
+ String windowId = context.getWindowId();
+ Portlet portlet = getPortlet(windowId);
+
+ //
+ renderInvocation.setClientContext(new AbstractClientContext(req, requestCookies));
+ renderInvocation.setServerContext(new AbstractServerContext(req, resp));
+ renderInvocation.setInstanceContext(new
AbstractInstanceContext(portlet.getContext().getId()));
+ renderInvocation.setUserContext(new AbstractUserContext(req));
+ renderInvocation.setWindowContext(new AbstractWindowContext(windowId));
+ renderInvocation.setPortalContext(PORTAL_CONTEXT);
+ renderInvocation.setSecurityContext(new AbstractSecurityContext(req));
+ renderInvocation.setTarget(portlet.getContext());
+
+ //
+ return invoke(renderInvocation);
+ }
+
public PortletInvocationResponse invoke(ResourceInvocation resourceInvocation) throws
PortletInvokerException
{
ControllerPortletInvocationContext context =
(ControllerPortletInvocationContext)resourceInvocation.getContext();
Modified:
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerContextSupport.java
===================================================================
---
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerContextSupport.java 2008-04-19
02:00:15 UTC (rev 10651)
+++
modules/portlet/trunk/controller/src/test/java/org/jboss/portal/portlet/controller/PortletControllerContextSupport.java 2008-04-19
14:21:09 UTC (rev 10652)
@@ -36,6 +36,7 @@
import org.jboss.portal.portlet.invocation.EventInvocation;
import org.jboss.portal.portlet.invocation.ResourceInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.OpaqueStateString;
@@ -117,6 +118,11 @@
return invoke(eventInvocation);
}
+ public PortletInvocationResponse invoke(List<Cookie> requestCookies,
RenderInvocation renderInvocation) throws PortletInvokerException
+ {
+ return invoke((PortletInvocation)renderInvocation);
+ }
+
public PortletInvocationResponse invoke(ResourceInvocation resourceInvocation) throws
PortletInvokerException
{
return invoke((PortletInvocation)resourceInvocation);
Modified:
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PortalRenderResponse.java
===================================================================
---
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PortalRenderResponse.java 2008-04-19
02:00:15 UTC (rev 10651)
+++
modules/portlet/trunk/portal/src/main/java/org/jboss/portal/portlet/portal/jsp/PortalRenderResponse.java 2008-04-19
14:21:09 UTC (rev 10652)
@@ -22,30 +22,22 @@
******************************************************************************/
package org.jboss.portal.portlet.portal.jsp;
-import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerContext;
import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
+import org.jboss.portal.portlet.controller.PortletController;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.impl.spi.AbstractClientContext;
-import org.jboss.portal.portlet.impl.spi.AbstractServerContext;
-import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
-import org.jboss.portal.portlet.impl.spi.AbstractWindowContext;
-import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext;
-import org.jboss.portal.portlet.impl.spi.AbstractInstanceContext;
-import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.WindowState;
-import org.jboss.portal.Mode;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.Cookie;
import javax.xml.namespace.QName;
import java.util.Map;
import java.util.HashMap;
import java.util.Set;
+import java.util.List;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -125,61 +117,9 @@
return portletControllerContext;
}
- private PortletInvocationResponse render(Portlet portlet, String windowId) throws
PortletInvokerException
+ private PortletInvocationResponse render(List<Cookie> cookies, String windowId)
throws PortletInvokerException
{
- PortletWindowNavigationalState windowNS = null;
- if (pageNavigationalState != null)
- {
- windowNS = pageNavigationalState.getPortletWindowNavigationalState(windowId);
- }
-
- //
- Map<String, String[]> publicNS = null;
- if (pageNavigationalState != null)
- {
- publicNS = pageNavigationalState.getPortletPublicNavigationalState(windowId);
- }
-
- //
- Mode mode = Mode.VIEW;
- WindowState windowState = WindowState.NORMAL;
- StateString portletNS = null;
-
- //
- if (windowNS != null)
- {
- if (windowNS.getMode() != null)
- {
- mode = windowNS.getMode();
- }
- if (windowNS.getWindowState() != null)
- {
- windowState = windowNS.getWindowState();
- }
- if (windowNS.getPortletNavigationalState() != null)
- {
- portletNS = windowNS.getPortletNavigationalState();
- }
- }
-
- //
- PortletInvocationContext renderContext =
portletControllerContext.createPortletInvocationContext(windowId, pageNavigationalState);
- RenderInvocation render = new RenderInvocation(renderContext);
- render.setClientContext(new
AbstractClientContext(portletControllerContext.getClientRequest()));
- render.setServerContext(new
AbstractServerContext(portletControllerContext.getClientRequest(),
portletControllerContext.getClientResponse()));
- render.setInstanceContext(new
AbstractInstanceContext(portlet.getContext().getId()));
- render.setUserContext(new
AbstractUserContext(portletControllerContext.getClientRequest()));
- render.setWindowContext(new AbstractWindowContext(windowId));
- render.setPortalContext(AbstractPortletControllerContext.PORTAL_CONTEXT);
- render.setSecurityContext(new
AbstractSecurityContext(portletControllerContext.getClientRequest()));
- render.setTarget(portlet.getContext());
- render.setMode(mode);
- render.setWindowState(windowState);
- render.setNavigationalState(portletNS);
- render.setPublicNavigationalState(publicNS);
-
- //
- return portletControllerContext.invoke(render);
+ return new PortletController().render(portletControllerContext, cookies,
pageNavigationalState, windowId);
}
private void render(PortalPrepareResponse prepareResponse)
@@ -196,7 +136,7 @@
//
if (portlet != null)
{
- PortletInvocationResponse portletResponse = render(portlet, windowId);
+ PortletInvocationResponse portletResponse = render(null, windowId);
//
WindowResult result = new WindowResult(windowDef, portletResponse);
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractClientContext.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractClientContext.java 2008-04-19
02:00:15 UTC (rev 10651)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractClientContext.java 2008-04-19
14:21:09 UTC (rev 10652)
@@ -63,37 +63,45 @@
MultiValuedPropertyMap<String> headers = new
SimpleMultiValuedPropertyMap<String>();
for (Enumeration<String> e = request.getHeaderNames();e.hasMoreElements();)
{
- String headerName = (String)e.nextElement();
+ String headerName = e.nextElement();
for (Enumeration<String> f =
request.getHeaders(headerName);f.hasMoreElements();)
{
- String headerValue = (String)f.nextElement();
+ String headerValue = f.nextElement();
headers.addValue(headerName, headerValue);
}
}
//
+ Cookie[] requestCookies = request.getCookies();
+
+ //
+ int length = (requestCookies == null ? 0 : requestCookies.length) +
(additionalCookies == null ? 0 : additionalCookies.size());
List<Cookie> cookies;
- Cookie[] tmp = request.getCookies();
- if (tmp == null || tmp.length == 0)
+ if (length == 0)
{
cookies = Collections.emptyList();
}
else
{
- cookies = new ArrayList<Cookie>(tmp.length);
- for (Cookie cookie : tmp)
+ cookies = new ArrayList<Cookie>(length);
+ if (requestCookies != null)
{
- Cookie copy = (Cookie)cookie.clone();
- cookies.add(copy);
+ for (Cookie cookie : requestCookies)
+ {
+ Cookie copy = (Cookie)cookie.clone();
+ cookies.add(copy);
+ }
}
+ if (additionalCookies != null)
+ {
+ for (Cookie cookie : additionalCookies)
+ {
+ Cookie copy = (Cookie)cookie.clone();
+ cookies.add(copy);
+ }
+ }
}
- for (Cookie cookie : additionalCookies)
- {
- Cookie copy = (Cookie)cookie.clone();
- cookies.add(copy);
- }
-
//
this.headers = headers;
this.method = request.getMethod();
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractRendererContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractRendererContext.java 2008-04-19
02:00:15 UTC (rev 10651)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/AbstractRendererContext.java 2008-04-19
14:21:09 UTC (rev 10652)
@@ -23,14 +23,16 @@
package org.jboss.portal.portlet.test.controller;
import org.jboss.portal.portlet.controller.PortletControllerContext;
+import org.jboss.portal.portlet.controller.PortletController;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerContext;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.PortletInvoker;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.Cookie;
+import java.util.List;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -42,13 +44,9 @@
/** . */
private final AbstractPortletControllerContext portletControllerContext;
- /** . */
- private final PortletInvoker portletInvoker;
-
- protected AbstractRendererContext(AbstractPortletControllerContext
portletControllerContext, PortletInvoker portletInvoker)
+ protected AbstractRendererContext(AbstractPortletControllerContext
portletControllerContext)
{
this.portletControllerContext = portletControllerContext;
- this.portletInvoker = portletInvoker;
}
public HttpServletRequest getClientRequest()
@@ -66,8 +64,8 @@
return portletControllerContext;
}
- public PortletInvocationResponse render(RenderInvocation render) throws
PortletInvokerException
+ public PortletInvocationResponse render(List<Cookie> cookies,
PortletPageNavigationalState pageNavigationalState, String windowId) throws
PortletInvokerException
{
- return portletInvoker.invoke(render);
+ return new PortletController().render(portletControllerContext, cookies,
pageNavigationalState, windowId);
}
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java 2008-04-19
02:00:15 UTC (rev 10651)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderer.java 2008-04-19
14:21:09 UTC (rev 10652)
@@ -23,38 +23,23 @@
package org.jboss.portal.portlet.test.controller;
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
import org.jboss.portal.common.util.MultiValuedPropertyMap;
import org.jboss.portal.common.xml.XMLTools;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.spi.PortletInvocationContext;
-import org.jboss.portal.portlet.impl.spi.AbstractClientContext;
-import org.jboss.portal.portlet.impl.spi.AbstractSecurityContext;
-import org.jboss.portal.portlet.impl.spi.AbstractServerContext;
-import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
-import org.jboss.portal.portlet.impl.spi.AbstractWindowContext;
-import org.jboss.portal.portlet.impl.spi.AbstractInstanceContext;
-import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
import org.jboss.portal.portlet.invocation.response.ContentResponse;
-import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
-import org.jboss.portal.portlet.controller.impl.AbstractPortletControllerContext;
import org.w3c.dom.Element;
-import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
-import java.util.Map;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
@@ -143,40 +128,11 @@
for (Portlet portlet : portlets)
{
- PortletWindowNavigationalState windowNS =
pageNavigationalState.getPortletWindowNavigationalState(portlet.getContext().getId());
-
- //
- Mode mode = Mode.VIEW;
- WindowState windowState = WindowState.NORMAL;
- StateString portletNS = null;
-
- //
- if (windowNS != null)
- {
- if (windowNS.getMode() != null)
- {
- mode = windowNS.getMode();
- }
- if (windowNS.getWindowState() != null)
- {
- windowState = windowNS.getWindowState();
- }
- if (windowNS.getPortletNavigationalState() != null)
- {
- portletNS = windowNS.getPortletNavigationalState();
- }
- }
-
- //
- Map<String, String[]> publicNS =
pageNavigationalState.getPortletPublicNavigationalState(portlet.getContext().getId());
-
- RenderInvocation render = createRenderInvocation(context, properties,
pageNavigationalState, portlet, windowNS, mode, windowState, portletNS, publicNS);
-
- //
try
{
- PortletInvocationResponse response = context.render(render);
+ PortletInvocationResponse response = context.render(properties.getCookies(),
pageNavigationalState, portlet.getContext().getId());
+ //
if (response instanceof ContentResponse)
{
ContentResponse fragment = (ContentResponse)response;
@@ -206,38 +162,4 @@
// Now we combine the render properties with the page properties
properties.append(renderProperties);
}
-
- protected RenderInvocation createRenderInvocation(
- RendererContext context,
- ResponseProperties pageProperties,
- PortletPageNavigationalState pageNS,
- Portlet portlet,
- PortletWindowNavigationalState windowNS,
- Mode mode,
- WindowState windowState,
- StateString portletNS,
- Map<String, String[]> publicNS)
- {
- HttpServletRequest req = context.getClientRequest();
- HttpServletResponse resp = context.getClientResponse();
-
- //
- PortletInvocationContext renderContext =
context.getPortletControllerContext().createPortletInvocationContext(portlet.getContext().getId(),
pageNS);
-
- //
- RenderInvocation render = new RenderInvocation(renderContext);
- render.setClientContext(new AbstractClientContext(req,
pageProperties.getCookies()));
- render.setServerContext(new AbstractServerContext(req, resp));
- render.setInstanceContext(new
AbstractInstanceContext(portlet.getContext().getId()));
- render.setUserContext(new AbstractUserContext(req));
- render.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
- render.setPortalContext(AbstractPortletControllerContext.PORTAL_CONTEXT);
- render.setSecurityContext(new AbstractSecurityContext(req));
- render.setTarget(portlet.getContext());
- render.setMode(mode);
- render.setWindowState(windowState);
- render.setNavigationalState(portletNS);
- render.setPublicNavigationalState(publicNS);
- return render;
- }
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RendererContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RendererContext.java 2008-04-19
02:00:15 UTC (rev 10651)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RendererContext.java 2008-04-19
14:21:09 UTC (rev 10652)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.test.controller;
import org.jboss.portal.portlet.controller.PortletControllerContext;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
@@ -30,7 +31,9 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.Cookie;
import java.util.Collection;
+import java.util.List;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -47,6 +50,6 @@
Collection<Portlet> getPortlets();
- PortletInvocationResponse render(RenderInvocation render) throws
PortletInvokerException;
+ PortletInvocationResponse render(List<Cookie> cookies,
PortletPageNavigationalState pageNavigationalState, String windowId) throws
PortletInvokerException;
}
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RendererContextImpl.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RendererContextImpl.java 2008-04-19
02:00:15 UTC (rev 10651)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RendererContextImpl.java 2008-04-19
14:21:09 UTC (rev 10652)
@@ -39,7 +39,7 @@
public RendererContextImpl(PortletControllerContextImpl portletControllerContext)
throws PortletInvokerException
{
- super(portletControllerContext, portletControllerContext.getPortletInvoker());
+ super(portletControllerContext);
//
this.portlets = portletControllerContext.getPortlets();
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKRendererContext.java
===================================================================
---
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKRendererContext.java 2008-04-19
02:00:15 UTC (rev 10651)
+++
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/tck/TCKRendererContext.java 2008-04-19
14:21:09 UTC (rev 10652)
@@ -44,7 +44,7 @@
TCKPortletControllerContext portletControllerContext,
TCKPortletPageNavigationalState tckPageNavigationalState) throws
PortletInvokerException
{
- super(portletControllerContext, portletControllerContext.getPortletInvoker());
+ super(portletControllerContext);
//
Collection<Portlet> involvedPortlets = new ArrayList<Portlet>();
Modified:
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/controller/StateControllerContextTestCase.java
===================================================================
---
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/controller/StateControllerContextTestCase.java 2008-04-19
02:00:15 UTC (rev 10651)
+++
modules/portlet/trunk/test/src/test/java/org/jboss/portal/portlet/controller/StateControllerContextTestCase.java 2008-04-19
14:21:09 UTC (rev 10652)
@@ -37,6 +37,7 @@
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.EventInvocation;
import org.jboss.portal.portlet.invocation.ResourceInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.common.io.IOTools;
@@ -147,6 +148,11 @@
throw new NotYetImplemented();
}
+ public PortletInvocationResponse invoke(List<Cookie> requestCookies,
RenderInvocation renderInvocation) throws PortletInvokerException
+ {
+ throw new NotYetImplemented();
+ }
+
public EventControllerContext getEventControllerContext()
{
throw new NotYetImplemented();