Author: thomas.heute(a)jboss.com
Date: 2009-12-22 07:35:37 -0500 (Tue, 22 Dec 2009)
New Revision: 1126
Added:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/NewJCRPersister.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerCapabilitiesMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationPropertiesMapping.java
portal/trunk/component/wsrp/src/test/
portal/trunk/component/wsrp/src/test/java/
portal/trunk/component/wsrp/src/test/java/org/
portal/trunk/component/wsrp/src/test/java/org/gatein/
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
portal/trunk/component/wsrp/src/test/resources/
portal/trunk/component/wsrp/src/test/resources/conf/
portal/trunk/component/wsrp/src/test/resources/conf/consumers-configuration-nodetypes.xml
portal/trunk/component/wsrp/src/test/resources/conf/test-configuration.xml
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerSelector.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPopup.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
Removed:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyDescriptionMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerCapabilitiesMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationPropertiesMapping.java
portal/trunk/component/wsrp/src/test/java/
portal/trunk/component/wsrp/src/test/java/org/
portal/trunk/component/wsrp/src/test/java/org/gatein/
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
portal/trunk/component/wsrp/src/test/resources/conf/
portal/trunk/component/wsrp/src/test/resources/conf/consumers-configuration-nodetypes.xml
portal/trunk/component/wsrp/src/test/resources/conf/test-configuration.xml
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPopup.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/wsrp-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
Modified:
portal/trunk/component/common/pom.xml
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/Safe.java
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java
portal/trunk/component/wsrp/pom.xml
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfosMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java
portal/trunk/packaging/profiles.xml
portal/trunk/pom.xml
portal/trunk/portlet/exoadmin/pom.xml
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/gatein-resources.xml
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
portal/trunk/portlet/web/src/main/webapp/WEB-INF/gatein-resources.xml
portal/trunk/portlet/web/src/main/webapp/WEB-INF/portlet.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIApplication.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java
Log:
Merging changes done in wsrp-integration branch
- Configuration persistence
- Admin UI portlet
Modified: portal/trunk/component/common/pom.xml
===================================================================
--- portal/trunk/component/common/pom.xml 2009-12-22 10:02:32 UTC (rev 1125)
+++ portal/trunk/component/common/pom.xml 2009-12-22 12:35:37 UTC (rev 1126)
@@ -36,6 +36,10 @@
<artifactId>common-logging</artifactId>
</dependency>
<dependency>
+ <groupId>org.gatein.common</groupId>
+ <artifactId>common-common</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.exoplatform.kernel</groupId>
<artifactId>exo.kernel.commons</artifactId>
</dependency>
Modified:
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/Safe.java
===================================================================
---
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/Safe.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/component/common/src/main/java/org/exoplatform/commons/utils/Safe.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,16 +1,16 @@
/**
* 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
@@ -19,8 +19,11 @@
package org.exoplatform.commons.utils;
+import org.gatein.common.io.IOTools;
+
import java.io.Closeable;
import java.io.IOException;
+import java.io.InputStream;
/**
* A class that contains utility method that make the caller not worry much about the
unexpectable expected such as
@@ -37,8 +40,8 @@
}
/**
- * Return true if both objects are null or both are non null and the equals method of
one object returns true when
- * it is invoked with the other object as argument.
+ * Return true if both objects are null or both are non null and the equals method of
one object returns true when it
+ * is invoked with the other object as argument.
*
* @param o1 the first object
* @param o2 the second object
@@ -57,8 +60,8 @@
}
/**
- * Close a closable object. The provided object may be null or thrown an IOException
or a runtime exception during the
- * invocation of the close method without changing the control flow of the method
caller. If the closeable was
+ * Close a closable object. The provided object may be null or thrown an IOException
or a runtime exception during
+ * the invocation of the close method without changing the control flow of the method
caller. If the closeable was
* succesfully closed the method returns true.
*
* @param closeable the closeable
@@ -82,4 +85,29 @@
}
return false;
}
+
+ public static byte[] getBytes(InputStream is)
+ {
+ byte[] bytes;
+
+ if (is == null)
+ {
+ return null;
+ }
+
+ try
+ {
+ bytes = IOTools.getBytes(is);
+ return bytes;
+ }
+ catch (IOException ignore)
+ {
+ // todo: should log
+ return null;
+ }
+ finally
+ {
+ IOTools.safeClose(is);
+ }
+ }
}
Modified:
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java
===================================================================
---
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/component/portal/src/main/java/org/exoplatform/portal/pom/spi/wsrp/WSRPContentProvider.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -19,15 +19,13 @@
package org.exoplatform.portal.pom.spi.wsrp;
+import org.exoplatform.commons.utils.Safe;
import org.exoplatform.portal.pom.spi.ContentProviderHelper;
import org.exoplatform.portal.pom.spi.HelpableContentProvider;
-import org.gatein.common.io.IOTools;
import org.gatein.mop.spi.content.ContentProvider;
import org.gatein.mop.spi.content.StateContainer;
import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
import java.util.List;
/**
@@ -74,31 +72,10 @@
persistedState.setCloned(updatedState.isCloned());
}
- private byte[] getBytes(InputStream is)
- {
- byte[] bytes;
-
- if (is == null)
- {
- return null;
- }
-
- try
- {
- bytes = IOTools.getBytes(is);
- }
- catch (IOException e)
- {
- throw new RuntimeException("Couldn't get bytes from WSRPState",
e); // todo: log instead?
- }
- IOTools.safeClose(is);
- return bytes;
- }
-
public WSRP getState(WSRPState state)
{
WSRP wsrp = new WSRP();
- byte[] bytes = getBytes(state.getState());
+ byte[] bytes = Safe.getBytes(state.getState());
wsrp.setState(bytes);
wsrp.setPortletId(state.getPortletId());
wsrp.setCloned(state.getCloned());
Modified: portal/trunk/component/wsrp/pom.xml
===================================================================
--- portal/trunk/component/wsrp/pom.xml 2009-12-22 10:02:32 UTC (rev 1125)
+++ portal/trunk/component/wsrp/pom.xml 2009-12-22 12:35:37 UTC (rev 1126)
@@ -21,7 +21,8 @@
~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-->
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>org.exoplatform.portal</groupId>
<artifactId>exo.portal.component</artifactId>
@@ -72,9 +73,57 @@
<version>${project.version}</version>
<scope>provided</scope>
</dependency>
+
<dependency>
+ <groupId>org.exoplatform.jcr</groupId>
+ <artifactId>exo.jcr.component.ext</artifactId>
+ <version>${org.exoplatform.jcr.version}</version>
+ </dependency>
+ <dependency>
<groupId>org.chromattic</groupId>
<artifactId>chromattic.api</artifactId>
+ <scope>provided</scope>
</dependency>
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.core</artifactId>
+ <version>${version.chromattic}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.spi</artifactId>
+ <version>${version.chromattic}</version>
+ </dependency>
+
+ <!-- Required to process Chromattic annotations -->
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.apt</artifactId>
+ <version>${version.chromattic}</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <!-- tests -->
+ <dependency>
+ <groupId>org.exoplatform.portal</groupId>
+ <artifactId>exo.portal.component.test.jcr</artifactId>
+ <version>${project.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <excludes>
+ <exclude>org/gatein/portal/wsrp/**</exclude>
+ </excludes>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
</project>
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/ExoKernelIntegration.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,5 +1,9 @@
-/**
- * Copyright (C) 2009 eXo Platform SAS.
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
@@ -31,21 +35,21 @@
import org.gatein.pc.portlet.impl.state.producer.PortletStatePersistenceManagerService;
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.portal.wsrp.state.producer.registrations.JCRRegistrationPersistenceManager;
import org.gatein.registration.RegistrationManager;
import org.gatein.registration.RegistrationPersistenceManager;
import org.gatein.registration.impl.RegistrationManagerImpl;
-import org.gatein.registration.impl.RegistrationPersistenceManagerImpl;
import org.gatein.registration.policies.DefaultRegistrationPolicy;
import org.gatein.registration.policies.DefaultRegistrationPropertyValidator;
import org.gatein.wsrp.api.SessionEvent;
import org.gatein.wsrp.api.SessionEventBroadcaster;
import org.gatein.wsrp.api.SessionEventListener;
import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
-import org.gatein.wsrp.consumer.registry.xml.XMLConsumerRegistry;
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;
@@ -58,32 +62,37 @@
*/
public class ExoKernelIntegration implements Startable
{
- private static final String DEFAULT_PRODUCER_CONFIG_LOCATION =
"conf/wsrp-producer-config.xml";
-
private static final String CLASSPATH = "classpath:/";
+ private static final String PRODUCER_CONFIG_LOCATION =
"producerConfigLocation";
+ private static final String CONSUMERS_CONFIG_LOCATION =
"consumersConfigLocation";
+ private static final String WORKSPACE_NAME = "workspaceName";
+ private static final String REPOSITORY_NAME = "repositoryName";
private final InputStream configurationIS;
-
- private String configLocation;
-
+ private final String producerConfigLocation;
private WSRPProducer producer;
+ private final String consumersConfigLocation;
private ConsumerRegistry consumerRegistry;
public ExoKernelIntegration(InitParams params, ConfigurationManager
configurationManager,
org.exoplatform.portal.pc.ExoKernelIntegration pc) throws
Exception
{
+ // IMPORTANT: even though PC ExoKernelIntegration is not used anywhere in the code,
it's still needed for pico
+ // to properly make sure that this service is started after the PC one. Yes, Pico
is crap. :/
+
if (params != null)
{
- configLocation = params.getValueParam("configLocation").getValue();
+ producerConfigLocation =
params.getValueParam(PRODUCER_CONFIG_LOCATION).getValue();
+ consumersConfigLocation =
params.getValueParam(CONSUMERS_CONFIG_LOCATION).getValue();
}
-
- if (configLocation == null)
+ else
{
- configLocation = DEFAULT_PRODUCER_CONFIG_LOCATION;
+ throw new IllegalArgumentException("Improperly configured service: missing
values for "
+ + PRODUCER_CONFIG_LOCATION + "and " + CONSUMERS_CONFIG_LOCATION);
}
- configurationIS = configurationManager.getInputStream(CLASSPATH + configLocation);
+ configurationIS = configurationManager.getInputStream(CLASSPATH +
producerConfigLocation);
}
public void start()
@@ -96,17 +105,29 @@
private void startProducer(ExoContainer container)
{
- ProducerConfigurationService producerConfigurationService = new
SimpleXMLProducerConfigurationService();
+ JCRProducerConfigurationService producerConfigurationService;
try
{
- producerConfigurationService.loadConfigurationFrom(configurationIS);
+ producerConfigurationService = new JCRProducerConfigurationService(container);
+ producerConfigurationService.setDefaultConfigurationIS(configurationIS);
+ producerConfigurationService.reloadConfiguration();
}
catch (Exception e)
{
- throw new RuntimeException("Couldn't load WSRP producer configuration
from " + configLocation, e);
+ throw new RuntimeException("Couldn't load WSRP producer configuration
from " + producerConfigLocation, e);
}
+ container.registerComponentInstance(ProducerConfigurationService.class,
producerConfigurationService);
- RegistrationPersistenceManager registrationPersistenceManager = new
RegistrationPersistenceManagerImpl();
+ RegistrationPersistenceManager registrationPersistenceManager = null;
+ try
+ {
+ registrationPersistenceManager = new
JCRRegistrationPersistenceManager(container);
+// registrationPersistenceManager = new RegistrationPersistenceManagerImpl();
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException("Couln't instantiate
RegistrationPersistenceManager", e);
+ }
RegistrationManager registrationManager = new RegistrationManagerImpl();
registrationManager.setPersistenceManager(registrationPersistenceManager);
@@ -152,18 +173,18 @@
FederatingPortletInvoker federatingPortletInvoker =
(FederatingPortletInvoker)container.getComponentInstanceOfType(PortletInvoker.class);
- consumerRegistry = new XMLConsumerRegistry();
- consumerRegistry.setFederatingPortletInvoker(federatingPortletInvoker);
- consumerRegistry.setSessionEventBroadcaster(new SimpleSessionEventBroadcaster());
-
try
{
+ consumerRegistry = new JCRConsumerRegistry(container);
+ consumerRegistry.setFederatingPortletInvoker(federatingPortletInvoker);
+ consumerRegistry.setSessionEventBroadcaster(new
SimpleSessionEventBroadcaster());
consumerRegistry.start();
}
catch (Exception e)
{
throw new RuntimeException("Couldn't start WSRP consumers
registry.", e);
}
+ container.registerComponentInstance(ConsumerRegistry.class, consumerRegistry);
}
public void stop()
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
(from rev 751,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/JCRPersister.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,173 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.gatein.portal.wsrp.state;
+
+import org.chromattic.api.Chromattic;
+import org.chromattic.api.ChromatticBuilder;
+import org.chromattic.api.ChromatticSession;
+import org.chromattic.api.format.FormatterContext;
+import org.chromattic.api.format.ObjectFormatter;
+import org.chromattic.spi.jcr.SessionLifeCycle;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.services.jcr.RepositoryService;
+import org.exoplatform.services.jcr.core.ManageableRepository;
+import org.exoplatform.services.jcr.ext.common.SessionProvider;
+
+import javax.jcr.Credentials;
+import javax.jcr.RepositoryException;
+import javax.jcr.Session;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class JCRPersister
+{
+ private Chromattic chrome;
+ private static final String WORKSPACE_NAME = "wsrp-system";
+ private static final String REPOSITORY_NAME = "repository";
+
+ public JCRPersister(ExoContainer container)
+ {
+ }
+
+ public void initializeBuilderFor(List<Class> mappingClasses) throws Exception
+ {
+ ChromatticBuilder builder = ChromatticBuilder.create();
+ builder.setOption(ChromatticBuilder.INSTRUMENTOR_CLASSNAME,
"org.chromattic.apt.InstrumentorImpl");
+ builder.setOption(ChromatticBuilder.SESSION_LIFECYCLE_CLASSNAME,
WSRPSessionLifeCycle.class.getName());
+
+ for (Class mappingClass : mappingClasses)
+ {
+ builder.add(mappingClass);
+ }
+
+ chrome = builder.build();
+ }
+
+ public ChromatticSession getSession()
+ {
+ return chrome.openSession();
+ }
+
+ public void closeSession(ChromatticSession session, boolean save)
+ {
+ if (save)
+ {
+ session.save();
+ }
+ session.close();
+ }
+
+
+ public static class WSRPSessionLifeCycle implements SessionLifeCycle
+ {
+ private ManageableRepository repository;
+ private SessionProvider provider;
+
+ public WSRPSessionLifeCycle()
+ {
+ try
+ {
+ ExoContainer container = ExoContainerContext.getCurrentContainer();
+ RepositoryService repoService =
(RepositoryService)container.getComponentInstanceOfType(RepositoryService.class);
+ repository = repoService.getRepository(REPOSITORY_NAME);
+ }
+ catch (Exception e)
+ {
+ throw new RuntimeException(e);
+ }
+
+ provider = SessionProvider.createSystemProvider();
+ }
+
+ public Session login() throws RepositoryException
+ {
+ return provider.getSession(WORKSPACE_NAME, repository);
+ }
+
+ public Session login(String s) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Session login(Credentials credentials, String s) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public Session login(Credentials credentials) throws RepositoryException
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ public void save(Session session) throws RepositoryException
+ {
+ session.save();
+ }
+
+ public void close(Session session)
+ {
+ session.logout();
+ }
+ }
+
+ public static class QNameFormatter implements ObjectFormatter
+ {
+ private static final String OPEN_BRACE_REPLACEMENT = "-__";
+ private static final String CLOSE_BRACE_REPLACEMENT = "__-";
+ private static final String COLON_REPLACEMENT = "_-_";
+
+ public String decodeNodeName(FormatterContext formatterContext, String s)
+ {
+ return decode(s);
+ }
+
+ public String encodeNodeName(FormatterContext formatterContext, String s)
+ {
+ return encode(s);
+ }
+
+ public String decodePropertyName(FormatterContext formatterContext, String s)
+ {
+ return decode(s);
+ }
+
+ public String encodePropertyName(FormatterContext formatterContext, String s)
+ {
+ return encode(s);
+ }
+
+ private String decode(String s)
+ {
+ return s.replace(CLOSE_BRACE_REPLACEMENT,
"}").replace(OPEN_BRACE_REPLACEMENT, "{").replace(COLON_REPLACEMENT,
":");
+ }
+
+ private String encode(String s)
+ {
+ return s.replace("{", OPEN_BRACE_REPLACEMENT).replace("}",
CLOSE_BRACE_REPLACEMENT).replace(":", COLON_REPLACEMENT);
+ }
+ }
+}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/NewJCRPersister.java
(from rev 1078,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/NewJCRPersister.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/NewJCRPersister.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/NewJCRPersister.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,132 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.gatein.portal.wsrp.state;
+
+import org.chromattic.api.ChromatticSession;
+import org.chromattic.api.format.FormatterContext;
+import org.chromattic.api.format.ObjectFormatter;
+import org.exoplatform.commons.chromattic.ChromatticLifeCycle;
+import org.exoplatform.commons.chromattic.ChromatticManager;
+import org.exoplatform.commons.chromattic.SessionContext;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.component.RequestLifeCycle;
+
+import java.util.concurrent.atomic.AtomicBoolean;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class NewJCRPersister
+{
+ private AtomicBoolean initialized = new AtomicBoolean(false);
+ private ChromatticManager manager;
+ private ChromatticLifeCycle lifeCycle;
+ private ExoContainer container;
+
+ /** Same as defined in wsrp-configuration.xml */
+ private static final String LIFECYCLE_NAME = "wsrp";
+
+ private static class InstanceHolder
+ {
+ static final NewJCRPersister instance = new NewJCRPersister();
+ }
+
+ private NewJCRPersister()
+ {
+ }
+
+ public ChromatticSession getSession()
+ {
+ manager.beginRequest();
+// lifeCycle.openContext();
+ return lifeCycle.getChromattic().openSession();
+ }
+
+ public void closeSession(ChromatticSession session, boolean save)
+ {
+ session.save();
+ session.close();
+// lifeCycle.closeContext(save);
+ manager.endRequest(save);
+ }
+
+ public static NewJCRPersister getInstance(ExoContainer container)
+ {
+ // get the singleton
+ NewJCRPersister persister = InstanceHolder.instance;
+
+ // if it hasn't been initialized, do it
+ if (!persister.initialized.get())
+ {
+ persister.initWith(container);
+ }
+
+ return persister;
+ }
+
+ private synchronized void initWith(ExoContainer container)
+ {
+ this.container = container;
+ manager = (ChromatticManager)
container.getComponentInstanceOfType(ChromatticManager.class);
+ lifeCycle = manager.getLifeCycle(LIFECYCLE_NAME);
+ initialized.set(true);
+ }
+
+ public static class QNameFormatter implements ObjectFormatter
+ {
+ private static final String OPEN_BRACE_REPLACEMENT = "-__";
+ private static final String CLOSE_BRACE_REPLACEMENT = "__-";
+ private static final String COLON_REPLACEMENT = "_-_";
+
+ public String decodeNodeName(FormatterContext formatterContext, String s)
+ {
+ return decode(s);
+ }
+
+ public String encodeNodeName(FormatterContext formatterContext, String s)
+ {
+ return encode(s);
+ }
+
+ public String decodePropertyName(FormatterContext formatterContext, String s)
+ {
+ return decode(s);
+ }
+
+ public String encodePropertyName(FormatterContext formatterContext, String s)
+ {
+ return encode(s);
+ }
+
+ private String decode(String s)
+ {
+ return s.replace(CLOSE_BRACE_REPLACEMENT,
"}").replace(OPEN_BRACE_REPLACEMENT, "{").replace(COLON_REPLACEMENT,
":");
+ }
+
+ private String encode(String s)
+ {
+ return s.replace("{", OPEN_BRACE_REPLACEMENT).replace("}",
CLOSE_BRACE_REPLACEMENT).replace(":", COLON_REPLACEMENT);
+ }
+ }
+}
\ No newline at end of file
Deleted:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistry.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,221 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
- * contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.gatein.portal.wsrp.state.consumer;
-
-import org.chromattic.api.Chromattic;
-import org.chromattic.api.ChromatticBuilder;
-import org.chromattic.api.ChromatticSession;
-import org.exoplatform.container.xml.InitParams;
-import org.exoplatform.services.jcr.ext.registry.RegistryService;
-import org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping;
-import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping;
-import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping;
-import org.gatein.portal.wsrp.state.consumer.mapping.RegistrationInfoMapping;
-import
org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyDescriptionMapping;
-import org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping;
-import org.gatein.wsrp.WSRPConsumer;
-import org.gatein.wsrp.consumer.ProducerInfo;
-import org.gatein.wsrp.consumer.registry.AbstractConsumerRegistry;
-import org.gatein.wsrp.consumer.registry.xml.XMLConsumerRegistry;
-
-import java.util.Iterator;
-import java.util.List;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-public class ConsumerRegistry extends AbstractConsumerRegistry
-{
- private Chromattic chrome;
- private static final String WSRP_SERVICES_PATH = RegistryService.EXO_SERVICES +
"/wsrp/";
- private static final String PRODUCER_INFOS_PATH = WSRP_SERVICES_PATH +
"producerinfos";
-
- public ConsumerRegistry(InitParams params, RegistryService jcrRegistry) throws
Exception
- {
-
- ChromatticBuilder builder = ChromatticBuilder.create();
- builder.setOption(ChromatticBuilder.INSTRUMENTOR_CLASSNAME,
"org.chromattic.apt.InstrumentorImpl");
-
- builder.add(ProducerInfosMapping.class);
- builder.add(ProducerInfoMapping.class);
- builder.add(EndpointInfoMapping.class);
- builder.add(RegistrationInfoMapping.class);
- builder.add(RegistrationPropertyMapping.class);
- builder.add(RegistrationPropertyDescriptionMapping.class);
-
- chrome = builder.build();
- }
-
- @Override
- protected void save(ProducerInfo info, String messageOnError)
- {
- String path = getPathFor(info);
- ChromatticSession session = chrome.openSession();
-
- session.persist(toProducerInfoMapping(info), path);
-
- // todo: find a way to inject JCR Id into ProducerInfo
-
- session.close();
- }
-
- @Override
- protected void delete(ProducerInfo info)
- {
- ChromatticSession session = chrome.openSession();
- delete(session, getPathFor(info));
-
- session.close();
- }
-
- @Override
- protected String update(ProducerInfo producerInfo)
- {
- // todo: need JCR id to be able to find the previous ProducerInfo in case the id
has been modified
- return null;
- }
-
- @Override
- protected Iterator getAllProducerInfos()
- {
- ChromatticSession session = chrome.openSession();
- ProducerInfosMapping producerInfosMapping =
session.findByPath(ProducerInfosMapping.class, PRODUCER_INFOS_PATH);
-
- Iterator<ProducerInfo> producerInfos;
-
- // if we don't have info from JCR, load from XML and populate JCR
- if (producerInfosMapping == null)
- {
- producerInfosMapping = session.insert(ProducerInfosMapping.class,
PRODUCER_INFOS_PATH);
-
- List<ProducerInfoMapping> infos =
producerInfosMapping.getProducerInfos();
-
- // Load from XML
- XMLConsumerRegistry fromXML = new XMLConsumerRegistry();
- fromXML.reloadConsumers();
-
- // Save to JCR
- List<WSRPConsumer> consumers = fromXML.getConfiguredConsumers();
- for (WSRPConsumer consumer : consumers)
- {
- infos.add(toProducerInfoMapping(consumer.getProducerInfo()));
- }
- session.persist(infos); // todo: is that sufficient?
-
- producerInfos = new ConsumerToProducerInfoIterator(consumers.iterator());
- }
- else
- {
- List<ProducerInfoMapping> mappings =
producerInfosMapping.getProducerInfos();
- producerInfos = new MappingToProducerInfoIterator(mappings.iterator());
- }
-
- session.save();
- session.close();
- return producerInfos;
- }
-
- private void delete(ChromatticSession session, String path)
- {
- ProducerInfoMapping old = session.findByPath(ProducerInfoMapping.class, path);
-
- if (old != null)
- {
- session.remove(old);
- }
- }
-
- private String getPathFor(ProducerInfo info)
- {
- return PRODUCER_INFOS_PATH + "/" + info.getId();
- }
-
- private static ProducerInfoMapping toProducerInfoMapping(ProducerInfo producerInfo)
- {
- return null; // todo: implement
- }
-
- private static ProducerInfo toProducerInfo(ProducerInfoMapping mapping)
- {
- return null; // todo: implement
- }
-
- private static class ConsumerToProducerInfoIterator implements
Iterator<ProducerInfo>
- {
-
- private final Iterator<WSRPConsumer> consumers;
-
- public ConsumerToProducerInfoIterator(Iterator<WSRPConsumer> consumers)
- {
- this.consumers = consumers;
- }
-
- @Override
- public boolean hasNext()
- {
- return consumers.hasNext();
- }
-
- @Override
- public ProducerInfo next()
- {
- return consumers.next().getProducerInfo();
- }
-
- @Override
- public void remove()
- {
- throw new UnsupportedOperationException("Remove not supported!");
- }
- }
-
- private static class MappingToProducerInfoIterator implements
Iterator<ProducerInfo>
- {
- private Iterator<ProducerInfoMapping> mappings;
-
- public MappingToProducerInfoIterator(Iterator<ProducerInfoMapping>
infoMappingIterator)
- {
- this.mappings = infoMappingIterator;
- }
-
- @Override
- public boolean hasNext()
- {
- return mappings.hasNext();
- }
-
- @Override
- public ProducerInfo next()
- {
- return toProducerInfo(mappings.next());
- }
-
- @Override
- public void remove()
- {
- throw new UnsupportedOperationException("Remove not supported!");
- }
- }
-}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
(from rev 751,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/JCRConsumerRegistry.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,220 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.consumer;
+
+import org.chromattic.api.ChromatticSession;
+import org.exoplatform.container.ExoContainer;
+import org.gatein.portal.wsrp.state.JCRPersister;
+import org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping;
+import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping;
+import org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping;
+import org.gatein.portal.wsrp.state.consumer.mapping.RegistrationInfoMapping;
+import org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping;
+import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.registry.AbstractConsumerRegistry;
+import org.gatein.wsrp.consumer.registry.xml.XMLConsumerRegistry;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class JCRConsumerRegistry extends AbstractConsumerRegistry
+{
+// private NewJCRPersister persister;
+ private JCRPersister persister;
+ private static final String PRODUCER_INFOS_PATH = ProducerInfosMapping.NODE_NAME;
+
+ public JCRConsumerRegistry(ExoContainer container) throws Exception
+ {
+ List<Class> mappingClasses = new ArrayList<Class>(6);
+ Collections.addAll(mappingClasses, ProducerInfosMapping.class,
ProducerInfoMapping.class,
+ EndpointInfoMapping.class, RegistrationInfoMapping.class,
RegistrationPropertyMapping.class,
+ RegistrationPropertyDescriptionMapping.class);
+
+ persister = new JCRPersister(container);
+ persister.initializeBuilderFor(mappingClasses);
+// persister = NewJCRPersister.getInstance(container);
+ }
+
+ @Override
+ protected void save(ProducerInfo info, String messageOnError)
+ {
+ ChromatticSession session = persister.getSession();
+
+ try
+ {
+ ProducerInfosMapping pims = getProducerInfosMapping(session);
+ ProducerInfoMapping pim = pims.createProducerInfo(info.getId());
+ String key = session.persist(pims, pim, info.getId());
+ info.setKey(key);
+ pim.initFrom(info);
+
+ persister.closeSession(session, true);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace(); // todo: fix me
+ persister.closeSession(session, false);
+ }
+ }
+
+ @Override
+ protected void delete(ProducerInfo info)
+ {
+ ChromatticSession session = persister.getSession();
+ delete(session, getPathFor(info));
+
+ persister.closeSession(session, true);
+ }
+
+ @Override
+ protected String update(ProducerInfo producerInfo)
+ {
+ String key = producerInfo.getKey();
+ if (key == null)
+ {
+ throw new IllegalArgumentException("ProducerInfo '" +
producerInfo.getId()
+ + "' hasn't been persisted and thus cannot be updated.");
+ }
+
+ ChromatticSession session = persister.getSession();
+ ProducerInfoMapping pim = session.findById(ProducerInfoMapping.class, key);
+ if (pim == null)
+ {
+ throw new IllegalArgumentException("Couldn't find ProducerInfoMapping
associated with key " + key);
+ }
+ pim.initFrom(producerInfo);
+
+ persister.closeSession(session, true);
+
+ return null;
+ }
+
+ @Override
+ protected Iterator<ProducerInfo> getProducerInfosFromStorage()
+ {
+ ChromatticSession session = persister.getSession();
+ ProducerInfosMapping producerInfosMapping = getProducerInfosMapping(session);
+
+ List<ProducerInfoMapping> mappings =
producerInfosMapping.getProducerInfos();
+
+ persister.closeSession(session, true);
+
+ return new MappingToProducerInfoIterator(mappings.iterator());
+ }
+
+ private ProducerInfosMapping getProducerInfosMapping(ChromatticSession session)
+ {
+ ProducerInfosMapping producerInfosMapping =
session.findByPath(ProducerInfosMapping.class, PRODUCER_INFOS_PATH);
+
+ // if we don't have info from JCR, load from XML and populate JCR
+ if (producerInfosMapping == null)
+ {
+ producerInfosMapping = session.insert(ProducerInfosMapping.class,
ProducerInfosMapping.NODE_NAME);
+
+ List<ProducerInfoMapping> infos =
producerInfosMapping.getProducerInfos();
+
+ // Load from XML
+ XMLConsumerRegistry fromXML = new XMLConsumerRegistry();
+ fromXML.reloadConsumers();
+
+ // Save to JCR
+ List<WSRPConsumer> consumers = fromXML.getConfiguredConsumers();
+ for (WSRPConsumer consumer : consumers)
+ {
+ ProducerInfo info = consumer.getProducerInfo();
+
+ ProducerInfoMapping pim =
producerInfosMapping.createProducerInfo(info.getId());
+
+ // need to add to parent first to attach newly created ProducerInfoMapping
+ infos.add(pim);
+
+ // init it from ProducerInfo
+ pim.initFrom(info);
+ }
+ }
+
+ return producerInfosMapping;
+ }
+
+ private void delete(ChromatticSession session, String path)
+ {
+ ProducerInfoMapping old = session.findByPath(ProducerInfoMapping.class, path);
+
+ if (old != null)
+ {
+ session.remove(old);
+ }
+ }
+
+ private static String getPathFor(ProducerInfo info)
+ {
+ return PRODUCER_INFOS_PATH + "/" + info.getId();
+ }
+
+ private static ProducerInfoMapping toProducerInfoMapping(ProducerInfo producerInfo,
ChromatticSession session)
+ {
+ ProducerInfoMapping pim = session.findById(ProducerInfoMapping.class,
producerInfo.getKey());
+ if (pim == null)
+ {
+ pim = session.insert(ProducerInfoMapping.class, getPathFor(producerInfo));
+ }
+
+ pim.initFrom(producerInfo);
+
+ return pim;
+ }
+
+ private static class MappingToProducerInfoIterator implements
Iterator<ProducerInfo>
+ {
+ private Iterator<ProducerInfoMapping> mappings;
+
+ public MappingToProducerInfoIterator(Iterator<ProducerInfoMapping>
infoMappingIterator)
+ {
+ this.mappings = infoMappingIterator;
+ }
+
+ public boolean hasNext()
+ {
+ return mappings.hasNext();
+ }
+
+ public ProducerInfo next()
+ {
+ return mappings.next().toProducerInfo();
+ }
+
+ public void remove()
+ {
+ throw new UnsupportedOperationException("Remove not supported!");
+ }
+ }
+}
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/EndpointInfoMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -25,6 +25,7 @@
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.Property;
+import org.gatein.wsrp.consumer.EndpointConfigurationInfo;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
@@ -39,4 +40,16 @@
public abstract String getWSDLURL();
public abstract void setWSDLURL(String wsdlURL);
+
+ public void initFrom(EndpointConfigurationInfo info)
+ {
+ setWSDLURL(info.getWsdlDefinitionURL());
+ }
+
+ public EndpointConfigurationInfo toEndpointConfigurationInfo()
+ {
+ EndpointConfigurationInfo info = new EndpointConfigurationInfo();
+ info.setWsdlDefinitionURL(getWSDLURL());
+ return info;
+ }
}
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfoMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -23,10 +23,15 @@
package org.gatein.portal.wsrp.state.consumer.mapping;
+import org.chromattic.api.annotations.DefaultValue;
+import org.chromattic.api.annotations.Id;
+import org.chromattic.api.annotations.MappedBy;
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.Property;
-import org.chromattic.api.annotations.RelatedMappedBy;
+import org.gatein.wsrp.consumer.EndpointConfigurationInfo;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.RegistrationInfo;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
@@ -38,17 +43,17 @@
public static final String NODE_NAME = "wsrp:producerinfo";
@OneToOne
- @RelatedMappedBy("endpoint")
+ @MappedBy("endpoint")
public abstract EndpointInfoMapping getEndpointInfo();
@OneToOne
- @RelatedMappedBy("registration")
+ @MappedBy("registration")
public abstract RegistrationInfoMapping getRegistrationInfo();
@Property(name = "producerid")
- public abstract String getProducerId();
+ public abstract String getId();
- public abstract void setProducerId(String id);
+ public abstract void setId(String id);
@Property(name = "cache")
public abstract Integer getExpirationCacheSeconds();
@@ -56,12 +61,52 @@
public abstract void setExpirationCacheSeconds(Integer expiration);
@Property(name = "active")
+ @DefaultValue.Boolean(false)
public abstract boolean getActive();
public abstract void setActive(boolean active);
- @Property(name = "available")
- public abstract boolean getAvailable();
+ @Id
+ public abstract String getKey();
- public abstract void setAvailable(boolean available);
+ /* @Property(name = "available")
+public abstract boolean getAvailable();
+
+public abstract void setAvailable(boolean available);*/
+
+ public void initFrom(ProducerInfo producerInfo)
+ {
+ setActive(producerInfo.isActive());
+ setExpirationCacheSeconds(producerInfo.getExpirationCacheSeconds());
+ setId(producerInfo.getId());
+
+ EndpointInfoMapping eim = getEndpointInfo();
+ eim.initFrom(producerInfo.getEndpointConfigurationInfo());
+
+ RegistrationInfoMapping rim = getRegistrationInfo();
+ RegistrationInfo regInfo = producerInfo.getRegistrationInfo();
+ rim.initFrom(regInfo);
+ }
+
+ public ProducerInfo toProducerInfo()
+ {
+ // todo: should probably use a ProducerInfo implementation backed by mapping at
some point
+ ProducerInfo info = new ProducerInfo();
+
+ // basic properties
+ info.setKey(getKey());
+ info.setId(getId());
+ info.setActive(getActive());
+ info.setExpirationCacheSeconds(getExpirationCacheSeconds());
+
+ // endpoint
+ EndpointConfigurationInfo endInfo =
getEndpointInfo().toEndpointConfigurationInfo();
+ info.setEndpointConfigurationInfo(endInfo);
+
+ // registration
+ RegistrationInfo regInfo = getRegistrationInfo().toRegistrationInfo();
+ info.setRegistrationInfo(regInfo);
+
+ return info;
+ }
}
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfosMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfosMapping.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/ProducerInfosMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -23,6 +23,7 @@
package org.gatein.portal.wsrp.state.consumer.mapping;
+import org.chromattic.api.annotations.Create;
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.OneToMany;
@@ -39,4 +40,7 @@
@OneToMany
public abstract List<ProducerInfoMapping> getProducerInfos();
+
+ @Create
+ public abstract ProducerInfoMapping createProducerInfo(String producerId);
}
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationInfoMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -23,10 +23,19 @@
package org.gatein.portal.wsrp.state.consumer.mapping;
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.FormattedBy;
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.OneToMany;
import org.chromattic.api.annotations.Property;
+import org.exoplatform.commons.utils.Safe;
+import org.gatein.portal.wsrp.state.JCRPersister;
+import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
+import org.gatein.wsrp.consumer.RegistrationInfo;
+import org.gatein.wsrp.consumer.RegistrationProperty;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.util.List;
@@ -35,6 +44,7 @@
* @version $Revision$
*/
@NodeMapping(name = RegistrationInfoMapping.NODE_NAME)
+(a)FormattedBy(JCRPersister.QNameFormatter.class)
public abstract class RegistrationInfoMapping
{
public static final String NODE_NAME = "wsrp:registrationinfo";
@@ -56,4 +66,58 @@
@OneToMany
public abstract List<RegistrationPropertyMapping> getRegistrationProperties();
+
+ @Create
+ public abstract RegistrationPropertyMapping createRegistrationProperty(String
propertyName);
+
+ public void initFrom(RegistrationInfo regInfo)
+ {
+ setConsumerName(regInfo.getConsumerName());
+ setRegistrationHandle(regInfo.getRegistrationHandle());
+ byte[] bytes = regInfo.getRegistrationState();
+ if (bytes != null && bytes.length > 0)
+ {
+ ByteArrayInputStream is = new ByteArrayInputStream(bytes);
+ setRegistrationState(is);
+ }
+
+ // clear and recreate registration properties
+ List<RegistrationPropertyMapping> rpms = getRegistrationProperties();
+ rpms.clear();
+ for (RegistrationProperty property : regInfo.getRegistrationProperties().values())
+ {
+ // create new RegistrationPropertyMapping for this RegistrationInfoMapping
+ RegistrationPropertyMapping rpm =
createRegistrationProperty(property.getName());
+
+ // add newly created RegistrationPropertyMapping to parent then initialize for
JCR
+ rpms.add(rpm);
+ rpm.initFrom(property);
+ }
+ }
+
+ public RegistrationInfo toRegistrationInfo()
+ {
+ RegistrationInfo regInfo = new RegistrationInfo();
+
+ regInfo.setConsumerName(getConsumerName());
+ regInfo.setRegistrationHandle(getRegistrationHandle());
+ regInfo.setRegistrationState(Safe.getBytes(getRegistrationState()));
+
+ // registration properties
+ for (RegistrationPropertyMapping rpm : getRegistrationProperties())
+ {
+ RegistrationProperty prop = regInfo.setRegistrationPropertyValue(rpm.getName(),
rpm.getValue());
+
+ RegistrationPropertyDescriptionMapping rpdm = rpm.getDescription();
+ if (rpdm != null)
+ {
+ RegistrationPropertyDescription desc =
rpdm.toRegistrationPropertyDescription();
+ prop.setDescription(desc);
+ }
+
+ prop.setStatus(rpm.getStatus());
+ }
+
+ return regInfo;
+ }
}
Deleted:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyDescriptionMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyDescriptionMapping.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyDescriptionMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,68 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
- * contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.gatein.portal.wsrp.state.consumer.mapping;
-
-import org.chromattic.api.annotations.NodeMapping;
-import org.chromattic.api.annotations.Property;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-@NodeMapping(name = RegistrationPropertyDescriptionMapping.NODE_NAME)
-public abstract class RegistrationPropertyDescriptionMapping
-{
- public static final String NODE_NAME =
"wsrp:registrationpropertydescription";
-
- // todo: this should really be a QName
- @Property(name = "name")
- public abstract String getName();
-
- public abstract void setName(String name);
-
- // todo: this should really be a QName
- @Property(name = "type")
- public abstract String getType();
-
- public abstract void setType(String type);
-
-
- // todo: this should really be a LocalizedString
- @Property(name = "description")
- public abstract String getDescription();
-
- public abstract void setDescription(String description);
-
- // todo: this should really be a LocalizedString
- @Property(name = "hint")
- public abstract String getHint();
-
- public abstract void setHint(String hint);
-
- // todo: this should really be a LocalizedString
- @Property(name = "label")
- public abstract String getLabel();
-
- public abstract void setLabel(String label);
-}
Modified:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/consumer/mapping/RegistrationPropertyMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -23,10 +23,14 @@
package org.gatein.portal.wsrp.state.consumer.mapping;
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.MappedBy;
import org.chromattic.api.annotations.NodeMapping;
import org.chromattic.api.annotations.OneToOne;
import org.chromattic.api.annotations.Property;
-import org.chromattic.api.annotations.RelatedMappedBy;
+import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
+import org.gatein.wsrp.consumer.RegistrationProperty;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
/**
* @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
@@ -37,18 +41,46 @@
{
public static final String NODE_NAME = "wsrp:registrationproperty";
+ @Property(name = "name")
+ public abstract String getName();
+
+ public abstract void setName(String name);
+
@Property(name = "value")
public abstract String getValue();
public abstract void setValue(String value);
@OneToOne
- @RelatedMappedBy("description")
+ @MappedBy("description")
public abstract RegistrationPropertyDescriptionMapping getDescription();
+ public abstract void setDescription(RegistrationPropertyDescriptionMapping rpdm);
+
+ @Create
+ public abstract RegistrationPropertyDescriptionMapping createDescription();
+
// todo: this should really be an enum�
+
@Property(name = "status")
- public abstract String getStatus();
+ public abstract RegistrationProperty.Status getStatus();
- public abstract void setStatus(String status);
+ public abstract void setStatus(RegistrationProperty.Status status);
+
+ public void initFrom(RegistrationProperty property)
+ {
+ // set properties
+ setName(property.getName());
+ setStatus(property.getStatus());
+ setValue(property.getValue());
+
+ // description
+ RegistrationPropertyDescription desc = property.getDescription();
+ if (desc != null)
+ {
+ RegistrationPropertyDescriptionMapping rpdm = createDescription();
+ setDescription(rpdm);
+ rpdm.initFrom(desc);
+ }
+ }
}
Copied: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping
(from rev 751,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping)
Deleted:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java 2009-11-23
01:08:00 UTC (rev 751)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,73 +0,0 @@
-/*
- * JBoss, a division of Red Hat
- * Copyright 2009, Red Hat Middleware, LLC, and individual
- * contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of
- * individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- */
-
-package org.gatein.portal.wsrp.state.mapping;
-
-import org.chromattic.api.annotations.NodeMapping;
-import org.chromattic.api.annotations.Property;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-@NodeMapping(name = RegistrationPropertyDescriptionMapping.NODE_NAME)
-public abstract class RegistrationPropertyDescriptionMapping
-{
- public static final String NODE_NAME =
"wsrp:registrationpropertydescription";
-
- // todo: this should really be a QName
-
- @Property(name = "name")
- public abstract String getName();
-
- public abstract void setName(String name);
-
- // todo: this should really be a QName
-
- @Property(name = "type")
- public abstract String getType();
-
- public abstract void setType(String type);
-
-
- // todo: this should really be a LocalizedString
-
- @Property(name = "description")
- public abstract String getDescription();
-
- public abstract void setDescription(String description);
-
- // todo: this should really be a LocalizedString
-
- @Property(name = "hint")
- public abstract String getHint();
-
- public abstract void setHint(String hint);
-
- // todo: this should really be a LocalizedString
-
- @Property(name = "label")
- public abstract String getLabel();
-
- public abstract void setLabel(String label);
-}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java
(from rev 751,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/mapping/RegistrationPropertyDescriptionMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.mapping;
+
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.Property;
+import org.gatein.wsrp.registration.LocalizedString;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+
+import javax.xml.namespace.QName;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = RegistrationPropertyDescriptionMapping.NODE_NAME)
+public abstract class RegistrationPropertyDescriptionMapping
+{
+ public static final String NODE_NAME =
"wsrp:registrationpropertydescription";
+
+ @Property(name = "name")
+ public abstract String getName(); // todo: this should really be a QName
+
+ public abstract void setName(String name);
+
+
+ @Property(name = "type")
+ public abstract String getType(); // todo: this should really be a QName
+
+ public abstract void setType(String type);
+
+ @Property(name = "description")
+ public abstract String getDescription(); // todo: this should really be a
LocalizedString
+
+ public abstract void setDescription(String description);
+
+ @Property(name = "hint")
+ public abstract String getHint(); // todo: this should really be a LocalizedString
+
+ public abstract void setHint(String hint);
+
+ @Property(name = "label")
+ public abstract String getLabel(); // todo: this should really be a LocalizedString
+
+ public abstract void setLabel(String label);
+
+ public void initFrom(RegistrationPropertyDescription desc)
+ {
+ setDescription(desc.getDescription().getValue());
+ setHint(desc.getHint().getValue());
+ setLabel(desc.getLabel().getValue());
+
+ // convert QNames to Strings
+ setName(desc.getName().toString());
+ setType(desc.getType().toString());
+ }
+
+ public RegistrationPropertyDescription toRegistrationPropertyDescription()
+ {
+ RegistrationPropertyDescription desc = new
RegistrationPropertyDescription(getName(), QName.valueOf(getType()));
+ desc.setDefaultDescription(getDescription());
+ desc.setHint(new LocalizedString(getHint()));
+ desc.setLabel(new LocalizedString(getLabel()));
+
+ return desc;
+ }
+}
Copied: portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer
(from rev 751,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer)
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration
(from rev 751,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration)
Deleted:
portal/trunk/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
01:08:00 UTC (rev 751)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,59 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.gatein.portal.wsrp.state.producer.configuration;
-
-import org.chromattic.api.ChromatticSession;
-import org.gatein.portal.wsrp.state.JCRPersister;
-import org.gatein.wsrp.producer.config.impl.AbstractProducerConfigurationService;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-public class JCRProducerConfigurationService extends
AbstractProducerConfigurationService
-{
- private JCRPersister persister;
- private static String PRODUCER_CONFIGURATION_PATH = JCRPersister.WSRP_SERVICES_PATH +
"producerconfiguration";
-
- public JCRProducerConfigurationService()
- {
- List<Class> mappingClasses = new ArrayList<Class>();
- Collections.addAll(mappingClasses, null);
- }
-
- protected void loadConfiguration() throws Exception
- {
- ChromatticSession session = persister.getSession();
-
- //todo
- }
-
- public void saveConfiguration() throws Exception
- {
- //todo
- }
-}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
(from rev 751,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/JCRProducerConfigurationService.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.producer.configuration;
+
+import org.chromattic.api.ChromatticSession;
+import org.exoplatform.container.ExoContainer;
+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;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class JCRProducerConfigurationService extends
AbstractProducerConfigurationService
+{
+ private static String PRODUCER_CONFIGURATION_PATH =
ProducerConfigurationMapping.NODE_NAME;
+
+ private InputStream defaultConfigurationIS;
+// private NewJCRPersister persister;
+ private JCRPersister persister;
+
+ public JCRProducerConfigurationService(ExoContainer container) throws Exception
+ {
+ List<Class> mappingClasses = new ArrayList<Class>(3);
+ Collections.addAll(mappingClasses, ProducerConfigurationMapping.class,
RegistrationRequirementsMapping.class,
+ RegistrationPropertyDescriptionMapping.class);
+
+ persister = new JCRPersister(container);
+ persister.initializeBuilderFor(mappingClasses);
+
+// persister = NewJCRPersister.getInstance(container);
+ }
+
+ /**
+ * 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);
+
+ // if we don't have a configuration persisted in JCR already, force a reload
from XML and save the resulting configuration
+ if (pcm == null)
+ {
+ pcm = session.insert(ProducerConfigurationMapping.class,
PRODUCER_CONFIGURATION_PATH);
+
+ ProducerConfigurationService service = new
SimpleXMLProducerConfigurationService(defaultConfigurationIS);
+
+ service.reloadConfiguration();
+ configuration = service.getConfiguration();
+ pcm.initFrom(configuration);
+ }
+ else
+ {
+ configuration = pcm.toProducerConfiguration();
+ }
+
+
+ persister.closeSession(session, true);
+ }
+
+ public void saveConfiguration() throws Exception
+ {
+ ChromatticSession session = persister.getSession();
+
+ ProducerConfigurationMapping pcm =
session.findByPath(ProducerConfigurationMapping.class, PRODUCER_CONFIGURATION_PATH);
+ if (pcm == null)
+ {
+ pcm = session.insert(ProducerConfigurationMapping.class,
PRODUCER_CONFIGURATION_PATH);
+ }
+ pcm.initFrom(configuration);
+
+ persister.closeSession(session, true);
+ }
+}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping
(from rev 751,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping)
Deleted:
portal/trunk/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
01:08:00 UTC (rev 751)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,47 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.gatein.portal.wsrp.state.producer.configuration.mapping;
-
-import org.chromattic.api.annotations.NodeMapping;
-import org.chromattic.api.annotations.OneToOne;
-import org.chromattic.api.annotations.Property;
-import org.chromattic.api.annotations.RelatedMappedBy;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-@NodeMapping(name = ProducerConfigurationMapping.NODE_NAME)
-public abstract class ProducerConfigurationMapping
-{
- public static final String NODE_NAME = "wsrp:producerconfiguration";
-
- @Property(name = "strictmode")
- public abstract boolean getUsingStrictMode();
-
- public abstract void setUsingStrictMode(boolean strict);
-
- @OneToOne
- @RelatedMappedBy("registrationrequirements")
- public abstract RegistrationRequirementsMapping getRegistrationRequirements();
-}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java
(from rev 751,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/ProducerConfigurationMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,70 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.gatein.portal.wsrp.state.producer.configuration.mapping;
+
+import org.chromattic.api.annotations.MappedBy;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToOne;
+import org.chromattic.api.annotations.Property;
+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>
+ * @version $Revision$
+ */
+@NodeMapping(name = ProducerConfigurationMapping.NODE_NAME)
+public abstract class ProducerConfigurationMapping
+{
+ public static final String NODE_NAME = "wsrp:producerconfiguration";
+
+ @Property(name = "strictmode")
+ public abstract boolean getUsingStrictMode();
+
+ public abstract void setUsingStrictMode(boolean strict);
+
+ @OneToOne
+ @MappedBy("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;
+ }
+}
Deleted:
portal/trunk/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
01:08:00 UTC (rev 751)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,57 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.gatein.portal.wsrp.state.producer.configuration.mapping;
-
-import org.chromattic.api.annotations.Create;
-import org.chromattic.api.annotations.NodeMapping;
-import org.chromattic.api.annotations.OneToMany;
-import org.chromattic.api.annotations.Property;
-import org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-@NodeMapping(name = RegistrationRequirementsMapping.NODE_NAME)
-public abstract class RegistrationRequirementsMapping
-{
- public static final String NODE_NAME = "wsrp:registrationrequirements";
-
- @Property(name = "registrationrequired")
- public abstract boolean getRegistrationRequired();
-
- public abstract void setRegistrationRequired(boolean requiresRegistration);
-
- @Property(name = "registrationrequiredforfulldescription")
- public abstract boolean getRegistrationRequiredForFullDescription();
-
- public abstract void setRegistrationRequiredForFullDescription(boolean
fullServiceDescriptionRequiresRegistration);
-
- @OneToMany
- public abstract List<RegistrationPropertyDescriptionMapping>
getRegistrationPropertyDescriptions();
-
- @Create
- public abstract RegistrationPropertyDescriptionMapping create();
-}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
(from rev 751,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/configuration/mapping/RegistrationRequirementsMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,91 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.gatein.portal.wsrp.state.producer.configuration.mapping;
+
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.NodeMapping;
+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;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = RegistrationRequirementsMapping.NODE_NAME)
+public abstract class RegistrationRequirementsMapping
+{
+ public static final String NODE_NAME = "wsrp:registrationrequirements";
+
+ @Property(name = "registrationrequired")
+ public abstract boolean getRegistrationRequired();
+
+ public abstract void setRegistrationRequired(boolean requiresRegistration);
+
+ @Property(name = "registrationrequiredforfulldescription")
+ public abstract boolean getRegistrationRequiredForFullDescription();
+
+ public abstract void setRegistrationRequiredForFullDescription(boolean
fullServiceDescriptionRequiresRegistration);
+
+ @OneToMany
+ public abstract List<RegistrationPropertyDescriptionMapping>
getRegistrationPropertyDescriptions();
+
+ @Create
+ public abstract RegistrationPropertyDescriptionMapping
createRegistrationPropertyDescription(String propertyName);
+
+ public void initFrom(ProducerRegistrationRequirements registrationRequirements)
+ {
+ setRegistrationRequired(registrationRequirements.isRegistrationRequired());
+
setRegistrationRequiredForFullDescription(registrationRequirements.isRegistrationRequiredForFullDescription());
+
+ List<RegistrationPropertyDescriptionMapping> rpdms =
getRegistrationPropertyDescriptions();
+ for (RegistrationPropertyDescription desc :
registrationRequirements.getRegistrationProperties().values())
+ {
+ RegistrationPropertyDescriptionMapping rpdm =
createRegistrationPropertyDescription(desc.getNameAsString());
+
+ // attach first to parent, then init
+ rpdms.add(rpdm);
+ rpdm.initFrom(desc);
+ }
+ }
+
+ public ProducerRegistrationRequirements toProducerRegistrationRequirements()
+ {
+ ProducerRegistrationRequirements req = new ProducerRegistrationRequirementsImpl();
+
+ req.setRegistrationRequired(getRegistrationRequired());
+
req.setRegistrationRequiredForFullDescription(getRegistrationRequiredForFullDescription());
+
+ for (RegistrationPropertyDescriptionMapping rpdm :
getRegistrationPropertyDescriptions())
+ {
+ req.addRegistrationProperty(rpdm.toRegistrationPropertyDescription());
+ }
+
+ return req;
+ }
+}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations
(from rev 964,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations)
Deleted:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2009-12-07
18:05:05 UTC (rev 964)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,163 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.gatein.portal.wsrp.state.producer.registrations;
-
-import org.chromattic.api.ChromatticSession;
-import org.exoplatform.container.ExoContainer;
-import org.gatein.portal.wsrp.state.JCRPersister;
-import
org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerCapabilitiesMapping;
-import org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerGroupMapping;
-import org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerMapping;
-import
org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumersAndGroupsMapping;
-import org.gatein.portal.wsrp.state.producer.registrations.mapping.RegistrationMapping;
-import org.gatein.registration.ConsumerGroup;
-import org.gatein.registration.Registration;
-import org.gatein.registration.RegistrationException;
-import org.gatein.registration.impl.RegistrationPersistenceManagerImpl;
-import org.gatein.registration.spi.ConsumerGroupSPI;
-import org.gatein.registration.spi.ConsumerSPI;
-import org.gatein.registration.spi.RegistrationSPI;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-public class JCRRegistrationPersistenceManager extends
RegistrationPersistenceManagerImpl
-{
- private JCRPersister persister;
- private ConsumersAndGroupsMapping mappings;
-
- public JCRRegistrationPersistenceManager(ExoContainer container, String workspaceName,
String repositoryName) throws Exception
- {
- persister = new JCRPersister(container, workspaceName, repositoryName);
-
- List<Class> mappingClasses = new ArrayList<Class>(5);
- Collections.addAll(mappingClasses, ConsumersAndGroupsMapping.class,
ConsumerMapping.class, ConsumerGroupMapping.class,
- RegistrationMapping.class, ConsumerCapabilitiesMapping.class);
-
- persister.initializeBuilderFor(mappingClasses);
-
- ChromatticSession session = persister.getSession();
- mappings = session.findByPath(ConsumersAndGroupsMapping.class,
ConsumersAndGroupsMapping.NODE_NAME);
- if(mappings == null)
- {
- session.insert(ConsumersAndGroupsMapping.class,
ConsumersAndGroupsMapping.NODE_NAME);
- }
- persister.closeSession(session);
-
- for (ConsumerGroupMapping cgm : mappings.getConsumerGroups().values())
- {
- internalAddConsumerGroup(cgm.toConsumerGroup(this));
- }
-
- for (ConsumerMapping cm : mappings.getConsumers().values())
- {
- internalAddConsumer(cm.toConsumer(this));
- }
- }
-
- @Override
- protected RegistrationSPI internalRemoveRegistration(String registrationId)
- {
- Registration registration = getRegistration(registrationId);
- remove(registration.getPersistentKey(), RegistrationMapping.class);
-
- return super.internalRemoveRegistration(registrationId);
- }
-
- @Override
- protected RegistrationSPI internalCreateRegistration(ConsumerSPI consumer, Map
registrationProperties)
- {
- ChromatticSession session = persister.getSession();
- ConsumerMapping cm = session.findById(ConsumerMapping.class,
consumer.getPersistentKey());
- RegistrationMapping rm = cm.createRegistration();
- RegistrationSPI registration = newRegistrationSPI(consumer, registrationProperties,
rm.getPersistentKey());
- rm.initFrom(registration);
- persister.closeSession(session);
-
- return registration;
- }
-
- @Override
- protected ConsumerSPI internalRemoveConsumer(String consumerId)
- {
- remove(consumerId, ConsumerMapping.class);
-
- return super.internalRemoveConsumer(consumerId);
- }
-
- private void remove(String id, Class clazz)
- {
- ChromatticSession session = persister.getSession();
- session.remove(session.findById(clazz, id));
- persister.closeSession(session);
- }
-
- @Override
- protected ConsumerSPI internalCreateConsumer(String consumerId, String consumerName)
- {
- ConsumerSPI consumer = super.internalCreateConsumer(consumerId, consumerName);
-
- ChromatticSession session = persister.getSession();
- ConsumerMapping cm = mappings.createConsumer(consumerId);
- cm.initFrom(consumer);
- persister.closeSession(session);
-
- return consumer;
- }
-
- @Override
- protected ConsumerGroupSPI internalRemoveConsumerGroup(String name)
- {
- try
- {
- ConsumerGroup group = getConsumerGroup(name);
- remove(group.getPersistentKey(), ConsumerGroupMapping.class);
- }
- catch (RegistrationException e)
- {
- throw new IllegalArgumentException("Couldn't remove ConsumerGroup
'" + name + "'", e);
- }
-
- return super.internalRemoveConsumerGroup(name);
- }
-
- @Override
- protected ConsumerGroupSPI internalCreateConsumerGroup(String name)
- {
- ConsumerGroupSPI group = super.internalCreateConsumerGroup(name);
-
- ChromatticSession session = persister.getSession();
- ConsumerGroupMapping cgm = mappings.createConsumerGroup(name);
- group.setPersistentKey(cgm.getPersistentKey());
- cgm.initFrom(group);
- persister.closeSession(session);
-
- return group;
- }
-}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
(from rev 964,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/JCRRegistrationPersistenceManager.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,196 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.gatein.portal.wsrp.state.producer.registrations;
+
+import org.chromattic.api.ChromatticSession;
+import org.exoplatform.container.ExoContainer;
+import org.gatein.portal.wsrp.state.JCRPersister;
+import
org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerCapabilitiesMapping;
+import org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerGroupMapping;
+import org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerMapping;
+import
org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumersAndGroupsMapping;
+import org.gatein.portal.wsrp.state.producer.registrations.mapping.RegistrationMapping;
+import
org.gatein.portal.wsrp.state.producer.registrations.mapping.RegistrationPropertiesMapping;
+import org.gatein.registration.ConsumerGroup;
+import org.gatein.registration.Registration;
+import org.gatein.registration.RegistrationException;
+import org.gatein.registration.impl.RegistrationPersistenceManagerImpl;
+import org.gatein.registration.spi.ConsumerGroupSPI;
+import org.gatein.registration.spi.ConsumerSPI;
+import org.gatein.registration.spi.RegistrationSPI;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public class JCRRegistrationPersistenceManager extends
RegistrationPersistenceManagerImpl
+{
+// private NewJCRPersister persister;
+ private JCRPersister persister;
+ private ConsumersAndGroupsMapping mappings;
+
+ public JCRRegistrationPersistenceManager(ExoContainer container) throws Exception
+ {
+ persister = new JCRPersister(container);
+
+ List<Class> mappingClasses = new ArrayList<Class>(5);
+ Collections.addAll(mappingClasses, ConsumersAndGroupsMapping.class,
ConsumerMapping.class, ConsumerGroupMapping.class,
+ RegistrationMapping.class, ConsumerCapabilitiesMapping.class,
RegistrationPropertiesMapping.class);
+
+ persister.initializeBuilderFor(mappingClasses);
+
+// persister = NewJCRPersister.getInstance(container);
+
+ ChromatticSession session = persister.getSession();
+ mappings = session.findByPath(ConsumersAndGroupsMapping.class,
ConsumersAndGroupsMapping.NODE_NAME);
+ if (mappings == null)
+ {
+ mappings = session.insert(ConsumersAndGroupsMapping.class,
ConsumersAndGroupsMapping.NODE_NAME);
+ }
+ persister.closeSession(session, true);
+
+ for (ConsumerGroupMapping cgm : mappings.getConsumerGroups())
+ {
+ internalAddConsumerGroup(cgm.toConsumerGroup(this));
+ }
+
+ for (ConsumerMapping cm : mappings.getConsumers())
+ {
+ internalAddConsumer(cm.toConsumer(this));
+ }
+ }
+
+ @Override
+ protected RegistrationSPI internalRemoveRegistration(String registrationId)
+ {
+ Registration registration = getRegistration(registrationId);
+ remove(registration.getPersistentKey(), RegistrationMapping.class);
+
+ return super.internalRemoveRegistration(registrationId);
+ }
+
+ @Override
+ protected RegistrationSPI internalCreateRegistration(ConsumerSPI consumer, Map
registrationProperties)
+ {
+ ChromatticSession session = persister.getSession();
+ RegistrationSPI registration = null;
+ try
+ {
+ ConsumerMapping cm = session.findById(ConsumerMapping.class,
consumer.getPersistentKey());
+ RegistrationMapping rm = cm.createAndAddRegistrationMappingFrom(null);
+ registration = newRegistrationSPI(consumer, registrationProperties,
rm.getPersistentKey());
+ rm.initFrom(registration);
+ persister.closeSession(session, true);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace(); // todo fix me
+ persister.closeSession(session, false);
+ }
+
+ return registration;
+ }
+
+ @Override
+ protected ConsumerSPI internalRemoveConsumer(String consumerId)
+ {
+ remove(consumerId, ConsumerMapping.class);
+
+ return super.internalRemoveConsumer(consumerId);
+ }
+
+ private void remove(String id, Class clazz)
+ {
+ ChromatticSession session = persister.getSession();
+ session.remove(session.findById(clazz, id));
+ persister.closeSession(session, true);
+ }
+
+ @Override
+ protected ConsumerSPI internalCreateConsumer(String consumerId, String consumerName)
+ {
+ ConsumerSPI consumer = super.internalCreateConsumer(consumerId, consumerName);
+
+ ChromatticSession session = persister.getSession();
+ mappings = session.findByPath(ConsumersAndGroupsMapping.class,
ConsumersAndGroupsMapping.NODE_NAME); // todo: needed?
+ try
+ {
+ ConsumerMapping cm = mappings.createConsumer(consumerId);
+ mappings.getConsumers().add(cm);
+ cm.initFrom(consumer);
+ consumer.setPersistentKey(cm.getPersistentKey());
+ persister.closeSession(session, true);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace(); // todo: fix me
+ persister.closeSession(session, false);
+ }
+
+ return consumer;
+ }
+
+ @Override
+ protected ConsumerGroupSPI internalRemoveConsumerGroup(String name)
+ {
+ try
+ {
+ ConsumerGroup group = getConsumerGroup(name);
+ remove(group.getPersistentKey(), ConsumerGroupMapping.class);
+ }
+ catch (RegistrationException e)
+ {
+ throw new IllegalArgumentException("Couldn't remove ConsumerGroup
'" + name + "'", e);
+ }
+
+ return super.internalRemoveConsumerGroup(name);
+ }
+
+ @Override
+ protected ConsumerGroupSPI internalCreateConsumerGroup(String name)
+ {
+ ConsumerGroupSPI group = super.internalCreateConsumerGroup(name);
+
+ ChromatticSession session = persister.getSession();
+ try
+ {
+ ConsumerGroupMapping cgm = mappings.createConsumerGroup(name);
+ mappings.getConsumerGroups().add(cgm);
+ group.setPersistentKey(cgm.getPersistentKey());
+ cgm.initFrom(group);
+ persister.closeSession(session, true);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace(); // todo: fix me
+ persister.closeSession(session, false);
+ }
+
+ return group;
+ }
+}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping
(from rev 964,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping)
Deleted:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerCapabilitiesMapping.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerCapabilitiesMapping.java 2009-12-07
18:05:05 UTC (rev 964)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerCapabilitiesMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,46 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.gatein.portal.wsrp.state.producer.registrations.mapping;
-
-import org.chromattic.api.annotations.NodeMapping;
-import org.gatein.registration.ConsumerCapabilities;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-@NodeMapping(name = ConsumerCapabilitiesMapping.NODE_NAME)
-public class ConsumerCapabilitiesMapping
-{
- public static final String NODE_NAME = "wsrp:consumercapabilities";
-
- public void initFrom(ConsumerCapabilities capabilities)
- {
-
- }
-
- public ConsumerCapabilities toConsumerCapabilities()
- {
- return null; // todo: implement
- }
-}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerCapabilitiesMapping.java
(from rev 964,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerCapabilitiesMapping.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerCapabilitiesMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerCapabilitiesMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,155 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.producer.registrations.mapping;
+
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.Property;
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.pc.api.Mode;
+import org.gatein.pc.api.WindowState;
+import org.gatein.registration.ConsumerCapabilities;
+import org.gatein.registration.impl.ConsumerCapabilitiesImpl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = ConsumerCapabilitiesMapping.NODE_NAME)
+public abstract class ConsumerCapabilitiesMapping
+{
+ public static final String NODE_NAME = "wsrp:consumercapabilities";
+
+ @Property(name = "supportsgetmethod")
+ public abstract boolean getSupportsGetMethod();
+
+ public abstract void setSupportsGetMethod(boolean supportsGetMethod);
+
+ @Property(name = "modes")
+ public abstract List<String> getSupportedModes();
+
+ public abstract void setSupportedModes(List<String> modes);
+
+ @Property(name = "windowstates")
+ public abstract List<String> getSupportedWindowStates();
+
+ public abstract void setSupportedWindowStates(List<String> windowStates);
+
+ @Property(name = "userscopes")
+ public abstract List<String> getSupportedUserScopes();
+
+ public abstract void setSupportedUserScopes(List<String> userScopes);
+
+ @Property(name = "userprofiledata")
+ public abstract List<String> getSupportedUserProfileData();
+
+ public abstract void setSupportedUserProfileData(List<String> userProfileData);
+
+
+ public void initFrom(ConsumerCapabilities capabilities)
+ {
+ setSupportsGetMethod(capabilities.supportsGetMethod());
+
+ List<String> modes = convertToStringList(capabilities.getSupportedModes());
+ if (modes != null)
+ {
+ setSupportedModes(modes);
+ }
+ List<String> states =
convertToStringList(capabilities.getSupportedWindowStates());
+ if (states != null)
+ {
+ setSupportedWindowStates(states);
+ }
+ List<String> scopes = capabilities.getSupportedUserScopes();
+ if (ParameterValidation.existsAndIsNotEmpty(scopes))
+ {
+ setSupportedUserScopes(scopes);
+ }
+ List<String> userProfileData = capabilities.getSupportedUserProfileData();
+ if (ParameterValidation.existsAndIsNotEmpty(userProfileData))
+ {
+ setSupportedUserProfileData(userProfileData);
+ }
+ }
+
+ private List<String> convertToStringList(List list)
+ {
+ if (ParameterValidation.existsAndIsNotEmpty(list))
+ {
+ List<String> result = new ArrayList<String>(list.size());
+ for (Object object : list)
+ {
+ result.add(object.toString());
+ }
+ return result;
+ }
+
+ return null;
+ }
+
+ public ConsumerCapabilities toConsumerCapabilities()
+ {
+ ConsumerCapabilitiesImpl consumerCapabilities = new ConsumerCapabilitiesImpl();
+
+ consumerCapabilities.setSupportsGetMethod(getSupportsGetMethod());
+
+ List<String> modeStrings = getSupportedModes();
+ if (ParameterValidation.existsAndIsNotEmpty(modeStrings))
+ {
+ List<Mode> modes = new ArrayList<Mode>(modeStrings.size());
+ for (String modeString : modeStrings)
+ {
+ modes.add(Mode.create(modeString));
+ }
+ consumerCapabilities.setSupportedModes(modes);
+ }
+
+ List<String> windowStateStrings = getSupportedWindowStates();
+ if (ParameterValidation.existsAndIsNotEmpty(windowStateStrings))
+ {
+ List<WindowState> windowStates = new
ArrayList<WindowState>(windowStateStrings.size());
+ for (String windowStateString : windowStateStrings)
+ {
+ windowStates.add(WindowState.create(windowStateString));
+ }
+ consumerCapabilities.setSupportedWindowStates(windowStates);
+ }
+
+ List<String> userProfileData = getSupportedUserProfileData();
+ if (ParameterValidation.existsAndIsNotEmpty(userProfileData))
+ {
+ consumerCapabilities.setSupportedUserProfileData(userProfileData);
+ }
+
+ List<String> userScopes = getSupportedUserScopes();
+ if (ParameterValidation.existsAndIsNotEmpty(userScopes))
+ {
+ consumerCapabilities.setSupportedUserScopes(userScopes);
+ }
+
+ return consumerCapabilities;
+ }
+}
Deleted:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java 2009-12-07
18:05:05 UTC (rev 964)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,110 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.gatein.portal.wsrp.state.producer.registrations.mapping;
-
-import org.chromattic.api.RelationshipType;
-import org.chromattic.api.annotations.FindById;
-import org.chromattic.api.annotations.Id;
-import org.chromattic.api.annotations.ManyToOne;
-import org.chromattic.api.annotations.MappedBy;
-import org.chromattic.api.annotations.NodeMapping;
-import org.chromattic.api.annotations.OneToMany;
-import org.chromattic.api.annotations.Property;
-import org.chromattic.api.annotations.RelatedMappedBy;
-import org.gatein.common.util.ParameterValidation;
-import
org.gatein.portal.wsrp.state.producer.registrations.JCRRegistrationPersistenceManager;
-import org.gatein.registration.Consumer;
-import org.gatein.registration.ConsumerGroup;
-import org.gatein.registration.RegistrationException;
-import org.gatein.registration.RegistrationStatus;
-import org.gatein.registration.spi.ConsumerGroupSPI;
-
-import java.util.Collection;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-@NodeMapping(name = ConsumerGroupMapping.NODE_NAME)
-public abstract class ConsumerGroupMapping
-{
- public static final String NODE_NAME = "wsrp:consumergroup";
-
- @OneToMany(type = RelationshipType.PATH)
- @RelatedMappedBy("group")
- public abstract Collection<ConsumerMapping> getConsumers();
-
- @Property(name = "name")
- public abstract String getName();
- public abstract void setName(String name);
-
- @Property(name = "status")
- public abstract RegistrationStatus getStatus();
- public abstract void setStatus(RegistrationStatus status);
-
- @Id
- public abstract String getPersistentKey();
-
- @FindById
- public abstract ConsumerMapping findConsumerById(String id);
-
- public void initFrom(ConsumerGroup group)
- {
- setName(group.getName());
- setStatus(group.getStatus());
-
- try
- {
- for (Consumer consumer : group.getConsumers())
- {
- String id = consumer.getPersistentKey();
- ConsumerMapping cm = findConsumerById(id);
- ParameterValidation.throwIllegalArgExceptionIfNull(cm, "ConsumerMapping
(no such mapping with id: " + id + ")");
- cm.initFrom(consumer);
- getConsumers().add(cm);
- }
- }
- catch (RegistrationException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public ConsumerGroupSPI toConsumerGroup(JCRRegistrationPersistenceManager
persistenceManager) throws RegistrationException
- {
- ConsumerGroupSPI group = persistenceManager.newConsumerGroupSPI(getName());
- group.setStatus(getStatus());
-
- for (ConsumerMapping cm : getConsumers())
- {
- Consumer consumer = persistenceManager.getConsumerById(cm.getPersistentKey());
- if(consumer == null)
- {
- consumer = cm.toConsumer(persistenceManager);
- }
-
- group.addConsumer(consumer);
- }
- return group;
- }
-}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java
(from rev 964,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerGroupMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,114 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.gatein.portal.wsrp.state.producer.registrations.mapping;
+
+import org.chromattic.api.annotations.FindById;
+import org.chromattic.api.annotations.Id;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToMany;
+import org.chromattic.api.annotations.Property;
+import org.chromattic.api.annotations.RelatedMappedBy;
+import org.gatein.common.util.ParameterValidation;
+import
org.gatein.portal.wsrp.state.producer.registrations.JCRRegistrationPersistenceManager;
+import org.gatein.registration.Consumer;
+import org.gatein.registration.ConsumerGroup;
+import org.gatein.registration.RegistrationException;
+import org.gatein.registration.RegistrationStatus;
+import org.gatein.registration.spi.ConsumerGroupSPI;
+
+import java.util.Collection;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = ConsumerGroupMapping.NODE_NAME)
+public abstract class ConsumerGroupMapping
+{
+ public static final String NODE_NAME = "wsrp:consumergroup";
+
+ @OneToMany
+ @RelatedMappedBy("group")
+ public abstract Collection<ConsumerMapping> getConsumers();
+
+ @Property(name = "name")
+ public abstract String getName();
+
+ public abstract void setName(String name);
+
+ @Property(name = "status")
+ public abstract RegistrationStatus getStatus();
+
+ public abstract void setStatus(RegistrationStatus status);
+
+ @Id
+ public abstract String getPersistentKey();
+
+ @FindById
+ public abstract ConsumerMapping findConsumerById(String id);
+
+ public void initFrom(ConsumerGroup group)
+ {
+ setName(group.getName());
+ setStatus(group.getStatus());
+
+ try
+ {
+ for (Consumer consumer : group.getConsumers())
+ {
+ String id = consumer.getPersistentKey();
+ ConsumerMapping cm = findConsumerById(id);
+ ParameterValidation.throwIllegalArgExceptionIfNull(cm, "ConsumerMapping
(no such mapping with id: " + id + ")");
+ cm.initFrom(consumer);
+ getConsumers().add(cm);
+ }
+ }
+ catch (RegistrationException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public ConsumerGroupSPI toConsumerGroup(JCRRegistrationPersistenceManager
persistenceManager) throws RegistrationException
+ {
+ ConsumerGroupSPI group = persistenceManager.newConsumerGroupSPI(getName());
+ RegistrationStatus status = getStatus();
+ if (status == null)
+ {
+ status = RegistrationStatus.PENDING;
+ }
+ group.setStatus(status);
+
+ for (ConsumerMapping cm : getConsumers())
+ {
+ Consumer consumer = persistenceManager.getConsumerById(cm.getPersistentKey());
+ if (consumer == null)
+ {
+ consumer = cm.toConsumer(persistenceManager);
+ }
+
+ group.addConsumer(consumer);
+ }
+ return group;
+ }
+}
Deleted:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java 2009-12-07
18:05:05 UTC (rev 964)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,152 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.gatein.portal.wsrp.state.producer.registrations.mapping;
-
-import org.chromattic.api.RelationshipType;
-import org.chromattic.api.annotations.Create;
-import org.chromattic.api.annotations.FindById;
-import org.chromattic.api.annotations.Id;
-import org.chromattic.api.annotations.ManyToOne;
-import org.chromattic.api.annotations.MappedBy;
-import org.chromattic.api.annotations.NodeMapping;
-import org.chromattic.api.annotations.OneToMany;
-import org.chromattic.api.annotations.OneToOne;
-import org.chromattic.api.annotations.Property;
-import org.chromattic.api.annotations.RelatedMappedBy;
-import
org.gatein.portal.wsrp.state.producer.registrations.JCRRegistrationPersistenceManager;
-import org.gatein.registration.Consumer;
-import org.gatein.registration.ConsumerGroup;
-import org.gatein.registration.Registration;
-import org.gatein.registration.RegistrationException;
-import org.gatein.registration.RegistrationStatus;
-import org.gatein.registration.spi.ConsumerSPI;
-
-import java.util.Map;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-@NodeMapping(name = ConsumerMapping.NODE_NAME)
-public abstract class ConsumerMapping
-{
- public static final String NODE_NAME = "wsrp:consumer";
-
- @Id
- public abstract String getPersistentKey();
-
- @Property(name = "name")
- public abstract String getName();
-
- public abstract void setName(String name);
-
- @Property(name = "id")
- public abstract String getId();
-
- public abstract void setId(String id);
-
- @Property(name = "consumeragent")
- public abstract String getConsumerAgent();
-
- public abstract void setConsumerAgent(String consumerAgent);
-
- @Property(name = "status")
- public abstract RegistrationStatus getStatus();
-
- public abstract void setStatus(RegistrationStatus status);
-
- @OneToMany(type = RelationshipType.PATH)
- @RelatedMappedBy("consumer")
- public abstract Map<String, RegistrationMapping> getRegistrations();
-
- @Create
- public abstract RegistrationMapping createRegistration();
-
- @ManyToOne(type = RelationshipType.PATH)
- @MappedBy("group")
- public abstract ConsumerGroupMapping getGroup();
-
- public abstract void setGroup(ConsumerGroupMapping group);
-
- @OneToOne
- @MappedBy("capabilities")
- public abstract ConsumerCapabilitiesMapping getCapabilities();
-
- @FindById
- public abstract ConsumerGroupMapping findGroupById(String id);
-
- public void initFrom(Consumer consumer)
- {
- setName(consumer.getName());
- setConsumerAgent(consumer.getConsumerAgent());
- setStatus(consumer.getStatus());
-
- ConsumerGroup group = consumer.getGroup();
- if (group != null)
- {
- ConsumerGroupMapping cgm = findGroupById(group.getPersistentKey());
- setGroup(cgm);
- }
-
- ConsumerCapabilitiesMapping ccm = getCapabilities();
- ccm.initFrom(consumer.getCapabilities());
-
- try
- {
- Map<String, RegistrationMapping> rms = getRegistrations();
- for (Registration reg : consumer.getRegistrations())
- {
- RegistrationMapping rm = createRegistration();
- rm.initFrom(reg);
- rms.put(reg.getRegistrationHandle(), rm);
- }
- }
- catch (RegistrationException e)
- {
- throw new RuntimeException(e);
- }
- }
-
- public ConsumerSPI toConsumer(JCRRegistrationPersistenceManager persistenceManager)
throws RegistrationException
- {
- ConsumerSPI consumer = persistenceManager.newConsumerSPI(getId(), getName());
- consumer.setConsumerAgent(getConsumerAgent());
- consumer.setStatus(getStatus());
- consumer.setPersistentKey(getPersistentKey());
-
- consumer.setCapabilities(getCapabilities().toConsumerCapabilities());
-
- ConsumerGroupMapping cgm = getGroup();
- if (cgm != null)
- {
- consumer.setGroup(persistenceManager.getConsumerGroup(cgm.getName()));
- }
-
- for (RegistrationMapping rm : getRegistrations().values())
- {
- consumer.addRegistration(rm.toRegistration(persistenceManager, consumer));
- }
-
- return consumer;
- }
-}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java
(from rev 964,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumerMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,161 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.gatein.portal.wsrp.state.producer.registrations.mapping;
+
+import org.chromattic.api.RelationshipType;
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.FindById;
+import org.chromattic.api.annotations.Id;
+import org.chromattic.api.annotations.ManyToOne;
+import org.chromattic.api.annotations.MappedBy;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToMany;
+import org.chromattic.api.annotations.OneToOne;
+import org.chromattic.api.annotations.Property;
+import org.chromattic.api.annotations.RelatedMappedBy;
+import
org.gatein.portal.wsrp.state.producer.registrations.JCRRegistrationPersistenceManager;
+import org.gatein.registration.Consumer;
+import org.gatein.registration.ConsumerGroup;
+import org.gatein.registration.Registration;
+import org.gatein.registration.RegistrationException;
+import org.gatein.registration.RegistrationStatus;
+import org.gatein.registration.spi.ConsumerSPI;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = ConsumerMapping.NODE_NAME)
+public abstract class ConsumerMapping
+{
+ public static final String NODE_NAME = "wsrp:consumer";
+
+ @Id
+ public abstract String getPersistentKey();
+
+ @Property(name = "name")
+ public abstract String getName();
+
+ public abstract void setName(String name);
+
+ @Property(name = "id")
+ public abstract String getId();
+
+ public abstract void setId(String id);
+
+ @Property(name = "consumeragent")
+ public abstract String getConsumerAgent();
+
+ public abstract void setConsumerAgent(String consumerAgent);
+
+ @Property(name = "status")
+ public abstract RegistrationStatus getStatus();
+
+ public abstract void setStatus(RegistrationStatus status);
+
+ @OneToMany
+ @RelatedMappedBy("consumer")
+ public abstract List<RegistrationMapping> getRegistrations();
+
+ @Create
+ public abstract RegistrationMapping createRegistration(String path);
+
+ @ManyToOne(type = RelationshipType.PATH)
+ @MappedBy("group")
+ public abstract ConsumerGroupMapping getGroup();
+
+ public abstract void setGroup(ConsumerGroupMapping group);
+
+ @OneToOne
+ @MappedBy("capabilities")
+ public abstract ConsumerCapabilitiesMapping getCapabilities();
+
+ @FindById
+ public abstract ConsumerGroupMapping findGroupById(String id);
+
+ public RegistrationMapping createAndAddRegistrationMappingFrom(Registration
registration)
+ {
+ // create, add to parent then init
+ RegistrationMapping rm = createRegistration("" + System.nanoTime());
+ getRegistrations().add(rm);
+ if (registration != null)
+ {
+ rm.initFrom(registration);
+ }
+ return rm;
+ }
+
+ public void initFrom(Consumer consumer)
+ {
+ setName(consumer.getName());
+ setConsumerAgent(consumer.getConsumerAgent());
+ setStatus(consumer.getStatus());
+
+ ConsumerGroup group = consumer.getGroup();
+ if (group != null)
+ {
+ ConsumerGroupMapping cgm = findGroupById(group.getPersistentKey());
+ setGroup(cgm);
+ }
+
+ ConsumerCapabilitiesMapping ccm = getCapabilities();
+ ccm.initFrom(consumer.getCapabilities());
+
+ try
+ {
+ for (Registration reg : consumer.getRegistrations())
+ {
+ createAndAddRegistrationMappingFrom(reg);
+ }
+ }
+ catch (RegistrationException e)
+ {
+ throw new RuntimeException(e);
+ }
+ }
+
+ public ConsumerSPI toConsumer(JCRRegistrationPersistenceManager persistenceManager)
throws RegistrationException
+ {
+ ConsumerSPI consumer = persistenceManager.newConsumerSPI(getId(), getName());
+ consumer.setConsumerAgent(getConsumerAgent());
+ consumer.setStatus(getStatus());
+ consumer.setPersistentKey(getPersistentKey());
+
+ consumer.setCapabilities(getCapabilities().toConsumerCapabilities());
+
+ ConsumerGroupMapping cgm = getGroup();
+ if (cgm != null)
+ {
+ consumer.setGroup(persistenceManager.getConsumerGroup(cgm.getName()));
+ }
+
+ for (RegistrationMapping rm : getRegistrations())
+ {
+ consumer.addRegistration(rm.toRegistration(persistenceManager, consumer));
+ }
+
+ return consumer;
+ }
+}
Deleted:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java 2009-12-07
18:05:05 UTC (rev 964)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,51 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.gatein.portal.wsrp.state.producer.registrations.mapping;
-
-import org.chromattic.api.annotations.Create;
-import org.chromattic.api.annotations.NodeMapping;
-import org.chromattic.api.annotations.OneToMany;
-
-import java.util.Map;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-@NodeMapping(name = ConsumersAndGroupsMapping.NODE_NAME)
-public abstract class ConsumersAndGroupsMapping
-{
- public static final String NODE_NAME = "wsrp:consumersandgroups";
-
- @OneToMany
- public abstract Map<String, ConsumerMapping> getConsumers();
-
- @OneToMany
- public abstract Map<String, ConsumerGroupMapping> getConsumerGroups();
-
- @Create
- public abstract ConsumerMapping createConsumer(String id);
-
- @Create
- public abstract ConsumerGroupMapping createConsumerGroup(String name);
-}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java
(from rev 964,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/ConsumersAndGroupsMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,51 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.gatein.portal.wsrp.state.producer.registrations.mapping;
+
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToMany;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = ConsumersAndGroupsMapping.NODE_NAME)
+public abstract class ConsumersAndGroupsMapping
+{
+ public static final String NODE_NAME = "wsrp:consumersandgroups";
+
+ @OneToMany
+ public abstract List<ConsumerMapping> getConsumers();
+
+ @OneToMany
+ public abstract List<ConsumerGroupMapping> getConsumerGroups();
+
+ @Create
+ public abstract ConsumerMapping createConsumer(String id);
+
+ @Create
+ public abstract ConsumerGroupMapping createConsumerGroup(String name);
+}
Deleted:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java 2009-12-07
18:05:05 UTC (rev 964)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,96 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.gatein.portal.wsrp.state.producer.registrations.mapping;
-
-import org.chromattic.api.RelationshipType;
-import org.chromattic.api.annotations.FindById;
-import org.chromattic.api.annotations.Id;
-import org.chromattic.api.annotations.ManyToOne;
-import org.chromattic.api.annotations.MappedBy;
-import org.chromattic.api.annotations.NodeMapping;
-import org.chromattic.api.annotations.OneToOne;
-import org.chromattic.api.annotations.Property;
-import
org.gatein.portal.wsrp.state.producer.registrations.JCRRegistrationPersistenceManager;
-import org.gatein.registration.Registration;
-import org.gatein.registration.RegistrationException;
-import org.gatein.registration.RegistrationStatus;
-import org.gatein.registration.spi.ConsumerSPI;
-import org.gatein.registration.spi.RegistrationSPI;
-
-import javax.xml.namespace.QName;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-@NodeMapping(name = RegistrationMapping.NODE_NAME)
-public abstract class RegistrationMapping
-{
- public static final String NODE_NAME = "wsrp:registration";
-
- @Id
- public abstract String getPersistentKey();
-
- @ManyToOne(type = RelationshipType.PATH)
- @MappedBy("consumer")
- public abstract ConsumerMapping getConsumer();
-
- @Property(name = "status")
- public abstract RegistrationStatus getStatus();
- public abstract void setStatus(RegistrationStatus status);
-
- @Property(name = "registrationhandle")
- public abstract String getRegistrationHandle();
- public abstract void setRegistrationHandle(String handle);
-
- @OneToOne
- @MappedBy("properties")
- public abstract RegistrationPropertiesMapping getProperties();
-
- @FindById
- public abstract ConsumerMapping findConsumerById(String id);
-
- public void initFrom(Registration registration)
- {
- setStatus(registration.getStatus());
- setRegistrationHandle(registration.getRegistrationHandle());
-
- getProperties().initFrom(registration.getProperties());
-
- ConsumerMapping cm = findConsumerById(registration.getConsumer().getId());
- cm.getRegistrations().put(registration.getPersistentKey(), this);
- }
-
- public RegistrationSPI toRegistration(JCRRegistrationPersistenceManager
persistenceManager, ConsumerSPI consumer) throws RegistrationException
- {
- ConsumerMapping cm = getConsumer();
-
- RegistrationSPI reg = persistenceManager.newRegistrationSPI(consumer,
getProperties().toPropMap(), getPersistentKey());
- reg.setStatus(getStatus());
- reg.setRegistrationHandle(getRegistrationHandle());
- return reg;
- }
-}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
(from rev 964,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,113 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.gatein.portal.wsrp.state.producer.registrations.mapping;
+
+import org.chromattic.api.annotations.Create;
+import org.chromattic.api.annotations.Id;
+import org.chromattic.api.annotations.ManyToOne;
+import org.chromattic.api.annotations.MappedBy;
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.OneToOne;
+import org.chromattic.api.annotations.Property;
+import org.gatein.common.util.ParameterValidation;
+import
org.gatein.portal.wsrp.state.producer.registrations.JCRRegistrationPersistenceManager;
+import org.gatein.registration.Registration;
+import org.gatein.registration.RegistrationException;
+import org.gatein.registration.RegistrationStatus;
+import org.gatein.registration.spi.ConsumerSPI;
+import org.gatein.registration.spi.RegistrationSPI;
+
+import javax.xml.namespace.QName;
+import java.util.Collections;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = RegistrationMapping.NODE_NAME)
+public abstract class RegistrationMapping
+{
+ public static final String NODE_NAME = "wsrp:registration";
+
+ @Id
+ public abstract String getPersistentKey();
+
+ @ManyToOne
+ @MappedBy("consumer")
+ public abstract ConsumerMapping getConsumer();
+
+ @Property(name = "status")
+ public abstract RegistrationStatus getStatus();
+
+ public abstract void setStatus(RegistrationStatus status);
+
+ @Property(name = "registrationhandle")
+ public abstract String getRegistrationHandle();
+
+ public abstract void setRegistrationHandle(String handle);
+
+ @OneToOne
+ @MappedBy("properties")
+ public abstract RegistrationPropertiesMapping getProperties();
+
+ public abstract void setProperties(RegistrationPropertiesMapping rpm);
+
+ @Create
+ public abstract RegistrationPropertiesMapping createProperties();
+
+ /**
+ * At this point, this RegistrationMapping should already have been added to its
parent
+ *
+ * @param registration
+ */
+ public void initFrom(Registration registration)
+ {
+ setStatus(registration.getStatus());
+ setRegistrationHandle(registration.getRegistrationHandle());
+
+ Map<QName, Object> properties = registration.getProperties();
+ if (ParameterValidation.existsAndIsNotEmpty(properties))
+ {
+ RegistrationPropertiesMapping rpm = createProperties();
+ setProperties(rpm);
+ rpm.initFrom(properties);
+ }
+ }
+
+ public RegistrationSPI toRegistration(JCRRegistrationPersistenceManager
persistenceManager, ConsumerSPI consumer) throws RegistrationException
+ {
+ RegistrationPropertiesMapping rpm = getProperties();
+ Map<QName, Object> props = Collections.emptyMap();
+ if (rpm != null)
+ {
+ props = rpm.toPropMap();
+ }
+
+ RegistrationSPI reg = persistenceManager.newRegistrationSPI(consumer, props,
getPersistentKey());
+ reg.setStatus(getStatus());
+ reg.setRegistrationHandle(getRegistrationHandle());
+
+ return reg;
+ }
+}
Deleted:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationPropertiesMapping.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationPropertiesMapping.java 2009-12-07
18:05:05 UTC (rev 964)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationPropertiesMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,73 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.gatein.portal.wsrp.state.producer.registrations.mapping;
-
-import org.chromattic.api.annotations.NodeMapping;
-import org.chromattic.api.annotations.Properties;
-
-import javax.xml.namespace.QName;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-/**
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-@NodeMapping(name = RegistrationPropertiesMapping.NODE_NAME)
-public abstract class RegistrationPropertiesMapping
-{
- public static final String NODE_NAME = "wsrp:registrationproperties";
-
- @Properties
- public abstract Map<String, String> getProperties();
-
- public Map<QName, Object> toPropMap()
- {
- Map<QName, Object> properties = Collections.emptyMap();
- Map<String, String> propMap = getProperties();
- if (!propMap.isEmpty())
- {
- properties = new HashMap<QName, Object>(propMap.size());
- for (Map.Entry<String, String> entry : propMap.entrySet())
- {
- properties.put(QName.valueOf(entry.getKey()), entry.getValue());
- }
- }
-
- return properties;
- }
-
- public void initFrom(Map<QName, Object> properties)
- {
- if(properties != null)
- {
- Map<String, String> map = getProperties();
-
- for (Map.Entry<QName, Object> entry : properties.entrySet())
- {
- map.put(entry.getKey().toString(), entry.getValue().toString());
- }
- }
- }
-}
Copied:
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationPropertiesMapping.java
(from rev 964,
portal/branches/wsrp-integration/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationPropertiesMapping.java)
===================================================================
---
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationPropertiesMapping.java
(rev 0)
+++
portal/trunk/component/wsrp/src/main/java/org/gatein/portal/wsrp/state/producer/registrations/mapping/RegistrationPropertiesMapping.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,73 @@
+/*
+* JBoss, a division of Red Hat
+* Copyright 2008, Red Hat Middleware, LLC, and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+*/
+
+package org.gatein.portal.wsrp.state.producer.registrations.mapping;
+
+import org.chromattic.api.annotations.NodeMapping;
+import org.chromattic.api.annotations.Properties;
+
+import javax.xml.namespace.QName;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@NodeMapping(name = RegistrationPropertiesMapping.NODE_NAME)
+public abstract class RegistrationPropertiesMapping
+{
+ public static final String NODE_NAME = "wsrp:registrationproperties";
+
+ @Properties
+ public abstract Map<String, String> getProperties();
+
+ public Map<QName, Object> toPropMap()
+ {
+ Map<QName, Object> properties = Collections.emptyMap();
+ Map<String, String> propMap = getProperties();
+ if (!propMap.isEmpty())
+ {
+ properties = new HashMap<QName, Object>(propMap.size());
+ for (Map.Entry<String, String> entry : propMap.entrySet())
+ {
+ properties.put(QName.valueOf(entry.getKey()), entry.getValue());
+ }
+ }
+
+ return properties;
+ }
+
+ public void initFrom(Map<QName, Object> properties)
+ {
+ if(properties != null)
+ {
+ Map<String, String> map = getProperties();
+
+ for (Map.Entry<QName, Object> entry : properties.entrySet())
+ {
+ map.put(entry.getKey().toString(), entry.getValue().toString());
+ }
+ }
+ }
+}
Copied: portal/trunk/component/wsrp/src/test (from rev 654,
portal/branches/wsrp-integration/component/wsrp/src/test)
Copied: portal/trunk/component/wsrp/src/test/java (from rev 654,
portal/branches/wsrp-integration/component/wsrp/src/test/java)
Copied: portal/trunk/component/wsrp/src/test/java/org (from rev 654,
portal/branches/wsrp-integration/component/wsrp/src/test/java/org)
Copied: portal/trunk/component/wsrp/src/test/java/org/gatein (from rev 654,
portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein)
Copied: portal/trunk/component/wsrp/src/test/java/org/gatein/portal (from rev 654,
portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal)
Copied: portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp (from rev 654,
portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp)
Copied: portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state (from rev
654,
portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp/state)
Copied: portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer
(from rev 654,
portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer)
Deleted:
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java 2009-11-18
23:03:17 UTC (rev 654)
+++
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,150 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2009, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-
-package org.gatein.portal.wsrp.state.consumer;
-
-import junit.framework.TestCase;
-import org.gatein.pc.federation.impl.FederatingPortletInvokerService;
-import org.gatein.wsrp.WSRPConsumer;
-import org.gatein.wsrp.consumer.ConsumerException;
-import org.gatein.wsrp.consumer.EndpointConfigurationInfo;
-import org.gatein.wsrp.consumer.ProducerInfo;
-import org.gatein.wsrp.consumer.RegistrationInfo;
-
-import java.util.Collection;
-
-/**
- * This is essentially the same class as
org.gatein.wsrp.state.consumer.ConsumerRegistryTestCase in WSRP consumer module
- * tests.
- *
- * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
- * @version $Revision$
- */
-public class ConsumerRegistryTestCase extends TestCase
-{
- private ConsumerRegistry registry;
-
- @Override
- protected void setUp() throws Exception
- {
- registry = new ConsumerRegistry();
- registry.setFederatingPortletInvoker(new FederatingPortletInvokerService());
- }
-
- public void testCreateAndGet()
- {
- String id = "test";
- WSRPConsumer consumer = registry.createConsumer(id, null);
- assertNotNull(consumer);
- assertEquals(id, consumer.getProducerId());
- ProducerInfo info = consumer.getProducerInfo();
- assertNotNull(info);
- assertEquals(consumer.getProducerId(), info.getId());
- EndpointConfigurationInfo endpoint = info.getEndpointConfigurationInfo();
- assertNotNull(endpoint);
- RegistrationInfo regInfo = info.getRegistrationInfo();
- assertTrue(regInfo.isUndetermined());
-
- WSRPConsumer fromRegistry = registry.getConsumer(id);
- assertNotNull(fromRegistry);
- assertEquals(consumer.getProducerId(), fromRegistry.getProducerId());
- ProducerInfo fromRegistryInfo = fromRegistry.getProducerInfo();
- assertNotNull(fromRegistryInfo);
- assertEquals(fromRegistry.getProducerId(), fromRegistryInfo.getId());
- assertNotNull(fromRegistryInfo.getEndpointConfigurationInfo());
- assertTrue(fromRegistryInfo.getRegistrationInfo().isUndetermined());
-
- assertEquals(info.getId(), fromRegistryInfo.getId());
- assertEquals(info.getEndpointConfigurationInfo(),
fromRegistryInfo.getEndpointConfigurationInfo());
- assertEquals(info.getRegistrationInfo(), fromRegistryInfo.getRegistrationInfo());
-
- Collection consumers = registry.getConfiguredConsumers();
- assertNotNull(consumers);
- assertEquals(1, consumers.size());
- assertTrue(consumers.contains(consumer));
- }
-
- public void testGetConsumer()
- {
- assertNull(registry.getConsumer("inexistent"));
- }
-
- public void testGetProducerInfoByKey()
- {
- WSRPConsumer consumer = registry.createConsumer("id", null);
- ProducerInfo info = consumer.getProducerInfo();
-
- String key = info.getKey();
- assertNotNull(key);
-
- assertEquals(info, registry.getProducerInfoByKey(key));
- }
-
- public void testDoubleRegistrationOfConsumerWithSameId()
- {
- String id = "foo";
-
- registry.createConsumer(id, null);
-
- try
- {
- registry.createConsumer(id, null);
- fail("Shouldn't be possible to create a consumer with an existing
id");
- }
- catch (ConsumerException expected)
- {
- }
- }
-
- public void testDelete()
- {
- String id = "id";
-
- WSRPConsumer consumer = registry.createConsumer(id, null);
- assertEquals(consumer, registry.getConsumer(id));
-
- String key = consumer.getProducerInfo().getKey();
-
- registry.destroyConsumer(id);
-
- assertNull(registry.getConsumer(id));
- assertNull(registry.getProducerInfoByKey(key));
- }
-
- public void testUpdateProducerInfo()
- {
- // create a foo consumer
- String id = "foo";
- WSRPConsumer consumer = registry.createConsumer(id, null);
- ProducerInfo info = consumer.getProducerInfo();
- String key = info.getKey();
-
- // change the id on the consumer's producer info and save it
- info.setId("bar");
- registry.updateProducerInfo(info);
-
- assertNull(registry.getConsumer(id));
- assertEquals(info, consumer.getProducerInfo());
- assertEquals(info, registry.getProducerInfoByKey(key));
- assertEquals(consumer, registry.getConsumer("bar"));
- }
-}
Copied:
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
(from rev 654,
portal/branches/wsrp-integration/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java)
===================================================================
---
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java
(rev 0)
+++
portal/trunk/component/wsrp/src/test/java/org/gatein/portal/wsrp/state/consumer/ConsumerRegistryTestCase.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,158 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+
+package org.gatein.portal.wsrp.state.consumer;
+
+import org.exoplatform.component.test.AbstractGateInTest;
+import org.exoplatform.component.test.ConfigurationUnit;
+import org.exoplatform.component.test.ConfiguredBy;
+import org.exoplatform.component.test.ContainerScope;
+import org.gatein.pc.federation.impl.FederatingPortletInvokerService;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.ConsumerException;
+import org.gatein.wsrp.consumer.EndpointConfigurationInfo;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.RegistrationInfo;
+
+import java.util.Collection;
+
+/**
+ * This is essentially the same class as
org.gatein.wsrp.state.consumer.ConsumerRegistryTestCase in WSRP consumer module
+ * tests.
+ *
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+@ConfiguredBy({
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path =
"conf/jcr/jcr-configuration.xml"),
+ @ConfigurationUnit(scope = ContainerScope.PORTAL, path =
"conf/test-configuration.xml")
+})
+public class ConsumerRegistryTestCase extends AbstractGateInTest
+{
+ private JCRConsumerRegistry registry;
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ registry = new JCRConsumerRegistry(getContainer());
+ registry.setFederatingPortletInvoker(new FederatingPortletInvokerService());
+ }
+
+ public void testCreateAndGet()
+ {
+ String id = "test";
+ WSRPConsumer consumer = registry.createConsumer(id, null, null);
+ assertNotNull(consumer);
+ assertEquals(id, consumer.getProducerId());
+ ProducerInfo info = consumer.getProducerInfo();
+ assertNotNull(info);
+ assertEquals(consumer.getProducerId(), info.getId());
+ EndpointConfigurationInfo endpoint = info.getEndpointConfigurationInfo();
+ assertNotNull(endpoint);
+ RegistrationInfo regInfo = info.getRegistrationInfo();
+ assertTrue(regInfo.isUndetermined());
+
+ WSRPConsumer fromRegistry = registry.getConsumer(id);
+ assertNotNull(fromRegistry);
+ assertEquals(consumer.getProducerId(), fromRegistry.getProducerId());
+ ProducerInfo fromRegistryInfo = fromRegistry.getProducerInfo();
+ assertNotNull(fromRegistryInfo);
+ assertEquals(fromRegistry.getProducerId(), fromRegistryInfo.getId());
+ assertNotNull(fromRegistryInfo.getEndpointConfigurationInfo());
+ assertTrue(fromRegistryInfo.getRegistrationInfo().isUndetermined());
+
+ assertEquals(info.getId(), fromRegistryInfo.getId());
+ assertEquals(info.getEndpointConfigurationInfo(),
fromRegistryInfo.getEndpointConfigurationInfo());
+ assertEquals(info.getRegistrationInfo(), fromRegistryInfo.getRegistrationInfo());
+
+ Collection consumers = registry.getConfiguredConsumers();
+ assertNotNull(consumers);
+ assertEquals(1, consumers.size());
+ assertTrue(consumers.contains(consumer));
+ }
+
+ public void testGetConsumer()
+ {
+ assertNull(registry.getConsumer("inexistent"));
+ }
+
+ public void testGetProducerInfoByKey()
+ {
+ WSRPConsumer consumer = registry.createConsumer("id", null, null);
+ ProducerInfo info = consumer.getProducerInfo();
+
+ String key = info.getKey();
+ assertNotNull(key);
+
+ assertEquals(info, registry.getProducerInfoByKey(key));
+ }
+
+ public void testDoubleRegistrationOfConsumerWithSameId()
+ {
+ String id = "foo";
+
+ registry.createConsumer(id, null, null);
+
+ try
+ {
+ registry.createConsumer(id, null, null);
+ fail("Shouldn't be possible to create a consumer with an existing
id");
+ }
+ catch (ConsumerException expected)
+ {
+ }
+ }
+
+ public void testDelete()
+ {
+ String id = "id";
+
+ WSRPConsumer consumer = registry.createConsumer(id, null, null);
+ assertEquals(consumer, registry.getConsumer(id));
+
+ String key = consumer.getProducerInfo().getKey();
+
+ registry.destroyConsumer(id);
+
+ assertNull(registry.getConsumer(id));
+ assertNull(registry.getProducerInfoByKey(key));
+ }
+
+ public void testUpdateProducerInfo()
+ {
+ // create a foo consumer
+ String id = "foo";
+ WSRPConsumer consumer = registry.createConsumer(id, null, null);
+ ProducerInfo info = consumer.getProducerInfo();
+ String key = info.getKey();
+
+ // change the id on the consumer's producer info and save it
+ info.setId("bar");
+ registry.updateProducerInfo(info);
+
+ assertNull(registry.getConsumer(id));
+ assertEquals(info, consumer.getProducerInfo());
+ assertEquals(info, registry.getProducerInfoByKey(key));
+ assertEquals(consumer, registry.getConsumer("bar"));
+ }
+}
Copied: portal/trunk/component/wsrp/src/test/resources (from rev 1078,
portal/branches/wsrp-integration/component/wsrp/src/test/resources)
Copied: portal/trunk/component/wsrp/src/test/resources/conf (from rev 1078,
portal/branches/wsrp-integration/component/wsrp/src/test/resources/conf)
Deleted:
portal/trunk/component/wsrp/src/test/resources/conf/consumers-configuration-nodetypes.xml
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/test/resources/conf/consumers-configuration-nodetypes.xml 2009-12-20
10:23:34 UTC (rev 1078)
+++
portal/trunk/component/wsrp/src/test/resources/conf/consumers-configuration-nodetypes.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,183 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<!--
- ~ JBoss, a division of Red Hat
- ~ Copyright 2009, Red Hat Middleware, LLC, and individual
- ~ contributors as indicated by the @authors tag. See the
- ~ copyright.txt in the distribution for a full listing of
- ~ individual contributors.
- ~
- ~ This is free software; you can redistribute it and/or modify it
- ~ under the terms of the GNU Lesser General Public License as
- ~ published by the Free Software Foundation; either version 2.1 of
- ~ the License, or (at your option) any later version.
- ~
- ~ This software is distributed in the hope that it will be useful,
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- ~ Lesser General Public License for more details.
- ~
- ~ You should have received a copy of the GNU Lesser General Public
- ~ License along with this software; if not, write to the Free
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- -->
-
-<nodeTypes
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
-
xmlns:jcr="http://www.jcp.org/jcr/1.0">
-
- <nodeType name="wsrp:producerinfos" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <childNodeDefinitions>
- <childNodeDefinition name="*"
defaultPrimaryType="wsrp:producerinfo" autoCreated="false"
mandatory="false"
- onParentVersion="COPY"
protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
- <requiredPrimaryType>wsrp:producerinfo</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="wsrp:producerinfo" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="producerid"
requiredType="String" autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="cache" requiredType="Integer"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="active" requiredType="boolean"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- <childNodeDefinitions>
- <childNodeDefinition name="endpoint"
defaultPrimaryType="wsrp:endpointinfo" autoCreated="true"
- mandatory="false"
- onParentVersion="COPY"
protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
- <requiredPrimaryType>wsrp:endpointinfo</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- <childNodeDefinition name="registration"
defaultPrimaryType="wsrp:registrationinfo" autoCreated="true"
- mandatory="false"
- onParentVersion="COPY"
protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
-
<requiredPrimaryType>wsrp:registrationinfo</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="wsrp:endpointinfo" isMixin="false"
hasOrderableChildNodes="false" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="wsdlurl" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- </nodeType>
-
- <nodeType name="wsrp:registrationinfo" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="consumername"
requiredType="String" autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="handle" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="state" requiredType="Binary"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- <childNodeDefinitions>
- <childNodeDefinition name="*"
defaultPrimaryType="wsrp:registrationproperty" autoCreated="false"
- mandatory="false"
- onParentVersion="COPY"
protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
-
<requiredPrimaryType>wsrp:registrationproperty</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="wsrp:registrationproperty" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="name" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="value" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="status" requiredType="Integer"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- <childNodeDefinitions>
- <childNodeDefinition name="description"
defaultPrimaryType="" autoCreated="false" mandatory="false"
- onParentVersion="COPY"
protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
-
<requiredPrimaryType>wsrp:registrationpropertydescription</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="wsrp:registrationpropertydescription"
isMixin="false" hasOrderableChildNodes="true"
- primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="name" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="type" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="description"
requiredType="String" autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="hint" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="label" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- </nodeType>
-
-</nodeTypes>
\ No newline at end of file
Copied:
portal/trunk/component/wsrp/src/test/resources/conf/consumers-configuration-nodetypes.xml
(from rev 1078,
portal/branches/wsrp-integration/component/wsrp/src/test/resources/conf/consumers-configuration-nodetypes.xml)
===================================================================
---
portal/trunk/component/wsrp/src/test/resources/conf/consumers-configuration-nodetypes.xml
(rev 0)
+++
portal/trunk/component/wsrp/src/test/resources/conf/consumers-configuration-nodetypes.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
+
+<nodeTypes
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
+
xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <nodeType name="wsrp:producerinfos" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*"
defaultPrimaryType="wsrp:producerinfo" autoCreated="false"
mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:producerinfo</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:producerinfo" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="producerid"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="cache" requiredType="Integer"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="active" requiredType="boolean"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="endpoint"
defaultPrimaryType="wsrp:endpointinfo" autoCreated="true"
+ mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:endpointinfo</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="registration"
defaultPrimaryType="wsrp:registrationinfo" autoCreated="true"
+ mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+
<requiredPrimaryType>wsrp:registrationinfo</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:endpointinfo" isMixin="false"
hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="wsdlurl" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationinfo" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="consumername"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="handle" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="state" requiredType="Binary"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*"
defaultPrimaryType="wsrp:registrationproperty" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+
<requiredPrimaryType>wsrp:registrationproperty</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationproperty" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="name" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="value" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="status" requiredType="Integer"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="description"
defaultPrimaryType="" autoCreated="false" mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+
<requiredPrimaryType>wsrp:registrationpropertydescription</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationpropertydescription"
isMixin="false" hasOrderableChildNodes="true"
+ primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="name" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="type" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="description"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="hint" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="label" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>
\ No newline at end of file
Deleted: portal/trunk/component/wsrp/src/test/resources/conf/test-configuration.xml
===================================================================
---
portal/branches/wsrp-integration/component/wsrp/src/test/resources/conf/test-configuration.xml 2009-12-20
10:23:34 UTC (rev 1078)
+++ portal/trunk/component/wsrp/src/test/resources/conf/test-configuration.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,83 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- 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.
-
--->
-
-<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
-
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
- <component>
- <key>org.exoplatform.commons.chromattic.ChromatticManager</key>
- <type>org.exoplatform.commons.chromattic.ChromatticManager</type>
- </component>
- <external-component-plugins>
-
<target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
- <component-plugin>
- <name>add.namespaces</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
- <init-params>
- <properties-param>
- <name>namespaces</name>
- <property name="wsrp"
value="http://www.gatein.org/jcr/wsrp/1.0/"/>
- </properties-param>
- </init-params>
- </component-plugin>
- <component-plugin>
- <name>add.nodeType</name>
- <set-method>addPlugin</set-method>
- <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
- <init-params>
- <values-param>
- <name>autoCreatedInNewRepository</name>
- <description>Node types configuration file</description>
-
<value>jar:/conf/consumers-configuration-nodetypes.xml</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
- <external-component-plugins>
-
<target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
- <component-plugin>
- <name>chromattic</name>
- <set-method>addLifeCycle</set-method>
- <type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
- <init-params>
- <value-param>
- <name>name</name>
- <value>wsrp</value>
- </value-param>
- <value-param>
- <name>workspace-name</name>
- <value>portal-test</value>
- </value-param>
- <values-param>
- <name>entities</name>
-
<value>org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping</value>
-
<value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping</value>
-
<value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping</value>
-
<value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationInfoMapping</value>
-
<value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping</value>
-
<value>org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping</value>
- </values-param>
- </init-params>
- </component-plugin>
- </external-component-plugins>
-</configuration>
Copied: portal/trunk/component/wsrp/src/test/resources/conf/test-configuration.xml (from
rev 1078,
portal/branches/wsrp-integration/component/wsrp/src/test/resources/conf/test-configuration.xml)
===================================================================
--- portal/trunk/component/wsrp/src/test/resources/conf/test-configuration.xml
(rev 0)
+++ portal/trunk/component/wsrp/src/test/resources/conf/test-configuration.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<configuration
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+ <component>
+ <key>org.exoplatform.commons.chromattic.ChromatticManager</key>
+ <type>org.exoplatform.commons.chromattic.ChromatticManager</type>
+ </component>
+ <external-component-plugins>
+
<target-component>org.exoplatform.services.jcr.RepositoryService</target-component>
+ <component-plugin>
+ <name>add.namespaces</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNamespacesPlugin</type>
+ <init-params>
+ <properties-param>
+ <name>namespaces</name>
+ <property name="wsrp"
value="http://www.gatein.org/jcr/wsrp/1.0/"/>
+ </properties-param>
+ </init-params>
+ </component-plugin>
+ <component-plugin>
+ <name>add.nodeType</name>
+ <set-method>addPlugin</set-method>
+ <type>org.exoplatform.services.jcr.impl.AddNodeTypePlugin</type>
+ <init-params>
+ <values-param>
+ <name>autoCreatedInNewRepository</name>
+ <description>Node types configuration file</description>
+
<value>jar:/conf/consumers-configuration-nodetypes.xml</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+ <external-component-plugins>
+
<target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
+ <component-plugin>
+ <name>chromattic</name>
+ <set-method>addLifeCycle</set-method>
+ <type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
+ <init-params>
+ <value-param>
+ <name>domain-name</name>
+ <value>wsrp</value>
+ </value-param>
+ <value-param>
+ <name>workspace-name</name>
+ <value>portal-test</value>
+ </value-param>
+ <values-param>
+ <name>entities</name>
+
<value>org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping</value>
+
<value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping</value>
+
<value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping</value>
+
<value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationInfoMapping</value>
+
<value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping</value>
+
<value>org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+</configuration>
Modified: portal/trunk/packaging/profiles.xml
===================================================================
--- portal/trunk/packaging/profiles.xml 2009-12-22 10:02:32 UTC (rev 1125)
+++ portal/trunk/packaging/profiles.xml 2009-12-22 12:35:37 UTC (rev 1126)
@@ -29,7 +29,7 @@
ex: On Windows 'c:/AS'
ex: On Linux '/home/user/AS'
-->
-
<exo.projects.directory.dependencies>REPLACE_WITH_YOUR_OWN_DIRECTORY</exo.projects.directory.dependencies>
+
<exo.projects.directory.dependencies>/home/theute/Portal/Development/workspace_GateIn/portal/packaging</exo.projects.directory.dependencies>
<!--
If you want that the server is deployed always at the same place (not in
packaging/pkg/target/<server> dir)
Modified: portal/trunk/pom.xml
===================================================================
--- portal/trunk/pom.xml 2009-12-22 10:02:32 UTC (rev 1125)
+++ portal/trunk/pom.xml 2009-12-22 12:35:37 UTC (rev 1126)
@@ -19,7 +19,8 @@
-->
-<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+<project
xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
@@ -47,7 +48,7 @@
<org.gatein.wci.version>2.0.0-CR02</org.gatein.wci.version>
<org.gatein.pc.version>2.1.0-CR01</org.gatein.pc.version>
<org.picketlink.idm>1.0.0.CR1</org.picketlink.idm>
- <org.gatein.wsrp.version>1.0.0-Beta01</org.gatein.wsrp.version>
+ <org.gatein.wsrp.version>1.0.0-Beta03</org.gatein.wsrp.version>
<org.gatein.mop.version>1.0.0-Beta12</org.gatein.mop.version>
<org.slf4j.version>1.5.6</org.slf4j.version>
<rhino.version>1.6R5</rhino.version>
@@ -59,15 +60,15 @@
<!-- ************** -->
<!-- Build settings -->
<!-- ************** -->
-
+
<!-- maven-enforcer-plugin -->
<jdk.min.version>1.6</jdk.min.version>
<!-- maven-release-plugin -->
- <arguments>-Prelease,pkg-tomcat,pkg-jbossas
-Dmaven.test.skip=true</arguments>
-
- </properties>
-
+ <arguments>-Prelease,pkg-tomcat,pkg-jbossas
-Dmaven.test.skip=true</arguments>
+
+ </properties>
+
<scm>
<
connection>scm:svn:http://anonsvn.jboss.org/repos/gatein/portal/trunk&...
<
developerConnection>scm:svn:http://svn.jboss.org/repos/gatein/portal/t...
@@ -494,7 +495,7 @@
<scope>test</scope>
</dependency>
</dependencies>
-
+
<build>
<resources>
<resource>
@@ -521,9 +522,9 @@
<pluginManagement>
<plugins>
<plugin>
- <groupId>org.codehaus.mojo</groupId>
- <artifactId>exec-maven-plugin</artifactId>
- <version>1.1.1</version>
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>exec-maven-plugin</artifactId>
+ <version>1.1.1</version>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
@@ -570,11 +571,12 @@
<phase>compile</phase>
<configuration>
<tasks>
- <copy failonerror="false"
todir="${project.build.directory}/${project.build.finalName}/WEB-INF/classes">
+ <copy failonerror="false"
+
todir="${project.build.directory}/${project.build.finalName}/WEB-INF/classes">
<fileset
dir="${basedir}/src/main/webapp/WEB-INF/classes">
- <include name="**/*_en.properties" />
+ <include name="**/*_en.properties"/>
</fileset>
- <globmapper from="*_en.properties"
to="*.properties" />
+ <globmapper from="*_en.properties"
to="*.properties"/>
</copy>
</tasks>
</configuration>
Modified: portal/trunk/portlet/exoadmin/pom.xml
===================================================================
--- portal/trunk/portlet/exoadmin/pom.xml 2009-12-22 10:02:32 UTC (rev 1125)
+++ portal/trunk/portlet/exoadmin/pom.xml 2009-12-22 12:35:37 UTC (rev 1126)
@@ -44,7 +44,26 @@
<artifactId>exo.portal.webui.eXo</artifactId>
<version>3.0.0-Beta04-SNAPSHOT</version>
<scope>provided</scope>
- </dependency>
+ </dependency>
+
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-producer-lib</artifactId>
+ <version>${org.gatein.wsrp.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-consumer</artifactId>
+ <version>${org.gatein.wsrp.version}</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-integration-api</artifactId>
+ <version>${org.gatein.wsrp.version}</version>
+ <scope>provided</scope>
+ </dependency>
</dependencies>
<build>
Copied: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp (from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp)
Copied: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui (from rev
975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui)
Copied: portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component)
Deleted:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java 2009-12-09
03:23:12 UTC (rev 975)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,138 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.exoplatform.wsrp.webui.component;
-
-import org.exoplatform.portal.webui.application.UIApplicationList;
-import org.exoplatform.portal.webui.application.UIPortlet;
-import org.exoplatform.portal.webui.container.UIContainerList;
-import org.exoplatform.portal.webui.util.Util;
-import org.exoplatform.portal.webui.workspace.UIPortalApplication;
-import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.ComponentConfigs;
-import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.UIComponent;
-import org.exoplatform.webui.core.UIContainer;
-import org.exoplatform.webui.core.UITabPane;
-import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
-import org.exoplatform.webui.event.Event;
-
-/** @author Wesley Hales */
-@ComponentConfigs({
-@ComponentConfig(
- lifecycle = UIApplicationLifecycle.class,
- template = "app:/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl"),
-@ComponentConfig(
- id = "UIWsrpConsoleTab",
- type = UITabPane.class,
- template = "app:/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl",
- events = {@EventConfig(listeners = UIWsrpConsole.SelectTabActionListener.class)})})
-public class UIWsrpConsole extends UIContainer
-{
- public UIWsrpConsole() throws Exception
- {
- UITabPane uiTabPane = addChild(UITabPane.class, "UIWsrpConsoleTab",
null);
- uiTabPane.addChild(UIWsrpConsumerOverview.class, null, null).setRendered(true);
- uiTabPane.addChild(UIContainerList.class, null, null);
- uiTabPane.setSelectedTab(1);
- }
-
- public void processRender(WebuiRequestContext context) throws Exception
- {
- UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
- int portalMode = uiPortalApp.getModeState();
- if (portalMode != UIPortalApplication.NORMAL_MODE)
- {
- UITabPane uiTabPane = this.getChild(UITabPane.class);
- UIComponent uiComponent = uiTabPane.getChildById(uiTabPane.getSelectedTabId());
- if (uiComponent instanceof UIWsrpConsumerOverview)
- {
- if (portalMode == UIPortalApplication.APP_VIEW_EDIT_MODE)
- {
- Util.showComponentEditInViewMode(UIPortlet.class);
- }
- else
- {
- uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
- Util.showComponentLayoutMode(UIPortlet.class);
- }
- }
- else if (uiComponent instanceof UIContainerList)
- {
- if (portalMode == UIPortalApplication.CONTAINER_VIEW_EDIT_MODE)
- {
-
Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
- }
- else
- {
- uiPortalApp.setModeState(UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE);
-
Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
- }
- }
- }
- super.processRender(context);
- }
-
- static public class SelectTabActionListener extends UITabPane.SelectTabActionListener
- {
- public void execute(Event<UITabPane> event) throws Exception
- {
- super.execute(event);
- UITabPane uiTabPane = event.getSource();
- UIComponent uiComponent = uiTabPane.getChildById(uiTabPane.getSelectedTabId());
- UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
- int portalMode = uiPortalApp.getModeState();
-
- if (uiComponent instanceof UIWsrpConsumerOverview)
- { // Swicth to Porlets Tab
- if (portalMode % 2 == 0)
- {
- uiPortalApp.setModeState(UIPortalApplication.APP_VIEW_EDIT_MODE);
- Util.showComponentEditInViewMode(UIPortlet.class);
- }
- else
- {
- uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
- Util.showComponentLayoutMode(UIPortlet.class);
- }
- }
- else if (uiComponent instanceof UIContainerList)
- { // Swicth to
- // Containers Tab
- if (portalMode % 2 == 0)
- {
- uiPortalApp.setModeState(UIPortalApplication.CONTAINER_VIEW_EDIT_MODE);
-
Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
- }
- else
- {
- uiPortalApp.setModeState(UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE);
-
Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
- }
- }
- event.getRequestContext().addUIComponentToUpdateByAjax(
-
Util.getUIPortalApplication().getChildById(UIPortalApplication.UI_WORKING_WS_ID));
- }
- }
-
-}
Copied:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsole.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,140 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.portal.webui.application.UIApplicationList;
+import org.exoplatform.portal.webui.application.UIPortlet;
+import org.exoplatform.portal.webui.container.UIContainerList;
+import org.exoplatform.portal.webui.util.Util;
+import org.exoplatform.portal.webui.workspace.UIPortalApplication;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.ComponentConfigs;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIComponent;
+import org.exoplatform.webui.core.UIContainer;
+import org.exoplatform.webui.core.UITabPane;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.event.Event;
+
+/** @author Wesley Hales */
+@ComponentConfigs({
+@ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class,
+ template = "app:/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl"),
+@ComponentConfig(
+ id = "UIWsrpConsoleTab",
+ type = UITabPane.class,
+ //template = "system:/groovy/webui/core/UITabPane.gtmpl",
+ template = "app:/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl",
+ events = {@EventConfig(listeners = UIWsrpConsole.SelectTabActionListener.class)})})
+public class UIWsrpConsole extends UIContainer
+{
+ public UIWsrpConsole() throws Exception
+ {
+ UITabPane uiTabPane = addChild(UITabPane.class, "UIWsrpConsoleTab",
null);
+ uiTabPane.addChild(UIWsrpConsumerOverview.class, null, "Manage
Consumers").setRendered(true);
+ uiTabPane.addChild(UIWsrpProducerOverview.class, null, "Producer
Configuration");
+ uiTabPane.setSelectedTab(1);
+
+ }
+
+ public void processRender(WebuiRequestContext context) throws Exception
+ {
+// UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
+// int portalMode = uiPortalApp.getModeState();
+// if (portalMode != UIPortalApplication.NORMAL_MODE)
+// {
+// UITabPane uiTabPane = this.getChild(UITabPane.class);
+// UIComponent uiComponent =
uiTabPane.getChildById(uiTabPane.getSelectedTabId());
+// if (uiComponent instanceof UIWsrpConsumerOverview)
+// {
+// if (portalMode == UIPortalApplication.APP_VIEW_EDIT_MODE)
+// {
+//
Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// else
+// {
+// uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
+//
Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// }
+// else if (uiComponent instanceof UIWsrpProducerOverview)
+// {
+// if (portalMode == UIPortalApplication.CONTAINER_VIEW_EDIT_MODE)
+// {
+//
Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// else
+// {
+//
uiPortalApp.setModeState(UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE);
+//
Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// }
+// }
+ super.processRender(context);
+ }
+
+ static public class SelectTabActionListener extends UITabPane.SelectTabActionListener
+ {
+ public void execute(Event<UITabPane> event) throws Exception
+ {
+// super.execute(event);
+// UITabPane uiTabPane = event.getSource();
+// UIComponent uiComponent =
uiTabPane.getChildById(uiTabPane.getSelectedTabId());
+// UIPortalApplication uiPortalApp = Util.getUIPortalApplication();
+// int portalMode = uiPortalApp.getModeState();
+//
+// if (uiComponent instanceof UIWsrpConsumerOverview)
+// { // Swicth to Porlets Tab
+// if (portalMode % 2 == 0)
+// {
+// uiPortalApp.setModeState(UIPortalApplication.APP_VIEW_EDIT_MODE);
+//
Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// else
+// {
+// uiPortalApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
+//
Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// }
+// else if (uiComponent instanceof UIWsrpProducerOverview)
+// { // Swicth to
+// // Containers Tab
+// if (portalMode % 2 == 0)
+// {
+// uiPortalApp.setModeState(UIPortalApplication.CONTAINER_VIEW_EDIT_MODE);
+//
Util.showComponentEditInViewMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// else
+// {
+//
uiPortalApp.setModeState(UIPortalApplication.CONTAINER_BLOCK_EDIT_MODE);
+//
Util.showComponentLayoutMode(org.exoplatform.portal.webui.container.UIContainer.class);
+// }
+// }
+// event.getRequestContext().addUIComponentToUpdateByAjax(
+//
Util.getUIPortalApplication().getChildById(UIPortalApplication.UI_WORKING_WS_ID));
+ }
+ }
+
+}
Deleted:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java 2009-12-09
03:23:12 UTC (rev 975)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,72 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.exoplatform.wsrp.webui.component;
-
-import org.exoplatform.applicationregistry.webui.component.UIAddApplicationForm;
-import org.exoplatform.applicationregistry.webui.component.UIApplicationForm;
-import org.exoplatform.applicationregistry.webui.component.UIApplicationOrganizer;
-import org.exoplatform.webui.application.WebuiRequestContext;
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
-import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
-import org.exoplatform.webui.form.UIForm;
-import org.exoplatform.webui.form.UIFormStringInput;
-import org.exoplatform.webui.form.validator.MandatoryValidator;
-
-/** @author Wesley Hales */
-@ComponentConfig(template =
"app:/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl", lifecycle =
UIFormLifecycle.class, events = {
- @EventConfig(listeners = UIAddApplicationForm.AddActionListener.class),
- @EventConfig(listeners = UIApplicationForm.SaveActionListener.class),
- @EventConfig(listeners = UIAddApplicationForm.CancelActionListener.class, phase =
Event.Phase.DECODE)})
-public class UIWsrpConsumerEditor extends UIApplicationForm
-{
- protected static final String CONSUMER_NAME = "Consumer Name:";
-
- public UIWsrpConsumerEditor() throws Exception
- {
- addUIFormInput(new UIFormStringInput(CONSUMER_NAME, CONSUMER_NAME,
null).addValidator(MandatoryValidator.class));
- }
-
- private String getConsumerName(){
- return getUIStringInput(CONSUMER_NAME).getValue();
- }
-
- static public class SaveActionListener extends
EventListener<UIWsrpConsumerEditor>
- {
- public void execute(Event<UIWsrpConsumerEditor> event) throws Exception
- {
- UIWsrpConsumerEditor consumerEditor = event.getSource();
- WebuiRequestContext ctx = event.getRequestContext();
- consumerEditor.save(ctx);
- }
- }
-
- public boolean save(WebuiRequestContext context) throws Exception
- {
- System.out.println("----------getConsumerName: " + getConsumerName());
- return true;
- }
-
-}
Copied:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerEditor.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,219 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIApplication;
+import org.exoplatform.webui.core.UIGrid;
+import org.exoplatform.webui.core.UIPopupWindow;
+import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.form.UIForm;
+import org.exoplatform.webui.form.UIFormStringInput;
+import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.ConsumerException;
+import org.gatein.wsrp.consumer.ProducerInfo;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
+
+/** @author Wesley Hales */
+@ComponentConfig(template =
"app:/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl", lifecycle =
UIFormLifecycle.class, events = {
+ @EventConfig(listeners = UIWsrpConsumerEditor.SaveActionListener.class)})
+public class UIWsrpConsumerEditor extends UIForm
+{
+ protected static final String CONSUMER_NAME = "Consumer Name: ";
+ protected static final String CACHE_EXPIRATION = "Cache Expiration Seconds:
";
+ protected static final String WSDL_URL = "WSDL URL: ";
+
+ public UIWsrpConsumerEditor() throws Exception
+ {
+
+ addUIFormInput(new UIFormStringInput(CONSUMER_NAME, CONSUMER_NAME,
null).addValidator(MandatoryValidator.class));
+ addUIFormInput(new UIFormStringInput(CACHE_EXPIRATION, CACHE_EXPIRATION, null));
+ addUIFormInput(new UIFormStringInput(WSDL_URL, WSDL_URL, null));
+ //addChild(UIWsrpEndpointConfigForm.class,null,null);
+ }
+
+ private String getConsumerName()
+ {
+ return getUIStringInput(CONSUMER_NAME).getValue();
+ }
+
+ private Integer getCacheExpiration()
+ {
+ Integer cacheExp = 0;
+ String cacheExpString = getUIStringInput(CACHE_EXPIRATION).getValue();
+ if (cacheExpString != null)
+ {
+ cacheExp = Integer.parseInt(cacheExpString);
+ }
+ return cacheExp;
+ }
+
+ private String getWSDLURL()
+ {
+ return getUIStringInput(WSDL_URL).getValue();
+ }
+
+ private Boolean newConsumer;
+
+ public Boolean isNewConsumer()
+ {
+ return newConsumer;
+ }
+
+ public void setNewConsumer(Boolean newConsumer)
+ {
+ this.newConsumer = newConsumer;
+ }
+
+ public void setConsumer(WSRPConsumer consumer) throws Exception
+ {
+ //UIWsrpEndpointConfigForm uiWsrpEndpointConfigForm =
getChild(UIWsrpEndpointConfigForm.class);
+ if (consumer == null)
+ {
+ getUIStringInput(CONSUMER_NAME).setEditable(UIFormStringInput.ENABLE);
+ setNewConsumer(true);
+ return;
+ }
+ getUIStringInput(CONSUMER_NAME).setEditable(UIFormStringInput.ENABLE);
+
+ getUIStringInput(CONSUMER_NAME).setValue(consumer.getProducerId());
+
getUIStringInput(CACHE_EXPIRATION).setValue(consumer.getProducerInfo().getExpirationCacheSeconds().toString());
+
getUIStringInput(WSDL_URL).setValue(consumer.getProducerInfo().getEndpointConfigurationInfo().getWsdlDefinitionURL());
+ setNewConsumer(false);
+ //invokeGetBindingBean(consumer.getProducerInfo());
+
+ //uiWsrpEndpointConfigForm.setProducerInfo(consumer.getProducerInfo());
+
//uiWsrpEndpointConfigForm.invokeGetBindingBean(consumer.getProducerInfo().getEndpointConfigurationInfo());
+ //bindingFields(consumer);
+ }
+
+ private void bindingFields(WSRPConsumer consumer)
+ {
+ //ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ //ConsumerRegistry consumerRegistry =
(ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
+ ProducerInfo producerInfo = consumer.getProducerInfo();
+ producerInfo.setId(getConsumerName());
+ producerInfo.setExpirationCacheSeconds(getCacheExpiration());
+ //EndpointConfigurationInfo ecinfo =
producerInfo.getEndpointConfigurationInfo().setWsdlDefinitionURL();
+ //producerInfo.getEndpointConfigurationInfo().setWsdlDefinitionURL(getWsdlUrl());
+ }
+
+ static public class SaveActionListener extends
EventListener<UIWsrpConsumerEditor>
+ {
+ public void execute(Event<UIWsrpConsumerEditor> event) throws Exception
+ {
+ UIWsrpConsumerEditor consumerEditor = event.getSource();
+
+ UIWsrpConsumerOverview consumerOverview =
consumerEditor.getAncestorOfType(UIWsrpConsumerOverview.class);
+
+ WebuiRequestContext ctx = event.getRequestContext();
+ if(consumerEditor.isNewConsumer()){
+ consumerEditor.save(ctx);
+ }else{
+ consumerEditor.edit(ctx);
+ }
+
+ consumerEditor.reset();
+ //loose the popup
+
+ //update the consumer grid/list using ajax
+
//event.getRequestContext().addUIComponentToUpdateByAjax(consumerEditor.getParent().getParent().findComponentById("ConsumerSelector"));
+
+ //getChild(UIAccountInputSet.class).reset();
+ UIPopupWindow popup = consumerEditor.getParent();
+ popup.setRendered(false);
+ popup.setShow(false);
+ //create a new form, clears out the old, probably a better way
+
//popup.setUIComponent(consumerOverview.createUIComponent(UIWsrpConsumerEditor.class,
null, null));
+
+ LazyPageList pageList =
consumerOverview.createPageList(consumerOverview.getConfiguredConsumers());
+ UIGrid uiGrid = consumerOverview.getChild(UIGrid.class);
+ uiGrid.getUIPageIterator().setPageList(pageList);
+
+ ctx.addUIComponentToUpdateByAjax(consumerOverview);
+
+
//consumerOverview.renderUIComponent(consumerEditor.getParent().getParent().findComponentById("ConsumerSelector"));
+ //ctx.sendRedirect(consumerOverview.url("wsrp"));
+ }
+ }
+
+ public boolean save(WebuiRequestContext context) throws Exception
+ {
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ ConsumerRegistry consumerRegistry =
(ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
+ //WSRPConsumer consumer;
+
+ UIApplication uiApp = context.getUIApplication();
+
+ try
+ {
+ consumerRegistry.createConsumer(getConsumerName(), getCacheExpiration(),
getWSDLURL());
+ uiApp.addMessage(new ApplicationMessage("Consumer Successfully Added",
null));
+ }
+ catch (ConsumerException ce)
+ {
+ //todo - add to resource bundle
+ uiApp.addMessage(new ApplicationMessage("Consumer already exists!",
null));
+ }
+ return true;
+ }
+
+ public boolean edit(WebuiRequestContext context) throws Exception
+ {
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ ConsumerRegistry consumerRegistry =
(ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
+ ProducerInfo producerInfo =
consumerRegistry.getConsumer(getConsumerName()).getProducerInfo();
+
+ //invokeSetBindingBean(consumer.getProducerInfo());
+ //UIWsrpEndpointConfigForm uiWsrpEndpointConfigForm =
getChild(UIWsrpEndpointConfigForm.class);
+
//uiWsrpEndpointConfigForm.invokeSetBindingBean(consumer.getProducerInfo().getEndpointConfigurationInfo());
+
+ producerInfo.setId(getConsumerName());
+ producerInfo.setExpirationCacheSeconds(getCacheExpiration());
+ producerInfo.getEndpointConfigurationInfo().setWsdlDefinitionURL(getWSDLURL());
+
+ UIApplication uiApp = context.getUIApplication();
+
+ try
+ {
+ consumerRegistry.updateProducerInfo(producerInfo);
+ uiApp.addMessage(new ApplicationMessage("Edit Consumer Successful!",
null));
+ }
+ catch (ConsumerException ce)
+ {
+ //todo - add to resource bundle
+ uiApp.addMessage(new ApplicationMessage("Edit Consumer Problem!",
null));
+ }
+ return true;
+ }
+
+}
Deleted:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2009-12-09
03:23:12 UTC (rev 975)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,61 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.exoplatform.wsrp.webui.component;
-
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.UIContainer;
-import org.exoplatform.webui.core.UIPopupWindow;
-import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
-import org.exoplatform.webui.event.Event;
-import org.exoplatform.webui.event.EventListener;
-
-/** @author Wesley Hales */
-@ComponentConfig(
- lifecycle = UIApplicationLifecycle.class,
- template = "app:/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl",
- events = {
- @EventConfig(listeners = UIWsrpConsumerOverview.OpenPopupActionListener.class)
- })
-public class UIWsrpConsumerOverview extends UIContainer
-{
- public UIWsrpConsumerOverview() throws Exception
- {
- UIPopupWindow popup = addChild(UIPopupWindow.class, null, null);
- popup.setWindowSize(400, 300);
- UIWsrpConsumerEditor consumerForm =
createUIComponent(UIWsrpConsumerEditor.class,null,null);
- popup.setUIComponent(consumerForm);
- popup.setRendered(false);
- }
-
- static public class OpenPopupActionListener extends
EventListener<UIWsrpConsumerOverview>
- {
- public void execute(Event<UIWsrpConsumerOverview> event) throws Exception
- {
- UIWsrpConsumerOverview consumerOverview = event.getSource();
- UIPopupWindow popup = consumerOverview.getChild(UIPopupWindow.class);
- popup.setRendered(true);
- popup.setShow(true);
- }
- }
-}
Copied:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpConsumerOverview.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,338 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.commons.utils.ListAccess;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.ComponentConfigs;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIApplication;
+import org.exoplatform.webui.core.UIContainer;
+import org.exoplatform.webui.core.UIGrid;
+import org.exoplatform.webui.core.UIPopupWindow;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.consumer.RefreshResult;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
+
+import java.util.List;
+
+/** @author Wesley Hales */
+@ComponentConfigs({
+ @ComponentConfig(id = "ConsumerSelector", type = UIGrid.class, template =
"system:/groovy/webui/core/UIGrid.gtmpl",
+ events = { //make note in doc not to put grid listeners here
+ }),
+ @ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class,
+ template =
"app:/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl",
+ events = {
+ @EventConfig(listeners = UIWsrpConsumerOverview.OpenPopupActionListener.class),
+ @EventConfig(listeners = UIWsrpConsumerOverview.EditActionListener.class),
+ @EventConfig(listeners = UIWsrpConsumerOverview.DeleteActionListener.class),
+ @EventConfig(listeners = UIWsrpConsumerOverview.RefreshActionListener.class),
+ @EventConfig(listeners =
UIWsrpConsumerOverview.DeactivateActionListener.class),
+ @EventConfig(listeners = UIWsrpConsumerOverview.ActivateActionListener.class),
+ @EventConfig(listeners =
UIWsrpConsumerOverview.RefreshGridActionListener.class)
+ })
+})
+
+public class UIWsrpConsumerOverview extends UIContainer
+{
+ public static String[] FIELDS = {"producerId", "active",
"refreshNeeded"};
+
+ //The action names are also your class names on the ui buttons. You should stick with
common names like:
+ //edit
+ //delete
+ //
+ public static String[] SELECT_ACTIONS = {"Edit", "Delete",
"Refresh", "Activate", "Deactivate"};
+
+ public List getConfiguredConsumers() throws Exception
+ {
+ ConsumerRegistry consumerRegistry = getConsumerRegistry();
+ return consumerRegistry.getConfiguredConsumers();
+ }
+
+ public LazyPageList createPageList(final List pageList)
+ {
+ return new LazyPageList<WSRPConsumer>(new ListAccess<WSRPConsumer>()
+ {
+
+ public int getSize() throws Exception
+ {
+ return pageList.size();
+ }
+
+ public WSRPConsumer[] load(int index, int length) throws Exception,
IllegalArgumentException
+ {
+ WSRPConsumer[] pcs = new WSRPConsumer[pageList.size()];
+
+ if (index < 0)
+ {
+ throw new IllegalArgumentException("Illegal index: index must be a
positive number");
+ }
+
+ if (length < 0)
+ {
+ throw new IllegalArgumentException("Illegal length: length must be a
positive number");
+ }
+
+ if (index + length > pageList.size())
+ {
+ throw new IllegalArgumentException(
+ "Illegal index or length: sum of the index and the length cannot
be greater than the list size");
+ }
+
+ for (int i = 0; i < length; i++)
+ {
+ pcs[i] = (WSRPConsumer)pageList.get(i + index);
+ }
+
+ return pcs;
+ }
+
+ }, 10);
+ }
+
+ public UIWsrpConsumerOverview() throws Exception
+ {
+ UIPopupWindow popup = addChild(UIPopupWindow.class, null, null);
+ popup.setWindowSize(450, 0);
+ UIWsrpConsumerEditor consumerForm = createUIComponent(UIWsrpConsumerEditor.class,
null, "Consumer Editor");
+ popup.setUIComponent(consumerForm);
+ popup.setRendered(false);
+
+ UIGrid uiGrid = addChild(UIGrid.class, "ConsumerSelector", null);
+ //configure the edit and delete buttons based on an id from the data list - this
will also be passed as param to listener
+ uiGrid.configure("producerId", FIELDS, SELECT_ACTIONS);
+
+ uiGrid.getUIPageIterator().setId("ChangeConsumerPageIterator");
+ addChild(uiGrid.getUIPageIterator());
+ uiGrid.getUIPageIterator().setRendered(false);
+
+ LazyPageList pageList = createPageList(getConfiguredConsumers());
+ uiGrid.getUIPageIterator().setPageList(pageList);
+ }
+
+ static public class RefreshGridActionListener extends
EventListener<UIWsrpConsumerOverview>
+ {
+ public void execute(Event<UIWsrpConsumerOverview> event) throws Exception
+ {
+ UIWsrpConsumerOverview consumerOverview = event.getSource();
+ consumerOverview.refreshGrid(event);
+ }
+ }
+
+ public void refreshGrid(Event<UIWsrpConsumerOverview> event) throws Exception
+ {
+ UIWsrpConsumerOverview consumerOverview = event.getSource();
+ WebuiRequestContext ctx = event.getRequestContext();
+
+ UIGrid uiGrid = consumerOverview.getChild(UIGrid.class);
+ //refresh the list
+ LazyPageList pageList =
consumerOverview.createPageList(consumerOverview.getConfiguredConsumers());
+ uiGrid.getUIPageIterator().setPageList(pageList);
+
+ ctx.addUIComponentToUpdateByAjax(consumerOverview);
+ }
+
+ static public class OpenPopupActionListener extends
EventListener<UIWsrpConsumerOverview>
+ {
+ public void execute(Event<UIWsrpConsumerOverview> event) throws Exception
+ {
+ UIWsrpConsumerOverview consumerOverview = event.getSource();
+ UIPopupWindow popup = consumerOverview.getChild(UIPopupWindow.class);
+ UIWsrpConsumerEditor editor = (UIWsrpConsumerEditor)popup.getUIComponent();
+
+ //reset the form
+ editor.setConsumer(null);
+ popup.setRendered(true);
+ popup.setShow(true);
+ popup.setShowCloseButton(true);
+ //popup.setShowMask(true);
+
+ }
+ }
+
+ static public class EditActionListener extends
EventListener<UIWsrpConsumerOverview>
+ {
+ public void execute(Event<UIWsrpConsumerOverview> event) throws Exception
+ {
+ UIWsrpConsumerOverview consumerOverview = event.getSource();
+ WSRPConsumer consumer = consumerOverview.getConsumerFromEvent(event);
+
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+
+ if (consumer != null)
+ {
+ UIPopupWindow popup = consumerOverview.getChild(UIPopupWindow.class);
+ UIWsrpConsumerEditor editor = (UIWsrpConsumerEditor)popup.getUIComponent();
+
+ try
+ {
+ editor.setConsumer(consumer);
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ popup.setUIComponent(editor);
+ popup.setRendered(true);
+ popup.setShow(true);
+ }
+ }
+ }
+
+ static public class DeleteActionListener extends
EventListener<UIWsrpConsumerOverview>
+ {
+ public void execute(Event<UIWsrpConsumerOverview> event)
+ {
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ try
+ {
+ UIWsrpConsumerOverview consumerOverview = event.getSource();
+ WSRPConsumer consumer = consumerOverview.getConsumerFromEvent(event);
+ ConsumerRegistry consumerRegistry = consumerOverview.getConsumerRegistry();
+ String id = event.getRequestContext().getRequestParameter(OBJECTID);
+ if (consumer != null)
+ {
+ consumerRegistry.destroyConsumer(id);
+ uiApp.addMessage(new ApplicationMessage("Consumer has been
deleted.", null));
+ consumerOverview.refreshGrid(event);
+ }
+ }
+ catch (Exception e)
+ {
+ uiApp.addMessage(new ApplicationMessage("Failed to delete Consumer.
Cause: " + e.getCause(), null, ApplicationMessage.ERROR));
+ }
+
+ }
+ }
+
+ static public class DeactivateActionListener extends
EventListener<UIWsrpConsumerOverview>
+ {
+ public void execute(Event<UIWsrpConsumerOverview> event) throws Exception
+ {
+ UIWsrpConsumerOverview consumerOverview = event.getSource();
+ WSRPConsumer consumer = consumerOverview.getConsumerFromEvent(event);
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+
+ if (consumer != null && consumer.isActive())
+ {
+ ConsumerRegistry registry = consumerOverview.getConsumerRegistry();
+ registry.deactivateConsumerWith(consumer.getProducerId());
+ uiApp.addMessage(new ApplicationMessage("Consumer successfully
deactivated", null));
+ consumerOverview.refreshGrid(event);
+ }
+ }
+ }
+
+ static public class ActivateActionListener extends
EventListener<UIWsrpConsumerOverview>
+ {
+ public void execute(Event<UIWsrpConsumerOverview> event) throws Exception
+ {
+ UIWsrpConsumerOverview consumerOverview = event.getSource();
+ WSRPConsumer consumer = consumerOverview.getConsumerFromEvent(event);
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+
+ if (consumer != null && !consumer.isActive())
+ {
+ ConsumerRegistry registry = consumerOverview.getConsumerRegistry();
+ registry.activateConsumerWith(consumer.getProducerId());
+ uiApp.addMessage(new ApplicationMessage("Consumer successfully
activated", null));
+ consumerOverview.refreshGrid(event);
+ }
+ }
+ }
+
+ static public class RefreshActionListener extends
EventListener<UIWsrpConsumerOverview>
+ {
+ public void execute(Event<UIWsrpConsumerOverview> event)
+ {
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ try
+ {
+ UIWsrpConsumerOverview consumerOverview = event.getSource();
+ WSRPConsumer consumer = consumerOverview.getConsumerFromEvent(event);
+
+ if (consumer != null)
+ {
+ ConsumerRegistry registry = consumerOverview.getConsumerRegistry();
+ RefreshResult result = consumer.refresh(true);
+
+ if (result.hasIssues())
+ {
+ // create the expected registration info and make it available
+ /*RegistrationInfo expected = new
RegistrationInfo(consumer.getProducerInfo().getRegistrationInfo());
+ expected.refresh(result.getServiceDescription(),
consumer.getProducerId(), true, true, true);
+ setExpectedRegistrationInfo(expected);*/
+
+ // refresh had issues, we should deactivate this consumer
+ registry.deactivateConsumerWith(consumer.getProducerId());
+ }
+ else
+ {
+ // activate the consumer if it's supposed to be active
+ if (consumer.isActive())
+ {
+ registry.activateConsumerWith(consumer.getProducerId());
+ }
+ else
+ {
+ registry.deactivateConsumerWith(consumer.getProducerId());
+ }
+
+ }
+ uiApp.addMessage(new ApplicationMessage("Consumer Refreshed
Successfully", null));
+ consumerOverview.refreshGrid(event);
+ }
+ }
+ catch (Exception e)
+ {
+ uiApp.addMessage(new ApplicationMessage("Failed to refresh
Consumer", null, ApplicationMessage.ERROR));
+ e.printStackTrace();
+ }
+ }
+ }
+
+
+ public WSRPConsumer getConsumerFromEvent(Event<?> event) throws Exception
+ {
+ ConsumerRegistry consumerRegistry = getConsumerRegistry();
+ String id = event.getRequestContext().getRequestParameter(OBJECTID);
+ return consumerRegistry.getConsumer(id);
+ }
+
+ public ConsumerRegistry getConsumerRegistry() throws Exception
+ {
+ // todo: this lookup shouldn't be done on each invocation, store it if
possible
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ return
(ConsumerRegistry)manager.getComponentInstanceOfType(ConsumerRegistry.class);
+ }
+}
Deleted:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java 2009-12-09
03:23:12 UTC (rev 975)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,46 +0,0 @@
-/******************************************************************************
- * JBoss, a division of Red Hat *
- * Copyright 2006, Red Hat Middleware, LLC, and individual *
- * contributors as indicated by the @authors tag. See the *
- * copyright.txt in the distribution for a full listing of *
- * individual contributors. *
- * *
- * This is free software; you can redistribute it and/or modify it *
- * under the terms of the GNU Lesser General Public License as *
- * published by the Free Software Foundation; either version 2.1 of *
- * the License, or (at your option) any later version. *
- * *
- * This software is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this software; if not, write to the Free *
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
- * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
- ******************************************************************************/
-package org.exoplatform.wsrp.webui.component;
-
-import org.exoplatform.webui.config.annotation.ComponentConfig;
-import org.exoplatform.webui.config.annotation.EventConfig;
-import org.exoplatform.webui.core.UIPortletApplication;
-import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
-
-/** @author Wesley Hales */
-@ComponentConfig(
- lifecycle = UIApplicationLifecycle.class,
- template = "app:/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl"
-)
-
-public class UIWsrpPortlet extends UIPortletApplication
-{
- public UIWsrpPortlet() throws Exception
- {
- addChild(UIWsrpConsole.class,null,null);
- }
-
-
-
-
-}
Copied:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpPortlet.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,46 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIPortletApplication;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+
+/** @author Wesley Hales */
+@ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class,
+ template = "app:/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl"
+)
+
+public class UIWsrpPortlet extends UIPortletApplication
+{
+ public UIWsrpPortlet() throws Exception
+ {
+ addChild(UIWsrpConsole.class,null,null);
+ }
+
+
+
+
+}
Copied:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java
(from rev 1114,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerEditor.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIApplication;
+import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.form.UIForm;
+import org.exoplatform.webui.form.UIFormCheckBoxInput;
+import org.gatein.wsrp.producer.config.ProducerConfiguration;
+import org.gatein.wsrp.producer.config.ProducerConfigurationService;
+import org.gatein.wsrp.producer.config.ProducerRegistrationRequirements;
+
+/** @author Wesley Hales */
+@ComponentConfig(template =
"app:/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl", lifecycle =
UIFormLifecycle.class, events = {
+ @EventConfig(listeners = UIWsrpProducerEditor.SaveActionListener.class)})
+public class UIWsrpProducerEditor extends UIForm
+{
+
+ protected static final String REG_REQUIRED_FOR_DESCRIPTION =
"registrationrequiredforfulldescription";
+ protected static final String STRICT_MODE = "strictmode";
+ protected static final String REQUIRES_REGISTRATION =
"requiresregistration";
+ protected static final String POLICY_CLASS = "policyClassName";
+ protected static final String VALIDATOR_CLASS = "validatorClassName";
+
+ public UIWsrpProducerEditor() throws Exception
+ {
+ addUIFormInput(new UIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION,
REG_REQUIRED_FOR_DESCRIPTION, null));
+ addUIFormInput(new UIFormCheckBoxInput(STRICT_MODE, STRICT_MODE, null));
+ addUIFormInput(new UIFormCheckBoxInput(REQUIRES_REGISTRATION,
REQUIRES_REGISTRATION, null));
+ /*addUIFormInput(new UIFormStringInput(POLICY_CLASS, POLICY_CLASS,
null).addValidator(MandatoryValidator.class));
+ addUIFormInput(new UIFormStringInput(VALIDATOR_CLASS, VALIDATOR_CLASS,
null).addValidator(MandatoryValidator.class));*/
+ }
+
+ public void setProducerConfig(ProducerConfiguration producerConfiguration) throws
Exception
+ {
+
+ ProducerRegistrationRequirements registrationRequirements =
producerConfiguration.getRegistrationRequirements();
+
getUIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION).setValue(registrationRequirements.isRegistrationRequiredForFullDescription());
+
getUIFormCheckBoxInput(STRICT_MODE).setValue(producerConfiguration.isUsingStrictMode());
+
getUIFormCheckBoxInput(REQUIRES_REGISTRATION).setValue(registrationRequirements.isRegistrationRequired());
+
+ /*RegistrationPolicy policy = registrationRequirements.getPolicy();
+ String policyClassName = policy.getClass().getName();
+ getUIStringInput(POLICY_CLASS).setValue(policyClassName);
+
+ if
(ProducerRegistrationRequirements.DEFAULT_POLICY_CLASS_NAME.equals(policyClassName))
+ {
+ DefaultRegistrationPolicy defaultPolicy = (DefaultRegistrationPolicy)policy;
+
getUIStringInput(VALIDATOR_CLASS).setValue(defaultPolicy.getValidator().getClass().getName());
+ }*/
+ }
+
+
+ static public class SaveActionListener extends
EventListener<UIWsrpProducerEditor>
+ {
+ public void execute(Event<UIWsrpProducerEditor> event) throws Exception
+ {
+ UIWsrpProducerEditor producerEditor = event.getSource();
+
+ WebuiRequestContext ctx = event.getRequestContext();
+ producerEditor.save(ctx);
+ //producerEditor.reset();
+
+ }
+ }
+
+ public boolean save(WebuiRequestContext context) throws Exception
+ {
+ //ConsumerRegistry consumerRegistry = getConsumerRegistry();
+ //ProducerInfo producerInfo =
consumerRegistry.getProducerInfoByKey("").getRegistrationInfo().
+ UIApplication uiApp = context.getUIApplication();
+
+ ProducerConfigurationService pconfService = getProducerConfigurationService();
+ ProducerConfiguration producerConfiguration = pconfService.getConfiguration();
+ try
+ {
+ ProducerRegistrationRequirements registrationRequirements =
producerConfiguration.getRegistrationRequirements();
+
registrationRequirements.setRegistrationRequiredForFullDescription(Boolean.parseBoolean(getUIFormCheckBoxInput(REG_REQUIRED_FOR_DESCRIPTION).getValue().toString()));
+
producerConfiguration.setUsingStrictMode(Boolean.parseBoolean(getUIFormCheckBoxInput(STRICT_MODE).getValue().toString()));
+
+
registrationRequirements.setRegistrationRequired(Boolean.parseBoolean(getUIFormCheckBoxInput(REQUIRES_REGISTRATION).getValue().toString()));
+//
registrationRequirements.reloadPolicyFrom(getUIStringInput(POLICY_CLASS).getValue(),
getUIStringInput(VALIDATOR_CLASS).getValue());
+
+ pconfService.saveConfiguration();
+ uiApp.addMessage(new ApplicationMessage("Producer Successfully
Changed", null));
+ }
+ catch (Exception e)
+ {
+ uiApp.addMessage(new ApplicationMessage("Producer Modification Error",
null, ApplicationMessage.ERROR));
+ e.printStackTrace();
+ }
+
+ return true;
+ }
+
+ public ProducerConfigurationService getProducerConfigurationService() throws
Exception
+ {
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ return
(ProducerConfigurationService)manager.getComponentInstanceOfType(ProducerConfigurationService.class);
+ }
+}
Copied:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java
(from rev 1114,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerOverview.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,230 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2009, Red Hat Middleware, LLC, and individual
+ * contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of
+ * individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ */
+package org.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.commons.utils.LazyPageList;
+import org.exoplatform.commons.utils.ListAccess;
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.ComponentConfigs;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIApplication;
+import org.exoplatform.webui.core.UIContainer;
+import org.exoplatform.webui.core.UIGrid;
+import org.exoplatform.webui.core.UIPopupWindow;
+import org.exoplatform.webui.core.lifecycle.UIApplicationLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+import org.gatein.wsrp.WSRPConsumer;
+import org.gatein.wsrp.producer.config.ProducerConfiguration;
+import org.gatein.wsrp.producer.config.ProducerConfigurationService;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.List;
+import java.util.Map;
+
+/** @author Wesley Hales */
+@ComponentConfigs({
+ @ComponentConfig(id = "RegistrationPropertySelector", type = UIGrid.class,
template = "system:/groovy/webui/core/UIGrid.gtmpl"),
+ @ComponentConfig(
+ lifecycle = UIApplicationLifecycle.class,
+ template =
"app:/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl",
+ events = {
+// @EventConfig(listeners =
UIWsrpProducerOverview.AddPropertyActionListener.class),
+ @EventConfig(listeners =
UIWsrpProducerOverview.EditPropertyActionListener.class),
+ @EventConfig(listeners =
UIWsrpProducerOverview.DeletePropertyActionListener.class)
+ }
+ )})
+public class UIWsrpProducerOverview extends UIContainer
+{
+
+ public static String[] FIELDS = {"name", "description",
"label", "hint"};
+
+ public static String[] SELECT_ACTIONS = {"EditProperty",
"DeleteProperty"};
+
+ public UIWsrpProducerOverview() throws Exception
+ {
+ ProducerConfigurationService service = getProducerConfigurationService();
+ ProducerConfiguration producerConfiguration = service.getConfiguration();
+ UIWsrpProducerEditor producerForm = createUIComponent(UIWsrpProducerEditor.class,
null, "Producer Editor");
+ producerForm.setProducerConfig(producerConfiguration);
+ addChild(producerForm);
+
+ /*UIGrid uiGrid = addChild(UIGrid.class, "RegistrationPropertySelector",
null);
+ //configure the edit and delete buttons based on an id from the data list - this
will also be passed as param to listener
+ uiGrid.configure("name", FIELDS, SELECT_ACTIONS);
+
+ //add the propery grid
+ uiGrid.getUIPageIterator().setId("ProducerPropPageIterator");
+ addChild(uiGrid.getUIPageIterator());
+ uiGrid.getUIPageIterator().setRendered(false);
+ LazyPageList propertyList = createPageList(getPropertyList());
+ uiGrid.getUIPageIterator().setPageList(propertyList);
+
+ //add the popup for property edit and adding new properties
+ UIPopupWindow popup = addChild(UIPopupWindow.class, null, null);
+ popup.setWindowSize(400, 300);
+ UIWsrpProducerPropertyEditor propertyForm =
createUIComponent(UIWsrpProducerPropertyEditor.class, null, "Producer Property
Editor");
+ popup.setUIComponent(propertyForm);
+ popup.setRendered(false);*/
+ }
+
+ public List<RegistrationPropertyDescription> getPropertyList() throws Exception
+ {
+ ProducerConfiguration producerConfiguration =
getProducerConfigurationService().getConfiguration();
+ Map descriptions =
producerConfiguration.getRegistrationRequirements().getRegistrationProperties();
+ Comparator<RegistrationPropertyDescription> descComparator = new
Comparator<RegistrationPropertyDescription>()
+ {
+ public int compare(RegistrationPropertyDescription o1,
RegistrationPropertyDescription o2)
+ {
+ return o1.getName().toString().compareTo(o2.getName().toString());
+ }
+ };
+
+ List<RegistrationPropertyDescription> result = new
ArrayList<RegistrationPropertyDescription>(descriptions.values());
+ Collections.sort(result, descComparator);
+ return result;
+ }
+
+ public List<String> getSupportedPropertyTypes()
+ {
+ return Collections.singletonList(("xsd:string"));
+ }
+
+ public LazyPageList createPageList(final List pageList)
+ {
+ return new LazyPageList<WSRPConsumer>(new ListAccess<WSRPConsumer>()
+ {
+
+ public int getSize() throws Exception
+ {
+ return pageList.size();
+ }
+
+ public WSRPConsumer[] load(int index, int length) throws Exception,
IllegalArgumentException
+ {
+ WSRPConsumer[] pcs = new WSRPConsumer[pageList.size()];
+
+ if (index < 0)
+ {
+ throw new IllegalArgumentException("Illegal index: index must be a
positive number");
+ }
+
+ if (length < 0)
+ {
+ throw new IllegalArgumentException("Illegal length: length must be a
positive number");
+ }
+
+ if (index + length > pageList.size())
+ {
+ throw new IllegalArgumentException(
+ "Illegal index or length: sum of the index and the length cannot
be greater than the list size");
+ }
+
+ for (int i = 0; i < length; i++)
+ {
+ pcs[i] = (WSRPConsumer)pageList.get(i + index);
+ }
+
+ return pcs;
+ }
+
+ }, 10);
+ }
+
+ static public class EditPropertyActionListener extends
EventListener<UIWsrpProducerOverview>
+ {
+ public void execute(Event<UIWsrpProducerOverview> event) throws Exception
+ {
+ UIWsrpProducerOverview producerOverview = event.getSource();
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ UIPopupWindow popup = producerOverview.getChild(UIPopupWindow.class);
+ UIWsrpProducerPropertyEditor editor =
(UIWsrpProducerPropertyEditor)popup.getUIComponent();
+ String id = event.getRequestContext().getRequestParameter(OBJECTID);
+ try
+ {
+
editor.setRegistrationPropertyDescription(producerOverview.getProducerConfigurationService().getConfiguration().getRegistrationRequirements().getRegistrationPropertyWith(id));
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ popup.setUIComponent(editor);
+ popup.setRendered(true);
+ popup.setShow(true);
+
+ }
+ }
+
+ static public class DeletePropertyActionListener extends
EventListener<UIWsrpProducerOverview>
+ {
+ public void execute(Event<UIWsrpProducerOverview> event)
+ {
+ UIWsrpProducerOverview producerOverview = event.getSource();
+ UIApplication uiApp = event.getRequestContext().getUIApplication();
+ UIPopupWindow popup = producerOverview.getChild(UIPopupWindow.class);
+ UIWsrpProducerPropertyEditor editor =
(UIWsrpProducerPropertyEditor)popup.getUIComponent();
+ String id = event.getRequestContext().getRequestParameter(OBJECTID);
+ try
+ {
+
producerOverview.getProducerConfigurationService().getConfiguration().getRegistrationRequirements().removeRegistrationProperty(id);
+ producerOverview.getProducerConfigurationService().saveConfiguration();
+ }
+ catch (Exception e)
+ {
+ e.printStackTrace();
+ uiApp.addMessage(new ApplicationMessage("Failed to delete Producer
Property. Cause: " + e.getCause(), null, ApplicationMessage.ERROR));
+ }
+
+ }
+ }
+
+ static public class AddPropertyActionListener extends
EventListener<UIWsrpProducerOverview>
+ {
+ public void execute(Event<UIWsrpProducerOverview> event) throws Exception
+ {
+ UIWsrpProducerOverview wsrpProducerOverview = event.getSource();
+ UIPopupWindow popup = wsrpProducerOverview.getChild(UIPopupWindow.class);
+ UIWsrpProducerPropertyEditor editor =
(UIWsrpProducerPropertyEditor)popup.getUIComponent();
+
+ //reset the form
+ editor.setRegistrationPropertyDescription(null);
+ popup.setRendered(true);
+ popup.setShow(true);
+ popup.setShowCloseButton(true);
+ //popup.setShowMask(true);
+
+ }
+ }
+
+ public ProducerConfigurationService getProducerConfigurationService() throws
Exception
+ {
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ return
(ProducerConfigurationService)manager.getComponentInstanceOfType(ProducerConfigurationService.class);
+ }
+}
Copied:
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java
(from rev 1114,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/java/org/exoplatform/wsrp/webui/component/UIWsrpProducerPropertyEditor.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,141 @@
+/******************************************************************************
+ * JBoss, a division of Red Hat *
+ * Copyright 2006, Red Hat Middleware, LLC, and individual *
+ * contributors as indicated by the @authors tag. See the *
+ * copyright.txt in the distribution for a full listing of *
+ * individual contributors. *
+ * *
+ * This is free software; you can redistribute it and/or modify it *
+ * under the terms of the GNU Lesser General Public License as *
+ * published by the Free Software Foundation; either version 2.1 of *
+ * the License, or (at your option) any later version. *
+ * *
+ * This software is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this software; if not, write to the Free *
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA *
+ * 02110-1301 USA, or see the FSF site:
http://www.fsf.org. *
+ ******************************************************************************/
+package org.exoplatform.wsrp.webui.component;
+
+import org.exoplatform.container.ExoContainer;
+import org.exoplatform.container.ExoContainerContext;
+import org.exoplatform.web.application.ApplicationMessage;
+import org.exoplatform.webui.application.WebuiRequestContext;
+import org.exoplatform.webui.config.annotation.ComponentConfig;
+import org.exoplatform.webui.config.annotation.EventConfig;
+import org.exoplatform.webui.core.UIApplication;
+import org.exoplatform.webui.core.lifecycle.UIFormLifecycle;
+import org.exoplatform.webui.event.Event;
+import org.exoplatform.webui.event.EventListener;
+import org.exoplatform.webui.form.UIForm;
+import org.exoplatform.webui.form.UIFormStringInput;
+import org.exoplatform.webui.form.validator.MandatoryValidator;
+import org.gatein.wsrp.consumer.registry.ConsumerRegistry;
+import org.gatein.wsrp.producer.config.ProducerConfiguration;
+import org.gatein.wsrp.producer.config.ProducerConfigurationService;
+import org.gatein.wsrp.registration.LocalizedString;
+import org.gatein.wsrp.registration.RegistrationPropertyDescription;
+
+
+/** @author Wesley Hales */
+@ComponentConfig(template =
"app:/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl", lifecycle
= UIFormLifecycle.class, events = {
+ @EventConfig(listeners = UIWsrpProducerPropertyEditor.SaveActionListener.class)})
+public class UIWsrpProducerPropertyEditor extends UIForm
+{
+ protected static final String DESCRIPTION = "description";
+ protected static final String LABEL = "label";
+ protected static final String HINT = "hint";
+ private RegistrationPropertyDescription registrationPropertyDescription_;
+
+ public UIWsrpProducerPropertyEditor() throws Exception
+ {
+ addUIFormInput(new UIFormStringInput(DESCRIPTION, DESCRIPTION,
null).addValidator(MandatoryValidator.class));
+ addUIFormInput(new UIFormStringInput(LABEL, LABEL,
null).addValidator(MandatoryValidator.class));
+ addUIFormInput(new UIFormStringInput(HINT, HINT,
null).addValidator(MandatoryValidator.class));
+ }
+
+ public void setRegistrationPropertyDescription(RegistrationPropertyDescription
registrationPropertyDescription) throws Exception {
+
+ this.registrationPropertyDescription_ = registrationPropertyDescription;
+
+ if (registrationPropertyDescription_ == null)
+ {
+ getUIStringInput(DESCRIPTION).setEditable(UIFormStringInput.ENABLE);
+ reset();
+ return;
+ }
+ getUIStringInput(DESCRIPTION).setEditable(UIFormStringInput.ENABLE);
+
+ invokeGetBindingBean(registrationPropertyDescription_);
+
+ }
+
+ public RegistrationPropertyDescription getRegistrationPropertyDescription()
+ {
+ return registrationPropertyDescription_;
+ }
+
+ static public class SaveActionListener extends
EventListener<UIWsrpProducerEditor>
+ {
+ public void execute(Event<UIWsrpProducerEditor> event) throws Exception
+ {
+ UIWsrpProducerEditor producerEditor = event.getSource();
+
+ UIWsrpProducerEditor producerOverview =
producerEditor.getAncestorOfType(UIWsrpProducerEditor.class);
+
+ WebuiRequestContext ctx = event.getRequestContext();
+ producerEditor.save(ctx);
+ //producerEditor.reset();
+
+ }
+ }
+
+ public boolean save(WebuiRequestContext context) throws Exception
+ {
+
+ ProducerConfigurationService pconfService = getProducerConfigurationService();
+ ProducerConfiguration producerConfiguration = pconfService.getConfiguration();
+
+
+
+ RegistrationPropertyDescription regPropDesc =
getRegistrationPropertyDescription();
+ if(regPropDesc != null){
+ System.out.println("---------old1: " + regPropDesc.getDescription());
+ RegistrationPropertyDescription oldRegPropDesc =
producerConfiguration.getRegistrationRequirements().getRegistrationProperties().get(regPropDesc);
+ invokeSetBindingBean(oldRegPropDesc);
+ System.out.println("---------new1: " +
oldRegPropDesc.getNameAsString());
+ //return;
+ }else{
+
+ RegistrationPropertyDescription newRegProcDesc = new
RegistrationPropertyDescription();
+ newRegProcDesc.setDescription(new
LocalizedString(getUIStringInput(DESCRIPTION).getValue()));
+ newRegProcDesc.setDescription(new
LocalizedString(getUIStringInput(LABEL).getValue()));
+ newRegProcDesc.setDescription(new
LocalizedString(getUIStringInput(HINT).getValue()));
+ System.out.println("---------new2: " + newRegProcDesc);
+
producerConfiguration.getRegistrationRequirements().addRegistrationProperty(newRegProcDesc);
+ }
+
+ UIApplication uiApp = context.getUIApplication();
+
+ try{
+ pconfService.saveConfiguration();
+ uiApp.addMessage(new ApplicationMessage("Producer Successfully
Changed", null));
+ }catch(Exception e){
+ uiApp.addMessage(new ApplicationMessage("Producer Modification Error",
null));
+
+ }
+
+ return true;
+ }
+
+ public ProducerConfigurationService getProducerConfigurationService() throws
Exception
+ {
+ ExoContainer manager = ExoContainerContext.getCurrentContainer();
+ return
(ProducerConfigurationService)manager.getComponentInstanceOfType(ProducerConfigurationService.class);
+ }
+}
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet)
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui)
Deleted:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml 2009-12-09
03:23:12 UTC (rev 975)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,30 +0,0 @@
-<!--
-
- 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.
-
--->
-
-<webui-configuration>
- <application>
-
<ui-component-root>org.exoplatform.wsrp.webui.component.UIWsrpPortlet</ui-component-root>
-
<state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
- <application-lifecycle-listeners>
-
<listener>org.exoplatform.portal.application.PortletStatisticLifecycle</listener>
- </application-lifecycle-listeners>
- </application>
-</webui-configuration>
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,30 @@
+<!--
+
+ 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.
+
+-->
+
+<webui-configuration>
+ <application>
+
<ui-component-root>org.exoplatform.wsrp.webui.component.UIWsrpPortlet</ui-component-root>
+
<state-manager>org.exoplatform.webui.application.portlet.ParentAppStateManager</state-manager>
+ <application-lifecycle-listeners>
+
<listener>org.exoplatform.portal.application.PortletStatisticLifecycle</listener>
+ </application-lifecycle-listeners>
+ </application>
+</webui-configuration>
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/gatein-resources.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/gatein-resources.xml 2009-12-22
10:02:32 UTC (rev 1125)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/gatein-resources.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -83,6 +83,15 @@
<skin-name>Default</skin-name>
<css-path>/skin/register/webui/component/DefaultStylesheet.css</css-path>
</portlet-skin>
+
+ <!-- WSRP Admin Portlet skins -->
+
+ <portlet-skin>
+ <application-name>exoadmin</application-name>
+ <portlet-name>WSRPAdminPortlet</portlet-name>
+ <skin-name>Default</skin-name>
+ <css-path>/skin/wsrp/webui/component/DefaultStylesheet.css</css-path>
+ </portlet-skin>
</gatein-resources>
Modified: portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2009-12-22 10:02:32
UTC (rev 1125)
+++ portal/trunk/portlet/exoadmin/src/main/webapp/WEB-INF/portlet.xml 2009-12-22 12:35:37
UTC (rev 1126)
@@ -105,6 +105,32 @@
</portlet-info>
</portlet>
+ <portlet>
+ <description xml:lang="EN">WSRP Admin Portlet</description>
+ <portlet-name>WSRPAdminPortlet</portlet-name>
+ <display-name xml:lang="EN">WSRP Admin Portlet</display-name>
+
<portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
+
+ <init-param>
+ <name>webui.configuration</name>
+
<value>/WEB-INF/conf/portlet/exoadmin/WSRPAdminPortlet/webui/configuration.xml</value>
+ </init-param>
+
+ <expiration-cache>0</expiration-cache>
+ <supports>
+ <mime-type>text/html</mime-type>
+ <portlet-mode>help</portlet-mode>
+ </supports>
+ <supported-locale>en</supported-locale>
+
+
<resource-bundle>locale.portlet.exoadmin.RegisterPortlet</resource-bundle>
+ <portlet-info>
+ <title>Register Portlet</title>
+ <short-title>Register Portlet</short-title>
+ <keywords>Administration</keywords>
+ </portlet-info>
+ </portlet>
+
<portlet>
<description xml:lang="EN">Group Navigation
Portlet</description>
<portlet-name>GroupNavigationPortlet</portlet-name>
Copied: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp (from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp)
Copied: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui (from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui)
Copied: portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component (from
rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component)
Deleted:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl 2009-12-09
03:23:12 UTC (rev 975)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,4 +0,0 @@
-<% uicomponent.renderChildren(); %>
-<div>
- Console Text...
-</div>
\ No newline at end of file
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsole.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,3 @@
+
+
+<% uicomponent.renderChildren(); %>
Deleted:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl 2009-12-09
03:23:12 UTC (rev 975)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,48 +0,0 @@
-<%
- import org.exoplatform.wsrp.webui.component.UIWsrpConsumerOverview;
-
-
- def rcontext = _ctx.getRequestContext();
-
rcontext.getJavascriptManager().importJavascript('eXo.webui.UIHorizontalTabs');
-%>
-
-<div class="UITabPane" id="$uicomponent.id">
- <div class="UIHorizontalTabs">
- <div class="TabsContainer">
- <%
- String url = uicomponent.url("SelectTab");
- String selTabId = uicomponent.getSelectedTabId();
-
- UIWsrpConsumerOverview consumerOverview =
uicomponent.getChild(UIWsrpConsumerOverview.class);
- %>
- <div class="UITab GrayTabStyle">
- <div class="<%= consumerOverview.getId().equals(selTabId) ?
"SelectedTab" : "NormalTab" %>">
- <div class="LeftTab">
- <div class="RightTab">
- <% String appLink = "ajaxAsyncGetRequest('" +
uicomponent.url("SelectTab",consumerOverview.getId()) + "', true)"
%>
- <div class="MiddleTab"
onclick="eXo.webui.UIHorizontalTabs.changeTabForUITabPane(this,
'${consumerOverview.getId()}', '$url');$appLink;if(eXo.portal.portalMode)
eXo.portal.portalMode -= 2;">
- <%=_ctx.appRes("UITabPane.title." +
consumerOverview.getId());%>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="UITab GrayTabStyle">
- <div class="NormalTab">
- <div class="LeftTab">
- <div class="RightTab">
-
- <div class="MiddleTab" onclick="">
- Manage Producers
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="UITabContentContainer GrayTabContainer">
- <div class="UITabContent" style="display:
<%=consumerOverview.getId().equals(selTabId) ? "block":
"none"%>;overflow:auto;clear:both"><%
uicomponent.renderUIComponent(consumerOverview); %></div>
- <div class="UITabContent"
style="display:none;overflow:auto;clear:both">Producer content</div>
- </div>
-</div>
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsoleContent.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,50 @@
+<%
+ import org.exoplatform.wsrp.webui.component.UIWsrpConsumerOverview;
+ import org.exoplatform.wsrp.webui.component.UIWsrpProducerOverview;
+
+
+ def rcontext = _ctx.getRequestContext();
+
rcontext.getJavascriptManager().importJavascript('eXo.webui.UIHorizontalTabs');
+%>
+
+<div class="UITabPane" id="$uicomponent.id">
+ <div class="UIHorizontalTabs">
+ <div class="TabsContainer">
+ <%
+ String url = uicomponent.url("SelectTab");
+ String selTabId = uicomponent.getSelectedTabId();
+
+ UIWsrpConsumerOverview consumerOverview =
uicomponent.getChild(UIWsrpConsumerOverview.class);
+ UIWsrpProducerOverview producerOverview =
uicomponent.getChild(UIWsrpProducerOverview.class);
+ %>
+ <div class="UITab GrayTabStyle">
+ <div class="<%= consumerOverview.getId().equals(selTabId) ?
"SelectedTab" : "NormalTab" %>">
+ <div class="LeftTab">
+ <div class="RightTab">
+ <% String consumerLink = "ajaxAsyncGetRequest('" +
uicomponent.url("SelectTab",consumerOverview.getId()) + "', true)"
%>
+ <div class="MiddleTab"
onclick="eXo.webui.UIHorizontalTabs.changeTabForUITabPane(this,
'${consumerOverview.getId()}',
'$url');$consumerLink;if(eXo.portal.portalMode) eXo.portal.portalMode -=
2;">
+ <%=_ctx.appRes("UITabPane.title." +
consumerOverview.getId());%>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="UITab GrayTabStyle">
+ <div class="<%= producerOverview.getId().equals(selTabId) ?
"SelectedTab" : "NormalTab" %>">
+ <div class="LeftTab">
+ <div class="RightTab">
+ <% String producerLink = "ajaxAsyncGetRequest('" +
uicomponent.url("SelectTab",producerOverview.getId()) + "', true)"
%>
+ <div class="MiddleTab"
onclick="eXo.webui.UIHorizontalTabs.changeTabForUITabPane(this,
'${producerOverview.getId()}',
'$url');$producerLink;if(eXo.portal.portalMode) eXo.portal.portalMode -=
2;">
+ <%=_ctx.appRes("UITabPane.title." +
producerOverview.getId());%>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="UITabContentContainer GrayTabContainer">
+ <div class="UITabContent" style="display:
<%=consumerOverview.getId().equals(selTabId) ? "block":
"none"%>;overflow:auto;clear:both"><%
uicomponent.renderUIComponent(consumerOverview); %></div>
+ <div class="UITabContent" style="display:
<%=producerOverview.getId().equals(selTabId) ? "block":
"none"%>;overflow:auto;clear:both"><%
uicomponent.renderUIComponent(producerOverview); %></div>
+ </div>
+</div>
Deleted:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl 2009-12-09
03:23:12 UTC (rev 975)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,44 +0,0 @@
-<%
-
- import org.exoplatform.webui.form.UIFormStringInput;
-
-%>
-
-<div class="UILoginForm" id="ChildTest">
-
- <%uiform.begin()%>
-
- <%
- UIFormStringInput name = uicomponent.getChild(UIFormStringInput.class);
- %>
- <div class="SignIn">Add new Consumer</div>
- <div class="FloatRight">
- <div class="FloatLeft">
- <div class="UserName" >
- <label>Consumer Name</label>
- <% uiform.renderField(name); %>
- </div>
-
- </div>
- <div class="UIAction">
- <table class="ActionContainer">
- <tr>
- <td>
- <div
onclick="<%=uicomponent.event("Save")%>"
class="ActionButton LightBlueStyle">
- <div class="ButtonLeft">
- <div class="ButtonRight">
- <div class="ButtonMiddle">
- <a
href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() +
".action.Save")%></a>
- </div>
- </div>
- </div>
- </div>
- </td>
- </tr>
- </table>
- </div>
- <div class="ClearLeft"><span></span></div>
- </div>
- <div class="ClearRight"><span></span></div>
- <%uiform.end()%>
-</div>
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerEditor.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,70 @@
+<%
+ import org.exoplatform.webui.form.UIFormStringInput;
+%>
+
+<div class="UILoginForm" id="ChildTest">
+ <% uiform.begin() %>
+ <%
+ UIFormStringInput name = uicomponent.getChild(UIFormStringInput.class);
+ %>
+
+ <div class="UserName">
+ <div>
+ <% //uiform.renderChild(0); %>
+ <%
+ for (field in uiform.getChildren())
+ {
+ if (field.isRendered())
+ {
+ %>
+ <div class="form-row">
+ <label>
+ <% fieldName = uicomponent.getLabel(field.getName()); %>
+ <% if (!fieldName.equals(uicomponent.getId()))
+ { %>
+ <span class="FieldLabel">
+ <% if (fieldName != null && fieldName.length() > 0)
+ { %>
+ <%=uicomponent.getLabel(field.getName())%>
+ <% } %>
+ </span>
+ <% uiform.renderField(field) %>
+ <% }
+ else
+ { %>
+ <% uiform.renderField(field) %>
+ <% } %>
+ </label>
+ </div>
+ <%
+ }
+ } %>
+
+
+
+ </div>
+
+ </div>
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div onclick="<%=uicomponent.event("Save")%>"
class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a
href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() +
".action.Save")%></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+
+ <% uiform.end() %>
+
+</div>
\ No newline at end of file
Deleted:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl 2009-12-09
03:23:12 UTC (rev 975)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,6 +0,0 @@
-<% uicomponent.renderChildren(); %>
-<div class="<%=uicomponent.getId()%>">
-
- <a href="<%=uicomponent.event("OpenPopup",
"")%>">Add Consumer</a>
-
-</div>
\ No newline at end of file
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerOverview.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,32 @@
+
+<%
+ import org.exoplatform.webui.core.UIComponent ;
+ import org.exoplatform.webui.form.UIFormPageIterator ;
+ import org.exoplatform.webui.form.UIFormCheckBoxInput ;
+
+%>
+
+
+<div class="<%=uicomponent.getId()%>"
id="<%=uicomponent.getId()%>">
+
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div onclick="<%=uicomponent.event("OpenPopup",
"")%>" class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a href="javascript:void(0);">Add New
Consumer</a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <% uicomponent.renderChildren(); %>
+
+</div>
\ No newline at end of file
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerSelector.gtmpl
(from rev 999,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpConsumerSelector.gtmpl)
===================================================================
Deleted:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPopup.gtmpl
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPopup.gtmpl 2009-12-09
03:23:12 UTC (rev 975)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPopup.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,3 +0,0 @@
-<div class="<%=uicomponent.getId()%>">
- this is a popup?
-</div>
\ No newline at end of file
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPopup.gtmpl
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPopup.gtmpl)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPopup.gtmpl
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPopup.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,3 @@
+<div class="<%=uicomponent.getId()%>">
+ this is a popup?
+</div>
\ No newline at end of file
Deleted:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl 2009-12-09
03:23:12 UTC (rev 975)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,4 +0,0 @@
-<% uicomponent.renderChildren(); %>
-<div class="<%=uicomponent.getId()%>">
-
-</div>
\ No newline at end of file
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpPortlet.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,4 @@
+
+<div class="<%=uicomponent.getId()%>">
+ <% uicomponent.renderChildren(); %>
+</div>
\ No newline at end of file
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl
(from rev 1114,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerEditor.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,43 @@
+<%
+ import org.exoplatform.webui.form.UIFormStringInput;
+%>
+
+<div class="UILoginForm" id="ChildTest">
+ <% uiform.begin() %>
+ <%
+ UIFormStringInput name = uicomponent.getChild(UIFormStringInput.class);
+ %>
+ <div class="SignIn">Access to full service description requires
consumers to be registered. <% uiform.renderChild(0); %></div>
+ <div class="SignIn">Use strict WSRP compliance. <%
uiform.renderChild(1); %></div>
+ <div class="SignIn">Requires registration. Modifying this information
will trigger invalidation of consumer registrations. <% uiform.renderChild(2);
%></div>
+
+ <div class="FloatRight">
+
+
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+
+ </td>
+ <td>
+ <div onclick="<%=uicomponent.event("Save")%>"
class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a
href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() +
".action.Save")%></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+
+
+ <div class="ClearRight"><span></span></div>
+ <% uiform.end() %>
+</div>
+</div>
\ No newline at end of file
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
(from rev 1114,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerOverview.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,13 @@
+
+<%
+ import org.exoplatform.webui.core.UIComponent ;
+ import org.exoplatform.webui.form.UIFormPageIterator ;
+ import org.exoplatform.webui.form.UIFormCheckBoxInput ;
+
+%>
+
+
+<div class="<%=uicomponent.getId()%>"
id="<%=uicomponent.getId()%>">
+
+ <% uicomponent.renderChildren(); %>
+</div>
\ No newline at end of file
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl
(from rev 1114,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/groovy/wsrp/webui/component/UIWsrpProducerPropertyEditor.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,65 @@
+<div class="UILoginForm" id="ChildTest">
+ <% uiform.begin() %>
+ <%
+
+ %>
+ <div class="SignIn">Add New Registration Property</div>
+ <div class="FloatRight">
+ <div class="FloatLeft">
+ <div class="UserName">
+ <div>
+ <!--label>Consumer Name</label-->
+ <% //uiform.renderChild(0); %>
+ <%
+ for (field in uiform.getChildren())
+ {
+ if (field.isRendered())
+ {
+ %>
+ <div>
+ <% fieldName = uicomponent.getLabel(field.getName()); %>
+ <% if (!fieldName.equals(uicomponent.getId()))
+ { %>
+ <div class="FieldLabel">
+ <% if (fieldName != null && fieldName.length() > 0)
+ { %>
+ <%=uicomponent.getLabel(field.getName())%>
+ <% } %>
+ </div>
+ <div class="FieldComponent"><% uiform.renderField(field)
%></div>
+ <% }
+ else
+ { %>
+ <div class="FieldComponent"><% uiform.renderField(field)
%></div>
+ <% } %>
+ </div>
+ <%
+ }
+ } %>
+ </div>
+
+ </div>
+ <div class="UIAction">
+ <table class="ActionContainer">
+ <tr>
+ <td>
+ <div onclick="<%=uicomponent.event("Save")%>"
class="ActionButton LightBlueStyle">
+ <div class="ButtonLeft">
+ <div class="ButtonRight">
+ <div class="ButtonMiddle">
+ <a
href="javascript:void(0);"><%=_ctx.appRes(uicomponent.getId() +
".action.Save")%></a>
+ </div>
+ </div>
+ </div>
+ </div>
+ </td>
+ </tr>
+ </table>
+ </div>
+
+ <div class="ClearLeft"><span></span></div>
+ </div>
+ <div class="ClearRight"><span></span></div>
+ <% uiform.end() %>
+</div>
+</div>
\ No newline at end of file
Copied: portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp (from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp)
Copied: portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui (from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui)
Copied: portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component (from rev
975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component)
Deleted:
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
===================================================================
---
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css 2009-12-09
03:23:12 UTC (rev 975)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,23 +0,0 @@
-/**
- * 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.
- */
-
-.UIWsrpPortlet {
- padding: 30px 0;
- border:2px dotted brown;
-}
\ No newline at end of file
Copied:
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
(from rev 975,
portal/branches/wsrp-integration/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css)
===================================================================
---
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css
(rev 0)
+++
portal/trunk/portlet/exoadmin/src/main/webapp/skin/wsrp/webui/component/DefaultStylesheet.css 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,89 @@
+/**
+ * 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.
+ */
+
+.UIWsrpPortlet {
+ padding:10px;
+}
+
+img.RefreshIcon {
+ width: 16px; height: 16px;
+ background:
url('/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/RefreshIcon.gif')
no-repeat;
+}
+
+img.DeactivateIcon {
+ width: 16px; height: 16px;
+ background:
url('/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/Cancel.gif') no-repeat;
+}
+
+img.StopIcon {
+ width: 16px; height: 16px;
+ background:
url('/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/DustBinClickButton.gif')
no-repeat;
+}
+
+img.ActivateIcon {
+ width: 16px; height: 16px;
+ background:
url('/eXoResources/skin/DefaultSkin/skinIcons/16x16/icons/SelectIcon.gif')
no-repeat;
+}
+
+.UIWsrpPortlet .UITabPane {
+ margin: 10px
+}
+
+.UIWsrpPortlet .UIHorizontalTabs .TabsContainer {
+ border-bottom:1px solid #DDDDDD;
+ height:24px;
+}
+
+.UIWsrpPortlet .UIAction .ActionContainer {
+ margin:0;
+ width:auto;
+}
+
+.UIWsrpPortlet .form-row {
+ /*border-bottom: 1px solid #ddd;*/
+ padding: 3px;
+ clear:both;
+}
+
+.UIWsrpPortlet .form-row label {
+ float:left;
+ width: 100%;
+}
+
+.UIWsrpPortlet .form-row label span {
+ display:block;
+ float:left;
+ width: 26%;
+}
+
+.UIWsrpPortlet .form-row label input {
+ float:left;
+ width: 69%;
+}
+
+.UIWsrpPortlet .UILoginForm .UIAction {
+ clear:both;
+ padding: 8px 0;
+}
+
+.UIWsrpPortlet .UILoginForm .ActionContainer {
+ float:right;
+ margin:0;
+}
+
Modified: portal/trunk/portlet/web/src/main/webapp/WEB-INF/gatein-resources.xml
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/WEB-INF/gatein-resources.xml 2009-12-22
10:02:32 UTC (rev 1125)
+++ portal/trunk/portlet/web/src/main/webapp/WEB-INF/gatein-resources.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -58,7 +58,7 @@
<portlet-skin>
<application-name>web</application-name>
- <portlet-name>PortalNavigationPortlet</portlet-name>
+ <portlet-name>PortalNavigationPortlet2</portlet-name>
<skin-name>Default</skin-name>
<css-path>/skin/portal/webui/component/UIPortalNavigationPortlet/DefaultStylesheet.css</css-path>
</portlet-skin>
Modified: portal/trunk/portlet/web/src/main/webapp/WEB-INF/portlet.xml
===================================================================
--- portal/trunk/portlet/web/src/main/webapp/WEB-INF/portlet.xml 2009-12-22 10:02:32 UTC
(rev 1125)
+++ portal/trunk/portlet/web/src/main/webapp/WEB-INF/portlet.xml 2009-12-22 12:35:37 UTC
(rev 1126)
@@ -202,7 +202,7 @@
<portlet>
<description xml:lang="EN">Portal Navigation
Portlet</description>
- <portlet-name>PortalNavigationPortlet</portlet-name>
+ <portlet-name>PortalNavigationPortlet2</portlet-name>
<display-name xml:lang="EN">Portal Navigation
Portlet</display-name>
<portlet-class>org.exoplatform.webui.application.portlet.PortletApplicationController</portlet-class>
Deleted:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/wsrp-configuration.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/wsrp-configuration.xml 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/common/wsrp-configuration.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- 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.
-
--->
-
-<configuration
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
-
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
-
- <component>
- <key>org.gatein.portal.wsrp.ExoKernelIntegration</key>
- <type>org.gatein.portal.wsrp.ExoKernelIntegration</type>
- <init-params>
- <value-param>
- <name>configLocation</name>
- <description>Location of the producer configuration
file</description>
- <value>conf/wsrp-producer-config.xml</value>
- </value-param>
- </init-params>
- </component>
-
-</configuration>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/configuration.xml
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/configuration.xml 2009-12-22
10:02:32 UTC (rev 1125)
+++ portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/configuration.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -26,7 +26,7 @@
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
<import>war:/conf/common/common-configuration.xml</import>
<import>war:/conf/common/portlet-container-configuration.xml</import>
- <import>war:/conf/common/wsrp-configuration.xml</import>
+ <import>war:/conf/wsrp/wsrp-configuration.xml</import>
<import>war:/conf/common/logs-configuration.xml</import>
<import>war:/conf/common/autologin-configuration.xml</import>
<import>war:/conf/database/database-configuration.xml</import>
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.tmpl.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -98,6 +98,7 @@
<property name="mop"
value="http://www.gatein.org/jcr/mop/1.0/"/>
<property name="app"
value="http://www.gatein.org/jcr/application-registry/1.0/"/>
<property name="lgn"
value="http://www.gatein.org/jcr/autologin/1.0/"/>
+ <property name="wsrp"
value="http://www.gatein.org/jcr/wsrp/1.0/"/>
</properties-param>
</init-params>
</component-plugin>
@@ -113,8 +114,11 @@
<value>jar:/conf/organization-nodetypes.xml</value>
<value>jar:/conf/mop-nodetypes.xml</value>
<value>jar:/conf/application-nodetypes.xml</value>
- <value>jar:/conf/content-nodetypes.xml</value>
- <value>jar:/conf/autologin-nodetypes.xml</value>
+ <value>jar:/conf/content-nodetypes.xml</value>
+ <value>jar:/conf/autologin-nodetypes.xml</value>
+
<value>war:/conf/wsrp/consumers-configuration-nodetypes.xml</value>
+
<value>war:/conf/wsrp/producer-configuration-nodetypes.xml</value>
+
<value>war:/conf/wsrp/producer-registrations-nodetypes.xml</value>
</values-param>
</init-params>
</component-plugin>
Modified: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/jcr-configuration.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -98,6 +98,7 @@
<property name="mop"
value="http://www.gatein.org/jcr/mop/1.0/"/>
<property name="app"
value="http://www.gatein.org/jcr/application-registry/1.0/"/>
<property name="lgn"
value="http://www.gatein.org/jcr/autologin/1.0/"/>
+ <property name="wsrp"
value="http://www.gatein.org/jcr/wsrp/1.0/"/>
</properties-param>
</init-params>
</component-plugin>
@@ -113,8 +114,11 @@
<value>jar:/conf/organization-nodetypes.xml</value>
<value>jar:/conf/mop-nodetypes.xml</value>
<value>jar:/conf/application-nodetypes.xml</value>
- <value>jar:/conf/content-nodetypes.xml</value>
- <value>jar:/conf/autologin-nodetypes.xml</value>
+ <value>jar:/conf/content-nodetypes.xml</value>
+ <value>jar:/conf/autologin-nodetypes.xml</value>
+
<value>war:/conf/wsrp/consumers-configuration-nodetypes.xml</value>
+
<value>war:/conf/wsrp/producer-configuration-nodetypes.xml</value>
+
<value>war:/conf/wsrp/producer-registrations-nodetypes.xml</value>
</values-param>
</init-params>
</component-plugin>
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.tmpl.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -173,7 +173,56 @@
</persister>
</lock-manager>
</workspace>
-
+ <!-- Workspace for WSRP -->
+ <workspace name="wsrp-system">
+ <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name"
value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="hsqldb"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size"
value="204800"/>
+ <property name="swap-directory"
value="../temp/swap/wsrp${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="gadgets"
+
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path"
value="../temp/values/wsrp${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer
class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype"
value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators
read;*:/platform/administrators add_node;*:/platform/administrators
set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir"
value="../temp/jcrlucenedb/wsrp${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister
class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path"
value="../temp/lock/wsrp${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
</workspaces>
</repository>
</repositories>
Modified:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/jcr/repository-configuration.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -173,6 +173,56 @@
</persister>
</lock-manager>
</workspace>
+ <!-- Workspace for WSRP -->
+ <workspace name="wsrp-system">
+ <container
class="org.exoplatform.services.jcr.impl.storage.jdbc.JDBCWorkspaceDataContainer">
+ <properties>
+ <property name="source-name"
value="jdbcexo${container.name.suffix}"/>
+ <property name="dialect" value="hsqldb"/>
+ <property name="multi-db" value="false"/>
+ <property name="update-storage" value="true"/>
+ <property name="max-buffer-size"
value="204800"/>
+ <property name="swap-directory"
value="../temp/swap/wsrp${container.name.suffix}"/>
+ </properties>
+ <value-storages>
+ <value-storage id="gadgets"
+
class="org.exoplatform.services.jcr.impl.storage.value.fs.TreeFileValueStorage">
+ <properties>
+ <property name="path"
value="../temp/values/wsrp${container.name.suffix}"/>
+ </properties>
+ <filters>
+ <filter property-type="Binary"/>
+ </filters>
+ </value-storage>
+ </value-storages>
+ </container>
+ <initializer
class="org.exoplatform.services.jcr.impl.core.ScratchWorkspaceInitializer">
+ <properties>
+ <property name="root-nodetype"
value="nt:unstructured"/>
+ <property name="root-permissions"
+ value="any read;*:/platform/administrators
read;*:/platform/administrators add_node;*:/platform/administrators
set_property;*:/platform/administrators remove"/>
+ </properties>
+ </initializer>
+ <cache enabled="true">
+ <properties>
+ <property name="max-size" value="20000"/>
+ <property name="live-time" value="30000"/>
+ </properties>
+ </cache>
+ <query-handler
class="org.exoplatform.services.jcr.impl.core.query.lucene.SearchIndex">
+ <properties>
+ <property name="index-dir"
value="../temp/jcrlucenedb/wsrp${container.name.suffix}"/>
+ </properties>
+ </query-handler>
+ <lock-manager>
+ <time-out>15m</time-out>
+ <persister
class="org.exoplatform.services.jcr.impl.core.lock.FileSystemLockPersister">
+ <properties>
+ <property name="path"
value="../temp/lock/wsrp${container.name.suffix}"/>
+ </properties>
+ </persister>
+ </lock-manager>
+ </workspace>
</workspaces>
</repository>
Copied: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp (from rev 804,
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp)
Deleted:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml
===================================================================
---
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml 2009-11-25
21:32:49 UTC (rev 804)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,177 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<!--
- ~ JBoss, a division of Red Hat
- ~ Copyright 2009, Red Hat Middleware, LLC, and individual
- ~ contributors as indicated by the @authors tag. See the
- ~ copyright.txt in the distribution for a full listing of
- ~ individual contributors.
- ~
- ~ This is free software; you can redistribute it and/or modify it
- ~ under the terms of the GNU Lesser General Public License as
- ~ published by the Free Software Foundation; either version 2.1 of
- ~ the License, or (at your option) any later version.
- ~
- ~ This software is distributed in the hope that it will be useful,
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- ~ Lesser General Public License for more details.
- ~
- ~ You should have received a copy of the GNU Lesser General Public
- ~ License along with this software; if not, write to the Free
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- -->
-
-<nodeTypes
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
-
xmlns:jcr="http://www.jcp.org/jcr/1.0">
-
- <nodeType name="wsrp:producerinfos" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <childNodeDefinitions>
- <childNodeDefinition name="*"
defaultPrimaryType="wsrp:producerinfo" autoCreated="false"
mandatory="false"
- onParentVersion="COPY"
protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
- <requiredPrimaryType>wsrp:producerinfo</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="wsrp:producerinfo" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="producerid"
requiredType="String" autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="cache" requiredType="Integer"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="active" requiredType="boolean"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- <childNodeDefinitions>
- <childNodeDefinition name="endpoint"
defaultPrimaryType="" autoCreated="false" mandatory="false"
- onParentVersion="COPY"
protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
- <requiredPrimaryType>wsrp:endpointinfo</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- <childNodeDefinition name="registration"
defaultPrimaryType="" autoCreated="false" mandatory="false"
- onParentVersion="COPY"
protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
-
<requiredPrimaryType>wsrp:registrationinfo</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="wsrp:endpointinfo" isMixin="false"
hasOrderableChildNodes="false" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="wsdlurl" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- </nodeType>
-
- <nodeType name="wsrp:registrationinfo" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="consumername"
requiredType="String" autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="handle" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="state" requiredType="Binary"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- <childNodeDefinitions>
- <childNodeDefinition name="*"
defaultPrimaryType="wsrp:registrationproperty" autoCreated="false"
- mandatory="false"
- onParentVersion="COPY"
protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
-
<requiredPrimaryType>wsrp:registrationproperty</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="wsrp:registrationproperty" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="value" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="status" requiredType="Integer"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- <childNodeDefinitions>
- <childNodeDefinition name="description"
defaultPrimaryType="" autoCreated="false" mandatory="false"
- onParentVersion="COPY"
protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
-
<requiredPrimaryType>wsrp:registrationpropertydescription</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="wsrp:registrationpropertydescription"
isMixin="false" hasOrderableChildNodes="true"
- primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="name" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="type" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="description"
requiredType="String" autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="hint" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="label" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- </nodeType>
-
-</nodeTypes>
\ No newline at end of file
Copied:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml
(from rev 804,
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml)
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml
(rev 0)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/consumers-configuration-nodetypes.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,183 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
+
+<nodeTypes
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
+
xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <nodeType name="wsrp:producerinfos" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*"
defaultPrimaryType="wsrp:producerinfo" autoCreated="false"
mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:producerinfo</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:producerinfo" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="producerid"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="cache" requiredType="Integer"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="active" requiredType="boolean"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="endpoint"
defaultPrimaryType="wsrp:endpointinfo" autoCreated="true"
+ mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:endpointinfo</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="registration"
defaultPrimaryType="wsrp:registrationinfo" autoCreated="true"
+ mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+
<requiredPrimaryType>wsrp:registrationinfo</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:endpointinfo" isMixin="false"
hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="wsdlurl" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationinfo" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="consumername"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="handle" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="state" requiredType="Binary"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*"
defaultPrimaryType="wsrp:registrationproperty" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+
<requiredPrimaryType>wsrp:registrationproperty</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationproperty" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="name" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="value" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="status" requiredType="Integer"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="description"
defaultPrimaryType="" autoCreated="false" mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+
<requiredPrimaryType>wsrp:registrationpropertydescription</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationpropertydescription"
isMixin="false" hasOrderableChildNodes="true"
+ primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="name" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="type" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="description"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="hint" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="label" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>
\ No newline at end of file
Deleted:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml
===================================================================
---
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml 2009-11-25
21:32:49 UTC (rev 804)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-
-<!--
- ~ JBoss, a division of Red Hat
- ~ Copyright 2009, Red Hat Middleware, LLC, and individual
- ~ contributors as indicated by the @authors tag. See the
- ~ copyright.txt in the distribution for a full listing of
- ~ individual contributors.
- ~
- ~ This is free software; you can redistribute it and/or modify it
- ~ under the terms of the GNU Lesser General Public License as
- ~ published by the Free Software Foundation; either version 2.1 of
- ~ the License, or (at your option) any later version.
- ~
- ~ This software is distributed in the hope that it will be useful,
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- ~ Lesser General Public License for more details.
- ~
- ~ You should have received a copy of the GNU Lesser General Public
- ~ License along with this software; if not, write to the Free
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
- -->
-
-<nodeTypes
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
-
xmlns:jcr="http://www.jcp.org/jcr/1.0">
-
- <nodeType name="wsrp:producerconfiguration" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="strictmode"
requiredType="boolean" autoCreated="false"
mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- <childNodeDefinitions>
- <childNodeDefinition name="registrationrequirements"
defaultPrimaryType="" autoCreated="true" mandatory="false"
- onParentVersion="COPY"
protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
-
<requiredPrimaryType>wsrp:registrationrequirements</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="wsrp:registrationrequirements" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="registrationrequired"
requiredType="boolean" autoCreated="false"
mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="registrationrequiredforfulldescription"
requiredType="boolean" autoCreated="false"
- mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="state" requiredType="Binary"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- <childNodeDefinitions>
- <childNodeDefinition name="*"
defaultPrimaryType="wsrp:registrationpropertydescription"
autoCreated="false"
- mandatory="false"
- onParentVersion="COPY"
protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
-
<requiredPrimaryType>wsrp:registrationpropertydescription</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="wsrp:registrationproperty" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="value" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="status" requiredType="Integer"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- <childNodeDefinitions>
- <childNodeDefinition name="description"
defaultPrimaryType="" autoCreated="false" mandatory="false"
- onParentVersion="COPY"
protected="false" sameNameSiblings="false">
- <requiredPrimaryTypes>
-
<requiredPrimaryType>wsrp:registrationpropertydescription</requiredPrimaryType>
- </requiredPrimaryTypes>
- </childNodeDefinition>
- </childNodeDefinitions>
- </nodeType>
-
- <nodeType name="wsrp:registrationpropertydescription"
isMixin="false" hasOrderableChildNodes="true"
- primaryItemName="">
- <supertypes>
- <supertype>nt:base</supertype>
- <supertype>mix:referenceable</supertype>
- </supertypes>
- <propertyDefinitions>
- <propertyDefinition name="name" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="true">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="type" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="description"
requiredType="String" autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="hint" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- <propertyDefinition name="label" requiredType="String"
autoCreated="false" mandatory="false"
- onParentVersion="COPY" protected="false"
multiple="false">
- <valueConstraints/>
- </propertyDefinition>
- </propertyDefinitions>
- </nodeType>
-
-</nodeTypes>
\ No newline at end of file
Copied:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml
(from rev 804,
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml)
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml
(rev 0)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-configuration-nodetypes.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
+
+<nodeTypes
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
+
xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <nodeType name="wsrp:producerconfiguration" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="strictmode"
requiredType="boolean" autoCreated="false"
mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="registrationrequirements"
defaultPrimaryType="wsrp:registrationrequirements"
+ autoCreated="true" mandatory="false"
onParentVersion="COPY" protected="false"
+ sameNameSiblings="false">
+ <requiredPrimaryTypes>
+
<requiredPrimaryType>wsrp:registrationrequirements</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationrequirements" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="registrationrequired"
requiredType="boolean" autoCreated="false"
mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="registrationrequiredforfulldescription"
requiredType="boolean" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="state" requiredType="Binary"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*"
defaultPrimaryType="wsrp:registrationpropertydescription"
autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+
<requiredPrimaryType>wsrp:registrationpropertydescription</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationproperty" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="value" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="status" requiredType="Integer"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="description"
defaultPrimaryType="" autoCreated="false" mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+
<requiredPrimaryType>wsrp:registrationpropertydescription</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationpropertydescription"
isMixin="false" hasOrderableChildNodes="true"
+ primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="name" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="type" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="description"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="hint" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="label" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>
\ No newline at end of file
Copied:
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml
(from rev 981,
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml)
===================================================================
---
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml
(rev 0)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/producer-registrations-nodetypes.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,194 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2009, Red Hat Middleware, LLC, and individual
+ ~ contributors as indicated by the @authors tag. See the
+ ~ copyright.txt in the distribution for a full listing of
+ ~ individual contributors.
+ ~
+ ~ This is free software; you can redistribute it and/or modify it
+ ~ under the terms of the GNU Lesser General Public License as
+ ~ published by the Free Software Foundation; either version 2.1 of
+ ~ the License, or (at your option) any later version.
+ ~
+ ~ This software is distributed in the hope that it will be useful,
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ ~ Lesser General Public License for more details.
+ ~
+ ~ You should have received a copy of the GNU Lesser General Public
+ ~ License along with this software; if not, write to the Free
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
+ -->
+
+<nodeTypes
xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
xmlns:mix="http://www.jcp.org/jcr/mix/1.0"
+
xmlns:jcr="http://www.jcp.org/jcr/1.0">
+
+ <nodeType name="wsrp:consumersandgroups" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*"
defaultPrimaryType="wsrp:consumer"
+ autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false"
+ sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:consumer</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="*"
defaultPrimaryType="wsrp:consumergroup"
+ autoCreated="false" mandatory="false"
onParentVersion="COPY" protected="false"
+ sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:consumergroup</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:consumer" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="name" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="id" requiredType="String"
autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="consumeragent"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="status" requiredType="String"
+ autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="group" requiredType="Path"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY"
+ protected="false" multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*"
defaultPrimaryType="wsrp:registration" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:registration</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="capabilities"
defaultPrimaryType="wsrp:consumercapabilities" autoCreated="true"
+ mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+
<requiredPrimaryType>wsrp:consumercapabilities</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registration" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="status" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="registrationhandle"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="consumer" requiredType="Path"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="properties"
defaultPrimaryType="wsrp:registrationproperties" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+
<requiredPrimaryType>wsrp:registrationproperties</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationproperties" isMixin="false"
hasOrderableChildNodes="true"
+ primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ </nodeType>
+
+ <nodeType name="wsrp:consumergroup" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="name" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="status" requiredType="String"
+ autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*"
defaultPrimaryType="wsrp:consumer" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:consumer</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:consumercapabilities" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="modes" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="windowstates"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="userscopes"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="userprofiledate"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="true">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="supportsgetmethod"
requiredType="boolean" autoCreated="false"
mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+
+</nodeTypes>
\ No newline at end of file
Deleted: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
===================================================================
---
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2009-11-25
21:32:49 UTC (rev 804)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -1,55 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-
- 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.
-
--->
-
-<configuration
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
-
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
-
- <component>
- <key>org.gatein.portal.wsrp.ExoKernelIntegration</key>
- <type>org.gatein.portal.wsrp.ExoKernelIntegration</type>
- <init-params>
- <value-param>
- <name>producerConfigLocation</name>
- <description>Location of the default producer configuration
file</description>
- <value>conf/wsrp-producer-config.xml</value>
- </value-param>
- <value-param>
- <name>consumersConfigLocation</name>
- <description>Location of the default consumers configuration
file</description>
- <value>conf/wsrp-consumers-config.xml</value>
- </value-param>
- <value-param>
- <name>workspaceName</name>
- <description>Name of the JCR workspace for WSRP
persistence</description>
- <value>wsrp-system</value>
- </value-param>
- <value-param>
- <name>repositoryName</name>
- <description>Name of the JCR repository for WSRP
persistence</description>
- <value>repository</value>
- </value-param>
- </init-params>
- </component>
-
-</configuration>
Copied: portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
(from rev 804,
portal/branches/wsrp-integration/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml)
===================================================================
--- portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml
(rev 0)
+++
portal/trunk/web/portal/src/main/webapp/WEB-INF/conf/wsrp/wsrp-configuration.xml 2009-12-22
12:35:37 UTC (rev 1126)
@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+
+ 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.
+
+-->
+
+<configuration
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+
xsi:schemaLocation="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd
http://www.exoplaform.org/xml/ns/kernel_1_0.xsd"
+
xmlns="http://www.exoplaform.org/xml/ns/kernel_1_0.xsd">
+
+ <component>
+ <key>org.gatein.portal.wsrp.ExoKernelIntegration</key>
+ <type>org.gatein.portal.wsrp.ExoKernelIntegration</type>
+ <init-params>
+ <value-param>
+ <name>producerConfigLocation</name>
+ <description>Location of the default producer configuration
file</description>
+ <value>conf/wsrp-producer-config.xml</value>
+ </value-param>
+ <value-param>
+ <name>consumersConfigLocation</name>
+ <description>Location of the default consumers configuration
file</description>
+ <value>conf/wsrp-consumers-config.xml</value>
+ </value-param>
+ </init-params>
+ </component>
+
+ <external-component-plugins>
+
<target-component>org.exoplatform.commons.chromattic.ChromatticManager</target-component>
+ <component-plugin>
+ <name>chromattic</name>
+ <set-method>addLifeCycle</set-method>
+ <type>org.exoplatform.commons.chromattic.ChromatticLifeCycle</type>
+ <init-params>
+ <value-param>
+ <name>domain-name</name>
+ <value>wsrp</value>
+ </value-param>
+ <value-param>
+ <name>workspace-name</name>
+ <value>wsrp-system</value>
+ </value-param>
+ <values-param>
+ <name>entities</name>
+
<value>org.gatein.portal.wsrp.state.mapping.RegistrationPropertyDescriptionMapping</value>
+
<value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfoMapping</value>
+
<value>org.gatein.portal.wsrp.state.consumer.mapping.ProducerInfosMapping</value>
+
<value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationInfoMapping</value>
+
<value>org.gatein.portal.wsrp.state.consumer.mapping.RegistrationPropertyMapping</value>
+
<value>org.gatein.portal.wsrp.state.consumer.mapping.EndpointInfoMapping</value>
+
<value>org.gatein.portal.wsrp.state.producer.configuration.mapping.ProducerConfigurationMapping</value>
+
<value>org.gatein.portal.wsrp.state.producer.configuration.mapping.RegistrationRequirementsMapping</value>
+
<value>org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerCapabilitiesMapping</value>
+
<value>org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerGroupMapping</value>
+
<value>org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumerMapping</value>
+
<value>org.gatein.portal.wsrp.state.producer.registrations.mapping.ConsumersAndGroupsMapping</value>
+
<value>org.gatein.portal.wsrp.state.producer.registrations.mapping.RegistrationMapping</value>
+
<value>org.gatein.portal.wsrp.state.producer.registrations.mapping.RegistrationPropertiesMapping</value>
+ </values-param>
+ </init-params>
+ </component-plugin>
+ </external-component-plugins>
+
+</configuration>
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/application/UIPortlet.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -7,7 +7,7 @@
def rcontext = _ctx.getRequestContext();
UIPortalApplication uiPortalApp = rcontext.getUIApplication();
- if(!uiPortalApp.isEditting() && !uicomponent.hasPermission()) return;
+ if(!uiPortalApp.isEditing() && !uicomponent.hasPermission()) return;
int portalMode = uiPortalApp.getModeState();
JavascriptManager jsmanager = rcontext.getJavascriptManager();
@@ -20,7 +20,7 @@
WindowState windowState = uicomponent.getCurrentWindowState();
boolean isDesktop = "Window".equals(uicomponent.getPortletStyle());
String portletId = uicomponent.getId();
- if(!isDesktop && uiPortalApp.isEditting()) {
+ if(!isDesktop && uiPortalApp.isEditing()) {
%>
<div class="UIPortlet" id="UIPortlet-$portletId"
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);"
style="top: 0px; left:0px;">
@@ -285,7 +285,7 @@
}
}
}
- if(!isDesktop && uiPortalApp.isEditting()) {
+ if(!isDesktop && uiPortalApp.isEditing()) {
if(portalMode != uiPortalApp.CONTAINER_BLOCK_EDIT_MODE && portalMode !=
uiPortalApp.APP_BLOCK_EDIT_MODE) {
%>
<div class="UIPortlet-$portletId UIPortletMask" style="position:
absolute; display:none;"><span></span></div>
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIContainer.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -7,7 +7,7 @@
ResourceBundle res = rcontext.getApplicationResourceBundle();
UIPortalApplication uiPortalApp = rcontext.getUIApplication();
- if(!uiPortalApp.isEditting() && !uicomponent.hasPermission()) return;
+ if(!uiPortalApp.isEditing() && !uicomponent.hasPermission()) return;
String cssStyle = "";
String uiComponentWidth = uicomponent.getWidth();
@@ -24,7 +24,7 @@
}
%>
-<div class="UIContainer
<%=uiPortalApp.isEditting()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}" ${cssStyle}
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
+<div class="UIContainer
<%=uiPortalApp.isEditing()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}" ${cssStyle}
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
<div class="NormalContainerBlock">
<div class="LeftContainerBlock">
<div class="RightContainerBlock UIComponentBlock">
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UITableColumnContainer.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -6,7 +6,7 @@
ResourceBundle res = rcontext.getApplicationResourceBundle();
UIPortalApplication uiPortalApp = rcontext.getUIApplication();
- if(!uiPortalApp.isEditting() && !uicomponent.hasPermission()) return;
+ if(!uiPortalApp.isEditing() && !uicomponent.hasPermission()) return;
/** Trim the prefix UIContainer- if any, this hardcoded part is needed to update nested
container via Ajax */
String componentId = uicomponent.getId();
@@ -15,7 +15,7 @@
}
%>
-<div class="UIContainer
<%=uiPortalApp.isEditting()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}"
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
+<div class="UIContainer
<%=uiPortalApp.isEditing()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}"
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
<div class="NormalContainerBlock">
<div class="LeftContainerBlock">
<div class="RightContainerBlock UIComponentBlock">
Modified:
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl
===================================================================
---
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/web/portal/src/main/webapp/groovy/portal/webui/container/UIToolbarContainer.gtmpl 2009-12-22
12:35:37 UTC (rev 1126)
@@ -5,13 +5,13 @@
def rcontext = _ctx.getRequestContext();
UIPortalApplication uiPortalApp = rcontext.getUIApplication();
- if(!uiPortalApp.isEditting() && !uicomponent.hasPermission()) return;
+ if(!uiPortalApp.isEditing() && !uicomponent.hasPermission()) return;
JavascriptManager jsmanager = rcontext.getJavascriptManager();
jsmanager.importJavascript('eXo.portal.PortalDragDrop');
%>
-<div class="UIContainer UIToolbarContainer
<%=uiPortalApp.isEditting()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}"
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
+<div class="UIContainer UIToolbarContainer
<%=uiPortalApp.isEditing()?"EdittingContainer":""%>"
id="UIContainer-${uicomponent.id}"
onmouseover="eXo.portal.UIPortal.blockOnMouseOver(event, this, true);"
onmouseout="eXo.portal.UIPortal.blockOnMouseOver(event, this, false);">
<div class="NormalContainerBlock">
<div class="LeftContainerBlock">
<div class="RightContainerBlock UIComponentBlock">
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/application/portlet/PortletURLBuilder.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -30,8 +30,10 @@
*/
public class PortletURLBuilder extends URLBuilder<UIComponent>
{
+ private static final String AMP = "&";
+ private static final char EQUALS = '=';
- public PortletURLBuilder()
+ public PortletURLBuilder()
{
super(null);
}
@@ -54,25 +56,25 @@
protected void createURL(StringBuilder builder, UIComponent targetComponent, String
action, String targetBeanId,
Parameter[] params)
{
- String baseUrl = getBaseURL().replaceAll("&",
"&");
-
builder.append(baseUrl).append("&").append(UIComponent.UICOMPONENT).append('=').append(
+ String baseUrl = getBaseURL().replaceAll("&", AMP);
+
builder.append(baseUrl).append(AMP).append(UIComponent.UICOMPONENT).append(EQUALS).append(
targetComponent.getId());
if (action != null && action.trim().length() > 0)
{
-
builder.append("&").append(WebuiRequestContext.ACTION).append('=').append(action);
+
builder.append(AMP).append(WebuiRequestContext.ACTION).append(EQUALS).append(action);
}
if (targetBeanId != null && targetBeanId.trim().length() > 0)
{
-
builder.append("&").append(UIComponent.OBJECTID).append('=').append(targetBeanId);
+
builder.append(AMP).append(UIComponent.OBJECTID).append(EQUALS).append(targetBeanId);
}
if (params == null || params.length < 1)
return;
for (Parameter param : params)
{
-
builder.append("&").append(param.getName()).append('=').append(param.getValue());
+
builder.append(AMP).append(param.getName()).append(EQUALS).append(param.getValue());
}
}
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIApplication.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIApplication.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIApplication.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -41,6 +41,7 @@
private long lastAccessApplication_;
private UIPopupMessages uiPopupMessages_;
+ private static final String UIAPPLICATION = "uiapplication";
public UIApplication() throws Exception
{
@@ -81,11 +82,11 @@
public void setLastAccessApplication(long time)
{
lastAccessApplication_ = time;
- };
+ }
public String getUIComponentName()
{
- return "uiapplication";
+ return UIAPPLICATION;
}
@SuppressWarnings("unchecked")
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/UIComponent.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -372,7 +372,7 @@
public String getUIComponentName()
{
- return "uicomponent";
+ return UICOMPONENT;
}
public <T> T getApplicationComponent(Class<T> type)
Modified:
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java
===================================================================
---
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/webui/core/src/main/java/org/exoplatform/webui/core/lifecycle/Lifecycle.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -57,15 +57,12 @@
}
/**
- * That method is the most generic one for every UICOmponent that is bound to
- * this Lifecycle object and the class that extends it withouyt overiding the
+ * That method is the most generic one for every UIComponent that is bound to
+ * this Lifecycle object and the class that extends it without overriding the
* method.
*
- * According to the template type associated with the UI component (groovy or
- * javascript one); the template is rendered using either the method
- * renderJSTemplate() or renderTemplate(). In the case of the use of a groovy
- * template, a context object of type WebuiBindingContext is used to then
- * provide to the template all the necessary objects to render
+ * The template associated to the specified UIComponent is rendered using
renderTemplate(). A WebuiBindingContext
+ * context object provides the template with all the necessary objects to render.
* (WebuiBindingContext extends the Map class)
*
*/
@@ -74,7 +71,7 @@
String template = uicomponent.getTemplate();
ResourceResolver resolver = uicomponent.getTemplateResourceResolver(context,
template);
WebuiBindingContext bcontext = new WebuiBindingContext(resolver,
context.getWriter(), uicomponent, context);
- bcontext.put("uicomponent", uicomponent);
+ bcontext.put(UIComponent.UICOMPONENT, uicomponent);
bcontext.put(uicomponent.getUIComponentName(), uicomponent);
renderTemplate(template, bcontext);
}
@@ -83,16 +80,16 @@
/**
* The method allows to use Groovy templates to render the portal components.
+ *
+ * <ol>
+ * <li>Add a decorator object into the context</li>
+ * <li>Get a reference to the TemplateService</li>
+ * <li>If the system property "exo.product.developing" is set to
<code>true</code>, the templates are not cached</li>
+ * <li>If the writer used to render the output is of type HtmlValidator, which
is the case in the Portal
+ * environment, then it is also possible to validate the generated HTML (for debugging
purposes)</li>
+ * <li>The template and the context are then merged to generate the HTML
fragment</li>
+ * </ol>
*
- * 1) Add a decorator object into the context 2) Get a reference of the
- * TemplateService 3) If the system property "exo.product.developing" is
set
- * to true, the templates are not cached 4) If the writer used to render the
- * output is of type HtmlValidator, which is the case in the Portal
- * environement, then it is also possible to validate the generated HTML (for
- * debug purposes) 6) The template and the context are then merged using the
- * method service.merge(groovyTemplate, bcontext) to generate the HTML
- * fragment
- *
*/
protected void renderTemplate(String template, WebuiBindingContext bcontext) throws
Exception
{
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/application/UIPortletLifecycle.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -266,7 +266,7 @@
WebuiApplication app = (WebuiApplication)prcontext.getApplication();
ApplicationResourceResolver resolver = app.getResourceResolver();
WebuiBindingContext bcontext = new WebuiBindingContext(resolver,
context.getWriter(), uicomponent, prcontext);
- bcontext.put("uicomponent", uicomponent);
+ bcontext.put(UIComponent.UICOMPONENT, uicomponent);
bcontext.put("portletContent", markup);
bcontext.put("portletTitle", portletTitle);
try
Modified:
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java
===================================================================
---
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java 2009-12-22
10:02:32 UTC (rev 1125)
+++
portal/trunk/webui/portal/src/main/java/org/exoplatform/portal/webui/workspace/UIPortalApplication.java 2009-12-22
12:35:37 UTC (rev 1126)
@@ -211,7 +211,7 @@
*
* @return True if the Portal is not in the normal mode
*/
- public boolean isEditting()
+ public boolean isEditing()
{
return (modeState != NORMAL_MODE);
}