jackrabbit-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ang...@apache.org
Subject svn commit: r522962 - in /jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr: DefaultItemCollection.java ItemResourceConstants.java
Date Tue, 27 Mar 2007 15:52:34 GMT
Author: angela
Date: Tue Mar 27 08:52:31 2007
New Revision: 522962

URL: http://svn.apache.org/viewvc?view=rev&rev=522962
Log:
ImportXML: uuidbehavior not transported

Modified:
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
    jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java?view=diff&rev=522962&r1=522961&r2=522962
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/DefaultItemCollection.java
Tue Mar 27 08:52:31 2007
@@ -380,14 +380,23 @@
                     n.addNode(memberName);
                 } else {
                     // MKCOL, which is not allowed for existing resources
+                    int uuidBehavior = ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW;
+                    String str = inputContext.getProperty(IMPORT_UUID_BEHAVIOR);
+                    if (str != null) {
+                        try {
+                            uuidBehavior = Integer.parseInt(str);
+                        } catch (NumberFormatException e) {
+                            throw new DavException(DavServletResponse.SC_BAD_REQUEST);
+                        }
+                    }
                     if (getTransactionId() == null) {
                         // if not part of a transaction directely import on workspace
                         // since changes would be explicitely saved in the
                         // complete-call.
-                        getRepositorySession().getWorkspace().importXML(itemPath, in, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
+                        getRepositorySession().getWorkspace().importXML(itemPath, in, uuidBehavior);
                     } else {
                         // changes will not be persisted unless the tx is completed.
-                        getRepositorySession().importXML(itemPath, in, ImportUUIDBehavior.IMPORT_UUID_CREATE_NEW);
+                        getRepositorySession().importXML(itemPath, in, uuidBehavior);
                     }
                 }
             } else {

Modified: jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java?view=diff&rev=522962&r1=522961&r2=522962
==============================================================================
--- jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
(original)
+++ jackrabbit/trunk/jackrabbit-jcr-server/src/main/java/org/apache/jackrabbit/webdav/jcr/ItemResourceConstants.java
Tue Mar 27 08:52:31 2007
@@ -57,6 +57,8 @@
      */
     public static final Namespace NAMESPACE = Namespace.getNamespace("dcr", "http://www.day.com/jcr/webdav/1.0");
 
+    public static final String IMPORT_UUID_BEHAVIOR = "ImportUUIDBehavior";
+
     // xml element names
     public static final String XML_PRIMARYNODETYPE = "primarynodetype";
     public static final String XML_VALUE = "value";



Mime
View raw message