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
e2c1df8f
Commit
e2c1df8f
authored
Mar 09, 1999
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
*** empty log message ***
parent
68c9d910
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
65 additions
and
13 deletions
+65
-13
lib/python/webdav/Resource.py
lib/python/webdav/Resource.py
+5
-4
lib/python/webdav/xmlcmds.py
lib/python/webdav/xmlcmds.py
+60
-9
No files found.
lib/python/webdav/Resource.py
View file @
e2c1df8f
...
...
@@ -85,7 +85,7 @@
"""WebDAV support - resource objects."""
__version__
=
'$Revision: 1.1
0
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.1
1
$'
[
11
:
-
2
]
import
sys
,
os
,
string
,
mimetypes
,
xmlcmds
from
common
import
absattr
,
aq_base
,
urlfix
,
rfc1123_date
...
...
@@ -122,9 +122,10 @@ class Resource:
def
dav__get_locks
(
self
):
# Return the current locks on the object.
if
hasattr
(
self
,
'locked_in_session'
)
and
self
.
locked_in_session
():
lock
=
Lock
(
'xxxx'
,
'xxxx'
)
return
self
.
dav__locks
+
(
lock
,)
#if hasattr(self, 'locked_in_session') and self.locked_in_session():
# lock=Lock('xxxx', 'xxxx')
# return self.dav__locks + (lock,)
return
self
.
dav__locks
def
dav__validate
(
self
,
methodname
,
REQUEST
):
# Check whether the user is allowed to perform a particular
...
...
lib/python/webdav/xmlcmds.py
View file @
e2c1df8f
...
...
@@ -85,14 +85,23 @@
"""WebDAV xml request objects."""
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
__version__
=
'$Revision: 1.
9
$'
[
11
:
-
2
]
import
sys
,
os
,
string
from
common
import
absattr
,
aq_base
,
urlfix
from
OFS.PropertySheets
import
DAVProperties
from
xmltools
import
XmlParser
from
cStringIO
import
StringIO
class
DAVProps
(
DAVProperties
):
"""Emulate required DAV properties for objects which do
not themselves support properties."""
def
__init__
(
self
,
obj
):
self
.
__obj__
=
obj
def
v_self
(
self
):
return
self
.
__obj__
class
PropFind
:
...
...
@@ -131,16 +140,58 @@ class PropFind:
iscol
=
hasattr
(
obj
,
'__dav_collection__'
)
if
iscol
and
url
[
-
1
]
!=
'/'
:
url
=
url
+
'/'
result
.
write
(
'<d:response>
\
n
<d:href>%s</d:href>
\
n
'
%
url
)
needstat
=
1
if
hasattr
(
obj
,
'__propsets__'
):
for
ps
in
obj
.
propertysheets
.
values
():
if
hasattr
(
aq_base
(
ps
),
'dav__propstat'
):
propstat
=
ps
.
dav__propstat
(
self
.
allprop
,
self
.
propnames
)
if
propstat
:
result
.
write
(
propstat
)
needstat
=
0
if
needstat
:
result
.
write
(
'<d:status>200 OK</d:status>
\
n
'
)
propsets
=
obj
.
propertysheets
.
values
()
obsheets
=
obj
.
propertysheets
else
:
propsets
=
(
DAVProps
(
obj
),)
obsheets
=
{}
if
self
.
allprop
:
stats
=
[]
for
ps
in
propsheets
.
values
():
if
hasattr
(
aq_base
(
ps
),
'dav__allprop'
):
stats
.
append
(
ps
.
dav__allprop
())
stats
=
string
.
join
(
stats
,
''
)
or
'<d:status>200 OK</d:status>
\
n
'
result
.
write
(
stats
)
elif
not
self
.
propnames
:
stats
=
[]
for
ps
in
propsheets
.
values
():
if
hasattr
(
aq_base
(
ps
),
'dav__propnames'
):
stats
.
append
(
ps
.
dav__propnames
())
stats
=
string
.
join
(
stats
,
''
)
or
'<d:status>200 OK</d:status>
\
n
'
result
.
write
(
stats
)
else
:
for
name
,
ns
in
self
.
propnames
:
ps
=
obsheets
.
get
(
ns
,
None
)
if
ps
is
not
None
and
hasattr
(
aq_base
(
ps
),
'dav__propstat'
):
stat
=
ps
.
dav__propstat
(
name
)
else
:
stat
=
'<d:propstat xmlns:n="%s">
\
n
'
\
' <d:prop>
\
n
'
\
' <n:%s/>
\
n
'
\
' </d:prop>
\
n
'
\
' <d:status>HTTP/1.1 404 Not Found</d:status>
\
n
'
\
' <d:responsedescription>
\
n
'
\
' The property %s does not exist.
\
n
'
\
' </d:responsedescription>
\
n
'
\
'</d:propstat>
\
n
'
%
(
ns
,
name
,
name
)
result
.
write
(
stat
)
result
.
write
(
'</d:response>
\
n
'
)
## for ps in obj.propertysheets.values():
## if hasattr(aq_base(ps), 'dav__propstat'):
## propstat=ps.dav__propstat(self.allprop, self.propnames)
## if propstat:
## result.write(propstat)
## needstat=0
## if needstat: result.write('<d:status>200 OK</d:status>\n')
## result.write('</d:response>\n')
if
depth
in
(
'1'
,
'infinity'
)
and
iscol
:
for
ob
in
obj
.
objectValues
():
dflag
=
hasattr
(
ob
,
'_p_changed'
)
and
(
ob
.
_p_changed
==
None
)
...
...
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