Author: thomas.heute(a)jboss.com
Date: 2010-01-06 13:54:25 -0500 (Wed, 06 Jan 2010)
New Revision: 13892
Modified:
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
Log:
JBEPP-154: Javascript error when click to "sign out with sign out event" link on
TestPortlet in TestWithAjax page
Handle the case of SignOutResponse
Modified:
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
===================================================================
---
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2010-01-06
14:38:54 UTC (rev 13891)
+++
branches/Enterprise_Portal_Platform_4_3/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2010-01-06
18:54:25 UTC (rev 13892)
@@ -31,12 +31,15 @@
import org.jboss.portal.core.controller.ControllerResponse;
import org.jboss.portal.core.controller.portlet.ControllerPortletControllerContext;
import org.jboss.portal.core.controller.portlet.ControllerPageNavigationalState;
+import org.jboss.portal.core.controller.command.response.SignOutResponse;
import org.jboss.portal.core.controller.handler.AjaxResponse;
import org.jboss.portal.core.controller.handler.CommandForward;
+import org.jboss.portal.core.controller.handler.HTTPResponse;
import org.jboss.portal.core.controller.handler.HandlerResponse;
import org.jboss.portal.core.controller.handler.ResponseHandler;
import org.jboss.portal.core.controller.handler.ResponseHandlerException;
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.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.portal.PortalObjectId;
@@ -59,6 +62,7 @@
import org.jboss.portal.core.theme.WindowContextFactory;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.PageService;
import org.jboss.portal.theme.PortalLayout;
@@ -171,6 +175,30 @@
return null;
}
}
+ else if (controllerResponse instanceof SignOutResponse)
+ {
+ // Get the optional signout location
+ String location = ((SignOutResponse)controllerResponse).getLocation();
+
+ final ServerInvocation invocation = controllerContext.getServerInvocation();
+
+ //
+ if (location == null)
+ {
+ PortalObjectContainer portalObjectContainer =
controllerContext.getController().getPortalObjectContainer();
+ Portal portal =
(Portal)portalObjectContainer.getContext().getDefaultPortal();
+ ViewPageCommand renderCmd = new ViewPageCommand(portal.getId());
+ URLContext urlContext = invocation.getServerContext().getURLContext();
+ location = controllerContext.renderURL(renderCmd,
urlContext.asNonAuthenticated(), null);
+ }
+
+ // Indicate that we want a sign out to be done
+ invocation.getResponse().setWantSignOut(true);
+
+ // We perform a full refresh
+ UpdatePageLocationResponse dresp = new UpdatePageLocationResponse(location);
+ return new AjaxResponse(dresp);
+ }
else if (controllerResponse instanceof UpdatePageResponse)
// {
// UpdatePageResponse upr = (UpdatePageResponse)controllerResponse;
Show replies by date