[jboss-svn-commits] JBoss Portal SVN: r5417 - in trunk: core/src/main/org/jboss/portal/core/aspects/controller core/src/main/org/jboss/portal/core/aspects/portlet core/src/main/org/jboss/portal/core/controller core/src/main/org/jboss/portal/core/controller/command core/src/main/org/jboss/portal/core/controller/command/response core/src/main/org/jboss/portal/core/model/instance core/src/main/org/jboss/portal/core/result core/src/main/org/jboss/portlet portlet/src/main/org/jboss/portal/portlet portlet/src/main/org/jboss/portal/portlet/aspects/portlet portlet/src/main/org/jboss/portal/portlet/container portlet/src/main/org/jboss/portal/portlet/impl/jsr168 portlet/src/main/org/jboss/portal/portlet/invocation portlet/src/main/org/jboss/portal/portlet/invocation/response portlet/src/main/org/jboss/portal/portlet/invocation/response/cache portlet/src/main/org/jboss/portal/portlet/test wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer wsrp/src/main/org/jboss/portal/wsrp/consumer wsrp/src/m! ain/org/jboss/portal/wsrp/producer
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Oct 11 10:58:29 EDT 2006
Author: julien at jboss.com
Date: 2006-10-11 10:57:28 -0400 (Wed, 11 Oct 2006)
New Revision: 5417
Added:
trunk/core/src/main/org/jboss/portal/core/result/AuthenticateResponse.java
trunk/core/src/main/org/jboss/portal/core/result/SignOutResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/AccessDeniedResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/ErrorResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/HTTPRedirectionResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientPrivilegesResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientTransportGuaranteeResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/PortletInvocationResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RedirectionResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RenderResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityErrorResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/StreamResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/UnavailableResponse.java
Removed:
trunk/core/src/main/org/jboss/portal/core/result/AuthenticateResult.java
trunk/core/src/main/org/jboss/portal/core/result/SignOutResult.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/AccessDeniedResult.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/ErrorResult.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResult.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/HTTPRedirectionResult.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientPrivilegesResult.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientTransportGuaranteeResult.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RedirectionResult.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RenderResult.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/Result.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityErrorResult.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/StreamResult.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/UnavailableResult.java
trunk/portlet/src/main/org/jboss/portal/portlet/result/
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/controller/WindowCacheInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
trunk/core/src/main/org/jboss/portal/core/controller/CoreController.java
trunk/core/src/main/org/jboss/portal/core/controller/command/InvokeWindowActionCommand.java
trunk/core/src/main/org/jboss/portal/core/controller/command/RenderPageCommand.java
trunk/core/src/main/org/jboss/portal/core/controller/command/RenderWindowCommand.java
trunk/core/src/main/org/jboss/portal/core/controller/command/response/PortletInvocationResponse.java
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java
trunk/core/src/main/org/jboss/portlet/JBossActionResponse.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionResponseImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/RenderResponseImpl.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/SoftTimedContent.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/StrongTimedContent.java
trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/TimedContent.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java
trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
Log:
- rename Result to PortletInvocationResponse in the portlet container to have smth similar to ControllerCommandResponse (later I will make the generic Invocation have a response object when I unify it with the ServerInvocation)
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/controller/WindowCacheInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/controller/WindowCacheInterceptor.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/controller/WindowCacheInterceptor.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -26,13 +26,12 @@
import org.jboss.portal.core.controller.command.RenderWindowCommand;
import org.jboss.portal.core.controller.command.InvokeWindowCommand;
import org.jboss.portal.core.controller.command.WindowCommand;
-import org.jboss.portal.core.controller.command.response.PortletInvocationResponse;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.common.invocation.InvocationContext;
-import org.jboss.portal.portlet.result.FragmentResult;
-import org.jboss.portal.portlet.result.Result;
-import org.jboss.portal.portlet.result.cache.TimedContent;
-import org.jboss.portal.portlet.result.cache.StrongTimedContent;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.cache.TimedContent;
+import org.jboss.portal.portlet.invocation.response.cache.StrongTimedContent;
import org.jboss.portal.server.ServerInvocation;
import java.io.Serializable;
@@ -60,7 +59,7 @@
CacheEntry cachedEntry = (CacheEntry)invocationCtx.getAttribute(ServerInvocation.PRINCIPAL_SCOPE, scopeKey);
//
- FragmentResult fragment = null;
+ FragmentResponse fragment = null;
if (cachedEntry != null)
{
long currentTimeMillis = System.currentTimeMillis();
@@ -85,12 +84,12 @@
cmd.invokeNext();
// Get result
- Result result = ((PortletInvocationResponse)rwc.getResponse()).getResult();
+ PortletInvocationResponse response = ((org.jboss.portal.core.controller.command.response.PortletInvocationResponse)rwc.getResponse()).getResult();
// Try to cache any fragment result
- if (result instanceof FragmentResult)
+ if (response instanceof FragmentResponse)
{
- FragmentResult renderResult = (FragmentResult)result;
+ FragmentResponse renderResult = (FragmentResponse)response;
// Compute expiration time
long expirationTimeMillis = 0;
@@ -114,7 +113,7 @@
else
{
// Use the cached fragment
- rwc.setResponse(new PortletInvocationResponse(rwc.getTargetId(), fragment));
+ rwc.setResponse(new org.jboss.portal.core.controller.command.response.PortletInvocationResponse(rwc.getTargetId(), fragment));
}
}
else if (cmd instanceof InvokeWindowCommand)
@@ -144,7 +143,7 @@
/** The timed content. */
private final TimedContent cachedResult;
- public CacheEntry(FragmentResult result, long expirationTimeMillis)
+ public CacheEntry(FragmentResponse result, long expirationTimeMillis)
{
if (expirationTimeMillis <= 0)
{
@@ -158,7 +157,7 @@
return cachedResult.getExpirationTimeMillis();
}
- public FragmentResult getContent()
+ public FragmentResponse getContent()
{
return cachedResult.getContent();
}
Modified: trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/core/src/main/org/jboss/portal/core/aspects/portlet/HeaderInterceptor.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -29,8 +29,8 @@
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.result.FragmentResult;
-import org.jboss.portal.portlet.result.Result;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import java.io.StringWriter;
import java.util.Iterator;
@@ -49,13 +49,13 @@
invocation.invokeNext();
//
- Result result = invocation.getResult();
+ PortletInvocationResponse response = invocation.getResponse();
//
- if (result instanceof FragmentResult)
+ if (response instanceof FragmentResponse)
{
RenderInvocation render = (RenderInvocation)invocation;
- FragmentResult fragment = (FragmentResult)result;
+ FragmentResponse fragment = (FragmentResponse)response;
// Add declaratively injected header content here (get it via the component)
String headerChars = fragment.getHeader(); // Chris' modif: note that the header might to be re-written...
Modified: trunk/core/src/main/org/jboss/portal/core/controller/CoreController.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/CoreController.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/core/src/main/org/jboss/portal/core/controller/CoreController.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -26,8 +26,6 @@
import org.jboss.portal.core.controller.command.RenderPageCommand;
import org.jboss.portal.core.controller.command.InvokeWindowActionCommand;
import org.jboss.portal.core.controller.command.InvokeWindowRenderCommand;
-import org.jboss.portal.core.controller.command.response.PortletInvocationResponse;
-import org.jboss.portal.core.controller.command.response.SignOutResponse;
import org.jboss.portal.core.controller.command.response.StreamContentResponse;
import org.jboss.portal.core.controller.command.response.UpdateViewResponse;
import org.jboss.portal.core.controller.command.response.UpdateWindowMarkupResponse;
@@ -40,7 +38,7 @@
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Portal;
import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.result.SignOutResult;
+import org.jboss.portal.core.result.SignOutResponse;
import org.jboss.portal.server.RequestController;
import org.jboss.portal.server.ServerException;
import org.jboss.portal.server.ServerInvocation;
@@ -48,12 +46,11 @@
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.theme.page.PageService;
import org.jboss.portal.theme.PageRendition;
-import org.jboss.portal.portlet.result.Result;
-import org.jboss.portal.portlet.result.RenderResult;
-import org.jboss.portal.portlet.result.HTTPRedirectionResult;
-import org.jboss.portal.portlet.result.InsufficientTransportGuaranteeResult;
-import org.jboss.portal.portlet.result.InsufficientPrivilegesResult;
-import org.jboss.portal.portlet.result.ErrorResult;
+import org.jboss.portal.portlet.invocation.response.RenderResponse;
+import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
+import org.jboss.portal.portlet.invocation.response.InsufficientTransportGuaranteeResponse;
+import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.WindowState;
import org.jboss.portal.Mode;
@@ -277,13 +274,13 @@
rendition.render(invocation);
return null;
}
- else if (response instanceof PortletInvocationResponse)
+ else if (response instanceof org.jboss.portal.core.controller.command.response.PortletInvocationResponse)
{
- PortletInvocationResponse pir = (PortletInvocationResponse)response;
- Result result = pir.getResult();
- if (result instanceof RenderResult)
+ org.jboss.portal.core.controller.command.response.PortletInvocationResponse pir = (org.jboss.portal.core.controller.command.response.PortletInvocationResponse)response;
+ org.jboss.portal.portlet.invocation.response.PortletInvocationResponse pir2 = pir.getResult();
+ if (pir2 instanceof RenderResponse)
{
- RenderResult renderResult = (RenderResult)result;
+ RenderResponse renderResult = (RenderResponse)pir2;
StateString portletNavState = renderResult.getNavigationalState();
WindowState windowState = renderResult.getWindowState();
Mode mode = renderResult.getMode();
@@ -294,26 +291,26 @@
portletNavState);
return new Forward(iwrc, null);
}
- else if (result instanceof HTTPRedirectionResult)
+ else if (pir2 instanceof HTTPRedirectionResponse)
{
- HTTPRedirectionResult redirectionResult = (HTTPRedirectionResult)result;
+ HTTPRedirectionResponse redirectionResult = (HTTPRedirectionResponse)pir2;
String url = redirectionResult.getLocation();
sendRedirect(invocation, url);
return null;
}
- else if (result instanceof InsufficientTransportGuaranteeResult)
+ else if (pir2 instanceof InsufficientTransportGuaranteeResponse)
{
boolean authenticated = invocation.getServerContext().getURLContext().isAuthenticated();
return new Forward(cmd, URLContext.newInstance(true, authenticated));
}
- else if (result instanceof InsufficientPrivilegesResult)
+ else if (pir2 instanceof InsufficientPrivilegesResponse)
{
boolean authenticated = invocation.getServerContext().getURLContext().isAuthenticated();
return new Forward(cmd, URLContext.newInstance(true, authenticated));
}
- else if (result instanceof SignOutResult)
+ else if (pir2 instanceof SignOutResponse)
{
- SignOutResult signOut = (SignOutResult)result;
+ SignOutResponse signOut = (SignOutResponse)pir2;
// Indicate that we want a sign out to be done
invocation.getResponse().setWantSignOut(true);
@@ -338,9 +335,9 @@
return null;
}
}
- else if (result instanceof ErrorResult)
+ else if (pir2 instanceof ErrorResponse)
{
- ErrorResult error = (ErrorResult)result;
+ ErrorResponse error = (ErrorResponse)pir2;
error.logErrorTo(log, "An portlet exception occured in portlet");
sendStatusCode(invocation, HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
return null;
@@ -350,7 +347,7 @@
throw new IllegalStateException();
}
}
- else if (response instanceof SignOutResponse)
+ else if (response instanceof org.jboss.portal.core.controller.command.response.SignOutResponse)
{
// Indicate that we want a sign out to be done
invocation.getResponse().setWantSignOut(true);
Modified: trunk/core/src/main/org/jboss/portal/core/controller/command/InvokeWindowActionCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/command/InvokeWindowActionCommand.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/core/src/main/org/jboss/portal/core/controller/command/InvokeWindowActionCommand.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -118,7 +118,7 @@
instance.invoke(invocation);
//
- return new PortletInvocationResponse(targetId, invocation.getResult());
+ return new PortletInvocationResponse(targetId, invocation.getResponse());
}
catch (PortletInvokerException e)
{
Modified: trunk/core/src/main/org/jboss/portal/core/controller/command/RenderPageCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/command/RenderPageCommand.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/core/src/main/org/jboss/portal/core/controller/command/RenderPageCommand.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -38,7 +38,6 @@
import org.jboss.portal.core.controller.ResourceAccessDeniedException;
import org.jboss.portal.core.controller.command.info.CommandInfo;
import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
-import org.jboss.portal.core.controller.command.response.PortletInvocationResponse;
import org.jboss.portal.server.config.ServerConfig;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.ServerInvocationContext;
@@ -65,12 +64,11 @@
import org.jboss.portal.portlet.Properties;
import org.jboss.portal.portlet.info.WindowStateInfo;
import org.jboss.portal.portlet.info.ModeInfo;
-import org.jboss.portal.portlet.result.Result;
-import org.jboss.portal.portlet.result.InsufficientTransportGuaranteeResult;
-import org.jboss.portal.portlet.result.FragmentResult;
-import org.jboss.portal.portlet.result.ErrorResult;
-import org.jboss.portal.portlet.result.UnavailableResult;
-import org.jboss.portal.portlet.result.InsufficientPrivilegesResult;
+import org.jboss.portal.portlet.invocation.response.InsufficientTransportGuaranteeResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
+import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
import org.jboss.portal.WindowState;
import org.jboss.portal.Mode;
@@ -397,21 +395,21 @@
context.execute(renderCmd);
//
- PortletInvocationResponse response = (PortletInvocationResponse)renderCmd.getResponse();
+ org.jboss.portal.core.controller.command.response.PortletInvocationResponse response = (org.jboss.portal.core.controller.command.response.PortletInvocationResponse)renderCmd.getResponse();
//
- Result result = response.getResult();
+ org.jboss.portal.portlet.invocation.response.PortletInvocationResponse pir = response.getResult();
//
- if (result instanceof InsufficientTransportGuaranteeResult)
+ if (pir instanceof InsufficientTransportGuaranteeResponse)
{
throw new InsufficientTransportGuaranteeException();
}
//
- if (result instanceof FragmentResult)
+ if (pir instanceof FragmentResponse)
{
- FragmentResult fragment = (FragmentResult)result;
+ FragmentResponse fragment = (FragmentResponse)pir;
windowTitle = fragment.getTitle();
if (windowTitle == null)
{
@@ -462,23 +460,23 @@
switch (fragment.getType())
{
- case FragmentResult.TYPE_CHARS:
+ case FragmentResponse.TYPE_CHARS:
contentChars = fragment.getChars().toString();
break;
- case FragmentResult.TYPE_BYTES:
+ case FragmentResponse.TYPE_BYTES:
// Funny for now we don't know how to interpret that or we should not
// because it is for some kind of flash portal ?
contentChars = fragment.getBytes().toString();
break;
- case FragmentResult.TYPE_EMPTY:
+ case FragmentResponse.TYPE_EMPTY:
// Do nothing, the contentChars is already empty string
break;
}
return new ModifiableWindowResult(windowTitle, contentChars, actionMap, windowProps, responseProps, headerChars, windowNavState.getWindowState(), windowNavState.getMode());
}
- else if (result instanceof ErrorResult)
+ else if (pir instanceof ErrorResponse)
{
- ErrorResult errorResult = (ErrorResult)result;
+ ErrorResponse errorResult = (ErrorResponse)pir;
String logMessage = "Rendering portlet window " + windowRef + " triggered the following error :";
errorResult.logErrorTo(ControllerCommand.log, logMessage);
String property = cfg.getProperty(WINDOW_ERROR);
@@ -495,7 +493,7 @@
return new ModifiableWindowResult(windowTitle, contentChars, actionMap, windowProps, responseProps, headerChars, windowNavState.getWindowState(), windowNavState.getMode());
}
}
- else if (result instanceof UnavailableResult)
+ else if (pir instanceof UnavailableResponse)
{
if (SHOW.equals(cfg.getProperty(WINDOW_UNAVAILABLE)))
{
@@ -508,14 +506,14 @@
return new ModifiableWindowResult(windowTitle, contentChars, actionMap, windowProps, responseProps, headerChars, windowNavState.getWindowState(), windowNavState.getMode());
}
}
- else if (result instanceof InsufficientPrivilegesResult)
+ else if (pir instanceof InsufficientPrivilegesResponse)
{
// Julien : go to the section below, I know it is very ugly
throw new ResourceAccessDeniedException(windowRef);
}
else
{
- ControllerCommand.log.error("Unexpected result from a portlet invocation " + result);
+ ControllerCommand.log.error("Unexpected result from a portlet invocation " + pir);
return null;
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/controller/command/RenderWindowCommand.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/command/RenderWindowCommand.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/core/src/main/org/jboss/portal/core/controller/command/RenderWindowCommand.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -93,7 +93,7 @@
instance.invoke(invocation);
//
- return new PortletInvocationResponse(targetId, invocation.getResult());
+ return new PortletInvocationResponse(targetId, invocation.getResponse());
}
catch (PortletInvokerException e)
{
Modified: trunk/core/src/main/org/jboss/portal/core/controller/command/response/PortletInvocationResponse.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/controller/command/response/PortletInvocationResponse.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/core/src/main/org/jboss/portal/core/controller/command/response/PortletInvocationResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -21,8 +21,6 @@
*/
package org.jboss.portal.core.controller.command.response;
-import org.jboss.portal.portlet.result.Result;
-
/**
* @author <a href="mailto:julien at jboss.org">Julien Viet</a>
* @version $Revision: 1.1 $
@@ -34,20 +32,20 @@
private String windowId;
/** . */
- private Result result;
+ private org.jboss.portal.portlet.invocation.response.PortletInvocationResponse response;
- public PortletInvocationResponse(String windowId, Result result)
+ public PortletInvocationResponse(String windowId, org.jboss.portal.portlet.invocation.response.PortletInvocationResponse response)
{
if (windowId == null)
{
throw new IllegalArgumentException();
}
- if (result == null)
+ if (response == null)
{
throw new IllegalArgumentException();
}
this.windowId = windowId;
- this.result = result;
+ this.response = response;
}
public String getWindowId()
@@ -55,8 +53,8 @@
return windowId;
}
- public Result getResult()
+ public org.jboss.portal.portlet.invocation.response.PortletInvocationResponse getResult()
{
- return result;
+ return response;
}
}
Modified: trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceSecurityInterceptor.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -25,7 +25,7 @@
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.result.InsufficientPrivilegesResult;
+import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
import org.jboss.portal.security.PortalSecurityException;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
import org.jboss.portal.security.spi.auth.PortalAuthorizationManagerFactory;
@@ -76,7 +76,7 @@
}
if (!authorized)
{
- invocation.setResult(new InsufficientPrivilegesResult());
+ invocation.setResponse(new InsufficientPrivilegesResponse());
}
else
{
Copied: trunk/core/src/main/org/jboss/portal/core/result/AuthenticateResponse.java (from rev 5412, trunk/core/src/main/org/jboss/portal/core/result/AuthenticateResult.java)
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/result/AuthenticateResult.java 2006-10-10 23:46:36 UTC (rev 5412)
+++ trunk/core/src/main/org/jboss/portal/core/result/AuthenticateResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.core.result;
+
+import org.jboss.portal.portlet.invocation.response.RedirectionResponse;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision:5352 $
+ */
+public class AuthenticateResponse extends RedirectionResponse
+{
+}
Property changes on: trunk/core/src/main/org/jboss/portal/core/result/AuthenticateResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/core/src/main/org/jboss/portal/core/result/AuthenticateResult.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/result/AuthenticateResult.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/core/src/main/org/jboss/portal/core/result/AuthenticateResult.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,32 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.core.result;
-
-import org.jboss.portal.portlet.result.RedirectionResult;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class AuthenticateResult extends RedirectionResult
-{
-}
Copied: trunk/core/src/main/org/jboss/portal/core/result/SignOutResponse.java (from rev 5412, trunk/core/src/main/org/jboss/portal/core/result/SignOutResult.java)
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/result/SignOutResult.java 2006-10-10 23:46:36 UTC (rev 5412)
+++ trunk/core/src/main/org/jboss/portal/core/result/SignOutResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,63 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.core.result;
+
+import org.jboss.portal.portlet.invocation.response.RedirectionResponse;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision:5352 $
+ */
+public class SignOutResponse extends RedirectionResponse
+{
+
+ /** Location is a URL to navigate to after signing out or null to indicate default behavior. */
+ protected String location;
+
+ public SignOutResponse()
+ {
+ }
+
+ public SignOutResponse(String location)
+ {
+ if (location == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.location = location;
+ }
+
+ /**
+ * Returns a destination URL or null.
+ *
+ * @return URL to navigate to after signing out or null to indicate default behavior
+ */
+ public String getLocation()
+ {
+ return location;
+ }
+
+ public void setLocation(String location)
+ {
+ this.location = location;
+ }
+}
Property changes on: trunk/core/src/main/org/jboss/portal/core/result/SignOutResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/core/src/main/org/jboss/portal/core/result/SignOutResult.java
===================================================================
--- trunk/core/src/main/org/jboss/portal/core/result/SignOutResult.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/core/src/main/org/jboss/portal/core/result/SignOutResult.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,63 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.core.result;
-
-import org.jboss.portal.portlet.result.RedirectionResult;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class SignOutResult extends RedirectionResult
-{
-
- /** Location is a URL to navigate to after signing out or null to indicate default behavior. */
- protected String location;
-
- public SignOutResult()
- {
- }
-
- public SignOutResult(String location)
- {
- if (location == null)
- {
- throw new IllegalArgumentException();
- }
- this.location = location;
- }
-
- /**
- * Returns a destination URL or null.
- *
- * @return URL to navigate to after signing out or null to indicate default behavior
- */
- public String getLocation()
- {
- return location;
- }
-
- public void setLocation(String location)
- {
- this.location = location;
- }
-}
Modified: trunk/core/src/main/org/jboss/portlet/JBossActionResponse.java
===================================================================
--- trunk/core/src/main/org/jboss/portlet/JBossActionResponse.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/core/src/main/org/jboss/portlet/JBossActionResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -24,7 +24,7 @@
import org.jboss.portal.common.util.URLTools;
import org.jboss.portal.core.aspects.controller.node.PortalNodeURLFactory;
import org.jboss.portal.core.aspects.controller.node.PortalObjectNode;
-import org.jboss.portal.core.result.SignOutResult;
+import org.jboss.portal.core.result.SignOutResponse;
import org.jboss.portal.api.node.PortalNode;
import org.jboss.portal.api.node.PortalNodeURL;
import org.jboss.portal.portlet.impl.jsr168.ActionResponseImpl;
@@ -119,7 +119,7 @@
{
throw new IllegalStateException("Cannot perform programmatic signout");
}
- sendRedirect(new SignOutResult());
+ sendRedirect(new SignOutResponse());
}
/**
@@ -140,6 +140,6 @@
throw new IllegalArgumentException("Null location is not accepted");
}
URLTools.enforceAbsoluteURL(location);
- sendRedirect(new SignOutResult(location));
+ sendRedirect(new SignOutResponse(location));
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ProducerCacheInterceptor.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -27,8 +27,8 @@
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.CacheInfo;
-import org.jboss.portal.portlet.result.Result;
-import org.jboss.portal.portlet.result.FragmentResult;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.common.invocation.InvocationException;
/**
@@ -50,10 +50,10 @@
invocation.invokeNext();
//
- Result result = invocation.getResult();
- if (result instanceof FragmentResult)
+ PortletInvocationResponse response = invocation.getResponse();
+ if (response instanceof FragmentResponse)
{
- FragmentResult fragmentResult = (FragmentResult)result;
+ FragmentResponse fragmentResult = (FragmentResponse)response;
// Get config
PortletInfo info = invocation.getInfo();
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/SecureTransportInterceptor.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -25,7 +25,7 @@
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.spi.SecurityContext;
import org.jboss.portal.portlet.TransportGuarantee;
-import org.jboss.portal.portlet.result.InsufficientTransportGuaranteeResult;
+import org.jboss.portal.portlet.invocation.response.InsufficientTransportGuaranteeResponse;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.SecurityInfo;
@@ -67,7 +67,7 @@
else
{
// Significate to the caller that this component should be executed with an higher security level
- invocation.setResult(new InsufficientTransportGuaranteeResult());
+ invocation.setResponse(new InsufficientTransportGuaranteeResponse());
}
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/aspects/portlet/ValveInterceptor.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -23,8 +23,8 @@
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.result.Result;
-import org.jboss.portal.portlet.result.UnavailableResult;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.portlet.container.PortletContainer;
import org.jboss.portal.portlet.container.info.ContainerPortletInfo;
@@ -67,8 +67,8 @@
}
// Stop the container if necessary
- Result result = invocation.getResult();
- if (result instanceof UnavailableResult)
+ PortletInvocationResponse response = invocation.getResponse();
+ if (response instanceof UnavailableResponse)
{
// This call will wait until all the current threads have exited the component valve.
// Perhaps this should be done asynchronously as it may lead to a long delay ?
@@ -79,8 +79,8 @@
}
else
{
- UnavailableResult res = new UnavailableResult();
- invocation.setResult(res);
+ UnavailableResponse res = new UnavailableResponse();
+ invocation.setResponse(res);
}
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/container/PortletContainer.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -46,10 +46,10 @@
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
import org.jboss.portal.portlet.metadata.JBossPortletMetaData;
-import org.jboss.portal.portlet.result.ErrorResult;
-import org.jboss.portal.portlet.result.Result;
-import org.jboss.portal.portlet.result.SecurityErrorResult;
-import org.jboss.portal.portlet.result.UnavailableResult;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.SecurityErrorResponse;
+import org.jboss.portal.portlet.invocation.response.UnavailableResponse;
import javax.portlet.Portlet;
import javax.portlet.PortletConfig;
@@ -430,13 +430,13 @@
{
if (invocation instanceof ActionInvocation)
{
- Result result = invokeAction((ActionInvocation)invocation);
- invocation.setResult(result);
+ PortletInvocationResponse response = invokeAction((ActionInvocation)invocation);
+ invocation.setResponse(response);
}
else if (invocation instanceof RenderInvocation)
{
- Result result = invokeRender((RenderInvocation)invocation);
- invocation.setResult(result);
+ PortletInvocationResponse response = invokeRender((RenderInvocation)invocation);
+ invocation.setResponse(response);
}
else
{
@@ -446,7 +446,7 @@
catch (NoClassDefFoundError e)
{
//
- invocation.setResult(new ErrorResult(e));
+ invocation.setResponse(new ErrorResponse(e));
}
catch (Exception e)
{
@@ -455,29 +455,29 @@
//
if (e instanceof PortletSecurityException)
{
- invocation.setResult(new SecurityErrorResult(e));
+ invocation.setResponse(new SecurityErrorResponse(e));
}
else if (e instanceof UnavailableException)
{
UnavailableException ue = (UnavailableException)e;
if (ue.isPermanent())
{
- invocation.setResult(new UnavailableResult());
+ invocation.setResponse(new UnavailableResponse());
}
else
{
- invocation.setResult(new UnavailableResult(ue.getUnavailableSeconds()));
+ invocation.setResponse(new UnavailableResponse(ue.getUnavailableSeconds()));
}
}
else
{
// The exception is either a PortletException, an IOException or a RuntimeException
- invocation.setResult(new ErrorResult(e));
+ invocation.setResponse(new ErrorResponse(e));
}
}
}
- protected Result invokeAction(ActionInvocation invocation) throws IOException, PortletException
+ protected PortletInvocationResponse invokeAction(ActionInvocation invocation) throws IOException, PortletException
{
APIFactory factory = application.getAPIFactory();
ActionRequestImpl areq = factory.createActionRequest(invocation);
@@ -502,7 +502,7 @@
return aresp.getResult();
}
- protected Result invokeRender(RenderInvocation invocation) throws IOException, PortletException
+ protected PortletInvocationResponse invokeRender(RenderInvocation invocation) throws IOException, PortletException
{
APIFactory factory = application.getAPIFactory();
RenderRequestImpl rreq = factory.createRenderRequest(invocation);
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionResponseImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionResponseImpl.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/ActionResponseImpl.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -27,10 +27,10 @@
import org.jboss.portal.portlet.ParametersStateString;
import org.jboss.portal.portlet.Properties;
import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.result.HTTPRedirectionResult;
-import org.jboss.portal.portlet.result.RedirectionResult;
-import org.jboss.portal.portlet.result.RenderResult;
-import org.jboss.portal.portlet.result.Result;
+import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
+import org.jboss.portal.portlet.invocation.response.RedirectionResponse;
+import org.jboss.portal.portlet.invocation.response.RenderResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import javax.portlet.ActionResponse;
import javax.portlet.PortletMode;
@@ -53,7 +53,7 @@
protected static final int WANT_RENDER = 1;
protected static final int WANT_REDIRECT = 2;
- protected Result result;
+ protected PortletInvocationResponse response;
protected int decision;
public ActionResponseImpl(ActionInvocation invocation, PortletRequestImpl preq)
@@ -61,18 +61,18 @@
super(invocation, preq);
//
- RenderResult rr = new RenderResult();
+ RenderResponse rr = new RenderResponse();
rr.setNavigationalState(new ParametersStateString());
rr.setProperties(new Properties());
//
- this.result = rr;
+ this.response = rr;
this.decision = WANT_NOTHING;
}
- public Result getResult()
+ public PortletInvocationResponse getResult()
{
- return result;
+ return response;
}
public void setWindowState(WindowState windowState) throws WindowStateException
@@ -83,7 +83,7 @@
{
throw new WindowStateException("Not supported", windowState);
}
- ((RenderResult)result).setWindowState(org.jboss.portal.WindowState.create(windowState.toString()));
+ ((RenderResponse)response).setWindowState(org.jboss.portal.WindowState.create(windowState.toString()));
decision = WANT_RENDER;
}
else
@@ -109,7 +109,7 @@
throw new PortletModeException("Not supported", portletMode);
}
Mode mode = Mode.create(portletMode.toString());
- ((RenderResult)result).setMode(mode);
+ ((RenderResponse)response).setMode(mode);
}
decision = WANT_RENDER;
}
@@ -127,7 +127,7 @@
return;
}
URLTools.enforceAbsoluteURL(location);
- sendRedirect(new HTTPRedirectionResult(location));
+ sendRedirect(new HTTPRedirectionResponse(location));
}
/**
@@ -136,11 +136,11 @@
* @param redirect
* @throws IllegalStateException implement jsr168 behavior if the portlet as already commited stuff
*/
- protected final void sendRedirect(RedirectionResult redirect) throws IllegalStateException
+ protected final void sendRedirect(RedirectionResponse redirect) throws IllegalStateException
{
if (decision == WANT_NOTHING || decision == WANT_REDIRECT)
{
- result = redirect;
+ response = redirect;
decision = WANT_REDIRECT;
}
else
@@ -158,7 +158,7 @@
//
if (decision == WANT_NOTHING || decision == WANT_RENDER)
{
- ((ParametersStateString)((RenderResult)result).getNavigationalState()).replace(map);
+ ((ParametersStateString)((RenderResponse)response).getNavigationalState()).replace(map);
decision = WANT_RENDER;
}
else
@@ -174,7 +174,7 @@
//
if (decision == WANT_NOTHING || decision == WANT_RENDER)
{
- ((ParametersStateString)((RenderResult)result).getNavigationalState()).setValue(name, value);
+ ((ParametersStateString)((RenderResponse)response).getNavigationalState()).setValue(name, value);
decision = WANT_RENDER;
}
else
@@ -190,7 +190,7 @@
//
if (decision == WANT_NOTHING || decision == WANT_RENDER)
{
- ((ParametersStateString)((RenderResult)result).getNavigationalState()).setValues(name, values);
+ ((ParametersStateString)((RenderResponse)response).getNavigationalState()).setValues(name, values);
decision = WANT_RENDER;
}
else
@@ -201,9 +201,9 @@
public void addProperty(String name, String value)
{
- if (result instanceof RenderResult)
+ if (response instanceof RenderResponse)
{
- RenderResult renderResult = (RenderResult)result;
+ RenderResponse renderResult = (RenderResponse)response;
Properties properties = renderResult.getProperties();
properties.addProperty(name, value);
}
@@ -211,9 +211,9 @@
public void setProperty(String name, String value)
{
- if (result instanceof RenderResult)
+ if (response instanceof RenderResponse)
{
- RenderResult renderResult = (RenderResult)result;
+ RenderResponse renderResult = (RenderResponse)response;
Properties properties = renderResult.getProperties();
properties.setProperty(name, value);
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/RenderResponseImpl.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/RenderResponseImpl.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/impl/jsr168/RenderResponseImpl.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -24,8 +24,8 @@
import org.jboss.portal.common.MediaType;
import org.jboss.portal.portlet.Properties;
import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.result.FragmentResult;
-import org.jboss.portal.portlet.result.Result;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.server.util.HTTPStreamInfo;
import javax.activation.MimeTypeParseException;
@@ -44,7 +44,7 @@
{
/** The fragment result. */
- protected FragmentResult result;
+ protected FragmentResponse result;
/** The namespace. */
protected String namespace;
@@ -52,10 +52,10 @@
public RenderResponseImpl(RenderInvocation invocation, PortletRequestImpl preq)
{
super(invocation, preq);
- this.result = new FragmentResult();
+ this.result = new FragmentResponse();
}
- public Result getResult()
+ public PortletInvocationResponse getResult()
{
return result;
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/PortletInvocation.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -26,7 +26,7 @@
import org.jboss.portal.common.invocation.Scope;
import org.jboss.portal.portlet.Properties;
import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.portlet.result.Result;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.PortalContext;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
@@ -103,7 +103,7 @@
protected HttpServletResponse dresp;
/** The result. */
- protected Result result;
+ protected PortletInvocationResponse response;
/** The invocation context. */
protected PortletInvocationContext ctx;
@@ -174,17 +174,17 @@
/**
* Set the outcome of this request.
*/
- public void setResult(Result result)
+ public void setResponse(PortletInvocationResponse response)
{
- this.result = result;
+ this.response = response;
}
/**
* Return the outcome of this request.
*/
- public Result getResult()
+ public PortletInvocationResponse getResponse()
{
- return result;
+ return response;
}
/**
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response (from rev 5410, trunk/portlet/src/main/org/jboss/portal/portlet/result)
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/AccessDeniedResponse.java (from rev 5410, trunk/portlet/src/main/org/jboss/portal/portlet/result/AccessDeniedResult.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/AccessDeniedResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/AccessDeniedResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,30 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.invocation.response;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class AccessDeniedResponse
+{
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/AccessDeniedResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/AccessDeniedResult.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/AccessDeniedResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/AccessDeniedResult.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,30 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.result;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class AccessDeniedResult
-{
-}
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/ErrorResponse.java (from rev 5410, trunk/portlet/src/main/org/jboss/portal/portlet/result/ErrorResult.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/ErrorResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/ErrorResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,115 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.invocation.response;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.common.util.Exceptions;
+
+/**
+ * Application level error.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class ErrorResponse extends PortletInvocationResponse
+{
+ /** The logged throwable if any. */
+ private final Throwable throwable;
+
+ /** There must be one error message. */
+ private final String message;
+
+ public ErrorResponse(Throwable throwable)
+ {
+ if (throwable == null)
+ {
+ throw new IllegalArgumentException("There must be a throwable");
+ }
+ this.throwable = throwable;
+ this.message = throwable.getMessage();
+ }
+
+ public ErrorResponse(String message)
+ {
+ if (message == null)
+ {
+ throw new IllegalArgumentException("Message cannot be null.");
+ }
+ this.message = message;
+ this.throwable = null;
+ }
+
+ /** The throwable. Can be a null object. */
+ public Throwable getThrowable()
+ {
+ return throwable;
+ }
+
+ /** The logged message. */
+ public String getMessage()
+ {
+ if (message == null)
+ {
+ return throwable.getClass().getName();
+ }
+
+ return message;
+ }
+
+ /**
+ * Logs an error message to the specified logger, using either the message or this ErrorResult's Throwable if
+ * available.
+ *
+ * @param log
+ * @param logMessage
+ */
+ public void logErrorTo(Logger log, String logMessage)
+ {
+ if (throwable != null)
+ {
+ log.error(logMessage, throwable);
+ }
+ else
+ {
+ log.error(logMessage + "\n" + message);
+ }
+ }
+
+ /**
+ * Provides an HTML description of the error, using either the message or the encapsulated Throwable.
+ *
+ * @return
+ */
+ public String toHTML()
+ {
+ if (throwable != null)
+ {
+ return Exceptions.toHTML(throwable);
+ }
+ else
+ {
+ StringBuffer sb = new StringBuffer(255);
+ sb.append("<div><code>").append(message).append("</code></div>");
+ return sb.toString();
+ }
+ }
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/ErrorResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/ErrorResult.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/ErrorResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/ErrorResult.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,115 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.result;
-
-import org.jboss.logging.Logger;
-import org.jboss.portal.common.util.Exceptions;
-
-/**
- * Application level error.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class ErrorResult extends Result
-{
- /** The logged throwable if any. */
- private final Throwable throwable;
-
- /** There must be one error message. */
- private final String message;
-
- public ErrorResult(Throwable throwable)
- {
- if (throwable == null)
- {
- throw new IllegalArgumentException("There must be a throwable");
- }
- this.throwable = throwable;
- this.message = throwable.getMessage();
- }
-
- public ErrorResult(String message)
- {
- if (message == null)
- {
- throw new IllegalArgumentException("Message cannot be null.");
- }
- this.message = message;
- this.throwable = null;
- }
-
- /** The throwable. Can be a null object. */
- public Throwable getThrowable()
- {
- return throwable;
- }
-
- /** The logged message. */
- public String getMessage()
- {
- if (message == null)
- {
- return throwable.getClass().getName();
- }
-
- return message;
- }
-
- /**
- * Logs an error message to the specified logger, using either the message or this ErrorResult's Throwable if
- * available.
- *
- * @param log
- * @param logMessage
- */
- public void logErrorTo(Logger log, String logMessage)
- {
- if (throwable != null)
- {
- log.error(logMessage, throwable);
- }
- else
- {
- log.error(logMessage + "\n" + message);
- }
- }
-
- /**
- * Provides an HTML description of the error, using either the message or the encapsulated Throwable.
- *
- * @return
- */
- public String toHTML()
- {
- if (throwable != null)
- {
- return Exceptions.toHTML(throwable);
- }
- else
- {
- StringBuffer sb = new StringBuffer(255);
- sb.append("<div><code>").append(message).append("</code></div>");
- return sb.toString();
- }
- }
-}
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResponse.java (from rev 5410, trunk/portlet/src/main/org/jboss/portal/portlet/result/FragmentResult.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/FragmentResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,250 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.invocation.response;
+
+import org.jboss.portal.portlet.Properties;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.OutputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+
+/**
+ * Data produced.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class FragmentResponse extends PortletInvocationResponse
+{
+
+ public static final int TYPE_EMPTY = 0;
+ public static final int TYPE_CHARS = 1;
+ public static final int TYPE_BYTES = 2;
+
+ /** Any content that should appear in the header. */
+ private String header;
+
+ /** The output as a bytes if any. */
+ private ByteArrayOutputStream bytes;
+
+ /** The output as chars if any. */
+ private StringWriter chars;
+
+ /** The writer that will produce the chars output if any. */
+ private PrintWriter writer;
+
+ /** The result content type if any. */
+ private String contentType;
+
+ /** The title if any. */
+ private String title;
+
+ /** The response properties. */
+ protected Properties properties;
+
+ /** Number of seconds this result remains valid, a value of -1 indicates that it never expires. */
+ protected int expirationSecs;
+
+ public FragmentResponse()
+ {
+ this.header = null;
+ this.bytes = null;
+ this.chars = null;
+ this.writer = null;
+ this.contentType = null;
+ this.title = null;
+ this.properties = new Properties();
+ this.expirationSecs = 0;
+ }
+
+ public String getHeader()
+ {
+ return header;
+ }
+
+ public void setHeader(String header)
+ {
+ this.header = header;
+ }
+
+ public int getType()
+ {
+ if (bytes == null)
+ {
+ if (chars == null)
+ {
+ return TYPE_EMPTY;
+ }
+ else
+ {
+ return TYPE_CHARS;
+ }
+ }
+ else
+ {
+ return TYPE_BYTES;
+ }
+ }
+
+ /**
+ * Return the bytes of the content held by the fragment.
+ *
+ * @return the bytes
+ * @throws IllegalArgumentException if the type is not bytes
+ */
+ public ByteArrayOutputStream getBytes() throws IllegalArgumentException
+ {
+ if (bytes == null)
+ {
+ throw new IllegalStateException("Bytes not used");
+ }
+ return bytes;
+ }
+
+ /**
+ * Return the chars of the content held by the fragment.
+ *
+ * @return the chars
+ * @throws IllegalArgumentException if the type is not chars
+ */
+ public StringWriter getChars() throws IllegalArgumentException
+ {
+ if (chars == null)
+ {
+ throw new IllegalStateException("Chars not used");
+ }
+ return chars;
+ }
+
+ /**
+ * Return the fragment title.
+ *
+ * @return the title.
+ */
+ public String getTitle()
+ {
+ return title;
+ }
+
+ /**
+ * Set the fragment title.
+ *
+ * @param title the new title
+ */
+ public void setTitle(String title)
+ {
+ this.title = title;
+ }
+
+ /**
+ * Return the content type of the generated fragment.
+ *
+ * @return the content type
+ */
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ /**
+ * Set the fragment of the content type.
+ *
+ * @param contentType the content type
+ */
+ public void setContentType(String contentType)
+ {
+ this.contentType = contentType;
+ }
+
+ /**
+ * @throws IllegalStateException if the output stream is already used or if no content type is defined
+ */
+ public PrintWriter getWriter()throws IllegalStateException
+ {
+ if (bytes != null)
+ {
+ throw new IllegalStateException("The window output stream is already used");
+ }
+ if (contentType == null)
+ {
+ throw new IllegalStateException("No content type defined");
+ }
+ if (chars == null)
+ {
+ chars = new StringWriter();
+ writer = new PrintWriter(chars);
+ }
+ return writer;
+ }
+
+ /**
+ * @throws IOException
+ * @throws IllegalStateException if the window writer is already used or if no content type is defined
+ */
+ public OutputStream getOutputStream() throws IOException, IllegalStateException
+ {
+ if (chars != null)
+ {
+ throw new IllegalStateException("The window writer is already used");
+ }
+ if (contentType == null)
+ {
+ throw new IllegalStateException("No content type defined");
+ }
+ if (bytes == null)
+ {
+ bytes = new ByteArrayOutputStream();
+ }
+ return bytes;
+ }
+
+ public void resetBuffer()
+ {
+ if (bytes != null)
+ {
+ bytes.reset();
+ }
+ else if (chars != null)
+ {
+ chars.flush();
+ chars.getBuffer().setLength(0);
+ }
+ }
+
+ public Properties getProperties()
+ {
+ return properties;
+ }
+
+
+ public int getExpirationSecs()
+ {
+ return expirationSecs;
+ }
+
+ public void setExpirationSecs(int expirationSecs)
+ {
+ this.expirationSecs = expirationSecs;
+ }
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResult.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/FragmentResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/FragmentResult.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,250 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.result;
-
-import org.jboss.portal.portlet.Properties;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-
-/**
- * Data produced.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class FragmentResult extends Result
-{
-
- public static final int TYPE_EMPTY = 0;
- public static final int TYPE_CHARS = 1;
- public static final int TYPE_BYTES = 2;
-
- /** Any content that should appear in the header. */
- private String header;
-
- /** The output as a bytes if any. */
- private ByteArrayOutputStream bytes;
-
- /** The output as chars if any. */
- private StringWriter chars;
-
- /** The writer that will produce the chars output if any. */
- private PrintWriter writer;
-
- /** The result content type if any. */
- private String contentType;
-
- /** The title if any. */
- private String title;
-
- /** The response properties. */
- protected Properties properties;
-
- /** Number of seconds this result remains valid, a value of -1 indicates that it never expires. */
- protected int expirationSecs;
-
- public FragmentResult()
- {
- this.header = null;
- this.bytes = null;
- this.chars = null;
- this.writer = null;
- this.contentType = null;
- this.title = null;
- this.properties = new Properties();
- this.expirationSecs = 0;
- }
-
- public String getHeader()
- {
- return header;
- }
-
- public void setHeader(String header)
- {
- this.header = header;
- }
-
- public int getType()
- {
- if (bytes == null)
- {
- if (chars == null)
- {
- return TYPE_EMPTY;
- }
- else
- {
- return TYPE_CHARS;
- }
- }
- else
- {
- return TYPE_BYTES;
- }
- }
-
- /**
- * Return the bytes of the content held by the fragment.
- *
- * @return the bytes
- * @throws IllegalArgumentException if the type is not bytes
- */
- public ByteArrayOutputStream getBytes() throws IllegalArgumentException
- {
- if (bytes == null)
- {
- throw new IllegalStateException("Bytes not used");
- }
- return bytes;
- }
-
- /**
- * Return the chars of the content held by the fragment.
- *
- * @return the chars
- * @throws IllegalArgumentException if the type is not chars
- */
- public StringWriter getChars() throws IllegalArgumentException
- {
- if (chars == null)
- {
- throw new IllegalStateException("Chars not used");
- }
- return chars;
- }
-
- /**
- * Return the fragment title.
- *
- * @return the title.
- */
- public String getTitle()
- {
- return title;
- }
-
- /**
- * Set the fragment title.
- *
- * @param title the new title
- */
- public void setTitle(String title)
- {
- this.title = title;
- }
-
- /**
- * Return the content type of the generated fragment.
- *
- * @return the content type
- */
- public String getContentType()
- {
- return contentType;
- }
-
- /**
- * Set the fragment of the content type.
- *
- * @param contentType the content type
- */
- public void setContentType(String contentType)
- {
- this.contentType = contentType;
- }
-
- /**
- * @throws IllegalStateException if the output stream is already used or if no content type is defined
- */
- public PrintWriter getWriter()throws IllegalStateException
- {
- if (bytes != null)
- {
- throw new IllegalStateException("The window output stream is already used");
- }
- if (contentType == null)
- {
- throw new IllegalStateException("No content type defined");
- }
- if (chars == null)
- {
- chars = new StringWriter();
- writer = new PrintWriter(chars);
- }
- return writer;
- }
-
- /**
- * @throws IOException
- * @throws IllegalStateException if the window writer is already used or if no content type is defined
- */
- public OutputStream getOutputStream() throws IOException, IllegalStateException
- {
- if (chars != null)
- {
- throw new IllegalStateException("The window writer is already used");
- }
- if (contentType == null)
- {
- throw new IllegalStateException("No content type defined");
- }
- if (bytes == null)
- {
- bytes = new ByteArrayOutputStream();
- }
- return bytes;
- }
-
- public void resetBuffer()
- {
- if (bytes != null)
- {
- bytes.reset();
- }
- else if (chars != null)
- {
- chars.flush();
- chars.getBuffer().setLength(0);
- }
- }
-
- public Properties getProperties()
- {
- return properties;
- }
-
-
- public int getExpirationSecs()
- {
- return expirationSecs;
- }
-
- public void setExpirationSecs(int expirationSecs)
- {
- this.expirationSecs = expirationSecs;
- }
-}
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/HTTPRedirectionResponse.java (from rev 5410, trunk/portlet/src/main/org/jboss/portal/portlet/result/HTTPRedirectionResult.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/HTTPRedirectionResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/HTTPRedirectionResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,44 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.invocation.response;
+
+/**
+ * Redirection to an HTTP location.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class HTTPRedirectionResponse extends RedirectionResponse
+{
+
+ protected String location;
+
+ public HTTPRedirectionResponse(String location)
+ {
+ this.location = location;
+ }
+
+ public String getLocation()
+ {
+ return location;
+ }
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/HTTPRedirectionResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/HTTPRedirectionResult.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/HTTPRedirectionResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/HTTPRedirectionResult.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,44 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.result;
-
-/**
- * Redirection to an HTTP location.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class HTTPRedirectionResult extends RedirectionResult
-{
-
- protected String location;
-
- public HTTPRedirectionResult(String location)
- {
- this.location = location;
- }
-
- public String getLocation()
- {
- return location;
- }
-}
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientPrivilegesResponse.java (from rev 5410, trunk/portlet/src/main/org/jboss/portal/portlet/result/InsufficientPrivilegesResult.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/InsufficientPrivilegesResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientPrivilegesResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,30 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.invocation.response;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class InsufficientPrivilegesResponse extends PortletInvocationResponse
+{
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientPrivilegesResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientPrivilegesResult.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/InsufficientPrivilegesResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientPrivilegesResult.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,30 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.result;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class InsufficientPrivilegesResult extends Result
-{
-}
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientTransportGuaranteeResponse.java (from rev 5410, trunk/portlet/src/main/org/jboss/portal/portlet/result/InsufficientTransportGuaranteeResult.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/InsufficientTransportGuaranteeResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientTransportGuaranteeResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,30 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.invocation.response;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class InsufficientTransportGuaranteeResponse extends PortletInvocationResponse
+{
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientTransportGuaranteeResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientTransportGuaranteeResult.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/InsufficientTransportGuaranteeResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/InsufficientTransportGuaranteeResult.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,30 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.result;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class InsufficientTransportGuaranteeResult extends Result
-{
-}
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/PortletInvocationResponse.java (from rev 5410, trunk/portlet/src/main/org/jboss/portal/portlet/result/Result.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/Result.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/PortletInvocationResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.invocation.response;
+
+/**
+ * The base interface for all result objects.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class PortletInvocationResponse
+{
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/PortletInvocationResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RedirectionResponse.java (from rev 5410, trunk/portlet/src/main/org/jboss/portal/portlet/result/RedirectionResult.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/RedirectionResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RedirectionResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,32 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.invocation.response;
+
+/**
+ * Redirection to something.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class RedirectionResponse extends PortletInvocationResponse
+{
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RedirectionResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RedirectionResult.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/RedirectionResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RedirectionResult.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,32 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.result;
-
-/**
- * Redirection to something.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class RedirectionResult extends Result
-{
-}
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RenderResponse.java (from rev 5410, trunk/portlet/src/main/org/jboss/portal/portlet/result/RenderResult.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/RenderResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RenderResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,97 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.invocation.response;
+
+import org.jboss.portal.portlet.Properties;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+
+/**
+ * Want to be rendered.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class RenderResponse extends PortletInvocationResponse
+{
+
+ /** The navigational state returned. */
+ protected StateString state;
+
+ /** The response properties. */
+ protected Properties properties;
+
+ /** The new window state requested. */
+ protected WindowState windowState;
+
+ /** The new mode requested. */
+ protected Mode mode;
+
+ public RenderResponse()
+ {
+ state = null;
+ properties = null;
+ windowState = null;
+ mode = null;
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public void setMode(Mode mode)
+ {
+ this.mode = mode;
+ }
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+
+ public void setWindowState(WindowState windowState)
+ {
+ this.windowState = windowState;
+ }
+
+ public StateString getNavigationalState()
+ {
+ return state;
+ }
+
+ public void setNavigationalState(StateString state)
+ {
+ this.state = state;
+ }
+
+ public Properties getProperties()
+ {
+ return properties;
+ }
+
+ public void setProperties(Properties properties)
+ {
+ this.properties = properties;
+ }
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RenderResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RenderResult.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/RenderResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/RenderResult.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,97 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.result;
-
-import org.jboss.portal.portlet.Properties;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-
-/**
- * Want to be rendered.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class RenderResult extends Result
-{
-
- /** The navigational state returned. */
- protected StateString state;
-
- /** The response properties. */
- protected Properties properties;
-
- /** The new window state requested. */
- protected WindowState windowState;
-
- /** The new mode requested. */
- protected Mode mode;
-
- public RenderResult()
- {
- state = null;
- properties = null;
- windowState = null;
- mode = null;
- }
-
- public Mode getMode()
- {
- return mode;
- }
-
- public void setMode(Mode mode)
- {
- this.mode = mode;
- }
-
- public WindowState getWindowState()
- {
- return windowState;
- }
-
- public void setWindowState(WindowState windowState)
- {
- this.windowState = windowState;
- }
-
- public StateString getNavigationalState()
- {
- return state;
- }
-
- public void setNavigationalState(StateString state)
- {
- this.state = state;
- }
-
- public Properties getProperties()
- {
- return properties;
- }
-
- public void setProperties(Properties properties)
- {
- this.properties = properties;
- }
-}
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/Result.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/Result.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/Result.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,32 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.result;
-
-/**
- * The base interface for all result objects.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class Result
-{
-}
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityErrorResponse.java (from rev 5410, trunk/portlet/src/main/org/jboss/portal/portlet/result/SecurityErrorResult.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/SecurityErrorResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityErrorResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,37 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.invocation.response;
+
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+
+/**
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class SecurityErrorResponse
+ extends ErrorResponse
+{
+ public SecurityErrorResponse(Throwable throwable)
+ {
+ super(throwable);
+ }
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityErrorResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityErrorResult.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/SecurityErrorResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/SecurityErrorResult.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,37 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.result;
-
-import org.jboss.portal.portlet.result.ErrorResult;
-
-/**
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class SecurityErrorResult
- extends ErrorResult
-{
- public SecurityErrorResult(Throwable throwable)
- {
- super(throwable);
- }
-}
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/StreamResponse.java (from rev 5410, trunk/portlet/src/main/org/jboss/portal/portlet/result/StreamResult.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/StreamResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/StreamResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,61 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.invocation.response;
+
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+
+/**
+ * Stream a result to the client directly.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class StreamResponse extends PortletInvocationResponse
+{
+
+ private String contentType;
+ private byte[] bytes;
+
+ public StreamResponse(String contentType, byte[] bytes)
+ {
+ if (contentType == null)
+ {
+ throw new IllegalArgumentException("Content type cannot be null");
+ }
+ if (bytes == null)
+ {
+ throw new IllegalArgumentException("Bytes cannot be null");
+ }
+ this.contentType = contentType;
+ this.bytes = bytes;
+ }
+
+ public String getContentType()
+ {
+ return contentType;
+ }
+
+ public byte[] getBytes()
+ {
+ return bytes;
+ }
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/StreamResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/StreamResult.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/StreamResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/StreamResult.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,61 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.result;
-
-import org.jboss.portal.portlet.result.Result;
-
-/**
- * Stream a result to the client directly.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class StreamResult extends Result
-{
-
- private String contentType;
- private byte[] bytes;
-
- public StreamResult(String contentType, byte[] bytes)
- {
- if (contentType == null)
- {
- throw new IllegalArgumentException("Content type cannot be null");
- }
- if (bytes == null)
- {
- throw new IllegalArgumentException("Bytes cannot be null");
- }
- this.contentType = contentType;
- this.bytes = bytes;
- }
-
- public String getContentType()
- {
- return contentType;
- }
-
- public byte[] getBytes()
- {
- return bytes;
- }
-}
Copied: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/UnavailableResponse.java (from rev 5410, trunk/portlet/src/main/org/jboss/portal/portlet/result/UnavailableResult.java)
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/UnavailableResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/UnavailableResponse.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -0,0 +1,57 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., 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.invocation.response;
+
+/**
+ * Portlet exists but cannot be used.
+ *
+ * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
+ * @version $Revision$
+ */
+public class UnavailableResponse extends PortletInvocationResponse
+{
+
+ private boolean permanent;
+ private int seconds;
+
+ public UnavailableResponse()
+ {
+ this.seconds = 0;
+ this.permanent = true;
+ }
+
+ public UnavailableResponse(int seconds)
+ {
+ this.seconds = seconds;
+ this.permanent = false;
+ }
+
+ public int getUnavailableSeconds()
+ {
+ return seconds;
+ }
+
+ public boolean isPermanent()
+ {
+ return permanent;
+ }
+}
Property changes on: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/UnavailableResponse.java
___________________________________________________________________
Name: svn:executable
+ *
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Deleted: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/UnavailableResult.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/UnavailableResult.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/UnavailableResult.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -1,57 +0,0 @@
-/*
-* JBoss, Home of Professional Open Source
-* Copyright 2005, JBoss Inc., 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.result;
-
-/**
- * Portlet exists but cannot be used.
- *
- * @author <a href="mailto:julien at jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class UnavailableResult extends Result
-{
-
- private boolean permanent;
- private int seconds;
-
- public UnavailableResult()
- {
- this.seconds = 0;
- this.permanent = true;
- }
-
- public UnavailableResult(int seconds)
- {
- this.seconds = seconds;
- this.permanent = false;
- }
-
- public int getUnavailableSeconds()
- {
- return seconds;
- }
-
- public boolean isPermanent()
- {
- return permanent;
- }
-}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/SoftTimedContent.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/cache/SoftTimedContent.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/SoftTimedContent.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -19,11 +19,11 @@
* 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.result.cache;
+package org.jboss.portal.portlet.invocation.response.cache;
import java.lang.ref.WeakReference;
-import org.jboss.portal.portlet.result.FragmentResult;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
/**
* Use soft reference.
@@ -42,7 +42,7 @@
/**
* @exception IllegalArgumentException if the content is null
*/
- public SoftTimedContent(FragmentResult content, long expirationTimeMillis) throws IllegalArgumentException
+ public SoftTimedContent(FragmentResponse content, long expirationTimeMillis) throws IllegalArgumentException
{
super(expirationTimeMillis);
if (content == null)
@@ -52,8 +52,8 @@
this.content = new WeakReference(content);
}
- public FragmentResult getContent()
+ public FragmentResponse getContent()
{
- return (FragmentResult)content.get();
+ return (FragmentResponse)content.get();
}
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/StrongTimedContent.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/cache/StrongTimedContent.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/StrongTimedContent.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -19,9 +19,9 @@
* 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.result.cache;
+package org.jboss.portal.portlet.invocation.response.cache;
-import org.jboss.portal.portlet.result.FragmentResult;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
/**
* Use strong references.
@@ -35,12 +35,12 @@
/** The serialVersionUID */
private static final long serialVersionUID = -8194245397756941208L;
/** The content. */
- private transient FragmentResult content;
+ private transient FragmentResponse content;
/**
* @exception IllegalArgumentException if the content is null
*/
- public StrongTimedContent(FragmentResult content, long expirationTimeMillis) throws IllegalArgumentException
+ public StrongTimedContent(FragmentResponse content, long expirationTimeMillis) throws IllegalArgumentException
{
super(expirationTimeMillis);
if (content == null)
@@ -50,7 +50,7 @@
this.content = content;
}
- public FragmentResult getContent()
+ public FragmentResponse getContent()
{
return content;
}
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/TimedContent.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/result/cache/TimedContent.java 2006-10-10 23:00:00 UTC (rev 5410)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/invocation/response/cache/TimedContent.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -19,9 +19,9 @@
* 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.result.cache;
+package org.jboss.portal.portlet.invocation.response.cache;
-import org.jboss.portal.portlet.result.FragmentResult;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import java.io.Serializable;
@@ -45,7 +45,7 @@
/**
* Return the content, possibly null.
*/
- public abstract FragmentResult getContent();
+ public abstract FragmentResponse getContent();
/**
*
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/PortletController.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -46,12 +46,12 @@
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.result.ErrorResult;
-import org.jboss.portal.portlet.result.FragmentResult;
-import org.jboss.portal.portlet.result.HTTPRedirectionResult;
-import org.jboss.portal.portlet.result.InsufficientPrivilegesResult;
-import org.jboss.portal.portlet.result.RenderResult;
-import org.jboss.portal.portlet.result.Result;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
+import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
+import org.jboss.portal.portlet.invocation.response.RenderResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.ActionContext;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.PortalContext;
@@ -68,7 +68,6 @@
import org.jboss.portal.server.RequestController;
import org.jboss.portal.server.ServerException;
import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
import org.jboss.portal.server.util.HTTPStreamInfo;
@@ -155,10 +154,10 @@
ActionInvocation action = createAction(invocation, actionContext);
action.setAttribute(PortletInvocation.REQUEST_SCOPE, PortletInvocation.PORTLET_CONTEXT_ATTRIBUTE, ((InstanceContextImpl)action.getInstanceContext()).getPortletContext());
portletInvoker.invoke(action);
- Result result = action.getResult();
- if (result instanceof RenderResult)
+ PortletInvocationResponse response = action.getResponse();
+ if (response instanceof RenderResponse)
{
- RenderResult renderResult = (RenderResult)result;
+ RenderResponse renderResult = (RenderResponse)response;
// Perform the redirection or chain rendering as part of the same http request
if (redirectAfterAction)
@@ -199,11 +198,11 @@
invocation.setAttribute(ServerInvocation.NAVIGATIONAL_STATE_SCOPE, portlet.getContext().getId(), renderResult.getNavigationalState());
}
}
- if (result instanceof HTTPRedirectionResult)
+ if (response instanceof HTTPRedirectionResponse)
{
try
{
- HTTPRedirectionResult redirection = (HTTPRedirectionResult)result;
+ HTTPRedirectionResponse redirection = (HTTPRedirectionResponse)response;
invocation.getServerContext().getClientResponse().sendRedirect(redirection.getLocation());
return;
}
@@ -212,9 +211,9 @@
throw new ServerException(e);
}
}
- else if (result instanceof ErrorResult)
+ else if (response instanceof ErrorResponse)
{
- ErrorResult error = (ErrorResult)result;
+ ErrorResponse error = (ErrorResponse)response;
error.logErrorTo(log, "An error occured during portlet invocation");
try
{
@@ -290,32 +289,32 @@
//
- Result result = render.getResult();
- if (result instanceof FragmentResult)
+ PortletInvocationResponse response = render.getResponse();
+ if (response instanceof FragmentResponse)
{
- FragmentResult fragment = (FragmentResult)result;
+ FragmentResponse fragment = (FragmentResponse)response;
String s = "";
switch (fragment.getType())
{
- case FragmentResult.TYPE_EMPTY:
+ case FragmentResponse.TYPE_EMPTY:
// Keep the empty string
break;
- case FragmentResult.TYPE_CHARS:
- s = ((FragmentResult)result).getChars().toString();
+ case FragmentResponse.TYPE_CHARS:
+ s = ((FragmentResponse)response).getChars().toString();
break;
- case FragmentResult.TYPE_BYTES:
- s = ((FragmentResult)result).getBytes().toString();
+ case FragmentResponse.TYPE_BYTES:
+ s = ((FragmentResponse)response).getBytes().toString();
break;
}
writer.write(s);
}
- else if (result instanceof ErrorResult)
+ else if (response instanceof ErrorResponse)
{
writer.write("<div style=\"color: red;\">");
- writer.write(((ErrorResult)result).toHTML());
+ writer.write(((ErrorResponse)response).toHTML());
writer.write("</div>");
}
- else if (result instanceof InsufficientPrivilegesResult)
+ else if (response instanceof InsufficientPrivilegesResponse)
{
throw new NotYetImplemented();
// // Redirect to authed servlet
Modified: trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java
===================================================================
--- trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/portlet/src/main/org/jboss/portal/portlet/test/TestSecurityInterceptor.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -23,7 +23,7 @@
import org.jboss.portal.portlet.invocation.PortletInterceptor;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.result.InsufficientPrivilegesResult;
+import org.jboss.portal.portlet.invocation.response.InsufficientPrivilegesResponse;
import org.jboss.portal.portlet.security.PortletPermission;
import org.jboss.portal.portlet.PortletContext;
import org.jboss.portal.common.invocation.InvocationException;
@@ -64,8 +64,8 @@
boolean authorized = authMgr.checkPermission(perm);
if (authorized == false)
{
- InsufficientPrivilegesResult result = new InsufficientPrivilegesResult();
- invocation.setResult(result);
+ InsufficientPrivilegesResponse result = new InsufficientPrivilegesResponse();
+ invocation.setResponse(result);
}
else
{
Modified: trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/wsrp/src/main/org/jboss/portal/test/wsrp/v1/consumer/MarkupTestCase.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -26,10 +26,10 @@
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.result.ErrorResult;
-import org.jboss.portal.portlet.result.FragmentResult;
-import org.jboss.portal.portlet.result.RenderResult;
-import org.jboss.portal.portlet.result.Result;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.RenderResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.WindowContext;
import org.jboss.portal.test.wsrp.TestWSRPProducerImpl;
import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
@@ -56,7 +56,7 @@
consumer.invoke(render);
- assertTrue(render.getResult() instanceof ErrorResult);
+ assertTrue(render.getResponse() instanceof ErrorResponse);
render = createRenderInvocation(SOF.EMPTY_MARKUP_PORTLET_HANDLE);
@@ -71,7 +71,7 @@
consumer.invoke(render);
- FragmentResult result = checkRenderResult(render, "portlet1:view:maximized");
+ FragmentResponse result = checkRenderResult(render, "portlet1:view:maximized");
assertEquals(15, result.getExpirationSecs());
render = createRenderInvocation(SOF.PORTLET_HANDLE_2);
@@ -93,10 +93,10 @@
consumer.invoke(action);
- Result result = action.getResult();
- assertNotNull(result);
- assertTrue(result instanceof RenderResult);
- RenderResult render = (RenderResult)result;
+ PortletInvocationResponse response = action.getResponse();
+ assertNotNull(response);
+ assertTrue(response instanceof RenderResponse);
+ RenderResponse render = (RenderResponse)response;
assertEquals("ns1", render.getNavigationalState().getStringValue());
RenderInvocation renderInvocation = createRenderInvocation(SOF.PORTLET_HANDLE_1);
@@ -153,12 +153,12 @@
assertNotNull(sessionInfo.getUserCookie());
}
- private FragmentResult checkRenderResult(RenderInvocation render, String markup)
+ private FragmentResponse checkRenderResult(RenderInvocation render, String markup)
{
- Result result = render.getResult();
- assertNotNull(result);
- assertTrue(result instanceof FragmentResult);
- FragmentResult fragment = (FragmentResult)result;
+ PortletInvocationResponse response = render.getResponse();
+ assertNotNull(response);
+ assertTrue(response instanceof FragmentResponse);
+ FragmentResponse fragment = (FragmentResponse)response;
assertEquals(markup, fragment.getChars().toString());
return fragment;
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/ActionHandler.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -27,9 +27,9 @@
import org.jboss.portal.portlet.ParametersStateString;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.result.ErrorResult;
-import org.jboss.portal.portlet.result.HTTPRedirectionResult;
-import org.jboss.portal.portlet.result.RenderResult;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
+import org.jboss.portal.portlet.invocation.response.RenderResponse;
import org.jboss.portal.portlet.spi.ActionContext;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.state.AccessMode;
@@ -122,13 +122,13 @@
UpdateResponse updateResponse = blockingInteractionResponse.getUpdateResponse();
if (redirectURL != null && updateResponse != null)
{
- invocation.setResult(new ErrorResult(
+ invocation.setResponse(new ErrorResponse(
new IllegalArgumentException("Response cannot both redirect and update state.")));
}
if (redirectURL != null)
{
- invocation.setResult(new HTTPRedirectionResult(redirectURL)); // do we need to process URLs?
+ invocation.setResponse(new HTTPRedirectionResponse(redirectURL)); // do we need to process URLs?
}
else
{
@@ -136,7 +136,7 @@
// updateResponse.getMarkupContext(); // ignore bundled markup for now.
- RenderResult result = new RenderResult();
+ RenderResponse result = new RenderResponse();
// new mode
String newMode = updateResponse.getNewMode();
if (newMode != null)
@@ -165,7 +165,7 @@
+ "' updated the portlet handle.");
}
- invocation.setResult(result);
+ invocation.setResponse(result);
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/InvocationHandler.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -26,7 +26,7 @@
import org.jboss.portal.portlet.InvokerUnavailableException;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.result.ErrorResult;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.WindowContext;
import org.jboss.portal.wsrp.core.InvalidCookieFault;
@@ -193,7 +193,7 @@
}
else
{
- invocation.setResult(new ErrorResult(error));
+ invocation.setResponse(new ErrorResponse(error));
return DO_NOT_RETRY;
}
}
@@ -202,7 +202,7 @@
else
{
// other errors cannot be dealt with: we have an error condition
- invocation.setResult(new ErrorResult(error));
+ invocation.setResponse(new ErrorResponse(error));
return DO_NOT_RETRY;
}
return ++retryCount;
@@ -210,7 +210,7 @@
protected void unwrapWSRPError(PortletInvocation invocation)
{
- ErrorResult errorResult = (ErrorResult)invocation.getResult();
+ ErrorResponse errorResult = (ErrorResponse)invocation.getResponse();
Throwable cause = errorResult.getThrowable();
if (cause != null)
{
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/RenderHandler.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -26,8 +26,8 @@
import org.jboss.portal.common.util.Tools;
import org.jboss.portal.common.util.URLTools;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.result.ErrorResult;
-import org.jboss.portal.portlet.result.FragmentResult;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.portlet.spi.PortletInvocationContext;
import org.jboss.portal.wsrp.WSRPPortletURL;
import org.jboss.portal.wsrp.WSRPResourceURL;
@@ -95,7 +95,7 @@
byte[] binary = markupContext.getMarkupBinary();
if (markup != null && binary != null)
{
- invocation.setResult(new ErrorResult(
+ invocation.setResponse(new ErrorResponse(
new IllegalArgumentException("Markup response cannot contain both string and binary markup.")));
}
@@ -108,7 +108,7 @@
// todo: need to deal with binary
}
- FragmentResult result = new FragmentResult();
+ FragmentResponse result = new FragmentResponse();
result.setContentType(markupContext.getMimeType());
result.setTitle(markupContext.getPreferredTitle());
@@ -118,7 +118,7 @@
PrintWriter writer = result.getWriter();
writer.write(markup);
- invocation.setResult(result);
+ invocation.setResponse(result);
}
protected void updateUserContext(Object request, UserContext userContext)
@@ -174,7 +174,7 @@
return URLTools.replaceURLsBy(markup, rewriter);
}
- private void cacheMarkupIfNeeded(MarkupContext markupContext, FragmentResult result)
+ private void cacheMarkupIfNeeded(MarkupContext markupContext, FragmentResponse result)
{
CacheControl cacheControl = markupContext.getCacheControl();
int expires;
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/consumer/SessionHandler.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -26,7 +26,7 @@
import org.jboss.portal.common.util.ParameterValidation;
import org.jboss.portal.portlet.InvokerUnavailableException;
import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.result.ErrorResult;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
import org.jboss.portal.wsrp.WSRPTypeFactory;
import org.jboss.portal.wsrp.consumer.portlet.info.WSRPPortletInfo;
import org.jboss.portal.wsrp.core.CookieProtocol;
@@ -191,7 +191,7 @@
catch (Exception e)
{
log.fatal("initCookie failed!", e);
- invocation.setResult(new ErrorResult(e));
+ invocation.setResponse(new ErrorResponse(e));
}
}
Modified: trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java
===================================================================
--- trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java 2006-10-11 12:29:24 UTC (rev 5416)
+++ trunk/wsrp/src/main/org/jboss/portal/wsrp/producer/MarkupHandler.java 2006-10-11 14:57:28 UTC (rev 5417)
@@ -35,11 +35,11 @@
import org.jboss.portal.portlet.invocation.ActionInvocation;
import org.jboss.portal.portlet.invocation.PortletInvocation;
import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.result.ErrorResult;
-import org.jboss.portal.portlet.result.FragmentResult;
-import org.jboss.portal.portlet.result.HTTPRedirectionResult;
-import org.jboss.portal.portlet.result.RenderResult;
-import org.jboss.portal.portlet.result.Result;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.HTTPRedirectionResponse;
+import org.jboss.portal.portlet.invocation.response.RenderResponse;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
import org.jboss.portal.portlet.spi.InstanceContext;
import org.jboss.portal.portlet.spi.PortalContext;
import org.jboss.portal.portlet.spi.SecurityContext;
@@ -202,21 +202,21 @@
throw WSRPUtils.createOperationFailedFault(e);
}
- Result result = render.getResult();
- checkForError(result);
+ PortletInvocationResponse response = render.getResponse();
+ checkForError(response);
- FragmentResult fragment = (FragmentResult)result;
+ FragmentResponse fragment = (FragmentResponse)response;
String markupString = null;
byte[] markupBinary = null;
switch (fragment.getType())
{
- case FragmentResult.TYPE_CHARS:
+ case FragmentResponse.TYPE_CHARS:
markupString = fragment.getChars().toString();
break;
- case FragmentResult.TYPE_BYTES:
+ case FragmentResponse.TYPE_BYTES:
markupBinary = fragment.getBytes().toByteArray(); // fix-me: might need to convert to Base64?
break;
- case FragmentResult.TYPE_EMPTY:
+ case FragmentResponse.TYPE_EMPTY:
markupString = EMPTY;
break;
}
@@ -375,12 +375,12 @@
throw WSRPUtils.createOperationFailedFault(e);
}
- Result result = invocation.getResult();
- checkForError(result);
+ PortletInvocationResponse response = invocation.getResponse();
+ checkForError(response);
- if (result instanceof RenderResult)
+ if (response instanceof RenderResponse)
{
- RenderResult renderResult = (RenderResult)result;
+ RenderResponse renderResult = (RenderResponse)response;
UpdateResponse updateResponse = WSRPTypeFactory.createUpdateResponse();
updateResponse.setNewMode(WSRPUtils.convertJSR168PortletModeNameToWSRPName(getNewStateOrNull(renderResult, true)));
updateResponse.setNewWindowState(WSRPUtils.convertJSR168WindowStateNameToWSRPName(getNewStateOrNull(renderResult, false)));
@@ -392,23 +392,23 @@
else
{
// result should be HTTPRedirectionResult
- HTTPRedirectionResult redirectionResult = (HTTPRedirectionResult)result;
+ HTTPRedirectionResponse redirectionResult = (HTTPRedirectionResponse)response;
return WSRPTypeFactory.createBlockingInteractionResponse(redirectionResult.getLocation());
}
}
- private String getNewStateOrNull(RenderResult renderResult, boolean forMode)
+ private String getNewStateOrNull(RenderResponse renderResult, boolean forMode)
{
Object state = forMode ? (Object)renderResult.getMode() : renderResult.getWindowState();
return state != null ? state.toString() : null;
}
- private void checkForError(Result result)
+ private void checkForError(PortletInvocationResponse response)
throws UnsupportedModeFault, OperationFailedFault, UnsupportedWindowStateFault
{
- if (result instanceof ErrorResult)
+ if (response instanceof ErrorResponse)
{
- ErrorResult errorResult = (ErrorResult)result;
+ ErrorResponse errorResult = (ErrorResponse)response;
Throwable throwable = errorResult.getThrowable();
if (throwable instanceof PortletModeException)
{
@@ -432,10 +432,10 @@
}
else
- if (!(result instanceof HTTPRedirectionResult || result instanceof FragmentResult || result instanceof RenderResult))
+ if (!(response instanceof HTTPRedirectionResponse || response instanceof FragmentResponse || response instanceof RenderResponse))
{
throw WSRPUtils.createOperationFailedFault(new IllegalArgumentException("Unsupported result type: "
- + result.getClass().getName()));
+ + response.getClass().getName()));
}
}
More information about the jboss-svn-commits
mailing list