Author: thomas.heute(a)jboss.com
Date: 2008-11-27 17:16:51 -0500 (Thu, 27 Nov 2008)
New Revision: 12314
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowActionCommand.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowResourceCommand.java
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokeWindowCommand.java
Log:
JBPORTAL-2248: Action URL retained by client
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowActionCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowActionCommand.java 2008-11-27
20:12:57 UTC (rev 12313)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowActionCommand.java 2008-11-27
22:16:51 UTC (rev 12314)
@@ -25,18 +25,29 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.ControllerResponse;
import org.jboss.portal.core.controller.NoSuchResourceException;
import org.jboss.portal.core.controller.command.info.ActionCommandInfo;
import org.jboss.portal.core.controller.command.info.CommandInfo;
+import org.jboss.portal.core.controller.portlet.ControllerPageNavigationalState;
+import org.jboss.portal.core.controller.portlet.ControllerPortletControllerContext;
+import org.jboss.portal.core.controller.portlet.ControllerResponseFactory;
import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.Window;
+import org.jboss.portal.core.model.portal.command.response.UpdatePageResponse;
import org.jboss.portal.identity.User;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.controller.PortletController;
import org.jboss.portal.portlet.controller.request.PortletActionRequest;
import org.jboss.portal.portlet.controller.request.ContainerRequest;
+import org.jboss.portal.portlet.controller.response.PageUpdateResponse;
+import org.jboss.portal.portlet.controller.response.PortletResponse;
+import org.jboss.portal.portlet.controller.response.ResourceResponse;
import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
@@ -140,4 +151,43 @@
pageNS
);
}
+
+ public ControllerResponse execute() throws ControllerException
+ {
+ try
+ {
+ ControllerPortletControllerContext cpcc = new
ControllerPortletControllerContext(
+ context,
+ page
+ );
+
+ //
+ PortletPageNavigationalState pageNS =
cpcc.getStateControllerContext().createPortletPageNavigationalState(false);
+
+ //
+ PortletWindowNavigationalState windowNS =
pageNS.getPortletWindowNavigationalState(window.getName());
+
+ //
+ PortletInfo portletInfo = cpcc.getPortletInfo(window.getName());
+
+ //
+ ContainerRequest containerRequest = createPortletRequest(portletInfo, pageNS,
windowNS);
+
+ //
+ PortletController controller = new PortletController();
+
+ //
+ org.jboss.portal.portlet.controller.response.ControllerResponse cr =
controller.process(cpcc, containerRequest);
+
+ PortletResponse portletResponse = (PortletResponse)cr;
+
+ //
+ return ControllerResponseFactory.createActionResponse(targetId,
portletResponse.getResponse());
+ }
+ catch (PortletInvokerException e)
+ {
+ return ControllerResponseFactory.createResponse(e);
+ }
+ }
+
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java 2008-11-27
20:12:57 UTC (rev 12313)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java 2008-11-27
22:16:51 UTC (rev 12314)
@@ -24,15 +24,26 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.ControllerResponse;
import org.jboss.portal.core.controller.command.info.CommandInfo;
import org.jboss.portal.core.controller.command.info.ActionCommandInfo;
+import org.jboss.portal.core.controller.portlet.ControllerPageNavigationalState;
+import org.jboss.portal.core.controller.portlet.ControllerPortletControllerContext;
+import org.jboss.portal.core.controller.portlet.ControllerResponseFactory;
import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.command.response.UpdatePageResponse;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.ParametersStateString;
import org.jboss.portal.portlet.info.PortletInfo;
import org.jboss.portal.portlet.info.ParameterInfo;
+import org.jboss.portal.portlet.controller.PortletController;
import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
import org.jboss.portal.portlet.controller.request.ContainerRequest;
+import org.jboss.portal.portlet.controller.response.PageUpdateResponse;
+import org.jboss.portal.portlet.controller.response.PortletResponse;
+import org.jboss.portal.portlet.controller.response.ResourceResponse;
import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
@@ -153,4 +164,51 @@
pageNS
);
}
+
+ public ControllerResponse execute() throws ControllerException
+ {
+ try
+ {
+ ControllerPortletControllerContext cpcc = new
ControllerPortletControllerContext(
+ context,
+ page
+ );
+
+ //
+ PortletPageNavigationalState pageNS =
cpcc.getStateControllerContext().createPortletPageNavigationalState(false);
+
+ //
+ PortletWindowNavigationalState windowNS =
pageNS.getPortletWindowNavigationalState(window.getName());
+
+ //
+ PortletInfo portletInfo = cpcc.getPortletInfo(window.getName());
+
+ //
+ ContainerRequest containerRequest = createPortletRequest(portletInfo, pageNS,
windowNS);
+
+ //
+ PortletController controller = new PortletController();
+
+ //
+ org.jboss.portal.portlet.controller.response.ControllerResponse cr =
controller.process(cpcc, containerRequest);
+
+ //
+ PageUpdateResponse pageUpdate = (PageUpdateResponse)cr;
+
+ //
+ ControllerPageNavigationalState pageNavigationalState =
(ControllerPageNavigationalState)pageUpdate.getPageNavigationalState();
+
+ // Flush all NS
+ pageNavigationalState.flushUpdates();
+
+ //
+ return new UpdatePageResponse(page.getId());
+
+ }
+ catch (PortletInvokerException e)
+ {
+ return ControllerResponseFactory.createResponse(e);
+ }
+ }
+
}
\ No newline at end of file
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowResourceCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowResourceCommand.java 2008-11-27
20:12:57 UTC (rev 12313)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowResourceCommand.java 2008-11-27
22:16:51 UTC (rev 12314)
@@ -23,14 +23,25 @@
package org.jboss.portal.core.model.portal.command.action;
import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.command.response.UpdatePageResponse;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.ControllerResponse;
import org.jboss.portal.core.controller.command.info.CommandInfo;
import org.jboss.portal.core.controller.command.info.ActionCommandInfo;
+import org.jboss.portal.core.controller.portlet.ControllerPageNavigationalState;
+import org.jboss.portal.core.controller.portlet.ControllerPortletControllerContext;
+import org.jboss.portal.core.controller.portlet.ControllerResponseFactory;
import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.portlet.controller.PortletController;
import org.jboss.portal.portlet.controller.request.PortletResourceRequest;
import org.jboss.portal.portlet.controller.request.ContainerRequest;
+import org.jboss.portal.portlet.controller.response.PageUpdateResponse;
+import org.jboss.portal.portlet.controller.response.PortletResponse;
+import org.jboss.portal.portlet.controller.response.ResourceResponse;
import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
import org.jboss.portal.portlet.cache.CacheLevel;
+import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.info.PortletInfo;
@@ -133,4 +144,44 @@
resourceForm,
scope);
}
+
+ public ControllerResponse execute() throws ControllerException
+ {
+ try
+ {
+ ControllerPortletControllerContext cpcc = new
ControllerPortletControllerContext(
+ context,
+ page
+ );
+
+ //
+ PortletPageNavigationalState pageNS =
cpcc.getStateControllerContext().createPortletPageNavigationalState(false);
+
+ //
+ PortletWindowNavigationalState windowNS =
pageNS.getPortletWindowNavigationalState(window.getName());
+
+ //
+ PortletInfo portletInfo = cpcc.getPortletInfo(window.getName());
+
+ //
+ ContainerRequest containerRequest = createPortletRequest(portletInfo, pageNS,
windowNS);
+
+ //
+ PortletController controller = new PortletController();
+
+ //
+ org.jboss.portal.portlet.controller.response.ControllerResponse cr =
controller.process(cpcc, containerRequest);
+
+ //
+ ResourceResponse resourceResponse = (ResourceResponse)cr;
+
+ //
+ return ControllerResponseFactory.createActionResponse(targetId,
resourceResponse.getResponse());
+ }
+ catch (PortletInvokerException e)
+ {
+ return ControllerResponseFactory.createResponse(e);
+ }
+ }
+
}
Modified:
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokeWindowCommand.java
===================================================================
---
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokeWindowCommand.java 2008-11-27
20:12:57 UTC (rev 12313)
+++
branches/JBoss_Portal_Branch_2_7/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokeWindowCommand.java 2008-11-27
22:16:51 UTC (rev 12314)
@@ -57,65 +57,4 @@
PortletPageNavigationalState pageNS,
PortletWindowNavigationalState windowNS);
- public ControllerResponse execute() throws ControllerException
- {
- try
- {
- ControllerPortletControllerContext cpcc = new
ControllerPortletControllerContext(
- context,
- page
- );
-
- //
- PortletPageNavigationalState pageNS =
cpcc.getStateControllerContext().createPortletPageNavigationalState(false);
-
- //
- PortletWindowNavigationalState windowNS =
pageNS.getPortletWindowNavigationalState(window.getName());
-
- //
- PortletInfo portletInfo = cpcc.getPortletInfo(window.getName());
-
- //
- ContainerRequest containerRequest = createPortletRequest(portletInfo, pageNS,
windowNS);
-
- //
- PortletController controller = new PortletController();
-
- //
- org.jboss.portal.portlet.controller.response.ControllerResponse cr =
controller.process(cpcc, containerRequest);
-
- //
- if (cr instanceof PageUpdateResponse)
- {
- PageUpdateResponse pageUpdate = (PageUpdateResponse)cr;
-
- //
- ControllerPageNavigationalState pageNavigationalState =
(ControllerPageNavigationalState)pageUpdate.getPageNavigationalState();
-
- // Flush all NS
- pageNavigationalState.flushUpdates();
-
- //
- return new UpdatePageResponse(page.getId());
- }
- else if (cr instanceof PortletResponse)
- {
- PortletResponse portletResponse = (PortletResponse)cr;
-
- //
- return ControllerResponseFactory.createActionResponse(targetId,
portletResponse.getResponse());
- }
- else
- {
- ResourceResponse resourceResponse = (ResourceResponse)cr;
-
- //
- return ControllerResponseFactory.createActionResponse(targetId,
resourceResponse.getResponse());
- }
- }
- catch (PortletInvokerException e)
- {
- return ControllerResponseFactory.createResponse(e);
- }
- }
}