gatein SVN: r773 - in components/wci/trunk: exo and 12 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-11-23 14:33:52 -0500 (Mon, 23 Nov 2009)
New Revision: 773
Modified:
components/wci/trunk/exo/pom.xml
components/wci/trunk/jetty/pom.xml
components/wci/trunk/pom.xml
components/wci/trunk/test/core/pom.xml
components/wci/trunk/test/pom.xml
components/wci/trunk/test/portlets/exo-portlet/pom.xml
components/wci/trunk/test/portlets/gatein-portlet/pom.xml
components/wci/trunk/test/portlets/native-portlet/pom.xml
components/wci/trunk/test/servers/jboss42/pom.xml
components/wci/trunk/test/servers/jboss51/pom.xml
components/wci/trunk/test/servers/pom.xml
components/wci/trunk/test/servers/tomcat6/pom.xml
components/wci/trunk/tomcat/pom.xml
components/wci/trunk/wci/pom.xml
Log:
[maven-release-plugin] prepare for next development iteration
Modified: components/wci/trunk/exo/pom.xml
===================================================================
--- components/wci/trunk/exo/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/exo/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-exo</artifactId>
Modified: components/wci/trunk/jetty/pom.xml
===================================================================
--- components/wci/trunk/jetty/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/jetty/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-jetty</artifactId>
Modified: components/wci/trunk/pom.xml
===================================================================
--- components/wci/trunk/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -6,7 +6,7 @@
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
<packaging>pom</packaging>
<parent>
@@ -16,9 +16,9 @@
</parent>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/wci/tags/2.0.0-CR01</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/wci/tags/2.0.0-CR01</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/wci/tags/2.0.0-CR01</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/wci/trunk/</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/wci/trunk/</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/wci/trunk/</url>
</scm>
<properties>
Modified: components/wci/trunk/test/core/pom.xml
===================================================================
--- components/wci/trunk/test/core/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/test/core/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-core</artifactId>
Modified: components/wci/trunk/test/pom.xml
===================================================================
--- components/wci/trunk/test/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/test/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-parent</artifactId>
Modified: components/wci/trunk/test/portlets/exo-portlet/pom.xml
===================================================================
--- components/wci/trunk/test/portlets/exo-portlet/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/test/portlets/exo-portlet/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-exo-portlet</artifactId>
Modified: components/wci/trunk/test/portlets/gatein-portlet/pom.xml
===================================================================
--- components/wci/trunk/test/portlets/gatein-portlet/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/test/portlets/gatein-portlet/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-gatein-portlet</artifactId>
Modified: components/wci/trunk/test/portlets/native-portlet/pom.xml
===================================================================
--- components/wci/trunk/test/portlets/native-portlet/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/test/portlets/native-portlet/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-native-portlet</artifactId>
Modified: components/wci/trunk/test/servers/jboss42/pom.xml
===================================================================
--- components/wci/trunk/test/servers/jboss42/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/test/servers/jboss42/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-jboss42</artifactId>
Modified: components/wci/trunk/test/servers/jboss51/pom.xml
===================================================================
--- components/wci/trunk/test/servers/jboss51/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/test/servers/jboss51/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-jboss51</artifactId>
Modified: components/wci/trunk/test/servers/pom.xml
===================================================================
--- components/wci/trunk/test/servers/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/test/servers/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-server-parent</artifactId>
Modified: components/wci/trunk/test/servers/tomcat6/pom.xml
===================================================================
--- components/wci/trunk/test/servers/tomcat6/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/test/servers/tomcat6/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-tomcat6</artifactId>
Modified: components/wci/trunk/tomcat/pom.xml
===================================================================
--- components/wci/trunk/tomcat/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/tomcat/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-tomcat</artifactId>
Modified: components/wci/trunk/wci/pom.xml
===================================================================
--- components/wci/trunk/wci/pom.xml 2009-11-23 19:33:07 UTC (rev 772)
+++ components/wci/trunk/wci/pom.xml 2009-11-23 19:33:52 UTC (rev 773)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR01</version>
+ <version>2.0.0-CR02-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-wci</artifactId>
15 years, 1 month
gatein SVN: r772 - components/wci/tags.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-11-23 14:33:07 -0500 (Mon, 23 Nov 2009)
New Revision: 772
Added:
components/wci/tags/2.0.0-CR01/
Log:
[maven-scm] copy for tag 2.0.0-CR01
Copied: components/wci/tags/2.0.0-CR01 (from rev 771, components/wci/trunk)
15 years, 1 month
gatein SVN: r771 - in components/wci/trunk: exo and 12 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-11-23 14:32:16 -0500 (Mon, 23 Nov 2009)
New Revision: 771
Modified:
components/wci/trunk/exo/pom.xml
components/wci/trunk/jetty/pom.xml
components/wci/trunk/pom.xml
components/wci/trunk/test/core/pom.xml
components/wci/trunk/test/pom.xml
components/wci/trunk/test/portlets/exo-portlet/pom.xml
components/wci/trunk/test/portlets/gatein-portlet/pom.xml
components/wci/trunk/test/portlets/native-portlet/pom.xml
components/wci/trunk/test/servers/jboss42/pom.xml
components/wci/trunk/test/servers/jboss51/pom.xml
components/wci/trunk/test/servers/pom.xml
components/wci/trunk/test/servers/tomcat6/pom.xml
components/wci/trunk/tomcat/pom.xml
components/wci/trunk/wci/pom.xml
Log:
[maven-release-plugin] prepare release 2.0.0-CR01
Modified: components/wci/trunk/exo/pom.xml
===================================================================
--- components/wci/trunk/exo/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/exo/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-exo</artifactId>
Modified: components/wci/trunk/jetty/pom.xml
===================================================================
--- components/wci/trunk/jetty/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/jetty/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-jetty</artifactId>
Modified: components/wci/trunk/pom.xml
===================================================================
--- components/wci/trunk/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -6,7 +6,7 @@
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
<packaging>pom</packaging>
<parent>
@@ -16,9 +16,9 @@
</parent>
<scm>
- <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/wci/trunk/</connection>
- <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/wci/trunk/</developerConnection>
- <url>http://fisheye.jboss.org/browse/gatein/components/wci/trunk/</url>
+ <connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/components/wci/tags/2.0.0-CR01</connection>
+ <developerConnection>scm:svn:https://svn.jboss.org/repos/gatein/components/wci/tags/2.0.0-CR01</developerConnection>
+ <url>http://fisheye.jboss.org/browse/gatein/components/wci/tags/2.0.0-CR01</url>
</scm>
<properties>
Modified: components/wci/trunk/test/core/pom.xml
===================================================================
--- components/wci/trunk/test/core/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/test/core/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-core</artifactId>
Modified: components/wci/trunk/test/pom.xml
===================================================================
--- components/wci/trunk/test/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/test/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-parent</artifactId>
Modified: components/wci/trunk/test/portlets/exo-portlet/pom.xml
===================================================================
--- components/wci/trunk/test/portlets/exo-portlet/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/test/portlets/exo-portlet/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-exo-portlet</artifactId>
Modified: components/wci/trunk/test/portlets/gatein-portlet/pom.xml
===================================================================
--- components/wci/trunk/test/portlets/gatein-portlet/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/test/portlets/gatein-portlet/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-gatein-portlet</artifactId>
Modified: components/wci/trunk/test/portlets/native-portlet/pom.xml
===================================================================
--- components/wci/trunk/test/portlets/native-portlet/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/test/portlets/native-portlet/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-native-portlet</artifactId>
Modified: components/wci/trunk/test/servers/jboss42/pom.xml
===================================================================
--- components/wci/trunk/test/servers/jboss42/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/test/servers/jboss42/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-jboss42</artifactId>
@@ -255,30 +255,30 @@
<tasks>
<!-- properties to pass to the build.xml -->
- <property name="project.build.directory" value="${project.build.directory}"/>
- <property name="plugin_classpath" refid="maven.plugin.classpath"/>
+ <property name="project.build.directory" value="${project.build.directory}" />
+ <property name="plugin_classpath" refid="maven.plugin.classpath" />
<property name="test_classpath" refid="maven.test.classpath" />
<!-- hack here allows for profiles to effect tasks in the build.xml -->
<!-- this should be removed when the antrun plugin properly handles properties -->
<condition property="test.generic.enable">
- <istrue value="${test.generic}"/>
+ <istrue value="${test.generic}" />
</condition>
<condition property="test.native.enable">
- <istrue value="${test.native}"/>
+ <istrue value="${test.native}" />
</condition>
<condition property="test.exo.enable">
- <istrue value="${test.exo}"/>
+ <istrue value="${test.exo}" />
</condition>
<condition property="test.endpoint.enable">
- <istrue value="${test.endpoint}"/>
+ <istrue value="${test.endpoint}" />
</condition>
<condition property="cargo.debug" value="${test.cargo.debug}">
- <isset property="test.cargo.debug"/>
+ <isset property="test.cargo.debug" />
</condition>
<condition property="cargo.debug" value="">
<not>
- <isset property="test.cargo.debug"/>
+ <isset property="test.cargo.debug" />
</not>
</condition>
<!-- end profiles hack -->
@@ -300,25 +300,25 @@
<property name="dependency.jboss-serialization.jar" value="${maven.dependency.jboss.jboss-serialization.jar.path}" />
<!-- locations of archives to use -->
- <property name="test.archives.directory" value="${project.build.directory}/test-archives"/>
- <property name="test.generic.server.war" value="${test.archives.directory}/test-spi-generic-server.war"/>
- <property name="test.native.server.war" value="${test.archives.directory}/test-spi-native-server.war"/>
- <property name="test.exo.server.war" value="${test.archives.directory}/test-spi-exo-server.war"/>
+ <property name="test.archives.directory" value="${project.build.directory}/test-archives" />
+ <property name="test.generic.server.war" value="${test.archives.directory}/test-spi-generic-server.war" />
+ <property name="test.native.server.war" value="${test.archives.directory}/test-spi-native-server.war" />
+ <property name="test.exo.server.war" value="${test.archives.directory}/test-spi-exo-server.war" />
- <property name="test.endpoint.default.server.mapping.server.war" value="${test.archives.directory}/test-endpoint-default-servlet-mapping.war"/>
- <property name="test.endpoint.root.mapping.server.war" value="${test.archives.directory}/test-endpoint-root-path-mapping.war"/>
- <property name="test.endpoint.path.mapping.server.war" value="${test.archives.directory}/test-endpoint-path-mapping.war"/>
+ <property name="test.endpoint.default.server.mapping.server.war" value="${test.archives.directory}/test-endpoint-default-servlet-mapping.war" />
+ <property name="test.endpoint.root.mapping.server.war" value="${test.archives.directory}/test-endpoint-root-path-mapping.war" />
+ <property name="test.endpoint.path.mapping.server.war" value="${test.archives.directory}/test-endpoint-path-mapping.war" />
- <property name="test.generic.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-gatein-portlet.war.path}"/>
- <property name="test.native.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-native-portlet.war.path}"/>
- <property name="test.exo.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-exo-portlet.war.path}"/>
+ <property name="test.generic.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-gatein-portlet.war.path}" />
+ <property name="test.native.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-native-portlet.war.path}" />
+ <property name="test.exo.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-exo-portlet.war.path}" />
<!-- location of common.xml shared between the different server's build.xml -->
- <property name="common.xml.file" value="${test.common.xml}"/>
+ <property name="common.xml.file" value="${test.common.xml}" />
<!-- -->
<ant antfile="${basedir}/src/integration-tests/build.xml" inheritRefs="true">
- <target name="tests"/>
+ <target name="tests" />
</ant>
</tasks>
</configuration>
Modified: components/wci/trunk/test/servers/jboss51/pom.xml
===================================================================
--- components/wci/trunk/test/servers/jboss51/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/test/servers/jboss51/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-jboss51</artifactId>
@@ -245,30 +245,30 @@
<tasks>
<!-- properties to pass to the build.xml -->
- <property name="project.build.directory" value="${project.build.directory}"/>
- <property name="plugin_classpath" refid="maven.plugin.classpath"/>
+ <property name="project.build.directory" value="${project.build.directory}" />
+ <property name="plugin_classpath" refid="maven.plugin.classpath" />
<property name="test_classpath" refid="maven.test.classpath" />
<!-- hack here allows for profiles to effect tasks in the build.xml -->
<!-- this should be removed when the antrun plugin properly handles properties -->
<condition property="test.generic.enable">
- <istrue value="${test.generic}"/>
+ <istrue value="${test.generic}" />
</condition>
<condition property="test.native.enable">
- <istrue value="${test.native}"/>
+ <istrue value="${test.native}" />
</condition>
<condition property="test.exo.enable">
- <istrue value="${test.exo}"/>
+ <istrue value="${test.exo}" />
</condition>
<condition property="test.endpoint.enable">
- <istrue value="${test.endpoint}"/>
+ <istrue value="${test.endpoint}" />
</condition>
<condition property="cargo.debug" value="${test.cargo.debug}">
- <isset property="test.cargo.debug"/>
+ <isset property="test.cargo.debug" />
</condition>
<condition property="cargo.debug" value="">
<not>
- <isset property="test.cargo.debug"/>
+ <isset property="test.cargo.debug" />
</not>
</condition>
<!-- end profiles hack -->
@@ -287,25 +287,25 @@
<property name="dependency.jboss-serialization.jar" value="${maven.dependency.jboss.jboss-serialization.jar.path}" />
<!-- locations of archives to use -->
- <property name="test.archives.directory" value="${project.build.directory}/test-archives"/>
- <property name="test.generic.server.war" value="${test.archives.directory}/test-spi-generic-server.war"/>
- <property name="test.native.server.war" value="${test.archives.directory}/test-spi-native-server.war"/>
- <property name="test.exo.server.war" value="${test.archives.directory}/test-spi-exo-server.war"/>
+ <property name="test.archives.directory" value="${project.build.directory}/test-archives" />
+ <property name="test.generic.server.war" value="${test.archives.directory}/test-spi-generic-server.war" />
+ <property name="test.native.server.war" value="${test.archives.directory}/test-spi-native-server.war" />
+ <property name="test.exo.server.war" value="${test.archives.directory}/test-spi-exo-server.war" />
- <property name="test.endpoint.default.server.mapping.server.war" value="${test.archives.directory}/test-endpoint-default-servlet-mapping.war"/>
- <property name="test.endpoint.root.mapping.server.war" value="${test.archives.directory}/test-endpoint-root-path-mapping.war"/>
- <property name="test.endpoint.path.mapping.server.war" value="${test.archives.directory}/test-endpoint-path-mapping.war"/>
+ <property name="test.endpoint.default.server.mapping.server.war" value="${test.archives.directory}/test-endpoint-default-servlet-mapping.war" />
+ <property name="test.endpoint.root.mapping.server.war" value="${test.archives.directory}/test-endpoint-root-path-mapping.war" />
+ <property name="test.endpoint.path.mapping.server.war" value="${test.archives.directory}/test-endpoint-path-mapping.war" />
- <property name="test.generic.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-gatein-portlet.war.path}"/>
- <property name="test.native.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-native-portlet.war.path}"/>
- <property name="test.exo.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-exo-portlet.war.path}"/>
+ <property name="test.generic.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-gatein-portlet.war.path}" />
+ <property name="test.native.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-native-portlet.war.path}" />
+ <property name="test.exo.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-exo-portlet.war.path}" />
<!-- location of common.xml shared between the different server's build.xml -->
- <property name="common.xml.file" value="${test.common.xml}"/>
+ <property name="common.xml.file" value="${test.common.xml}" />
<!-- -->
<ant antfile="${basedir}/src/integration-tests/build.xml" inheritRefs="true">
- <target name="tests"/>
+ <target name="tests" />
</ant>
</tasks>
</configuration>
Modified: components/wci/trunk/test/servers/pom.xml
===================================================================
--- components/wci/trunk/test/servers/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/test/servers/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-server-parent</artifactId>
Modified: components/wci/trunk/test/servers/tomcat6/pom.xml
===================================================================
--- components/wci/trunk/test/servers/tomcat6/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/test/servers/tomcat6/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-tomcat6</artifactId>
@@ -255,30 +255,30 @@
<tasks>
<!-- properties to pass to the build.xml -->
- <property name="project.build.directory" value="${project.build.directory}"/>
- <property name="plugin_classpath" refid="maven.plugin.classpath"/>
+ <property name="project.build.directory" value="${project.build.directory}" />
+ <property name="plugin_classpath" refid="maven.plugin.classpath" />
<property name="test_classpath" refid="maven.test.classpath" />
<!-- hack here allows for profiles to effect tasks in the build.xml -->
<!-- this should be removed when the antrun plugin properly handles properties -->
<condition property="test.generic.enable">
- <istrue value="${test.generic}"/>
+ <istrue value="${test.generic}" />
</condition>
<condition property="test.native.enable">
- <istrue value="${test.native}"/>
+ <istrue value="${test.native}" />
</condition>
<condition property="test.exo.enable">
- <istrue value="${test.exo}"/>
+ <istrue value="${test.exo}" />
</condition>
<condition property="test.endpoint.enable">
- <istrue value="${test.endpoint}"/>
+ <istrue value="${test.endpoint}" />
</condition>
<condition property="cargo.debug" value="${test.cargo.debug}">
- <isset property="test.cargo.debug"/>
+ <isset property="test.cargo.debug" />
</condition>
<condition property="cargo.debug" value="">
<not>
- <isset property="test.cargo.debug"/>
+ <isset property="test.cargo.debug" />
</not>
</condition>
<!-- end profiles hack -->
@@ -299,25 +299,25 @@
<property name="dependency.jboss-serialization.jar" value="${maven.dependency.jboss.jboss-serialization.jar.path}" />
<!-- locations of archives to use -->
- <property name="test.archives.directory" value="${project.build.directory}/test-archives"/>
- <property name="test.generic.server.war" value="${test.archives.directory}/test-spi-generic-server.war"/>
- <property name="test.native.server.war" value="${test.archives.directory}/test-spi-native-server.war"/>
- <property name="test.exo.server.war" value="${test.archives.directory}/test-spi-exo-server.war"/>
+ <property name="test.archives.directory" value="${project.build.directory}/test-archives" />
+ <property name="test.generic.server.war" value="${test.archives.directory}/test-spi-generic-server.war" />
+ <property name="test.native.server.war" value="${test.archives.directory}/test-spi-native-server.war" />
+ <property name="test.exo.server.war" value="${test.archives.directory}/test-spi-exo-server.war" />
- <property name="test.endpoint.default.server.mapping.server.war" value="${test.archives.directory}/test-endpoint-default-servlet-mapping.war"/>
- <property name="test.endpoint.root.mapping.server.war" value="${test.archives.directory}/test-endpoint-root-path-mapping.war"/>
- <property name="test.endpoint.path.mapping.server.war" value="${test.archives.directory}/test-endpoint-path-mapping.war"/>
+ <property name="test.endpoint.default.server.mapping.server.war" value="${test.archives.directory}/test-endpoint-default-servlet-mapping.war" />
+ <property name="test.endpoint.root.mapping.server.war" value="${test.archives.directory}/test-endpoint-root-path-mapping.war" />
+ <property name="test.endpoint.path.mapping.server.war" value="${test.archives.directory}/test-endpoint-path-mapping.war" />
- <property name="test.generic.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-gatein-portlet.war.path}"/>
- <property name="test.native.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-native-portlet.war.path}"/>
- <property name="test.exo.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-exo-portlet.war.path}"/>
+ <property name="test.generic.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-gatein-portlet.war.path}" />
+ <property name="test.native.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-native-portlet.war.path}" />
+ <property name="test.exo.portlet.war" value="${maven.dependency.org.gatein.wci.wci-test-exo-portlet.war.path}" />
<!-- location of common.xml shared between the different server's build.xml -->
- <property name="common.xml.file" value="${test.common.xml}"/>
+ <property name="common.xml.file" value="${test.common.xml}" />
<!-- -->
<ant antfile="${basedir}/src/integration-tests/build.xml" inheritRefs="true">
- <target name="tests"/>
+ <target name="tests" />
</ant>
</tasks>
</configuration>
Modified: components/wci/trunk/tomcat/pom.xml
===================================================================
--- components/wci/trunk/tomcat/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/tomcat/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-tomcat</artifactId>
Modified: components/wci/trunk/wci/pom.xml
===================================================================
--- components/wci/trunk/wci/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
+++ components/wci/trunk/wci/pom.xml 2009-11-23 19:32:16 UTC (rev 771)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR01-SNAPSHOT</version>
+ <version>2.0.0-CR01</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-wci</artifactId>
15 years, 1 month
gatein SVN: r770 - in components/wci/trunk: exo and 13 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-11-23 13:54:43 -0500 (Mon, 23 Nov 2009)
New Revision: 770
Modified:
components/wci/trunk/exo/pom.xml
components/wci/trunk/jetty/pom.xml
components/wci/trunk/pom.xml
components/wci/trunk/test/core/pom.xml
components/wci/trunk/test/pom.xml
components/wci/trunk/test/portlets/exo-portlet/pom.xml
components/wci/trunk/test/portlets/gatein-portlet/pom.xml
components/wci/trunk/test/portlets/native-portlet/pom.xml
components/wci/trunk/test/servers/jboss42/pom.xml
components/wci/trunk/test/servers/jboss51/pom.xml
components/wci/trunk/test/servers/jetty6/pom.xml
components/wci/trunk/test/servers/pom.xml
components/wci/trunk/test/servers/tomcat6/pom.xml
components/wci/trunk/tomcat/pom.xml
components/wci/trunk/wci/pom.xml
Log:
Wrong 0-padding
Modified: components/wci/trunk/exo/pom.xml
===================================================================
--- components/wci/trunk/exo/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/exo/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-exo</artifactId>
Modified: components/wci/trunk/jetty/pom.xml
===================================================================
--- components/wci/trunk/jetty/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/jetty/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-jetty</artifactId>
Modified: components/wci/trunk/pom.xml
===================================================================
--- components/wci/trunk/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -6,7 +6,7 @@
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
<packaging>pom</packaging>
<parent>
Modified: components/wci/trunk/test/core/pom.xml
===================================================================
--- components/wci/trunk/test/core/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/test/core/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-core</artifactId>
Modified: components/wci/trunk/test/pom.xml
===================================================================
--- components/wci/trunk/test/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/test/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-parent</artifactId>
Modified: components/wci/trunk/test/portlets/exo-portlet/pom.xml
===================================================================
--- components/wci/trunk/test/portlets/exo-portlet/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/test/portlets/exo-portlet/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-exo-portlet</artifactId>
Modified: components/wci/trunk/test/portlets/gatein-portlet/pom.xml
===================================================================
--- components/wci/trunk/test/portlets/gatein-portlet/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/test/portlets/gatein-portlet/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-gatein-portlet</artifactId>
Modified: components/wci/trunk/test/portlets/native-portlet/pom.xml
===================================================================
--- components/wci/trunk/test/portlets/native-portlet/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/test/portlets/native-portlet/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-native-portlet</artifactId>
Modified: components/wci/trunk/test/servers/jboss42/pom.xml
===================================================================
--- components/wci/trunk/test/servers/jboss42/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/test/servers/jboss42/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-jboss42</artifactId>
Modified: components/wci/trunk/test/servers/jboss51/pom.xml
===================================================================
--- components/wci/trunk/test/servers/jboss51/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/test/servers/jboss51/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-jboss51</artifactId>
Modified: components/wci/trunk/test/servers/jetty6/pom.xml
===================================================================
--- components/wci/trunk/test/servers/jetty6/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/test/servers/jetty6/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-jetty6</artifactId>
Modified: components/wci/trunk/test/servers/pom.xml
===================================================================
--- components/wci/trunk/test/servers/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/test/servers/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-server-parent</artifactId>
Modified: components/wci/trunk/test/servers/tomcat6/pom.xml
===================================================================
--- components/wci/trunk/test/servers/tomcat6/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/test/servers/tomcat6/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-test-server-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-test-tomcat6</artifactId>
Modified: components/wci/trunk/tomcat/pom.xml
===================================================================
--- components/wci/trunk/tomcat/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/tomcat/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-tomcat</artifactId>
Modified: components/wci/trunk/wci/pom.xml
===================================================================
--- components/wci/trunk/wci/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
+++ components/wci/trunk/wci/pom.xml 2009-11-23 18:54:43 UTC (rev 770)
@@ -2,7 +2,7 @@
<parent>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-parent</artifactId>
- <version>2.0.0-CR1-SNAPSHOT</version>
+ <version>2.0.0-CR01-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>wci-wci</artifactId>
15 years, 1 month
gatein SVN: r769 - in components/mop/trunk: api/src/main/java/org/gatein/mop/api and 7 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-11-23 13:37:57 -0500 (Mon, 23 Nov 2009)
New Revision: 769
Modified:
components/mop/trunk/api/src/main/java/org/gatein/mop/api/Attributes.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/Key.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/Model.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/ValueType.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/ComponentIterator.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/IterationType.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIterator.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategies.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategy.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/StructureIterator.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Content.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/ContentType.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Customization.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/CustomizationContext.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Navigation.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ObjectType.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Page.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Site.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Templatized.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/TemplatizedObject.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Workspace.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceCustomizationContext.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceObject.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/ContentLink.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/Link.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/PageLink.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/URLLink.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIBody.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIComponent.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIContainer.java
components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIWindow.java
components/mop/trunk/pom.xml
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/customization/CustomizationContextProvider.java
Log:
- update pom to have dependency management for common module
- finish to reformat code
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/Attributes.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/Attributes.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/Attributes.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -22,46 +22,47 @@
import java.util.Set;
/**
- * <p>This interface extends a map to provide convenient method for dealing with attribute values in a type safe
- * manner when the interface client knows the type of an attribute and wants to deal with it accordingly.</p>
+ * <p>This interface extends a map to provide convenient method for dealing with attribute values in a type safe manner
+ * when the interface client knows the type of an attribute and wants to deal with it accordingly.</p>
*
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface Attributes {
+public interface Attributes
+{
- Set<String> getKeys();
+ Set<String> getKeys();
- String getString(String name);
+ String getString(String name);
- void setString(String name, String value);
+ void setString(String name, String value);
- Boolean getBoolean(String name);
+ Boolean getBoolean(String name);
- void setBoolean(String name, Boolean value);
+ void setBoolean(String name, Boolean value);
- Integer getInteger(String name);
+ Integer getInteger(String name);
- void setInteger(String name, Integer value);
+ void setInteger(String name, Integer value);
- Date getDate(String name);
+ Date getDate(String name);
- void setDate(String name, Date value);
+ void setDate(String name, Date value);
- Double getDouble(String name);
+ Double getDouble(String name);
- void setDouble(String name, Double value);
+ void setDouble(String name, Double value);
- Object getObject(String name);
+ Object getObject(String name);
- <T> void setObject(String name, T value);
+ <T> void setObject(String name, T value);
- ValueType<?> getType(String name);
+ ValueType<?> getType(String name);
- <T> T getValue(Key<T> key);
+ <T> T getValue(Key<T> key);
- <T> T getValue(Key<T> key, T defaultValue);
+ <T> T getValue(Key<T> key, T defaultValue);
- <T> void setValue(Key<T> key, T value);
+ <T> void setValue(Key<T> key, T value);
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/Key.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/Key.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/Key.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -20,80 +20,93 @@
/**
* A key is a typed name. This class is immutable and is therefore thread safe.
- *
+ *
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class Key<T> {
+public class Key<T>
+{
- public static <T> Key<T> create(java.lang.String name, ValueType<T> type) {
- if (type == null) {
- throw new NullPointerException();
- }
- return new Key<T>(name, type);
- }
+ public static <T> Key<T> create(java.lang.String name, ValueType<T> type)
+ {
+ if (type == null)
+ {
+ throw new NullPointerException();
+ }
+ return new Key<T>(name, type);
+ }
- /** The key name. */
- private final java.lang.String name;
+ /** The key name. */
+ private final java.lang.String name;
- /** The type. */
- private final ValueType<T> type;
+ /** The type. */
+ private final ValueType<T> type;
- /**
- * Creates a new key.
- *
- * @param name the key name
- * @param type the key type
- * @throws NullPointerException if the name is null
- */
- protected Key(java.lang.String name, ValueType<T> type) throws NullPointerException {
- if (name == null) {
- throw new NullPointerException();
- }
- if (type == null) {
- throw new NullPointerException();
- }
- this.name = name;
- this.type = type;
- }
+ /**
+ * Creates a new key.
+ *
+ * @param name the key name
+ * @param type the key type
+ * @throws NullPointerException if the name is null
+ */
+ protected Key(java.lang.String name, ValueType<T> type) throws NullPointerException
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ if (type == null)
+ {
+ throw new NullPointerException();
+ }
+ this.name = name;
+ this.type = type;
+ }
- /**
- * Returns the key type.
- *
- * @return the type
- */
- public ValueType<T> getType() {
- return type;
- }
+ /**
+ * Returns the key type.
+ *
+ * @return the type
+ */
+ public ValueType<T> getType()
+ {
+ return type;
+ }
- /**
- * Returns the key name.
- *
- * @return the name
- */
- public final java.lang.String getName() {
- return name;
- }
+ /**
+ * Returns the key name.
+ *
+ * @return the name
+ */
+ public final java.lang.String getName()
+ {
+ return name;
+ }
- @Override
- public int hashCode() {
- return getType().hashCode() + name.hashCode();
- }
+ @Override
+ public int hashCode()
+ {
+ return getType().hashCode() + name.hashCode();
+ }
- @Override
- public boolean equals(java.lang.Object obj) {
- if (obj == this) {
- return true;
- }
- if (obj.getClass() == getClass()) {
- Key that = (Key)obj;
- return name.equals(that.name);
- }
- return false;
- }
+ @Override
+ public boolean equals(java.lang.Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj.getClass() == getClass())
+ {
+ Key that = (Key)obj;
+ return name.equals(that.name);
+ }
+ return false;
+ }
- @Override
- public java.lang.String toString() {
- return "Key[name=" + name + ",type=" + getType() + "]";
- }
+ @Override
+ public java.lang.String toString()
+ {
+ return "Key[name=" + name + ",type=" + getType() + "]";
+ }
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/Model.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/Model.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/Model.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -26,40 +26,41 @@
import java.util.Iterator;
/**
- * Provides access to the model.
+ * Provides access to the model.
*
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface Model {
+public interface Model
+{
- /**
- * Returns the workspace.
- *
- * @return the workspace
- */
- Workspace getWorkspace();
+ /**
+ * Returns the workspace.
+ *
+ * @return the workspace
+ */
+ Workspace getWorkspace();
- /**
- * Returns a specified object or null if it cannot be found.
- *
- * @param type the object type
- * @param id the object id
- * @param <O> the object type parameter
- * @return the object
- */
- <O extends WorkspaceObject> O findObjectById(ObjectType<O> type, String id);
+ /**
+ * Returns a specified object or null if it cannot be found.
+ *
+ * @param type the object type
+ * @param id the object id
+ * @param <O> the object type parameter
+ * @return the object
+ */
+ <O extends WorkspaceObject> O findObjectById(ObjectType<O> type, String id);
- <O extends WorkspaceObject> O findObjectByPath(ObjectType<? extends O> type, String path);
+ <O extends WorkspaceObject> O findObjectByPath(ObjectType<? extends O> type, String path);
- <O extends WorkspaceObject> Iterator<O> findObject(ObjectType<O> type, String statement);
+ <O extends WorkspaceObject> Iterator<O> findObject(ObjectType<O> type, String statement);
- String pathOf(WorkspaceObject o);
+ String pathOf(WorkspaceObject o);
- Customization<?> findCustomizationById(String id);
+ Customization<?> findCustomizationById(String id);
- void save();
+ void save();
- void close();
+ void close();
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/ValueType.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/ValueType.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/ValueType.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -23,140 +23,172 @@
import java.util.Date;
/**
- * The enumeration of value type that are permitted for attributes state. The generic type is used to represent
- * the relevant associated java type for the runtime values.
+ * The enumeration of value type that are permitted for attributes state. The generic type is used to represent the
+ * relevant associated java type for the runtime values.
*
- * @param <T> the value java type
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
+ * @param <T> the value java type
*/
-public abstract class ValueType<T> {
+public abstract class ValueType<T>
+{
- /** . */
- public static final ValueType<String> STRING = new ValueType<String>() {};
+ /** . */
+ public static final ValueType<String> STRING = new ValueType<String>()
+ {
+ };
- /** . */
- public static final ValueType<Integer> INTEGER = new ValueType<Integer>() {};
+ /** . */
+ public static final ValueType<Integer> INTEGER = new ValueType<Integer>()
+ {
+ };
- /** . */
- public static final ValueType<Boolean> BOOLEAN = new ValueType<Boolean>() {};
+ /** . */
+ public static final ValueType<Boolean> BOOLEAN = new ValueType<Boolean>()
+ {
+ };
- /** . */
- public static final ValueType<Date> DATE = new ValueType<Date>() {};
+ /** . */
+ public static final ValueType<Date> DATE = new ValueType<Date>()
+ {
+ };
- /** . */
- public static final ValueType<Double> DOUBLE = new ValueType<Double>() {};
+ /** . */
+ public static final ValueType<Double> DOUBLE = new ValueType<Double>()
+ {
+ };
- /** . */
- private final Class<T> javaType;
+ /** . */
+ private final Class<T> javaType;
- @SuppressWarnings("unchecked")
- private ValueType() {
- Type type = getClass().getGenericSuperclass();
- ParameterizedType parameterizedType = (ParameterizedType)type;
- javaType = (Class<T>)parameterizedType.getActualTypeArguments()[0];
- }
+ @SuppressWarnings("unchecked")
+ private ValueType()
+ {
+ Type type = getClass().getGenericSuperclass();
+ ParameterizedType parameterizedType = (ParameterizedType)type;
+ javaType = (Class<T>)parameterizedType.getActualTypeArguments()[0];
+ }
- /**
- * Returns the java type.
- *
- * @return the java type
- */
- public Class<T> getJavaType() {
- return javaType;
- }
+ /**
+ * Returns the java type.
+ *
+ * @return the java type
+ */
+ public Class<T> getJavaType()
+ {
+ return javaType;
+ }
- /**
- * Returns true if the object matches the type.
- *
- * @param o the object
- * @return true when the value matches the type
- */
- public boolean isInstance(Object o) {
- return javaType.isInstance(o);
- }
+ /**
+ * Returns true if the object matches the type.
+ *
+ * @param o the object
+ * @return true when the value matches the type
+ */
+ public boolean isInstance(Object o)
+ {
+ return javaType.isInstance(o);
+ }
- /**
- * Casts the object to the underlying java type.
- *
- * @param o the object to cast
- * @return the casted object
- * @throws ClassCastException if the object cannot be casted
- */
- public T cast(Object o) throws ClassCastException {
- if (o == null) {
- return null;
- }
- if (javaType.isInstance(o)) {
- return javaType.cast(o);
- }
- throw new ClassCastException("Object " + o + " cannot be casted to " + javaType.getName());
- }
+ /**
+ * Casts the object to the underlying java type.
+ *
+ * @param o the object to cast
+ * @return the casted object
+ * @throws ClassCastException if the object cannot be casted
+ */
+ public T cast(Object o) throws ClassCastException
+ {
+ if (o == null)
+ {
+ return null;
+ }
+ if (javaType.isInstance(o))
+ {
+ return javaType.cast(o);
+ }
+ throw new ClassCastException("Object " + o + " cannot be casted to " + javaType.getName());
+ }
- /**
- * Returns the corresponding value type for the specified object or null if no valid one can be found.
- *
- * @param t the object to decode type for
- * @param <T> the java type
- * @return the decoded type
- */
- @SuppressWarnings("unchecked")
- public static <T> ValueType<T> decode(T t) {
- if (t == null) {
+ /**
+ * Returns the corresponding value type for the specified object or null if no valid one can be found.
+ *
+ * @param t the object to decode type for
+ * @param <T> the java type
+ * @return the decoded type
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> ValueType<T> decode(T t)
+ {
+ if (t == null)
+ {
+ return null;
+ }
+ if (t instanceof String)
+ {
+ return (ValueType<T>)ValueType.STRING;
+ }
+ if (t instanceof Integer)
+ {
+ return (ValueType<T>)ValueType.INTEGER;
+ }
+ if (t instanceof Boolean)
+ {
+ return (ValueType<T>)ValueType.BOOLEAN;
+ }
+ if (t instanceof Date)
+ {
+ return (ValueType<T>)ValueType.DATE;
+ }
+ if (t instanceof Double)
+ {
+ return (ValueType<T>)ValueType.DOUBLE;
+ }
return null;
- }
- if (t instanceof String) {
- return (ValueType<T>)ValueType.STRING;
- }
- if (t instanceof Integer) {
- return (ValueType<T>)ValueType.INTEGER;
- }
- if (t instanceof Boolean) {
- return (ValueType<T>)ValueType.BOOLEAN;
- }
- if (t instanceof Date) {
- return (ValueType<T>)ValueType.DATE;
- }
- if (t instanceof Double) {
- return (ValueType<T>)ValueType.DOUBLE;
- }
- return null;
- }
+ }
- /**
- * Returns the corresponding value type for the specified object.
- *
- * @param t the object to get the type for
- * @param <T> the java type
- * @return the decoded type
- * @throws NullPointerException if the argument is null
- * @throws IllegalArgumentException if the argument does not match a valid type
- */
- @SuppressWarnings("unchecked")
- public static <T> ValueType<T> get(T t) throws NullPointerException, IllegalArgumentException {
- if (t == null) {
- throw new NullPointerException();
- }
- if (t instanceof String) {
- return (ValueType<T>)ValueType.STRING;
- }
- if (t instanceof Integer) {
- return (ValueType<T>)ValueType.INTEGER;
- }
- if (t instanceof Boolean) {
- return (ValueType<T>)ValueType.BOOLEAN;
- }
- if (t instanceof Date) {
- return (ValueType<T>)ValueType.DATE;
- }
- if (t instanceof Double) {
- return (ValueType<T>)ValueType.DOUBLE;
- }
- throw new IllegalArgumentException("Java class " + t.getClass().getName() + " cannot be used as a value type");
- }
+ /**
+ * Returns the corresponding value type for the specified object.
+ *
+ * @param t the object to get the type for
+ * @param <T> the java type
+ * @return the decoded type
+ * @throws NullPointerException if the argument is null
+ * @throws IllegalArgumentException if the argument does not match a valid type
+ */
+ @SuppressWarnings("unchecked")
+ public static <T> ValueType<T> get(T t) throws NullPointerException, IllegalArgumentException
+ {
+ if (t == null)
+ {
+ throw new NullPointerException();
+ }
+ if (t instanceof String)
+ {
+ return (ValueType<T>)ValueType.STRING;
+ }
+ if (t instanceof Integer)
+ {
+ return (ValueType<T>)ValueType.INTEGER;
+ }
+ if (t instanceof Boolean)
+ {
+ return (ValueType<T>)ValueType.BOOLEAN;
+ }
+ if (t instanceof Date)
+ {
+ return (ValueType<T>)ValueType.DATE;
+ }
+ if (t instanceof Double)
+ {
+ return (ValueType<T>)ValueType.DOUBLE;
+ }
+ throw new IllegalArgumentException("Java class " + t.getClass().getName() + " cannot be used as a value type");
+ }
- @Override
- public String toString() {
- return "ValueType[" + javaType.getSimpleName() + "]";
- }
+ @Override
+ public String toString()
+ {
+ return "ValueType[" + javaType.getSimpleName() + "]";
+ }
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/ComponentIterator.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/ComponentIterator.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/ComponentIterator.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -28,81 +28,105 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class ComponentIterator implements StructureIterator {
+public class ComponentIterator implements StructureIterator
+{
- /** . */
- private final UIComponent root;
+ /** . */
+ private final UIComponent root;
- /** . */
- private final LinkedList<ContainerVisit> stack;
+ /** . */
+ private final LinkedList<ContainerVisit> stack;
- /** . */
- private UIComponent current;
+ /** . */
+ private UIComponent current;
- /** . */
- private IterationType type;
+ /** . */
+ private IterationType type;
- public ComponentIterator(UIComponent root) {
- this.root = root;
- this.stack = new LinkedList<ContainerVisit>();
- this.type = null;
- }
+ public ComponentIterator(UIComponent root)
+ {
+ this.root = root;
+ this.stack = new LinkedList<ContainerVisit>();
+ this.type = null;
+ }
- public UIComponent getComponent() {
- return current;
- }
+ public UIComponent getComponent()
+ {
+ return current;
+ }
- public IterationType next() {
+ public IterationType next()
+ {
- if (type == null) {
- current = root;
- type = IterationType.START;
- } else {
- if (type == IterationType.START) {
- if (current instanceof UIContainer) {
- UIContainer container = (UIContainer)current;
- Iterator<? extends UIComponent> iterator = container.iterator();
- if (iterator.hasNext()) {
- stack.add(new ContainerVisit(container, iterator));
- current = iterator.next();
- } else {
- type = IterationType.END;
- }
- } else {
- type = IterationType.END;
- }
- } else {
- if (stack.size() > 0) {
- ContainerVisit visit = stack.getLast();
- if (visit.iterator.hasNext()) {
- type = IterationType.START;
- current = visit.iterator.next();
- } else {
- stack.removeLast();
- current = visit.container;
- }
- } else {
- current = null;
- return IterationType.DONE;
- }
+ if (type == null)
+ {
+ current = root;
+ type = IterationType.START;
}
- }
+ else
+ {
+ if (type == IterationType.START)
+ {
+ if (current instanceof UIContainer)
+ {
+ UIContainer container = (UIContainer)current;
+ Iterator<? extends UIComponent> iterator = container.iterator();
+ if (iterator.hasNext())
+ {
+ stack.add(new ContainerVisit(container, iterator));
+ current = iterator.next();
+ }
+ else
+ {
+ type = IterationType.END;
+ }
+ }
+ else
+ {
+ type = IterationType.END;
+ }
+ }
+ else
+ {
+ if (stack.size() > 0)
+ {
+ ContainerVisit visit = stack.getLast();
+ if (visit.iterator.hasNext())
+ {
+ type = IterationType.START;
+ current = visit.iterator.next();
+ }
+ else
+ {
+ stack.removeLast();
+ current = visit.container;
+ }
+ }
+ else
+ {
+ current = null;
+ return IterationType.DONE;
+ }
+ }
+ }
- //
- return type;
- }
+ //
+ return type;
+ }
- private static class ContainerVisit {
+ private static class ContainerVisit
+ {
- /** . */
- private final UIContainer container;
+ /** . */
+ private final UIContainer container;
- /** . */
- private final Iterator<? extends UIComponent> iterator;
+ /** . */
+ private final Iterator<? extends UIComponent> iterator;
- private ContainerVisit(UIContainer container, Iterator<? extends UIComponent> iterator) {
- this.container = container;
- this.iterator = iterator;
- }
- }
+ private ContainerVisit(UIContainer container, Iterator<? extends UIComponent> iterator)
+ {
+ this.container = container;
+ this.iterator = iterator;
+ }
+ }
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/IterationType.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/IterationType.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/IterationType.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -22,13 +22,14 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public enum IterationType {
+public enum IterationType
+{
- START,
+ START,
- END,
+ END,
- DONE
+ DONE
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIterator.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIterator.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIterator.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -29,84 +29,102 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class PageIterator implements StructureIterator {
+public class PageIterator implements StructureIterator
+{
- /** . */
- private final ArrayList<PageVisit> list;
+ /** . */
+ private final ArrayList<PageVisit> list;
- /** . */
- private int index;
+ /** . */
+ private int index;
- /** . */
- private UIComponent current;
+ /** . */
+ private UIComponent current;
- public PageIterator(Page page, PageIteratorStrategy strategy) {
- ArrayList<PageVisit> list = new ArrayList<PageVisit>();
- Iterator<Page> iterator = strategy.iterator(page);
- while (iterator.hasNext()) {
- Page p = iterator.next();
- list.add(new PageVisit(p, new ComponentIterator(p.getRootComponent())));
- }
+ public PageIterator(Page page, PageIteratorStrategy strategy)
+ {
+ ArrayList<PageVisit> list = new ArrayList<PageVisit>();
+ Iterator<Page> iterator = strategy.iterator(page);
+ while (iterator.hasNext())
+ {
+ Page p = iterator.next();
+ list.add(new PageVisit(p, new ComponentIterator(p.getRootComponent())));
+ }
- //
- this.list = list;
- this.index = list.size() - 1;
- this.current = null;
- }
+ //
+ this.list = list;
+ this.index = list.size() - 1;
+ this.current = null;
+ }
- public UIComponent getComponent() {
- return current;
- }
+ public UIComponent getComponent()
+ {
+ return current;
+ }
- public IterationType next() {
- while (index < list.size()) {
- PageVisit visit = list.get(index);
- switch (visit.iterator.next()) {
- case START: {
- UIComponent current = visit.iterator.getComponent();
- if (current instanceof UIBody) {
- index--;
- break;
- } else {
- this.current = current;
- return IterationType.START;
- }
- }
- case END: {
- UIComponent current = visit.iterator.getComponent();
- if (current instanceof UIBody) {
- break;
- } else {
- this.current = current;
- return IterationType.END;
- }
- }
- case DONE: {
- current = null;
- index++;
- break;
- }
- default:
- throw new AssertionError();
+ public IterationType next()
+ {
+ while (index < list.size())
+ {
+ PageVisit visit = list.get(index);
+ switch (visit.iterator.next())
+ {
+ case START:
+ {
+ UIComponent current = visit.iterator.getComponent();
+ if (current instanceof UIBody)
+ {
+ index--;
+ break;
+ }
+ else
+ {
+ this.current = current;
+ return IterationType.START;
+ }
+ }
+ case END:
+ {
+ UIComponent current = visit.iterator.getComponent();
+ if (current instanceof UIBody)
+ {
+ break;
+ }
+ else
+ {
+ this.current = current;
+ return IterationType.END;
+ }
+ }
+ case DONE:
+ {
+ current = null;
+ index++;
+ break;
+ }
+ default:
+ throw new AssertionError();
+ }
}
- }
- //
- return IterationType.DONE;
- }
+ //
+ return IterationType.DONE;
+ }
- private static class PageVisit {
+ private static class PageVisit
+ {
- /** . */
- private final Page page;
+ /** . */
+ private final Page page;
- /** . */
- private final ComponentIterator iterator;
+ /** . */
+ private final ComponentIterator iterator;
- private PageVisit(Page page, ComponentIterator iterator) {
- this.page = page;
- this.iterator = iterator;
- }
- }
+ private PageVisit(Page page, ComponentIterator iterator)
+ {
+ this.page = page;
+ this.iterator = iterator;
+ }
+ }
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategies.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategies.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategies.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -28,44 +28,61 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public enum PageIteratorStrategies implements PageIteratorStrategy {
+public enum PageIteratorStrategies implements PageIteratorStrategy
+{
- SIMPLE {
- public Iterator<Page> iterator(Page page) {
- return Collections.singletonList(page).iterator();
- }},
+ SIMPLE
+ {
+ public Iterator<Page> iterator(Page page)
+ {
+ return Collections.singletonList(page).iterator();
+ }},
- PAGE_TEMPLATE {
- public Iterator<Page> iterator(final Page page) {
- return new Iterator<Page>() {
- Page current = page;
- public boolean hasNext() {
- return current != null;
- }
- public Page next() {
- if (current == null) {
- throw new NoSuchElementException();
- }
- Page next = null;
- for (Page p = current;p != null;p = p.getParent()) {
- Page template = p.getTemplate();
- if (template != null) {
- next = template;
- break;
- }
- }
- Page tmp = current;
- current = next;
- return tmp;
- }
- public void remove() {
- throw new UnsupportedOperationException();
- }
- };
- }},
+ PAGE_TEMPLATE
+ {
+ public Iterator<Page> iterator(final Page page)
+ {
+ return new Iterator<Page>()
+ {
+ Page current = page;
- PAGE_AND_SITE_TEMPLATE {
- public Iterator<Page> iterator(Page page) {
- throw new UnsupportedOperationException();
- }}
+ public boolean hasNext()
+ {
+ return current != null;
+ }
+
+ public Page next()
+ {
+ if (current == null)
+ {
+ throw new NoSuchElementException();
+ }
+ Page next = null;
+ for (Page p = current; p != null; p = p.getParent())
+ {
+ Page template = p.getTemplate();
+ if (template != null)
+ {
+ next = template;
+ break;
+ }
+ }
+ Page tmp = current;
+ current = next;
+ return tmp;
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }},
+
+ PAGE_AND_SITE_TEMPLATE
+ {
+ public Iterator<Page> iterator(Page page)
+ {
+ throw new UnsupportedOperationException();
+ }}
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategy.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategy.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/PageIteratorStrategy.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -26,8 +26,9 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface PageIteratorStrategy {
+public interface PageIteratorStrategy
+{
- Iterator<Page> iterator(Page page);
+ Iterator<Page> iterator(Page page);
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/StructureIterator.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/StructureIterator.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/composer/StructureIterator.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -24,10 +24,11 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface StructureIterator {
+public interface StructureIterator
+{
- IterationType next();
+ IterationType next();
- UIComponent getComponent();
+ UIComponent getComponent();
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Content.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Content.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Content.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -25,20 +25,21 @@
* @version $Revision$
* @param <S> the content state type parameter
*/
-public interface Content<S> {
+public interface Content<S>
+{
- /**
- * Returns the content id.
- *
- * @return the id
- */
- String getId();
+ /**
+ * Returns the content id.
+ *
+ * @return the id
+ */
+ String getId();
- /**
- * Returns the content type.
- *
- * @return the content type
- */
- ContentType<S> getType();
+ /**
+ * Returns the content type.
+ *
+ * @return the content type
+ */
+ ContentType<S> getType();
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/ContentType.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/ContentType.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/ContentType.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -25,56 +25,66 @@
* @version $Revision$
* @param <S> the content state type parameter
*/
-public final class ContentType<S> {
+public final class ContentType<S>
+{
- /** . */
- private final String mimeType;
+ /** . */
+ private final String mimeType;
- /** . */
- private final Class<S> stateClass;
+ /** . */
+ private final Class<S> stateClass;
- /**
- * Create a new content type.
- *
- * @param mimeType the mime type
- * @param stateClass the state class
- * @throws NullPointerException if any argument is null
- */
- public ContentType(String mimeType, Class<S> stateClass) throws NullPointerException {
- if (mimeType == null) {
- throw new NullPointerException("No null mime type accepted");
- }
- if (stateClass == null) {
- throw new NullPointerException("No null state class accepted");
- }
+ /**
+ * Create a new content type.
+ *
+ * @param mimeType the mime type
+ * @param stateClass the state class
+ * @throws NullPointerException if any argument is null
+ */
+ public ContentType(String mimeType, Class<S> stateClass) throws NullPointerException
+ {
+ if (mimeType == null)
+ {
+ throw new NullPointerException("No null mime type accepted");
+ }
+ if (stateClass == null)
+ {
+ throw new NullPointerException("No null state class accepted");
+ }
- //
- this.mimeType = mimeType;
- this.stateClass = stateClass;
- }
+ //
+ this.mimeType = mimeType;
+ this.stateClass = stateClass;
+ }
- public String getMimeType() {
- return mimeType;
- }
+ public String getMimeType()
+ {
+ return mimeType;
+ }
- public Class<S> getStateClass() {
- return stateClass;
- }
+ public Class<S> getStateClass()
+ {
+ return stateClass;
+ }
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (obj instanceof ContentType) {
- ContentType that = (ContentType)obj;
- return mimeType.equals(that.mimeType);
- }
- return false;
- }
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof ContentType)
+ {
+ ContentType that = (ContentType)obj;
+ return mimeType.equals(that.mimeType);
+ }
+ return false;
+ }
- @Override
- public int hashCode() {
- return mimeType.hashCode();
- }
+ @Override
+ public int hashCode()
+ {
+ return mimeType.hashCode();
+ }
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Customization.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Customization.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/Customization.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -28,105 +28,102 @@
* @version $Revision$
* @param <S> the content state type parameter
*/
-public interface Customization<S> {
+public interface Customization<S>
+{
- /**
- * Returns the customization id
- *
- * @return the customization id
- */
- String getId();
+ /**
+ * Returns the customization id
+ *
+ * @return the customization id
+ */
+ String getId();
- /**
- * Returns the content this customization refers to.
- */
- Content<S> getContent();
+ /** Returns the content this customization refers to. */
+ Content<S> getContent();
- /**
- * Returns the content id this customization refers to.
- *
- * @return the content id
- */
- String getContentId();
+ /**
+ * Returns the content id this customization refers to.
+ *
+ * @return the content id
+ */
+ String getContentId();
- /**
- * Returns the content type this customization refers to.
- *
- * @return The content type
- */
- ContentType<S> getType();
+ /**
+ * Returns the content type this customization refers to.
+ *
+ * @return The content type
+ */
+ ContentType<S> getType();
- /**
- * Returns the related context of this customization.
- *
- * @return the related context
- */
- CustomizationContext getContext();
+ /**
+ * Returns the related context of this customization.
+ *
+ * @return the related context
+ */
+ CustomizationContext getContext();
- /**
- * Returns the contexts that are associated with this customization. Note that the set returned
- * maintains the hierararchy order of the set from the most specific to the least specific.
- *
- * @return the contexts
- */
- Set<CustomizationContext> getContexts();
+ /**
+ * Returns the contexts that are associated with this customization. Note that the set returned maintains the
+ * hierararchy order of the set from the most specific to the least specific.
+ *
+ * @return the contexts
+ */
+ Set<CustomizationContext> getContexts();
- /**
- * <p>Returns the stateful content associated with the specified customization contexts or null
- * if no customization can be created for the desired contexts. The returned customization
- * may not honour all provided the customization contexts.</p>
- *
- * <p>Calling the method with an empty set returns the default customization of the
- * content or null if none is available.</p>
- *
- * <p>Calling the method with a set of contexts that is not consistent will trigger an
- * <tt>IllegalArgumentException</tt> to be thrown. For instance two workspace contexts
- * specifying different pages cannot lead to determine a final context.</p>
- *
- * @param contexts the customization contexts
- * @return the content state
- */
- Customization<S> getCustomization(Set<CustomizationContext> contexts);
+ /**
+ * <p>Returns the stateful content associated with the specified customization contexts or null if no customization
+ * can be created for the desired contexts. The returned customization may not honour all provided the customization
+ * contexts.</p>
+ * <p/>
+ * <p>Calling the method with an empty set returns the default customization of the content or null if none is
+ * available.</p>
+ * <p/>
+ * <p>Calling the method with a set of contexts that is not consistent will trigger an
+ * <tt>IllegalArgumentException</tt> to be thrown. For instance two workspace contexts specifying different pages
+ * cannot lead to determine a final context.</p>
+ *
+ * @param contexts the customization contexts
+ * @return the content state
+ */
+ Customization<S> getCustomization(Set<CustomizationContext> contexts);
- /**
- * Customize the state with respect to the provided customization context.
- *
- * @param contexts the customization context
- * @return the customization
- */
- Customization<S> customize(Collection<CustomizationContext> contexts);
+ /**
+ * Customize the state with respect to the provided customization context.
+ *
+ * @param contexts the customization context
+ * @return the customization
+ */
+ Customization<S> customize(Collection<CustomizationContext> contexts);
- /**
- * Returns the parent customization or null if this customization is full featured clone.
- *
- * @return the parent customization
- */
- Customization getParent();
+ /**
+ * Returns the parent customization or null if this customization is full featured clone.
+ *
+ * @return the parent customization
+ */
+ Customization getParent();
- /**
- * Returns the customization virtual state that is computed from various state of the customization hierarchy.
- *
- * @return the virtual state
- */
- S getVirtualState();
+ /**
+ * Returns the customization virtual state that is computed from various state of the customization hierarchy.
+ *
+ * @return the virtual state
+ */
+ S getVirtualState();
- /**
- * Returns the customization state.
- *
- * @return the state
- */
- S getState();
+ /**
+ * Returns the customization state.
+ *
+ * @return the state
+ */
+ S getState();
- /**
- * Updates the customization state.
- *
- * @param state the customization state
- */
- void setState(S state);
+ /**
+ * Updates the customization state.
+ *
+ * @param state the customization state
+ */
+ void setState(S state);
- /**
- * Destroys the customization.
- */
- void destroy();
+ /** Destroys the customization. */
+ void destroy();
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/CustomizationContext.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/CustomizationContext.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/content/CustomizationContext.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -19,46 +19,40 @@
package org.gatein.mop.api.content;
/**
- * <p>The customization context defines where customization applies, it can be an entity, an identity, or anything
- * else that is subject to customization.</p>
+ * <p>The customization context defines where customization applies, it can be an entity, an identity, or anything else
+ * that is subject to customization.</p> <p/> <p>Contexts are partitionned by their type, i.e all the context that share
+ * the same value returned by the invocation of the method {@link #getContextType()} are considered to belong to the
+ * same type.</p> <p/> <p>Within a partition it is possible to find out the relationship between two contexts thanks to
+ * the {@link #contains(CustomizationContext)} method. <ul> <li>Two contexts are considered equals when they contain
+ * each other.</li> <li>Two contexts are not related when no context contains the other one.</li> <li>Otherwise one
+ * contexts belongs to the other.</li> </ul> The <tt>contains</tt> relationship is transitive.</p>
*
- * <p>Contexts are partitionned by their type, i.e all the context that share the same value returned by the
- * invocation of the method {@link #getContextType()} are considered to belong to the same type.</p>
- *
- * <p>Within a partition it is possible to find out the relationship between two contexts thanks to the
- * {@link #contains(CustomizationContext)} method.
- * <ul>
- * <li>Two contexts are considered equals when they contain each other.</li>
- * <li>Two contexts are not related when no context contains the other one.</li>
- * <li>Otherwise one contexts belongs to the other.</li>
- * </ul>
- * The <tt>contains</tt> relationship is transitive.</p>
- *
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface CustomizationContext {
+public interface CustomizationContext
+{
- /**
- * Returns the identifier of the context.
- *
- * @return the context identifier
- */
- String getContextId();
+ /**
+ * Returns the identifier of the context.
+ *
+ * @return the context identifier
+ */
+ String getContextId();
- /**
- * Returns the customization context type.
- *
- * @return the customization context type
- */
- String getContextType();
+ /**
+ * Returns the customization context type.
+ *
+ * @return the customization context type
+ */
+ String getContextType();
- /**
- * Returns true if the context contains the provided context.
- *
- * @param that the context to test
- * @return a boolean indicated whether the provided context is contained by this context
- */
- boolean contains(CustomizationContext that);
+ /**
+ * Returns true if the context contains the provided context.
+ *
+ * @param that the context to test
+ * @return a boolean indicated whether the provided context is contained by this context
+ */
+ boolean contains(CustomizationContext that);
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Navigation.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Navigation.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Navigation.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -20,86 +20,92 @@
import org.gatein.mop.api.workspace.link.Link;
-import java.util.Collection;
+import java.util.List;
/**
+ * <p>A navigation denotes a visual item that display a link to a referenced entity like a page. A navigation is
+ * expressed as a tree where each navigation node owns an ordered list of named children.</p> <p/> <p>A navigation node
+ * owns an optional link to a {@link org.gatein.mop.api.workspace.link.Link} that denotes the entity shown visually by
+ * the navigation node.</p>
+ *
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface Navigation extends TemplatizedObject {
+public interface Navigation extends TemplatizedObject
+{
- /**
- * Returns the navigation name.
- *
- * @return the navigation name
- */
- String getName();
+ /**
+ * Returns the navigation name.
+ *
+ * @return the navigation name
+ */
+ String getName();
- /**
- * Extends the object type to navigation.
- *
- * @return the object type
- */
- ObjectType<? extends Navigation> getObjectType();
+ /**
+ * Extends the object type to navigation.
+ *
+ * @return the object type
+ */
+ ObjectType<? extends Navigation> getObjectType();
- /**
- * Returns the site this navigation belongs to
- *
- * @return the site
- */
- Site getSite();
+ /**
+ * Returns the site this navigation belongs to
+ *
+ * @return the site
+ */
+ Site getSite();
- /**
- * Return the navigation parent or null if it is a root.
- *
- * @return the navigation parent
- */
- Navigation getParent();
+ /**
+ * Return the navigation parent or null if it is a root.
+ *
+ * @return the navigation parent
+ */
+ Navigation getParent();
- /**
- * Returns the child navigations.
- *
- * @return the child navigations
- */
- Collection<? extends Navigation> getChildren();
+ /**
+ * Returns the child navigations.
+ *
+ * @return the child navigations
+ */
+ List<? extends Navigation> getChildren();
- /**
- * Returns a specified navigation.
- *
- * @param name the navigation name
- * @return a child navigation
- */
- Navigation getChild(String name);
+ /**
+ * Returns a specified navigation.
+ *
+ * @param name the navigation name
+ * @return a child navigation
+ */
+ Navigation getChild(String name);
- /**
- * Adds a child navigation
- *
- * @param name the child name
- * @return the child navigation
- * @throws NullPointerException when a null name is provided
- * @throws IllegalArgumentException when an illegal name is provided
- */
- Navigation addChild(String name) throws NullPointerException, IllegalArgumentException;
+ /**
+ * Adds a child navigation that will be added to the last position among the ordered children list.
+ *
+ * @param name the child name
+ * @return the child navigation
+ * @throws NullPointerException when a null name is provided
+ * @throws IllegalArgumentException when an illegal name is provided
+ */
+ Navigation addChild(String name) throws NullPointerException, IllegalArgumentException;
- /**
- * Destroys this navigation.
- */
- void destroy();
+ /**
+ * Destroys this navigation.
+ */
+ void destroy();
- /**
- * Returns the current link related to this navitation object.
- *
- * @return the link
- */
- Link getLink();
+ /**
+ * Returns the current link related to this navitation object.
+ *
+ * @return the link
+ */
+ Link getLink();
- /**
- * Link the navigation to a specifed type and returns the corresponding link subclass that
- * allows the configuration of the link.
- *
- * @param linkType the link type
- * @param <L> the link type parameter
- * @return the link object
- */
- <L extends Link> L linkTo(ObjectType<L> linkType);
+ /**
+ * Link the navigation to a specifed type and returns the corresponding link subclass that
+ * allows the configuration of the link.
+ *
+ * @param linkType the link type
+ * @param <L> the link type parameter
+ * @return the link object
+ */
+ <L extends Link> L linkTo(ObjectType<L> linkType);
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ObjectType.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ObjectType.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ObjectType.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -34,103 +34,119 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class ObjectType<O extends WorkspaceObject> {
+public class ObjectType<O extends WorkspaceObject>
+{
- /** . */
- public static final ObjectType<WorkspaceObject> ANY = new ObjectType<WorkspaceObject>(WorkspaceObject.class);
+ /** . */
+ public static final ObjectType<WorkspaceObject> ANY = new ObjectType<WorkspaceObject>(WorkspaceObject.class);
- /** . */
- public static final ObjectType<Workspace> WORKSPACE = new ObjectType<Workspace>(Workspace.class);
+ /** . */
+ public static final ObjectType<Workspace> WORKSPACE = new ObjectType<Workspace>(Workspace.class);
- /** . */
- public static final ObjectType<Site> SITE = new ObjectType<Site>(Site.class);
+ /** . */
+ public static final ObjectType<Site> SITE = new ObjectType<Site>(Site.class);
- /** . */
- public static final ObjectType<Site> PORTAL_SITE = new ObjectType<Site>(Site.class, SITE);
+ /** . */
+ public static final ObjectType<Site> PORTAL_SITE = new ObjectType<Site>(Site.class, SITE);
- /** . */
- public static final ObjectType<Site> GROUP_SITE = new ObjectType<Site>(Site.class, SITE);
+ /** . */
+ public static final ObjectType<Site> GROUP_SITE = new ObjectType<Site>(Site.class, SITE);
- /** . */
- public static final ObjectType<Site> USER_SITE = new ObjectType<Site>(Site.class, SITE);
+ /** . */
+ public static final ObjectType<Site> USER_SITE = new ObjectType<Site>(Site.class, SITE);
- /** . */
- public static final ObjectType<Site> SHARED_SITE = new ObjectType<Site>(Site.class, SITE);
+ /** . */
+ public static final ObjectType<Site> SHARED_SITE = new ObjectType<Site>(Site.class, SITE);
- /** . */
- public static final ObjectType<Page> PAGE = new ObjectType<Page>(Page.class);
+ /** . */
+ public static final ObjectType<Page> PAGE = new ObjectType<Page>(Page.class);
- /** . */
- public static final ObjectType<Navigation> NAVIGATION = new ObjectType<Navigation>(Navigation.class);
+ /** . */
+ public static final ObjectType<Navigation> NAVIGATION = new ObjectType<Navigation>(Navigation.class);
- /** . */
- public static final ObjectType<UIComponent> COMPONENT = new ObjectType<UIComponent>(UIComponent.class);
+ /** . */
+ public static final ObjectType<UIComponent> COMPONENT = new ObjectType<UIComponent>(UIComponent.class);
- /** . */
- public static final ObjectType<UIBody> BODY = new ObjectType<UIBody>(UIBody.class, COMPONENT);
+ /** . */
+ public static final ObjectType<UIBody> BODY = new ObjectType<UIBody>(UIBody.class, COMPONENT);
- /** . */
- public static final ObjectType<UIContainer> CONTAINER = new ObjectType<UIContainer>(UIContainer.class, COMPONENT);
+ /** . */
+ public static final ObjectType<UIContainer> CONTAINER = new ObjectType<UIContainer>(UIContainer.class, COMPONENT);
- /** . */
- public static final ObjectType<UIWindow> WINDOW = new ObjectType<UIWindow>(UIWindow.class, COMPONENT);
+ /** . */
+ public static final ObjectType<UIWindow> WINDOW = new ObjectType<UIWindow>(UIWindow.class, COMPONENT);
- /** . */
- public static final ObjectType<PageLink> PAGE_LINK = new ObjectType<PageLink>(PageLink.class);
+ /** . */
+ public static final ObjectType<PageLink> PAGE_LINK = new ObjectType<PageLink>(PageLink.class);
- /** . */
- public static final ObjectType<URLLink> URL_LINK = new ObjectType<URLLink>(URLLink.class);
+ /** . */
+ public static final ObjectType<URLLink> URL_LINK = new ObjectType<URLLink>(URLLink.class);
- /** . */
- private final Class<O> javaType;
+ /** . */
+ private final Class<O> javaType;
- /** . */
- private final Set<ObjectType<?>> superTypes;
+ /** . */
+ private final Set<ObjectType<?>> superTypes;
- private ObjectType(Class<O> javaType, ObjectType<?>... superTypes) {
- for (ObjectType<?> superType : superTypes) {
- if (!superType.javaType.isAssignableFrom(javaType)) {
- throw new AssertionError();
+ private ObjectType(Class<O> javaType, ObjectType<?>... superTypes)
+ {
+ for (ObjectType<?> superType : superTypes)
+ {
+ if (!superType.javaType.isAssignableFrom(javaType))
+ {
+ throw new AssertionError();
+ }
}
- }
- //
- Set<ObjectType<?>> tmp = new HashSet<ObjectType<?>>();
- for (ObjectType<?> superType : superTypes) {
- tmp.add(superType);
- }
+ //
+ Set<ObjectType<?>> tmp = new HashSet<ObjectType<?>>();
+ for (ObjectType<?> superType : superTypes)
+ {
+ tmp.add(superType);
+ }
- //
- this.javaType = javaType;
- this.superTypes = tmp;
- }
+ //
+ this.javaType = javaType;
+ this.superTypes = tmp;
+ }
- public Class<O> getJavaType() {
- return javaType;
- }
+ public Class<O> getJavaType()
+ {
+ return javaType;
+ }
- public boolean isAssignableFrom(ObjectType<?> other) {
- if (other == null) {
- throw new NullPointerException();
- }
- if (this == ANY) {
- return true;
- }
- return other == this || other.superTypes.contains(this);
- }
+ public boolean isAssignableFrom(ObjectType<?> other)
+ {
+ if (other == null)
+ {
+ throw new NullPointerException();
+ }
+ if (this == ANY)
+ {
+ return true;
+ }
+ return other == this || other.superTypes.contains(this);
+ }
- public O cast(Object o) {
- if (o == null) {
- return null;
- } if (javaType.isInstance(o)) {
- return javaType.cast(o);
- } else {
- throw new ClassCastException();
- }
- }
+ public O cast(Object o)
+ {
+ if (o == null)
+ {
+ return null;
+ }
+ if (javaType.isInstance(o))
+ {
+ return javaType.cast(o);
+ }
+ else
+ {
+ throw new ClassCastException();
+ }
+ }
- @Override
- public String toString() {
- return "ObjectType[" + javaType + "]";
- }
+ @Override
+ public String toString()
+ {
+ return "ObjectType[" + javaType + "]";
+ }
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Page.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Page.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Page.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -25,103 +25,103 @@
import java.util.Collection;
/**
- * <p>A page is a pointer with useful information pointing to a component structure.</p>
+ * <p>A page is a pointer with useful information pointing to a component structure.</p> <p/> <p>Page can be organized
+ * as hierarchies used for the single purpose of performing property inheritance. The pages of a same hierarchy belong
+ * to the same site.</p>
*
- * <p>Page can be organized as hierarchies used for the single purpose of performing
- * property inheritance. The pages of a same hierarchy belong to the same site.</p>
- *
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface Page extends TemplatizedObject, WorkspaceCustomizationContext {
+public interface Page extends TemplatizedObject, WorkspaceCustomizationContext
+{
- /**
- * Returns the page name.
- *
- * @return the page name
- */
- String getName();
+ /**
+ * Returns the page name.
+ *
+ * @return the page name
+ */
+ String getName();
- /**
- * Returns the page type.
- *
- * @return the page type
- */
- ObjectType<? extends Page> getObjectType();
+ /**
+ * Returns the page type.
+ *
+ * @return the page type
+ */
+ ObjectType<? extends Page> getObjectType();
- /**
- * Returns the page attributes.
- *
- * @return the attributes
- */
- Attributes getCascadingAttributes();
+ /**
+ * Returns the page attributes.
+ *
+ * @return the attributes
+ */
+ Attributes getCascadingAttributes();
- /**
- * Returns the site that owns the page.
- *
- * @return the owner site
- */
- Site getSite();
-
- /**
- * Returns the parent page
- *
- * @return the parent page
- */
- Page getParent();
+ /**
+ * Returns the site that owns the page.
+ *
+ * @return the owner site
+ */
+ Site getSite();
- /**
- * Returns the children.
- *
- * @return the children
- */
- Collection<? extends Page> getChildren();
+ /**
+ * Returns the parent page
+ *
+ * @return the parent page
+ */
+ Page getParent();
- /**
- * Returns a named child or null if it does not exist.
- *
- * @param name the child name
- * @return a child
- */
- Page getChild(String name);
+ /**
+ * Returns the children.
+ *
+ * @return the children
+ */
+ Collection<? extends Page> getChildren();
- /**
- * Create a child page and returns it.
- *
- * @param name the child name
- * @return the child page
- * @throws NullPointerException if the name is null
- * @throws IllegalArgumentException if a child with such name already exists
- */
- Page addChild(String name) throws NullPointerException, IllegalArgumentException;
+ /**
+ * Returns a named child or null if it does not exist.
+ *
+ * @param name the child name
+ * @return a child
+ */
+ Page getChild(String name);
- /**
- * Returns the layout of the page. A layout is automatically when the page is created and is bound to the page
- * life cycle.
- *
- * @return the page layout.
- */
- UIContainer getRootComponent();
+ /**
+ * Create a child page and returns it.
+ *
+ * @param name the child name
+ * @return the child page
+ * @throws NullPointerException if the name is null
+ * @throws IllegalArgumentException if a child with such name already exists
+ */
+ Page addChild(String name) throws NullPointerException, IllegalArgumentException;
- /**
- * Returns the set of navigations pointing to this page.
- *
- * @return the related navigations
- */
- Collection<PageLink> getNavigations();
+ /**
+ * Returns the layout of the page. A layout is automatically when the page is created and is bound to the page
+ * life cycle.
+ *
+ * @return the page layout.
+ */
+ UIContainer getRootComponent();
- /**
- * Destroys the page.
- */
- void destroy();
+ /**
+ * Returns the set of navigations pointing to this page.
+ *
+ * @return the related navigations
+ */
+ Collection<PageLink> getNavigations();
- /**
- * Returns the templatized objects for this page.
- *
- * @param templatizedType the type of templatized
- * @param <T> the templatized workspace object type parameter
- * @return the collection of templatized objects
- */
- <T extends TemplatizedObject> Collection<? extends T> getTemplatizedObjects(ObjectType<T> templatizedType);
+ /**
+ * Destroys the page.
+ */
+ void destroy();
+ /**
+ * Returns the templatized objects for this page.
+ *
+ * @param templatizedType the type of templatized
+ * @param <T> the templatized workspace object type parameter
+ * @return the collection of templatized objects
+ */
+ <T extends TemplatizedObject> Collection<? extends T> getTemplatizedObjects(ObjectType<T> templatizedType);
+
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Site.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Site.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Site.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -24,46 +24,45 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface Site extends WorkspaceObject, WorkspaceCustomizationContext {
+public interface Site extends WorkspaceObject, WorkspaceCustomizationContext
+{
- /**
- * Returns the site name.
- *
- * @return the site name
- */
- String getName();
+ /**
+ * Returns the site name.
+ *
+ * @return the site name
+ */
+ String getName();
- /**
- * Returns a type that extends the site.
- *
- * @return the objec type
- */
- ObjectType<? extends Site> getObjectType();
+ /**
+ * Returns a type that extends the site.
+ *
+ * @return the objec type
+ */
+ ObjectType<? extends Site> getObjectType();
- /**
- * Returns the site root navigation.
- *
- * @return the site navigation
- */
- Navigation getRootNavigation();
+ /**
+ * Returns the site root navigation.
+ *
+ * @return the site navigation
+ */
+ Navigation getRootNavigation();
- /**
- * Returns the site root page.
- *
- * @return the site root page
- */
- Page getRootPage();
+ /**
+ * Returns the site root page.
+ *
+ * @return the site root page
+ */
+ Page getRootPage();
- /**
- * Returns the site workspace.
- *
- * @return the site workspace
- */
- Workspace getWorkspace();
+ /**
+ * Returns the site workspace.
+ *
+ * @return the site workspace
+ */
+ Workspace getWorkspace();
- /**
- * Destroy the site.
- */
- void destroy();
+ /** Destroy the site. */
+ void destroy();
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Templatized.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Templatized.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Templatized.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -22,20 +22,21 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface Templatized {
+public interface Templatized
+{
- /**
- * Returns the page template or null if no page template exists.
- *
- * @return the page template
- */
- Page getTemplate();
+ /**
+ * Returns the page template or null if no page template exists.
+ *
+ * @return the page template
+ */
+ Page getTemplate();
- /**
- * Updates the page template.
- *
- * @param template the page template
- */
- void setTemplate(Page template);
+ /**
+ * Updates the page template.
+ *
+ * @param template the page template
+ */
+ void setTemplate(Page template);
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/TemplatizedObject.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/TemplatizedObject.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/TemplatizedObject.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -24,5 +24,6 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface TemplatizedObject extends WorkspaceObject, Templatized {
+public interface TemplatizedObject extends WorkspaceObject, Templatized
+{
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Workspace.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Workspace.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/Workspace.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -26,46 +26,47 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface Workspace extends WorkspaceObject, WorkspaceCustomizationContext {
+public interface Workspace extends WorkspaceObject, WorkspaceCustomizationContext
+{
- /**
- * Returns the default share site.
- *
- * @return the default shared site
- */
- Site getSharedSite();
+ /**
+ * Returns the default share site.
+ *
+ * @return the default shared site
+ */
+ Site getSharedSite();
- /**
- * Returns a specified site or null if it cannot be found.
- *
- * @param siteType the site type
- * @param siteName the site name
- * @return the site
- */
- <S extends Site> S getSite(ObjectType<S> siteType, String siteName);
+ /**
+ * Returns a specified site or null if it cannot be found.
+ *
+ * @param siteType the site type
+ * @param siteName the site name
+ * @return the site
+ */
+ <S extends Site> S getSite(ObjectType<S> siteType, String siteName);
- /**
- * Returns the sites of a given type.
- *
- * @param siteType the site type
- * @return the sites
- */
- <S extends Site> Collection<S> getSites(ObjectType<S> siteType);
+ /**
+ * Returns the sites of a given type.
+ *
+ * @param siteType the site type
+ * @return the sites
+ */
+ <S extends Site> Collection<S> getSites(ObjectType<S> siteType);
- /**
- * Returns all the sites.
- *
- * @return the sites
- */
- Collection<Site> getSites();
+ /**
+ * Returns all the sites.
+ *
+ * @return the sites
+ */
+ Collection<Site> getSites();
- /**
- * Creates a new site.
- *
- * @param siteType the site type
- * @param name the site name
- * @return the new site
- */
- <S extends Site> S addSite(ObjectType<S> siteType, String name);
+ /**
+ * Creates a new site.
+ *
+ * @param siteType the site type
+ * @param name the site name
+ * @return the new site
+ */
+ <S extends Site> S addSite(ObjectType<S> siteType, String name);
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceCustomizationContext.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceCustomizationContext.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceCustomizationContext.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -28,51 +28,50 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface WorkspaceCustomizationContext extends CustomizationContext {
+public interface WorkspaceCustomizationContext extends CustomizationContext
+{
- /**
- * The context type returned that must be returned by implementations of the {@link #getContextType()} method.
- */
- String TYPE = "workspace";
+ /** The context type returned that must be returned by implementations of the {@link #getContextType()} method. */
+ String TYPE = "workspace";
- /**
- * The root customization.
- *
- * @param name the customization name
- * @return the root customization
- */
- Customization<?> getCustomization(String name);
+ /**
+ * The root customization.
+ *
+ * @param name the customization name
+ * @return the root customization
+ */
+ Customization<?> getCustomization(String name);
- /**
- * Configure a root customization for the specified content.
- *
- * @param name the customization name
- * @param contentType the content type
- * @param contentId the content id
- * @param state the customization state
- * @param <S> the content state typa parameter
- * @return the customization
- */
- <S> Customization<S> customize(String name, ContentType<S> contentType, String contentId, S state);
+ /**
+ * Configure a root customization for the specified content.
+ *
+ * @param name the customization name
+ * @param contentType the content type
+ * @param contentId the content id
+ * @param state the customization state
+ * @param <S> the content state typa parameter
+ * @return the customization
+ */
+ <S> Customization<S> customize(String name, ContentType<S> contentType, String contentId, S state);
- /**
- * Configure a customization for extending the specified customization.
- *
- * @param name the customization name
- * @param customization the customization to extend
- * @param <S> the content state typa parameter
- * @return the customization
- */
- <S> Customization<S> customize(String name, Customization<S> customization);
+ /**
+ * Configure a customization for extending the specified customization.
+ *
+ * @param name the customization name
+ * @param customization the customization to extend
+ * @param <S> the content state typa parameter
+ * @return the customization
+ */
+ <S> Customization<S> customize(String name, Customization<S> customization);
- /**
- * Returns the customization name related to this context or null if the customization is not
- * related to this context.
- *
- * @param customization the customization related to this context
- * @return the customization name
- */
- String nameOf(Customization customization);
+ /**
+ * Returns the customization name related to this context or null if the customization is not related to this
+ * context.
+ *
+ * @param customization the customization related to this context
+ * @return the customization name
+ */
+ String nameOf(Customization customization);
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceObject.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceObject.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/WorkspaceObject.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -26,27 +26,28 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface WorkspaceObject {
+public interface WorkspaceObject
+{
- /**
- * Returns an id that uniquely identify the object in the workspace.
- *
- * @return the id
- */
- String getObjectId();
+ /**
+ * Returns an id that uniquely identify the object in the workspace.
+ *
+ * @return the id
+ */
+ String getObjectId();
- /**
- * Returns the object type.
- *
- * @return the object type
- */
- ObjectType<? extends WorkspaceObject> getObjectType();
+ /**
+ * Returns the object type.
+ *
+ * @return the object type
+ */
+ ObjectType<? extends WorkspaceObject> getObjectType();
- /**
- * Returns the object attributes.
- *
- * @return the attributes
- */
- Attributes getAttributes();
+ /**
+ * Returns the object attributes.
+ *
+ * @return the attributes
+ */
+ Attributes getAttributes();
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/ContentLink.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/ContentLink.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/ContentLink.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -26,20 +26,21 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface ContentLink extends Link {
+public interface ContentLink extends Link
+{
- /**
- * Returns the link to a content.
- *
- * @return the content
- */
- Content getContent();
+ /**
+ * Returns the link to a content.
+ *
+ * @return the content
+ */
+ Content getContent();
- /**
- * Updates the content linked.
- *
- * @param content the content to link
- */
- void setContent(Content content);
+ /**
+ * Updates the content linked.
+ *
+ * @param content the content to link
+ */
+ void setContent(Content content);
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/Link.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/Link.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/Link.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -26,5 +26,6 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface Link extends WorkspaceObject {
+public interface Link extends WorkspaceObject
+{
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/PageLink.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/PageLink.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/PageLink.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -26,20 +26,21 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface PageLink extends Link {
+public interface PageLink extends Link
+{
- /**
- * The target page.
- *
- * @return the page
- */
- Page getPage();
+ /**
+ * The target page.
+ *
+ * @return the page
+ */
+ Page getPage();
- /**
- * Updates the target page.
- *
- * @param page the page to update
- */
- void setPage(Page page);
+ /**
+ * Updates the target page.
+ *
+ * @param page the page to update
+ */
+ void setPage(Page page);
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/URLLink.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/URLLink.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/link/URLLink.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -24,19 +24,20 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface URLLink extends Link {
+public interface URLLink extends Link
+{
- /**
- * Returns the link URL.
- *
- * @return the link URL
- */
- String getURL();
+ /**
+ * Returns the link URL.
+ *
+ * @return the link URL
+ */
+ String getURL();
- /**
- * Sets the link URL.
- *
- * @param url the link URL
- */
- void setURL(String url);
+ /**
+ * Sets the link URL.
+ *
+ * @param url the link URL
+ */
+ void setURL(String url);
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIBody.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIBody.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIBody.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -19,11 +19,11 @@
package org.gatein.mop.api.workspace.ui;
/**
- * The ui body denotes a place holder in a user interface structure. Usually it is used by template
- * mechanisms.
+ * The ui body denotes a place holder in a user interface structure. Usually it is used by template mechanisms.
*
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface UIBody extends UIComponent {
+public interface UIBody extends UIComponent
+{
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIComponent.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIComponent.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIComponent.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -26,14 +26,15 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface UIComponent extends WorkspaceObject {
+public interface UIComponent extends WorkspaceObject
+{
- String getName();
+ String getName();
- ObjectType<? extends UIComponent> getObjectType();
+ ObjectType<? extends UIComponent> getObjectType();
- UIContainer getParent();
-
- Page getPage();
+ UIContainer getParent();
+ Page getPage();
+
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIContainer.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIContainer.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIContainer.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -26,12 +26,13 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface UIContainer extends UIComponent, List<UIComponent> {
+public interface UIContainer extends UIComponent, List<UIComponent>
+{
- <T extends UIComponent> T add(ObjectType<T> componentType, String componentName);
+ <T extends UIComponent> T add(ObjectType<T> componentType, String componentName);
- <T extends UIComponent> T add(int index, ObjectType<T> componentType, String componentName);
+ <T extends UIComponent> T add(int index, ObjectType<T> componentType, String componentName);
- UIComponent get(String componentName);
+ UIComponent get(String componentName);
}
Modified: components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIWindow.java
===================================================================
--- components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIWindow.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/api/src/main/java/org/gatein/mop/api/workspace/ui/UIWindow.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -28,33 +28,34 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface UIWindow extends UIComponent, CustomizationContext {
+public interface UIWindow extends UIComponent, CustomizationContext
+{
- /**
- * Returns the customization of this window or null if no customization exists.
- *
- * @return the window customization
- */
- Customization<?> getCustomization();
+ /**
+ * Returns the customization of this window or null if no customization exists.
+ *
+ * @return the window customization
+ */
+ Customization<?> getCustomization();
- /**
- * Customizes the specified content.
- *
- * @param contentType the content type
- * @param contentId the content id
- * @param state the content state
- * @param <S> the content type parameter
- * @return the created customization
- */
- <S> Customization<S> customize(ContentType<S> contentType, String contentId, S state);
+ /**
+ * Customizes the specified content.
+ *
+ * @param contentType the content type
+ * @param contentId the content id
+ * @param state the content state
+ * @param <S> the content type parameter
+ * @return the created customization
+ */
+ <S> Customization<S> customize(ContentType<S> contentType, String contentId, S state);
- /**
- * Specialize the specified customization.
- *
- * @param customization the customization to specialise
- * @param <S> the content type parameter
- * @return the created customization
- */
- <S> Customization<S> customize(Customization<S> customization);
+ /**
+ * Specialize the specified customization.
+ *
+ * @param customization the customization to specialise
+ * @param <S> the content type parameter
+ * @return the created customization
+ */
+ <S> Customization<S> customize(Customization<S> customization);
}
Modified: components/mop/trunk/pom.xml
===================================================================
--- components/mop/trunk/pom.xml 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/pom.xml 2009-11-23 18:37:57 UTC (rev 769)
@@ -60,6 +60,16 @@
<!-- Internal dependencies -->
<dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-logging</artifactId>
+ <version>${version.gatein.common}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-common</artifactId>
+ <version>${version.gatein.common}</version>
+ </dependency>
+ <dependency>
<groupId>org.gatein.mop</groupId>
<artifactId>mop-api</artifactId>
<version>${project.version}</version>
@@ -82,6 +92,7 @@
</dependencies>
<properties>
+ <version.gatein.common>2.0.0-CR02</version.gatein.common>
<!-- ************** -->
<!-- Build settings -->
<!-- ************** -->
Modified: components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java
===================================================================
--- components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/ContentProvider.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -24,37 +24,38 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface ContentProvider<S> {
+public interface ContentProvider<S>
+{
- /**
- * Combines several states into a single state representation.
- *
- * @param states the various states to combine
- * @return the combined state
- */
- S combine(List<S> states);
+ /**
+ * Combines several states into a single state representation.
+ *
+ * @param states the various states to combine
+ * @return the combined state
+ */
+ S combine(List<S> states);
- /**
- * Update the state container with the provided state.
- *
- * @param container the state container
- * @param state the state
- */
- void setState(StateContainer container, S state);
+ /**
+ * Update the state container with the provided state.
+ *
+ * @param container the state container
+ * @param state the state
+ */
+ void setState(StateContainer container, S state);
- /**
- * Returns the state attached to the provided container.
- *
- * @param container the container
- * @return the state
- */
- S getState(StateContainer container);
+ /**
+ * Returns the state attached to the provided container.
+ *
+ * @param container the container
+ * @return the state
+ */
+ S getState(StateContainer container);
- /**
- * Returns the class the represents the state as seen by the framework client.
- *
- * @return the external state class
- */
- Class<S> getStateType();
+ /**
+ * Returns the class the represents the state as seen by the framework client.
+ *
+ * @return the external state class
+ */
+ Class<S> getStateType();
}
Modified: components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java
===================================================================
--- components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -22,5 +22,6 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface StateContainer {
+public interface StateContainer
+{
}
Modified: components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/customization/CustomizationContextProvider.java
===================================================================
--- components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/customization/CustomizationContextProvider.java 2009-11-23 17:22:31 UTC (rev 768)
+++ components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/customization/CustomizationContextProvider.java 2009-11-23 18:37:57 UTC (rev 769)
@@ -26,14 +26,15 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface CustomizationContextProvider {
+public interface CustomizationContextProvider
+{
- /**
- * Resolves the provided customization context or returns null if no context can be resolved.
- *
- * @param contextId the context id
- * @return the resolved context
- */
- CustomizationContext resolveContext(String contextId);
+ /**
+ * Resolves the provided customization context or returns null if no context can be resolved.
+ *
+ * @param contextId the context id
+ * @return the resolved context
+ */
+ CustomizationContext resolveContext(String contextId);
}
15 years, 1 month
gatein SVN: r768 - in components/mop/trunk/core/src: main/java/org/gatein/mop/core/api/content and 12 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-11-23 12:22:31 -0500 (Mon, 23 Nov 2009)
New Revision: 768
Modified:
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPFormatter.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ComparisonException.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ContentManagerRegistry.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ContentRegistration.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/CustomizationContextComparator.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/CustomizationContextProviderRegistry.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/CustomizationContextResolver.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/GroupSite.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/GroupSiteContainer.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/LinkImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationContainer.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageContainer.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageLinkImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PortalSite.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PortalSiteContainer.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SharedSite.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SharedSiteContainer.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SiteContainer.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SiteImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIBodyImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIComponentImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIContainerImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIWindowImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/URLLinkImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UserSite.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UserSiteContainer.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomization.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContentState.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextSpecialization.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextType.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextTypeContainer.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/CustomizationContainer.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/WorkspaceClone.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/WorkspaceCustomization.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/WorkspaceSpecialization.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/spi/content/WorkspaceCustomizationPolicy.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/AbstractAttributes.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/SimpleAttributes.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/Tools.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/AbstractPOMTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/POMFormatterTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/composer/StructureIteratorTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/BiltoTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/CustomizationContextComparatorTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/CustomizationTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AttributesTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/ObjectTypeTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/POMTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/QueryTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/WorkspaceTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/content/CustomizationTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/Gadget.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletDefinition.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferenceState.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferencesState.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preference.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preferences.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PreferencesBuilder.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/util/KeyTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/util/ToolsTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/util/ValueTypeTestCase.java
Log:
code reformat to GateIn conventions
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPFormatter.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPFormatter.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/MOPFormatter.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -25,122 +25,150 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class MOPFormatter implements ObjectFormatter {
+public class MOPFormatter implements ObjectFormatter
+{
- private static boolean isSpecialChar(char c) {
- return getCode(c) != null;
- }
+ private static boolean isSpecialChar(char c)
+ {
+ return getCode(c) != null;
+ }
- private static String getCode(char c) {
- if (c == 0x9
- || c == 0xA
- || c == 0xD
- || (c >= 0x20 && c <= 0xD7FF)
- || (c >= 0xE000 && c <= 0xFFFD)
- || (c >= 0x10000 && c <= 0x10FFFF)) {
- switch (c) {
- case '{':
- return "00";
- case '}':
- return "01";
- case '.':
- return "02";
- case '/':
- return "03";
- case ':':
- return "04";
- case '[':
- return "05";
- case ']':
- return "06";
- case '|':
- return "07";
- case '*':
- return "08";
- case '%':
- return "09";
- default:
- return null;
+ private static String getCode(char c)
+ {
+ if (c == 0x9
+ || c == 0xA
+ || c == 0xD
+ || (c >= 0x20 && c <= 0xD7FF)
+ || (c >= 0xE000 && c <= 0xFFFD)
+ || (c >= 0x10000 && c <= 0x10FFFF))
+ {
+ switch (c)
+ {
+ case '{':
+ return "00";
+ case '}':
+ return "01";
+ case '.':
+ return "02";
+ case '/':
+ return "03";
+ case ':':
+ return "04";
+ case '[':
+ return "05";
+ case ']':
+ return "06";
+ case '|':
+ return "07";
+ case '*':
+ return "08";
+ case '%':
+ return "09";
+ default:
+ return null;
+ }
}
- } else {
- throw new UnsupportedOperationException();
- }
- }
+ else
+ {
+ throw new UnsupportedOperationException();
+ }
+ }
- private static final char[] table = new char[] {
- '{', '}', '.', '/', ':', '[', ']', '|', '*', '%'
- };
+ private static final char[] table = new char[]{
+ '{', '}', '.', '/', ':', '[', ']', '|', '*', '%'
+ };
- private String decode(String s, int from) {
- StringBuffer buffer = new StringBuffer(s.length());
- buffer.append(s, 0, from);
- int to = s.length();
- while (from < to) {
- char c = s.charAt(from++);
- if (c == '%') {
- if (from + 1 >= to) {
- throw new IllegalStateException("Cannot decode wrong name " + s);
- }
- char c1 = s.charAt(from++);
- if (c1 != '0') {
- throw new IllegalStateException("Cannot decode wrong name " + s);
- }
- char c2 = s.charAt(from++);
- if (c2 < '0' || c2 > '9') {
- throw new IllegalStateException("Cannot decode wrong name " + s);
- }
- buffer.append(table[c2 - '0']);
- } else {
- buffer.append(c);
+ private String decode(String s, int from)
+ {
+ StringBuffer buffer = new StringBuffer(s.length());
+ buffer.append(s, 0, from);
+ int to = s.length();
+ while (from < to)
+ {
+ char c = s.charAt(from++);
+ if (c == '%')
+ {
+ if (from + 1 >= to)
+ {
+ throw new IllegalStateException("Cannot decode wrong name " + s);
+ }
+ char c1 = s.charAt(from++);
+ if (c1 != '0')
+ {
+ throw new IllegalStateException("Cannot decode wrong name " + s);
+ }
+ char c2 = s.charAt(from++);
+ if (c2 < '0' || c2 > '9')
+ {
+ throw new IllegalStateException("Cannot decode wrong name " + s);
+ }
+ buffer.append(table[c2 - '0']);
+ }
+ else
+ {
+ buffer.append(c);
+ }
}
- }
- return buffer.toString();
- }
+ return buffer.toString();
+ }
- public String decodeNodeName(FormatterContext context, String internalName) {
- int length = internalName.length();
- for (int i = 0;i < length;i++) {
- char c = internalName.charAt(i);
- if (c == '%') {
- return decode(internalName, i);
+ public String decodeNodeName(FormatterContext context, String internalName)
+ {
+ int length = internalName.length();
+ for (int i = 0; i < length; i++)
+ {
+ char c = internalName.charAt(i);
+ if (c == '%')
+ {
+ return decode(internalName, i);
+ }
}
- }
- return internalName;
- }
+ return internalName;
+ }
- private String encode(String s, int from) {
- StringBuffer buffer = new StringBuffer((s.length() * 5) >> 2);
- buffer.append(s, 0, from);
- int to = s.length();
- while (from < to) {
- char c = s.charAt(from++);
- String code = getCode(c);
- if (code != null) {
- buffer.append('%');
- buffer.append(code);
- } else {
- buffer.append(c);
+ private String encode(String s, int from)
+ {
+ StringBuffer buffer = new StringBuffer((s.length() * 5) >> 2);
+ buffer.append(s, 0, from);
+ int to = s.length();
+ while (from < to)
+ {
+ char c = s.charAt(from++);
+ String code = getCode(c);
+ if (code != null)
+ {
+ buffer.append('%');
+ buffer.append(code);
+ }
+ else
+ {
+ buffer.append(c);
+ }
}
- }
- return buffer.toString();
- }
+ return buffer.toString();
+ }
- public String encodeNodeName(FormatterContext context, String externalName) {
- int length = externalName.length();
- for (int i = 0;i < length;i++) {
- char c = externalName.charAt(i);
- if (isSpecialChar(c)) {
- return encode(externalName, i);
+ public String encodeNodeName(FormatterContext context, String externalName)
+ {
+ int length = externalName.length();
+ for (int i = 0; i < length; i++)
+ {
+ char c = externalName.charAt(i);
+ if (isSpecialChar(c))
+ {
+ return encode(externalName, i);
+ }
}
- }
- return externalName;
- }
+ return externalName;
+ }
- public String decodePropertyName(FormatterContext context, String internalName) {
- return internalName;
- }
+ public String decodePropertyName(FormatterContext context, String internalName)
+ {
+ return internalName;
+ }
- public String encodePropertyName(FormatterContext context, String externalName) {
- return externalName;
- }
+ public String encodePropertyName(FormatterContext context, String externalName)
+ {
+ return externalName;
+ }
}
\ No newline at end of file
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ComparisonException.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ComparisonException.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ComparisonException.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -22,20 +22,25 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class ComparisonException extends RuntimeException {
+public class ComparisonException extends RuntimeException
+{
- public ComparisonException() {
- }
+ public ComparisonException()
+ {
+ }
- public ComparisonException(String message) {
- super(message);
- }
+ public ComparisonException(String message)
+ {
+ super(message);
+ }
- public ComparisonException(String message, Throwable cause) {
- super(message, cause);
- }
+ public ComparisonException(String message, Throwable cause)
+ {
+ super(message, cause);
+ }
- public ComparisonException(Throwable cause) {
- super(cause);
- }
+ public ComparisonException(Throwable cause)
+ {
+ super(cause);
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ContentManagerRegistry.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ContentManagerRegistry.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ContentManagerRegistry.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -30,29 +30,36 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class ContentManagerRegistry {
+public class ContentManagerRegistry
+{
- /** The various providers. */
- public final transient Map<String, ContentRegistration> providers;
+ /** The various providers. */
+ public final transient Map<String, ContentRegistration> providers;
- public ContentManagerRegistry() {
- providers = new HashMap<String, ContentRegistration>();
- }
+ public ContentManagerRegistry()
+ {
+ providers = new HashMap<String, ContentRegistration>();
+ }
- public synchronized <S> void register(ContentType<S> contentType, ContentProvider<S> contentProvider) {
- if (contentType == null) {
- throw new NullPointerException();
- }
- if (contentProvider == null) {
- throw new NullPointerException();
- }
- providers.put(contentType.getMimeType(), new ContentRegistration(contentType, contentProvider));
- }
+ public synchronized <S> void register(ContentType<S> contentType, ContentProvider<S> contentProvider)
+ {
+ if (contentType == null)
+ {
+ throw new NullPointerException();
+ }
+ if (contentProvider == null)
+ {
+ throw new NullPointerException();
+ }
+ providers.put(contentType.getMimeType(), new ContentRegistration(contentType, contentProvider));
+ }
- public synchronized void unregister(ContentType contentType) {
- if (contentType == null) {
- throw new NullPointerException();
- }
- providers.remove(contentType.getMimeType());
- }
+ public synchronized void unregister(ContentType contentType)
+ {
+ if (contentType == null)
+ {
+ throw new NullPointerException();
+ }
+ providers.remove(contentType.getMimeType());
+ }
}
\ No newline at end of file
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ContentRegistration.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ContentRegistration.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/ContentRegistration.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -25,24 +25,28 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class ContentRegistration {
+public class ContentRegistration
+{
- /** . */
- private final ContentType<?> contentType;
+ /** . */
+ private final ContentType<?> contentType;
- /** . */
- private final ContentProvider provider;
+ /** . */
+ private final ContentProvider provider;
- public ContentRegistration(ContentType<?> contentType, ContentProvider provider) {
- this.contentType = contentType;
- this.provider = provider;
- }
+ public ContentRegistration(ContentType<?> contentType, ContentProvider provider)
+ {
+ this.contentType = contentType;
+ this.provider = provider;
+ }
- public ContentType<?> getContentType() {
- return contentType;
- }
+ public ContentType<?> getContentType()
+ {
+ return contentType;
+ }
- public ContentProvider getProvider() {
- return provider;
- }
+ public ContentProvider getProvider()
+ {
+ return provider;
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/CustomizationContextComparator.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/CustomizationContextComparator.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/CustomizationContextComparator.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -28,53 +28,71 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class CustomizationContextComparator implements Comparator<CustomizationContext> {
+public class CustomizationContextComparator implements Comparator<CustomizationContext>
+{
- /** . */
- private List<String> contextOrder;
+ /** . */
+ private List<String> contextOrder;
- public CustomizationContextComparator(List<String> contextOrder) {
- this.contextOrder = contextOrder;
- }
+ public CustomizationContextComparator(List<String> contextOrder)
+ {
+ this.contextOrder = contextOrder;
+ }
- public CustomizationContextComparator(String... contextOrder) {
- this(Arrays.asList(contextOrder));
- }
+ public CustomizationContextComparator(String... contextOrder)
+ {
+ this(Arrays.asList(contextOrder));
+ }
- public int compare(CustomizationContext c1, CustomizationContext c2) {
- String t1 = c1.getContextType();
- int i1 = contextOrder.indexOf(t1);
- if (i1 == -1) {
- throw new ComparisonException("Context type " + t1 + " cannot be used for comparison");
- }
+ public int compare(CustomizationContext c1, CustomizationContext c2)
+ {
+ String t1 = c1.getContextType();
+ int i1 = contextOrder.indexOf(t1);
+ if (i1 == -1)
+ {
+ throw new ComparisonException("Context type " + t1 + " cannot be used for comparison");
+ }
- //
- String t2 = c2.getContextType();
- int i2 = contextOrder.indexOf(t2);
- if (i2 == -1) {
- throw new ComparisonException("Context type " + t1 + " cannot be used for comparison");
- }
+ //
+ String t2 = c2.getContextType();
+ int i2 = contextOrder.indexOf(t2);
+ if (i2 == -1)
+ {
+ throw new ComparisonException("Context type " + t1 + " cannot be used for comparison");
+ }
- //
- if (i1 < i2) {
- return -1;
- } else if (i1 > i2) {
- return 1;
- }
+ //
+ if (i1 < i2)
+ {
+ return -1;
+ }
+ else if (i1 > i2)
+ {
+ return 1;
+ }
- //
- if (c1.contains(c2)) {
- if (c2.contains(c1)) {
- return 0;
- } else {
- return -1;
+ //
+ if (c1.contains(c2))
+ {
+ if (c2.contains(c1))
+ {
+ return 0;
+ }
+ else
+ {
+ return -1;
+ }
}
- } else {
- if (c2.contains(c1)) {
- return 1;
- } else {
- throw new ComparisonException("Cannot compare customization contexts " + c1 + " and " + c2);
+ else
+ {
+ if (c2.contains(c1))
+ {
+ return 1;
+ }
+ else
+ {
+ throw new ComparisonException("Cannot compare customization contexts " + c1 + " and " + c2);
+ }
}
- }
- }
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/CustomizationContextProviderRegistry.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/CustomizationContextProviderRegistry.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/CustomizationContextProviderRegistry.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -30,49 +30,60 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class CustomizationContextProviderRegistry implements CustomizationContextResolver {
+public class CustomizationContextProviderRegistry implements CustomizationContextResolver
+{
- /** The various providers. */
- final transient Map<String, CustomizationContextProvider> resolvers;
+ /** The various providers. */
+ final transient Map<String, CustomizationContextProvider> resolvers;
- public CustomizationContextProviderRegistry() {
- resolvers = new HashMap<String, CustomizationContextProvider>();
- }
+ public CustomizationContextProviderRegistry()
+ {
+ resolvers = new HashMap<String, CustomizationContextProvider>();
+ }
- public synchronized void register(String contextType, CustomizationContextProvider contentProvider) {
- if (contextType == null) {
- throw new NullPointerException();
- }
- if (contentProvider == null) {
- throw new NullPointerException();
- }
- resolvers.put(contextType, contentProvider);
- }
+ public synchronized void register(String contextType, CustomizationContextProvider contentProvider)
+ {
+ if (contextType == null)
+ {
+ throw new NullPointerException();
+ }
+ if (contentProvider == null)
+ {
+ throw new NullPointerException();
+ }
+ resolvers.put(contextType, contentProvider);
+ }
- public synchronized void unregister(String contextType) {
- if (contextType == null) {
- throw new NullPointerException();
- }
- resolvers.remove(contextType);
- }
+ public synchronized void unregister(String contextType)
+ {
+ if (contextType == null)
+ {
+ throw new NullPointerException();
+ }
+ resolvers.remove(contextType);
+ }
- public CustomizationContext resolve(String contextType, String contextId) {
- if (contextType == null) {
- throw new NullPointerException();
- }
- if (contextId == null) {
- throw new NullPointerException();
- }
+ public CustomizationContext resolve(String contextType, String contextId)
+ {
+ if (contextType == null)
+ {
+ throw new NullPointerException();
+ }
+ if (contextId == null)
+ {
+ throw new NullPointerException();
+ }
- //
- CustomizationContextProvider provider = resolvers.get(contextType);
+ //
+ CustomizationContextProvider provider = resolvers.get(contextType);
- //
- if (provider != null) {
- return provider.resolveContext(contextId);
- }
+ //
+ if (provider != null)
+ {
+ return provider.resolveContext(contextId);
+ }
- //
- return null;
- }
+ //
+ return null;
+ }
}
\ No newline at end of file
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/CustomizationContextResolver.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/CustomizationContextResolver.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/content/CustomizationContextResolver.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -24,8 +24,9 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public interface CustomizationContextResolver {
+public interface CustomizationContextResolver
+{
- CustomizationContext resolve(String contextType, String contextId);
+ CustomizationContext resolve(String contextType, String contextId);
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/GroupSite.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/GroupSite.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/GroupSite.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -28,11 +28,13 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:groupsite")
-public abstract class GroupSite extends SiteImpl {
+public abstract class GroupSite extends SiteImpl
+{
- // Site implementation ***********************************************************************************************
+ // Site implementation ***********************************************************************************************
- public ObjectType<? extends Site> getObjectType() {
- return ObjectType.GROUP_SITE;
- }
+ public ObjectType<? extends Site> getObjectType()
+ {
+ return ObjectType.GROUP_SITE;
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/GroupSiteContainer.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/GroupSiteContainer.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/GroupSiteContainer.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -28,9 +28,10 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:groupsites")
-public abstract class GroupSiteContainer extends SiteContainer<GroupSite> {
+public abstract class GroupSiteContainer extends SiteContainer<GroupSite>
+{
- @RelatedMappedBy("groupsites")
- public abstract WorkspaceImpl getWorkspace();
+ @RelatedMappedBy("groupsites")
+ public abstract WorkspaceImpl getWorkspace();
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/LinkImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/LinkImpl.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/LinkImpl.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -25,8 +25,9 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class LinkImpl extends WorkspaceObjectImpl implements Link {
+public abstract class LinkImpl extends WorkspaceObjectImpl implements Link
+{
- public abstract ObjectType<? extends Link> getObjectType();
+ public abstract ObjectType<? extends Link> getObjectType();
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationContainer.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationContainer.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationContainer.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -32,25 +32,27 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:navigationcontainer")
-public abstract class NavigationContainer {
+public abstract class NavigationContainer
+{
- @OneToOne
- @RelatedMappedBy("navigations")
- public abstract NavigationImpl getOwner();
+ @OneToOne
+ @RelatedMappedBy("navigations")
+ public abstract NavigationImpl getOwner();
- @OneToMany
- public abstract Map<String, NavigationImpl> getNavigationMap();
+ @OneToMany
+ public abstract Map<String, NavigationImpl> getNavigationMap();
@OneToMany
- public abstract List<NavigationImpl> getNavigationList();
+ public abstract List<NavigationImpl> getNavigationList();
- @Create
- public abstract NavigationImpl createNavigation();
+ @Create
+ public abstract NavigationImpl createNavigation();
- public NavigationImpl addNavigation(String name) {
- NavigationImpl page = createNavigation();
- page.setName(name);
- getNavigationList().add(page);
- return page;
- }
+ public NavigationImpl addNavigation(String name)
+ {
+ NavigationImpl page = createNavigation();
+ page.setName(name);
+ getNavigationList().add(page);
+ return page;
+ }
}
\ No newline at end of file
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationImpl.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationImpl.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -40,107 +40,128 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:navigation")
-public abstract class NavigationImpl extends WorkspaceObjectImpl implements Navigation {
+public abstract class NavigationImpl extends WorkspaceObjectImpl implements Navigation
+{
- @OneToOne
- @RelatedMappedBy("rootnavigation")
- public abstract SiteImpl getParentSite();
+ @OneToOne
+ @RelatedMappedBy("rootnavigation")
+ public abstract SiteImpl getParentSite();
- @OneToOne
- @MappedBy("children")
- public abstract NavigationContainer getChildrenContainer();
+ @OneToOne
+ @MappedBy("children")
+ public abstract NavigationContainer getChildrenContainer();
- @ManyToOne
- public abstract NavigationContainer getParentContainer();
+ @ManyToOne
+ public abstract NavigationContainer getParentContainer();
- @OneToOne
- @MappedBy("link")
- public abstract LinkImpl getLink();
+ @OneToOne
+ @MappedBy("link")
+ public abstract LinkImpl getLink();
- public abstract LinkImpl setLink(LinkImpl target);
+ public abstract LinkImpl setLink(LinkImpl target);
- @Create
- public abstract NavigationImpl createNavigation(String name);
+ @Create
+ public abstract NavigationImpl createNavigation(String name);
- @Create
- public abstract URLLinkImpl createURLTarget();
+ @Create
+ public abstract URLLinkImpl createURLTarget();
- @Create
- public abstract PageLinkImpl createPageLink();
+ @Create
+ public abstract PageLinkImpl createPageLink();
- @ManyToOne(type = RelationshipType.PATH)
- @MappedBy("template")
- public abstract PageImpl getPageTemplate();
+ @ManyToOne(type = RelationshipType.PATH)
+ @MappedBy("template")
+ public abstract PageImpl getPageTemplate();
- public abstract void setPageTemplate(PageImpl template);
+ public abstract void setPageTemplate(PageImpl template);
- @Destroy
- public abstract void destroy();
+ @Destroy
+ public abstract void destroy();
- public ObjectType<? extends Navigation> getObjectType() {
- return ObjectType.NAVIGATION;
- }
+ public ObjectType<? extends Navigation> getObjectType()
+ {
+ return ObjectType.NAVIGATION;
+ }
- public Page getTemplate() {
- return getPageTemplate();
- }
+ public Page getTemplate()
+ {
+ return getPageTemplate();
+ }
- public void setTemplate(Page template) {
- setPageTemplate((PageImpl)template);
- }
+ public void setTemplate(Page template)
+ {
+ setPageTemplate((PageImpl)template);
+ }
- public Navigation getParent() {
- NavigationContainer parent = getParentContainer();
- if (parent != null) {
- return parent.getOwner();
- } else {
- return null;
- }
- }
+ public Navigation getParent()
+ {
+ NavigationContainer parent = getParentContainer();
+ if (parent != null)
+ {
+ return parent.getOwner();
+ }
+ else
+ {
+ return null;
+ }
+ }
- public List<? extends Navigation> getChildren() {
- NavigationContainer childrenContainer = getChildrenContainer();
- return childrenContainer.getNavigationList();
- }
+ public List<? extends Navigation> getChildren()
+ {
+ NavigationContainer childrenContainer = getChildrenContainer();
+ return childrenContainer.getNavigationList();
+ }
- public Navigation getChild(String name) {
- if (name == null) {
- throw new NullPointerException();
- }
- NavigationContainer childrenContainer = getChildrenContainer();
- return childrenContainer.getNavigationMap().get(name);
- }
+ public Navigation getChild(String name)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ NavigationContainer childrenContainer = getChildrenContainer();
+ return childrenContainer.getNavigationMap().get(name);
+ }
- public NavigationImpl addChild(String name) {
- NavigationContainer childrenContainer = getChildrenContainer();
- return childrenContainer.addNavigation(name);
- }
+ public NavigationImpl addChild(String name)
+ {
+ NavigationContainer childrenContainer = getChildrenContainer();
+ return childrenContainer.addNavigation(name);
+ }
- public <L extends Link> L linkTo(ObjectType<L> linkType) {
- setLink(null);
+ public <L extends Link> L linkTo(ObjectType<L> linkType)
+ {
+ setLink(null);
- //
- L link = null;
- if (linkType != null) {
- if (linkType.getJavaType().equals(PageLink.class)) {
- PageLinkImpl pl = createPageLink();
- setLink(pl);
- link = (L)pl;
- } else {
- throw new UnsupportedOperationException("Links of type " + linkType + " are not supported");
+ //
+ L link = null;
+ if (linkType != null)
+ {
+ if (linkType.getJavaType().equals(PageLink.class))
+ {
+ PageLinkImpl pl = createPageLink();
+ setLink(pl);
+ link = (L)pl;
+ }
+ else
+ {
+ throw new UnsupportedOperationException("Links of type " + linkType + " are not supported");
+ }
}
- }
- //
- return link;
- }
+ //
+ return link;
+ }
- public Site getSite() {
- SiteImpl parent = getParentSite();
- if (parent != null) {
- return parent;
- } else {
- return getParent().getSite();
- }
- }
+ public Site getSite()
+ {
+ SiteImpl parent = getParentSite();
+ if (parent != null)
+ {
+ return parent;
+ }
+ else
+ {
+ return getParent().getSite();
+ }
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageContainer.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageContainer.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageContainer.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -31,21 +31,23 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:pagecontainer")
-public abstract class PageContainer {
+public abstract class PageContainer
+{
- @OneToOne
- @RelatedMappedBy("pages")
- public abstract PageImpl getOwner();
+ @OneToOne
+ @RelatedMappedBy("pages")
+ public abstract PageImpl getOwner();
- @OneToMany
- public abstract Map<String, PageImpl> getPages();
+ @OneToMany
+ public abstract Map<String, PageImpl> getPages();
- @Create
- public abstract PageImpl createPage();
+ @Create
+ public abstract PageImpl createPage();
- public PageImpl addPage(String name) {
- PageImpl page = createPage();
- getPages().put(name, page);
- return page;
- }
+ public PageImpl addPage(String name)
+ {
+ PageImpl page = createPage();
+ getPages().put(name, page);
+ return page;
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageImpl.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageImpl.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -49,177 +49,219 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:page")
-public abstract class PageImpl extends WorkspaceObjectImpl implements Page, WorkspaceCustomizationContext {
+public abstract class PageImpl extends WorkspaceObjectImpl implements Page, WorkspaceCustomizationContext
+{
- /** . */
- private final Attributes cascadingAttributes = new AbstractAttributes() {
- public Set<String> getKeys() {
- throw new UnsupportedOperationException("todo ?");
- }
- protected Object get(String name) {
- return getCascadedPropertyValue(name);
- }
- protected void set(String name, Object o) {
- throw new UnsupportedOperationException("read only");
- }
- };
+ /** . */
+ private final Attributes cascadingAttributes = new AbstractAttributes()
+ {
+ public Set<String> getKeys()
+ {
+ throw new UnsupportedOperationException("todo ?");
+ }
- @ManyToOne(type = RelationshipType.PATH)
- @MappedBy("template")
- public abstract PageImpl getPageTemplate();
+ protected Object get(String name)
+ {
+ return getCascadedPropertyValue(name);
+ }
- public abstract void setPageTemplate(PageImpl template);
+ protected void set(String name, Object o)
+ {
+ throw new UnsupportedOperationException("read only");
+ }
+ };
- @OneToMany(type = RelationshipType.PATH)
- @RelatedMappedBy("template")
- public abstract Collection<NavigationImpl> getTemplatizedNavigations();
+ @ManyToOne(type = RelationshipType.PATH)
+ @MappedBy("template")
+ public abstract PageImpl getPageTemplate();
- @OneToMany(type = RelationshipType.PATH)
- @RelatedMappedBy("template")
- public abstract Collection<PageImpl> getTemplatizedPages();
+ public abstract void setPageTemplate(PageImpl template);
- @OneToMany(type = RelationshipType.PATH)
- @RelatedMappedBy("template")
- public abstract Collection<? extends WorkspaceObject> getTemplatizedObjects();
+ @OneToMany(type = RelationshipType.PATH)
+ @RelatedMappedBy("template")
+ public abstract Collection<NavigationImpl> getTemplatizedNavigations();
- @OneToOne
- @MappedBy("children")
- public abstract PageContainer getChildrenContainer();
+ @OneToMany(type = RelationshipType.PATH)
+ @RelatedMappedBy("template")
+ public abstract Collection<PageImpl> getTemplatizedPages();
- @OneToOne
- @RelatedMappedBy("children")
- public abstract PageContainer getParentContainer();
+ @OneToMany(type = RelationshipType.PATH)
+ @RelatedMappedBy("template")
+ public abstract Collection<? extends WorkspaceObject> getTemplatizedObjects();
- @OneToOne
- @RelatedMappedBy("rootpage")
- public abstract SiteImpl getSiteParent();
+ @OneToOne
+ @MappedBy("children")
+ public abstract PageContainer getChildrenContainer();
- @OneToOne
- @MappedBy("rootcomponent")
- public abstract UIContainerImpl getRootComponent();
+ @OneToOne
+ @RelatedMappedBy("children")
+ public abstract PageContainer getParentContainer();
- @Destroy
- public abstract void destroy();
+ @OneToOne
+ @RelatedMappedBy("rootpage")
+ public abstract SiteImpl getSiteParent();
- @OneToOne
- @MappedBy("customizations")
- public abstract CustomizationContainer getCustomizations();
+ @OneToOne
+ @MappedBy("rootcomponent")
+ public abstract UIContainerImpl getRootComponent();
- // WorkspaceCustomizationContext implementation **********************************************************************
+ @Destroy
+ public abstract void destroy();
- public String getContextType() {
- return WorkspaceCustomizationContext.TYPE;
- }
+ @OneToOne
+ @MappedBy("customizations")
+ public abstract CustomizationContainer getCustomizations();
- public String getContextId() {
- return getObjectId();
- }
+ // WorkspaceCustomizationContext implementation **********************************************************************
- public boolean contains(CustomizationContext that) {
- return contains(this, that);
- }
+ public String getContextType()
+ {
+ return WorkspaceCustomizationContext.TYPE;
+ }
- public Customization<?> getCustomization(String name) {
- return getCustomizations().getCustomization(name);
- }
+ public String getContextId()
+ {
+ return getObjectId();
+ }
- public <S> Customization<S> customize(String name, ContentType<S> contentType, String contentId, S state) {
- return getCustomizations().customize(name, contentType, contentId, state);
- }
+ public boolean contains(CustomizationContext that)
+ {
+ return contains(this, that);
+ }
- public <S> Customization<S> customize(String name, Customization<S> customization) {
- return getCustomizations().customize(name, customization);
- }
+ public Customization<?> getCustomization(String name)
+ {
+ return getCustomizations().getCustomization(name);
+ }
- public String nameOf(Customization customization) {
- return getCustomizations().nameOf(customization);
- }
+ public <S> Customization<S> customize(String name, ContentType<S> contentType, String contentId, S state)
+ {
+ return getCustomizations().customize(name, contentType, contentId, state);
+ }
- // *******************************************************************************************************************
+ public <S> Customization<S> customize(String name, Customization<S> customization)
+ {
+ return getCustomizations().customize(name, customization);
+ }
- public <T extends TemplatizedObject> Collection<? extends T> getTemplatizedObjects(ObjectType<T> templatizedType) {
- if (Page.class.equals(templatizedType.getJavaType())) {
- ArrayList bilto = new ArrayList();
- for (Page page : getTemplatizedPages()) {
- bilto.add(page);
+ public String nameOf(Customization customization)
+ {
+ return getCustomizations().nameOf(customization);
+ }
+
+ // *******************************************************************************************************************
+
+ public <T extends TemplatizedObject> Collection<? extends T> getTemplatizedObjects(ObjectType<T> templatizedType)
+ {
+ if (Page.class.equals(templatizedType.getJavaType()))
+ {
+ ArrayList bilto = new ArrayList();
+ for (Page page : getTemplatizedPages())
+ {
+ bilto.add(page);
+ }
+ return bilto;
}
- return bilto;
- } else if (Navigation.class.isAssignableFrom(templatizedType.getJavaType())) {
- ArrayList bilto = new ArrayList();
- for (Navigation page : getTemplatizedNavigations()) {
- bilto.add(page);
+ else if (Navigation.class.isAssignableFrom(templatizedType.getJavaType()))
+ {
+ ArrayList bilto = new ArrayList();
+ for (Navigation page : getTemplatizedNavigations())
+ {
+ bilto.add(page);
+ }
+ return bilto;
}
- return bilto;
- } else {
- throw new IllegalArgumentException("Unaccepted templatized type");
- }
- }
+ else
+ {
+ throw new IllegalArgumentException("Unaccepted templatized type");
+ }
+ }
- public ObjectType<? extends Page> getObjectType() {
- return ObjectType.PAGE;
- }
+ public ObjectType<? extends Page> getObjectType()
+ {
+ return ObjectType.PAGE;
+ }
- public Attributes getCascadingAttributes() {
- return cascadingAttributes;
- }
+ public Attributes getCascadingAttributes()
+ {
+ return cascadingAttributes;
+ }
- public SiteImpl getSite() {
- PageContainer parent = getParentContainer();
- if (parent != null) {
- return parent.getOwner().getSite();
- } else {
- return getSiteParent();
- }
- }
+ public SiteImpl getSite()
+ {
+ PageContainer parent = getParentContainer();
+ if (parent != null)
+ {
+ return parent.getOwner().getSite();
+ }
+ else
+ {
+ return getSiteParent();
+ }
+ }
- public PageImpl getParent() {
- PageContainer parent = getParentContainer();
- if (parent != null) {
- return parent.getOwner();
- } else {
- return null;
- }
- }
+ public PageImpl getParent()
+ {
+ PageContainer parent = getParentContainer();
+ if (parent != null)
+ {
+ return parent.getOwner();
+ }
+ else
+ {
+ return null;
+ }
+ }
- public PageImpl addChild(String name) throws NullPointerException, IllegalArgumentException {
- PageContainer childrenContainer = getChildrenContainer();
- return childrenContainer.addPage(name);
- }
+ public PageImpl addChild(String name) throws NullPointerException, IllegalArgumentException
+ {
+ PageContainer childrenContainer = getChildrenContainer();
+ return childrenContainer.addPage(name);
+ }
- public Collection<? extends Page> getChildren() {
- PageContainer childrenContainer = getChildrenContainer();
- return childrenContainer.getPages().values();
- }
+ public Collection<? extends Page> getChildren()
+ {
+ PageContainer childrenContainer = getChildrenContainer();
+ return childrenContainer.getPages().values();
+ }
- public PageImpl getChild(String name) {
- if (name == null) {
- throw new NullPointerException();
- }
- PageContainer childrenContainer = getChildrenContainer();
- return childrenContainer.getPages().get(name);
- }
+ public PageImpl getChild(String name)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ PageContainer childrenContainer = getChildrenContainer();
+ return childrenContainer.getPages().get(name);
+ }
- public Collection<PageLink> getNavigations() {
- throw new UnsupportedOperationException();
- }
+ public Collection<PageLink> getNavigations()
+ {
+ throw new UnsupportedOperationException();
+ }
- public void setTemplate(Page template) {
- setPageTemplate((PageImpl)template);
- }
+ public void setTemplate(Page template)
+ {
+ setPageTemplate((PageImpl)template);
+ }
- public Page getTemplate() {
- return getPageTemplate();
- }
+ public Page getTemplate()
+ {
+ return getPageTemplate();
+ }
- private Object getCascadedPropertyValue(String propertyName) {
- Attributes attributes = getAttributes();
- Object value = attributes.getObject(propertyName);
- if (value == null) {
- PageImpl parent = getParent();
- if (parent != null) {
- value = parent.getCascadedPropertyValue(propertyName);
+ private Object getCascadedPropertyValue(String propertyName)
+ {
+ Attributes attributes = getAttributes();
+ Object value = attributes.getObject(propertyName);
+ if (value == null)
+ {
+ PageImpl parent = getParent();
+ if (parent != null)
+ {
+ value = parent.getCascadedPropertyValue(propertyName);
+ }
}
- }
- return value;
- }
+ return value;
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageLinkImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageLinkImpl.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PageLinkImpl.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -33,25 +33,28 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:pagelink")
-public abstract class PageLinkImpl extends LinkImpl implements PageLink {
+public abstract class PageLinkImpl extends LinkImpl implements PageLink
+{
- @ManyToOne(type = RelationshipType.PATH)
- @MappedBy("page")
- public abstract PageImpl getPage();
+ @ManyToOne(type = RelationshipType.PATH)
+ @MappedBy("page")
+ public abstract PageImpl getPage();
- public abstract void setPage(PageImpl page);
+ public abstract void setPage(PageImpl page);
- @Path
- @Property(name = "path")
- public abstract String getPathPath();
+ @Path
+ @Property(name = "path")
+ public abstract String getPathPath();
- public abstract void setPagePath(String path);
+ public abstract void setPagePath(String path);
- public void setPage(Page page) {
- setPage((PageImpl)page);
- }
+ public void setPage(Page page)
+ {
+ setPage((PageImpl)page);
+ }
- public ObjectType<? extends PageLink> getObjectType() {
- return ObjectType.PAGE_LINK;
- }
+ public ObjectType<? extends PageLink> getObjectType()
+ {
+ return ObjectType.PAGE_LINK;
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PortalSite.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PortalSite.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PortalSite.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -27,25 +27,30 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:portalsite")
-public abstract class PortalSite extends SiteImpl {
+public abstract class PortalSite extends SiteImpl
+{
- // Site implementation ***********************************************************************************************
+ // Site implementation ***********************************************************************************************
- public ObjectType<? extends Site> getObjectType() {
- return ObjectType.PORTAL_SITE;
- }
+ public ObjectType<? extends Site> getObjectType()
+ {
+ return ObjectType.PORTAL_SITE;
+ }
- // Portal implementation *********************************************************************************************
+ // Portal implementation *********************************************************************************************
- public String getSkinId() {
- throw new UnsupportedOperationException();
- }
+ public String getSkinId()
+ {
+ throw new UnsupportedOperationException();
+ }
- public String getTitle() {
- throw new UnsupportedOperationException();
- }
+ public String getTitle()
+ {
+ throw new UnsupportedOperationException();
+ }
- public String getLocale() {
- throw new UnsupportedOperationException();
- }
+ public String getLocale()
+ {
+ throw new UnsupportedOperationException();
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PortalSiteContainer.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PortalSiteContainer.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/PortalSiteContainer.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -28,10 +28,11 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:portalsites")
-public abstract class PortalSiteContainer extends SiteContainer<PortalSite> {
+public abstract class PortalSiteContainer extends SiteContainer<PortalSite>
+{
- @RelatedMappedBy("portalsites")
- public abstract WorkspaceImpl getWorkspace();
-
+ @RelatedMappedBy("portalsites")
+ public abstract WorkspaceImpl getWorkspace();
+
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SharedSite.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SharedSite.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SharedSite.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -28,11 +28,13 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:sharedsite")
-public abstract class SharedSite extends SiteImpl {
+public abstract class SharedSite extends SiteImpl
+{
- // Site implementation ***********************************************************************************************
+ // Site implementation ***********************************************************************************************
- public ObjectType<? extends Site> getObjectType() {
- return ObjectType.SHARED_SITE;
- }
+ public ObjectType<? extends Site> getObjectType()
+ {
+ return ObjectType.SHARED_SITE;
+ }
}
\ No newline at end of file
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SharedSiteContainer.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SharedSiteContainer.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SharedSiteContainer.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -28,9 +28,10 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:sharedsites")
-public abstract class SharedSiteContainer extends SiteContainer<SharedSite> {
+public abstract class SharedSiteContainer extends SiteContainer<SharedSite>
+{
- @RelatedMappedBy("sharedsites")
- public abstract WorkspaceImpl getWorkspace();
+ @RelatedMappedBy("sharedsites")
+ public abstract WorkspaceImpl getWorkspace();
}
\ No newline at end of file
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SiteContainer.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SiteContainer.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SiteContainer.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -30,30 +30,34 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class SiteContainer<T extends Site> {
+public abstract class SiteContainer<T extends Site>
+{
- @OneToMany
- public abstract Map<String, T> getSites();
+ @OneToMany
+ public abstract Map<String, T> getSites();
- @OneToOne
- public abstract WorkspaceImpl getWorkspace();
+ @OneToOne
+ public abstract WorkspaceImpl getWorkspace();
- public T addSite(String siteName) {
- T site = createSite();
- getSites().put(siteName, site);
- return site;
- }
+ public T addSite(String siteName)
+ {
+ T site = createSite();
+ getSites().put(siteName, site);
+ return site;
+ }
- @Create
- public abstract T createSite();
+ @Create
+ public abstract T createSite();
- public T getSite(String name) {
- Map<String, T> sites = getSites();
- return sites.get(name);
- }
+ public T getSite(String name)
+ {
+ Map<String, T> sites = getSites();
+ return sites.get(name);
+ }
- public Collection<T> getAllSites() {
- Map<String, T> sites = getSites();
- return sites.values();
- }
+ public Collection<T> getAllSites()
+ {
+ Map<String, T> sites = getSites();
+ return sites.values();
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SiteImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SiteImpl.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/SiteImpl.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -35,66 +35,76 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class SiteImpl extends WorkspaceObjectImpl implements Site, WorkspaceCustomizationContext {
+public abstract class SiteImpl extends WorkspaceObjectImpl implements Site, WorkspaceCustomizationContext
+{
- @OneToOne
- @MappedBy("rootpage")
- public abstract PageImpl getRoot();
+ @OneToOne
+ @MappedBy("rootpage")
+ public abstract PageImpl getRoot();
- @OneToOne
- @MappedBy("rootnavigation")
- public abstract NavigationImpl getRootNavigation();
+ @OneToOne
+ @MappedBy("rootnavigation")
+ public abstract NavigationImpl getRootNavigation();
- @ManyToOne
- public abstract SiteContainer getSites();
+ @ManyToOne
+ public abstract SiteContainer getSites();
- @Destroy
- public abstract void destroy();
+ @Destroy
+ public abstract void destroy();
- @OneToOne
- @MappedBy("customizations")
- public abstract CustomizationContainer getCustomizations();
+ @OneToOne
+ @MappedBy("customizations")
+ public abstract CustomizationContainer getCustomizations();
- public abstract ObjectType<? extends Site> getObjectType();
+ public abstract ObjectType<? extends Site> getObjectType();
- // Site implementation ***********************************************************************************************
+ // Site implementation ***********************************************************************************************
- public WorkspaceImpl getWorkspace() {
- SiteContainer sites = getSites();
- return sites.getWorkspace();
- }
+ public WorkspaceImpl getWorkspace()
+ {
+ SiteContainer sites = getSites();
+ return sites.getWorkspace();
+ }
- public Page getRootPage() {
- return getRoot();
- }
+ public Page getRootPage()
+ {
+ return getRoot();
+ }
- // WorkspaceCustomizationContext implementation **********************************************************************
+ // WorkspaceCustomizationContext implementation **********************************************************************
- public String getContextType() {
- return WorkspaceCustomizationContext.TYPE;
- }
+ public String getContextType()
+ {
+ return WorkspaceCustomizationContext.TYPE;
+ }
- public String getContextId() {
- return getObjectId();
- }
+ public String getContextId()
+ {
+ return getObjectId();
+ }
- public boolean contains(CustomizationContext that) {
- return contains(this, that);
- }
+ public boolean contains(CustomizationContext that)
+ {
+ return contains(this, that);
+ }
- public Customization<?> getCustomization(String name) {
- return getCustomizations().getCustomization(name);
- }
+ public Customization<?> getCustomization(String name)
+ {
+ return getCustomizations().getCustomization(name);
+ }
- public <S> Customization<S> customize(String name, ContentType<S> contentType, String contentId, S state) {
- return getCustomizations().customize(name, contentType, contentId, state);
- }
+ public <S> Customization<S> customize(String name, ContentType<S> contentType, String contentId, S state)
+ {
+ return getCustomizations().customize(name, contentType, contentId, state);
+ }
- public <S> Customization<S> customize(String name, Customization<S> customization) {
- return getCustomizations().customize(name, customization);
- }
+ public <S> Customization<S> customize(String name, Customization<S> customization)
+ {
+ return getCustomizations().customize(name, customization);
+ }
- public String nameOf(Customization customization) {
- return getCustomizations().nameOf(customization);
- }
+ public String nameOf(Customization customization)
+ {
+ return getCustomizations().nameOf(customization);
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIBodyImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIBodyImpl.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIBodyImpl.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -27,9 +27,11 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:uibody")
-public abstract class UIBodyImpl extends UIComponentImpl implements UIBody {
+public abstract class UIBodyImpl extends UIComponentImpl implements UIBody
+{
- public ObjectType<? extends UIBody> getObjectType() {
- return ObjectType.BODY;
- }
+ public ObjectType<? extends UIBody> getObjectType()
+ {
+ return ObjectType.BODY;
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIComponentImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIComponentImpl.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIComponentImpl.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -27,26 +27,32 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class UIComponentImpl extends WorkspaceObjectImpl implements UIComponent {
+public abstract class UIComponentImpl extends WorkspaceObjectImpl implements UIComponent
+{
- @ManyToOne
- public abstract UIContainerImpl getParentContainer();
+ @ManyToOne
+ public abstract UIContainerImpl getParentContainer();
- @ManyToOne
- public abstract PageImpl getParentPage();
+ @ManyToOne
+ public abstract PageImpl getParentPage();
- public abstract ObjectType<? extends UIComponent> getObjectType();
+ public abstract ObjectType<? extends UIComponent> getObjectType();
- public final UIContainerImpl getParent() {
- return getParentContainer();
- }
+ public final UIContainerImpl getParent()
+ {
+ return getParentContainer();
+ }
- public final PageImpl getPage() {
- UIContainerImpl container = getParentContainer();
- if (container != null) {
- return container.getPage();
- } else {
- return getParentPage();
- }
- }
+ public final PageImpl getPage()
+ {
+ UIContainerImpl container = getParentContainer();
+ if (container != null)
+ {
+ return container.getPage();
+ }
+ else
+ {
+ return getParentPage();
+ }
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIContainerImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIContainerImpl.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIContainerImpl.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -37,156 +37,198 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:uicontainer")
-public abstract class UIContainerImpl extends UIComponentImpl implements UIContainer {
+public abstract class UIContainerImpl extends UIComponentImpl implements UIContainer
+{
- @Create
- public abstract UIContainerImpl createContainer();
+ @Create
+ public abstract UIContainerImpl createContainer();
- @Create
- public abstract UIBodyImpl createInsertion();
+ @Create
+ public abstract UIBodyImpl createInsertion();
- @Create
- public abstract UIWindowImpl createWindow();
+ @Create
+ public abstract UIWindowImpl createWindow();
- @OneToMany
- public abstract Map<String, UIComponentImpl> getComponentMap();
-
- @OneToMany
- public abstract List<UIComponent> getComponentList();
+ @OneToMany
+ public abstract Map<String, UIComponentImpl> getComponentMap();
- public ObjectType<? extends UIContainer> getObjectType() {
- return ObjectType.CONTAINER;
- }
+ @OneToMany
+ public abstract List<UIComponent> getComponentList();
- public UIComponent get(String componentName) {
- Map<String, UIComponentImpl> children = getComponentMap();
- return children.get(componentName);
- }
+ public ObjectType<? extends UIContainer> getObjectType()
+ {
+ return ObjectType.CONTAINER;
+ }
- public <T extends UIComponent> T add(ObjectType<T> componentType, String name) {
- UIComponentImpl child;
- if (componentType == ObjectType.WINDOW) {
- child = createWindow();
- } else if (componentType == ObjectType.CONTAINER) {
- child = createContainer();
- } else if (componentType == ObjectType.BODY) {
- child = createInsertion();
- } else {
- throw new UnsupportedOperationException();
- }
- Map<String, UIComponentImpl> children = getComponentMap();
- children.put(name, child);
- return componentType.cast(child);
- }
+ public UIComponent get(String componentName)
+ {
+ Map<String, UIComponentImpl> children = getComponentMap();
+ return children.get(componentName);
+ }
- public <T extends UIComponent> T add(int index, ObjectType<T> componentType, String name) {
- UIComponentImpl child;
- if (componentType == ObjectType.WINDOW) {
- child = createWindow();
- } else if (componentType == ObjectType.CONTAINER) {
- child = createContainer();
- } else if (componentType == ObjectType.BODY) {
- child = createInsertion();
- } else {
- throw new UnsupportedOperationException();
- }
- child.setName(name);
- List<UIComponent> children = getComponentList();
- children.add(index, child);
- return componentType.cast(child);
- }
+ public <T extends UIComponent> T add(ObjectType<T> componentType, String name)
+ {
+ UIComponentImpl child;
+ if (componentType == ObjectType.WINDOW)
+ {
+ child = createWindow();
+ }
+ else if (componentType == ObjectType.CONTAINER)
+ {
+ child = createContainer();
+ }
+ else if (componentType == ObjectType.BODY)
+ {
+ child = createInsertion();
+ }
+ else
+ {
+ throw new UnsupportedOperationException();
+ }
+ Map<String, UIComponentImpl> children = getComponentMap();
+ children.put(name, child);
+ return componentType.cast(child);
+ }
- // List<UIComponent> implementation **********************************************************************************
+ public <T extends UIComponent> T add(int index, ObjectType<T> componentType, String name)
+ {
+ UIComponentImpl child;
+ if (componentType == ObjectType.WINDOW)
+ {
+ child = createWindow();
+ }
+ else if (componentType == ObjectType.CONTAINER)
+ {
+ child = createContainer();
+ }
+ else if (componentType == ObjectType.BODY)
+ {
+ child = createInsertion();
+ }
+ else
+ {
+ throw new UnsupportedOperationException();
+ }
+ child.setName(name);
+ List<UIComponent> children = getComponentList();
+ children.add(index, child);
+ return componentType.cast(child);
+ }
- public int size() {
- return getComponentList().size();
- }
+ // List<UIComponent> implementation **********************************************************************************
- public boolean isEmpty() {
- return getComponentList().isEmpty();
- }
+ public int size()
+ {
+ return getComponentList().size();
+ }
- public boolean contains(Object o) {
- return getComponentList().contains(o);
- }
+ public boolean isEmpty()
+ {
+ return getComponentList().isEmpty();
+ }
- public Iterator<UIComponent> iterator() {
- return getComponentList().iterator();
- }
+ public boolean contains(Object o)
+ {
+ return getComponentList().contains(o);
+ }
- public Object[] toArray() {
- return new Object[0];
- }
+ public Iterator<UIComponent> iterator()
+ {
+ return getComponentList().iterator();
+ }
- public <T> T[] toArray(T[] a) {
- return getComponentList().toArray(a);
- }
+ public Object[] toArray()
+ {
+ return new Object[0];
+ }
- public boolean add(UIComponent uiComponent) {
- return getComponentList().add(uiComponent);
- }
+ public <T> T[] toArray(T[] a)
+ {
+ return getComponentList().toArray(a);
+ }
- public boolean remove(Object o) {
- return getComponentList().remove(o);
- }
+ public boolean add(UIComponent uiComponent)
+ {
+ return getComponentList().add(uiComponent);
+ }
- public boolean containsAll(Collection<?> c) {
- return getComponentList().containsAll(c);
- }
+ public boolean remove(Object o)
+ {
+ return getComponentList().remove(o);
+ }
- public boolean addAll(Collection<? extends UIComponent> c) {
- return getComponentList().addAll(c);
- }
+ public boolean containsAll(Collection<?> c)
+ {
+ return getComponentList().containsAll(c);
+ }
- public boolean addAll(int index, Collection<? extends UIComponent> c) {
- return getComponentList().addAll(index, c);
- }
+ public boolean addAll(Collection<? extends UIComponent> c)
+ {
+ return getComponentList().addAll(c);
+ }
- public boolean removeAll(Collection<?> c) {
- return getComponentList().removeAll(c);
- }
+ public boolean addAll(int index, Collection<? extends UIComponent> c)
+ {
+ return getComponentList().addAll(index, c);
+ }
- public boolean retainAll(Collection<?> c) {
- return getComponentList().retainAll(c);
- }
+ public boolean removeAll(Collection<?> c)
+ {
+ return getComponentList().removeAll(c);
+ }
- public void clear() {
- getComponentList().clear();
- }
+ public boolean retainAll(Collection<?> c)
+ {
+ return getComponentList().retainAll(c);
+ }
- public UIComponent get(int index) {
- return getComponentList().get(index);
- }
+ public void clear()
+ {
+ getComponentList().clear();
+ }
- public UIComponent set(int index, UIComponent element) {
- return getComponentList().set(index, element);
- }
+ public UIComponent get(int index)
+ {
+ return getComponentList().get(index);
+ }
- public void add(int index, UIComponent element) {
- getComponentList().add(index, element);
- }
+ public UIComponent set(int index, UIComponent element)
+ {
+ return getComponentList().set(index, element);
+ }
- public UIComponent remove(int index) {
- return getComponentList().remove(index);
- }
+ public void add(int index, UIComponent element)
+ {
+ getComponentList().add(index, element);
+ }
- public int indexOf(Object o) {
- return getComponentList().indexOf(o);
- }
+ public UIComponent remove(int index)
+ {
+ return getComponentList().remove(index);
+ }
- public int lastIndexOf(Object o) {
- return getComponentList().lastIndexOf(o);
- }
+ public int indexOf(Object o)
+ {
+ return getComponentList().indexOf(o);
+ }
- public ListIterator<UIComponent> listIterator() {
- return getComponentList().listIterator();
- }
+ public int lastIndexOf(Object o)
+ {
+ return getComponentList().lastIndexOf(o);
+ }
- public ListIterator<UIComponent> listIterator(int index) {
- return getComponentList().listIterator(index);
- }
+ public ListIterator<UIComponent> listIterator()
+ {
+ return getComponentList().listIterator();
+ }
- public List<UIComponent> subList(int fromIndex, int toIndex) {
- return getComponentList().subList(fromIndex, toIndex);
- }
+ public ListIterator<UIComponent> listIterator(int index)
+ {
+ return getComponentList().listIterator(index);
+ }
+
+ public List<UIComponent> subList(int fromIndex, int toIndex)
+ {
+ return getComponentList().subList(fromIndex, toIndex);
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIWindowImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIWindowImpl.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UIWindowImpl.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -37,82 +37,96 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:uiwindow")
-public abstract class UIWindowImpl extends UIComponentImpl implements UIWindow, CustomizationContext {
+public abstract class UIWindowImpl extends UIComponentImpl implements UIWindow, CustomizationContext
+{
- public ObjectType<? extends UIWindow> getObjectType() {
- return ObjectType.WINDOW;
- }
+ public ObjectType<? extends UIWindow> getObjectType()
+ {
+ return ObjectType.WINDOW;
+ }
- // Abstract **********************************************************************************************************
+ // Abstract **********************************************************************************************************
- @OneToOne
- @MappedBy("customization")
- public abstract WorkspaceCustomization getCustomization();
+ @OneToOne
+ @MappedBy("customization")
+ public abstract WorkspaceCustomization getCustomization();
- public abstract void setCustomization(WorkspaceCustomization customization);
+ public abstract void setCustomization(WorkspaceCustomization customization);
- @Create
- public abstract WorkspaceClone create();
+ @Create
+ public abstract WorkspaceClone create();
- @Create
- public abstract WorkspaceSpecialization create2();
+ @Create
+ public abstract WorkspaceSpecialization create2();
- // UIWindow implementation *******************************************************************************************
+ // UIWindow implementation *******************************************************************************************
- public <S> Customization<S> customize(ContentType<S> contentType, String contentId, S state) {
- if (getCustomization() != null) {
- throw new IllegalStateException("Already customized");
- }
- WorkspaceClone customization = create();
- setCustomization(customization);
- customization.setMimeType(contentType.getMimeType());
- customization.setContentId(contentId);
- customization.setState(state);
- return (Customization<S>)customization;
- }
+ public <S> Customization<S> customize(ContentType<S> contentType, String contentId, S state)
+ {
+ if (getCustomization() != null)
+ {
+ throw new IllegalStateException("Already customized");
+ }
+ WorkspaceClone customization = create();
+ setCustomization(customization);
+ customization.setMimeType(contentType.getMimeType());
+ customization.setContentId(contentId);
+ customization.setState(state);
+ return (Customization<S>)customization;
+ }
- public <S> Customization<S> customize(Customization<S> customization) {
- if (customization == null) {
- throw new NullPointerException();
- } else if (customization instanceof WorkspaceCustomization) {
- if (getCustomization() != null) {
- throw new IllegalStateException("Already customized");
+ public <S> Customization<S> customize(Customization<S> customization)
+ {
+ if (customization == null)
+ {
+ throw new NullPointerException();
}
+ else if (customization instanceof WorkspaceCustomization)
+ {
+ if (getCustomization() != null)
+ {
+ throw new IllegalStateException("Already customized");
+ }
- // Get parent customization
- WorkspaceCustomization parentCustomization = (WorkspaceCustomization)customization;
+ // Get parent customization
+ WorkspaceCustomization parentCustomization = (WorkspaceCustomization)customization;
- // Create
- WorkspaceSpecialization specialization = create2();
+ // Create
+ WorkspaceSpecialization specialization = create2();
- // Persist
- setCustomization(specialization);
+ // Persist
+ setCustomization(specialization);
- // Configuration
- specialization.setMimeType(parentCustomization.getMimeType());
- specialization.setContentId(parentCustomization.getContentId());
+ // Configuration
+ specialization.setMimeType(parentCustomization.getMimeType());
+ specialization.setContentId(parentCustomization.getContentId());
- // Create relationship
- specialization.setCustomization(parentCustomization);
+ // Create relationship
+ specialization.setCustomization(parentCustomization);
- //
- return (Customization<S>)specialization;
- } else {
- throw new IllegalArgumentException("implement customization of "+ customization);
- }
- }
+ //
+ return (Customization<S>)specialization;
+ }
+ else
+ {
+ throw new IllegalArgumentException("implement customization of " + customization);
+ }
+ }
- // WorkspaceCustomizationContext implementation **********************************************************************
+ // WorkspaceCustomizationContext implementation **********************************************************************
- public String getContextType() {
- return WorkspaceCustomizationContext.TYPE;
- }
+ public String getContextType()
+ {
+ return WorkspaceCustomizationContext.TYPE;
+ }
- public String getContextId() {
- return getObjectId();
- }
+ public String getContextId()
+ {
+ return getObjectId();
+ }
- public boolean contains(CustomizationContext that) {
- return contains(this, that);
- }
+ public boolean contains(CustomizationContext that)
+ {
+ return contains(this, that);
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/URLLinkImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/URLLinkImpl.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/URLLinkImpl.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -28,14 +28,16 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:urllink")
-public abstract class URLLinkImpl extends LinkImpl implements URLLink {
+public abstract class URLLinkImpl extends LinkImpl implements URLLink
+{
- @Property(name = "url")
- public abstract String getURL();
+ @Property(name = "url")
+ public abstract String getURL();
- public abstract void setURL(String url);
+ public abstract void setURL(String url);
- public ObjectType<? extends URLLink> getObjectType() {
- return ObjectType.URL_LINK;
- }
+ public ObjectType<? extends URLLink> getObjectType()
+ {
+ return ObjectType.URL_LINK;
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UserSite.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UserSite.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UserSite.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -28,11 +28,13 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:usersite")
-public abstract class UserSite extends SiteImpl {
+public abstract class UserSite extends SiteImpl
+{
- // Site implementation ***********************************************************************************************
+ // Site implementation ***********************************************************************************************
- public ObjectType<? extends Site> getObjectType() {
- return ObjectType.USER_SITE;
- }
+ public ObjectType<? extends Site> getObjectType()
+ {
+ return ObjectType.USER_SITE;
+ }
}
\ No newline at end of file
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UserSiteContainer.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UserSiteContainer.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/UserSiteContainer.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -26,9 +26,10 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:usersites")
-public abstract class UserSiteContainer extends SiteContainer<UserSite> {
+public abstract class UserSiteContainer extends SiteContainer<UserSite>
+{
- @RelatedMappedBy("usersites")
- public abstract WorkspaceImpl getWorkspace();
+ @RelatedMappedBy("usersites")
+ public abstract WorkspaceImpl getWorkspace();
}
\ No newline at end of file
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceImpl.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceImpl.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -39,106 +39,130 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:workspace")
-public abstract class WorkspaceImpl extends WorkspaceObjectImpl implements Workspace, WorkspaceCustomizationContext {
+public abstract class WorkspaceImpl extends WorkspaceObjectImpl implements Workspace, WorkspaceCustomizationContext
+{
- public ObjectType<? extends Workspace> getObjectType() {
- return ObjectType.WORKSPACE;
- }
+ public ObjectType<? extends Workspace> getObjectType()
+ {
+ return ObjectType.WORKSPACE;
+ }
- // Abstract **********************************************************************************************************
+ // Abstract **********************************************************************************************************
- @OneToOne
- @MappedBy("portalsites")
- public abstract PortalSiteContainer getPortalSites();
+ @OneToOne
+ @MappedBy("portalsites")
+ public abstract PortalSiteContainer getPortalSites();
- @OneToOne
- @MappedBy("groupsites")
- public abstract GroupSiteContainer getGroupSites();
+ @OneToOne
+ @MappedBy("groupsites")
+ public abstract GroupSiteContainer getGroupSites();
- @OneToOne
- @MappedBy("usersites")
- public abstract UserSiteContainer getUserSites();
+ @OneToOne
+ @MappedBy("usersites")
+ public abstract UserSiteContainer getUserSites();
- @OneToOne
- @MappedBy("sharedsites")
- public abstract UserSiteContainer getSharedSites();
+ @OneToOne
+ @MappedBy("sharedsites")
+ public abstract UserSiteContainer getSharedSites();
- @OneToOne
- @MappedBy("customizations")
- public abstract CustomizationContainer getCustomizations();
+ @OneToOne
+ @MappedBy("customizations")
+ public abstract CustomizationContainer getCustomizations();
- // CustomizationContextResolver implementation ***********************************************************************
+ // CustomizationContextResolver implementation ***********************************************************************
- @FindById
- public abstract CustomizationContext resolveContext(String contextId);
+ @FindById
+ public abstract CustomizationContext resolveContext(String contextId);
- // WorkspaceCustomizationContext implementation **********************************************************************
+ // WorkspaceCustomizationContext implementation **********************************************************************
- public String getContextType() {
- return WorkspaceCustomizationContext.TYPE;
- }
+ public String getContextType()
+ {
+ return WorkspaceCustomizationContext.TYPE;
+ }
- public String getContextId() {
- return getObjectId();
- }
+ public String getContextId()
+ {
+ return getObjectId();
+ }
- public boolean contains(CustomizationContext that) {
- return contains(this, that);
- }
+ public boolean contains(CustomizationContext that)
+ {
+ return contains(this, that);
+ }
- public Customization<?> getCustomization(String name) {
- return getCustomizations().getCustomization(name);
- }
+ public Customization<?> getCustomization(String name)
+ {
+ return getCustomizations().getCustomization(name);
+ }
- public <S> Customization<S> customize(String name, ContentType<S> contentType, String contentId, S state) {
- return getCustomizations().customize(name, contentType, contentId, state);
- }
+ public <S> Customization<S> customize(String name, ContentType<S> contentType, String contentId, S state)
+ {
+ return getCustomizations().customize(name, contentType, contentId, state);
+ }
- public <S> Customization<S> customize(String name, Customization<S> customization) {
- return getCustomizations().customize(name, customization);
- }
+ public <S> Customization<S> customize(String name, Customization<S> customization)
+ {
+ return getCustomizations().customize(name, customization);
+ }
- public String nameOf(Customization customization) {
- return getCustomizations().nameOf(customization);
- }
+ public String nameOf(Customization customization)
+ {
+ return getCustomizations().nameOf(customization);
+ }
- // Workspace implementation ******************************************************************************************
+ // Workspace implementation ******************************************************************************************
- @SuppressWarnings("unchecked")
- private <S extends Site> SiteContainer<S> getSiteContainer(ObjectType<S> siteType) {
- if (siteType == ObjectType.PORTAL_SITE) {
- return (SiteContainer<S>)getPortalSites();
- } else if (siteType == ObjectType.GROUP_SITE) {
- return (SiteContainer<S>)getGroupSites();
- } else if (siteType == ObjectType.USER_SITE) {
- return (SiteContainer<S>)getUserSites();
- } else if (siteType == ObjectType.SHARED_SITE) {
- return (SiteContainer<S>)getSharedSites();
- } else {
- throw new UnsupportedOperationException();
- }
- }
+ @SuppressWarnings("unchecked")
+ private <S extends Site> SiteContainer<S> getSiteContainer(ObjectType<S> siteType)
+ {
+ if (siteType == ObjectType.PORTAL_SITE)
+ {
+ return (SiteContainer<S>)getPortalSites();
+ }
+ else if (siteType == ObjectType.GROUP_SITE)
+ {
+ return (SiteContainer<S>)getGroupSites();
+ }
+ else if (siteType == ObjectType.USER_SITE)
+ {
+ return (SiteContainer<S>)getUserSites();
+ }
+ else if (siteType == ObjectType.SHARED_SITE)
+ {
+ return (SiteContainer<S>)getSharedSites();
+ }
+ else
+ {
+ throw new UnsupportedOperationException();
+ }
+ }
- public <S extends Site> S getSite(ObjectType<S> siteType, String siteName) {
- SiteContainer<S> sites = getSiteContainer(siteType);
- return sites.getSite(siteName);
- }
+ public <S extends Site> S getSite(ObjectType<S> siteType, String siteName)
+ {
+ SiteContainer<S> sites = getSiteContainer(siteType);
+ return sites.getSite(siteName);
+ }
- public Collection<Site> getSites() {
- throw new UnsupportedOperationException();
- }
+ public Collection<Site> getSites()
+ {
+ throw new UnsupportedOperationException();
+ }
- public <S extends Site> Collection<S> getSites(ObjectType<S> siteType) {
- SiteContainer<S> sites = getSiteContainer(siteType);
- return sites.getAllSites();
- }
+ public <S extends Site> Collection<S> getSites(ObjectType<S> siteType)
+ {
+ SiteContainer<S> sites = getSiteContainer(siteType);
+ return sites.getAllSites();
+ }
- public <S extends Site> S addSite(ObjectType<S> siteType, String name) {
- SiteContainer<S> sites = getSiteContainer(siteType);
- return sites.addSite(name);
- }
+ public <S extends Site> S addSite(ObjectType<S> siteType, String name)
+ {
+ SiteContainer<S> sites = getSiteContainer(siteType);
+ return sites.addSite(name);
+ }
- public Site getSharedSite() {
- return getSite(ObjectType.SHARED_SITE, "default");
- }
+ public Site getSharedSite()
+ {
+ return getSite(ObjectType.SHARED_SITE, "default");
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/WorkspaceObjectImpl.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -37,118 +37,152 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class WorkspaceObjectImpl implements WorkspaceObject {
+public abstract class WorkspaceObjectImpl implements WorkspaceObject
+{
- /** . */
- private final Set<String> keys = new AbstractSet<String>() {
- @Override
- public Iterator<String> iterator() {
- Map<String, Object> properties = getProperties();
- return new AbstractFilterIterator<String, String>(properties.keySet().iterator()) {
- protected String adapt(String internal) {
- if (internal.startsWith("mop:")) {
- return internal.substring(4);
- } else {
- return null;
- }
- }
- };
- }
- public int size() {
- Map<String, Object> properties = getProperties();
- int count = 0;
- for (String key : properties.keySet()) {
- if (key.startsWith("mop:")) {
- count++;
- }
+ /** . */
+ private final Set<String> keys = new AbstractSet<String>()
+ {
+ @Override
+ public Iterator<String> iterator()
+ {
+ Map<String, Object> properties = getProperties();
+ return new AbstractFilterIterator<String, String>(properties.keySet().iterator())
+ {
+ protected String adapt(String internal)
+ {
+ if (internal.startsWith("mop:"))
+ {
+ return internal.substring(4);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ };
}
- return count;
- }
- };
- /** . */
- private final AbstractAttributes attributes = new AbstractAttributes() {
- @Override
- protected Object get(String name) {
- Map<String, Object> properties = getProperties();
- return properties.get("mop:" + name);
- }
+ public int size()
+ {
+ Map<String, Object> properties = getProperties();
+ int count = 0;
+ for (String key : properties.keySet())
+ {
+ if (key.startsWith("mop:"))
+ {
+ count++;
+ }
+ }
+ return count;
+ }
+ };
- @Override
- protected void set(String name, Object o) {
- Map<String, Object> properties = getProperties();
- properties.put("mop:" + name, o);
- }
+ /** . */
+ private final AbstractAttributes attributes = new AbstractAttributes()
+ {
+ @Override
+ protected Object get(String name)
+ {
+ Map<String, Object> properties = getProperties();
+ return properties.get("mop:" + name);
+ }
- public Set<String> getKeys() {
- return keys;
- }
- };
+ @Override
+ protected void set(String name, Object o)
+ {
+ Map<String, Object> properties = getProperties();
+ properties.put("mop:" + name, o);
+ }
- public Attributes getAttributes() {
- return attributes;
- }
+ public Set<String> getKeys()
+ {
+ return keys;
+ }
+ };
- @Name
- public abstract String getName();
+ public Attributes getAttributes()
+ {
+ return attributes;
+ }
- public abstract void setName(String name);
+ @Name
+ public abstract String getName();
- @Id
- public abstract String getObjectId();
+ public abstract void setName(String name);
- @Properties
- public abstract Map<String, Object> getProperties();
+ @Id
+ public abstract String getObjectId();
- @Override
- public String toString() {
- ObjectType<?> objectType = getObjectType();
- Class<? extends WorkspaceObject> javaType = objectType.getJavaType();
- String typeName = javaType.getSimpleName();
- String name = getName();
- String id = getObjectId();
- return typeName + "[name=" + name + ",id=" + id + "]";
- }
+ @Properties
+ public abstract Map<String, Object> getProperties();
- static boolean contains(CustomizationContext container, CustomizationContext contained) {
- if (container == null) {
- throw new NullPointerException("No null container accepted");
- }
- if (contained == null) {
- throw new NullPointerException("No null contained accepted");
- }
+ @Override
+ public String toString()
+ {
+ ObjectType<?> objectType = getObjectType();
+ Class<? extends WorkspaceObject> javaType = objectType.getJavaType();
+ String typeName = javaType.getSimpleName();
+ String name = getName();
+ String id = getObjectId();
+ return typeName + "[name=" + name + ",id=" + id + "]";
+ }
- //
- if (container == contained) {
- return true;
- }
- if (container instanceof WorkspaceImpl) {
- if (contained instanceof SiteImpl) {
- SiteImpl site = (SiteImpl)contained;
- return contains(container, site.getWorkspace());
- } else if (contained instanceof PageImpl) {
- PageImpl page = (PageImpl)contained;
- return contains(container, page.getSite());
- } else if (contained instanceof UIWindowImpl) {
- UIWindowImpl window = (UIWindowImpl)contained;
- return contains(container, window.getPage());
+ static boolean contains(CustomizationContext container, CustomizationContext contained)
+ {
+ if (container == null)
+ {
+ throw new NullPointerException("No null container accepted");
}
- }
- if (container instanceof SiteImpl) {
- if (contained instanceof PageImpl) {
- PageImpl page = (PageImpl)contained;
- return contains(container, page.getSite());
- } else if (contained instanceof UIWindowImpl) {
- UIWindowImpl window = (UIWindowImpl)contained;
- return contains(container, window.getPage());
+ if (contained == null)
+ {
+ throw new NullPointerException("No null contained accepted");
}
- }
- if (container instanceof PageImpl) {
- if (contained instanceof UIWindowImpl) {
- UIWindowImpl window = (UIWindowImpl)contained;
- return contains(container, window.getPage());
+
+ //
+ if (container == contained)
+ {
+ return true;
}
- }
- return false;
- }
+ if (container instanceof WorkspaceImpl)
+ {
+ if (contained instanceof SiteImpl)
+ {
+ SiteImpl site = (SiteImpl)contained;
+ return contains(container, site.getWorkspace());
+ }
+ else if (contained instanceof PageImpl)
+ {
+ PageImpl page = (PageImpl)contained;
+ return contains(container, page.getSite());
+ }
+ else if (contained instanceof UIWindowImpl)
+ {
+ UIWindowImpl window = (UIWindowImpl)contained;
+ return contains(container, window.getPage());
+ }
+ }
+ if (container instanceof SiteImpl)
+ {
+ if (contained instanceof PageImpl)
+ {
+ PageImpl page = (PageImpl)contained;
+ return contains(container, page.getSite());
+ }
+ else if (contained instanceof UIWindowImpl)
+ {
+ UIWindowImpl window = (UIWindowImpl)contained;
+ return contains(container, window.getPage());
+ }
+ }
+ if (container instanceof PageImpl)
+ {
+ if (contained instanceof UIWindowImpl)
+ {
+ UIWindowImpl window = (UIWindowImpl)contained;
+ return contains(container, window.getPage());
+ }
+ }
+ return false;
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomization.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomization.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/AbstractCustomization.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -44,181 +44,212 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class AbstractCustomization implements Customization<Object>, StateContainer {
+public abstract class AbstractCustomization implements Customization<Object>, StateContainer
+{
- /** . */
- protected static final CustomizationContextComparator comparator;
+ /** . */
+ protected static final CustomizationContextComparator comparator;
- static {
- CustomizationContextComparator _comparator = new CustomizationContextComparator(
- WorkspaceCustomizationContext.TYPE
- );
+ static
+ {
+ CustomizationContextComparator _comparator = new CustomizationContextComparator(
+ WorkspaceCustomizationContext.TYPE
+ );
- //
- comparator = _comparator;
- }
+ //
+ comparator = _comparator;
+ }
- /** . */
- public ContentManagerRegistry registry;
+ /** . */
+ public ContentManagerRegistry registry;
- /** . */
- public ChromatticSession session;
+ /** . */
+ public ChromatticSession session;
- @Id
- public abstract String getId();
+ @Id
+ public abstract String getId();
- @OneToOne
- @MappedBy("contexttypes")
- abstract ContextTypeContainer getContextTypes();
+ @OneToOne
+ @MappedBy("contexttypes")
+ abstract ContextTypeContainer getContextTypes();
- @Create
- abstract ContextType create();
+ @Create
+ abstract ContextType create();
- @Create
- abstract ContextSpecialization createContextSpecialization();
+ @Create
+ abstract ContextSpecialization createContextSpecialization();
- public abstract CustomizationContext getContext();
+ public abstract CustomizationContext getContext();
- public abstract AbstractCustomization getParent();
+ public abstract AbstractCustomization getParent();
- public Object getVirtualState() {
+ public Object getVirtualState()
+ {
- ContentType contentType = getType();
+ ContentType contentType = getType();
- String mimeType = contentType.getMimeType();
+ String mimeType = contentType.getMimeType();
- ContentProvider contentProvider = registry.providers.get(mimeType).getProvider();
+ ContentProvider contentProvider = registry.providers.get(mimeType).getProvider();
- //
- Object childPayload = contentProvider.getState(this);
+ //
+ Object childPayload = contentProvider.getState(this);
- //
- Object parentPayload = null;
- AbstractCustomization parent = getParent();
- if (parent != null) {
- parentPayload = parent.getVirtualState();
- }
+ //
+ Object parentPayload = null;
+ AbstractCustomization parent = getParent();
+ if (parent != null)
+ {
+ parentPayload = parent.getVirtualState();
+ }
- //
- if (parentPayload != null) {
- if (childPayload != null) {
- return contentProvider.combine(Arrays.asList(parentPayload, childPayload));
- } else {
- return parentPayload;
+ //
+ if (parentPayload != null)
+ {
+ if (childPayload != null)
+ {
+ return contentProvider.combine(Arrays.asList(parentPayload, childPayload));
+ }
+ else
+ {
+ return parentPayload;
+ }
}
- } else {
- return childPayload;
- }
- }
+ else
+ {
+ return childPayload;
+ }
+ }
- public Object getState() {
- ContentType contentType = getType();
- String mimeType = contentType.getMimeType();
- ContentProvider contentProvider = registry.providers.get(mimeType).getProvider();
- return contentProvider.getState(this);
- }
+ public Object getState()
+ {
+ ContentType contentType = getType();
+ String mimeType = contentType.getMimeType();
+ ContentProvider contentProvider = registry.providers.get(mimeType).getProvider();
+ return contentProvider.getState(this);
+ }
- public void setState(Object state) {
- ContentType contentType = getType();
- String mimeType = contentType.getMimeType();
- ContentProvider contentProvider = registry.providers.get(mimeType).getProvider();
- contentProvider.setState(this, state);
- }
+ public void setState(Object state)
+ {
+ ContentType contentType = getType();
+ String mimeType = contentType.getMimeType();
+ ContentProvider contentProvider = registry.providers.get(mimeType).getProvider();
+ contentProvider.setState(this, state);
+ }
- public Customization<Object> getCustomization(Set<CustomizationContext> contexts) {
- return get(contexts, false);
- }
+ public Customization<Object> getCustomization(Set<CustomizationContext> contexts)
+ {
+ return get(contexts, false);
+ }
- public Customization<Object> customize(Collection<CustomizationContext> contexts) {
- if (contexts == null) {
- throw new NullPointerException();
- }
- return get(contexts, true);
- }
-
- public Set<CustomizationContext> getContexts() {
- //
- AbstractCustomization current = this;
- LinkedHashSet<CustomizationContext> contexts = new LinkedHashSet<CustomizationContext>();
-
- //
- while (true) {
- CustomizationContext currentContext = current.getContext();
- if (currentContext == null) {
- throw new IllegalStateException("Could not resolve customization context for customization " + this);
+ public Customization<Object> customize(Collection<CustomizationContext> contexts)
+ {
+ if (contexts == null)
+ {
+ throw new NullPointerException();
}
+ return get(contexts, true);
+ }
+ public Set<CustomizationContext> getContexts()
+ {
//
- contexts.add(currentContext);
+ AbstractCustomization current = this;
+ LinkedHashSet<CustomizationContext> contexts = new LinkedHashSet<CustomizationContext>();
//
- AbstractCustomization parent = current.getParent();
- if (parent != null) {
- current = parent;
- } else {
- break;
- }
- }
+ while (true)
+ {
+ CustomizationContext currentContext = current.getContext();
+ if (currentContext == null)
+ {
+ throw new IllegalStateException("Could not resolve customization context for customization " + this);
+ }
- //
- return contexts;
- }
+ //
+ contexts.add(currentContext);
- //
+ //
+ AbstractCustomization parent = current.getParent();
+ if (parent != null)
+ {
+ current = parent;
+ }
+ else
+ {
+ break;
+ }
+ }
- protected final Customization<Object> get(Collection<CustomizationContext> contexts, boolean create) {
+ //
+ return contexts;
+ }
- // The sorted contexts
- TreeSet<CustomizationContext> sortedContexts = new TreeSet<CustomizationContext>(comparator);
+ //
- // Contexts up to this node
- Set<CustomizationContext> existingContexts = getContexts();
+ protected final Customization<Object> get(Collection<CustomizationContext> contexts, boolean create)
+ {
- // Add all existing contexts
- sortedContexts.addAll(existingContexts);
+ // The sorted contexts
+ TreeSet<CustomizationContext> sortedContexts = new TreeSet<CustomizationContext>(comparator);
- // Sort everything and check consistency
- sortedContexts.addAll(contexts);
+ // Contexts up to this node
+ Set<CustomizationContext> existingContexts = getContexts();
- // Remove existing contexts
- sortedContexts.removeAll(existingContexts);
+ // Add all existing contexts
+ sortedContexts.addAll(existingContexts);
- //
- return get(sortedContexts.iterator(), create);
- }
+ // Sort everything and check consistency
+ sortedContexts.addAll(contexts);
- protected final Customization<Object> get(Iterator<CustomizationContext> contexts, boolean create) {
- if (contexts.hasNext()) {
- CustomizationContext context = contexts.next();
- String type = context.getContextType();
- ContextTypeContainer typeContainer = getContextTypes();
- Map<String, ContextType> contextTypes = typeContainer.getContextTypes();
- ContextType tmp = contextTypes.get(type);
- if (tmp == null) {
- if (create) {
- tmp = create();
- contextTypes.put(type, tmp);
- } else {
- return null;
- }
- }
- Map<String, ContextSpecialization> c = tmp.getSpecializations();
- String id = context.getContextId();
- ContextSpecialization blah = c.get(id);
+ // Remove existing contexts
+ sortedContexts.removeAll(existingContexts);
//
- if (blah != null || !create) {
- return blah;
- }
+ return get(sortedContexts.iterator(), create);
+ }
- //
- blah = createContextSpecialization();
- c.put(id, blah);
+ protected final Customization<Object> get(Iterator<CustomizationContext> contexts, boolean create)
+ {
+ if (contexts.hasNext())
+ {
+ CustomizationContext context = contexts.next();
+ String type = context.getContextType();
+ ContextTypeContainer typeContainer = getContextTypes();
+ Map<String, ContextType> contextTypes = typeContainer.getContextTypes();
+ ContextType tmp = contextTypes.get(type);
+ if (tmp == null)
+ {
+ if (create)
+ {
+ tmp = create();
+ contextTypes.put(type, tmp);
+ }
+ else
+ {
+ return null;
+ }
+ }
+ Map<String, ContextSpecialization> c = tmp.getSpecializations();
+ String id = context.getContextId();
+ ContextSpecialization blah = c.get(id);
- //
- return blah.get(contexts, create);
- } else {
- return this;
- }
- }
+ //
+ if (blah != null || !create)
+ {
+ return blah;
+ }
+
+ //
+ blah = createContextSpecialization();
+ c.put(id, blah);
+
+ //
+ return blah.get(contexts, create);
+ }
+ else
+ {
+ return this;
+ }
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContentState.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContentState.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContentState.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -22,10 +22,11 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class ContentState {
+public abstract class ContentState
+{
- public abstract Object getPayload();
+ public abstract Object getPayload();
- public abstract void setPayload(Object payload);
+ public abstract void setPayload(Object payload);
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextSpecialization.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextSpecialization.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextSpecialization.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -30,45 +30,53 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:contextspecialization")
-public abstract class ContextSpecialization extends AbstractCustomization {
+public abstract class ContextSpecialization extends AbstractCustomization
+{
- /** . */
- private CustomizationContextResolver customizationContextResolver;
+ /** . */
+ private CustomizationContextResolver customizationContextResolver;
- public CustomizationContextResolver getCustomizationContextResolver() {
- return customizationContextResolver;
- }
+ public CustomizationContextResolver getCustomizationContextResolver()
+ {
+ return customizationContextResolver;
+ }
- public void setCustomizationContextResolver(CustomizationContextResolver customizationContextResolver) {
- this.customizationContextResolver = customizationContextResolver;
- }
+ public void setCustomizationContextResolver(CustomizationContextResolver customizationContextResolver)
+ {
+ this.customizationContextResolver = customizationContextResolver;
+ }
- @Name
- public abstract String getContextId();
+ @Name
+ public abstract String getContextId();
- @ManyToOne
- public abstract ContextType getContextType();
+ @ManyToOne
+ public abstract ContextType getContextType();
- public ContentType<Object> getType() {
- throw new UnsupportedOperationException();
- }
+ public ContentType<Object> getType()
+ {
+ throw new UnsupportedOperationException();
+ }
- public CustomizationContext getContext() {
- ContextType currentContextType = getContextType();
- String contextType = currentContextType.getName();
- return customizationContextResolver.resolve(contextType, getContextId());
- }
+ public CustomizationContext getContext()
+ {
+ ContextType currentContextType = getContextType();
+ String contextType = currentContextType.getName();
+ return customizationContextResolver.resolve(contextType, getContextId());
+ }
- public AbstractCustomization getParent() {
- ContextType contextType = getContextType();
- return contextType.getContainer().getCustomization();
- }
+ public AbstractCustomization getParent()
+ {
+ ContextType contextType = getContextType();
+ return contextType.getContainer().getCustomization();
+ }
- public String getContentId() {
- throw new UnsupportedOperationException();
- }
+ public String getContentId()
+ {
+ throw new UnsupportedOperationException();
+ }
- public void destroy() {
- throw new UnsupportedOperationException("todo");
- }
+ public void destroy()
+ {
+ throw new UnsupportedOperationException("todo");
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextType.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextType.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextType.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -30,15 +30,16 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:contexttype")
-public abstract class ContextType {
+public abstract class ContextType
+{
- @Name
- public abstract String getName();
+ @Name
+ public abstract String getName();
- @OneToMany
- public abstract Map<String, ContextSpecialization> getSpecializations();
+ @OneToMany
+ public abstract Map<String, ContextSpecialization> getSpecializations();
- @ManyToOne
- public abstract ContextTypeContainer getContainer();
+ @ManyToOne
+ public abstract ContextTypeContainer getContainer();
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextTypeContainer.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextTypeContainer.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/ContextTypeContainer.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -29,12 +29,13 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:contexttypecontainer")
-public abstract class ContextTypeContainer {
+public abstract class ContextTypeContainer
+{
- @OneToMany
- public abstract Map<String, ContextType> getContextTypes();
+ @OneToMany
+ public abstract Map<String, ContextType> getContextTypes();
- @ManyToOne
- public abstract AbstractCustomization getCustomization();
+ @ManyToOne
+ public abstract AbstractCustomization getCustomization();
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/CustomizationContainer.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/CustomizationContainer.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/CustomizationContainer.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -34,55 +34,62 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:customizationcontainer")
-public abstract class CustomizationContainer {
+public abstract class CustomizationContainer
+{
- @OneToOne
- @RelatedMappedBy("customizations")
- public abstract WorkspaceCustomizationContext getOwner();
+ @OneToOne
+ @RelatedMappedBy("customizations")
+ public abstract WorkspaceCustomizationContext getOwner();
- @OneToMany
- public abstract Map<String, WorkspaceCustomization> getCustomizations();
+ @OneToMany
+ public abstract Map<String, WorkspaceCustomization> getCustomizations();
- @Create
- public abstract WorkspaceClone createClone();
+ @Create
+ public abstract WorkspaceClone createClone();
- @Create
- public abstract WorkspaceSpecialization createSpecialization();
+ @Create
+ public abstract WorkspaceSpecialization createSpecialization();
- public Customization<?> getCustomization(String name) {
- Map<String, WorkspaceCustomization> customizations = getCustomizations();
- return customizations.get(name);
- }
+ public Customization<?> getCustomization(String name)
+ {
+ Map<String, WorkspaceCustomization> customizations = getCustomizations();
+ return customizations.get(name);
+ }
- public <S> Customization<S> customize(String name, ContentType<S> contentType, String contentId, S state) {
- Map<String, WorkspaceCustomization> contents = getCustomizations();
- WorkspaceClone content = createClone();
- contents.put(name, content);
- content.setContentId(contentId);
- content.setMimeType(contentType.getMimeType());
- content.setState(state);
- return (Customization<S>)content;
- }
+ public <S> Customization<S> customize(String name, ContentType<S> contentType, String contentId, S state)
+ {
+ Map<String, WorkspaceCustomization> contents = getCustomizations();
+ WorkspaceClone content = createClone();
+ contents.put(name, content);
+ content.setContentId(contentId);
+ content.setMimeType(contentType.getMimeType());
+ content.setState(state);
+ return (Customization<S>)content;
+ }
- public <S> Customization<S> customize(String name, Customization<S> customization) {
- Map<String, WorkspaceCustomization> contents = getCustomizations();
- WorkspaceCustomization workspaceCustomization = (WorkspaceCustomization)customization;
- WorkspaceSpecialization content = createSpecialization();
- contents.put(name, content);
- content.setMimeType(workspaceCustomization.getMimeType());
- content.setContentId(workspaceCustomization.getContentId());
- content.setCustomization(workspaceCustomization);
- return (Customization<S>)content;
- }
+ public <S> Customization<S> customize(String name, Customization<S> customization)
+ {
+ Map<String, WorkspaceCustomization> contents = getCustomizations();
+ WorkspaceCustomization workspaceCustomization = (WorkspaceCustomization)customization;
+ WorkspaceSpecialization content = createSpecialization();
+ contents.put(name, content);
+ content.setMimeType(workspaceCustomization.getMimeType());
+ content.setContentId(workspaceCustomization.getContentId());
+ content.setCustomization(workspaceCustomization);
+ return (Customization<S>)content;
+ }
- public String nameOf(Customization customization) {
- if (customization instanceof WorkspaceClone) {
- WorkspaceClone wc = (WorkspaceClone)customization;
- Map<String, WorkspaceCustomization> contents = getCustomizations();
- if (contents.containsValue(wc)) {
- return wc.getFooName();
+ public String nameOf(Customization customization)
+ {
+ if (customization instanceof WorkspaceClone)
+ {
+ WorkspaceClone wc = (WorkspaceClone)customization;
+ Map<String, WorkspaceCustomization> contents = getCustomizations();
+ if (contents.containsValue(wc))
+ {
+ return wc.getFooName();
+ }
}
- }
- return null;
- }
+ return null;
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/WorkspaceClone.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/WorkspaceClone.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/WorkspaceClone.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -37,49 +37,58 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:workspaceclone")
-public abstract class WorkspaceClone extends WorkspaceCustomization {
+public abstract class WorkspaceClone extends WorkspaceCustomization
+{
- public Set<CustomizationContext> getContexts() {
- return Collections.emptySet();
- }
+ public Set<CustomizationContext> getContexts()
+ {
+ return Collections.emptySet();
+ }
- @Name
- public abstract String getFooName();
+ @Name
+ public abstract String getFooName();
- @OneToMany(type = RelationshipType.PATH)
- @RelatedMappedBy("customization")
- public abstract Collection<WorkspaceSpecialization> getSpecializations();
+ @OneToMany(type = RelationshipType.PATH)
+ @RelatedMappedBy("customization")
+ public abstract Collection<WorkspaceSpecialization> getSpecializations();
- //
+ //
- public String getName() {
- CustomizationContext customizationContext = getContext();
- if (customizationContext instanceof WorkspaceCustomizationContext) {
- return getFooName();
- } else {
+ public String getName()
+ {
+ CustomizationContext customizationContext = getContext();
+ if (customizationContext instanceof WorkspaceCustomizationContext)
+ {
+ return getFooName();
+ }
+ else
+ {
+ return null;
+ }
+ }
+
+ public AbstractCustomization getParent()
+ {
return null;
- }
- }
+ }
- public AbstractCustomization getParent() {
- return null;
- }
+ public void destroy()
+ {
+ // Get specializations (clone for now because of bug with concurrent modif in chromattic)
+ Collection<WorkspaceSpecialization> specializations = new ArrayList<WorkspaceSpecialization>(getSpecializations());
- public void destroy() {
- // Get specializations (clone for now because of bug with concurrent modif in chromattic)
- Collection<WorkspaceSpecialization> specializations = new ArrayList<WorkspaceSpecialization>(getSpecializations());
+ //
+ for (WorkspaceSpecialization specialization : specializations)
+ {
+ // Update the specialization with its virtual state
+ Object state = specialization.getVirtualState();
+ specialization.setState(state);
- //
- for (WorkspaceSpecialization specialization : specializations) {
- // Update the specialization with its virtual state
- Object state = specialization.getVirtualState();
- specialization.setState(state);
+ // Clear ref
+ specialization.setCustomization(null);
+ }
- // Clear ref
- specialization.setCustomization(null);
- }
-
- //
- doDestroy();
- }
+ //
+ doDestroy();
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/WorkspaceCustomization.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/WorkspaceCustomization.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/WorkspaceCustomization.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -30,41 +30,52 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class WorkspaceCustomization extends AbstractCustomization {
+public abstract class WorkspaceCustomization extends AbstractCustomization
+{
- @Property(name = "mimetype")
- public abstract String getMimeType();
+ @Property(name = "mimetype")
+ public abstract String getMimeType();
- public abstract void setMimeType(String mimeType);
+ public abstract void setMimeType(String mimeType);
- @Property(name = "contentid")
- public abstract String getContentId();
+ @Property(name = "contentid")
+ public abstract String getContentId();
- public abstract void setContentId(String contentId);
+ public abstract void setContentId(String contentId);
- @ManyToOne
- public abstract Object getOwner();
+ @ManyToOne
+ public abstract Object getOwner();
- @Destroy
- public abstract void doDestroy();
+ @Destroy
+ public abstract void doDestroy();
- public final CustomizationContext getContext() {
- Object owner = getOwner();
- if (owner instanceof CustomizationContainer) {
- return ((CustomizationContainer)owner).getOwner();
- } else if (owner instanceof UIWindowImpl) {
- return (UIWindowImpl)owner;
- } else {
- throw new AssertionError();
- }
- }
+ public final CustomizationContext getContext()
+ {
+ Object owner = getOwner();
+ if (owner instanceof CustomizationContainer)
+ {
+ return ((CustomizationContainer)owner).getOwner();
+ }
+ else if (owner instanceof UIWindowImpl)
+ {
+ return (UIWindowImpl)owner;
+ }
+ else
+ {
+ throw new AssertionError();
+ }
+ }
- public final ContentType<Object> getType() {
- ContentRegistration registration = registry.providers.get(getMimeType());
- if (registration != null) {
- return (ContentType<Object>)registration.getContentType();
- } else {
- return null;
- }
- }
+ public final ContentType<Object> getType()
+ {
+ ContentRegistration registration = registry.providers.get(getMimeType());
+ if (registration != null)
+ {
+ return (ContentType<Object>)registration.getContentType();
+ }
+ else
+ {
+ return null;
+ }
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/WorkspaceSpecialization.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/WorkspaceSpecialization.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/content/WorkspaceSpecialization.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -28,19 +28,22 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:workspacespecialization")
-public abstract class WorkspaceSpecialization extends WorkspaceCustomization {
+public abstract class WorkspaceSpecialization extends WorkspaceCustomization
+{
- @ManyToOne(type = RelationshipType.PATH)
- @MappedBy("customization")
- public abstract WorkspaceCustomization getCustomization();
+ @ManyToOne(type = RelationshipType.PATH)
+ @MappedBy("customization")
+ public abstract WorkspaceCustomization getCustomization();
- public abstract void setCustomization(WorkspaceCustomization customization);
+ public abstract void setCustomization(WorkspaceCustomization customization);
- public void destroy() {
- doDestroy();
- }
+ public void destroy()
+ {
+ doDestroy();
+ }
- public AbstractCustomization getParent() {
- return getCustomization();
- }
+ public AbstractCustomization getParent()
+ {
+ return getCustomization();
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/spi/content/WorkspaceCustomizationPolicy.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/spi/content/WorkspaceCustomizationPolicy.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/spi/content/WorkspaceCustomizationPolicy.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -24,9 +24,11 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class WorkspaceCustomizationPolicy {
+public class WorkspaceCustomizationPolicy
+{
- public boolean contains(WorkspaceCustomizationContext c1, WorkspaceCustomizationContext c2) {
+ public boolean contains(WorkspaceCustomizationContext c1, WorkspaceCustomizationContext c2)
+ {
/*
if (c1 instanceof Workspace) {
if (c2 instanceof Workspace) {
@@ -74,6 +76,6 @@
throw new AssertionError();
}
*/
- throw new UnsupportedOperationException();
- }
+ throw new UnsupportedOperationException();
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/AbstractAttributes.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/AbstractAttributes.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/AbstractAttributes.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -28,110 +28,144 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class AbstractAttributes implements Attributes {
+public abstract class AbstractAttributes implements Attributes
+{
- protected abstract Object get(String name);
+ protected abstract Object get(String name);
- protected abstract void set(String name, Object o);
+ protected abstract void set(String name, Object o);
- private <T> T getObject(String name, ValueType<T> type, T defaultValue) {
- if (name == null) {
- throw new NullPointerException();
- }
- Object o = get(name);
- if (o == null) {
- return defaultValue;
- } else {
- return type.cast(o);
- }
- }
+ private <T> T getObject(String name, ValueType<T> type, T defaultValue)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ Object o = get(name);
+ if (o == null)
+ {
+ return defaultValue;
+ }
+ else
+ {
+ return type.cast(o);
+ }
+ }
- public final Object getObject(String name) {
- if (name == null) {
- throw new NullPointerException();
- }
- Object o = get(name);
- if (o == null) {
- return null;
- } else {
- ValueType.get(o);
- return o;
- }
- }
+ public final Object getObject(String name)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ Object o = get(name);
+ if (o == null)
+ {
+ return null;
+ }
+ else
+ {
+ ValueType.get(o);
+ return o;
+ }
+ }
- public final <T> void setObject(String name, T value) {
- if (name == null) {
- throw new NullPointerException();
- }
- if (value == null) {
- set(name, null);
- } else {
- ValueType.get(value);
- set(name, value);
- }
- }
+ public final <T> void setObject(String name, T value)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ if (value == null)
+ {
+ set(name, null);
+ }
+ else
+ {
+ ValueType.get(value);
+ set(name, value);
+ }
+ }
- public final ValueType<?> getType(String name) {
- if (name == null) {
- throw new NullPointerException();
- }
- Object o = get(name);
- if (o == null) {
- return null;
- } else {
- return ValueType.get(o);
- }
- }
+ public final ValueType<?> getType(String name)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ Object o = get(name);
+ if (o == null)
+ {
+ return null;
+ }
+ else
+ {
+ return ValueType.get(o);
+ }
+ }
- public final String getString(String name) {
- return getObject(name, ValueType.STRING, null);
- }
+ public final String getString(String name)
+ {
+ return getObject(name, ValueType.STRING, null);
+ }
- public final void setString(String name, String value) {
- setObject(name, value);
- }
+ public final void setString(String name, String value)
+ {
+ setObject(name, value);
+ }
- public final Boolean getBoolean(String name) {
- return getObject(name, ValueType.BOOLEAN, null);
- }
+ public final Boolean getBoolean(String name)
+ {
+ return getObject(name, ValueType.BOOLEAN, null);
+ }
- public final void setBoolean(String name, Boolean value) {
- setObject(name, value);
- }
+ public final void setBoolean(String name, Boolean value)
+ {
+ setObject(name, value);
+ }
- public final Integer getInteger(String name) {
- return getObject(name, ValueType.INTEGER, null);
- }
+ public final Integer getInteger(String name)
+ {
+ return getObject(name, ValueType.INTEGER, null);
+ }
- public final void setInteger(String name, Integer value) {
- setObject(name, value);
- }
+ public final void setInteger(String name, Integer value)
+ {
+ setObject(name, value);
+ }
- public final Date getDate(String name) {
- return getObject(name, ValueType.DATE, null);
- }
+ public final Date getDate(String name)
+ {
+ return getObject(name, ValueType.DATE, null);
+ }
- public final void setDate(String name, Date value) {
- setObject(name, value);
- }
+ public final void setDate(String name, Date value)
+ {
+ setObject(name, value);
+ }
- public final Double getDouble(String name) {
- return getObject(name, ValueType.DOUBLE, null);
- }
+ public final Double getDouble(String name)
+ {
+ return getObject(name, ValueType.DOUBLE, null);
+ }
- public final void setDouble(String name, Double value) {
- setObject(name, value);
- }
+ public final void setDouble(String name, Double value)
+ {
+ setObject(name, value);
+ }
- public final <T> T getValue(Key<T> key, T defaultValue) {
- return getObject(key.getName(), key.getType(), defaultValue);
- }
+ public final <T> T getValue(Key<T> key, T defaultValue)
+ {
+ return getObject(key.getName(), key.getType(), defaultValue);
+ }
- public final <T> T getValue(Key<T> key) {
- return getObject(key.getName(), key.getType(), null);
- }
+ public final <T> T getValue(Key<T> key)
+ {
+ return getObject(key.getName(), key.getType(), null);
+ }
- public final <T> void setValue(Key<T> key, T value) {
- setObject(key.getName(), value);
- }
+ public final <T> void setValue(Key<T> key, T value)
+ {
+ setObject(key.getName(), value);
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/SimpleAttributes.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/SimpleAttributes.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/SimpleAttributes.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -26,31 +26,40 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class SimpleAttributes extends AbstractAttributes {
+public class SimpleAttributes extends AbstractAttributes
+{
- private final Map<String, Object> map;
+ private final Map<String, Object> map;
- public SimpleAttributes(Map<String, Object> map) {
- this.map = map;
- }
+ public SimpleAttributes(Map<String, Object> map)
+ {
+ this.map = map;
+ }
- public SimpleAttributes() {
- this(new HashMap<String, Object>());
- }
+ public SimpleAttributes()
+ {
+ this(new HashMap<String, Object>());
+ }
- public Set<String> getKeys() {
- return map.keySet();
- }
+ public Set<String> getKeys()
+ {
+ return map.keySet();
+ }
- protected Object get(String name) {
- return map.get(name);
- }
+ protected Object get(String name)
+ {
+ return map.get(name);
+ }
- protected void set(String name, Object o) {
- if (o == null) {
- map.remove(name);
- } else {
- map.put(name, o);
- }
- }
+ protected void set(String name, Object o)
+ {
+ if (o == null)
+ {
+ map.remove(name);
+ }
+ else
+ {
+ map.put(name, o);
+ }
+ }
}
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/Tools.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/Tools.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/util/Tools.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -29,91 +29,115 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class Tools {
+public class Tools
+{
- public static <N> List<N> list(Iterator<N> iterable) {
- ArrayList<N> set = new ArrayList<N>();
- while (iterable.hasNext()) {
- set.add(iterable.next());
- }
- return set;
- }
+ public static <N> List<N> list(Iterator<N> iterable)
+ {
+ ArrayList<N> set = new ArrayList<N>();
+ while (iterable.hasNext())
+ {
+ set.add(iterable.next());
+ }
+ return set;
+ }
- public static <N> Set<N> set(Iterable<N> iterable) {
- HashSet<N> set = new HashSet<N>();
- for (N n : iterable) {
- set.add(n);
- }
- return set;
- }
+ public static <N> Set<N> set(Iterable<N> iterable)
+ {
+ HashSet<N> set = new HashSet<N>();
+ for (N n : iterable)
+ {
+ set.add(n);
+ }
+ return set;
+ }
- public static <N> Set<N> set(Iterator<N> iterator) {
- HashSet<N> set = new HashSet<N>();
- while (iterator.hasNext()) {
- set.add(iterator.next());
- }
- return set;
- }
+ public static <N> Set<N> set(Iterator<N> iterator)
+ {
+ HashSet<N> set = new HashSet<N>();
+ while (iterator.hasNext())
+ {
+ set.add(iterator.next());
+ }
+ return set;
+ }
- public static <N> Set<N> set() {
- return new HashSet<N>();
- }
+ public static <N> Set<N> set()
+ {
+ return new HashSet<N>();
+ }
- public static <N> Set<N> set(N object) {
- HashSet<N> set = new HashSet<N>();
- set.add(object);
- return set;
- }
-
- public static <N> Set<N> set(N... objects) throws NullPointerException {
- if (objects == null) {
- throw new NullPointerException();
- }
- HashSet<N> set = new HashSet<N>();
- for (N object : objects) {
+ public static <N> Set<N> set(N object)
+ {
+ HashSet<N> set = new HashSet<N>();
set.add(object);
- }
- return set;
- }
+ return set;
+ }
- public static int max(int value, int... values) {
- int max = value;
- for (int v : values) {
- if (v > max) {
- max = v;
+ public static <N> Set<N> set(N... objects) throws NullPointerException
+ {
+ if (objects == null)
+ {
+ throw new NullPointerException();
}
- }
- return max;
- }
+ HashSet<N> set = new HashSet<N>();
+ for (N object : objects)
+ {
+ set.add(object);
+ }
+ return set;
+ }
- public static <E> Iterator<E> iterator(final Iterator<? extends E>... iterators) {
- return new Iterator<E>() {
+ public static int max(int value, int... values)
+ {
+ int max = value;
+ for (int v : values)
+ {
+ if (v > max)
+ {
+ max = v;
+ }
+ }
+ return max;
+ }
- int index = 0;
+ public static <E> Iterator<E> iterator(final Iterator<? extends E>... iterators)
+ {
+ return new Iterator<E>()
+ {
- public boolean hasNext() {
- while (index < iterators.length) {
- if (iterators[index].hasNext()) {
- return true;
- }
- index++;
- }
- return false;
- }
+ int index = 0;
- public E next() {
- while (index < iterators.length) {
- if (iterators[index].hasNext()) {
- return iterators[index].next();
- }
- index++;
- }
- throw new NoSuchElementException();
- }
+ public boolean hasNext()
+ {
+ while (index < iterators.length)
+ {
+ if (iterators[index].hasNext())
+ {
+ return true;
+ }
+ index++;
+ }
+ return false;
+ }
- public void remove() {
- throw new UnsupportedOperationException();
- }
- };
- }
+ public E next()
+ {
+ while (index < iterators.length)
+ {
+ if (iterators[index].hasNext())
+ {
+ return iterators[index].next();
+ }
+ index++;
+ }
+ throw new NoSuchElementException();
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException();
+ }
+ };
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/AbstractPOMTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/AbstractPOMTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/AbstractPOMTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -31,28 +31,30 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class AbstractPOMTestCase extends TestCase {
+public abstract class AbstractPOMTestCase extends TestCase
+{
- /** . */
- protected MOPService pomService;
+ /** . */
+ protected MOPService pomService;
- @Override
- protected void setUp() throws Exception {
- Preferences weatherPreferences = new Preferences(Collections.<String, Preference>singletonMap(
- "zip", new Preference("zip", Collections.singletonList("marseille"), false)));
- PortletContentProvider portletContentProvider = new PortletContentProvider();
+ @Override
+ protected void setUp() throws Exception
+ {
+ Preferences weatherPreferences = new Preferences(Collections.<String, Preference>singletonMap(
+ "zip", new Preference("zip", Collections.singletonList("marseille"), false)));
+ PortletContentProvider portletContentProvider = new PortletContentProvider();
- //
- MOPService pomService = new TestMOPService();
+ //
+ MOPService pomService = new TestMOPService();
- //
- pomService.start();
+ //
+ pomService.start();
- // Not needed for now
- // pomService.getContentManagerRegistry().register(Preferences.CONTENT_TYPE, portletContentProvider);
+ // Not needed for now
+ // pomService.getContentManagerRegistry().register(Preferences.CONTENT_TYPE, portletContentProvider);
- //
- this.pomService = pomService;
- }
+ //
+ this.pomService = pomService;
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/POMFormatterTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/POMFormatterTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/POMFormatterTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -25,45 +25,52 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class POMFormatterTestCase extends TestCase {
+public class POMFormatterTestCase extends TestCase
+{
- /** . */
- private final ObjectFormatter formatter = new MOPFormatter();
+ /** . */
+ private final ObjectFormatter formatter = new MOPFormatter();
- private void assertString(String expected, String s) {
- assertEquals(expected, formatter.encodeNodeName(null, s));
- assertEquals(s, formatter.decodeNodeName(null, expected));
- }
+ private void assertString(String expected, String s)
+ {
+ assertEquals(expected, formatter.encodeNodeName(null, s));
+ assertEquals(s, formatter.decodeNodeName(null, expected));
+ }
- private void assertCannotDecode(String s) {
- try {
- formatter.decodeNodeName(null, s);
- fail();
- }
- catch (IllegalStateException ignore) {
- }
- }
+ private void assertCannotDecode(String s)
+ {
+ try
+ {
+ formatter.decodeNodeName(null, s);
+ fail();
+ }
+ catch (IllegalStateException ignore)
+ {
+ }
+ }
- public void testStrings() {
- assertString("", "");
- assertString("a", "a");
- assertString("%00", "{");
- assertString("%01", "}");
- assertString("%02", ".");
- assertString("%03", "/");
- assertString("%04", ":");
- assertString("%05", "[");
- assertString("%06", "]");
- assertString("%07", "|");
- assertString("%08", "*");
- assertString("%09", "%");
- assertString("a%03b", "a/b");
- }
+ public void testStrings()
+ {
+ assertString("", "");
+ assertString("a", "a");
+ assertString("%00", "{");
+ assertString("%01", "}");
+ assertString("%02", ".");
+ assertString("%03", "/");
+ assertString("%04", ":");
+ assertString("%05", "[");
+ assertString("%06", "]");
+ assertString("%07", "|");
+ assertString("%08", "*");
+ assertString("%09", "%");
+ assertString("a%03b", "a/b");
+ }
- public void testDecodeFailure() {
- assertCannotDecode("%0");
- assertCannotDecode("%0" + (char)('0' - 1));
- assertCannotDecode("%0" + (char)('9' + 1));
- assertCannotDecode("%1");
- }
+ public void testDecodeFailure()
+ {
+ assertCannotDecode("%0");
+ assertCannotDecode("%0" + (char)('0' - 1));
+ assertCannotDecode("%0" + (char)('9' + 1));
+ assertCannotDecode("%1");
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/composer/StructureIteratorTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/composer/StructureIteratorTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/composer/StructureIteratorTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -35,128 +35,135 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class StructureIteratorTestCase extends AbstractPOMTestCase {
+public class StructureIteratorTestCase extends AbstractPOMTestCase
+{
- public void testCompoundPage() {
- ModelImpl model = pomService.getModel();
- Site site = model.getWorkspace().addSite(ObjectType.PORTAL_SITE, "site");
- Page root = site.getRootPage();
+ public void testCompoundPage()
+ {
+ ModelImpl model = pomService.getModel();
+ Site site = model.getWorkspace().addSite(ObjectType.PORTAL_SITE, "site");
+ Page root = site.getRootPage();
- //
- Page t = root.addChild("t");
- UIContainer t0 = t.getRootComponent();
- UIComponent t1 = t0.add(ObjectType.WINDOW, "t1");
- UIComponent t2 = t0.add(ObjectType.BODY, "t2");
- UIComponent t3 = t0.add(ObjectType.WINDOW, "t3");
+ //
+ Page t = root.addChild("t");
+ UIContainer t0 = t.getRootComponent();
+ UIComponent t1 = t0.add(ObjectType.WINDOW, "t1");
+ UIComponent t2 = t0.add(ObjectType.BODY, "t2");
+ UIComponent t3 = t0.add(ObjectType.WINDOW, "t3");
- //
- Page u = root.addChild("u");
- UIContainer u0 = u.getRootComponent();
- UIComponent u1 = u0.add(ObjectType.WINDOW, "u1");
- UIComponent u2 = u0.add(ObjectType.BODY, "u2");
+ //
+ Page u = root.addChild("u");
+ UIContainer u0 = u.getRootComponent();
+ UIComponent u1 = u0.add(ObjectType.WINDOW, "u1");
+ UIComponent u2 = u0.add(ObjectType.BODY, "u2");
- //
- Page a = root.addChild("a");
- a.setTemplate(t);
- UIContainer a0 = a.getRootComponent();
- UIComponent a1 = a0.add(ObjectType.WINDOW, "a1");
- UIComponent a2 = a0.add(ObjectType.WINDOW, "a2");
- PageIterator ia = new PageIterator(a, PageIteratorStrategies.PAGE_TEMPLATE);
- assertStart(ia, t0);
- assertStart(ia, t1);
- assertEnd(ia, t1);
- assertStart(ia, a0);
- assertStart(ia, a1);
- assertEnd(ia, a1);
- assertStart(ia, a2);
- assertEnd(ia, a2);
- assertEnd(ia, a0);
- assertStart(ia, t3);
- assertEnd(ia, t3);
- assertEnd(ia, t0);
- assertDone(ia);
+ //
+ Page a = root.addChild("a");
+ a.setTemplate(t);
+ UIContainer a0 = a.getRootComponent();
+ UIComponent a1 = a0.add(ObjectType.WINDOW, "a1");
+ UIComponent a2 = a0.add(ObjectType.WINDOW, "a2");
+ PageIterator ia = new PageIterator(a, PageIteratorStrategies.PAGE_TEMPLATE);
+ assertStart(ia, t0);
+ assertStart(ia, t1);
+ assertEnd(ia, t1);
+ assertStart(ia, a0);
+ assertStart(ia, a1);
+ assertEnd(ia, a1);
+ assertStart(ia, a2);
+ assertEnd(ia, a2);
+ assertEnd(ia, a0);
+ assertStart(ia, t3);
+ assertEnd(ia, t3);
+ assertEnd(ia, t0);
+ assertDone(ia);
- //
- Page b = root.addChild("b");
- UIContainer b0 = b.getRootComponent();
- UIComponent b1 = b0.add(ObjectType.WINDOW, "b1");
- UIComponent b2 = b0.add(ObjectType.WINDOW, "b2");
+ //
+ Page b = root.addChild("b");
+ UIContainer b0 = b.getRootComponent();
+ UIComponent b1 = b0.add(ObjectType.WINDOW, "b1");
+ UIComponent b2 = b0.add(ObjectType.WINDOW, "b2");
- //
- Page c = root.addChild("c");
- c.setTemplate(u);
+ //
+ Page c = root.addChild("c");
+ c.setTemplate(u);
- }
+ }
- private void assertStart(StructureIterator i, UIComponent expectedComponent) {
- IterationType type = i.next();
- assertEquals(IterationType.START, type);
- UIComponent component = i.getComponent();
- assertSame(expectedComponent, component);
- }
+ private void assertStart(StructureIterator i, UIComponent expectedComponent)
+ {
+ IterationType type = i.next();
+ assertEquals(IterationType.START, type);
+ UIComponent component = i.getComponent();
+ assertSame(expectedComponent, component);
+ }
- private void assertEnd(StructureIterator i, UIComponent expectedComponent) {
- IterationType type = i.next();
- assertEquals(IterationType.END, type);
- UIComponent component = i.getComponent();
- assertSame(expectedComponent, component);
- }
+ private void assertEnd(StructureIterator i, UIComponent expectedComponent)
+ {
+ IterationType type = i.next();
+ assertEquals(IterationType.END, type);
+ UIComponent component = i.getComponent();
+ assertSame(expectedComponent, component);
+ }
- private void assertDone(StructureIterator i) {
- IterationType type = i.next();
- assertEquals(IterationType.DONE, type);
- UIComponent component = i.getComponent();
- assertSame(null, component);
- }
+ private void assertDone(StructureIterator i)
+ {
+ IterationType type = i.next();
+ assertEquals(IterationType.DONE, type);
+ UIComponent component = i.getComponent();
+ assertSame(null, component);
+ }
- public void testSimplePage() {
- ModelImpl model = pomService.getModel();
- Site site = model.getWorkspace().addSite(ObjectType.PORTAL_SITE, "site");
- Page root = site.getRootPage();
- UIContainer c0 = root.getRootComponent();
- UIComponent c1 = c0.add(ObjectType.WINDOW, "c1");
+ public void testSimplePage()
+ {
+ ModelImpl model = pomService.getModel();
+ Site site = model.getWorkspace().addSite(ObjectType.PORTAL_SITE, "site");
+ Page root = site.getRootPage();
+ UIContainer c0 = root.getRootComponent();
+ UIComponent c1 = c0.add(ObjectType.WINDOW, "c1");
- //
- PageIterator i = new PageIterator(root, PageIteratorStrategies.PAGE_TEMPLATE);
- assertStart(i, c0);
- assertStart(i, c1);
- assertEnd(i, c1);
- assertEnd(i, c0);
- assertDone(i);
- }
+ //
+ PageIterator i = new PageIterator(root, PageIteratorStrategies.PAGE_TEMPLATE);
+ assertStart(i, c0);
+ assertStart(i, c1);
+ assertEnd(i, c1);
+ assertEnd(i, c0);
+ assertDone(i);
+ }
- public void testComponents() {
- ModelImpl model = pomService.getModel();
- Site site = model.getWorkspace().addSite(ObjectType.PORTAL_SITE, "site");
- Page root = site.getRootPage();
- UIContainer c0 = root.getRootComponent();
- UIComponent c1 = c0.add(ObjectType.WINDOW, "c1");
- UIContainer c2 = c0.add(ObjectType.CONTAINER, "c2");
- UIComponent c3 = c2.add(ObjectType.WINDOW, "c3");
- UIComponent c4 = c2.add(ObjectType.WINDOW, "c4");
- UIComponent c5 = c0.add(ObjectType.WINDOW, "c5");
+ public void testComponents()
+ {
+ ModelImpl model = pomService.getModel();
+ Site site = model.getWorkspace().addSite(ObjectType.PORTAL_SITE, "site");
+ Page root = site.getRootPage();
+ UIContainer c0 = root.getRootComponent();
+ UIComponent c1 = c0.add(ObjectType.WINDOW, "c1");
+ UIContainer c2 = c0.add(ObjectType.CONTAINER, "c2");
+ UIComponent c3 = c2.add(ObjectType.WINDOW, "c3");
+ UIComponent c4 = c2.add(ObjectType.WINDOW, "c4");
+ UIComponent c5 = c0.add(ObjectType.WINDOW, "c5");
- //
- ComponentIterator i0 = new ComponentIterator(c1);
- assertStart(i0, c1);
- assertEnd(i0, c1);
- assertDone(i0);
+ //
+ ComponentIterator i0 = new ComponentIterator(c1);
+ assertStart(i0, c1);
+ assertEnd(i0, c1);
+ assertDone(i0);
- //
- ComponentIterator i1 = new ComponentIterator(c0);
- assertStart(i1, c0);
- assertStart(i1, c1);
- assertEnd(i1, c1);
- assertStart(i1, c2);
- assertStart(i1, c3);
- assertEnd(i1, c3);
- assertStart(i1, c4);
- assertEnd(i1, c4);
- assertEnd(i1, c2);
- assertStart(i1, c5);
- assertEnd(i1, c5);
- assertEnd(i1, c0);
- assertDone(i1);
- }
+ //
+ ComponentIterator i1 = new ComponentIterator(c0);
+ assertStart(i1, c0);
+ assertStart(i1, c1);
+ assertEnd(i1, c1);
+ assertStart(i1, c2);
+ assertStart(i1, c3);
+ assertEnd(i1, c3);
+ assertStart(i1, c4);
+ assertEnd(i1, c4);
+ assertEnd(i1, c2);
+ assertStart(i1, c5);
+ assertEnd(i1, c5);
+ assertEnd(i1, c0);
+ assertDone(i1);
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/BiltoTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/BiltoTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/BiltoTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -26,10 +26,11 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class BiltoTestCase extends AbstractPOMTestCase {
+public abstract class BiltoTestCase extends AbstractPOMTestCase
+{
- /** . */
- private final ContentType portletContentType = Preferences.CONTENT_TYPE;
+ /** . */
+ private final ContentType portletContentType = Preferences.CONTENT_TYPE;
/*
public void testBar() throws Exception {
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/CustomizationContextComparatorTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/CustomizationContextComparatorTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/CustomizationContextComparatorTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -34,129 +34,149 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class CustomizationContextComparatorTestCase extends TestCase {
+public class CustomizationContextComparatorTestCase extends TestCase
+{
- /** . */
- private final SimpleCustomizationContext s2 = new SimpleCustomizationContext("foo", 2);
+ /** . */
+ private final SimpleCustomizationContext s2 = new SimpleCustomizationContext("foo", 2);
- /** . */
- private final SimpleCustomizationContext s3 = new SimpleCustomizationContext("foo", 3);
+ /** . */
+ private final SimpleCustomizationContext s3 = new SimpleCustomizationContext("foo", 3);
- /** . */
- private final SimpleCustomizationContext s4 = new SimpleCustomizationContext("foo", 4);
+ /** . */
+ private final SimpleCustomizationContext s4 = new SimpleCustomizationContext("foo", 4);
- /** . */
- private final SimpleCustomizationContext b2 = new SimpleCustomizationContext("bar", 2);
+ /** . */
+ private final SimpleCustomizationContext b2 = new SimpleCustomizationContext("bar", 2);
- /** . */
- private final SimpleCustomizationContext b3 = new SimpleCustomizationContext("bar", 3);
+ /** . */
+ private final SimpleCustomizationContext b3 = new SimpleCustomizationContext("bar", 3);
- /** . */
- private final SimpleCustomizationContext b4 = new SimpleCustomizationContext("bar", 4);
+ /** . */
+ private final SimpleCustomizationContext b4 = new SimpleCustomizationContext("bar", 4);
- public void testKeepOrder() {
- CustomizationContextComparator comparator = new CustomizationContextComparator("foo");
- List<SimpleCustomizationContext> contexts = new ArrayList<SimpleCustomizationContext>();
- contexts.add(s2);
- contexts.add(s4);
- Collections.sort(contexts, comparator);
- List<SimpleCustomizationContext> blah = Arrays.asList(s2, s4);
- assertEquals(blah, contexts);
- }
+ public void testKeepOrder()
+ {
+ CustomizationContextComparator comparator = new CustomizationContextComparator("foo");
+ List<SimpleCustomizationContext> contexts = new ArrayList<SimpleCustomizationContext>();
+ contexts.add(s2);
+ contexts.add(s4);
+ Collections.sort(contexts, comparator);
+ List<SimpleCustomizationContext> blah = Arrays.asList(s2, s4);
+ assertEquals(blah, contexts);
+ }
- public void testSort() {
- CustomizationContextComparator comparator = new CustomizationContextComparator("foo");
- List<SimpleCustomizationContext> contexts = new ArrayList<SimpleCustomizationContext>();
- contexts.add(s4);
- contexts.add(s2);
- Collections.sort(contexts, comparator);
- List<SimpleCustomizationContext> blah = Arrays.asList(s2, s4);
- assertEquals(blah, contexts);
- }
-
- public void testFailWhenNotComparable() {
- CustomizationContextComparator comparator = new CustomizationContextComparator("foo");
- List<SimpleCustomizationContext> contexts = new ArrayList<SimpleCustomizationContext>();
- contexts.add(s2);
- contexts.add(s3);
- try {
+ public void testSort()
+ {
+ CustomizationContextComparator comparator = new CustomizationContextComparator("foo");
+ List<SimpleCustomizationContext> contexts = new ArrayList<SimpleCustomizationContext>();
+ contexts.add(s4);
+ contexts.add(s2);
Collections.sort(contexts, comparator);
- fail();
- }
- catch (ComparisonException e) {
- }
- }
+ List<SimpleCustomizationContext> blah = Arrays.asList(s2, s4);
+ assertEquals(blah, contexts);
+ }
- public void testFailWhenNonExpectedType() {
- CustomizationContextComparator comparator = new CustomizationContextComparator("foo");
- List<SimpleCustomizationContext> contexts = new ArrayList<SimpleCustomizationContext>();
- contexts.add(s2);
- contexts.add(b4);
- try {
+ public void testFailWhenNotComparable()
+ {
+ CustomizationContextComparator comparator = new CustomizationContextComparator("foo");
+ List<SimpleCustomizationContext> contexts = new ArrayList<SimpleCustomizationContext>();
+ contexts.add(s2);
+ contexts.add(s3);
+ try
+ {
+ Collections.sort(contexts, comparator);
+ fail();
+ }
+ catch (ComparisonException e)
+ {
+ }
+ }
+
+ public void testFailWhenNonExpectedType()
+ {
+ CustomizationContextComparator comparator = new CustomizationContextComparator("foo");
+ List<SimpleCustomizationContext> contexts = new ArrayList<SimpleCustomizationContext>();
+ contexts.add(s2);
+ contexts.add(b4);
+ try
+ {
+ Collections.sort(contexts, comparator);
+ fail();
+ }
+ catch (ComparisonException e)
+ {
+ }
+ }
+
+ public void testSortByTypes()
+ {
+ CustomizationContextComparator comparator = new CustomizationContextComparator("foo", "bar");
+ List<SimpleCustomizationContext> contexts = new ArrayList<SimpleCustomizationContext>();
+ contexts.add(b4);
+ contexts.add(s2);
+ contexts.add(s4);
+ contexts.add(b2);
Collections.sort(contexts, comparator);
- fail();
- }
- catch (ComparisonException e) {
- }
- }
+ List<?> blah = Arrays.asList(s2, s4, b2, b4);
+ assertEquals(blah, contexts);
+ }
- public void testSortByTypes() {
- CustomizationContextComparator comparator = new CustomizationContextComparator("foo","bar");
- List<SimpleCustomizationContext> contexts = new ArrayList<SimpleCustomizationContext>();
- contexts.add(b4);
- contexts.add(s2);
- contexts.add(s4);
- contexts.add(b2);
- Collections.sort(contexts, comparator);
- List<?> blah = Arrays.asList(s2, s4, b2, b4);
- assertEquals(blah, contexts);
- }
+ public void testRemoveDuplicates()
+ {
+ CustomizationContextComparator comparator = new CustomizationContextComparator("foo");
+ SortedSet<SimpleCustomizationContext> contexts = new TreeSet<SimpleCustomizationContext>(comparator);
+ contexts.add(s2);
+ contexts.add(s2);
+ assertEquals(1, contexts.size());
+ }
- public void testRemoveDuplicates() {
- CustomizationContextComparator comparator = new CustomizationContextComparator("foo");
- SortedSet<SimpleCustomizationContext> contexts = new TreeSet<SimpleCustomizationContext>(comparator);
- contexts.add(s2);
- contexts.add(s2);
- assertEquals(1, contexts.size());
- }
+ private static class SimpleCustomizationContext implements CustomizationContext
+ {
- private static class SimpleCustomizationContext implements CustomizationContext {
+ /** . */
+ private final String type;
- /** . */
- private final String type;
+ /** . */
+ private final int value;
- /** . */
- private final int value;
+ private SimpleCustomizationContext(String type, int value)
+ {
+ if (type == null)
+ {
+ throw new NullPointerException();
+ }
+ if (value < 1)
+ {
+ throw new IllegalArgumentException();
+ }
- private SimpleCustomizationContext(String type, int value) {
- if (type == null) {
- throw new NullPointerException();
+ //
+ this.type = type;
+ this.value = value;
}
- if (value < 1) {
- throw new IllegalArgumentException();
+
+ public String getContextId()
+ {
+ return type + "/" + value;
}
- //
- this.type = type;
- this.value = value;
- }
+ public String getContextType()
+ {
+ return type;
+ }
- public String getContextId() {
- return type + "/" + value;
- }
-
- public String getContextType() {
- return type;
- }
-
- public boolean contains(CustomizationContext that) {
- if (that instanceof SimpleCustomizationContext) {
- SimpleCustomizationContext thatSimple = (SimpleCustomizationContext)that;
- if (thatSimple.type.equals(type)) {
- return thatSimple.value % value == 0;
- }
+ public boolean contains(CustomizationContext that)
+ {
+ if (that instanceof SimpleCustomizationContext)
+ {
+ SimpleCustomizationContext thatSimple = (SimpleCustomizationContext)that;
+ if (thatSimple.type.equals(type))
+ {
+ return thatSimple.value % value == 0;
+ }
+ }
+ return false;
}
- return false;
- }
- }
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/CustomizationTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/CustomizationTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/content/CustomizationTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -24,7 +24,8 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public abstract class CustomizationTestCase extends AbstractPOMTestCase {
+public abstract class CustomizationTestCase extends AbstractPOMTestCase
+{
/*
public void tesGetPersistedCustomization() {
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AttributesTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AttributesTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/AttributesTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -29,33 +29,36 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class AttributesTestCase extends AbstractPOMTestCase {
+public class AttributesTestCase extends AbstractPOMTestCase
+{
- public void testAttributes() {
- ModelImpl model = pomService.getModel();
- Site portal = model.getWorkspace().addSite(ObjectType.PORTAL_SITE, "portal");
- Attributes portalAttributes = portal.getAttributes();
- portalAttributes.setString("foo", "bar");
- assertEquals("bar", portalAttributes.getString("foo"));
- Attributes pageAttributes = portal.getRootPage().getAttributes();
- pageAttributes.setString("foo", "bar");
- assertEquals("bar", pageAttributes.getString("foo"));
- }
+ public void testAttributes()
+ {
+ ModelImpl model = pomService.getModel();
+ Site portal = model.getWorkspace().addSite(ObjectType.PORTAL_SITE, "portal");
+ Attributes portalAttributes = portal.getAttributes();
+ portalAttributes.setString("foo", "bar");
+ assertEquals("bar", portalAttributes.getString("foo"));
+ Attributes pageAttributes = portal.getRootPage().getAttributes();
+ pageAttributes.setString("foo", "bar");
+ assertEquals("bar", pageAttributes.getString("foo"));
+ }
- public void testCascadedAttributes() {
- ModelImpl model = pomService.getModel();
- Site portal = model.getWorkspace().addSite(ObjectType.PORTAL_SITE, "portal");
- Page root = portal.getRootPage();
- Page a = root.addChild("a");
- Attributes rootAttrs = root.getAttributes();
- Attributes aAttrs = a.getAttributes();
- rootAttrs.setString("foo", "foo_root");
- aAttrs.setString("bar", "bar_a");
- rootAttrs.setString("juu", "juu_root");
- aAttrs.setString("juu", "juu_a");
- Attributes combinedAttrs = a.getCascadingAttributes();
- assertEquals("foo_root", combinedAttrs.getString("foo"));
- assertEquals("bar_a", combinedAttrs.getString("bar"));
- assertEquals("juu_a", combinedAttrs.getString("juu"));
- }
+ public void testCascadedAttributes()
+ {
+ ModelImpl model = pomService.getModel();
+ Site portal = model.getWorkspace().addSite(ObjectType.PORTAL_SITE, "portal");
+ Page root = portal.getRootPage();
+ Page a = root.addChild("a");
+ Attributes rootAttrs = root.getAttributes();
+ Attributes aAttrs = a.getAttributes();
+ rootAttrs.setString("foo", "foo_root");
+ aAttrs.setString("bar", "bar_a");
+ rootAttrs.setString("juu", "juu_root");
+ aAttrs.setString("juu", "juu_a");
+ Attributes combinedAttrs = a.getCascadingAttributes();
+ assertEquals("foo_root", combinedAttrs.getString("foo"));
+ assertEquals("bar_a", combinedAttrs.getString("bar"));
+ assertEquals("juu_a", combinedAttrs.getString("juu"));
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/ObjectTypeTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/ObjectTypeTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/ObjectTypeTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -25,21 +25,23 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class ObjectTypeTestCase extends TestCase {
+public class ObjectTypeTestCase extends TestCase
+{
- public void testAssignability() {
- assertFalse(ObjectType.WORKSPACE.isAssignableFrom(ObjectType.SITE));
- assertFalse(ObjectType.SITE.isAssignableFrom(ObjectType.WORKSPACE));
+ public void testAssignability()
+ {
+ assertFalse(ObjectType.WORKSPACE.isAssignableFrom(ObjectType.SITE));
+ assertFalse(ObjectType.SITE.isAssignableFrom(ObjectType.WORKSPACE));
- //
- assertTrue(ObjectType.SITE.isAssignableFrom(ObjectType.SITE));
+ //
+ assertTrue(ObjectType.SITE.isAssignableFrom(ObjectType.SITE));
- //
- assertTrue(ObjectType.SITE.isAssignableFrom(ObjectType.PORTAL_SITE));
- assertFalse(ObjectType.PORTAL_SITE.isAssignableFrom(ObjectType.SITE));
+ //
+ assertTrue(ObjectType.SITE.isAssignableFrom(ObjectType.PORTAL_SITE));
+ assertFalse(ObjectType.PORTAL_SITE.isAssignableFrom(ObjectType.SITE));
- //
- assertTrue(ObjectType.SITE.isAssignableFrom(ObjectType.GROUP_SITE));
- assertFalse(ObjectType.GROUP_SITE.isAssignableFrom(ObjectType.SITE));
- }
+ //
+ assertTrue(ObjectType.SITE.isAssignableFrom(ObjectType.GROUP_SITE));
+ assertFalse(ObjectType.GROUP_SITE.isAssignableFrom(ObjectType.SITE));
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/POMTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/POMTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/POMTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -33,81 +33,90 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class POMTestCase extends AbstractPOMTestCase {
+public class POMTestCase extends AbstractPOMTestCase
+{
- public void testPortals() throws Exception {
- test(0);
- }
+ public void testPortals() throws Exception
+ {
+ test(0);
+ }
- public void testGroups() throws Exception {
- test(1);
- }
+ public void testGroups() throws Exception
+ {
+ test(1);
+ }
- private void test(int type) throws Exception {
+ private void test(int type) throws Exception
+ {
- ModelImpl model = pomService.getModel();
+ ModelImpl model = pomService.getModel();
- Workspace workspace = model.getWorkspace();
+ Workspace workspace = model.getWorkspace();
- //
- ObjectType<? extends Site> siteType;
- if (type == 0) {
- siteType = ObjectType.PORTAL_SITE;
- } else if (type == 1) {
- siteType = ObjectType.GROUP_SITE;
- } else {
- throw new UnsupportedOperationException();
- }
+ //
+ ObjectType<? extends Site> siteType;
+ if (type == 0)
+ {
+ siteType = ObjectType.PORTAL_SITE;
+ }
+ else if (type == 1)
+ {
+ siteType = ObjectType.GROUP_SITE;
+ }
+ else
+ {
+ throw new UnsupportedOperationException();
+ }
- //
- Site site = workspace.addSite(siteType, "default");
- Page root = site.getRootPage();
- assertNotNull(root);
- Page template = root.addChild("template");
- assertNotNull(template);
+ //
+ Site site = workspace.addSite(siteType, "default");
+ Page root = site.getRootPage();
+ assertNotNull(root);
+ Page template = root.addChild("template");
+ assertNotNull(template);
- UIContainer container = template.getRootComponent();
- assertNotNull(container);
- container.add(ObjectType.WINDOW, "window");
+ UIContainer container = template.getRootComponent();
+ assertNotNull(container);
+ container.add(ObjectType.WINDOW, "window");
- //
- Page page = root.addChild("page");
- assertNotNull(page);
- page.setTemplate(template);
+ //
+ Page page = root.addChild("page");
+ assertNotNull(page);
+ page.setTemplate(template);
- //
- NavigationImpl nav = (NavigationImpl)site.getRootNavigation();
- assertNotNull(nav);
+ //
+ NavigationImpl nav = (NavigationImpl)site.getRootNavigation();
+ assertNotNull(nav);
// assertNull(nav.getLink());
- //
- nav.setTemplate(template);
+ //
+ nav.setTemplate(template);
- //
- PageLinkImpl pageTarget = nav.createPageLink();
+ //
+ PageLinkImpl pageTarget = nav.createPageLink();
// nav.setLink(pageTarget);
// pageTarget.setPage(page);
- //
- NavigationImpl subnav = nav.addChild("subnav");
- URLLinkImpl urlTarget = nav.createURLTarget();
+ //
+ NavigationImpl subnav = nav.addChild("subnav");
+ URLLinkImpl urlTarget = nav.createURLTarget();
// subnav.setLink(urlTarget);
// urlTarget.setURL("http://www.exoplatform.com");
- // Try something with template relationships
+ // Try something with template relationships
- Collection<? extends Page> templatizedPages = template.getTemplatizedObjects(ObjectType.PAGE);
- assertNotNull(templatizedPages);
- assertEquals(1, templatizedPages.size());
+ Collection<? extends Page> templatizedPages = template.getTemplatizedObjects(ObjectType.PAGE);
+ assertNotNull(templatizedPages);
+ assertEquals(1, templatizedPages.size());
- Collection<? extends Navigation> templatizedNavigations = template.getTemplatizedObjects(ObjectType.NAVIGATION);
- assertNotNull(templatizedNavigations);
- assertEquals(1, templatizedNavigations.size());
+ Collection<? extends Navigation> templatizedNavigations = template.getTemplatizedObjects(ObjectType.NAVIGATION);
+ assertNotNull(templatizedNavigations);
+ assertEquals(1, templatizedNavigations.size());
/*
Collection<Templatized> templatizedObjects = template.getTemplatizedObjects(Templatized.class);
assertNotNull(templatizedObjects);
assertEquals(2, templatizedObjects.size());
*/
- }
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/QueryTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/QueryTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/QueryTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -30,16 +30,18 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class QueryTestCase extends AbstractPOMTestCase {
+public class QueryTestCase extends AbstractPOMTestCase
+{
- public void testFoo() {
- ModelImpl model = pomService.getModel();
- Workspace workspace = model.getWorkspace();
- Site site = workspace.addSite(ObjectType.PORTAL_SITE, "foo");
- model.save();
- Iterator<Site> sites = model.findObject(ObjectType.PORTAL_SITE, "jcr:path='" + model.pathOf(site) + "'");
- assertTrue(sites.hasNext());
- assertSame(site, sites.next());
- assertFalse(sites.hasNext());
- }
+ public void testFoo()
+ {
+ ModelImpl model = pomService.getModel();
+ Workspace workspace = model.getWorkspace();
+ Site site = workspace.addSite(ObjectType.PORTAL_SITE, "foo");
+ model.save();
+ Iterator<Site> sites = model.findObject(ObjectType.PORTAL_SITE, "jcr:path='" + model.pathOf(site) + "'");
+ assertTrue(sites.hasNext());
+ assertSame(site, sites.next());
+ assertFalse(sites.hasNext());
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/WorkspaceTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/WorkspaceTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/WorkspaceTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -37,81 +37,90 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class WorkspaceTestCase extends AbstractPOMTestCase {
+public class WorkspaceTestCase extends AbstractPOMTestCase
+{
- public void testGetSite() {
- ModelImpl model = pomService.getModel();
- Workspace workspace = model.getWorkspace();
- Site site = workspace.addSite(ObjectType.GROUP_SITE, "site");
- assertNotNull(site);
- Site s2 = model.findObjectById(ObjectType.SITE, site.getObjectId());
- assertEquals(site, s2);
- assertEquals(workspace, site.getWorkspace());
- }
+ public void testGetSite()
+ {
+ ModelImpl model = pomService.getModel();
+ Workspace workspace = model.getWorkspace();
+ Site site = workspace.addSite(ObjectType.GROUP_SITE, "site");
+ assertNotNull(site);
+ Site s2 = model.findObjectById(ObjectType.SITE, site.getObjectId());
+ assertEquals(site, s2);
+ assertEquals(workspace, site.getWorkspace());
+ }
- public void testGetPortal() {
- ModelImpl model = pomService.getModel();
- Workspace workspace = model.getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- assertNotNull(portal);
- Site s2 = model.findObjectById(ObjectType.SITE, portal.getObjectId());
- assertEquals(portal, s2);
- }
+ public void testGetPortal()
+ {
+ ModelImpl model = pomService.getModel();
+ Workspace workspace = model.getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ assertNotNull(portal);
+ Site s2 = model.findObjectById(ObjectType.SITE, portal.getObjectId());
+ assertEquals(portal, s2);
+ }
- public void testGetSites() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site s1 = workspace.addSite(ObjectType.GROUP_SITE, "foo");
- assertNotNull(s1);
- Site s2 = workspace.addSite(ObjectType.GROUP_SITE, "bar");
- assertNotNull(s2);
- assertEquals(Tools.set(workspace.getSites(ObjectType.GROUP_SITE)), Tools.set(s1, s2));
- }
+ public void testGetSites()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site s1 = workspace.addSite(ObjectType.GROUP_SITE, "foo");
+ assertNotNull(s1);
+ Site s2 = workspace.addSite(ObjectType.GROUP_SITE, "bar");
+ assertNotNull(s2);
+ assertEquals(Tools.set(workspace.getSites(ObjectType.GROUP_SITE)), Tools.set(s1, s2));
+ }
- public void testRootPage() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- Page root = portal.getRootPage();
- assertEquals(portal, root.getSite());
- }
+ public void testRootPage()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ Page root = portal.getRootPage();
+ assertEquals(portal, root.getSite());
+ }
- public void testPageAddChild() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- Page root = portal.getRootPage();
- assertEquals(portal, root.getSite());
- Page foo = root.addChild("foo");
- assertNotNull(foo);
- assertEquals(root, foo.getParent());
- assertEquals(portal, foo.getSite());
- Collection<? extends Page> children = root.getChildren();
- assertEquals(Tools.set(foo), new HashSet<Page>(children));
- }
+ public void testPageAddChild()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ Page root = portal.getRootPage();
+ assertEquals(portal, root.getSite());
+ Page foo = root.addChild("foo");
+ assertNotNull(foo);
+ assertEquals(root, foo.getParent());
+ assertEquals(portal, foo.getSite());
+ Collection<? extends Page> children = root.getChildren();
+ assertEquals(Tools.set(foo), new HashSet<Page>(children));
+ }
- public void testPortalTemplate() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- Page template = portal.getRootPage().addChild("template");
- portal.getRootNavigation().setTemplate(template);
- assertEquals(template, portal.getRootNavigation().getTemplate());
- }
+ public void testPortalTemplate()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ Page template = portal.getRootPage().addChild("template");
+ portal.getRootNavigation().setTemplate(template);
+ assertEquals(template, portal.getRootNavigation().getTemplate());
+ }
- public void testPageTemplate() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- Page template = portal.getRootPage().addChild("template");
- Page foo = portal.getRootPage().addChild("foo");
- foo.setTemplate(template);
- assertEquals(template, foo.getTemplate());
- }
+ public void testPageTemplate()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ Page template = portal.getRootPage().addChild("template");
+ Page foo = portal.getRootPage().addChild("foo");
+ foo.setTemplate(template);
+ assertEquals(template, foo.getTemplate());
+ }
- public void testLoading() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- String portalId = portal.getObjectId();
- Page root = portal.getRootPage();
- String rootId = root.getObjectId();
- Page foo = root.addChild("foo");
- String fooId= foo.getObjectId();
+ public void testLoading()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ String portalId = portal.getObjectId();
+ Page root = portal.getRootPage();
+ String rootId = root.getObjectId();
+ Page foo = root.addChild("foo");
+ String fooId = foo.getObjectId();
/*
// Test loading
@@ -127,111 +136,117 @@
assertEquals(portal, foo.getSite());
assertEquals(portal, root.getSite());
*/
- }
+ }
- public void testNavigationHierarchy() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- Navigation rootNav = portal.getRootNavigation();
- assertNotNull(rootNav);
- assertNotNull(rootNav.getAttributes());
- assertNull(rootNav.getParent());
- assertTrue(rootNav.getChildren().isEmpty());
- Navigation fooNav = rootNav.addChild("foo");
- assertNotNull(fooNav);
- assertNotNull(fooNav.getAttributes());
- assertSame(rootNav, fooNav.getParent());
- assertTrue(fooNav.getChildren().isEmpty());
- assertEquals(Collections.singleton(fooNav), new HashSet<Navigation>(rootNav.getChildren()));
- }
+ public void testNavigationHierarchy()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ Navigation rootNav = portal.getRootNavigation();
+ assertNotNull(rootNav);
+ assertNotNull(rootNav.getAttributes());
+ assertNull(rootNav.getParent());
+ assertTrue(rootNav.getChildren().isEmpty());
+ Navigation fooNav = rootNav.addChild("foo");
+ assertNotNull(fooNav);
+ assertNotNull(fooNav.getAttributes());
+ assertSame(rootNav, fooNav.getParent());
+ assertTrue(fooNav.getChildren().isEmpty());
+ assertEquals(Collections.singleton(fooNav), new HashSet<Navigation>(rootNav.getChildren()));
+ }
- public void testLink() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- Navigation rootNav = portal.getRootNavigation();
- assertNull(rootNav.getLink());
+ public void testLink()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ Navigation rootNav = portal.getRootNavigation();
+ assertNull(rootNav.getLink());
- //
- PageLink link = rootNav.linkTo(ObjectType.PAGE_LINK);
- assertNotNull(link);
- assertSame(link, rootNav.getLink());
- Page rootPage = portal.getRootPage();
- link.setPage(rootPage);
- assertEquals(rootPage, link.getPage());
- }
+ //
+ PageLink link = rootNav.linkTo(ObjectType.PAGE_LINK);
+ assertNotNull(link);
+ assertSame(link, rootNav.getLink());
+ Page rootPage = portal.getRootPage();
+ link.setPage(rootPage);
+ assertEquals(rootPage, link.getPage());
+ }
- public void testNavigationClear() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- Navigation rootNav = portal.getRootNavigation();
- rootNav.addChild("a");
- rootNav.addChild("b");
- assertEquals(2, rootNav.getChildren().size());
- rootNav.getChildren().clear();
- assertEquals(0, rootNav.getChildren().size());
- }
+ public void testNavigationClear()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ Navigation rootNav = portal.getRootNavigation();
+ rootNav.addChild("a");
+ rootNav.addChild("b");
+ assertEquals(2, rootNav.getChildren().size());
+ rootNav.getChildren().clear();
+ assertEquals(0, rootNav.getChildren().size());
+ }
- public void testNavigationGetSite() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- Navigation rootNav = portal.getRootNavigation();
- Navigation a = rootNav.addChild("a");
- Site site = a.getSite();
- assertSame(portal, site);
- }
+ public void testNavigationGetSite()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ Navigation rootNav = portal.getRootNavigation();
+ Navigation a = rootNav.addChild("a");
+ Site site = a.getSite();
+ assertSame(portal, site);
+ }
- public void testRemoveReferencedTemplate() {
- ModelImpl pom = pomService.getModel();
- Workspace workspace = pom.getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- Page root = portal.getRootPage();
- Page template = root.addChild("template");
- portal.getRootNavigation().setTemplate(template);
- pom.save();
+ public void testRemoveReferencedTemplate()
+ {
+ ModelImpl pom = pomService.getModel();
+ Workspace workspace = pom.getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ Page root = portal.getRootPage();
+ Page template = root.addChild("template");
+ portal.getRootNavigation().setTemplate(template);
+ pom.save();
- pom = pomService.getModel();
- portal = workspace.getSite(ObjectType.PORTAL_SITE, "portal");
- portal.getRootPage().getChild("template").destroy();
- pom.save();
+ pom = pomService.getModel();
+ portal = workspace.getSite(ObjectType.PORTAL_SITE, "portal");
+ portal.getRootPage().getChild("template").destroy();
+ pom.save();
- //
- pom = pomService.getModel();
- portal = workspace.getSite(ObjectType.PORTAL_SITE, "portal");
- portal.destroy();
- pom.save();
+ //
+ pom = pomService.getModel();
+ portal = workspace.getSite(ObjectType.PORTAL_SITE, "portal");
+ portal.destroy();
+ pom.save();
- pom = pomService.getModel();
- workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ pom = pomService.getModel();
+ workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- }
+ }
- public void testComponentOrder() {
- ModelImpl pom = pomService.getModel();
- Workspace workspace = pom.getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal2");
- Page root = portal.getRootPage();
+ public void testComponentOrder()
+ {
+ ModelImpl pom = pomService.getModel();
+ Workspace workspace = pom.getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal2");
+ Page root = portal.getRootPage();
- UIContainer container = root.getRootComponent();
+ UIContainer container = root.getRootComponent();
- container.add(ObjectType.WINDOW, "2");
- container.add(0, ObjectType.WINDOW, "0");
+ container.add(ObjectType.WINDOW, "2");
+ container.add(0, ObjectType.WINDOW, "0");
- assertEquals("0", container.get(0).getName());
- assertEquals("2", container.get(1).getName());
- assertEquals(2, container.size());
+ assertEquals("0", container.get(0).getName());
+ assertEquals("2", container.get(1).getName());
+ assertEquals(2, container.size());
- container.add(1, ObjectType.WINDOW, "1");
+ container.add(1, ObjectType.WINDOW, "1");
- assertEquals("0", container.get(0).getName());
- assertEquals("1", container.get(1).getName());
- assertEquals("2", container.get(2).getName());
- assertEquals(3, container.size());
+ assertEquals("0", container.get(0).getName());
+ assertEquals("1", container.get(1).getName());
+ assertEquals("2", container.get(2).getName());
+ assertEquals(3, container.size());
- container.add(0, container.get(2));
+ container.add(0, container.get(2));
- assertEquals("2", container.get(0).getName());
- assertEquals("0", container.get(1).getName());
- assertEquals("1", container.get(2).getName());
- assertEquals(3, container.size());
- }
+ assertEquals("2", container.get(0).getName());
+ assertEquals("0", container.get(1).getName());
+ assertEquals("1", container.get(2).getName());
+ assertEquals(3, container.size());
+ }
}
\ No newline at end of file
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/content/CustomizationTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/content/CustomizationTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/content/CustomizationTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -36,152 +36,161 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class CustomizationTestCase extends AbstractPOMTestCase {
+public class CustomizationTestCase extends AbstractPOMTestCase
+{
- /** . */
- private final Preferences marseille = new PreferencesBuilder().add("city", "marseille").add("temperature", "celsius").build();
+ /** . */
+ private final Preferences marseille = new PreferencesBuilder().add("city", "marseille").add("temperature", "celsius").build();
- /** . */
- private final Preferences paris = new PreferencesBuilder().add("city", "paris").build();
+ /** . */
+ private final Preferences paris = new PreferencesBuilder().add("city", "paris").build();
- /** . */
- private final Preferences parisCelsius = new PreferencesBuilder().add("city", "paris").add("temperature", "celsius").build();
+ /** . */
+ private final Preferences parisCelsius = new PreferencesBuilder().add("city", "paris").add("temperature", "celsius").build();
- /** . */
- private final Preferences parisFarenheit = new PreferencesBuilder().add("city", "paris").add("temperature", "farenheit").build();
+ /** . */
+ private final Preferences parisFarenheit = new PreferencesBuilder().add("city", "paris").add("temperature", "farenheit").build();
- public void testVirtualCustomization() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Customization<Preferences> customization1 = workspace.customize("marseille", Preferences.CONTENT_TYPE, "WeatherPortlet", marseille);
- Customization<Preferences> customization2 = workspace.customize("paris", customization1);
+ public void testVirtualCustomization()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Customization<Preferences> customization1 = workspace.customize("marseille", Preferences.CONTENT_TYPE, "WeatherPortlet", marseille);
+ Customization<Preferences> customization2 = workspace.customize("paris", customization1);
- //
- customization2.setState(paris);
- assertEquals(paris, customization2.getState());
- assertEquals(parisCelsius, customization2.getVirtualState());
+ //
+ customization2.setState(paris);
+ assertEquals(paris, customization2.getState());
+ assertEquals(parisCelsius, customization2.getVirtualState());
- //
- customization2.setState(parisFarenheit);
- assertEquals(parisFarenheit, customization2.getState());
- assertEquals(parisFarenheit, customization2.getVirtualState());
+ //
+ customization2.setState(parisFarenheit);
+ assertEquals(parisFarenheit, customization2.getState());
+ assertEquals(parisFarenheit, customization2.getVirtualState());
- //
- customization1.setState(customization1.getState().setReadOnly("temperature", true));
- assertEquals(parisFarenheit, customization2.getState());
- assertEquals(parisCelsius, customization2.getVirtualState());
- }
+ //
+ customization1.setState(customization1.getState().setReadOnly("temperature", true));
+ assertEquals(parisFarenheit, customization2.getState());
+ assertEquals(parisCelsius, customization2.getVirtualState());
+ }
- public void testCustomizeWorkspace() {
- Workspace workspace = pomService.getModel().getWorkspace();
- assertNull(workspace.getCustomization("marseille"));
- Customization<Preferences> customization = workspace.customize("marseille", Preferences.CONTENT_TYPE, "WeatherPortlet", marseille);
- assertNotNull(customization);
- Preferences b = customization.getState();
- assertEquals(marseille, b);
- assertEquals(0, customization.getContexts().size());
- assertEquals("WeatherPortlet", customization.getContentId());
- assertEquals(Preferences.CONTENT_TYPE, customization.getType());
- assertEquals("marseille", workspace.nameOf(customization));
- }
+ public void testCustomizeWorkspace()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ assertNull(workspace.getCustomization("marseille"));
+ Customization<Preferences> customization = workspace.customize("marseille", Preferences.CONTENT_TYPE, "WeatherPortlet", marseille);
+ assertNotNull(customization);
+ Preferences b = customization.getState();
+ assertEquals(marseille, b);
+ assertEquals(0, customization.getContexts().size());
+ assertEquals("WeatherPortlet", customization.getContentId());
+ assertEquals(Preferences.CONTENT_TYPE, customization.getType());
+ assertEquals("marseille", workspace.nameOf(customization));
+ }
- public void testCustomizeWindow() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- UIContainer layout = portal.getRootPage().getRootComponent();
- UIWindow window = layout.add(ObjectType.WINDOW, "window");
+ public void testCustomizeWindow()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ UIContainer layout = portal.getRootPage().getRootComponent();
+ UIWindow window = layout.add(ObjectType.WINDOW, "window");
- //
- Customization<Preferences> customization = window.customize(Preferences.CONTENT_TYPE, "WeatherPortlet", marseille);
- assertSame(customization, window.getCustomization());
- assertEquals(marseille, customization.getVirtualState());
- assertEquals(marseille, customization.getState());
+ //
+ Customization<Preferences> customization = window.customize(Preferences.CONTENT_TYPE, "WeatherPortlet", marseille);
+ assertSame(customization, window.getCustomization());
+ assertEquals(marseille, customization.getVirtualState());
+ assertEquals(marseille, customization.getState());
- //
- customization = (Customization<Preferences>)window.getCustomization();
- assertSame(customization, window.getCustomization());
- assertEquals(marseille, customization.getVirtualState());
- assertEquals(marseille, customization.getState());
- }
+ //
+ customization = (Customization<Preferences>)window.getCustomization();
+ assertSame(customization, window.getCustomization());
+ assertEquals(marseille, customization.getVirtualState());
+ assertEquals(marseille, customization.getState());
+ }
- public void testCustomizeWindowByCloneWithNoState() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- UIContainer layout = portal.getRootPage().getRootComponent();
- UIWindow window = layout.add(ObjectType.WINDOW, "window");
+ public void testCustomizeWindowByCloneWithNoState()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ UIContainer layout = portal.getRootPage().getRootComponent();
+ UIWindow window = layout.add(ObjectType.WINDOW, "window");
- //
- Customization<Preferences> customization = window.customize(Preferences.CONTENT_TYPE, "WeatherPortlet", null);
- assertSame(customization, window.getCustomization());
- assertNull(customization.getState());
- }
+ //
+ Customization<Preferences> customization = window.customize(Preferences.CONTENT_TYPE, "WeatherPortlet", null);
+ assertSame(customization, window.getCustomization());
+ assertNull(customization.getState());
+ }
- public void testCustomizeWindowBySpecialization() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- UIContainer layout = portal.getRootPage().getRootComponent();
- UIWindow window = layout.add(ObjectType.WINDOW, "window");
+ public void testCustomizeWindowBySpecialization()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ UIContainer layout = portal.getRootPage().getRootComponent();
+ UIWindow window = layout.add(ObjectType.WINDOW, "window");
- //
- Customization<Preferences> workspaceCustomization = portal.customize("marseille", Preferences.CONTENT_TYPE, "WeatherPortlet", marseille);
- Customization<Preferences> windowCustomization = window.customize(workspaceCustomization);
+ //
+ Customization<Preferences> workspaceCustomization = portal.customize("marseille", Preferences.CONTENT_TYPE, "WeatherPortlet", marseille);
+ Customization<Preferences> windowCustomization = window.customize(workspaceCustomization);
- //
- assertNotNull(windowCustomization);
- assertEquals(Arrays.<CustomizationContext>asList(window, portal), new ArrayList<CustomizationContext>(windowCustomization.getContexts()));
- assertSame(windowCustomization, window.getCustomization());
- assertTrue(((Customization)windowCustomization) instanceof WorkspaceSpecialization);
+ //
+ assertNotNull(windowCustomization);
+ assertEquals(Arrays.<CustomizationContext>asList(window, portal), new ArrayList<CustomizationContext>(windowCustomization.getContexts()));
+ assertSame(windowCustomization, window.getCustomization());
+ assertTrue(((Customization)windowCustomization) instanceof WorkspaceSpecialization);
- //
- assertPreferences(null, windowCustomization.getState());
- assertPreferences(marseille, windowCustomization.getVirtualState());
- assertPreferences(marseille, workspaceCustomization.getState());
+ //
+ assertPreferences(null, windowCustomization.getState());
+ assertPreferences(marseille, windowCustomization.getVirtualState());
+ assertPreferences(marseille, workspaceCustomization.getState());
- //
- workspaceCustomization.setState(paris);
- assertPreferences(paris, windowCustomization.getVirtualState());
- assertPreferences(null, windowCustomization.getState());
- assertPreferences(paris, workspaceCustomization.getState());
+ //
+ workspaceCustomization.setState(paris);
+ assertPreferences(paris, windowCustomization.getVirtualState());
+ assertPreferences(null, windowCustomization.getState());
+ assertPreferences(paris, workspaceCustomization.getState());
- //
- windowCustomization.setState(parisFarenheit);
- assertPreferences(parisFarenheit, windowCustomization.getVirtualState());
- assertPreferences(parisFarenheit, windowCustomization.getState());
- assertPreferences(paris, workspaceCustomization.getState());
- }
+ //
+ windowCustomization.setState(parisFarenheit);
+ assertPreferences(parisFarenheit, windowCustomization.getVirtualState());
+ assertPreferences(parisFarenheit, windowCustomization.getState());
+ assertPreferences(paris, workspaceCustomization.getState());
+ }
- public void testDestroySpecializedCustomization() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- UIContainer layout = portal.getRootPage().getRootComponent();
- UIWindow window = layout.add(ObjectType.WINDOW, "window");
+ public void testDestroySpecializedCustomization()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ UIContainer layout = portal.getRootPage().getRootComponent();
+ UIWindow window = layout.add(ObjectType.WINDOW, "window");
- //
- Customization<Preferences> workspaceCustomization = portal.customize("marseille", Preferences.CONTENT_TYPE, "WeatherPortlet", marseille);
- Customization<Preferences> windowCustomization = window.customize(workspaceCustomization);
+ //
+ Customization<Preferences> workspaceCustomization = portal.customize("marseille", Preferences.CONTENT_TYPE, "WeatherPortlet", marseille);
+ Customization<Preferences> windowCustomization = window.customize(workspaceCustomization);
- //
- workspaceCustomization.destroy();
+ //
+ workspaceCustomization.destroy();
- //
- assertEquals(marseille, windowCustomization.getVirtualState());
- assertEquals(marseille, windowCustomization.getState());
- }
+ //
+ assertEquals(marseille, windowCustomization.getVirtualState());
+ assertEquals(marseille, windowCustomization.getState());
+ }
- public void testDestroySpecialization() {
- Workspace workspace = pomService.getModel().getWorkspace();
- Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
- UIContainer layout = portal.getRootPage().getRootComponent();
- UIWindow window = layout.add(ObjectType.WINDOW, "window");
+ public void testDestroySpecialization()
+ {
+ Workspace workspace = pomService.getModel().getWorkspace();
+ Site portal = workspace.addSite(ObjectType.PORTAL_SITE, "portal");
+ UIContainer layout = portal.getRootPage().getRootComponent();
+ UIWindow window = layout.add(ObjectType.WINDOW, "window");
- //
- Customization<Preferences> workspaceCustomization = portal.customize("marseille", Preferences.CONTENT_TYPE, "WeatherPortlet", marseille);
- Customization<Preferences> windowCustomization = window.customize(workspaceCustomization);
+ //
+ Customization<Preferences> workspaceCustomization = portal.customize("marseille", Preferences.CONTENT_TYPE, "WeatherPortlet", marseille);
+ Customization<Preferences> windowCustomization = window.customize(workspaceCustomization);
- //
- windowCustomization.destroy();
- }
+ //
+ windowCustomization.destroy();
+ }
- private void assertPreferences(Preferences expectedPrefs, Preferences prefs) {
- assertEquals("Was expecting to have prefs " + prefs + " equals to " + expectedPrefs, expectedPrefs, prefs);
- }
+ private void assertPreferences(Preferences expectedPrefs, Preferences prefs)
+ {
+ assertEquals("Was expecting to have prefs " + prefs + " equals to " + expectedPrefs, expectedPrefs, prefs);
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/Gadget.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/Gadget.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/Gadget.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -24,19 +24,22 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class Gadget {
+public class Gadget
+{
- /** . */
- public static final ContentType<Gadget> CONTENT_TYPE = new ContentType<Gadget>("application/gadget", Gadget.class);
+ /** . */
+ public static final ContentType<Gadget> CONTENT_TYPE = new ContentType<Gadget>("application/gadget", Gadget.class);
- /** . */
- private String userPref;
+ /** . */
+ private String userPref;
- public String getUserPref() {
- return userPref;
- }
+ public String getUserPref()
+ {
+ return userPref;
+ }
- public void setUserPref(String userPref) {
- this.userPref = userPref;
- }
+ public void setUserPref(String userPref)
+ {
+ this.userPref = userPref;
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -32,68 +32,87 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class GadgetContentProvider implements ContentProvider<Gadget> {
+public class GadgetContentProvider implements ContentProvider<Gadget>
+{
- public Gadget combine(List<Gadget> states) {
- throw new UnsupportedOperationException();
- }
+ public Gadget combine(List<Gadget> states)
+ {
+ throw new UnsupportedOperationException();
+ }
- public void setState(StateContainer container, Gadget state) {
- try {
- ChromatticSession session = ((AbstractCustomization)container).session;
- String containerId = session.getId(container);
- Node node = session.getJCRSession().getNodeByUUID(containerId);
+ public void setState(StateContainer container, Gadget state)
+ {
+ try
+ {
+ ChromatticSession session = ((AbstractCustomization)container).session;
+ String containerId = session.getId(container);
+ Node node = session.getJCRSession().getNodeByUUID(containerId);
- //
- GadgetState prefs;
- if (node.hasNode("state")) {
- Node stateNode = node.getNode("state");
- prefs = (GadgetState)session.findById(Object.class, stateNode.getUUID());
- if (state == null) {
- session.remove(prefs);
- return;
- }
- } else {
- if (state == null) {
- return;
- } else {
- Node stateNode = node.addNode("state", "mop:gadget");
- prefs = (GadgetState)session.findById(Object.class, stateNode.getUUID());
- }
+ //
+ GadgetState prefs;
+ if (node.hasNode("state"))
+ {
+ Node stateNode = node.getNode("state");
+ prefs = (GadgetState)session.findById(Object.class, stateNode.getUUID());
+ if (state == null)
+ {
+ session.remove(prefs);
+ return;
+ }
+ }
+ else
+ {
+ if (state == null)
+ {
+ return;
+ }
+ else
+ {
+ Node stateNode = node.addNode("state", "mop:gadget");
+ prefs = (GadgetState)session.findById(Object.class, stateNode.getUUID());
+ }
+ }
+
+ //
+ prefs.setUserPrefs(state.getUserPref());
}
+ catch (RepositoryException e)
+ {
+ throw new UndeclaredRepositoryException(e);
+ }
+ }
- //
- prefs.setUserPrefs(state.getUserPref());
- }
- catch (RepositoryException e) {
- throw new UndeclaredRepositoryException(e);
- }
- }
+ public Gadget getState(StateContainer container)
+ {
+ try
+ {
+ ChromatticSession session = ((AbstractCustomization)container).session;
+ String containerId = session.getId(container);
+ Node node = session.getJCRSession().getNodeByUUID(containerId);
- public Gadget getState(StateContainer container) {
- try {
- ChromatticSession session = ((AbstractCustomization)container).session;
- String containerId = session.getId(container);
- Node node = session.getJCRSession().getNodeByUUID(containerId);
-
- //
- GadgetState prefs;
- if (node.hasNode("state")) {
- Node stateNode = node.getNode("state");
- prefs = (GadgetState)session.findById(Object.class, stateNode.getUUID());
- Gadget gadget = new Gadget();
- gadget.setUserPref(prefs.getUserPrefs());
- return gadget;
- } else {
- return null;
+ //
+ GadgetState prefs;
+ if (node.hasNode("state"))
+ {
+ Node stateNode = node.getNode("state");
+ prefs = (GadgetState)session.findById(Object.class, stateNode.getUUID());
+ Gadget gadget = new Gadget();
+ gadget.setUserPref(prefs.getUserPrefs());
+ return gadget;
+ }
+ else
+ {
+ return null;
+ }
}
- }
- catch (RepositoryException e) {
- throw new UndeclaredRepositoryException(e);
- }
- }
+ catch (RepositoryException e)
+ {
+ throw new UndeclaredRepositoryException(e);
+ }
+ }
- public Class<Gadget> getStateType() {
- return Gadget.class;
- }
+ public Class<Gadget> getStateType()
+ {
+ return Gadget.class;
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -26,12 +26,13 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:gadget")
-public abstract class GadgetState {
+public abstract class GadgetState
+{
- @Property(name = "prefs")
- public abstract String getUserPrefs();
+ @Property(name = "prefs")
+ public abstract String getUserPrefs();
- public abstract void setUserPrefs(String userPrefs);
+ public abstract void setUserPrefs(String userPrefs);
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletContentProvider.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -34,79 +34,101 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class PortletContentProvider implements ContentProvider<Preferences> {
+public class PortletContentProvider implements ContentProvider<Preferences>
+{
- public Preferences combine(List<Preferences> states) {
- Map<String, Preference> entries = new HashMap<String, Preference>();
+ public Preferences combine(List<Preferences> states)
+ {
+ Map<String, Preference> entries = new HashMap<String, Preference>();
- //
- for (Preferences preferences : states) {
- for (Preference preference : preferences) {
- Preference previous = entries.get(preference.getName());
- if (previous == null || !previous.isReadOnly()) {
- entries.put(preference.getName(), preference);
- }
+ //
+ for (Preferences preferences : states)
+ {
+ for (Preference preference : preferences)
+ {
+ Preference previous = entries.get(preference.getName());
+ if (previous == null || !previous.isReadOnly())
+ {
+ entries.put(preference.getName(), preference);
+ }
+ }
}
- }
- //
- return new Preferences(entries);
- }
+ //
+ return new Preferences(entries);
+ }
- public void setState(StateContainer container, Preferences state) {
- try {
- ChromatticSession session = ((AbstractCustomization)container).session;
- String containerId = session.getId(container);
- Node node = session.getJCRSession().getNodeByUUID(containerId);
+ public void setState(StateContainer container, Preferences state)
+ {
+ try
+ {
+ ChromatticSession session = ((AbstractCustomization)container).session;
+ String containerId = session.getId(container);
+ Node node = session.getJCRSession().getNodeByUUID(containerId);
- //
- PortletPreferencesState prefs;
- if (node.hasNode("state")) {
- Node stateNode = node.getNode("state");
- prefs = (PortletPreferencesState)session.findById(Object.class, stateNode.getUUID());
- if (state == null) {
- session.remove(prefs);
- return;
- }
- } else {
- if (state == null) {
- return;
- } else {
- Node stateNode = node.addNode("state", "mop:portletpreferences");
- prefs = (PortletPreferencesState)session.findById(Object.class, stateNode.getUUID());
- }
+ //
+ PortletPreferencesState prefs;
+ if (node.hasNode("state"))
+ {
+ Node stateNode = node.getNode("state");
+ prefs = (PortletPreferencesState)session.findById(Object.class, stateNode.getUUID());
+ if (state == null)
+ {
+ session.remove(prefs);
+ return;
+ }
+ }
+ else
+ {
+ if (state == null)
+ {
+ return;
+ }
+ else
+ {
+ Node stateNode = node.addNode("state", "mop:portletpreferences");
+ prefs = (PortletPreferencesState)session.findById(Object.class, stateNode.getUUID());
+ }
+ }
+
+ //
+ prefs.setPayload(state);
}
+ catch (RepositoryException e)
+ {
+ throw new UndeclaredRepositoryException(e);
+ }
+ }
- //
- prefs.setPayload(state);
- }
- catch (RepositoryException e) {
- throw new UndeclaredRepositoryException(e);
- }
- }
+ public Preferences getState(StateContainer container)
+ {
+ try
+ {
+ ChromatticSession session = ((AbstractCustomization)container).session;
+ String containerId = session.getId(container);
+ Node node = session.getJCRSession().getNodeByUUID(containerId);
- public Preferences getState(StateContainer container) {
- try {
- ChromatticSession session = ((AbstractCustomization)container).session;
- String containerId = session.getId(container);
- Node node = session.getJCRSession().getNodeByUUID(containerId);
-
- //
- PortletPreferencesState prefs;
- if (node.hasNode("state")) {
- Node stateNode = node.getNode("state");
- prefs = (PortletPreferencesState)session.findById(Object.class, stateNode.getUUID());
- return (Preferences)prefs.getPayload();
- } else {
- return null;
+ //
+ PortletPreferencesState prefs;
+ if (node.hasNode("state"))
+ {
+ Node stateNode = node.getNode("state");
+ prefs = (PortletPreferencesState)session.findById(Object.class, stateNode.getUUID());
+ return (Preferences)prefs.getPayload();
+ }
+ else
+ {
+ return null;
+ }
}
- }
- catch (RepositoryException e) {
- throw new UndeclaredRepositoryException(e);
- }
- }
+ catch (RepositoryException e)
+ {
+ throw new UndeclaredRepositoryException(e);
+ }
+ }
- public Class<Preferences> getStateType() {
- return Preferences.class;
- }
+ public Class<Preferences> getStateType()
+ {
+ return Preferences.class;
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletDefinition.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletDefinition.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletDefinition.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -24,24 +24,28 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class PortletDefinition {
+public class PortletDefinition
+{
- /** . */
- private final String name;
+ /** . */
+ private final String name;
- /** . */
- private final Preferences preferences;
+ /** . */
+ private final Preferences preferences;
- public PortletDefinition(String name, Preferences preferences) {
- this.name = name;
- this.preferences = preferences;
- }
+ public PortletDefinition(String name, Preferences preferences)
+ {
+ this.name = name;
+ this.preferences = preferences;
+ }
- public String getName() {
- return name;
- }
+ public String getName()
+ {
+ return name;
+ }
- public Preferences getPreferences() {
- return preferences;
- }
+ public Preferences getPreferences()
+ {
+ return preferences;
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferenceState.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferenceState.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferenceState.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -30,28 +30,29 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:portletpreference")
-public abstract class PortletPreferenceState {
+public abstract class PortletPreferenceState
+{
- @ManyToOne
- public abstract PortletPreferenceState getParent();
+ @ManyToOne
+ public abstract PortletPreferenceState getParent();
- @Name
- public abstract String getName();
+ @Name
+ public abstract String getName();
- @Property(name = "value")
- public abstract List<String> getValue();
+ @Property(name = "value")
+ public abstract List<String> getValue();
- public abstract void setValue(List<String> value);
+ public abstract void setValue(List<String> value);
- @Property(name = "value")
- public abstract List<String> getValues();
+ @Property(name = "value")
+ public abstract List<String> getValues();
- public abstract void setValues(List<String> value);
+ public abstract void setValues(List<String> value);
- @Property(name = "readonly")
- public abstract boolean getReadOnly();
+ @Property(name = "readonly")
+ public abstract boolean getReadOnly();
- public abstract void setReadOnly(boolean readOnly);
+ public abstract void setReadOnly(boolean readOnly);
}
\ No newline at end of file
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferencesState.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferencesState.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PortletPreferencesState.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -35,49 +35,56 @@
* @version $Revision$
*/
@NodeMapping(name = "mop:portletpreferences")
-public abstract class PortletPreferencesState {
+public abstract class PortletPreferencesState
+{
- /** . */
- private Preferences payload;
+ /** . */
+ private Preferences payload;
- @OneToMany
- public abstract Map<String, PortletPreferenceState> getChildren();
+ @OneToMany
+ public abstract Map<String, PortletPreferenceState> getChildren();
- @Create
- public abstract PortletPreferenceState create();
+ @Create
+ public abstract PortletPreferenceState create();
- @OneToOne
- @RelatedMappedBy("state")
- public abstract AbstractCustomization getCustomization();
+ @OneToOne
+ @RelatedMappedBy("state")
+ public abstract AbstractCustomization getCustomization();
- private void setPayload(Preferences payload) {
+ private void setPayload(Preferences payload)
+ {
- this.payload = payload;
+ this.payload = payload;
- //
- Map<String, PortletPreferenceState> entries = getChildren();
- entries.clear();
+ //
+ Map<String, PortletPreferenceState> entries = getChildren();
+ entries.clear();
- for (Preference pref : payload) {
- PortletPreferenceState prefState = create();
- entries.put(pref.getName(), prefState);
- prefState.setValue(pref.getValues());
- prefState.setReadOnly(pref.isReadOnly());
- }
- }
+ for (Preference pref : payload)
+ {
+ PortletPreferenceState prefState = create();
+ entries.put(pref.getName(), prefState);
+ prefState.setValue(pref.getValues());
+ prefState.setReadOnly(pref.isReadOnly());
+ }
+ }
- public void setPayload(Object payload) {
- setPayload((Preferences)payload);
- }
+ public void setPayload(Object payload)
+ {
+ setPayload((Preferences)payload);
+ }
- public Object getPayload() {
- if (payload == null) {
- PreferencesBuilder builder = new PreferencesBuilder();
- for (PortletPreferenceState entry : getChildren().values()) {
- builder.add(entry.getName(), entry.getValues(), entry.getReadOnly());
+ public Object getPayload()
+ {
+ if (payload == null)
+ {
+ PreferencesBuilder builder = new PreferencesBuilder();
+ for (PortletPreferenceState entry : getChildren().values())
+ {
+ builder.add(entry.getName(), entry.getValues(), entry.getReadOnly());
+ }
+ payload = builder.build();
}
- payload = builder.build();
- }
- return payload;
- }
+ return payload;
+ }
}
\ No newline at end of file
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preference.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preference.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preference.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -28,91 +28,110 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public final class Preference {
+public final class Preference
+{
- /** . */
- private final String name;
+ /** . */
+ private final String name;
- /** . */
- private final List<String> values;
+ /** . */
+ private final List<String> values;
- /** . */
- private final boolean readOnly;
+ /** . */
+ private final boolean readOnly;
- public Preference(String name, List<String> values, boolean readOnly) {
- if (name == null) {
- throw new NullPointerException();
- }
- if (values == null) {
- throw new NullPointerException();
- }
+ public Preference(String name, List<String> values, boolean readOnly)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ if (values == null)
+ {
+ throw new NullPointerException();
+ }
- // Clone and check state
- values = Collections.unmodifiableList(new ArrayList<String>(values));
- if (values.size() == 0) {
- throw new IllegalArgumentException();
- }
- for (String value : values) {
- if (value == null) {
- throw new IllegalArgumentException();
+ // Clone and check state
+ values = Collections.unmodifiableList(new ArrayList<String>(values));
+ if (values.size() == 0)
+ {
+ throw new IllegalArgumentException();
}
- }
+ for (String value : values)
+ {
+ if (value == null)
+ {
+ throw new IllegalArgumentException();
+ }
+ }
- //
- this.name = name;
- this.values = values;
- this.readOnly = readOnly;
- }
+ //
+ this.name = name;
+ this.values = values;
+ this.readOnly = readOnly;
+ }
- public Preference(String name, String value, boolean readOnly) {
- if (name == null) {
- throw new NullPointerException();
- }
- if (value == null) {
- throw new NullPointerException();
- }
+ public Preference(String name, String value, boolean readOnly)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ if (value == null)
+ {
+ throw new NullPointerException();
+ }
- //
- this.name = name;
- this.values = Collections.singletonList(value);
- this.readOnly = readOnly;
- }
+ //
+ this.name = name;
+ this.values = Collections.singletonList(value);
+ this.readOnly = readOnly;
+ }
- public String getName() {
- return name;
- }
+ public String getName()
+ {
+ return name;
+ }
- public String getValue() {
- return values.get(0);
- }
+ public String getValue()
+ {
+ return values.get(0);
+ }
- public List<String> getValues() {
- return values;
- }
+ public List<String> getValues()
+ {
+ return values;
+ }
- public boolean isReadOnly() {
- return readOnly;
- }
+ public boolean isReadOnly()
+ {
+ return readOnly;
+ }
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (obj instanceof Preference) {
- Preference that = (Preference)obj;
- return this.name.equals(that.name) && this.getValues().equals(that.getValues());
- }
- return false;
- }
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof Preference)
+ {
+ Preference that = (Preference)obj;
+ return this.name.equals(that.name) && this.getValues().equals(that.getValues());
+ }
+ return false;
+ }
- @Override
- public int hashCode() {
- return name.hashCode() ^ values.hashCode() ^ (readOnly ? -1 : 0);
- }
+ @Override
+ public int hashCode()
+ {
+ return name.hashCode() ^ values.hashCode() ^ (readOnly ? -1 : 0);
+ }
- @Override
- public String toString() {
- return "Preference[name=" + name + ",values=" + values + ",readOnly=" + readOnly + "]";
- }
+ @Override
+ public String toString()
+ {
+ return "Preference[name=" + name + ",values=" + values + ",readOnly=" + readOnly + "]";
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preferences.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preferences.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/Preferences.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -32,111 +32,136 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public final class Preferences implements Iterable<Preference> {
+public final class Preferences implements Iterable<Preference>
+{
- /** . */
- public static final ContentType<Preferences> CONTENT_TYPE = new ContentType<Preferences>("application/portlet", Preferences.class);
+ /** . */
+ public static final ContentType<Preferences> CONTENT_TYPE = new ContentType<Preferences>("application/portlet", Preferences.class);
- /** . */
- final Map<String, Preference> state;
+ /** . */
+ final Map<String, Preference> state;
- /** . */
- private final Map<String, Preference> entries;
+ /** . */
+ private final Map<String, Preference> entries;
- public Preferences() {
- this.state = new HashMap<String, Preference>();
- this.entries = Collections.unmodifiableMap(this.state);
- }
+ public Preferences()
+ {
+ this.state = new HashMap<String, Preference>();
+ this.entries = Collections.unmodifiableMap(this.state);
+ }
- public Preferences(Map<String, Preference> state) {
- if (state == null) {
- throw new NullPointerException();
- }
+ public Preferences(Map<String, Preference> state)
+ {
+ if (state == null)
+ {
+ throw new NullPointerException();
+ }
- //
- this.state = new HashMap<String, Preference>(state);
- this.entries = Collections.unmodifiableMap(this.state);
- }
+ //
+ this.state = new HashMap<String, Preference>(state);
+ this.entries = Collections.unmodifiableMap(this.state);
+ }
- public List<String> getValues(String name) {
- Preference entry = entries.get(name);
- return entry != null ? entry.getValues() : null;
- }
+ public List<String> getValues(String name)
+ {
+ Preference entry = entries.get(name);
+ return entry != null ? entry.getValues() : null;
+ }
- public Preferences setValues(String name, List<String> values) {
- Preference entry = entries.get(name);
- if (entry == null) {
- entry = new Preference(name, values, false);
- } else {
- entry = new Preference(entry.getName(), values, entry.isReadOnly());
- }
- entries.put(name, entry);
- return this;
- }
+ public Preferences setValues(String name, List<String> values)
+ {
+ Preference entry = entries.get(name);
+ if (entry == null)
+ {
+ entry = new Preference(name, values, false);
+ }
+ else
+ {
+ entry = new Preference(entry.getName(), values, entry.isReadOnly());
+ }
+ entries.put(name, entry);
+ return this;
+ }
- public String getValue(String name) {
- Preference entry = entries.get(name);
- return entry != null ? entry.getValue() : null;
- }
+ public String getValue(String name)
+ {
+ Preference entry = entries.get(name);
+ return entry != null ? entry.getValue() : null;
+ }
- public Preferences setValue(String name, String value) {
- Preference entry = entries.get(name);
- if (entry == null) {
- entry = new Preference(name, value, false);
- } else {
- entry = new Preference(entry.getName(), value, entry.isReadOnly());
- }
- state.put(name, entry);
- return this;
- }
+ public Preferences setValue(String name, String value)
+ {
+ Preference entry = entries.get(name);
+ if (entry == null)
+ {
+ entry = new Preference(name, value, false);
+ }
+ else
+ {
+ entry = new Preference(entry.getName(), value, entry.isReadOnly());
+ }
+ state.put(name, entry);
+ return this;
+ }
- public Boolean isReadOnly(String name) {
- Preference entry = entries.get(name);
- return entry != null ? entry.isReadOnly() : null;
- }
+ public Boolean isReadOnly(String name)
+ {
+ Preference entry = entries.get(name);
+ return entry != null ? entry.isReadOnly() : null;
+ }
- public Preferences setReadOnly(String name, boolean readOnly) {
- Preference entry = entries.get(name);
- if (entry == null) {
- throw new IllegalStateException();
- }
- entry = new Preference(entry.getName(), entry.getValues(), readOnly);
- state.put(name, entry);
- return this;
- }
+ public Preferences setReadOnly(String name, boolean readOnly)
+ {
+ Preference entry = entries.get(name);
+ if (entry == null)
+ {
+ throw new IllegalStateException();
+ }
+ entry = new Preference(entry.getName(), entry.getValues(), readOnly);
+ state.put(name, entry);
+ return this;
+ }
- public Preference getPreference(String name) {
- return entries.get(name);
- }
+ public Preference getPreference(String name)
+ {
+ return entries.get(name);
+ }
- public Preferences putPreference(Preference preference) {
- state.put(preference.getName(), preference);
- return this;
- }
+ public Preferences putPreference(Preference preference)
+ {
+ state.put(preference.getName(), preference);
+ return this;
+ }
- public Iterator<Preference> iterator() {
- return entries.values().iterator();
- }
+ public Iterator<Preference> iterator()
+ {
+ return entries.values().iterator();
+ }
- @Override
- public boolean equals(Object obj) {
- if (obj == this) {
- return true;
- }
- if (obj instanceof Preferences) {
- Preferences that = (Preferences)obj;
- return state.equals(that.state);
- }
- return false;
- }
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+ if (obj instanceof Preferences)
+ {
+ Preferences that = (Preferences)obj;
+ return state.equals(that.state);
+ }
+ return false;
+ }
- @Override
- public int hashCode() {
- return state.hashCode();
- }
+ @Override
+ public int hashCode()
+ {
+ return state.hashCode();
+ }
- @Override
- public String toString() {
- return "Preferences[state=" + state.toString() + "]";
- }
+ @Override
+ public String toString()
+ {
+ return "Preferences[state=" + state.toString() + "]";
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PreferencesBuilder.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PreferencesBuilder.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/portlet/PreferencesBuilder.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -24,68 +24,81 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class PreferencesBuilder {
+public class PreferencesBuilder
+{
- /** The state being configured. */
- private Preferences prefs;
+ /** The state being configured. */
+ private Preferences prefs;
- public PreferencesBuilder() {
- this.prefs = new Preferences();
- }
+ public PreferencesBuilder()
+ {
+ this.prefs = new Preferences();
+ }
- /**
- * Initialize the builder with the provided preferences.
- *
- * @param that the preferences to clone
- */
- public PreferencesBuilder(Preferences that) {
- Preferences prefs = new Preferences();
- prefs.state.putAll(that.state);
+ /**
+ * Initialize the builder with the provided preferences.
+ *
+ * @param that the preferences to clone
+ */
+ public PreferencesBuilder(Preferences that)
+ {
+ Preferences prefs = new Preferences();
+ prefs.state.putAll(that.state);
- //
- this.prefs = prefs;
- }
+ //
+ this.prefs = prefs;
+ }
- public PreferencesBuilder add(Preference preference) {
- if (preference == null) {
- throw new NullPointerException();
- }
- prefs.state.put(preference.getName(), preference);
- return this;
- }
+ public PreferencesBuilder add(Preference preference)
+ {
+ if (preference == null)
+ {
+ throw new NullPointerException();
+ }
+ prefs.state.put(preference.getName(), preference);
+ return this;
+ }
- public PreferencesBuilder add(String name, List<String> values, boolean readOnly) {
- return add(new Preference(name, values, readOnly));
- }
+ public PreferencesBuilder add(String name, List<String> values, boolean readOnly)
+ {
+ return add(new Preference(name, values, readOnly));
+ }
- public PreferencesBuilder add(String name, List<String> values) {
- return add(new Preference(name, values, false));
- }
+ public PreferencesBuilder add(String name, List<String> values)
+ {
+ return add(new Preference(name, values, false));
+ }
- public PreferencesBuilder add(String name, String value, boolean readOnly) {
- return add(new Preference(name, value, readOnly));
- }
+ public PreferencesBuilder add(String name, String value, boolean readOnly)
+ {
+ return add(new Preference(name, value, readOnly));
+ }
- public PreferencesBuilder add(String name, String value) {
- return add(name, value, false);
- }
+ public PreferencesBuilder add(String name, String value)
+ {
+ return add(name, value, false);
+ }
- public PreferencesBuilder remove(String name) {
- if (name == null) {
- throw new NullPointerException();
- }
- prefs.state.remove(name);
- return this;
- }
+ public PreferencesBuilder remove(String name)
+ {
+ if (name == null)
+ {
+ throw new NullPointerException();
+ }
+ prefs.state.remove(name);
+ return this;
+ }
- public PreferencesBuilder clear() {
- prefs.state.clear();
- return this;
- }
+ public PreferencesBuilder clear()
+ {
+ prefs.state.clear();
+ return this;
+ }
- public Preferences build() {
- Preferences tmp = prefs;
- prefs = new Preferences();
- return tmp;
- }
+ public Preferences build()
+ {
+ Preferences tmp = prefs;
+ prefs = new Preferences();
+ return tmp;
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/util/KeyTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/util/KeyTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/util/KeyTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -29,40 +29,44 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class KeyTestCase extends TestCase {
+public class KeyTestCase extends TestCase
+{
- public void testCreate() {
- Key<String> a = Key.create("a", ValueType.STRING);
- assertNotNull(a);
- assertEquals("a", a.getName());
+ public void testCreate()
+ {
+ Key<String> a = Key.create("a", ValueType.STRING);
+ assertNotNull(a);
+ assertEquals("a", a.getName());
- //
- Key<Integer> b = Key.create("a", ValueType.INTEGER);
- assertNotNull(b);
- assertEquals("a", b.getName());
+ //
+ Key<Integer> b = Key.create("a", ValueType.INTEGER);
+ assertNotNull(b);
+ assertEquals("a", b.getName());
- //
- Key<Boolean> c = Key.create("a", ValueType.BOOLEAN);
- assertNotNull(c);
- assertEquals("a", c.getName());
+ //
+ Key<Boolean> c = Key.create("a", ValueType.BOOLEAN);
+ assertNotNull(c);
+ assertEquals("a", c.getName());
- //
- Key<Date> d = Key.create("a", ValueType.DATE);
- assertNotNull(d);
- assertEquals("a", d.getName());
+ //
+ Key<Date> d = Key.create("a", ValueType.DATE);
+ assertNotNull(d);
+ assertEquals("a", d.getName());
- //
- Key<Double> e = Key.create("a", ValueType.DOUBLE);
- assertNotNull(e);
- assertEquals("a", e.getName());
+ //
+ Key<Double> e = Key.create("a", ValueType.DOUBLE);
+ assertNotNull(e);
+ assertEquals("a", e.getName());
- //
- try {
- Key.create("a", null);
- fail();
- }
- catch (NullPointerException ignore) {
- }
- }
+ //
+ try
+ {
+ Key.create("a", null);
+ fail();
+ }
+ catch (NullPointerException ignore)
+ {
+ }
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/util/ToolsTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/util/ToolsTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/util/ToolsTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -28,13 +28,15 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class ToolsTestCase extends TestCase {
+public class ToolsTestCase extends TestCase
+{
- public void testIterators() {
- List<String> s1 = Arrays.asList();
- List<String> s2 = Arrays.asList("a");
- List<String> s3 = Arrays.asList("b", "c");
- Iterator<String> it = Tools.iterator(s1.iterator(), s2.iterator(), s3.iterator());
- assertEquals(Arrays.asList("a", "b", "c"), Tools.list(it));
- }
+ public void testIterators()
+ {
+ List<String> s1 = Arrays.asList();
+ List<String> s2 = Arrays.asList("a");
+ List<String> s3 = Arrays.asList("b", "c");
+ Iterator<String> it = Tools.iterator(s1.iterator(), s2.iterator(), s3.iterator());
+ assertEquals(Arrays.asList("a", "b", "c"), Tools.list(it));
+ }
}
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/util/ValueTypeTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/util/ValueTypeTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/util/ValueTypeTestCase.java 2009-11-23 17:22:31 UTC (rev 768)
@@ -27,86 +27,95 @@
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
* @version $Revision$
*/
-public class ValueTypeTestCase extends TestCase {
+public class ValueTypeTestCase extends TestCase
+{
- public void testGet() {
- assertEquals(ValueType.INTEGER, ValueType.get(5));
- assertEquals(ValueType.BOOLEAN, ValueType.get(true));
- assertEquals(ValueType.STRING, ValueType.get(""));
- assertEquals(ValueType.DATE, ValueType.get(new Date()));
- assertEquals(ValueType.DOUBLE, ValueType.get(0.5D));
- try {
- ValueType.get(null);
- fail();
- }
- catch (NullPointerException ignore) {
- }
- try {
- ValueType.get(new Object());
- fail();
- }
- catch (IllegalArgumentException ignore) {
- }
- }
+ public void testGet()
+ {
+ assertEquals(ValueType.INTEGER, ValueType.get(5));
+ assertEquals(ValueType.BOOLEAN, ValueType.get(true));
+ assertEquals(ValueType.STRING, ValueType.get(""));
+ assertEquals(ValueType.DATE, ValueType.get(new Date()));
+ assertEquals(ValueType.DOUBLE, ValueType.get(0.5D));
+ try
+ {
+ ValueType.get(null);
+ fail();
+ }
+ catch (NullPointerException ignore)
+ {
+ }
+ try
+ {
+ ValueType.get(new Object());
+ fail();
+ }
+ catch (IllegalArgumentException ignore)
+ {
+ }
+ }
- public void testDecode() {
- assertEquals(ValueType.INTEGER, ValueType.decode(5));
- assertEquals(ValueType.BOOLEAN, ValueType.decode(true));
- assertEquals(ValueType.STRING, ValueType.decode(""));
- assertEquals(ValueType.DATE, ValueType.decode(new Date()));
- assertEquals(ValueType.DOUBLE, ValueType.decode(0.5D));
- assertEquals(null, ValueType.decode(null));
- assertEquals(null, ValueType.decode(new Object()));
- }
+ public void testDecode()
+ {
+ assertEquals(ValueType.INTEGER, ValueType.decode(5));
+ assertEquals(ValueType.BOOLEAN, ValueType.decode(true));
+ assertEquals(ValueType.STRING, ValueType.decode(""));
+ assertEquals(ValueType.DATE, ValueType.decode(new Date()));
+ assertEquals(ValueType.DOUBLE, ValueType.decode(0.5D));
+ assertEquals(null, ValueType.decode(null));
+ assertEquals(null, ValueType.decode(new Object()));
+ }
- public void testAccept() {
- assertTrue(ValueType.INTEGER.isInstance(5));
- assertFalse(ValueType.INTEGER.isInstance(""));
- assertFalse(ValueType.INTEGER.isInstance(new Date()));
- assertFalse(ValueType.INTEGER.isInstance(true));
- assertFalse(ValueType.INTEGER.isInstance(0.5D));
- assertFalse(ValueType.INTEGER.isInstance(null));
- assertFalse(ValueType.INTEGER.isInstance(new Object()));
+ public void testAccept()
+ {
+ assertTrue(ValueType.INTEGER.isInstance(5));
+ assertFalse(ValueType.INTEGER.isInstance(""));
+ assertFalse(ValueType.INTEGER.isInstance(new Date()));
+ assertFalse(ValueType.INTEGER.isInstance(true));
+ assertFalse(ValueType.INTEGER.isInstance(0.5D));
+ assertFalse(ValueType.INTEGER.isInstance(null));
+ assertFalse(ValueType.INTEGER.isInstance(new Object()));
- //
- assertFalse(ValueType.BOOLEAN.isInstance(5));
- assertFalse(ValueType.BOOLEAN.isInstance(""));
- assertFalse(ValueType.BOOLEAN.isInstance(new Date()));
- assertTrue(ValueType.BOOLEAN.isInstance(true));
- assertFalse(ValueType.BOOLEAN.isInstance(0.5D));
- assertFalse(ValueType.BOOLEAN.isInstance(null));
- assertFalse(ValueType.BOOLEAN.isInstance(new Object()));
+ //
+ assertFalse(ValueType.BOOLEAN.isInstance(5));
+ assertFalse(ValueType.BOOLEAN.isInstance(""));
+ assertFalse(ValueType.BOOLEAN.isInstance(new Date()));
+ assertTrue(ValueType.BOOLEAN.isInstance(true));
+ assertFalse(ValueType.BOOLEAN.isInstance(0.5D));
+ assertFalse(ValueType.BOOLEAN.isInstance(null));
+ assertFalse(ValueType.BOOLEAN.isInstance(new Object()));
- //
- assertFalse(ValueType.DATE.isInstance(5));
- assertFalse(ValueType.DATE.isInstance(""));
- assertTrue(ValueType.DATE.isInstance(new Date()));
- assertFalse(ValueType.DATE.isInstance(true));
- assertFalse(ValueType.DATE.isInstance(0.5D));
- assertFalse(ValueType.DATE.isInstance(null));
- assertFalse(ValueType.DATE.isInstance(new Object()));
+ //
+ assertFalse(ValueType.DATE.isInstance(5));
+ assertFalse(ValueType.DATE.isInstance(""));
+ assertTrue(ValueType.DATE.isInstance(new Date()));
+ assertFalse(ValueType.DATE.isInstance(true));
+ assertFalse(ValueType.DATE.isInstance(0.5D));
+ assertFalse(ValueType.DATE.isInstance(null));
+ assertFalse(ValueType.DATE.isInstance(new Object()));
- //
- assertFalse(ValueType.STRING.isInstance(5));
- assertTrue(ValueType.STRING.isInstance(""));
- assertFalse(ValueType.STRING.isInstance(new Date()));
- assertFalse(ValueType.STRING.isInstance(true));
- assertFalse(ValueType.STRING.isInstance(0.5D));
- assertFalse(ValueType.STRING.isInstance(null));
- assertFalse(ValueType.STRING.isInstance(new Object()));
+ //
+ assertFalse(ValueType.STRING.isInstance(5));
+ assertTrue(ValueType.STRING.isInstance(""));
+ assertFalse(ValueType.STRING.isInstance(new Date()));
+ assertFalse(ValueType.STRING.isInstance(true));
+ assertFalse(ValueType.STRING.isInstance(0.5D));
+ assertFalse(ValueType.STRING.isInstance(null));
+ assertFalse(ValueType.STRING.isInstance(new Object()));
- //
- assertFalse(ValueType.DOUBLE.isInstance(5));
- assertFalse(ValueType.DOUBLE.isInstance(""));
- assertFalse(ValueType.DOUBLE.isInstance(new Date()));
- assertFalse(ValueType.DOUBLE.isInstance(true));
- assertTrue(ValueType.DOUBLE.isInstance(0.5D));
- assertFalse(ValueType.DOUBLE.isInstance(null));
- assertFalse(ValueType.DOUBLE.isInstance(new Object()));
- }
+ //
+ assertFalse(ValueType.DOUBLE.isInstance(5));
+ assertFalse(ValueType.DOUBLE.isInstance(""));
+ assertFalse(ValueType.DOUBLE.isInstance(new Date()));
+ assertFalse(ValueType.DOUBLE.isInstance(true));
+ assertTrue(ValueType.DOUBLE.isInstance(0.5D));
+ assertFalse(ValueType.DOUBLE.isInstance(null));
+ assertFalse(ValueType.DOUBLE.isInstance(new Object()));
+ }
- public void testCast() {
- // todo
- }
+ public void testCast()
+ {
+ // todo
+ }
}
15 years, 1 month
gatein SVN: r767 - in components/mop/trunk/core: src/main/java/org/gatein/mop/core/api/workspace and 2 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-11-23 12:17:11 -0500 (Mon, 23 Nov 2009)
New Revision: 767
Added:
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/NavigationTestCase.java
Modified:
components/mop/trunk/core/pom.xml
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationContainer.java
components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationImpl.java
components/mop/trunk/core/src/main/resources/conf/mop-nodetypes.xml
Log:
GTNMOP-12 : Supporting ordered children in the navigation
Modified: components/mop/trunk/core/pom.xml
===================================================================
--- components/mop/trunk/core/pom.xml 2009-11-23 16:44:55 UTC (rev 766)
+++ components/mop/trunk/core/pom.xml 2009-11-23 17:17:11 UTC (rev 767)
@@ -70,6 +70,16 @@
</dependency>
<dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-common</artifactId>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-logging</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>org.chromattic</groupId>
<artifactId>chromattic.exo</artifactId>
<scope>test</scope>
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationContainer.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationContainer.java 2009-11-23 16:44:55 UTC (rev 766)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationContainer.java 2009-11-23 17:17:11 UTC (rev 767)
@@ -24,6 +24,7 @@
import org.chromattic.api.annotations.Create;
import org.chromattic.api.annotations.RelatedMappedBy;
+import java.util.List;
import java.util.Map;
/**
@@ -38,14 +39,18 @@
public abstract NavigationImpl getOwner();
@OneToMany
- public abstract Map<String, NavigationImpl> getNavigations();
+ public abstract Map<String, NavigationImpl> getNavigationMap();
+ @OneToMany
+ public abstract List<NavigationImpl> getNavigationList();
+
@Create
public abstract NavigationImpl createNavigation();
public NavigationImpl addNavigation(String name) {
NavigationImpl page = createNavigation();
- getNavigations().put(name, page);
+ page.setName(name);
+ getNavigationList().add(page);
return page;
}
}
\ No newline at end of file
Modified: components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationImpl.java
===================================================================
--- components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationImpl.java 2009-11-23 16:44:55 UTC (rev 766)
+++ components/mop/trunk/core/src/main/java/org/gatein/mop/core/api/workspace/NavigationImpl.java 2009-11-23 17:17:11 UTC (rev 767)
@@ -33,7 +33,7 @@
import org.gatein.mop.api.workspace.Site;
import org.gatein.mop.api.workspace.link.PageLink;
-import java.util.Collection;
+import java.util.List;
/**
* @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
@@ -98,9 +98,9 @@
}
}
- public Collection<? extends Navigation> getChildren() {
+ public List<? extends Navigation> getChildren() {
NavigationContainer childrenContainer = getChildrenContainer();
- return childrenContainer.getNavigations().values();
+ return childrenContainer.getNavigationList();
}
public Navigation getChild(String name) {
@@ -108,7 +108,7 @@
throw new NullPointerException();
}
NavigationContainer childrenContainer = getChildrenContainer();
- return childrenContainer.getNavigations().get(name);
+ return childrenContainer.getNavigationMap().get(name);
}
public NavigationImpl addChild(String name) {
Modified: components/mop/trunk/core/src/main/resources/conf/mop-nodetypes.xml
===================================================================
--- components/mop/trunk/core/src/main/resources/conf/mop-nodetypes.xml 2009-11-23 16:44:55 UTC (rev 766)
+++ components/mop/trunk/core/src/main/resources/conf/mop-nodetypes.xml 2009-11-23 17:17:11 UTC (rev 767)
@@ -230,7 +230,7 @@
</childNodeDefinitions>
</nodeType>
- <nodeType name="mop:navigationcontainer" isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+ <nodeType name="mop:navigationcontainer" isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
<supertypes>
<supertype>nt:base</supertype>
<supertype>mix:referenceable</supertype>
Added: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/NavigationTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/NavigationTestCase.java (rev 0)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/NavigationTestCase.java 2009-11-23 17:17:11 UTC (rev 767)
@@ -0,0 +1,49 @@
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
+ *
+ * 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.gatein.mop.core.api.workspace;
+
+import org.gatein.mop.api.workspace.Navigation;
+import org.gatein.mop.api.workspace.ObjectType;
+import org.gatein.mop.api.workspace.Site;
+import org.gatein.mop.core.api.AbstractPOMTestCase;
+import org.gatein.mop.core.api.ModelImpl;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:julien.viet@exoplatform.com">Julien Viet</a>
+ * @version $Revision$
+ */
+public class NavigationTestCase extends AbstractPOMTestCase
+{
+ public void testNavigationOrder()
+ {
+ ModelImpl model = pomService.getModel();
+ Site portal = model.getWorkspace().addSite(ObjectType.PORTAL_SITE, "portal_for_navigation");
+ Navigation root = portal.getRootNavigation();
+ Navigation n1 = root.addChild("1");
+ Navigation n2 = root.addChild("2");
+ Navigation n3 = root.addChild("3");
+ List<? extends Navigation> ns = root.getChildren();
+ assertEquals(3, ns.size());
+ assertSame(n1, ns.get(0));
+ assertSame(n2, ns.get(1));
+ assertSame(n3, ns.get(2));
+ }
+}
15 years, 1 month
gatein SVN: r766 - in components/mop/trunk: core/src/test/java/org/gatein/mop/core/support and 2 other directories.
by do-not-reply@jboss.org
Author: julien_viet
Date: 2009-11-23 11:44:55 -0500 (Mon, 23 Nov 2009)
New Revision: 766
Modified:
components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/QueryTestCase.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/Gadget.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java
components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java
components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java
Log:
update wrong license header
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/QueryTestCase.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/QueryTestCase.java 2009-11-23 16:31:52 UTC (rev 765)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/api/workspace/QueryTestCase.java 2009-11-23 16:44:55 UTC (rev 766)
@@ -1,18 +1,20 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * 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 General Public License
- * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ * 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.gatein.mop.core.api.workspace;
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java 2009-11-23 16:31:52 UTC (rev 765)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/TestMOPService.java 2009-11-23 16:44:55 UTC (rev 766)
@@ -1,18 +1,20 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * 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 General Public License
- * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ * 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.gatein.mop.core.support;
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/Gadget.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/Gadget.java 2009-11-23 16:31:52 UTC (rev 765)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/Gadget.java 2009-11-23 16:44:55 UTC (rev 766)
@@ -1,18 +1,20 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * 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 General Public License
- * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ * 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.gatein.mop.core.support.content.gadget;
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java 2009-11-23 16:31:52 UTC (rev 765)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetContentProvider.java 2009-11-23 16:44:55 UTC (rev 766)
@@ -1,18 +1,20 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * 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 General Public License
- * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ * 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.gatein.mop.core.support.content.gadget;
Modified: components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java
===================================================================
--- components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java 2009-11-23 16:31:52 UTC (rev 765)
+++ components/mop/trunk/core/src/test/java/org/gatein/mop/core/support/content/gadget/GadgetState.java 2009-11-23 16:44:55 UTC (rev 766)
@@ -1,18 +1,20 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * 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 General Public License
- * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ * 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.gatein.mop.core.support.content.gadget;
Modified: components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java
===================================================================
--- components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java 2009-11-23 16:31:52 UTC (rev 765)
+++ components/mop/trunk/spi/src/main/java/org/gatein/mop/spi/content/StateContainer.java 2009-11-23 16:44:55 UTC (rev 766)
@@ -1,18 +1,20 @@
-/*
- * Copyright (C) 2003-2007 eXo Platform SAS.
+/**
+ * Copyright (C) 2009 eXo Platform SAS.
*
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Affero General Public License
- * as published by the Free Software Foundation; either version 3
- * of the License, or (at your option) any later version.
+ * 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 program is distributed in the hope that it will be useful,
+ * 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 General Public License for more details.
+ * 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 General Public License
- * along with this program; if not, see<http://www.gnu.org/licenses/>.
+ * 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.gatein.mop.spi.content;
15 years, 1 month
gatein SVN: r765 - in components/wci/trunk: .settings and 14 other directories.
by do-not-reply@jboss.org
Author: thomas.heute(a)jboss.com
Date: 2009-11-23 11:31:52 -0500 (Mon, 23 Nov 2009)
New Revision: 765
Added:
components/wci/trunk/.classpath
components/wci/trunk/.settings/org.maven.ide.eclipse.prefs
Modified:
components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java
components/wci/trunk/pom.xml
components/wci/trunk/test/core/
components/wci/trunk/test/core/pom.xml
components/wci/trunk/test/portlets/exo-portlet/
components/wci/trunk/test/portlets/gatein-portlet/
components/wci/trunk/test/portlets/native-portlet/
components/wci/trunk/test/servers/
components/wci/trunk/test/servers/jboss42/
components/wci/trunk/test/servers/jboss42/pom.xml
components/wci/trunk/test/servers/jboss51/
components/wci/trunk/test/servers/jboss51/pom.xml
components/wci/trunk/test/servers/src/common/resources/common.xml
components/wci/trunk/test/servers/tomcat6/
components/wci/trunk/test/servers/tomcat6/pom.xml
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java
components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6WebAppContext.java
components/wci/trunk/wci/pom.xml
components/wci/trunk/wci/src/main/java/org/gatein/wci/endpoint/EndPointServlet.java
components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/DefaultServletContainer.java
Log:
Update common and dep
Adding Eclipse files
Added: components/wci/trunk/.classpath
===================================================================
--- components/wci/trunk/.classpath (rev 0)
+++ components/wci/trunk/.classpath 2009-11-23 16:31:52 UTC (rev 765)
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="wci/target/classes" path="wci/src/main/java"/>
+ <classpathentry kind="src" output="exo/target/classes" path="exo/src/main/java"/>
+ <classpathentry kind="src" output="tomcat/target/classes" path="tomcat/src/main/java"/>
+ <classpathentry kind="src" output="jetty/target/classes" path="jetty/src/main/java"/>
+ <classpathentry kind="src" output="test/target/test-classes" path="test/src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="test/target/test-classes" path="test/src/test/resources"/>
+ <classpathentry kind="src" output="test/core/target/classes" path="test/core/src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="test/core/target/classes" path="test/core/src/main/resources"/>
+ <classpathentry excluding="**" kind="src" output="test/core/target/test-classes" path="test/core/src/test/resources"/>
+ <classpathentry excluding="**" kind="src" output="test/servers/tomcat6/target/test-classes" path="test/servers/tomcat6/src/test/resources"/>
+ <classpathentry excluding="**" kind="src" output="test/servers/jboss42/target/test-classes" path="test/servers/jboss42/src/test/resources"/>
+ <classpathentry excluding="**" kind="src" output="test/servers/jboss51/target/test-classes" path="test/servers/jboss51/src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: components/wci/trunk/.settings/org.maven.ide.eclipse.prefs
===================================================================
--- components/wci/trunk/.settings/org.maven.ide.eclipse.prefs (rev 0)
+++ components/wci/trunk/.settings/org.maven.ide.eclipse.prefs 2009-11-23 16:31:52 UTC (rev 765)
@@ -0,0 +1,9 @@
+#Mon Nov 23 09:05:12 CET 2009
+activeProfiles=
+eclipse.preferences.version=1
+fullBuildGoals=process-test-resources
+includeModules=true
+resolveWorkspaceProjects=true
+resourceFilterGoals=process-resources resources\:testResources
+skipCompilerPlugin=true
+version=1
Modified: components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java
===================================================================
--- components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java 2009-11-23 15:50:38 UTC (rev 764)
+++ components/wci/trunk/jetty/src/main/java/org/gatein/wci/jetty/Jetty6WebAppContext.java 2009-11-23 16:31:52 UTC (rev 765)
@@ -36,9 +36,6 @@
public class Jetty6WebAppContext implements WebAppContext
{
- /** The logger. */
-// protected final Logger log = Logger.getLogger(getClass());
-
/** . */
private Document descriptor;
Modified: components/wci/trunk/pom.xml
===================================================================
--- components/wci/trunk/pom.xml 2009-11-23 15:50:38 UTC (rev 764)
+++ components/wci/trunk/pom.xml 2009-11-23 16:31:52 UTC (rev 765)
@@ -22,15 +22,13 @@
</scm>
<properties>
- <version.gatein.common>2.0.0-Beta03</version.gatein.common>
+ <version.gatein.common>2.0.0-CR02</version.gatein.common>
<version.junit>3.8.2-brew</version.junit>
<version.jaxb>2.1</version.jaxb>
<version.jetty>6.1.21</version.jetty>
<version.jaxen>1.0-FCS</version.jaxen>
<version.saxpath>1.0-FCS</version.saxpath>
-
- <version.apache.commons-logging>1.1.0.jboss</version.apache.commons-logging>
<!-- used in test module by maven-antrun-extended-plugin -->
<version.jboss.unit>1.2.3</version.jboss.unit>
@@ -44,7 +42,7 @@
<dependency>
<groupId>org.gatein</groupId>
<artifactId>gatein-dep</artifactId>
- <version>1.0.0-Beta02</version>
+ <version>1.0.0-Beta03</version>
<type>pom</type>
<scope>import</scope>
</dependency>
@@ -60,8 +58,12 @@
<artifactId>common-mc</artifactId>
<version>${version.gatein.common}</version>
</dependency>
-
<dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-logging</artifactId>
+ <version>${version.gatein.common}</version>
+ </dependency>
+ <dependency>
<groupId>org.gatein.wci</groupId>
<artifactId>wci-wci</artifactId>
<version>${project.version}</version>
@@ -98,13 +100,7 @@
<artifactId>jetty-util</artifactId>
<version>${version.jetty}</version>
</dependency>
-
- <dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <version>${version.apache.commons-logging}</version>
- </dependency>
- <dependency>
+ <dependency>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
<version>${version.jaxen}</version>
@@ -119,6 +115,7 @@
<artifactId>jaxb-api</artifactId>
<version>${version.jaxb}</version>
</dependency>
+
</dependencies>
</dependencyManagement>
Property changes on: components/wci/trunk/test/core
___________________________________________________________________
Name: svn:ignore
+ target
Modified: components/wci/trunk/test/core/pom.xml
===================================================================
--- components/wci/trunk/test/core/pom.xml 2009-11-23 15:50:38 UTC (rev 764)
+++ components/wci/trunk/test/core/pom.xml 2009-11-23 16:31:52 UTC (rev 765)
@@ -40,8 +40,16 @@
<groupId>org.gatein.common</groupId>
<artifactId>common-mc</artifactId>
</dependency>
-
<dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-logging</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
<groupId>org.jboss.unit</groupId>
<artifactId>jboss-unit</artifactId>
</dependency>
Property changes on: components/wci/trunk/test/portlets/exo-portlet
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: components/wci/trunk/test/portlets/gatein-portlet
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: components/wci/trunk/test/portlets/native-portlet
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: components/wci/trunk/test/servers
___________________________________________________________________
Name: svn:ignore
+ target
Property changes on: components/wci/trunk/test/servers/jboss42
___________________________________________________________________
Name: svn:ignore
+ target
Modified: components/wci/trunk/test/servers/jboss42/pom.xml
===================================================================
--- components/wci/trunk/test/servers/jboss42/pom.xml 2009-11-23 15:50:38 UTC (rev 764)
+++ components/wci/trunk/test/servers/jboss42/pom.xml 2009-11-23 16:31:52 UTC (rev 765)
@@ -69,6 +69,21 @@
<artifactId>common-mc</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-logging</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
<!-- JBOSS UNIT DEPENDENCIES -->
<dependency>
<groupId>org.jboss.unit</groupId>
@@ -273,6 +288,9 @@
<property name="dependency.jboss-logging-jdk.jar" value="${maven.dependency.jboss.jboss-common-logging-jdk.jar.path}" />
<property name="dependency.jboss-logging-log4j.jar" value="${maven.dependency.jboss.jboss-common-logging-log4j.jar.path}" />
<property name="dependency.gatein-common-common.jar" value="${maven.dependency.org.gatein.common.common-common.jar.path}" />
+ <property name="dependency.gatein-common-logging.jar" value="${maven.dependency.org.gatein.common.common-logging.jar.path}" />
+ <property name="dependency.slf4j-api.jar" value="${maven.dependency.org.slf4j.slf4j-api.jar.path}" />
+ <property name="dependency.slf4j-simple.jar" value="${maven.dependency.org.slf4j.slf4j-simple.jar.path}" />
<property name="dependency.log4j.jar" value="${maven.dependency.apache-log4j.log4j.jar.path}" />
<property name="dependency.activation.jar" value="${maven.dependency.javax.activation.activation.jar.path}" />
<property name="dependency.junit.jar" value="${maven.dependency.junit.junit.jar.path}" />
Property changes on: components/wci/trunk/test/servers/jboss51
___________________________________________________________________
Name: svn:ignore
+ target
Modified: components/wci/trunk/test/servers/jboss51/pom.xml
===================================================================
--- components/wci/trunk/test/servers/jboss51/pom.xml 2009-11-23 15:50:38 UTC (rev 764)
+++ components/wci/trunk/test/servers/jboss51/pom.xml 2009-11-23 16:31:52 UTC (rev 765)
@@ -69,6 +69,11 @@
<artifactId>common-mc</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-logging</artifactId>
+ <scope>test</scope>
+ </dependency>
<!-- JBOSS UNIT DEPENDENCIES -->
<dependency>
<groupId>org.jboss.unit</groupId>
@@ -273,7 +278,7 @@
<property name="dependency.jboss-logging-jdk.jar" value="${maven.dependency.jboss.jboss-common-logging-jdk.jar.path}" />
<property name="dependency.jboss-logging-log4j.jar" value="${maven.dependency.jboss.jboss-common-logging-log4j.jar.path}" />
<property name="dependency.gatein-common-common.jar" value="${maven.dependency.org.gatein.common.common-common.jar.path}" />
- <property name="dependency.log4j.jar" value="${maven.dependency.apache-log4j.log4j.jar.path}" />
+ <property name="dependency.gatein-common-logging.jar" value="${maven.dependency.org.gatein.common.common-logging.jar.path}" />
<property name="dependency.activation.jar" value="${maven.dependency.javax.activation.activation.jar.path}" />
<property name="dependency.junit.jar" value="${maven.dependency.junit.junit.jar.path}" />
<property name="dependency.gatein-wci-core.jar" value="${maven.dependency.org.gatein.wci.wci-wci.jar.path}" />
Modified: components/wci/trunk/test/servers/src/common/resources/common.xml
===================================================================
--- components/wci/trunk/test/servers/src/common/resources/common.xml 2009-11-23 15:50:38 UTC (rev 764)
+++ components/wci/trunk/test/servers/src/common/resources/common.xml 2009-11-23 16:31:52 UTC (rev 765)
@@ -22,7 +22,11 @@
</path>
<path id="gatein-common-shared">
- <pathelement path="${dependency.gatein-common-common.jar}"/>
+ <path path="${dependency.gatein-common-common.jar}"/>
+
+ <path path="${dependency.gatein-common-logging.jar}"/>
+ <path path="${dependency.slf4j-api.jar}"/>
+ <path path="${dependency.slf4j-simple.jar}"/>
</path>
<target name="mkdirs">
Property changes on: components/wci/trunk/test/servers/tomcat6
___________________________________________________________________
Name: svn:ignore
+ target
Modified: components/wci/trunk/test/servers/tomcat6/pom.xml
===================================================================
--- components/wci/trunk/test/servers/tomcat6/pom.xml 2009-11-23 15:50:38 UTC (rev 764)
+++ components/wci/trunk/test/servers/tomcat6/pom.xml 2009-11-23 16:31:52 UTC (rev 765)
@@ -69,6 +69,21 @@
<artifactId>common-mc</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-logging</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-api</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.slf4j</groupId>
+ <artifactId>slf4j-simple</artifactId>
+ <scope>test</scope>
+ </dependency>
<!-- JBOSS UNIT DEPENDENCIES -->
<dependency>
<groupId>org.jboss.unit</groupId>
@@ -273,7 +288,9 @@
<property name="dependency.jboss-logging-jdk.jar" value="${maven.dependency.jboss.jboss-common-logging-jdk.jar.path}" />
<property name="dependency.jboss-logging-log4j.jar" value="${maven.dependency.jboss.jboss-common-logging-log4j.jar.path}" />
<property name="dependency.gatein-common-common.jar" value="${maven.dependency.org.gatein.common.common-common.jar.path}" />
- <property name="dependency.log4j.jar" value="${maven.dependency.apache-log4j.log4j.jar.path}" />
+ <property name="dependency.gatein-common-logging.jar" value="${maven.dependency.org.gatein.common.common-logging.jar.path}" />
+ <property name="dependency.slf4j-api.jar" value="${maven.dependency.org.slf4j.slf4j-api.jar.path}" />
+ <property name="dependency.slf4j-simple.jar" value="${maven.dependency.org.slf4j.slf4j-simple.jar.path}" />
<property name="dependency.activation.jar" value="${maven.dependency.javax.activation.activation.jar.path}" />
<property name="dependency.junit.jar" value="${maven.dependency.junit.junit.jar.path}" />
<property name="dependency.gatein-wci-core.jar" value="${maven.dependency.org.gatein.wci.wci-wci.jar.path}" />
Modified: components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java
===================================================================
--- components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java 2009-11-23 15:50:38 UTC (rev 764)
+++ components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6ServletContainerContext.java 2009-11-23 16:31:52 UTC (rev 765)
@@ -31,12 +31,13 @@
import org.apache.catalina.Lifecycle;
import org.apache.catalina.LifecycleEvent;
import org.apache.catalina.LifecycleListener;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
import org.gatein.wci.RequestDispatchCallback;
import org.gatein.wci.command.CommandDispatcher;
import org.gatein.wci.impl.DefaultServletContainerFactory;
import org.gatein.wci.spi.ServletContainerContext;
import org.apache.catalina.core.StandardContext;
-import org.apache.log4j.Logger;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -54,7 +55,7 @@
*/
public class TC6ServletContainerContext implements ServletContainerContext, ContainerListener, LifecycleListener
{
- private final static Logger log = Logger.getLogger(TC6ServletContainerContext.class);
+ private final static Logger log = LoggerFactory.getLogger(TC6ServletContainerContext.class);
/** . */
private final CommandDispatcher dispatcher = new CommandDispatcher("/tomcatgateinservlet");
Modified: components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6WebAppContext.java
===================================================================
--- components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6WebAppContext.java 2009-11-23 15:50:38 UTC (rev 764)
+++ components/wci/trunk/tomcat/src/main/java/org/gatein/wci/tomcat/TC6WebAppContext.java 2009-11-23 16:31:52 UTC (rev 765)
@@ -39,9 +39,6 @@
public class TC6WebAppContext implements WebAppContext
{
- /** The logger. */
-// protected final Logger log = Logger.getLogger(getClass());
-
/** . */
private Document descriptor;
Modified: components/wci/trunk/wci/pom.xml
===================================================================
--- components/wci/trunk/wci/pom.xml 2009-11-23 15:50:38 UTC (rev 764)
+++ components/wci/trunk/wci/pom.xml 2009-11-23 16:31:52 UTC (rev 765)
@@ -43,10 +43,6 @@
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty</artifactId>
</dependency>
- <dependency>
- <groupId>apache-log4j</groupId>
- <artifactId>log4j</artifactId>
- </dependency>
<!-- SCOPE TEST -->
<dependency>
@@ -90,16 +86,6 @@
<scope>test</scope>
</dependency>
<dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-jdk</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>jboss</groupId>
- <artifactId>jboss-common-logging-log4j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>org.jboss.remoting</groupId>
<artifactId>jboss-remoting</artifactId>
</dependency>
@@ -123,12 +109,8 @@
<artifactId>jboss-serialization</artifactId>
<scope>test</scope>
</dependency>
+
<dependency>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
<groupId>commons-httpclient</groupId>
<artifactId>commons-httpclient</artifactId>
<scope>test</scope>
Modified: components/wci/trunk/wci/src/main/java/org/gatein/wci/endpoint/EndPointServlet.java
===================================================================
--- components/wci/trunk/wci/src/main/java/org/gatein/wci/endpoint/EndPointServlet.java 2009-11-23 15:50:38 UTC (rev 764)
+++ components/wci/trunk/wci/src/main/java/org/gatein/wci/endpoint/EndPointServlet.java 2009-11-23 16:31:52 UTC (rev 765)
@@ -28,10 +28,11 @@
import org.w3c.dom.Document;
import org.gatein.common.xml.XMLTools;
import org.gatein.common.io.IOTools;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
import org.gatein.common.text.FastURLDecoder;
import org.gatein.wci.WebRequest;
import org.gatein.wci.WebResponse;
-import org.apache.log4j.Logger;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
@@ -58,7 +59,7 @@
{
/** . */
- private final static Logger log = Logger.getLogger(EndPointServlet.class);
+ private final static Logger log = LoggerFactory.getLogger(EndPointServlet.class);
/** . */
private FastURLDecoder decoder = FastURLDecoder.getUTF8Instance();
Modified: components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/DefaultServletContainer.java
===================================================================
--- components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/DefaultServletContainer.java 2009-11-23 15:50:38 UTC (rev 764)
+++ components/wci/trunk/wci/src/main/java/org/gatein/wci/impl/DefaultServletContainer.java 2009-11-23 16:31:52 UTC (rev 765)
@@ -32,7 +32,8 @@
import org.gatein.wci.ServletContainer;
import org.gatein.wci.WebExecutor;
import org.gatein.common.NotYetImplemented;
-import org.apache.log4j.Logger;
+import org.gatein.common.logging.Logger;
+import org.gatein.common.logging.LoggerFactory;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
@@ -52,7 +53,7 @@
*/
public class DefaultServletContainer implements ServletContainer
{
- private final static Logger log = Logger.getLogger(ServletContainer.class);
+ private final static Logger log = LoggerFactory.getLogger(ServletContainer.class);
/** . */
private final Object lock = new Object();
15 years, 1 month
gatein SVN: r764 - in portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp: state/producer/configuration and 1 other directories.
by do-not-reply@jboss.org
Author: chris.laprun(a)jboss.com
Date: 2009-11-23 10:50:38 -0500 (Mon, 23 Nov 2009)
New Revision: 764
Modified:
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
Log:
- First pass at producer configuration persistence.
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java 2009-11-23 14:43:45 UTC (rev 763)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java 2009-11-23 15:50:38 UTC (rev 764)
@@ -32,6 +32,7 @@
import org.gatein.pc.portlet.state.StateConverter;
import org.gatein.pc.portlet.state.producer.ProducerPortletInvoker;
import org.gatein.portal.wsrp.state.consumer.JCRConsumerRegistry;
+import org.gatein.portal.wsrp.state.producer.configuration.JCRProducerConfigurationService;
import org.gatein.registration.RegistrationManager;
import org.gatein.registration.RegistrationPersistenceManager;
import org.gatein.registration.impl.RegistrationManagerImpl;
@@ -44,8 +45,6 @@
import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
import org.gatein.wsrp.producer.ProducerHolder;
import org.gatein.wsrp.producer.WSRPProducer;
-import org.gatein.wsrp.producer.config.ProducerConfigurationService;
-import org.gatein.wsrp.producer.config.impl.xml.SimpleXMLProducerConfigurationService;
import org.picocontainer.Startable;
import java.io.InputStream;
@@ -96,7 +95,8 @@
private void startProducer(ExoContainer container)
{
- ProducerConfigurationService producerConfigurationService = new SimpleXMLProducerConfigurationService(configurationIS);
+ JCRProducerConfigurationService producerConfigurationService = new JCRProducerConfigurationService();
+ producerConfigurationService.setDefaultConfigurationIS(configurationIS);
try
{
producerConfigurationService.reloadConfiguration();
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2009-11-23 14:43:45 UTC (rev 763)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2009-11-23 15:50:38 UTC (rev 764)
@@ -24,8 +24,14 @@
import org.chromattic.api.ChromatticSession;
import org.gatein.portal.wsrp.state.JCRPersister;
+import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
+import org.gatein.portal.wsrp.state.producer.configuration.mapping.ProducerConfigurationMapping;
+import org.gatein.portal.wsrp.state.producer.configuration.mapping.RegistrationRequirementsMapping;
+import org.gatein.wsrp.producer.config.ProducerConfigurationService;
import org.gatein.wsrp.producer.config.impl.AbstractProducerConfigurationService;
+import org.gatein.wsrp.producer.config.impl.xml.SimpleXMLProducerConfigurationService;
+import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -39,21 +45,69 @@
private JCRPersister persister;
private static String PRODUCER_CONFIGURATION_PATH = JCRPersister.WSRP_SERVICES_PATH + "producerconfiguration";
+ private InputStream defaultConfigurationIS;
+
public JCRProducerConfigurationService()
{
- List<Class> mappingClasses = new ArrayList<Class>();
- Collections.addAll(mappingClasses, null);
+ List<Class> mappingClasses = new ArrayList<Class>(3);
+ Collections.addAll(mappingClasses, ProducerConfigurationMapping.class, RegistrationRequirementsMapping.class,
+ RegistrationPropertyDescriptionMapping.class);
}
+ /**
+ * todo: remove
+ *
+ * @param is
+ * @deprecated this should be removed when a better initialization of default is setup
+ */
+ public void setDefaultConfigurationIS(InputStream is)
+ {
+ this.defaultConfigurationIS = is;
+ }
+
protected void loadConfiguration() throws Exception
{
+ // Try loading configuration from JCR first
ChromatticSession session = persister.getSession();
+ ProducerConfigurationMapping pcm = session.findByPath(ProducerConfigurationMapping.class, PRODUCER_CONFIGURATION_PATH);
- //todo
+ // if we don't have a configuration persisted in JCR already, force a reload from XML and save the resulting configuration
+ pcm = saveConfiguration(session, pcm, true);
+
+ configuration = pcm.toProducerConfiguration();
+
}
public void saveConfiguration() throws Exception
{
- //todo
+ ChromatticSession session = persister.getSession();
+
+ saveConfiguration(session, session.findByPath(ProducerConfigurationMapping.class, PRODUCER_CONFIGURATION_PATH), false);
}
+
+ private ProducerConfigurationMapping saveConfiguration(ChromatticSession session, ProducerConfigurationMapping pcm, boolean forceReloadFromXML) throws Exception
+ {
+ if (pcm == null)
+ {
+ pcm = session.insert(ProducerConfigurationMapping.class, PRODUCER_CONFIGURATION_PATH);
+ }
+
+ if (configuration == null)
+ {
+ // if we don't already have a configuration, check if we want to reload it from XML
+ if (forceReloadFromXML)
+ {
+ ProducerConfigurationService service = new SimpleXMLProducerConfigurationService(defaultConfigurationIS);
+
+ service.reloadConfiguration();
+ configuration = service.getConfiguration();
+ }
+
+ pcm.initFrom(configuration);
+
+ session.persist(pcm);
+ }
+
+ return pcm;
+ }
}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java 2009-11-23 14:43:45 UTC (rev 763)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java 2009-11-23 15:50:38 UTC (rev 764)
@@ -26,6 +26,9 @@
import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.Property;
import org.chromattic.api.annotations.RelatedMappedBy;
+import org.gatein.wsrp.producer.config.ProducerConfiguration;
+import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
+import org.gatein.wsrp.producer.config.impl.ProducerConfigurationImpl;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris Laprun</a>
@@ -44,4 +47,24 @@
@OneToOne
@RelatedMappedBy("registrationrequirements")
public abstract RegistrationRequirementsMapping getRegistrationRequirements();
+
+ public void initFrom(ProducerConfiguration configuration)
+ {
+ setUsingStrictMode(configuration.isUsingStrictMode());
+
+ RegistrationRequirementsMapping rrm = getRegistrationRequirements();
+ rrm.initFrom(configuration.getRegistrationRequirements());
+ }
+
+ public ProducerConfiguration toProducerConfiguration()
+ {
+ ProducerConfigurationImpl configuration = new ProducerConfigurationImpl();
+
+ configuration.setUsingStrictMode(getUsingStrictMode());
+
+ ProducerRegistrationRequirements req = getRegistrationRequirements().toProducerRegistrationRequirements();
+ configuration.setRegistrationRequirements(req);
+
+ return configuration;
+ }
}
Modified: portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
===================================================================
--- portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java 2009-11-23 14:43:45 UTC (rev 763)
+++ portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java 2009-11-23 15:50:38 UTC (rev 764)
@@ -27,6 +27,9 @@
import org.chromattic.api.annotations.OneToMany;
import org.chromattic.api.annotations.Property;
import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
+import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
+import org.gatein.wsrp.producer.config.impl.ProducerRegistrationRequirementsImpl;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
import java.util.List;
@@ -54,4 +57,35 @@
@Create
public abstract RegistrationPropertyDescriptionMapping create();
+
+ public void initFrom(ProducerRegistrationRequirements registrationRequirements)
+ {
+ setRegistrationRequired(registrationRequirements.isRegistrationRequired());
+ setRegistrationRequiredForFullDescription(registrationRequirements.isRegistrationRequiredForFullDescription());
+
+ List<RegistrationPropertyDescriptionMapping> rpdms = getRegistrationPropertyDescriptions();
+ for (RegistrationPropertyDescription desc : registrationRequirements.getRegistrationProperties().values())
+ {
+ RegistrationPropertyDescriptionMapping rpdm = create();
+
+ rpdm.initFrom(desc);
+
+ rpdms.add(rpdm);
+ }
+ }
+
+ public ProducerRegistrationRequirements toProducerRegistrationRequirements()
+ {
+ ProducerRegistrationRequirements req = new ProducerRegistrationRequirementsImpl();
+
+ req.setRegistrationRequired(getRegistrationRequired());
+ req.setRegistrationRequiredForFullDescription(getRegistrationRequiredForFullDescription());
+
+ for (RegistrationPropertyDescriptionMapping rpdm : getRegistrationPropertyDescriptions())
+ {
+ req.addRegistrationProperty(rpdm.toRegistrationPropertyDescription());
+ }
+
+ return req;
+ }
}
15 years, 1 month