jackrabbit-oak-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mdue...@apache.org
Subject svn commit: r1452746 - in /jackrabbit/oak/trunk: oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/ oak-jcr/ oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/
Date Tue, 05 Mar 2013 11:34:32 GMT
Author: mduerig
Date: Tue Mar  5 11:34:32 2013
New Revision: 1452746

URL: http://svn.apache.org/r1452746
Log:
OAK-667: Node.orderBefore() doesn't check whether the node type supports orderable child nodes

Modified:
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/EffectiveNodeType.java
    jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/EffectiveNodeTypeImpl.java
    jackrabbit/oak/trunk/oak-jcr/pom.xml
    jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/EffectiveNodeType.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/EffectiveNodeType.java?rev=1452746&r1=1452745&r2=1452746&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/EffectiveNodeType.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/EffectiveNodeType.java
Tue Mar  5 11:34:32 2013
@@ -18,6 +18,7 @@ package org.apache.jackrabbit.oak.plugin
 
 import javax.annotation.Nonnull;
 import javax.jcr.RepositoryException;
+import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.nodetype.NodeDefinition;
 import javax.jcr.nodetype.NodeType;
@@ -118,4 +119,6 @@ public interface EffectiveNodeType {
     void checkRemoveNode(String name, NodeType nodeType) throws RepositoryException;
 
     void checkMandatoryItems(Tree tree) throws ConstraintViolationException;
+
+    void checkOrderableChildNodes() throws UnsupportedRepositoryOperationException;
 }

Modified: jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/EffectiveNodeTypeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/EffectiveNodeTypeImpl.java?rev=1452746&r1=1452745&r2=1452746&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/EffectiveNodeTypeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/nodetype/EffectiveNodeTypeImpl.java
Tue Mar  5 11:34:32 2013
@@ -23,6 +23,7 @@ import java.util.List;
 import java.util.Set;
 import javax.annotation.Nullable;
 import javax.jcr.RepositoryException;
+import javax.jcr.UnsupportedRepositoryOperationException;
 import javax.jcr.Value;
 import javax.jcr.nodetype.ConstraintViolationException;
 import javax.jcr.nodetype.ItemDefinition;
@@ -291,6 +292,18 @@ class EffectiveNodeTypeImpl implements E
         }
     }
 
+    @Override
+    public void checkOrderableChildNodes() throws UnsupportedRepositoryOperationException
{
+        Iterable<NodeType> nts = getAllNodeTypes();
+        for (NodeType nt : nts) {
+            if (nt.hasOrderableChildNodes()) {
+                return;
+            }
+        }
+
+        throw new UnsupportedRepositoryOperationException("Child node ordering is not supported
on this node");
+    }
+
     //------------------------------------------------------------< private >---
 
     private PropertyDefinition getDefinition(PropertyState property) throws RepositoryException
{

Modified: jackrabbit/oak/trunk/oak-jcr/pom.xml
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/pom.xml?rev=1452746&r1=1452745&r2=1452746&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/pom.xml (original)
+++ jackrabbit/oak/trunk/oak-jcr/pom.xml Tue Mar  5 11:34:32 2013
@@ -48,7 +48,6 @@
       org.apache.jackrabbit.test.api.NodeTest#testRemoveNodeParentLocked
       org.apache.jackrabbit.test.api.NodeUUIDTest#testSaveReferentialIntegrityException<!--OAK-66-->
       org.apache.jackrabbit.test.api.NodeUUIDTest#testSaveMovedRefNode<!--OAK-66-->
-      org.apache.jackrabbit.test.api.NodeOrderableChildNodesTest#testOrderBeforeUnsupportedRepositoryOperationException<!--OAK-169
-->
       org.apache.jackrabbit.test.api.SetValueValueFormatExceptionTest#testNodeNotReferenceable
       org.apache.jackrabbit.test.api.NodeSetPrimaryTypeTest#testLocked
       org.apache.jackrabbit.test.api.WorkspaceCopyReferenceableTest#testCopyNodesNewUUID
                   <!-- OAK-118 -->

Modified: jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java?rev=1452746&r1=1452745&r2=1452746&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
(original)
+++ jackrabbit/oak/trunk/oak-jcr/src/main/java/org/apache/jackrabbit/oak/jcr/NodeImpl.java
Tue Mar  5 11:34:32 2013
@@ -293,6 +293,7 @@ public class NodeImpl<T extends NodeDele
         perform(new SessionOperation<Void>() {
             @Override
             public Void perform() throws RepositoryException {
+                getEffectiveNodeType().checkOrderableChildNodes();
                 String oakSrcChildRelPath =
                         sessionDelegate.getOakPathOrThrowNotFound(srcChildRelPath);
                 String oakDestChildRelPath = null;



Mime
View raw message