Author: julien(a)jboss.com
Date: 2008-01-23 15:07:37 -0500 (Wed, 23 Jan 2008)
New Revision: 9585
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ClientDataRequestImpl.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/PortletInvocation.java
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ResourceInvocation.java
modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml
Log:
moved RequestContext on PortletInvocation and ResourceInvocation and removed it from
PortletInvocation (since it can be used only in processAction or serveResource
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ClientDataRequestImpl.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ClientDataRequestImpl.java 2008-01-23
17:40:03 UTC (rev 9584)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/impl/jsr168/api/ClientDataRequestImpl.java 2008-01-23
20:07:37 UTC (rev 9585)
@@ -22,7 +22,8 @@
******************************************************************************/
package org.jboss.portal.portlet.impl.jsr168.api;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.ResourceInvocation;
import org.jboss.portal.portlet.spi.RequestContext;
import org.jboss.portal.common.NotYetImplemented;
@@ -42,7 +43,7 @@
/** . */
protected final RequestContext requestContext;
- public ClientDataRequestImpl(PortletInvocation invocation)
+ public ClientDataRequestImpl(ActionInvocation invocation)
{
super(invocation);
@@ -50,6 +51,14 @@
this.requestContext = invocation.getRequestContext();
}
+ public ClientDataRequestImpl(ResourceInvocation invocation)
+ {
+ super(invocation);
+
+ //
+ this.requestContext = invocation.getRequestContext();
+ }
+
public InputStream getPortletInputStream() throws IOException
{
if
("application/x-www-form-urlencoded".equals(requestContext.getContentType()))
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-01-23
17:40:03 UTC (rev 9584)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ActionInvocation.java 2008-01-23
20:07:37 UTC (rev 9585)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.invocation;
import org.jboss.portal.portlet.spi.ActionContext;
+import org.jboss.portal.portlet.spi.RequestContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -34,6 +35,9 @@
/** . */
private final ActionContext ctx;
+ /** The request context. */
+ protected RequestContext requestContext;
+
public ActionInvocation(ActionContext ctx) throws IllegalArgumentException
{
super(ctx);
@@ -46,4 +50,14 @@
{
return ctx;
}
+
+ public RequestContext getRequestContext()
+ {
+ return requestContext;
+ }
+
+ public void setRequestContext(RequestContext requestContext)
+ {
+ this.requestContext = requestContext;
+ }
}
Modified:
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvocation.java
===================================================================
---
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvocation.java 2008-01-23
17:40:03 UTC (rev 9584)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/PortletInvocation.java 2008-01-23
20:07:37 UTC (rev 9585)
@@ -23,7 +23,6 @@
package org.jboss.portal.portlet.invocation;
import org.jboss.portal.common.invocation.Invocation;
-import org.jboss.portal.common.invocation.InvocationContext;
import org.jboss.portal.common.invocation.Scope;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.PortalContext;
@@ -32,7 +31,6 @@
import org.jboss.portal.portlet.spi.SecurityContext;
import org.jboss.portal.portlet.spi.UserContext;
import org.jboss.portal.portlet.spi.WindowContext;
-import org.jboss.portal.portlet.spi.RequestContext;
import org.jboss.portal.portlet.PortletContext;
import javax.servlet.http.HttpServletRequest;
@@ -83,9 +81,6 @@
/** The window context. */
protected WindowContext windowContext;
- /** The request context. */
- protected RequestContext requestContext;
-
/** The window states this portlet can accept. */
protected Set supportedWindowStates;
@@ -105,6 +100,7 @@
* Create an invocation to a portlet.
*
* @param ctx the portlet invocation context
+ * @throws IllegalArgumentException if the provided context is null
*/
protected PortletInvocation(PortletInvocationContext ctx) throws
IllegalArgumentException
{
@@ -152,25 +148,41 @@
this.supportedModes = supportedModes;
}
- /** Return the dispatched http servlet request. */
+ /**
+ * Returns the dispatched http servlet request.
+ *
+ * @return the dispatched response
+ */
public HttpServletResponse getDispatchedResponse()
{
return dresp;
}
- /** Set the dispatched http servlet request. */
+ /**
+ * Set the dispatched http servlet request.
+ *
+ * @param dresp the dispatched response
+ */
public void setDispatchedResponse(HttpServletResponse dresp)
{
this.dresp = dresp;
}
- /** Return the dispatched http servlet request. */
+ /**
+ * Returns the dispatched http servlet request.
+ *
+ * @return the dispatched request
+ */
public HttpServletRequest getDispatchedRequest()
{
return dreq;
}
- /** Set the dispatched http servlet request. */
+ /**
+ * Set the dispatched http servlet request.
+ *
+ * @param dreq the dispatched request
+ */
public void setDispatchedRequest(HttpServletRequest dreq)
{
this.dreq = dreq;
@@ -235,14 +247,4 @@
{
this.windowContext = windowContext;
}
-
- public RequestContext getRequestContext()
- {
- return requestContext;
- }
-
- public void setRequestContext(RequestContext requestContext)
- {
- this.requestContext = requestContext;
- }
}
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-01-23
17:40:03 UTC (rev 9584)
+++
modules/portlet/trunk/portlet/src/main/java/org/jboss/portal/portlet/invocation/ResourceInvocation.java 2008-01-23
20:07:37 UTC (rev 9585)
@@ -23,6 +23,7 @@
package org.jboss.portal.portlet.invocation;
import org.jboss.portal.portlet.spi.ResourceInvocationContext;
+import org.jboss.portal.portlet.spi.RequestContext;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -34,6 +35,9 @@
/** . */
private final ResourceInvocationContext ctx;
+ /** The request context. */
+ protected RequestContext requestContext;
+
public ResourceInvocation(ResourceInvocationContext ctx) throws
IllegalArgumentException
{
super(ctx);
@@ -46,4 +50,14 @@
{
return ctx;
}
+
+ public RequestContext getRequestContext()
+ {
+ return requestContext;
+ }
+
+ public void setRequestContext(RequestContext requestContext)
+ {
+ this.requestContext = requestContext;
+ }
}
Modified: modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml
===================================================================
--- modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml 2008-01-23
17:40:03 UTC (rev 9584)
+++ modules/portlet/trunk/test/src/test/resources/test/remote-jboss-unit.xml 2008-01-23
20:07:37 UTC (rev 9585)
@@ -4,7 +4,10 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="urn:jboss:jboss-unit:1.0 jboss-unit_1_0.xsd">
- <!--Spec TCK Assertions tests-->
+<!--
+ -->
+<!--Spec TCK Assertions tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr168-tck-dispatcher.war"/>
@@ -50,7 +53,9 @@
<property name="archiveId"
value="test-jsr168-tck-windowstates.war"/>
</generic>
- <!--API Tests-->
+ -->
+<!--API Tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr168-api-actionrequest.war"/>
@@ -104,7 +109,9 @@
<property name="archiveId"
value="test-jsr168-api-windowstate.war"/>
</generic>
- <!--Ext Tests-->
+ -->
+<!--Ext Tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr168-ext-dispatcher.war"/>
@@ -133,6 +140,7 @@
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr168-ext-session.war"/>
</generic>
+-->
<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
@@ -147,8 +155,11 @@
<property name="archiveId"
value="test-jsr168-ext-nocache.war"/>
</generic>
-->
+<!--
- <!--Spec TCK Assertions tests-->
+ -->
+<!--Spec TCK Assertions tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-tck-portletconfig.war"/>
@@ -169,6 +180,7 @@
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-tck-stateawareresponse.war"/>
</generic>
+-->
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-tck-portletrequests.war"/>
@@ -179,10 +191,12 @@
</generic>
<!--Spec API Assertions tests-->
+<!--
<generic>
<class
name="org.jboss.unit.remote.driver.RemoteTestDriverClient"/>
<property name="archiveId"
value="test-jsr286-api-event.war"/>
</generic>
+-->
<!--Ext Assertions tests-->
<generic>