Log message for revision 30875: Forward-port fix from 2.7: - 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.
Changed: U Zope/trunk/doc/CHANGES.txt U Zope/trunk/lib/python/webdav/Resource.py -=- Modified: Zope/trunk/doc/CHANGES.txt =================================================================== --- Zope/trunk/doc/CHANGES.txt 2005-06-21 10:28:34 UTC (rev 30874) +++ Zope/trunk/doc/CHANGES.txt 2005-06-21 15:30:24 UTC (rev 30875) @@ -39,6 +39,12 @@ - Collector #1808: manage_convertIndexes no longer tries to change the index types causing some trouble with CMF. + - 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. + - Collector #1548: Fix 'httplib' usage in ZPublisher.Client. - Collector #1792: applied patch for broken ZClasses Modified: Zope/trunk/lib/python/webdav/Resource.py =================================================================== --- Zope/trunk/lib/python/webdav/Resource.py 2005-06-21 10:28:34 UTC (rev 30874) +++ Zope/trunk/lib/python/webdav/Resource.py 2005-06-21 15:30:24 UTC (rev 30875) @@ -373,6 +373,7 @@ else: raise Locked, 'Destination is locked.' + self._notifyOfCopyTo(parent, op=0) ob = self._getCopy(parent) ob._setId(name) @@ -385,6 +386,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 @@ -481,7 +483,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: @@ -489,6 +496,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) _______________________________________________ Zope-Checkins maillist - Zope-Checkins@zope.org http://mail.zope.org/mailman/listinfo/zope-checkins