jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r432274 - /jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
Date Thu, 17 Aug 2006 16:13:54 GMT
Author: angela
Date: Thu Aug 17 09:13:53 2006
New Revision: 432274

URL: http://svn.apache.org/viewvc?rev=432274&view=rev
Log:
work in progress

- readding basic validation checks on importTarget before starting the import.

Modified:
    jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java

Modified: jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java?rev=432274&r1=432273&r2=432274&view=diff
==============================================================================
--- jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
(original)
+++ jackrabbit/trunk/contrib/spi/jcr2spi/src/main/java/org/apache/jackrabbit/jcr2spi/xml/SessionImporter.java
Thu Aug 17 09:13:53 2006
@@ -23,6 +23,7 @@
 import org.apache.jackrabbit.jcr2spi.state.ChildNodeEntry;
 import org.apache.jackrabbit.jcr2spi.state.ItemStateException;
 import org.apache.jackrabbit.jcr2spi.state.NoSuchItemStateException;
+import org.apache.jackrabbit.jcr2spi.state.ItemStateValidator;
 import org.apache.jackrabbit.jcr2spi.SessionImpl;
 import org.apache.jackrabbit.jcr2spi.SessionListener;
 import org.apache.jackrabbit.jcr2spi.util.ReferenceChangeTracker;
@@ -128,13 +129,16 @@
             }
             importTarget = (NodeState) itemState;
 
+            // check if import target is writable, not-locked and checked-out.
+            int options = ItemStateValidator.CHECK_ACCESS | ItemStateValidator.CHECK_LOCK
| ItemStateValidator.CHECK_VERSIONING;
+            session.getValidator().checkIsWritable(importTarget, options);
+
             refTracker = new ReferenceChangeTracker();
             parents = new Stack();
             parents.push(importTarget);
         } catch (ItemNotFoundException infe) {
             throw new PathNotFoundException(LogUtil.safeGetJCRPath(parentPath, session.getNamespaceResolver()));
         }
-        // DIFF JR: remove check for overall writability on target-node.
     }
 
     //-----------------------------------------------------------< Importer >---
@@ -402,7 +406,7 @@
                 if (conflicting.getStatus() == ItemState.STATUS_NEW) {
                     // assume this property has been imported as well;
                     // rename conflicting property
-                    // @todo use better reversible escaping scheme to create unique name
+                    // TODO: use better reversible escaping scheme to create unique name
                     QName newName = new QName(nodeInfo.getName().getNamespaceURI(), nodeInfo.getName().getLocalName()
+ "_");
                     if (parent.hasPropertyName(newName)) {
                         newName = new QName(newName.getNamespaceURI(), newName.getLocalName()
+ "_");



Mime
View raw message