The WebDAV Content Provider
The WebDAV Content Provider (DCP) implements a content provider for the Universal Content Broker (UCB). An overview is provided at URL http://www.webdav.org. It provides access to WebDAV and standard HTTP servers. The DCP communicates with the server by using the WebDAV protocol that is an extension to the HTTP protocol, or by using the plain HTTP protocol if the server is not WebDAV-enabled.
The DCP provides two types of content: a folder or document that corresponds to a collection or non-collection, of nodes and leafs, in WebDAV, respectively.
- A DCP folder is a container for other DCP Folders or Documents.
- A DCP document is a container for document data or content. The data or content can be any type. A WebDAV server, like an HTTP server, does not mandate what type of data or content is contained within Documents. The type of data or content is defined by the
MediaTypeproperty which is different from the content type returned from the
MediaTypeproperty is mapped to the equivalent WebDAV property and the WebDAV server calculates the value.
Creation of New DCP Contents
DCP folders implement the interface com.sun.star.ucb.XContentCreator. DCP documents and DCP folders support the command "
insert". To create a new child of a DCP folder:
- The parent folder creates a new content by calling its
createNewContent()method. The content type for new folders is "
application/vnd.sun.star.webdav-collection". To create a new document, use the type string "
- Set a title for the new folder or document. The new child executes a "
setPropertyValues" command that sets the property Title to a non-empty value.
- The new child, not the parent, executes the command "
insert". This commits the creation process and makes the newly-created content on the WebDAV server persistent.
DAV resources that require authentication are accessed using the interaction handler mechanism of the UCB. The DAV content calls an interaction handler supplied by the client to let it handle an authentication request. The implementation of the interaction handler collects the username or password from a location, for example, a login dialog, and supplies this data as an interaction response.
In addition to the mandatory UCB properties, the DCP supports reading and writing all DAV live and dead properties. Some DAV live properties are mapped in addition to the UCB properties and conversely, that is, DAV:creationdate is mapped to
DateCreated. Adding and removing dead properties is also supported by the implementation of the
XPropertyContainer interface of a DCP content.
The DCP cannot determine the semantics of unknown properties, thus the values of such properties will always be presented as plain text, as they were returned from the server.
The following namespaces are known to the DCP:
Properties with these namespaces are addressed using a UCB property name which is the concatenation of namespace and name, that is, DAV:getcontentlength.
Dead properties with namespaces that are not well-known to the DCP are addressed using a special UCB property name string, that contains both the namespace and the property name. A special property name string must be similar to the following:
The DCP internally applies the namespace http://ucb.openoffice.org/dav/props/ to all UCB property names that:
- are not predefined by the UCB API.
- do not start with a well-known namespace.
- do not use the special property name string to encode namespace and name.
For example, a client does an
addProperty( .... "MyAdditionalProperty" ... ). The resulting DAV property has the name
MyAdditionalProperty, its namespace is http://ucb.openoffice.org/dav/props/. However, the DCP client never sees that namespace, but the client can always use the simple name
DAV / UCB Property Mapping
|DAV:resourcetype||(used to set IsFolder, IsDocument, ContentType)|
URL Scheme for DCP Contents
Each DCP content has an identifier corresponding to the following scheme:
<path> is a hierarchical path of the form
<name> is an encoded string according to the URL conventions.
It is also possible to use standard HTTP URLs. The implementation determines if the requested resource is DAV enabled.
vnd.sun.star.webdav://localhost/davhome/ vnd.sun.star.webdav://davserver.com/Documents/report.sdw http://davserver.com/Documents/report.sdw
Commands and Properties
|UCB Type (returned by XContent::getContentType )||Properties||Commands||Interfaces|
|same as DCP Folder, plus|
|Content on this page is licensed under the Public Documentation License (PDL).|