The Apache Software Foundation is proud to present... Version: 2.1.12

WebDAV Block Samples

Orthogonal views: Content   Pretty content   Links

Back

Back - to Cocoon Samples main page
Back - to Cocoon Blocks Samples main page

Documentation

WebDAV - How to How to build a poor men's CMS with Cocoon and WebDAV
Setting up mod_dav - How to setup the Apache Web server as a WebDAV server

WebDAV protocol examples

NOTE: All these samples operate on the filesystem by default. Each sitemap has a global variable {staging} that is empty. Just put your content on a WebDAV server (i.e. copy this folder to your WebDAV server) and point this variable to the corresponding path. The WebDAV protocol is then used transparently. Now you can connect one or several additional Cocoon instances to your WebDAV repository to serve as publishing engines.

In fact you could use any of Cocoon's pseudo protocols that implements the TraversableSource and ModifiableSource interfaces.

step1 - Using the TraversableGenerator
step2 - Browsing the folder hierarchy
step3 - Changing content
step4 - Putting meta data separate. This sample puts the meta data in a separate file with a .meta extension. You could equally well put your meta data in a relational database by putting the SQLTransformer in the write pipeline and modifying the doc2write.xsl stylesheet accordingly. That way you can query your meta data via SQL later on. In the future there will be the possibility to store your meta data together with your document as a WebDAV property and query it via DASL (given you have a DASL enabled WebDAV server such as Catacomb)
step5 - Creating new content
Flow sample - Sample using flow

Serving WebDAV

WebDAV sitemap - This sample shows how to serve WebDAV clients from Cocoon (i.e. using Cocoon as a WebDAV server) - still some work in progress, but quite usable already: point your favourite WebDAV client to [Cocoon URL]/samples/blocks/webdav/davmap/repo/ and have fun browsing around!

DASL

DASL query - This sample shows how to run a query against a DASL enabled WebDAV server (such as Catacomb or Slide). It assumes that on localhost a DASL enables server is running with a resource path of /repos (the default place for Catacomb installs). If that's not the case, please change dasl/test.dasl.xml accordingly.
Query source - View the actual query source.

Protocol Level WebDAV Requests

This sample shows how to run a query against a WebDAV server (such as Catacomb or Slide). It assumes that on localhost a server is running with a resource path of /repos (the default place for Catacomb installs). If that's not the case, please change low-level/test-search.xml and other test-*.xml accordingly. Also, adjust your username/password there.

SEARCH Request - Searches a WebDAV server for everthing that is of content type "text/xml" and return the first 4 hits ordered by content type.
SEARCH Request source - View the actual query source.
PUT Request - PUT will add a new resource to the WebDAV server.
PUT Request source - View the actual query source.
PROPPATCH Request - PROPPATCH will set/remove WebDAV properties. Here, we set a sample property "http://cocoon.apache.org/samplenamespace/1.0:caption".
PROPPATCH Request source - View the actual query source.
PROPFIND Request - PROPFIND will select all properties given from the target itself and all immediate decendants (because "Depth" is 1).
PROPFIND Request source - View the actual query source.

WebDAV Source

Just as with the examples above, make sure a webdav server is running. You can use the sample below after using the PUT request above.

GETting a WebDAV resource - with the webdav:// protocol.

Resources

webdav.org - The webdav.org website
Catacomb - A DASL enabled WebDAV server