Author: chris.laprun(a)jboss.com
Date: 2011-04-21 04:37:10 -0400 (Thu, 21 Apr 2011)
New Revision: 6313
Added:
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/jcr/BaseChromatticPersister.java
components/wsrp/trunk/jcr-impl/src/main/resources/
components/wsrp/trunk/jcr-impl/src/main/resources/conf/
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/consumers-configuration-nodetypes.xml
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/migration-nodetypes.xml
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/producer-configuration-nodetypes.xml
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/producer-pc-nodetypes.xml
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/producer-registrations-nodetypes.xml
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/consumer/
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/consumer/registry/
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/consumer/registry/JCRConsumerRegistryTestCase.java
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/registry/ConsumerRegistryTestCase.java
components/wsrp/trunk/jcr-impl/pom.xml
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/JCRConsumerRegistry.java
components/wsrp/trunk/pom.xml
Log:
- GTNWSRP-196: Moved nodetype definitions to WSRP module from GateIn. Need to be removed
from GateIn once a new WSRP release is available.
- Added BaseChromatticPersister based on GateIn's implementation of
ChromatticPersister, JCRPersister. JCRPersister will need to be adapted to this change
once a new WSRP is available.
- Added JCRConsumerRegistryTestCase.
Modified:
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/registry/ConsumerRegistryTestCase.java
===================================================================
---
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/registry/ConsumerRegistryTestCase.java 2011-04-21
08:06:47 UTC (rev 6312)
+++
components/wsrp/trunk/consumer/src/test/java/org/gatein/wsrp/consumer/registry/ConsumerRegistryTestCase.java 2011-04-21
08:37:10 UTC (rev 6313)
@@ -41,7 +41,7 @@
*/
public class ConsumerRegistryTestCase extends TestCase
{
- private ConsumerRegistry registry;
+ protected ConsumerRegistry registry;
@Override
protected void setUp() throws Exception
Modified: components/wsrp/trunk/jcr-impl/pom.xml
===================================================================
--- components/wsrp/trunk/jcr-impl/pom.xml 2011-04-21 08:06:47 UTC (rev 6312)
+++ components/wsrp/trunk/jcr-impl/pom.xml 2011-04-21 08:37:10 UTC (rev 6313)
@@ -22,7 +22,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/xsd/maven-4.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/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>wsrp-parent</artifactId>
<groupId>org.gatein.wsrp</groupId>
@@ -74,6 +75,51 @@
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.core</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.exo</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-consumer</artifactId>
+ <type>test-jar</type>
+ <scope>test</scope>
+ </dependency>
+ <!-- JBoss dependencies -->
+ <dependency>
+ <groupId>org.jboss</groupId>
+ <artifactId>jbossxb</artifactId>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>${org.mockito.version}</version>
+ <scope>test</scope>
+ </dependency>
</dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <systemProperties>
+ <property>
+
<name>com.arjuna.ats.arjuna.objectstore.objectStoreDir</name>
+ <value>${project.build.directory}</value>
+ </property>
+ </systemProperties>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
</project>
\ No newline at end of file
Modified:
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/JCRConsumerRegistry.java
===================================================================
---
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/JCRConsumerRegistry.java 2011-04-21
08:06:47 UTC (rev 6312)
+++
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/consumer/registry/JCRConsumerRegistry.java 2011-04-21
08:37:10 UTC (rev 6313)
@@ -50,6 +50,7 @@
public class JCRConsumerRegistry extends AbstractConsumerRegistry implements
StoresByPathManager<ProducerInfo>
{
private ChromatticPersister persister;
+ private boolean loadFromXMLIfNeeded;
private static final String PRODUCER_INFOS_PATH = ProducerInfosMapping.NODE_NAME;
public static final List<Class> mappingClasses = new ArrayList<Class>(6);
@@ -63,7 +64,13 @@
public JCRConsumerRegistry(ChromatticPersister persister) throws Exception
{
+ this(persister, true);
+ }
+
+ protected JCRConsumerRegistry(ChromatticPersister persister, boolean
loadFromXMLIfNeeded)
+ {
this.persister = persister;
+ this.loadFromXMLIfNeeded = loadFromXMLIfNeeded;
}
@Override
@@ -163,25 +170,27 @@
{
producerInfosMapping = session.insert(ProducerInfosMapping.class,
ProducerInfosMapping.NODE_NAME);
- List<ProducerInfoMapping> infos =
producerInfosMapping.getProducerInfos();
+ if (loadFromXMLIfNeeded)
+ {
+ // Load from XML
+ XMLConsumerRegistry fromXML = new XMLConsumerRegistry();
+ fromXML.reloadConsumers();
- // Load from XML
- XMLConsumerRegistry fromXML = new XMLConsumerRegistry();
- fromXML.reloadConsumers();
+ // Save to JCR
+ List<ProducerInfoMapping> infos =
producerInfosMapping.getProducerInfos();
+ List<WSRPConsumer> consumers = fromXML.getConfiguredConsumers();
+ for (WSRPConsumer consumer : consumers)
+ {
+ ProducerInfo info = consumer.getProducerInfo();
- // Save to JCR
- List<WSRPConsumer> consumers = fromXML.getConfiguredConsumers();
- for (WSRPConsumer consumer : consumers)
- {
- ProducerInfo info = consumer.getProducerInfo();
+ ProducerInfoMapping pim =
producerInfosMapping.createProducerInfo(info.getId());
- ProducerInfoMapping pim =
producerInfosMapping.createProducerInfo(info.getId());
+ // need to add to parent first to attach newly created
ProducerInfoMapping
+ infos.add(pim);
- // need to add to parent first to attach newly created ProducerInfoMapping
- infos.add(pim);
-
- // init it from ProducerInfo
- pim.initFrom(info);
+ // init it from ProducerInfo
+ pim.initFrom(info);
+ }
}
}
Added:
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/jcr/BaseChromatticPersister.java
===================================================================
---
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/jcr/BaseChromatticPersister.java
(rev 0)
+++
components/wsrp/trunk/jcr-impl/src/main/java/org/gatein/wsrp/jcr/BaseChromatticPersister.java 2011-04-21
08:37:10 UTC (rev 6313)
@@ -0,0 +1,153 @@
+/*
+* 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.wsrp.jcr;
+
+import org.chromattic.api.Chromattic;
+import org.chromattic.api.ChromatticBuilder;
+import org.chromattic.api.ChromatticSession;
+import org.gatein.common.util.ParameterValidation;
+import org.gatein.wsrp.jcr.mapping.BaseMapping;
+
+import java.lang.reflect.ParameterizedType;
+import java.lang.reflect.Type;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ * @version $Revision$
+ */
+public abstract class BaseChromatticPersister implements ChromatticPersister
+{
+ private Chromattic chrome;
+ public static final String WSRP_WORKSPACE_NAME = "wsrp-system";
+ public static final String PORTLET_STATES_WORKSPACE_NAME = "pc-system";
+ protected static final String REPOSITORY_NAME = "repository";
+ protected String workspaceName;
+ private Map<Class, Class<? extends BaseMapping>> modelToMapping;
+
+ private ThreadLocal<ChromatticSession> sessionHolder = new
ThreadLocal<ChromatticSession>();
+
+ public BaseChromatticPersister(String workspaceName)
+ {
+ this.workspaceName = workspaceName;
+ }
+
+ public void initializeBuilderFor(List<Class> mappingClasses) throws Exception
+ {
+ ChromatticBuilder builder = ChromatticBuilder.create();
+ builder.setOptionValue(ChromatticBuilder.INSTRUMENTOR_CLASSNAME,
"org.chromattic.apt.InstrumentorImpl");
+
+ setBuilderOptions(builder);
+
+ modelToMapping = new HashMap<Class, Class<? extends
BaseMapping>>(mappingClasses.size());
+ for (Class mappingClass : mappingClasses)
+ {
+ if (BaseMapping.class.isAssignableFrom(mappingClass))
+ {
+ Type[] interfaces = mappingClass.getGenericInterfaces();
+ if (ParameterValidation.existsAndIsNotEmpty(interfaces))
+ {
+ Class type =
(Class)((ParameterizedType)interfaces[0]).getActualTypeArguments()[0];
+ modelToMapping.put(type, mappingClass);
+ }
+ }
+ builder.add(mappingClass);
+ }
+
+ chrome = builder.build();
+ }
+
+ protected abstract void setBuilderOptions(ChromatticBuilder builder);
+
+ public ChromatticSession getSession()
+ {
+ ChromatticSession chromatticSession = sessionHolder.get();
+ if (chromatticSession == null)
+ {
+ ChromatticSession session = chrome.openSession();
+ sessionHolder.set(session);
+ return session;
+ }
+ else
+ {
+ return chromatticSession;
+ }
+ }
+
+ public void closeSession(boolean save)
+ {
+ ChromatticSession session = getOpenedSessionOrFail();
+ if (save)
+ {
+ synchronized (this)
+ {
+ session.save();
+ }
+ }
+ session.close();
+ sessionHolder.set(null);
+ }
+
+ private ChromatticSession getOpenedSessionOrFail()
+ {
+ ChromatticSession session = sessionHolder.get();
+ if (session == null)
+ {
+ throw new IllegalStateException("Cannot close the session as it hasn't
been opened first!");
+ }
+ return session;
+ }
+
+ public synchronized void save()
+ {
+ getOpenedSessionOrFail().save();
+ }
+
+ public <T> boolean delete(T toDelete,
org.gatein.wsrp.jcr.StoresByPathManager<T> manager)
+ {
+ Class<? extends Object> modelClass = toDelete.getClass();
+ Class<? extends BaseMapping> baseMappingClass =
modelToMapping.get(modelClass);
+ if (baseMappingClass == null)
+ {
+ throw new IllegalArgumentException("Cannot find a mapping class for "
+ modelClass.getName());
+ }
+
+ ChromatticSession session = getSession();
+
+ Object old = session.findByPath(baseMappingClass, manager.getChildPath(toDelete));
+
+ if (old != null)
+ {
+ session.remove(old);
+ closeSession(true);
+ return true;
+ }
+ else
+ {
+ closeSession(false);
+ return false;
+ }
+ }
+}
Added:
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/consumers-configuration-nodetypes.xml
===================================================================
---
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/consumers-configuration-nodetypes.xml
(rev 0)
+++
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/consumers-configuration-nodetypes.xml 2011-04-21
08:37:10 UTC (rev 6313)
@@ -0,0 +1,191 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2011, 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="false">
+ <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="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="timeout" requiredType="Integer"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="enablewss"
requiredType="boolean" autoCreated="false"
mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <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="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="value" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <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="false">
+ <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
Added:
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/migration-nodetypes.xml
===================================================================
---
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/migration-nodetypes.xml
(rev 0)
+++
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/migration-nodetypes.xml 2011-04-21
08:37:10 UTC (rev 6313)
@@ -0,0 +1,114 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2011, 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:exportinfos" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*"
defaultPrimaryType="wsrp:exportinfo" autoCreated="false"
mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:exportinfo</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:exportinfo" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="exporttime" requiredType="Long"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="expirationtime"
requiredType="Long" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="exportcontext"
requiredType="Binary" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*"
defaultPrimaryType="wsrp:exportedstate" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:exportedstate</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ <childNodeDefinition name="*"
defaultPrimaryType="wsrp:exporterror" autoCreated="false"
+ mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>wsrp:exporterror</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:exportedstate" isMixin="false"
primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <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>
+ </nodeType>
+
+ <nodeType name="wsrp:exporterror" isMixin="false"
primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="errorcode"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="handles" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </nodeType>
+</nodeTypes>
\ No newline at end of file
Added:
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/producer-configuration-nodetypes.xml
===================================================================
---
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/producer-configuration-nodetypes.xml
(rev 0)
+++
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/producer-configuration-nodetypes.xml 2011-04-21
08:37:10 UTC (rev 6313)
@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2011, 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="false">
+ <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="policyclassname"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="validatorclassname"
requiredType="String" 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="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="status" requiredType="String"
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="false">
+ <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
Added:
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/producer-pc-nodetypes.xml
===================================================================
---
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/producer-pc-nodetypes.xml
(rev 0)
+++
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/producer-pc-nodetypes.xml 2011-04-21
08:37:10 UTC (rev 6313)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2011, 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="pc:producerstates" isMixin="false"
hasOrderableChildNodes="false">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions/>
+ <childNodeDefinitions>
+ <childNodeDefinition name="*" defaultPrimaryType=""
autoCreated="false" mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>pc:statecontext</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="pc:statecontext" isMixin="false"
hasOrderableChildNodes="false">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="id" requiredType="String"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions>
+ <childNodeDefinition name="state"
defaultPrimaryType="pc:state" autoCreated="true"
mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+ <requiredPrimaryType>pc:state</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="pc:state" isMixin="false"
hasOrderableChildNodes="false">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="pc:portletid"
requiredType="String" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="pc:terminationtime"
requiredType="Date" autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="*" requiredType="undefined"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ <childNodeDefinitions/>
+ </nodeType>
+
+</nodeTypes>
Added:
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/producer-registrations-nodetypes.xml
===================================================================
---
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/producer-registrations-nodetypes.xml
(rev 0)
+++
components/wsrp/trunk/jcr-impl/src/main/resources/conf/nodetypes/producer-registrations-nodetypes.xml 2011-04-21
08:37:10 UTC (rev 6313)
@@ -0,0 +1,218 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+
+<!--
+ ~ JBoss, a division of Red Hat
+ ~ Copyright 2011, 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="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ <propertyDefinition name="registrationhandle"
requiredType="String" 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>
+ <childNodeDefinition name="*"
defaultPrimaryType="wsrp:portletcontext" autoCreated="false"
mandatory="false"
+ onParentVersion="COPY"
protected="false" sameNameSiblings="false">
+ <requiredPrimaryTypes>
+
<requiredPrimaryType>wsrp:portletcontext</requiredPrimaryType>
+ </requiredPrimaryTypes>
+ </childNodeDefinition>
+ </childNodeDefinitions>
+ </nodeType>
+
+ <nodeType name="wsrp:portletcontext" isMixin="false"
hasOrderableChildNodes="false" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <propertyDefinitions>
+ <propertyDefinition name="id" 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>
+ </nodeType>
+
+ <nodeType name="wsrp:registrationproperties" isMixin="false"
hasOrderableChildNodes="true" primaryItemName="">
+ <supertypes>
+ <supertype>nt:base</supertype>
+ <supertype>mix:referenceable</supertype>
+ </supertypes>
+ <!-- residual properties so that we can store an arbritrary number of
registration properties -->
+ <propertyDefinitions>
+ <propertyDefinition name="*" requiredType="undefined"
autoCreated="false" mandatory="false"
+ onParentVersion="COPY" protected="false"
multiple="false">
+ <valueConstraints/>
+ </propertyDefinition>
+ </propertyDefinitions>
+ </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="userprofiledata"
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
Added:
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/consumer/registry/JCRConsumerRegistryTestCase.java
===================================================================
---
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/consumer/registry/JCRConsumerRegistryTestCase.java
(rev 0)
+++
components/wsrp/trunk/jcr-impl/src/test/java/org/gatein/wsrp/consumer/registry/JCRConsumerRegistryTestCase.java 2011-04-21
08:37:10 UTC (rev 6313)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, a division of Red Hat
+ * Copyright 2010, 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.wsrp.consumer.registry;
+
+import org.chromattic.api.ChromatticBuilder;
+import org.gatein.pc.federation.impl.FederatingPortletInvokerService;
+import org.gatein.wsrp.jcr.BaseChromatticPersister;
+
+/**
+ * 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 JCRConsumerRegistryTestCase extends ConsumerRegistryTestCase
+{
+ /**
+ * Incremented for each test so that we can append it to the workspace name and work
with a "clean" DB for each
+ * test.
+ */
+
+ @Override
+ protected void setUp() throws Exception
+ {
+ String workspaceName = "/wsrp-jcr-test" + Math.round(Math.abs(100000 *
Math.random()));
+ BaseChromatticPersister persister = new BaseChromatticPersister(workspaceName)
+ {
+ @Override
+ protected void setBuilderOptions(ChromatticBuilder builder)
+ {
+ builder.setOptionValue(ChromatticBuilder.ROOT_NODE_PATH, workspaceName);
+ builder.setOptionValue(ChromatticBuilder.ROOT_NODE_TYPE,
"nt:unstructured");
+ builder.setOptionValue(ChromatticBuilder.CREATE_ROOT_NODE, true);
+ }
+ };
+ persister.initializeBuilderFor(JCRConsumerRegistry.mappingClasses);
+ registry = new JCRConsumerRegistry(persister, false);
+ registry.setFederatingPortletInvoker(new FederatingPortletInvokerService());
+ }
+
+ @Override
+ public void testStoppingShouldntStartConsumers() throws Exception
+ {
+ // override to bypass this test as I couldn't find a way to make it work
properly (i.e. how to inject a Mock
+ // into the registry to check that start is only called once)
+ }
+}
Modified: components/wsrp/trunk/pom.xml
===================================================================
--- components/wsrp/trunk/pom.xml 2011-04-21 08:06:47 UTC (rev 6312)
+++ components/wsrp/trunk/pom.xml 2011-04-21 08:37:10 UTC (rev 6313)
@@ -87,6 +87,12 @@
</dependency>
<dependency>
<groupId>org.gatein.wsrp</groupId>
+ <artifactId>wsrp-consumer</artifactId>
+ <type>test-jar</type>
+ <version>${project.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.gatein.wsrp</groupId>
<artifactId>wsrp-producer-lib</artifactId>
<version>${project.version}</version>
</dependency>
@@ -195,6 +201,20 @@
<scope>compile</scope>
</dependency>
+ <!-- For JCR tests-->
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.core</artifactId>
+ <version>${org.chromattic.version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.chromattic</groupId>
+ <artifactId>chromattic.exo</artifactId>
+ <version>${org.chromattic.version}</version>
+ <scope>test</scope>
+ </dependency>
+
<!--
TODO: Need to investigate this plugin to speed up tests
<dependency>