[Zope-Checkins] CVS: Packages/webdav - Resource.py:1.55.10.10

Sidnei da Silva sidnei at enfoldsystems.com
Tue Jun 21 11:27:30 EDT 2005


Update of /cvs-repository/Packages/webdav
In directory cvs.zope.org:/tmp/cvs-serv30574/lib/python/webdav

Modified Files:
      Tag: Zope-2_7-branch
	Resource.py 
Log Message:

      - WebDAV COPY and MOVE did not call '_notifyOfCopyTo' and
        '_postCopy' hooks like it was done in
        OFS.CopySupport. Additionally added
        'manage_changeOwnershipType' to make MOVE behave even closer
        to OFS.CopySupport.


=== Packages/webdav/Resource.py 1.55.10.9 => 1.55.10.10 ===
--- Packages/webdav/Resource.py:1.55.10.9	Wed Dec 22 18:29:30 2004
+++ Packages/webdav/Resource.py	Tue Jun 21 11:27:30 2005
@@ -377,6 +377,7 @@
             else:
                 raise Locked, 'Destination is locked.'
 
+        self._notifyOfCopyTo(parent, op=0)
         ob = self._getCopy(parent)
         ob._setId(name)
 
@@ -389,6 +390,7 @@
             parent._delObject(name)
         parent._setObject(name, ob)
         ob = parent._getOb(name)
+        ob._postCopy(parent, op=0)
         ob.manage_afterClone(ob)
         # We remove any locks from the copied object because webdav clients
         # don't track the lock status and the lock token for copied resources
@@ -485,7 +487,12 @@
                 raise PreconditionFailed, 'Source is locked and no '\
                       'condition was passed in.'
 
-        ob=aq_base(self._getCopy(parent))
+        # try to make ownership explicit so that it gets carried
+        # along to the new location if needed.
+        self.manage_changeOwnershipType(explicit=1)
+
+        self._notifyOfCopyTo(parent, op=1)
+        ob = aq_base(self._getCopy(parent))
         self.aq_parent._delObject(absattr(self.id))
         ob._setId(name)
         if existing:
@@ -493,6 +500,12 @@
             self.dav__validate(object, 'DELETE', REQUEST)
             parent._delObject(name)
         parent._setObject(name, ob)
+        ob = parent._getOb(name)
+        ob._postCopy(parent, op=1)
+
+        # try to make ownership implicit if possible
+        ob.manage_changeOwnershipType(explicit=0)
+
         RESPONSE.setStatus(existing and 204 or 201)
         if not existing:
             RESPONSE.setHeader('Location', dest)



More information about the Zope-Checkins mailing list