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
4690ca0e
Commit
4690ca0e
authored
Feb 22, 2006
by
David Whitfield Morriss
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
reversing webdav changes for alec
parent
8ff15818
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
68 deletions
+8
-68
lib/python/Products/Five/browser/tests/test_traversable.py
lib/python/Products/Five/browser/tests/test_traversable.py
+0
-45
lib/python/Products/Five/traversable.py
lib/python/Products/Five/traversable.py
+8
-23
No files found.
lib/python/Products/Five/browser/tests/test_traversable.py
View file @
4690ca0e
...
@@ -114,51 +114,6 @@ def test_traversable():
...
@@ -114,51 +114,6 @@ def test_traversable():
...
...
an_attribute
an_attribute
If we use WebDAV to get an object no acquisition should be performed,
otherwise content creation will break:
>>> from Products.Five.tests.testing import manage_addFiveTraversableFolder
>>> manage_addFiveTraversableFolder(self.folder, 'traversable_folder', 'Traversable')
Let's verify that we can get our object properties via WebDAV:
>>> print http(r'''
... PROPFIND /test_folder_1_/fancy HTTP/1.1
... Content-Type: text/xml; charset="utf-8"
... Depth: 0
...
... <?xml version="1.0" encoding="utf-8"?>
... <DAV:propfind xmlns:DAV="DAV:"
... xmlns:zope="http://www.zope.org/propsets/default">
... <DAV:prop><zope:title/></DAV:prop>
... </DAV:propfind>
... ''')
HTTP/1.1 200 OK
...
PROPFIND
And that a normal http request will acquire the object:
>>> print http(r'''
... GET /test_folder_1_/traversable_folder/fancy HTTP/1.1
... ''')
HTTP/1.1 200 OK
...
<FancyContent at >
But that a WebDAV request will not:
>>> print http(r'''
... PROPFIND /test_folder_1_/traversable_folder/fancy HTTP/1.1
... Content-Type: text/xml; charset="utf-8"
... Depth: 0
...
... <?xml version="1.0" encoding="utf-8"?>
... <DAV:propfind xmlns:DAV="DAV:"
... xmlns:zope="http://www.zope.org/propsets/default">
... <DAV:prop><zope:title/></DAV:prop>
... </DAV:propfind>
... ''')
HTTP/1.1 404 Not Found
...
Clean up:
Clean up:
...
...
lib/python/Products/Five/traversable.py
View file @
4690ca0e
...
@@ -33,8 +33,6 @@ from AccessControl import getSecurityManager
...
@@ -33,8 +33,6 @@ from AccessControl import getSecurityManager
from
Acquisition
import
aq_base
from
Acquisition
import
aq_base
from
Products.Five.security
import
newInteraction
from
Products.Five.security
import
newInteraction
from
webdav.NullResource
import
NullResource
_marker
=
object
_marker
=
object
class
FakeRequest
(
dict
):
class
FakeRequest
(
dict
):
...
@@ -97,19 +95,6 @@ class Traversable:
...
@@ -97,19 +95,6 @@ class Traversable:
# potential WebDAV issues, in particular we should not perform
# potential WebDAV issues, in particular we should not perform
# acquisition for webdav requests, and should return a NullResource
# acquisition for webdav requests, and should return a NullResource
# when appropriate.
# when appropriate.
method
=
REQUEST
.
get
(
'REQUEST_METHOD'
,
'GET'
).
upper
()
if
(
len
(
REQUEST
.
get
(
'TraversalRequestNameStack'
,
()))
==
0
and
not
(
method
in
(
'GET'
,
'HEAD'
,
'POST'
)
and
not
isinstance
(
REQUEST
.
RESPONSE
,
xmlrpc
.
Response
))):
if
getattr
(
aq_base
(
self
),
name
,
None
)
is
not
None
:
return
getattr
(
self
,
name
)
else
:
# XXX: This may be unnecessary as Zope itself doesn't do it,
# but it shouldn't be harmful
if
(
method
in
(
'PUT'
,
'MKCOL'
)
and
not
isinstance
(
RESPONSE
,
xmlrpc
.
Response
)):
return
NullResource
(
self
,
name
,
REQUEST
).
__of__
(
self
)
else
:
try
:
try
:
return
getattr
(
self
,
name
)
return
getattr
(
self
,
name
)
except
AttributeError
:
except
AttributeError
:
...
...
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