JBoss Portal SVN: r9758 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: controller and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 21:52:01 -0500 (Mon, 04 Feb 2008)
New Revision: 9758
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/Event.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/EventControllerContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/ContainerRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/FullScopedCacheablePortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PageScopedFullPortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletActionRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRenderRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletScopedPortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
Log:
update controller to use notion of "window id" and not a portlet, in the case of the controller2 stuff we have indeed window id == portlet id, but a window id is really something used to designate the portlet + its surrounding context (window and instance). In general window id notion is more precise than portlet id
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -33,6 +33,7 @@
import org.jboss.portal.portlet.RenderURL;
import org.jboss.portal.portlet.ResourceURL;
import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.cache.CacheLevel;
import static org.jboss.portal.portlet.test.URLParameterConstants.*;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
@@ -51,7 +52,7 @@
{
/** . */
- final Portlet portlet;
+ final String windowId;
/** . */
final HttpServletRequest clientReq;
@@ -64,12 +65,12 @@
public PortletURLRenderer(
PageNavigationalState pageNS,
- Portlet portlet,
+ String windowId,
HttpServletRequest clientReq,
HttpServletResponse clientResp)
{
this.pageNS = pageNS;
- this.portlet = portlet;
+ this.windowId = windowId;
this.clientReq = clientReq;
this.clientResp = clientResp;
}
@@ -84,7 +85,7 @@
buffer.append(Integer.toString(clientReq.getServerPort()));
buffer.append(clientReq.getContextPath());
buffer.append('/');
- buffer.append(StringCodec.encode(portlet.getContext().getId()));
+ buffer.append(StringCodec.encode(windowId));
//
Map<String, String> parameters = new HashMap<String, String>();
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -25,6 +25,7 @@
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.info.ParameterInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
import javax.xml.namespace.QName;
import java.util.Map;
@@ -68,10 +69,10 @@
return windows.get(windowId);
}
- public ParameterMap getPublicNavigationalState(Portlet portlet)
+ public ParameterMap getPublicNavigationalState(PortletInfo portlet)
{
ParameterMap publicNavigationalState = null;
- for (ParameterInfo parameterInfo : portlet.getInfo().getNavigation().getPublicParameters())
+ for (ParameterInfo parameterInfo : portlet.getNavigation().getPublicParameters())
{
String[] parameterValue = page.get(parameterInfo.getName());
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -24,6 +24,7 @@
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.EventInvocation;
@@ -51,7 +52,7 @@
HttpServletResponse getClientResponse();
- Portlet getPortlet(String portletId) throws PortletInvokerException;
+ PortletInfo getPortletInfo(String windowId) throws PortletInvokerException;
// To be removed
PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -7,12 +7,11 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.util.ParameterMap;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.info.NavigationInfo;
import org.jboss.portal.portlet.info.ParameterInfo;
+import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.EventInvocation;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
@@ -22,8 +21,6 @@
import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStateResponse;
import org.jboss.portal.portlet.test.PortletURLRenderer;
import org.jboss.portal.portlet.test.TestPortletInvocationContext;
-import org.jboss.portal.portlet.test.TestInstanceContext;
-import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import static org.jboss.portal.portlet.test.controller.PortletController.*;
import org.jboss.portal.portlet.test.controller.event.Event;
import org.jboss.portal.portlet.test.controller.event.EventControllerContext;
@@ -73,9 +70,6 @@
MutablePageNavigationalState pageState = portletRequest.getPageState() == null ? new MutablePageNavigationalState() : new MutablePageNavigationalState(portletRequest.getPageState());
//
- PortletContext portletContext = portletRequest.getControllerContext().getPortlet(portletRequest.getPortletId()).getContext();
-
- //
ResponseProperties requestProperties = new ResponseProperties();
//
@@ -87,7 +81,7 @@
{
// Update portlet NS
UpdateNavigationalStateResponse updateResponse = (UpdateNavigationalStateResponse)response;
- updateNavigationalState(context, portletRequest.getPortletId(), updateResponse, pageState);
+ updateNavigationalState(context, portletRequest.getWindowId(), updateResponse, pageState);
//
ResponseProperties update = updateResponse.getProperties();
@@ -104,7 +98,7 @@
LinkedList<Event> eventQueue = new LinkedList<Event>();
for (UpdateNavigationalStateResponse.Event portletEvent : stateResponse.getEvents())
{
- Event producedEvent = new Event(portletEvent.getName(), portletEvent.getPayload(), portletContext);
+ Event producedEvent = new Event(portletEvent.getName(), portletEvent.getPayload(), portletRequest.getWindowId());
List<Event> consumedEvents = eventCC.getConsumedEvents(producedEvent);
eventQueue.addAll(consumedEvents);
}
@@ -123,12 +117,12 @@
UpdateNavigationalStateResponse eventStateResponse = (UpdateNavigationalStateResponse)eventResponse;
// Update ns
- updateNavigationalState(context, event.getPortletContext().getId(), eventStateResponse, pageState);
+ updateNavigationalState(context, event.getWindowId(), eventStateResponse, pageState);
// Add events if any
for (UpdateNavigationalStateResponse.Event portletEvent : eventStateResponse.getEvents())
{
- Event producedEvent = new Event(portletEvent.getName(), portletEvent.getPayload(), portletContext);
+ Event producedEvent = new Event(portletEvent.getName(), portletEvent.getPayload(), portletRequest.getWindowId());
List<Event> consumedEvents = eventCC.getConsumedEvents(producedEvent);
eventQueue.addAll(consumedEvents);
}
@@ -166,7 +160,7 @@
PortletInvocationResponse invoke(PortletRequest portletRequest) throws PortletInvokerException
{
PortletControllerContext context = portletRequest.getControllerContext();
- Portlet portlet = context.getPortlet(portletRequest.getPortletId());
+ PortletInfo portlet = context.getPortletInfo(portletRequest.getWindowId());
HttpServletRequest req = context.getClientRequest();
HttpServletResponse resp = context.getClientResponse();
@@ -208,7 +202,7 @@
//
ParameterMap publicNS = pageNS.getPublicNavigationalState(portlet);
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portlet, req, resp);
+ PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portletRequest.getWindowId(), req, resp);
TestPortletInvocationContext portletInvocationContext = new TestPortletInvocationContext(renderer, MARKUP_INFO);
ActionInvocation actionInvocation = new ActionInvocation(portletInvocationContext);
@@ -221,7 +215,7 @@
actionInvocation.setForm(portletActionRequest.getBodyParameters() != null ? ParameterMap.clone(portletActionRequest.getBodyParameters()) : null);
//
- return context.invoke(portletRequest.getPortletId(), actionInvocation);
+ return context.invoke(portletRequest.getWindowId(), actionInvocation);
}
}
@@ -229,11 +223,11 @@
PageNavigationalState pageNS, List<Cookie> requestCookies)
throws PortletInvokerException
{
- Portlet portlet = context.getPortlet(event.getPortletContext().getId());
+ PortletInfo portlet = context.getPortletInfo(event.getWindowId());
HttpServletRequest req = context.getClientRequest();
HttpServletResponse resp = context.getClientResponse();
- WindowNavigationalState windowNS = pageNS.getWindowNavigationalState(portlet.getContext().getId());
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portlet, req, resp);
+ WindowNavigationalState windowNS = pageNS.getWindowNavigationalState(event.getWindowId());
+ PortletURLRenderer renderer = new PortletURLRenderer(pageNS, event.getWindowId(), req, resp);
//
if (windowNS == null)
@@ -257,17 +251,17 @@
eventInvocation.setPayload(event.getPayload());
//
- return context.invoke(event.getPortletContext().getId(), requestCookies, eventInvocation);
+ return context.invoke(event.getWindowId(), requestCookies, eventInvocation);
}
- private void updateNavigationalState(PortletControllerContext context, String portletId,
+ private void updateNavigationalState(PortletControllerContext context, String windowId,
UpdateNavigationalStateResponse update, MutablePageNavigationalState pageState)
throws PortletInvokerException
{
- Portlet portlet = context.getPortlet(portletId);
+ PortletInfo portlet = context.getPortletInfo(windowId);
//
- WindowNavigationalState windowNS = pageState.getWindowNavigationalState(portletId);
+ WindowNavigationalState windowNS = pageState.getWindowNavigationalState(windowId);
//
if (windowNS == null)
@@ -292,13 +286,13 @@
portletNS = update.getNavigationalState();
}
windowNS = new WindowNavigationalState(portletNS, mode, windowState);
- pageState.setWindowNavigationalState(portletId, windowNS);
+ pageState.setWindowNavigationalState(windowId, windowNS);
// Now update shared state scoped at page
Map<String, String[]> publicNS = update.getPublicNavigationalStateUpdates();
if (publicNS != null)
{
- NavigationInfo navigationInfo = portlet.getInfo().getNavigation();
+ NavigationInfo navigationInfo = portlet.getNavigation();
for (Map.Entry<String, String[]> entry : publicNS.entrySet())
{
String id = entry.getKey();
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -29,13 +29,13 @@
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.cache.CacheLevel;
import org.jboss.portal.portlet.invocation.ResourceInvocation;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.test.PortletURLRenderer;
-import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import static org.jboss.portal.portlet.test.controller.PortletController.*;
import org.jboss.portal.portlet.test.controller.request.ControllerRequest;
@@ -87,7 +87,7 @@
CacheLevel cacheability;
PortletControllerContext context = portletResourceRequest.getControllerContext();
- Portlet portlet = context.getPortlet(portletResourceRequest.getPortletId());
+ PortletInfo portlet = context.getPortletInfo(portletResourceRequest.getWindowId());
HttpServletRequest req = context.getClientRequest();
HttpServletResponse resp = context.getClientResponse();
@@ -133,7 +133,7 @@
}
//
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portlet, req, resp);
+ PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portletResourceRequest.getWindowId(), req, resp);
//
TestPortletInvocationContext resourceInvocationContext = new TestPortletInvocationContext(renderer, MARKUP_INFO);
@@ -152,7 +152,7 @@
//
try
{
- return context.invoke(portletResourceRequest.getPortletId(), resourceInvocation);
+ return context.invoke(portletResourceRequest.getWindowId(), resourceInvocation);
}
catch (PortletInvokerException e)
{
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/Event.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/Event.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/Event.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -43,21 +43,21 @@
private final Serializable payload;
/** . */
- private final PortletContext portletContext;
+ private final String windowId;
- public Event(QName name, Serializable payload, PortletContext portletContext)
+ public Event(QName name, Serializable payload, String windowId)
{
if (name == null)
{
throw new IllegalArgumentException();
}
- if (portletContext == null)
+ if (windowId == null)
{
throw new IllegalArgumentException();
}
this.name = name;
this.payload = payload;
- this.portletContext = portletContext;
+ this.windowId = windowId;
}
public QName getName()
@@ -70,8 +70,8 @@
return payload;
}
- public PortletContext getPortletContext()
+ public String getWindowId()
{
- return portletContext;
+ return windowId;
}
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/EventControllerContextImpl.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/EventControllerContextImpl.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/EventControllerContextImpl.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -56,7 +56,7 @@
PortletInfo portletInfo = portlet.getInfo();
if (portletInfo.getEventing().getConsumedEvents().containsKey(producedEvent.getName()))
{
- Event consumedEvent = new Event(producedEvent.getName(), producedEvent.getPayload(), portlet.getContext());
+ Event consumedEvent = new Event(producedEvent.getName(), producedEvent.getPayload(), portlet.getContext().getId());
consumedEvents.add(consumedEvent);
}
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/ContainerRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/ContainerRequest.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/ContainerRequest.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -32,18 +32,18 @@
{
/** . */
- private final String portletId;
+ private final String windowId;
- ContainerRequest(PortletControllerContext controllerContext, String portletId)
+ ContainerRequest(PortletControllerContext controllerContext, String windowId)
{
super(controllerContext);
//
- this.portletId = portletId;
+ this.windowId = windowId;
}
- public String getPortletId()
+ public String getWindowId()
{
- return portletId;
+ return windowId;
}
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/FullScopedCacheablePortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/FullScopedCacheablePortletResourceRequest.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/FullScopedCacheablePortletResourceRequest.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -35,11 +35,11 @@
public FullScopedCacheablePortletResourceRequest(
PortletControllerContext controllerContext,
- String portletId,
+ String windowId,
String resourceId,
StateString resourceState,
ParameterMap bodyParameters)
{
- super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
+ super(controllerContext, windowId, resourceId, resourceState, bodyParameters);
}
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PageScopedFullPortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PageScopedFullPortletResourceRequest.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PageScopedFullPortletResourceRequest.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -40,14 +40,14 @@
public PageScopedFullPortletResourceRequest(
PortletControllerContext controllerContext,
- String portletId,
+ String windowId,
String resourceId,
StateString resourceState,
ParameterMap bodyParameters,
PageNavigationalState pageState,
WindowNavigationalState windowNavigationalState)
{
- super(controllerContext, portletId, resourceId, resourceState, bodyParameters, windowNavigationalState);
+ super(controllerContext, windowId, resourceId, resourceState, bodyParameters, windowNavigationalState);
//
this.pageState = pageState;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletActionRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletActionRequest.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletActionRequest.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -43,13 +43,13 @@
public PortletActionRequest(
PortletControllerContext controllerContext,
- String portletId,
+ String windowId,
StateString interactionState,
ParameterMap bodyParameters,
WindowNavigationalState windowNavigationalState,
PageNavigationalState pageState)
{
- super(controllerContext, portletId, windowNavigationalState, pageState);
+ super(controllerContext, windowId, windowNavigationalState, pageState);
//
this.interactionState = interactionState;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRenderRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRenderRequest.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRenderRequest.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -40,12 +40,12 @@
public PortletRenderRequest(
PortletControllerContext controllerContext,
- String portletId,
+ String windowId,
WindowNavigationalState windowNavigationalState,
Map<String, String[]> publicNavigationalStateChanges,
PageNavigationalState pageState)
{
- super(controllerContext, portletId, windowNavigationalState, pageState);
+ super(controllerContext, windowId, windowNavigationalState, pageState);
//
this.publicNavigationalStateChanges = publicNavigationalStateChanges;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRequest.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRequest.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -41,11 +41,11 @@
PortletRequest(
PortletControllerContext controllerContext,
- String portletId,
+ String windowId,
WindowNavigationalState windowNavigationalState,
PageNavigationalState pageState)
{
- super(controllerContext, portletId);
+ super(controllerContext, windowId);
//
this.windowNavigationalState = windowNavigationalState;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletResourceRequest.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletResourceRequest.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -58,13 +58,13 @@
PortletResourceRequest(
PortletControllerContext controllerContext,
- String portletId,
+ String windowId,
String resourceId,
StateString resourceState,
ParameterMap bodyParameters
)
{
- super(controllerContext, portletId);
+ super(controllerContext, windowId);
//
this.resourceId = resourceId;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletScopedPortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletScopedPortletResourceRequest.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletScopedPortletResourceRequest.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -39,13 +39,13 @@
public PortletScopedPortletResourceRequest(
PortletControllerContext controllerContext,
- String portletId,
+ String windowId,
String resourceId,
StateString resourceState,
ParameterMap bodyParameters,
WindowNavigationalState windowNavigationalState)
{
- super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
+ super(controllerContext, windowId, resourceId, resourceState, bodyParameters);
//
this.windowNavigationalState = windowNavigationalState;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -174,7 +174,7 @@
}
//
- ParameterMap publicNS = pageState.getPublicNavigationalState(portlet);
+ ParameterMap publicNS = pageState.getPublicNavigationalState(portlet.getInfo());
RenderInvocation render = createRenderInvocation(context, properties, pageState, portlet, windowNS, mode, windowState, portletNS, publicNS);
@@ -228,7 +228,7 @@
HttpServletResponse resp = context.getClientResponse();
//
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portlet, req, resp);
+ PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portlet.getContext().getId(), req, resp);
//
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), false);
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-05 02:33:07 UTC (rev 9757)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-05 02:52:01 UTC (rev 9758)
@@ -33,6 +33,7 @@
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.impl.spi.AbstractClientContext;
import org.jboss.portal.portlet.impl.spi.AbstractServerContext;
import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
@@ -276,11 +277,16 @@
return resp;
}
- public Portlet getPortlet(String portletId) throws PortletInvokerException
+ public PortletInfo getPortletInfo(String windowId) throws PortletInvokerException
{
- return invoker.getPortlet(PortletContext.createPortletContext(portletId));
+ return _getPortlet(windowId).getInfo();
}
+ private Portlet _getPortlet(String windowId) throws PortletInvokerException
+ {
+ return invoker.getPortlet(PortletContext.createPortletContext(windowId));
+ }
+
public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
{
return invoker.invoke(invocation);
@@ -299,7 +305,7 @@
public PortletInvocationResponse invoke(String windowId, ActionInvocation actionInvocation) throws PortletInvokerException
{
- Portlet portlet = getPortlet(windowId);
+ Portlet portlet =_getPortlet(windowId);
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
@@ -318,7 +324,7 @@
public PortletInvocationResponse invoke(String windowId, List<Cookie> requestCookies, EventInvocation eventInvocation) throws PortletInvokerException
{
- Portlet portlet = getPortlet(windowId);
+ Portlet portlet = _getPortlet(windowId);
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
@@ -336,7 +342,7 @@
public PortletInvocationResponse invoke(String windowId, ResourceInvocation resourceInvocation) throws PortletInvokerException
{
- Portlet portlet = getPortlet(windowId);
+ Portlet portlet = _getPortlet(windowId);
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
16 years, 4 months
JBoss Portal SVN: r9757 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: controller2 and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 21:33:07 -0500 (Mon, 04 Feb 2008)
New Revision: 9757
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
Log:
moved the stuffing of the portlet invocation to the portlet controller context implementation (as the controller does not care about)
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java 2008-02-05 01:13:32 UTC (rev 9756)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java 2008-02-05 02:33:07 UTC (rev 9757)
@@ -25,12 +25,18 @@
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+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.response.PortletInvocationResponse;
import org.jboss.portal.portlet.test.controller.event.EventControllerContext;
+import org.jboss.portal.portlet.test.TestInstanceContext;
import javax.servlet.ServletContext;
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>
@@ -47,8 +53,15 @@
Portlet getPortlet(String portletId) throws PortletInvokerException;
+ // To be removed
PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException;
+ PortletInvocationResponse invoke(String windowId, ActionInvocation actionInvocation) throws PortletInvokerException;
+
+ PortletInvocationResponse invoke(String windowId, List<Cookie> requestCookies, EventInvocation eventInvocation) throws PortletInvokerException;
+
+ PortletInvocationResponse invoke(String windowId, ResourceInvocation resourceInvocation) throws PortletInvokerException;
+
EventControllerContext getEventControllerContext();
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 01:13:32 UTC (rev 9756)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 02:33:07 UTC (rev 9757)
@@ -11,12 +11,6 @@
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.impl.spi.AbstractClientContext;
-import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
-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.info.NavigationInfo;
import org.jboss.portal.portlet.info.ParameterInfo;
import org.jboss.portal.portlet.invocation.ActionInvocation;
@@ -30,7 +24,6 @@
import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import org.jboss.portal.portlet.test.TestInstanceContext;
import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
-import org.jboss.portal.portlet.test.TestPortalContext;
import static org.jboss.portal.portlet.test.controller.PortletController.*;
import org.jboss.portal.portlet.test.controller.event.Event;
import org.jboss.portal.portlet.test.controller.event.EventControllerContext;
@@ -215,12 +208,7 @@
//
ParameterMap publicNS = pageNS.getPublicNavigationalState(portlet);
-
- //
PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portlet, req, resp);
-
- //
- TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
TestPortletInvocationContext portletInvocationContext = new TestPortletInvocationContext(renderer, MARKUP_INFO);
ActionInvocation actionInvocation = new ActionInvocation(portletInvocationContext);
@@ -233,25 +221,7 @@
actionInvocation.setForm(portletActionRequest.getBodyParameters() != null ? ParameterMap.clone(portletActionRequest.getBodyParameters()) : null);
//
- actionInvocation.setClientContext(new AbstractClientContext(req));
- actionInvocation.setServerContext(new AbstractServerContext(req, resp));
- actionInvocation.setInstanceContext(instanceContext);
- actionInvocation.setUserContext(new AbstractUserContext(req));
- actionInvocation.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
- actionInvocation.setPortalContext(new TestPortalContext());
- actionInvocation.setSecurityContext(new AbstractSecurityContext(req));
- actionInvocation.setRequestContext(new AbstractRequestContext(req));
- actionInvocation.setTarget(instanceContext.getTarget());
-
- //
- try
- {
- return context.invoke(actionInvocation);
- }
- catch (PortletInvokerException e)
- {
- return null;
- }
+ return context.invoke(portletRequest.getPortletId(), actionInvocation);
}
}
@@ -275,7 +245,6 @@
ParameterMap publicNS = pageNS.getPublicNavigationalState(portlet);
//
- TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
TestPortletInvocationContext actionContext = new TestPortletInvocationContext(renderer, MARKUP_INFO);
EventInvocation eventInvocation = new EventInvocation(actionContext);
@@ -288,27 +257,7 @@
eventInvocation.setPayload(event.getPayload());
//
- eventInvocation.setClientContext(new AbstractClientContext(req, requestCookies));
- eventInvocation.setServerContext(new AbstractServerContext(req, resp));
- eventInvocation.setInstanceContext(instanceContext);
- eventInvocation.setUserContext(new AbstractUserContext(req));
- eventInvocation.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
- eventInvocation.setPortalContext(new TestPortalContext());
- eventInvocation.setSecurityContext(new AbstractSecurityContext(req));
- eventInvocation.setTarget(instanceContext.getTarget());
-
- //
- try
- {
- return context.invoke(eventInvocation);
- }
- catch (PortletInvokerException e)
- {
- log.error("Error during event invocation", e);
-
- //
- return null;
- }
+ return context.invoke(event.getPortletContext().getId(), requestCookies, eventInvocation);
}
private void updateNavigationalState(PortletControllerContext context, String portletId,
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-05 01:13:32 UTC (rev 9756)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-05 02:33:07 UTC (rev 9757)
@@ -30,20 +30,12 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.cache.CacheLevel;
-import org.jboss.portal.portlet.impl.spi.AbstractClientContext;
-import org.jboss.portal.portlet.impl.spi.AbstractRequestContext;
-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.invocation.ResourceInvocation;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.test.PortletURLRenderer;
-import org.jboss.portal.portlet.test.TestInstanceContext;
import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
-import org.jboss.portal.portlet.test.TestPortalContext;
import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import static org.jboss.portal.portlet.test.controller.PortletController.*;
import org.jboss.portal.portlet.test.controller.request.ControllerRequest;
@@ -141,13 +133,9 @@
}
//
- WindowNavigationalState windowNS = new WindowNavigationalState(portletNS, mode, windowState);
-
- //
PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portlet, req, resp);
//
- TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
TestPortletInvocationContext resourceInvocationContext = new TestPortletInvocationContext(renderer, MARKUP_INFO);
ResourceInvocation resourceInvocation = new ResourceInvocation(resourceInvocationContext);
@@ -162,20 +150,9 @@
resourceInvocation.setForm(portletResourceRequest.getBodyParameters() != null ? ParameterMap.clone(portletResourceRequest.getBodyParameters()) : null);
//
- resourceInvocation.setClientContext(new AbstractClientContext(req));
- resourceInvocation.setServerContext(new AbstractServerContext(req, resp));
- resourceInvocation.setInstanceContext(instanceContext);
- resourceInvocation.setUserContext(new AbstractUserContext(req));
- resourceInvocation.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
- resourceInvocation.setPortalContext(new TestPortalContext());
- resourceInvocation.setSecurityContext(new AbstractSecurityContext(req));
- resourceInvocation.setRequestContext(new AbstractRequestContext(req));
- resourceInvocation.setTarget(instanceContext.getTarget());
-
- //
try
{
- return context.invoke(resourceInvocation);
+ return context.invoke(portletResourceRequest.getPortletId(), resourceInvocation);
}
catch (PortletInvokerException e)
{
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-05 01:13:32 UTC (rev 9756)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-05 02:33:07 UTC (rev 9757)
@@ -33,10 +33,21 @@
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.PortletInvokerException;
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.AbstractRequestContext;
import org.jboss.portal.portlet.cache.CacheLevel;
import org.jboss.portal.portlet.invocation.PortletInvocation;
+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.response.PortletInvocationResponse;
import org.jboss.portal.portlet.test.StringCodec;
+import org.jboss.portal.portlet.test.TestInstanceContext;
+import org.jboss.portal.portlet.test.TestPortalContext;
import static org.jboss.portal.portlet.test.URLParameterConstants.*;
import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
@@ -56,9 +67,11 @@
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.Cookie;
import java.io.IOException;
import java.util.Collection;
import java.util.Map;
+import java.util.List;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -282,4 +295,61 @@
{
return eventControllerContext;
}
+
+ public PortletInvocationResponse invoke(String windowId, ActionInvocation actionInvocation) throws PortletInvokerException
+ {
+
+ Portlet portlet = getPortlet(windowId);
+
+ TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
+
+ actionInvocation.setClientContext(new AbstractClientContext(req));
+ actionInvocation.setServerContext(new AbstractServerContext(req, resp));
+ actionInvocation.setInstanceContext(instanceContext);
+ actionInvocation.setUserContext(new AbstractUserContext(req));
+ actionInvocation.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
+ actionInvocation.setPortalContext(new TestPortalContext());
+ actionInvocation.setSecurityContext(new AbstractSecurityContext(req));
+ actionInvocation.setRequestContext(new AbstractRequestContext(req));
+ actionInvocation.setTarget(instanceContext.getTarget());
+
+ return invoke(actionInvocation);
+ }
+
+ public PortletInvocationResponse invoke(String windowId, List<Cookie> requestCookies, EventInvocation eventInvocation) throws PortletInvokerException
+ {
+ Portlet portlet = getPortlet(windowId);
+
+ TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
+
+ eventInvocation.setClientContext(new AbstractClientContext(req, requestCookies));
+ eventInvocation.setServerContext(new AbstractServerContext(req, resp));
+ eventInvocation.setInstanceContext(instanceContext);
+ eventInvocation.setUserContext(new AbstractUserContext(req));
+ eventInvocation.setWindowContext(new AbstractWindowContext(windowId));
+ eventInvocation.setPortalContext(new TestPortalContext());
+ eventInvocation.setSecurityContext(new AbstractSecurityContext(req));
+ eventInvocation.setTarget(instanceContext.getTarget());
+
+ return invoke(eventInvocation);
+ }
+
+ public PortletInvocationResponse invoke(String windowId, ResourceInvocation resourceInvocation) throws PortletInvokerException
+ {
+ Portlet portlet = getPortlet(windowId);
+
+ TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
+
+ resourceInvocation.setClientContext(new AbstractClientContext(req));
+ resourceInvocation.setServerContext(new AbstractServerContext(req, resp));
+ resourceInvocation.setInstanceContext(instanceContext);
+ resourceInvocation.setUserContext(new AbstractUserContext(req));
+ resourceInvocation.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
+ resourceInvocation.setPortalContext(new TestPortalContext());
+ resourceInvocation.setSecurityContext(new AbstractSecurityContext(req));
+ resourceInvocation.setRequestContext(new AbstractRequestContext(req));
+ resourceInvocation.setTarget(instanceContext.getTarget());
+
+ return invoke(resourceInvocation);
+ }
}
16 years, 4 months
JBoss Portal SVN: r9756 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api and 3 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 20:13:32 -0500 (Mon, 04 Feb 2008)
New Revision: 9756
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/ActionURL.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/ResourceURL.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceURLImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
Log:
update ActionURL and ResourceURL to have nav state related info (as it should be, I tried to simplify but after all it does not simplify)
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/ActionURL.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/ActionURL.java 2008-02-05 00:22:45 UTC (rev 9755)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/ActionURL.java 2008-02-05 01:13:32 UTC (rev 9756)
@@ -34,4 +34,11 @@
* @return the interaction state
*/
StateString getInteractionState();
+
+ /**
+ * Return the navigational state that may be null.
+ *
+ * @return the navigational state
+ */
+ StateString getNavigationalState();
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/ResourceURL.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/ResourceURL.java 2008-02-05 00:22:45 UTC (rev 9755)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/ResourceURL.java 2008-02-05 01:13:32 UTC (rev 9756)
@@ -23,6 +23,8 @@
package org.jboss.portal.portlet;
import org.jboss.portal.portlet.cache.CacheLevel;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -52,4 +54,24 @@
*/
CacheLevel getCacheability();
+ /**
+ * Return the navigational state that may be null.
+ *
+ * @return the navigational state
+ */
+ StateString getNavigationalState();
+
+ /**
+ * Returns the mode that may be null.
+ *
+ * @return the mode
+ */
+ Mode getMode();
+
+ /**
+ * Returns the window state that may be null.
+ *
+ * @return the window state
+ */
+ WindowState getWindowState();
}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java 2008-02-05 00:22:45 UTC (rev 9755)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/PortletURLImpl.java 2008-02-05 01:13:32 UTC (rev 9756)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.api;
-import org.jboss.portal.common.NotYetImplemented;
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.impl.jsr168.PortletParameterMap;
@@ -49,7 +48,7 @@
public static PortletURLImpl createActionURL(PortletInvocation invocation, PortletRequestImpl preq)
{
- InternalActionURL url = new InternalActionURL();
+ InternalActionURL url = new InternalActionURL(invocation.getNavigationalState());
return new PortletURLImpl(invocation, preq, url, true);
}
@@ -197,9 +196,13 @@
/** . */
private final ParametersStateString interactionState;
- private InternalActionURL()
+ /** . */
+ private final StateString navigationalState;
+
+ private InternalActionURL(StateString navigationalState)
{
this.interactionState = ParametersStateString.create();
+ this.navigationalState = navigationalState;
}
private InternalActionURL(InternalActionURL original)
@@ -208,6 +211,7 @@
//
this.interactionState = ParametersStateString.create(ParameterMap.clone(original.interactionState.getParameters()));
+ this.navigationalState = original.navigationalState;
}
public StateString getInteractionState()
@@ -238,6 +242,11 @@
{
return ParameterMap.clone(interactionState.getParameters());
}
+
+ public StateString getNavigationalState()
+ {
+ return navigationalState;
+ }
}
private static class InternalRenderURL extends InternalPortletURL implements RenderURL
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceURLImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceURLImpl.java 2008-02-05 00:22:45 UTC (rev 9755)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ResourceURLImpl.java 2008-02-05 01:13:32 UTC (rev 9756)
@@ -28,6 +28,8 @@
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.ParametersStateString;
import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
import javax.portlet.ResourceURL;
import javax.portlet.PortletURLGenerationListener;
@@ -159,7 +161,11 @@
public static ResourceURLImpl createResourceURL(PortletInvocation invocation, PortletRequestImpl preq)
{
- return new ResourceURLImpl(invocation, preq, new InternalResourceURL(), true);
+ return new ResourceURLImpl(
+ invocation,
+ preq,
+ new InternalResourceURL(invocation.getNavigationalState(), invocation.getMode(),invocation.getWindowState()),
+ true);
}
private static class InternalResourceURL extends InternalContainerURL implements org.jboss.portal.portlet.ResourceURL
@@ -177,9 +183,21 @@
/** . */
private ParametersStateString parameters;
- private InternalResourceURL()
+ /** . */
+ private final StateString navigationalState;
+
+ /** . */
+ private final Mode mode;
+
+ /** . */
+ private final WindowState windowState;
+
+ private InternalResourceURL(StateString navigationalState, Mode mode, WindowState windowState)
{
this.parameters = ParametersStateString.create();
+ this.navigationalState = navigationalState;
+ this.mode = mode;
+ this.windowState = windowState;
}
private InternalResourceURL(InternalResourceURL original)
@@ -188,6 +206,9 @@
this.parentCacheLevel = original.parentCacheLevel;
this.cacheLevel = original.cacheLevel;
this.parameters = ParametersStateString.create(ParameterMap.clone(original.parameters.getParameters()));
+ this.navigationalState = original.navigationalState;
+ this.mode = original.mode;
+ this.windowState = original.windowState;
}
protected void setParameter(String name, String value)
@@ -238,5 +259,20 @@
}
}
}
+
+ public StateString getNavigationalState()
+ {
+ return navigationalState;
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
}
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java 2008-02-05 00:22:45 UTC (rev 9755)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java 2008-02-05 01:13:32 UTC (rev 9756)
@@ -36,7 +36,6 @@
import org.jboss.portal.portlet.cache.CacheLevel;
import static org.jboss.portal.portlet.test.URLParameterConstants.*;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
-import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -55,9 +54,6 @@
final Portlet portlet;
/** . */
- final WindowNavigationalState windowNS;
-
- /** . */
final HttpServletRequest clientReq;
/** . */
@@ -68,13 +64,11 @@
public PortletURLRenderer(
PageNavigationalState pageNS,
- WindowNavigationalState windowNS,
Portlet portlet,
HttpServletRequest clientReq,
HttpServletResponse clientResp)
{
this.pageNS = pageNS;
- this.windowNS = windowNS;
this.portlet = portlet;
this.clientReq = clientReq;
this.clientResp = clientResp;
@@ -152,13 +146,9 @@
ActionURL actionURL = (ActionURL)containerURL;
//
- if (windowNS != null)
+ if (actionURL.getNavigationalState() != null)
{
- StateString portletNS = windowNS.getPortletNavigationalState();
- if (portletNS != null)
- {
- parameters.put(NAVIGATIONAL_STATE, windowNS.getPortletNavigationalState().getStringValue());
- }
+ parameters.put(NAVIGATIONAL_STATE, actionURL.getNavigationalState().getStringValue());
}
//
@@ -210,25 +200,26 @@
//
if (cacheability != CacheLevel.FULL)
{
- if (windowNS != null)
+ if (resourceURL.getNavigationalState() != null)
{
- StateString portletNS = windowNS.getPortletNavigationalState();
- if (portletNS != null)
- {
- parameters.put(NAVIGATIONAL_STATE, windowNS.getPortletNavigationalState().getStringValue());
- }
+ parameters.put(NAVIGATIONAL_STATE, resourceURL.getNavigationalState().getStringValue());
+ }
- //
- parameters.put(MODE, windowNS.getMode().toString());
+ //
+ if (resourceURL.getMode() != null)
+ {
+ parameters.put(MODE, resourceURL.getMode().toString());
+ }
- //
- parameters.put(WINDOW_STATE, windowNS.getWindowState().toString());
+ //
+ if (resourceURL.getWindowState() != null)
+ {
+ parameters.put(WINDOW_STATE, resourceURL.getWindowState().toString());
+ }
- //
- if (cacheability == CacheLevel.PAGE)
- {
- parameters.put(PAGE_STATE, pageState);
- }
+ if (cacheability == CacheLevel.PAGE)
+ {
+ parameters.put(PAGE_STATE, pageState);
}
}
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java 2008-02-05 00:22:45 UTC (rev 9755)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java 2008-02-05 01:13:32 UTC (rev 9756)
@@ -24,7 +24,6 @@
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.info.ParameterInfo;
import javax.xml.namespace.QName;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 00:22:45 UTC (rev 9755)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 01:13:32 UTC (rev 9756)
@@ -217,7 +217,7 @@
ParameterMap publicNS = pageNS.getPublicNavigationalState(portlet);
//
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portletActionRequest.getWindowNavigationalState(), portlet, req, resp);
+ PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portlet, req, resp);
//
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
@@ -263,7 +263,7 @@
HttpServletRequest req = context.getClientRequest();
HttpServletResponse resp = context.getClientResponse();
WindowNavigationalState windowNS = pageNS.getWindowNavigationalState(portlet.getContext().getId());
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, windowNS, portlet, req, resp);
+ PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portlet, req, resp);
//
if (windowNS == null)
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-05 00:22:45 UTC (rev 9755)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-05 01:13:32 UTC (rev 9756)
@@ -144,7 +144,7 @@
WindowNavigationalState windowNS = new WindowNavigationalState(portletNS, mode, windowState);
//
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, windowNS, portlet, req, resp);
+ PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portlet, req, resp);
//
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-05 00:22:45 UTC (rev 9755)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-05 01:13:32 UTC (rev 9756)
@@ -228,7 +228,7 @@
HttpServletResponse resp = context.getClientResponse();
//
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, windowNS, portlet, req, resp);
+ PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portlet, req, resp);
//
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), false);
16 years, 4 months
JBoss Portal SVN: r9755 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: controller and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 19:22:45 -0500 (Mon, 04 Feb 2008)
New Revision: 9755
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/WindowNavigationalState.java
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/MutablePageNavigationalState.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PageScopedFullPortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletActionRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRenderRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletScopedPortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
Log:
move WindowNavigationalState to controller package
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java 2008-02-04 23:43:59 UTC (rev 9754)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortletURLRenderer.java 2008-02-05 00:22:45 UTC (rev 9755)
@@ -36,6 +36,7 @@
import org.jboss.portal.portlet.cache.CacheLevel;
import static org.jboss.portal.portlet.test.URLParameterConstants.*;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/MutablePageNavigationalState.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/MutablePageNavigationalState.java 2008-02-04 23:43:59 UTC (rev 9754)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/MutablePageNavigationalState.java 2008-02-05 00:22:45 UTC (rev 9755)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.test.controller;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import javax.xml.namespace.QName;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java 2008-02-04 23:43:59 UTC (rev 9754)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java 2008-02-05 00:22:45 UTC (rev 9755)
@@ -24,7 +24,7 @@
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.info.ParameterInfo;
import javax.xml.namespace.QName;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-04 23:43:59 UTC (rev 9754)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-05 00:22:45 UTC (rev 9755)
@@ -29,7 +29,7 @@
import org.jboss.portal.portlet.test.PortletURLRenderer;
import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import org.jboss.portal.portlet.test.TestInstanceContext;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.TestPortalContext;
import static org.jboss.portal.portlet.test.controller.PortletController.*;
import org.jboss.portal.portlet.test.controller.event.Event;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-04 23:43:59 UTC (rev 9754)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-05 00:22:45 UTC (rev 9755)
@@ -42,7 +42,7 @@
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.test.PortletURLRenderer;
import org.jboss.portal.portlet.test.TestInstanceContext;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.TestPortalContext;
import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import static org.jboss.portal.portlet.test.controller.PortletController.*;
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/WindowNavigationalState.java (from rev 9754, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/WindowNavigationalState.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/WindowNavigationalState.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/WindowNavigationalState.java 2008-02-05 00:22:45 UTC (rev 9755)
@@ -0,0 +1,75 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.portlet.StateString;
+
+import java.io.Serializable;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class WindowNavigationalState implements Serializable
+{
+
+ /** . */
+ private final StateString portletNavigationalState;
+
+ /** . */
+ private final Mode mode;
+
+ /** . */
+ private final WindowState windowState;
+
+ public WindowNavigationalState()
+ {
+ this.portletNavigationalState = null;
+ this.mode = Mode.VIEW;
+ this.windowState = WindowState.NORMAL;
+ }
+
+ public WindowNavigationalState(StateString portletNavigationalState, Mode mode, WindowState windowState)
+ {
+ this.portletNavigationalState = portletNavigationalState;
+ this.mode = mode;
+ this.windowState = windowState;
+ }
+
+ public StateString getPortletNavigationalState()
+ {
+ return portletNavigationalState;
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PageScopedFullPortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PageScopedFullPortletResourceRequest.java 2008-02-04 23:43:59 UTC (rev 9754)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PageScopedFullPortletResourceRequest.java 2008-02-05 00:22:45 UTC (rev 9755)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.test.controller.request;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
import org.jboss.portal.common.util.ParameterMap;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletActionRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletActionRequest.java 2008-02-04 23:43:59 UTC (rev 9754)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletActionRequest.java 2008-02-05 00:22:45 UTC (rev 9755)
@@ -23,7 +23,7 @@
package org.jboss.portal.portlet.test.controller.request;
import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
import org.jboss.portal.common.util.ParameterMap;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRenderRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRenderRequest.java 2008-02-04 23:43:59 UTC (rev 9754)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRenderRequest.java 2008-02-05 00:22:45 UTC (rev 9755)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.test.controller.request;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRequest.java 2008-02-04 23:43:59 UTC (rev 9754)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRequest.java 2008-02-05 00:22:45 UTC (rev 9755)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.test.controller.request;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletScopedPortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletScopedPortletResourceRequest.java 2008-02-04 23:43:59 UTC (rev 9754)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletScopedPortletResourceRequest.java 2008-02-05 00:22:45 UTC (rev 9755)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.test.controller.request;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.common.util.ParameterMap;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-04 23:43:59 UTC (rev 9754)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-05 00:22:45 UTC (rev 9755)
@@ -43,7 +43,7 @@
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
import org.jboss.portal.portlet.test.PortletURLRenderer;
import org.jboss.portal.portlet.test.TestInstanceContext;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.TestPortalContext;
import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-04 23:43:59 UTC (rev 9754)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-05 00:22:45 UTC (rev 9755)
@@ -38,7 +38,7 @@
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.test.StringCodec;
import static org.jboss.portal.portlet.test.URLParameterConstants.*;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.WindowNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
import org.jboss.portal.portlet.test.controller.request.PortletRenderRequest;
16 years, 4 months
JBoss Portal SVN: r9754 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: controller2 and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 18:43:59 -0500 (Mon, 04 Feb 2008)
New Revision: 9754
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
Log:
the PortletControllerContext does not need to define access to a list of portlets
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java 2008-02-04 23:36:42 UTC (rev 9753)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java 2008-02-04 23:43:59 UTC (rev 9754)
@@ -31,7 +31,6 @@
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import java.util.Collection;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -50,8 +49,6 @@
PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException;
- Collection<Portlet> getPortlets() throws PortletInvokerException;
-
EventControllerContext getEventControllerContext();
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-04 23:36:42 UTC (rev 9753)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-04 23:43:59 UTC (rev 9754)
@@ -141,7 +141,7 @@
//
try
{
- Collection<Portlet> portlets = context.getPortlets();
+ Collection<Portlet> portlets = ((PortletControllerContextImpl)context).getPortlets();
int capacity = portlets.size();
fragments = new ArrayList<FragmentResponse>(capacity);
16 years, 4 months
JBoss Portal SVN: r9753 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: controller/request and 1 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 18:36:42 -0500 (Mon, 04 Feb 2008)
New Revision: 9753
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/ContainerRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/ControllerRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/FullScopedCacheablePortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PageScopedFullPortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletActionRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRenderRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletScopedPortletResourceRequest.java
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ContainerRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FullScopedCacheablePortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageScopedFullPortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletActionRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRenderRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletScopedPortletResourceRequest.java
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
Log:
move all request to a request package for more readability
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ContainerRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ContainerRequest.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ContainerRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -1,42 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test.controller;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ContainerRequest extends ControllerRequest
-{
-
- /** . */
- final String portletId;
-
- ContainerRequest(PortletControllerContext controllerContext, String portletId)
- {
- super(controllerContext);
-
- //
- this.portletId = portletId;
- }
-}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerRequest.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -1,38 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test.controller;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class ControllerRequest
-{
- /** . */
- final PortletControllerContext controllerContext;
-
- ControllerRequest(PortletControllerContext controllerContext)
- {
- this.controllerContext = controllerContext;
- }
-}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FullScopedCacheablePortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FullScopedCacheablePortletResourceRequest.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FullScopedCacheablePortletResourceRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -1,44 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.common.util.ParameterMap;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class FullScopedCacheablePortletResourceRequest extends PortletResourceRequest
-{
-
- public FullScopedCacheablePortletResourceRequest(
- PortletControllerContext controllerContext,
- String portletId,
- String resourceId,
- StateString resourceState,
- ParameterMap bodyParameters)
- {
- super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
- }
-}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageScopedFullPortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageScopedFullPortletResourceRequest.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageScopedFullPortletResourceRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -1,58 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
-import org.jboss.portal.common.util.ParameterMap;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PageScopedFullPortletResourceRequest extends PortletScopedPortletResourceRequest
-{
-
- /** . */
- private final PageNavigationalState pageState;
-
- public PageScopedFullPortletResourceRequest(
- PortletControllerContext controllerContext,
- String portletId,
- String resourceId,
- StateString resourceState,
- ParameterMap bodyParameters,
- PageNavigationalState pageState,
- WindowNavigationalState windowNavigationalState)
- {
- super(controllerContext, portletId, resourceId, resourceState, bodyParameters, windowNavigationalState);
-
- //
- this.pageState = pageState;
- }
-
- PageNavigationalState getPageState()
- {
- return pageState;
- }
-}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletActionRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletActionRequest.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletActionRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -1,56 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
-import org.jboss.portal.common.util.ParameterMap;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletActionRequest extends PortletRequest
-{
-
- /** . */
- final StateString interactionState;
-
- /** . */
- final ParameterMap bodyParameters;
-
- public PortletActionRequest(
- PortletControllerContext controllerContext,
- String portletId,
- StateString interactionState,
- ParameterMap bodyParameters,
- WindowNavigationalState windowNavigationalState,
- PageNavigationalState pageState)
- {
- super(controllerContext, portletId, windowNavigationalState, pageState);
-
- //
- this.interactionState = interactionState;
- this.bodyParameters = bodyParameters;
- }
-}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -25,6 +25,9 @@
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.common.util.MediaType;
import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.test.controller.request.ControllerRequest;
+import org.jboss.portal.portlet.test.controller.request.PortletRequest;
+import org.jboss.portal.portlet.test.controller.request.PortletResourceRequest;
import java.io.IOException;
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRenderRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRenderRequest.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRenderRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -1,51 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.portlet.test.WindowNavigationalState;
-
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletRenderRequest extends PortletRequest
-{
-
- /** . */
- final Map<String, String[]> publicNavigationalStateChanges;
-
- public PortletRenderRequest(
- PortletControllerContext controllerContext,
- String portletId,
- WindowNavigationalState windowNavigationalState,
- Map<String, String[]> publicNavigationalStateChanges,
- PageNavigationalState pageState)
- {
- super(controllerContext, portletId, windowNavigationalState, pageState);
-
- //
- this.publicNavigationalStateChanges = publicNavigationalStateChanges;
- }
-}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequest.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -1,52 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.portlet.test.WindowNavigationalState;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletRequest extends ContainerRequest
-{
-
- /** . */
- final PageNavigationalState pageState;
-
- /** . */
- final WindowNavigationalState windowNavigationalState;
-
- PortletRequest(
- PortletControllerContext controllerContext,
- String portletId,
- WindowNavigationalState windowNavigationalState,
- PageNavigationalState pageState)
- {
- super(controllerContext, portletId);
-
- //
- this.windowNavigationalState = windowNavigationalState;
- this.pageState = pageState;
- }
-}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -34,6 +34,10 @@
import static org.jboss.portal.portlet.test.controller.PortletController.*;
import org.jboss.portal.portlet.test.controller.event.Event;
import org.jboss.portal.portlet.test.controller.event.EventControllerContext;
+import org.jboss.portal.portlet.test.controller.request.ControllerRequest;
+import org.jboss.portal.portlet.test.controller.request.PortletActionRequest;
+import org.jboss.portal.portlet.test.controller.request.PortletRenderRequest;
+import org.jboss.portal.portlet.test.controller.request.PortletRequest;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
@@ -68,15 +72,15 @@
ControllerResponse processResponse(PortletRequest portletRequest, PortletInvocationResponse response) throws IOException, PortletInvokerException
{
- PortletControllerContext context = portletRequest.controllerContext;
+ PortletControllerContext context = portletRequest.getControllerContext();
// The page navigational state we will operate on during the request
// Either we have nothing in the request so we create a new one
// Or we have one but we copy it as we should not modify the input state provided
- MutablePageNavigationalState pageState = portletRequest.pageState == null ? new MutablePageNavigationalState() : new MutablePageNavigationalState(portletRequest.pageState);
+ MutablePageNavigationalState pageState = portletRequest.getPageState() == null ? new MutablePageNavigationalState() : new MutablePageNavigationalState(portletRequest.getPageState());
//
- PortletContext portletContext = portletRequest.controllerContext.getPortlet(portletRequest.portletId).getContext();
+ PortletContext portletContext = portletRequest.getControllerContext().getPortlet(portletRequest.getPortletId()).getContext();
//
ResponseProperties requestProperties = new ResponseProperties();
@@ -90,7 +94,7 @@
{
// Update portlet NS
UpdateNavigationalStateResponse updateResponse = (UpdateNavigationalStateResponse)response;
- updateNavigationalState(context, portletRequest.portletId, updateResponse, pageState);
+ updateNavigationalState(context, portletRequest.getPortletId(), updateResponse, pageState);
//
ResponseProperties update = updateResponse.getProperties();
@@ -168,8 +172,8 @@
PortletInvocationResponse invoke(PortletRequest portletRequest) throws PortletInvokerException
{
- PortletControllerContext context = portletRequest.controllerContext;
- Portlet portlet = context.getPortlet(portletRequest.portletId);
+ PortletControllerContext context = portletRequest.getControllerContext();
+ Portlet portlet = context.getPortlet(portletRequest.getPortletId());
HttpServletRequest req = context.getClientRequest();
HttpServletResponse resp = context.getClientResponse();
@@ -180,10 +184,10 @@
//
UpdateNavigationalStateResponse updateNavigationalState = new UpdateNavigationalStateResponse();
- updateNavigationalState.setMode(portletRenderRequest.windowNavigationalState.getMode());
- updateNavigationalState.setWindowState(portletRenderRequest.windowNavigationalState.getWindowState());
- updateNavigationalState.setNavigationalState(portletRenderRequest.windowNavigationalState.getPortletNavigationalState());
- updateNavigationalState.setPublicNavigationalStateUpdates(portletRenderRequest.publicNavigationalStateChanges);
+ updateNavigationalState.setMode(portletRenderRequest.getWindowNavigationalState().getMode());
+ updateNavigationalState.setWindowState(portletRenderRequest.getWindowNavigationalState().getWindowState());
+ updateNavigationalState.setNavigationalState(portletRenderRequest.getWindowNavigationalState().getPortletNavigationalState());
+ updateNavigationalState.setPublicNavigationalStateUpdates(portletRenderRequest.getPublicNavigationalStateChanges());
//
return updateNavigationalState;
@@ -193,17 +197,17 @@
PortletActionRequest portletActionRequest = (PortletActionRequest)portletRequest;
//
- PageNavigationalState pageNS = portletActionRequest.pageState;
+ PageNavigationalState pageNS = portletActionRequest.getPageState();
//
- Mode mode = portletActionRequest.windowNavigationalState.getMode();
+ Mode mode = portletActionRequest.getWindowNavigationalState().getMode();
if (mode == null)
{
mode = Mode.VIEW;
}
//
- WindowState windowState = portletActionRequest.windowNavigationalState.getWindowState();
+ WindowState windowState = portletActionRequest.getWindowNavigationalState().getWindowState();
if (windowState == null)
{
windowState = WindowState.NORMAL;
@@ -213,7 +217,7 @@
ParameterMap publicNS = pageNS.getPublicNavigationalState(portlet);
//
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portletActionRequest.windowNavigationalState, portlet, req, resp);
+ PortletURLRenderer renderer = new PortletURLRenderer(pageNS, portletActionRequest.getWindowNavigationalState(), portlet, req, resp);
//
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
@@ -223,10 +227,10 @@
//
actionInvocation.setMode(mode);
actionInvocation.setWindowState(windowState);
- actionInvocation.setNavigationalState(portletActionRequest.windowNavigationalState.getPortletNavigationalState());
+ actionInvocation.setNavigationalState(portletActionRequest.getWindowNavigationalState().getPortletNavigationalState());
actionInvocation.setPublicNavigationalState(publicNS);
- actionInvocation.setInteractionState(portletActionRequest.interactionState);
- actionInvocation.setForm(portletActionRequest.bodyParameters != null ? ParameterMap.clone(portletActionRequest.bodyParameters) : null);
+ actionInvocation.setInteractionState(portletActionRequest.getInteractionState());
+ actionInvocation.setForm(portletActionRequest.getBodyParameters() != null ? ParameterMap.clone(portletActionRequest.getBodyParameters()) : null);
//
actionInvocation.setClientContext(new AbstractClientContext(req));
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequest.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -1,78 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.portlet.cache.CacheLevel;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.common.util.ParameterMap;
-
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletResourceRequest extends ContainerRequest
-{
-
- /** . */
- private static final Map<Class, CacheLevel> cacheability = new HashMap<Class, CacheLevel>();
-
- static
- {
- cacheability.put(FullScopedCacheablePortletResourceRequest.class, CacheLevel.FULL);
- cacheability.put(PortletScopedPortletResourceRequest.class, CacheLevel.PORTLET);
- cacheability.put(PageScopedFullPortletResourceRequest.class, CacheLevel.PAGE);
- }
-
- /** . */
- final String resourceId;
-
- /** . */
- final StateString resourceState;
-
- /** . */
- final ParameterMap bodyParameters;
-
- PortletResourceRequest(
- PortletControllerContext controllerContext,
- String portletId,
- String resourceId,
- StateString resourceState,
- ParameterMap bodyParameters
- )
- {
- super(controllerContext, portletId);
-
- //
- this.resourceId = resourceId;
- this.resourceState = resourceState;
- this.bodyParameters = bodyParameters;
- }
-
- public CacheLevel getCacheabilityType()
- {
- return cacheability.get(getClass());
- }
-}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -46,6 +46,10 @@
import org.jboss.portal.portlet.test.TestPortalContext;
import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import static org.jboss.portal.portlet.test.controller.PortletController.*;
+import org.jboss.portal.portlet.test.controller.request.ControllerRequest;
+import org.jboss.portal.portlet.test.controller.request.PageScopedFullPortletResourceRequest;
+import org.jboss.portal.portlet.test.controller.request.PortletResourceRequest;
+import org.jboss.portal.portlet.test.controller.request.PortletScopedPortletResourceRequest;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@@ -90,8 +94,8 @@
StateString portletNS = null;
CacheLevel cacheability;
- PortletControllerContext context = portletResourceRequest.controllerContext;
- Portlet portlet = context.getPortlet(portletResourceRequest.portletId);
+ PortletControllerContext context = portletResourceRequest.getControllerContext();
+ Portlet portlet = context.getPortlet(portletResourceRequest.getPortletId());
HttpServletRequest req = context.getClientRequest();
HttpServletResponse resp = context.getClientResponse();
@@ -99,9 +103,9 @@
if (portletResourceRequest instanceof PortletScopedPortletResourceRequest)
{
PortletScopedPortletResourceRequest portletScopedRequest = (PortletScopedPortletResourceRequest)portletResourceRequest;
- mode = portletScopedRequest.windowNavigationalState.getMode();
- windowState = portletScopedRequest.windowNavigationalState.getWindowState();
- portletNS = portletScopedRequest.windowNavigationalState.getPortletNavigationalState();
+ mode = portletScopedRequest.getWindowNavigationalState().getMode();
+ windowState = portletScopedRequest.getWindowNavigationalState().getWindowState();
+ portletNS = portletScopedRequest.getWindowNavigationalState().getPortletNavigationalState();
//
if (portletResourceRequest instanceof PageScopedFullPortletResourceRequest)
@@ -148,14 +152,14 @@
ResourceInvocation resourceInvocation = new ResourceInvocation(resourceInvocationContext);
//
- resourceInvocation.setResourceId(portletResourceRequest.resourceId);
+ resourceInvocation.setResourceId(portletResourceRequest.getResourceId());
resourceInvocation.setCacheLevel(cacheability);
resourceInvocation.setMode(mode);
resourceInvocation.setWindowState(windowState);
resourceInvocation.setNavigationalState(portletNS);
resourceInvocation.setPublicNavigationalState(publicNS);
- resourceInvocation.setResourceState(portletResourceRequest.resourceState);
- resourceInvocation.setForm(portletResourceRequest.bodyParameters != null ? ParameterMap.clone(portletResourceRequest.bodyParameters) : null);
+ resourceInvocation.setResourceState(portletResourceRequest.getResourceState());
+ resourceInvocation.setForm(portletResourceRequest.getBodyParameters() != null ? ParameterMap.clone(portletResourceRequest.getBodyParameters()) : null);
//
resourceInvocation.setClientContext(new AbstractClientContext(req));
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletScopedPortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletScopedPortletResourceRequest.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletScopedPortletResourceRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -1,52 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.portlet.test.WindowNavigationalState;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.common.util.ParameterMap;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletScopedPortletResourceRequest extends FullScopedCacheablePortletResourceRequest
-{
-
- /** . */
- final WindowNavigationalState windowNavigationalState;
-
- public PortletScopedPortletResourceRequest(
- PortletControllerContext controllerContext,
- String portletId,
- String resourceId,
- StateString resourceState,
- ParameterMap bodyParameters,
- WindowNavigationalState windowNavigationalState)
- {
- super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
-
- //
- this.windowNavigationalState = windowNavigationalState;
- }
-}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -6,6 +6,7 @@
import org.apache.log4j.Logger;
import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.test.controller.request.ControllerRequest;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import java.io.IOException;
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/ContainerRequest.java (from rev 9750, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ContainerRequest.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/ContainerRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/ContainerRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -0,0 +1,49 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller.request;
+
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContainerRequest extends ControllerRequest
+{
+
+ /** . */
+ private final String portletId;
+
+ ContainerRequest(PortletControllerContext controllerContext, String portletId)
+ {
+ super(controllerContext);
+
+ //
+ this.portletId = portletId;
+ }
+
+ public String getPortletId()
+ {
+ return portletId;
+ }
+}
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/ControllerRequest.java (from rev 9750, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerRequest.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/ControllerRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/ControllerRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller.request;
+
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ControllerRequest
+{
+
+ /** . */
+ private final PortletControllerContext controllerContext;
+
+ ControllerRequest(PortletControllerContext controllerContext)
+ {
+ this.controllerContext = controllerContext;
+ }
+
+ public PortletControllerContext getControllerContext()
+ {
+ return controllerContext;
+ }
+}
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/FullScopedCacheablePortletResourceRequest.java (from rev 9750, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FullScopedCacheablePortletResourceRequest.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/FullScopedCacheablePortletResourceRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/FullScopedCacheablePortletResourceRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -0,0 +1,45 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller.request;
+
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+import org.jboss.portal.common.util.ParameterMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class FullScopedCacheablePortletResourceRequest extends PortletResourceRequest
+{
+
+ public FullScopedCacheablePortletResourceRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ String resourceId,
+ StateString resourceState,
+ ParameterMap bodyParameters)
+ {
+ super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
+ }
+}
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PageScopedFullPortletResourceRequest.java (from rev 9750, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageScopedFullPortletResourceRequest.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PageScopedFullPortletResourceRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PageScopedFullPortletResourceRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller.request;
+
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+import org.jboss.portal.common.util.ParameterMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PageScopedFullPortletResourceRequest extends PortletScopedPortletResourceRequest
+{
+
+ /** . */
+ private final PageNavigationalState pageState;
+
+ public PageScopedFullPortletResourceRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ String resourceId,
+ StateString resourceState,
+ ParameterMap bodyParameters,
+ PageNavigationalState pageState,
+ WindowNavigationalState windowNavigationalState)
+ {
+ super(controllerContext, portletId, resourceId, resourceState, bodyParameters, windowNavigationalState);
+
+ //
+ this.pageState = pageState;
+ }
+
+ public PageNavigationalState getPageState()
+ {
+ return pageState;
+ }
+}
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletActionRequest.java (from rev 9750, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletActionRequest.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletActionRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletActionRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller.request;
+
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+import org.jboss.portal.common.util.ParameterMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletActionRequest extends PortletRequest
+{
+
+ /** . */
+ private final StateString interactionState;
+
+ /** . */
+ private final ParameterMap bodyParameters;
+
+ public PortletActionRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ StateString interactionState,
+ ParameterMap bodyParameters,
+ WindowNavigationalState windowNavigationalState,
+ PageNavigationalState pageState)
+ {
+ super(controllerContext, portletId, windowNavigationalState, pageState);
+
+ //
+ this.interactionState = interactionState;
+ this.bodyParameters = bodyParameters;
+ }
+
+ public StateString getInteractionState()
+ {
+ return interactionState;
+ }
+
+ public ParameterMap getBodyParameters()
+ {
+ return bodyParameters;
+ }
+}
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRenderRequest.java (from rev 9750, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRenderRequest.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRenderRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRenderRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller.request;
+
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletRenderRequest extends PortletRequest
+{
+
+ /** . */
+ private final Map<String, String[]> publicNavigationalStateChanges;
+
+ public PortletRenderRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ WindowNavigationalState windowNavigationalState,
+ Map<String, String[]> publicNavigationalStateChanges,
+ PageNavigationalState pageState)
+ {
+ super(controllerContext, portletId, windowNavigationalState, pageState);
+
+ //
+ this.publicNavigationalStateChanges = publicNavigationalStateChanges;
+ }
+
+ public Map<String, String[]> getPublicNavigationalStateChanges()
+ {
+ return publicNavigationalStateChanges;
+ }
+}
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRequest.java (from rev 9750, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequest.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller.request;
+
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletRequest extends ContainerRequest
+{
+
+ /** . */
+ private final PageNavigationalState pageState;
+
+ /** . */
+ private final WindowNavigationalState windowNavigationalState;
+
+ PortletRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ WindowNavigationalState windowNavigationalState,
+ PageNavigationalState pageState)
+ {
+ super(controllerContext, portletId);
+
+ //
+ this.windowNavigationalState = windowNavigationalState;
+ this.pageState = pageState;
+ }
+
+ public PageNavigationalState getPageState()
+ {
+ return pageState;
+ }
+
+ public WindowNavigationalState getWindowNavigationalState()
+ {
+ return windowNavigationalState;
+ }
+}
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletResourceRequest.java (from rev 9750, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequest.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletResourceRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletResourceRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -0,0 +1,94 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller.request;
+
+import org.jboss.portal.portlet.cache.CacheLevel;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+import org.jboss.portal.common.util.ParameterMap;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletResourceRequest extends ContainerRequest
+{
+
+ /** . */
+ private static final Map<Class, CacheLevel> cacheability = new HashMap<Class, CacheLevel>();
+
+ static
+ {
+ cacheability.put(FullScopedCacheablePortletResourceRequest.class, CacheLevel.FULL);
+ cacheability.put(PortletScopedPortletResourceRequest.class, CacheLevel.PORTLET);
+ cacheability.put(PageScopedFullPortletResourceRequest.class, CacheLevel.PAGE);
+ }
+
+ /** . */
+ private final String resourceId;
+
+ /** . */
+ private final StateString resourceState;
+
+ /** . */
+ private final ParameterMap bodyParameters;
+
+ PortletResourceRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ String resourceId,
+ StateString resourceState,
+ ParameterMap bodyParameters
+ )
+ {
+ super(controllerContext, portletId);
+
+ //
+ this.resourceId = resourceId;
+ this.resourceState = resourceState;
+ this.bodyParameters = bodyParameters;
+ }
+
+ public CacheLevel getCacheabilityType()
+ {
+ return cacheability.get(getClass());
+ }
+
+ public String getResourceId()
+ {
+ return resourceId;
+ }
+
+ public StateString getResourceState()
+ {
+ return resourceState;
+ }
+
+ public ParameterMap getBodyParameters()
+ {
+ return bodyParameters;
+ }
+}
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletScopedPortletResourceRequest.java (from rev 9750, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletScopedPortletResourceRequest.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletScopedPortletResourceRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/request/PortletScopedPortletResourceRequest.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller.request;
+
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.common.util.ParameterMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletScopedPortletResourceRequest extends FullScopedCacheablePortletResourceRequest
+{
+
+ /** . */
+ private final WindowNavigationalState windowNavigationalState;
+
+ public PortletScopedPortletResourceRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ String resourceId,
+ StateString resourceState,
+ ParameterMap bodyParameters,
+ WindowNavigationalState windowNavigationalState)
+ {
+ super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
+
+ //
+ this.windowNavigationalState = windowNavigationalState;
+ }
+
+ public WindowNavigationalState getWindowNavigationalState()
+ {
+ return windowNavigationalState;
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-04 22:59:50 UTC (rev 9752)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-04 23:36:42 UTC (rev 9753)
@@ -41,12 +41,12 @@
import org.jboss.portal.portlet.test.WindowNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
-import org.jboss.portal.portlet.test.controller.PortletRenderRequest;
-import org.jboss.portal.portlet.test.controller.ControllerRequest;
-import org.jboss.portal.portlet.test.controller.PortletScopedPortletResourceRequest;
-import org.jboss.portal.portlet.test.controller.FullScopedCacheablePortletResourceRequest;
-import org.jboss.portal.portlet.test.controller.PageScopedFullPortletResourceRequest;
-import org.jboss.portal.portlet.test.controller.PortletActionRequest;
+import org.jboss.portal.portlet.test.controller.request.PortletRenderRequest;
+import org.jboss.portal.portlet.test.controller.request.ControllerRequest;
+import org.jboss.portal.portlet.test.controller.request.PortletScopedPortletResourceRequest;
+import org.jboss.portal.portlet.test.controller.request.FullScopedCacheablePortletResourceRequest;
+import org.jboss.portal.portlet.test.controller.request.PageScopedFullPortletResourceRequest;
+import org.jboss.portal.portlet.test.controller.request.PortletActionRequest;
import org.jboss.portal.portlet.test.controller.event.EventControllerContext;
import org.jboss.portal.portlet.test.controller.event.EventControllerContextImpl;
import org.jboss.portal.web.Body;
16 years, 4 months
JBoss Portal SVN: r9752 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: controller and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 17:59:50 -0500 (Mon, 04 Feb 2008)
New Revision: 9752
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/event/
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/Event.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/EventControllerContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/EventControllerContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
Log:
moved controller event package as a child of the controller package
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java 2008-02-04 22:54:01 UTC (rev 9751)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContext.java 2008-02-04 22:59:50 UTC (rev 9752)
@@ -26,7 +26,7 @@
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.test.event.EventControllerContext;
+import org.jboss.portal.portlet.test.controller.event.EventControllerContext;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-04 22:54:01 UTC (rev 9751)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-04 22:59:50 UTC (rev 9752)
@@ -32,8 +32,8 @@
import org.jboss.portal.portlet.test.WindowNavigationalState;
import org.jboss.portal.portlet.test.TestPortalContext;
import static org.jboss.portal.portlet.test.controller.PortletController.*;
-import org.jboss.portal.portlet.test.event.Event;
-import org.jboss.portal.portlet.test.event.EventControllerContext;
+import org.jboss.portal.portlet.test.controller.event.Event;
+import org.jboss.portal.portlet.test.controller.event.EventControllerContext;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event (from rev 9748, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/event)
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/Event.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/event/Event.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/Event.java 2008-02-04 22:59:50 UTC (rev 9752)
@@ -20,7 +20,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.portlet.test.event;
+package org.jboss.portal.portlet.test.controller.event;
import org.jboss.portal.portlet.PortletContext;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/EventControllerContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/event/EventControllerContext.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/EventControllerContext.java 2008-02-04 22:59:50 UTC (rev 9752)
@@ -20,7 +20,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.portlet.test.event;
+package org.jboss.portal.portlet.test.controller.event;
import java.util.List;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/EventControllerContextImpl.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/event/EventControllerContextImpl.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/event/EventControllerContextImpl.java 2008-02-04 22:59:50 UTC (rev 9752)
@@ -20,7 +20,7 @@
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
* 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
******************************************************************************/
-package org.jboss.portal.portlet.test.event;
+package org.jboss.portal.portlet.test.controller.event;
import org.jboss.portal.portlet.PortletInvoker;
import org.jboss.portal.portlet.Portlet;
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-04 22:54:01 UTC (rev 9751)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-04 22:59:50 UTC (rev 9752)
@@ -47,8 +47,8 @@
import org.jboss.portal.portlet.test.controller.FullScopedCacheablePortletResourceRequest;
import org.jboss.portal.portlet.test.controller.PageScopedFullPortletResourceRequest;
import org.jboss.portal.portlet.test.controller.PortletActionRequest;
-import org.jboss.portal.portlet.test.event.EventControllerContext;
-import org.jboss.portal.portlet.test.event.EventControllerContextImpl;
+import org.jboss.portal.portlet.test.controller.event.EventControllerContext;
+import org.jboss.portal.portlet.test.controller.event.EventControllerContextImpl;
import org.jboss.portal.web.Body;
import org.jboss.portal.web.IllegalRequestException;
import org.jboss.portal.web.WebRequest;
16 years, 4 months
JBoss Portal SVN: r9751 - in modules/portlet/trunk: portlet/src/main/java/org/jboss/portal/portlet/impl/spi and 7 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 17:54:01 -0500 (Mon, 04 Feb 2008)
New Revision: 9751
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java
Removed:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractEventContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractResourceContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ActionContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/EventContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/RenderContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ResourceInvocationContext.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/ActionContextSupport.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/RenderContextSupport.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ResourceTestContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestActionContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestEventContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestRenderContext.java
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ResourceRequestParameterMap.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ActionInvocation.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/EventInvocation.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/RenderInvocation.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ResourceInvocation.java
modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/ActionContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
Log:
removed a bunch of obsolete classes
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ResourceRequestParameterMap.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ResourceRequestParameterMap.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/ResourceRequestParameterMap.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -24,7 +24,6 @@
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.portlet.info.NavigationInfo;
-import org.jboss.portal.portlet.spi.ResourceInvocationContext;
import org.jboss.portal.portlet.invocation.ResourceInvocation;
/**
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractActionContext.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,38 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.impl.spi;
-
-import org.jboss.portal.portlet.spi.ActionContext;
-import org.jboss.portal.common.util.MarkupInfo;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractActionContext extends AbstractPortletInvocationContext implements ActionContext
-{
- protected AbstractActionContext(MarkupInfo markupInfo)
- {
- super(markupInfo);
- }
-}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractEventContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractEventContext.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractEventContext.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,39 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.impl.spi;
-
-import org.jboss.portal.portlet.spi.EventContext;
-import org.jboss.portal.common.util.MarkupInfo;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractEventContext extends AbstractPortletInvocationContext implements EventContext
-{
-
- protected AbstractEventContext(MarkupInfo markupInfo)
- {
- super(markupInfo);
- }
-}
\ No newline at end of file
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractRenderContext.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,39 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.impl.spi;
-
-import org.jboss.portal.portlet.spi.RenderContext;
-import org.jboss.portal.common.util.MarkupInfo;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public abstract class AbstractRenderContext extends AbstractPortletInvocationContext implements RenderContext
-{
-
- protected AbstractRenderContext(MarkupInfo markupInfo)
- {
- super(markupInfo);
- }
-}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractResourceContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractResourceContext.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/spi/AbstractResourceContext.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,39 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.impl.spi;
-
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.portlet.spi.ResourceInvocationContext;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public abstract class AbstractResourceContext extends AbstractPortletInvocationContext implements ResourceInvocationContext
-{
-
- public AbstractResourceContext(MarkupInfo markupInfo)
- {
- super(markupInfo);
- }
-}
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ActionInvocation.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ActionInvocation.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ActionInvocation.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.invocation;
-import org.jboss.portal.portlet.spi.ActionContext;
import org.jboss.portal.portlet.spi.RequestContext;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.common.util.ParameterMap;
@@ -34,9 +34,6 @@
public class ActionInvocation extends PortletInvocation
{
- /** . */
- private final ActionContext ctx;
-
/** The request context. */
protected RequestContext requestContext;
@@ -46,12 +43,9 @@
/** . */
protected ParameterMap form;
- public ActionInvocation(ActionContext ctx) throws IllegalArgumentException
+ public ActionInvocation(PortletInvocationContext ctx) throws IllegalArgumentException
{
super(ctx);
-
- //
- this.ctx = ctx;
}
public StateString getInteractionState()
@@ -74,11 +68,6 @@
this.form = form;
}
- public ActionContext getContext()
- {
- return ctx;
- }
-
public RequestContext getRequestContext()
{
return requestContext;
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/EventInvocation.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/EventInvocation.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/EventInvocation.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.invocation;
-import org.jboss.portal.portlet.spi.EventContext;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
import javax.xml.namespace.QName;
import java.io.Serializable;
@@ -35,27 +35,16 @@
{
/** . */
- private final EventContext ctx;
-
- /** . */
private QName name;
/** . */
private Serializable payload;
- public EventInvocation(EventContext ctx) throws IllegalArgumentException
+ public EventInvocation(PortletInvocationContext ctx) throws IllegalArgumentException
{
super(ctx);
-
- //
- this.ctx = ctx;
}
- public EventContext getContext()
- {
- return ctx;
- }
-
public QName getName()
{
return name;
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/RenderInvocation.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/RenderInvocation.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/RenderInvocation.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.portlet.invocation;
-import org.jboss.portal.portlet.spi.RenderContext;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -32,12 +32,9 @@
{
/** . */
- private final RenderContext ctx;
-
- /** . */
private String validationToken;
- public RenderInvocation(RenderContext ctx) throws IllegalArgumentException
+ public RenderInvocation(PortletInvocationContext ctx) throws IllegalArgumentException
{
super(ctx);
@@ -45,11 +42,6 @@
this.ctx = ctx;
}
- public RenderContext getContext()
- {
- return ctx;
- }
-
public String getValidationToken()
{
return validationToken;
Modified: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ResourceInvocation.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ResourceInvocation.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ResourceInvocation.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -22,8 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.invocation;
-import org.jboss.portal.portlet.spi.ResourceInvocationContext;
import org.jboss.portal.portlet.spi.RequestContext;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.cache.CacheLevel;
import org.jboss.portal.common.util.ParameterMap;
@@ -35,9 +35,6 @@
public class ResourceInvocation extends PortletInvocation
{
- /** . */
- private final ResourceInvocationContext ctx;
-
/** The request context. */
private RequestContext requestContext;
@@ -56,19 +53,11 @@
/** . */
private CacheLevel cacheLevel;
- public ResourceInvocation(ResourceInvocationContext ctx) throws IllegalArgumentException
+ public ResourceInvocation(PortletInvocationContext ctx) throws IllegalArgumentException
{
super(ctx);
-
- //
- this.ctx = ctx;
}
- public ResourceInvocationContext getContext()
- {
- return ctx;
- }
-
public String getValidationToken()
{
return validationToken;
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ActionContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ActionContext.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ActionContext.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,33 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.spi;
-
-/**
- * Extends the generic invocation context to provide action invocation specific input/services.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5976 $
- */
-public interface ActionContext extends PortletInvocationContext
-{
-}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/EventContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/EventContext.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/EventContext.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,31 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.spi;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface EventContext extends PortletInvocationContext
-{
-}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/RenderContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/RenderContext.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/RenderContext.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,33 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.spi;
-
-/**
- * Extends the generic invocation context to provide render invocation specific input/services.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5976 $
- */
-public interface RenderContext extends PortletInvocationContext
-{
-}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ResourceInvocationContext.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ResourceInvocationContext.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/spi/ResourceInvocationContext.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,31 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.spi;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 630 $
- */
-public interface ResourceInvocationContext extends PortletInvocationContext
-{
-}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/ActionContextSupport.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/ActionContextSupport.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/ActionContextSupport.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,33 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.support.spi;
-
-import org.jboss.portal.portlet.spi.ActionContext;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5976 $
- */
-public class ActionContextSupport extends PortletInvocationContextSupport implements ActionContext
-{
-}
Deleted: modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/RenderContextSupport.java
===================================================================
--- modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/RenderContextSupport.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/support/spi/RenderContextSupport.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,33 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.support.spi;
-
-import org.jboss.portal.portlet.spi.RenderContext;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 5448 $
- */
-public class RenderContextSupport extends PortletInvocationContextSupport implements RenderContext
-{
-}
Modified: modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/ActionContextImpl.java
===================================================================
--- modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/ActionContextImpl.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/portlet/src/test/java/org/jboss/portal/test/portlet/state/ActionContextImpl.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -24,13 +24,14 @@
import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.support.spi.ActionContextSupport;
+import org.jboss.portal.portlet.support.spi.PortletInvocationContextSupport;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
* @version $Revision: 5113 $
*/
-public class ActionContextImpl extends ActionContextSupport
+public class ActionContextImpl extends PortletInvocationContextSupport implements PortletInvocationContext
{
public ActionContextImpl()
{
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ResourceTestContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ResourceTestContext.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/ResourceTestContext.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,74 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test;
-
-import org.jboss.portal.portlet.ContainerURL;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.impl.spi.AbstractResourceContext;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResolver;
-import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ResourceTestContext extends AbstractResourceContext
-{
-
- /** . */
- private final PortletURLRenderer urlRenderer;
-
- public ResourceTestContext(PortletURLRenderer urlRenderer, MarkupInfo markupInfo)
- {
- super(markupInfo);
-
- //
- this.urlRenderer = urlRenderer;
-
- //
- addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttributeResolver(urlRenderer.clientReq));
- addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolver());
- }
-
- public HttpServletRequest getClientRequest() throws IllegalStateException
- {
- return urlRenderer.clientReq;
- }
-
- public HttpServletResponse getClientResponse() throws IllegalStateException
- {
- return urlRenderer.clientResp;
- }
-
- public String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
- {
- return urlRenderer.renderURL(containerURL, wantSecure, wantAuthenticated, relative);
- }
-}
\ No newline at end of file
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestActionContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestActionContext.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestActionContext.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,74 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test;
-
-import org.jboss.portal.portlet.ContainerURL;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.impl.spi.AbstractActionContext;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResolver;
-import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestActionContext extends AbstractActionContext
-{
-
- /** . */
- private final PortletURLRenderer urlRenderer;
-
- public TestActionContext(PortletURLRenderer urlRenderer, MarkupInfo markupInfo)
- {
- super(markupInfo);
-
- //
- this.urlRenderer = urlRenderer;
-
- //
- addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttributeResolver(urlRenderer.clientReq));
- addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolver());
- }
-
- public HttpServletRequest getClientRequest() throws IllegalStateException
- {
- return urlRenderer.clientReq;
- }
-
- public HttpServletResponse getClientResponse() throws IllegalStateException
- {
- return urlRenderer.clientResp;
- }
-
- public String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
- {
- return urlRenderer.renderURL(containerURL, wantSecure, wantAuthenticated, relative);
- }
-}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestEventContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestEventContext.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestEventContext.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,80 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test;
-
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.ContainerURL;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.impl.spi.AbstractEventContext;
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.common.util.ParameterMap;
-import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResolver;
-import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import javax.xml.namespace.QName;
-import java.io.Serializable;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestEventContext extends AbstractEventContext
-{
-
- /** . */
- private final PortletURLRenderer urlRenderer;
-
- public TestEventContext(PortletURLRenderer urlRenderer, MarkupInfo markupInfo)
- {
- super(markupInfo);
-
- //
- this.urlRenderer = urlRenderer;
-
- //
- addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttributeResolver(urlRenderer.clientReq));
- addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolver());
- }
-
- public HttpServletRequest getClientRequest() throws IllegalStateException
- {
- return urlRenderer.clientReq;
- }
-
- public HttpServletResponse getClientResponse() throws IllegalStateException
- {
- return urlRenderer.clientResp;
- }
-
- public String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
- {
- return urlRenderer.renderURL(containerURL, wantSecure, wantAuthenticated, relative);
- }
-}
\ No newline at end of file
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java (from rev 9748, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestActionContext.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortletInvocationContext.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test;
+
+import org.jboss.portal.portlet.ContainerURL;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResolver;
+import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class TestPortletInvocationContext extends AbstractPortletInvocationContext
+{
+
+ /** . */
+ private final PortletURLRenderer urlRenderer;
+
+ public TestPortletInvocationContext(PortletURLRenderer urlRenderer, MarkupInfo markupInfo)
+ {
+ super(markupInfo);
+
+ //
+ this.urlRenderer = urlRenderer;
+
+ //
+ addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttributeResolver(urlRenderer.clientReq));
+ addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
+ addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttributeResolver());
+ addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttributeResolver());
+ addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolver());
+ }
+
+ public HttpServletRequest getClientRequest() throws IllegalStateException
+ {
+ return urlRenderer.clientReq;
+ }
+
+ public HttpServletResponse getClientResponse() throws IllegalStateException
+ {
+ return urlRenderer.clientResp;
+ }
+
+ public String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
+ {
+ return urlRenderer.renderURL(containerURL, wantSecure, wantAuthenticated, relative);
+ }
+}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestRenderContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestRenderContext.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestRenderContext.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -1,74 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test;
-
-import org.jboss.portal.portlet.ContainerURL;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.impl.spi.AbstractRenderContext;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.common.invocation.resolver.PrincipalAttributeResolver;
-import org.jboss.portal.common.invocation.resolver.MapAttributeResolver;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class TestRenderContext extends AbstractRenderContext
-{
-
- /** . */
- private final PortletURLRenderer urlRenderer;
-
- public TestRenderContext(PortletURLRenderer urlRenderer, MarkupInfo markupInfo)
- {
- super(markupInfo);
-
- //
- this.urlRenderer = urlRenderer;
-
- //
- addResolver(PortletInvocation.PRINCIPAL_SCOPE, new PrincipalAttributeResolver(urlRenderer.clientReq));
- addResolver(PortletInvocation.INVOCATION_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.REQUEST_PROPERTIES_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.RESPONSE_PROPERTIES_SCOPE, new MapAttributeResolver());
- addResolver(PortletInvocation.REQUEST_SCOPE, new MapAttributeResolver());
- }
-
- public HttpServletRequest getClientRequest() throws IllegalStateException
- {
- return urlRenderer.clientReq;
- }
-
- public HttpServletResponse getClientResponse() throws IllegalStateException
- {
- return urlRenderer.clientResp;
- }
-
- public String renderURL(ContainerURL containerURL, Boolean wantSecure, Boolean wantAuthenticated, boolean relative)
- {
- return urlRenderer.renderURL(containerURL, wantSecure, wantAuthenticated, relative);
- }
-}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -27,8 +27,7 @@
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
import org.jboss.portal.portlet.invocation.response.UpdateNavigationalStateResponse;
import org.jboss.portal.portlet.test.PortletURLRenderer;
-import org.jboss.portal.portlet.test.TestActionContext;
-import org.jboss.portal.portlet.test.TestEventContext;
+import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import org.jboss.portal.portlet.test.TestInstanceContext;
import org.jboss.portal.portlet.test.WindowNavigationalState;
import org.jboss.portal.portlet.test.TestPortalContext;
@@ -218,8 +217,8 @@
//
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
- TestActionContext actionContext = new TestActionContext(renderer, MARKUP_INFO);
- ActionInvocation actionInvocation = new ActionInvocation(actionContext);
+ TestPortletInvocationContext portletInvocationContext = new TestPortletInvocationContext(renderer, MARKUP_INFO);
+ ActionInvocation actionInvocation = new ActionInvocation(portletInvocationContext);
//
actionInvocation.setMode(mode);
@@ -273,7 +272,7 @@
//
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
- TestEventContext actionContext = new TestEventContext(renderer, MARKUP_INFO);
+ TestPortletInvocationContext actionContext = new TestPortletInvocationContext(renderer, MARKUP_INFO);
EventInvocation eventInvocation = new EventInvocation(actionContext);
//
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -40,12 +40,11 @@
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.spi.ResourceInvocationContext;
import org.jboss.portal.portlet.test.PortletURLRenderer;
-import org.jboss.portal.portlet.test.ResourceTestContext;
import org.jboss.portal.portlet.test.TestInstanceContext;
import org.jboss.portal.portlet.test.WindowNavigationalState;
import org.jboss.portal.portlet.test.TestPortalContext;
+import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import static org.jboss.portal.portlet.test.controller.PortletController.*;
import javax.servlet.http.HttpServletRequest;
@@ -145,7 +144,7 @@
//
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), true);
- ResourceInvocationContext resourceInvocationContext = new ResourceTestContext(renderer, MARKUP_INFO);
+ TestPortletInvocationContext resourceInvocationContext = new TestPortletInvocationContext(renderer, MARKUP_INFO);
ResourceInvocation resourceInvocation = new ResourceInvocation(resourceInvocationContext);
//
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-04 22:35:20 UTC (rev 9750)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-04 22:54:01 UTC (rev 9751)
@@ -43,9 +43,9 @@
import org.jboss.portal.portlet.invocation.response.ResponseProperties;
import org.jboss.portal.portlet.test.PortletURLRenderer;
import org.jboss.portal.portlet.test.TestInstanceContext;
-import org.jboss.portal.portlet.test.TestRenderContext;
import org.jboss.portal.portlet.test.WindowNavigationalState;
import org.jboss.portal.portlet.test.TestPortalContext;
+import org.jboss.portal.portlet.test.TestPortletInvocationContext;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
import org.jboss.portal.portlet.test.controller.PortletController;
@@ -232,7 +232,7 @@
//
TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), false);
- TestRenderContext renderContext = new TestRenderContext(renderer, PortletController.MARKUP_INFO);
+ TestPortletInvocationContext renderContext = new TestPortletInvocationContext(renderer, PortletController.MARKUP_INFO);
//
RenderInvocation render = new RenderInvocation(renderContext);
16 years, 4 months
JBoss Portal SVN: r9750 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test: controller2 and 1 other directory.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 17:35:20 -0500 (Mon, 04 Feb 2008)
New Revision: 9750
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ContainerRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FullScopedCacheablePortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageScopedFullPortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletActionRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRenderRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequest.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletScopedPortletResourceRequest.java
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderControllerResponse.java
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFragmentRenderer.java
Log:
removed inner classes ControllerRequest and its subclasses
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ContainerRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ContainerRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ContainerRequest.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ContainerRequest extends ControllerRequest
+{
+
+ /** . */
+ final String portletId;
+
+ ContainerRequest(PortletControllerContext controllerContext, String portletId)
+ {
+ super(controllerContext);
+
+ //
+ this.portletId = portletId;
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerRequest.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ControllerRequest
+{
+ /** . */
+ final PortletControllerContext controllerContext;
+
+ ControllerRequest(PortletControllerContext controllerContext)
+ {
+ this.controllerContext = controllerContext;
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java 2008-02-04 22:24:27 UTC (rev 9749)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -23,8 +23,6 @@
package org.jboss.portal.portlet.test.controller;
-import java.io.IOException;
-
/**
* Must be used as base class for high level response provided by the controller that will be translated into something
* at the portal level. The goal is to avoid to manipulate the HTTP response directly.
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FullScopedCacheablePortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FullScopedCacheablePortletResourceRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FullScopedCacheablePortletResourceRequest.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller;
+
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.common.util.ParameterMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class FullScopedCacheablePortletResourceRequest extends PortletResourceRequest
+{
+
+ public FullScopedCacheablePortletResourceRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ String resourceId,
+ StateString resourceState,
+ ParameterMap bodyParameters)
+ {
+ super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageScopedFullPortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageScopedFullPortletResourceRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageScopedFullPortletResourceRequest.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller;
+
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.common.util.ParameterMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PageScopedFullPortletResourceRequest extends PortletScopedPortletResourceRequest
+{
+
+ /** . */
+ private final PageNavigationalState pageState;
+
+ public PageScopedFullPortletResourceRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ String resourceId,
+ StateString resourceState,
+ ParameterMap bodyParameters,
+ PageNavigationalState pageState,
+ WindowNavigationalState windowNavigationalState)
+ {
+ super(controllerContext, portletId, resourceId, resourceState, bodyParameters, windowNavigationalState);
+
+ //
+ this.pageState = pageState;
+ }
+
+ PageNavigationalState getPageState()
+ {
+ return pageState;
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletActionRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletActionRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletActionRequest.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller;
+
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.common.util.ParameterMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletActionRequest extends PortletRequest
+{
+
+ /** . */
+ final StateString interactionState;
+
+ /** . */
+ final ParameterMap bodyParameters;
+
+ public PortletActionRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ StateString interactionState,
+ ParameterMap bodyParameters,
+ WindowNavigationalState windowNavigationalState,
+ PageNavigationalState pageState)
+ {
+ super(controllerContext, portletId, windowNavigationalState, pageState);
+
+ //
+ this.interactionState = interactionState;
+ this.bodyParameters = bodyParameters;
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java 2008-02-04 22:24:27 UTC (rev 9749)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -24,17 +24,9 @@
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.common.util.MediaType;
-import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.cache.CacheLevel;
-import org.jboss.portal.portlet.impl.spi.AbstractPortalContext;
-import org.jboss.portal.portlet.spi.PortalContext;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -46,17 +38,6 @@
/** . */
public static final MarkupInfo MARKUP_INFO = new MarkupInfo(MediaType.HTML, "UTF8");
- /** . */
- static final PortalContext portalContext;
-
- static
- {
- Map<String, String> portalProperties = new HashMap<String, String>();
- portalProperties.put("javax.portlet.markup.head.element.support", "true");
-
- portalContext = new AbstractPortalContext(portalProperties);
- }
-
public ControllerResponse process(ControllerRequest controllerRequest) throws IOException, PortletInvokerException
{
RequestHandler handler;
@@ -76,196 +57,4 @@
return handler.handle(controllerRequest);
}
-
- public static class ControllerRequest
- {
- /** . */
- final PortletControllerContext controllerContext;
-
- ControllerRequest(PortletControllerContext controllerContext)
- {
- this.controllerContext = controllerContext;
- }
- }
-
- public static class ContainerRequest extends ControllerRequest
- {
- /** . */
- final String portletId;
-
- ContainerRequest(PortletControllerContext controllerContext, String portletId)
- {
- super(controllerContext);
-
- //
- this.portletId = portletId;
- }
- }
-
- public static class PortletRequest extends ContainerRequest
- {
- /** . */
- final PageNavigationalState pageState;
-
- /** . */
- final WindowNavigationalState windowNavigationalState;
-
- PortletRequest(
- PortletControllerContext controllerContext,
- String portletId,
- WindowNavigationalState windowNavigationalState,
- PageNavigationalState pageState)
- {
- super(controllerContext, portletId);
-
- //
- this.windowNavigationalState = windowNavigationalState;
- this.pageState = pageState;
- }
- }
-
- public static abstract class PortletResourceRequest extends ContainerRequest
- {
- /** . */
- private static final Map<Class, CacheLevel> cacheability = new HashMap<Class, CacheLevel>();
-
- static
- {
- cacheability.put(FullScopedCacheablePortletResourceRequest.class, CacheLevel.FULL);
- cacheability.put(PortletScopedPortletResourceRequest.class, CacheLevel.PORTLET);
- cacheability.put(PageScopedFullPortletResourceRequest.class, CacheLevel.PAGE);
- }
-
- /** . */
- final String resourceId;
-
- /** . */
- final StateString resourceState;
-
- /** . */
- final ParameterMap bodyParameters;
-
- PortletResourceRequest(
- PortletControllerContext controllerContext,
- String portletId,
- String resourceId,
- StateString resourceState,
- ParameterMap bodyParameters
- )
- {
- super(controllerContext, portletId);
-
- //
- this.resourceId = resourceId;
- this.resourceState = resourceState;
- this.bodyParameters = bodyParameters;
- }
-
- public CacheLevel getCacheabilityType()
- {
- return cacheability.get(getClass());
- }
- }
-
- public static class FullScopedCacheablePortletResourceRequest extends PortletResourceRequest
- {
- public FullScopedCacheablePortletResourceRequest(
- PortletControllerContext controllerContext,
- String portletId,
- String resourceId,
- StateString resourceState,
- ParameterMap bodyParameters)
- {
- super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
- }
- }
-
- public static class PortletScopedPortletResourceRequest extends FullScopedCacheablePortletResourceRequest
- {
- /** . */
- final WindowNavigationalState windowNavigationalState;
-
- public PortletScopedPortletResourceRequest(
- PortletControllerContext controllerContext,
- String portletId,
- String resourceId,
- StateString resourceState,
- ParameterMap bodyParameters,
- WindowNavigationalState windowNavigationalState)
- {
- super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
-
- //
- this.windowNavigationalState = windowNavigationalState;
- }
- }
-
- public static class PageScopedFullPortletResourceRequest extends PortletScopedPortletResourceRequest
- {
- /** . */
- private final PageNavigationalState pageState;
-
- public PageScopedFullPortletResourceRequest(
- PortletControllerContext controllerContext,
- String portletId,
- String resourceId,
- StateString resourceState,
- ParameterMap bodyParameters,
- PageNavigationalState pageState,
- WindowNavigationalState windowNavigationalState)
- {
- super(controllerContext, portletId, resourceId, resourceState, bodyParameters, windowNavigationalState);
-
- //
- this.pageState = pageState;
- }
-
- PageNavigationalState getPageState()
- {
- return pageState;
- }
- }
-
- public static class PortletActionRequest extends PortletRequest
- {
- /** . */
- final StateString interactionState;
-
- /** . */
- final ParameterMap bodyParameters;
-
- public PortletActionRequest(
- PortletControllerContext controllerContext,
- String portletId,
- StateString interactionState,
- ParameterMap bodyParameters,
- WindowNavigationalState windowNavigationalState,
- PageNavigationalState pageState)
- {
- super(controllerContext, portletId, windowNavigationalState, pageState);
-
- //
- this.interactionState = interactionState;
- this.bodyParameters = bodyParameters;
- }
- }
-
- public static class PortletRenderRequest extends PortletRequest
- {
- /** . */
- final Map<String, String[]> publicNavigationalStateChanges;
-
- public PortletRenderRequest(
- PortletControllerContext controllerContext,
- String portletId,
- WindowNavigationalState windowNavigationalState,
- Map<String, String[]> publicNavigationalStateChanges,
- PageNavigationalState pageState)
- {
- super(controllerContext, portletId, windowNavigationalState, pageState);
-
- //
- this.publicNavigationalStateChanges = publicNavigationalStateChanges;
- }
- }
}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRenderRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRenderRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRenderRequest.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller;
+
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletRenderRequest extends PortletRequest
+{
+
+ /** . */
+ final Map<String, String[]> publicNavigationalStateChanges;
+
+ public PortletRenderRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ WindowNavigationalState windowNavigationalState,
+ Map<String, String[]> publicNavigationalStateChanges,
+ PageNavigationalState pageState)
+ {
+ super(controllerContext, portletId, windowNavigationalState, pageState);
+
+ //
+ this.publicNavigationalStateChanges = publicNavigationalStateChanges;
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequest.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller;
+
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletRequest extends ContainerRequest
+{
+
+ /** . */
+ final PageNavigationalState pageState;
+
+ /** . */
+ final WindowNavigationalState windowNavigationalState;
+
+ PortletRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ WindowNavigationalState windowNavigationalState,
+ PageNavigationalState pageState)
+ {
+ super(controllerContext, portletId);
+
+ //
+ this.windowNavigationalState = windowNavigationalState;
+ this.pageState = pageState;
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequest.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller;
+
+import org.jboss.portal.portlet.cache.CacheLevel;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.common.util.ParameterMap;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletResourceRequest extends ContainerRequest
+{
+
+ /** . */
+ private static final Map<Class, CacheLevel> cacheability = new HashMap<Class, CacheLevel>();
+
+ static
+ {
+ cacheability.put(FullScopedCacheablePortletResourceRequest.class, CacheLevel.FULL);
+ cacheability.put(PortletScopedPortletResourceRequest.class, CacheLevel.PORTLET);
+ cacheability.put(PageScopedFullPortletResourceRequest.class, CacheLevel.PAGE);
+ }
+
+ /** . */
+ final String resourceId;
+
+ /** . */
+ final StateString resourceState;
+
+ /** . */
+ final ParameterMap bodyParameters;
+
+ PortletResourceRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ String resourceId,
+ StateString resourceState,
+ ParameterMap bodyParameters
+ )
+ {
+ super(controllerContext, portletId);
+
+ //
+ this.resourceId = resourceId;
+ this.resourceState = resourceState;
+ this.bodyParameters = bodyParameters;
+ }
+
+ public CacheLevel getCacheabilityType()
+ {
+ return cacheability.get(getClass());
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletScopedPortletResourceRequest.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletScopedPortletResourceRequest.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletScopedPortletResourceRequest.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller;
+
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.common.util.ParameterMap;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletScopedPortletResourceRequest extends FullScopedCacheablePortletResourceRequest
+{
+
+ /** . */
+ final WindowNavigationalState windowNavigationalState;
+
+ public PortletScopedPortletResourceRequest(
+ PortletControllerContext controllerContext,
+ String portletId,
+ String resourceId,
+ StateString resourceState,
+ ParameterMap bodyParameters,
+ WindowNavigationalState windowNavigationalState)
+ {
+ super(controllerContext, portletId, resourceId, resourceState, bodyParameters);
+
+ //
+ this.windowNavigationalState = windowNavigationalState;
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java 2008-02-04 22:24:27 UTC (rev 9749)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -7,7 +7,6 @@
import org.apache.log4j.Logger;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import static org.jboss.portal.portlet.test.controller.PortletController.ControllerRequest;
import java.io.IOException;
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderControllerResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderControllerResponse.java 2008-02-04 22:24:27 UTC (rev 9749)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderControllerResponse.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -1,93 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-
-import javax.servlet.ServletOutputStream;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.io.Writer;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class ResourceRenderControllerResponse extends RenderControllerResponse
-{
- private FragmentResponse fragment;
-
- public ResourceRenderControllerResponse(ResponseProperties properties, FragmentResponse fragment)
- {
- super(properties);
- this.fragment = fragment;
- }
-
- protected void renderContent(HttpServletResponse resp) throws IOException
- {
- //
- if (fragment.getType() == FragmentResponse.TYPE_EMPTY)
- {
- resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
- }
- else
- {
- String contentType = fragment.getContentType();
- if (contentType != null)
- {
- resp.setContentType(contentType);
- }
-
- //
- if (fragment.getType() == FragmentResponse.TYPE_BYTES)
- {
- ServletOutputStream out = null;
- try
- {
- out = resp.getOutputStream();
- out.write(fragment.getBytes().toByteArray());
- }
- finally
- {
- IOTools.safeClose(out);
- }
- }
- else
- {
- Writer writer = null;
- try
- {
- writer = resp.getWriter();
- writer.write(fragment.getChars().toString());
- }
- finally
- {
- writer.close();
- }
- }
- }
- }
-}
\ No newline at end of file
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-04 22:24:27 UTC (rev 9749)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -40,8 +40,13 @@
import static org.jboss.portal.portlet.test.URLParameterConstants.*;
import org.jboss.portal.portlet.test.WindowNavigationalState;
import org.jboss.portal.portlet.test.controller.PortletControllerContext;
-import org.jboss.portal.portlet.test.controller.PortletController;
import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+import org.jboss.portal.portlet.test.controller.PortletRenderRequest;
+import org.jboss.portal.portlet.test.controller.ControllerRequest;
+import org.jboss.portal.portlet.test.controller.PortletScopedPortletResourceRequest;
+import org.jboss.portal.portlet.test.controller.FullScopedCacheablePortletResourceRequest;
+import org.jboss.portal.portlet.test.controller.PageScopedFullPortletResourceRequest;
+import org.jboss.portal.portlet.test.controller.PortletActionRequest;
import org.jboss.portal.portlet.test.event.EventControllerContext;
import org.jboss.portal.portlet.test.event.EventControllerContextImpl;
import org.jboss.portal.web.Body;
@@ -78,7 +83,7 @@
private final ServletContext servletContext;
/** . */
- private final PortletController.ControllerRequest request;
+ private final ControllerRequest request;
/** . */
private final PortletInvoker invoker;
@@ -98,7 +103,7 @@
PageNavigationalState pageState = null;
// The request decoded if not null
- PortletController.ControllerRequest request = null;
+ ControllerRequest request = null;
// Process
String pathInfo = req.getPathInfo();
@@ -164,7 +169,7 @@
switch (resourceCacheLevel)
{
case FULL:
- request = new PortletController.FullScopedCacheablePortletResourceRequest(
+ request = new FullScopedCacheablePortletResourceRequest(
this,
targetId,
resourceId,
@@ -172,7 +177,7 @@
formParameters);
break;
case PORTLET:
- request = new PortletController.PortletScopedPortletResourceRequest(
+ request = new PortletScopedPortletResourceRequest(
this,
targetId,
resourceId,
@@ -181,7 +186,7 @@
windowNavigationalState);
break;
case PAGE:
- request = new PortletController.PageScopedFullPortletResourceRequest(
+ request = new PageScopedFullPortletResourceRequest(
this,
targetId,
resourceId,
@@ -206,7 +211,7 @@
StateString interactionState = ParametersStateString.create(req.getParameter(INTERACTION_STATE));
//
- request = new PortletController.PortletActionRequest(
+ request = new PortletActionRequest(
this,
targetId,
interactionState,
@@ -219,7 +224,7 @@
Map<String, String[]> publicNavigationalStateChanges = (Map<String, String[]>)IOTools.unserialize(Tools.fromHexString(req.getParameter(PUBLIC_NAVIGATIONAL_STATE_CHANGES)));
//
- request = new PortletController.PortletRenderRequest(
+ request = new PortletRenderRequest(
this,
targetId,
windowNavigationalState,
@@ -238,7 +243,7 @@
this.eventControllerContext = new EventControllerContextImpl(invoker);
}
- public PortletController.ControllerRequest getRequest()
+ public ControllerRequest getRequest()
{
return request;
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFragmentRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFragmentRenderer.java 2008-02-04 22:24:27 UTC (rev 9749)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFragmentRenderer.java 2008-02-04 22:35:20 UTC (rev 9750)
@@ -25,7 +25,6 @@
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.test.controller2.FragmentRenderer;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
16 years, 4 months
JBoss Portal SVN: r9749 - in modules/portlet/trunk/test/src/main/java/org/jboss/portal: portlet/test/controller and 2 other directories.
by portal-commits@lists.jboss.org
Author: julien(a)jboss.com
Date: 2008-02-04 17:24:27 -0500 (Mon, 04 Feb 2008)
New Revision: 9749
Added:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortalContext.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageUpdate.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/AbstractMarkupRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ErrorResponseRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/FragmentRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/RedirectResponseRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ResourceRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFragmentRenderer.java
Removed:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FragmentRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RenderControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/SimpleFragmentRenderer.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ViewRequestHandler.java
Modified:
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectControllerResponse.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java
modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java
Log:
splitted the controller in 2 (controller and controller2 for now)
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/PortalServlet.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -24,7 +24,12 @@
import org.jboss.portal.portlet.test.controller.ControllerResponse;
import org.jboss.portal.portlet.test.controller.PortletController;
-import org.jboss.portal.portlet.test.controller.PortletControllerContextImpl;
+import org.jboss.portal.portlet.test.controller2.PortletControllerContextImpl;
+import org.jboss.portal.portlet.test.controller.PageUpdate;
+import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+import org.jboss.portal.portlet.test.controller2.ControllerResponseRendererFactory;
+import org.jboss.portal.portlet.test.controller2.ControllerResponseRenderer;
+import org.jboss.portal.portlet.invocation.response.ResponseProperties;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -70,7 +75,26 @@
//
PortletController controller = new PortletController();
- ControllerResponse response = controller.process(context.getRequest());
- response.render(context);
+ if (context.getRequest() != null)
+ {
+ //
+ ControllerResponse response = controller.process(context.getRequest());
+
+ //
+ ControllerResponseRenderer renderer = ControllerResponseRendererFactory.getRenderer(response);
+
+ //
+ renderer.render(context);
+ }
+ else
+ {
+ PageUpdate pageUpdate = new PageUpdate(new ResponseProperties(), new PageNavigationalState());
+
+ //
+ ControllerResponseRenderer renderer = ControllerResponseRendererFactory.getRenderer(pageUpdate);
+
+ //
+ renderer.render(context);
+ }
}
}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortalContext.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortalContext.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/TestPortalContext.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test;
+
+import org.jboss.portal.portlet.impl.spi.AbstractPortalContext;
+
+import java.util.Map;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class TestPortalContext extends AbstractPortalContext
+{
+ public TestPortalContext()
+ {
+ super(Collections.singletonMap("javax.portlet.markup.head.element.support", "true"));
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ControllerResponse.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -35,7 +35,6 @@
* <p/>
* Typical usage should be : ControllerResponse response = controller.invoker(ControllerRequest request);
*/
-public interface ControllerResponse
+public abstract class ControllerResponse
{
- void render(PortletControllerContext context) throws IOException;
}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorControllerResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorControllerResponse.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ErrorControllerResponse.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -23,38 +23,22 @@
package org.jboss.portal.portlet.test.controller;
-import org.apache.log4j.Logger;
import org.jboss.portal.portlet.invocation.response.ErrorResponse;
-import java.io.IOException;
-
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class ErrorControllerResponse implements ControllerResponse
+public class ErrorControllerResponse extends ControllerResponse
{
- private ErrorResponse error;
- private static final Logger log = Logger.getLogger(ErrorControllerResponse.class);
+ /** . */
+ public ErrorResponse error;
+
+
public ErrorControllerResponse(ErrorResponse error)
{
this.error = error;
}
- public void render(PortletControllerContext context) throws IOException
- {
- //
- if (error.getCause() != null)
- {
- log.error("Portlet action threw an error: " + error.getMessage(), error.getCause());
- }
- else
- {
- log.error("Portlet action threw an error: " + error.getMessage());
- }
-
- //
- context.getClientResponse().sendError(404, error.getMessage());
- }
}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FragmentRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FragmentRenderer.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/FragmentRenderer.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -1,38 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public interface FragmentRenderer
-{
- String renderPortlet(FragmentResponse fragment);
-
- String renderError(ErrorResponse error);
-}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageNavigationalState.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -25,7 +25,6 @@
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.portlet.Portlet;
import org.jboss.portal.portlet.test.WindowNavigationalState;
-import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.ParameterInfo;
import javax.xml.namespace.QName;
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderControllerResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderControllerResponse.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageRenderControllerResponse.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -1,245 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-
-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.util.ParameterMap;
-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.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.invocation.RenderInvocation;
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-import org.jboss.portal.portlet.test.PortletURLRenderer;
-import org.jboss.portal.portlet.test.TestInstanceContext;
-import org.jboss.portal.portlet.test.TestRenderContext;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
-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;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class PageRenderControllerResponse extends RenderControllerResponse
-{
- private FragmentRenderer fragmentRenderer = new SimpleFragmentRenderer();
- private List<FragmentResponse> fragments;
- private List<ErrorResponse> errors;
- private PageNavigationalState pageState;
-
- public PageRenderControllerResponse(ResponseProperties properties, PageNavigationalState pageState)
- {
- super(properties);
- this.pageState = pageState;
- }
-
- public void setFragmentRenderer(FragmentRenderer fragmentRenderer)
- {
- this.fragmentRenderer = fragmentRenderer;
- }
-
- protected void renderContent(HttpServletResponse resp) throws IOException
- {
- //
- resp.setContentType("text/html");
- PrintWriter writer = resp.getWriter();
- writer.print("<html>");
-
- // Render the head contributions
- writer.print("<head>");
- MultiValuedPropertyMap<Element> markupHeaders = properties.getMarkupHeaders();
- List<Element> headElement = markupHeaders.getValues("javax.portlet.markup.head.element");
- if (headElement != null)
- {
- for (Element headerValue : headElement)
- {
- try
- {
- String serializedElement = XMLTools.toString(headerValue);
- writer.print(serializedElement);
- }
- catch (Exception e)
- {
- // todo
- e.printStackTrace();
- }
- }
- }
- writer.print("</head>");
-
-
- writer.print("<body>");
- for (FragmentResponse fragment : fragments)
- {
- writer.print(fragmentRenderer.renderPortlet(fragment));
-
- }
-
- for (ErrorResponse error : errors)
- {
- writer.print(fragmentRenderer.renderError(error));
- }
-
- writer.print("</body></html>");
- }
-
- protected void prepareRendering(PortletControllerContext context)
- {
-
- // What we collect during the different renders
- // we don't reuse the render properties argument since we want to avoid that
- // a portlet rendition affects another rendition of a portlet on the same page
- ResponseProperties renderProperties = new ResponseProperties();
-
- //
- try
- {
- Collection<Portlet> portlets = context.getPortlets();
-
- int capacity = portlets.size();
- fragments = new ArrayList<FragmentResponse>(capacity);
- errors = new ArrayList<ErrorResponse>(capacity);
-
- for (Portlet portlet : portlets)
- {
- WindowNavigationalState windowNS = pageState.getWindowNavigationalState(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();
- }
- }
-
- //
- ParameterMap publicNS = pageState.getPublicNavigationalState(portlet);
-
- RenderInvocation render = createRenderInvocation(context, properties, pageState, portlet, windowNS, mode, windowState, portletNS, publicNS);
-
- //
- try
- {
- PortletInvocationResponse response = context.invoke(render);
-
- if (response instanceof FragmentResponse)
- {
- FragmentResponse fragment = (FragmentResponse)response;
-
- //
- fragments.add(fragment);
-
- //
- ResponseProperties fragmentProperties = fragment.getProperties();
- if (fragmentProperties != null)
- {
- renderProperties.append(fragmentProperties);
- }
- }
- else if (response instanceof ErrorResponse)
- {
- ErrorResponse error = (ErrorResponse)response;
- errors.add(error);
- }
-
- }
- catch (PortletInvokerException e)
- {
- e.printStackTrace();
- }
- }
- }
- catch (PortletInvokerException e)
- {
- // todo
- e.printStackTrace();
- }
-
- // Now we combine the render properties with the page properties
- properties.append(renderProperties);
- }
-
- protected RenderInvocation createRenderInvocation(
- PortletControllerContext context, ResponseProperties pageProperties, PageNavigationalState pageNS, Portlet portlet,
- WindowNavigationalState windowNS, Mode mode, WindowState windowState, StateString portletNS, ParameterMap publicNS)
- {
- HttpServletRequest req = context.getClientRequest();
- HttpServletResponse resp = context.getClientResponse();
-
- //
- PortletURLRenderer renderer = new PortletURLRenderer(pageNS, windowNS, portlet, req, resp);
- //
- TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), false);
-
- TestRenderContext renderContext = new TestRenderContext(renderer, PortletController.MARKUP_INFO);
-
- //
- RenderInvocation render = new RenderInvocation(renderContext);
- render.setClientContext(new AbstractClientContext(req, pageProperties.getCookies()));
- render.setServerContext(new AbstractServerContext(req, resp));
- render.setInstanceContext(instanceContext);
- render.setUserContext(new AbstractUserContext(req));
- render.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
- render.setPortalContext(PortletController.getPortalContext());
- render.setSecurityContext(new AbstractSecurityContext(req));
- render.setTarget(instanceContext.getTarget());
- render.setMode(mode);
- render.setWindowState(windowState);
- render.setNavigationalState(portletNS);
- render.setPublicNavigationalState(publicNS);
- return render;
- }
-}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageUpdate.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageUpdate.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PageUpdate.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -0,0 +1,55 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller;
+
+import org.jboss.portal.portlet.invocation.response.ResponseProperties;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PageUpdate extends ControllerResponse
+{
+
+ /** . */
+ private ResponseProperties properties;
+
+ /** . */
+ private PageNavigationalState pageState;
+
+ public PageUpdate(ResponseProperties properties, PageNavigationalState pageState)
+ {
+ this.properties = properties;
+ this.pageState = pageState;
+ }
+
+ public ResponseProperties getProperties()
+ {
+ return properties;
+ }
+
+ public PageNavigationalState getPageState()
+ {
+ return pageState;
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletController.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -44,7 +44,7 @@
{
/** . */
- static final MarkupInfo MARKUP_INFO = new MarkupInfo(MediaType.HTML, "UTF8");
+ public static final MarkupInfo MARKUP_INFO = new MarkupInfo(MediaType.HTML, "UTF8");
/** . */
static final PortalContext portalContext;
@@ -61,12 +61,8 @@
{
RequestHandler handler;
- if (controllerRequest instanceof ViewRequest)
+ if (controllerRequest instanceof PortletRequest)
{
- handler = new ViewRequestHandler(this);
- }
- else if (controllerRequest instanceof PortletRequest)
- {
handler = new PortletRequestHandler(this);
}
else if (controllerRequest instanceof PortletResourceRequest)
@@ -81,13 +77,8 @@
return handler.handle(controllerRequest);
}
- static PortalContext getPortalContext()
+ public static class ControllerRequest
{
- return portalContext;
- }
-
- static class ControllerRequest
- {
/** . */
final PortletControllerContext controllerContext;
@@ -97,16 +88,8 @@
}
}
- static class ViewRequest extends ControllerRequest
+ public static class ContainerRequest extends ControllerRequest
{
- ViewRequest(PortletControllerContext controllerContext)
- {
- super(controllerContext);
- }
- }
-
- static class ContainerRequest extends ControllerRequest
- {
/** . */
final String portletId;
@@ -119,7 +102,7 @@
}
}
- static class PortletRequest extends ContainerRequest
+ public static class PortletRequest extends ContainerRequest
{
/** . */
final PageNavigationalState pageState;
@@ -141,7 +124,7 @@
}
}
- static abstract class PortletResourceRequest extends ContainerRequest
+ public static abstract class PortletResourceRequest extends ContainerRequest
{
/** . */
private static final Map<Class, CacheLevel> cacheability = new HashMap<Class, CacheLevel>();
@@ -184,9 +167,9 @@
}
}
- static class FullScopedCacheablePortletResourceRequest extends PortletResourceRequest
+ public static class FullScopedCacheablePortletResourceRequest extends PortletResourceRequest
{
- FullScopedCacheablePortletResourceRequest(
+ public FullScopedCacheablePortletResourceRequest(
PortletControllerContext controllerContext,
String portletId,
String resourceId,
@@ -197,12 +180,12 @@
}
}
- static class PortletScopedPortletResourceRequest extends FullScopedCacheablePortletResourceRequest
+ public static class PortletScopedPortletResourceRequest extends FullScopedCacheablePortletResourceRequest
{
/** . */
final WindowNavigationalState windowNavigationalState;
- PortletScopedPortletResourceRequest(
+ public PortletScopedPortletResourceRequest(
PortletControllerContext controllerContext,
String portletId,
String resourceId,
@@ -217,12 +200,12 @@
}
}
- static class PageScopedFullPortletResourceRequest extends PortletScopedPortletResourceRequest
+ public static class PageScopedFullPortletResourceRequest extends PortletScopedPortletResourceRequest
{
/** . */
private final PageNavigationalState pageState;
- PageScopedFullPortletResourceRequest(
+ public PageScopedFullPortletResourceRequest(
PortletControllerContext controllerContext,
String portletId,
String resourceId,
@@ -243,7 +226,7 @@
}
}
- static class PortletActionRequest extends PortletRequest
+ public static class PortletActionRequest extends PortletRequest
{
/** . */
final StateString interactionState;
@@ -267,7 +250,7 @@
}
}
- static class PortletRenderRequest extends PortletRequest
+ public static class PortletRenderRequest extends PortletRequest
{
/** . */
final Map<String, String[]> publicNavigationalStateChanges;
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletControllerContextImpl.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -1,282 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.common.io.IOTools;
-import org.jboss.portal.common.util.ParameterMap;
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.portlet.ParametersStateString;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.cache.CacheLevel;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.test.controller.PageNavigationalState;
-import org.jboss.portal.portlet.test.StringCodec;
-import static org.jboss.portal.portlet.test.URLParameterConstants.*;
-import org.jboss.portal.portlet.test.WindowNavigationalState;
-import org.jboss.portal.portlet.test.event.EventControllerContext;
-import org.jboss.portal.portlet.test.event.EventControllerContextImpl;
-import org.jboss.portal.web.Body;
-import org.jboss.portal.web.IllegalRequestException;
-import org.jboss.portal.web.WebRequest;
-
-import javax.servlet.ServletContext;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class PortletControllerContextImpl implements PortletControllerContext
-{
-
- /** . */
- public static final int NAV_SCOPE = 0;
-
- /** . */
- public static final int SESSION_SCOPE = 1;
-
- /** . */
- private final HttpServletRequest req;
-
- /** . */
- private final HttpServletResponse resp;
-
- /** . */
- private final ServletContext servletContext;
-
- /** . */
- private final PortletController.ControllerRequest request;
-
- /** . */
- private final PortletInvoker invoker;
-
- /** . */
- private final EventControllerContext eventControllerContext;
-
- public PortletControllerContextImpl(
- HttpServletRequest req,
- HttpServletResponse resp,
- ServletContext servletContext)
- throws IllegalRequestException, IOException, ClassNotFoundException
- {
- PortletInvoker invoker = (PortletInvoker)servletContext.getAttribute("ConsumerPortletInvoker");
-
- // The nav state provided with the request
- PageNavigationalState pageState = null;
-
- // The request decoded if not null
- PortletController.ControllerRequest request = null;
-
- // Process
- String pathInfo = req.getPathInfo();
- if (pathInfo != null && pathInfo.startsWith("/") && pathInfo.length() > 1)
- {
- // Get the target portlet
- String targetId = StringCodec.decode(pathInfo.substring(1));
-
- // Helper
- WebRequest ri = new WebRequest(req);
-
- // Unmarshall portal navigational state if it is provided
- String context = req.getParameter(PAGE_STATE);
- if (context != null)
- {
- byte[] bytes = Tools.fromHexString(context);
- pageState = PageNavigationalState.unserialize(bytes);
- }
-
- //
- Mode mode = null;
- if (req.getParameter(MODE) != null)
- {
- mode = Mode.create(req.getParameter(MODE));
- }
-
- //
- WindowState windowState = null;
- if (req.getParameter(WINDOW_STATE) != null)
- {
- windowState = WindowState.create(req.getParameter(WINDOW_STATE));
- }
-
- //
- String navigationalStateString = req.getParameter(NAVIGATIONAL_STATE);
- StateString navigationalState = null;
- if (navigationalStateString != null)
- {
- navigationalState = ParametersStateString.create(navigationalStateString);
- }
-
- //
- WindowNavigationalState windowNavigationalState = new WindowNavigationalState(navigationalState, mode, windowState);
-
- //
- String type = req.getParameter(LIFECYCLE_TYPE);
- if (RESOURCE_LIFECYCLE.equals(type))
- {
- StateString resourceState = ParametersStateString.create(req.getParameter(RESOURCE_STATE));
- String resourceId = req.getParameter(RESOURCE_ID);
-
- //
- ParameterMap formParameters = null;
- if (ri.getBody() instanceof Body.Form)
- {
- formParameters = ((Body.Form)ri.getBody()).getParameters();
- }
-
- //
- CacheLevel resourceCacheLevel = CacheLevel.valueOf(req.getParameter(RESOURCE_CACHEABILITY));
-
- //
- switch (resourceCacheLevel)
- {
- case FULL:
- request = new PortletController.FullScopedCacheablePortletResourceRequest(
- this,
- targetId,
- resourceId,
- resourceState,
- formParameters);
- break;
- case PORTLET:
- request = new PortletController.PortletScopedPortletResourceRequest(
- this,
- targetId,
- resourceId,
- resourceState,
- formParameters,
- windowNavigationalState);
- break;
- case PAGE:
- request = new PortletController.PageScopedFullPortletResourceRequest(
- this,
- targetId,
- resourceId,
- resourceState,
- formParameters,
- pageState,
- windowNavigationalState);
- break;
- }
- }
- else
- {
- if (ACTION_LIFECYCLE.equals(type))
- {
- ParameterMap formParameters = null;
- if (ri.getBody() instanceof Body.Form)
- {
- formParameters = ((Body.Form)ri.getBody()).getParameters();
- }
-
- //
- StateString interactionState = ParametersStateString.create(req.getParameter(INTERACTION_STATE));
-
- //
- request = new PortletController.PortletActionRequest(
- this,
- targetId,
- interactionState,
- formParameters,
- windowNavigationalState,
- pageState);
- }
- else
- {
- Map<String, String[]> publicNavigationalStateChanges = (Map<String, String[]>)IOTools.unserialize(Tools.fromHexString(req.getParameter(PUBLIC_NAVIGATIONAL_STATE_CHANGES)));
-
- //
- request = new PortletController.PortletRenderRequest(
- this,
- targetId,
- windowNavigationalState,
- publicNavigationalStateChanges,
- pageState);
- }
- }
- }
- else
- {
- request = new PortletController.ViewRequest(this);
- }
-
- //
- this.request = request;
- this.req = req;
- this.resp = resp;
- this.servletContext = servletContext;
- this.invoker = invoker;
- this.eventControllerContext = new EventControllerContextImpl(invoker);
- }
-
- public PortletController.ControllerRequest getRequest()
- {
- return request;
- }
-
- public ServletContext getServletContext()
- {
- return servletContext;
- }
-
- public HttpServletRequest getClientRequest()
- {
- return req;
- }
-
- public HttpServletResponse getClientResponse()
- {
- return resp;
- }
-
- public Portlet getPortlet(String portletId) throws PortletInvokerException
- {
- return invoker.getPortlet(PortletContext.createPortletContext(portletId));
- }
-
- public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
- {
- return invoker.invoke(invocation);
- }
-
- public Collection<Portlet> getPortlets() throws PortletInvokerException
- {
- return invoker.getPortlets();
- }
-
- public EventControllerContext getEventControllerContext()
- {
- return eventControllerContext;
- }
-}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletRequestHandler.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -31,6 +31,7 @@
import org.jboss.portal.portlet.test.TestEventContext;
import org.jboss.portal.portlet.test.TestInstanceContext;
import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.TestPortalContext;
import static org.jboss.portal.portlet.test.controller.PortletController.*;
import org.jboss.portal.portlet.test.event.Event;
import org.jboss.portal.portlet.test.event.EventControllerContext;
@@ -48,8 +49,9 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class PortletRequestHandler extends RequestHandler<PortletRequest>
+class PortletRequestHandler extends RequestHandler<PortletRequest>
{
+
public PortletRequestHandler(PortletController controller)
{
super(controller);
@@ -161,7 +163,8 @@
System.out.println("Not yet handled " + response);
}
- return new PageRenderControllerResponse(requestProperties, pageState);
+ //
+ return new PageUpdate(requestProperties, pageState);
}
PortletInvocationResponse invoke(PortletRequest portletRequest) throws PortletInvokerException
@@ -232,7 +235,7 @@
actionInvocation.setInstanceContext(instanceContext);
actionInvocation.setUserContext(new AbstractUserContext(req));
actionInvocation.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
- actionInvocation.setPortalContext(getPortalContext());
+ actionInvocation.setPortalContext(new TestPortalContext());
actionInvocation.setSecurityContext(new AbstractSecurityContext(req));
actionInvocation.setRequestContext(new AbstractRequestContext(req));
actionInvocation.setTarget(instanceContext.getTarget());
@@ -287,7 +290,7 @@
eventInvocation.setInstanceContext(instanceContext);
eventInvocation.setUserContext(new AbstractUserContext(req));
eventInvocation.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
- eventInvocation.setPortalContext(getPortalContext());
+ eventInvocation.setPortalContext(new TestPortalContext());
eventInvocation.setSecurityContext(new AbstractSecurityContext(req));
eventInvocation.setTarget(instanceContext.getTarget());
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/PortletResourceRequestHandler.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -45,6 +45,7 @@
import org.jboss.portal.portlet.test.ResourceTestContext;
import org.jboss.portal.portlet.test.TestInstanceContext;
import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.TestPortalContext;
import static org.jboss.portal.portlet.test.controller.PortletController.*;
import javax.servlet.http.HttpServletRequest;
@@ -55,7 +56,7 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class PortletResourceRequestHandler extends RequestHandler<PortletResourceRequest>
+class PortletResourceRequestHandler extends RequestHandler<PortletResourceRequest>
{
public PortletResourceRequestHandler(PortletController controller)
{
@@ -69,7 +70,7 @@
{
FragmentResponse fragment = (FragmentResponse)response;
- return new ResourceRenderControllerResponse(fragment.getProperties(), fragment);
+ return new ResourceControllerResponse(fragment);
}
else
{
@@ -163,7 +164,7 @@
resourceInvocation.setInstanceContext(instanceContext);
resourceInvocation.setUserContext(new AbstractUserContext(req));
resourceInvocation.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
- resourceInvocation.setPortalContext(getPortalContext());
+ resourceInvocation.setPortalContext(new TestPortalContext());
resourceInvocation.setSecurityContext(new AbstractSecurityContext(req));
resourceInvocation.setRequestContext(new AbstractRequestContext(req));
resourceInvocation.setTarget(instanceContext.getTarget());
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectControllerResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectControllerResponse.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RedirectControllerResponse.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -25,23 +25,18 @@
import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
-import java.io.IOException;
-
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public class RedirectControllerResponse implements ControllerResponse
+public class RedirectControllerResponse extends ControllerResponse
{
- private HTTPRedirectionResponse redirection;
+ /** . */
+ public HTTPRedirectionResponse redirection;
+
public RedirectControllerResponse(HTTPRedirectionResponse redirection)
{
this.redirection = redirection;
}
-
- public void render(PortletControllerContext context) throws IOException
- {
- context.getClientResponse().sendRedirect(redirection.getLocation());
- }
}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RenderControllerResponse.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RenderControllerResponse.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RenderControllerResponse.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -1,91 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.common.util.MultiValuedPropertyMap;
-import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-
-import javax.servlet.http.Cookie;
-import javax.servlet.http.HttpServletResponse;
-import java.io.IOException;
-import java.util.List;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public abstract class RenderControllerResponse implements ControllerResponse
-{
- protected ResponseProperties properties = new ResponseProperties();
-
- protected RenderControllerResponse(ResponseProperties properties)
- {
- this.properties = properties;
- }
-
- public void render(PortletControllerContext context) throws IOException
- {
- prepareRendering(context);
- HttpServletResponse resp = context.getClientResponse();
-
- // Render the headers and cookies
- if (properties != null)
- {
- renderTransportHeaders(properties, resp);
- renderCookies(properties, resp);
- }
-
- renderContent(resp);
- }
-
- protected abstract void renderContent(HttpServletResponse resp)
- throws IOException;
-
- private void renderCookies(ResponseProperties pageProperties, HttpServletResponse resp)
- {
- List<Cookie> cookies = pageProperties.getCookies();
- for (Cookie cookie : cookies)
- {
- resp.addCookie(cookie);
- }
- }
-
- private void renderTransportHeaders(ResponseProperties pageProperties, HttpServletResponse resp)
- {
- MultiValuedPropertyMap<String> transportHeaders = pageProperties.getTransportHeaders();
- for (String headerName : transportHeaders.keySet())
- {
- for (String headerValue : transportHeaders.getValues(headerName))
- {
- resp.addHeader(headerName, headerValue);
- }
- }
- }
-
- protected void prepareRendering(PortletControllerContext context)
- {
- // default behavior does nothing
- return;
- }
-}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/RequestHandler.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -15,7 +15,7 @@
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
* @version $Revision$
*/
-public abstract class RequestHandler<T extends ControllerRequest>
+abstract class RequestHandler<T extends ControllerRequest>
{
protected PortletController controller;
Copied: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceControllerResponse.java (from rev 9748, modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceRenderControllerResponse.java)
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceControllerResponse.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceControllerResponse.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.portlet.test.controller;
+
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision$
+ */
+public class ResourceControllerResponse extends ControllerResponse
+{
+
+ /** . */
+ public FragmentResponse fragment;
+
+ public ResourceControllerResponse(FragmentResponse fragment)
+ {
+ this.fragment = fragment;
+ }
+}
\ No newline at end of file
Property changes on: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ResourceControllerResponse.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/SimpleFragmentRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/SimpleFragmentRenderer.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/SimpleFragmentRenderer.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -1,69 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class SimpleFragmentRenderer implements FragmentRenderer
-{
- public String renderPortlet(FragmentResponse fragment)
- {
-
- if (fragment.getType() != FragmentResponse.TYPE_EMPTY)
- {
- String frag;
-
- //
- if (fragment.getType() == FragmentResponse.TYPE_BYTES)
- {
- frag = fragment.getBytes().toString();
- }
- else
- {
- frag = fragment.getChars().toString();
- }
-
- StringBuilder builder = new StringBuilder(frag.length() + 50);
- builder.append("<div class=\"portlet\">").append(frag).append("</div>");
- return builder.toString();
- }
- else
- {
- return "<div/>";
- }
- }
-
- public String renderError(ErrorResponse error)
- {
- String html = error.toHTML();
- StringBuilder builder = new StringBuilder(html + 50);
- builder.append("<div class='error'>").append(html).append("</div>");
- return builder.toString();
- }
-}
Deleted: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ViewRequestHandler.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ViewRequestHandler.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller/ViewRequestHandler.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -1,64 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
- ******************************************************************************/
-
-package org.jboss.portal.portlet.test.controller;
-
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.ResponseProperties;
-import static org.jboss.portal.portlet.test.controller.PortletController.ControllerRequest;
-import static org.jboss.portal.portlet.test.controller.PortletController.ViewRequest;
-
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
- * @version $Revision$
- */
-public class ViewRequestHandler extends RequestHandler<ViewRequest>
-{
- public ViewRequestHandler(PortletController controller)
- {
- super(controller);
- }
-
- ControllerResponse processResponse(ViewRequest request, PortletInvocationResponse response) throws IOException, PortletInvokerException
- {
- return new PageRenderControllerResponse(new ResponseProperties(), new PageNavigationalState());
- }
-
- PortletInvocationResponse invoke(ViewRequest controllerRequest) throws PortletInvokerException
- {
- return null;
- }
-
- ViewRequest downcastRequest(ControllerRequest request)
- {
- if (!(request instanceof ViewRequest))
- {
- throw new IllegalArgumentException("Request " + request + " cannot be handled by this handler");
- }
-
- return (ViewRequest)request;
- }
-}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/AbstractMarkupRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/AbstractMarkupRenderer.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/AbstractMarkupRenderer.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -0,0 +1,91 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller2;
+
+import org.jboss.portal.portlet.invocation.response.ResponseProperties;
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.Cookie;
+import java.io.IOException;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public abstract class AbstractMarkupRenderer implements ControllerResponseRenderer
+{
+
+ /** . */
+ protected ResponseProperties properties;
+
+ public AbstractMarkupRenderer(ResponseProperties properties)
+ {
+ this.properties = properties;
+ }
+
+ public void render(PortletControllerContext context) throws IOException
+ {
+ prepareRendering(context);
+ HttpServletResponse resp = context.getClientResponse();
+
+ // Render the headers and cookies
+ if (properties != null)
+ {
+ renderTransportHeaders(properties, resp);
+ renderCookies(properties, resp);
+ }
+
+ renderContent(resp);
+ }
+
+ protected abstract void renderContent(HttpServletResponse resp) throws IOException;
+
+ private void renderCookies(ResponseProperties pageProperties, HttpServletResponse resp)
+ {
+ List<Cookie> cookies = pageProperties.getCookies();
+ for (Cookie cookie : cookies)
+ {
+ resp.addCookie(cookie);
+ }
+ }
+
+ private void renderTransportHeaders(ResponseProperties pageProperties, HttpServletResponse resp)
+ {
+ MultiValuedPropertyMap<String> transportHeaders = pageProperties.getTransportHeaders();
+ for (String headerName : transportHeaders.keySet())
+ {
+ for (String headerValue : transportHeaders.getValues(headerName))
+ {
+ resp.addHeader(headerName, headerValue);
+ }
+ }
+ }
+
+ protected void prepareRendering(PortletControllerContext context)
+ {
+ // default behavior does nothing
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRenderer.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRenderer.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -0,0 +1,36 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller2;
+
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface ControllerResponseRenderer
+{
+ void render(PortletControllerContext context) throws IOException;
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ControllerResponseRendererFactory.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller2;
+
+import org.jboss.portal.portlet.test.controller.ControllerResponse;
+import org.jboss.portal.portlet.test.controller.PageUpdate;
+import org.jboss.portal.portlet.test.controller.RedirectControllerResponse;
+import org.jboss.portal.portlet.test.controller.ErrorControllerResponse;
+import org.jboss.portal.portlet.test.controller.ResourceControllerResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ControllerResponseRendererFactory
+{
+ public static ControllerResponseRenderer getRenderer(ControllerResponse response)
+ {
+ if (response instanceof PageUpdate)
+ {
+ return new PageUpdateRenderer((PageUpdate)response);
+ }
+ else if (response instanceof RedirectControllerResponse)
+ {
+ return new RedirectResponseRenderer((RedirectControllerResponse)response);
+ }
+ else if (response instanceof ErrorControllerResponse)
+ {
+ return new ErrorResponseRenderer((ErrorControllerResponse)response);
+ }
+ else if (response instanceof ResourceControllerResponse)
+ {
+ return new ResourceRenderer((ResourceControllerResponse)response);
+ }
+
+ //
+ return null;
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ErrorResponseRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ErrorResponseRenderer.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ErrorResponseRenderer.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller2;
+
+import org.jboss.portal.portlet.test.controller.ErrorControllerResponse;
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+import org.apache.log4j.Logger;
+
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ErrorResponseRenderer implements ControllerResponseRenderer
+{
+
+ /** . */
+ private static final Logger log = Logger.getLogger(ErrorControllerResponse.class);
+
+ /** . */
+ private ErrorControllerResponse response;
+
+ public ErrorResponseRenderer(ErrorControllerResponse response)
+ {
+ this.response = response;
+ }
+
+ public void render(PortletControllerContext context) throws IOException
+ {
+ //
+ if (response.error.getCause() != null)
+ {
+ log.error("Portlet action threw an error: " + response.error.getMessage(), response.error.getCause());
+ }
+ else
+ {
+ log.error("Portlet action threw an error: " + response.error.getMessage());
+ }
+
+ //
+ context.getClientResponse().sendError(404, response.error.getMessage());
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/FragmentRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/FragmentRenderer.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/FragmentRenderer.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.portlet.test.controller2;
+
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 9748 $
+ */
+public interface FragmentRenderer
+{
+ String renderPortlet(FragmentResponse fragment);
+
+ String renderError(ErrorResponse error);
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PageUpdateRenderer.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -0,0 +1,253 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.portlet.test.controller2;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
+import org.jboss.portal.common.util.ParameterMap;
+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.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.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.ResponseProperties;
+import org.jboss.portal.portlet.test.PortletURLRenderer;
+import org.jboss.portal.portlet.test.TestInstanceContext;
+import org.jboss.portal.portlet.test.TestRenderContext;
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.TestPortalContext;
+import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+import org.jboss.portal.portlet.test.controller.PortletController;
+import org.jboss.portal.portlet.test.controller.PageUpdate;
+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;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 9748 $
+ */
+public class PageUpdateRenderer extends AbstractMarkupRenderer
+{
+
+ private FragmentRenderer fragmentRenderer = new SimpleFragmentRenderer();
+ private List<FragmentResponse> fragments;
+ private List<ErrorResponse> errors;
+ private PageNavigationalState pageState;
+
+ public PageUpdateRenderer(PageUpdate pageUpdate)
+ {
+ super(pageUpdate.getProperties());
+
+ //
+ this.pageState = pageUpdate.getPageState();
+ }
+
+ public void setFragmentRenderer(FragmentRenderer fragmentRenderer)
+ {
+ this.fragmentRenderer = fragmentRenderer;
+ }
+
+ protected void renderContent(HttpServletResponse resp) throws IOException
+ {
+ //
+ resp.setContentType("text/html");
+ PrintWriter writer = resp.getWriter();
+ writer.print("<html>");
+
+ // Render the head contributions
+ writer.print("<head>");
+ MultiValuedPropertyMap<Element> markupHeaders = properties.getMarkupHeaders();
+ List<Element> headElement = markupHeaders.getValues("javax.portlet.markup.head.element");
+ if (headElement != null)
+ {
+ for (Element headerValue : headElement)
+ {
+ try
+ {
+ String serializedElement = XMLTools.toString(headerValue);
+ writer.print(serializedElement);
+ }
+ catch (Exception e)
+ {
+ // todo
+ e.printStackTrace();
+ }
+ }
+ }
+ writer.print("</head>");
+
+
+ writer.print("<body>");
+ for (FragmentResponse fragment : fragments)
+ {
+ writer.print(fragmentRenderer.renderPortlet(fragment));
+
+ }
+
+ for (ErrorResponse error : errors)
+ {
+ writer.print(fragmentRenderer.renderError(error));
+ }
+
+ writer.print("</body></html>");
+ }
+
+ protected void prepareRendering(PortletControllerContext context)
+ {
+
+ // What we collect during the different renders
+ // we don't reuse the render properties argument since we want to avoid that
+ // a portlet rendition affects another rendition of a portlet on the same page
+ ResponseProperties renderProperties = new ResponseProperties();
+
+ //
+ try
+ {
+ Collection<Portlet> portlets = context.getPortlets();
+
+ int capacity = portlets.size();
+ fragments = new ArrayList<FragmentResponse>(capacity);
+ errors = new ArrayList<ErrorResponse>(capacity);
+
+ for (Portlet portlet : portlets)
+ {
+ WindowNavigationalState windowNS = pageState.getWindowNavigationalState(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();
+ }
+ }
+
+ //
+ ParameterMap publicNS = pageState.getPublicNavigationalState(portlet);
+
+ RenderInvocation render = createRenderInvocation(context, properties, pageState, portlet, windowNS, mode, windowState, portletNS, publicNS);
+
+ //
+ try
+ {
+ PortletInvocationResponse response = context.invoke(render);
+
+ if (response instanceof FragmentResponse)
+ {
+ FragmentResponse fragment = (FragmentResponse)response;
+
+ //
+ fragments.add(fragment);
+
+ //
+ ResponseProperties fragmentProperties = fragment.getProperties();
+ if (fragmentProperties != null)
+ {
+ renderProperties.append(fragmentProperties);
+ }
+ }
+ else if (response instanceof ErrorResponse)
+ {
+ ErrorResponse error = (ErrorResponse)response;
+ errors.add(error);
+ }
+
+ }
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ catch (PortletInvokerException e)
+ {
+ // todo
+ e.printStackTrace();
+ }
+
+ // Now we combine the render properties with the page properties
+ properties.append(renderProperties);
+ }
+
+ protected RenderInvocation createRenderInvocation(
+ PortletControllerContext context, ResponseProperties pageProperties, PageNavigationalState pageNS, Portlet portlet,
+ WindowNavigationalState windowNS, Mode mode, WindowState windowState, StateString portletNS, ParameterMap publicNS)
+ {
+ HttpServletRequest req = context.getClientRequest();
+ HttpServletResponse resp = context.getClientResponse();
+
+ //
+ PortletURLRenderer renderer = new PortletURLRenderer(pageNS, windowNS, portlet, req, resp);
+ //
+ TestInstanceContext instanceContext = new TestInstanceContext(req, portlet.getContext(), false);
+
+ TestRenderContext renderContext = new TestRenderContext(renderer, PortletController.MARKUP_INFO);
+
+ //
+ RenderInvocation render = new RenderInvocation(renderContext);
+ render.setClientContext(new AbstractClientContext(req, pageProperties.getCookies()));
+ render.setServerContext(new AbstractServerContext(req, resp));
+ render.setInstanceContext(instanceContext);
+ render.setUserContext(new AbstractUserContext(req));
+ render.setWindowContext(new AbstractWindowContext(portlet.getContext().getId()));
+ render.setPortalContext(new TestPortalContext());
+ render.setSecurityContext(new AbstractSecurityContext(req));
+ render.setTarget(instanceContext.getTarget());
+ render.setMode(mode);
+ render.setWindowState(windowState);
+ render.setNavigationalState(portletNS);
+ render.setPublicNavigationalState(publicNS);
+ return render;
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/PortletControllerContextImpl.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -0,0 +1,280 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller2;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.io.IOTools;
+import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.portlet.ParametersStateString;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.cache.CacheLevel;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.test.StringCodec;
+import static org.jboss.portal.portlet.test.URLParameterConstants.*;
+import org.jboss.portal.portlet.test.WindowNavigationalState;
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+import org.jboss.portal.portlet.test.controller.PortletController;
+import org.jboss.portal.portlet.test.controller.PageNavigationalState;
+import org.jboss.portal.portlet.test.event.EventControllerContext;
+import org.jboss.portal.portlet.test.event.EventControllerContextImpl;
+import org.jboss.portal.web.Body;
+import org.jboss.portal.web.IllegalRequestException;
+import org.jboss.portal.web.WebRequest;
+
+import javax.servlet.ServletContext;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletControllerContextImpl implements PortletControllerContext
+{
+
+ /** . */
+ public static final int NAV_SCOPE = 0;
+
+ /** . */
+ public static final int SESSION_SCOPE = 1;
+
+ /** . */
+ private final HttpServletRequest req;
+
+ /** . */
+ private final HttpServletResponse resp;
+
+ /** . */
+ private final ServletContext servletContext;
+
+ /** . */
+ private final PortletController.ControllerRequest request;
+
+ /** . */
+ private final PortletInvoker invoker;
+
+ /** . */
+ private final EventControllerContext eventControllerContext;
+
+ public PortletControllerContextImpl(
+ HttpServletRequest req,
+ HttpServletResponse resp,
+ ServletContext servletContext)
+ throws IllegalRequestException, IOException, ClassNotFoundException
+ {
+ PortletInvoker invoker = (PortletInvoker)servletContext.getAttribute("ConsumerPortletInvoker");
+
+ // The nav state provided with the request
+ PageNavigationalState pageState = null;
+
+ // The request decoded if not null
+ PortletController.ControllerRequest request = null;
+
+ // Process
+ String pathInfo = req.getPathInfo();
+ if (pathInfo != null && pathInfo.startsWith("/") && pathInfo.length() > 1)
+ {
+ // Get the target portlet
+ String targetId = StringCodec.decode(pathInfo.substring(1));
+
+ // Helper
+ WebRequest ri = new WebRequest(req);
+
+ // Unmarshall portal navigational state if it is provided
+ String context = req.getParameter(PAGE_STATE);
+ if (context != null)
+ {
+ byte[] bytes = Tools.fromHexString(context);
+ pageState = PageNavigationalState.unserialize(bytes);
+ }
+
+ //
+ Mode mode = null;
+ if (req.getParameter(MODE) != null)
+ {
+ mode = Mode.create(req.getParameter(MODE));
+ }
+
+ //
+ WindowState windowState = null;
+ if (req.getParameter(WINDOW_STATE) != null)
+ {
+ windowState = WindowState.create(req.getParameter(WINDOW_STATE));
+ }
+
+ //
+ String navigationalStateString = req.getParameter(NAVIGATIONAL_STATE);
+ StateString navigationalState = null;
+ if (navigationalStateString != null)
+ {
+ navigationalState = ParametersStateString.create(navigationalStateString);
+ }
+
+ //
+ WindowNavigationalState windowNavigationalState = new WindowNavigationalState(navigationalState, mode, windowState);
+
+ //
+ String type = req.getParameter(LIFECYCLE_TYPE);
+ if (RESOURCE_LIFECYCLE.equals(type))
+ {
+ StateString resourceState = ParametersStateString.create(req.getParameter(RESOURCE_STATE));
+ String resourceId = req.getParameter(RESOURCE_ID);
+
+ //
+ ParameterMap formParameters = null;
+ if (ri.getBody() instanceof Body.Form)
+ {
+ formParameters = ((Body.Form)ri.getBody()).getParameters();
+ }
+
+ //
+ CacheLevel resourceCacheLevel = CacheLevel.valueOf(req.getParameter(RESOURCE_CACHEABILITY));
+
+ //
+ switch (resourceCacheLevel)
+ {
+ case FULL:
+ request = new PortletController.FullScopedCacheablePortletResourceRequest(
+ this,
+ targetId,
+ resourceId,
+ resourceState,
+ formParameters);
+ break;
+ case PORTLET:
+ request = new PortletController.PortletScopedPortletResourceRequest(
+ this,
+ targetId,
+ resourceId,
+ resourceState,
+ formParameters,
+ windowNavigationalState);
+ break;
+ case PAGE:
+ request = new PortletController.PageScopedFullPortletResourceRequest(
+ this,
+ targetId,
+ resourceId,
+ resourceState,
+ formParameters,
+ pageState,
+ windowNavigationalState);
+ break;
+ }
+ }
+ else
+ {
+ if (ACTION_LIFECYCLE.equals(type))
+ {
+ ParameterMap formParameters = null;
+ if (ri.getBody() instanceof Body.Form)
+ {
+ formParameters = ((Body.Form)ri.getBody()).getParameters();
+ }
+
+ //
+ StateString interactionState = ParametersStateString.create(req.getParameter(INTERACTION_STATE));
+
+ //
+ request = new PortletController.PortletActionRequest(
+ this,
+ targetId,
+ interactionState,
+ formParameters,
+ windowNavigationalState,
+ pageState);
+ }
+ else
+ {
+ Map<String, String[]> publicNavigationalStateChanges = (Map<String, String[]>)IOTools.unserialize(Tools.fromHexString(req.getParameter(PUBLIC_NAVIGATIONAL_STATE_CHANGES)));
+
+ //
+ request = new PortletController.PortletRenderRequest(
+ this,
+ targetId,
+ windowNavigationalState,
+ publicNavigationalStateChanges,
+ pageState);
+ }
+ }
+ }
+
+ //
+ this.request = request;
+ this.req = req;
+ this.resp = resp;
+ this.servletContext = servletContext;
+ this.invoker = invoker;
+ this.eventControllerContext = new EventControllerContextImpl(invoker);
+ }
+
+ public PortletController.ControllerRequest getRequest()
+ {
+ return request;
+ }
+
+ public ServletContext getServletContext()
+ {
+ return servletContext;
+ }
+
+ public HttpServletRequest getClientRequest()
+ {
+ return req;
+ }
+
+ public HttpServletResponse getClientResponse()
+ {
+ return resp;
+ }
+
+ public Portlet getPortlet(String portletId) throws PortletInvokerException
+ {
+ return invoker.getPortlet(PortletContext.createPortletContext(portletId));
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws PortletInvokerException
+ {
+ return invoker.invoke(invocation);
+ }
+
+ public Collection<Portlet> getPortlets() throws PortletInvokerException
+ {
+ return invoker.getPortlets();
+ }
+
+ public EventControllerContext getEventControllerContext()
+ {
+ return eventControllerContext;
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/RedirectResponseRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/RedirectResponseRenderer.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/RedirectResponseRenderer.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller2;
+
+import org.jboss.portal.portlet.test.controller.PortletControllerContext;
+import org.jboss.portal.portlet.test.controller.RedirectControllerResponse;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class RedirectResponseRenderer implements ControllerResponseRenderer
+{
+
+ /** . */
+ private RedirectControllerResponse response;
+
+ public RedirectResponseRenderer(RedirectControllerResponse response)
+ {
+ this.response = response;
+ }
+
+ public void render(PortletControllerContext context) throws IOException
+ {
+ context.getClientResponse().sendRedirect(response.redirection.getLocation());
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ResourceRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ResourceRenderer.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/ResourceRenderer.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -0,0 +1,96 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.portlet.test.controller2;
+
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.test.controller.ResourceControllerResponse;
+import org.jboss.portal.common.io.IOTools;
+
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletOutputStream;
+import java.io.IOException;
+import java.io.Writer;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ResourceRenderer extends AbstractMarkupRenderer
+{
+
+ /** . */
+ private FragmentResponse fragment;
+
+ public ResourceRenderer(ResourceControllerResponse response)
+ {
+ super(response.fragment.getProperties());
+
+ //
+ this.fragment = response.fragment;
+ }
+
+ protected void renderContent(HttpServletResponse resp) throws IOException
+ {
+ //
+ if (fragment.getType() == FragmentResponse.TYPE_EMPTY)
+ {
+ resp.setStatus(HttpServletResponse.SC_NO_CONTENT);
+ }
+ else
+ {
+ String contentType = fragment.getContentType();
+ if (contentType != null)
+ {
+ resp.setContentType(contentType);
+ }
+
+ //
+ if (fragment.getType() == FragmentResponse.TYPE_BYTES)
+ {
+ ServletOutputStream out = null;
+ try
+ {
+ out = resp.getOutputStream();
+ out.write(fragment.getBytes().toByteArray());
+ }
+ finally
+ {
+ IOTools.safeClose(out);
+ }
+ }
+ else
+ {
+ Writer writer = null;
+ try
+ {
+ writer = resp.getWriter();
+ writer.write(fragment.getChars().toString());
+ }
+ finally
+ {
+ writer.close();
+ }
+ }
+ }
+ }
+}
Added: modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFragmentRenderer.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFragmentRenderer.java (rev 0)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/portlet/test/controller2/SimpleFragmentRenderer.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org. *
+ ******************************************************************************/
+
+package org.jboss.portal.portlet.test.controller2;
+
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.test.controller2.FragmentRenderer;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+ * @version $Revision: 9748 $
+ */
+public class SimpleFragmentRenderer implements FragmentRenderer
+{
+ public String renderPortlet(FragmentResponse fragment)
+ {
+
+ if (fragment.getType() != FragmentResponse.TYPE_EMPTY)
+ {
+ String frag;
+
+ //
+ if (fragment.getType() == FragmentResponse.TYPE_BYTES)
+ {
+ frag = fragment.getBytes().toString();
+ }
+ else
+ {
+ frag = fragment.getChars().toString();
+ }
+
+ StringBuilder builder = new StringBuilder(frag.length() + 50);
+ builder.append("<div class=\"portlet\">").append(frag).append("</div>");
+ return builder.toString();
+ }
+ else
+ {
+ return "<div/>";
+ }
+ }
+
+ public String renderError(ErrorResponse error)
+ {
+ String html = error.toHTML();
+ StringBuilder builder = new StringBuilder(html + 50);
+ builder.append("<div class='error'>").append(html).append("</div>");
+ return builder.toString();
+ }
+}
Modified: modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java
===================================================================
--- modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java 2008-02-04 19:06:09 UTC (rev 9748)
+++ modules/portlet/trunk/test/src/main/java/org/jboss/portal/simple/SimplePortalServlet.java 2008-02-04 22:24:27 UTC (rev 9749)
@@ -24,7 +24,9 @@
import org.jboss.portal.portlet.test.controller.ControllerResponse;
import org.jboss.portal.portlet.test.controller.PortletController;
-import org.jboss.portal.portlet.test.controller.PortletControllerContextImpl;
+import org.jboss.portal.portlet.test.controller2.PortletControllerContextImpl;
+import org.jboss.portal.portlet.test.controller2.ControllerResponseRenderer;
+import org.jboss.portal.portlet.test.controller2.ControllerResponseRendererFactory;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -72,6 +74,11 @@
//
ControllerResponse response = controller.process(context.getRequest());
- response.render(context);
+
+ //
+ ControllerResponseRenderer renderer = ControllerResponseRendererFactory.getRenderer(response);
+
+ //
+ renderer.render(context);
}
}
\ No newline at end of file
16 years, 4 months