Extended MKCOL for Web Distributed Authoring and Versioning (WebDAV) Apple Inc.
1 Infinite Loop Cupertino CA 95014 USA [email protected] http://www.apple.com/
Applications webdav HTTP This specification extends the Web Distributed Authoring and Versioning (WebDAV) MKCOL (Make Collection) method to allow collections of arbitrary resourcetype to be created and to allow properties to be set at the same time.
WebDAV defines the HTTP method MKCOL. This method is used to create WebDAV collections on the server. However, several WebDAV-based specifications (e.g., CalDAV ) define "special" collections -- ones that are identified by additional values in the DAV:resourcetype property assigned to the collection resource or by other means. These "special" collections are created by new methods (e.g., MKCALENDAR). The addition of a new MKxxx method for each new "special" collection adds to server complexity and is detrimental to overall reliability due to the need to make sure intermediaries are aware of these methods. This specification defines an extension to the WebDAV MKCOL method that adds a request body allowing a client to specify WebDAV properties to be set on the newly created collection or resource. In particular, the DAV:resourcetype property can be used to create a "special" collection; alternatively, other properties can be used to create a "special" resource. This avoids the need to invent new MKxxx methods.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in . This document uses XML DTD fragments (Section 3.2 of ) as a purely notational convention. WebDAV request and response bodies cannot be validated by a DTD due to the specific extensibility rules defined in Section 17 of [RFC4918] and due to the fact that all XML elements defined by this specification use the XML namespace name "DAV:". In particular: Element names use the "DAV:" namespace. Element ordering is irrelevant unless explicitly stated. Extension elements (elements not already defined as valid child elements) may be added anywhere, except when explicitly stated otherwise. Extension attributes (attributes not already defined as valid for this element) may be added anywhere, except when explicitly stated otherwise. When an XML element type in the "DAV:" namespace is referenced in this document outside of the context of an XML fragment, the string "DAV:" will be prefixed to the element type. This document inherits, and sometimes extends, DTD productions from Section 14 of .
The WebDAV MKCOL request is extended to allow the inclusion of a request body. The request body is an XML document containing a single DAV:mkcol XML element as the root element. The Content-Type request header MUST be set appropriately for an XML body (e.g., set to "text/xml" or "application/xml"). XML-typed bodies for an MKCOL request that do not have DAV:mkcol as the root element are reserved for future usage. One or more DAV:set XML elements may be included in the DAV:mkcol XML element to allow setting properties on the collection as it is created. In particular, to create a collection of a particular type, the DAV:resourcetype XML element MUST be included in a DAV:set XML element and MUST specify the expected resource type elements for the new resource, which MUST include the DAV:collection element that needs to be present for any WebDAV collection. As per the PROPPATCH method (Section 9.2 of ), servers MUST process any DAV:set instructions in document order (an exception to the normal rule that ordering is irrelevant). If any one instruction fails to execute successfully, all instructions MUST fail (i.e., either all succeed or all fail). Thus, if any error occurs during processing, all executed instructions MUST be undone and a proper error result returned. Failure to set a property value on the collection MUST result in a failure of the overall MKCOL request -- i.e., the collection is not created. The response to an extended MKCOL request MUST be an XML document containing a single DAV:mkcol-response XML element, which MUST contain DAV:propstat XML elements with the status of each property when the request fails due to a failure to set one or more of the properties specified in the request body. The server MAY return a response body in the case where the request is successful, indicating success for setting each property specified in the request body. When an empty response body is returned with a success request status code, the client can assume that all properties were set. In all other respects, the behavior of the extended MKCOL request follows that of the standard MKCOL request.
A server supporting the features described in this document 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.
>> Request << <![CDATA[ OPTIONS /addressbooks/users/ HTTP/1.1 Host: addressbook.example.com ]]>
>> Response << <![CDATA[ HTTP/1.1 200 OK Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, REPORT, ACL DAV: 1, 2, 3, access-control, extended-mkcol Date: Sat, 11 Nov 2006 09:32:12 GMT Content-Length: 0 ]]>
As per Section 9.3.1 of .
WebDAV (, Section 16) defines preconditions and postconditions for request behavior. This specification adds the following precondition for the extended MKCOL request. valid-resourcetype DAV: Typically 403 (Forbidden) (precondition) -- The server MUST support the specified resourcetype value for the specified collection.
This example shows how the extended MKCOL request is used to create a collection of a fictitious type "special-resource". The response body is empty as the request completed successfully.
>> Request << <![CDATA[ MKCOL /home/special/ HTTP/1.1 Host: special.example.com Content-Type: application/xml; charset="utf-8" Content-Length: xxxx Special Resource ]]>
>> Response << <![CDATA[ HTTP/1.1 201 Created Cache-Control: no-cache Date: Sat, 11 Nov 2006 09:32:12 GMT ]]>
This example shows an attempt to use the extended MKCOL request to create a collection of a fictitious type "special-resource", which is not actually supported by the server. The response body shows that an error occurred specifically with the DAV:resourcetype property.
>> Request << <![CDATA[ MKCOL /home/special/ HTTP/1.1 Host: special.example.com Content-Type: application/xml; charset="utf-8" Content-Length: xxxx Special Resource ]]>
>> Response << <![CDATA[ HTTP/1.1 403 Forbidden Cache-Control: no-cache Date: Sat, 11 Nov 2006 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Content-Length: xxxx HTTP/1.1 403 Forbidden Resource type is not supported by this server HTTP/1.1 424 Failed Dependency ]]>
One of the goals of this extension is to eliminate the need for other extensions to define their own variant of MKCOL to create the special collections they need. This extension can be used as an alternative to existing MKxxx methods in other extensions as detailed below. If a server supports this extension and the other extension listed, then the server MUST support use of the extended MKCOL method to achieve the same result as the MKxxx method of the other extension.
CalDAV defines the MKCALENDAR method to create a calendar collection as well as to set properties during creation (Section 5.3.1 of ). The extended MKCOL method can be used instead by specifying both DAV:collection and CALDAV:calendar-collection XML elements in the DAV:resourcetype property, set during the extended MKCOL request.
The first example below shows an MKCALENDAR request containing a CALDAV:mkcalendar XML element in the request body and returning a CALDAV:mkcalendar-response XML element in the response body.
>> MKCALENDAR Request << <![CDATA[ MKCALENDAR /home/lisa/calendars/events/ HTTP/1.1 Host: calendar.example.com Content-Type: application/xml; charset="utf-8" Content-Length: xxxx Lisa's Events ]]>
>> MKCALENDAR Response << <![CDATA[ HTTP/1.1 201 Created Cache-Control: no-cache Date: Sat, 11 Nov 2006 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Content-Length: xxxx HTTP/1.1 200 OK ]]>
The second example shows the equivalent extended MKCOL request with the same request and response XML elements.
>> MKCOL Request << <![CDATA[ MKCOL /home/lisa/calendars/events/ HTTP/1.1 Host: calendar.example.com Content-Type: application/xml; charset="utf-8" Content-Length: xxxx Lisa's Events ]]>
>> MKCOL Response << <![CDATA[ HTTP/1.1 201 Created Cache-Control: no-cache Date: Sat, 11 Nov 2006 09:32:12 GMT Content-Type: application/xml; charset="utf-8" Content-Length: xxxx HTTP/1.1 200 OK ]]>
mkcol DAV: Used in a request to specify properties to be set in an extended MKCOL request, as well as any additional information needed when creating the resource. This XML element is a container for the information required to modify the properties on a collection resource as it is created in an extended MKCOL request.
<![CDATA[ <!ELEMENT mkcol (set+)> ]]>
mkcol-response DAV: Used in a response to indicate the status of properties that were set or failed to be set during an extended MKCOL request. This XML element is a container for the information returned about a resource that has been created in an extended MKCOL request.
<![CDATA[ <!ELEMENT mkcol-response (propstat+)> ]]>
This extension does not introduce any new security concerns beyond those already described in HTTP and WebDAV .
Thanks to Bernard Desruisseaux, Mike Douglass, Alexey Melnikov, Julian Reschke, and Simon Vaillancourt.
Key words for use in RFCs to Indicate Requirement Levels Harvard University
1350 Mass. Ave. Cambridge MA 02138 - +1 617 495 3864 [email protected]
Hypertext Transfer Protocol -- HTTP/1.1 Department of Information and Computer Science
University of California, Irvine Irvine CA 92697-3425 +1(949)824-1715 [email protected]
World Wide Web Consortium
MIT Laboratory for Computer Science, NE43-356 545 Technology Square Cambridge MA 02139 +1(617)258-8682 [email protected]
Compaq Computer Corporation
Western Research Laboratory 250 University Avenue Palo Alto CA 94305 [email protected]
World Wide Web Consortium
MIT Laboratory for Computer Science, NE43-356 545 Technology Square Cambridge MA 02139 +1(617)258-8682 [email protected]
Xerox Corporation
MIT Laboratory for Computer Science, NE43-356 3333 Coyote Hill Road Palo Alto CA 94034 [email protected]
Microsoft Corporation
1 Microsoft Way Redmond WA 98052 [email protected]
World Wide Web Consortium
MIT Laboratory for Computer Science, NE43-356 545 Technology Square Cambridge MA 02139 +1(617)258-8682 [email protected]
Calendaring Extensions to WebDAV (CalDAV) Apple Inc.
1 Infinite Loop Cupertino CA 95014 USA [email protected] http://www.apple.com/
Oracle Corporation
600 Blvd. de Maisonneuve West Suite 1900 Montreal QC H3A 3J2 CANADA [email protected] http://www.oracle.com/
CommerceNet
169 University Ave. Palo Alto CA 94301 USA [email protected] http://commerce.net/
HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV) Extensible Markup Language (XML) 1.0 (Fifth Edition)