Author: julien(a)jboss.com
Date: 2008-04-28 06:47:59 -0400 (Mon, 28 Apr 2008)
New Revision: 10723
Added:
modules/presentation/trunk/portlet/
modules/presentation/trunk/portlet/pom.xml
modules/presentation/trunk/portlet/src/
modules/presentation/trunk/portlet/src/main/
modules/presentation/trunk/portlet/src/main/java/
modules/presentation/trunk/portlet/src/main/java/org/
modules/presentation/trunk/portlet/src/main/java/org/jboss/
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/PortletPresentationServer.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralEventControllerContext.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralPortletControllerContext.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralPortletPageNavigationalState.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralStateControllerContext.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/protocol/
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/protocol/PortletContainerAction.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationClientContext.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationInstanceContext.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationPortalContext.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationPortletInvocationContext.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationSecurityContext.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationServerContext.java
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationWindowContext.java
modules/presentation/trunk/portlet/src/main/resources/
modules/presentation/trunk/portlet/src/test/
modules/presentation/trunk/portlet/src/test/java/
modules/presentation/trunk/portlet/src/test/resources/
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/InternalObjectContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java
Removed:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UIObjectImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/PortletContainerAction.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralEventControllerContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralPortletControllerContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralPortletPageNavigationalState.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralStateControllerContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationClientContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationInstanceContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationPortalContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationPortletInvocationContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationSecurityContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationServerContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationWindowContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/CommandAction.java
Modified:
modules/presentation/trunk/ajax/src/test/java/org/jboss/portal/presentation/test/portal/PresentationServerImpl.java
modules/presentation/trunk/classic/pom.xml
modules/presentation/trunk/classic/src/assemble/presentation-war.xml
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationServlet.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionDecoder.java
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionEncoder.java
modules/presentation/trunk/pom.xml
modules/presentation/trunk/presentation/pom.xml
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/PresentationClient.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectUpdate.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIContextImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPageImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIWindowImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/PresentationServerImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationServer.java
Log:
modularize portlet integration in a separate module
Modified:
modules/presentation/trunk/ajax/src/test/java/org/jboss/portal/presentation/test/portal/PresentationServerImpl.java
===================================================================
---
modules/presentation/trunk/ajax/src/test/java/org/jboss/portal/presentation/test/portal/PresentationServerImpl.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/ajax/src/test/java/org/jboss/portal/presentation/test/portal/PresentationServerImpl.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -66,11 +66,6 @@
return structuralStateContext;
}
- public String render(ProtocolAction action) throws IllegalArgumentException
- {
- throw new UnsupportedOperationException();
- }
-
/**
*
*/
Modified: modules/presentation/trunk/classic/pom.xml
===================================================================
--- modules/presentation/trunk/classic/pom.xml 2008-04-28 10:07:59 UTC (rev 10722)
+++ modules/presentation/trunk/classic/pom.xml 2008-04-28 10:47:59 UTC (rev 10723)
@@ -21,6 +21,12 @@
</dependency>
<dependency>
+ <groupId>org.jboss.portal.presentation</groupId>
+ <artifactId>presentation-portlet</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
<groupId>sun-servlet</groupId>
<artifactId>servlet-api</artifactId>
</dependency>
Modified: modules/presentation/trunk/classic/src/assemble/presentation-war.xml
===================================================================
--- modules/presentation/trunk/classic/src/assemble/presentation-war.xml 2008-04-28
10:07:59 UTC (rev 10722)
+++ modules/presentation/trunk/classic/src/assemble/presentation-war.xml 2008-04-28
10:47:59 UTC (rev 10723)
@@ -33,6 +33,7 @@
<include>org.jboss.portal.portlet:portlet-mc</include>
<include>org.jboss.portal.portlet:portlet-samples</include>
<include>org.jboss.portal.presentation:presentation-presentation</include>
+
<include>org.jboss.portal.presentation:presentation-portlet</include>
<include>javax.ccpp:ccpp</include>
<include>javax.portlet:portlet-api</include>
Modified:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -22,7 +22,6 @@
******************************************************************************/
package org.jboss.portal.presentation.classic;
-import org.jboss.portal.portlet.URLFormat;
import org.jboss.portal.presentation.classic.model.ClassicUINode;
import org.jboss.portal.presentation.classic.model.ClassicViewPortContext;
import org.jboss.portal.presentation.classic.model.DefaultPageViewPortScope;
@@ -55,6 +54,7 @@
import org.jboss.portal.web.WebRequest;
import org.jboss.portal.web.WebResponse;
import org.jboss.portal.web.impl.DefaultServletContainerFactory;
+import org.jboss.portal.common.servlet.URLFormat;
import java.io.IOException;
import java.io.PrintWriter;
Modified:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationServlet.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationServlet.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationServlet.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -29,6 +29,7 @@
import org.jboss.portal.presentation.impl.state.structural.StructuralStateContextImpl;
import org.jboss.portal.presentation.server.PresentationServer;
import org.jboss.portal.presentation.server.PresentationServerException;
+import org.jboss.portal.presentation.portlet.PortletPresentationServer;
import org.jboss.portal.web.WebRequest;
import org.jboss.portal.web.WebResponse;
import org.jboss.portal.web.endpoint.EndPointServlet;
@@ -74,7 +75,10 @@
PortletInvoker portletInvoker =
(PortletInvoker)getServletContext().getAttribute("ConsumerPortletInvoker");
//
- this.server = new PresentationServerImpl(structuralStateContext, portletInvoker);
+ PresentationServer blahServer = new
PresentationServerImpl(structuralStateContext);
+
+ //
+ this.server = new PortletPresentationServer(portletInvoker, blahServer);
}
protected void service(WebRequest req, WebResponse resp) throws ServletException,
IOException
Modified:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionDecoder.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionDecoder.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionDecoder.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -26,9 +26,9 @@
import org.jboss.portal.presentation.protocol.PostActivation;
import org.jboss.portal.presentation.protocol.ProtocolAction;
import org.jboss.portal.presentation.protocol.ViewUIObjectAction;
-import org.jboss.portal.presentation.impl.server.portlet.PortletContainerAction;
import
org.jboss.portal.presentation.impl.state.navigational.NavigationalStateContextSerialization;
import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
+import org.jboss.portal.presentation.portlet.protocol.PortletContainerAction;
import org.jboss.portal.web.WebRequest;
import org.jboss.portal.web.Body;
import org.jboss.portal.portlet.LifeCyclePhase;
Modified:
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionEncoder.java
===================================================================
---
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionEncoder.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/protocol/ActionEncoder.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -27,9 +27,9 @@
import org.jboss.portal.presentation.protocol.ProtocolAction;
import org.jboss.portal.presentation.protocol.UIObjectAction;
import org.jboss.portal.presentation.protocol.ViewUIObjectAction;
-import org.jboss.portal.presentation.impl.server.portlet.PortletContainerAction;
import
org.jboss.portal.presentation.impl.state.navigational.NavigationalStateContextImpl;
import
org.jboss.portal.presentation.impl.state.navigational.NavigationalStateContextSerialization;
+import org.jboss.portal.presentation.portlet.protocol.PortletContainerAction;
import org.jboss.portal.web.WebResponse;
import org.jboss.portal.common.io.IOTools;
import org.jboss.portal.common.io.SerializationFilter;
Modified: modules/presentation/trunk/pom.xml
===================================================================
--- modules/presentation/trunk/pom.xml 2008-04-28 10:07:59 UTC (rev 10722)
+++ modules/presentation/trunk/pom.xml 2008-04-28 10:47:59 UTC (rev 10723)
@@ -28,6 +28,7 @@
<modules>
<module>build</module>
<module>presentation</module>
+ <module>portlet</module>
<module>classic</module>
<!--<module>ajax</module>-->
</modules>
Added: modules/presentation/trunk/portlet/pom.xml
===================================================================
--- modules/presentation/trunk/portlet/pom.xml (rev 0)
+++ modules/presentation/trunk/portlet/pom.xml 2008-04-28 10:47:59 UTC (rev 10723)
@@ -0,0 +1,69 @@
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+ <parent>
+ <groupId>org.jboss.portal.presentation</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>presentation-portlet</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Portal Presentation Framework - Portlet Module</name>
+
+ <dependencies>
+
+ <dependency>
+ <groupId>org.jboss.portal.presentation</groupId>
+ <artifactId>presentation-presentation</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+
+ <dependency>
+ <groupId>sun-servlet</groupId>
+ <artifactId>servlet-api</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.portal.common</groupId>
+ <artifactId>common-common</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.portal.common</groupId>
+ <artifactId>common-common</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.portal.common</groupId>
+ <artifactId>common-portal</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.portal.common</groupId>
+ <artifactId>common-mc</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.portal.web</groupId>
+ <artifactId>web-web</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-portlet</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-controller</artifactId>
+ </dependency>
+ </dependencies>
+
+</project>
Added:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/PortletPresentationServer.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/PortletPresentationServer.java
(rev 0)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/PortletPresentationServer.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,214 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.portlet;
+
+import org.jboss.portal.presentation.server.PresentationServer;
+import org.jboss.portal.presentation.server.PresentationServerException;
+import org.jboss.portal.presentation.server.PresentationResponse;
+import org.jboss.portal.presentation.server.PresentationRequest;
+import org.jboss.portal.presentation.state.structural.StructuralStateContext;
+import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
+import org.jboss.portal.presentation.protocol.ProtocolAction;
+import org.jboss.portal.presentation.protocol.ShowUIObjectResponse;
+import org.jboss.portal.presentation.model.content.WindowContent;
+import org.jboss.portal.presentation.model.tree.UINode;
+import org.jboss.portal.presentation.client.PresentationClient;
+import org.jboss.portal.presentation.portlet.protocol.PortletContainerAction;
+import
org.jboss.portal.presentation.portlet.controller.StructuralPortletPageNavigationalState;
+import
org.jboss.portal.presentation.portlet.controller.StructuralPortletControllerContext;
+import org.jboss.portal.presentation.impl.model.tree.UINodeFactory;
+import org.jboss.portal.portlet.controller.request.ControllerRequest;
+import org.jboss.portal.portlet.controller.request.PortletActionRequest;
+import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
+import org.jboss.portal.portlet.controller.PortletController;
+import org.jboss.portal.portlet.controller.response.ControllerResponse;
+import org.jboss.portal.portlet.controller.response.PageUpdateResponse;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.invocation.response.FragmentResponse;
+import org.jboss.portal.common.NotYetImplemented;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletPresentationServer implements PresentationServer
+{
+
+ /** . */
+ private PortletInvoker portletInvoker;
+
+ /** . */
+ private PresentationServer next;
+
+ public PortletPresentationServer(PortletInvoker portletInvoker, PresentationServer
next)
+ {
+ this.portletInvoker = portletInvoker;
+ this.next = next;
+ }
+
+ public StructuralStateContext getStructuralStateContext()
+ {
+ return next.getStructuralStateContext();
+ }
+
+ public WindowContent renderWindow(PresentationClient client, String windowId) throws
PresentationServerException
+ {
+ try
+ {
+ NavigationalStateContext navigationalStateContext =
client.getNavigationalStateContext();
+ StructuralStateContext structuralStateContext =
next.getStructuralStateContext();
+ UINode windowNode = UINodeFactory.createNode(navigationalStateContext,
structuralStateContext, windowId);
+
+ //
+ UINode pageNode = windowNode.getParent();
+
+ //
+ PortletController controller = new PortletController();
+
+ //
+ StructuralPortletControllerContext portletControllerContext = new
StructuralPortletControllerContext(
+ client,
+ pageNode,
+ portletInvoker);
+
+ //
+ StructuralPortletPageNavigationalState pageNavigationalState = new
StructuralPortletPageNavigationalState(
+ portletControllerContext,
+ client.getNavigationalStateContext(),
+ StructuralPortletPageNavigationalState.READ_ONLY_MODE);
+
+ PortletInvocationResponse response = controller.render(portletControllerContext,
null, pageNavigationalState, windowId);
+
+ //
+ if (response instanceof FragmentResponse)
+ {
+ FragmentResponse fragment = (FragmentResponse)response;
+ return new WindowContent(0, fragment.getTitle(), fragment.getContent());
+ }
+ else
+ {
+ return new WindowContent(0, "Unexpected response for window " +
windowId, "");
+ }
+ }
+ catch (PortletInvokerException e)
+ {
+ throw new PresentationServerException(e);
+ }
+ }
+
+ public PresentationResponse process(PresentationClient client, PresentationRequest
request) throws PresentationServerException
+ {
+ ProtocolAction action = request.getProtocolAction();
+
+ //
+ if (action instanceof PortletContainerAction)
+ {
+ PortletContainerAction pcAction = (PortletContainerAction)action;
+
+ NavigationalStateContext navigationalStateContext =
client.getNavigationalStateContext();
+ StructuralStateContext structuralStateContext =
next.getStructuralStateContext();
+ UINode windowNode = UINodeFactory.createNode(navigationalStateContext,
structuralStateContext, pcAction.getTargetId());
+
+ //
+ UINode pageNode = windowNode.getParent();
+
+ //
+ StructuralPortletControllerContext portletControllerContext = new
StructuralPortletControllerContext(
+ client,
+ pageNode,
+ portletInvoker);
+
+ StructuralPortletPageNavigationalState pageNavigationalState = new
StructuralPortletPageNavigationalState(
+ portletControllerContext,
+ client.getNavigationalStateContext(),
+ StructuralPortletPageNavigationalState.CLONE_AND_WRITE_MODE);
+
+ //
+ ControllerRequest controllerRequest;
+ switch (pcAction.getPhase())
+ {
+ case ACTION:
+ controllerRequest = new PortletActionRequest(
+ pcAction.getTargetId(),
+ pcAction.getState(),
+ pcAction.getForm(),
+
pageNavigationalState.getPortletWindowNavigationalState(pcAction.getTargetId()),
+ pageNavigationalState
+ );
+ break;
+ case RENDER:
+ PortletWindowNavigationalState windowNavigationalState = new
PortletWindowNavigationalState(
+ pcAction.getState(),
+ pcAction.getMode(),
+ pcAction.getWindowState()
+ );
+ controllerRequest = new PortletRenderRequest(
+ pcAction.getTargetId(),
+ windowNavigationalState,
+ null,
+ pageNavigationalState
+ );
+ break;
+ default:
+ throw new NotYetImplemented();
+ }
+
+ //
+ PortletController controller = new PortletController();
+
+ //
+ try
+ {
+ ControllerResponse response = controller.process(portletControllerContext,
controllerRequest);
+
+ if (response instanceof PageUpdateResponse)
+ {
+ PageUpdateResponse pageUpdate = (PageUpdateResponse)response;
+
+ //
+ NavigationalStateContext nsc = client.getNavigationalStateContext();
+
+ //
+ StructuralPortletPageNavigationalState blah =
(StructuralPortletPageNavigationalState)pageUpdate.getPageNavigationalState();
+
+ //
+ blah.flush();
+ }
+ }
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
+
+ //
+ return new PresentationResponse(new
ShowUIObjectResponse(pageNode.getObject().getId()));
+ }
+ else
+ {
+ return next.process(client, request);
+ }
+ }
+}
Added:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralEventControllerContext.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralEventControllerContext.java
(rev 0)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralEventControllerContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.portlet.controller;
+
+import org.jboss.portal.portlet.controller.event.EventControllerContext;
+import org.jboss.portal.portlet.controller.event.EventPhaseContext;
+import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.info.PortletInfo;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class StructuralEventControllerContext implements EventControllerContext
+{
+
+ /** . */
+ private final StructuralPortletControllerContext portletControllerContext;
+
+ public StructuralEventControllerContext(StructuralPortletControllerContext
portletControllerContext)
+ {
+ this.portletControllerContext = portletControllerContext;
+ }
+
+ public void eventProduced(EventPhaseContext context, PortletWindowEvent producedEvent,
PortletWindowEvent sourceEvent)
+ {
+ for (String windowId : portletControllerContext.getWindowIds())
+ {
+ PortletInfo portletInfo = portletControllerContext.getPortletInfo(windowId);
+ if
(portletInfo.getEventing().getConsumedEvents().containsKey(producedEvent.getName()))
+ {
+ PortletWindowEvent distributedEvent = new
PortletWindowEvent(producedEvent.getName(), producedEvent.getPayload(), windowId);
+ context.queueEvent(distributedEvent);
+ }
+ }
+ }
+
+ public void eventConsumed(EventPhaseContext context, PortletWindowEvent consumedEvent,
PortletInvocationResponse consumerResponse)
+ {
+ }
+
+ public void eventFailed(EventPhaseContext context, PortletWindowEvent failedEvent,
Throwable throwable)
+ {
+ }
+
+ public void eventDiscarded(EventPhaseContext context, PortletWindowEvent
discardedEvent, int cause)
+ {
+ }
+}
Added:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralPortletControllerContext.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralPortletControllerContext.java
(rev 0)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralPortletControllerContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,208 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.portlet.controller;
+
+import org.jboss.portal.portlet.PortletInvoker;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
+import org.jboss.portal.portlet.controller.PortletControllerContext;
+import org.jboss.portal.portlet.controller.event.EventControllerContext;
+import org.jboss.portal.portlet.controller.state.StateControllerContext;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import org.jboss.portal.portlet.info.PortletInfo;
+import org.jboss.portal.portlet.invocation.ActionInvocation;
+import org.jboss.portal.portlet.invocation.EventInvocation;
+import org.jboss.portal.portlet.invocation.ResourceInvocation;
+import org.jboss.portal.portlet.invocation.RenderInvocation;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
+import org.jboss.portal.presentation.portlet.spi.PresentationPortletInvocationContext;
+import org.jboss.portal.presentation.portlet.spi.PresentationServerContext;
+import org.jboss.portal.presentation.portlet.spi.PresentationWindowContext;
+import org.jboss.portal.presentation.portlet.spi.PresentationInstanceContext;
+import org.jboss.portal.presentation.portlet.spi.PresentationClientContext;
+import org.jboss.portal.presentation.portlet.spi.PresentationPortalContext;
+import org.jboss.portal.presentation.portlet.spi.PresentationSecurityContext;
+import org.jboss.portal.presentation.client.PresentationClient;
+import org.jboss.portal.presentation.model.tree.UINode;
+import org.jboss.portal.presentation.model.UIObject;
+import org.jboss.portal.presentation.model.ui.UIWindow;
+import org.jboss.portal.presentation.state.StateType;
+
+import javax.servlet.http.Cookie;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class StructuralPortletControllerContext implements PortletControllerContext
+{
+
+ /** . */
+ private final UINode pageNode;
+
+ /** . */
+ private final PortletInvoker invoker;
+
+ /** . */
+ private final StateControllerContext stateControllerContext;
+
+ /** A map of window ids to portlets. */
+ private final Map<String, Portlet> portlets;
+
+ /** A map of window ids to windows. */
+ private final Map<String, UINode> windows;
+
+ /** . */
+ private final PresentationClient client;
+
+ /** . */
+ private final EventControllerContext eventControllerContext;
+
+ public StructuralPortletControllerContext(
+ PresentationClient client,
+ UINode pageNode,
+ PortletInvoker invoker)
+ {
+ Map<String, Portlet> portlets = new HashMap<String, Portlet>();
+ Map<String, UINode> windows = new HashMap<String, UINode>();
+
+ //
+ for (UINode childNode : pageNode.getChildren())
+ {
+ UIObject child = childNode.getObject();
+
+ if (child instanceof UIWindow)
+ {
+ String portletRef = child.getProperty(StateType.STRUCTURAL,
"portlet-ref", String.class);
+
+ //
+ if (portletRef != null)
+ {
+ try
+ {
+ Portlet portlet =
invoker.getPortlet(PortletContext.createPortletContext(portletRef));
+
+ //
+ portlets.put(child.getId(), portlet);
+ windows.put(child.getId(), childNode);
+ }
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ //
+ this.client = client;
+ this.pageNode = pageNode;
+ this.invoker = invoker;
+ this.stateControllerContext = new StructuralStateControllerContext(this);
+ this.portlets = portlets;
+ this.windows = windows;
+ this.eventControllerContext = new StructuralEventControllerContext(this);
+ }
+
+ public String getPageId()
+ {
+ return pageNode.getObject().getId();
+ }
+
+ public Set<String> getWindowIds()
+ {
+ return windows.keySet();
+ }
+
+ public PortletInfo getPortletInfo(String windowId)
+ {
+ return portlets.get(windowId).getInfo();
+ }
+
+ public PortletInvocationContext createPortletInvocationContext(String windowId,
PortletPageNavigationalState pageNavigationalState)
+ {
+ return new PresentationPortletInvocationContext(client, this, windowId);
+ }
+
+ public PortletInvocationResponse invoke(ActionInvocation actionInvocation) throws
PortletInvokerException
+ {
+ return invoke((PortletInvocation)actionInvocation);
+ }
+
+ public PortletInvocationResponse invoke(List<Cookie> requestCookies,
EventInvocation eventInvocation) throws PortletInvokerException
+ {
+ return invoke(eventInvocation);
+ }
+
+ public PortletInvocationResponse invoke(List<Cookie> requestCookies,
RenderInvocation renderInvocation) throws PortletInvokerException
+ {
+ return invoke(renderInvocation);
+ }
+
+ public PortletInvocationResponse invoke(ResourceInvocation resourceInvocation) throws
PortletInvokerException
+ {
+ return invoke((PortletInvocation)resourceInvocation);
+ }
+
+ private PortletInvocationResponse invoke(PortletInvocation portletInvocation) throws
PortletInvokerException
+ {
+ PresentationPortletInvocationContext ctx =
(PresentationPortletInvocationContext)portletInvocation.getContext();
+
+ //
+ UINode window = windows.get(ctx.getWindowId());
+
+ //
+ portletInvocation.setServerContext(new PresentationServerContext(client));
+ portletInvocation.setSecurityContext(new PresentationSecurityContext());
+ portletInvocation.setClientContext(new PresentationClientContext());
+ portletInvocation.setInstanceContext(new PresentationInstanceContext(window));
+ portletInvocation.setPortalContext(new PresentationPortalContext());
+ portletInvocation.setUserContext(new AbstractUserContext());
+ portletInvocation.setWindowContext(new PresentationWindowContext(window));
+
+ //
+ Portlet portlet = portlets.get(ctx.getWindowId());
+ portletInvocation.setTarget(portlet.getContext());
+
+ //
+ return invoker.invoke(portletInvocation);
+ }
+
+ public EventControllerContext getEventControllerContext()
+ {
+ return eventControllerContext;
+ }
+
+ public StateControllerContext getStateControllerContext()
+ {
+ return stateControllerContext;
+ }
+}
Added:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralPortletPageNavigationalState.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralPortletPageNavigationalState.java
(rev 0)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralPortletPageNavigationalState.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,290 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.portlet.controller;
+
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.info.ParameterInfo;
+import org.jboss.portal.portlet.info.NavigationInfo;
+import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
+import
org.jboss.portal.presentation.impl.state.navigational.DelegatingNavigationalStateContext;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+
+import javax.xml.namespace.QName;
+import java.util.Set;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class StructuralPortletPageNavigationalState implements
PortletPageNavigationalState
+{
+
+ /** . */
+ public static final int READ_ONLY_MODE = 0;
+
+ /** . */
+ public static final int READ_WRITE_MODE = 1;
+
+ /** . */
+ public static final int CLONE_AND_WRITE_MODE = 2;
+
+ /** . */
+ private final StructuralPortletControllerContext portletControllerContext;
+
+ /** . */
+ private final NavigationalStateContext navigationalStateContext;
+
+ /** . */
+ private final boolean modifiable;
+
+ public StructuralPortletPageNavigationalState(
+ StructuralPortletControllerContext portletControllerContext,
+ NavigationalStateContext navigationalStateContext,
+ int mode)
+ {
+ boolean modifiable;
+ switch (mode)
+ {
+ case READ_ONLY_MODE:
+ modifiable = false;
+ break;
+ case READ_WRITE_MODE:
+ modifiable = true;
+ break;
+ case CLONE_AND_WRITE_MODE:
+ modifiable = true;
+ navigationalStateContext = new
DelegatingNavigationalStateContext(navigationalStateContext);
+ break;
+ default:
+ throw new AssertionError();
+ }
+
+ //
+ this.portletControllerContext = portletControllerContext;
+ this.navigationalStateContext = navigationalStateContext;
+ this.modifiable = modifiable;
+ }
+
+ public StructuralPortletPageNavigationalState(
+ StructuralPortletPageNavigationalState pageNavigationalState,
+ int mode)
+ {
+ NavigationalStateContext navigationalStateContext =
pageNavigationalState.navigationalStateContext;
+ boolean modifiable;
+ switch (mode)
+ {
+ case READ_ONLY_MODE:
+ modifiable = false;
+ break;
+ case READ_WRITE_MODE:
+ modifiable = true;
+ break;
+ case CLONE_AND_WRITE_MODE:
+ modifiable = true;
+ navigationalStateContext = new
DelegatingNavigationalStateContext(navigationalStateContext);
+ break;
+ default:
+ throw new AssertionError();
+ }
+
+ //
+ this.portletControllerContext = pageNavigationalState.portletControllerContext;
+ this.navigationalStateContext = navigationalStateContext;
+ this.modifiable = modifiable;
+ }
+
+ public void flush()
+ {
+ if (navigationalStateContext instanceof DelegatingNavigationalStateContext)
+ {
+ ((DelegatingNavigationalStateContext)navigationalStateContext).flush(true);
+ }
+ }
+
+ public Set<String> getPortletWindowIds()
+ {
+ return portletControllerContext.getWindowIds();
+ }
+
+ public PortletWindowNavigationalState getPortletWindowNavigationalState(String
portletWindowId) throws IllegalArgumentException
+ {
+ Mode mode = (Mode)navigationalStateContext.getProperty(portletWindowId,
"mode");
+ WindowState windowState =
(WindowState)navigationalStateContext.getProperty(portletWindowId,
"windowstate");
+ StateString portletNavigationalState =
(StateString)navigationalStateContext.getProperty(portletWindowId, "portlet");
+ return new PortletWindowNavigationalState(portletNavigationalState, mode,
windowState);
+ }
+
+ public void setPortletWindowNavigationalState(String portletWindowId,
PortletWindowNavigationalState portletWindowState) throws IllegalArgumentException,
IllegalStateException
+ {
+ if (!modifiable)
+ {
+ throw new IllegalStateException();
+ }
+
+ //
+ navigationalStateContext.setProperty(portletWindowId, "windowstate",
portletWindowState.getWindowState());
+ navigationalStateContext.setProperty(portletWindowId, "mode",
portletWindowState.getMode());
+ navigationalStateContext.setProperty(portletWindowId, "portlet",
portletWindowState.getPortletNavigationalState());
+ }
+
+ public Map<String, String[]> getPortletPublicNavigationalState(String
portletWindowId) throws IllegalArgumentException
+ {
+ Map<QName, String[]> pageParameters = (Map<QName,
String[]>)navigationalStateContext.getProperty(portletControllerContext.getPageId(),
"portlet");
+
+ //
+ Map<String, String[]> portletParameters = null;
+
+ //
+ if (pageParameters != null)
+ {
+ NavigationInfo navigationInfo =
portletControllerContext.getPortletInfo(portletWindowId).getNavigation();
+
+ //
+ for (ParameterInfo parameterInfo : navigationInfo.getPublicParameters())
+ {
+ QName parameterName = parameterInfo.getName();
+ String[] parameterValue = pageParameters.get(parameterName);
+
+ //
+ if (parameterValue != null)
+ {
+ if (portletParameters == null)
+ {
+ portletParameters = new HashMap<String, String[]>();
+ }
+
+ //
+ portletParameters.put(parameterInfo.getId(), parameterValue);
+ }
+ }
+ }
+
+ //
+ return portletParameters;
+ }
+
+ public void setPortletPublicNavigationalState(String portletWindowId, Map<String,
String[]> update) throws IllegalArgumentException, IllegalStateException
+ {
+ if (!modifiable)
+ {
+ throw new IllegalStateException();
+ }
+
+ //
+ HashMap<QName, String[]> pageParameters = (HashMap<QName,
String[]>)navigationalStateContext.getProperty(portletControllerContext.getPageId(),
"portlet");
+
+ //
+ if (pageParameters == null)
+ {
+ pageParameters = new HashMap<QName, String[]>();
+ }
+
+ //
+ NavigationInfo navigationInfo =
portletControllerContext.getPortletInfo(portletWindowId).getNavigation();
+
+ //
+ for (Map.Entry<String, String[]> entry : update.entrySet())
+ {
+ ParameterInfo parameterInfo =
navigationInfo.getPublicParameter(entry.getKey());
+
+ //
+ QName parameterName = parameterInfo.getName();
+
+ if (entry.getValue().length == 0)
+ {
+ pageParameters.remove(parameterName);
+ }
+ else
+ {
+ pageParameters.put(parameterName, entry.getValue());
+ }
+ }
+
+ //
+ navigationalStateContext.setProperty(portletControllerContext.getPageId(),
"portlet", pageParameters);
+ }
+
+ public Set<QName> getPublicNames()
+ {
+ HashMap<QName, String[]> pageParameters = (HashMap<QName,
String[]>)navigationalStateContext.getProperty(portletControllerContext.getPageId(),
"portlet");
+
+ //
+ return pageParameters != null ? pageParameters.keySet() : null;
+ }
+
+ public String[] getPublicNavigationalState(QName name) throws
IllegalArgumentException
+ {
+ Map<QName, String[]> pageParameters = (Map<QName,
String[]>)navigationalStateContext.getProperty(portletControllerContext.getPageId(),
"portlet");
+
+ //
+ return pageParameters != null ? pageParameters.get(name) : null;
+ }
+
+ public void setPublicNavigationalState(QName name, String[] value) throws
IllegalArgumentException, IllegalStateException
+ {
+ if (!modifiable)
+ {
+ throw new IllegalStateException();
+ }
+
+ //
+ HashMap<QName, String[]> pageParameters = (HashMap<QName,
String[]>)navigationalStateContext.getProperty(portletControllerContext.getPageId(),
"portlet");
+
+ //
+ if (pageParameters == null)
+ {
+ pageParameters = new HashMap<QName, String[]>();
+ }
+
+ //
+ pageParameters.put(name, value);
+
+ //
+ navigationalStateContext.setProperty(portletControllerContext.getPageId(),
"portlet", pageParameters);
+ }
+
+ public void removePublicNavigationalState(QName name) throws IllegalArgumentException,
IllegalStateException
+ {
+ if (!modifiable)
+ {
+ throw new IllegalStateException();
+ }
+
+ //
+ HashMap<QName, String[]> pageParameters = (HashMap<QName,
String[]>)navigationalStateContext.getProperty(portletControllerContext.getPageId(),
"portlet");
+
+ //
+ if (pageParameters != null)
+ {
+ pageParameters.remove(name);
+
+ //
+ navigationalStateContext.setProperty(portletControllerContext.getPageId(),
"portlet", pageParameters);
+ }
+ }
+}
Added:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralStateControllerContext.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralStateControllerContext.java
(rev 0)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/controller/StructuralStateControllerContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.portlet.controller;
+
+import org.jboss.portal.portlet.controller.state.StateControllerContext;
+import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
+import
org.jboss.portal.presentation.impl.state.navigational.NavigationalStateContextImpl;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class StructuralStateControllerContext implements StateControllerContext
+{
+
+ /** . */
+ private StructuralPortletControllerContext portletControllerContext;
+
+ public StructuralStateControllerContext(StructuralPortletControllerContext
portletControllerContext)
+ {
+ this.portletControllerContext = portletControllerContext;
+ }
+
+ public PortletPageNavigationalState
clonePortletPageNavigationalState(PortletPageNavigationalState
portletPageNavigationalState, boolean modifiable)
+ {
+
+ return new StructuralPortletPageNavigationalState(
+ (StructuralPortletPageNavigationalState)portletPageNavigationalState,
+ modifiable ? StructuralPortletPageNavigationalState.CLONE_AND_WRITE_MODE :
StructuralPortletPageNavigationalState.READ_ONLY_MODE);
+ }
+
+ public PortletPageNavigationalState createPortletPageNavigationalState(boolean
modifiable)
+ {
+ return new StructuralPortletPageNavigationalState(
+ portletControllerContext,
+ new NavigationalStateContextImpl(),
+ modifiable ? StructuralPortletPageNavigationalState.READ_WRITE_MODE :
StructuralPortletPageNavigationalState.READ_ONLY_MODE);
+ }
+}
Added:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/protocol/PortletContainerAction.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/protocol/PortletContainerAction.java
(rev 0)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/protocol/PortletContainerAction.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,168 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.portlet.protocol;
+
+import org.jboss.portal.presentation.protocol.UIObjectCommandAction;
+import org.jboss.portal.portlet.LifeCyclePhase;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.ContainerURL;
+import org.jboss.portal.portlet.RenderURL;
+import org.jboss.portal.portlet.ActionURL;
+import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PortletContainerAction extends UIObjectCommandAction
+{
+
+ /** The portlet phase. */
+ private final LifeCyclePhase phase;
+
+ /** The navigational state. */
+ private final StateString state;
+
+ /** . */
+ private final Map<String, String[]> form;
+
+ /** . */
+ private final Mode mode;
+
+ /** . */
+ private final WindowState windowState;
+
+ /** . */
+ private final Map<String, String[]> publicNavigationalStateChanges;
+
+ private PortletContainerAction(
+ String targetId,
+ LifeCyclePhase phase,
+ StateString state,
+ Mode mode,
+ WindowState windowState,
+ Map<String, String[]> publicNavigationalStateChanges,
+ Map<String, String[]> form) throws IllegalArgumentException
+ {
+ super(targetId);
+
+ //
+ this.phase = phase;
+ this.state = state;
+ this.mode = mode;
+ this.windowState = windowState;
+ this.publicNavigationalStateChanges = publicNavigationalStateChanges;
+ this.form = form;
+ }
+
+ public LifeCyclePhase getPhase()
+ {
+ return phase;
+ }
+
+ public StateString getState()
+ {
+ return state;
+ }
+
+ public Mode getMode()
+ {
+ return mode;
+ }
+
+ public WindowState getWindowState()
+ {
+ return windowState;
+ }
+
+ public Map<String, String[]> getPublicNavigationalStateChanges()
+ {
+ return publicNavigationalStateChanges;
+ }
+
+ public Map<String, String[]> getForm()
+ {
+ return form;
+ }
+
+ public static PortletContainerAction create(String targetId, ContainerURL
containerURL)
+ {
+ if (containerURL instanceof RenderURL)
+ {
+ RenderURL renderURL = (RenderURL)containerURL;
+
+ //
+ return new PortletContainerAction(
+ targetId,
+ LifeCyclePhase.RENDER,
+ renderURL.getNavigationalState(),
+ renderURL.getMode(),
+ renderURL.getWindowState(),
+ renderURL.getPublicNavigationalStateChanges(),
+ null);
+
+ }
+ else if (containerURL instanceof ActionURL)
+ {
+ ActionURL actionURL = (ActionURL)containerURL;
+
+ //
+ return new PortletContainerAction(
+ targetId,
+ LifeCyclePhase.ACTION,
+ actionURL.getInteractionState(),
+ actionURL.getMode(),
+ actionURL.getWindowState(),
+ null,
+ null);
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+ }
+
+ public static PortletContainerAction createRender(
+ String targetId,
+ StateString navigationalState,
+ Mode mode,
+ WindowState windowState,
+ Map<String, String[]> publicNavigationalStateChanges)
+ {
+ return new PortletContainerAction(targetId, LifeCyclePhase.RENDER,
navigationalState, mode, windowState, publicNavigationalStateChanges, null);
+ }
+
+ public static PortletContainerAction createAction(
+ String targetId,
+ Mode mode,
+ WindowState windowState,
+ StateString interactionState,
+ Map<String, String[]> form)
+ {
+ return new PortletContainerAction(targetId, LifeCyclePhase.ACTION,
interactionState, mode, windowState, null, form);
+ }
+}
Added:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationClientContext.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationClientContext.java
(rev 0)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationClientContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,58 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.portlet.spi;
+
+import org.jboss.portal.common.util.MultiValuedPropertyMap;
+import org.jboss.portal.common.util.SimpleMultiValuedPropertyMap;
+import org.jboss.portal.portlet.spi.ClientContext;
+
+import javax.servlet.http.Cookie;
+import java.util.Collections;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PresentationClientContext implements ClientContext
+{
+
+ public PresentationClientContext()
+ {
+ }
+
+ public String getMethod()
+ {
+ return "GET";
+ }
+
+ public MultiValuedPropertyMap<String> getProperties()
+ {
+ return new SimpleMultiValuedPropertyMap<String>();
+ }
+
+ public List<Cookie> getCookies()
+ {
+ return Collections.emptyList();
+ }
+}
Added:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationInstanceContext.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationInstanceContext.java
(rev 0)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationInstanceContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.portlet.spi;
+
+import org.jboss.portal.portlet.StateEvent;
+import org.jboss.portal.portlet.spi.InstanceContext;
+import org.jboss.portal.portlet.state.AccessMode;
+import org.jboss.portal.presentation.model.tree.UINode;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PresentationInstanceContext implements InstanceContext
+{
+
+ /** . */
+ private final UINode window;
+
+ public PresentationInstanceContext(UINode window)
+ {
+ this.window = window;
+ }
+
+ public String getId()
+ {
+ return window.getObject().getId();
+ }
+
+ public AccessMode getAccessMode()
+ {
+ return AccessMode.READ_ONLY;
+ }
+
+ public void onStateEvent(StateEvent event)
+ {
+ throw new IllegalStateException();
+ }
+}
Added:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationPortalContext.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationPortalContext.java
(rev 0)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationPortalContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.portlet.spi;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.portlet.spi.PortalContext;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PresentationPortalContext implements PortalContext
+{
+ public String getInfo()
+ {
+ return "PresentationPortal";
+ }
+
+ public Set<WindowState> getWindowStates()
+ {
+ return Tools.toSet(WindowState.NORMAL);
+ }
+
+ public Set<Mode> getModes()
+ {
+ return Tools.toSet(Mode.VIEW);
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return Collections.emptyMap();
+ }
+}
Added:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationPortletInvocationContext.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationPortletInvocationContext.java
(rev 0)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationPortletInvocationContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,112 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.portlet.spi;
+
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
+import org.jboss.portal.portlet.ContainerURL;
+import org.jboss.portal.portlet.URLFormat;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.common.net.media.MediaType;
+import org.jboss.portal.presentation.portlet.protocol.PortletContainerAction;
+import
org.jboss.portal.presentation.portlet.controller.StructuralPortletControllerContext;
+import org.jboss.portal.presentation.client.PresentationClient;
+
+import java.io.Writer;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PresentationPortletInvocationContext implements PortletInvocationContext
+{
+
+ /** . */
+ private final MarkupInfo markup = new MarkupInfo(MediaType.TEXT_HTML,
"UTF-8");
+
+ /** . */
+ private final StructuralPortletControllerContext portletControllerContext;
+
+ /** . */
+ private final String windowId;
+
+ /** . */
+ private final PresentationClient client;
+
+ public PresentationPortletInvocationContext(
+ PresentationClient client,
+ StructuralPortletControllerContext portletControllerContext,
+ String windowId)
+ {
+ this.client = client;
+ this.portletControllerContext = portletControllerContext;
+ this.windowId = windowId;
+ }
+
+ public String getWindowId()
+ {
+ return windowId;
+ }
+
+ public MarkupInfo getMarkupInfo()
+ {
+ return markup;
+ }
+
+ public String encodeResourceURL(String url) throws IllegalArgumentException
+ {
+ return url;
+ }
+
+ public String renderURL(ContainerURL containerURL, URLFormat format)
+ {
+ PortletContainerAction action = PortletContainerAction.create(windowId,
containerURL);
+
+ //
+ String url = client.renderURL(action, null);
+
+
+// StateControllerContext stateControllerContext =
portletControllerContext.getStateControllerContext();
+// PortletPageNavigationalStateSerialization serialiation = new
PortletPageNavigationalStateSerialization(stateControllerContext);
+// ControllerRequestParameterMapFactory parameterMapFactory = new
ControllerRequestParameterMapFactory(serialiation);
+//
+// Map<String, String> parameters = parameterMapFactory.encode(null, windowId,
containerURL);
+//
+// Map<String, String[]> blah = new HashMap<String, String[]>();
+// for (Map.Entry<String, String> entry : parameters.entrySet())
+// {
+// blah.put(entry.getKey(), new String[]{entry.getValue()});
+// }
+//
+// GetActivation getActivation = new GetActivation(windowId, "/", blah);
+//
+// String url = client.renderURL(getActivation, null);
+
+ return url;
+ }
+
+ public void renderURL(Writer writer, ContainerURL containerURL, URLFormat format)
throws IOException
+ {
+ writer.write(renderURL(containerURL, format));
+ }
+}
Added:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationSecurityContext.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationSecurityContext.java
(rev 0)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationSecurityContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,64 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.portlet.spi;
+
+import org.jboss.portal.portlet.spi.SecurityContext;
+
+import java.security.Principal;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PresentationSecurityContext implements SecurityContext
+{
+ public boolean isSecure()
+ {
+ return false;
+ }
+
+ public boolean isAuthenticated()
+ {
+ return false;
+ }
+
+ public String getAuthType()
+ {
+ return null;
+ }
+
+ public String getRemoteUser()
+ {
+ return null;
+ }
+
+ public Principal getUserPrincipal()
+ {
+ return null;
+ }
+
+ public boolean isUserInRole(String roleName)
+ {
+ return false;
+ }
+}
Added:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationServerContext.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationServerContext.java
(rev 0)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationServerContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,70 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.portlet.spi;
+
+import org.jboss.portal.portlet.spi.ServerContext;
+import org.jboss.portal.presentation.client.PresentationClient;
+import org.jboss.portal.web.RequestDispatchCallback;
+import org.jboss.portal.web.ServletContainer;
+import org.jboss.portal.web.ServletContextDispatcher;
+
+import javax.servlet.ServletContext;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PresentationServerContext implements ServerContext
+{
+
+ /** . */
+ private final PresentationClient presentationClient;
+
+ public PresentationServerContext(PresentationClient presentationClient)
+ {
+ this.presentationClient = presentationClient;
+ }
+
+ public String getScheme()
+ {
+ return "http";
+ }
+
+ public String getServerName()
+ {
+ return "localhost";
+ }
+
+ public int getServerPort()
+ {
+ return 8080;
+ }
+
+ public Object dispatch(ServletContainer servletContainer, ServletContext
targetServletContext, RequestDispatchCallback callback, Object handback) throws Exception
+ {
+ ServletContextDispatcher dispatcher = presentationClient.getDispatcher();
+
+ //
+ return dispatcher.include(targetServletContext, callback, handback);
+ }
+}
Added:
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationWindowContext.java
===================================================================
---
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationWindowContext.java
(rev 0)
+++
modules/presentation/trunk/portlet/src/main/java/org/jboss/portal/presentation/portlet/spi/PresentationWindowContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,47 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.portlet.spi;
+
+import org.jboss.portal.portlet.spi.WindowContext;
+import org.jboss.portal.presentation.model.tree.UINode;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PresentationWindowContext implements WindowContext
+{
+
+ /** . */
+ private final UINode window;
+
+ public PresentationWindowContext(UINode window)
+ {
+ this.window = window;
+ }
+
+ public String getId()
+ {
+ return window.getObject().getId();
+ }
+}
Modified: modules/presentation/trunk/presentation/pom.xml
===================================================================
--- modules/presentation/trunk/presentation/pom.xml 2008-04-28 10:07:59 UTC (rev 10722)
+++ modules/presentation/trunk/presentation/pom.xml 2008-04-28 10:47:59 UTC (rev 10723)
@@ -22,12 +22,12 @@
<artifactId>common-common</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet-portlet</artifactId>
+ <groupId>org.jboss.portal.common</groupId>
+ <artifactId>common-portal</artifactId>
</dependency>
<dependency>
- <groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet-controller</artifactId>
+ <groupId>org.jboss.portal.web</groupId>
+ <artifactId>web-web</artifactId>
</dependency>
</dependencies>
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/PresentationClient.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/PresentationClient.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/client/PresentationClient.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -22,10 +22,10 @@
******************************************************************************/
package org.jboss.portal.presentation.client;
-import org.jboss.portal.portlet.URLFormat;
import org.jboss.portal.presentation.protocol.ProtocolAction;
import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.common.servlet.URLFormat;
import java.io.IOException;
import java.io.Writer;
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateDiffPhase.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -28,6 +28,7 @@
import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
import org.jboss.portal.presentation.state.structural.StructuralObject;
import org.jboss.portal.presentation.state.structural.StructuralStateContext;
+import org.jboss.portal.presentation.impl.model.ui.UIObjectImpl;
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
@@ -111,7 +112,7 @@
case SINGLE:
return new ObjectVisit(object, true);
case RECURSIVE:
- StructuralObject.Refresh refresh =
structuralStateContext.refresh(object.structuralObject);
+ StructuralObject.Refresh refresh =
structuralStateContext.refresh(object.getStructuralObject());
ChildrenVisit childrenVisit = new ChildrenVisit();
//
@@ -152,7 +153,7 @@
private ObjectVisit load(StructuralObject structuralObject)
{
- UIObjectImpl object = UIObjectImpl.create(navigationalStateContext,
structuralObject);
+ UIObjectImpl object = UIObjectImpl.create(structuralObject, new
InternalObjectContext(navigationalStateContext));
//
ObjectTraversalType traversalType = scope.enterObject(object);
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/CreateUpdatePhase.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -23,6 +23,7 @@
package org.jboss.portal.presentation.impl.model;
import org.jboss.portal.presentation.model.ViewPortContext;
+import org.jboss.portal.presentation.impl.model.ui.UIObjectImpl;
import java.util.ArrayList;
import java.util.HashMap;
@@ -207,7 +208,7 @@
if (object != null)
{
return new ObjectUpdate.UpdateObject(
- object.structuralObject,
+ object.getStructuralObject(),
childrenStatus,
addedChildrenUpdates,
removedChildrenUpdates,
@@ -230,9 +231,12 @@
List<ObjectUpdate.RemoveChild> removedChildrenUpdates = new
ArrayList<ObjectUpdate.RemoveChild>();
//
- if (object.childRefs != null)
+ InternalObjectContext objectContext =
(InternalObjectContext)object.getContext();
+
+ //
+ if (objectContext.childRefs != null)
{
- for (UIObjectRef removedChildRef : object.childRefs.values())
+ for (UIObjectRef removedChildRef : objectContext.childRefs.values())
{
if (removedChildRef.loaded)
{
@@ -251,7 +255,7 @@
}
//
- return new ObjectUpdate.UpdateObject(object.structuralObject,
removedChildrenUpdates);
+ return new ObjectUpdate.UpdateObject(object.getStructuralObject(),
removedChildrenUpdates);
}
else
{
@@ -277,9 +281,12 @@
List<ObjectUpdate.RemoveObject> removedChildrenUpdates = new
ArrayList<ObjectUpdate.RemoveObject>();
//
- if (object.childRefs != null)
+ InternalObjectContext objectContext = (InternalObjectContext)object.getContext();
+
+ //
+ if (objectContext.childRefs != null)
{
- for (UIObjectRef removedChildRef : object.childRefs.values())
+ for (UIObjectRef removedChildRef : objectContext.childRefs.values())
{
if (removedChildRef.loaded)
{
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/InternalObjectContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/InternalObjectContext.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/InternalObjectContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,51 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.impl.model;
+
+import org.jboss.portal.presentation.impl.model.ui.UIObjectContext;
+import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+class InternalObjectContext implements UIObjectContext
+{
+
+ /** We keep track of what was loaded by the scope. */
+ Map<String, UIObjectRef> childRefs;
+
+ final NavigationalStateContext navigationalStateContext;
+
+ InternalObjectContext(NavigationalStateContext navigationalStateContext)
+ {
+ this.navigationalStateContext = navigationalStateContext;
+ }
+
+ public NavigationalStateContext getNavigationalStateContext()
+ {
+ return navigationalStateContext;
+ }
+}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectUpdate.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectUpdate.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectUpdate.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -24,6 +24,7 @@
import org.jboss.portal.presentation.model.ViewPortContext;
import org.jboss.portal.presentation.state.structural.StructuralObject;
+import org.jboss.portal.presentation.impl.model.ui.UIObjectImpl;
import java.util.HashMap;
import java.util.List;
@@ -122,21 +123,24 @@
}
// Perform state update
- if (object.structuralObject.equals(structuralObject))
+ if (object.getStructuralObject().equals(structuralObject))
{
- object.structuralObject = structuralObject;
+ object.setStructuralObject(structuralObject);
context.updateObject(structuralObject.getId());
}
//
+ InternalObjectContext objectContext =
(InternalObjectContext)object.getContext();
+
+ //
if (childrenStatus != null)
{
- if (object.childRefs == null)
+ if (objectContext.childRefs == null)
{
- object.childRefs = new HashMap<String, UIObjectRef>();
+ objectContext.childRefs = new HashMap<String, UIObjectRef>();
for (Map.Entry<String, Boolean> childRefEntry :
childrenStatus.entrySet())
{
- object.childRefs.put(childRefEntry.getKey(), new
UIObjectRef(childRefEntry.getKey(), childRefEntry.getValue()));
+ objectContext.childRefs.put(childRefEntry.getKey(), new
UIObjectRef(childRefEntry.getKey(), childRefEntry.getValue()));
}
//
@@ -157,7 +161,7 @@
}
else
{
- if (object.childRefs != null)
+ if (objectContext.childRefs != null)
{
context.destroyChildren(structuralObject.getId());
}
@@ -238,10 +242,13 @@
//
if (childrenStatus != null)
{
- object.childRefs = new HashMap<String, UIObjectRef>();
+ InternalObjectContext objectContext =
(InternalObjectContext)object.getContext();
+
+ //
+ objectContext.childRefs = new HashMap<String, UIObjectRef>();
for (Map.Entry<String, Boolean> childRefEntry :
childrenStatus.entrySet())
{
- object.childRefs.put(childRefEntry.getKey(), new
UIObjectRef(childRefEntry.getKey(), childRefEntry.getValue()));
+ objectContext.childRefs.put(childRefEntry.getKey(), new
UIObjectRef(childRefEntry.getKey(), childRefEntry.getValue()));
}
//
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ObjectVisit.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -22,6 +22,8 @@
******************************************************************************/
package org.jboss.portal.presentation.impl.model;
+import org.jboss.portal.presentation.impl.model.ui.UIObjectImpl;
+
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UIObjectImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UIObjectImpl.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UIObjectImpl.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,148 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.impl.model;
-
-import org.jboss.portal.common.NotYetImplemented;
-import org.jboss.portal.common.reflect.Reflection;
-import org.jboss.portal.presentation.impl.model.ui.UIContextImpl;
-import org.jboss.portal.presentation.impl.model.ui.UIPageImpl;
-import org.jboss.portal.presentation.impl.model.ui.UIWindowImpl;
-import org.jboss.portal.presentation.model.UIObject;
-import org.jboss.portal.presentation.model.ui.UIContext;
-import org.jboss.portal.presentation.model.ui.UIPage;
-import org.jboss.portal.presentation.model.ui.UIWindow;
-import org.jboss.portal.presentation.state.StateException;
-import org.jboss.portal.presentation.state.StateType;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
-import org.jboss.portal.presentation.state.structural.StructuralObject;
-
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public abstract class UIObjectImpl implements UIObject
-{
-
- /** . */
- private final NavigationalStateContext navigationalStateContext;
-
- /** . */
- StructuralObject structuralObject;
-
- /** We keep track of what was loaded by the scope. */
- Map<String, UIObjectRef> childRefs;
-
- public static UIObjectImpl create(NavigationalStateContext navigationalStateContext,
StructuralObject structuralObject)
- {
- UIObjectImpl object;
-
- //
- Class type = structuralObject.getState().getType();
-
- //
- if (type == UIWindow.class)
- {
- object = new UIWindowImpl(navigationalStateContext, structuralObject);
- }
- else if (type == UIPage.class)
- {
- object = new UIPageImpl(navigationalStateContext, structuralObject);
- }
- else if (type == UIContext.class)
- {
- object = new UIContextImpl(navigationalStateContext, structuralObject);
- }
- else
- {
- throw new NotYetImplemented();
- }
-
- //
- return object;
- }
-
- public UIObjectImpl(NavigationalStateContext navigationalStateContext,
StructuralObject structuralObject)
- {
- this.navigationalStateContext = navigationalStateContext;
- this.structuralObject = structuralObject;
- }
-
- public String getId()
- {
- return structuralObject.getId();
- }
-
- public String getName()
- {
- return structuralObject.getState().getName();
- }
-
- public <T> T getProperty(StateType stateType, String propertyName,
Class<T> propertyType) throws IllegalArgumentException, StateException
- {
- if (stateType == null)
- {
- throw new IllegalArgumentException();
- }
- if (propertyName == null)
- {
- throw new IllegalArgumentException();
- }
- if (propertyType == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- switch (stateType)
- {
- case STRUCTURAL:
- return
Reflection.safeCast(structuralObject.getState().getProperties().get(propertyName),
propertyType);
- case NAVIGATIONAL:
- return
Reflection.safeCast(navigationalStateContext.getProperty(structuralObject.getId(),
propertyName), propertyType);
- default:
- throw new AssertionError();
- }
- }
-
- public Set<String> getPropertyNames(StateType stateType)
- {
- if (stateType == null)
- {
- throw new IllegalArgumentException();
- }
-
- //
- switch (stateType)
- {
- case STRUCTURAL:
- return structuralObject.getState().getProperties().keySet();
- case NAVIGATIONAL:
- return navigationalStateContext.getPropertyNames(structuralObject.getId());
- default:
- throw new AssertionError();
- }
- }
-}
\ No newline at end of file
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeFactory.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.impl.model.tree;
+
+import org.jboss.portal.presentation.model.tree.UINode;
+import org.jboss.portal.presentation.state.structural.StructuralStateContext;
+import org.jboss.portal.presentation.state.structural.StructuralObject;
+import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class UINodeFactory
+{
+
+ /**
+ * Creates a user interface node.
+ *
+ * @param navigationalStateContext the navigational state context
+ * @param structuralStateContext the structural state context
+ * @param objectId the object id
+ * @return the corresponding node
+ */
+ public static UINode createNode(
+ NavigationalStateContext navigationalStateContext,
+ StructuralStateContext structuralStateContext,
+ String objectId)
+ {
+ StructuralObject object = structuralStateContext.load(objectId);
+
+ //
+ if (object != null)
+ {
+ return new UINodeImpl(navigationalStateContext, structuralStateContext,
object);
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/tree/UINodeImpl.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,164 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.impl.model.tree;
+
+import org.jboss.portal.presentation.model.tree.UINode;
+import org.jboss.portal.presentation.model.UIObject;
+import org.jboss.portal.presentation.state.structural.StructuralObject;
+import org.jboss.portal.presentation.state.structural.StructuralStateContext;
+import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
+import org.jboss.portal.presentation.impl.model.ui.UIObjectContext;
+import org.jboss.portal.presentation.impl.model.ui.UIObjectImpl;
+
+import java.util.Collection;
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+class UINodeImpl implements UINode, UIObjectContext
+{
+
+ /** . */
+ private final NavigationalStateContext navigationalStateContext;
+
+ /** . */
+ private final StructuralStateContext structuralStateContext;
+
+ /** . */
+ private final StructuralObject structuralObject;
+
+ /** . */
+ private Collection<UINode> children;
+
+ /** . */
+ private UINode parent;
+
+ /** . */
+ private boolean parentVisited;
+
+ /** . */
+ private UIObject object;
+
+ UINodeImpl(NavigationalStateContext navigationalStateContext, StructuralStateContext
structuralStateContext, StructuralObject structuralObject)
+ {
+ this.navigationalStateContext = navigationalStateContext;
+ this.structuralStateContext = structuralStateContext;
+ this.structuralObject = structuralObject;
+ this.children = null;
+ this.parentVisited = false;
+ }
+
+ private UINodeImpl(NavigationalStateContext navigationalStateContext,
StructuralStateContext structuralStateContext, StructuralObject structuralObject,
Collection<UINode> children)
+ {
+ this.navigationalStateContext = navigationalStateContext;
+ this.structuralStateContext = structuralStateContext;
+ this.structuralObject = structuralObject;
+ this.children = children;
+ this.parentVisited = true;
+ }
+
+ public UIObject getObject()
+ {
+ if (object == null)
+ {
+ object = UIObjectImpl.create(structuralObject, this);
+ }
+
+ //
+ return object;
+ }
+
+ public UINode getParent()
+ {
+ if (!parentVisited)
+ {
+ StructuralObject parentObject =
structuralStateContext.loadParent(structuralObject);
+
+ //
+ if (parentObject != null)
+ {
+ Collection<StructuralObject> siblingObjects =
structuralStateContext.loadChildren(parentObject);
+ ArrayList<UINode> siblings = new
ArrayList<UINode>(siblingObjects.size());
+ for (StructuralObject siblingObject : siblingObjects)
+ {
+ UINodeImpl sibling;
+ if (siblingObject.getId().equals(structuralObject.getId()))
+ {
+ sibling = this;
+ }
+ else
+ {
+ sibling = new UINodeImpl(navigationalStateContext,
structuralStateContext, siblingObject);
+ sibling.parent = this;
+ sibling.parentVisited = true;
+ }
+
+ //
+ siblings.add(sibling);
+ }
+
+ //
+ parent = new UINodeImpl(navigationalStateContext, structuralStateContext,
parentObject, siblings);
+ }
+
+ //
+ parentVisited = true;
+ }
+
+ //
+ return parent;
+ }
+
+ public Collection<UINode> getChildren()
+ {
+ if (children == null)
+ {
+ Collection<StructuralObject> childrenObject =
structuralStateContext.loadChildren(structuralObject);
+ ArrayList<UINode> children = new
ArrayList<UINode>(childrenObject.size());
+ for (StructuralObject childObject : childrenObject)
+ {
+ UINodeImpl child = new UINodeImpl(navigationalStateContext,
structuralStateContext, childObject);
+ child.parent = this;
+ child.parentVisited = true;
+
+ //
+ children.add(child);
+ }
+
+ //
+ this.children = children;
+ }
+
+ //
+ return children;
+ }
+
+ // UIObjectContext implementation
***********************************************************************************
+
+ public NavigationalStateContext getNavigationalStateContext()
+ {
+ return navigationalStateContext;
+ }
+}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIContextImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIContextImpl.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIContextImpl.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -22,9 +22,7 @@
******************************************************************************/
package org.jboss.portal.presentation.impl.model.ui;
-import org.jboss.portal.presentation.impl.model.UIObjectImpl;
import org.jboss.portal.presentation.model.ui.UIContext;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
import org.jboss.portal.presentation.state.structural.StructuralObject;
/**
@@ -33,8 +31,10 @@
*/
public class UIContextImpl extends UIObjectImpl implements UIContext
{
- public UIContextImpl(NavigationalStateContext navigationalStateContext,
StructuralObject structuralObject)
+ public UIContextImpl(
+ StructuralObject structuralObject,
+ UIObjectContext context)
{
- super(navigationalStateContext, structuralObject);
+ super(structuralObject, context);
}
}
\ No newline at end of file
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectContext.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,38 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.impl.model.ui;
+
+import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
+
+/**
+ * Just some context data for a uiobject that can be used by different concerns.
+ *
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface UIObjectContext
+{
+
+ NavigationalStateContext getNavigationalStateContext();
+
+}
Copied:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java
(from rev 10714,
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/UIObjectImpl.java)
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIObjectImpl.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,167 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.impl.model.ui;
+
+import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.common.reflect.Reflection;
+import org.jboss.portal.presentation.model.UIObject;
+import org.jboss.portal.presentation.model.ui.UIContext;
+import org.jboss.portal.presentation.model.ui.UIPage;
+import org.jboss.portal.presentation.model.ui.UIWindow;
+import org.jboss.portal.presentation.state.StateException;
+import org.jboss.portal.presentation.state.StateType;
+import org.jboss.portal.presentation.state.structural.StructuralObject;
+
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public abstract class UIObjectImpl implements UIObject
+{
+
+ /** . */
+ private final UIObjectContext context;
+
+ /** . */
+ private StructuralObject structuralObject;
+
+ public static UIObjectImpl create(
+ StructuralObject structuralObject,
+ UIObjectContext objectContext)
+ {
+ UIObjectImpl object;
+
+ //
+ Class type = structuralObject.getState().getType();
+
+ //
+ if (type == UIWindow.class)
+ {
+ object = new UIWindowImpl(structuralObject, objectContext);
+ }
+ else if (type == UIPage.class)
+ {
+ object = new UIPageImpl(structuralObject, objectContext);
+ }
+ else if (type == UIContext.class)
+ {
+ object = new UIContextImpl(structuralObject, objectContext);
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+
+ //
+ return object;
+ }
+
+ public UIObjectImpl(
+ StructuralObject structuralObject,
+ UIObjectContext context)
+ {
+ this.structuralObject = structuralObject;
+ this.context = context;
+ }
+
+ public String getId()
+ {
+ return structuralObject.getId();
+ }
+
+ public String getName()
+ {
+ return structuralObject.getState().getName();
+ }
+
+ public <T> T getProperty(StateType stateType, String propertyName,
Class<T> propertyType) throws IllegalArgumentException, StateException
+ {
+ if (stateType == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (propertyName == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ if (propertyType == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ switch (stateType)
+ {
+ case STRUCTURAL:
+ return
Reflection.safeCast(structuralObject.getState().getProperties().get(propertyName),
propertyType);
+ case NAVIGATIONAL:
+ return
Reflection.safeCast(context.getNavigationalStateContext().getProperty(getStructuralObject().getId(),
propertyName), propertyType);
+ default:
+ throw new AssertionError();
+ }
+ }
+
+ public Set<String> getPropertyNames(StateType stateType)
+ {
+ if (stateType == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ switch (stateType)
+ {
+ case STRUCTURAL:
+ return structuralObject.getState().getProperties().keySet();
+ case NAVIGATIONAL:
+ return
context.getNavigationalStateContext().getPropertyNames(structuralObject.getId());
+ default:
+ throw new AssertionError();
+ }
+ }
+
+ public StructuralObject getStructuralObject()
+ {
+ return structuralObject;
+ }
+
+ public void setStructuralObject(StructuralObject structuralObject)
+ {
+ if
(!structuralObject.getState().getType().equals(this.structuralObject.getState().getType()))
+ {
+ // It means that actually we should not update the state but rather recreate the
node in the
+ // view port, we need to think about what to do when this happens
+ throw new NotYetImplemented();
+ }
+
+ //
+ this.structuralObject = structuralObject;
+ }
+
+ public UIObjectContext getContext()
+ {
+ return context;
+ }
+}
\ No newline at end of file
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPageImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPageImpl.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIPageImpl.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -22,9 +22,7 @@
******************************************************************************/
package org.jboss.portal.presentation.impl.model.ui;
-import org.jboss.portal.presentation.impl.model.UIObjectImpl;
import org.jboss.portal.presentation.model.ui.UIPage;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
import org.jboss.portal.presentation.state.structural.StructuralObject;
/**
@@ -33,8 +31,10 @@
*/
public class UIPageImpl extends UIObjectImpl implements UIPage
{
- public UIPageImpl(NavigationalStateContext navigationalStateContext, StructuralObject
structuralObject)
+ public UIPageImpl(
+ StructuralObject structuralObject,
+ UIObjectContext context)
{
- super(navigationalStateContext, structuralObject);
+ super(structuralObject, context);
}
}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIWindowImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIWindowImpl.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/model/ui/UIWindowImpl.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -24,10 +24,8 @@
import org.jboss.portal.Mode;
import org.jboss.portal.WindowState;
-import org.jboss.portal.presentation.impl.model.UIObjectImpl;
import org.jboss.portal.presentation.model.ui.UIWindow;
import org.jboss.portal.presentation.state.StateType;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
import org.jboss.portal.presentation.state.structural.StructuralObject;
/**
@@ -37,9 +35,11 @@
public class UIWindowImpl extends UIObjectImpl implements UIWindow
{
- public UIWindowImpl(NavigationalStateContext navigationalStateContext,
StructuralObject structuralObject)
+ public UIWindowImpl(
+ StructuralObject structuralObject,
+ UIObjectContext context)
{
- super(navigationalStateContext, structuralObject);
+ super(structuralObject, context);
}
public WindowState getWindowState()
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/PresentationServerImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/PresentationServerImpl.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/PresentationServerImpl.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -25,11 +25,6 @@
import org.jboss.portal.presentation.client.PresentationClient;
import org.jboss.portal.presentation.impl.state.structural.StructuralNode;
import org.jboss.portal.presentation.impl.state.structural.StructuralStateContextImpl;
-import org.jboss.portal.presentation.impl.state.structural.WindowNode;
-import org.jboss.portal.presentation.impl.state.structural.PageNode;
-import
org.jboss.portal.presentation.impl.server.portlet.StructuralPortletControllerContext;
-import org.jboss.portal.presentation.impl.server.portlet.PortletContainerAction;
-import
org.jboss.portal.presentation.impl.server.portlet.StructuralPortletPageNavigationalState;
import org.jboss.portal.presentation.model.content.WindowContent;
import org.jboss.portal.presentation.protocol.ErrorResponse;
import org.jboss.portal.presentation.protocol.ProtocolAction;
@@ -42,19 +37,6 @@
import org.jboss.portal.presentation.server.PresentationServer;
import org.jboss.portal.presentation.server.PresentationServerException;
import org.jboss.portal.presentation.state.structural.StructuralStateContext;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.controller.request.ControllerRequest;
-import org.jboss.portal.portlet.controller.request.PortletActionRequest;
-import org.jboss.portal.portlet.controller.request.PortletRenderRequest;
-import org.jboss.portal.portlet.controller.PortletController;
-import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
-import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
-import org.jboss.portal.portlet.controller.response.ControllerResponse;
-import org.jboss.portal.portlet.controller.response.PageUpdateResponse;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.invocation.response.FragmentResponse;
import org.jboss.portal.common.NotYetImplemented;
/**
@@ -67,13 +49,9 @@
/** . */
private StructuralStateContextImpl structuralStateContext;
- /** . */
- private PortletInvoker portletInvoker;
-
- public PresentationServerImpl(StructuralStateContextImpl structuralStateContext,
PortletInvoker portletInvoker)
+ public PresentationServerImpl(StructuralStateContextImpl structuralStateContext)
{
this.structuralStateContext = structuralStateContext;
- this.portletInvoker = portletInvoker;
}
public StructuralStateContext getStructuralStateContext()
@@ -81,52 +59,9 @@
return structuralStateContext;
}
- public String render(ProtocolAction action) throws IllegalArgumentException
- {
- throw new UnsupportedOperationException();
- }
-
public WindowContent renderWindow(PresentationClient client, String windowId) throws
PresentationServerException
{
- try
- {
- WindowNode window = (WindowNode)structuralStateContext.getNode(windowId);
-
- //
- PageNode page = (PageNode)window.getParent();
-
- //
- PortletController controller = new PortletController();
-
- //
- StructuralPortletControllerContext portletControllerContext = new
StructuralPortletControllerContext(
- client,
- page,
- portletInvoker);
-
- //
- StructuralPortletPageNavigationalState pageNavigationalState = new
StructuralPortletPageNavigationalState(
- portletControllerContext,
- client.getNavigationalStateContext(),
- StructuralPortletPageNavigationalState.READ_ONLY_MODE);
-
- PortletInvocationResponse response = controller.render(portletControllerContext,
null, pageNavigationalState, windowId);
-
- //
- if (response instanceof FragmentResponse)
- {
- FragmentResponse fragment = (FragmentResponse)response;
- return new WindowContent(0, fragment.getTitle(), fragment.getContent());
- }
- else
- {
- return new WindowContent(0, "Unexpected response for window " +
windowId, "");
- }
- }
- catch (PortletInvokerException e)
- {
- throw new PresentationServerException(e);
- }
+ throw new PresentationServerException();
}
public PresentationResponse process(PresentationClient client, PresentationRequest
request) throws PresentationServerException
@@ -158,87 +93,6 @@
{
throw new NotYetImplemented();
}
- else if (objectAction instanceof PortletContainerAction)
- {
- PortletContainerAction pcAction = (PortletContainerAction)objectAction;
-
- //
- WindowNode targetWindow = (WindowNode)targetNode;
-
- //
- PageNode targetPage = (PageNode)targetWindow.getParent();
-
- //
- StructuralPortletControllerContext portletControllerContext = new
StructuralPortletControllerContext(
- client,
- targetPage,
- portletInvoker);
-
- StructuralPortletPageNavigationalState pageNavigationalState = new
StructuralPortletPageNavigationalState(
- portletControllerContext,
- client.getNavigationalStateContext(),
- StructuralPortletPageNavigationalState.CLONE_AND_WRITE_MODE);
-
- //
- ControllerRequest controllerRequest;
- switch (pcAction.getPhase())
- {
- case ACTION:
- controllerRequest = new PortletActionRequest(
- targetWindow.getId(),
- pcAction.getState(),
- pcAction.getForm(),
-
pageNavigationalState.getPortletWindowNavigationalState(targetWindow.getId()),
- pageNavigationalState
- );
- break;
- case RENDER:
- PortletWindowNavigationalState windowNavigationalState = new
PortletWindowNavigationalState(
- pcAction.getState(),
- pcAction.getMode(),
- pcAction.getWindowState()
- );
- controllerRequest = new PortletRenderRequest(
- targetWindow.getId(),
- windowNavigationalState,
- null,
- pageNavigationalState
- );
- break;
- default:
- throw new NotYetImplemented();
- }
-
- //
- PortletController controller = new PortletController();
-
- //
- try
- {
- ControllerResponse response = controller.process(portletControllerContext,
controllerRequest);
-
- if (response instanceof PageUpdateResponse)
- {
- PageUpdateResponse pageUpdate = (PageUpdateResponse)response;
-
- //
- NavigationalStateContext nsc = client.getNavigationalStateContext();
-
- //
- StructuralPortletPageNavigationalState blah =
(StructuralPortletPageNavigationalState)pageUpdate.getPageNavigationalState();
-
- //
- blah.flush();
- }
- }
- catch (PortletInvokerException e)
- {
- e.printStackTrace();
- }
-
- //
- return new PresentationResponse(new
ShowUIObjectResponse(targetPage.getId()));
- }
}
//
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/PortletContainerAction.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/PortletContainerAction.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/PortletContainerAction.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,168 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.impl.server.portlet;
-
-import org.jboss.portal.presentation.protocol.UIObjectCommandAction;
-import org.jboss.portal.portlet.LifeCyclePhase;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.ContainerURL;
-import org.jboss.portal.portlet.RenderURL;
-import org.jboss.portal.portlet.ActionURL;
-import org.jboss.portal.common.NotYetImplemented;
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-
-import java.util.Map;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class PortletContainerAction extends UIObjectCommandAction
-{
-
- /** The portlet phase. */
- private final LifeCyclePhase phase;
-
- /** The navigational state. */
- private final StateString state;
-
- /** . */
- private final Map<String, String[]> form;
-
- /** . */
- private final Mode mode;
-
- /** . */
- private final WindowState windowState;
-
- /** . */
- private final Map<String, String[]> publicNavigationalStateChanges;
-
- private PortletContainerAction(
- String targetId,
- LifeCyclePhase phase,
- StateString state,
- Mode mode,
- WindowState windowState,
- Map<String, String[]> publicNavigationalStateChanges,
- Map<String, String[]> form) throws IllegalArgumentException
- {
- super(targetId);
-
- //
- this.phase = phase;
- this.state = state;
- this.mode = mode;
- this.windowState = windowState;
- this.publicNavigationalStateChanges = publicNavigationalStateChanges;
- this.form = form;
- }
-
- public LifeCyclePhase getPhase()
- {
- return phase;
- }
-
- public StateString getState()
- {
- return state;
- }
-
- public Mode getMode()
- {
- return mode;
- }
-
- public WindowState getWindowState()
- {
- return windowState;
- }
-
- public Map<String, String[]> getPublicNavigationalStateChanges()
- {
- return publicNavigationalStateChanges;
- }
-
- public Map<String, String[]> getForm()
- {
- return form;
- }
-
- public static PortletContainerAction create(String targetId, ContainerURL
containerURL)
- {
- if (containerURL instanceof RenderURL)
- {
- RenderURL renderURL = (RenderURL)containerURL;
-
- //
- return new PortletContainerAction(
- targetId,
- LifeCyclePhase.RENDER,
- renderURL.getNavigationalState(),
- renderURL.getMode(),
- renderURL.getWindowState(),
- renderURL.getPublicNavigationalStateChanges(),
- null);
-
- }
- else if (containerURL instanceof ActionURL)
- {
- ActionURL actionURL = (ActionURL)containerURL;
-
- //
- return new PortletContainerAction(
- targetId,
- LifeCyclePhase.ACTION,
- actionURL.getInteractionState(),
- actionURL.getMode(),
- actionURL.getWindowState(),
- null,
- null);
- }
- else
- {
- throw new NotYetImplemented();
- }
- }
-
- public static PortletContainerAction createRender(
- String targetId,
- StateString navigationalState,
- Mode mode,
- WindowState windowState,
- Map<String, String[]> publicNavigationalStateChanges)
- {
- return new PortletContainerAction(targetId, LifeCyclePhase.RENDER,
navigationalState, mode, windowState, publicNavigationalStateChanges, null);
- }
-
- public static PortletContainerAction createAction(
- String targetId,
- Mode mode,
- WindowState windowState,
- StateString interactionState,
- Map<String, String[]> form)
- {
- return new PortletContainerAction(targetId, LifeCyclePhase.ACTION,
interactionState, mode, windowState, null, form);
- }
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralEventControllerContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralEventControllerContext.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralEventControllerContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,70 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.impl.server.portlet;
-
-import org.jboss.portal.portlet.controller.event.EventControllerContext;
-import org.jboss.portal.portlet.controller.event.EventPhaseContext;
-import org.jboss.portal.portlet.controller.event.PortletWindowEvent;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.info.PortletInfo;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class StructuralEventControllerContext implements EventControllerContext
-{
-
- /** . */
- private final StructuralPortletControllerContext portletControllerContext;
-
- public StructuralEventControllerContext(StructuralPortletControllerContext
portletControllerContext)
- {
- this.portletControllerContext = portletControllerContext;
- }
-
- public void eventProduced(EventPhaseContext context, PortletWindowEvent producedEvent,
PortletWindowEvent sourceEvent)
- {
- for (String windowId : portletControllerContext.getWindowIds())
- {
- PortletInfo portletInfo = portletControllerContext.getPortletInfo(windowId);
- if
(portletInfo.getEventing().getConsumedEvents().containsKey(producedEvent.getName()))
- {
- PortletWindowEvent distributedEvent = new
PortletWindowEvent(producedEvent.getName(), producedEvent.getPayload(), windowId);
- context.queueEvent(distributedEvent);
- }
- }
- }
-
- public void eventConsumed(EventPhaseContext context, PortletWindowEvent consumedEvent,
PortletInvocationResponse consumerResponse)
- {
- }
-
- public void eventFailed(EventPhaseContext context, PortletWindowEvent failedEvent,
Throwable throwable)
- {
- }
-
- public void eventDiscarded(EventPhaseContext context, PortletWindowEvent
discardedEvent, int cause)
- {
- }
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralPortletControllerContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralPortletControllerContext.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralPortletControllerContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,205 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.impl.server.portlet;
-
-import org.jboss.portal.portlet.PortletInvoker;
-import org.jboss.portal.portlet.PortletInvokerException;
-import org.jboss.portal.portlet.PortletContext;
-import org.jboss.portal.portlet.Portlet;
-import org.jboss.portal.portlet.impl.spi.AbstractUserContext;
-import org.jboss.portal.portlet.controller.PortletControllerContext;
-import org.jboss.portal.portlet.controller.event.EventControllerContext;
-import org.jboss.portal.portlet.controller.state.StateControllerContext;
-import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
-import org.jboss.portal.portlet.info.PortletInfo;
-import org.jboss.portal.portlet.invocation.ActionInvocation;
-import org.jboss.portal.portlet.invocation.EventInvocation;
-import org.jboss.portal.portlet.invocation.ResourceInvocation;
-import org.jboss.portal.portlet.invocation.RenderInvocation;
-import org.jboss.portal.portlet.invocation.PortletInvocation;
-import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
-import org.jboss.portal.portlet.spi.PortletInvocationContext;
-import org.jboss.portal.presentation.impl.state.structural.PageNode;
-import org.jboss.portal.presentation.impl.state.structural.StructuralNode;
-import org.jboss.portal.presentation.impl.state.structural.WindowNode;
-import
org.jboss.portal.presentation.impl.server.portlet.spi.PresentationPortletInvocationContext;
-import org.jboss.portal.presentation.impl.server.portlet.spi.PresentationServerContext;
-import org.jboss.portal.presentation.impl.server.portlet.spi.PresentationWindowContext;
-import
org.jboss.portal.presentation.impl.server.portlet.spi.PresentationInstanceContext;
-import org.jboss.portal.presentation.impl.server.portlet.spi.PresentationClientContext;
-import org.jboss.portal.presentation.impl.server.portlet.spi.PresentationPortalContext;
-import
org.jboss.portal.presentation.impl.server.portlet.spi.PresentationSecurityContext;
-import org.jboss.portal.presentation.client.PresentationClient;
-
-import javax.servlet.http.Cookie;
-import java.util.List;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class StructuralPortletControllerContext implements PortletControllerContext
-{
-
- /** . */
- private final PageNode page;
-
- /** . */
- private final PortletInvoker invoker;
-
- /** . */
- private final StateControllerContext stateControllerContext;
-
- /** A map of window ids to portlets. */
- private final Map<String, Portlet> portlets;
-
- /** A map of window ids to windows. */
- private final Map<String, WindowNode> windows;
-
- /** . */
- private final PresentationClient client;
-
- /** . */
- private final EventControllerContext eventControllerContext;
-
- public StructuralPortletControllerContext(
- PresentationClient client,
- PageNode page,
- PortletInvoker invoker)
- {
- Map<String, Portlet> portlets = new HashMap<String, Portlet>();
- Map<String, WindowNode> windows = new HashMap<String, WindowNode>();
-
- //
- for (StructuralNode child : page.getChildren())
- {
- if (child instanceof WindowNode)
- {
- String portletRef = child.getProperty("portlet-ref");
-
- //
- if (portletRef != null)
- {
- try
- {
- Portlet portlet =
invoker.getPortlet(PortletContext.createPortletContext(portletRef));
-
- //
- portlets.put(child.getId(), portlet);
- windows.put(child.getId(), (WindowNode)child);
- }
- catch (PortletInvokerException e)
- {
- e.printStackTrace();
- }
- }
- }
- }
-
- //
- this.client = client;
- this.page = page;
- this.invoker = invoker;
- this.stateControllerContext = new StructuralStateControllerContext(this);
- this.portlets = portlets;
- this.windows = windows;
- this.eventControllerContext = new StructuralEventControllerContext(this);
- }
-
- public String getPageId()
- {
- return page.getId();
- }
-
- public Set<String> getWindowIds()
- {
- return windows.keySet();
- }
-
- public PortletInfo getPortletInfo(String windowId)
- {
- return portlets.get(windowId).getInfo();
- }
-
- public PortletInvocationContext createPortletInvocationContext(String windowId,
PortletPageNavigationalState pageNavigationalState)
- {
- return new PresentationPortletInvocationContext(client, this, windowId);
- }
-
- public PortletInvocationResponse invoke(ActionInvocation actionInvocation) throws
PortletInvokerException
- {
- return invoke((PortletInvocation)actionInvocation);
- }
-
- public PortletInvocationResponse invoke(List<Cookie> requestCookies,
EventInvocation eventInvocation) throws PortletInvokerException
- {
- return invoke(eventInvocation);
- }
-
- public PortletInvocationResponse invoke(List<Cookie> requestCookies,
RenderInvocation renderInvocation) throws PortletInvokerException
- {
- return invoke(renderInvocation);
- }
-
- public PortletInvocationResponse invoke(ResourceInvocation resourceInvocation) throws
PortletInvokerException
- {
- return invoke((PortletInvocation)resourceInvocation);
- }
-
- private PortletInvocationResponse invoke(PortletInvocation portletInvocation) throws
PortletInvokerException
- {
- PresentationPortletInvocationContext ctx =
(PresentationPortletInvocationContext)portletInvocation.getContext();
-
- //
- WindowNode window = windows.get(ctx.getWindowId());
-
- //
- portletInvocation.setServerContext(new PresentationServerContext(client));
- portletInvocation.setSecurityContext(new PresentationSecurityContext());
- portletInvocation.setClientContext(new PresentationClientContext());
- portletInvocation.setInstanceContext(new PresentationInstanceContext(window));
- portletInvocation.setPortalContext(new PresentationPortalContext());
- portletInvocation.setUserContext(new AbstractUserContext());
- portletInvocation.setWindowContext(new PresentationWindowContext(window));
-
- //
- Portlet portlet = portlets.get(ctx.getWindowId());
- portletInvocation.setTarget(portlet.getContext());
-
- //
- return invoker.invoke(portletInvocation);
- }
-
- public EventControllerContext getEventControllerContext()
- {
- return eventControllerContext;
- }
-
- public StateControllerContext getStateControllerContext()
- {
- return stateControllerContext;
- }
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralPortletPageNavigationalState.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralPortletPageNavigationalState.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralPortletPageNavigationalState.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,290 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.impl.server.portlet;
-
-import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
-import org.jboss.portal.portlet.controller.state.PortletWindowNavigationalState;
-import org.jboss.portal.portlet.StateString;
-import org.jboss.portal.portlet.info.ParameterInfo;
-import org.jboss.portal.portlet.info.NavigationInfo;
-import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
-import
org.jboss.portal.presentation.impl.state.navigational.DelegatingNavigationalStateContext;
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-
-import javax.xml.namespace.QName;
-import java.util.Set;
-import java.util.Map;
-import java.util.HashMap;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class StructuralPortletPageNavigationalState implements
PortletPageNavigationalState
-{
-
- /** . */
- public static final int READ_ONLY_MODE = 0;
-
- /** . */
- public static final int READ_WRITE_MODE = 1;
-
- /** . */
- public static final int CLONE_AND_WRITE_MODE = 2;
-
- /** . */
- private final StructuralPortletControllerContext portletControllerContext;
-
- /** . */
- private final NavigationalStateContext navigationalStateContext;
-
- /** . */
- private final boolean modifiable;
-
- public StructuralPortletPageNavigationalState(
- StructuralPortletControllerContext portletControllerContext,
- NavigationalStateContext navigationalStateContext,
- int mode)
- {
- boolean modifiable;
- switch (mode)
- {
- case READ_ONLY_MODE:
- modifiable = false;
- break;
- case READ_WRITE_MODE:
- modifiable = true;
- break;
- case CLONE_AND_WRITE_MODE:
- modifiable = true;
- navigationalStateContext = new
DelegatingNavigationalStateContext(navigationalStateContext);
- break;
- default:
- throw new AssertionError();
- }
-
- //
- this.portletControllerContext = portletControllerContext;
- this.navigationalStateContext = navigationalStateContext;
- this.modifiable = modifiable;
- }
-
- public StructuralPortletPageNavigationalState(
- StructuralPortletPageNavigationalState pageNavigationalState,
- int mode)
- {
- NavigationalStateContext navigationalStateContext =
pageNavigationalState.navigationalStateContext;
- boolean modifiable;
- switch (mode)
- {
- case READ_ONLY_MODE:
- modifiable = false;
- break;
- case READ_WRITE_MODE:
- modifiable = true;
- break;
- case CLONE_AND_WRITE_MODE:
- modifiable = true;
- navigationalStateContext = new
DelegatingNavigationalStateContext(navigationalStateContext);
- break;
- default:
- throw new AssertionError();
- }
-
- //
- this.portletControllerContext = pageNavigationalState.portletControllerContext;
- this.navigationalStateContext = navigationalStateContext;
- this.modifiable = modifiable;
- }
-
- public void flush()
- {
- if (navigationalStateContext instanceof DelegatingNavigationalStateContext)
- {
- ((DelegatingNavigationalStateContext)navigationalStateContext).flush(true);
- }
- }
-
- public Set<String> getPortletWindowIds()
- {
- return portletControllerContext.getWindowIds();
- }
-
- public PortletWindowNavigationalState getPortletWindowNavigationalState(String
portletWindowId) throws IllegalArgumentException
- {
- Mode mode = (Mode)navigationalStateContext.getProperty(portletWindowId,
"mode");
- WindowState windowState =
(WindowState)navigationalStateContext.getProperty(portletWindowId,
"windowstate");
- StateString portletNavigationalState =
(StateString)navigationalStateContext.getProperty(portletWindowId, "portlet");
- return new PortletWindowNavigationalState(portletNavigationalState, mode,
windowState);
- }
-
- public void setPortletWindowNavigationalState(String portletWindowId,
PortletWindowNavigationalState portletWindowState) throws IllegalArgumentException,
IllegalStateException
- {
- if (!modifiable)
- {
- throw new IllegalStateException();
- }
-
- //
- navigationalStateContext.setProperty(portletWindowId, "windowstate",
portletWindowState.getWindowState());
- navigationalStateContext.setProperty(portletWindowId, "mode",
portletWindowState.getMode());
- navigationalStateContext.setProperty(portletWindowId, "portlet",
portletWindowState.getPortletNavigationalState());
- }
-
- public Map<String, String[]> getPortletPublicNavigationalState(String
portletWindowId) throws IllegalArgumentException
- {
- Map<QName, String[]> pageParameters = (Map<QName,
String[]>)navigationalStateContext.getProperty(portletControllerContext.getPageId(),
"portlet");
-
- //
- Map<String, String[]> portletParameters = null;
-
- //
- if (pageParameters != null)
- {
- NavigationInfo navigationInfo =
portletControllerContext.getPortletInfo(portletWindowId).getNavigation();
-
- //
- for (ParameterInfo parameterInfo : navigationInfo.getPublicParameters())
- {
- QName parameterName = parameterInfo.getName();
- String[] parameterValue = pageParameters.get(parameterName);
-
- //
- if (parameterValue != null)
- {
- if (portletParameters == null)
- {
- portletParameters = new HashMap<String, String[]>();
- }
-
- //
- portletParameters.put(parameterInfo.getId(), parameterValue);
- }
- }
- }
-
- //
- return portletParameters;
- }
-
- public void setPortletPublicNavigationalState(String portletWindowId, Map<String,
String[]> update) throws IllegalArgumentException, IllegalStateException
- {
- if (!modifiable)
- {
- throw new IllegalStateException();
- }
-
- //
- HashMap<QName, String[]> pageParameters = (HashMap<QName,
String[]>)navigationalStateContext.getProperty(portletControllerContext.getPageId(),
"portlet");
-
- //
- if (pageParameters == null)
- {
- pageParameters = new HashMap<QName, String[]>();
- }
-
- //
- NavigationInfo navigationInfo =
portletControllerContext.getPortletInfo(portletWindowId).getNavigation();
-
- //
- for (Map.Entry<String, String[]> entry : update.entrySet())
- {
- ParameterInfo parameterInfo =
navigationInfo.getPublicParameter(entry.getKey());
-
- //
- QName parameterName = parameterInfo.getName();
-
- if (entry.getValue().length == 0)
- {
- pageParameters.remove(parameterName);
- }
- else
- {
- pageParameters.put(parameterName, entry.getValue());
- }
- }
-
- //
- navigationalStateContext.setProperty(portletControllerContext.getPageId(),
"portlet", pageParameters);
- }
-
- public Set<QName> getPublicNames()
- {
- HashMap<QName, String[]> pageParameters = (HashMap<QName,
String[]>)navigationalStateContext.getProperty(portletControllerContext.getPageId(),
"portlet");
-
- //
- return pageParameters != null ? pageParameters.keySet() : null;
- }
-
- public String[] getPublicNavigationalState(QName name) throws
IllegalArgumentException
- {
- Map<QName, String[]> pageParameters = (Map<QName,
String[]>)navigationalStateContext.getProperty(portletControllerContext.getPageId(),
"portlet");
-
- //
- return pageParameters != null ? pageParameters.get(name) : null;
- }
-
- public void setPublicNavigationalState(QName name, String[] value) throws
IllegalArgumentException, IllegalStateException
- {
- if (!modifiable)
- {
- throw new IllegalStateException();
- }
-
- //
- HashMap<QName, String[]> pageParameters = (HashMap<QName,
String[]>)navigationalStateContext.getProperty(portletControllerContext.getPageId(),
"portlet");
-
- //
- if (pageParameters == null)
- {
- pageParameters = new HashMap<QName, String[]>();
- }
-
- //
- pageParameters.put(name, value);
-
- //
- navigationalStateContext.setProperty(portletControllerContext.getPageId(),
"portlet", pageParameters);
- }
-
- public void removePublicNavigationalState(QName name) throws IllegalArgumentException,
IllegalStateException
- {
- if (!modifiable)
- {
- throw new IllegalStateException();
- }
-
- //
- HashMap<QName, String[]> pageParameters = (HashMap<QName,
String[]>)navigationalStateContext.getProperty(portletControllerContext.getPageId(),
"portlet");
-
- //
- if (pageParameters != null)
- {
- pageParameters.remove(name);
-
- //
- navigationalStateContext.setProperty(portletControllerContext.getPageId(),
"portlet", pageParameters);
- }
- }
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralStateControllerContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralStateControllerContext.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralStateControllerContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,59 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.impl.server.portlet;
-
-import org.jboss.portal.portlet.controller.state.StateControllerContext;
-import org.jboss.portal.portlet.controller.state.PortletPageNavigationalState;
-import
org.jboss.portal.presentation.impl.state.navigational.NavigationalStateContextImpl;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class StructuralStateControllerContext implements StateControllerContext
-{
-
- /** . */
- private StructuralPortletControllerContext portletControllerContext;
-
- public StructuralStateControllerContext(StructuralPortletControllerContext
portletControllerContext)
- {
- this.portletControllerContext = portletControllerContext;
- }
-
- public PortletPageNavigationalState
clonePortletPageNavigationalState(PortletPageNavigationalState
portletPageNavigationalState, boolean modifiable)
- {
-
- return new StructuralPortletPageNavigationalState(
- (StructuralPortletPageNavigationalState)portletPageNavigationalState,
- modifiable ? StructuralPortletPageNavigationalState.CLONE_AND_WRITE_MODE :
StructuralPortletPageNavigationalState.READ_ONLY_MODE);
- }
-
- public PortletPageNavigationalState createPortletPageNavigationalState(boolean
modifiable)
- {
- return new StructuralPortletPageNavigationalState(
- portletControllerContext,
- new NavigationalStateContextImpl(),
- modifiable ? StructuralPortletPageNavigationalState.READ_WRITE_MODE :
StructuralPortletPageNavigationalState.READ_ONLY_MODE);
- }
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationClientContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationClientContext.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationClientContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,58 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.impl.server.portlet.spi;
-
-import org.jboss.portal.common.util.MultiValuedPropertyMap;
-import org.jboss.portal.common.util.SimpleMultiValuedPropertyMap;
-import org.jboss.portal.portlet.spi.ClientContext;
-
-import javax.servlet.http.Cookie;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class PresentationClientContext implements ClientContext
-{
-
- public PresentationClientContext()
- {
- }
-
- public String getMethod()
- {
- return "GET";
- }
-
- public MultiValuedPropertyMap<String> getProperties()
- {
- return new SimpleMultiValuedPropertyMap<String>();
- }
-
- public List<Cookie> getCookies()
- {
- return Collections.emptyList();
- }
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationInstanceContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationInstanceContext.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationInstanceContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,59 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.impl.server.portlet.spi;
-
-import org.jboss.portal.portlet.StateEvent;
-import org.jboss.portal.portlet.spi.InstanceContext;
-import org.jboss.portal.portlet.state.AccessMode;
-import org.jboss.portal.presentation.impl.state.structural.WindowNode;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class PresentationInstanceContext implements InstanceContext
-{
-
- /** . */
- private final WindowNode window;
-
- public PresentationInstanceContext(WindowNode window)
- {
- this.window = window;
- }
-
- public String getId()
- {
- return window.getId();
- }
-
- public AccessMode getAccessMode()
- {
- return AccessMode.READ_ONLY;
- }
-
- public void onStateEvent(StateEvent event)
- {
- throw new IllegalStateException();
- }
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationPortalContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationPortalContext.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationPortalContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,59 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.impl.server.portlet.spi;
-
-import org.jboss.portal.Mode;
-import org.jboss.portal.WindowState;
-import org.jboss.portal.common.util.Tools;
-import org.jboss.portal.portlet.spi.PortalContext;
-
-import java.util.Collections;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class PresentationPortalContext implements PortalContext
-{
- public String getInfo()
- {
- return "PresentationPortal";
- }
-
- public Set<WindowState> getWindowStates()
- {
- return Tools.toSet(WindowState.NORMAL);
- }
-
- public Set<Mode> getModes()
- {
- return Tools.toSet(Mode.VIEW);
- }
-
- public Map<String, String> getProperties()
- {
- return Collections.emptyMap();
- }
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationPortletInvocationContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationPortletInvocationContext.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationPortletInvocationContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,112 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.impl.server.portlet.spi;
-
-import org.jboss.portal.portlet.spi.PortletInvocationContext;
-import org.jboss.portal.portlet.ContainerURL;
-import org.jboss.portal.portlet.URLFormat;
-import org.jboss.portal.common.util.MarkupInfo;
-import org.jboss.portal.common.net.media.MediaType;
-import
org.jboss.portal.presentation.impl.server.portlet.StructuralPortletControllerContext;
-import org.jboss.portal.presentation.impl.server.portlet.PortletContainerAction;
-import org.jboss.portal.presentation.client.PresentationClient;
-
-import java.io.Writer;
-import java.io.IOException;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class PresentationPortletInvocationContext implements PortletInvocationContext
-{
-
- /** . */
- private final MarkupInfo markup = new MarkupInfo(MediaType.TEXT_HTML,
"UTF-8");
-
- /** . */
- private final StructuralPortletControllerContext portletControllerContext;
-
- /** . */
- private final String windowId;
-
- /** . */
- private final PresentationClient client;
-
- public PresentationPortletInvocationContext(
- PresentationClient client,
- StructuralPortletControllerContext portletControllerContext,
- String windowId)
- {
- this.client = client;
- this.portletControllerContext = portletControllerContext;
- this.windowId = windowId;
- }
-
- public String getWindowId()
- {
- return windowId;
- }
-
- public MarkupInfo getMarkupInfo()
- {
- return markup;
- }
-
- public String encodeResourceURL(String url) throws IllegalArgumentException
- {
- return url;
- }
-
- public String renderURL(ContainerURL containerURL, URLFormat format)
- {
- PortletContainerAction action = PortletContainerAction.create(windowId,
containerURL);
-
- //
- String url = client.renderURL(action, null);
-
-
-// StateControllerContext stateControllerContext =
portletControllerContext.getStateControllerContext();
-// PortletPageNavigationalStateSerialization serialiation = new
PortletPageNavigationalStateSerialization(stateControllerContext);
-// ControllerRequestParameterMapFactory parameterMapFactory = new
ControllerRequestParameterMapFactory(serialiation);
-//
-// Map<String, String> parameters = parameterMapFactory.encode(null, windowId,
containerURL);
-//
-// Map<String, String[]> blah = new HashMap<String, String[]>();
-// for (Map.Entry<String, String> entry : parameters.entrySet())
-// {
-// blah.put(entry.getKey(), new String[]{entry.getValue()});
-// }
-//
-// GetActivation getActivation = new GetActivation(windowId, "/", blah);
-//
-// String url = client.renderURL(getActivation, null);
-
- return url;
- }
-
- public void renderURL(Writer writer, ContainerURL containerURL, URLFormat format)
throws IOException
- {
- writer.write(renderURL(containerURL, format));
- }
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationSecurityContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationSecurityContext.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationSecurityContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,64 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.impl.server.portlet.spi;
-
-import org.jboss.portal.portlet.spi.SecurityContext;
-
-import java.security.Principal;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class PresentationSecurityContext implements SecurityContext
-{
- public boolean isSecure()
- {
- return false;
- }
-
- public boolean isAuthenticated()
- {
- return false;
- }
-
- public String getAuthType()
- {
- return null;
- }
-
- public String getRemoteUser()
- {
- return null;
- }
-
- public Principal getUserPrincipal()
- {
- return null;
- }
-
- public boolean isUserInRole(String roleName)
- {
- return false;
- }
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationServerContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationServerContext.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationServerContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,70 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.impl.server.portlet.spi;
-
-import org.jboss.portal.portlet.spi.ServerContext;
-import org.jboss.portal.presentation.client.PresentationClient;
-import org.jboss.portal.web.RequestDispatchCallback;
-import org.jboss.portal.web.ServletContainer;
-import org.jboss.portal.web.ServletContextDispatcher;
-
-import javax.servlet.ServletContext;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class PresentationServerContext implements ServerContext
-{
-
- /** . */
- private final PresentationClient presentationClient;
-
- public PresentationServerContext(PresentationClient presentationClient)
- {
- this.presentationClient = presentationClient;
- }
-
- public String getScheme()
- {
- return "http";
- }
-
- public String getServerName()
- {
- return "localhost";
- }
-
- public int getServerPort()
- {
- return 8080;
- }
-
- public Object dispatch(ServletContainer servletContainer, ServletContext
targetServletContext, RequestDispatchCallback callback, Object handback) throws Exception
- {
- ServletContextDispatcher dispatcher = presentationClient.getDispatcher();
-
- //
- return dispatcher.include(targetServletContext, callback, handback);
- }
-}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationWindowContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationWindowContext.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationWindowContext.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,47 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.impl.server.portlet.spi;
-
-import org.jboss.portal.portlet.spi.WindowContext;
-import org.jboss.portal.presentation.impl.state.structural.WindowNode;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public class PresentationWindowContext implements WindowContext
-{
-
- /** . */
- private final WindowNode window;
-
- public PresentationWindowContext(WindowNode window)
- {
- this.window = window;
- }
-
- public String getId()
- {
- return window.getId();
- }
-}
Added:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/model/tree/UINode.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2008, 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.presentation.model.tree;
+
+import org.jboss.portal.presentation.model.UIObject;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface UINode
+{
+
+ UIObject getObject();
+
+ UINode getParent();
+
+ Collection<UINode> getChildren();
+
+}
Deleted:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/CommandAction.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/CommandAction.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/CommandAction.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -1,35 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2008, 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.presentation.protocol;
-
-/**
- * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
- * @version $Revision: 630 $
- */
-public abstract class CommandAction extends UIObjectAction
-{
- protected CommandAction(String targetId) throws IllegalArgumentException
- {
- super(targetId);
- }
-}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationServer.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationServer.java 2008-04-28
10:07:59 UTC (rev 10722)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/server/PresentationServer.java 2008-04-28
10:47:59 UTC (rev 10723)
@@ -36,8 +36,6 @@
StructuralStateContext getStructuralStateContext();
- String render(ProtocolAction action) throws IllegalArgumentException;
-
WindowContent renderWindow(PresentationClient client, String windowId) throws
PresentationServerException;
PresentationResponse process(PresentationClient client, PresentationRequest request)
throws PresentationServerException;