Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
a72a5048
Commit
a72a5048
authored
Aug 22, 2006
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made sure WebDAV.COPY sends an ObjectClonedEvent.
Fixes
http://www.zope.org/Collectors/Zope/2169
parent
bad63b39
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
lib/python/OFS/tests/testCopySupportHooks.py
lib/python/OFS/tests/testCopySupportHooks.py
+23
-0
lib/python/webdav/Resource.py
lib/python/webdav/Resource.py
+9
-1
No files found.
lib/python/OFS/tests/testCopySupportHooks.py
View file @
a72a5048
...
...
@@ -159,6 +159,15 @@ class TestCopySupport(HookTest):
self
.
assertEqual
(
old
.
order
(),
(
0
,
0
,
1
))
# del
self
.
assertEqual
(
self
.
subfolder
.
mydoc
.
order
(),
(
1
,
0
,
0
))
# add
def
test_7_DELETE
(
self
):
# Test webdav DELETE
req
=
self
.
app
.
REQUEST
req
[
'URL'
]
=
'%s/mydoc'
%
self
.
folder
.
absolute_url
()
old
=
self
.
folder
.
mydoc
self
.
folder
.
mydoc
.
DELETE
(
req
,
req
.
RESPONSE
)
self
.
assertEqual
(
req
.
RESPONSE
.
getStatus
(),
204
)
self
.
assertEqual
(
old
.
order
(),
(
0
,
0
,
1
))
# del
class
TestCopySupportSublocation
(
HookTest
):
'''Tests the order in which the add/clone/del hooks are called'''
...
...
@@ -210,6 +219,9 @@ class TestCopySupportSublocation(HookTest):
def
test_5_COPY
(
self
):
# Test webdav COPY
#
# See http://www.zope.org/Collectors/Zope/2169
#
req
=
self
.
app
.
REQUEST
req
.
environ
[
'HTTP_DEPTH'
]
=
'infinity'
req
.
environ
[
'HTTP_DESTINATION'
]
=
'%s/subfolder/yourfolder'
%
self
.
folder
.
absolute_url
()
...
...
@@ -232,6 +244,17 @@ class TestCopySupportSublocation(HookTest):
self
.
assertEqual
(
olddoc
.
order
(),
(
0
,
0
,
1
))
# del
self
.
assertEqual
(
self
.
subfolder
.
yourfolder
.
mydoc
.
order
(),
(
1
,
0
,
0
))
# add
def
test_7_DELETE
(
self
):
# Test webdav DELETE
req
=
self
.
app
.
REQUEST
req
[
'URL'
]
=
'%s/myfolder'
%
self
.
folder
.
absolute_url
()
oldfolder
=
self
.
folder
.
myfolder
olddoc
=
self
.
folder
.
myfolder
.
mydoc
self
.
folder
.
myfolder
.
DELETE
(
req
,
req
.
RESPONSE
)
self
.
assertEqual
(
req
.
RESPONSE
.
getStatus
(),
204
)
self
.
assertEqual
(
oldfolder
.
order
(),
(
0
,
0
,
1
))
# del
self
.
assertEqual
(
olddoc
.
order
(),
(
0
,
0
,
1
))
# del
def
test_suite
():
suite
=
unittest
.
TestSuite
()
...
...
lib/python/webdav/Resource.py
View file @
a72a5048
...
...
@@ -38,6 +38,10 @@ from interfaces import IDAVResource
from
interfaces
import
IWriteLock
from
WriteLockInterface
import
WriteLockInterface
from
zope.event
import
notify
from
OFS.event
import
ObjectClonedEvent
import
OFS.subscribers
class
Resource
(
ExtensionClass
.
Base
,
Lockable
.
LockableItem
):
...
...
@@ -396,7 +400,11 @@ class Resource(ExtensionClass.Base, Lockable.LockableItem):
parent
.
_setObject
(
name
,
ob
)
ob
=
parent
.
_getOb
(
name
)
ob
.
_postCopy
(
parent
,
op
=
0
)
ob
.
manage_afterClone
(
ob
)
OFS
.
subscribers
.
compatibilityCall
(
'manage_afterClone'
,
ob
,
ob
)
notify
(
ObjectClonedEvent
(
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
ob
.
wl_clearLocks
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment