Extended MKCOL for Web Distributed Authoring and Versioning (WebDAV)
updates
Extracted elements (15)
Extended MKCOL was introduced to eliminate the proliferation of new MKxxx methods (e.g., MKCALENDAR) for each new 'special' collection type. Each new method adds server complexity and requires intermediaries to be aware of it, making the overall system less reliable.
CalDAV's MKCALENDAR method can be replaced by an extended MKCOL request that specifies both DAV:collection and CALDAV:calendar-collection in the DAV:resourcetype property. The request and response XML differ (DAV:mkcol / DAV:mkcol-response vs. CALDAV:mkcalendar / CALDAV:mkcalendar-response), but the functional result is equivalent.
A server supporting extended MKCOL MUST include 'extended-mkcol' as a field in the DAV response header from an OPTIONS request on any URI that supports use of the extended MKCOL method.
If a server supports both extended MKCOL and another extension that defines a MKxxx method (e.g., CalDAV's MKCALENDAR), the server MUST support use of the extended MKCOL method to achieve the same result as the MKxxx method.
Servers MUST process DAV:set instructions in document order. If any one instruction fails, all instructions MUST fail (all-or-nothing); all executed instructions MUST be undone and a proper error result returned. Failure to set a property MUST result in failure of the overall MKCOL request — the collection is not created.
The Content-Type request header MUST be set appropriately for an XML body (e.g., 'text/xml' or 'application/xml') when sending an extended MKCOL request with an XML body.
The response to an extended MKCOL request MUST be an XML document containing a single DAV:mkcol-response element, which MUST contain DAV:propstat elements with the status of each property when the request fails due to a property-setting failure. The server MAY return a response body on success.
To create a collection of a particular type, the DAV:resourcetype XML element MUST be included in a DAV:set element and MUST specify the expected resource type elements, which MUST include DAV:collection for any WebDAV collection.
A new precondition DAV:valid-resourcetype (namespace DAV:) is defined for extended MKCOL. It applies when the server does not support the specified resourcetype value for the collection, typically returned with HTTP 403 Forbidden.
Capability discovery for extended MKCOL is performed via an OPTIONS request. A supporting server advertises 'extended-mkcol' in the DAV response header alongside other DAV compliance classes (e.g., '1, 2, 3, access-control, extended-mkcol').
DAV:mkcol-response XML element (namespace DAV:) is the root element of an extended MKCOL response body. It contains one or more DAV:propstat elements reporting the status of each property set or failed. Definition: <!ELEMENT mkcol-response (propstat+)>.
DAV:mkcol XML element (namespace DAV:) is the root element of an extended MKCOL request body. It is a container for one or more DAV:set elements specifying properties to be set when the collection is created. Definition: <!ELEMENT mkcol (set+)>.
The extended MKCOL request carries an XML request body whose root element is DAV:mkcol. The Content-Type request header MUST be set to 'text/xml' or 'application/xml'. XML bodies with any other root element are reserved for future use.
This extension does not introduce any new security concerns beyond those already described in HTTP (RFC 2616) and WebDAV (RFC 4918). Existing security models and access controls for MKCOL apply unchanged.
The extended MKCOL request body is an XML document with DAV:mkcol as root, containing one or more DAV:set > DAV:prop subtrees. The response body (when present) is an XML document with DAV:mkcol-response as root, containing DAV:propstat elements each holding DAV:prop, DAV:status, and optionally DAV:error and DAV:responsedescription.