jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ju...@apache.org
Subject svn commit: r396173 - in /jackrabbit/trunk/jackrabbit: ./ src/main/java/org/apache/jackrabbit/core/ src/main/java/org/apache/jackrabbit/core/nodetype/ src/test/java/org/apache/jackrabbit/core/nodetype/xml/
Date Sat, 22 Apr 2006 22:41:12 GMT
Author: jukka
Date: Sat Apr 22 15:41:08 2006
New Revision: 396173

URL: http://svn.apache.org/viewcvs?rev=396173&view=rev
Log:
JCR-349: Register new node type namespaces automatically. Applied the patch contributed by
David Kennedy with minor cleanups and modifications.

Added:
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/test_ns_cnd_nodetypes.cnd
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/test_ns_xml_nodetypes.xml
  (with props)
Modified:
    jackrabbit/trunk/jackrabbit/project.xml
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
    jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
    jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java

Modified: jackrabbit/trunk/jackrabbit/project.xml
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/project.xml?rev=396173&r1=396172&r2=396173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/project.xml (original)
+++ jackrabbit/trunk/jackrabbit/project.xml Sat Apr 22 15:41:08 2006
@@ -542,6 +542,7 @@
                     <includes>
                         <include>**/*.xml</include>
                         <include>**/*.txt</include>
+                        <include>**/*.cnd</include>
                     </includes>
                 </resource>
             </resources>

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SessionImpl.java?rev=396173&r1=396172&r2=396173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/SessionImpl.java
Sat Apr 22 15:41:08 2006
@@ -236,7 +236,7 @@
         }
         this.subject = subject;
         nsMappings = new LocalNamespaceMappings(rep.getNamespaceRegistry());
-        ntMgr = new NodeTypeManagerImpl(rep.getNodeTypeRegistry(), getNamespaceResolver());
+        ntMgr = new NodeTypeManagerImpl(rep.getNodeTypeRegistry(), rep.getNamespaceRegistry(),
getNamespaceResolver());
         String wspName = wspConfig.getName();
         wsp = createWorkspaceInstance(wspConfig,
                 rep.getWorkspaceStateManager(wspName), rep, this);

Modified: jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java?rev=396173&r1=396172&r2=396173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/main/java/org/apache/jackrabbit/core/nodetype/NodeTypeManagerImpl.java
Sat Apr 22 15:41:08 2006
@@ -32,7 +32,10 @@
 import org.xml.sax.InputSource;
 import org.xml.sax.SAXException;
 
+import javax.jcr.NamespaceException;
+import javax.jcr.NamespaceRegistry;
 import javax.jcr.RepositoryException;
+import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
 import javax.jcr.nodetype.NodeType;
 import javax.jcr.nodetype.NodeTypeIterator;
@@ -44,10 +47,12 @@
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
+import java.util.Enumeration;
 import java.util.HashSet;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
+import java.util.Properties;
 import java.util.Set;
 
 /**
@@ -68,6 +73,13 @@
     private final NodeTypeRegistry ntReg;
 
     /**
+     * The persistent namespace registry where any new namespaces are
+     * automatically registered when new node type definition files are
+     * read.
+     */
+    private final NamespaceRegistry nsReg;
+
+    /**
      * The root node definition.
      */
     private final NodeDefinitionImpl rootNodeDef;
@@ -101,10 +113,12 @@
      * @param ntReg      node type registry
      * @param nsResolver namespace resolver
      */
-    public NodeTypeManagerImpl(NodeTypeRegistry ntReg,
-                               NamespaceResolver nsResolver) {
+    public NodeTypeManagerImpl(
+            NodeTypeRegistry ntReg, NamespaceRegistry nsReg,
+            NamespaceResolver nsResolver) {
         this.nsResolver = nsResolver;
         this.ntReg = ntReg;
+        this.nsReg = nsReg;
         this.ntReg.addListener(this);
 
         // setup caches with soft references to node type
@@ -327,18 +341,70 @@
     }
 
     /**
+     * Registers a single namespace bypassing registration if the namespace
+     * is already registered. A unique prefix is automatically genenerated
+     * if the given prefix is already mapped to another namespace.
+     *
+     * @param prefix The namespace prefix
+     * @param uri The namespace URI
+     * @throws RepositoryException if a repository error occurs
+     */
+    protected void registerNamespace(String prefix, String uri)
+            throws RepositoryException {
+        try {
+            // Check if the uri is already registered
+            nsReg.getPrefix(uri);
+        } catch (NamespaceException e1) {
+            // The uri is not in the registry. The prefix may be with another
+            // uri or it may not be (the ideal scenario).  In either case,
+            // attempt to register it and add a incrementing sequence number
+            // to the prefix until it no longer conflicts with any existing
+            // prefix.
+            String original = prefix;
+            for (int i = 2; true; i++) {
+                try {
+                    // Attempt to register the prefix and uri... if the prefix
+                    // is already registered an exception will be thrown due
+                    // to an attempt to remap.
+                    nsReg.registerNamespace(prefix, uri);
+                    return;
+                } catch (NamespaceException e2) {
+                    prefix = original + i;
+                }
+            }
+        }
+    }
+
+    /**
      * Registers the node types defined in the given XML stream.  This
      * is a trivial implementation that just invokes the existing
      * {@link NodeTypeReader} and {@link NodeTypeRegistry} methods and
-     * heuristically creates the returned node type array.
+     * heuristically creates the returned node type array.  It will also
+     * register any namespaces defined in the input source that have not
+     * already been registered.
      *
      * {@inheritDoc}
      */
     public NodeType[] registerNodeTypes(InputSource in)
             throws SAXException, RepositoryException {
         try {
-            NodeTypeDef[] defs = NodeTypeReader.read(in.getByteStream());
+            NodeTypeReader ntr = new NodeTypeReader(in.getByteStream());
+
+            Properties namespaces = ntr.getNamespaces();
+            if (namespaces != null) {
+                Enumeration prefixes = namespaces.propertyNames();
+                while (prefixes.hasMoreElements()) {
+                    String prefix = (String) prefixes.nextElement();
+                    registerNamespace(prefix, namespaces.getProperty(prefix));
+                }
+            }
+
+            NodeTypeDef[] defs = ntr.getNodeTypeDefs();
             return registerNodeTypes(Arrays.asList(defs));
+        } catch (IllegalNameException e) {
+            throw new RepositoryException("Illegal JCR name syntax", e);
+        } catch (UnknownPrefixException e) {
+            throw new RepositoryException("Unknown namespace prefix", e);
         } catch (InvalidNodeTypeDefException e) {
             throw new RepositoryException("Invalid node type definition", e);
         } catch (IOException e) {
@@ -348,23 +414,38 @@
 
     private static final String APPLICATION_XML = "application/xml";
 
-    /** {@inheritDoc} */
+    /**
+     * Registers the node types defined in the given input stream depending
+     * on the content type specified for the stream. This will also register
+     * any namespaces identified in the input stream if they have not already
+     * been registered.
+     *
+     * {@inheritDoc}
+     */
     public NodeType[] registerNodeTypes(InputStream in, String contentType)
             throws IOException, RepositoryException {
         try {
-            if (contentType.equalsIgnoreCase(JackrabbitNodeTypeManager.TEXT_XML)
-                    || contentType.equalsIgnoreCase(APPLICATION_XML)) {
-                return registerNodeTypes(new InputSource(in));
-            } else if (contentType.equalsIgnoreCase(
-                    JackrabbitNodeTypeManager.TEXT_X_JCR_CND)) {
-                NamespaceMapping mapping = new NamespaceMapping(nsResolver);
-                CompactNodeTypeDefReader reader = new CompactNodeTypeDefReader(
-                        new InputStreamReader(in), "cnd input stream", mapping);
-                return registerNodeTypes(reader.getNodeTypeDefs());
-            } else {
-                throw new UnsupportedOperationException(
-                        "Unsupported content type: " + contentType);
-            }
+          if (contentType.equalsIgnoreCase(TEXT_XML)
+                  || contentType.equalsIgnoreCase(APPLICATION_XML)) {
+              return registerNodeTypes(new InputSource(in));
+          } else if (contentType.equalsIgnoreCase(TEXT_X_JCR_CND)) {
+              NamespaceMapping mapping = new NamespaceMapping(nsResolver);
+              CompactNodeTypeDefReader reader = new CompactNodeTypeDefReader(
+                      new InputStreamReader(in), "cnd input stream", mapping);
+
+              Map nsMap = mapping.getPrefixToURIMapping();
+              Iterator iterator = nsMap.entrySet().iterator();
+              while (iterator.hasNext()) {
+                  Map.Entry entry = (Map.Entry) iterator.next();
+                  registerNamespace(
+                          (String) entry.getKey(), (String) entry.getValue());
+              }
+
+              return registerNodeTypes(reader.getNodeTypeDefs());
+          } else {
+              throw new UnsupportedRepositoryOperationException(
+                      "Unsupported content type: " + contentType);
+          }
         } catch (InvalidNodeTypeDefException e) {
             throw new RepositoryException("Invalid node type definition", e);
         } catch (SAXException e) {

Modified: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java?rev=396173&r1=396172&r2=396173&view=diff
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java
(original)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/TestAll.java
Sat Apr 22 15:41:08 2006
@@ -17,6 +17,9 @@
 
 import junit.framework.AssertionFailedError;
 import junit.framework.TestCase;
+
+import org.apache.jackrabbit.api.JackrabbitNodeTypeManager;
+import org.apache.jackrabbit.core.TestRepository;
 import org.apache.jackrabbit.core.nodetype.InvalidNodeTypeDefException;
 import org.apache.jackrabbit.core.nodetype.NodeDef;
 import org.apache.jackrabbit.core.nodetype.NodeTypeDef;
@@ -25,9 +28,11 @@
 import org.apache.jackrabbit.name.NamespaceResolver;
 import org.apache.jackrabbit.name.QName;
 
+import javax.jcr.NamespaceException;
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.PropertyType;
 import javax.jcr.RepositoryException;
+import javax.jcr.Session;
 import javax.jcr.version.OnParentVersionAction;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
@@ -47,6 +52,14 @@
     private static final String TEST_NODETYPES =
         "org/apache/jackrabbit/core/nodetype/xml/test_nodetypes.xml";
 
+    /** Name of the xml nodetype file for import and namespace registration. */
+    private static final String TEST_NS_XML_NODETYPES =
+        "test_ns_xml_nodetypes.xml";
+
+    /** Name of the cnd nodetype file for import and namespace registration. */
+    private static final String TEST_NS_CND_NODETYPES =
+        "test_ns_cnd_nodetypes.cnd";
+
     /** Test node types definitions. */
     private NodeTypeDef[] types;
 
@@ -207,6 +220,51 @@
                 10, def.getPropertyDefs().length);
         PropDef pdef = getProperty("itemNodeType", null);
         assertTrue("itemNodeType wildcard property", pdef.definesResidual());
+    }
+
+    /** Test for namespace registration on node type import. */
+    public void testImportXMLNodeTypes() throws Exception {
+        Session session = TestRepository.getInstance().login();
+        try {
+            session.getNamespacePrefix("test-namespace2");
+            // Ignore test case, node type and namespace already registered
+        } catch (NamespaceException e1) {
+            // Namespace testns2 not yet registered
+            JackrabbitNodeTypeManager ntm = (JackrabbitNodeTypeManager)
+                session.getWorkspace().getNodeTypeManager();
+            ntm.registerNodeTypes(
+                    TestAll.class.getResourceAsStream(TEST_NS_XML_NODETYPES),
+                    JackrabbitNodeTypeManager.TEXT_XML);
+            try {
+                session.getNamespacePrefix("test-namespace2");
+            } catch (NamespaceException e2) {
+                fail("xml test2 namespace not registered");
+            }
+        } finally {
+            session.logout();
+        }
+    }
+
+    /** Test for namespace registration on node type import. */
+    public void testImportCNDNodeTypes() throws Exception {
+        Session session = TestRepository.getInstance().login();
+        try {
+            session.getNamespacePrefix("test-namespace3");
+            // Ignore test case, node type and namespace already registered
+        } catch (NamespaceException e1) {
+            JackrabbitNodeTypeManager ntm = (JackrabbitNodeTypeManager)
+                session.getWorkspace().getNodeTypeManager();
+            ntm.registerNodeTypes(
+                    TestAll.class.getResourceAsStream(TEST_NS_CND_NODETYPES),
+                    JackrabbitNodeTypeManager.TEXT_X_JCR_CND);
+            try {
+                session.getNamespacePrefix("test-namespace3");
+            } catch (NamespaceException e2) {
+                fail("cnd test3 namespace not registered");
+            }
+        } finally {
+            session.logout();
+        }
     }
 
     /** Test for the empty item definition. */

Added: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/test_ns_cnd_nodetypes.cnd
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/test_ns_cnd_nodetypes.cnd?rev=396173&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/test_ns_cnd_nodetypes.cnd
(added)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/test_ns_cnd_nodetypes.cnd
Sat Apr 22 15:41:08 2006
@@ -0,0 +1,14 @@
+<testns3 = "test-namespace3">
+<testns4 = "test-namespace4">
+
+[testns3:emptyNodeType] > nt:base 
+
+[testns4:mixinNodeType]
+  mixin
+
+[testns3:orderableNodeType] > nt:base
+  orderable
+
+[testns4:itemNodeType] > nt:base
+  - testns4:myDouble (double) ignore
+  - testns4:myBool (boolean) protected

Added: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/test_ns_xml_nodetypes.xml
URL: http://svn.apache.org/viewcvs/jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/test_ns_xml_nodetypes.xml?rev=396173&view=auto
==============================================================================
--- jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/test_ns_xml_nodetypes.xml
(added)
+++ jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/test_ns_xml_nodetypes.xml
Sat Apr 22 15:41:08 2006
@@ -0,0 +1,193 @@
+<?xml version="1.0"?>
+<!--
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  The ASF licenses this file to You
+ * under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+ -->
+<nodeTypes xmlns:testns1="test-namespace1"
+           xmlns:testns2="test-namespace2"
+           xmlns:nt="http://www.jcp.org/jcr/nt/1.0">
+
+  <nodeType name="testns2:emptyNodeType"
+            isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>nt:base</supertype>
+    </supertypes>
+  </nodeType>
+
+  <nodeType name="testns1:mixinNodeType"
+            isMixin="true" hasOrderableChildNodes="false" primaryItemName=""/>
+
+  <nodeType name="testns1:orderedNodeType"
+            isMixin="false" hasOrderableChildNodes="true" primaryItemName="">
+        <supertypes>
+          <supertype>nt:base</supertype>
+        </supertypes>
+  </nodeType>
+            
+
+  <nodeType name="testns2:itemNodeType"
+            isMixin="false" hasOrderableChildNodes="false"
+            primaryItemName="testns1:emptyItem">
+    <supertypes>
+      <supertype>nt:base</supertype>
+    </supertypes>
+    <propertyDefinition name="*"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="false" multiple="false"/>
+    <propertyDefinition name="testns1:emptyItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="false" multiple="false"/>
+    <propertyDefinition name="testns1:autoCreatedItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="false" multiple="false"/>
+    <propertyDefinition name="testns1:mandatoryItem"
+                 requiredType="undefined" autoCreated="false" mandatory="true"
+                 onParentVersion="IGNORE" protected="false" multiple="false"/>
+    <propertyDefinition name="testns1:copyItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
+                 onParentVersion="COPY" protected="false" multiple="false"/>
+    <propertyDefinition name="testns1:versionItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
+                 onParentVersion="VERSION" protected="false" multiple="false"/>
+    <propertyDefinition name="testns1:initializeItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
+                 onParentVersion="INITIALIZE" protected="false" multiple="false"/>
+    <propertyDefinition name="testns1:computeItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
+                 onParentVersion="COMPUTE" protected="false" multiple="false"/>
+    <propertyDefinition name="testns1:abortItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
+                 onParentVersion="ABORT" protected="false" multiple="false"/>
+    <propertyDefinition name="testns1:protectedItem"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="true" multiple="false"/>
+  </nodeType>
+
+  <nodeType name="testns1:propertyNodeType"
+            isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>nt:base</supertype>
+    </supertypes>
+    <propertyDefinition name="testns1:emptyProperty"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="false" multiple="false"/>
+    <propertyDefinition name="testns1:binaryProperty"
+                 requiredType="Binary" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>[0,)</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="testns1:booleanProperty"
+                 requiredType="Boolean" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>true</valueConstraint>
+        <valueConstraint>false</valueConstraint>
+      </valueConstraints>
+      <defaultValues>
+        <defaultValue>true</defaultValue>
+      </defaultValues>
+    </propertyDefinition>
+    <propertyDefinition name="testns1:dateProperty"
+                 requiredType="Date" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>
+          [2005-01-01T00:00:00.000Z,2006-01-01T00:00:00.000Z)
+        </valueConstraint>
+      </valueConstraints>
+      <defaultValues>
+        <defaultValue>2005-01-01T00:00:00.000Z</defaultValue>
+      </defaultValues>
+    </propertyDefinition>
+    <propertyDefinition name="testns1:doubleProperty"
+                 requiredType="Double" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>[,0.0)</valueConstraint>
+        <valueConstraint>(1.0,2.0)</valueConstraint>
+        <valueConstraint>(3.0,]</valueConstraint>
+      </valueConstraints>
+      <defaultValues>
+        <defaultValue>1.5</defaultValue>
+      </defaultValues>
+    </propertyDefinition>
+    <propertyDefinition name="testns1:longProperty"
+                 requiredType="Long" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>(-10,0]</valueConstraint>
+        <valueConstraint>[1,2]</valueConstraint>
+        <valueConstraint>[10,100)</valueConstraint>
+      </valueConstraints>
+      <defaultValues>
+        <defaultValue>25</defaultValue>
+      </defaultValues>
+    </propertyDefinition>
+    <propertyDefinition name="testns1:nameProperty"
+                 requiredType="Name" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>testns1:testName</valueConstraint>
+      </valueConstraints>
+      <defaultValues>
+        <defaultValue>testns1:testName</defaultValue>
+      </defaultValues>
+    </propertyDefinition>
+    <propertyDefinition name="testns1:pathProperty"
+                 requiredType="Path" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="false" multiple="false">
+      <valueConstraints>
+        <valueConstraint>/testns1:testPath</valueConstraint>
+      </valueConstraints>
+    </propertyDefinition>
+    <propertyDefinition name="testns1:stringProperty"
+                 requiredType="String" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="false" multiple="true">
+      <valueConstraints>
+        <valueConstraint>bananas?</valueConstraint>
+      </valueConstraints>
+      <defaultValues>
+        <defaultValue>banana</defaultValue>
+        <defaultValue>bananas</defaultValue>
+      </defaultValues>
+    </propertyDefinition>
+    <propertyDefinition name="testns1:multipleProperty"
+                 requiredType="undefined" autoCreated="false" mandatory="false"
+                 onParentVersion="IGNORE" protected="false" multiple="true"/>
+  </nodeType>
+
+  <nodeType name="testns1:childNodeType"
+            isMixin="false" hasOrderableChildNodes="false" primaryItemName="">
+    <supertypes>
+      <supertype>nt:base</supertype>
+    </supertypes>
+    <childNodeDefinition name="testns1:emptyNode"
+                  defaultPrimaryType="" sameNameSiblings="false"
+                  autoCreated="false" mandatory="false"
+                  onParentVersion="IGNORE" protected="false"/>
+    <childNodeDefinition name="testns1:siblingNode"
+                  defaultPrimaryType="" sameNameSiblings="true"
+                  autoCreated="false" mandatory="false"
+                  onParentVersion="IGNORE" protected="false"/>
+    <childNodeDefinition name="testns1:defaultTypeNode"
+                  defaultPrimaryType="testns1:propertyNodeType" sameNameSiblings="false"
+                  autoCreated="false" mandatory="false"
+                  onParentVersion="IGNORE" protected="false"/>
+  </nodeType>
+
+</nodeTypes>

Propchange: jackrabbit/trunk/jackrabbit/src/test/java/org/apache/jackrabbit/core/nodetype/xml/test_ns_xml_nodetypes.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message