Author: chris.laprun(a)jboss.com
Date: 2009-06-25 12:30:42 -0400 (Thu, 25 Jun 2009)
New Revision: 13501
Added:
modules/wsrp/trunk/core/src/assemble/
modules/wsrp/trunk/core/src/assemble/portal-wsrp-client-jar.xml
modules/wsrp/trunk/core/src/assemble/portal-wsrp-war.xml
modules/wsrp/trunk/service/
modules/wsrp/trunk/service/pom.xml
modules/wsrp/trunk/service/src/
modules/wsrp/trunk/service/src/main/
modules/wsrp/trunk/service/src/main/resources/
modules/wsrp/trunk/service/src/main/resources/META-INF/
modules/wsrp/trunk/service/src/main/resources/META-INF/jboss-service.xml
modules/wsrp/trunk/service/src/main/resources/conf/
modules/wsrp/trunk/service/src/main/resources/conf/hibernate/
modules/wsrp/trunk/service/src/main/resources/conf/hibernate/consumer/
modules/wsrp/trunk/service/src/main/resources/conf/hibernate/consumer/domain.hbm.xml
modules/wsrp/trunk/service/src/main/resources/conf/hibernate/consumer/ehcache.xml
modules/wsrp/trunk/service/src/main/resources/conf/hibernate/consumer/hibernate.cfg.xml
modules/wsrp/trunk/service/src/main/resources/conf/producer/
modules/wsrp/trunk/service/src/main/resources/conf/producer/config.xml
modules/wsrp/trunk/service/src/main/resources/default-wsrp.xml
modules/wsrp/trunk/service/src/main/resources/dtd/
modules/wsrp/trunk/service/src/main/resources/dtd/jboss-wsrp-consumer_2_6.dtd
modules/wsrp/trunk/service/src/main/resources/dtd/jboss-wsrp-producer_2_6.dtd
modules/wsrp/trunk/service/src/main/resources/wsrp-aop.xml
modules/wsrp/trunk/service/src/main/resources/xsd/
modules/wsrp/trunk/service/src/main/resources/xsd/jboss-wsrp-consumer_2_6.xsd
modules/wsrp/trunk/service/src/main/resources/xsd/jboss-wsrp-producer_2_6.xsd
modules/wsrp/trunk/service/src/main/resources/xsd/jboss-wsrp-producer_2_7.xsd
modules/wsrp/trunk/service/src/main/resources/xsd/xml.xsd
modules/wsrp/trunk/src/
modules/wsrp/trunk/src/assemble/
modules/wsrp/trunk/src/assemble/wsrp-service.xml
modules/wsrp/trunk/test-support/
modules/wsrp/trunk/test-support/pom.xml
modules/wsrp/trunk/test-support/src/
modules/wsrp/trunk/test-support/src/main/
modules/wsrp/trunk/test-support/src/main/java/
modules/wsrp/trunk/test-support/src/main/java/org/
modules/wsrp/trunk/test-support/src/main/java/org/jboss/
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/BehaviorRegistry.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/InitCookieFakerHandler.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/MarkupBehavior.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/PortletManagementBehavior.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/RegistrationBehavior.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/ServiceDescriptionBehavior.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/TestProducerBehavior.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/TestWSRPProducer.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/TestWSRPProducerImpl.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicInstanceContext.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicPortalContext.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicSecurityContext.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicUserContext.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BehaviorBackedServiceFactory.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockConsumerRegistry.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockHttpServletRequest.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockHttpServletResponse.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockHttpSession.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockWSRPConsumer.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/ServiceObjectFactory.java
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/TestPortletInvocationContext.java
Modified:
modules/wsrp/trunk/admin-gui/pom.xml
modules/wsrp/trunk/build/pom.xml
modules/wsrp/trunk/core/pom.xml
modules/wsrp/trunk/pom.xml
Log:
- JBPORTAL-2186: More WSRP extraction
+ Extracted common test framework into test-support module
+ Extracted SAR generation to separate service module (still needs work)
+ Uses assembly plugin to generate client and server WSRP artefacts from core.
Modified: modules/wsrp/trunk/admin-gui/pom.xml
===================================================================
--- modules/wsrp/trunk/admin-gui/pom.xml 2009-06-25 15:10:55 UTC (rev 13500)
+++ modules/wsrp/trunk/admin-gui/pom.xml 2009-06-25 16:30:42 UTC (rev 13501)
@@ -41,6 +41,11 @@
<version>${project.version}</version>
</dependency>
<dependency>
+ <groupId>org.jboss.portal.wsrp</groupId>
+ <artifactId>wsrp-test-support</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
<groupId>javax.faces</groupId>
<artifactId>jsf-api</artifactId>
<version>1.2_12</version>
@@ -50,6 +55,11 @@
<artifactId>faces</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
+ <dependency>
+ <groupId>org.jboss.portal.common</groupId>
+ <artifactId>common-common</artifactId>
+ <version>${version.common}</version>
+ </dependency>
</dependencies>
Modified: modules/wsrp/trunk/build/pom.xml
===================================================================
--- modules/wsrp/trunk/build/pom.xml 2009-06-25 15:10:55 UTC (rev 13500)
+++ modules/wsrp/trunk/build/pom.xml 2009-06-25 16:30:42 UTC (rev 13501)
@@ -49,6 +49,7 @@
<!--All artifacts versions should be defined here-->
<properties>
<version.portlet>trunk-SNAPSHOT</version.portlet>
+ <version.common>trunk-SNAPSHOT</version.common>
<version.jaxrpc>1.1</version.jaxrpc>
<version.slf4j>1.5.6</version.slf4j>
<version.jbossas>4.2.3.GA</version.jbossas>
Modified: modules/wsrp/trunk/core/pom.xml
===================================================================
--- modules/wsrp/trunk/core/pom.xml 2009-06-25 15:10:55 UTC (rev 13500)
+++ modules/wsrp/trunk/core/pom.xml 2009-06-25 16:30:42 UTC (rev 13501)
@@ -48,12 +48,12 @@
<dependency>
<groupId>org.jboss.portal.common</groupId>
<artifactId>common-common</artifactId>
- <version>1.2.3</version>
+ <version>${version.common}</version>
</dependency>
<dependency>
<groupId>org.jboss.portal.common</groupId>
<artifactId>common-portal</artifactId>
- <version>1.2.3</version>
+ <version>${version.common}</version>
</dependency>
<dependency>
<groupId>org.jboss.portal.registration</groupId>
@@ -63,12 +63,12 @@
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>portlet-portlet</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>${version.portlet}</version>
</dependency>
<dependency>
<groupId>org.jboss.portal.portlet</groupId>
<artifactId>portlet-federation</artifactId>
- <version>trunk-SNAPSHOT</version>
+ <version>${version.portlet}</version>
</dependency>
<!-- JBoss dependencies -->
@@ -128,7 +128,9 @@
</dependencies>
<build>
- <!--<plugins>
+ <finalName>portal-wsrp</finalName>
+ <sourceDirectory>src/main</sourceDirectory>
+ <plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
@@ -136,7 +138,28 @@
<target>1.5</target>
</configuration>
</plugin>
- </plugins>-->
+
+ <plugin>
+ <artifactId>maven-assembly-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>make-assembly</id>
+ <goals>
+ <goal>single</goal>
+ </goals>
+ <phase>package</phase>
+ <configuration>
+ <descriptors>
+
<descriptor>src/assemble/portal-wsrp-client-jar.xml</descriptor>
+
<descriptor>src/assemble/portal-wsrp-war.xml</descriptor>
+
<descriptor>src/assemble/portal-wsrp-sar.xml</descriptor>
+
<!--<descriptor>src/assemble/portal-wsrp-tests-jar.xml</descriptor>-->
+ </descriptors>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
</build>
</project>
\ No newline at end of file
Added: modules/wsrp/trunk/core/src/assemble/portal-wsrp-client-jar.xml
===================================================================
--- modules/wsrp/trunk/core/src/assemble/portal-wsrp-client-jar.xml
(rev 0)
+++ modules/wsrp/trunk/core/src/assemble/portal-wsrp-client-jar.xml 2009-06-25 16:30:42
UTC (rev 13501)
@@ -0,0 +1,39 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembl...
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-p...
http://maven.apache.org/xsd/assembly-1.1.1.xsd">
+ <id>client</id>
+ <formats>
+ <format>jar</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>src/main/resources/portal-wsrp-client-jar</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+ </fileSets>
+</assembly>
+
Added: modules/wsrp/trunk/core/src/assemble/portal-wsrp-war.xml
===================================================================
--- modules/wsrp/trunk/core/src/assemble/portal-wsrp-war.xml (rev
0)
+++ modules/wsrp/trunk/core/src/assemble/portal-wsrp-war.xml 2009-06-25 16:30:42 UTC (rev
13501)
@@ -0,0 +1,39 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembl...
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-p...
http://maven.apache.org/xsd/assembly-1.1.1.xsd">
+ <id>server</id>
+ <formats>
+ <format>war</format>
+ </formats>
+ <includeBaseDirectory>false</includeBaseDirectory>
+
+ <fileSets>
+ <fileSet>
+ <directory>src/main/resources/portal-wsrp-war</directory>
+ <outputDirectory>/</outputDirectory>
+ </fileSet>
+ </fileSets>
+</assembly>
+
Modified: modules/wsrp/trunk/pom.xml
===================================================================
--- modules/wsrp/trunk/pom.xml 2009-06-25 15:10:55 UTC (rev 13500)
+++ modules/wsrp/trunk/pom.xml 2009-06-25 16:30:42 UTC (rev 13501)
@@ -31,8 +31,6 @@
<version>1.0.0-SNAPSHOT</version>
<
url>http://www.jboss.org/jbossportal</url>
- <dependencies/>
-
<!--Repository definition needed to deploy artifacts into JBoss maven
repositories-->
<distributionManagement>
<repository>
@@ -54,8 +52,49 @@
<module>api</module>
<module>wsrp1-rpc</module>
<module>core</module>
+ <module>test-support</module>
<module>admin-gui</module>
+ <module>service</module>
</modules>
+ <!--<build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.0</version>
+ <executions>
+ <execution>
+ <id>copy-portal-jopr-plugin-jar</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.portal.jopr</groupId>
+ <artifactId>portal-management</artifactId>
+ <version>${project.version}</version>
+ </artifactItem>
+ </artifactItems>
+
<outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jboss-packaging-maven-plugin</artifactId>
+ <version>2.0-beta-1</version>
+
+ <!– Enable packaging types and lifecycle bindings.
–>
+ <extensions>true</extensions>
+ <configuration>
+ <excludeAll>true</excludeAll>
+ <primaryArtifact>false</primaryArtifact>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>-->
</project>
\ No newline at end of file
Added: modules/wsrp/trunk/service/pom.xml
===================================================================
--- modules/wsrp/trunk/service/pom.xml (rev 0)
+++ modules/wsrp/trunk/service/pom.xml 2009-06-25 16:30:42 UTC (rev 13501)
@@ -0,0 +1,87 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<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.wsrp</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wsrp-service</artifactId>
+ <packaging>jboss-sar</packaging>
+ <name>JBoss Portal WSRP Service</name>
+
+ <!--<dependencies>
+ <dependency>
+ <groupId>org.jboss.portal.jopr</groupId>
+ <artifactId>portal-management</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+-->
+
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-dependency-plugin</artifactId>
+ <version>2.0</version>
+ <executions>
+ <execution>
+ <id>copy-portal-wsrp-libs</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>copy</goal>
+ </goals>
+ <configuration>
+ <artifactItems>
+ <artifactItem>
+ <groupId>org.jboss.portal.wsrp</groupId>
+ <artifactId>wsrp-core</artifactId>
+ <version>${project.version}</version>
+ </artifactItem>
+ </artifactItems>
+
<outputDirectory>${project.build.outputDirectory}/lib</outputDirectory>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>jboss-packaging-maven-plugin</artifactId>
+ <version>2.0-beta-1</version>
+
+ <!-- Enable packaging types and lifecycle bindings. -->
+ <extensions>true</extensions>
+ <configuration>
+ <excludeAll>true</excludeAll>
+ <primaryArtifact>false</primaryArtifact>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+</project>
\ No newline at end of file
Added: modules/wsrp/trunk/service/src/main/resources/META-INF/jboss-service.xml
===================================================================
--- modules/wsrp/trunk/service/src/main/resources/META-INF/jboss-service.xml
(rev 0)
+++ modules/wsrp/trunk/service/src/main/resources/META-INF/jboss-service.xml 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,134 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<server>
+ <!-- WSRP Producer implementation -->
+ <mbean
+ code="org.jboss.portal.wsrp.producer.WSRPProducerImpl"
+ name="portal.wsrp:service=WSRPProducer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="Invoker"
proxy-type="attribute">portal:service=PortletInvoker,type=Producer
+ </depends>
+ <depends optional-attribute-name="RegistrationManager"
proxy-type="attribute">
+ portal.wsrp:service=RegistrationManager,type=Producer
+ </depends>
+ <depends optional-attribute-name="ProducerConfigurationService"
proxy-type="attribute">
+ portal.wsrp:service=ProducerConfiguration
+ </depends>
+ </mbean>
+
+ <!-- Registration manager -->
+ <mbean code="org.jboss.portal.registration.impl.RegistrationManagerImpl"
+ name="portal.wsrp:service=RegistrationManager,type=Producer"
xmbean-dd=""
+
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends optional-attribute-name="PersistenceManager"
proxy-type="attribute">
+ portal.wsrp:service=PersistenceManager
+ </depends>
+ </mbean>
+
+ <!-- Persistence manager for registrations -->
+ <mbean
code="org.jboss.portal.core.impl.portlet.state.PersistentPortletStatePersistenceManager"
+ name="portal.wsrp:service=PersistenceManager" xmbean-dd=""
+
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends>portal:service=Hibernate,type=Portlet</depends>
+ <attribute
name="SessionFactoryJNDIName">java:/portal/PortletSessionFactory</attribute>
+ </mbean>
+
+ <!-- Producer configuration service -->
+ <mbean
code="org.jboss.portal.wsrp.producer.config.impl.ProducerConfigurationServiceImpl"
+ name="portal.wsrp:service=ProducerConfiguration"
xmbean-dd=""
+
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute
name="ConfigLocation">conf/producer/config.xml</attribute>
+ </mbean>
+
+ <mbean
+ code="org.jboss.portal.server.impl.xml.EntityResolverService"
+ name="portal.wsrp:service=EntityResolver"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <attribute name="DTDMapping">
+ <properties>
+ <entry
+ key="-//JBoss Portal//DTD WSRP Remote Producer Configuration
2.6//EN">
+ dtd/jboss-wsrp-consumer_2_6.dtd
+ </entry>
+ <entry
+ key="-//JBoss Portal//DTD WSRP Local Producer Configuration
2.6//EN">
+ dtd/jboss-wsrp-producer_2_6.dtd
+ </entry>
+ <entry
key="urn:jboss:portal:wsrp:consumer:v2_6">/xsd/jboss-wsrp-consumer_2_6.xsd</entry>
+ <entry
key="urn:jboss:portal:wsrp:producer:v2_6">/xsd/jboss-wsrp-consumer_2_6.xsd</entry>
+ </properties>
+ </attribute>
+ </mbean>
+
+ <!-- Deployer for *-wsrp.xml files. Deploys default-wsrp.xml which contains the
'self' consumer -->
+ <mbean code="org.jboss.portal.wsrp.deployment.WSRPDeployer"
name="portal.wsrp:service=WSRPDeployer">
+ <attribute
name="DefaultWSRPLocation">default-wsrp.xml</attribute>
+ <depends>jboss.system:service=MainDeployer</depends>
+ <depends optional-attribute-name="ConsumerRegistry"
+ proxy-type="attribute">portal.wsrp:service=ConsumerRegistry
+ </depends>
+ <depends optional-attribute-name="EntityResolver"
+ proxy-type="attribute">portal.wsrp:service=EntityResolver
+ </depends>
+ </mbean>
+
+ <mbean
+ code="org.jboss.portal.jems.hibernate.SessionFactoryBinder"
+ name="portal:service=Hibernate,type=WSRPConsumer"
+ xmbean-dd=""
+ xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+
<depends>jboss.jca:service=DataSourceBinding,name=@portal.datasource.name@</depends>
+ <!-- Uncomment in clustered mode : hibernate depends on its tree cache service
@portal.single.xml.close@
+ <depends>portal:service=TreeCacheProvider,type=hibernate</depends>
+ @portal.single.xml.open@ -->
+ <attribute name="DoChecking">true</attribute>
+ <attribute
name="ConfigLocation">conf/hibernate/consumer/hibernate.cfg.xml</attribute>
+ <attribute
name="JNDIName">java:/portal/WSRPConsumerSessionFactory</attribute>
+ </mbean>
+
+ <!-- Consumers registry for WSRP consumers -->
+ <mbean code="org.jboss.portal.wsrp.consumer.ConsumerRegistryService"
+ name="portal.wsrp:service=ConsumerRegistry"
+ xmbean-dd=""
xmbean-code="org.jboss.portal.jems.as.system.JBossServiceModelMBean">
+ <xmbean/>
+ <depends>portal:service=Hibernate,type=WSRPConsumer</depends>
+ <attribute
name="SessionFactoryJNDIName">java:/portal/WSRPConsumerSessionFactory</attribute>
+ <depends optional-attribute-name="FederatingPortletInvoker"
proxy-type="attribute">
+ portal:service=PortletInvoker,type=Federating
+ </depends>
+ <depends optional-attribute-name="PortalEventListenerRegistry"
proxy-type="attribute">
+ portal:service=ListenerRegistry
+ </depends>
+ </mbean>
+</server>
+
Property changes on:
modules/wsrp/trunk/service/src/main/resources/META-INF/jboss-service.xml
___________________________________________________________________
Name: svn:executable
+ *
Added:
modules/wsrp/trunk/service/src/main/resources/conf/hibernate/consumer/domain.hbm.xml
===================================================================
--- modules/wsrp/trunk/service/src/main/resources/conf/hibernate/consumer/domain.hbm.xml
(rev 0)
+++
modules/wsrp/trunk/service/src/main/resources/conf/hibernate/consumer/domain.hbm.xml 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,146 @@
+<?xml version="1.0"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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 hibernate-mapping PUBLIC
+ "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+<hibernate-mapping>
+ <class name="org.jboss.portal.wsrp.consumer.ProducerInfo"
table="JBP_PRODUCER_INFO">
+ <cache usage="@portal.hibernate.cache.usage(a)"/>
+ <id name="key" column="PK" access="field"
type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">wsrpconsumer_seq</param>
+ </generator>
+ </id>
+ <many-to-one name="endpointConfigurationInfo"
+ column="ENDPOINT_ID"
+
class="org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo"
+ unique="true"
+ not-null="true"
+ cascade="all"
+ lazy="false"/>
+ <many-to-one name="registrationInfo"
+ column="REGISTRATION_ID"
+ class="org.jboss.portal.wsrp.consumer.RegistrationInfo"
+ unique="true"
+ not-null="false"
+ cascade="all"
+ lazy="false"/>
+ <property name="expirationCacheSeconds"
column="EXPIRATION_CACHE_SECONDS" type="java.lang.Integer"/>
+ <property name="active" not-null="true"
column="ACTIVE" type="boolean"/>
+ <property name="persistentId" column="PRODUCER_ID"
not-null="true" unique="true" type="java.lang.String"
+ access="field"/>
+ </class>
+
+ <class name="org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo"
table="JBP_ENDPOINT_INFO">
+ <cache usage="@portal.hibernate.cache.usage(a)"/>
+ <id name="key" column="PK"
type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">wsrpconsumer_seq</param>
+ </generator>
+ </id>
+ <property name="serviceDescriptionURL" column="SD_URL"
type="java.lang.String" not-null="true"/>
+ <property name="markupURL" column="M_URL"
type="java.lang.String" not-null="true"/>
+ <property name="portletManagementURL" column="PM_URL"
type="java.lang.String" not-null="false"/>
+ <property name="registrationURL" column="R_URL"
type="java.lang.String" not-null="false"/>
+ <property name="wsdlDefinitionURL" column="WSDL_URL"
type="java.lang.String" not-null="false"/>
+ </class>
+
+ <class name="org.jboss.portal.wsrp.consumer.RegistrationInfo"
table="JBP_REGISTRATION_INFO">
+ <cache usage="@portal.hibernate.cache.usage(a)"/>
+ <id name="key" column="PK"
type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">wsrpconsumer_seq</param>
+ </generator>
+ </id>
+ <property name="persistentConsumerName"
column="CONSUMER_NAME" type="java.lang.String"
not-null="true"
+ access="field"/>
+ <property name="persistentRegistrationHandle"
column="HANDLE" type="java.lang.String" access="field"/>
+ <property name="registrationState" column="STATE"
type="binary" length="16384"/>
+ <map name="persistentRegistrationProperties"
cascade="all,delete-orphan" lazy="false" access="field">
+ <cache usage="@portal.hibernate.cache.usage(a)"/>
+ <key column="REG_PK" not-null="true"/>
+ <map-key type="string" formula="NAME"/>
+ <one-to-many
class="org.jboss.portal.wsrp.consumer.RegistrationProperty"/>
+ </map>
+ </class>
+
+ <class name="org.jboss.portal.wsrp.consumer.RegistrationProperty"
table="JBP_REG_PROPERTY">
+ <cache usage="@portal.hibernate.cache.usage(a)"/>
+ <id name="key" column="PK"
type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">wsrpconsumer_seq</param>
+ </generator>
+ </id>
+ <property name="name" column="NAME"
type="java.lang.String" not-null="true"/>
+ <property name="value" column="VALUE"
type="java.lang.String"/>
+ <property name="invalid" column="INVALID"
type="java.lang.Boolean"/>
+ <property name="lang" column="LANG"
type="java.lang.String" not-null="true"/>
+ <many-to-one
+ name="description"
+ column="DESC_PK"
+
class="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription"
+ unique="true"
+ cascade="all"
+ lazy="false"/>
+ </class>
+ <class
name="org.jboss.portal.wsrp.registration.RegistrationPropertyDescription"
table="JBP_REG_PROP_DESC">
+ <cache usage="@portal.hibernate.cache.usage(a)"/>
+ <id name="key" column="PK"
type="java.lang.Long">
+ <generator class="native">
+ <param name="sequence">portlet_seq</param>
+ </generator>
+ </id>
+ <property name="name" column="NAME"
type="org.jboss.portal.jems.hibernate.QNameUserType"
not-null="true"/>
+ <property name="type" column="TYPE"
type="org.jboss.portal.jems.hibernate.QNameUserType"
not-null="true"/>
+ <property name="schemaLocation" column="SCHEMA_LOCATION"
type="java.lang.String"/>
+ <component name="description"
class="org.jboss.portal.wsrp.registration.LocalizedString">
+ <property name="value" column="DESC_VALUE"/>
+ <property name="locale" column="DESC_LOCALE"/>
+ <property name="resourceName" column="DESC_RES"/>
+ </component>
+ <component name="hint"
class="org.jboss.portal.wsrp.registration.LocalizedString">
+ <property name="value" column="HINT_VALUE"/>
+ <property name="locale" column="HINT_LOCALE"/>
+ <property name="resourceName" column="HINT_RES"/>
+ </component>
+ <component name="label"
class="org.jboss.portal.wsrp.registration.LocalizedString">
+ <property name="value" column="LABEL_VALUE"/>
+ <property name="locale" column="LABEL_LOCALE"/>
+ <property name="resourceName" column="LABEL_RES"/>
+ </component>
+ <array name="usages" table="JBP_REG_PROP_DESC_USAGES"
cascade="all" fetch="join">
+ <cache usage="@portal.hibernate.cache.usage(a)"/>
+ <key column="PK"/>
+ <index column="IDX"/>
+ <element column="DESC_USAGE" type="java.lang.String"
not-null="true" unique="false"/>
+ </array>
+ <array name="aliases" table="JBP_REG_PROP_DESC_ALIASES"
cascade="all" fetch="join">
+ <cache usage="@portal.hibernate.cache.usage(a)"/>
+ <key column="PK"/>
+ <index column="IDX"/>
+ <element column="ALIAS"
type="org.jboss.portal.jems.hibernate.QNameUserType" not-null="true"
unique="false"/>
+ </array>
+ </class>
+</hibernate-mapping>
Added: modules/wsrp/trunk/service/src/main/resources/conf/hibernate/consumer/ehcache.xml
===================================================================
--- modules/wsrp/trunk/service/src/main/resources/conf/hibernate/consumer/ehcache.xml
(rev 0)
+++
modules/wsrp/trunk/service/src/main/resources/conf/hibernate/consumer/ehcache.xml 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,60 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<ehcache>
+
+ <!-- Sets the path to the directory where cache .data files are created.
+
+If the path is a Java System Property it is replaced by
+its value in the running VM.
+
+The following properties are translated:
+user.home - User's home directory
+user.dir - User's current working directory
+java.io.tmpdir - Default temp file path -->
+ <diskStore path="java.io.tmpdir/wsrpconsumer"/>
+
+
+ <!--Default Cache configuration. These will applied to caches programmatically
created through
+ the CacheManager.
+
+ The following attributes are required for defaultCache:
+
+ maxInMemory - Sets the maximum number of objects that will be created in memory
+ eternal - Sets whether elements are eternal. If eternal, timeouts are
ignored and the element
+ is never expired.
+ timeToIdleSeconds - Sets the time to idle for an element before it expires. Is only
used
+ if the element is not eternal. Idle time is now - last accessed
time
+ timeToLiveSeconds - Sets the time to live for an element before it expires. Is only
used
+ if the element is not eternal. TTL is now - creation time
+ overflowToDisk - Sets whether elements can overflow to disk when the in-memory
cache
+ has reached the maxInMemory limit.
+
+ -->
+ <defaultCache
+ maxElementsInMemory="10000"
+ eternal="false"
+ timeToIdleSeconds="1800"
+ timeToLiveSeconds="1800"
+ overflowToDisk="false"
+ />
+</ehcache>
\ No newline at end of file
Added:
modules/wsrp/trunk/service/src/main/resources/conf/hibernate/consumer/hibernate.cfg.xml
===================================================================
---
modules/wsrp/trunk/service/src/main/resources/conf/hibernate/consumer/hibernate.cfg.xml
(rev 0)
+++
modules/wsrp/trunk/service/src/main/resources/conf/hibernate/consumer/hibernate.cfg.xml 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,58 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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 hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+ <session-factory>
+ <property
name="connection.datasource">java:@portal.datasource.name@</property>
+ <property name="show_sql">@portal.sql.show(a)</property>
+ <property
name="cache.use_second_level_cache">true</property>
+ <property name="cache.use_query_cache">true</property>
+
+ <!--
+ | Uncomment in clustered mode : use transactional replicated cache
+ @portal.single.xml.close@
+ <property
name="cache.provider_class">org.jboss.portal.jems.hibernate.JMXTreeCacheProvider</property>
+ <property
name="cache.object_name">portal:service=TreeCacheProvider,type=hibernate</property>
+ @portal.single.xml.open@
+ -->
+
+ <!--
+ | Comment in clustered mode
+ @portal.clustered.xml.close@
+ <property
name="cache.provider_configuration_file_resource_path">conf/consumer/hibernate/ehcache.xml</property>
+ <property
name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
+ @portal.clustered.xml.open@
+ -->
+
+ <!-- Force the dialect instead of using autodetection -->
+ <!--
+ <property
name="dialect">org.hibernate.dialect.PostgreSQLDialect</property>
+ -->
+
+ <!-- Mapping files -->
+ <mapping resource="conf/hibernate/consumer/domain.hbm.xml"/>
+ </session-factory>
+</hibernate-configuration>
\ No newline at end of file
Added: modules/wsrp/trunk/service/src/main/resources/conf/producer/config.xml
===================================================================
--- modules/wsrp/trunk/service/src/main/resources/conf/producer/config.xml
(rev 0)
+++ modules/wsrp/trunk/service/src/main/resources/conf/producer/config.xml 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,40 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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 producer-configuration PUBLIC "-//JBoss Portal//DTD WSRP Local Producer
Configuration 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-wsrp-producer_2_6.dtd">
+-->
+
+<!-- Configuration using registration with default registration property validator.
-->
+<producer-configuration xmlns="urn:jboss:portal:wsrp:producer:v2_6"
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:portal:wsrp:producer:v2_6
http://www.jboss.org/portal/xsd/jboss-wsrp-producer_2_6.xsd">
+ <registration-configuration
fullServiceDescriptionRequiresRegistration="true">
+
<registration-property-validator>org.jboss.portal.registration.policies.DefaultRegistrationPropertyValidator
+ </registration-property-validator>
+ </registration-configuration>
+</producer-configuration>
+
+ <!-- Configuration without registration -->
+ <!--<producer-configuration/>-->
\ No newline at end of file
Added: modules/wsrp/trunk/service/src/main/resources/default-wsrp.xml
===================================================================
--- modules/wsrp/trunk/service/src/main/resources/default-wsrp.xml
(rev 0)
+++ modules/wsrp/trunk/service/src/main/resources/default-wsrp.xml 2009-06-25 16:30:42 UTC
(rev 13501)
@@ -0,0 +1,88 @@
+<?xml version='1.0' encoding='UTF-8' ?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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 deployments PUBLIC "-//JBoss Portal//DTD WSRP Remote Producer
Configuration 2.6//EN"
+ "http://www.jboss.org/portal/dtd/jboss-wsrp-consumer_2_6.dtd">-->
+
+<deployments xmlns="urn:jboss:portal:wsrp:consumer:v2_6"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="urn:jboss:portal:wsrp:consumer:v2_6
http://www.jboss.org/portal/xsd/jboss-wsrp-consumer_2_6.xsd">
+ <deployment>
+ <wsrp-producer id="self" expiration-cache="300">
+ <!--
+ we need to use the individual endpoint configuration because the configuration
via wsdl forces an
+ immediate attempt to access the web service description which is not available
yet at this point of deployment
+ -->
+ <endpoint-config>
+
<service-description-url>http://localhost:8080/portal-wsrp/ServiceDescriptionService
+ </service-description-url>
+
<markup-url>http://localhost:8080/portal-wsrp/MarkupService</markup-url>
+
<registration-url>http://localhost:8080/portal-wsrp/RegistrationService</registration-url>
+
<portlet-management-url>http://localhost:8080/portal-wsrp/PortletManagementService</portlet-management-url>
+ </endpoint-config>
+ <registration-data/>
+ </wsrp-producer>
+ </deployment>
+ <!--<deployment>
+ <wsrp-producer id="NetUnity" expiration-cache="300">
+
<
endpoint-wsdl-url>http://wsrp.netunitysoftware.com/WSRPTestService/WSR...
+ <registration-data/>
+ </wsrp-producer>
+ </deployment>-->
+ <!--<deployment>
+ <wsrp-producer id="vignette" expiration-cache="300">
+
<endpoint-wsdl-url>http://wsrpdemo.vignette.com:8080/producer/wsdl</endpoint-wsdl-url>
+ <registration-data>
+ <property>
+ <name>com.vignette.wsrp.registration.username</name>
+ <lang>en</lang>
+ <value>test</value>
+ </property>
+ <property>
+ <name>com.vignette.wsrp.registration.password</name>
+ <lang>en</lang>
+ <value>test</value>
+ </property>
+ </registration-data>
+ </wsrp-producer>
+ </deployment>-->
+ <!--<deployment>
+ <wsrp-producer id="bea" expiration-cache="300">
+
<endpoint-wsdl-url>http://wsrp.bea.com:7001/producer/producer?WSDL</endpoint-wsdl-url>
+ <registration-data>
+ <property>
+ <name>registration/consumerRole</name>
+ <lang>en</lang>
+ <value>public</value>
+ </property>
+ </registration-data>
+ </wsrp-producer>
+ </deployment>-->
+ <!--<deployment>
+ <wsrp-producer id="oracle" expiration-cache="300">
+
<
endpoint-wsdl-url>http://portalstandards.oracle.com/portletapp/portlet...
+ <registration-data/>
+ </wsrp-producer>
+ </deployment>-->
+</deployments>
\ No newline at end of file
Property changes on: modules/wsrp/trunk/service/src/main/resources/default-wsrp.xml
___________________________________________________________________
Name: svn:executable
+ *
Added: modules/wsrp/trunk/service/src/main/resources/dtd/jboss-wsrp-consumer_2_6.dtd
===================================================================
--- modules/wsrp/trunk/service/src/main/resources/dtd/jboss-wsrp-consumer_2_6.dtd
(rev 0)
+++
modules/wsrp/trunk/service/src/main/resources/dtd/jboss-wsrp-consumer_2_6.dtd 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,85 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!--
+JBoss Portal's WSRP Remote Producer Configuration deployment descriptor for the
*-wsrp.xml files used by Portal to be
+able to consume WSRP portlets exposed by a remote producer.
+author: <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+version: 1.1 (Portal 2.6)
+revision: $Revision: 8784 $
+-->
+
+<!-- The root element. Contains deployment elements. -->
+<!ELEMENT deployments ( deployment* )>
+
+<!-- Deployment related information. As of Portal 2.6, the only deployment information
relates to WSRP remote producers. -->
+<!ELEMENT deployment ( wsrp-producer )>
+
+<!-- Information on a remote WSRP producer identified by the mandatory producer-id
attribute. -->
+<!ELEMENT wsrp-producer ( ( endpoint-config | endpoint-wsdl-url ), registration-data?
)>
+
+<!-- The producer identifier. This should be unique for a given Portal deployment. The
identifier is used to
+identify the portlet provider in the management interface. -->
+<!ATTLIST wsrp-producer id CDATA #REQUIRED>
+
+<!-- The period of producer information (such as list of offered portlets) cache
refreshing in seconds. -->
+<!ATTLIST wsrp-producer expiration-cache CDATA #IMPLIED>
+
+<!-- WSRP endpoints configuration information by interface URL. Mutually exclusive
with endpoint-wsdl-url. -->
+<!ELEMENT endpoint-config ( service-description-url, markup-url, registration-url?,
portlet-management-url? )>
+
+<!-- The URL for the service description interface endpoint on the remote producer.
-->
+<!ELEMENT service-description-url ( #PCDATA )>
+
+<!-- The URL for the markup interface endpoint on the remote producer. -->
+<!ELEMENT markup-url ( #PCDATA )>
+
+<!-- The URL for the optional portlet management interface endpoint on the remote
producer. -->
+<!ELEMENT portlet-management-url ( #PCDATA )>
+
+<!-- The URL for the optional registration interface endpoint on the remote producer.
-->
+<!ELEMENT registration-url ( #PCDATA )>
+
+<!-- The URL of the WSDL description of the producer's WSRP services. Mutally
exclusive with endpoint-config. -->
+<!ELEMENT endpoint-wsdl-url ( #PCDATA )>
+
+<!-- Container for registration information. -->
+<!ELEMENT registration-data ( consumer-name?, property* )>
+
+<!--
+An optional name (preferably unique) that identifies the Consumer. An example of such a
name would be the Consumer's URL.
+If no consumer-name is provided, one will be automatically generated by JBoss Portal.
+-->
+<!ELEMENT consumer-name ( #PCDATA )>
+
+<!-- A registration property. -->
+<!ELEMENT property ( name, lang, value )>
+
+<!-- The name of the property. -->
+<!ELEMENT name ( #PCDATA )>
+
+<!-- The language the property is in. -->
+<!ELEMENT lang ( #PCDATA )>
+
+<!-- The value of the property. -->
+<!ELEMENT value ( #PCDATA )>
\ No newline at end of file
Added: modules/wsrp/trunk/service/src/main/resources/dtd/jboss-wsrp-producer_2_6.dtd
===================================================================
--- modules/wsrp/trunk/service/src/main/resources/dtd/jboss-wsrp-producer_2_6.dtd
(rev 0)
+++
modules/wsrp/trunk/service/src/main/resources/dtd/jboss-wsrp-producer_2_6.dtd 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,87 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<!--
+A DTD for the configuration of Portal's WSRP producer.
+
+author: <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
+version: 1.0 (Portal 2.6)
+revision: $Revision: 8784 $
+-->
+
+<!-- Root element for the producer configuration. Contains a single
registration-configuration as of Portal 2.6 -->
+<!ELEMENT producer-configuration ( registration-configuration? )>
+
+
+<!-- Allows configuration of whether the producer requires registration or not and how
to deal with registrations. -->
+<!ELEMENT registration-configuration ( (registration-property-validator |
registration-policy)?, registration-property-description* )>
+
+<!--
+Specifies whether the producer will send a complete service description (that is one
including offered portlets) or not
+to unregistered consumers.
+-->
+<!ATTLIST registration-configuration fullServiceDescriptionRequiresRegistration (true
| false) "false">
+
+<!--
+A fully-qualified class name for a class implementing the RegistrationPropertyValidator
interface. Only makes sense when
+using the default RegistrationPolicy.
+-->
+<!ELEMENT registration-property-validator ( #PCDATA )>
+
+<!--
+A fully-qualified class name for an implementation of the RegistrationPolicy interface,
allowing users to customize
+the behavior of the producer when handling registration attempts.
+ -->
+<!ELEMENT registration-policy ( #PCDATA )>
+
+<!--
+The description for a registration property for which the producer will require consumers
to provide a value.
+Example:
+<registration-property-description>
+ <name>name1</name>
+ <type>xsd:string</type>
+ <label xml:lang="en"
resourceName="resource.label1">label1</label>
+ <hint xml:lang="en"
resourceName="resource.hint1">hint1</hint>
+</registration-property-description>
+-->
+<!ELEMENT registration-property-description ( name, type, label, hint? )>
+
+<!-- The name of the registration property -->
+<!ELEMENT name ( #PCDATA )>
+
+<!-- The qualified name of the type of the registration property. As of Portal 2.6,
only xsd:string is supported. -->
+<!ELEMENT type ( #PCDATA )>
+
+<!-- A description of the registration property and its usage targeted at end users.
-->
+<!ELEMENT hint ( #PCDATA )>
+<!-- The language in which the hint is written. -->
+<!ATTLIST hint xml:lang CDATA #REQUIRED>
+<!-- A resource name identifying the hint in localization bundles (currently
unsupported in Portal 2.6). -->
+<!ATTLIST hint resourceName CDATA #IMPLIED>
+
+<!-- A short, human readable name for the property, intended for consumer-generated
administration interface. -->
+<!ELEMENT label ( #PCDATA )>
+<!-- The language in which the label is written. -->
+<!ATTLIST label xml:lang CDATA #REQUIRED>
+<!-- A resource name identifying the label in localization bundles (currently
unsupported in Portal 2.6). -->
+<!ATTLIST label resourceName CDATA #IMPLIED>
Added: modules/wsrp/trunk/service/src/main/resources/wsrp-aop.xml
===================================================================
--- modules/wsrp/trunk/service/src/main/resources/wsrp-aop.xml
(rev 0)
+++ modules/wsrp/trunk/service/src/main/resources/wsrp-aop.xml 2009-06-25 16:30:42 UTC
(rev 13501)
@@ -0,0 +1,79 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<aop>
+ <metadata tag="transaction"
class="org.jboss.portal.wsrp.consumer.ConsumerRegistryService">
+ <method name="startService">
+ <trans-attribute>Required</trans-attribute>
+ </method>
+ <method name="persistConsumer">
+ <trans-attribute>Required</trans-attribute>
+ </method>
+ <method name="activateConsumerWith">
+ <trans-attribute>Required</trans-attribute>
+ </method>
+ <method name="updateProducerInfo">
+ <trans-attribute>Required</trans-attribute>
+ </method>
+ <method name="createConsumer">
+ <trans-attribute>Required</trans-attribute>
+ </method>
+ <method name="destroyConsumer">
+ <trans-attribute>Required</trans-attribute>
+ </method>
+ </metadata>
+
+ <!-- TRANSACTIONS -->
+ <interceptor class="org.jboss.aspects.tx.TxPropagationInterceptor"
scope="PER_VM"/>
+ <interceptor factory="org.jboss.aspects.tx.TxInterceptorFactory"
scope="PER_CLASS_JOINPOINT"/>
+
+ <bind pointcut="all(@transaction)">
+ <interceptor-ref
name="org.jboss.aspects.tx.TxInterceptorFactory"/>
+ </bind>
+
+ <interceptor name="class-txsynchronized"
factory="org.jboss.aspects.txlock.TxLockInterceptorFactory"
+ scope="PER_CLASS"/>
+ <interceptor name="instance-txsynchronized"
factory="org.jboss.aspects.txlock.TxLockInterceptorFactory"
+ scope="PER_INSTANCE"/>
+
+ <bind pointcut="execution(static * *->@TxSynchronized(..)) OR
execution(*->@TxSynchronized(..))">
+ <interceptor-ref name="class-txsynchronized"/>
+ </bind>
+
+ <bind pointcut="execution(!static * *->@TxSynchronized(..))">
+ <interceptor-ref name="instance-txsynchronized"/>
+ </bind>
+
+ <bind pointcut="all((a)org.jboss.aspects.tx.Tx)">
+ <interceptor-ref
name="org.jboss.aspects.tx.TxInterceptorFactory"/>
+ </bind>
+
+ <bind
+ pointcut="execution(static *
*->@org.jboss.aspects.txlock.TxSynchronized(..)) OR
execution(*->@org.jboss.aspects.txlock.TxSynchronized(..))">
+ <interceptor-ref name="class-txsynchronized"/>
+ </bind>
+
+ <bind pointcut="execution(!static *
*->@org.jboss.aspects.txlock.TxSynchronized(..))">
+ <interceptor-ref name="instance-txsynchronized"/>
+ </bind>
+</aop>
\ No newline at end of file
Added: modules/wsrp/trunk/service/src/main/resources/xsd/jboss-wsrp-consumer_2_6.xsd
===================================================================
--- modules/wsrp/trunk/service/src/main/resources/xsd/jboss-wsrp-consumer_2_6.xsd
(rev 0)
+++
modules/wsrp/trunk/service/src/main/resources/xsd/jboss-wsrp-consumer_2_6.xsd 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,202 @@
+<?xml version="1.0"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jboss:portal:wsrp:consumer:v2_6"
+ xmlns="urn:jboss:portal:wsrp:consumer:v2_6"
+
xmlns:xml="http://www.w3.org/XML/1998/namespace"
+ xmlns:wcc="urn:jboss:portal:wsrp:consumer:v2_6"
+ elementFormDefault="qualified">
+
+ <xs:import
namespace="http://www.w3.org/XML/1998/namespace"/>
+
+ <xs:element name="deployments">
+ <xs:annotation>
+ <xs:documentation>Root element. Contains deployment
elements.</xs:documentation>
+ </xs:annotation>
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="deployment" type="wcc:Deployment"
minOccurs="0" maxOccurs="unbounded"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="Deployment">
+ <xs:annotation>
+ <xs:documentation>Deployment related information. As of Portal 2.6, the
only deployment information relates to
+ WSRP remote producers.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="wsrp-producer" type="wcc:WSRPProducer"
maxOccurs="1" minOccurs="1"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="WSRPProducer">
+ <xs:annotation>
+ <xs:documentation>Information on a remote WSRP producer identified by the
mandatory id attribute.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:choice>
+ <xs:element name="endpoint-config"
type="wcc:EndpointConfig">
+ <xs:annotation>
+ <xs:documentation>
+ WSRP endpoints configuration information by interface URL. Mutually
exclusive with
+ endpoint-wsdl-url.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="endpoint-wsdl-url"
type="xs:anyURI">
+ <xs:annotation>
+ <xs:documentation>
+ The URL of the WSDL description of the producer's WSRP services.
Mutally exclusive with
+ endpoint-config.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:choice>
+ <xs:element name="registration-data"
type="wcc:RegistrationData" minOccurs="0">
+ <xs:annotation>
+ <xs:documentation>
+ Container for registration information.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ <xs:attribute name="id" type="xs:string"
use="required">
+ <xs:annotation>
+ <xs:documentation>
+ The producer identifier. This should be unique for a given Portal
deployment. The identifier is used to
+ identify the portlet provider in the management interface.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ <xs:attribute name="expiration-cache" type="wcc:cacheValue"
use="required">
+ <xs:annotation>
+ <xs:documentation>The period of producer information (such as list of
offered portlets) cache refreshing in
+ seconds.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+ </xs:complexType>
+
+ <xs:simpleType name="cacheValue" id="cacheValue">
+ <xs:annotation>
+ <xs:documentation>
+ Type for cache information. Positive or null integer, allowing -1 as a value
to indicate that cache should
+ not
+ be used.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:restriction base="xs:integer">
+ <xs:minInclusive value="-1"/>
+ </xs:restriction>
+ </xs:simpleType>
+
+ <xs:complexType name="EndpointConfig">
+ <xs:sequence>
+ <xs:element name="service-description-url"
type="xs:anyURI">
+ <xs:annotation>
+ <xs:documentation>
+ The mandatory URL for the service description interface endpoint on the
remote producer.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="markup-url" type="xs:anyURI">
+ <xs:annotation>
+ <xs:documentation>
+ The madatory URL for the markup interface endpoint on the remote
producer.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="registration-url" type="xs:anyURI"
minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>
+ The optional URL for the registration interface endpoint on the remote
producer.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="portlet-management-url"
type="xs:anyURI" minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>
+ The optional URL for the portlet management interface endpoint on the
remote producer.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="RegistrationData">
+ <xs:sequence>
+ <xs:element name="consumer-name" type="xs:string"
minOccurs="0" maxOccurs="1">
+ <xs:annotation>
+ <xs:documentation>
+ An optional name (preferably unique) that identifies the Consumer. An
example of such a name would be
+ the Consumer's URL. If no consumer-name is provided, one will be
automatically generated by JBoss
+ Portal.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="property" type="wcc:Property"
minOccurs="0" maxOccurs="unbounded">
+ <xs:annotation>
+ <xs:documentation>
+ Optional registration properties required by the remote producer.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="Property">
+ <xs:annotation>
+ <xs:documentation>
+ Registration property.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:sequence>
+ <xs:element name="name" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>
+ Name of the property.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="lang" type="xs:language">
+ <xs:annotation>
+ <xs:documentation>
+ Language the property is in.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ <xs:element name="value" type="xs:string">
+ <xs:annotation>
+ <xs:documentation>
+ Value of the property.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+</xs:schema>
Added: modules/wsrp/trunk/service/src/main/resources/xsd/jboss-wsrp-producer_2_6.xsd
===================================================================
--- modules/wsrp/trunk/service/src/main/resources/xsd/jboss-wsrp-producer_2_6.xsd
(rev 0)
+++
modules/wsrp/trunk/service/src/main/resources/xsd/jboss-wsrp-producer_2_6.xsd 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,68 @@
+<?xml version="1.0"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jboss:portal:wsrp:producer:v2_6"
+ xmlns="urn:jboss:portal:wsrp:producer:v2_6"
+
xmlns:xml="http://www.w3.org/XML/1998/namespace"
+ xmlns:wpc="urn:jboss:portal:wsrp:producer:v2_6"
elementFormDefault="qualified">
+
+ <xs:import
namespace="http://www.w3.org/XML/1998/namespace"/>
+
+ <xs:element name="producer-configuration">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="registration-configuration"
type="wpc:RegistrationConfiguration"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="RegistrationConfiguration">
+ <xs:sequence>
+ <xs:element name="registration-policy" type="xs:string"
minOccurs="0"/>
+ <xs:element name="registration-property-validator"
type="xs:string" minOccurs="0"/>
+ <xs:element name="registration-property-description"
type="wpc:RegistrationPropertyDescription" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="fullServiceDescriptionRequiresRegistration"
type="xs:boolean" use="optional"/>
+ </xs:complexType>
+
+ <xs:complexType name="RegistrationPropertyDescription">
+ <xs:sequence>
+ <xs:element name="name" type="xs:QName"/>
+ <xs:element name="type" type="xs:QName"/>
+ <xs:element name="label" type="wpc:LocalizedString"
minOccurs="0"/>
+ <xs:element name="hint" type="wpc:LocalizedString"
minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="LocalizedString">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute ref="xml:lang" use="required"/>
+ <xs:attribute name="resourceName" type="xs:string"
use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+</xs:schema>
Added: modules/wsrp/trunk/service/src/main/resources/xsd/jboss-wsrp-producer_2_7.xsd
===================================================================
--- modules/wsrp/trunk/service/src/main/resources/xsd/jboss-wsrp-producer_2_7.xsd
(rev 0)
+++
modules/wsrp/trunk/service/src/main/resources/xsd/jboss-wsrp-producer_2_7.xsd 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,70 @@
+<?xml version="1.0"?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<xs:schema
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ targetNamespace="urn:jboss:portal:wsrp:producer:v2_7"
+ xmlns="urn:jboss:portal:wsrp:producer:v2_7"
+
xmlns:xml="http://www.w3.org/XML/1998/namespace"
+ xmlns:wpc="urn:jboss:portal:wsrp:producer:v2_7"
elementFormDefault="qualified">
+
+ <xs:import
namespace="http://www.w3.org/XML/1998/namespace"/>
+
+ <xs:element name="producer-configuration">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="registration-configuration"
type="wpc:RegistrationConfiguration"/>
+ </xs:sequence>
+ <xs:attribute name="useStrictMode" type="xs:boolean"
use="optional"/>
+ </xs:complexType>
+ </xs:element>
+
+ <xs:complexType name="RegistrationConfiguration">
+ <xs:sequence>
+ <xs:element name="registration-policy" type="xs:string"
minOccurs="0"/>
+ <xs:element name="registration-property-validator"
type="xs:string" minOccurs="0"/>
+ <xs:element name="registration-property-description"
type="wpc:RegistrationPropertyDescription" minOccurs="0"
+ maxOccurs="unbounded"/>
+ </xs:sequence>
+ <xs:attribute name="fullServiceDescriptionRequiresRegistration"
type="xs:boolean" use="optional"/>
+ </xs:complexType>
+
+ <xs:complexType name="RegistrationPropertyDescription">
+ <xs:sequence>
+ <xs:element name="name" type="xs:QName"/>
+ <xs:element name="type" type="xs:QName"/>
+ <xs:element name="label" type="wpc:LocalizedString"
minOccurs="0"/>
+ <xs:element name="hint" type="wpc:LocalizedString"
minOccurs="0"/>
+ <xs:element name="description" type="wpc:LocalizedString"
minOccurs="0"/>
+ </xs:sequence>
+ </xs:complexType>
+
+ <xs:complexType name="LocalizedString">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute ref="xml:lang" use="required"/>
+ <xs:attribute name="resourceName" type="xs:string"
use="optional"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+</xs:schema>
Added: modules/wsrp/trunk/service/src/main/resources/xsd/xml.xsd
===================================================================
--- modules/wsrp/trunk/service/src/main/resources/xsd/xml.xsd (rev
0)
+++ modules/wsrp/trunk/service/src/main/resources/xsd/xml.xsd 2009-06-25 16:30:42 UTC (rev
13501)
@@ -0,0 +1,174 @@
+<?xml version='1.0'?>
+
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<xs:schema
targetNamespace="http://www.w3.org/XML/1998/namespace"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
+ xml:lang="en">
+
+ <xs:annotation>
+ <xs:documentation>
+ See
http://www.w3.org/XML/1998/namespace.html and
+
http://www.w3.org/TR/REC-xml for information about this namespace.
+
+ This schema document describes the XML namespace, in a form
+ suitable for import by other schema documents.
+
+ Note that local names in this namespace are intended to be defined
+ only by the World Wide Web Consortium or its subgroups. The
+ following names are currently defined in this namespace and should
+ not be used with conflicting semantics by any Working Group,
+ specification, or document instance:
+
+ base (as an attribute name): denotes an attribute whose value
+ provides a URI to be used as the base for interpreting any
+ relative URIs in the scope of the element on which it
+ appears; its value is inherited. This name is reserved
+ by virtue of its definition in the XML Base specification.
+
+ id (as an attribute name): denotes an attribute whose value
+ should be interpreted as if declared to be of type ID.
+ This name is reserved by virtue of its definition in the
+ xml:id specification.
+
+ lang (as an attribute name): denotes an attribute whose value
+ is a language code for the natural language of the content of
+ any element; its value is inherited. This name is reserved
+ by virtue of its definition in the XML specification.
+
+ space (as an attribute name): denotes an attribute whose
+ value is a keyword indicating what whitespace processing
+ discipline is intended for the content of the element; its
+ value is inherited. This name is reserved by virtue of its
+ definition in the XML specification.
+
+ Father (in any context at all): denotes Jon Bosak, the chair of
+ the original XML Working Group. This name is reserved by
+ the following decision of the W3C XML Plenary and
+ XML Coordination groups:
+
+ In appreciation for his vision, leadership and dedication
+ the W3C XML Plenary on this 10th day of February, 2000
+ reserves for Jon Bosak in perpetuity the XML name
+ xml:Father
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>This schema defines attributes and an attribute group
+ suitable for use by
+ schemas wishing to allow xml:base, xml:lang, xml:space or xml:id
+ attributes on elements they define.
+
+ To enable this, such a schema must import this schema
+ for the XML namespace, e.g. as follows:
+ <schema . . .>
+ . . .
+ <import
namespace="http://www.w3.org/XML/1998/namespace"
+
schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+
+ Subsequently, qualified reference to any of the attributes
+ or the group defined below will have the desired effect, e.g.
+
+ <type . . .>
+ . . .
+ <attributeGroup ref="xml:specialAttrs"/>
+
+ will define a type which will schema-validate an instance
+ element with any of those attributes
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:annotation>
+ <xs:documentation>In keeping with the XML Schema WG's standard
versioning
+ policy, this schema document will persist at
+
http://www.w3.org/2007/08/xml.xsd.
+ At the date of issue it can also be found at
+
http://www.w3.org/2001/xml.xsd.
+ The schema document at that URI may however change in the future,
+ in order to remain compatible with the latest version of XML Schema
+ itself, or with the XML namespace itself. In other words, if the XML
+ Schema or XML namespaces change, the version of this document at
+
http://www.w3.org/2001/xml.xsd will change
+ accordingly; the version at
+
http://www.w3.org/2007/08/xml.xsd will not change.
+ </xs:documentation>
+ </xs:annotation>
+
+ <xs:attribute name="lang">
+ <xs:annotation>
+ <xs:documentation>Attempting to install the relevant ISO 2- and 3-letter
+ codes as the enumerated possible values is probably never
+ going to be a realistic possibility. See
+ RFC 3066 at
http://www.ietf.org/rfc/rfc3066.txt and the IANA registry
+ at
http://www.iana.org/assignments/lang-tag-apps.htm for
+ further information.
+
+ The union allows for the 'un-declaration' of xml:lang with
+ the empty string.
+ </xs:documentation>
+ </xs:annotation>
+ <xs:simpleType>
+ <xs:union memberTypes="xs:language">
+ <xs:simpleType>
+ <xs:restriction base="xs:string">
+ <xs:enumeration value=""/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:union>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="space">
+ <xs:simpleType>
+ <xs:restriction base="xs:NCName">
+ <xs:enumeration value="default"/>
+ <xs:enumeration value="preserve"/>
+ </xs:restriction>
+ </xs:simpleType>
+ </xs:attribute>
+
+ <xs:attribute name="base" type="xs:anyURI">
+ <xs:annotation>
+ <xs:documentation>See
http://www.w3.org/TR/xmlbase/ for
+ information about this attribute.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attribute name="id" type="xs:ID">
+ <xs:annotation>
+ <xs:documentation>See
http://www.w3.org/TR/xml-id/ for
+ information about this attribute.
+ </xs:documentation>
+ </xs:annotation>
+ </xs:attribute>
+
+ <xs:attributeGroup name="specialAttrs">
+ <xs:attribute ref="xml:base"/>
+ <xs:attribute ref="xml:lang"/>
+ <xs:attribute ref="xml:space"/>
+ <xs:attribute ref="xml:id"/>
+ </xs:attributeGroup>
+
+</xs:schema>
Added: modules/wsrp/trunk/src/assemble/wsrp-service.xml
===================================================================
--- modules/wsrp/trunk/src/assemble/wsrp-service.xml (rev 0)
+++ modules/wsrp/trunk/src/assemble/wsrp-service.xml 2009-06-25 16:30:42 UTC (rev 13501)
@@ -0,0 +1,40 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<assembly
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembl...
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-p...
http://maven.apache.org/xsd/assembly-1.1.1.xsd">
+ <id>wsrp-service</id>
+ <formats>
+ <format>sar</format>
+ </formats>
+ <moduleSets>
+ <moduleSet>
+ <includes>
+ <include>org.jboss.portal.wsrp:child1</include>
+ </includes>
+ <sources>
+ <outputDirectory>sources/${artifactId}</outputDirectory>
+ </sources>
+ </moduleSet>
+ </moduleSets>
+</assembly>
Added: modules/wsrp/trunk/test-support/pom.xml
===================================================================
--- modules/wsrp/trunk/test-support/pom.xml (rev 0)
+++ modules/wsrp/trunk/test-support/pom.xml 2009-06-25 16:30:42 UTC (rev 13501)
@@ -0,0 +1,54 @@
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2009, 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. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+
+<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.wsrp</groupId>
+ <artifactId>module-parent</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../build/pom.xml</relativePath>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>wsrp-test-support</artifactId>
+ <packaging>jar</packaging>
+ <name>JBoss Portal WSRP Test Support</name>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.jboss.portal.wsrp</groupId>
+ <artifactId>wsrp1-rpc</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.wsrp</groupId>
+ <artifactId>wsrp-core</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.jboss.portal.portlet</groupId>
+ <artifactId>portlet-portlet</artifactId>
+ <version>${version.portlet}</version>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/BehaviorRegistry.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/BehaviorRegistry.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/BehaviorRegistry.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,110 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework;
+
+import org.jboss.portal.wsrp.WSRPExceptionFactory;
+import org.jboss.portal.wsrp.core.InvalidHandleFault;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 9360 $
+ * @since 2.6
+ */
+public class BehaviorRegistry
+{
+ private final Map<String, MarkupBehavior> behaviors = new HashMap<String,
MarkupBehavior>();
+ private PortletManagementBehavior portletManagementBehavior;
+ private ServiceDescriptionBehavior serviceDescriptionBehavior;
+ private RegistrationBehavior registrationBehavior;
+
+ public ServiceDescriptionBehavior getServiceDescriptionBehavior()
+ {
+ // this is required since the consumer will try to access the producer as soon as
it's started and the test
+ // producer will not be properly setup at that time since it's set up in the
test's setUp method...
+ if (serviceDescriptionBehavior == null)
+ {
+ return ServiceDescriptionBehavior.DEFAULT;
+ }
+
+ return serviceDescriptionBehavior;
+ }
+
+ public void clear()
+ {
+ behaviors.clear();
+ }
+
+ public MarkupBehavior getMarkupBehaviorFor(String handle) throws InvalidHandleFault
+ {
+ if (behaviors.containsKey(handle))
+ {
+ return behaviors.get(handle);
+ }
+ throw
WSRPExceptionFactory.throwSOAPFaultException(WSRPExceptionFactory.INVALID_HANDLE,
+ "There is no registered MarkupBehavior for handle '" + handle +
"'", null);
+ }
+
+ public void registerMarkupBehavior(MarkupBehavior behavior)
+ {
+ for (String handle : behavior.getSupportedHandles())
+ {
+ MarkupBehavior existing = behaviors.get(handle);
+ if (existing != null)
+ {
+ throw new IllegalArgumentException("Cannot register behavior " +
behavior.getClass().getName()
+ + " because it uses a handle '" + handle + "'
that's already associated with behavior "
+ + existing.getClass().getName());
+ }
+ behaviors.put(handle, behavior);
+ }
+ }
+
+ public PortletManagementBehavior getPortletManagementBehavior()
+ {
+ return portletManagementBehavior;
+ }
+
+ public void setPortletManagementBehavior(PortletManagementBehavior
portletManagementBehavior)
+ {
+ this.portletManagementBehavior = portletManagementBehavior;
+ }
+
+ public void setServiceDescriptionBehavior(ServiceDescriptionBehavior
serviceDescriptionBehavior)
+ {
+ this.serviceDescriptionBehavior = serviceDescriptionBehavior;
+ }
+
+ public RegistrationBehavior getRegistrationBehavior()
+ {
+ return registrationBehavior;
+ }
+
+ public void setRegistrationBehavior(RegistrationBehavior registrationBehavior)
+ {
+ this.registrationBehavior = registrationBehavior;
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/InitCookieFakerHandler.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/InitCookieFakerHandler.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/InitCookieFakerHandler.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework;
+
+import javax.xml.namespace.QName;
+import javax.xml.rpc.handler.GenericHandler;
+import javax.xml.rpc.handler.MessageContext;
+import javax.xml.rpc.handler.soap.SOAPMessageContext;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPBody;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPMessage;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class InitCookieFakerHandler extends GenericHandler
+{
+ public QName[] getHeaders()
+ {
+ return null;
+ }
+
+ public boolean handleResponse(MessageContext msgContext)
+ {
+ SOAPMessageContext smc = (SOAPMessageContext)msgContext;
+ SOAPMessage message = smc.getMessage();
+ try
+ {
+ SOAPBody body = message.getSOAPBody();
+ String messageType = body.getFirstChild().getLocalName();
+
+ if (!"initCookieResponse".equals(messageType))
+ {
+ // only process if we're returning from initCookie
+ return super.handleResponse(msgContext);
+ }
+ }
+ catch (SOAPException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File | Settings |
File Templates.
+ }
+
+ MimeHeaders mimeHeaders = message.getMimeHeaders();
+ mimeHeaders.setHeader("Set-Cookie", "value");
+
+ return super.handleResponse(msgContext);
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/MarkupBehavior.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/MarkupBehavior.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/MarkupBehavior.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,181 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.net.media.MediaType;
+import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.WSRPUtils;
+import org.jboss.portal.wsrp.core.AccessDeniedFault;
+import org.jboss.portal.wsrp.core.BlockingInteractionResponse;
+import org.jboss.portal.wsrp.core.GetMarkup;
+import org.jboss.portal.wsrp.core.InconsistentParametersFault;
+import org.jboss.portal.wsrp.core.InitCookie;
+import org.jboss.portal.wsrp.core.InvalidCookieFault;
+import org.jboss.portal.wsrp.core.InvalidHandleFault;
+import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
+import org.jboss.portal.wsrp.core.InvalidSessionFault;
+import org.jboss.portal.wsrp.core.InvalidUserCategoryFault;
+import org.jboss.portal.wsrp.core.MarkupContext;
+import org.jboss.portal.wsrp.core.MarkupParams;
+import org.jboss.portal.wsrp.core.MarkupResponse;
+import org.jboss.portal.wsrp.core.MissingParametersFault;
+import org.jboss.portal.wsrp.core.OperationFailedFault;
+import org.jboss.portal.wsrp.core.PerformBlockingInteraction;
+import org.jboss.portal.wsrp.core.PortletDescription;
+import org.jboss.portal.wsrp.core.PortletStateChangeRequiredFault;
+import org.jboss.portal.wsrp.core.ReleaseSessions;
+import org.jboss.portal.wsrp.core.ReturnAny;
+import org.jboss.portal.wsrp.core.UnsupportedLocaleFault;
+import org.jboss.portal.wsrp.core.UnsupportedMimeTypeFault;
+import org.jboss.portal.wsrp.core.UnsupportedModeFault;
+import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
+import org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType;
+
+import java.rmi.RemoteException;
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * Behavior delivering Markup services.
+ *
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.AbstractMarkupBehavior">Chris
+ * Laprun</a>
+ * @version $Revision: 10337 $
+ * @since 2.6
+ */
+public abstract class MarkupBehavior extends TestProducerBehavior implements
WSRP_v1_Markup_PortType
+{
+ private List<String> handles = new ArrayList<String>(3);
+ private BehaviorRegistry registry;
+
+
+ protected MarkupBehavior(BehaviorRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public MarkupResponse getMarkup(GetMarkup getMarkup) throws
UnsupportedWindowStateFault, InvalidCookieFault,
+ InvalidSessionFault, AccessDeniedFault, InconsistentParametersFault,
InvalidHandleFault, UnsupportedLocaleFault,
+ UnsupportedModeFault, OperationFailedFault, MissingParametersFault,
InvalidUserCategoryFault,
+ InvalidRegistrationFault, UnsupportedMimeTypeFault, RemoteException
+ {
+ MarkupParams markupParams = getMarkup.getMarkupParams();
+
+ String markupString =
getMarkupString(WSRPUtils.getJSR168PortletModeFromWSRPName(markupParams.getMode()),
+ WSRPUtils.getJSR168WindowStateFromWSRPName(markupParams.getWindowState()),
markupParams.getNavigationalState(),
+ getMarkup);
+
+ MarkupContext markupContext =
WSRPTypeFactory.createMarkupContext(MediaType.TEXT_HTML.getValue(), markupString);
+ markupContext.setRequiresUrlRewriting(Boolean.TRUE);
+
+ MarkupResponse markupResponse =
WSRPTypeFactory.createMarkupResponse(markupContext);
+
+ modifyResponseIfNeeded(markupResponse);
+
+ return markupResponse;
+ }
+
+
+ /**
+ * Performs a blocking interaction and returns the appropriate response. Default
implementation returns
+ * <code>null</code>.
+ *
+ * @param performBlockingInteraction the original interaction request
+ * @return a BlockingInteractionResponse
+ */
+ public BlockingInteractionResponse
performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction)
+ throws InvalidSessionFault, UnsupportedModeFault, UnsupportedMimeTypeFault,
OperationFailedFault,
+ UnsupportedWindowStateFault, UnsupportedLocaleFault, AccessDeniedFault,
PortletStateChangeRequiredFault,
+ InvalidRegistrationFault, MissingParametersFault, InvalidUserCategoryFault,
InconsistentParametersFault,
+ InvalidHandleFault, InvalidCookieFault, RemoteException
+ {
+ return null;
+ }
+
+ public ReturnAny releaseSessions(ReleaseSessions releaseSessions) throws
InvalidRegistrationFault,
+ OperationFailedFault, MissingParametersFault, AccessDeniedFault, RemoteException
+ {
+ return null;
+ }
+
+ public ReturnAny initCookie(InitCookie initCookie) throws AccessDeniedFault,
OperationFailedFault,
+ InvalidRegistrationFault, RemoteException
+ {
+ return null;
+ }
+
+ /**
+ * Returns a markup String based on the passed information.
+ *
+ * @param mode the requested mode
+ * @param windowState the requested window state
+ * @param navigationalState the current navigational state
+ * @param getMarkup the original GetMarkup request (in case more information
is required by this behavior)
+ * @return a possibly <code>null</code> markup String
+ */
+ protected abstract String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, GetMarkup getMarkup)
+ throws UnsupportedWindowStateFault, InvalidCookieFault, InvalidSessionFault,
AccessDeniedFault,
+ InconsistentParametersFault, InvalidHandleFault, UnsupportedLocaleFault,
UnsupportedModeFault,
+ OperationFailedFault, MissingParametersFault, InvalidUserCategoryFault,
InvalidRegistrationFault,
+ UnsupportedMimeTypeFault, RemoteException;
+
+ /**
+ * Allows this behavior to modify the response after the markup has been generated.
The default implementation does
+ * nothing.
+ *
+ * @param markupResponse the response that will be passed on to the consumer
+ */
+ public void modifyResponseIfNeeded(MarkupResponse markupResponse)
+ {
+ // default implementation does not nothing
+ }
+
+ public List<String> getSupportedHandles()
+ {
+ return handles;
+ }
+
+ public PortletDescription getPortletDescriptionFor(String handle)
+ {
+ if (handles.contains(handle))
+ {
+ return createPortletDescription(handle, getSuffixFor(handle));
+ }
+ throw new IllegalArgumentException("MarkupBehavior " +
getClass().getName() + " is not associated with handle '"
+ + handle + "'");
+ }
+
+ protected String getSuffixFor(String handle)
+ {
+ return "";
+ }
+
+ protected void registerHandle(String handle)
+ {
+ handles.add(handle);
+
registry.getServiceDescriptionBehavior().addPortletDescription(createPortletDescription(handle,
getSuffixFor(handle)));
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/PortletManagementBehavior.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/PortletManagementBehavior.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/PortletManagementBehavior.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,104 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework;
+
+import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.core.AccessDeniedFault;
+import org.jboss.portal.wsrp.core.ClonePortlet;
+import org.jboss.portal.wsrp.core.DestroyPortlets;
+import org.jboss.portal.wsrp.core.DestroyPortletsResponse;
+import org.jboss.portal.wsrp.core.GetPortletDescription;
+import org.jboss.portal.wsrp.core.GetPortletProperties;
+import org.jboss.portal.wsrp.core.GetPortletPropertyDescription;
+import org.jboss.portal.wsrp.core.InconsistentParametersFault;
+import org.jboss.portal.wsrp.core.InvalidHandleFault;
+import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
+import org.jboss.portal.wsrp.core.InvalidUserCategoryFault;
+import org.jboss.portal.wsrp.core.MissingParametersFault;
+import org.jboss.portal.wsrp.core.OperationFailedFault;
+import org.jboss.portal.wsrp.core.PortletContext;
+import org.jboss.portal.wsrp.core.PortletDescriptionResponse;
+import org.jboss.portal.wsrp.core.PortletPropertyDescriptionResponse;
+import org.jboss.portal.wsrp.core.PropertyList;
+import org.jboss.portal.wsrp.core.SetPortletProperties;
+import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
+
+import java.rmi.RemoteException;
+
+/**
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.PortletManagementBehavior">Chris
+ * Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class PortletManagementBehavior extends TestProducerBehavior implements
WSRP_v1_PortletManagement_PortType
+{
+ public PortletDescriptionResponse getPortletDescription(GetPortletDescription
getPortletDescription)
+ throws AccessDeniedFault, InvalidHandleFault, InvalidUserCategoryFault,
InconsistentParametersFault,
+ MissingParametersFault, InvalidRegistrationFault, OperationFailedFault,
RemoteException
+ {
+ incrementCallCount();
+ return null;
+ }
+
+ public PortletContext clonePortlet(ClonePortlet clonePortlet)
+ throws InvalidUserCategoryFault, AccessDeniedFault, OperationFailedFault,
InvalidHandleFault,
+ InvalidRegistrationFault, InconsistentParametersFault, MissingParametersFault,
RemoteException
+ {
+ incrementCallCount();
+ return null;
+ }
+
+ public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets)
+ throws InconsistentParametersFault, MissingParametersFault,
InvalidRegistrationFault, OperationFailedFault,
+ RemoteException
+ {
+ incrementCallCount();
+ return null;
+ }
+
+ public PortletContext setPortletProperties(SetPortletProperties setPortletProperties)
+ throws OperationFailedFault, InvalidHandleFault, MissingParametersFault,
InconsistentParametersFault,
+ InvalidUserCategoryFault, AccessDeniedFault, InvalidRegistrationFault,
RemoteException
+ {
+ incrementCallCount();
+ return null;
+ }
+
+ public PropertyList getPortletProperties(GetPortletProperties getPortletProperties)
+ throws InvalidHandleFault, MissingParametersFault, InvalidRegistrationFault,
AccessDeniedFault,
+ OperationFailedFault, InconsistentParametersFault, InvalidUserCategoryFault,
RemoteException
+ {
+ incrementCallCount();
+ return null;
+ }
+
+ public PortletPropertyDescriptionResponse
getPortletPropertyDescription(GetPortletPropertyDescription
getPortletPropertyDescription)
+ throws MissingParametersFault, InconsistentParametersFault,
InvalidUserCategoryFault, InvalidRegistrationFault,
+ AccessDeniedFault, InvalidHandleFault, OperationFailedFault, RemoteException
+ {
+ incrementCallCount();
+ return WSRPTypeFactory.createPortletPropertyDescriptionResponse(null);
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/RegistrationBehavior.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/RegistrationBehavior.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/RegistrationBehavior.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,69 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework;
+
+import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
+import org.jboss.portal.wsrp.core.MissingParametersFault;
+import org.jboss.portal.wsrp.core.ModifyRegistration;
+import org.jboss.portal.wsrp.core.OperationFailedFault;
+import org.jboss.portal.wsrp.core.RegistrationContext;
+import org.jboss.portal.wsrp.core.RegistrationData;
+import org.jboss.portal.wsrp.core.RegistrationState;
+import org.jboss.portal.wsrp.core.ReturnAny;
+import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
+
+import java.rmi.RemoteException;
+
+/**
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.RegistrationBehavior">Chris
+ * Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class RegistrationBehavior extends TestProducerBehavior implements
WSRP_v1_Registration_PortType
+{
+ public static final String REGISTRATION_HANDLE = "registration";
+
+ public RegistrationContext register(RegistrationData register)
+ throws MissingParametersFault, OperationFailedFault, RemoteException
+ {
+ incrementCallCount();
+ return WSRPTypeFactory.createRegistrationContext(REGISTRATION_HANDLE);
+ }
+
+ public ReturnAny deregister(RegistrationContext deregister)
+ throws OperationFailedFault, InvalidRegistrationFault, RemoteException
+ {
+ incrementCallCount();
+ return null;
+ }
+
+ public RegistrationState modifyRegistration(ModifyRegistration modifyRegistration)
+ throws MissingParametersFault, OperationFailedFault, InvalidRegistrationFault,
RemoteException
+ {
+ incrementCallCount();
+ return null;
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/ServiceDescriptionBehavior.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/ServiceDescriptionBehavior.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/ServiceDescriptionBehavior.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,137 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework;
+
+import org.jboss.portal.common.util.Tools;
+import org.jboss.portal.wsrp.WSRPConstants;
+import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.core.CookieProtocol;
+import org.jboss.portal.wsrp.core.GetServiceDescription;
+import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
+import org.jboss.portal.wsrp.core.OperationFailedFault;
+import org.jboss.portal.wsrp.core.PortletDescription;
+import org.jboss.portal.wsrp.core.PropertyDescription;
+import org.jboss.portal.wsrp.core.ServiceDescription;
+import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
+
+import java.rmi.RemoteException;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.ServiceDescriptionBehavior">Chris
+ * Laprun</a>
+ * @version $Revision: 11320 $
+ * @since 2.6
+ */
+public class ServiceDescriptionBehavior extends TestProducerBehavior implements
WSRP_v1_ServiceDescription_PortType
+{
+ protected ServiceDescription serviceDescription;
+ private static final ServiceDescription DEFAULT_SERVICE_DESCRIPTION =
WSRPTypeFactory.createServiceDescription(false);
+ public static final ServiceDescriptionBehavior DEFAULT = new
ServiceDescriptionBehavior();
+
+ public ServiceDescriptionBehavior()
+ {
+ //Prepare sample ServiceDescription
+ serviceDescription = WSRPTypeFactory.createServiceDescription(false);
+ }
+
+ public ServiceDescription getServiceDescription(GetServiceDescription
getServiceDescription) throws
+ OperationFailedFault, InvalidRegistrationFault, RemoteException
+ {
+ incrementCallCount();
+ return serviceDescription;
+ }
+
+ public void setRequiresRegistration(boolean requiresRegistration)
+ {
+ serviceDescription.setRequiresRegistration(requiresRegistration);
+ }
+
+ public void setRequiresInitCookie(CookieProtocol requiresInitCookie)
+ {
+ serviceDescription.setRequiresInitCookie(requiresInitCookie);
+ }
+
+ public void setServiceDescription(boolean requiresRegistration, int numberOfProps)
+ {
+ serviceDescription = createServiceDescription(requiresRegistration,
numberOfProps);
+ }
+
+ public static ServiceDescription getDefaultServiceDescription()
+ {
+ return DEFAULT_SERVICE_DESCRIPTION;
+ }
+
+ public void addPortletDescription(PortletDescription portletDescription)
+ {
+ PortletDescription[] initial = serviceDescription.getOfferedPortlets();
+ if (initial == null || initial.length == 0)
+ {
+ serviceDescription.setOfferedPortlets(new
PortletDescription[]{portletDescription});
+ }
+ else
+ {
+ List<PortletDescription> portlets = Tools.toList(initial);
+ portlets.add(portletDescription);
+ serviceDescription.setOfferedPortlets(portlets.toArray(new
PortletDescription[portlets.size()]));
+ }
+ }
+
+ public Set<String> getPortletHandles()
+ {
+ PortletDescription[] portletDescriptions =
serviceDescription.getOfferedPortlets();
+ Set<String> handles = new HashSet<String>(portletDescriptions.length);
+
+ for (PortletDescription description : portletDescriptions)
+ {
+ handles.add(description.getPortletHandle());
+ }
+
+ return handles;
+ }
+
+ public int getPortletNumber()
+ {
+ return serviceDescription.getOfferedPortlets().length;
+ }
+
+ public static ServiceDescription createServiceDescription(boolean
requiresRegistration, int numberOfProperties)
+ {
+ ServiceDescription sd =
WSRPTypeFactory.createServiceDescription(requiresRegistration);
+
+ if (requiresRegistration)
+ {
+ PropertyDescription[] descriptions = new
PropertyDescription[numberOfProperties];
+ for (int i = 0; i < numberOfProperties; i++)
+ {
+ descriptions[i] = WSRPTypeFactory.createPropertyDescription("prop"
+ i, WSRPConstants.XSD_STRING);
+ }
+
sd.setRegistrationPropertyDescription(WSRPTypeFactory.createModelDescription(descriptions));
+ }
+
+ return sd;
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/TestProducerBehavior.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/TestProducerBehavior.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/TestProducerBehavior.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,74 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework;
+
+import org.jboss.portal.common.net.media.MediaType;
+import org.jboss.portal.wsrp.WSRPConstants;
+import org.jboss.portal.wsrp.core.LocalizedString;
+import org.jboss.portal.wsrp.core.MarkupType;
+import org.jboss.portal.wsrp.core.PortletDescription;
+import org.jboss.portal.wsrp.framework.support.ServiceObjectFactory;
+
+/**
+ * Provides a base class for Producer behavior used in Consumer testing.
+ *
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.TestProducerBehavior">Chris
+ * Laprun</a>
+ * @version $Revision: 11317 $
+ * @since 2.6
+ */
+public abstract class TestProducerBehavior
+{
+ protected int callCount;
+
+ /**
+ * Increment the number of times methods of this behavior have been called. Used when
the behavior changes depending
+ * on how many times methods have been called.
+ */
+ public void incrementCallCount()
+ {
+ callCount++;
+ }
+
+ public int getCallCount()
+ {
+ return callCount;
+ }
+
+ public PortletDescription createPortletDescription(String portletHandle, String
suffix)
+ {
+ PortletDescription portletDesc = new PortletDescription();
+ portletDesc.setPortletHandle(portletHandle);
+ portletDesc.setMarkupTypes(new MarkupType[]{new
MarkupType(MediaType.TEXT_HTML.getValue(), new String[]{WSRPConstants.VIEW_MODE},
+ new String[]{WSRPConstants.NORMAL_WINDOW_STATE},
WSRPConstants.getDefaultLocales(), null)});
+
+ String suffixString = suffix == null ? "" : suffix;
+
portletDesc.setDescription(ServiceObjectFactory.createLocalizedString(ServiceObjectFactory.SAMPLE_DESCRIPTION
+ suffixString));
+
portletDesc.setTitle(ServiceObjectFactory.createLocalizedString(ServiceObjectFactory.SAMPLE_TITLE
+ suffixString));
+
portletDesc.setShortTitle(ServiceObjectFactory.createLocalizedString(ServiceObjectFactory.SAMPLE_SHORTTITLE
+ suffixString));
+
portletDesc.setDisplayName(ServiceObjectFactory.createLocalizedString(ServiceObjectFactory.SAMPLE_DISPLAYNAME
+ suffixString));
+ portletDesc.setKeywords(new
LocalizedString[]{ServiceObjectFactory.createLocalizedString(ServiceObjectFactory.SAMPLE_KEYWORD
+ suffixString)});
+ return portletDesc;
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/TestWSRPProducer.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/TestWSRPProducer.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/TestWSRPProducer.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,48 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework;
+
+import org.jboss.portal.wsrp.WSRPProducer;
+
+/**
+ * Exposes WSPRProducer test implementation methods - we inject what it returns
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 10610 $
+ */
+public interface TestWSRPProducer extends WSRPProducer
+{
+ /** Resets any currently held state. */
+ void reset();
+
+ BehaviorRegistry getBehaviorRegistry();
+
+ /**
+ * Sets the currently used portlet handle identifying the MarkupBehavior we're
using. This is needed to be able to
+ * dispatch calls to initCookie to the proper behavior.
+ *
+ * @param handle
+ */
+ void setCurrentMarkupBehaviorHandle(String handle);
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/TestWSRPProducerImpl.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/TestWSRPProducerImpl.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/TestWSRPProducerImpl.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,284 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework;
+
+import org.jboss.portal.registration.RegistrationManager;
+import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.core.AccessDeniedFault;
+import org.jboss.portal.wsrp.core.BlockingInteractionResponse;
+import org.jboss.portal.wsrp.core.ClonePortlet;
+import org.jboss.portal.wsrp.core.CookieProtocol;
+import org.jboss.portal.wsrp.core.DestroyPortlets;
+import org.jboss.portal.wsrp.core.DestroyPortletsResponse;
+import org.jboss.portal.wsrp.core.GetMarkup;
+import org.jboss.portal.wsrp.core.GetPortletDescription;
+import org.jboss.portal.wsrp.core.GetPortletProperties;
+import org.jboss.portal.wsrp.core.GetPortletPropertyDescription;
+import org.jboss.portal.wsrp.core.GetServiceDescription;
+import org.jboss.portal.wsrp.core.InconsistentParametersFault;
+import org.jboss.portal.wsrp.core.InitCookie;
+import org.jboss.portal.wsrp.core.InvalidCookieFault;
+import org.jboss.portal.wsrp.core.InvalidHandleFault;
+import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
+import org.jboss.portal.wsrp.core.InvalidSessionFault;
+import org.jboss.portal.wsrp.core.InvalidUserCategoryFault;
+import org.jboss.portal.wsrp.core.MarkupResponse;
+import org.jboss.portal.wsrp.core.MissingParametersFault;
+import org.jboss.portal.wsrp.core.ModifyRegistration;
+import org.jboss.portal.wsrp.core.OperationFailedFault;
+import org.jboss.portal.wsrp.core.PerformBlockingInteraction;
+import org.jboss.portal.wsrp.core.PortletContext;
+import org.jboss.portal.wsrp.core.PortletDescriptionResponse;
+import org.jboss.portal.wsrp.core.PortletPropertyDescriptionResponse;
+import org.jboss.portal.wsrp.core.PortletStateChangeRequiredFault;
+import org.jboss.portal.wsrp.core.PropertyList;
+import org.jboss.portal.wsrp.core.RegistrationContext;
+import org.jboss.portal.wsrp.core.RegistrationData;
+import org.jboss.portal.wsrp.core.RegistrationState;
+import org.jboss.portal.wsrp.core.ReleaseSessions;
+import org.jboss.portal.wsrp.core.ReturnAny;
+import org.jboss.portal.wsrp.core.ServiceDescription;
+import org.jboss.portal.wsrp.core.SetPortletProperties;
+import org.jboss.portal.wsrp.core.UnsupportedLocaleFault;
+import org.jboss.portal.wsrp.core.UnsupportedMimeTypeFault;
+import org.jboss.portal.wsrp.core.UnsupportedModeFault;
+import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
+import org.jboss.portal.wsrp.producer.WSRPValidator;
+import org.jboss.portal.wsrp.producer.config.ProducerConfiguration;
+import org.jboss.portal.wsrp.producer.config.ProducerRegistrationRequirements;
+import org.jboss.portal.wsrp.services.AbstractJBossService;
+
+import java.rmi.RemoteException;
+
+/**
+ * This is dummy clone of org.jboss.portal.wsrp.producer.WSRPProducerImpl customizable
from client side. Just for
+ * consumer implementation testing purposes.
+ *
+ * @author <a href="mailto:Boleslaw.Dawidowicz@jboss.com">Boleslaw
Dawidowicz</a>
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 12020 $
+ * @since 2.4
+ */
+public class TestWSRPProducerImpl extends AbstractJBossService implements
TestWSRPProducer
+{
+ private int sessionExpirationTime = DEFAULT_SESSION_EXPIRATION_TIME;
+
+ private CookieProtocol requiresInitCookie = CookieProtocol.none;
+
+ private BehaviorRegistry behaviorRegistry = new BehaviorRegistry();
+
+ public static final String USER_COOKIE = "cookie";
+
+ private String currentMarkupBehaviorHandle;
+
+ public TestWSRPProducerImpl()
+ {
+ reset();
+ }
+
+ public BehaviorRegistry getBehaviorRegistry()
+ {
+ return behaviorRegistry;
+ }
+
+ public void setCurrentMarkupBehaviorHandle(String handle)
+ {
+ currentMarkupBehaviorHandle = handle;
+ }
+
+ public void reset()
+ {
+ requiresInitCookie = null;
+ currentMarkupBehaviorHandle = null;
+ behaviorRegistry.clear();
+ }
+
+ private MarkupBehavior getMarkupBehaviorFor(String portletHandle) throws
InvalidHandleFault
+ {
+ return behaviorRegistry.getMarkupBehaviorFor(portletHandle);
+ }
+
+ private ServiceDescriptionBehavior getServiceDescriptionBehavior()
+ {
+ return behaviorRegistry.getServiceDescriptionBehavior();
+ }
+
+ public PortletManagementBehavior getPortletManagementBehavior()
+ {
+ return behaviorRegistry.getPortletManagementBehavior();
+ }
+
+ // ServiceDescription implementation
********************************************************************************
+
+ public ServiceDescription getServiceDescription(GetServiceDescription gs)
+ throws InvalidRegistrationFault, OperationFailedFault, RemoteException
+ {
+ return getServiceDescriptionBehavior().getServiceDescription(gs);
+ }
+
+ // MarkupService implementation
*************************************************************************************
+
+ public MarkupResponse getMarkup(GetMarkup getMarkup)
+ throws UnsupportedWindowStateFault, InvalidCookieFault, InvalidSessionFault,
AccessDeniedFault,
+ InconsistentParametersFault, InvalidHandleFault, UnsupportedLocaleFault,
UnsupportedModeFault,
+ OperationFailedFault, MissingParametersFault, InvalidUserCategoryFault,
InvalidRegistrationFault,
+ UnsupportedMimeTypeFault, RemoteException
+ {
+
+ return getMarkupBehaviorFor(getMarkup.getPortletContext().getPortletHandle())
+ .getMarkup(getMarkup);
+ }
+
+ public BlockingInteractionResponse
performBlockingInteraction(PerformBlockingInteraction performBlockingInteraction)
+ throws InvalidSessionFault, UnsupportedModeFault, UnsupportedMimeTypeFault,
OperationFailedFault,
+ UnsupportedWindowStateFault, UnsupportedLocaleFault, AccessDeniedFault,
PortletStateChangeRequiredFault,
+ InvalidRegistrationFault, MissingParametersFault, InvalidUserCategoryFault,
InconsistentParametersFault,
+ InvalidHandleFault, InvalidCookieFault, RemoteException
+ {
+
+ return
getMarkupBehaviorFor(performBlockingInteraction.getPortletContext().getPortletHandle())
+ .performBlockingInteraction(performBlockingInteraction);
+ }
+
+ public ReturnAny releaseSessions(ReleaseSessions releaseSessions)
+ throws InvalidRegistrationFault, OperationFailedFault, MissingParametersFault,
AccessDeniedFault, RemoteException
+ {
+ return null;
+ }
+
+ public ReturnAny initCookie(InitCookie initCookie)
+ throws AccessDeniedFault, OperationFailedFault, InvalidRegistrationFault,
RemoteException
+ {
+ // should only be called if we required cookies to be initialized
+ if (requiresInitCookie == null || CookieProtocol.none.equals(requiresInitCookie))
+ {
+ throw new OperationFailedFault();
+ }
+
+ try
+ {
+ return
getMarkupBehaviorFor(currentMarkupBehaviorHandle).initCookie(initCookie);
+ }
+ catch (InvalidHandleFault invalidHandleFault)
+ {
+ throw new OperationFailedFault();
+ }
+ }
+
+ // Registration implementation
**************************************************************************************
+
+ public RegistrationContext register(RegistrationData register) throws
MissingParametersFault, OperationFailedFault, RemoteException
+ {
+ return WSRPTypeFactory.createRegistrationContext("registration");
+ }
+
+ public ReturnAny deregister(RegistrationContext deregister) throws
OperationFailedFault, InvalidRegistrationFault, RemoteException
+ {
+ return null;
+ }
+
+ public RegistrationState modifyRegistration(ModifyRegistration modifyRegistration)
throws MissingParametersFault, OperationFailedFault, InvalidRegistrationFault,
RemoteException
+ {
+ return null;
+ }
+
+ // PortletManagement implementation
*********************************************************************************
+
+ public PortletDescriptionResponse getPortletDescription(GetPortletDescription
getPortletDescription)
+ throws AccessDeniedFault, InvalidHandleFault, InvalidUserCategoryFault,
InconsistentParametersFault,
+ MissingParametersFault, InvalidRegistrationFault, OperationFailedFault,
RemoteException
+ {
+ return
getPortletManagementBehavior().getPortletDescription(getPortletDescription);
+ }
+
+ public PortletContext clonePortlet(ClonePortlet clonePortlet) throws
InvalidUserCategoryFault, AccessDeniedFault, OperationFailedFault, InvalidHandleFault,
InvalidRegistrationFault, InconsistentParametersFault, MissingParametersFault,
RemoteException
+ {
+ return getPortletManagementBehavior().clonePortlet(clonePortlet);
+ }
+
+ public DestroyPortletsResponse destroyPortlets(DestroyPortlets destroyPortlets) throws
InconsistentParametersFault, MissingParametersFault, InvalidRegistrationFault,
OperationFailedFault, RemoteException
+ {
+ return getPortletManagementBehavior().destroyPortlets(destroyPortlets);
+ }
+
+ public PortletContext setPortletProperties(SetPortletProperties setPortletProperties)
throws OperationFailedFault, InvalidHandleFault, MissingParametersFault,
InconsistentParametersFault, InvalidUserCategoryFault, AccessDeniedFault,
InvalidRegistrationFault, RemoteException
+ {
+ return getPortletManagementBehavior().setPortletProperties(setPortletProperties);
+ }
+
+ public PropertyList getPortletProperties(GetPortletProperties getPortletProperties)
throws InvalidHandleFault, MissingParametersFault, InvalidRegistrationFault,
AccessDeniedFault, OperationFailedFault, InconsistentParametersFault,
InvalidUserCategoryFault, RemoteException
+ {
+ return getPortletManagementBehavior().getPortletProperties(getPortletProperties);
+ }
+
+ public PortletPropertyDescriptionResponse
getPortletPropertyDescription(GetPortletPropertyDescription getPortletPropertyDescription)
throws MissingParametersFault, InconsistentParametersFault, InvalidUserCategoryFault,
InvalidRegistrationFault, AccessDeniedFault, InvalidHandleFault, OperationFailedFault,
RemoteException
+ {
+ return
getPortletManagementBehavior().getPortletPropertyDescription(getPortletPropertyDescription);
+ }
+
+ // Producer implementation
******************************************************************************************
+
+ public CookieProtocol getRequiresInitCookie()
+ {
+ return requiresInitCookie;
+ }
+
+ public void setRequiresInitCookie(CookieProtocol requiresInitCookie)
+ {
+ this.requiresInitCookie = requiresInitCookie;
+ getServiceDescriptionBehavior().setRequiresInitCookie(requiresInitCookie);
+ }
+
+ public int getSessionExpirationTime()
+ {
+ return sessionExpirationTime;
+ }
+
+ public void setSessionExpirationTime(int sessionExpirationTime)
+ {
+ this.sessionExpirationTime = sessionExpirationTime;
+ }
+
+ public ProducerRegistrationRequirements getProducerRegistrationRequirements()
+ {
+ throw new UnsupportedOperationException("getProducerRegistrationRequirements
not implemented");
+ }
+
+
+ public RegistrationManager getRegistrationManager()
+ {
+ throw new UnsupportedOperationException("getRegistrationManager not
implemented");
+ }
+
+
+ public ProducerConfiguration getProducerConfiguration()
+ {
+ throw new UnsupportedOperationException("getProducerConfiguration not
implemented");
+ }
+
+ public void usingStrictModeChangedTo(boolean strictMode)
+ {
+ WSRPValidator.setStrict(strictMode);
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicInstanceContext.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicInstanceContext.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicInstanceContext.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,59 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework.support;
+
+import org.jboss.portal.portlet.StateEvent;
+import org.jboss.portal.portlet.spi.InstanceContext;
+import org.jboss.portal.portlet.state.AccessMode;
+
+/**
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.support.BasicInstanceContext">Chris
+ * Laprun</a>
+ * @version $Revision: 10198 $
+ * @since 2.4
+ */
+public class BasicInstanceContext implements InstanceContext
+{
+ String id;
+
+ public BasicInstanceContext(String id)
+ {
+ this.id = id;
+ }
+
+ public String getId()
+ {
+ return id;
+ }
+
+ public AccessMode getAccessMode()
+ {
+ return AccessMode.READ_ONLY;
+ }
+
+ public void onStateEvent(StateEvent event)
+ {
+ // do nothing
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicPortalContext.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicPortalContext.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicPortalContext.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,60 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework.support;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.portlet.spi.PortalContext;
+import org.jboss.portal.wsrp.WSRPUtils;
+
+import java.util.Collections;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class BasicPortalContext implements PortalContext
+{
+ public String getInfo()
+ {
+ return PortalContext.VERSION.toString();
+ }
+
+ public Set<WindowState> getWindowStates()
+ {
+ return WSRPUtils.DEFAULT_JSR168_WINDOWSTATES;
+ }
+
+ public Set<Mode> getModes()
+ {
+ return WSRPUtils.DEFAULT_JSR168_MODES;
+ }
+
+ public Map<String, String> getProperties()
+ {
+ return Collections.emptyMap();
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicSecurityContext.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicSecurityContext.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicSecurityContext.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,67 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework.support;
+
+import org.jboss.portal.portlet.spi.SecurityContext;
+
+import java.security.Principal;
+
+/**
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.support.BasicSecurityContext">Chris
+ * Laprun</a>
+ * @version $Revision: 10198 $
+ * @since 2.4
+ */
+public class BasicSecurityContext implements SecurityContext
+{
+ public String getAuthType()
+ {
+ return null;
+ }
+
+ public String getRemoteUser()
+ {
+ return null;
+ }
+
+ public Principal getUserPrincipal()
+ {
+ return null;
+ }
+
+ public boolean isUserInRole(String s)
+ {
+ return false;
+ }
+
+ public boolean isSecure()
+ {
+ return false;
+ }
+
+ public boolean isAuthenticated()
+ {
+ return false;
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicUserContext.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicUserContext.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BasicUserContext.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,83 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework.support;
+
+import org.jboss.portal.portlet.spi.UserContext;
+
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+
+/**
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.support.BasicUserContext">Chris
+ * Laprun</a>
+ * @version $Revision: 11068 $
+ * @since 2.4
+ */
+public class BasicUserContext implements UserContext
+{
+ /** . */
+ private Map<String, Object> attributes;
+
+ public String getId()
+ {
+ return null;
+ }
+
+ public Map<String, String> getInformations()
+ {
+ return null;
+ }
+
+ public Locale getLocale()
+ {
+ return Locale.ENGLISH;
+ }
+
+ public List getLocales()
+ {
+ return Collections.singletonList(getLocale());
+ }
+
+ public Object getAttribute(String arg0)
+ {
+ if (attributes != null)
+ {
+ return attributes.get(arg0);
+ }
+ return null;
+ }
+
+ public void setAttribute(String arg0, Object arg1)
+ {
+ if (attributes == null)
+ {
+ attributes = new HashMap<String, Object>();
+ }
+ attributes.put(arg0, arg1);
+ }
+
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BehaviorBackedServiceFactory.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BehaviorBackedServiceFactory.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/BehaviorBackedServiceFactory.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,204 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework.support;
+
+import org.jboss.portal.Mode;
+import org.jboss.portal.WindowState;
+import org.jboss.portal.common.NotYetImplemented;
+import org.jboss.portal.wsrp.core.AccessDeniedFault;
+import org.jboss.portal.wsrp.core.GetMarkup;
+import org.jboss.portal.wsrp.core.InconsistentParametersFault;
+import org.jboss.portal.wsrp.core.InvalidCookieFault;
+import org.jboss.portal.wsrp.core.InvalidHandleFault;
+import org.jboss.portal.wsrp.core.InvalidRegistrationFault;
+import org.jboss.portal.wsrp.core.InvalidSessionFault;
+import org.jboss.portal.wsrp.core.InvalidUserCategoryFault;
+import org.jboss.portal.wsrp.core.MissingParametersFault;
+import org.jboss.portal.wsrp.core.OperationFailedFault;
+import org.jboss.portal.wsrp.core.UnsupportedLocaleFault;
+import org.jboss.portal.wsrp.core.UnsupportedMimeTypeFault;
+import org.jboss.portal.wsrp.core.UnsupportedModeFault;
+import org.jboss.portal.wsrp.core.UnsupportedWindowStateFault;
+import org.jboss.portal.wsrp.core.WSRP_v1_Markup_PortType;
+import org.jboss.portal.wsrp.core.WSRP_v1_PortletManagement_PortType;
+import org.jboss.portal.wsrp.core.WSRP_v1_Registration_PortType;
+import org.jboss.portal.wsrp.core.WSRP_v1_ServiceDescription_PortType;
+import org.jboss.portal.wsrp.framework.BehaviorRegistry;
+import org.jboss.portal.wsrp.framework.MarkupBehavior;
+import org.jboss.portal.wsrp.services.ServiceFactory;
+
+import java.rmi.Remote;
+import java.rmi.RemoteException;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 11461 $
+ * @since 2.6
+ */
+public class BehaviorBackedServiceFactory implements ServiceFactory
+{
+ private BehaviorRegistry registry;
+ private final static String MARKUP = "markup";
+ private final static String SD_URL = "sd";
+ private final static String M_URL = "m";
+ private final static String PM_URL = "pm";
+ private final static String R_URL = "r";
+ private boolean initialized = false;
+
+
+ public BehaviorBackedServiceFactory()
+ {
+ registry = new BehaviorRegistry();
+ registry.registerMarkupBehavior(new SimpleMarkupBehavior());
+ }
+
+ public <T extends Remote> T getService(Class<T> serviceClass) throws
Exception
+ {
+ if (WSRP_v1_ServiceDescription_PortType.class.isAssignableFrom(serviceClass))
+ {
+ return (T)registry.getServiceDescriptionBehavior();
+ }
+ if (WSRP_v1_Markup_PortType.class.isAssignableFrom(serviceClass))
+ {
+ return (T)registry.getMarkupBehaviorFor(MARKUP);
+ }
+ if (WSRP_v1_PortletManagement_PortType.class.isAssignableFrom(serviceClass))
+ {
+ return (T)registry.getPortletManagementBehavior();
+ }
+ if (WSRP_v1_Registration_PortType.class.isAssignableFrom(serviceClass))
+ {
+ return (T)registry.getRegistrationBehavior();
+ }
+ return null;
+ }
+
+ public BehaviorRegistry getRegistry()
+ {
+ return registry;
+ }
+
+ public void setRegistry(BehaviorRegistry registry)
+ {
+ this.registry = registry;
+ }
+
+ public boolean isAvailable()
+ {
+ if (!initialized)
+ {
+ initialized = true;
+ return false;
+ }
+ return true;
+ }
+
+ public boolean isFailed()
+ {
+ return false;
+ }
+
+ public void setFailed(boolean failed)
+ {
+ // do nothing
+ }
+
+ public String getServiceDescriptionURL()
+ {
+ return SD_URL;
+ }
+
+ public String getMarkupURL()
+ {
+ return M_URL;
+ }
+
+ public String getRegistrationURL()
+ {
+ return R_URL;
+ }
+
+ public String getPortletManagementURL()
+ {
+ return PM_URL;
+ }
+
+ public void setServiceDescriptionURL(String serviceDescriptionURL)
+ {
+ // do nothing
+ }
+
+ public void setMarkupURL(String markupURL)
+ {
+ // do nothing
+ }
+
+ public void setRegistrationURL(String registrationURL)
+ {
+ // do nothing
+ }
+
+ public void setPortletManagementURL(String portletManagementURL)
+ {
+ // do nothing
+ }
+
+ public void create() throws Exception
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void start() throws Exception
+ {
+ // do nothing
+ }
+
+ public void stop()
+ {
+ throw new NotYetImplemented();
+ }
+
+ public void destroy()
+ {
+ throw new NotYetImplemented();
+ }
+
+ private class SimpleMarkupBehavior extends MarkupBehavior
+ {
+ public SimpleMarkupBehavior()
+ {
+ super(BehaviorBackedServiceFactory.this.registry);
+ registerHandle(MARKUP);
+ }
+
+ protected String getMarkupString(Mode mode, WindowState windowState, String
navigationalState, GetMarkup getMarkup)
+ throws UnsupportedWindowStateFault, InvalidCookieFault, InvalidSessionFault,
AccessDeniedFault,
+ InconsistentParametersFault, InvalidHandleFault, UnsupportedLocaleFault,
UnsupportedModeFault,
+ OperationFailedFault, MissingParametersFault, InvalidUserCategoryFault,
InvalidRegistrationFault,
+ UnsupportedMimeTypeFault, RemoteException
+ {
+ return MARKUP;
+ }
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockConsumerRegistry.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockConsumerRegistry.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockConsumerRegistry.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,127 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework.support;
+
+import org.jboss.portal.common.util.ParameterValidation;
+import org.jboss.portal.portlet.federation.FederatingPortletInvoker;
+import org.jboss.portal.wsrp.WSRPConsumer;
+import org.jboss.portal.wsrp.consumer.ConsumerException;
+import org.jboss.portal.wsrp.consumer.ConsumerRegistry;
+import org.jboss.portal.wsrp.consumer.EndpointConfigurationInfo;
+import org.jboss.portal.wsrp.consumer.ProducerInfo;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 12693 $
+ * @since 2.6
+ */
+public class MockConsumerRegistry implements ConsumerRegistry
+{
+ private Map consumers = new HashMap(3);
+ public static final String MOCK_SERVICE_DESCRIPTION =
"mock-service-description";
+ public static final String MOCK_MARKUP = "mock-markup";
+ public static final String CONSUMER1 = "inDB";
+ public static final String CONSUMER2 = "inDB2";
+
+ /**
+ * Creates a ConsumerRegistry containing 2 consumers with id '{@link
#CONSUMER1}' and '{@link #CONSUMER2}'
+ * respectively. CONSUMER2 is active and has a service description URL set to {@link
#MOCK_SERVICE_DESCRIPTION} and a
+ * markup URL set to {@link #MOCK_MARKUP}
+ */
+ public MockConsumerRegistry()
+ {
+ reloadConsumers();
+ }
+
+ public List<WSRPConsumer> getConfiguredConsumers()
+ {
+ return new ArrayList<WSRPConsumer>(consumers.values());
+ }
+
+ public WSRPConsumer getConsumer(String id)
+ {
+ return (WSRPConsumer)consumers.get(id);
+ }
+
+ public FederatingPortletInvoker getFederatingPortletInvoker()
+ {
+ return null;
+ }
+
+ public WSRPConsumer createConsumer(String id, Integer expirationCacheSeconds)
+ {
+ MockWSRPConsumer consumer = new MockWSRPConsumer(id);
+ consumer.getProducerInfo().setExpirationCacheSeconds(expirationCacheSeconds);
+ consumers.put(id, consumer);
+ return consumer;
+ }
+
+ public void persistConsumer(WSRPConsumer consumer)
+ {
+ ParameterValidation.throwIllegalArgExceptionIfNull(consumer,
"WSRPConsumer");
+ consumers.put(consumer.getProducerId(), consumer);
+ }
+
+ public void activateConsumerWith(String id) throws ConsumerException
+ {
+ // do nothing
+ }
+
+ public void updateProducerInfo(ProducerInfo producerInfo)
+ {
+ // do nothing
+ }
+
+ public void deactivateConsumerWith(String id) throws ConsumerException
+ {
+ // do nothing
+ }
+
+ public void registerOrDeregisterConsumerWith(String id, boolean register)
+ {
+ // do nothing
+ }
+
+ public void destroyConsumer(String id)
+ {
+ // do nothing
+ }
+
+ public void reloadConsumers()
+ {
+ consumers.clear();
+ consumers.put(CONSUMER1, new MockWSRPConsumer(CONSUMER1));
+ MockWSRPConsumer consumer = new MockWSRPConsumer(CONSUMER2);
+ consumer.getProducerInfo().setActive(true);
+ EndpointConfigurationInfo info =
consumer.getProducerInfo().getEndpointConfigurationInfo();
+ info.setServiceDescriptionURL(MOCK_SERVICE_DESCRIPTION);
+ info.setMarkupURL(MOCK_MARKUP);
+ consumers.put(CONSUMER2, consumer);
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockHttpServletRequest.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockHttpServletRequest.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockHttpServletRequest.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,111 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework.support;
+
+import javax.servlet.http.HttpSession;
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.support.MockHttpServletRequest">Chris
+ * Laprun</a>
+ * @version $Revision: 11416 $
+ * @since 2.4
+ */
+public class MockHttpServletRequest implements InvocationHandler, Serializable
+{
+ private HttpSession session;
+
+ private Map attrs;
+ public static String scheme = "http";
+ public static String serverName = "test";
+ public static Integer serverPort = 1234;
+
+ public MockHttpServletRequest(HttpSession session)
+ {
+ this.session = session;
+ this.attrs = new HashMap();
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ String methodName = method.getName();
+ if ("getSession".equals(methodName))
+ {
+ return session;
+ }
+ if ("getHeader".equals(methodName))
+ {
+ if ("User-Agent".equals(args[0]))
+ {
+ return "Mock Client User Agent";
+ }
+ return null;
+ }
+ if ("toString".equals(methodName))
+ {
+ return "MockHttpServletResponse";
+ }
+ if ("getAttribute".equals(methodName))
+ {
+ return attrs.get(args[0]);
+ }
+ if ("setAttribute".equals(methodName))
+ {
+ String name = (String)args[0];
+ Object value = args[1];
+ if (value != null)
+ {
+ attrs.put(name, value);
+ }
+ else
+ {
+ attrs.remove(value);
+ }
+ return null;
+ }
+ if ("removeAttribute".equals(methodName))
+ {
+ String name = (String)args[0];
+ attrs.remove(name);
+ return null;
+ }
+ if ("getScheme".equals(methodName))
+ {
+ return scheme;
+ }
+ if ("getServerName".equals(methodName))
+ {
+ return serverName;
+ }
+ if ("getServerPort".equals(methodName))
+ {
+ return serverPort;
+ }
+ throw new UnsupportedOperationException("MockHttpServletRequest does not
support: " + method);
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockHttpServletResponse.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockHttpServletResponse.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockHttpServletResponse.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,63 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework.support;
+
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+
+/**
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.support.MockHttpServletResponse">Chris
+ * Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.4
+ */
+public class MockHttpServletResponse implements InvocationHandler, Serializable
+{
+ Object cookie;
+
+ public MockHttpServletResponse()
+ {
+ }
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ String methodName = method.getName();
+ if ("addCookie".equals(methodName))
+ {
+ cookie = args[0];
+ return null;
+ }
+ else if ("reset".equals(methodName))
+ {
+ cookie = null;
+ return null;
+ }
+ else if ("toString".equals(methodName))
+ {
+ return "MockHttpServletResponse";
+ }
+ throw new UnsupportedOperationException("MockHttpServletResponse does not
support: " + method);
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockHttpSession.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockHttpSession.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockHttpSession.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,78 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework.support;
+
+import org.jboss.portal.common.util.Tools;
+
+import java.io.Serializable;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a
href="mailto:chris.laprun@jboss.com?subject=org.jboss.portal.test.wsrp.framework.support.MockHttpSession">Chris
+ * Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.4
+ */
+public class MockHttpSession implements InvocationHandler, Serializable
+{
+ private final Map map = new HashMap();
+
+ public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+ {
+ String methodName = method.getName();
+ if ("setAttribute".equals(methodName))
+ {
+ map.put(args[0], args[1]);
+ return null;
+ }
+ else if ("removeAttribute".equals(methodName))
+ {
+ map.remove(args[0]);
+ return null;
+ }
+ else if ("getAttribute".equals(methodName))
+ {
+ return map.get(args[0]);
+ }
+ else if ("getAttributeNames".equals(methodName))
+ {
+ return Tools.toEnumeration(map.keySet().iterator());
+ }
+ else if ("toString".equals(methodName))
+ {
+ return "MockHttpSession";
+ }
+ else if ("getId".equals(methodName))
+ {
+ return "SESSION_ID";
+ }
+ else
+ {
+ throw new UnsupportedOperationException("MockHttpSession does not support:
" + method);
+ }
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockWSRPConsumer.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockWSRPConsumer.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/MockWSRPConsumer.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,181 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework.support;
+
+import org.jboss.portal.portlet.Portlet;
+import org.jboss.portal.portlet.PortletContext;
+import org.jboss.portal.portlet.PortletInvokerException;
+import org.jboss.portal.portlet.invocation.PortletInvocation;
+import org.jboss.portal.portlet.invocation.response.PortletInvocationResponse;
+import org.jboss.portal.portlet.state.PropertyChange;
+import org.jboss.portal.portlet.state.PropertyMap;
+import org.jboss.portal.wsrp.WSRPConsumer;
+import org.jboss.portal.wsrp.api.SessionEvent;
+import org.jboss.portal.wsrp.consumer.ProducerInfo;
+import org.jboss.portal.wsrp.consumer.ProducerSessionInformation;
+import org.jboss.portal.wsrp.consumer.RefreshResult;
+import org.jboss.portal.wsrp.services.ServiceFactory;
+
+import javax.servlet.http.HttpSession;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 8784 $
+ * @since 2.6
+ */
+public class MockWSRPConsumer implements WSRPConsumer
+{
+ private ProducerInfo producerInfo;
+
+ public MockWSRPConsumer(String id)
+ {
+ producerInfo = new ProducerInfo();
+ producerInfo.setId(id);
+ }
+
+ public String getProducerId()
+ {
+ return producerInfo.getId();
+ }
+
+ public void setServiceFactory(ServiceFactory serviceFactory)
+ {
+ }
+
+ public ProducerSessionInformation getProducerSessionInformationFrom(PortletInvocation
invocation)
+ {
+ return null;
+ }
+
+ public ProducerSessionInformation getProducerSessionInformationFrom(HttpSession
session)
+ {
+ return null;
+ }
+
+ public ProducerInfo getProducerInfo()
+ {
+ return producerInfo;
+ }
+
+ public void setProducerInfo(ProducerInfo producerInfo)
+ {
+ }
+
+ public void refreshProducerInfo() throws PortletInvokerException
+ {
+ }
+
+ public void releaseSessions()
+ {
+ }
+
+ public void activate() throws Exception
+ {
+ }
+
+ public void deactivate() throws Exception
+ {
+ }
+
+ public boolean isActive()
+ {
+ return true;
+ }
+
+ public boolean isRefreshNeeded()
+ {
+ return false;
+ }
+
+ public RefreshResult refresh(boolean forceRefresh)
+ {
+ return null;
+ }
+
+ public Set getPortlets() throws PortletInvokerException
+ {
+ return null;
+ }
+
+ public Portlet getPortlet(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException
+ {
+ return null;
+ }
+
+ public PortletInvocationResponse invoke(PortletInvocation invocation) throws
IllegalArgumentException, PortletInvokerException
+ {
+ return null;
+ }
+
+ public PortletContext createClone(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public List destroyClones(List portletContexts) throws IllegalArgumentException,
PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext, Set keys) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public PropertyMap getProperties(PortletContext portletContext) throws
IllegalArgumentException, PortletInvokerException, UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public PortletContext setProperties(PortletContext portletContext, PropertyChange[]
changes) throws IllegalArgumentException, PortletInvokerException,
UnsupportedOperationException
+ {
+ return null;
+ }
+
+ public void create() throws Exception
+ {
+ }
+
+ public void start() throws Exception
+ {
+ }
+
+ public void stop()
+ {
+ }
+
+ public void destroy()
+ {
+ }
+
+ public void sessionCreated(SessionEvent event)
+ {
+ }
+
+ public void sessionDestroyed(SessionEvent event)
+ {
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/ServiceObjectFactory.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/ServiceObjectFactory.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/ServiceObjectFactory.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,66 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework.support;
+
+import org.jboss.portal.wsrp.WSRPTypeFactory;
+import org.jboss.portal.wsrp.core.LocalizedString;
+
+/**
+ * Service Object Factory for testing
+ *
+ * @author <a href="mailto:boleslaw.dawidowicz@jboss.org">Boleslaw
Dawidowicz</a>
+ * @version $Revision: 9360 $
+ */
+public class ServiceObjectFactory
+{
+ public static final String SAMPLE_DESCRIPTION = "SampleDescription";
+
+ public static final String SAMPLE_SHORTTITLE = "SampleShortTitle";
+
+ public static final String SAMPLE_TITLE = "SampleTitle";
+
+ public static final String SAMPLE_DISPLAYNAME = "SampleDisplayName";
+ public static final String SAMPLE_KEYWORD = "keyword";
+
+ private ServiceObjectFactory()
+ {
+ }
+
+ /**
+ * Create the dummiest form of LocalizedString
+ *
+ * @param value
+ * @return
+ */
+ public static LocalizedString createLocalizedString(String value)
+ {
+ return WSRPTypeFactory.createLocalizedString(value);
+ }
+
+ /** Produces String from LocalizedString */
+ public static String extractString(org.jboss.portal.common.i18n.LocalizedString ls)
+ {
+ return ls.getPreferredOrBestLocalizedMappingFor(new
String[]{"en"}).getString();
+ }
+}
Added:
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/TestPortletInvocationContext.java
===================================================================
---
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/TestPortletInvocationContext.java
(rev 0)
+++
modules/wsrp/trunk/test-support/src/main/java/org/jboss/portal/wsrp/framework/support/TestPortletInvocationContext.java 2009-06-25
16:30:42 UTC (rev 13501)
@@ -0,0 +1,140 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2009, 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.wsrp.framework.support;
+
+import org.jboss.portal.common.net.media.MediaType;
+import org.jboss.portal.common.util.MarkupInfo;
+import org.jboss.portal.common.util.ParameterMap;
+import org.jboss.portal.portlet.ContainerURL;
+import org.jboss.portal.portlet.StateString;
+import org.jboss.portal.portlet.URLFormat;
+import org.jboss.portal.portlet.impl.spi.AbstractPortletInvocationContext;
+import org.jboss.portal.portlet.spi.PortletInvocationContext;
+import org.jboss.portal.wsrp.WSRPConstants;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Proxy;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision: 11068 $
+ * @since 2.4
+ */
+public class TestPortletInvocationContext extends AbstractPortletInvocationContext
implements PortletInvocationContext
+{
+
+ private HttpServletRequest mockRequest;
+ private HttpServletResponse mockResponse;
+
+ public TestPortletInvocationContext()
+ {
+ super(new MarkupInfo(MediaType.TEXT_HTML, WSRPConstants.DEFAULT_CHARACTER_SET));
+
+ ClassLoader classLoader = getClass().getClassLoader();
+ HttpSession session = (HttpSession)Proxy.newProxyInstance(classLoader, new
Class[]{HttpSession.class},
+ new MockHttpSession());
+ mockRequest = (HttpServletRequest)Proxy.newProxyInstance(classLoader, new
Class[]{HttpServletRequest.class},
+ new MockHttpServletRequest(session));
+ mockResponse = (HttpServletResponse)Proxy.newProxyInstance(classLoader, new
Class[]{HttpServletResponse.class},
+ new MockHttpServletResponse());
+ }
+
+ public void setMockRequest(HttpServletRequest mockRequest)
+ {
+ this.mockRequest = mockRequest;
+ }
+
+ public void setMockResponse(HttpServletResponse mockResponse)
+ {
+ this.mockResponse = mockResponse;
+ }
+
+ public HttpServletRequest getClientRequest()
+ {
+ if (mockRequest == null)
+ {
+ throw new IllegalStateException();
+ }
+ return mockRequest;
+ }
+
+ public HttpServletResponse getClientResponse()
+ {
+ if (mockResponse == null)
+ {
+ throw new IllegalStateException();
+ }
+ return mockResponse;
+ }
+
+ public String encodeResourceURL(String url)
+ {
+ return null;
+ }
+
+ public String renderURL(ContainerURL containerURL, URLFormat urlFormat)
+ {
+ return null;
+ }
+
+ public String getCharacterEncoding()
+ {
+ return null;
+ }
+
+ public int getContentLength()
+ {
+ return 0;
+ }
+
+ public BufferedReader getReader() throws IOException
+ {
+ return null;
+ }
+
+ public InputStream getInputStream() throws IOException
+ {
+ return null;
+ }
+
+ public String getContentType()
+ {
+ return null;
+ }
+
+ public StateString getInteractionState()
+ {
+ return null;
+ }
+
+ public ParameterMap getForm()
+ {
+ return null;
+ }
+}