Author: julien(a)jboss.com
Date: 2007-04-08 10:16:18 -0400 (Sun, 08 Apr 2007)
New Revision: 6957
Added:
trunk/core/src/main/org/jboss/portal/core/model/instance/PortletInstanceResponseHandler.java
trunk/core/src/main/org/jboss/portal/core/model/instance/command/PortletInstanceCommand.java
trunk/core/src/main/org/jboss/portal/core/model/instance/command/action/
trunk/core/src/main/org/jboss/portal/core/model/instance/command/action/InvokePortletInstanceActionCommand.java
trunk/core/src/main/org/jboss/portal/core/model/instance/command/action/InvokePortletInstanceRenderCommand.java
trunk/core/src/main/org/jboss/portal/core/model/instance/command/render/
trunk/core/src/main/org/jboss/portal/core/model/instance/command/render/RenderPortletInstanceCommand.java
trunk/core/src/main/org/jboss/portal/core/model/instance/command/response/UpdatePortletInstanceResponse.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/ImportPageToDashboardCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowActionCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokeWindowCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/MoveWindowCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/
trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdatePageResponse.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateWindowResponse.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewDashboardCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPageCommand.java
Removed:
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceActionCommand.java
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceCommand.java
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceRenderCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/ImportPageToDashboardCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowActionCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowRenderCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokeWindowCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/MoveWindowCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderPageCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderWindowCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/ViewDashboardCommand.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateViewResponse.java
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateWindowMarkupResponse.java
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/InternalCMSContentProvider.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeInterceptor.java
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeURLFactory.java
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxCommandFactory.java
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
trunk/core/src/main/org/jboss/portal/core/controller/classic/ClassicResponseHandler.java
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletResponseHandler.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/InternalPortletContentProvider.java
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceCommandFactory.java
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceURLFactory.java
trunk/core/src/main/org/jboss/portal/core/model/instance/InvokePortletInstanceCommandFactory.java
trunk/core/src/main/org/jboss/portal/core/model/portal/DashboardCommandFactory.java
trunk/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectCommandFactory.java
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectResponseHandler.java
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectURLFactory.java
trunk/core/src/main/org/jboss/portal/core/model/portal/content/ContentRenderer.java
trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml
Log:
improve request/response command protocol : commands like RenderPageCommand and
RenderWindowCommand are not triggered by command factories, instead they are just used
programmatically in order to build something (markup usually under some form). So
ViewPageCommand has been introduced instead and it is the responsibility of the response
handler to translate a ViewPageCommand response into a programmatic RenderPageCommand
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/aspects/controller/PageCustomizerInterceptor.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -32,7 +32,7 @@
import org.jboss.portal.core.controller.command.SignOutCommand;
import org.jboss.portal.core.impl.model.portal.PortalObjectImpl;
import org.jboss.portal.core.model.CustomizationManager;
-import org.jboss.portal.core.model.instance.command.InvokePortletInstanceRenderCommand;
+import
org.jboss.portal.core.model.instance.command.action.InvokePortletInstanceRenderCommand;
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Portal;
import org.jboss.portal.core.model.portal.PortalContainer;
@@ -40,9 +40,10 @@
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.PortalObjectPermission;
import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.command.ImportPageToDashboardCommand;
-import org.jboss.portal.core.model.portal.command.RenderPageCommand;
-import org.jboss.portal.core.model.portal.command.ViewDashboardCommand;
+import org.jboss.portal.core.model.portal.command.action.ImportPageToDashboardCommand;
+import org.jboss.portal.core.model.portal.command.render.RenderPageCommand;
+import org.jboss.portal.core.model.portal.command.view.ViewDashboardCommand;
+import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
import org.jboss.portal.identity.User;
import org.jboss.portal.portlet.PortletParametersStateString;
import org.jboss.portal.security.PortalSecurityException;
@@ -50,7 +51,6 @@
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.theme.page.PageRendition;
import org.jboss.portal.theme.ThemeConstants;
-import org.jboss.portal.theme.impl.render.dynamic.DynaConstants;
import org.jboss.portal.theme.impl.render.dynamic.DynaRenderOptions;
import org.jboss.portal.theme.page.Region;
import org.jboss.portal.theme.page.WindowContext;
@@ -211,7 +211,7 @@
String label;
if (isDashboard)
{
- RenderPageCommand _rpc = new RenderPageCommand(new PortalObjectId(new
String[]{"default", "default"}));
+ ViewPageCommand _rpc = new ViewPageCommand(new PortalObjectId(new
String[]{"default", "default"}));
pageURL = controllerCtx.renderURL(_rpc, null, null);
label = "Portal";
}
@@ -239,7 +239,7 @@
if (admin)
{
- RenderPageCommand showDefault = new RenderPageCommand(new PortalObjectId(new
String[]{"default"}));
+ ViewPageCommand showDefault = new ViewPageCommand(new PortalObjectId(new
String[]{"default"}));
showDefaultURL = controllerCtx.renderURL(showDefault, null, null);
}
else
@@ -249,7 +249,7 @@
{
if
(controller.getPortalAuthorizationManagerFactory().getManager().checkPermission(perm))
{
- RenderPageCommand showadmin = new RenderPageCommand(new
PortalObjectId(new String[]{"admin"}));
+ ViewPageCommand showadmin = new ViewPageCommand(new PortalObjectId(new
String[]{"admin"}));
showadminURL = controllerCtx.renderURL(showadmin, null, null);
}
}
@@ -349,7 +349,7 @@
PortalObjectPermission perm = new PortalObjectPermission(id,
PortalObjectPermission.VIEW_MASK);
if (portalAuthorizationManagerFactory.getManager().checkPermission(perm))
{
- RenderPageCommand cmd = new RenderPageCommand(navElement.getId());
+ ViewPageCommand cmd = new ViewPageCommand(navElement.getId());
String childURL = rpc.getControllerContext().renderURL(cmd, null, null);
html.append("<li");
// if we were able to detect the selected node in the hierarchie level of
the nav elements,
@@ -382,7 +382,7 @@
PortalObject child = (PortalObject)j.next();
if (child.getType() == PortalObject.TYPE_PAGE)
{
- RenderPageCommand renderCmd = new
RenderPageCommand(child.getId());
+ ViewPageCommand renderCmd = new ViewPageCommand(child.getId());
String subChildURL =
rpc.getControllerContext().renderURL(renderCmd, null, null);
html.append("<li>").append("<a
href='").append(subChildURL).append("'>").append(child.getName()).append("</a></li>");
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/EventBroadcasterInterceptor.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -39,10 +39,10 @@
import org.jboss.portal.core.controller.CommandRedirectionException;
import org.jboss.portal.core.controller.ControllerCommand;
import org.jboss.portal.core.controller.ControllerInterceptor;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowActionCommand;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowRenderCommand;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowActionCommand;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
import org.jboss.portal.core.model.portal.command.WindowCommand;
-import org.jboss.portal.core.model.portal.command.RenderPageCommand;
+import org.jboss.portal.core.model.portal.command.render.RenderPageCommand;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.ns.WindowNavigationalState;
import org.jboss.portal.core.event.PortalEventListenerRegistry;
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeInterceptor.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeInterceptor.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeInterceptor.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -25,7 +25,7 @@
import org.jboss.portal.common.invocation.InvocationException;
import org.jboss.portal.core.controller.ControllerCommand;
import org.jboss.portal.core.controller.ControllerInterceptor;
-import org.jboss.portal.core.model.portal.command.RenderPageCommand;
+import org.jboss.portal.core.model.portal.command.render.RenderPageCommand;
import org.jboss.portal.core.model.portal.command.WindowCommand;
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Window;
Modified:
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeURLFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeURLFactory.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/aspects/controller/node/PortalNodeURLFactory.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -28,8 +28,8 @@
import org.jboss.portal.server.request.URLContext;
import org.jboss.portal.server.request.URLFormat;
import org.jboss.portal.core.controller.ControllerContext;
-import org.jboss.portal.core.model.portal.command.RenderPageCommand;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowRenderCommand;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
+import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
import org.jboss.portal.core.model.portal.PortalObjectId;
/**
@@ -145,7 +145,7 @@
public String toString()
{
- RenderPageCommand cmd = new RenderPageCommand(id);
+ ViewPageCommand cmd = new ViewPageCommand(id);
URLContext urlContext = getURLContext();
return controllerContext.renderURL(cmd, urlContext,
URLFormat.newInstance(relative, true));
}
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxCommandFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxCommandFactory.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxCommandFactory.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -25,7 +25,7 @@
import org.jboss.portal.core.controller.command.mapper.AbstractCommandFactory;
import org.jboss.portal.core.controller.ControllerCommand;
import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.command.MoveWindowCommand;
+import org.jboss.portal.core.model.portal.command.action.MoveWindowCommand;
import org.jboss.portal.server.ServerInvocation;
import javax.servlet.http.HttpServletRequest;
Modified: trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxInterceptor.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -26,7 +26,7 @@
import org.jboss.portal.core.controller.ControllerCommand;
import org.jboss.portal.core.controller.ControllerInterceptor;
import org.jboss.portal.core.controller.ControllerContext;
-import org.jboss.portal.core.model.portal.command.RenderPageCommand;
+import org.jboss.portal.core.model.portal.command.render.RenderPageCommand;
import org.jboss.portal.core.model.portal.ns.PortalObjectNavigationalStateContext;
import org.jboss.portal.theme.page.PageRendition;
import org.jboss.portal.theme.impl.render.dynamic.DynaConstants;
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/controller/ajax/AjaxResponseHandler.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -30,10 +30,11 @@
import org.jboss.portal.core.controller.AjaxResponse;
import org.jboss.portal.core.controller.portlet.PortletResponseHandler;
import org.jboss.portal.core.model.portal.command.response.PortletWindowResponse;
-import org.jboss.portal.core.model.portal.command.response.UpdateWindowMarkupResponse;
+import org.jboss.portal.core.model.portal.command.response.UpdateWindowResponse;
import org.jboss.portal.core.model.portal.command.PortalObjectCommand;
-import org.jboss.portal.core.model.portal.command.RenderPageCommand;
-import org.jboss.portal.core.model.portal.command.RenderWindowCommand;
+import org.jboss.portal.core.model.portal.command.render.RenderPageCommand;
+import org.jboss.portal.core.model.portal.command.render.RenderWindowCommand;
+import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.portal.Portal;
@@ -56,7 +57,6 @@
import org.jboss.portal.common.util.MarkupInfo;
import org.jboss.portal.theme.impl.render.dynamic.response.UpdatePageLocationResponse;
import org.jboss.portal.theme.impl.render.dynamic.response.UpdatePageStateResponse;
-import org.jboss.portal.theme.impl.render.dynamic.DynaRenderStatus;
import org.jboss.portal.theme.LayoutService;
import org.jboss.portal.theme.PortalLayout;
import org.jboss.portal.theme.PageService;
@@ -168,7 +168,7 @@
throw new Error("todo " + commandResponse);
}
}
- else if (commandResponse instanceof UpdateWindowMarkupResponse)
+ else if (commandResponse instanceof UpdateWindowResponse)
{
// We make an assumption here, the window result should carry somehow the window
id
PortalObjectCommand pocmd = (PortalObjectCommand)command;
@@ -250,7 +250,7 @@
//
if (refresh)
{
- RenderPageCommand rpc = new RenderPageCommand(page.getId());
+ ViewPageCommand rpc = new ViewPageCommand(page.getId());
String url = controllerContext.renderURL(rpc, null, null);
UpdatePageLocationResponse dresp = new UpdatePageLocationResponse(url);
return new AjaxResponse(dresp);
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/classic/ClassicResponseHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/classic/ClassicResponseHandler.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/controller/classic/ClassicResponseHandler.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -42,7 +42,8 @@
import org.jboss.portal.core.model.portal.PortalObjectContainer;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.portal.PortalObjectResponseHandler;
-import org.jboss.portal.core.model.portal.command.RenderPageCommand;
+import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
+import org.jboss.portal.core.model.instance.PortletInstanceResponseHandler;
import org.jboss.portal.web.ServletContextDispatcher;
import org.jboss.portal.common.util.MarkupInfo;
@@ -134,7 +135,7 @@
{
PortalObjectContainer portalObjectContainer =
controllerContext.getController().getPortalObjectContainer();
Portal portal =
(Portal)portalObjectContainer.getObject(defaultPortalPath);
- RenderPageCommand renderCmd = new RenderPageCommand(portal.getId());
+ ViewPageCommand renderCmd = new ViewPageCommand(portal.getId());
URLContext urlContext = invocation.getServerContext().getURLContext();
location = controllerContext.renderURL(renderCmd,
urlContext.asNonAuthenticated(), null);
}
@@ -158,6 +159,7 @@
private ResponseHandler[] handlers = new ResponseHandler[]
{
new OtherResponseHandler(),
+ new PortletInstanceResponseHandler(),
new PortalObjectResponseHandler(),
new PortletResponseHandler()
};
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletInvocationFactory.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -36,8 +36,8 @@
import org.jboss.portal.portlet.spi.RenderContext;
import org.jboss.portal.core.controller.ControllerContext;
import org.jboss.portal.core.controller.ControllerCommand;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowActionCommand;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowRenderCommand;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowActionCommand;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.portal.Portal;
import org.jboss.portal.Mode;
Modified:
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletResponseHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletResponseHandler.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/controller/portlet/PortletResponseHandler.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -28,13 +28,13 @@
import org.jboss.portal.core.controller.CommandForward;
import org.jboss.portal.core.controller.classic.AbstractResponseHandler;
import org.jboss.portal.core.controller.HandlerResponse;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowActionCommand;
-import org.jboss.portal.core.model.portal.command.RenderPageCommand;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowRenderCommand;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowActionCommand;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
+import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
import org.jboss.portal.core.model.portal.command.response.PortletWindowResponse;
import org.jboss.portal.core.model.portal.Page;
import org.jboss.portal.core.model.instance.command.response.PortletInstanceResponse;
-import org.jboss.portal.core.model.instance.command.InvokePortletInstanceRenderCommand;
+import
org.jboss.portal.core.model.instance.command.action.InvokePortletInstanceRenderCommand;
import org.jboss.portal.server.ServerException;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.request.URLContext;
@@ -142,7 +142,7 @@
// Redirect to the same page
InvokePortletWindowActionCommand iwac =
(InvokePortletWindowActionCommand)command;
Page page = iwac.getPage();
- RenderPageCommand renderCmd = new RenderPageCommand(page.getId());
+ ViewPageCommand renderCmd = new ViewPageCommand(page.getId());
boolean secure =
invocation.getServerContext().getURLContext().isSecure();
URLContext urlContext = URLContext.newInstance(secure, false);
location = controllerContext.renderURL(renderCmd, urlContext, null);
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/InternalContentProvider.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -26,8 +26,8 @@
import org.jboss.portal.core.model.content.Content;
import org.jboss.portal.core.model.content.spi.ContentProvider;
import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.core.model.portal.command.RenderWindowCommand;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowRenderCommand;
+import org.jboss.portal.core.model.portal.command.render.RenderWindowCommand;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
import org.jboss.portal.core.model.portal.command.response.PortletWindowResponse;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.portal.Portal;
@@ -46,7 +46,6 @@
import org.jboss.portal.server.request.URLFormat;
import org.jboss.portal.portlet.PortletInvokerException;
import org.jboss.portal.portlet.NoSuchPortletException;
-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.invocation.RenderInvocation;
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/generic/InternalGenericContentProvider.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -30,7 +30,7 @@
import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
-import org.jboss.portal.core.model.portal.command.RenderWindowCommand;
+import org.jboss.portal.core.model.portal.command.render.RenderWindowCommand;
import org.jboss.portal.core.model.portal.Window;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.controller.ControllerContext;
@@ -44,7 +44,6 @@
import java.util.Iterator;
import java.util.Map;
-import java.util.HashMap;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified:
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/InternalPortletContentProvider.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/InternalPortletContentProvider.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/impl/model/content/portlet/InternalPortletContentProvider.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -40,7 +40,7 @@
import org.jboss.portal.core.model.instance.Instance;
import org.jboss.portal.core.model.instance.InstanceContainer;
import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.command.RenderWindowCommand;
+import org.jboss.portal.core.model.portal.command.render.RenderWindowCommand;
import org.jboss.portal.identity.User;
/**
Modified:
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceCommandFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceCommandFactory.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceCommandFactory.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -24,8 +24,8 @@
import org.jboss.portal.core.controller.ControllerCommand;
import org.jboss.portal.core.controller.command.mapper.AbstractCommandFactory;
-import org.jboss.portal.core.model.instance.command.InvokePortletInstanceActionCommand;
-import org.jboss.portal.core.model.instance.command.InvokePortletInstanceRenderCommand;
+import
org.jboss.portal.core.model.instance.command.action.InvokePortletInstanceActionCommand;
+import
org.jboss.portal.core.model.instance.command.action.InvokePortletInstanceRenderCommand;
import org.jboss.portal.portlet.impl.PortletRequestDecoder;
import org.jboss.portal.server.ServerInvocation;
Modified:
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceURLFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceURLFactory.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/InstanceURLFactory.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -24,9 +24,9 @@
import org.jboss.portal.core.controller.command.mapper.URLFactoryDelegate;
import org.jboss.portal.core.controller.ControllerCommand;
-import org.jboss.portal.core.model.instance.command.InvokePortletInstanceRenderCommand;
-import org.jboss.portal.core.model.instance.command.InvokePortletInstanceActionCommand;
-import org.jboss.portal.core.model.instance.command.InvokePortletInstanceCommand;
+import
org.jboss.portal.core.model.instance.command.action.InvokePortletInstanceRenderCommand;
+import
org.jboss.portal.core.model.instance.command.action.InvokePortletInstanceActionCommand;
+import org.jboss.portal.core.model.instance.command.PortletInstanceCommand;
import org.jboss.portal.server.ServerURL;
import org.jboss.portal.server.ServerInvocation;
import org.jboss.portal.server.AbstractServerURL;
@@ -73,9 +73,9 @@
}
//
- if (cmd instanceof InvokePortletInstanceCommand)
+ if (cmd instanceof PortletInstanceCommand)
{
- InvokePortletInstanceCommand iic = (InvokePortletInstanceCommand)cmd;
+ PortletInstanceCommand iic = (PortletInstanceCommand)cmd;
if (iic.getInstanceId().equals(instanceId))
{
AbstractServerURL url = new AbstractServerURL();
Modified:
trunk/core/src/main/org/jboss/portal/core/model/instance/InvokePortletInstanceCommandFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/InvokePortletInstanceCommandFactory.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/InvokePortletInstanceCommandFactory.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -24,8 +24,8 @@
import org.jboss.portal.core.controller.portlet.InvokePortletCommandFactory;
import org.jboss.portal.core.controller.ControllerCommand;
-import org.jboss.portal.core.model.instance.command.InvokePortletInstanceRenderCommand;
-import org.jboss.portal.core.model.instance.command.InvokePortletInstanceActionCommand;
+import
org.jboss.portal.core.model.instance.command.action.InvokePortletInstanceRenderCommand;
+import
org.jboss.portal.core.model.instance.command.action.InvokePortletInstanceActionCommand;
import org.jboss.portal.portlet.ActionURL;
import org.jboss.portal.portlet.RenderURL;
Added:
trunk/core/src/main/org/jboss/portal/core/model/instance/PortletInstanceResponseHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/PortletInstanceResponseHandler.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/PortletInstanceResponseHandler.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,76 @@
+/******************************************************************************
+ * 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.model.instance;
+
+import org.jboss.portal.core.controller.ResponseHandler;
+import org.jboss.portal.core.controller.HandlerResponse;
+import org.jboss.portal.core.controller.ControllerContext;
+import org.jboss.portal.core.controller.ControllerCommand;
+import org.jboss.portal.core.controller.HTTPResponse;
+import org.jboss.portal.core.controller.ControllerException;
+import
org.jboss.portal.core.model.instance.command.response.UpdatePortletInstanceResponse;
+import org.jboss.portal.core.model.instance.command.render.RenderPortletInstanceCommand;
+import org.jboss.portal.server.ServerException;
+import org.jboss.portal.server.ServerInvocationContext;
+import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.theme.page.PageRendition;
+
+import javax.servlet.ServletException;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class PortletInstanceResponseHandler implements ResponseHandler
+{
+ public HandlerResponse processCommandResponse(ControllerContext controllerContext,
ControllerCommand command, Object commandResponse) throws IOException, ServletException,
ServerException
+ {
+ if (commandResponse instanceof UpdatePortletInstanceResponse)
+ {
+ try
+ {
+ UpdatePortletInstanceResponse upir =
(UpdatePortletInstanceResponse)commandResponse;
+ RenderPortletInstanceCommand render= new
RenderPortletInstanceCommand(upir.getInstanceId(), upir.getNavigationalState());
+ final PageRendition rendition =
(PageRendition)controllerContext.execute(render);
+ final ServerInvocation invocation = controllerContext.getServerInvocation();
+ return new HTTPResponse()
+ {
+ public void sendResponse(ServerInvocationContext ctx) throws IOException,
ServletException
+ {
+ ServletContextDispatcher dispatcher = new
ServletContextDispatcher(invocation.getServerContext().getClientRequest(),
invocation.getServerContext().getClientResponse(),
invocation.getRequest().getServer().getServletContainerContext());
+ MarkupInfo markupInfo =
(MarkupInfo)invocation.getResponse().getContentInfo();
+ rendition.render(markupInfo, dispatcher);
+ }
+ };
+ }
+ catch (ControllerException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ return null;
+ }
+}
Deleted:
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceActionCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceActionCommand.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceActionCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -1,106 +0,0 @@
-/******************************************************************************
- * 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.model.instance.command;
-
-import org.jboss.portal.core.controller.ControllerException;
-import org.jboss.portal.core.controller.portlet.PortletContextFactory;
-import org.jboss.portal.core.controller.portlet.InvokePortletCommandFactory;
-import org.jboss.portal.core.controller.portlet.PortletInvocationFactory;
-import org.jboss.portal.core.controller.command.info.CommandInfo;
-import org.jboss.portal.core.model.instance.InvokePortletInstanceCommandFactory;
-import org.jboss.portal.core.model.instance.command.response.PortletInstanceResponse;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.PortletParameters;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class InvokePortletInstanceActionCommand extends InvokePortletInstanceCommand
-{
-
- /** The interaction state. */
- private StateString interactionState;
-
- /** The nform. */
- private PortletParameters form;
-
- public InvokePortletInstanceActionCommand(String instanceId, StateString
navigationalState, StateString interactionState, PortletParameters form)
- {
- super(instanceId, navigationalState);
-
- //
- this.interactionState = interactionState;
- this.form = form;
- }
-
- public StateString getInteractionState()
- {
- return interactionState;
- }
-
- public PortletParameters getForm()
- {
- return form;
- }
-
- public CommandInfo getInfo()
- {
- return null;
- }
-
- public Object execute() throws ControllerException
- {
- try
- {
- PortletContextFactory pcf1 = new PortletContextFactory(context);
- InvokePortletCommandFactory pcf2 = new
InvokePortletInstanceCommandFactory(instanceId);
-
- //
- ActionInvocation action = PortletInvocationFactory.createAction(
- context,
- Mode.VIEW,
- WindowState.MAXIMIZED,
- navigationalState,
- interactionState,
- form,
- pcf1,
- pcf2);
-
- //
- PortletInvocationResponse response = instance.invoke(action);
-
- //
- return new PortletInstanceResponse(instanceId, response);
- }
- catch (PortletInvokerException e)
- {
- return new ControllerException(e);
- }
- }
-}
Deleted:
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceCommand.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -1,81 +0,0 @@
-/******************************************************************************
- * 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.model.instance.command;
-
-import org.jboss.portal.core.controller.ControllerCommand;
-import org.jboss.portal.core.controller.ControllerException;
-import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.core.model.instance.InstanceContainer;
-import org.jboss.portal.portlet.StateString;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public abstract class InvokePortletInstanceCommand extends ControllerCommand
-{
-
- /** The instance id. */
- protected String instanceId;
-
- /** The navigational state. */
- protected StateString navigationalState;
-
- /** The instance displayed. */
- protected Instance instance;
-
- protected InvokePortletInstanceCommand(String instanceId, StateString
navigationalState)
- {
- if (instanceId == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- this.instanceId = instanceId;
- this.navigationalState = navigationalState;
-
- }
-
- public String getInstanceId()
- {
- return instanceId;
- }
-
- protected void create() throws ControllerException
- {
- InstanceContainer container = context.getController().getInstanceContainer();
-
- //
- instance = container.getDefinition(instanceId);
- if (instance == null)
- {
- throw new ControllerException("Configurator portlet instance " +
instanceId + " not found");
- }
- }
-
- public StateString getNavigationalState()
- {
- return navigationalState;
- }
-}
Deleted:
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceRenderCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceRenderCommand.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/command/InvokePortletInstanceRenderCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -1,123 +0,0 @@
-/******************************************************************************
- * 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.model.instance.command;
-
-import org.jboss.portal.core.controller.ControllerException;
-import org.jboss.portal.core.controller.portlet.PortletContextFactory;
-import org.jboss.portal.core.controller.portlet.InvokePortletCommandFactory;
-import org.jboss.portal.core.controller.portlet.PortletInvocationFactory;
-import org.jboss.portal.core.controller.command.info.CommandInfo;
-import org.jboss.portal.core.model.instance.InvokePortletInstanceCommandFactory;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
-import org.jboss.portal.portlet.invocation.response.ErrorResponse;
-import org.jboss.portal.theme.page.PageRendition;
-import org.jboss.portal.theme.LayoutService;
-import org.jboss.portal.theme.PortalLayout;
-import org.jboss.portal.theme.ThemeConstants;
-import org.jboss.portal.theme.PageService;
-import org.jboss.portal.theme.page.PageResult;
-import org.jboss.portal.theme.page.WindowResult;
-import org.jboss.portal.theme.page.WindowContext;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.Mode;
-import org.jboss.portal.common.NotYetImplemented;
-
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Collections;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class InvokePortletInstanceRenderCommand extends InvokePortletInstanceCommand
-{
-
- public InvokePortletInstanceRenderCommand(String instanceId, StateString
navigationalState)
- {
- super(instanceId, navigationalState);
- }
-
- public CommandInfo getInfo()
- {
- return null;
- }
-
- public Object execute() throws ControllerException
- {
- try
- {
- PortletContextFactory pcf1 = new PortletContextFactory(context);
- InvokePortletCommandFactory pcf2 = new
InvokePortletInstanceCommandFactory(instanceId);
- RenderInvocation render = PortletInvocationFactory.createRender(context,
Mode.VIEW, WindowState.MAXIMIZED, navigationalState, pcf1, pcf2);
- PortletInvocationResponse response = instance.invoke(render);
-
- // For now let the controller handle non fragment response
- String content;
- if (response instanceof FragmentResponse)
- {
- content = ((FragmentResponse)response).getContent();
- }
- else if (response instanceof ErrorResponse)
- {
- content = ((ErrorResponse)response).toHTML();
- }
- else
- {
- throw new NotYetImplemented();
- }
-
- //
- PageService ps = context.getController().getPageService();
- LayoutService ls = ps.getLayoutService();
- PortalLayout layout = ls.getLayout("generic", true);
- Map pageProperties = new HashMap();
- Map portalProperties = new HashMap();
- portalProperties.put("theme.renderSetId", "divRenderer");
- portalProperties.put("theme.id", "renaissance");
- PageResult result = new PageResult("BILTO", pageProperties,
portalProperties);
-
- //
- Map windowProps = new HashMap();
- windowProps.put(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER,
"emptyRenderer");
- windowProps.put(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER,
"emptyRenderer");
- windowProps.put(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER,
"emptyRenderer");
-
- //
- WindowResult res = new WindowResult("", content,
Collections.EMPTY_MAP, windowProps, null, WindowState.MAXIMIZED, Mode.VIEW);
- WindowContext blah = new WindowContext("BILTO", "BILTO",
"maximized", 0, res);
- result.addWindowContext(blah);
-
- //
- return new PageRendition(layout, null, result, ps);
- }
- catch (PortletInvokerException e)
- {
- return new ControllerException(e);
- }
- }
-}
Added:
trunk/core/src/main/org/jboss/portal/core/model/instance/command/PortletInstanceCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/command/PortletInstanceCommand.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/command/PortletInstanceCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,81 @@
+/******************************************************************************
+ * 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.model.instance.command;
+
+import org.jboss.portal.core.controller.ControllerCommand;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.core.model.instance.InstanceContainer;
+import org.jboss.portal.portlet.StateString;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class PortletInstanceCommand extends ControllerCommand
+{
+
+ /** The instance id. */
+ protected String instanceId;
+
+ /** The navigational state. */
+ protected StateString navigationalState;
+
+ /** The instance displayed. */
+ protected Instance instance;
+
+ protected PortletInstanceCommand(String instanceId, StateString navigationalState)
+ {
+ if (instanceId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.instanceId = instanceId;
+ this.navigationalState = navigationalState;
+
+ }
+
+ public String getInstanceId()
+ {
+ return instanceId;
+ }
+
+ protected void create() throws ControllerException
+ {
+ InstanceContainer container = context.getController().getInstanceContainer();
+
+ //
+ instance = container.getDefinition(instanceId);
+ if (instance == null)
+ {
+ throw new ControllerException("Configurator portlet instance " +
instanceId + " not found");
+ }
+ }
+
+ public StateString getNavigationalState()
+ {
+ return navigationalState;
+ }
+}
Added:
trunk/core/src/main/org/jboss/portal/core/model/instance/command/action/InvokePortletInstanceActionCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/command/action/InvokePortletInstanceActionCommand.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/command/action/InvokePortletInstanceActionCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,107 @@
+/******************************************************************************
+ * 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.model.instance.command.action;
+
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.portlet.PortletContextFactory;
+import org.jboss.portal.core.controller.portlet.InvokePortletCommandFactory;
+import org.jboss.portal.core.controller.portlet.PortletInvocationFactory;
+import org.jboss.portal.core.controller.command.info.CommandInfo;
+import org.jboss.portal.core.model.instance.InvokePortletInstanceCommandFactory;
+import org.jboss.portal.core.model.instance.command.response.PortletInstanceResponse;
+import org.jboss.portal.core.model.instance.command.PortletInstanceCommand;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class InvokePortletInstanceActionCommand extends PortletInstanceCommand
+{
+
+ /** The interaction state. */
+ private StateString interactionState;
+
+ /** The nform. */
+ private PortletParameters form;
+
+ public InvokePortletInstanceActionCommand(String instanceId, StateString
navigationalState, StateString interactionState, PortletParameters form)
+ {
+ super(instanceId, navigationalState);
+
+ //
+ this.interactionState = interactionState;
+ this.form = form;
+ }
+
+ public StateString getInteractionState()
+ {
+ return interactionState;
+ }
+
+ public PortletParameters getForm()
+ {
+ return form;
+ }
+
+ public CommandInfo getInfo()
+ {
+ return null;
+ }
+
+ public Object execute() throws ControllerException
+ {
+ try
+ {
+ PortletContextFactory pcf1 = new PortletContextFactory(context);
+ InvokePortletCommandFactory pcf2 = new
InvokePortletInstanceCommandFactory(instanceId);
+
+ //
+ ActionInvocation action = PortletInvocationFactory.createAction(
+ context,
+ Mode.VIEW,
+ WindowState.MAXIMIZED,
+ navigationalState,
+ interactionState,
+ form,
+ pcf1,
+ pcf2);
+
+ //
+ PortletInvocationResponse response = instance.invoke(action);
+
+ //
+ return new PortletInstanceResponse(instanceId, response);
+ }
+ catch (PortletInvokerException e)
+ {
+ return new ControllerException(e);
+ }
+ }
+}
Added:
trunk/core/src/main/org/jboss/portal/core/model/instance/command/action/InvokePortletInstanceRenderCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/command/action/InvokePortletInstanceRenderCommand.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/command/action/InvokePortletInstanceRenderCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,52 @@
+/******************************************************************************
+ * 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.model.instance.command.action;
+
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.command.info.CommandInfo;
+import
org.jboss.portal.core.model.instance.command.response.UpdatePortletInstanceResponse;
+import org.jboss.portal.core.model.instance.command.PortletInstanceCommand;
+import org.jboss.portal.portlet.StateString;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class InvokePortletInstanceRenderCommand extends PortletInstanceCommand
+{
+
+ public InvokePortletInstanceRenderCommand(String instanceId, StateString
navigationalState)
+ {
+ super(instanceId, navigationalState);
+ }
+
+ public CommandInfo getInfo()
+ {
+ return null;
+ }
+
+ public Object execute() throws ControllerException
+ {
+ return new UpdatePortletInstanceResponse(instanceId, navigationalState);
+ }
+}
Added:
trunk/core/src/main/org/jboss/portal/core/model/instance/command/render/RenderPortletInstanceCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/command/render/RenderPortletInstanceCommand.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/command/render/RenderPortletInstanceCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,125 @@
+/******************************************************************************
+ * 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.model.instance.command.render;
+
+import org.jboss.portal.core.model.instance.command.PortletInstanceCommand;
+import org.jboss.portal.core.model.instance.InvokePortletInstanceCommandFactory;
+import org.jboss.portal.core.controller.command.info.CommandInfo;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.portlet.PortletContextFactory;
+import org.jboss.portal.core.controller.portlet.InvokePortletCommandFactory;
+import org.jboss.portal.core.controller.portlet.PortletInvocationFactory;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.portlet.invocation.response.ErrorResponse;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.theme.PageService;
+import org.jboss.portal.theme.LayoutService;
+import org.jboss.portal.theme.PortalLayout;
+import org.jboss.portal.theme.ThemeConstants;
+import org.jboss.portal.theme.page.PageResult;
+import org.jboss.portal.theme.page.WindowResult;
+import org.jboss.portal.theme.page.WindowContext;
+import org.jboss.portal.theme.page.PageRendition;
+import org.jboss.portal.common.NotYetImplemented;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RenderPortletInstanceCommand extends PortletInstanceCommand
+{
+
+ public RenderPortletInstanceCommand(String instanceId, StateString navigationalState)
+ {
+ super(instanceId, navigationalState);
+ }
+
+ public CommandInfo getInfo()
+ {
+ return null;
+ }
+
+ public Object execute() throws ControllerException
+ {
+
+ try
+ {
+ PortletContextFactory pcf1 = new PortletContextFactory(context);
+ InvokePortletCommandFactory pcf2 = new
InvokePortletInstanceCommandFactory(instanceId);
+ RenderInvocation render = PortletInvocationFactory.createRender(context,
Mode.VIEW, WindowState.MAXIMIZED, navigationalState, pcf1, pcf2);
+ PortletInvocationResponse response = instance.invoke(render);
+
+ // For now let the controller handle non fragment response
+ String content;
+ if (response instanceof FragmentResponse)
+ {
+ content = ((FragmentResponse)response).getContent();
+ }
+ else if (response instanceof ErrorResponse)
+ {
+ content = ((ErrorResponse)response).toHTML();
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+
+ //
+ PageService ps = context.getController().getPageService();
+ LayoutService ls = ps.getLayoutService();
+ PortalLayout layout = ls.getLayout("generic", true);
+ Map pageProperties = new HashMap();
+ Map portalProperties = new HashMap();
+ portalProperties.put("theme.renderSetId", "divRenderer");
+ portalProperties.put("theme.id", "renaissance");
+ PageResult result = new PageResult("BILTO", pageProperties,
portalProperties);
+
+ //
+ Map windowProps = new HashMap();
+ windowProps.put(ThemeConstants.PORTAL_PROP_WINDOW_RENDERER,
"emptyRenderer");
+ windowProps.put(ThemeConstants.PORTAL_PROP_DECORATION_RENDERER,
"emptyRenderer");
+ windowProps.put(ThemeConstants.PORTAL_PROP_PORTLET_RENDERER,
"emptyRenderer");
+
+ //
+ WindowResult res = new WindowResult("", content,
Collections.EMPTY_MAP, windowProps, null, WindowState.MAXIMIZED, Mode.VIEW);
+ WindowContext blah = new WindowContext("BILTO", "BILTO",
"maximized", 0, res);
+ result.addWindowContext(blah);
+
+ //
+ return new PageRendition(layout, null, result, ps);
+ }
+ catch (PortletInvokerException e)
+ {
+ throw new ControllerException(e);
+ }
+ }
+}
Added:
trunk/core/src/main/org/jboss/portal/core/model/instance/command/response/UpdatePortletInstanceResponse.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/instance/command/response/UpdatePortletInstanceResponse.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/instance/command/response/UpdatePortletInstanceResponse.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.model.instance.command.response;
+
+import org.jboss.portal.portlet.StateString;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class UpdatePortletInstanceResponse
+{
+
+ /** . */
+ private String instanceId;
+
+ /** The navigational state. */
+ protected StateString navigationalState;
+
+ public UpdatePortletInstanceResponse(String instanceId, StateString
navigationalState)
+ {
+ this.instanceId = instanceId;
+ this.navigationalState = navigationalState;
+ }
+
+ public String getInstanceId()
+ {
+ return instanceId;
+ }
+
+
+ public StateString getNavigationalState()
+ {
+ return navigationalState;
+ }
+}
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/DashboardCommandFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/DashboardCommandFactory.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/DashboardCommandFactory.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -23,7 +23,7 @@
package org.jboss.portal.core.model.portal;
import org.jboss.portal.core.controller.ControllerCommand;
-import org.jboss.portal.core.model.portal.command.ViewDashboardCommand;
+import org.jboss.portal.core.model.portal.command.view.ViewDashboardCommand;
import org.jboss.portal.core.controller.command.mapper.AbstractCommandFactory;
import org.jboss.portal.server.ServerInvocation;
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/DefaultPortalCommandFactory.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -23,7 +23,7 @@
package org.jboss.portal.core.model.portal;
import org.jboss.portal.core.controller.ControllerCommand;
-import org.jboss.portal.core.model.portal.command.RenderPageCommand;
+import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
import org.jboss.portal.core.controller.command.mapper.AbstractCommandFactory;
import org.jboss.portal.core.controller.command.mapper.CommandFactory;
import org.jboss.portal.server.ServerInvocation;
@@ -79,7 +79,7 @@
throw new IllegalStateException("Default page does not exist");
}
PortalObjectId id = page.getId();
- cmd = new RenderPageCommand(id);
+ cmd = new ViewPageCommand(id);
}
return cmd;
}
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectCommandFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectCommandFactory.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectCommandFactory.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -26,10 +26,10 @@
import org.jboss.portal.WindowState;
import org.jboss.portal.common.util.ParameterMap;
import org.jboss.portal.core.controller.ControllerCommand;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowActionCommand;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowRenderCommand;
-import org.jboss.portal.core.model.portal.command.RenderPageCommand;
-import org.jboss.portal.core.model.portal.command.ImportPageToDashboardCommand;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowActionCommand;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
+import org.jboss.portal.core.model.portal.command.action.ImportPageToDashboardCommand;
+import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
import org.jboss.portal.core.model.portal.ns.WindowNavigationalState;
import org.jboss.portal.core.controller.command.mapper.AbstractCommandFactory;
import org.jboss.portal.core.ns.NavigationalStateKey;
@@ -182,7 +182,7 @@
}
else
{
- cmd = new RenderPageCommand(id);
+ cmd = new ViewPageCommand(id);
}
}
}
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectResponseHandler.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectResponseHandler.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectResponseHandler.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -27,10 +27,18 @@
import org.jboss.portal.core.controller.HandlerResponse;
import org.jboss.portal.core.controller.ControllerCommand;
import org.jboss.portal.core.controller.ControllerContext;
-import org.jboss.portal.core.model.portal.command.response.UpdateViewResponse;
-import org.jboss.portal.core.model.portal.command.response.UpdateWindowMarkupResponse;
-import org.jboss.portal.core.model.portal.command.RenderPageCommand;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.HTTPResponse;
+import org.jboss.portal.core.model.portal.command.response.UpdatePageResponse;
+import org.jboss.portal.core.model.portal.command.response.UpdateWindowResponse;
+import org.jboss.portal.core.model.portal.command.view.ViewPageCommand;
+import org.jboss.portal.core.model.portal.command.render.RenderPageCommand;
import org.jboss.portal.server.ServerException;
+import org.jboss.portal.server.ServerInvocationContext;
+import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.theme.page.PageRendition;
+import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.common.util.MarkupInfo;
import javax.servlet.ServletException;
import java.io.IOException;
@@ -44,19 +52,40 @@
public HandlerResponse processCommandResponse(ControllerContext controllerContext,
ControllerCommand command, Object commandResponse) throws IOException, ServletException,
ServerException
{
- if (commandResponse instanceof UpdateViewResponse)
+ if (commandResponse instanceof UpdatePageResponse)
{
- UpdateViewResponse uvr = (UpdateViewResponse)commandResponse;
- RenderPageCommand renderCmd = new RenderPageCommand(uvr.getPageId());
- return new CommandForward(renderCmd, null);
+ UpdatePageResponse uvr = (UpdatePageResponse)commandResponse;
+
+ try
+ {
+ RenderPageCommand rpc = new RenderPageCommand(uvr.getPageId());
+ final PageRendition rendition =
(PageRendition)controllerContext.execute(rpc);
+ final ServerInvocation invocation = controllerContext.getServerInvocation();
+ return new HTTPResponse()
+ {
+ public void sendResponse(ServerInvocationContext ctx) throws IOException,
ServletException
+ {
+ ServletContextDispatcher dispatcher = new
ServletContextDispatcher(invocation.getServerContext().getClientRequest(),
invocation.getServerContext().getClientResponse(),
invocation.getRequest().getServer().getServletContainerContext());
+ MarkupInfo markupInfo =
(MarkupInfo)invocation.getResponse().getContentInfo();
+ rendition.render(markupInfo, dispatcher);
+ }
+ };
+ }
+ catch (ControllerException e)
+ {
+ e.printStackTrace();
+
+ // todo
+ return null;
+ }
}
- else if (commandResponse instanceof UpdateWindowMarkupResponse)
+ else if (commandResponse instanceof UpdateWindowResponse)
{
- UpdateWindowMarkupResponse uwmr = (UpdateWindowMarkupResponse)commandResponse;
+ UpdateWindowResponse uwmr = (UpdateWindowResponse)commandResponse;
PortalObjectContainer portalObjectContainer =
controllerContext.getController().getPortalObjectContainer();
PortalObject window = portalObjectContainer.getObject(uwmr.getWindowId());
Page page = (Page)window.getParent();
- RenderPageCommand rpc = new RenderPageCommand(page.getId());
+ ViewPageCommand rpc = new ViewPageCommand(page.getId());
return new CommandForward(rpc, null);
}
else
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectURLFactory.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectURLFactory.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/PortalObjectURLFactory.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -26,12 +26,12 @@
import org.jboss.portal.WindowState;
import org.jboss.portal.common.text.FastURLEncoder;
import org.jboss.portal.core.controller.ControllerCommand;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowActionCommand;
-import org.jboss.portal.core.model.portal.command.InvokeWindowCommand;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowRenderCommand;
-import org.jboss.portal.core.model.portal.command.RenderPageCommand;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowActionCommand;
+import org.jboss.portal.core.model.portal.command.action.InvokeWindowCommand;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
+import org.jboss.portal.core.model.portal.command.render.RenderPageCommand;
import org.jboss.portal.core.model.portal.command.PortalObjectCommand;
-import org.jboss.portal.core.model.portal.command.ImportPageToDashboardCommand;
+import org.jboss.portal.core.model.portal.command.action.ImportPageToDashboardCommand;
import org.jboss.portal.core.controller.command.mapper.URLFactoryDelegate;
import org.jboss.portal.portlet.StateString;
import org.jboss.portal.portlet.impl.PortletRequestEncoder;
Deleted:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/ImportPageToDashboardCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/ImportPageToDashboardCommand.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/ImportPageToDashboardCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -1,111 +0,0 @@
-/******************************************************************************
- * 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.model.portal.command;
-
-import org.jboss.portal.core.controller.command.info.CommandInfo;
-import org.jboss.portal.core.controller.command.info.ActionCommandInfo;
-import org.jboss.portal.core.controller.ControllerException;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.Portal;
-import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.command.response.UpdateViewResponse;
-import org.jboss.portal.core.model.CustomizationManager;
-import org.jboss.portal.identity.User;
-
-import java.util.Iterator;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ImportPageToDashboardCommand extends PageCommand
-{
-
- /** . */
- private static final CommandInfo info = new ActionCommandInfo(false);
-
- /** . */
- private Portal dashboardPortal;
-
- public ImportPageToDashboardCommand(PortalObjectId pageId)
- {
- super(pageId);
- }
-
- public CommandInfo getInfo()
- {
- return info;
- }
-
- public void create() throws ControllerException
- {
- super.create();
-
- //
- CustomizationManager manager =
getControllerContext().getController().getCustomizationManager();
-
- //
- User user = getControllerContext().getUser();
-
- //
- dashboardPortal = manager.getDashboard(user);
- }
-
- public Object execute() throws ControllerException
- {
- String name = target.getName();
-
- //
- PortalObject dashboardPage = dashboardPortal.getChild(name);
-
- //
- if (dashboardPage == null)
- {
- try
- {
- // Copy page
- dashboardPage = target.copy(dashboardPortal, name, false);
-
- // Copy children windows only
- for (Iterator i = target.getChildren().iterator();i.hasNext();)
- {
- PortalObject child = (PortalObject)i.next();
- if (child.getType() == PortalObject.TYPE_WINDOW)
- {
- child.copy(dashboardPage, child.getName(), false);
- }
- }
- }
- catch (DuplicatePortalObjectException e)
- {
- log.error("Unexpected exception during the copy of a page to a dashboard
page", e);
-
- //
- throw new ControllerException(e);
- }
- }
-
- return new UpdateViewResponse(dashboardPage.getId());
- }
-}
Deleted:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowActionCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowActionCommand.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowActionCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -1,174 +0,0 @@
-/******************************************************************************
- * 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.model.portal.command;
-
-import org.jboss.logging.Logger;
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.core.controller.ControllerException;
-import org.jboss.portal.core.controller.ResourceNotFoundException;
-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.PortletInvocationFactory;
-import org.jboss.portal.core.model.portal.command.response.PortletWindowResponse;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.instance.Instance;
-import org.jboss.portal.core.model.content.Content;
-import org.jboss.portal.portlet.NoSuchPortletException;
-import org.jboss.portal.portlet.PortletParameters;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class InvokePortletWindowActionCommand extends InvokeWindowCommand
-{
-
- /** . */
- private static final Logger log =
Logger.getLogger(InvokePortletWindowActionCommand.class);
-
- /** . */
- private static final CommandInfo info = new ActionCommandInfo(false);
-
- /** . */
- private StateString navigationalState;
-
- /** . */
- private StateString interactionState;
-
- /** . */
- private PortletParameters formParameters;
-
- /** The instance. */
- protected Instance instance;
-
- public InvokePortletWindowActionCommand(
- PortalObjectId windowId,
- Mode mode,
- WindowState windowState,
- StateString navigationalState,
- StateString interactionState,
- PortletParameters formParameters)
- throws IllegalArgumentException
- {
- super(windowId, mode, windowState);
- this.navigationalState = navigationalState;
- this.interactionState = interactionState;
- this.formParameters = formParameters;
- }
-
- public StateString getNavigationalState()
- {
- return navigationalState;
- }
-
- public StateString getInteractionState()
- {
- return interactionState;
- }
-
- public void setInteractionState(StateString interactionState)
- {
- this.interactionState = interactionState;
- }
-
- public PortletParameters getFormParameters()
- {
- return formParameters;
- }
-
- public void setFormParameters(PortletParameters formParameters)
- {
- this.formParameters = formParameters;
- }
-
- public CommandInfo getInfo()
- {
- return info;
- }
-
- public void create() throws ControllerException
- {
- super.create();
-
- // We need the user id
- User user = getControllerContext().getUser();
-
- // Get instance
- instance = context.getController().getCustomizationManager().getInstance(window,
user);
-
- // No instance means we can't continue
- if (instance == null)
- {
- String ref = null;
- Content content = window.getContent();
- if (content != null)
- {
- ref = content.getURI();
- }
- if (ref == null)
- {
- ref = window.getId().toString();
- }
- throw new ResourceNotFoundException(ref);
- }
- }
-
- public Object execute() throws ControllerException
- {
- try
- {
- PortletInvocation invocation = PortletInvocationFactory.createAction(
- context,
- mode,
- windowState,
- navigationalState,
- interactionState,
- formParameters,
- window,
- portal);
-
- //
- PortletInvocationResponse response = instance.invoke(invocation);
-
- //
- return new PortletWindowResponse(targetId, response);
- }
- catch (PortletInvokerException e)
- {
- if (e instanceof NoSuchPortletException)
- {
- throw new
ResourceNotFoundException(((NoSuchPortletException)e).getPortletId());
- }
- else
- {
- throw new ControllerException(e);
- }
- }
- }
-}
Deleted:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowRenderCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowRenderCommand.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokePortletWindowRenderCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -1,124 +0,0 @@
-/******************************************************************************
- * 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.model.portal.command;
-
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.common.invocation.InvocationContext;
-import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.core.controller.command.info.CommandInfo;
-import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
-import org.jboss.portal.core.model.portal.command.response.UpdateWindowMarkupResponse;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.ns.WindowNavigationalState;
-import org.jboss.portal.core.ns.NavigationalStateKey;
-import org.jboss.portal.portlet.StateString;
-
-/**
- * Simply update the navigational state of the window. No invocation to the underlying is
done.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public class InvokePortletWindowRenderCommand extends InvokeWindowCommand
-{
-
- private static final CommandInfo info = new ViewCommandInfo();
-
- /** . */
- protected final StateString navigationalState;
-
- public InvokePortletWindowRenderCommand(
- PortalObjectId windowId,
- Mode mode,
- WindowState windowState,
- StateString navigationalState)
- throws IllegalArgumentException
- {
- super(windowId, mode, windowState);
- this.navigationalState = navigationalState;
- }
-
- public InvokePortletWindowRenderCommand(
- PortalObjectId windowId,
- Mode mode,
- WindowState windowState)
- throws IllegalArgumentException
- {
- super(windowId, mode, windowState);
- this.navigationalState = null;
- }
-
- public StateString getNavigationalState()
- {
- return navigationalState;
- }
-
- public CommandInfo getInfo()
- {
- return info;
- }
-
- public Object execute() throws InvocationException
- {
- InvocationContext ctx = getContext();
- PortalObjectId windowId = window.getId();
- NavigationalStateKey nsKey = new
NavigationalStateKey(WindowNavigationalState.class, windowId);
-
- //
- WindowNavigationalState oldNS =
(WindowNavigationalState)ctx.getAttribute(NAVIGATIONAL_STATE_SCOPE, nsKey);
-
- //
- StateString newState = oldNS != null ? oldNS.getNavigationalState() : null;
- WindowState newWindowState = oldNS != null ? oldNS.getWindowState() : null;
- Mode newMode = oldNS != null ? oldNS.getMode() : null;
-
- //
- if (navigationalState != null)
- {
- newState = navigationalState;
- }
-
- //
- if (this.mode != null)
- {
- newMode = this.mode;
- }
-
- //
- if (this.windowState != null)
- {
- newWindowState = this.windowState;
- }
-
- // Create new NS
- WindowNavigationalState newNS = new WindowNavigationalState(newWindowState,
newMode, newState);
-
- // Update NS
- ctx.setAttribute(NAVIGATIONAL_STATE_SCOPE, nsKey, newNS);
-
-
- //
- return new UpdateWindowMarkupResponse(windowId);
- }
-}
\ No newline at end of file
Deleted:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokeWindowCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokeWindowCommand.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/InvokeWindowCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -1,58 +0,0 @@
-/******************************************************************************
- * 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.model.portal.command;
-
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public abstract class InvokeWindowCommand extends WindowCommand
-{
-
- /** . */
- protected final Mode mode;
-
- /** . */
- protected final WindowState windowState;
-
- public InvokeWindowCommand(PortalObjectId windowId, Mode mode, WindowState
windowState) throws IllegalArgumentException
- {
- super(windowId);
- this.mode = mode;
- this.windowState = windowState;
- }
-
- public Mode getMode()
- {
- return mode;
- }
-
- public WindowState getWindowState()
- {
- return windowState;
- }
-}
Deleted:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/MoveWindowCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/MoveWindowCommand.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/MoveWindowCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -1,142 +0,0 @@
-/******************************************************************************
- * 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.model.portal.command;
-
-import org.jboss.portal.core.controller.ControllerException;
-import org.jboss.portal.core.controller.command.info.ActionCommandInfo;
-import org.jboss.portal.core.controller.command.info.CommandInfo;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.theme.ThemeConstants;
-
-import java.util.Iterator;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class MoveWindowCommand extends WindowCommand
-{
-
- /** . */
- private static final CommandInfo info = new ActionCommandInfo(false);
-
- /** . */
- private int fromPos;
-
- /** . */
- private String fromRegion;
-
- /** . */
- private int toPos;
-
- /** . */
- private String toRegion;
-
- public MoveWindowCommand(PortalObjectId windowId, int fromPos, String fromRegion, int
toPos, String toRegion)
- throws IllegalArgumentException
- {
- super(windowId);
- this.fromPos = fromPos;
- this.fromRegion = fromRegion;
- this.toPos = toPos;
- this.toRegion = toRegion;
- }
-
- public CommandInfo getInfo()
- {
- return info;
- }
-
- public Object execute() throws ControllerException
- {
-
- // For now just update the navigational state of the page
-// PageNavigationalState pns =
(PageNavigationalState)getContext().getAttribute(NAVIGATIONAL_STATE_SCOPE, page.getId());
-
- //
-/*
- for (Iterator i = pns.getWindowContexts().iterator(); i.hasNext();)
- {
- WindowContext windowCtx = (WindowContext)i.next();
- String windowRegion = windowCtx.getRegionName();
- if (targetId.equals(windowCtx.getId()))
- {
- windowCtx.setRegionName(toRegion);
- windowCtx.setOrder(toPos);
- }
- else if (fromRegion.equals(windowRegion) && fromPos <
windowCtx.getOrder())
- {
- windowCtx.setOrder(windowCtx.getOrder() - 1);
- }
- else if (toRegion.equals(windowRegion) && toPos <=
windowCtx.getOrder())
- {
- windowCtx.setOrder(windowCtx.getOrder() + 1);
- }
- }
-*/
-
- //
- if (isDashboard())
- {
- for (Iterator i = page.getChildren().iterator(); i.hasNext();)
- {
- PortalObject child = (PortalObject)i.next();
- if (child.getType() == PortalObject.TYPE_WINDOW)
- {
- Window window = (Window)child;
- PortalObjectId windowId = window.getId();
- String regionId =
window.getDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION);
- String posAsString =
window.getDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER);
- if (regionId != null && posAsString != null)
- {
- try
- {
- int pos = Integer.parseInt(posAsString);
- if (targetId.equals(windowId))
- {
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION,
toRegion);
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER,
Integer.toString(toPos));
- }
- else if (fromRegion.equals(regionId) && fromPos < pos)
- {
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER,
Integer.toString(toPos - 1));
- }
- else if (toRegion.equals(regionId) && toPos <= pos)
- {
- window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER,
Integer.toString(toPos + 1));
- }
- }
- catch (NumberFormatException e)
- {
- }
- }
- }
- }
- }
-
- //
- return null;
- }
-}
Deleted:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderPageCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderPageCommand.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderPageCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -1,379 +0,0 @@
-/******************************************************************************
- * 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.model.portal.command;
-
-import org.jboss.portal.common.invocation.InvocationException;
-import org.jboss.portal.core.controller.ControllerContext;
-import org.jboss.portal.core.controller.ControllerException;
-import org.jboss.portal.core.controller.ControllerSecurityException;
-import org.jboss.portal.core.controller.command.info.CommandInfo;
-import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
-import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.model.portal.PortalObject;
-import org.jboss.portal.core.model.portal.PortalObjectPermission;
-import org.jboss.portal.core.model.portal.Window;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.identity.User;
-import org.jboss.portal.identity.UserProfileModule;
-import org.jboss.portal.security.PortalSecurityException;
-import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
-import org.jboss.portal.server.ServerInvocation;
-import org.jboss.portal.theme.LayoutService;
-import org.jboss.portal.theme.page.PageRendition;
-import org.jboss.portal.theme.PortalLayout;
-import org.jboss.portal.theme.PortalTheme;
-import org.jboss.portal.theme.ServerRegistrationID;
-import org.jboss.portal.theme.ThemeConstants;
-import org.jboss.portal.theme.ThemeService;
-import org.jboss.portal.theme.PageService;
-import org.jboss.portal.theme.page.PageResult;
-import org.jboss.portal.theme.page.WindowResult;
-import org.jboss.portal.theme.page.WindowContext;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.StringTokenizer;
-
-/**
- * Render a full page.
- *
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision$
- */
-public final class RenderPageCommand extends PageCommand
-{
-
- /** . */
- private static final CommandInfo info = new ViewCommandInfo();
-
- /** The windows to render. */
- private Collection windows;
-
- /** . */
- private PortalLayout layout;
-
- /** . */
- private boolean personalizable;
-
- public RenderPageCommand(PortalObjectId pageId)
- {
- super(pageId);
- }
-
- /**
- * Get the command info (runtime info about the command)
- *
- * @return info about the command
- */
- public CommandInfo getInfo()
- {
- return info;
- }
-
- /**
- * Get the layout that was determined for this request (based on portal and page
properties)
- *
- * @return the layout to use for this request
- */
- public PortalLayout getLayout()
- {
- return layout;
- }
-
- /**
- * Returns the modifiable list of windows.
- *
- * @return the windows on the page
- */
- public Collection getWindows()
- {
- return windows;
- }
-
- /**
- * initialize the command
- *
- * @throws InvocationException
- */
- public void create() throws ControllerException
- {
- super.create();
-
- // All windows on the page
- windows = new ArrayList(getPage().getChildren(PortalObject.WINDOW_MASK));
-
- //
- LayoutService layoutService =
context.getController().getPageService().getLayoutService();
- layout = getLayout(layoutService, page);
- }
-
- public void enforceSecurity(PortalAuthorizationManager pam) throws
ControllerSecurityException, PortalSecurityException
- {
- //
- super.enforceSecurity(pam);
-
- // Check if the user can personalize the page
- PortalObjectId uri = page.getId();
- PortalObjectPermission perm = new PortalObjectPermission(uri,
PortalObjectPermission.PERSONALIZE_MASK);
- personalizable = pam.checkPermission(perm);
- }
-
- /**
- * execute the command
- *
- * @throws InvocationException
- */
- public Object execute() throws ControllerException, InvocationException
- {
- ServerInvocation sinv = context.getServerInvocation();
- HttpServletRequest request = sinv.getServerContext().getClientRequest();
- try
- {
- //
- PageService pageService = context.getController().getPageService();
-
- // The theme for the page
- PortalTheme theme = null;
-
- //
- if (personalizable)
- {
- ControllerContext controllerCtx = (ControllerContext)getContext();
- User user = controllerCtx.getUser();
- if (user != null)
- {
- UserProfileModule userProfileModule = null;
-
- //MARK: identity code change
- try
- {
- userProfileModule = (UserProfileModule)new
InitialContext().lookup("java:portal/UserProfileModule");
- }
- catch (NamingException ignore)
- {
- // Name is not bound anymore, it could happen during a shutdown, we
don't do anything
- }
-
- //
- String themeId = (String)userProfileModule.getProperty(user,
User.INFO_USER_THEME);
-
- if (themeId != null)
- {
- theme = getTheme(themeId);
- }
- }
- }
-
- // If nothing get it from the object properties
- if (theme == null)
- {
- String themeId = page.getProperty(ThemeConstants.PORTAL_PROP_THEME);
- theme = getTheme(themeId);
- }
-
- // Call the portlet container to create the markup fragment(s) for each portlet
that needs to render itself
- PageResult pageResult = new PageResult(
- getPage().getName(),
- new HashMap(getPage().getDeclaredProperties()),
- new HashMap(getPage().getPortal().getDeclaredProperties()));
-
- // Render the windows
- for (Iterator i = windows.iterator(); i.hasNext();)
- {
- PortalObject o = (PortalObject)i.next();
- if (o instanceof Window)
- {
- Window window = (Window)o;
- boolean visible = true;
- if (visible)
- {
- RenderWindowCommand renderCmd = new
RenderWindowCommand(window.getId());
-
- //
- Object res = null;
-
- //
- if (renderCmd != null)
- {
- res = context.execute(renderCmd);
- }
-
- //
- if (res == null)
- {
- // Skip
- }
- else if (res instanceof WindowResult)
- {
- WindowResult result = (WindowResult)res;
- String region =
window.getDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION);
- String order =
window.getDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER);
- WindowContext wc = new WindowContext(
- window.getName(),
- window.getId().toString(PortalObjectId.LEGACY_BASE64_FORMAT),
- region,
- Integer.parseInt(order),
- result);
- pageResult.addWindowContext(wc);
- }
- else
- {
- return res;
- }
- }
- }
- }
-
- //
- return new PageRendition(layout, theme, pageResult, pageService);
- }
- catch (Exception e)
- {
- rethrow(e);
- }
-
- //
- return null;
- }
-
- private PortalTheme getTheme(String themeIdString)
- {
- //
- ThemeService service = context.getController().getPageService().getThemeService();
-
- PortalTheme theme;
-
- // If the id is provided in the form of context.name then look up the theme via a
registration id
- if (themeIdString == null)
- {
- theme = service.getDefaultTheme();
- }
- else if (themeIdString.lastIndexOf(".") > 0)
- {
- ServerRegistrationID themeId =
ServerRegistrationID.createID(ServerRegistrationID.TYPE_THEME, parseId(themeIdString));
- theme = service.getTheme(themeId, true);
- }
- else
- {
- // Otherwise use the ordinary theme name provided and lookup the theme via the
name
- theme = service.getTheme(themeIdString, true);
- }
-
- // Last Chance
- if (theme == null)
- {
- theme = service.getTheme("renaissance", true);
- }
-
- // We don't like that situation
- if (theme == null)
- {
- throw new IllegalStateException("No Theme found for " +
themeIdString);
- }
-
- //
- return theme;
- }
-
- /**
- * Get the portal layout to use for the provided page. <p>The name of the layout
to use can be defined as a property
- * in the portal, or the individual page. The page property overwrites the portal
property. If no property was set, a
- * default layout with the name "nodesk" is assumed.</p>
- *
- * @param layoutService the layout service that allows access to the layout
- * @param page the page that hosts the markup container to render (the page,
region, window,...)
- * @return a <code>PortalLayout</code> for the defined layout name
- */
- public static PortalLayout getLayout(LayoutService layoutService, Page page)
- {
- String layoutIdString = page.getProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
-
- //
- PortalLayout layout;
-
- if (layoutIdString == null)
- {
- layout = layoutService.getDefaultLayout();
- }
- else if (layoutIdString.lastIndexOf(".") > 0)
- {
- // if the id is provided in the form of context.name then look up the layout via
a registration id
- ServerRegistrationID layoutID =
ServerRegistrationID.createID(ServerRegistrationID.TYPE_LAYOUT, parseId(layoutIdString));
- layout = layoutService.getLayout(layoutID, true);
- }
- else
- {
- // otherwise use the ordinary layout name provided and lookup the layout via the
name
- layout = layoutService.getLayout(layoutIdString, true);
- }
-
- // Last Chance
- if (layout == null)
- {
- layout = layoutService.getLayout("generic", true);
- }
-
- // We don't like that situation
- if (layout == null)
- {
- throw new IllegalStateException("NO LAYOUT FOUND FOR " +
layoutIdString);
- }
-
- //
- return layout;
- }
-
- /**
- * parse the provided String for '.' as a separator. For each token, add an
entry to a String[] that will be returned
- * as the result
- *
- * @param layoutIDString the string to be examined
- * @return an array of Strings
- */
- private static String[] parseId(String layoutIDString)
- {
- List names = new ArrayList();
- StringTokenizer tokens = new StringTokenizer(layoutIDString, ".");
- if (tokens.countTokens() > 1)
- {
- while (tokens.hasMoreElements())
- {
- names.add(tokens.nextToken());
- }
- }
- else
- {
- names.add(layoutIDString);
- }
-
- String[] id = new String[names.size()];
- names.toArray(id);
- return id;
- }
-}
Deleted:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderWindowCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderWindowCommand.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/RenderWindowCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -1,98 +0,0 @@
-/******************************************************************************
- * 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.model.portal.command;
-
-import org.jboss.portal.core.controller.command.info.CommandInfo;
-import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
-import org.jboss.portal.core.controller.ControllerException;
-import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.content.ContentRendererRegistry;
-import org.jboss.portal.core.model.portal.content.ContentRenderer;
-import org.jboss.portal.core.model.content.ContentType;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class RenderWindowCommand extends WindowCommand
-{
-
- /** . */
- public static final String WINDOW_ACCESS_DENIED =
"core.render.window_access_denied";
-
- /** . */
- public static final String WINDOW_UNAVAILABLE =
"core.render.window_unavailable";
-
- /** . */
- public static final String WINDOW_ERROR = "core.render.window_error";
-
- /** . */
- public static final String WINDOW_INTERNAL_ERROR =
"core.render.window_internal_error";
-
- /** . */
- public static final String WINDOW_NOT_FOUND =
"core.render.window_not_found";
-
- /** . */
- public static final String HIDE = "hide";
-
- /** . */
- public static final String SHOW = "show";
-
- /** . */
- private static final CommandInfo info = new ViewCommandInfo();
-
- public RenderWindowCommand(PortalObjectId windowId)
- throws IllegalArgumentException
- {
- super(windowId);
- }
-
- public CommandInfo getInfo()
- {
- return info;
- }
-
- public Object execute() throws ControllerException
- {
- ContentRendererRegistry registry =
context.getController().getContentRendererRegistry();
- ContentType contentType = window.getContentType();
- ContentRenderer renderer = registry.getRenderer(contentType);
-
- //
- if (renderer == null)
- {
- return null;
- }
- else
- {
- try
- {
- return renderer.renderWindow(this);
- }
- catch (Exception e)
- {
- throw new ControllerException(e);
- }
- }
- }
-}
Deleted:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/ViewDashboardCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/ViewDashboardCommand.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/ViewDashboardCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -1,110 +0,0 @@
-/******************************************************************************
- * 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.model.portal.command;
-
-import org.jboss.portal.core.controller.ControllerException;
-import org.jboss.portal.core.controller.ControllerSecurityException;
-import org.jboss.portal.core.controller.command.info.CommandInfo;
-import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
-import org.jboss.portal.core.model.portal.command.response.UpdateViewResponse;
-import org.jboss.portal.core.model.portal.Page;
-import org.jboss.portal.core.model.portal.Portal;
-import org.jboss.portal.core.model.CustomizationManager;
-import org.jboss.portal.security.PortalSecurityException;
-import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
-import org.jboss.portal.identity.User;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class ViewDashboardCommand extends DashboardCommand
-{
-
- /** . */
- private static final CommandInfo info = new ViewCommandInfo();
-
- /** . */
- private Portal dashboardPortal;
-
- /** . */
- private Page dashboardPage;
-
- /** . */
- private User user;
-
- public ViewDashboardCommand()
- {
- }
-
- public CommandInfo getInfo()
- {
- return info;
- }
-
- public Portal getDashboardPortal()
- {
- return dashboardPortal;
- }
-
- public Page getDashboardPage()
- {
- return dashboardPage;
- }
-
- /**
- * Initialize the command
- *
- * @throws org.jboss.portal.common.invocation.InvocationException
- *
- */
- public void create() throws ControllerException
- {
- super.create();
-
- //
- CustomizationManager manager =
getControllerContext().getController().getCustomizationManager();
-
- //
- user = getControllerContext().getUser();
-
- //
- dashboardPortal = manager.getDashboard(user);
-
- //
- dashboardPage = dashboardPortal.getDefaultPage();
- }
-
- public void enforceSecurity(PortalAuthorizationManager pam) throws
ControllerSecurityException, PortalSecurityException
- {
- if (user == null)
- {
- throw new ControllerSecurityException("User needs to be authenticated to
view a dashboard");
- }
- }
-
- public Object execute() throws ControllerException
- {
- return new UpdateViewResponse(dashboardPage.getId());
- }
-}
\ No newline at end of file
Added:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/ImportPageToDashboardCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/ImportPageToDashboardCommand.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/ImportPageToDashboardCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,112 @@
+/******************************************************************************
+ * 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.model.portal.command.action;
+
+import org.jboss.portal.core.controller.command.info.CommandInfo;
+import org.jboss.portal.core.controller.command.info.ActionCommandInfo;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.core.model.portal.DuplicatePortalObjectException;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.command.response.UpdatePageResponse;
+import org.jboss.portal.core.model.portal.command.PageCommand;
+import org.jboss.portal.core.model.CustomizationManager;
+import org.jboss.portal.identity.User;
+
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ImportPageToDashboardCommand extends PageCommand
+{
+
+ /** . */
+ private static final CommandInfo info = new ActionCommandInfo(false);
+
+ /** . */
+ private Portal dashboardPortal;
+
+ public ImportPageToDashboardCommand(PortalObjectId pageId)
+ {
+ super(pageId);
+ }
+
+ public CommandInfo getInfo()
+ {
+ return info;
+ }
+
+ public void create() throws ControllerException
+ {
+ super.create();
+
+ //
+ CustomizationManager manager =
getControllerContext().getController().getCustomizationManager();
+
+ //
+ User user = getControllerContext().getUser();
+
+ //
+ dashboardPortal = manager.getDashboard(user);
+ }
+
+ public Object execute() throws ControllerException
+ {
+ String name = target.getName();
+
+ //
+ PortalObject dashboardPage = dashboardPortal.getChild(name);
+
+ //
+ if (dashboardPage == null)
+ {
+ try
+ {
+ // Copy page
+ dashboardPage = target.copy(dashboardPortal, name, false);
+
+ // Copy children windows only
+ for (Iterator i = target.getChildren().iterator();i.hasNext();)
+ {
+ PortalObject child = (PortalObject)i.next();
+ if (child.getType() == PortalObject.TYPE_WINDOW)
+ {
+ child.copy(dashboardPage, child.getName(), false);
+ }
+ }
+ }
+ catch (DuplicatePortalObjectException e)
+ {
+ log.error("Unexpected exception during the copy of a page to a dashboard
page", e);
+
+ //
+ throw new ControllerException(e);
+ }
+ }
+
+ return new UpdatePageResponse(dashboardPage.getId());
+ }
+}
Added:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowActionCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowActionCommand.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowActionCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,175 @@
+/******************************************************************************
+ * 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.model.portal.command.action;
+
+import org.jboss.logging.Logger;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.ResourceNotFoundException;
+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.PortletInvocationFactory;
+import org.jboss.portal.core.model.portal.command.response.PortletWindowResponse;
+import org.jboss.portal.core.model.portal.command.action.InvokeWindowCommand;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.instance.Instance;
+import org.jboss.portal.core.model.content.Content;
+import org.jboss.portal.portlet.NoSuchPortletException;
+import org.jboss.portal.portlet.PortletParameters;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6912 $
+ */
+public class InvokePortletWindowActionCommand extends InvokeWindowCommand
+{
+
+ /** . */
+ private static final Logger log =
Logger.getLogger(InvokePortletWindowActionCommand.class);
+
+ /** . */
+ private static final CommandInfo info = new ActionCommandInfo(false);
+
+ /** . */
+ private StateString navigationalState;
+
+ /** . */
+ private StateString interactionState;
+
+ /** . */
+ private PortletParameters formParameters;
+
+ /** The instance. */
+ protected Instance instance;
+
+ public InvokePortletWindowActionCommand(
+ PortalObjectId windowId,
+ Mode mode,
+ WindowState windowState,
+ StateString navigationalState,
+ StateString interactionState,
+ PortletParameters formParameters)
+ throws IllegalArgumentException
+ {
+ super(windowId, mode, windowState);
+ this.navigationalState = navigationalState;
+ this.interactionState = interactionState;
+ this.formParameters = formParameters;
+ }
+
+ public StateString getNavigationalState()
+ {
+ return navigationalState;
+ }
+
+ public StateString getInteractionState()
+ {
+ return interactionState;
+ }
+
+ public void setInteractionState(StateString interactionState)
+ {
+ this.interactionState = interactionState;
+ }
+
+ public PortletParameters getFormParameters()
+ {
+ return formParameters;
+ }
+
+ public void setFormParameters(PortletParameters formParameters)
+ {
+ this.formParameters = formParameters;
+ }
+
+ public CommandInfo getInfo()
+ {
+ return info;
+ }
+
+ public void create() throws ControllerException
+ {
+ super.create();
+
+ // We need the user id
+ User user = getControllerContext().getUser();
+
+ // Get instance
+ instance = context.getController().getCustomizationManager().getInstance(window,
user);
+
+ // No instance means we can't continue
+ if (instance == null)
+ {
+ String ref = null;
+ Content content = window.getContent();
+ if (content != null)
+ {
+ ref = content.getURI();
+ }
+ if (ref == null)
+ {
+ ref = window.getId().toString();
+ }
+ throw new ResourceNotFoundException(ref);
+ }
+ }
+
+ public Object execute() throws ControllerException
+ {
+ try
+ {
+ PortletInvocation invocation = PortletInvocationFactory.createAction(
+ context,
+ mode,
+ windowState,
+ navigationalState,
+ interactionState,
+ formParameters,
+ window,
+ portal);
+
+ //
+ PortletInvocationResponse response = instance.invoke(invocation);
+
+ //
+ return new PortletWindowResponse(targetId, response);
+ }
+ catch (PortletInvokerException e)
+ {
+ if (e instanceof NoSuchPortletException)
+ {
+ throw new
ResourceNotFoundException(((NoSuchPortletException)e).getPortletId());
+ }
+ else
+ {
+ throw new ControllerException(e);
+ }
+ }
+ }
+}
Property changes on:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowActionCommand.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,125 @@
+/******************************************************************************
+ * 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.model.portal.command.action;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.invocation.InvocationContext;
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.core.controller.command.info.CommandInfo;
+import org.jboss.portal.core.controller.command.info.ActionCommandInfo;
+import org.jboss.portal.core.model.portal.command.response.UpdateWindowResponse;
+import org.jboss.portal.core.model.portal.command.action.InvokeWindowCommand;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.ns.WindowNavigationalState;
+import org.jboss.portal.core.ns.NavigationalStateKey;
+import org.jboss.portal.portlet.StateString;
+
+/**
+ * Simply update the navigational state of the window. No invocation to the underlying is
done.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6912 $
+ */
+public class InvokePortletWindowRenderCommand extends InvokeWindowCommand
+{
+
+ private static final CommandInfo info = new ActionCommandInfo(true);
+
+ /** . */
+ protected final StateString navigationalState;
+
+ public InvokePortletWindowRenderCommand(
+ PortalObjectId windowId,
+ Mode mode,
+ WindowState windowState,
+ StateString navigationalState)
+ throws IllegalArgumentException
+ {
+ super(windowId, mode, windowState);
+ this.navigationalState = navigationalState;
+ }
+
+ public InvokePortletWindowRenderCommand(
+ PortalObjectId windowId,
+ Mode mode,
+ WindowState windowState)
+ throws IllegalArgumentException
+ {
+ super(windowId, mode, windowState);
+ this.navigationalState = null;
+ }
+
+ public StateString getNavigationalState()
+ {
+ return navigationalState;
+ }
+
+ public CommandInfo getInfo()
+ {
+ return info;
+ }
+
+ public Object execute() throws InvocationException
+ {
+ InvocationContext ctx = getContext();
+ PortalObjectId windowId = window.getId();
+ NavigationalStateKey nsKey = new
NavigationalStateKey(WindowNavigationalState.class, windowId);
+
+ //
+ WindowNavigationalState oldNS =
(WindowNavigationalState)ctx.getAttribute(NAVIGATIONAL_STATE_SCOPE, nsKey);
+
+ //
+ StateString newState = oldNS != null ? oldNS.getNavigationalState() : null;
+ WindowState newWindowState = oldNS != null ? oldNS.getWindowState() : null;
+ Mode newMode = oldNS != null ? oldNS.getMode() : null;
+
+ //
+ if (navigationalState != null)
+ {
+ newState = navigationalState;
+ }
+
+ //
+ if (this.mode != null)
+ {
+ newMode = this.mode;
+ }
+
+ //
+ if (this.windowState != null)
+ {
+ newWindowState = this.windowState;
+ }
+
+ // Create new NS
+ WindowNavigationalState newNS = new WindowNavigationalState(newWindowState,
newMode, newState);
+
+ // Update NS
+ ctx.setAttribute(NAVIGATIONAL_STATE_SCOPE, nsKey, newNS);
+
+
+ //
+ return new UpdateWindowResponse(windowId);
+ }
+}
\ No newline at end of file
Property changes on:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokePortletWindowRenderCommand.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokeWindowCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokeWindowCommand.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokeWindowCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * 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.model.portal.command.action;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.command.WindowCommand;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6007 $
+ */
+public abstract class InvokeWindowCommand extends WindowCommand
+{
+
+ /** . */
+ protected final Mode mode;
+
+ /** . */
+ protected final WindowState windowState;
+
+ public InvokeWindowCommand(PortalObjectId windowId, Mode mode, WindowState
windowState) throws IllegalArgumentException
+ {
+ super(windowId);
+ this.mode = mode;
+ this.windowState = windowState;
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+}
Property changes on:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/InvokeWindowCommand.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/MoveWindowCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/MoveWindowCommand.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/action/MoveWindowCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,143 @@
+/******************************************************************************
+ * 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.model.portal.command.action;
+
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.command.info.ActionCommandInfo;
+import org.jboss.portal.core.controller.command.info.CommandInfo;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.Window;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.command.WindowCommand;
+import org.jboss.portal.theme.ThemeConstants;
+
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class MoveWindowCommand extends WindowCommand
+{
+
+ /** . */
+ private static final CommandInfo info = new ActionCommandInfo(false);
+
+ /** . */
+ private int fromPos;
+
+ /** . */
+ private String fromRegion;
+
+ /** . */
+ private int toPos;
+
+ /** . */
+ private String toRegion;
+
+ public MoveWindowCommand(PortalObjectId windowId, int fromPos, String fromRegion, int
toPos, String toRegion)
+ throws IllegalArgumentException
+ {
+ super(windowId);
+ this.fromPos = fromPos;
+ this.fromRegion = fromRegion;
+ this.toPos = toPos;
+ this.toRegion = toRegion;
+ }
+
+ public CommandInfo getInfo()
+ {
+ return info;
+ }
+
+ public Object execute() throws ControllerException
+ {
+
+ // For now just update the navigational state of the page
+// PageNavigationalState pns =
(PageNavigationalState)getContext().getAttribute(NAVIGATIONAL_STATE_SCOPE, page.getId());
+
+ //
+/*
+ for (Iterator i = pns.getWindowContexts().iterator(); i.hasNext();)
+ {
+ WindowContext windowCtx = (WindowContext)i.next();
+ String windowRegion = windowCtx.getRegionName();
+ if (targetId.equals(windowCtx.getId()))
+ {
+ windowCtx.setRegionName(toRegion);
+ windowCtx.setOrder(toPos);
+ }
+ else if (fromRegion.equals(windowRegion) && fromPos <
windowCtx.getOrder())
+ {
+ windowCtx.setOrder(windowCtx.getOrder() - 1);
+ }
+ else if (toRegion.equals(windowRegion) && toPos <=
windowCtx.getOrder())
+ {
+ windowCtx.setOrder(windowCtx.getOrder() + 1);
+ }
+ }
+*/
+
+ //
+ if (isDashboard())
+ {
+ for (Iterator i = page.getChildren().iterator(); i.hasNext();)
+ {
+ PortalObject child = (PortalObject)i.next();
+ if (child.getType() == PortalObject.TYPE_WINDOW)
+ {
+ Window window = (Window)child;
+ PortalObjectId windowId = window.getId();
+ String regionId =
window.getDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION);
+ String posAsString =
window.getDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER);
+ if (regionId != null && posAsString != null)
+ {
+ try
+ {
+ int pos = Integer.parseInt(posAsString);
+ if (targetId.equals(windowId))
+ {
+ window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION,
toRegion);
+ window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER,
Integer.toString(toPos));
+ }
+ else if (fromRegion.equals(regionId) && fromPos < pos)
+ {
+ window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER,
Integer.toString(toPos - 1));
+ }
+ else if (toRegion.equals(regionId) && toPos <= pos)
+ {
+ window.setDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER,
Integer.toString(toPos + 1));
+ }
+ }
+ catch (NumberFormatException e)
+ {
+ }
+ }
+ }
+ }
+ }
+
+ //
+ return null;
+ }
+}
Added:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,380 @@
+/******************************************************************************
+ * 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.model.portal.command.render;
+
+import org.jboss.portal.common.invocation.InvocationException;
+import org.jboss.portal.core.controller.ControllerContext;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.ControllerSecurityException;
+import org.jboss.portal.core.controller.command.info.CommandInfo;
+import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.PortalObject;
+import org.jboss.portal.core.model.portal.PortalObjectPermission;
+import org.jboss.portal.core.model.portal.Window;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.command.PageCommand;
+import org.jboss.portal.identity.User;
+import org.jboss.portal.identity.UserProfileModule;
+import org.jboss.portal.security.PortalSecurityException;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
+import org.jboss.portal.server.ServerInvocation;
+import org.jboss.portal.theme.LayoutService;
+import org.jboss.portal.theme.page.PageRendition;
+import org.jboss.portal.theme.PortalLayout;
+import org.jboss.portal.theme.PortalTheme;
+import org.jboss.portal.theme.ServerRegistrationID;
+import org.jboss.portal.theme.ThemeConstants;
+import org.jboss.portal.theme.ThemeService;
+import org.jboss.portal.theme.PageService;
+import org.jboss.portal.theme.page.PageResult;
+import org.jboss.portal.theme.page.WindowResult;
+import org.jboss.portal.theme.page.WindowContext;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.StringTokenizer;
+
+/**
+ * Render a full page.
+ *
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 6942 $
+ */
+public final class RenderPageCommand extends PageCommand
+{
+
+ /** . */
+ private static final CommandInfo info = new ViewCommandInfo();
+
+ /** The windows to render. */
+ private Collection windows;
+
+ /** . */
+ private PortalLayout layout;
+
+ /** . */
+ private boolean personalizable;
+
+ public RenderPageCommand(PortalObjectId pageId)
+ {
+ super(pageId);
+ }
+
+ /**
+ * Get the command info (runtime info about the command)
+ *
+ * @return info about the command
+ */
+ public CommandInfo getInfo()
+ {
+ return info;
+ }
+
+ /**
+ * Get the layout that was determined for this request (based on portal and page
properties)
+ *
+ * @return the layout to use for this request
+ */
+ public PortalLayout getLayout()
+ {
+ return layout;
+ }
+
+ /**
+ * Returns the modifiable list of windows.
+ *
+ * @return the windows on the page
+ */
+ public Collection getWindows()
+ {
+ return windows;
+ }
+
+ /**
+ * initialize the command
+ *
+ * @throws InvocationException
+ */
+ public void create() throws ControllerException
+ {
+ super.create();
+
+ // All windows on the page
+ windows = new ArrayList(getPage().getChildren(PortalObject.WINDOW_MASK));
+
+ //
+ LayoutService layoutService =
context.getController().getPageService().getLayoutService();
+ layout = getLayout(layoutService, page);
+ }
+
+ public void enforceSecurity(PortalAuthorizationManager pam) throws
ControllerSecurityException, PortalSecurityException
+ {
+ //
+ super.enforceSecurity(pam);
+
+ // Check if the user can personalize the page
+ PortalObjectId uri = page.getId();
+ PortalObjectPermission perm = new PortalObjectPermission(uri,
PortalObjectPermission.PERSONALIZE_MASK);
+ personalizable = pam.checkPermission(perm);
+ }
+
+ /**
+ * execute the command
+ *
+ * @throws InvocationException
+ */
+ public Object execute() throws ControllerException, InvocationException
+ {
+ ServerInvocation sinv = context.getServerInvocation();
+ HttpServletRequest request = sinv.getServerContext().getClientRequest();
+ try
+ {
+ //
+ PageService pageService = context.getController().getPageService();
+
+ // The theme for the page
+ PortalTheme theme = null;
+
+ //
+ if (personalizable)
+ {
+ ControllerContext controllerCtx = (ControllerContext)getContext();
+ User user = controllerCtx.getUser();
+ if (user != null)
+ {
+ UserProfileModule userProfileModule = null;
+
+ //MARK: identity code change
+ try
+ {
+ userProfileModule = (UserProfileModule)new
InitialContext().lookup("java:portal/UserProfileModule");
+ }
+ catch (NamingException ignore)
+ {
+ // Name is not bound anymore, it could happen during a shutdown, we
don't do anything
+ }
+
+ //
+ String themeId = (String)userProfileModule.getProperty(user,
User.INFO_USER_THEME);
+
+ if (themeId != null)
+ {
+ theme = getTheme(themeId);
+ }
+ }
+ }
+
+ // If nothing get it from the object properties
+ if (theme == null)
+ {
+ String themeId = page.getProperty(ThemeConstants.PORTAL_PROP_THEME);
+ theme = getTheme(themeId);
+ }
+
+ // Call the portlet container to create the markup fragment(s) for each portlet
that needs to render itself
+ PageResult pageResult = new PageResult(
+ getPage().getName(),
+ new HashMap(getPage().getDeclaredProperties()),
+ new HashMap(getPage().getPortal().getDeclaredProperties()));
+
+ // Render the windows
+ for (Iterator i = windows.iterator(); i.hasNext();)
+ {
+ PortalObject o = (PortalObject)i.next();
+ if (o instanceof Window)
+ {
+ Window window = (Window)o;
+ boolean visible = true;
+ if (visible)
+ {
+ RenderWindowCommand renderCmd = new
RenderWindowCommand(window.getId());
+
+ //
+ Object res = null;
+
+ //
+ if (renderCmd != null)
+ {
+ res = context.execute(renderCmd);
+ }
+
+ //
+ if (res == null)
+ {
+ // Skip
+ }
+ else if (res instanceof WindowResult)
+ {
+ WindowResult result = (WindowResult)res;
+ String region =
window.getDeclaredProperty(ThemeConstants.PORTAL_PROP_REGION);
+ String order =
window.getDeclaredProperty(ThemeConstants.PORTAL_PROP_ORDER);
+ WindowContext wc = new WindowContext(
+ window.getName(),
+ window.getId().toString(PortalObjectId.LEGACY_BASE64_FORMAT),
+ region,
+ Integer.parseInt(order),
+ result);
+ pageResult.addWindowContext(wc);
+ }
+ else
+ {
+ return res;
+ }
+ }
+ }
+ }
+
+ //
+ return new PageRendition(layout, theme, pageResult, pageService);
+ }
+ catch (Exception e)
+ {
+ rethrow(e);
+ }
+
+ //
+ return null;
+ }
+
+ private PortalTheme getTheme(String themeIdString)
+ {
+ //
+ ThemeService service = context.getController().getPageService().getThemeService();
+
+ PortalTheme theme;
+
+ // If the id is provided in the form of context.name then look up the theme via a
registration id
+ if (themeIdString == null)
+ {
+ theme = service.getDefaultTheme();
+ }
+ else if (themeIdString.lastIndexOf(".") > 0)
+ {
+ ServerRegistrationID themeId =
ServerRegistrationID.createID(ServerRegistrationID.TYPE_THEME, parseId(themeIdString));
+ theme = service.getTheme(themeId, true);
+ }
+ else
+ {
+ // Otherwise use the ordinary theme name provided and lookup the theme via the
name
+ theme = service.getTheme(themeIdString, true);
+ }
+
+ // Last Chance
+ if (theme == null)
+ {
+ theme = service.getTheme("renaissance", true);
+ }
+
+ // We don't like that situation
+ if (theme == null)
+ {
+ throw new IllegalStateException("No Theme found for " +
themeIdString);
+ }
+
+ //
+ return theme;
+ }
+
+ /**
+ * Get the portal layout to use for the provided page. <p>The name of the layout
to use can be defined as a property
+ * in the portal, or the individual page. The page property overwrites the portal
property. If no property was set, a
+ * default layout with the name "nodesk" is assumed.</p>
+ *
+ * @param layoutService the layout service that allows access to the layout
+ * @param page the page that hosts the markup container to render (the page,
region, window,...)
+ * @return a <code>PortalLayout</code> for the defined layout name
+ */
+ public static PortalLayout getLayout(LayoutService layoutService, Page page)
+ {
+ String layoutIdString = page.getProperty(ThemeConstants.PORTAL_PROP_LAYOUT);
+
+ //
+ PortalLayout layout;
+
+ if (layoutIdString == null)
+ {
+ layout = layoutService.getDefaultLayout();
+ }
+ else if (layoutIdString.lastIndexOf(".") > 0)
+ {
+ // if the id is provided in the form of context.name then look up the layout via
a registration id
+ ServerRegistrationID layoutID =
ServerRegistrationID.createID(ServerRegistrationID.TYPE_LAYOUT, parseId(layoutIdString));
+ layout = layoutService.getLayout(layoutID, true);
+ }
+ else
+ {
+ // otherwise use the ordinary layout name provided and lookup the layout via the
name
+ layout = layoutService.getLayout(layoutIdString, true);
+ }
+
+ // Last Chance
+ if (layout == null)
+ {
+ layout = layoutService.getLayout("generic", true);
+ }
+
+ // We don't like that situation
+ if (layout == null)
+ {
+ throw new IllegalStateException("NO LAYOUT FOUND FOR " +
layoutIdString);
+ }
+
+ //
+ return layout;
+ }
+
+ /**
+ * parse the provided String for '.' as a separator. For each token, add an
entry to a String[] that will be returned
+ * as the result
+ *
+ * @param layoutIDString the string to be examined
+ * @return an array of Strings
+ */
+ private static String[] parseId(String layoutIDString)
+ {
+ List names = new ArrayList();
+ StringTokenizer tokens = new StringTokenizer(layoutIDString, ".");
+ if (tokens.countTokens() > 1)
+ {
+ while (tokens.hasMoreElements())
+ {
+ names.add(tokens.nextToken());
+ }
+ }
+ else
+ {
+ names.add(layoutIDString);
+ }
+
+ String[] id = new String[names.size()];
+ names.toArray(id);
+ return id;
+ }
+}
Property changes on:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderPageCommand.java
___________________________________________________________________
Name: svn:executable
+ *
Added:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/render/RenderWindowCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,99 @@
+/******************************************************************************
+ * 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.model.portal.command.render;
+
+import org.jboss.portal.core.controller.command.info.CommandInfo;
+import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.command.WindowCommand;
+import org.jboss.portal.core.model.portal.content.ContentRendererRegistry;
+import org.jboss.portal.core.model.portal.content.ContentRenderer;
+import org.jboss.portal.core.model.content.ContentType;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class RenderWindowCommand extends WindowCommand
+{
+
+ /** . */
+ public static final String WINDOW_ACCESS_DENIED =
"core.render.window_access_denied";
+
+ /** . */
+ public static final String WINDOW_UNAVAILABLE =
"core.render.window_unavailable";
+
+ /** . */
+ public static final String WINDOW_ERROR = "core.render.window_error";
+
+ /** . */
+ public static final String WINDOW_INTERNAL_ERROR =
"core.render.window_internal_error";
+
+ /** . */
+ public static final String WINDOW_NOT_FOUND =
"core.render.window_not_found";
+
+ /** . */
+ public static final String HIDE = "hide";
+
+ /** . */
+ public static final String SHOW = "show";
+
+ /** . */
+ private static final CommandInfo info = new ViewCommandInfo();
+
+ public RenderWindowCommand(PortalObjectId windowId)
+ throws IllegalArgumentException
+ {
+ super(windowId);
+ }
+
+ public CommandInfo getInfo()
+ {
+ return info;
+ }
+
+ public Object execute() throws ControllerException
+ {
+ ContentRendererRegistry registry =
context.getController().getContentRendererRegistry();
+ ContentType contentType = window.getContentType();
+ ContentRenderer renderer = registry.getRenderer(contentType);
+
+ //
+ if (renderer == null)
+ {
+ return null;
+ }
+ else
+ {
+ try
+ {
+ return renderer.renderWindow(this);
+ }
+ catch (Exception e)
+ {
+ throw new ControllerException(e);
+ }
+ }
+ }
+}
Copied:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdatePageResponse.java
(from rev 6949,
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateViewResponse.java)
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdatePageResponse.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdatePageResponse.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * 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.model.portal.command.response;
+
+import org.jboss.portal.core.model.portal.PortalObjectId;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class UpdatePageResponse
+{
+
+ /** . */
+ private PortalObjectId pageId;
+
+ public UpdatePageResponse(PortalObjectId pageId)
+ {
+ if (pageId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.pageId = pageId;
+ }
+
+ public PortalObjectId getPageId()
+ {
+ return pageId;
+ }
+}
Deleted:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateViewResponse.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateViewResponse.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateViewResponse.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -1,50 +0,0 @@
-/******************************************************************************
- * 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.model.portal.command.response;
-
-import org.jboss.portal.core.model.portal.PortalObjectId;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class UpdateViewResponse
-{
-
- /** . */
- private PortalObjectId pageId;
-
- public UpdateViewResponse(PortalObjectId pageId)
- {
- if (pageId == null)
- {
- throw new IllegalArgumentException();
- }
- this.pageId = pageId;
- }
-
- public PortalObjectId getPageId()
- {
- return pageId;
- }
-}
Deleted:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateWindowMarkupResponse.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateWindowMarkupResponse.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateWindowMarkupResponse.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -1,51 +0,0 @@
-/******************************************************************************
- * 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.model.portal.command.response;
-
-import org.jboss.portal.core.model.portal.PortalObjectId;
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @version $Revision: 1.1 $
- */
-public class UpdateWindowMarkupResponse
-{
-
- /** . */
- private final PortalObjectId windowId;
-
-
- public UpdateWindowMarkupResponse(PortalObjectId windowId)
- {
- if (windowId == null)
- {
- throw new IllegalArgumentException();
- }
- this.windowId = windowId;
- }
-
- public PortalObjectId getWindowId()
- {
- return windowId;
- }
-}
Copied:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateWindowResponse.java
(from rev 6949,
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateWindowMarkupResponse.java)
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateWindowResponse.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/response/UpdateWindowResponse.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,50 @@
+/******************************************************************************
+ * 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.model.portal.command.response;
+
+import org.jboss.portal.core.model.portal.PortalObjectId;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class UpdateWindowResponse
+{
+
+ /** . */
+ private final PortalObjectId windowId;
+
+ public UpdateWindowResponse(PortalObjectId windowId)
+ {
+ if (windowId == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ this.windowId = windowId;
+ }
+
+ public PortalObjectId getWindowId()
+ {
+ return windowId;
+ }
+}
Added:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewDashboardCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewDashboardCommand.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewDashboardCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * 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.model.portal.command.view;
+
+import org.jboss.portal.core.controller.ControllerException;
+import org.jboss.portal.core.controller.ControllerSecurityException;
+import org.jboss.portal.core.controller.command.info.CommandInfo;
+import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
+import org.jboss.portal.core.model.portal.command.response.UpdatePageResponse;
+import org.jboss.portal.core.model.portal.command.DashboardCommand;
+import org.jboss.portal.core.model.portal.Page;
+import org.jboss.portal.core.model.portal.Portal;
+import org.jboss.portal.core.model.CustomizationManager;
+import org.jboss.portal.security.PortalSecurityException;
+import org.jboss.portal.security.spi.auth.PortalAuthorizationManager;
+import org.jboss.portal.identity.User;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ViewDashboardCommand extends DashboardCommand
+{
+
+ /** . */
+ private static final CommandInfo info = new ViewCommandInfo();
+
+ /** . */
+ private Portal dashboardPortal;
+
+ /** . */
+ private Page dashboardPage;
+
+ /** . */
+ private User user;
+
+ public ViewDashboardCommand()
+ {
+ }
+
+ public CommandInfo getInfo()
+ {
+ return info;
+ }
+
+ public Portal getDashboardPortal()
+ {
+ return dashboardPortal;
+ }
+
+ public Page getDashboardPage()
+ {
+ return dashboardPage;
+ }
+
+ /**
+ * Initialize the command
+ *
+ * @throws org.jboss.portal.common.invocation.InvocationException
+ *
+ */
+ public void create() throws ControllerException
+ {
+ super.create();
+
+ //
+ CustomizationManager manager =
getControllerContext().getController().getCustomizationManager();
+
+ //
+ user = getControllerContext().getUser();
+
+ //
+ dashboardPortal = manager.getDashboard(user);
+
+ //
+ dashboardPage = dashboardPortal.getDefaultPage();
+ }
+
+ public void enforceSecurity(PortalAuthorizationManager pam) throws
ControllerSecurityException, PortalSecurityException
+ {
+ if (user == null)
+ {
+ throw new ControllerSecurityException("User needs to be authenticated to
view a dashboard");
+ }
+ }
+
+ public Object execute() throws ControllerException
+ {
+ return new UpdatePageResponse(dashboardPage.getId());
+ }
+}
\ No newline at end of file
Added:
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPageCommand.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPageCommand.java
(rev 0)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/command/view/ViewPageCommand.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -0,0 +1,56 @@
+/******************************************************************************
+ * 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.model.portal.command.view;
+
+import org.jboss.portal.core.model.portal.PortalObjectId;
+import org.jboss.portal.core.model.portal.command.response.UpdatePageResponse;
+import org.jboss.portal.core.model.portal.command.PageCommand;
+import org.jboss.portal.core.controller.command.info.CommandInfo;
+import org.jboss.portal.core.controller.command.info.ViewCommandInfo;
+import org.jboss.portal.core.controller.ControllerException;
+
+/**
+ * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
+ * @version $Revision: 1.1 $
+ */
+public class ViewPageCommand extends PageCommand
+{
+
+ /** . */
+ private static final CommandInfo info = new ViewCommandInfo();
+
+ public ViewPageCommand(PortalObjectId pageId)
+ {
+ super(pageId);
+ }
+
+ public CommandInfo getInfo()
+ {
+ return info;
+ }
+
+ public Object execute() throws ControllerException
+ {
+ return new UpdatePageResponse(page.getId());
+ }
+}
Modified:
trunk/core/src/main/org/jboss/portal/core/model/portal/content/ContentRenderer.java
===================================================================
---
trunk/core/src/main/org/jboss/portal/core/model/portal/content/ContentRenderer.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core/src/main/org/jboss/portal/core/model/portal/content/ContentRenderer.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -22,7 +22,7 @@
******************************************************************************/
package org.jboss.portal.core.model.portal.content;
-import org.jboss.portal.core.model.portal.command.RenderWindowCommand;
+import org.jboss.portal.core.model.portal.command.render.RenderWindowCommand;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
Modified: trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml
===================================================================
--- trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-04-08
12:59:16 UTC (rev 6956)
+++ trunk/core/src/resources/portal-core-sar/META-INF/jboss-service.xml 2007-04-08
14:16:18 UTC (rev 6957)
@@ -837,7 +837,7 @@
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
<xmbean/>
<attribute name="Path">/dashboard</attribute>
- <attribute
name="ClassNames">org.jboss.portal.core.model.portal.command.ViewDashboardCommand</attribute>
+ <attribute
name="ClassNames">org.jboss.portal.core.model.portal.command.view.ViewDashboardCommand</attribute>
<depends
optional-attribute-name="Factory"
proxy-type="attribute">portal:urlFactory=Delegating</depends>
Modified: trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml
===================================================================
--- trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml 2007-04-08 12:59:16
UTC (rev 6956)
+++ trunk/core/src/resources/portal-core-war/WEB-INF/jboss-portlet.xml 2007-04-08 14:16:18
UTC (rev 6957)
@@ -52,12 +52,8 @@
</header-content>
</portlet>
- <!-- We don't want the catalog portlet to be asynchronous as it targets the
whole page -->
<portlet>
<portlet-name>CatalogPortlet</portlet-name>
- <ajax>
- <asynchronous>false</asynchronous>
- </ajax>
<transaction>
<trans-attribute>Required</trans-attribute>
</transaction>
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java
===================================================================
---
trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core-cms/src/main/org/jboss/portal/core/cms/CMSObjectCommandFactoryService.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -25,7 +25,7 @@
import org.jboss.portal.core.controller.command.mapper.AbstractCommandFactory;
import org.jboss.portal.core.controller.ControllerCommand;
import org.jboss.portal.core.model.portal.PortalObjectId;
-import org.jboss.portal.core.model.portal.command.InvokePortletWindowRenderCommand;
+import
org.jboss.portal.core.model.portal.command.action.InvokePortletWindowRenderCommand;
import org.jboss.portal.core.cms.command.StreamContentCommand;
import org.jboss.portal.core.cms.ui.CMSPortlet;
import org.jboss.portal.cms.CMS;
Modified:
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/InternalCMSContentProvider.java
===================================================================
---
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/InternalCMSContentProvider.java 2007-04-08
12:59:16 UTC (rev 6956)
+++
trunk/core-cms/src/main/org/jboss/portal/core/cms/content/InternalCMSContentProvider.java 2007-04-08
14:16:18 UTC (rev 6957)
@@ -23,7 +23,7 @@
package org.jboss.portal.core.cms.content;
import org.jboss.portal.core.impl.model.content.generic.InternalGenericContentProvider;
-import org.jboss.portal.core.model.portal.command.RenderWindowCommand;
+import org.jboss.portal.core.model.portal.command.render.RenderWindowCommand;
import org.jboss.portal.core.model.portal.PortalObjectId;
import org.jboss.portal.core.model.content.spi.portlet.ContentPortlet;
import org.jboss.portal.core.cms.CMSObjectCommandFactory;