You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by st...@apache.org on 2005/04/28 18:21:09 UTC

svn commit: r165156 - in /incubator/jackrabbit/trunk: ./ src/java/org/apache/jackrabbit/core/ src/java/org/apache/jackrabbit/core/nodetype/ src/java/org/apache/jackrabbit/core/query/ src/java/org/apache/jackrabbit/core/state/obj/ src/java/org/apache/jackrabbit/core/value/ src/java/org/apache/jackrabbit/core/xml/ src/test/org/apache/jackrabbit/test/api/nodetype/spec/

Author: stefan
Date: Thu Apr 28 09:21:06 2005
New Revision: 165156

URL: http://svn.apache.org/viewcvs?rev=165156&view=rev
Log:
port to jcr api v0.16.4.1

Modified:
    incubator/jackrabbit/trunk/project.xml
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/repository.properties
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/DocViewSAXEventGenerator.java
    incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewSAXEventGenerator.java
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-childNodeDefinition.txt
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-nodeType.txt
    incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-propertyDefinition.txt

Modified: incubator/jackrabbit/trunk/project.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/project.xml?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/project.xml (original)
+++ incubator/jackrabbit/trunk/project.xml Thu Apr 28 09:21:06 2005
@@ -21,7 +21,7 @@
   <pomVersion>3</pomVersion>
   <id>jackrabbit</id>
   <name>Jackrabbit</name>
-  <currentVersion>0.16.4-dev</currentVersion>
+  <currentVersion>0.16.4.1-dev</currentVersion>
   <organization>
     <name>The Apache Software Foundation</name>
     <url>http://incubator.apache.org/projects/jackrabbit.html</url>
@@ -288,8 +288,8 @@
     <dependency>
       <groupId>jsr170</groupId>
       <artifactId>jcr</artifactId>
-      <version>0.16.4</version>
-      <url>http://www.day.com/maven/jsr170/jars/jcr-0.16.4.jar</url>
+      <version>0.16.4.1</version>
+      <url>http://www.day.com/maven/jsr170/jars/jcr-0.16.4.1.jar</url>
     </dependency>
     <dependency>
       <id>log4j</id>

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/ItemImpl.java Thu Apr 28 09:21:06 2005
@@ -473,7 +473,8 @@
                 // check WRITE permission
                 ItemId id = itemState.getId();
                 if (!accessMgr.isGranted(id, AccessManager.WRITE)) {
-                    String msg = itemMgr.safeGetJCRPath(id) + ": not allowed to modify item";
+                    String msg = itemMgr.safeGetJCRPath(id)
+                            + ": not allowed to modify item";
                     log.debug(msg);
                     throw new AccessDeniedException(msg);
                 }
@@ -504,7 +505,8 @@
                              * the transient node's primary node type does not
                              * satisfy the 'required primary types' constraint
                              */
-                            String msg = node.safeGetJCRPath() + " must be of node type " + ntReq.getName();
+                            String msg = node.safeGetJCRPath()
+                                    + " must be of node type " + ntReq.getName();
                             log.debug(msg);
                             throw new ConstraintViolationException(msg);
                         }
@@ -515,8 +517,18 @@
                 PropDef[] pda = ent.getMandatoryPropDefs();
                 for (int i = 0; i < pda.length; i++) {
                     PropDef pd = pda[i];
+                    if (pd.getDeclaringNodeType().equals(MIX_VERSIONABLE)) {
+                        /**
+                         * todo FIXME workaround for mix:versionable:
+                         * the mandatory properties are initialized at a
+                         * later stage and might not exist yet
+                         */
+                        continue;
+                    }
                     if (!nodeState.hasPropertyEntry(pd.getName())) {
-                        String msg = node.safeGetJCRPath() + ": mandatory property " + pd.getName() + " does not exist";
+                        String msg = node.safeGetJCRPath()
+                                + ": mandatory property " + pd.getName()
+                                + " does not exist";
                         log.debug(msg);
                         throw new ConstraintViolationException(msg);
                     }
@@ -526,7 +538,9 @@
                 for (int i = 0; i < cnda.length; i++) {
                     NodeDef cnd = cnda[i];
                     if (!nodeState.hasChildNodeEntry(cnd.getName())) {
-                        String msg = node.safeGetJCRPath() + ": mandatory child node " + cnd.getName() + " does not exist";
+                        String msg = node.safeGetJCRPath()
+                                + ": mandatory child node " + cnd.getName()
+                                + " does not exist";
                         log.debug(msg);
                         throw new ConstraintViolationException(msg);
                     }
@@ -536,7 +550,8 @@
                 PropertyState propState = (PropertyState) itemState;
                 ItemId propId = propState.getId();
                 PropertyImpl prop = (PropertyImpl) itemMgr.getItem(propId);
-                PropertyDefinitionImpl def = (PropertyDefinitionImpl) prop.getDefinition();
+                PropertyDefinitionImpl def =
+                        (PropertyDefinitionImpl) prop.getDefinition();
 
                 /**
                  * check value constraints
@@ -616,7 +631,8 @@
             ItemId id = itemState.getId();
             // check WRITE permission
             if (!accessMgr.isGranted(id, AccessManager.REMOVE)) {
-                String msg = itemMgr.safeGetJCRPath(id) + ": not allowed to remove item";
+                String msg = itemMgr.safeGetJCRPath(id)
+                        + ": not allowed to remove item";
                 log.debug(msg);
                 throw new AccessDeniedException(msg);
             }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NamespaceRegistryImpl.java Thu Apr 28 09:21:06 2005
@@ -25,6 +25,7 @@
 import javax.jcr.NamespaceRegistry;
 import javax.jcr.RepositoryException;
 import javax.jcr.UnsupportedRepositoryOperationException;
+import javax.jcr.AccessDeniedException;
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.util.HashMap;
@@ -200,7 +201,7 @@
      */
     public void registerNamespace(String prefix, String uri)
             throws NamespaceException, UnsupportedRepositoryOperationException,
-            RepositoryException {
+            AccessDeniedException, RepositoryException {
         if (prefix == null || uri == null) {
             throw new IllegalArgumentException("prefix/uri can not be null");
         }
@@ -261,7 +262,7 @@
      */
     public void unregisterNamespace(String prefix)
             throws NamespaceException, UnsupportedRepositoryOperationException,
-            RepositoryException {
+            AccessDeniedException, RepositoryException {
         if (reservedPrefixes.contains(prefix)) {
             throw new NamespaceException("reserved prefix: " + prefix);
         }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/NodeImpl.java Thu Apr 28 09:21:06 2005
@@ -35,8 +35,9 @@
 import org.apache.jackrabbit.core.state.PropertyState;
 import org.apache.jackrabbit.core.util.ChildrenCollectorFilter;
 import org.apache.jackrabbit.core.util.IteratorHelper;
-import org.apache.jackrabbit.core.value.ValueHelper;
 import org.apache.jackrabbit.core.util.uuid.UUID;
+import org.apache.jackrabbit.core.value.InternalValue;
+import org.apache.jackrabbit.core.value.ValueHelper;
 import org.apache.jackrabbit.core.version.GenericVersionSelector;
 import org.apache.jackrabbit.core.version.InternalFreeze;
 import org.apache.jackrabbit.core.version.InternalFrozenNode;
@@ -45,8 +46,6 @@
 import org.apache.jackrabbit.core.version.VersionHistoryImpl;
 import org.apache.jackrabbit.core.version.VersionImpl;
 import org.apache.jackrabbit.core.version.VersionSelector;
-import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.core.value.ValueHelper;
 import org.apache.log4j.Logger;
 
 import javax.jcr.AccessDeniedException;
@@ -1119,8 +1118,7 @@
             // make sure no references exist
             PropertyIterator iter = getReferences();
             if (iter.hasNext()) {
-                throw new ConstraintViolationException(
-                        mixinName + " can not be removed: the node is being referenced"
+                throw new ConstraintViolationException(mixinName + " can not be removed: the node is being referenced"
                         + " through at least one property of type REFERENCE");
             }
         }
@@ -1230,10 +1228,9 @@
      * Note that certain checks are performed by the respective
      * <code>Property.setValue()</code> methods.
      *
-     * @throws VersionException if this node is not checked-out
-     * @throws LockException if this node is locked by somebody else
+     * @throws VersionException    if this node is not checked-out
+     * @throws LockException       if this node is locked by somebody else
      * @throws RepositoryException if another error occurs
-     *
      * @see javax.jcr.Node#setProperty
      */
     protected void checkSetProperty()
@@ -1740,6 +1737,8 @@
             throws UnsupportedRepositoryOperationException, VersionException,
             ConstraintViolationException, ItemNotFoundException, LockException,
             RepositoryException {
+        // check state of this instance
+        sanityCheck();
 
         if (!nodeType.hasOrderableChildNodes()) {
             throw new UnsupportedRepositoryOperationException("child node ordering not supported on node " + safeGetJCRPath());
@@ -1747,7 +1746,8 @@
 
         // check arguments
         if (srcName.equals(destName)) {
-            throw new ConstraintViolationException("source and destination have to be different");
+            // there's nothing to do
+            return;
         }
 
         Path.PathElement insertName;
@@ -1784,22 +1784,26 @@
 
         // check existence
         if (!hasNode(srcName)) {
-            throw new ItemNotFoundException(safeGetJCRPath() + " has no child node with name " + srcName);
+            throw new ItemNotFoundException(safeGetJCRPath()
+                    + " has no child node with name " + srcName);
         }
         if (destName != null && !hasNode(destName)) {
-            throw new ItemNotFoundException(safeGetJCRPath() + " has no child node with name " + destName);
+            throw new ItemNotFoundException(safeGetJCRPath()
+                    + " has no child node with name " + destName);
         }
 
         // make sure this node is checked-out
         if (!internalIsCheckedOut()) {
-            String msg = safeGetJCRPath() + ": cannot change child node ordering of a checked-in node";
+            String msg = safeGetJCRPath()
+                    + ": cannot change child node ordering of a checked-in node";
             log.debug(msg);
             throw new VersionException(msg);
         }
 
         // check protected flag
         if (definition.isProtected()) {
-            String msg = safeGetJCRPath() + ": cannot change child node ordering of a protected node";
+            String msg = safeGetJCRPath()
+                    + ": cannot change child node ordering of a protected node";
             log.debug(msg);
             throw new ConstraintViolationException(msg);
         }
@@ -3361,9 +3365,8 @@
      * @throws LockException
      * @throws RepositoryException
      */
-    private void internalMerge(
-            SessionImpl srcSession, List failedIds,
-            boolean bestEffort, boolean removeExisting, boolean replaceExisting)
+    private void internalMerge(SessionImpl srcSession, List failedIds,
+                               boolean bestEffort, boolean removeExisting, boolean replaceExisting)
             throws LockException, RepositoryException {
 
         NodeImpl srcNode = doMergeTest(srcSession, failedIds, bestEffort);
@@ -3625,8 +3628,7 @@
                         } else {
                             // since we delete the OPV=Copy children beforehand, all
                             // found nodes must be outside of this tree
-                            throw new ItemExistsException(
-                                    "Unable to restore node, item already exists outside of restored tree: "
+                            throw new ItemExistsException("Unable to restore node, item already exists outside of restored tree: "
                                     + existing.safeGetJCRPath());
                         }
                     } catch (ItemNotFoundException e) {
@@ -3652,8 +3654,7 @@
                     } else {
                         // since we delete the OPV=Copy children beforehand, all
                         // found nodes must be outside of this tree
-                        throw new ItemExistsException(
-                                "Unable to restore node, item already exists outside of restored tree: "
+                        throw new ItemExistsException("Unable to restore node, item already exists outside of restored tree: "
                                 + n.safeGetJCRPath());
                     }
                 } else {

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/SessionImpl.java Thu Apr 28 09:21:06 2005
@@ -47,6 +47,8 @@
 import javax.jcr.Session;
 import javax.jcr.SimpleCredentials;
 import javax.jcr.Workspace;
+import javax.jcr.ValueFactory;
+import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.lock.LockException;
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.nodetype.NoSuchNodeTypeException;
@@ -1137,6 +1139,14 @@
      */
     public Repository getRepository() {
         return rep;
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public ValueFactory getValueFactory() 
+            throws UnsupportedRepositoryOperationException, RepositoryException {
+        return null;  // @todo implement
     }
 
     /**

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/nodetype/builtin_nodetypes.xml Thu Apr 28 09:21:06 2005
@@ -128,7 +128,7 @@
             <supertype>nt:base</supertype>
         </supertypes>
         <propertyDefinition name="jcr:nodeTypeName" requiredType="Name" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
-        <propertyDefinition name="jcr:supertypes" requiredType="Name" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="true"/>
+        <propertyDefinition name="jcr:supertypes" requiredType="Name" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
         <propertyDefinition name="jcr:isMixin" requiredType="Boolean" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDefinition name="jcr:hasOrderableChildNodes" requiredType="Boolean" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDefinition name="jcr:primaryItemName" requiredType="Name" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
@@ -150,9 +150,30 @@
         <propertyDefinition name="jcr:name" requiredType="Name" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDefinition name="jcr:autoCreated" requiredType="Boolean" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDefinition name="jcr:mandatory" requiredType="Boolean" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
-        <propertyDefinition name="jcr:onParentVersion" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
+        <propertyDefinition name="jcr:onParentVersion" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
+            <valueConstraints>
+                <valueConstraint>COPY</valueConstraint>
+                <valueConstraint>VERSION</valueConstraint>
+                <valueConstraint>INITIALIZE</valueConstraint>
+                <valueConstraint>COMPUTE</valueConstraint>
+                <valueConstraint>IGNORE</valueConstraint>
+            </valueConstraints>
+        </propertyDefinition>
         <propertyDefinition name="jcr:protected" requiredType="Boolean" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
-        <propertyDefinition name="jcr:requiredType" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
+        <propertyDefinition name="jcr:requiredType" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
+            <valueConstraints>
+                <valueConstraint>STRING</valueConstraint>
+                <valueConstraint>BINARY</valueConstraint>
+                <valueConstraint>LONG</valueConstraint>
+                <valueConstraint>DOUBLE</valueConstraint>
+                <valueConstraint>BOOLEAN</valueConstraint>
+                <valueConstraint>DATE</valueConstraint>
+                <valueConstraint>NAME</valueConstraint>
+                <valueConstraint>PATH</valueConstraint>
+                <valueConstraint>REFERENCE</valueConstraint>
+                <valueConstraint>UNDEFINED</valueConstraint>
+            </valueConstraints>
+        </propertyDefinition>
         <propertyDefinition name="jcr:valueConstraints" requiredType="String" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
         <propertyDefinition name="jcr:defaultValues" requiredType="undefined" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="true"/>
         <propertyDefinition name="jcr:multiple" requiredType="Boolean" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
@@ -164,7 +185,15 @@
         <propertyDefinition name="jcr:name" requiredType="Name" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDefinition name="jcr:autoCreated" requiredType="Boolean" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDefinition name="jcr:mandatory" requiredType="Boolean" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
-        <propertyDefinition name="jcr:onParentVersion" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
+        <propertyDefinition name="jcr:onParentVersion" requiredType="String" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false">
+            <valueConstraints>
+                <valueConstraint>COPY</valueConstraint>
+                <valueConstraint>VERSION</valueConstraint>
+                <valueConstraint>INITIALIZE</valueConstraint>
+                <valueConstraint>COMPUTE</valueConstraint>
+                <valueConstraint>IGNORE</valueConstraint>
+            </valueConstraints>
+        </propertyDefinition>
         <propertyDefinition name="jcr:protected" requiredType="Boolean" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="false"/>
         <propertyDefinition name="jcr:requiredPrimaryTypes" requiredType="Name" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="false" multiple="true">
             <defaultValues>
@@ -274,26 +303,22 @@
         <supertypes>
             <supertype>mix:referenceable</supertype>
         </supertypes>
-        <!-- FIXME jsr-170 defines this property as being mandatory; currently set to non-mandatory as workaround for initialization issue -->
-        <propertyDefinition name="jcr:versionHistory" requiredType="Reference" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="true" multiple="false">
+        <propertyDefinition name="jcr:versionHistory" requiredType="Reference" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="true" multiple="false">
             <valueConstraints>
                 <valueConstraint>nt:versionHistory</valueConstraint>
             </valueConstraints>
         </propertyDefinition>
-        <!-- FIXME jsr-170 defines this property as being mandatory; currently set to non-mandatory as workaround for initialization issue -->
-        <propertyDefinition name="jcr:baseVersion" requiredType="Reference" autoCreated="false" mandatory="false" onParentVersion="IGNORE" protected="true" multiple="false">
+        <propertyDefinition name="jcr:baseVersion" requiredType="Reference" autoCreated="false" mandatory="true" onParentVersion="IGNORE" protected="true" multiple="false">
             <valueConstraints>
                 <valueConstraint>nt:version</valueConstraint>
             </valueConstraints>
         </propertyDefinition>
-        <!-- FIXME jsr-170 defines this property as being mandatory; currently set to non-mandatory as workaround for initialization issue -->
-        <propertyDefinition name="jcr:isCheckedOut" requiredType="Boolean" autoCreated="true" mandatory="false" onParentVersion="IGNORE" protected="true" multiple="false">
+        <propertyDefinition name="jcr:isCheckedOut" requiredType="Boolean" autoCreated="true" mandatory="true" onParentVersion="IGNORE" protected="true" multiple="false">
             <defaultValues>
                 <defaultValue>true</defaultValue>
             </defaultValues>
         </propertyDefinition>
-        <!-- FIXME jsr-170 defines this property as being mandatory; currently set to non-mandatory as workaround for initialization issue -->
-        <propertyDefinition name="jcr:predecessors" requiredType="Reference" autoCreated="false" mandatory="false" onParentVersion="COPY" protected="true" multiple="true">
+        <propertyDefinition name="jcr:predecessors" requiredType="Reference" autoCreated="false" mandatory="true" onParentVersion="COPY" protected="true" multiple="true">
             <valueConstraints>
                 <valueConstraint>nt:version</valueConstraint>
             </valueConstraints>

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/query/QueryManagerImpl.java Thu Apr 28 09:21:06 2005
@@ -99,7 +99,7 @@
     /**
      * {@inheritDoc}
      */
-    public String[] getSupportedQueryLanguages() {
+    public String[] getSupportedQueryLanguages() throws RepositoryException {
         return (String[]) SUPPORTED_QUERIES_LIST.toArray(new String[SUPPORTED_QUERIES.length]);
     }
 }

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/repository.properties
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/repository.properties?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/repository.properties (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/repository.properties Thu Apr 28 09:21:06 2005
@@ -19,7 +19,7 @@
 #
 
 # The descriptor for the version of the specification that this repository implements.
-jcr.specification.version = 0.16.4
+jcr.specification.version = 0.16.4.1
 
 # The descriptor for the name of the specification that this repository implements.
 jcr.specification.name = Content Repository API for Java(TM) Technology Specification
@@ -34,7 +34,7 @@
 jcr.repository.name = Jackrabbit
 
 # The descriptor for the version of this repository implementation.
-jcr.repository.version = 0.16.4
+jcr.repository.version = 0.16.4.1
 
 ################################################################################
 # Repository features and support information

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/state/obj/ObjectPersistenceManager.java Thu Apr 28 09:21:06 2005
@@ -16,9 +16,6 @@
  */
 package org.apache.jackrabbit.core.state.obj;
 
-import org.apache.jackrabbit.core.value.BLOBFileValue;
-import org.apache.jackrabbit.core.value.InternalValue;
-import org.apache.jackrabbit.core.value.BLOBFileValue;
 import org.apache.jackrabbit.core.NodeId;
 import org.apache.jackrabbit.core.PropertyId;
 import org.apache.jackrabbit.core.QName;
@@ -39,6 +36,8 @@
 import org.apache.jackrabbit.core.state.PMContext;
 import org.apache.jackrabbit.core.state.PersistenceManager;
 import org.apache.jackrabbit.core.state.PropertyState;
+import org.apache.jackrabbit.core.value.BLOBFileValue;
+import org.apache.jackrabbit.core.value.InternalValue;
 import org.apache.log4j.Logger;
 
 import javax.jcr.PropertyType;

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/value/BLOBFileValue.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/value/BLOBFileValue.java?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/value/BLOBFileValue.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/value/BLOBFileValue.java Thu Apr 28 09:21:06 2005
@@ -386,8 +386,7 @@
      * {@inheritDoc}
      */
     public InputStream getStream()
-            throws ValueFormatException, IllegalStateException,
-            RepositoryException {
+            throws IllegalStateException, RepositoryException {
         // always return a 'fresh' stream
         if (file != null) {
             // this instance is backed by a 'real' file

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/DocViewSAXEventGenerator.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/DocViewSAXEventGenerator.java?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/DocViewSAXEventGenerator.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/DocViewSAXEventGenerator.java Thu Apr 28 09:21:06 2005
@@ -131,9 +131,6 @@
             Iterator iter = props.iterator();
             while (iter.hasNext()) {
                 PropertyImpl prop = (PropertyImpl) iter.next();
-                if (prop.getType() == PropertyType.BINARY && skipBinary) {
-                    continue;
-                }
                 QName propName = prop.getQName();
                 // encode property name to make sure it's a valid xml name
                 propName = ISO9075.encode(propName);
@@ -149,25 +146,31 @@
                     throw new RepositoryException(msg, npde);
                 }
                 // attribute value
-                StringBuffer attrValue = new StringBuffer();
-                // process property value(s)
-                boolean multiValued = prop.getDefinition().isMultiple();
-                Value[] vals;
-                if (multiValued) {
-                    vals = prop.getValues();
+                if (prop.getType() == PropertyType.BINARY && skipBinary) {
+                    // add empty attribute
+                    attrs.addAttribute(propName.getNamespaceURI(),
+                            propName.getLocalName(), attrName, CDATA_TYPE, "");
                 } else {
-                    vals = new Value[]{prop.getValue()};
-                }
-                for (int i = 0; i < vals.length; i++) {
-                    if (i > 0) {
-                        // use space as delimiter for multi-valued properties
-                        attrValue.append(" ");
+                    StringBuffer attrValue = new StringBuffer();
+                    // process property value(s)
+                    boolean multiValued = prop.getDefinition().isMultiple();
+                    Value[] vals;
+                    if (multiValued) {
+                        vals = prop.getValues();
+                    } else {
+                        vals = new Value[]{prop.getValue()};
+                    }
+                    for (int i = 0; i < vals.length; i++) {
+                        if (i > 0) {
+                            // use space as delimiter for multi-valued properties
+                            attrValue.append(" ");
+                        }
+                        attrValue.append(ValueHelper.serialize(vals[i], true));
                     }
-                    attrValue.append(ValueHelper.serialize(vals[i], true));
+                    attrs.addAttribute(propName.getNamespaceURI(),
+                            propName.getLocalName(), attrName, CDATA_TYPE,
+                            attrValue.toString());
                 }
-                attrs.addAttribute(propName.getNamespaceURI(),
-                        propName.getLocalName(), attrName, CDATA_TYPE,
-                        attrValue.toString());
             }
             // start element (node)
             contentHandler.startElement(name.getNamespaceURI(),

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewSAXEventGenerator.java
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewSAXEventGenerator.java?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewSAXEventGenerator.java (original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewSAXEventGenerator.java Thu Apr 28 09:21:06 2005
@@ -146,10 +146,6 @@
      */
     protected void entering(PropertyImpl prop, int level)
             throws RepositoryException, SAXException {
-        if (prop.getType() == PropertyType.BINARY && skipBinary) {
-            return;
-        }
-
         QName name = prop.getQName();
         String propName;
         try {
@@ -181,54 +177,62 @@
                 PREFIXED_PROPERTY_ELEMENT, attrs);
 
         // values
-        boolean multiValued = prop.getDefinition().isMultiple();
-        Value[] vals;
-        if (multiValued) {
-            vals = prop.getValues();
-        } else {
-            vals = new Value[]{prop.getValue()};
-        }
-        for (int i = 0; i < vals.length; i++) {
-            Value val = vals[i];
-
-            // start value element
+        if (prop.getType() == PropertyType.BINARY && skipBinary) {
+            // empty value element
             contentHandler.startElement(NS_SV_URI, VALUE_ELEMENT,
                     PREFIXED_VALUE_ELEMENT, new AttributesImpl());
+            contentHandler.endElement(NS_SV_URI, VALUE_ELEMENT,
+                    PREFIXED_VALUE_ELEMENT);
+        } else {
+            boolean multiValued = prop.getDefinition().isMultiple();
+            Value[] vals;
+            if (multiValued) {
+                vals = prop.getValues();
+            } else {
+                vals = new Value[]{prop.getValue()};
+            }
+            for (int i = 0; i < vals.length; i++) {
+                Value val = vals[i];
 
-            // characters
-            Writer writer = new Writer() {
-                public void close() /*throws IOException*/ {
-                }
+                // start value element
+                contentHandler.startElement(NS_SV_URI, VALUE_ELEMENT,
+                        PREFIXED_VALUE_ELEMENT, new AttributesImpl());
+
+                // characters
+                Writer writer = new Writer() {
+                    public void close() /*throws IOException*/ {
+                    }
 
-                public void flush() /*throws IOException*/ {
-                }
+                    public void flush() /*throws IOException*/ {
+                    }
 
-                public void write(char[] cbuf, int off, int len) throws IOException {
-                    try {
-                        contentHandler.characters(cbuf, off, len);
-                    } catch (SAXException se) {
-                        throw new IOException(se.toString());
+                    public void write(char[] cbuf, int off, int len) throws IOException {
+                        try {
+                            contentHandler.characters(cbuf, off, len);
+                        } catch (SAXException se) {
+                            throw new IOException(se.toString());
+                        }
+                    }
+                };
+                try {
+                    ValueHelper.serialize(val, false, writer);
+                    // no need to close our Writer implementation
+                    //writer.close();
+                } catch (IOException ioe) {
+                    // check if the exception wraps a SAXException
+                    // (see Writer.write(char[], int, int) above)
+                    Throwable t = ioe.getCause();
+                    if (t != null && t instanceof SAXException) {
+                        throw (SAXException) t;
+                    } else {
+                        throw new SAXException(ioe);
                     }
                 }
-            };
-            try {
-                ValueHelper.serialize(val, false, writer);
-                // no need to close our Writer implementation
-                //writer.close();
-            } catch (IOException ioe) {
-                // check if the exception wraps a SAXException
-                // (see Writer.write(char[], int, int) above)
-                Throwable t = ioe.getCause();
-                if (t != null && t instanceof SAXException) {
-                    throw (SAXException) t;
-                } else {
-                    throw new SAXException(ioe);
-                }
-            }
 
-            // end value element
-            contentHandler.endElement(NS_SV_URI, VALUE_ELEMENT,
-                    PREFIXED_VALUE_ELEMENT);
+                // end value element
+                contentHandler.endElement(NS_SV_URI, VALUE_ELEMENT,
+                        PREFIXED_VALUE_ELEMENT);
+            }
         }
     }
 
@@ -237,9 +241,6 @@
      */
     protected void leaving(PropertyImpl prop, int level)
             throws RepositoryException, SAXException {
-        if (prop.getType() == PropertyType.BINARY && skipBinary) {
-            return;
-        }
         contentHandler.endElement(NS_SV_URI, PROPERTY_ELEMENT,
                 PREFIXED_PROPERTY_ELEMENT);
     }

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-childNodeDefinition.txt
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-childNodeDefinition.txt?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-childNodeDefinition.txt (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-childNodeDefinition.txt Thu Apr 28 09:21:06 2005
@@ -51,7 +51,7 @@
 PropertyDefinition
   Name jcr:onParentVersion
   RequiredType STRING
-  ValueConstraints []
+  ValueConstraints [COPY,VERSION,INITIALIZE,COMPUTE,IGNORE]
   DefaultValues null
   AutoCreated false
   Mandatory true

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-nodeType.txt
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-nodeType.txt?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-nodeType.txt (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-nodeType.txt Thu Apr 28 09:21:06 2005
@@ -72,7 +72,7 @@
   ValueConstraints []
   DefaultValues null
   AutoCreated false
-  Mandatory true
+  Mandatory false
   OnParentVersion COPY
   Protected false
   Multiple true

Modified: incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-propertyDefinition.txt
URL: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-propertyDefinition.txt?rev=165156&r1=165155&r2=165156&view=diff
==============================================================================
--- incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-propertyDefinition.txt (original)
+++ incubator/jackrabbit/trunk/src/test/org/apache/jackrabbit/test/api/nodetype/spec/nt-propertyDefinition.txt Thu Apr 28 09:21:06 2005
@@ -61,7 +61,7 @@
 PropertyDefinition
   Name jcr:onParentVersion
   RequiredType STRING
-  ValueConstraints []
+  ValueConstraints [COPY,VERSION,INITIALIZE,COMPUTE,IGNORE]
   DefaultValues null
   AutoCreated false
   Mandatory true
@@ -81,7 +81,7 @@
 PropertyDefinition
   Name jcr:requiredType
   RequiredType STRING
-  ValueConstraints []
+  ValueConstraints [STRING,BINARY,LONG,DOUBLE,BOOLEAN,DATE,NAME,PATH,REFERENCE,UNDEFINED]
   DefaultValues null
   AutoCreated false
   Mandatory true