Commit 5f35a675 authored by 's avatar

Added DAV fixes, document_src url for DTML objects.

parent d0685ae5
......@@ -84,7 +84,7 @@
##############################################################################
"""DTML Document objects."""
__version__='$Revision: 1.11 $'[11:-2]
__version__='$Revision: 1.12 $'[11:-2]
from DocumentTemplate.DT_Util import InstanceDict, TemplateDict
from ZPublisher.Converters import type_converters
from Globals import HTML, HTMLFile, MessageDialog
......@@ -113,7 +113,8 @@ class DTMLDocument(DTMLMethod, PropertyManager):
__ac_permissions__=(
('View management screens', ('manage', 'manage_main', 'manage_editForm',
'manage_tabs', 'manage_uploadForm')),
'manage_tabs', 'manage_uploadForm',
'document_src')),
('Access contents information', ('PROPFIND',)),
('Change permissions', ('manage_access',)),
('Change DTML Documents', ('manage_edit', 'manage_upload', 'PUT')),
......
......@@ -84,7 +84,7 @@
##############################################################################
"""DTML Method objects."""
__version__='$Revision: 1.8 $'[11:-2]
__version__='$Revision: 1.9 $'[11:-2]
from Globals import HTML, HTMLFile, MessageDialog
from string import join,split,strip,rfind,atoi,lower
......@@ -118,7 +118,8 @@ class DTMLMethod(cDocument, HTML, Explicit, RoleManager, Item_w__name__):
)
__ac_permissions__=(
('View management screens', ('manage', 'manage_main', 'manage_editForm',
'manage_tabs', 'manage_uploadForm')),
'manage_tabs', 'manage_uploadForm',
'document_src')),
('Access contents information', ('PROPFIND',)),
('Change DTML Methods', ('manage_edit', 'manage_upload', 'PUT')),
('Change proxy roles', ('manage_proxyForm', 'manage_proxy')),
......@@ -291,6 +292,10 @@ class DTMLMethod(cDocument, HTML, Explicit, RoleManager, Item_w__name__):
"Support for searching - the document's contents are searched."
return self.read()
def document_src(self, REQUEST, RESPONSE):
"""Return unprocessed document source."""
RESPONSE.setHeader('Content-Type', 'text/plain')
return self.read()
## Protocol handlers
......
......@@ -84,7 +84,7 @@
##############################################################################
"""Property sheets"""
__version__='$Revision: 1.25 $'[11:-2]
__version__='$Revision: 1.26 $'[11:-2]
import time, string, App.Management
from ZPublisher.Converters import type_converters
......@@ -543,17 +543,17 @@ class DAVProperties(Virtual, PropertySheet):
def dav__source(self):
vself=self.v_self()
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()
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 ''
def dav__supportedlock(self):
return '\n <n:lockentry>\n' \
' <d:lockscope><d:exclusive/></d:lockscope>\n' \
' <d:locktype><d:write/></d:locktype>\n' \
' </n:lockentry>\n'
' </n:lockentry>\n '
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