[Zope-CVS] CVS: Packages/Moztop/moztopsupport/dav - configure.zcml:1.6 propfind.py:1.7
Sidnei da Silva
sidnei@x3ng.com.br
Tue, 25 Mar 2003 16:16:31 -0500
Update of /cvs-repository/Packages/Moztop/moztopsupport/dav
In directory cvs.zope.org:/tmp/cvs-serv1216/moztopsupport/dav
Modified Files:
configure.zcml propfind.py
Log Message:
small cleanup. should work a little better now~
=== Packages/Moztop/moztopsupport/dav/configure.zcml 1.5 => 1.6 ===
--- Packages/Moztop/moztopsupport/dav/configure.zcml:1.5 Mon Mar 24 17:23:04 2003
+++ Packages/Moztop/moztopsupport/dav/configure.zcml Tue Mar 25 16:16:00 2003
@@ -8,6 +8,14 @@
allowed_attributes="PROPFIND"
/>
+ <view for="*"
+ name="MKCOL"
+ type="zope.publisher.interfaces.http.IHTTPPresentation"
+ factory=".mkcol.MKCOL"
+ permission="zope.ManageContent"
+ allowed_attributes="MKCOL"
+ />
+
<view
for="zope.app.interfaces.content.zpt.IZPTPage"
type="zope.publisher.interfaces.http.IHTTPPresentation"
=== Packages/Moztop/moztopsupport/dav/propfind.py 1.6 => 1.7 ===
--- Packages/Moztop/moztopsupport/dav/propfind.py:1.6 Tue Mar 25 15:04:04 2003
+++ Packages/Moztop/moztopsupport/dav/propfind.py Tue Mar 25 16:16:00 2003
@@ -18,10 +18,11 @@
from xml.dom import minidom
from zope.component import getAdapter, getView, queryView
from zope.proxy.introspection import removeAllProxies
+from zope.schema import getFieldNamesInOrder
-from moztopsupport.dav.interfaces import IDAVSource
+from moztopsupport.dav.interfaces import IDAVSource, IDAVSchema
-_avail_props = ['displayname', 'creationdate', 'resourcetype']
+_avail_props = getFieldNamesInOrder(IDAVSchema)
class PROPFIND:
"""PROPFIND handler for all objects
@@ -59,13 +60,20 @@
self.setDepth(depth)
xmldoc = minidom.parse(data)
- source = xmldoc.getElementsByTagNameNS('DAV:', 'prop')
- if not source:
- # possibly allprop
- body = self._buildBody(self._buildProps(_avail_props))
+
+ propname = xmldoc.getElementsByTagNameNS('DAV:', 'propname')
+ if propname:
+ props = self._buildProps(_avail_props)
+ ok = self._buildOk(props)
+ body = self._buildBody(ok)
request.response.setStatus(207)
request.response.setBody(body)
return body
+
+ source = xmldoc.getElementsByTagNameNS('DAV:', 'prop')
+ if not source:
+ # allprop
+ return ''
source = source[0]
childs = [e for e in source.childNodes