You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Michael Homeijer <M....@devote.nl> on 2002/10/17 09:13:05 UTC

webDAV status - Separation of content and protocol

Hi,

I have build a prototype webapp that handles the webDAV protocol for my
application. With very little pipelines and files I was able to simulate a
file system that contains files from a folder in my webapp and contains
files that represent rows in a database table (most "files" will be
read-only for now).

At the bottom of this mail I included a snippet of my sitemap.

I you look at it, you'll see that the sitemap contains code that handles the
DAV protocol and code to represent my virtual filesystem on top of my Cocoon
uri space in DAV. I think my next step should be to seperate the generic
webDAV handling from my "filesystem" configuration.

I see some options for this:
1. Creating a DAVmap handler, like the sitemap handler that reads a davmap
configuration and represents this as a DAV filesystem.
2. Creating a generic DAV sitemap and mount that in my DAV root directory.
The dav sitemap uses information from the DAVmap from my root DAV directory
and represents this as a DAV filesystem.
3. Creating a DAVmap configuration and generating this into a DAV sitemap
that is specific for my URI space configuration. This sitemap can than be
mounted in a DAV directory.

Input appreciated.

TIA,
Michael

<map:match pattern="spike/**">
  <map:act type="requestmethod">
    <map:redirect-to uri="cocoon:/WEBDAV/{request-method}/{../1}"/>
  </map:act>
</map:match>

<map:match pattern="WEBDAV/PROPFIND/*">
  <map:act type="status">
    <map:generate type="directory" src="files"/>
    <map:transform src="propfind{../1}.xsl"/>
    <map:serialize type="xml"/>
  </map:act>
</map:match>

<map:match pattern="WEBDAV/OPTIONS/*">
  <map:act type="set-header">
    <map:parameter name="DAV" value="DAV:1"/>
    <map:parameter name="Allow" value="OPTIONS, GET, HEAD, POST, DELETE,
TRACE, PROPFIND, PROPPATCH, COPY, MOVE"/>
    <map:generate type="request"/>
    <map:serialize type="xml"/>
  </map:act>
</map:match>

<map:match pattern="WEBDAV/LOCK/*">
  <map:generate src="dummylock.xml"/>
  <map:serialize type="xml"/>
</map:match>

<map:match pattern="WEBDAV/GET/offerte/offerte(*.*).xml">
  <map:generate src="cocoon://main/offreren/offerte({1}.{2}).xml.debug"/>
  <map:serialize type="xml"/>
</map:match>
			
<map:match pattern="WEBDAV/GET/files/*.xml">
  <map:generate src="files/{1}.xml"/>
  <map:serialize type="xml"/>
</map:match>

<map:match pattern="WEBDAV/GET/files/*.txt">
  <map:read src="files/{1}.txt" mime-type="text/plain"/>
</map:match>

<map:match pattern="WEBDAV/PUT/files/*.xml">
  <map:generate type="streamdav"/>
  <map:transform src="writetofile.xsl">
    <map:parameter name="file" value="files/{1}.xml"/>
  </map:transform>
  <map:transform type="write-source"/>
  <map:transform src="dummydav.xsl"/>
  <map:serialize/>
</map:match>

---------------------------------------------------------------------
To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
For additional commands, email: cocoon-dev-help@xml.apache.org