jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject svn commit: r125428 - /incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java
Date Mon, 17 Jan 2005 17:32:31 GMT
Author: stefan
Date: Mon Jan 17 09:32:27 2005
New Revision: 125428

URL: http://svn.apache.org/viewcvs?view=rev&rev=125428
Log:
Session.importXML did not throw ItemExistsException if existing node is in the way
Modified:
   incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java

Modified: incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java
Url: http://svn.apache.org/viewcvs/incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java?view=diff&rev=125428&p1=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java&r1=125427&p2=incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java&r2=125428
==============================================================================
--- incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java
(original)
+++ incubator/jackrabbit/trunk/src/java/org/apache/jackrabbit/core/xml/SysViewImportHandler.java
Mon Jan 17 09:32:27 2005
@@ -249,7 +249,7 @@
                     // jcr:uuid is the last system property; we can assume that all
                     // required system properties have been collected by now
                     if (current.node == null) {
-                        // now that we're collected all required system properties
+                        // now that we've collected all required system properties
                         // we're ready to create the node
                         createNode(current);
                     }
@@ -265,7 +265,7 @@
                     // non-system property encountered; we can assume that all
                     // required system properties have been collected by now
                     if (current.node == null) {
-                        // now that we're collected all required system properties
+                        // now that we've collected all required system properties
                         // we're ready to create the node
                         createNode(current);
                     }
@@ -347,14 +347,14 @@
         if (state.parent.hasNode(state.nodeName)) {
             state.node = state.parent.getNode(state.nodeName);
             NodeDef def = state.node.getDefinition();
-            if (def.isProtected()) {
+            if (def.isProtected() || def.isAutoCreate()) {
                 // @todo how to handle protected/auto-created child node?
-
-            } else if (def.isAutoCreate()) {
-                // @todo how to handle protected/auto-created child node?
-
+                state.node = (NodeImpl) state.parent.getNode(state.nodeName);
+            } else if (!def.allowSameNameSibs()) {
+                throw new ItemExistsException(state.parent.safeGetJCRPath() + "/" + state.nodeName);
             }
-        } else {
+        }
+        if (state.node == null) {
             state.node = (NodeImpl) state.parent.addNode(state.nodeName, state.primaryType);
             if (state.mixinTypes != null) {
                 for (int i = 0; i < state.mixinTypes.size(); i++) {

Mime
View raw message