Commit 5f35a675 authored by 's avatar

Added DAV fixes, document_src url for DTML objects.

parent d0685ae5
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""DTML Document objects.""" """DTML Document objects."""
__version__='$Revision: 1.11 $'[11:-2] __version__='$Revision: 1.12 $'[11:-2]
from DocumentTemplate.DT_Util import InstanceDict, TemplateDict from DocumentTemplate.DT_Util import InstanceDict, TemplateDict
from ZPublisher.Converters import type_converters from ZPublisher.Converters import type_converters
from Globals import HTML, HTMLFile, MessageDialog from Globals import HTML, HTMLFile, MessageDialog
...@@ -113,7 +113,8 @@ class DTMLDocument(DTMLMethod, PropertyManager): ...@@ -113,7 +113,8 @@ class DTMLDocument(DTMLMethod, PropertyManager):
__ac_permissions__=( __ac_permissions__=(
('View management screens', ('manage', 'manage_main', 'manage_editForm', ('View management screens', ('manage', 'manage_main', 'manage_editForm',
'manage_tabs', 'manage_uploadForm')), 'manage_tabs', 'manage_uploadForm',
'document_src')),
('Access contents information', ('PROPFIND',)), ('Access contents information', ('PROPFIND',)),
('Change permissions', ('manage_access',)), ('Change permissions', ('manage_access',)),
('Change DTML Documents', ('manage_edit', 'manage_upload', 'PUT')), ('Change DTML Documents', ('manage_edit', 'manage_upload', 'PUT')),
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""DTML Method objects.""" """DTML Method objects."""
__version__='$Revision: 1.8 $'[11:-2] __version__='$Revision: 1.9 $'[11:-2]
from Globals import HTML, HTMLFile, MessageDialog from Globals import HTML, HTMLFile, MessageDialog
from string import join,split,strip,rfind,atoi,lower from string import join,split,strip,rfind,atoi,lower
...@@ -118,7 +118,8 @@ class DTMLMethod(cDocument, HTML, Explicit, RoleManager, Item_w__name__): ...@@ -118,7 +118,8 @@ class DTMLMethod(cDocument, HTML, Explicit, RoleManager, Item_w__name__):
) )
__ac_permissions__=( __ac_permissions__=(
('View management screens', ('manage', 'manage_main', 'manage_editForm', ('View management screens', ('manage', 'manage_main', 'manage_editForm',
'manage_tabs', 'manage_uploadForm')), 'manage_tabs', 'manage_uploadForm',
'document_src')),
('Access contents information', ('PROPFIND',)), ('Access contents information', ('PROPFIND',)),
('Change DTML Methods', ('manage_edit', 'manage_upload', 'PUT')), ('Change DTML Methods', ('manage_edit', 'manage_upload', 'PUT')),
('Change proxy roles', ('manage_proxyForm', 'manage_proxy')), ('Change proxy roles', ('manage_proxyForm', 'manage_proxy')),
...@@ -291,6 +292,10 @@ class DTMLMethod(cDocument, HTML, Explicit, RoleManager, Item_w__name__): ...@@ -291,6 +292,10 @@ class DTMLMethod(cDocument, HTML, Explicit, RoleManager, Item_w__name__):
"Support for searching - the document's contents are searched." "Support for searching - the document's contents are searched."
return self.read() return self.read()
def document_src(self, REQUEST, RESPONSE):
"""Return unprocessed document source."""
RESPONSE.setHeader('Content-Type', 'text/plain')
return self.read()
## Protocol handlers ## Protocol handlers
......
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
############################################################################## ##############################################################################
"""Property sheets""" """Property sheets"""
__version__='$Revision: 1.25 $'[11:-2] __version__='$Revision: 1.26 $'[11:-2]
import time, string, App.Management import time, string, App.Management
from ZPublisher.Converters import type_converters from ZPublisher.Converters import type_converters
...@@ -543,17 +543,17 @@ class DAVProperties(Virtual, PropertySheet): ...@@ -543,17 +543,17 @@ class DAVProperties(Virtual, PropertySheet):
def dav__source(self): def dav__source(self):
vself=self.v_self() vself=self.v_self()
if hasattr(vself, 'meta_type') and vself.meta_type in \ if hasattr(vself, 'meta_type') and vself.meta_type in \
('Document', 'DTMLDocument', 'DTMLMethod', 'ZSQLMethod'): ('Document', 'DTML Document', 'DTML Method', 'Z SQL Method'):
url=vself.absolute_url() url=vself.absolute_url()
return '\n <n:src>%s</n:src>\n' \ return '\n <n:src>%s</n:src>\n' \
' <n:dst>%s/object_src</n:dst>' % (url, url) ' <n:dst>%s/document_src</n:dst>\n ' % (url, url)
return '' return ''
def dav__supportedlock(self): def dav__supportedlock(self):
return '\n <n:lockentry>\n' \ return '\n <n:lockentry>\n' \
' <d:lockscope><d:exclusive/></d:lockscope>\n' \ ' <d:lockscope><d:exclusive/></d:lockscope>\n' \
' <d:locktype><d:write/></d:locktype>\n' \ ' <d:locktype><d:write/></d:locktype>\n' \
' </n:lockentry>\n' ' </n:lockentry>\n '
class PropertySheets(Implicit): class PropertySheets(Implicit):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment