Author: julien(a)jboss.com
Date: 2008-06-12 11:24:25 -0400 (Thu, 12 Jun 2008)
New Revision: 11004
Added:
modules/presentation/trunk/ajax/
modules/presentation/trunk/ajax/pom.xml
modules/presentation/trunk/ajax/src/
modules/presentation/trunk/ajax/src/assemble/
modules/presentation/trunk/ajax/src/assemble/presentation-war.xml
modules/presentation/trunk/ajax/src/main/
modules/presentation/trunk/ajax/src/main/artifacts/
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/context.xml
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/jboss-beans.xml
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/jboss-web.xml
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/portlet.xml
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/web.xml
modules/presentation/trunk/ajax/src/main/java/
modules/presentation/trunk/ajax/src/main/java/org/
modules/presentation/trunk/ajax/src/main/java/org/jboss/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/Presentation.gwt.xml
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemote.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemoteAsync.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/AddChild.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/AddObject.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/CreateChildren.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/DestroyChildren.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/ModelUpdate.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/ObjectType.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/RemoveChild.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/RemoveObject.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxAction.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxRequest.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxResponse.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/OpaqueWindowAction.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/RefreshAction.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Bootstrap.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/DOMTools.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/ElementListener.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/Presentation.html
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientImpl.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/protocol/
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/protocol/AjaxActionDecoderContext.java
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/protocol/AjaxActionEncoderContext.java
modules/presentation/trunk/ajax/src/main/resources/
modules/presentation/trunk/ajax/src/test/
modules/presentation/trunk/ajax/src/test/java/
modules/presentation/trunk/ajax/src/test/resources/
Log:
replacing ajax with refactored impl
Added: modules/presentation/trunk/ajax/pom.xml
===================================================================
--- modules/presentation/trunk/ajax/pom.xml (rev 0)
+++ modules/presentation/trunk/ajax/pom.xml 2008-06-12 15:24:25 UTC (rev 11004)
@@ -0,0 +1,173 @@
+<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-ajax</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Portal Presentation Framework - Ajax 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>com.google.gwt</groupId>
+ <artifactId>gwt-user</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>
+
+ <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>
+
+ </dependencies>
+
+ <profiles>
+ <profile>
+ <id>gwt-mac</id>
+ <activation>
+ <os>
+ <family>mac</family>
+ </os>
+ </activation>
+ <properties>
+ <gwt.os>mac</gwt.os>
+
<gwt.compiler.classpath>${maven.dependency.com.google.gwt.gwt-dev-mac.jar.path}</gwt.compiler.classpath>
+ </properties>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-dev-mac</artifactId>
+ <version>${version.gwt}</version>
+ <scope>package</scope>
+ </dependency>
+ </dependencies>
+ </profile>
+ </profiles>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.jvnet.maven-antrun-extended-plugin</groupId>
+ <artifactId>maven-antrun-extended-plugin</artifactId>
+ <version>1.13</version>
+ <dependencies>
+ <dependency>
+ <groupId>com.google.gwt</groupId>
+ <artifactId>gwt-user</artifactId>
+ <version>${version.gwt}</version>
+ </dependency>
+ </dependencies>
+ <executions>
+ <execution>
+ <id>package</id>
+ <phase>package</phase>
+ <configuration>
+ <tasks>
+ <java
+ fork="true"
+ classname="com.google.gwt.dev.GWTCompiler">
+ <classpath>
+ <pathelement
path="${basedir}/src/main/java"/>
+ <pathelement
location="${maven.dependency.com.google.gwt.gwt-user.jar.path}"/>
+ <pathelement
location="${gwt.compiler.classpath}"/>
+ </classpath>
+ <arg line="-out
${basedir}/target/gwt-client/"/>
+ <arg
line="org.jboss.portal.presentation.ajax.Presentation"/>
+ </java>
+ </tasks>
+ </configuration>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <configuration>
+ <descriptors>
+ <descriptor>src/assemble/presentation-war.xml</descriptor>
+ </descriptors>
+ </configuration>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <phase>package</phase>
+ <goals>
+ <goal>attached</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
Added: modules/presentation/trunk/ajax/src/assemble/presentation-war.xml
===================================================================
--- modules/presentation/trunk/ajax/src/assemble/presentation-war.xml
(rev 0)
+++ modules/presentation/trunk/ajax/src/assemble/presentation-war.xml 2008-06-12 15:24:25
UTC (rev 11004)
@@ -0,0 +1,50 @@
+<assembly>
+ <formats>
+ <format>war</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+
+ <fileSet>
+
<directory>target/gwt-client/org.jboss.portal.presentation.ajax.Presentation</directory>
+ <outputDirectory></outputDirectory>
+ </fileSet>
+
+ </fileSets>
+
+<!--
+ <dependencySets>
+ <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>org.jboss.portal.presentation:presentation-portlet</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>
+
+ <include>com.google.gwt:gwt-user</include>
+
+ </includes>
+ </dependencySet>
+ </dependencySets>
+-->
+
+</assembly>
Added:
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/context.xml
===================================================================
---
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/context.xml
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/context.xml 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Context privileged="true"/>
\ No newline at end of file
Added:
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/jboss-beans.xml
===================================================================
---
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/jboss-beans.xml
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/jboss-beans.xml 2008-06-12
15:24:25 UTC (rev 11004)
@@ -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/ajax/src/main/artifacts/presentation-war/WEB-INF/jboss-web.xml
===================================================================
---
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/jboss-web.xml
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/jboss-web.xml 2008-06-12
15:24:25 UTC (rev 11004)
@@ -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
Added:
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml
===================================================================
---
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/page-structure.xml 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<context-def
+ xmlns="urn:jboss:portal:presentation:page:1.0"
+
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>
+ <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>
+ </window-def>
+ <window-def name="windowB">
+ <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 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>
+ </page-def>
+ </page-def>
+ <page-def name="default-sibling-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>
+ </window-def>
+ <window-def name="windowB">
+ <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>
+ <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>
+ <window-def name="windowE">
+ <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>
+</context-def>
Added:
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/portlet.xml
===================================================================
---
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/portlet.xml
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/portlet.xml 2008-06-12
15:24:25 UTC (rev 11004)
@@ -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>
+
Added:
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/web.xml
===================================================================
--- modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/web.xml
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/artifacts/presentation-war/WEB-INF/web.xml 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,50 @@
+<?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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<web-app version="2.4"
+
xmlns="http://java.sun.com/xml/ns/j2ee"
+
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>AjaxPresentationServlet</servlet-name>
+
<servlet-class>org.jboss.portal.presentation.ajax.server.PresentationClientServlet</servlet-class>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>AjaxPresentationServlet</servlet-name>
+ <url-pattern>/remote</url-pattern>
+ </servlet-mapping>
+
+</web-app>
\ No newline at end of file
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/Presentation.gwt.xml
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/Presentation.gwt.xml
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/Presentation.gwt.xml 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,4 @@
+<module>
+ <inherits name="com.google.gwt.user.User"/>
+ <entry-point
class="org.jboss.portal.presentation.ajax.client.PresentationClientAgent"/>
+</module>
\ No newline at end of file
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientAgent.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,92 @@
+/******************************************************************************
+ * 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.ajax.client;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import org.jboss.portal.presentation.ajax.client.model.update.ModelUpdate;
+import org.jboss.portal.presentation.ajax.client.model.AjaxObject;
+import org.jboss.portal.presentation.ajax.client.utils.Bootstrap;
+
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PresentationClientAgent implements EntryPoint
+{
+
+
+
+ /** . */
+ private Map pages = new HashMap();
+
+ /** . */
+ private PresentationClientRemoteAsync remote;
+
+ public void onModuleLoad()
+ {
+ Bootstrap.init();
+
+ // Initialize the remote service
+ remote =
(PresentationClientRemoteAsync)GWT.create(PresentationClientRemote.class);
+ ServiceDefTarget endpoint = (ServiceDefTarget)remote;
+ String moduleRelativeURL = GWT.getModuleBaseURL() + "remote";
+ endpoint.setServiceEntryPoint(moduleRelativeURL);
+
+ //
+ AsyncCallback callback = new AsyncCallback()
+ {
+ public void onFailure(Throwable throwable)
+ {
+ Window.alert("Ping failed " + throwable.getMessage());
+ }
+
+ public void onSuccess(Object o)
+ {
+ ModelUpdate[] updates = (ModelUpdate[])o;
+
+ //
+ AjaxObject.Context context = new AjaxObject.Context();
+
+ //
+ context.update(updates);
+
+ //
+ context.getRoot().refresh();
+
+ //
+ RootPanel.get().add(context.getRoot().getWidget());
+ }
+ };
+
+ //
+ remote.ping(callback);
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemote.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemote.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemote.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -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.ajax.client;
+
+import com.google.gwt.user.client.rpc.RemoteService;
+import org.jboss.portal.presentation.ajax.client.model.update.ModelUpdate;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxRequest;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxResponse;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface PresentationClientRemote extends RemoteService
+{
+ ModelUpdate[] ping();
+
+ String render(String windowId);
+
+ AjaxResponse process(AjaxRequest request);
+
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemoteAsync.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemoteAsync.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/PresentationClientRemoteAsync.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,40 @@
+/******************************************************************************
+ * 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.ajax.client;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxRequest;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface PresentationClientRemoteAsync
+{
+
+ void ping(AsyncCallback async);
+
+ void render(String windowId, AsyncCallback async);
+
+ void process(AjaxRequest request, AsyncCallback async);
+}
\ No newline at end of file
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxObject.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,181 @@
+/******************************************************************************
+ * 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.ajax.client.model;
+
+import com.google.gwt.user.client.ui.Widget;
+
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Collection;
+
+import org.jboss.portal.presentation.ajax.client.model.update.ModelUpdate;
+import org.jboss.portal.presentation.ajax.client.model.update.AddObject;
+import org.jboss.portal.presentation.ajax.client.model.update.ObjectType;
+import org.jboss.portal.presentation.ajax.client.model.update.CreateChildren;
+import org.jboss.portal.presentation.ajax.client.model.update.AddChild;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public abstract class AjaxObject
+{
+
+ /** . */
+ private Context context;
+
+ /** . */
+ private final String id;
+
+ /** . */
+ private Map children;
+
+ /** . */
+ private AjaxObject parent;
+
+ protected AjaxObject(String id)
+ {
+ this.id = id;
+ this.children = new HashMap();
+ }
+
+ public final Context getContext()
+ {
+ return context;
+ }
+
+ public Collection getChildren()
+ {
+ return children.values();
+ }
+
+ public final String getId()
+ {
+ return id;
+ }
+
+ public final AjaxObject getParent()
+ {
+ return parent;
+ }
+
+ private void addChild(AjaxObject child)
+ {
+ // Create relationship
+ children.put(child.getId(), child);
+ child.parent = this;
+
+ // Perform DOM wiring
+ doAddChild(child);
+ }
+
+ public void refresh()
+ {
+ doRefresh();
+ }
+
+ protected abstract void doRefresh();
+
+ protected abstract void doAddChild(AjaxObject child);
+
+ public abstract Widget getWidget();
+
+ public static class Context
+ {
+ /** All the known objects. */
+ private final Map objects;
+
+ /** . */
+ private AjaxPage root;
+
+ public Context()
+ {
+ this.objects = new HashMap();
+ }
+
+ public AjaxObject getObject(String objectId)
+ {
+ return (AjaxObject)objects.get(objectId);
+ }
+
+ public AjaxPage getRoot()
+ {
+ return root;
+ }
+
+ public void update(ModelUpdate[] updates)
+ {
+ for (int i = 0; i < updates.length;i++)
+ {
+ ModelUpdate update = updates[i];
+
+ //
+ if (update instanceof AddObject)
+ {
+ AddObject addObject = (AddObject)update;
+
+ //
+ AjaxObject object = null;
+
+ //
+ switch (addObject.getObjectType())
+ {
+ case ObjectType.PAGE:
+ if (root != null)
+ {
+ throw new IllegalStateException("Already a root
page");
+ }
+
+ //
+ object = root = new AjaxPage(addObject.getObjectId());
+ break;
+ case ObjectType.WINDOW:
+ object = new AjaxWindow(addObject.getObjectId());
+ break;
+ case ObjectType.PANE:
+ object = new AjaxPane(addObject.getObjectId());
+ break;
+ }
+
+ // Wire to the context
+ objects.put(addObject.getObjectId(), object);
+ object.context = this;
+ }
+ else if (update instanceof CreateChildren)
+ {
+ }
+ else if (update instanceof AddChild)
+ {
+ AddChild addChild = (AddChild)update;
+
+ //
+ AjaxObject parent = (AjaxObject)objects.get(addChild.getParentId());
+ AjaxObject child = (AjaxObject)objects.get(addChild.getChildId());
+
+ //
+ parent.addChild(child);
+ }
+ }
+ }
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPage.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * 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.ajax.client.model;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AjaxPage extends AjaxPane
+{
+ public AjaxPage(String id)
+ {
+ super(id);
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxPane.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,89 @@
+/******************************************************************************
+ * 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.ajax.client.model;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Label;
+
+import java.util.Iterator;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AjaxPane extends AjaxObject
+{
+
+ /** . */
+ private Label title;
+
+ /** . */
+ private VerticalPanel container;
+
+ /** . */
+ private VerticalPanel widget;
+
+ public AjaxPane(String id)
+ {
+ super(id);
+
+ //
+ Label title = new Label("Pane " + id);
+
+ //
+ VerticalPanel container = new VerticalPanel();
+ VerticalPanel widget = new VerticalPanel();
+ widget.add(title);
+ widget.add(container);
+
+ //
+ this.title = title;
+ this.container = container;
+ this.widget = widget;
+ }
+
+ protected void doAddChild(AjaxObject child)
+ {
+ Widget childWidget = child.getWidget();
+
+ //
+ container.add(childWidget);
+ }
+
+ public Widget getWidget()
+ {
+ return widget;
+ }
+
+ protected void doRefresh()
+ {
+ for (Iterator i = getChildren().iterator();i.hasNext();)
+ {
+ AjaxObject child = (AjaxObject)i.next();
+
+ //
+ child.refresh();
+ }
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/AjaxWindow.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,178 @@
+/******************************************************************************
+ * 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.ajax.client.model;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.core.client.GWT;
+import org.jboss.portal.presentation.ajax.client.PresentationClientRemoteAsync;
+import org.jboss.portal.presentation.ajax.client.PresentationClientRemote;
+import org.jboss.portal.presentation.ajax.client.protocol.OpaqueWindowAction;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxRequest;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxResponse;
+import org.jboss.portal.presentation.ajax.client.utils.DOMTools;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AjaxWindow extends AjaxObject
+{
+
+ /** . */
+ private HTML widget;
+
+ public AjaxWindow(String id)
+ {
+ super(id);
+
+ //
+ this.widget = new HTML("Window " + id);
+
+ //
+ this.widget.addClickListener(new ClickListener()
+ {
+ public void onClick(Widget widget)
+ {
+ Event event = DOM.eventGetCurrentEvent();
+
+ //
+ Element target = DOM.eventGetTarget(event);
+
+ //
+ String tagName = DOMTools.getTagName(target);
+
+ //
+ if (tagName.equals("A"))
+ {
+ DOM.eventPreventDefault(event);
+
+ //
+ String uri = DOM.getElementAttribute(target, "href");
+
+ // This is a get
+ Window.alert("This is link click " + uri);
+
+ //
+ OpaqueWindowAction windowAction = new OpaqueWindowAction(uri);
+
+ //
+ final PresentationClientRemoteAsync remote =
(PresentationClientRemoteAsync)GWT.create(PresentationClientRemote.class);
+ ServiceDefTarget endpoint = (ServiceDefTarget)remote;
+ String moduleRelativeURL = GWT.getModuleBaseURL() + "remote";
+ endpoint.setServiceEntryPoint(moduleRelativeURL);
+
+ //
+ AjaxRequest request = new AjaxRequest();
+ request.setAction(windowAction);
+
+ //
+ //
+ remote.process(request, new AsyncCallback()
+ {
+ public void onFailure(Throwable throwable)
+ {
+ }
+
+ public void onSuccess(Object o)
+ {
+ AjaxResponse response = (AjaxResponse)o;
+
+ for (int i = 0; i < response.getStaleObjects().length; i++)
+ {
+ String staleObject = response.getStaleObjects()[i];
+
+ AjaxObject stale = getContext().getObject(staleObject);
+
+ if (stale != null)
+ {
+ Window.alert("Going to refresh portlet window " +
staleObject);
+ stale.refresh();
+ }
+ else
+ {
+ Window.alert("No stale window found for " +
staleObject);
+ }
+
+ }
+
+ }
+ });
+ }
+ else if (tagName.equals("INPUT"))
+ {
+ DOM.eventPreventDefault(event);
+
+ // This is maybe a form submit
+ Window.alert("This is maybe a form submit");
+ }
+ }
+ });
+ }
+
+ protected void doAddChild(AjaxObject child)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Widget getWidget()
+ {
+ return widget;
+ }
+
+ protected void doRefresh()
+ {
+
+ final PresentationClientRemoteAsync remote =
(PresentationClientRemoteAsync)GWT.create(PresentationClientRemote.class);
+
+ ServiceDefTarget endpoint = (ServiceDefTarget)remote;
+ String moduleRelativeURL = GWT.getModuleBaseURL() + "remote";
+ endpoint.setServiceEntryPoint(moduleRelativeURL);
+
+ AsyncCallback callback = new AsyncCallback()
+ {
+ public void onFailure(Throwable throwable)
+ {
+ Window.alert("Refresh failed " + throwable.getMessage());
+ }
+
+ public void onSuccess(Object o)
+ {
+ String content = (String)o;
+
+ //
+ widget.setHTML(content);
+ }
+ };
+
+ //
+ remote.render(getId(), callback);
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/AddChild.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/AddChild.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/AddChild.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * 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.ajax.client.model.update;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AddChild extends ModelUpdate
+{
+
+ /** . */
+ private String parentId;
+
+ /** . */
+ private String childId;
+
+ public AddChild()
+ {
+ }
+
+ public AddChild(String parentId, String childId)
+ {
+ this.parentId = parentId;
+ this.childId = childId;
+ }
+
+ public String getParentId()
+ {
+ return parentId;
+ }
+
+ public void setParentId(String parentId)
+ {
+ this.parentId = parentId;
+ }
+
+ public String getChildId()
+ {
+ return childId;
+ }
+
+ public void setChildId(String childId)
+ {
+ this.childId = childId;
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/AddObject.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/AddObject.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/AddObject.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * 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.ajax.client.model.update;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AddObject extends ModelUpdate
+{
+
+ /** . */
+ private String objectId;
+
+ /** . */
+ private int objectType;
+
+ public AddObject()
+ {
+ }
+
+ public AddObject(String objectId, int objectType)
+ {
+ this.objectId = objectId;
+ this.objectType = objectType;
+ }
+
+ public String getObjectId()
+ {
+ return objectId;
+ }
+
+ public void setObjectId(String objectId)
+ {
+ this.objectId = objectId;
+ }
+
+ public int getObjectType()
+ {
+ return objectType;
+ }
+
+ public void setObjectType(int objectType)
+ {
+ this.objectType = objectType;
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/CreateChildren.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/CreateChildren.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/CreateChildren.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * 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.ajax.client.model.update;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class CreateChildren extends ModelUpdate
+{
+
+ /** . */
+ private String objectId;
+
+ public CreateChildren()
+ {
+ }
+
+ public CreateChildren(String objectId)
+ {
+ this.objectId = objectId;
+ }
+
+ public String getObjectId()
+ {
+ return objectId;
+ }
+
+ public void setObjectId(String objectId)
+ {
+ this.objectId = objectId;
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/DestroyChildren.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/DestroyChildren.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/DestroyChildren.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * 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.ajax.client.model.update;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class DestroyChildren extends ModelUpdate
+{
+
+ /** . */
+ private String objectId;
+
+ public DestroyChildren()
+ {
+ }
+
+ public DestroyChildren(String objectId)
+ {
+ this.objectId = objectId;
+ }
+
+ public String getObjectId()
+ {
+ return objectId;
+ }
+
+ public void setObjectId(String objectId)
+ {
+ this.objectId = objectId;
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/ModelUpdate.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/ModelUpdate.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/ModelUpdate.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,33 @@
+/******************************************************************************
+ * 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.ajax.client.model.update;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class ModelUpdate implements IsSerializable
+{
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/ObjectType.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/ObjectType.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/ObjectType.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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.ajax.client.model.update;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public final class ObjectType
+{
+
+ /** . */
+ public static final int CONTEXT = 0;
+
+ /** . */
+ public static final int PAGE = 1;
+
+ /** . */
+ public static final int WINDOW = 2;
+
+ /** . */
+ public static final int PANE = 3;
+
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/RemoveChild.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/RemoveChild.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/RemoveChild.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,68 @@
+/******************************************************************************
+ * 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.ajax.client.model.update;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class RemoveChild extends ModelUpdate
+{
+
+ /** . */
+ private String parentId;
+
+ /** . */
+ private String childId;
+
+ public RemoveChild()
+ {
+ }
+
+ public RemoveChild(String parentId, String childId)
+ {
+ this.parentId = parentId;
+ this.childId = childId;
+ }
+
+ public String getParentId()
+ {
+ return parentId;
+ }
+
+ public void setParentId(String parentId)
+ {
+ this.parentId = parentId;
+ }
+
+ public String getChildId()
+ {
+ return childId;
+ }
+
+ public void setChildId(String childId)
+ {
+ this.childId = childId;
+ }
+}
+
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/RemoveObject.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/RemoveObject.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/model/update/RemoveObject.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,53 @@
+/******************************************************************************
+ * 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.ajax.client.model.update;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class RemoveObject extends ModelUpdate
+{
+
+ /** . */
+ private String objectId;
+
+ public RemoveObject()
+ {
+ }
+
+ public RemoveObject(String objectId)
+ {
+ this.objectId = objectId;
+ }
+
+ public String getObjectId()
+ {
+ return objectId;
+ }
+
+ public void setObjectId(String objectId)
+ {
+ this.objectId = objectId;
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxAction.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxAction.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxAction.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,35 @@
+/******************************************************************************
+ * 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.ajax.client.protocol;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+/**
+ * An ajax action.
+ *
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AjaxAction implements IsSerializable
+{
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxRequest.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxRequest.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxRequest.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -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.ajax.client.protocol;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AjaxRequest implements IsSerializable
+{
+
+ /** The page id that fired the request. */
+ private String pageId;
+
+ /** The action. */
+ private AjaxAction action;
+
+ public String getPageId()
+ {
+ return pageId;
+ }
+
+ public void setPageId(String pageId)
+ {
+ this.pageId = pageId;
+ }
+
+ public AjaxAction getAction()
+ {
+ return action;
+ }
+
+ public void setAction(AjaxAction action)
+ {
+ this.action = action;
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxResponse.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxResponse.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/AjaxResponse.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,65 @@
+/******************************************************************************
+ * 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.ajax.client.protocol;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AjaxResponse implements IsSerializable
+{
+
+ /** . */
+ private static final String[] EMPTY_STRINGS = new String[0];
+
+ /** . */
+ private String[] staleObjects;
+
+ public AjaxResponse()
+ {
+ this(EMPTY_STRINGS);
+ }
+
+ public AjaxResponse(String[] staleObjects)
+ {
+ if (staleObjects == null)
+ {
+ throw new IllegalArgumentException();
+ }
+
+ //
+ this.staleObjects = staleObjects;
+ }
+
+ public String[] getStaleObjects()
+ {
+ return staleObjects;
+ }
+
+ public void setStaleObjects(String[] staleObjects)
+ {
+ this.staleObjects = staleObjects;
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/OpaqueWindowAction.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/OpaqueWindowAction.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/OpaqueWindowAction.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -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.ajax.client.protocol;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class OpaqueWindowAction extends AjaxAction
+{
+
+ /** . */
+ private String uri;
+
+ public OpaqueWindowAction()
+ {
+ }
+
+ public OpaqueWindowAction(String uri)
+ {
+ this.uri = uri;
+ }
+
+ public String getURI()
+ {
+ return uri;
+ }
+
+ public void setURI(String uri)
+ {
+ this.uri = uri;
+ }
+
+ public String toString()
+ {
+ return "OpaqueWindowAction[uri=" + uri + "]";
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/RefreshAction.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/RefreshAction.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/protocol/RefreshAction.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,31 @@
+/******************************************************************************
+ * 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.ajax.client.protocol;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class RefreshAction extends AjaxAction
+{
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Bootstrap.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Bootstrap.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/Bootstrap.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,144 @@
+/******************************************************************************
+ * 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.ajax.client.utils;
+
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Event;
+import com.google.gwt.user.client.Window;
+
+import java.util.ArrayList;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class Bootstrap
+{
+
+ /** . */
+ private static Bootstrap instance;
+
+ public static void init()
+ {
+ if (instance == null)
+ {
+ instance = new Bootstrap();
+ instance.perform();
+ }
+ }
+
+ /** . */
+ private ArrayList listeners;
+
+ private Bootstrap()
+ {
+ listeners = new ArrayList();
+ }
+
+ private void perform()
+ {
+ JavaScriptObject overridenSubmit = getOverridenSubmitFunction();
+
+ //
+ patch(overridenSubmit);
+ }
+
+ public void addListener(ElementListener listener)
+ {
+ ArrayList copy = new ArrayList(listeners);
+ copy.add(listener);
+ listeners = copy;
+ }
+
+ private static void handle(Event event, Element element)
+ {
+ DOM.eventPreventDefault(event);
+
+ //
+ Window.alert("Element " + element + " clicked");
+
+// for (Iterator i = listeners.iterator();i.hasNext();)
+// {
+// ElementListener listener = (ElementListener)i.next();
+// listener.clicked(element);
+// }
+ }
+
+ private static void handle(Element element)
+ {
+ Window.alert("Element " + element + " clicked");
+// for (Iterator i = listeners.iterator();i.hasNext();)
+// {
+// ElementListener listener = (ElementListener)i.next();
+// listener.clicked(element);
+// }
+ }
+
+ /**
+ * Returns the submit function of the HTMLFormElement javascript object.
+ *
+ * @return the submit function
+ */
+ public native JavaScriptObject getNativeSubmitFunction()
+ /*-{
+ return $wnd.HTMLFormElement.prototype.submit;
+ }-*/;
+
+ /**
+ *
+ * @return
+ */
+ public native JavaScriptObject getOverridenSubmitFunction()
+ /*-{
+ function overrideSubmit(event)
+ {
+ if(event != null)
+ {
+ // It is a browser submit event
+ var target = event.target;
+
@org.jboss.portal.presentation.ajax.client.utils.Bootstrap::handle(Lcom/google/gwt/user/client/Event;Lcom/google/gwt/user/client/Element;)(event,target);
+ }
+ else
+ {
+ // It is a programmatic submit
+
@org.jboss.portal.presentation.ajax.client.utils.Bootstrap::handle(Lcom/google/gwt/user/client/Element;)(this);
+ }
+
+ //
+ }
+
+ //
+ return overrideSubmit;
+ }-*/;
+
+ /**
+ * @param overridenSubmit the patched submit
+ */
+ public native void patch(JavaScriptObject overridenSubmit)
+ /*-{
+ $wnd.HTMLFormElement.prototype.submit2 = $wnd.HTMLFormElement.prototype.submit;
+ $wnd.HTMLFormElement.prototype.submit = overridenSubmit;
+ }-*/;
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/DOMTools.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/DOMTools.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/DOMTools.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,44 @@
+/******************************************************************************
+ * 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.ajax.client.utils;
+
+import com.google.gwt.user.client.Element;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class DOMTools
+{
+
+ /**
+ * Returns an element tag name.
+ *
+ * @param element the element to obtain the tag name from
+ * @return the tag name value
+ */
+ public static native String getTagName(Element element)
+ /*-{
+ return element.nodeName;
+ }-*/;
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/ElementListener.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/ElementListener.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/client/utils/ElementListener.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,34 @@
+/******************************************************************************
+ * 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.ajax.client.utils;
+
+import com.google.gwt.user.client.Element;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public interface ElementListener
+{
+ void clicked(Element element);
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/Presentation.html
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/Presentation.html
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/public/Presentation.html 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,8 @@
+<html>
+ <head>
+ <title>Presentation</title>
+ </head>
+ <body bgcolor="white">
+ <script language="javascript"
src="org.jboss.portal.presentation.ajax.Presentation.nocache.js"></script>
+ </body>
+</html>
\ No newline at end of file
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientImpl.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientImpl.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientImpl.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,81 @@
+/******************************************************************************
+ * 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.ajax.server;
+
+import org.jboss.portal.presentation.client.PresentationClient;
+import org.jboss.portal.presentation.state.navigational.NavigationalStateContext;
+import org.jboss.portal.presentation.protocol.ProtocolAction;
+import org.jboss.portal.presentation.protocol.codec.ActionEncoder;
+import
org.jboss.portal.presentation.impl.state.navigational.NavigationalStateContextImpl;
+import org.jboss.portal.presentation.ajax.server.protocol.AjaxActionEncoderContext;
+import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.common.servlet.URLFormat;
+
+import java.io.Writer;
+import java.io.IOException;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PresentationClientImpl implements PresentationClient
+{
+
+ /** . */
+ private ServletContextDispatcher dispatcher;
+
+ /** . */
+ private AjaxActionEncoderContext actionEncoderContext;
+
+ /** . */
+ private ActionEncoder encoder;
+
+ public PresentationClientImpl(
+ ServletContextDispatcher dispatcher,
+ ActionEncoder encoder)
+ {
+ this.dispatcher = dispatcher;
+ this.encoder = encoder;
+ this.actionEncoderContext = new AjaxActionEncoderContext();
+ }
+
+ public ServletContextDispatcher getDispatcher()
+ {
+ return dispatcher;
+ }
+
+ public NavigationalStateContext getNavigationalStateContext()
+ {
+ return new NavigationalStateContextImpl();
+ }
+
+ public void renderURL(Writer writer, ProtocolAction action, URLFormat format) throws
IOException
+ {
+ writer.write(renderURL(action, format));
+ }
+
+ public String renderURL(ProtocolAction action, URLFormat format) throws
IllegalArgumentException
+ {
+ return encoder.encode(action, actionEncoderContext);
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/PresentationClientServlet.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,211 @@
+/******************************************************************************
+ * 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.ajax.server;
+
+import com.google.gwt.user.server.rpc.RemoteServiceServlet;
+import org.jboss.portal.presentation.ajax.client.PresentationClientRemote;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxAction;
+import org.jboss.portal.presentation.ajax.client.protocol.OpaqueWindowAction;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxResponse;
+import org.jboss.portal.presentation.ajax.client.protocol.AjaxRequest;
+import org.jboss.portal.presentation.ajax.client.model.update.ModelUpdate;
+import org.jboss.portal.presentation.ajax.server.model.AjaxViewPortContext;
+import org.jboss.portal.presentation.ajax.server.protocol.AjaxActionDecoderContext;
+import org.jboss.portal.presentation.server.PresentationServer;
+import org.jboss.portal.presentation.server.PresentationServerException;
+import org.jboss.portal.presentation.server.PresentationRequest;
+import org.jboss.portal.presentation.server.PresentationResponse;
+import org.jboss.portal.presentation.model.UIModel;
+import org.jboss.portal.presentation.model.ViewPort;
+import org.jboss.portal.presentation.model.ViewPortScope;
+import org.jboss.portal.presentation.model.UINode;
+import org.jboss.portal.presentation.model.content.ContentFragment;
+import org.jboss.portal.presentation.impl.model.UIModelImpl;
+import org.jboss.portal.presentation.impl.model.pull.DetachedViewPortContext;
+import
org.jboss.portal.presentation.impl.state.navigational.NavigationalStateContextImpl;
+import org.jboss.portal.presentation.view.DefaultPageViewPortScope;
+import org.jboss.portal.presentation.view.PageViewPortScope;
+import org.jboss.portal.presentation.state.structural.StructuralStateContext;
+import org.jboss.portal.presentation.client.PresentationClient;
+import org.jboss.portal.presentation.protocol.codec.ActionEncoder;
+import org.jboss.portal.presentation.protocol.codec.ActionDecoder;
+import org.jboss.portal.presentation.protocol.ProtocolAction;
+import org.jboss.portal.web.ServletContextDispatcher;
+import org.jboss.portal.web.ServletContainer;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.impl.DefaultServletContainerFactory;
+import org.jboss.portal.common.http.QueryStringParser;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.ServletException;
+import java.util.Map;
+import java.util.Collections;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class PresentationClientServlet extends RemoteServiceServlet implements
PresentationClientRemote
+{
+
+
+
+ public void init() throws ServletException
+ {
+ super.init();
+ }
+
+ private String getDefaultPageId(PresentationServer server)
+ {
+ StructuralStateContext ssc = server.getStructuralStateContext();
+ ViewPortScope scope = new DefaultPageViewPortScope(ssc.getRootId());
+ DetachedViewPortContext context = new DetachedViewPortContext();
+ UIModel model = new UIModelImpl(null, ssc);
+ ViewPort viewPort = model.createViewPort(context, scope);
+ viewPort.refresh();
+ UINode root = context.getNode(ssc.getRootId());
+ UINode defaultPage = root.getChildren().iterator().next();
+ return defaultPage.getObject().getId();
+ }
+
+ public ModelUpdate[] ping()
+ {
+ PresentationServer server = getPresentationServer();
+
+ //
+ UIModel model = new UIModelImpl(new NavigationalStateContextImpl(),
server.getStructuralStateContext());
+
+ //
+ AjaxViewPortContext viewPortContext = new AjaxViewPortContext();
+
+ //
+ String defaultPageId = getDefaultPageId(server);
+
+ //
+ ViewPort viewPort = model.createViewPort(viewPortContext, new
PageViewPortScope(defaultPageId));
+
+ //
+ viewPort.refresh();
+
+ //
+ return viewPortContext.getDelta();
+ }
+
+ private PresentationServer getPresentationServer()
+ {
+ return
(PresentationServer)getServletContext().getAttribute("PresentationServer");
+ }
+
+ private PresentationClientImpl createPresentationClient()
+ {
+ HttpServletRequest req = getThreadLocalRequest();
+ HttpServletResponse resp = getThreadLocalResponse();
+ ServletContainer container =
DefaultServletContainerFactory.getInstance().getServletContainer();
+ ServletContextDispatcher dispatcher = new ServletContextDispatcher(req, resp,
container);
+ ActionEncoder encoder =
(ActionEncoder)getServletContext().getAttribute("ActionEncoder");
+ return new PresentationClientImpl(dispatcher, encoder);
+ }
+
+ public String render(String windowId)
+ {
+ PresentationClient client = createPresentationClient();
+ PresentationServer server = getPresentationServer();
+
+ //
+ try
+ {
+ ContentFragment fragment = server.renderWindow(client, windowId);
+ return fragment.getMarkup();
+ }
+ catch (PresentationServerException e)
+ {
+ return "An error occured";
+ }
+ }
+
+ public AjaxResponse process(AjaxRequest request)
+ {
+ AjaxAction action = request.getAction();
+
+ //
+ ActionDecoder decoder =
(ActionDecoder)getServletContext().getAttribute("ActionDecoder");
+
+ //
+ System.out.println("Should handle action " + action);
+
+ if (action instanceof OpaqueWindowAction)
+ {
+ String uri = ((OpaqueWindowAction)action).getURI();
+
+
+ String path;
+ Map<String, String[]> queryParameterMap;
+
+ //
+ int index = uri.indexOf('?');
+ if (index > -1)
+ {
+ path = uri.substring(0, index);
+ queryParameterMap =
QueryStringParser.getInstance().parseQueryString(uri.substring(index + 1));
+ }
+ else
+ {
+ path = uri;
+ queryParameterMap = Collections.emptyMap();
+ }
+
+ ProtocolAction protocolAction = decoder.decode(new
AjaxActionDecoderContext(WebRequest.Verb.GET, path, queryParameterMap, null));
+
+ System.out.println("decoded protocolAction = " + protocolAction);
+
+ // Now we execute
+ PresentationServer server = getPresentationServer();
+
+ PresentationClient client = createPresentationClient();
+
+ PresentationRequest prequest = new PresentationRequest(protocolAction);
+
+ try
+ {
+ PresentationResponse response = server.process(client, prequest);
+
+ System.out.println("response = " + response);
+ System.out.println("Stale windows " + response.getStaleObjects());
+
+ //
+ return new AjaxResponse(response.getStaleObjects().toArray(new
String[response.getStaleObjects().size()]));
+ }
+ catch (PresentationServerException e)
+ {
+ e.printStackTrace();
+
+ return new AjaxResponse();
+ }
+ }
+ else
+ {
+ return new AjaxResponse();
+ }
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/model/AjaxViewPortContext.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,137 @@
+/******************************************************************************
+ * 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.ajax.server.model;
+
+import org.jboss.portal.presentation.model.ViewPortContext;
+import org.jboss.portal.presentation.model.ui.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.model.ui.UIPane;
+import org.jboss.portal.presentation.ajax.client.model.update.ModelUpdate;
+import org.jboss.portal.presentation.ajax.client.model.update.AddObject;
+import org.jboss.portal.presentation.ajax.client.model.update.RemoveObject;
+import org.jboss.portal.presentation.ajax.client.model.update.CreateChildren;
+import org.jboss.portal.presentation.ajax.client.model.update.DestroyChildren;
+import org.jboss.portal.presentation.ajax.client.model.update.AddChild;
+import org.jboss.portal.presentation.ajax.client.model.update.RemoveChild;
+import org.jboss.portal.presentation.ajax.client.model.update.ObjectType;
+import org.jboss.portal.common.NotYetImplemented;
+
+import java.util.ArrayList;
+import java.util.Map;
+import java.util.HashMap;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AjaxViewPortContext implements ViewPortContext
+{
+
+ /** . */
+ private ArrayList<ModelUpdate> updates;
+
+ /** . */
+ private Map<String, UIObject> objects;
+
+ public AjaxViewPortContext()
+ {
+ objects = new HashMap<String, UIObject>();
+ updates = new ArrayList<ModelUpdate>();
+ }
+
+ public ModelUpdate[] getDelta()
+ {
+ ModelUpdate[] tmp = updates.toArray(new ModelUpdate[updates.size()]);
+ updates.clear();
+ return tmp;
+ }
+
+ public UIObject getObject(String objectId)
+ {
+ return objects.get(objectId);
+ }
+
+ public void addObject(UIObject object)
+ {
+ objects.put(object.getId(), object);
+
+ int objectType;
+ if (object instanceof UIContext)
+ {
+ objectType = ObjectType.CONTEXT;
+ }
+ else if (object instanceof UIPage)
+ {
+ objectType = ObjectType.PAGE;
+ }
+ else if (object instanceof UIWindow)
+ {
+ objectType = ObjectType.WINDOW;
+ }
+ else if (object instanceof UIPane)
+ {
+ objectType = ObjectType.PANE;
+ }
+ else
+ {
+ throw new NotYetImplemented();
+ }
+
+ //
+ updates.add(new AddObject(object.getId(), objectType));
+ }
+
+ public void updateObject(String objectId)
+ {
+ }
+
+ public void removeObject(String objectId)
+ {
+ objects.remove(objectId);
+
+ //
+ updates.add(new RemoveObject(objectId));
+ }
+
+ public void createChildren(String parentId)
+ {
+ updates.add(new CreateChildren(parentId));
+ }
+
+ public void destroyChildren(String parentId)
+ {
+ updates.add(new DestroyChildren(parentId));
+ }
+
+ public void addChild(String parentId, String childId)
+ {
+ updates.add(new AddChild(parentId, childId));
+ }
+
+ public void removeChild(String parentId, String childId)
+ {
+ updates.add(new RemoveChild(parentId, childId));
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/protocol/AjaxActionDecoderContext.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/protocol/AjaxActionDecoderContext.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/protocol/AjaxActionDecoderContext.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,77 @@
+/******************************************************************************
+ * 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.ajax.server.protocol;
+
+import org.jboss.portal.presentation.protocol.codec.ActionDecoderContext;
+import org.jboss.portal.web.WebRequest;
+import org.jboss.portal.web.Body;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AjaxActionDecoderContext implements ActionDecoderContext
+{
+
+ /** . */
+ private WebRequest.Verb verb;
+
+ /** . */
+ private String path;
+
+ /** . */
+ private Map<String, String[]> queryParameterMap;
+
+ /** . */
+ private Body body;
+
+ public AjaxActionDecoderContext(WebRequest.Verb verb, String path, Map<String,
String[]> queryParameterMap, Body body)
+ {
+ this.verb = verb;
+ this.path = path;
+ this.queryParameterMap = queryParameterMap;
+ this.body = body;
+ }
+
+ public WebRequest.Verb getVerb()
+ {
+ return verb;
+ }
+
+ public String getPath()
+ {
+ return path;
+ }
+
+ public Map<String, String[]> getQueryParameterMap()
+ {
+ return queryParameterMap;
+ }
+
+ public Body getBody()
+ {
+ return body;
+ }
+}
Added:
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/protocol/AjaxActionEncoderContext.java
===================================================================
---
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/protocol/AjaxActionEncoderContext.java
(rev 0)
+++
modules/presentation/trunk/ajax/src/main/java/org/jboss/portal/presentation/ajax/server/protocol/AjaxActionEncoderContext.java 2008-06-12
15:24:25 UTC (rev 11004)
@@ -0,0 +1,84 @@
+/******************************************************************************
+ * 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.ajax.server.protocol;
+
+import org.jboss.portal.presentation.protocol.codec.ActionEncoderContext;
+
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:julien@jboss-portal.org">Julien
Viet</a>
+ * @version $Revision: 630 $
+ */
+public class AjaxActionEncoderContext implements ActionEncoderContext
+{
+
+ public String getNavigationalState()
+ {
+ return null;
+ }
+
+ /**
+ * todo rewrite me because it's really much basic
+ */
+ public String renderURL(String path, Map<String, String[]> parameters) throws
IllegalArgumentException
+ {
+ StringBuffer buffer = new StringBuffer(path);
+
+ //
+ boolean first = true;
+ if (parameters != null)
+ {
+ for (Map.Entry parameter: parameters.entrySet())
+ {
+ String name = (String)parameter.getKey();
+
+ //
+ if (name == null)
+ {
+ throw new IllegalArgumentException("Null key in the parameter map are
not allowed");
+ }
+
+ //
+ String[] values = (String[])parameter.getValue();
+ for (String value : values)
+ {
+ if (value == null)
+ {
+ throw new IllegalArgumentException("Null value for the key "
+ name + " in the parameter map are not allowed");
+ }
+
+ //
+ buffer.append(first ? "?" : "&");
+ buffer.append(name);
+ buffer.append('=');
+ buffer.append(value);
+ first = false;
+ }
+ }
+ }
+
+ //
+ return buffer.toString();
+ }
+}