Wednesday, August 15, 2007

WebDAV, cadaver and metadata

Recently I wanted to automate some document management processes against a Plone site and was trying to figure out how to do set the Title property on the newly created objects via WebDAV, using the cadaver command line client. This led me to look a little more closely at how WebDAV does properties. In fact it is not like a simple Python dictionary, rather there is a nested structure like a dictionary of dictionaries. Each application can have its own namespace. By default cadaver will set properties in its own custom namespace. So you need to use the set namespace command to use the Zope namespace identified by its namespace: http://www.zope.org/propsets/default The following example uses cadaver and creates a collection (folder) and sets the title property:
mkcol just_a_folder
set namespace http://www.zope.org/propsets/default
propset just_a_folder title “A long title”

2 comments:

Erik said...

Ah! Very useful information!

lijiale said...
This comment has been removed by a blog administrator.