[Zope3-checkins] CVS: Zope3/src/zope/app/dav - adapter.py:1.4 configure.zcml:1.7 propfind.py:1.11

Sidnei da Silva sidnei@x3ng.com.br
Mon, 23 Jun 2003 13:17:33 -0400


Update of /cvs-repository/Zope3/src/zope/app/dav
In directory cvs.zope.org:/tmp/cvs-serv14183/src/zope/app/dav

Modified Files:
	adapter.py configure.zcml propfind.py 
Log Message:
1. Whitespace cleanup. 2. Docstring fixing. 3. Modified DAV code and tests to append '/' to the path if the last element is 'dir-like'. 4. Support for MKCOL with tests + functional tests. 5. Refactored DAV functional tests into a base class for reusing

=== Zope3/src/zope/app/dav/adapter.py 1.3 => 1.4 ===
--- Zope3/src/zope/app/dav/adapter.py:1.3	Fri Jun 13 13:41:16 2003
+++ Zope3/src/zope/app/dav/adapter.py	Mon Jun 23 13:17:02 2003
@@ -29,7 +29,10 @@
         self.context = object
 
     def displayname(self):
-        return zapi.name(self.context)
+        value = zapi.name(self.context)
+        if queryAdapter(self.context, IReadDirectory, None) is not None:
+            value = value + '/'
+        return value
 
     def creationdate(self):
         value = getAdapter(self.context, IDCTimes).created


=== Zope3/src/zope/app/dav/configure.zcml 1.6 => 1.7 ===
--- Zope3/src/zope/app/dav/configure.zcml:1.6	Thu May 22 09:58:53 2003
+++ Zope3/src/zope/app/dav/configure.zcml	Mon Jun 23 13:17:02 2003
@@ -10,6 +10,42 @@
 	 allowed_attributes="PROPFIND setDepth getDepth"
 	 />
 
+  <view for="zope.app.interfaces.http.INullResource"
+ 	name="MKCOL"
+	type="zope.publisher.interfaces.http.IHTTPPresentation"
+	factory=".mkcol.NullResource"
+	permission="zope.ManageContent"
+	allowed_attributes="MKCOL"
+  />
+
+  <view for="*"
+ 	name="MKCOL"
+	type="zope.publisher.interfaces.http.IHTTPPresentation"
+	factory=".mkcol.MKCOL"
+	permission="zope.ManageContent"
+	allowed_attributes="MKCOL"
+  />
+
+
+<!-- Disabled for now. Need to write tests before checking in. 
+  <view for="*"
+ 	name="MOVE"
+	type="zope.publisher.interfaces.http.IHTTPPresentation"
+	factory=".move.MOVE"
+	permission="zope.ManageContent"
+	allowed_attributes="MOVE"
+  />
+
+  <view for="*"
+ 	name="COPY"
+	type="zope.publisher.interfaces.http.IHTTPPresentation"
+	factory=".copy.COPY"
+	permission="zope.ManageContent"
+	allowed_attributes="COPY"
+  />
+
+-->
+
  <defaultView
        for="zope.schema.interfaces.IText"
        name="view"


=== Zope3/src/zope/app/dav/propfind.py 1.10 => 1.11 ===
--- Zope3/src/zope/app/dav/propfind.py:1.10	Thu Jun  5 16:13:08 2003
+++ Zope3/src/zope/app/dav/propfind.py	Mon Jun 23 13:17:02 2003
@@ -45,6 +45,8 @@
     def PROPFIND(self):
         request = self.request
         resource_url = str(getView(self.context, 'absolute_url', request))
+        if IReadContainer.isImplementedBy(self.context):
+            resource_url = resource_url + '/'
         data = request.bodyFile
         data.seek(0)
         response = ''