Author: julien(a)jboss.com
Date: 2007-06-11 08:55:25 -0400 (Mon, 11 Jun 2007)
New Revision: 7396
Added:
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletResponseHandler.java
Log:
added experimental scope for portal object property info
Added:
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletResponseHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletResponseHandler.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletResponseHandler.java 2007-06-11
12:55:25 UTC (rev 7396)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.jboss.portal.core.controller.portlet;
+
+import org.jboss.portal.core.controller.handler.ResponseHandler;
+import org.jboss.portal.core.controller.handler.HandlerResponse;
+import org.jboss.portal.core.controller.handler.ResponseHandlerException;
+import org.jboss.portal.core.controller.handler.CommandForward;
+import org.jboss.portal.core.controller.ControllerContext;
+import org.jboss.portal.core.controller.ControllerCommand;
+import org.jboss.portal.core.controller.ControllerResponse;
+import
org.jboss.portal.core.model.instance.command.response.PortletInstanceActionResponse;
+import
org.jboss.portal.core.model.instance.command.action.InvokePortletInstanceRenderCommand;
+import org.jboss.portal.core.model.portal.command.response.PortletWindowActionResponse;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletResponseHandler implements ResponseHandler
+{
+ public HandlerResponse processCommandResponse(
+ ControllerContext controllerContext,
+ ControllerCommand controllerCommand,
+ ControllerResponse controllerResponse) throws ResponseHandlerException
+ {
+ if (controllerResponse instanceof PortletActionResponse)
+ {
+ PortletActionResponse par = (PortletActionResponse)controllerResponse;
+
+ //
+ if (par instanceof PortletInstanceActionResponse)
+ {
+ PortletInstanceActionResponse piar = (PortletInstanceActionResponse)par;
+ InvokePortletInstanceRenderCommand command = new
InvokePortletInstanceRenderCommand(piar.getInstanceId(), piar.getContentState());
+ return new CommandForward(command, null);
+ }
+ else if (par instanceof PortletWindowActionResponse)
+ {
+ PortletWindowActionResponse pwar = (PortletWindowActionResponse)par;
+ InvokePortletWindowRenderCommand command = new
InvokePortletWindowRenderCommand(pwar.getWindowId(), pwar.getMode(),
pwar.getWindowState(), pwar.getContentState());
+ return new CommandForward(command, null);
+ }
+ }
+
+ //
+ return null;
+ }
+}