<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="MSHTML 5.00.3013.2600" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT size=2>Hello,</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>I have been taking a look on WebDAV, especially RFC 2518,
"HTTP Extension for Distributed Authoring -- WEBDAV". The extension
concerns four areas, queries and manipulation of properties, handling of
collections, locking and namespace operations. The two last areas are not
crucial.</FONT></DIV>
<DIV><FONT size=2>Each of these areas has its set of methods, which is
dispatched the same way as 'GET' and 'PUT', but usually with a XML-file appended
to the request.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>The twisted.web architecture of resources is well suited
for adding WebDAV. resource.Resource is fitting the term Resource as it is used
in the RFC. And twisted.web</FONT><FONT size=2>.server.Request's way of
handling requests/responses seems open-ended enough too add a
xml-reader/writer that concates the reply with XML (mimed). I will here try to
examine the changes that need to be done to twisted.web.server (and
protocols.http). Barely nothing else is examined, or needed.</FONT></DIV>
<DIV><FONT size=2>I will blend some explanations into my proposal in case my
understanding of twisted.* is wrong :).</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>The methods 'GET', 'PUT', 'HEAD', etc, is not touched by
WebDAV. These methods by definitions only concern 'files' (eg. GET
retrieves the entity described by the URI).</FONT></DIV>
<DIV><FONT size=2>The WebDAV-Resource '/foo/' is a Resource Collection, and
'/foo/file' is a member of the collection. If '/foo/faa/file' exists, then the
'faa'-collection needs to exist because the resource-tree has to be consistent.
The trailing slash tells if the files is a collection or not; this is not a rule
so the server may correct the client with a MOVED_PERMANENTLY in the same way
web.static does. The tree may however contain non-DAV-compliant resources, so
there won't be a need to force DAV onto everything. If a putChild should be put
into a collection is a discussion on its own :) (I will however mean that a
DAVResource should be a good starting point for making everything DAV, by
letting the stuff to go DAV inherit DAVResource)</FONT></DIV>
<DIV><FONT size=2></FONT> </DIV>
<DIV><FONT size=2>Since resource is the dispatcher of methods, then
WebDAV can be a simple twisted.web.resource. The request has arguments in
the Header and this gets conviently passed to the assigned resource. The
request may contain an XML with additional arguments as well.
Request.process seems to handle the task well, except that its 'POST'-handler
may be rewritten to collect the XML for most methods.</FONT></DIV>
<DIV><FONT size=2>'GET' is done in the regular way, no XML, just send the
entity the URI point at (for collections, send eg. the index.html. I don't know
the case here, really). This is resource-stuff. All the action will be in
resource.render (it will render the response XML, I guess).</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>Minor thing, yet: If a request take long time to accomplish
(eg. MOVE 100M of data over wire) there is a reply 102 PROCESSING which tells
the client to keep the line open and wait. I don't know how the details, but I
guess a NOT_DONE_YET may stop the block :) The problems with this is that it
will send a response later on, I guess this can be hacked in.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT size=2>
<DIV><FONT size=2>The changes that need to be done to protocols.http is simply
adding the new error-codes, since that is all that is in it :) If we want to add
namespace operations (MOVE, COPY) the http-client needs to be made
DAV-compliant. Note that COPY/MOVE also can be done by FTP too
;)</FONT></DIV>
<DIV> </DIV></FONT></DIV>
<DIV><FONT size=2>The changes:</FONT></DIV>
<DIV><FONT size=2>Request.resource: retrieve the XML in the
request.</FONT></DIV>
<DIV><FONT size=2>Handle the response 102 PROCESSING</FONT></DIV>
<DIV><FONT size=2>protocols.http: Errorcodes</FONT></DIV>
<DIV><FONT size=2>The conclusion:</FONT></DIV>
<DIV><FONT size=2>Everything will happen in the DAV-Resource.
:)</FONT></DIV></BODY></HTML>