Author: julien(a)jboss.com
Date: 2008-04-25 18:56:30 -0400 (Fri, 25 Apr 2008)
New Revision: 10718
Added:
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/context.xml
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/jboss-beans.xml
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/jboss-web.xml
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/portlet.xml
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/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/PresentationPortletInvocationContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationSecurityContext.java
Modified:
modules/presentation/trunk/ajax/pom.xml
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/model/AjaxNavigationalStateContext.java
modules/presentation/trunk/ajax/src/test/java/org/jboss/portal/presentation/test/portal/PresentationServerImpl.java
modules/presentation/trunk/build/pom.xml
modules/presentation/trunk/classic/pom.xml
modules/presentation/trunk/classic/src/assemble/presentation-war.xml
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/web.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/pom.xml
modules/presentation/trunk/presentation/pom.xml
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/portlet/PresentationPortletInvoker.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/spi/PresentationClientContext.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/NavigationalStateContextImpl.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/LinkActivation.java
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/navigational/NavigationalStateContext.java
Log:
start to integrate portlet container with presentation framework
Modified: modules/presentation/trunk/ajax/pom.xml
===================================================================
--- modules/presentation/trunk/ajax/pom.xml 2008-04-25 01:39:30 UTC (rev 10717)
+++ modules/presentation/trunk/ajax/pom.xml 2008-04-25 22:56:30 UTC (rev 10718)
@@ -60,16 +60,6 @@
</dependency>
<dependency>
- <groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet-jsr168api</artifactId>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet-portal</artifactId>
- </dependency>
-
- <dependency>
<groupId>org.jboss.portal.web</groupId>
<artifactId>web-web</artifactId>
</dependency>
Modified:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/model/AjaxNavigationalStateContext.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/model/AjaxNavigationalStateContext.java 2008-04-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/model/AjaxNavigationalStateContext.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -24,6 +24,7 @@
import java.util.List;
import java.util.ArrayList;
+import java.io.Serializable;
import
org.jboss.portal.presentation.impl.state.navigational.NavigationalStateContextImpl;
import org.jboss.portal.presentation.state.StateChangeVetoException;
@@ -78,7 +79,7 @@
/**
*
*/
- public void setProperty(String objectId, String key, Object navigationalState)
+ public void setProperty(String objectId, String key, Serializable navigationalState)
throws StateChangeVetoException, StateException, IllegalArgumentException
{
this.markAsStale(objectId);
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-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/ajax/src/test/java/org/jboss/portal/presentation/test/portal/PresentationServerImpl.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -149,10 +149,16 @@
formParameters = ((Body.Form)body).getParameters();
}
}
+
+
- WindowState windowState = activation.getWindowState();
- Mode windowMode = activation.getWindowMode();
-
+ String windowStateParam = activation.getQueryParameter("windowstate");
+ WindowState windowState = windowStateParam != null ?
WindowState.create(windowStateParam) : WindowState.NORMAL;
+
+
+ String windowModeParam = activation.getQueryParameter("mode");
+ Mode windowMode = windowModeParam != null ? Mode.create(windowModeParam) :
Mode.VIEW;
+
//Perform processing of this request through to the PortletContainer
//Just Stub code...just mark all children on this page as stale for re-rendering
for(StructuralNode window: targetNode.getParent().getChildren())
Modified: modules/presentation/trunk/build/pom.xml
===================================================================
--- modules/presentation/trunk/build/pom.xml 2008-04-25 01:39:30 UTC (rev 10717)
+++ modules/presentation/trunk/build/pom.xml 2008-04-25 22:56:30 UTC (rev 10718)
@@ -31,13 +31,15 @@
<version.gwt>1.4.60</version.gwt>
<version.mygwt>0.3.0</version.mygwt>
+ <version.portlet-api>2.0</version.portlet-api>
+
<version.jboss.portal.common>1.2.0-SNAPSHOT</version.jboss.portal.common>
- <version.jboss.portal.portlet>2.0.0.CR2</version.jboss.portal.portlet>
+
<version.jboss.portal.portlet>2.0.0-SNAPSHOT</version.jboss.portal.portlet>
<version.jboss.portal.web>1.2.0-SNAPSHOT</version.jboss.portal.web>
<version.jboss.unit>1.2.0.Beta2</version.jboss.unit>
- <version.jboss.microcontainer>2.0.0.Beta9</version.jboss.microcontainer>
- <version.jboss.common.core>2.0.3.GA</version.jboss.common.core>
+
<version.jboss.microcontainer>2.0.0.Beta13</version.jboss.microcontainer>
+ <version.jboss.common.core>2.0.4.GA</version.jboss.common.core>
<version.jboss.remoting>2.2.1.GA</version.jboss.remoting>
<!-- your local appserver installation -->
@@ -120,6 +122,12 @@
</dependency>
<dependency>
+ <groupId>javax.portlet</groupId>
+ <artifactId>portlet-api</artifactId>
+ <version>${version.portlet-api}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.portal.common</groupId>
<artifactId>common-common</artifactId>
<version>${version.jboss.portal.common}</version>
@@ -138,24 +146,36 @@
</dependency>
<dependency>
+ <groupId>org.jboss.portal.web</groupId>
+ <artifactId>web-web</artifactId>
+ <version>${version.jboss.portal.web}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet-jsr168api</artifactId>
+ <artifactId>portlet-portlet</artifactId>
<version>${version.jboss.portal.portlet}</version>
</dependency>
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet-portal</artifactId>
+ <artifactId>portlet-controller</artifactId>
<version>${version.jboss.portal.portlet}</version>
</dependency>
<dependency>
- <groupId>org.jboss.portal.web</groupId>
- <artifactId>web-web</artifactId>
- <version>${version.jboss.portal.web}</version>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-mc</artifactId>
+ <version>${version.jboss.portal.portlet}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-samples</artifactId>
+ <version>${version.jboss.portal.portlet}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit</artifactId>
<version>${version.jboss.unit}</version>
@@ -187,12 +207,6 @@
<dependency>
<groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-container</artifactId>
- <version>${version.jboss.microcontainer}</version>
- </dependency>
-
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
<artifactId>jboss-kernel</artifactId>
<version>${version.jboss.microcontainer}</version>
</dependency>
Modified: modules/presentation/trunk/classic/pom.xml
===================================================================
--- modules/presentation/trunk/classic/pom.xml 2008-04-25 01:39:30 UTC (rev 10717)
+++ modules/presentation/trunk/classic/pom.xml 2008-04-25 22:56:30 UTC (rev 10718)
@@ -14,62 +14,81 @@
<dependencies>
- <dependency>
- <groupId>org.jboss.portal.presentation</groupId>
- <artifactId>presentation-presentation</artifactId>
- <version>${project.version}</version>
- </dependency>
+ <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>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>junit</groupId>
+ <artifactId>junit</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.jboss.portal.common</groupId>
- <artifactId>common-portal</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.common</groupId>
+ <artifactId>common-common</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.jboss.portal.web</groupId>
- <artifactId>web-web</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.common</groupId>
+ <artifactId>common-portal</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-container</artifactId>
- <version>${version.jboss.microcontainer}</version>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.common</groupId>
+ <artifactId>common-mc</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-kernel</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.web</groupId>
+ <artifactId>web-web</artifactId>
+ </dependency>
- <dependency>
- <groupId>org.jboss.microcontainer</groupId>
- <artifactId>jboss-dependency</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-portlet</artifactId>
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-core</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-controller</artifactId>
+ </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-remoting</artifactId>
- </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-mc</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-samples</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-kernel</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.jboss.microcontainer</groupId>
+ <artifactId>jboss-dependency</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-common-core</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>jboss</groupId>
+ <artifactId>jboss-remoting</artifactId>
+ </dependency>
</dependencies>
<build>
Modified: modules/presentation/trunk/classic/src/assemble/presentation-war.xml
===================================================================
--- modules/presentation/trunk/classic/src/assemble/presentation-war.xml 2008-04-25
01:39:30 UTC (rev 10717)
+++ modules/presentation/trunk/classic/src/assemble/presentation-war.xml 2008-04-25
22:56:30 UTC (rev 10718)
@@ -23,10 +23,27 @@
<dependencySet>
<outputDirectory>WEB-INF/lib</outputDirectory>
<includes>
+
<include>org.jboss.portal.common:common-common</include>
<include>org.jboss.portal.common:common-portal</include>
+ <include>org.jboss.portal.common:common-mc</include>
<include>org.jboss.portal.web:web-web</include>
+ <include>org.jboss.portal.portlet:portlet-portlet</include>
+ <include>org.jboss.portal.portlet:portlet-controller</include>
+ <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>javax.ccpp:ccpp</include>
+ <include>javax.portlet:portlet-api</include>
+
+ <include>org.jboss:jboss-common-core</include>
+ <include>org.jboss.microcontainer:jboss-kernel</include>
+ <include>org.jboss.microcontainer:jboss-dependency</include>
+ <include>org.jboss:jboss-reflect</include>
+ <include>org.jboss:jboss-mdr</include>
+ <include>org.jboss:jbossxb</include>
+
</includes>
</dependencySet>
</dependencySets>
Added:
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/context.xml
===================================================================
---
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/context.xml
(rev 0)
+++
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/context.xml 2008-04-25
22:56:30 UTC (rev 10718)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context privileged="true"/>
\ No newline at end of file
Added:
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/jboss-beans.xml
===================================================================
---
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/jboss-beans.xml
(rev 0)
+++
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/jboss-beans.xml 2008-04-25
22:56:30 UTC (rev 10718)
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<deployment xmlns="urn:jboss:bean-deployer:2.0">
+
+ <bean name="PortletApplicationDeployer"
class="org.jboss.portal.portlet.mc.PortletApplicationDeployer">
+ <alias>PortletApplicationRegistry</alias>
+ <property name="servletContainer"><inject
bean="ServletContainer"/></property>
+ <property name="containerPortletInvoker"><inject
bean="ContainerPortletInvoker"/></property>
+ </bean>
+
+ <!-- The ServletContainerFactory -->
+ <bean name="ServletContainerFactory"
class="org.jboss.portal.web.impl.DefaultServletContainerFactory">
+ <constructor
factoryClass="org.jboss.portal.web.impl.DefaultServletContainerFactory"
factoryMethod="getInstance"/>
+ </bean>
+
+ <!-- The servlet container obtained from the ServletContainerFactory -->
+ <bean name="ServletContainer"
class="org.jboss.portal.web.ServletContainer">
+ <constructor factoryMethod="getServletContainer">
+ <factory bean="ServletContainerFactory"/>
+ </constructor>
+ </bean>
+
+ <!-- The producer persistence manager -->
+ <bean name="ProducerPersistenceManager"
class="org.jboss.portal.portlet.impl.state.producer.PortletStatePersistenceManagerService"/>
+
+ <!-- The producer state management policy -->
+ <bean name="ProducerStateManagementPolicy"
class="org.jboss.portal.portlet.impl.state.StateManagementPolicyService">
+ <property
name="persistLocally"><value>true</value></property>
+ </bean>
+
+ <!-- The producer state converter -->
+ <bean name="ProducerStateConverter"
class="org.jboss.portal.portlet.impl.state.StateConverterV0"/>
+
+ <!-- The consumer portlet invoker -->
+ <bean name="ConsumerPortletInvoker"
class="org.jboss.portal.portlet.PortletInvokerInterceptor">
+ <property name="next"><inject
bean="ConsumerCacheInterceptor"/></property>
+ </bean>
+ <bean name="ConsumerCacheInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ConsumerCacheInterceptor">
+ <property name="next"><inject
bean="PortletCustomizationInterceptor"/></property>
+ </bean>
+ <bean name="PortletCustomizationInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.PortletCustomizationInterceptor">
+ <property name="next"><inject
bean="ProducerPortletInvoker"/></property>
+ </bean>
+
+ <!-- The producer portlet invoker -->
+ <bean name="ProducerPortletInvoker"
class="org.jboss.portal.portlet.state.producer.ProducerPortletInvoker">
+ <property name="next"><inject
bean="ContainerPortletInvoker"/></property>
+ <property name="persistenceManager"><inject
bean="ProducerPersistenceManager"/></property>
+ <property name="stateManagementPolicy"><inject
bean="ProducerStateManagementPolicy"/></property>
+ <property name="stateConverter"><inject
bean="ProducerStateConverter"/></property>
+ </bean>
+
+ <!-- The portlet container invoker -->
+ <bean name="ContainerPortletInvoker"
class="org.jboss.portal.portlet.container.ContainerPortletInvoker">
+ <property name="next"><inject
bean="ValveInterceptor"/></property>
+ </bean>
+
+ <!-- Container stack -->
+ <bean name="ValveInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ValveInterceptor">
+ <property name="portletApplicationRegistry"><inject
bean="PortletApplicationRegistry"
state="Instantiated"/></property>
+ <property name="next"><inject
bean="SecureTransportInterceptor"/></property>
+ </bean>
+ <bean name="SecureTransportInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.SecureTransportInterceptor">
+ <property name="next"><inject
bean="ContextDispatcherInterceptor"/></property>
+ </bean>
+ <bean name="ContextDispatcherInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ContextDispatcherInterceptor">
+ <property name="servletContainerFactory"><inject
bean="ServletContainerFactory"/></property>
+ <property name="next"><inject
bean="ProducerCacheInterceptor"/></property>
+ </bean>
+ <bean name="ProducerCacheInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.ProducerCacheInterceptor">
+ <property name="next"><inject
bean="CCPPInterceptor"/></property>
+ </bean>
+ <bean name="CCPPInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.CCPPInterceptor">
+ <property name="next"><inject
bean="RequestAttributeConversationInterceptor"/></property>
+ </bean>
+ <bean name="RequestAttributeConversationInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.RequestAttributeConversationInterceptor">
+ <property name="next"><inject
bean="EventPayloadInterceptor"/></property>
+ </bean>
+ <bean name="EventPayloadInterceptor"
class="org.jboss.portal.portlet.aspects.portlet.EventPayloadInterceptor">
+ <property name="next"><inject
bean="PortletContainerDispatcher"/></property>
+ </bean>
+ <bean name="PortletContainerDispatcher"
class="org.jboss.portal.portlet.container.ContainerPortletDispatcher">
+ </bean>
+
+</deployment>
Added:
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/jboss-web.xml
===================================================================
---
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/jboss-web.xml
(rev 0)
+++
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/jboss-web.xml 2008-04-25
22:56:30 UTC (rev 10718)
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<!DOCTYPE jboss-web PUBLIC
+ "-//JBoss//DTD Web Application 4.2//EN"
+ "http://www.jboss.org/j2ee/dtd/jboss-web_4_2.dtd">
+<jboss-web>
+ <class-loading java2ClassLoadingCompliance="false">
+ <loader-repository>test:loader=portlet</loader-repository>
+ </class-loading>
+</jboss-web>
\ No newline at end of file
Modified:
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml
===================================================================
---
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml 2008-04-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml 2008-04-25
22:56:30 UTC (rev 10718)
@@ -4,14 +4,23 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<page-def name="default">
<window-def name="windowA">
+ <properties>
+ <property>
+ <name>portlet-ref</name>
+ <value>/classic-presentation.Catalog</value>
+ </property>
+ </properties>
<content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
</window-def>
<window-def name="windowB">
+ <properties>
+ <property>
+ <name>portlet-ref</name>
+ <value>/classic-presentation.Cart</value>
+ </property>
+ </properties>
<content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
</window-def>
- <window-def name="windowC">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
- </window-def>
<page-def name="child-page-default-1">
<window-def name="windowA">
<content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
@@ -22,17 +31,32 @@
</page-def>
<page-def name="child-page-default-2">
<window-def name="windowA">
+ <properties>
+ <property>
+ <name>portlet-ref</name>
+
<value>/classic-presentation.PublicParameterPortlet1</value>
+ </property>
+ </properties>
<content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
</window-def>
<window-def name="windowB">
+ <properties>
+ <property>
+ <name>portlet-ref</name>
+
<value>/classic-presentation.PublicParameterPortlet2</value>
+ </property>
+ </properties>
<content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
</window-def>
<window-def name="windowC">
+ <properties>
+ <property>
+ <name>portlet-ref</name>
+
<value>/classic-presentation.PublicParameterPortlet3</value>
+ </property>
+ </properties>
<content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
</window-def>
- <window-def name="windowD">
- <content>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
Pellentesque odio nisl, faucibus id, placerat et, pulvinar at, nisi. Vivamus mollis
pharetra risus. Mauris vitae massa vel augue congue eleifend. Morbi pede pede, adipiscing
nec, scelerisque nec, ullamcorper sed, libero. Mauris iaculis lorem sit amet eros. Proin
viverra eros. Morbi sit amet libero. Donec nec turpis et nunc consectetuer auctor. Fusce
et metus. Sed commodo condimentum libero. Sed mollis tellus id justo. Nulla condimentum,
libero ultricies accumsan pellentesque, nibh pede egestas quam, vitae varius nisi arcu ac
urna. Phasellus interdum, odio vitae eleifend suscipit, nibh massa laoreet lorem, id
mollis justo nisl non nunc. Sed enim enim, rutrum a, scelerisque eget, laoreet non, ante.
Aenean molestie ipsum in nisi.</content>
- </window-def>
</page-def>
</page-def>
<page-def name="default-sibling-1">
Added:
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/portlet.xml
===================================================================
---
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/portlet.xml 2008-04-25
22:56:30 UTC (rev 10718)
@@ -0,0 +1,133 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<portlet-app
xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://java.sun.com/xml/ns/portlet/portlet-app_2...
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
+ version="2.0">
+
+ <portlet>
+ <description>Catalog Portlet</description>
+ <portlet-name>Catalog</portlet-name>
+ <display-name>Catalog Portlet</display-name>
+
<portlet-class>org.jboss.portal.portlet.samples.shoppingcart.CatalogPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Catalog Portlet</title>
+ <keywords>sample,event,catalog</keywords>
+ </portlet-info>
+ <supported-publishing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:event'>jbp:CartEvent</qname>
+ </supported-publishing-event>
+ </portlet>
+
+ <portlet>
+ <description>Cart Portlet</description>
+ <portlet-name>Cart</portlet-name>
+ <display-name>Cart Portlet</display-name>
+
<portlet-class>org.jboss.portal.portlet.samples.shoppingcart.CartPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>VIEW</portlet-mode>
+ </supports>
+ <portlet-info>
+ <title>Cart Portlet</title>
+ <keywords>sample,event,cart</keywords>
+ </portlet-info>
+ <supported-processing-event>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:event'>jbp:CartEvent</qname>
+ </supported-processing-event>
+ </portlet>
+
+ <portlet>
+ <description>Portlet that manipulates its public render
parameters</description>
+ <portlet-name>PublicParameterPortlet1</portlet-name>
+ <display-name>Public Parameter Portlet 1</display-name>
+
<portlet-class>org.jboss.portal.portlet.samples.basic.PublicParameterPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Public Parameter Portlet</title>
+ <keywords>sample,test</keywords>
+ </portlet-info>
+
<supported-public-render-parameter>foo</supported-public-render-parameter>
+
<supported-public-render-parameter>bar</supported-public-render-parameter>
+ </portlet>
+ <portlet>
+ <description>Portlet that manipulates its public render
parameters</description>
+ <portlet-name>PublicParameterPortlet2</portlet-name>
+ <display-name>Public Parameter Portlet 2</display-name>
+
<portlet-class>org.jboss.portal.portlet.samples.basic.PublicParameterPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Public Parameter Portlet</title>
+ <keywords>sample,test</keywords>
+ </portlet-info>
+
<supported-public-render-parameter>foo</supported-public-render-parameter>
+
<supported-public-render-parameter>juu</supported-public-render-parameter>
+ </portlet>
+ <portlet>
+ <description>Portlet that manipulates its public render
parameters</description>
+ <portlet-name>PublicParameterPortlet3</portlet-name>
+ <display-name>Public Parameter Portlet 3</display-name>
+
<portlet-class>org.jboss.portal.portlet.samples.basic.PublicParameterPortlet</portlet-class>
+ <supports>
+ <mime-type>text/html</mime-type>
+ </supports>
+ <portlet-info>
+ <title>Public Parameter Portlet</title>
+ <keywords>sample,test</keywords>
+ </portlet-info>
+
<supported-public-render-parameter>bar</supported-public-render-parameter>
+
<supported-public-render-parameter>juu</supported-public-render-parameter>
+ </portlet>
+
+ <public-render-parameter>
+ <name>foo</name>
+ <identifier>foo</identifier>
+ </public-render-parameter>
+
+ <public-render-parameter>
+ <name>bar</name>
+ <identifier>bar</identifier>
+ </public-render-parameter>
+
+ <public-render-parameter>
+ <name>juu</name>
+ <identifier>juu</identifier>
+ </public-render-parameter>
+
+ <event-definition>
+ <qname
xmlns:jbp='urn:jboss:portal:samples:event'>jbp:CartEvent</qname>
+
<value-type>org.jboss.portal.portlet.samples.shoppingcart.CartEvent</value-type>
+ </event-definition>
+
+</portlet-app>
+
Modified:
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/web.xml
===================================================================
---
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/web.xml 2008-04-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/classic/src/main/artifacts/presentation-war/WEB-INF/web.xml 2008-04-25
22:56:30 UTC (rev 10718)
@@ -27,7 +27,17 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
+ <listener>
+
<listener-class>org.jboss.portal.common.mc.bootstrap.WebBootstrap</listener-class>
+ </listener>
+
<servlet>
+ <servlet-name>ContainerServlet</servlet-name>
+
<servlet-class>org.jboss.portal.web.impl.tomcat.TC6ContainerServlet</servlet-class>
+ <load-on-startup>0</load-on-startup>
+ </servlet>
+
+ <servlet>
<servlet-name>ClassicPresentationServlet</servlet-name>
<servlet-class>org.jboss.portal.presentation.classic.ClassicPresentationServlet</servlet-class>
</servlet>
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-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationClient.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -108,6 +108,9 @@
String link = encoder.encode(action, resp);
//
+
+
+ //
if (link == null)
{
throw new IllegalArgumentException("The action " + action + "
cannot be rendered");
@@ -196,6 +199,9 @@
UIObject object = node.getObject();
//
+ writer.println("<div style=\"border: 1px solid
black\">");
+
+ //
if (object instanceof UIContext)
{
renderChildren(node, writer);
@@ -240,6 +246,9 @@
e.printStackTrace();
}
}
+
+ //
+ writer.println("</div>");
}
private void renderChildren(ClassicUINode node, PrintWriter writer)
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-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/classic/src/main/java/org/jboss/portal/presentation/classic/ClassicPresentationServlet.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -32,6 +32,7 @@
import org.jboss.portal.web.WebRequest;
import org.jboss.portal.web.WebResponse;
import org.jboss.portal.web.endpoint.EndPointServlet;
+import org.jboss.portal.portlet.PortletInvoker;
import javax.servlet.ServletException;
import java.io.IOException;
@@ -70,7 +71,10 @@
}
//
- this.server = new PresentationServerImpl(structuralStateContext);
+ PortletInvoker portletInvoker =
(PortletInvoker)getServletContext().getAttribute("ConsumerPortletInvoker");
+
+ //
+ this.server = new PresentationServerImpl(structuralStateContext, portletInvoker);
}
protected void service(WebRequest req, WebResponse resp) throws ServletException,
IOException
Modified: modules/presentation/trunk/pom.xml
===================================================================
--- modules/presentation/trunk/pom.xml 2008-04-25 01:39:30 UTC (rev 10717)
+++ modules/presentation/trunk/pom.xml 2008-04-25 22:56:30 UTC (rev 10718)
@@ -29,6 +29,6 @@
<module>build</module>
<module>presentation</module>
<module>classic</module>
- <module>ajax</module>
+ <!--<module>ajax</module>-->
</modules>
</project>
Modified: modules/presentation/trunk/presentation/pom.xml
===================================================================
--- modules/presentation/trunk/presentation/pom.xml 2008-04-25 01:39:30 UTC (rev 10717)
+++ modules/presentation/trunk/presentation/pom.xml 2008-04-25 22:56:30 UTC (rev 10718)
@@ -19,8 +19,12 @@
</dependency>
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
- <artifactId>portlet-portal</artifactId>
+ <artifactId>portlet-portlet</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-controller</artifactId>
+ </dependency>
</dependencies>
<build>
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-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/PresentationServerImpl.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -26,18 +26,36 @@
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.model.content.WindowContent;
import org.jboss.portal.presentation.protocol.ErrorResponse;
import org.jboss.portal.presentation.protocol.ProtocolAction;
import org.jboss.portal.presentation.protocol.ShowUIObjectResponse;
import org.jboss.portal.presentation.protocol.UIObjectAction;
import org.jboss.portal.presentation.protocol.ViewUIObjectAction;
+import org.jboss.portal.presentation.protocol.LinkActivation;
+import org.jboss.portal.presentation.protocol.PostActivation;
import org.jboss.portal.presentation.server.PresentationRequest;
import org.jboss.portal.presentation.server.PresentationResponse;
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.impl.ControllerRequestFactory;
+import org.jboss.portal.portlet.controller.request.ControllerRequest;
+import org.jboss.portal.portlet.controller.PortletController;
+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.web.Body;
+import java.util.Map;
+
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
@@ -48,9 +66,13 @@
/** . */
private StructuralStateContextImpl structuralStateContext;
- public PresentationServerImpl(StructuralStateContextImpl structuralStateContext)
+ /** . */
+ private PortletInvoker portletInvoker;
+
+ public PresentationServerImpl(StructuralStateContextImpl structuralStateContext,
PortletInvoker portletInvoker)
{
this.structuralStateContext = structuralStateContext;
+ this.portletInvoker = portletInvoker;
}
public StructuralStateContext getStructuralStateContext()
@@ -65,24 +87,38 @@
public WindowContent renderWindow(PresentationClient client, String windowId) throws
PresentationServerException
{
- StructuralNode node = structuralStateContext.getNode(windowId);
-
- //
- if (node instanceof WindowNode)
+ try
{
- WindowNode window = (WindowNode)node;
+ WindowNode window = (WindowNode)structuralStateContext.getNode(windowId);
+ //
+ PageNode page = (PageNode)window.getParent();
+ //
+ PortletController controller = new PortletController();
-
+ //
+ StructuralPortletControllerContext portletControllerContext = new
StructuralPortletControllerContext(
+ client,
+ page,
+ portletInvoker);
+ PortletInvocationResponse response = controller.render(portletControllerContext,
null, null, windowId);
-
- return new WindowContent(0, "Window " + window.getName(),
window.getContent());
+ //
+ 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, "");
+ }
}
- else
+ catch (PortletInvokerException e)
{
- throw new PresentationServerException("No such window " + windowId);
+ throw new PresentationServerException(e);
}
}
@@ -111,6 +147,64 @@
{
return new PresentationResponse(new ShowUIObjectResponse(targetId));
}
+ else if (objectAction instanceof LinkActivation)
+ {
+ LinkActivation linkActivation = (LinkActivation)objectAction;
+
+ //
+ if (targetNode instanceof WindowNode)
+ {
+ WindowNode targetWindow = (WindowNode)targetNode;
+
+ //
+ PageNode targetPage = (PageNode)targetWindow.getParent();
+
+ //
+ ControllerRequestFactory factory = new ControllerRequestFactory(null);
+
+ Body body = null;
+ if (linkActivation instanceof PostActivation)
+ {
+ body = ((PostActivation)linkActivation).getBody();
+ }
+
+ //
+ ControllerRequest controllerRequest =
factory.decode(linkActivation.getQueryParameters(), body);
+
+ //
+ PortletController controller = new PortletController();
+
+ //
+ StructuralPortletControllerContext portletControllerContext = new
StructuralPortletControllerContext(
+ client,
+ targetPage,
+ portletInvoker);
+
+ //
+ try
+ {
+ ControllerResponse response =
controller.process(portletControllerContext, controllerRequest);
+
+ if (response instanceof PageUpdateResponse)
+ {
+ PageUpdateResponse pageUpdate = (PageUpdateResponse)response;
+
+ //
+ NavigationalStateContext nsc =
client.getNavigationalStateContext();
+
+ //
+ PortletPageNavigationalState blah =
pageUpdate.getPageNavigationalState();
+ }
+ }
+ catch (PortletInvokerException e)
+ {
+ e.printStackTrace();
+ }
+
+ //
+ return new PresentationResponse(new
ShowUIObjectResponse(targetPage.getId()));
+ }
+ }
}
//
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/PresentationPortletInvoker.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/PresentationPortletInvoker.java 2008-04-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/PresentationPortletInvoker.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -22,26 +22,10 @@
******************************************************************************/
package org.jboss.portal.presentation.impl.server.portlet;
-import org.jboss.portal.presentation.impl.state.structural.StructuralStateContextImpl;
-
/**
* @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
* @version $Revision: 630 $
*/
public class PresentationPortletInvoker
{
-
- /** . */
- private StructuralStateContextImpl structuralContext;
-
- public PresentationPortletInvoker(StructuralStateContextImpl structuralContext)
- {
- this.structuralContext = structuralContext;
- }
-
- public void render(String windowId)
- {
-
- }
-
}
Added:
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
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralEventControllerContext.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -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.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)
+ {
+ }
+}
Modified:
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-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralPortletControllerContext.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -24,20 +24,38 @@
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.PageNavigationalState;
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>
@@ -52,44 +70,136 @@
/** . */
private final PortletInvoker invoker;
- public StructuralPortletControllerContext(PageNode page, 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,
client.getNavigationalStateContext());
+ 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 null;
+ return portlets.get(windowId).getInfo();
}
- public PortletInvocationContext createPortletInvocationContext(String windowId,
PageNavigationalState pageNavigationalState)
+ public PortletInvocationContext createPortletInvocationContext(String windowId,
PortletPageNavigationalState pageNavigationalState)
{
- return null;
+ return new PresentationPortletInvocationContext(client, this, windowId);
}
public PortletInvocationResponse invoke(ActionInvocation actionInvocation) throws
PortletInvokerException
{
- return null;
+ return invoke((PortletInvocation)actionInvocation);
}
public PortletInvocationResponse invoke(List<Cookie> requestCookies,
EventInvocation eventInvocation) throws PortletInvokerException
{
- return null;
+ return invoke(eventInvocation);
}
+ public PortletInvocationResponse invoke(List<Cookie> requestCookies,
RenderInvocation renderInvocation) throws PortletInvokerException
+ {
+ return invoke(renderInvocation);
+ }
+
public PortletInvocationResponse invoke(ResourceInvocation resourceInvocation) throws
PortletInvokerException
{
- return null;
+ 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 null;
+ return eventControllerContext;
}
public StateControllerContext getStateControllerContext()
{
- return null;
+ return stateControllerContext;
}
}
Added:
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
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralPortletPageNavigationalState.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -0,0 +1,195 @@
+/******************************************************************************
+ * 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.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
+{
+
+ /** . */
+ private final StructuralPortletControllerContext portletControllerContext;
+
+ /** . */
+ private final NavigationalStateContext navigationalStateContext;
+
+ public StructuralPortletPageNavigationalState(StructuralPortletControllerContext
portletControllerContext, NavigationalStateContext navigationalStateContext)
+ {
+ this.portletControllerContext = portletControllerContext;
+ this.navigationalStateContext = navigationalStateContext;
+ }
+
+ public Set<String> getPortletWindowIds()
+ {
+ return portletControllerContext.getWindowIds();
+ }
+
+ public PortletWindowNavigationalState getPortletWindowNavigationalState(String
portletWindowId) throws IllegalArgumentException
+ {
+ Mode mode = (Mode)navigationalStateContext.getProperty(portletWindowId,
"windowstate");
+ WindowState windowState =
(WindowState)navigationalStateContext.getProperty(portletWindowId, "mode");
+ StateString portletNavigationalState =
(StateString)navigationalStateContext.getProperty(portletWindowId, "portlet");
+ return new PortletWindowNavigationalState(portletNavigationalState, mode,
windowState);
+ }
+
+ public void setPortletWindowNavigationalState(String portletWindowId,
PortletWindowNavigationalState portletWindowState) throws IllegalArgumentException,
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
+ {
+ 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
+ {
+ 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
+ {
+ 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/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
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/StructuralStateControllerContext.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -0,0 +1,57 @@
+/******************************************************************************
+ * 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.state.navigational.NavigationalStateContext;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class StructuralStateControllerContext implements StateControllerContext
+{
+
+ /** . */
+ private StructuralPortletControllerContext portletControllerContext;
+
+ /** . */
+ private NavigationalStateContext navigationalStateContext;
+
+ public StructuralStateControllerContext(StructuralPortletControllerContext
portletControllerContext, NavigationalStateContext navigationalStateContext)
+ {
+ this.portletControllerContext = portletControllerContext;
+ this.navigationalStateContext = navigationalStateContext;
+ }
+
+ public PortletPageNavigationalState
clonePortletPageNavigationalState(PortletPageNavigationalState
portletPageNavigationalState, boolean modifiable)
+ {
+ return new StructuralPortletPageNavigationalState(portletControllerContext,
navigationalStateContext);
+ }
+
+ public PortletPageNavigationalState createPortletPageNavigationalState(boolean
modifiable)
+ {
+ return new StructuralPortletPageNavigationalState(portletControllerContext,
navigationalStateContext);
+ }
+}
Modified:
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-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationClientContext.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -25,8 +25,6 @@
import org.jboss.portal.common.util.MultiValuedPropertyMap;
import org.jboss.portal.common.util.SimpleMultiValuedPropertyMap;
import org.jboss.portal.portlet.spi.ClientContext;
-import org.jboss.portal.presentation.protocol.GetActivation;
-import org.jboss.portal.presentation.protocol.LinkActivation;
import javax.servlet.http.Cookie;
import java.util.Collections;
@@ -39,17 +37,13 @@
public class PresentationClientContext implements ClientContext
{
- /** . */
- private final LinkActivation linkActivation;
-
- public PresentationClientContext(LinkActivation linkActivation)
+ public PresentationClientContext()
{
- this.linkActivation = linkActivation;
}
public String getMethod()
{
- return linkActivation instanceof GetActivation ? "GET" :
"POST";
+ return "GET";
}
public MultiValuedPropertyMap<String> getProperties()
Added:
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
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationPortletInvocationContext.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -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.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.portlet.controller.impl.PortletURLRenderer;
+import org.jboss.portal.portlet.controller.impl.ControllerRequestParameterMapFactory;
+import
org.jboss.portal.portlet.controller.state.PortletPageNavigationalStateSerialization;
+import org.jboss.portal.portlet.controller.state.StateControllerContext;
+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.protocol.GetActivation;
+import org.jboss.portal.presentation.client.PresentationClient;
+
+import java.io.Writer;
+import java.io.IOException;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @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)
+ {
+ 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/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
(rev 0)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/server/portlet/spi/PresentationSecurityContext.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -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.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;
+ }
+}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/NavigationalStateContextImpl.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/NavigationalStateContextImpl.java 2008-04-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/navigational/NavigationalStateContextImpl.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -29,6 +29,7 @@
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -38,16 +39,16 @@
{
/** . */
- private final Map<String, Map<String, Object>> map;
+ private final Map<String, Map<String, Serializable>> map;
- public NavigationalStateContextImpl(Map<String, Map<String, Object>> map)
+ public NavigationalStateContextImpl(Map<String, Map<String, Serializable>>
map)
{
this.map = map;
}
public NavigationalStateContextImpl()
{
- this(new HashMap<String, Map<String, Object>>());
+ this(new HashMap<String, Map<String, Serializable>>());
}
public Set<String> getPropertyNames(String objectId)
@@ -61,7 +62,7 @@
return map.get(objectId).keySet();
}
- public void setProperty(String objectId, String key, Object navigationalState) throws
StateChangeVetoException, StateException, IllegalArgumentException
+ public void setProperty(String objectId, String key, Serializable navigationalState)
throws StateChangeVetoException, StateException, IllegalArgumentException
{
if (objectId == null)
{
@@ -73,14 +74,14 @@
}
//
- Map<String, Object> properties = map.get(objectId);
+ Map<String, Serializable> properties = map.get(objectId);
//
if (navigationalState != null)
{
if (properties == null)
{
- properties = new HashMap<String, Object>();
+ properties = new HashMap<String, Serializable>();
map.put(objectId, properties);
}
@@ -102,7 +103,7 @@
}
}
- public Object getProperty(String objectId, String key) throws
IllegalArgumentException
+ public Serializable getProperty(String objectId, String key) throws
IllegalArgumentException
{
if (objectId == null)
{
@@ -114,7 +115,7 @@
}
//
- Map<String, Object> properties = map.get(objectId);
+ Map<String, Serializable> properties = map.get(objectId);
//
if (properties != null)
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java 2008-04-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/impl/state/structural/NodeImporter.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -119,6 +119,11 @@
}
}
+ private void importProperties()
+ {
+
+ }
+
private void importContextDef(Element contextDefElt)
{
// Children pages
@@ -128,7 +133,7 @@
}
}
- private void importPageDef(StructuralNode parentNode, Element pageDefElt)
+ private PageNode importPageDef(StructuralNode parentNode, Element pageDefElt)
{
PageNode pageNode = createStructuralNode(parentNode, PageNode.class, pageDefElt);
@@ -143,9 +148,12 @@
{
importWindowDef(pageNode, childElt);
}
+
+ //
+ return pageNode;
}
- private void importWindowDef(StructuralNode parentNode, Element windowDefElt)
+ private WindowNode importWindowDef(StructuralNode parentNode, Element windowDefElt)
{
WindowNode windowNode = createStructuralNode(parentNode, WindowNode.class,
windowDefElt);
@@ -155,6 +163,9 @@
//
String content = asString(contentElt);
windowNode.setContent(content);
+
+ //
+ return windowNode;
}
private <T extends StructuralNode> T createStructuralNode(StructuralNode parent,
Class<T> type, Element nodeDefElt)
@@ -162,6 +173,29 @@
String nodeName = nodeDefElt.getAttribute("name");
//
- return parent.addChild(nodeName, type);
+ T node = parent.addChild(nodeName, type);
+
+ //
+ Element propertiesElt = XMLTools.getUniqueChild(nodeDefElt, "properties",
false);
+
+ //
+ if (propertiesElt != null)
+ {
+ for (Element propertyElt : XMLTools.getChildren(propertiesElt,
"property"))
+ {
+ Element nameElt = XMLTools.getUniqueChild(propertyElt, "name",
true);
+ String propertyName = XMLTools.asString(nameElt);
+
+ //
+ Element valueElt = XMLTools.getUniqueChild(propertyElt, "value",
true);
+ String propertyValue = XMLTools.asString(valueElt);
+
+ //
+ node.setProperty(propertyName, propertyValue);
+ }
+ }
+
+ //
+ return node;
}
}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/LinkActivation.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/LinkActivation.java 2008-04-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/protocol/LinkActivation.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -80,54 +80,34 @@
{
return queryParameters;
}
-
+
+
/**
- *
- * @return
+ * Returns the first value of the specified query parameter or null if no such value
exists.
+ *
+ * @param parameterName the parameter name
+ * @return the query parameter value or null
+ * @throws IllegalArgumentException if the query parameter is null
*/
- public WindowState getWindowState()
+ public String getQueryParameter(String parameterName) throws IllegalArgumentException
{
- WindowState windowState = null;
-
- if(this.queryParameters != null)
+ if (parameterName == null)
{
- String[] windowStateValue = this.queryParameters.get("windowstate");
- if(windowStateValue != null)
- {
- windowState = WindowState.create(windowStateValue[0]);
- }
+ throw new IllegalArgumentException();
}
-
- if(windowState == null)
+
+ if (queryParameters != null)
{
- windowState = windowState.NORMAL;
- }
-
- return windowState;
- }
-
- /**
- *
- * @return
- */
- public Mode getWindowMode()
- {
- Mode mode = null;
-
- if(this.queryParameters != null)
- {
- String[] modeValue = this.queryParameters.get("mode");
- if(modeValue != null)
+ String[] value = this.queryParameters.get(parameterName);
+
+ //
+ if(value != null)
{
- mode = Mode.create(modeValue[0]);
+ return value[0];
}
}
-
- if(mode == null)
- {
- mode = Mode.VIEW;
- }
-
- return mode;
- }
+
+ //
+ return null;
+ }
}
Modified:
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/navigational/NavigationalStateContext.java
===================================================================
---
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/navigational/NavigationalStateContext.java 2008-04-25
01:39:30 UTC (rev 10717)
+++
modules/presentation/trunk/presentation/src/main/java/org/jboss/portal/presentation/state/navigational/NavigationalStateContext.java 2008-04-25
22:56:30 UTC (rev 10718)
@@ -25,6 +25,7 @@
import org.jboss.portal.presentation.state.StateException;
import java.util.Set;
+import java.io.Serializable;
/**
* @author <a href="mailto:julien@jboss.org">Julien Viet</a>
@@ -33,10 +34,33 @@
public interface NavigationalStateContext
{
+ /**
+ * Returns the set of known properties or null if it does not exist for a specified
object id.
+ *
+ * @param objectId the object id
+ * @return the set of property names
+ */
Set<String> getPropertyNames(String objectId);
- Object getProperty(String objectId, String key) throws IllegalArgumentException;
+ /**
+ * Returns the property value for the specified object id and key.
+ *
+ * @param objectId the object id
+ * @param key the property key
+ * @return the property value
+ * @throws IllegalArgumentException if any argument is null
+ */
+ Serializable getProperty(String objectId, String key) throws
IllegalArgumentException;
- void setProperty(String objectId, String key, Object navigationalState) throws
StateException, IllegalArgumentException;
+ /**
+ * Set a property value with the provided navigational state
+ *
+ * @param objectId the object id
+ * @param key the property key
+ * @param navigationalState the navigational state
+ * @throws StateException any state exception
+ * @throws IllegalArgumentException if the object id or key is null
+ */
+ void setProperty(String objectId, String key, Serializable navigationalState) throws
StateException, IllegalArgumentException;
}
\ No newline at end of file