draft-ietf-webdav-protocol-01.txt   draft-ietf-webdav-protocol-02.txt 
WEBDAV Working Group Y. Goland, Microsoft WEBDAV Working Group Y. Y. Goland, Microsoft
INTERNET-DRAFT E. J. Whitehead, Jr., U.C. Irvine INTERNET-DRAFT E. J. Whitehead, Jr., U.C. Irvine
<draft-ietf-webdav-protocol-01> Asad Faizi, Netscape <draft-ietf-webdav-protocol-02> A. Faizi, Netscape
Stephen R. Carter, Novell S. R Carter, Novell
Del Jensen, Novell D. Jensen, Novell
Expires January 15, 1997 July 13, 1997 Expires March 8, 1998 September 3, 1997
Extensions for Distributed Authoring and Versioning Extensions for Distributed Authoring and Versioning
on the on the
World Wide Web -- WEBDAV World Wide Web -- WEBDAV
Status of this Memo Status of this Memo
This document is an Internet-Draft. Internet-Drafts are working This document is an Internet-Draft. Internet-Drafts are working
documents of the Internet Engineering Task Force (IETF), its documents of the Internet Engineering Task Force (IETF), its
areas, and its working groups. Note that other groups may also areas, and its working groups. Note that other groups may also
skipping to change at line 42 skipping to change at line 42
Distribution of this document is unlimited. Please send comments Distribution of this document is unlimited. Please send comments
to the Distributed Authoring and Versioning (WEBDAV) working to the Distributed Authoring and Versioning (WEBDAV) working
group at <w3c-dist-auth@w3.org>, which may be joined by sending a group at <w3c-dist-auth@w3.org>, which may be joined by sending a
message with subject "subscribe" to <w3c-dist-auth- message with subject "subscribe" to <w3c-dist-auth-
request@w3.org>. request@w3.org>.
Discussions of the WEBDAV working group are archived at Discussions of the WEBDAV working group are archived at
<URL:http://www.w3.org/pub/WWW/Archives/Public/w3c-dist-auth>. <URL:http://www.w3.org/pub/WWW/Archives/Public/w3c-dist-auth>.
Abstract Abstract
This Document specifies a set of methods and content-types This Document specifies a set of methods and content-types
ancillary to HTTP/1.1 for the management of resource properties, ancillary to HTTP/1.1 for the management of resource properties,
simple name space manipulation, simple name space manipulation, simple resource locking
simple resource locking (collision avoidance) and resource (collision avoidance) and resource version control.
version control.
Table of Contents Table of Contents
Abstract Abstract
1 Terminology 1 Terminology
2 Data Model and Methods for DAV Properties 2 Data Model and Methods for DAV Properties
2.1 Introduction 2.1 Introduction
2.1.1............................The DAV Property 2.1.1 The DAV Property
2.1.2.................Existing Metadata Proposals 2.1.2 Existing Metadata Proposals
2.1.3.................Properties and HTTP Headers 2.1.3 Properties and HTTP Headers
2.2 A Property Model for HTTP Resources 2.2 A Property Model for HTTP Resources
2.2.1....................................Overview 2.2.1 Overview
2.2.2..........................Property Namespace 2.2.2 Property Namespace
2.2.3.........................Property Attributes 2.3 Schemas
2.3.1 PropSchema XML Element
2.3.2 DTD XML Element
2.3.3 DefinedProps XML Element
2.2.4.....................................Schemas 2.3.4 PropEntries XML Element
2.3 DAV Schema 2.3.5 Live XML Element
2.3.1..............................Live Attribute 2.4 DAV Schema
2.3.2..........................ReadOnly Attribute 2.4.1 DAV Property
2.3.3....................................Elements 2.4.2 Level XML Element
2.4 Property Identifiers 2.4.3 Prop XML element
2.4.1..........................Problem Definition 2.4.4 PropLoc XML Attribute
2.4.2........................Solution Requirement 2.4.5 Example
2.4.3...........................DAV URL Parameter 2.5 Property Identifiers
2.4.4...............................Name Encoding 2.5.1 Problem Definition
2.4.5...........Compatibility with legacy systems 2.6 Link XML Element
2.5 Link XML Element 2.6.1 Problem Description
2.5.1.........................Problem Description 2.6.2 Solution Requirements
2.5.2.......................Solution Requirements 2.6.3 Link XML Element
2.5.3............................Link XML Element 2.6.4 Src XML Element
2.5.4.............................Src XML Element 2.6.5 Dst XML Element
2.5.5.............................Dst XML Element 2.6.6 Example
2.5.6.....................................Example 2.7 Multi-Status Response
2.6 Properties and Methods 2.7.1 Problem Definition
2.6.1......................................DELETE 2.7.2 Solution Requirements
2.6.2.........................................GET 2.7.3 Multi-Status Response
2.6.3............................PROPPATCH Method 2.8 Properties and Methods
2.6.4.........................................PUT 2.8.1 DELETE
2.6.5......................................SEARCH 2.8.2 GET
2.8.3 PROPPATCH
2.8.4 PUT
2.8.5 PROPFIND
3 A Proposal for Collections of Web Resources and Name Space 3 A Proposal for Collections of Web Resources and Name Space
Operations Operations
3.1 Observations on the HTTP Object Model 3.1 Observations on the HTTP Object Model
3.1.1........................Collection Resources 3.1.1 Collection Resources
3.1.2Creation and Retrieval of Collection Resources 3.1.2Creation and Retrieval of Collection Resources
3.1.3.......Source Resources and Output Resources 3.1.3 Source Resources and Output Resources
3.2 MKCOL Method 3.2 MKCOL Method
3.2.1.........................Problem Description 3.2.1 Problem Description
3.2.2.......................Solution Requirements 3.2.2 Solution Requirements
3.2.3.....................................Request 3.2.3 Request
3.2.4....................................Response 3.2.4 Response
3.2.5.....................................Example 3.2.5 Example
3.3 INDEX Method 3.3 INDEX Method
3.3.1.........................Problem Description 3.3.1 Problem Description
3.3.2.......................Solution Requirements 3.3.2 Solution Requirements
3.3.3.................................The Request 3.3.3 The Request
3.3.4................................The Response 3.3.4 The Response
3.3.5.......................Response Message Body 3.3.5 Response Message Body
3.3.6.....................................Example 3.3.6 Example
3.4 Behavior of RFC 2068 Methods on Collections 3.4 Behavior of RFC 2068 Methods on Collections
3.4.1...................GET, HEAD for Collections 3.4.1 GET, HEAD for Collections
3.4.2........................POST for Collections 3.4.2 POST for Collections
3.4.3.........................PUT for Collections 3.4.3 PUT for Collections
3.4.4......................DELETE for Collections 3.4.4 DELETE for Collections
3.5 COPY Method 3.5 COPY Method
3.5.1.........................Problem Description 3.5.1 Problem Description
3.5.2.......................Solution Requirements 3.5.2 Solution Requirements
3.5.3.................................The Request 3.5.3 The Request
3.5.4................................The Response 3.5.4 The Response
3.5.5....................................Examples 3.5.5 Examples
3.6 MOVE Method 3.6 MOVE Method
3.6.1.........................Problem Description 3.6.1 Problem Description
3.6.2.......................Solution Requirements 3.6.2 Solution Requirements
3.6.3.................................The Request 3.6.3 The Request
3.6.4................................The Response 3.6.4 The Response
3.6.5....................................Examples 3.6.5 Examples
3.7 Multi-Status Response 3.7 ADDREF Method
3.7.1..........................Problem Definition 3.7.1 Problem Definition
3.7.2.......................Solution Requirements
3.7.3.......................Multi-Status Response
3.7.4.....................................Example
3.8 ADDREF Method 3.7.2 Solution Requirements
3.8.1..........................Problem Definition 3.7.3 The Request
3.8.2.......................Solution Requirements 3.8 DELREF Method
3.8.3.................................The Request 3.8.1 Problem Definition
3.9 DELREF Method 3.8.2 Solution Requirements
3.9.1..........................Problem Definition 3.8.3 The Request
3.9.2.......................Solution Requirements 3.9 PATCH Method
3.9.3.................................The Request 3.9.1 Problem Definition
3.10 PATCH Method 3.9.2 Solution Requirements
3.10.1.........................Problem Definition 3.9.3 The Request
3.10.2......................Solution Requirements 3.9.4 application/XML elements for PATCH
3.10.3................................The Request 3.9.5 The Response
3.10.4.........application/XML elements for PATCH 3.9.6 Examples
3.10.5...............................The Response 3.10 Headers
3.10.6...................................Examples 3.10.1 Depth
3.11 Headers 3.10.2 Destination
3.11.1......................................Depth 3.10.3 Enforce-Live-Properties
3.11.2................................Destination 3.10.4 Duplicate-Properties
3.11.3....................Enforce-Live-Properties 3.10.5 Overwrite
3.11.4.......................Duplicate-Properties 3.10.6 Destroy Header
3.11.5..................................Overwrite 3.10.7 Mandatory header
3.11.6.............................Destroy Header 3.10.8 Collection-Member Header
3.11.7...................Collection-Member Header 3.11 Links
3.12 Links 3.11.1 Source Link Property Type
3.12.1..................Source Link Property Type
4 State Tokens 4 State Tokens
4.1 Overview 4.1 Overview
4.1.1.........................Problem Description 4.1.1 Problem Description
4.1.2.......................Solution Requirements 4.1.2 Solution Requirements
4.2 State Token Syntax 4.2 State Token Syntax
4.3 State Token Conditional Headers 4.3 State Token Conditional Headers
4.3.1..............................If-State-Match 4.3.1 If-State-Match
4.3.2.........................If-None-State-Match 4.3.2 If-None-State-Match
4.4 State Token Header 4.4 State Token Header
4.5 E-Tags 4.5 E-Tags
5 Locking 5 Locking
5.1 Problem Description - Overview 5.1 Problem Description - Overview
5.1.1..................Exclusive Vs. Shared Locks 5.1.1 Exclusive Vs. Shared Locks
5.1.2............................Required Support 5.1.2 Required Support
5.2 LOCK Method 5.2 LOCK Method
5.2.1...................................Operation 5.2.1 Operation
5.2.2The Effect of Locks on Properties and Containers 5.2.2Effect of Locks on Properties and Containers
5.2.3................Locking Replicated Resources 5.2.3 Locking Replicated Resources
5.2.4..............Interaction with other Methods 5.2.4 Interaction with other Methods
5.2.5....................Lock Compatibility Table 5.2.5 Lock Compatibility Table
5.2.6................................Status Codes 5.2.6 Status Codes
5.2.7.....................................Example 5.2.7 Example
5.2.8....................Lock-Info Request Header 5.2.8 Lock-Info Request Header
5.2.9........................Owner Request Header 5.2.9 Owner Request Header
5.2.10............................Time-Out Header 5.2.10 Time-Out Header
5.2.11.........................State-Token Header 5.2.11 State-Token Header
5.3 Write Lock 5.3 Write Lock
5.4 Lock Tokens 5.4 Lock Tokens
5.4.1.........................Problem Description 5.4.1 Problem Description
5.4.2...........................Proposed Solution 5.4.2 Proposed Solution
5.4.3.......................Lock Token Definition 5.4.3 Lock Token Definition
5.5 UNLOCK Method 5.5 UNLOCK Method
5.5.1..........................Problem Definition 5.5.1 Problem Definition
5.5.2.....................................Example 5.5.2 Example
5.6 Discovery Mechanisms 5.6 Discovery Mechanisms
5.6.1.........................Lock Type Discovery 5.6.1 Lock Type Discovery
5.6.2.......................Active Lock Discovery 5.6.2 Active Lock Discovery
6 Version Control 6 Version Control
7 Internationalization Support 7 Internationalization Support
8 Security Considerations 8 Security Considerations
9 Acknowledgements 9 Acknowledgements
10 References 10 References
11 Authors' Addresses 11 Authors' Addresses
Appendix 1 - Content Type Application/XML
Syntax
XML element
Entity-Name
Close
XML Encoding
Markup Modifier
XML Syntax Shorthand
Appendix 2 - Parameter Syntax for Content-Type Application/XML
Schema Content-Type Parameter
Appendix 3 – URI Path Encoding
Problem Definition
Solution Requirement
Path Component
Appendix 4 - XML URI
Appendix 5 - XML elements
Ref XML element
Namespace
Namespace XML element
AS XML element
Required XML element
The XML URI and Namespace
1 Terminology 1 Terminology
Collection - A resource that contains member resources. Collection - A resource that contains member resources.
Member Resource - a resource referred to by a collection. There Member Resource - a resource referred to by a collection. There
are two types of member resources: external and internal. are two types of member resources: external and internal.
Internal Member Resource - the name given to a member resource of Internal Member Resource - the name given to a member resource of
a collection whose URI is relative to the URI of the collection. a collection whose URI is relative to the URI of the collection.
External Member Resource - a member resource with an absolute URI External Member Resource - a member resource with an absolute URI
that is not relative to its parent’s URI. that is not relative to its parent’s URI.
skipping to change at line 232 skipping to change at line 212
Member Resource - a resource referred to by a collection. There Member Resource - a resource referred to by a collection. There
are two types of member resources: external and internal. are two types of member resources: external and internal.
Internal Member Resource - the name given to a member resource of Internal Member Resource - the name given to a member resource of
a collection whose URI is relative to the URI of the collection. a collection whose URI is relative to the URI of the collection.
External Member Resource - a member resource with an absolute URI External Member Resource - a member resource with an absolute URI
that is not relative to its parent’s URI. that is not relative to its parent’s URI.
Properties – Also known as small-chunk metadata, a hierarchical Properties - A set of name/value pairs that contain descriptive
set of name/value pairs that describe a resource. information about a resource.
Live Properties Properties whose semantics and syntax are Live Properties - Properties whose semantics and syntax are
enforced by the server. For example, a live “read-only” property enforced by the server. For example, a live "read-only" property
that is enforced by the server would disallow PUTs to the that is enforced by the server would disallow PUTs to the
associated resource. associated resource.
Dead properties Properties whose semantics and syntax are not Dead properties - Properties whose semantics and syntax are not
enforced by the server. A dead “read-only” property would not be enforced by the server. A dead "read-only" property would not be
enforced by the server and thus would not be used by the server as enforced by the server and thus would not be used by the server
a reason to disallow a PUT on the associated resource. as a reason to disallow a PUT on the associated resource.
2 Data Model and Methods for DAV Properties 2 Data Model and Methods for DAV Properties
2.1 Introduction 2.1 Introduction
2.1.1 The DAV Property 2.1.1 The DAV Property
Properties are pieces of data that describe the state of a Properties are pieces of data that describe the state of a
resource. Properties are data about data. The term property is resource. Properties are data about data. The term property is
used within this specification to disambiguate the concept from used within this specification to disambiguate the concept from
the overloaded terms “metadata” and “attribute”. the overloaded terms "metadata" and "attribute".
Properties are used within distributed authoring environments to Properties are used within distributed authoring environments to
provide for efficient discovery and management of resources. For provide for efficient discovery and management of resources. For
example, a 'subject' property might allow for the indexing of all
example, a ‘subject’ property might allow for the indexing of all resources by their subject, and an 'author' property might allow
resources by their subject, and an ‘author’ property might allow
for the discovery of what authors have written which documents. for the discovery of what authors have written which documents.
2.1.2 Existing Metadata Proposals 2.1.2 Existing Metadata Proposals
Properties have a long played an essential role in the maintenance Properties have a long played an essential role in the
of large document repositories, and many current proposals contain maintenance of large document repositories, and many current
some notion of a property. These include PICS [Miller et al., proposals contain some notion of a property. These include PICS
1996], PICS-NG, the Rel/Rev draft [Maloney, 1996], Web [Miller et al., 1996], PICS-NG, the Rel/Rev draft [Maloney,
Collections, XML [Bray, 1997], several proposals on representing 1996], Web Collections, XML [Bray, Sperberg-McQueen, 1997],
relationships within HTML, digital signature manifests (DCMF), and several proposals on representing relationships within HTML,
a position paper on Web metadata architecture [Berners-Lee, 1997]. digital signature manifests (DCMF), and a position paper on Web
metadata architecture [Berners-Lee, 1997].
Some proposals come from a digital library perspective. These Some proposals come from a digital library perspective. These
include the Dublin Core [Weibel et al., 1995] metadata set and the include the Dublin Core [Weibel et al., 1995] metadata set and
Warwick Framework [Lagoze, 1996], a container architecture for the Warwick Framework [Lagoze, 1996], a container architecture
different metadata schemas. The literature includes many examples for different metadata schemas. The literature includes many
of metadata, including MARC [MARC, 1994], a bibliographic metadata
format, RFC 1807 [Lasher, Cohen, 1995], a technical report examples of metadata, including MARC [MARC, 1994], a
bibliographic format employed by the Dienst system, and the bibliographic metadata format, RFC 1807 [Lasher, Cohen, 1995], a
proceedings from the first IEEE Metadata conference describe many technical report bibliographic format employed by the Dienst
community-specific metadata sets. system, and the proceedings from the first IEEE Metadata
conference describe many community-specific metadata sets.
Participants of the 1996 Metadata II Workshop in Warwick, UK Participants of the 1996 Metadata II Workshop in Warwick, UK
[Lagoze, 1996], noted that, "new metadata sets will develop as the [Lagoze, 1996], noted that, "new metadata sets will develop as
networked infrastructure matures" and "different communities will the networked infrastructure matures" and "different communities
propose, design, and be responsible for different types of will propose, design, and be responsible for different types of
metadata." These observations can be corroborated by noting that metadata." These observations can be corroborated by noting that
many community-specific sets of metadata already exist, and there many community-specific sets of metadata already exist, and there
is significant motivation for the development of new forms of is significant motivation for the development of new forms of
metadata as many communities increasingly make their data metadata as many communities increasingly make their data
available in digital form, requiring a metadata format to assist available in digital form, requiring a metadata format to assist
data location and cataloging. data location and cataloging.
2.1.3 Properties and HTTP Headers 2.1.3 Properties and HTTP Headers
Properties already exist, in a limited sense, within HTTP through Properties already exist, in a limited sense, within HTTP through
the use of message headers. However, in distributed authoring the use of message headers. However, in distributed authoring
environments a relatively large number of properties are needed to environments a relatively large number of properties are needed
fully describe the state of a resource, and setting/returning them to describe the state of a resource, and setting/returning them
all through HTTP headers is inefficient. Thus a mechanism is all through HTTP headers is inefficient. Thus a mechanism is
needed which allows a principal to identify a set of properties in needed which allows a principal to identify a set of properties
which the principal is interested and to then set or retrieve just in which the principal is interested and to then set or retrieve
those properties. just those properties.
2.2 A Property Model for HTTP Resources 2.2 A Property Model for HTTP Resources
2.2.1 Overview 2.2.1 Overview
The DAV property model is based on name/value/attribute triples. The DAV property model is based on name/value doubles. The name
The name of a property identifies the property’s syntax and of a property identifies the property's syntax and semantics, and
semantics, and provides an address with which to refer to a provides an address with which to refer to a property. The name
property. The value of a property is an octet stream. The and value of a property is expressed as a well-formed XML
attributes of a property are a set of name/value pairs that are element, where the name of the property is the name of the XML
not directly addressable. Attributes are retrieved in conjunction element, and the value of the property MUST be either blank, or a
with retrieving a property, and are set when changing a property’s well-formed XML element value.
value. This specification defines two attributes, live, which
indicates if the property’s syntax and semantics is enforced by
the server, and readonly, which indicates that the property’s
value may be retrieved but not set.
2.2.2 Property Namespace 2.2.2 Property Namespace
2.2.2.1 Problem Definition 2.2.2.1 Problem Definition
The requirement is to be able to associate a value with a property The requirement is to be able to associate a value with a
name on a resource and to be able to directly address that value. property name on a resource and to be able to directly address
that value.
2.2.2.2 Solution Requirement 2.2.2.2 Solution Requirement
Ideally a property namespace should work well with extant property Ideally a property namespace should work well with extant
implementations as well as database systems. The DAV property property implementations as well as database systems. The DAV
namespace has been specified with the following two facts in mind: property namespace has been specified with the following two
facts in mind:
Namespaces associated with flat file systems are certainly · Namespaces associated with flat file systems are ubiquitous.
ubiquitous. · The majority of databases use a fixed schema mechanism.
The last point makes efficient implementation of hierarchical
properties difficult. Specifically, each property has a random
set of children; the best a relational database can do is provide
Many databases use a fixed schema mechanism, which makes a table with name and value, where the value is a series of
efficient implementation of hierarchical properties indexes into other tables and each index represents a specific
difficult. Specifically, each property has a random set of value. However most RDBS do not provide for table pointers, only
children; the best a relational database can do is provide index values. Such a system would have to be jury-rigged to
a table with name and value, where the value is a series handle table pointers. In addition, indexing systems are
of indexes into other tables and each index represents a optimized for a small set of relatively large tables;
specific value. However most RDBS do not provide for table hierarchical property systems tend toward many properties, each
pointers, only index values. Such a system would have to with different numbers and types of children, thus potentially
be jury-rigged to handle table pointers. In addition, requiring a table for each child.
indexing systems are optimized for a small set of
relatively large tables; hierarchical property systems
tend toward many properties, each with different numbers
and types of children, thus potentially requiring a table
for each child.
It would seem best to implement a flat property namespace, It would seem best to implement a flat property namespace,
inducing a natural isomorphism between DAV and most native inducing a natural isomorphism between DAV and most native file
file systems. Adopting such a model should not restrict RDBS systems. Adopting such a model will not restrict RDBS from taking
from taking full advantage of their search facilities. full advantage of their search facilities.
However, it seems that future trends might be toward However, it seems that future trends might be toward hierarchical
hierarchical properties. As such, DAV requirements [] properties. Therefore, DAV requirements [Slein et al.] stipulate
stipulate that the design of the flat property system MUST that the design of the flat property system MUST be such that it
be such that it will be possible to add true hierarchical will be possible to add true hierarchical properties later
properties later without breaking downlevel clients. without breaking downlevel clients. Specifically, a flat client
Specifically, a flat client MUST be able to speak to a MUST be able to speak to a hierarchical server and a hierarchical
hierarchical server and a hierarchical client MUST be able client MUST be able to speak to a flat server. Worst case either
to speak to a flat server. Worst case either way MUST be way MUST be that the request fails.
that the request fails.
2.2.2.3 Property Names 2.2.2.3 Property Names
A property name identifies both the syntax and semantics of A property name identifies both the syntax and semantics of the
the property’s value. It is critical that property names do property's value. It is critical that property names do not
not collide, e.g., two principals defining the same property collide, e.g., two principals defining the same property name
name with two different meanings. with two different meanings.
The URI framework provides for a mechanism to prevent
namespace collision and for varying degrees of
administrative control. Rather than reinvent these desirable
features, DAV properties make use of them by requiring that
all DAV property names MUST be URIs.
The property namespace is flat, that is, it is not possible
to string together a series of property names in order to
refer to a hierarchy of properties. Thus it is possible to
refer to a property A but not a property A/B.
2.2.3 Property Attributes
The attributes of a property provide information about the
property. Note that a property contains information about a
resource.
Attributes consist of name/value pairs whose value MUST be a The URI framework provides a mechanism to prevent namespace
string. Attributes are not directly addressable, rather they collision and for varying degrees of administrative control.
are retrieved and defined in the context of other property Rather than reinvent these desirable features, DAV properties
operations. For example, if one retrieves a property value, make use of them by requiring that all DAV property names MUST be
the attributes will also be returned. If one sets a property URIs. Since a property is also an XML element, the name of the
value, one may also specify the values for its attributes. XML element is a URI.
All attributes on a server MUST be live. This means that the The property namespace is flat, that is, it is not possible to
server MUST only record attributes with syntax and semantics string together a series of property names in order to refer to a
the server understands and enforces. This normally means hierarchy of properties. Thus it is possible to refer to a
that clients can not define new attributes on a property; property B but not a property A/B, where is also a property
clients may only make use of the attributes supported by the defined on the resource.
server.
If a client submits an attribute when setting a property Finally, it is not possible to define the same property twice as
then the server MUST NOT record the property unless it this would cause a collision in the resource's property
accepts the values specified for the corresponding namespace.
attributes. Thus, if a property value is submitted with a
live attribute then the server MUST NOT record the value
unless the server understands and enforces the syntax and
semantics of the property.
2.2.4 Schemas 2.3 Schemas
A schema is a group of property names, attributes, and XML A schema is a group of property names and XML elements.
elements.
It is often useful to indicate support for a particular Schema discovery is used to determine if a system supports a
schema in a request or a response. Schema discovery is also group of properties or XML elements. A property does not
useful for determining if a system supports a group of
properties, attributes, or XML elements. A property does not
necessarily contain sufficient information to identify any necessarily contain sufficient information to identify any
schema(s) to which it may belong. schema(s) to which it may belong.
As with property names, schemas MUST use URIs as their As with property names, schemas MUST use URIs as their names.
names.
2.3 DAV Schema
The DAV Schema is specified as
http://www.ietf.org/standards/dav/. This schema is used to
indicate support for
properties and attributes that can be defined on a resource
and
XML elements that can be returned in responses.
All DAV compliant servers MUST support the DAV schema.
2.3.1 Live Attribute
Name: http://www.ietf.org/standards/dav/live A resource declares its support for a schema by defining a
property whose name is the same as the schema's. The property
SHOULD contain the PropSchema XML element.
Purpose: To indicate that the property has its syntax and 2.3.1 PropSchema XML Element
semantics enforced by the resource on which it is recorded.
Name: http://www.ietf.org/standards/dav/PropSchema
Purpose: To provide information about properties
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: Any
Values= [DTD] [DefinedProps]
Description:This property contains the definition of the schema.
This definition consists of two parts. A DTD element that
contains a DTD that declares all XML elements and DefinedProps
that defines any properties associated with the schema. As with
all XML it is possible to add extra XML elements. Therefore
schemas may define extra XML elements which are to be included
with their values.
Parent: Any property 2.3.2 DTD XML Element
Values= “=” <”><”>
Description: This attribute is used to indicate that the
resource expressing the property understands and enforces
the syntax and semantics of the property. The absence of the
Live attribute in a response indicates to the client that
the corresponding property does not have its syntax and
semantics enforced by the resource on which it is recorded.
If a live attribute is included when setting the value of a
property then the server SHOULD set the property if the
property will be live and MUST NOT set the property if the
property will not be live.
2.3.2 ReadOnly Attribute
Name: http://www.ietf.org/standards/dav/readonly
Purpose: To indicate that a property can be retrieved, but
not set through the property mechanism.
Name: http://www.ietf.org/standards/dav/DTD
Purpose: To contain the DTD for XML elements associated with the
schema.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: Any
Values: XML Declaration statements
Parent: Any property 2.3.3 DefinedProps XML Element
Values= “=” <”><”>
Description: This attribute is used to indicate that the
property can only be retrieved, not set through the property
mechanism. This attribute is not meant as an access control
mechanism but rather to reflect the fact that the property
is not designed to have its value set through the property
mechanism. If this attribute is included when setting the
value of a property, the request MUST be rejected since
accepting the value would violate ReadOnly attribute. A
server MUST NOT effect a property protocol element that is
inconsistent or ill-defined with respect to the element’s
attribute state, were it to be expressed.
2.3.3 Elements
2.3.3.1 Prop XML element
Name: http://www.ietf.org/standards/dav/prop
Purpose: To specify the name and value of a property
Name: http://www.ietf.org/standards/dav/DefinedProps
Purpose: To contain a list of properties defined by the schema.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: Any Parent: Any
Values= 1*PropEntries
Values: PropName PropValue 2.3.4 PropEntries XML Element
2.3.3.2 PropName XML element
Name: http://www.ietf.org/stnadards/dav/name
Purpose: To specify the name of a property, which MUST be a
URI.
Name: http://www.ietf.org/standards/dav/PropEntries
Purpose: To contain the name of a defined property, the DTD of
its value, and its live/dead status.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: DefinedProps
Values= Prop [DTD] [Live]
Description:Prop contains the name of the property. The DTD
contains the DTD of the property's value. Live, if defined,
indicates that the property has semantics and syntax that are
enforced by the server.
Parent: Prop 2.3.5 Live XML Element
Values: URI
2.3.3.3 PropValue XML element
Name: http://www.ietf.org/standards/dav/propvalue
Purpose: To specify the value of a property.
Name: http://www.ietf.org/standards/dav/Live
Purpose: If present this indicates the server MUST enforce the
syntax and semantics of the property.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: PropEntries
Parent: Prop 2.4 DAV Schema
Values: The contents of a property.
2.4 Property Identifiers
2.4.1 Problem Definition
The addition of DAV properties to the HTTP object model
introduces the need for a mechanism to unambiguously refer
to either the body of the resource or the properties of a
resource.
2.4.2 Solution Requirement
The mechanism used for referring to the resource body must
also be usable for referring to the resource’s properties,
such that even non-DAV aware clients can retrieve DAV
properties.
2.4.3 DAV URL Parameter
To allow for the specification of property information in
the context of an http scheme URL, a switch is needed. The
switch indicates that following path segments specify a
property location. To this end the “DAV” param is introduced
for use with http scheme URLs. The path segment to the right
of the DAV param MUST be formatted according to the XML Link
standard, described in Appendix 3.
2.4.4 Name Encoding
Properties on a resource are given URIs as a name. Thus, in The DAV Schema is specified as
order to be able to refer to a property one must be able to http://www.ietf.org/standards/dav/. This schema is used to
put the property’s URI into an HTTP URI. indicate support for
· properties that may be defined on a resource and
· XML elements that may be returned in responses.
For example, the author property with full name 2.4.1 DAV Property
http://www.w3.org/standards/z39.50/author is defined on
http://somewhere.com/resource.
To create a reference to the author one would perform the Name: http://www.ietf.org/standards/dav
following steps. Purpose: Defines support for the DAV schema and protocol.
Schema: http://www.ietf.org/standards/dav/
Values= PropSchema Level
Description:This property indicates that the resource supports
the DAV schema and protocol to the level indicated. THE VALUE IN
PROPSCHEMA IS TBD, WE NEED TO PROVIDE IT IN AN APPENDIX.
Add the DAV parameter to the base URI, 2.4.2 Level XML Element
http://somewhere.com/resource;DAV.
Add “/” to refer to the root of the resource’s property Name: http://www.ietf.org/standards/dav/level
namespace, http://somewhere.com/resource;DAV/. Purpose: To indicate the level of DAV compliance the resource
meets.
Schema: http://www.ietf.org/standards/dav/
Parent: DAV
Values= "1" | "2" | "3"
Description:A value of 1 for level indicates that the resource
supports the property and namespace sections of the DAV
specification. Level 2 indicates that the resource supports level
1 and the lock section of the specification, with a minimum
locking capability of the write lock. Level 3 indicates support
for levels 1 and 2 as well as support for the versioning section
of the DAV specification.
Change the author property’s name into parameter format by 2.4.3 Prop XML element
changing “/”s to “!”s and encasing the entire value in
parenthesis. The value must be encased in parenthesis in
order to indicate the “/” to “!” translation. The
translation “/” to “!” is done in order to prevent
confusion over segments boundaries, and to make sure that
the syntax for relative URIs remains well-defined.
http://somewhere.com/resource;DAV/(http:!!www.w3.org!stand
ards!z39.50!author).
The process is now complete, and the URL can be used in a Name: http://www.ietf.org/standards/dav/prop
GET or PATCH to retrieve or alter the value. See appendix 3 Purpose: Contains properties related to a resource.
for more information. Schema: http://www.ietf.org/standards/dav/
Parent: Any
Values: XML Elements
Description:The Prop XML element is a generic container for
properties defined on resources. All elements inside Prop MUST
define properties related to the resource. No other elements may
be used inside of a Prop element.
2.4.5 Compatibility with legacy systems 2.4.4 PropLoc XML Attribute
2.4.5.1 Problem Definition Name: http://www.ietf.org/standards/dav/PropLoc
Purpose: To specify the location of the associated property.
Schema: http://www.ietf.org/standards/dav/
Values= URL
Description:This attribute is used with elements inside of Props
contained in responses to specify the URL of the property on the
associated resource. The PropLoc attribute MUST NOT be used in
requests.
The HTTP parameter space is uncontrolled, thus someone may 2.4.5 Example
already be using a parameter with a value of “DAV” for some
end other than the one described here. Thus a client sending
a URI with a DAV param to a server may receive an unexpected
or inappropriate response.
2.4.5.2 Solution Requirement <?XML:Namespace href="http://www.ietf.org/standards/dav/"
AS="D"/>
<?XML:Namespace href="AIIM:Dublin:" AS="A"/>
<D:Prop>
<A:Author
D:PropLoc="http://www.foo.com/resource/props/Author">
Larry Masinter
</A:Author>
A mechanism is needed to prevent namespace collisions. </D:Prop>
2.4.5.3 Proposed Solution The previous specifies that the property author exists on some
unspecified resource and that the property can be directly
referenced at http://www.foo.com/resource/props/Author. The
resource upon which the property is defined must be determined
from context.
All DAV compliant servers MUST honor the DAV param type on 2.5 Property Identifiers
http URLs. Thus if a client knows it is talking to a DAV
server, it can safely send an http URL with the DAV param.
The client may send the http URL with the DAV param 2.5.1 Problem Definition
extension to a server that is not known to be DAV compliant
if the client uses PEP [Connolly, 1997] to prevent
collisions. The proper PEP header is:
DAVPEP = “PEP: {{map “DAV”}{strength must}}” DAV properties are resources and thus may have a URI where the
value of an instance of the property may be retrieved. This URI
is separate from the URI name of the property, which identifies
the syntax and semantics of the property, but which does not give
information on how to access the value of an instance of the
property.
Note: this PEP header is not compliant with [Connolly, A server is free to assign whatever URI it chooses to identify an
1997]; the PEP authors have indicated they will change the instance of a property defined on a resource. In fact, a server
format to make the example legal. is free not to reveal the URI of an instance of a particular
resource and instead require that the client access the property
through PROPFIND and PROPPATCH. However, many servers will want
to allow clients to directly manipulate properties. On these
servers, a client can discover the URI of an instance of a
property by performing a PROPFIND and examining the PropLoc
attribute, if returned, of each property.
2.5 Link XML Element 2.6 Link XML Element
2.5.1 Problem Description 2.6.1 Problem Description
A mechanism is needed to associate resources with other A mechanism is needed to associate resources with other
resources. These associations, also known as links, consist resources. These associations, known as links, consist of three
of three values, a type describing the nature of the values, a type describing the nature of the association, the
association, the source of the link, and the destination of source of the link, and the destination of the link. In the case
the link. In the case of annotation, neither the source nor of annotation, neither the source nor the destination of a link
the destination of a link need be the resource upon which need be the resource upon which the link is recorded.
the link is recorded.
2.5.2 Solution Requirements 2.6.2 Solution Requirements
The association mechanism MUST make use of the DAV property The association mechanism MUST make use of the DAV property
mechanism in order to make the existence of the associations mechanism in order to make the existence of the associations
searchable. searchable.
2.5.3 Link XML Element 2.6.3 Link XML Element
Name: http://www.ietf.org/standards/dav/link Name: http://www.ietf.org/standards/dav/link
Purpose: To identify a property as a link and to contain the
Purpose: The XML document which is the value of a link. source and destination of that link.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Values= 1*Src 1*Dst
Values= An XML document which MUST have a src and dst XML Description:Link is used to provide the sources and destinations
element. of a link. The type of the property containing the Link XML
element provides the type of the link. Link is a multi-valued
Description: Link is used to provide the source and one or
more destinations of the link. The type of the property
provides the type of the link. Link is a multivalued
element,so multiple Links may be used together to indicate element,so multiple Links may be used together to indicate
multiple links with the same type. multiple links with the same type.
2.5.4 Src XML Element 2.6.4 Src XML Element
Name: http://www.ietf.org/standards/dav/src Name: http://www.ietf.org/standards/dav/src
Purpose: To indicate the source of a link. Purpose: To indicate the source of a link.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: http://www.ietf.org/standards/dav/link Parent: http://www.ietf.org/standards/dav/link
Values= URI Values= URI
2.5.5 Dst XML Element 2.6.5 Dst XML Element
Name: http://www.ietf.org/standards/dav/Dst Name: http://www.ietf.org/standards/dav/Dst
Purpose: To indicate the destination of a link
Purpose: To indicate one or more destinations of a link
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: http://www.ietf.org/standards/dav/link Parent: http://www.ietf.org/standards/dav/link
Values= URI Values= URI
2.5.6 Example 2.6.6 Example
<XML> <?XML:Namespace
<Namespace><Ref>http://www.ietf.org/standards/dav/</><A href = "http://www.ietf.org/standards/dav/" AS = "D"/>
S>D</></> <?XML:Namespace
href = "http://www.foocorp.com/Project/" AS = "F"/>
<D:Prop> <D:Prop>
<Propname>Source</> <Source>
<Propvalue> <Link>
<XML:XML> <F:ProjFiles>Source</F:ProjFiles>
<Namespace> <src>http://foo.bar/program</src>
<dst>http://foo.bar/src/main.c</dst>
</Link>
<Link>
<F:ProjFiles>Library</F:ProjFiles>
<src>http://foo.bar/program</src>
<dst>http://foo.bar/src/main.lib</dst>
</Link>
<Link>
<F:ProjFiles>Makefile</F:ProjFiles>
<src>http://foo.bar/program</src>
<dst>http://foo.bar/src/makefile</dst>
<Link>
</Source>
</D:Prop>
<Ref>http://www.ietf.org/standards/ In this example the resource http://foo.bar/program has a source
dav/</><AS>D</> property defined which contains three links. Each link contains
</> three elements, two of which, src and dst, are part of the DAV
<Namespace> schema defined in this document, and one which is defined by the
schema http://www.foocorp.com/project/ (Source, Library, and
Makefile). A client which only implements the elements in the DAV
spec will not understand the foocorp elements and will ignore
them, thus seeing the expected source and destination links. An
enhanced client may know about the foocorp elements and be able
to present the user with additional information about the links.
<Ref>http://www.foocorp.com/Project 2.7 Multi-Status Response
/</><AS>F</>
</>
<D:Link>
<F:ProjectFiles>Source</>
<src>http://foo.bar/program</>
<dst>http://foo.bar/source/main.c</> 2.7.1 Problem Definition
</>
<D:Link>
<F:ProjectFiles>Library</>
<src>http://foo.bar/program</>
<dst>http://foo.bar/source/main.lib</> Some methods effect more than one resource. The effect of the
</> method on each of the scoped resources may be different, as such
<D:Link> a return format that can specify the effect of the method on each
<F:ProjectFiles>Makefile</> resource is needed.
<src>http://foo.bar/program</>
<dst>http://foo.bar/source/makefile</> 2.7.2 Solution Requirements
</> </> </> </> </>
In this example the resource http://foo.bar/program has a The solution must:
source property defined which contains three links. Each - communicate the status code and reason
link contains three elements, two of which, src and dst, are - give the URI of the resource on which the method was invoked
part of the DAV schema defined in this document, and one - be consistent with other return body formats
which is defined by the schema -
http://www.foocorp.com/project/ (Source, Library, and
Makefile). A client which only implements the elements in 2.7.3 Multi-Status Response
the DAV spec will not understand the foocorp elements and
will ignore them, thus seeing the expected source and
destination links. An enhanced client may know about the
foocorp elements and be able to present the user with
additional information about the links.
2.6 Properties and Methods The default multi-status response body is an text/xml HTTP entity
that contains a single XML element called multiresponse, which
contains a set of XML elements called response, one for each 200,
300, 400, and 500 series status code generated during the method
invocation. 100 series status codes MUST NOT be recorded in a
response XML element.
2.6.1 DELETE 2.7.3.1 MultiResponse
The delete method, when used on a property, causes the Name: http://www.ietf.org/standards/dav/multiresponse
property to be removed. Purpose: Contains multiple response messages.
Schema: http://www.ietf.org/standards/dav/
Parent: Any
Value: 1*Response [ResponseDescription]
Description:The ResponseDescription at the top level is used to
provide a general message describing the over arching nature of
the response. If this value is available an application MAY use
it instead of presenting the individual response descriptions
contain within the responses.
2.6.2 GET 2.7.3.2 Response
A GET on a property returns the name of the property. Accept Name: http://www.ietf.org/standards/dav/response
types may be used to specify the format of the return value, Purpose: Holds a single response
but all DAV compliant servers MUST at minimum support a Schema: http://www.ietf.org/standards/dav/
return type of application/XML. If application/XML is used Parent: Any
as the response format then it MUST include the Value: (Prop | HREF) Status [ResponseDescription]
http://www.ietf.org/standards/dav/ schema. Description: Prop MUST contain one or more empty XML elements
representing the name of properties. Multiple properties may be
included if the same response applies to them all. If HREF is
used then the response refers to a problem with the referenced
resource, not a property.
2.6.2.1 Example 2.7.3.3 Status
GET bar;DAV/(http:!!www.w3.org!standards!z39.50!Authors) Name: http://www.ietf.org/standards/dav/status
HTTP/1.1 Purpose: Holds a single HTTP status-line
Host: foo.com Schema: http://www.ietf.org/standards/dav/
Parent: Response
Value: status-line ;status-line defined in [Fielding et al.,
1997]
HTTP/1.1 200 OK 2.7.3.4 ResponseDescription
Content-Type: application/xml
Content-Length: xxxx
E-tag: “1234”
Last-Modified: xxxx
<XML> Name:
<XML:Namespace><Ref>http://www.ietf.org/standards/dav/< http://www.ietf.org/standards/dav/ResponseDescription
/><AS>D</></> Purpose: Contains a message that can be displayed to the user
<XML:Namespace><Ref>http://www.w3.com/standards/z39.50/ explaining the nature of the response.
</><AS>Z</></> Schema: http://www.ietf.org/standards/dav/
<D:prop>
<propname>Z:Authors</>
<propvalue>
<XML:XML>
<Namespace>
<Ref>http://www.ietf.org/standards/ Parent: Multiresponse and/or Response
dav/</> Value: Any
<AS>D</> Description: This XML element provides information suitable to
</> be presented to a user.
<Namespace>
<Ref>http://www.w3.com/standards/z39.50/ 2.8 Properties and Methods
</>
<AS>Z</>
</>
<Z:Author>Jane Doe</>
<Z:Author>Joe Doe</>
<Z:Author>Lots o’Doe</>
</> </> </> </>
GET bar;DAV/(Dublin:Producer) HTTP/1.1 2.8.1 DELETE
Host: foo.com
HTTP/1.1 200 OK As properties are resources, the deletion of a property causes
the same result as the deletion of any resource. It is worth
pointing out that the deletion of a property effects both direct
manipulation, that is by the property's URL, as well as indirect
discovery and manipulation, that is PROPPATCH and PROPFIND.
Content-Type: application/xml 2.8.2 GET
Content-Length: xxxx
E-tag: “2345”
Last-Modified: xxxx
<XML> A GET with a Request-URI that identifies a property returns the
<XML:Namespace><Ref>http://www.ietf.org/standards/dav/< name and value of that property. Accept types may be used to
/><AS>D</></> specify the format of the return value, but all DAV compliant
<XML:Namespace><Ref>Dublin</><AS>Du</></> servers MUST at minimum support a return type of text/xml. If
<D:prop> text/xml is used as the response format then it MUST return the
<propname>Du:Producer</> name and value of the property using the Prop XML element.
<propvalue><XML:XML>Marcus Doe</></>
</> </>
GET bar;DAV/ HTTP/1.1 2.8.2.1 Example
The following example assumes that the property's URL, originally
generated by the server, was discovered by examining the proploc
XML attribute returned on a result from a FINDPROP.
GET /bar.html;prop=z39.50_authors HTTP/1.1
Host: foo.com Host: foo.com
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/xml Content-Type: text/xml
Content-Length: xxxx Content-Length: xxxx
E-tag; “1234” E-tag: "1234"
Last-Modified: xxxx Last-Modified: xxxx
<XML> <?XML:Namespace
<XML:Namespace><Ref>http://www.ietf.org/standards/dav/< href = "http://www.ietf.org/standards/dav/" AS = "D"/>
/><AS>D</></> <?XML:Namespace
<XML:Namespace><Ref>http://www.w3.com/standards/z39.50/ href = "http://www.w3.com/standards/z39.50/"AS = "Z"/>
</><AS>Z</></>
<XML:Namespace><Ref>Dublin</><AS>Du</></>
<D:prop>
<propname>Z:Authors</>
<propvalue>
<XML:XML>
<Namespace>
<Ref>http://www.ietf.org/standards/
dav/</>
<AS>D</>
</>
<Namespace>
<Ref>http://www.w3.com/standards/z39.50/
</>
<AS>Z</>
</>
<Z:Author>Jane Doe</>
<Z:Author>Joe Doe</>
<Z:Author>Lots o’Doe</>
</> </> </>
<D:prop> <D:prop>
<propname>Du:Producer</> <Z:Authors>
<propvalue><XML:XML>Marcus Doe</></> <Z:Author>Jane Doe</Z:Author>
</> </> <Z:Author>Joe Doe</Z:Author>
<Z:Author>Lots o'Doe</Z:Author>
2.6.3 PROPPATCH Method </Z:Authors>
</D:prop>
The PROPPATCH method specifies how to alter a property. The 2.8.3 PROPPATCH
message body controls the actual action taken by a
PROPPATCH. All DAV compliant servers are required to support
the use of the application/XML content-type using the
http://www.ietf.org/standards/dav/proppatch/ schema in a
PROPPATCH method with a request-URI that points to the
resource upon which the property is defined.
The changes in a http://www.w3.com/standards/dav/proppatch/ The PROPPATCH method processes instructions specified in the
request MUST be atomically executed, partial results are not request body to create and/or remove properties defined on the
allowed. resource identified by Request-URI.
2.6.3.1 Request URI All DAV compliant servers MUST process instructions which are
specified using the PropertyUpdate, Create, and Remove XML
elements of the DAV schema. The request message body MUST
The request URI of a PROPPATCH method with the contain at least one PropertyUpdate XML element. Instruction
http://www.ietf.org/standards/dav/proppatch/ schema MUST processing MUST occur in the order instructions are received
point to the resource upon which the property is defined. (i.e., from top to bottom), and MUST be performed atomically.
2.6.3.2 PropertyUpdate XML element 2.8.3.1 PropertyUpdate XML element
Name: http://www.ietf.org/standards/dav/PropertyUpdate Name: http://www.ietf.org/standards/dav/PropertyUpdate
Purpose: To contain a request to alter the properties on a Purpose: To contain a request to alter the properties on a
resource. resource.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: Any
Values= *(Create | Remove)
Description:This XML element is a container for the information
required to modify the properties on the resource. This XML
element is multi-valued.
Parent: <XML> 2.8.3.2 Create XML element
Values= *(Create | Remove | Insert)
Description: This XML element is a container for the
information required to modify the properties on the
resource. This XML element is multivalued.
2.6.3.3 Create XML element
Name: http://www.ietf.org/standards/dav/create Name: http://www.ietf.org/standards/dav/create
Purpose: To create the DAV properties specified inside the
Purpose: To create the DAV property specified inside the
Create XML element. Create XML element.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: http://www.ietf.org/standards/dav/PropertyUpdate Parent: http://www.ietf.org/standards/dav/PropertyUpdate
Values= Prop Values= Prop
Description:This XML element MUST contain only a Prop XML
element. The elements contained by Prop specify the name and
value of properties that are created on Request-URI. If a
property already exists then its value is replaced. The Prop XML
element MUST NOT contain a PropLoc XML attribute.
Description: This XML element contains a Prop as the only 2.8.3.3 Remove XML element
element. The PropName contains the name of the property to
be created or overwritten. The PropValue XML element
contains the value of the new property.
2.6.3.4 Remove XML element
Name: http://www.ietf.org/standards/dav/remove Name: http://www.ietf.org/standards/dav/remove
Purpose: To remove the DAV properties specified inside the
Purpose: To remove the DAV property specified inside the
Remove XML element. Remove XML element.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: http://www.ietf.org/standards/dav/PropertyUpdate Parent: http://www.ietf.org/standards/dav/PropertyUpdate
Values= Prop
Description:Remove specifies that the properties specified in
Prop should be removed. Specifying the removal of a property that
does not exist is not an error. All the elements in Prop MUST be
empty, as only the names of properties to be removed are
required.
Values= PropName 2.8.3.4 Response
Description: Remove specifies that the property specified in
PropName should be removed. Specifying the removal of a
property that does not exist is not an error.
2.6.3.5 Response Codes
200 OK – The command succeeded. As there can be a mixture of
PUT and DELETEs in a body, a 201 Create seems inappropriate.
400 Bad Request – The client has provide a value whose
syntax is illegal for the property.
401 Unauthorized – The client does not have authorization to
alter one of the properties. This error also occurs if a The response MUST have a response body that contains a
property is inherently read only. multiresponse identifying the results for each property.
403 Forbidden – The client, for reasons the server chooses 2.8.3.5 Response Codes
not to specify, can not alter one of the properties.
405 Conflict The client has provided a value whose 200 OK - The command succeeded. As there can be a mixture of
semantics are not appropriate for the property. Create and Removes in a body, a 201 Create seems inappropriate.
403 Forbidden - The client, for reasons the server chooses not to
specify, can not alter one of the properties.
405 Conflict - The client has provided a value whose semantics
are not appropriate for the property. This includes trying to set
read only properties.
413 Request Entity Too Long - If a particular property is too
long to be recorded then a composite XML error will be returned
413 Request Entity Too Long – If a particular property is indicating the offending property.
too long to be recorded then a composite XML error will be 417 Insufficient Space on Resource - The resource does not have
returned indicating the offending property. sufficient space to record the state of the resource after the
execution of this method.
418 Atomicity Failure - The command was not executed because of
an atomicity failure elsewhere the caused the entire command to
be aborted.
2.6.3.6 Example 2.8.3.6 Example
PROPPATCH bar;DAV/ HTTP/1.1 PROPPATCH /bar.html HTTP/1.1
Host: www.foo.com Host: www.foo.com
Content-Type: application/XML Content-Type: text/xml
Content-Length: xxxx Content-Length: xxxx
<XML> <?XML:Namespace
<Namespace><Ref>http://www.ietf.org/standards/dav/</><A href = "http://www.ietf.org/standards/dav/" AS = "D"/>
S>D</></> <?XML:Namespace
<Namespace><Ref>http://www.w3.com/standards/z39.50/</>< href = "http://www.w3.com/standards/z39.50/" AS = "Z"/>
AS>Z</></>
<D:PropertyUpdate> <D:PropertyUpdate>
<Create><prop> <Create>
<propname>Z:authors</> <prop>
<propvalue> <Z:authors>
<XML:XML> <Z:Author>Jim Whitehead</Z:Author>
<Namespace> <Z:Author>Roy Fielding</Z:Author>
</Z:authors>
<Ref>http://www.ietf.org/standards/dav/proppatch/</> </Prop>
<AS>D</> </Create>
</> <Remove>
<Namespace> <prop><Z:Copyright-Owner/></prop>
</Remove>
<Ref>http://www.w3.com/standards/z39.50/</> </D:PropertyUpdate>
<AS>Z</>
</>
<Z:Author>Jim Whitehead</>
<Z:Author>Roy Fielding</>
</>
</>
<Remove><propname>Z:Copyright-Onwer</></>
</> </>
2.6.4 PUT
A PUT is specified in order to control what is returned by a
GET. However a GET on a property always returns some sort of
property containment format. As such PUT can not be used if
the Request-URI refers to a property.
2.6.5 SEARCH HTTP/1.1 405 Conflict
Content-Type: text/xml
Content-Length: xxxxx
2.6.5.1 Request-URI <?XML:Namespace
href="http://www.ietf.org/standards/dav/" AS = "D"/>
<?XML:Namespace
href="http://www.w3.com/standards/z39.50/" AS = "Z"/>
<D:MultiResponse>
<ResponseDescription> Copyright Owner can not be deleted or
altered.</ResponseDescription>
<Response>
<Prop><Z:authors/></Prop>
<Status>HTTP/1.1 418 Atomicity Failure</Status>
</Response>
<Response>
<Prop><Z:Copyright-Owner/></Prop>
<Status>HTTP/1.1 405 Conflict</Status>
</Response>
</D:MultiResponse>
The request-URI of the search method is the URI of the 2.8.4 PUT
resource. .
The Depth header MUST NOT be used on a SEARCH method which A PUT is specified in order to control what is returned by a GET.
contains a Limited-Search XML element (“limited search”). However a GET on a property always returns a predefined property
containment format. Therefore PUT can not be used if the Request-
URI refers to a property.
2.6.5.2 Command Format 2.8.5 PROPFIND
The message body stipulates the action of a SEARCH method. The PROPFIND method retrieves properties defined on Request-URI.
This section defines an application/xml content type using The request message body is an XML document that MUST contain
the http://www.ietf.org/standards/dav/ schema. This method only one PropFind XML element, which specifies the type of
is not normally cacheable. property find action to be performed. The XML element contained
by PropFind specifies the type of action to be performed:
retrieve all property names and values (AllProp), retrieve only
specified property names and values (Prop), or retrieve only a
list of all property names (Propname). When a Prop XML element
is present, it specifies a list of the names of properties whose
name and value are to be returned. The Prop element, when used
within a FINDPROP request body MUST be empty.
2.6.5.2.1 Limited-Search XML element The response is a text/xml message body that contains a
MultiResponse XML element which describes the results of the
attempts to retrieve the various properties. If a property was
successfully retrieved then its value MUST be returned in the
prop XML element. In the case of Allprop and Findprop, if a
principal does not have the right to know if a particular
property exists, an error MUST NOT be returned. The results of
this method SHOULD NOT be cached.
Name: http://www.ietf.org/standards/dav/limited-search 2.8.5.1 Propfind XML element
Name: http://www.ietf.org/standards/dav/Propfind
Purpose: To specify the set of matching properties Purpose: To specify the set of matching properties
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: Any
Values= (Prop | Allprop | Propname)
Description: Propfind is a container element for the exact
specification of a PROPFIND request.
Parent: <XML> 2.8.5.2 Allprop
Values: The value is a single OR XML element. The OR element
may only contain AND XML elements, and MUST contain at least
one AND element.
Description: This property indicates a very limited search.
The search may only be on HTTP properties.
2.6.5.2.2 OR XML element
Name: http://www.ietf.org/standards/dav/or
Purpose: To take its members, evaluate them, get a true or
false result, “or” the results together, and have that be
the total result.
Name: http://www.ietf.org/standards/dav/Allprop
Purpose: To specify that all properties are to be returned
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: Propfind
Description: Its presence in a PROPFIND request specifies the
name and value of all properties defined on the resource MUST be
returned.
Parent: Limited-Search XML element 2.8.5.3 Propname
Values: AND XML element.
2.6.5.2.3 AND XML element
Name: http://www.ietf.org/sandards/dav/and
Purpose: To take its members, evaluate them, get a true or
false result, “and” the results together, and have that be
the total result.
Schema: http://www.ietf.org/standards/dav
Parent: OR XML element
Values: Zero or one Name XML element, and zero or one Value
XML element. There MUST be at least one Name or Value XML
element.
2.6.5.2.4 Name XML element
Name: http://www.ietf.org/standards/dav/name
Purpose: To provide a pattern against which property names
are to be compared. If the name matches then the property
evaluates to true, otherwise false.
Name: http://www.ietf.org/standards/dav/Propname
Purpose: To specify that the names of all properties defined on
the resource are to be returned.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: Propfind
Description: Its presence in a PROPFIND request specifies the
name of all properties defined on the resource MUST be returned.
Parent: AND XML element 2.8.5.4 PropFindResult XML element
Values: Match-Stream
2.6.5.2.5 Value XML element
Name: http://www.ietf.org/standards/dav/value
Purpose: To provide a pattern against which property values
are to be compared. If the value matches then the property
evaluates to true, otherwise false.
Name: http://www.ietf.org/standards/dav/PropFindResult
Purpose: To contain the results of a SEARCH request
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: Any
Values: Prop
Parent: AND XML element 2.8.5.5 Example 1 - Prop
Values: Match-Stream
2.6.5.2.6 Match-String XML element
Name: http://www.ietf.org/standards/dav/match-string
Purpose: To specify a search pattern to be matched against
an octet stream
Schema: http://www.ietf.org/standards/dav/
Parent: Name or Value XML element PROPFIND /container/ HTTP/1.1
Host: www.foo.bar
Content-Length: xxxx
Content-Type: text/xml
Values: (“*” | “?” | EncodedOctet) <?XML:Namespace href =
EncodedOctet = <An EncodedOctet uses XML encoding to encode "http://www.ietf.org/standards/dav/" AS = "G"/>
“*” and “?” as well as “<” and “>” <?XML:Namespace href =
"http://www.foo.bar/boxschema/" AS = "B"/>
<G:PROPFIND>
<prop>
<B:bigbox>
<B:author>
<B:DingALing>
<B:Random>
</prop>
</G:PROPFIND>
Description: This element provides a template against which HTTP/1.1 207 Partial Success
anything that can be expressed as an octet stream may be Content-Type: text/xml
compared. “*” is a wildcard that matches zero or more Content-Length: xxxxx
unspecified contiguous octets. “?” is a wildcard that
matches exactly one unspecified octet.
2.6.5.3 Response Format <?XML:Namespace
href ="http://www.ietf.org/standards/dav/" AS = "S">
<?XML:Namespace href = "http://www.foo.bar/boxschema" AS = R">
<D:MultiResponse>
<ResponseDescription> There has been an access violation
error. </ResponseDescription>
<Response>
<Prop>
<R:bigbox D:Proploc="http://prop.com/BoxType">
<BoxType>Box type A</BoxType>
</R:bigbox>
<R:author D:Proploc="http://prop.com/Author">
<Name>J.J. Dingleheimerschmidt</Name>
</R:author>
</Prop>
<Status>HTTP/1.1 200 Success</Status>
</Response>
<Response>
<Prop><R:DingALing/><R:Random/></>
<Status>HTTP/1.1 403 Forbidden</Status>
<ResponseDescription> The user does not have access to
the DingALink property. </ResponseDescription>
</Response>
</D:MultiResponse>
The response is an application/xml message body which The result will return all properties on the container. In this
contains a single SearchResult XML element whose contents case only two properties were found. The principal did not have
are a series of XML elements representing matching sufficient access rights to see the third and fourth properties
properties. so an error was returned.
2.6.5.3.1 SearchResult XML element 2.8.5.6 Example 2 - Allprop
Name: http://www.ietf.org/standards/dav/searchresult PROPFIND /container/ HTTP/1.1
Host: www.foo.bar
Content-Length: xxxx
Content-Type: text/xml
Purpose: To contain the results of a SEARCH request <?XML:Namespace href =
"http://www.ietf.org/standards/dav/" AS = "G"/>
Schema: http://www.ietf.org/standards/dav/ <G:PROPFIND>
<Allprop/>
</G:PROPFIND>
Parent: Any, usually <XML> HTTP/1.1 200 Success
Content-Type: text/xml
Content-Length: xxxxx
Values: Zero or more Prop XML elements (defined in <?XML:Namespace href =
Properties draft) "http://www.ietf.org/standards/dav/" As = "S">
<?XML:Namespace href = "http://www.foo.bar/boxschema" AS = R">
<S:MultiResponse>
<Prop>
<R:bigbox D:Proploc="http://prop.com/BigBox">
<BoxType>Box type A</BoxType>
</R:bigbox>
<R:author D:Proploc="http://prop.com/Author">
<Name>Hadrian</Name>
</R:author>
</Prop>
<Status>HTTP/1.1 200 Success</Status>
</S:MultiResponse>
Description: The SearchResult XML element provides the This particular client only had the right to see two properties,
context to inform the client that its contents are not just BoxType and Author. No error is returned for the remaining
some XML element, but an XML representation of the requested properties, as the client does not even have sufficient rights to
property. know they exist. If the client did have the right to know they
existed but did not have the right to see their value, a 201
Partial Success with a multiresponse, as used in the previous
example, would have been returned.
2.6.5.4 Example 2.8.5.7 Example 3 - Propname
SEARCH /container/ HTTP/1.1 PROPFIND /container/ HTTP/1.1
Host: www.foo.bar Host: www.foo.bar
Content-Length: xxxx Content-Length: xxxx
Content-Type: application/xml Content-Type: text/xml
<XML>
<XML:Namespace>
<Ref>http://www.ietf.org/standards/dav/</>
<AS>S</>
</>
<S:limited-search>
<OR> <?XML:Namespace
<AND> href = "http://www.ietf.org/standards/dav/" AS = "G"/>
<Name>*</> <G:PROPFIND>
</> <Propname/>
</> </G:PROPFIND>
</>
</>
HTTP/1.1 200 OK HTTP/1.1 200 Success
Content-Type: application/xml Content-Type: text/xml
Content-Length: xxxxx Content-Length: xxxxx
<XML> <?XML:Namespace
<XML:Namespace> href = "http://www.ietf.org/standards/dav/" As = "S">
<Ref>http://www.ietf.org/standards/dav/</> <?XML:Namespace
<As>S</> href = "http://www.foo.bar/boxschema" AS = "R">
</> <S:MultiResponse>
<XML:Namespace>
<Ref>http://www.foo.bar/boxschema</>
<AS>R</>
</>
<S:SearchResult>
<Prop>
<PropName>R:bigbox</>
<PropValue>
<XML:XML>
<BoxType>Box type A</>
</>
</>
</>
<Prop> <Prop>
<PropName>R:author</> <R:bigbox D:Proploc="http://prop.com/BigBox"/>
<PropValue> <R:author D:Proploc="http://prop.com/Author"/>
<XML:XML> <R:DingALing/>
<Name>J.J. <R:Random/>
Dingleheimerschmidt</> </Prop>
</> <Status>HTTP/1.1 200 Success</Status>
</> </S:MultiResponse>
</>
</>
</>
The result will return all properties on the container and In this case only two of the properties have direct URLs
its members. In this case only two properties were found, available, while the other two properties can only be referenced
one on the container and one on one of its members, both
properties are live.
3 A Proposal for Collections of Web Resources and Name via PROPFIND and PROPPATCH.
Space Operations
3 A Proposal for Collections of Web Resources and Name Space
Operations
3.1 Observations on the HTTP Object Model 3.1 Observations on the HTTP Object Model
As a prerequisite for specification of collections and name
space operations for the Web, a model for collection As a prerequisite for specification of collections and name space
resources and for namespace topology must be given. This operations for the Web, a model for collection resources and for
section describes a new type of Web resource, the collection namespace topology must be given. This section describes a new
resource, and provides a model for discussing the type of Web resource, the collection resource, and provides a
relationship between the resources that are generated as the model for discussing the relationship between the resources that
result of a data-producing process, and the source resources are generated as the result of a data-producing process, and the
that describe the process. source resources that describe the process.
3.1.1 Collection Resources 3.1.1 Collection Resources
A collection is a Web resource type whose primary state is a A collection is a Web resource type whose primary state is a set
set of URIs and associated values that are recorded as of URIs and associated values that are recorded as properties on
properties on the resource. The URIs identify resources the resource. The URIs identify resources that are members of
that are members of the collection. The values associated the collection. The values associated with each URI include
with each URI include information such as the Last Modified information such as the Last Modified Date, Entity Tag, Creation
Date, Entity Tag, Creation Date, Content Type, Display Name, Date, Content Type, Display Name, and whether the member is a
and whether the member is a collection. collection.
A member of a collection is either an internal member A member of a collection is either an internal member resource,
resource, which MUST have a URI that is relative to the base which MUST have a URI that is relative to the base URI of the
URI of the collection, or an external member resource, which collection, or an external member resource, which has a URI which
has a URI which is not relative to the base URI of the is not relative to the base URI of the collection. External
collection. External member resources are further subdivided member resources are further subdivided into propagate members,
into propagate members, which have recursive method which have recursive method invocations propagated to them, and
invocations propagated to them, and no-propagate members, no-propagate members, which do not.
which do not.
A collection resource may be viewed and used as a compound A collection resource may be viewed and used as a compound
resource in which the collection is a container for a group resource in which the collection is a container for a group of
of related resources that, together, form a larger logical related resources that, together, form a larger logical unit.
unit. For example, a collection of HTML resources where For example, a collection of HTML resources where each resource
each resource is the chapter of a book can be viewed as a is the chapter of a book can be viewed as a compound resource
compound resource representing the entire book. representing the entire book.
Some methods, when invoked on a collection, affect the Some methods, when invoked on a collection, affect the entire
entire collection. For example, it is possible to copy an collection. For example, it is possible to copy an entire
entire collection and its contents with just a single copy collection and its contents with just a single copy method
method request. The model for performing these operations is request. The model for performing these operations is a tree
a tree traversal. The method is invoked on the collection, traversal. The method is invoked on the collection, which then
which then performs the method on itself before propagating performs the method on itself before propagating the method to
the method to all its internal members and propagate all its internal members and propagate external members. If
external members. If these are non-collection resources, these are non-collection resources, the request method is
the request method is processed. However, if the request is processed. However, if the request is propagated to another
propagated to another collection, then the propagation collection, then the propagation begins again. This sequence of
begins again. This sequence of actions causes the method to actions causes the method to be propagated as a tree traversal of
be propagated as a tree traversal of the members of the the members of the collections. It is incumbent upon the client
collections. It is incumbent upon the client to perform any to perform any locking operation on the collection or subordinate
locking operation on the collection or subordinate members members that it deems necessary in order to maintain state
that it deems necessary in order to maintain state
consistency during the execution of such methods. consistency during the execution of such methods.
3.1.2 Creation and Retrieval of Collection Resources 3.1.2 Creation and Retrieval of Collection Resources
Since the existing HTTP methods for creating (PUT, POST) and Since the existing HTTP methods for creating (PUT, POST) and
retrieving (GET) a resource were defined for non-collection retrieving (GET) a resource were defined for non-collection
resources, it is not surprising that the semantics of these resources, it is not surprising that the semantics of these
methods do not transfer well to collections. For example, methods do not transfer well to collections. For example, the PUT
the PUT method is defined to store the request entity under
the Request-URI. While a description format for a
collection can readily be constructed that could be used
with PUT, the implications of sending such a description to
the server are undesirable. For example, if a description
of a collection that omitted some existing resources were
PUT to a server, this might be interpreted as a command to
remove those members. This would extend PUT to perform
DELETE functionality, which is undesirable since it changes
the semantics of PUT, and makes it difficult to control
DELETE functionality with an access control scheme based on
methods.
While the POST method is sufficiently open-ended that a method is defined to store the request entity under the Request-
“create a collection” POST command could be constructed, URI. While a description format for a collection can readily be
this is undesirable because it would be difficult to provide constructed that could be used with PUT, the implications of
separate access control for collection creation and other sending such a description to the server are undesirable. For
uses of POST if they both use the same method. example, if a description of a collection that omitted some
existing resources were PUT to a server, this might be
interpreted as a command to remove those members. This would
extend PUT to perform DELETE functionality, which is undesirable
since it changes the semantics of PUT, and makes it difficult to
control DELETE functionality with an access control scheme based
on methods.
The GET method when applied to collections is also While the POST method is sufficiently open-ended that a "create a
problematic. While it might seem desirable to have GET collection" POST command could be constructed, this is
return a listing of the members of a collection, this is undesirable because it would be difficult to provide separate
foiled by the existence of the “index.html” de-facto access control for collection creation and other uses of POST if
standard namespace redirection, in which a GET request on a they both use the same method.
collection is automatically redirected to the index.html
resource. The GET method when applied to collections is also problematic.
While it might seem desirable to have GET return a listing of the
members of a collection, this is foiled by the existence of the
"index.html" de-facto standard namespace redirection, in which a
GET request on a collection is automatically redirected to the
index.html resource.
Because of the difficulty of reusing some existing HTTP/1.1 Because of the difficulty of reusing some existing HTTP/1.1
methods for collections, two new resource creation/retrieval methods for collections, two new resource creation/retrieval
methods are needed. This specification introduces the MKCOL methods are needed. This specification introduces the MKCOL
method for creating collection resources, and the INDEX method for creating collection resources, and the INDEX method
method for retrieving the contents of a collection. for retrieving the contents of a collection.
The exact definition of the behavior of GET and PUT on The exact definition of the behavior of GET and PUT on
collections is defined later in this draft. collections is defined later in this draft.
3.1.3 Source Resources and Output Resources 3.1.3 Source Resources and Output Resources
For many resources, the entity returned by GET exactly For many resources, the entity returned by GET exactly matches
matches the persistent state of the resource, for example, a the persistent state of the resource, for example, a GIF file
GIF file stored on a disk. For this simple case, the URL at stored on a disk. For this simple case, the URL at which a
which a resource is accessed is identical to the URL at resource is accessed is identical to the URL at which the source
which the source (the persistent state) of the resource is (the persistent state) of the resource is accessed. This is also
accessed. This is also the case for HTML source files that the case for HTML source files that are not processed by the
are not processed by the server prior to transmission. server prior to transmission.
However, HTML files can sometimes be processed by the server However, HTML files can sometimes be processed by the server
before being transmitted as a return entity body. Server- before being transmitted as a return entity body. Server-side-
side-include directives within an HTML file instruct a include directives within an HTML file instruct a server to
server to replace the directive with another value, such as replace the directive with another value, such as the current
the current date. In this case, what is returned by GET date. In this case, what is returned by GET (HTML plus date)
(HTML plus date) differs from the persistent state of the differs from the persistent state of the resource (HTML plus
resource (HTML plus directive). Typically there is no way to directive). Typically there is no way to access the HTML file
access the HTML file containing the unprocessed directive. containing the unprocessed directive.
Sometimes the entity returned by GET is the output of a Sometimes the entity returned by GET is the output of a data-
data-producing process that is described by one or more producing process that is described by one or more source
source resources (that may not even have a location in the resources (that may not even have a location in the URL
URL namespace). A single data-producing process may namespace). A single data-producing process may dynamically
dynamically generate the state of a potentially large number generate the state of a potentially large number of output
of output resources. An example of this is a CGI script that resources. An example of this is a CGI script that describes a
describes a "finger" gateway process that maps part of the "finger" gateway process that maps part of the namespace of a
namespace of a server into finger requests, such as server into finger requests, such as
http://www.foo.bar.org/finger_gateway/user@host. http://www.foo.bar.org/finger_gateway/user@host.
In the absence of distributed authoring capability, the fact In the absence of distributed authoring capability, the fact that
that the source resource(s) for server generated output do
not have a mapping to the URI namespace is not a problem,
and has desirable security benefits. However, if remote
editing of the source resource(s) is desired, they should be
given a location in the URI namespace. This source location
should not be one of the locations at which the generated
output is retrievable, since in general it is impossible for
the server to differentiate requests for source resources
from requests for process output resources. There is often a
many-to-many relationship between source resources and
output resources.
For DAV compliant servers all output resources which have a the source resource(s) for server generated output do not have a
single source resource (and that source resource has a URI), mapping to the URI namespace is not a problem, and has desirable
the URI of the source resource SHOULD be stored in a single security benefits. However, if remote editing of the source
link on the output resource with type DAV:/ Source. Note resource(s) is desired, they should be given a location in the
that by storing the source URI in links on the output URI namespace. This source location should not be one of the
resources, the burden of discovering the source is placed on locations at which the generated output is retrievable, since in
the authoring client. general it is impossible for the server to differentiate requests
for source resources from requests for process output resources.
There is often a many-to-many relationship between source
resources and output resources. For DAV compliant servers all
output resources which have a single source resource (and that
source resource has a URI), the URI of the source resource SHOULD
be stored in a single link on the output resource with type
http://www.ietf.org/standards/dav/link/Source. Note that by
storing the source URI in links on the output resources, the
burden of discovering the source is placed on the authoring
client.
In the general case, a large number of source resources can In the general case, a large number of source resources can
comprise a data-producing process that generates many output comprise a data-producing process that generates many output
resources, creating a many-to-many relationship between resources, creating a many-to-many relationship between output
output resources and source resources. If each output resources and source resources. If each output resource had links
resource had links back to every source resource in the back to every source resource in the data-producing process,
data-producing process, there can be a potentially large there can be a potentially large number of such links. Due to the
number of such links. Due to the potentially large number of potentially large number of links, and the lack of a policy for
links, and the lack of a policy for ordering access to ordering access to multiple sources, explicit storage of source
multiple sources, explicit storage of source relationships relationships is limited to cases with only a single source
is limited to cases with only a single source resource. resource.
3.2 MKCOL Method 3.2 MKCOL Method
3.2.1 Problem Description 3.2.1 Problem Description
The client needs a way to create a collection. The client needs a way to create a collection.
3.2.2 Solution Requirements 3.2.2 Solution Requirements
The solution: The solution:
- Must ensure that a collection has been made (i.e. that it
Must ensure that a collection has been made (i.e. that it responds to the INDEX method) as opposed to a non-collection
responds to the INDEX method) as opposed to a non- resource. If a collection could not be made, it must indicate a
collection resource. If a collection could not be made, it failure to the principal.
must indicate a failure to the principal. - The server MAY, if necessary, create any intermediate
collections so that the underlying storage medium is self-
Requires that the server MAY, if necessary, create any consistent.
intermediate collections so that the underlying storage -
medium is self-consistent.
3.2.3 Request 3.2.3 Request
The MKCOL method creates a new collection resource at the The MKCOL method creates a new collection resource at the
location specified by the Request-URI. If the Request-URI location specified by the Request-URI. If the Request-URI exists
exists then MKCOL must fail. then MKCOL must fail.
During MKCOL processing, a server MAY add the Request-URI to During MKCOL processing, a server MAY add the Request-URI to one
one or more collections within the server’s controlled or more collections within the server’s controlled namespace.
namespace.
3.2.3.1 MKCOL Without Request Body 3.2.3.1 MKCOL Without Request Body
When MKCOL is invoked without a request body then the When MKCOL is invoked without a request body then the collection
collection created has no members. created has no members.
3.2.3.2 MKCOL With Request Body 3.2.3.2 MKCOL With Request Body
A MKCOL request message MAY contain a message body. The A MKCOL request message MAY contain a message body. The behavior
behavior of a MKCOL request when the body is present is of a MKCOL request when the body is present is limited to
limited to creating collections, members of a collection, creating collections, members of a collection, bodies of members
bodies of members and properties on the collections or and properties on the collections or members. If the server
members. If the server receives a MKCOL request entity type receives a MKCOL request entity type it does not support or
it does not support or understand it MUST respond with a 415 understand it MUST respond with a 415 (Unsupported Media Type)
(Unsupported Media Type) status code. status code.
3.2.3.3 Creating Multiple Collections 3.2.3.3 Creating Multiple Collections
The server MAY create intermediate collections if they do The server MAY create intermediate collections if they do not
not already exist. For example, if the collection already exist. For example, if the collection http://server/a/
http://server/a/ already exists in the server’s namespace, already exists in the server’s namespace, then while performing a
then while performing a MKCOL to create http://server/a/b/c/ MKCOL to create http://server/a/b/c/ the server may also create a
the server may also create a collection at collection at http://server/a/b/.
http://server/a/b/.
3.2.4 Response 3.2.4 Response
Responses from a MKCOL request are not cacheable, since Responses from a MKCOL request are not cacheable, since MKCOL has
MKCOL has non-idempotent semantics. non-idempotent semantics.
201 (Created) - The structured resource was created in its 201 (Created) - The structured resource was created in its
entirety. entirety.
403 (Forbidden) - The server does not allow the creation of 403 (Forbidden) - The server does not allow the creation of
collections at the given location in its namespace. collections at the given location in its namespace.
415 (Unsupported Media Type)- The server does not support the
415 (Unsupported Media Type)– The server does not support request type of the body.
the request type of the body.
416 (Unprocessable Entity) - A new status code. The server 416 (Unprocessable Entity) - A new status code. The server
understands the content type of the request entity, but was understands the content type of the request entity, but was
unable to process the contained instructions. unable to process the contained instructions.
3.2.5 Example 3.2.5 Example
This example creates a container collection called This example creates a container collection called
/webdisc/xfiles/ on the server www.server.org. /webdisc/xfiles/ on the server www.server.org.
MKCOL /webdisc/xfiles/ HTTP/1.1 MKCOL /webdisc/xfiles/ HTTP/1.1
Host: www.server.org Host: www.server.org
HTTP/1.1 201 Created HTTP/1.1 201 Created
3.3 INDEX Method 3.3 INDEX Method
3.3.1 Problem Description 3.3.1 Problem Description
A mechanism is needed to discover if a resource is a A mechanism is needed to discover if a resource is a collection
collection and if so, list its members. and if so, list its members.
3.3.2 Solution Requirements 3.3.2 Solution Requirements
The solution: The solution:
- must allow a client to discover the members of a collection
must allow a client to discover the members of a collection - must always provide a machine-readable description of the
must always provide a machine-readable description of the
membership of a collection membership of a collection
-
3.3.3 The Request 3.3.3 The Request
The INDEX method returns a machine-readable representation The INDEX method returns a machine-readable representation of the
of the membership of the resource at the Request-URI. For a membership of the resource at the Request-URI. For a collection,
collection, INDEX MUST return a machine-readable list of its INDEX MUST return a machine-readable list of its members. For
members. For other resources, the information returned by other resources, the information returned by INDEX is undefined,
INDEX is undefined, and MAY vary. The request message body and MAY vary. The request message body of an INDEX request
of an INDEX request SHOULD be ignored. SHOULD be ignored.
The Depth header can be used to indicate how much of a The Depth header can be used to indicate how much of a result can
result can be generated for the response. The specific be generated for the response. The specific values allowed for
values allowed for the depth header when used with the INDEX the depth header when used with the INDEX method are 1 and
method are 1 and infinity. The 1 value indicates that the infinity. The 1 value indicates that the internal and external
internal and external member resources should be reported in member resources should be reported in the result, infinity
the result, infinity indicates that all internal and indicates that all internal and external member resources and all
external member resources and all their descendants should their descendants should be in the result. If the Depth header is
be in the result. If the Depth header is not given, then 1 not given, then 1 is assumed. Servers MUST honor a depth of 1.
is assumed. Servers MUST honor a depth of 1. Servers MAY Servers MAY honor infinity. If the server does not support the
honor infinity. If the server does not support the value of value of the depth header then a 412 (Precondition failed) MUST
the depth header then a 412 (Precondition failed) MUST be be returned.
returned.
3.3.4 The Response 3.3.4 The Response
200 (OK) – The server MUST send an application/xml response 200 (OK) - The server MUST send an application/xml response
entity which describes the collection. entity which describes the collection.
404 (Not Found) - Same behavior as HTTP 1.1. The server never had
404 (Not Found) - Same behavior as HTTP 1.1. The server the resource, or the server permanently deleted the resource and
never had the resource, or the server permanently deleted has no knowledge that it ever existed. This error code implies
the resource and has no knowledge that it ever existed. This that, essentially, the server has no information about the
error code implies that, essentially, the server has no Request URI.
information about the Request URI.
3.3.5 Response Message Body 3.3.5 Response Message Body
The default INDEX response for a resource is an The default INDEX response for a resource is an application/xml
application/xml HTTP entity (i.e., an Extensible Markup HTTP entity (i.e., an Extensible Markup Language (XML) document)
Language (XML) document) that contains a single XML element that contains a single XML element called collectionresource
called collectionresource which describes the collection, which describes the collection, and a set of XML elements called
and a set of XML elements called memberesource which memberesource which describe the members of the collection.
describe the members of the collection.
The response from INDEX is cacheable, and SHOULD be The response from INDEX is cacheable, and SHOULD be accompanied
accompanied by an ETag header (see section 13.3.4 of RFC by an ETag header (see section 13.3.4 of RFC 2068). If GET and
2068). If GET and INDEX return different entities for the INDEX return different entities for the same resource state, they
same resource state, they MUST return different entity tags. MUST return different entity tags.
The server MUST transmit the following XML elements for each The server MUST transmit the following XML elements for each
member resource of a collection: Ref, IsCollection, Content- member resource of a collection: Ref, IsCollection, Content-Type,
Type, External. The server MUST transmit the following XML External. The server MUST transmit the following XML elements if
elements if it can generate any meaningful values for them: it can generate any meaningful values for them: Creation-Date,
Creation-Date, Last-Modified, DisplayName, Content-Language. Last-Modified, DisplayName, Content-Language. The server SHOULD
The server SHOULD transmit Etag XML elements for each transmit Etag XML elements for each member (see section 13.3.4 of
member (see section 13.3.4 of RFC 2068). RFC 2068).
The value of content-type, last-modified, and etag XML The value of content-type, last-modified, and etag XML elements
elements MUST be identical to the value of the response MUST be identical to the value of the response header field of
header field of the same name in the HTTP/1.1 specification. the same name in the HTTP/1.1 specification. Since the HTTP/1.1
Since the HTTP/1.1 header fields are described in terms of header fields are described in terms of the on-the-wire entity,
the on-the-wire entity, the values presented by INDEX are the values presented by INDEX are those that would be generated
those that would be generated if the resource was accessed if the resource was accessed using the GET method without content
using the GET method without content negotiation. negotiation.
3.3.5.1 CollectionResource 3.3.5.1 CollectionResource
Name: http://www.ietf.org/standards/dav/collectionresource Name: http://www.ietf.org/standards/dav/collectionresource
Purpose: Describes a collection Purpose: Describes a collection
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: <XML> Parent: <XML>
Value:MemberResource Value:MemberResource
3.3.5.2 MemberResource 3.3.5.2 MemberResource
Name: http://www.ietf.org/standards/dav/memberresource Name: http://www.ietf.org/standards/dav/memberresource
Purpose: Describes a member of a collection Purpose: Describes a member of a collection
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: CollectionResource Parent: CollectionResource
Value:Ref, IsCollection, Content-Type, External, Creation- Value:Ref, IsCollection, Content-Type, External, Creation-
Date, Last-Modified, ETag, DisplayName (other XML elements Date, Last-Modified, ETag, DisplayName (other XML elements MAY
MAY also be present) also be present)
3.3.5.3 Ref 3.3.5.3 Ref
See XML definition. See XML definition.
3.3.5.4 IsCollection 3.3.5.4 IsCollection
Name: http://www.ietf.org/standards/dav/iscollection Name: http://www.ietf.org/standards/dav/iscollection
Purpose: This is a boolean value which is set to "true" if the
Purpose: This is a boolean value which is set to “true” if entry is a collection
the entry is a collection
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: MemberResource Parent: MemberResource
Value: ("true" | "false")
Value:(“true” | “false”)
3.3.5.5 Content-Type 3.3.5.5 Content-Type
Name: http://www.ietf.org/standards/dav/content-type Name: http://www.ietf.org/standards/dav/content-type
Purpose: The content-type of the member resource. Purpose: The content-type of the member resource.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: MemberResource Parent: MemberResource
Value: media-type ; defined in Section 3.7 of [Fielding et
Value:media-type ; defined in Section 3.7 of [HTTP11] al., 1997]
If no meaningful content-type can be generated, then an If no meaningful content-type can be generated, then an empty
empty value MUST be given. value MUST be given.
3.3.5.6 External 3.3.5.6 External
Name: http://www.ietf.org/standards/dav/external Name: http://www.ietf.org/standards/dav/external
Purpose: If present, this element indicates the resource is an
Purpose: If present, this element indicates the resource is external member of the collection. If the value is "propagate,"
an external member of the collection. If the value is it is a propagate member, if the value is "no-propagate," it is a
“propagate,” it is a propagate member, if the value is “no- no-propagate member.
propagate,” it is a no-propagate member.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: MemberResource Parent: MemberResource
Value: ("propagate" | "no-propagate")
Value:(“propagate” | “no-propagate”)
3.3.5.7 Creation-Date 3.3.5.7 Creation-Date
Name: http://www.ietf.org/standards/dav/creation-date Name: http://www.ietf.org/standards/dav/creation-date
Purpose: The date the resource was created. Purpose: The date the resource was created.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: MemberResource Parent: MemberResource
Value:The date MUST be given in RFC 1123 format (rfc-1123 Value:The date MUST be given in RFC 1123 format (rfc-1123
production, defined in section 3.3.1 of [HTTP11] production, defined in section 3.3.1 of [Fielding et al., 1997]
3.3.5.8 Last-Modified 3.3.5.8 Last-Modified
Name: http://www.ietf.org/standards/dav/last-modified Name: http://www.ietf.org/standards/dav/last-modified
Purpose: The date the resource was last modified. Purpose: The date the resource was last modified.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: MemberResource Parent: MemberResource
Value:The date MUST be given in RFC 1123 format (rfc-1123 Value:The date MUST be given in RFC 1123 format (rfc-1123
production, defined in section 3.3.1 of [HTTP11] production, defined in section 3.3.1 of [Fielding et al., 1997]
3.3.5.9 ETag 3.3.5.9 ETag
Name: http://www.ietf.org/standards/dav/etag Name: http://www.ietf.org/standards/dav/etag
Purpose: The entity tag of the resource. Purpose: The entity tag of the resource.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: MemberResource Parent: MemberResource
Value: entity-tag ; defined in Section 3.11 of [Fielding et
Value:entity-tag ; defined in Section 3.11 of [HTTP11] al., 1997]
3.3.5.10 DisplayName 3.3.5.10 DisplayName
Name: http://www.ietf.org/standards/dav/displayname Name: http://www.ietf.org/standards/dav/displayname
Purpose: A name for the resource that is suitable for Purpose: A name for the resource that is suitable for
presentation to a person presentation to a person
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: MemberResource Parent: MemberResource
Value:Any valid XML character data (from XML specification) Value:Any valid XML character data (from XML specification)
3.3.5.11 Content-Language 3.3.5.11 Content-Language
Name: http://www.ietf.org/standards/dav/content-language Name: http://www.ietf.org/standards/dav/content-language
Purpose: Describes the natural language(s) of the intended Purpose: Describes the natural language(s) of the intended
audience for the resource. audience for the resource.
Schema: http://www.ietf.org.standards/dav/ Schema: http://www.ietf.org.standards/dav/
Parent: MemberResource Parent: MemberResource
Value: 1#language-tag ;language-tag is defined in section Value: 1#language-tag ;language-tag is defined in section
14.13 of RFC 2068 14.13 of RFC 2068
3.3.6 Example 3.3.6 Example
INDEX /user/yarong/dav_drafts/ HTTP/1.1 INDEX /user/yarong/dav_drafts/ HTTP/1.1
Host: www.microsoft.com Host: www.microsoft.com
Depth: 1 Depth: 1
HTTP/1.1 200 OK HTTP/1.1 200 OK
skipping to change at line 1644 skipping to change at line 1470
3.3.6 Example 3.3.6 Example
INDEX /user/yarong/dav_drafts/ HTTP/1.1 INDEX /user/yarong/dav_drafts/ HTTP/1.1
Host: www.microsoft.com Host: www.microsoft.com
Depth: 1 Depth: 1
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/xml Content-Type: application/xml
Content-Length: xxx Content-Length: xxx
Last-Modified: xxx Last-Modified: xxx
ETag: “fooyyybar” ETag: "fooyyybar"
<XML> <XML>
<XML:Namespace><Ref>http://www.ietf.org/standards/dav/< <XML:Namespace><Ref>http://www.ietf.org/standards/dav/</><As
/><As>D</></> >D</></>
<D:CollectionResource> <D:CollectionResource>
<MemberResource> <MemberResource>
<XML:Ref>namespace.doc</> <XML:Ref>namespace.doc</>
<IsCollection>false</> <IsCollection>false</>
<Content-Type>application/msword</> <Content-Type>application/msword</>
<External>false</> <External>false</>
<Creation-Date>Thu, 20 Mar 1997 23:05:25 <Creation-Date>Thu, 20 Mar 1997 23:05:25 GMT</>
GMT</>
<Last-Modified>Fri, 22 Aug 1997 18:22:56 <Last-Modified>Fri, 22 Aug 1997 18:22:56 GMT</>
GMT</>
<Etag>8675309</> <Etag>8675309</>
<DisplayName>WebDAV Name Space Operations <DisplayName>WebDAV Name Space Operations Draft</>
Draft</>
<Content-Language>en</> <Content-Language>en</>
</> </> </> </>
</> </>
This example shows the result of the INDEX method applied to the
This example shows the result of the INDEX method applied to collection resource
http://www.microsoft.com/er/yarong/dav_drafts/. It returns a
the collection resource response body in XML format, which gives information about the
http://www.microsoft.com/er/yarong/dav_drafts/. It returns container’s sole member,
a response body in XML format, which gives information about http://www.microsoft.com/users/yarong/dav_drafts/namespace.doc.
the container’s sole member,
http://www.microsoft.com/users/yarong/dav_drafts/namespace.d
oc.
3.4 Behavior of RFC 2068 Methods on Collections 3.4 Behavior of RFC 2068 Methods on Collections
With the introduction of the collection resource type to the
HTTP object model, it is necessary to define the behavior of With the introduction of the collection resource type to the HTTP
the existing methods (defined in RFC 2068) when invoked on a object model, it is necessary to define the behavior of the
collection resource to avoid ambiguity. While some methods, existing methods (defined in RFC 2068) when invoked on a
such as OPTIONS and TRACE behave identically when applied to collection resource to avoid ambiguity. While some methods, such
as OPTIONS and TRACE behave identically when applied to
collections, GET, HEAD, POST, PUT, and DELETE require some collections, GET, HEAD, POST, PUT, and DELETE require some
additional explanation. additional explanation.
3.4.1 GET, HEAD for Collections 3.4.1 GET, HEAD for Collections
The semantics of GET are unchanged when applied to a The semantics of GET are unchanged when applied to a collection,
collection, since GET is defined as, “retrieve whatever since GET is defined as, "retrieve whatever information (in the
information (in the form of an entity) is identified by the form of an entity) is identified by the Request-URI" [Fielding et
Request-URI” [HTTP11]. GET when applied to a collection MAY al., 1997]. GET when applied to a collection MAY return the
return the contents of an “index.html” resource, a human- contents of an "index.html" resource, a human-readable view of
readable view of the contents of the collection, or the contents of the collection, or something else altogether, and
something else altogether, and hence it is possible the hence it is possible the result of a GET on a collection will
result of a GET on a collection will bear no correlation to bear no correlation to the state of the collection.
the state of the collection.
Similarly, since the definition of HEAD is a GET without a Similarly, since the definition of HEAD is a GET without a
response message body, the semantics of HEAD do not require response message body, the semantics of HEAD do not require any
any modification when applied to collection resources. modification when applied to collection resources.
3.4.2 POST for Collections 3.4.2 POST for Collections
Since by definition the actual function performed by POST is Since by definition the actual function performed by POST is
determined by the server and often depends on the particular determined by the server and often depends on the particular
resource, the behavior of POST when applied to collections resource, the behavior of POST when applied to collections cannot
cannot be modified because it is largely undefined. Thus be modified because it is largely undefined. Thus the semantics
the semantics of POST do not require any modification when of POST do not require any modification when applied to a
applied to a collection. collection.
3.4.3 PUT for Collections 3.4.3 PUT for Collections
In HTTP/1.1, PUT stores the request entity under the In HTTP/1.1, PUT stores the request entity under the Request-URI,
Request-URI, and hence its semantics are limited to non- and hence its semantics are limited to non-collection resources.
collection resources. If a PUT is invoked on a collection If a PUT is invoked on a collection resource it MUST fail.
resource it MUST fail.
When the PUT operation creates a new non-collection When the PUT operation creates a new non-collection resource, a
resource, a server MAY add that resource’s URI to one or server MAY add that resource’s URI to one or more collections
more collections within the server’s controlled namespace. within the server’s controlled namespace.
3.4.4 DELETE for Collections 3.4.4 DELETE for Collections
When DELETE is applied to a collection resource, all When DELETE is applied to a collection resource, all internal
internal members MUST be recursively deleted. The
dav:link/propagate external members MUST be deleted and
their links must be removed. dav:link/nopropagate external
members MUST have only their link removed; the resources
MUST not be deleted.
The Depth header does not apply to the DELETE method. It members MUST be recursively deleted. The dav:link/propagate
cannot be used to limit the extent of the operation. If it external members MUST be deleted and their links must be removed.
dav:link/nopropagate external members MUST have only their link
removed; the resources MUST not be deleted.
is present it MUST be ignored. The Depth header does not apply to the DELETE method. It cannot
be used to limit the extent of the operation. If it is present it
MUST be ignored.
When applied to any resource, the DELETE method deletes all When applied to any resource, the DELETE method deletes all
properties on the Request-URI. properties on the Request-URI.
During DELETE processing, a server MAY remove the URI of the During DELETE processing, a server MAY remove the URI of the
deleted resource(s) from collections within its controlled deleted resource(s) from collections within its controlled
namespace. namespace.
3.4.4.1 New Response Codes for DELETE 3.4.4.1 New Response Codes for DELETE
207 (Partial Success) Only some of the member resources were 207 (Partial Success) Only some of the member resources were
deleted. The response entity will describe any errors. deleted. The response entity will describe any errors.
500 (Server Error) The resource was in such a state that it 500 (Server Error) The resource was in such a state that it could
could not be deleted. The response entity will describe not be deleted. The response entity will describe reason for the
reason for the error. error.
3.5 COPY Method 3.5 COPY Method
3.5.1 Problem Description 3.5.1 Problem Description
Currently, in order to create a copy of a resource, the Currently, in order to create a copy of a resource, the client
client must GET an entity and then PUT that entity to the must GET an entity and then PUT that entity to the desired
desired destination. This requires (1) an entity to be destination. This requires (1) an entity to be transmitted to and
transmitted to and from the server and (2) that the resource from the server and (2) that the resource be expressible as an
be expressible as an entity with complete fidelity. entity with complete fidelity. This is problematic because of
the network traffic involved in making a copy, and because there
This is problematic because of the network traffic involved is often no way to fully express a resource as an entity without
in making a copy, and because there is often no way to fully a loss of fidelity.
express a resource as an entity without a loss of fidelity.
3.5.2 Solution Requirements 3.5.2 Solution Requirements
The solution: The solution:
- MUST allow a principal to create a copy of a resource
MUST allow a principal to create a copy of a resource without having to transmit the resource to and from the server.
without having to transmit the resource to and from the
server.
3.5.3 The Request 3.5.3 The Request
The COPY method creates a duplicate of the source resource, The COPY method creates a duplicate of the source resource, given
given by the Request-URI, in the destination resource, given by the Request-URI, in the destination resource, given by the
by the Destination header. The Destination header MUST be Destination header. The Destination header MUST be present. The
present. The exact behavior of the COPY method depends on exact behavior of the COPY method depends on the type of the
the type of the source resource. source resource.
3.5.3.1 COPY for HTTP/1.1 resources 3.5.3.1 COPY for HTTP/1.1 resources
When the source resource is not a collection, and is not a When the source resource is not a collection, and is not a
property, the body of the destination resource MUST be property, the body of the destination resource MUST be octet-for-
octet-for-octet identical to the body of the source octet identical to the body of the source resource. Alterations
resource. Alterations to the destination resource do not to the destination resource do not modify the source resource.
modify the source resource. Alterations to the source Alterations to the source resource do not modify the destination
resource do not modify the destination resource. Thus, all
copies are performed “by-value”.
If the Duplicate-Properties header is “false,” then resource. Thus, all copies are performed "by-value".
properties SHOULD NOT be copied to the destination resource.
If the Duplicate-Properties header is “false” and the
Enforce-Live-Properties header is also present, the request
MUST fail with a 412 (Precondition Failed) status code.
[Ed. Note: what if resource to be copied has no properties,
and no properties are explicitly named in the header?]
All properties on a source resource SHOULD be duplicated on If the Duplicate-Properties header is "false," then properties
SHOULD NOT be copied to the destination resource. If the
Duplicate-Properties header is "false" and the Enforce-Live-
Properties header is also present, the request MUST fail with a
412 (Precondition Failed) status code. [Ed. Note: what if
resource to be copied has no properties, and no properties are
explicitly named in the header?]
the destination resource following the definition for All properties on a source resource SHOULD be duplicated on the
copying properties. destination resource following the definition for copying
properties.
3.5.3.2 COPY for Properties 3.5.3.2 COPY for Properties
Live properties SHOULD be duplicated as identically behaving Live properties SHOULD be duplicated as identically behaving live
live properties at the destination resource. Since they are properties at the destination resource. Since they are live
live properties, the server determines the syntax and properties, the server determines the syntax and semantics (hence
semantics (hence value) of these properties. Properties value) of these properties. Properties named by the Enforce-
named by the Enforce-Live-Properties header MUST be live on Live-
the destination resource, or the method MUST fail. If a Properties header MUST be live on the destination resource, or
property is not named by Enforce-Live-Properties and cannot the method MUST fail. If a property is not named by Enforce-
be copied live, then its value MUST be duplicated in an Live-
identically named, dead resource on the destination Properties and cannot be copied live, then its value MUST be
resource. duplicated in an identically named, dead resource on the
destination resource.
For every dead property defined on the source resource, For every dead property defined on the source resource, there
there SHOULD be an octet-for-octet identical dead property SHOULD be an octet-for-octet identical dead property on the
on the destination resource. destination resource.
3.5.3.3 COPY for Collections 3.5.3.3 COPY for Collections
The Depth and Overwrite headers govern the behavior of COPY The Depth and Overwrite headers govern the behavior of COPY for
for collections. collections.
When performing a recursive copy, all HTTP/1.1 request When performing a recursive copy, all HTTP/1.1 request headers
headers are duplicated on the propagated method request are duplicated on the propagated method request except for the
except for the precondition headers If-Modified-Since, If- precondition headers If-Modified-Since, If-Match, If-None-Match,
Match, If-None-Match, If-Range, If-Unmodified-Since, which If-Range, If-Unmodified-Since, which should only be applied to
should only be applied to the Request-URI in order to the Request-URI in order to determine if the operation should be
determine if the operation should be performed. The performed. The Destination header MUST be rewritten to preserve
Destination header MUST be rewritten to preserve the the membership of the destination collection, i.e., by appending
membership of the destination collection, i.e., by appending
the relative URI of the member to the URI of the destination the relative URI of the member to the URI of the destination
collection. collection.
A Depth of “0” indicates the collection MUST duplicate all A Depth of "0" indicates the collection MUST duplicate all of its
of its external members in a new collection at the external members in a new collection at the Destination. Since
Destination. Since the COPY method is not propagated to its the COPY method is not propagated to its members, no internal
members, no internal member resource is duplicated. member resource is duplicated.
A Depth of “1” indicates the collection MUST propagate the A Depth of "1" indicates the collection MUST propagate the COPY
COPY to all internal, non-collection members. If the to all internal, non-collection members. If the Overwrite header
Overwrite header is “true” the COPY method duplicates all of is "true" the COPY method duplicates all of its external members
its external members in a new collection at the Destination. in a new collection at the Destination. If the Overwrite header
If the Overwrite header is “false” and the destination is "false" and the destination resource is a collection, the COPY
resource is a collection, the COPY method does not duplicate method does not duplicate its external members, but is propagated
its external members, but is propagated to all internal, to all internal, non-collection members.
non-collection members.
A Depth of “infinity” indicates the collection MUST A Depth of "infinity" indicates the collection MUST propagate the
propagate the COPY method to all internal members. If the COPY method to all internal members. If the Overwrite header is
Overwrite header is “true,” the COPY method MUST duplicate "true," the COPY method MUST duplicate all of its external
all of its external members in a new collection at the
Destination. If the Overwrite header is “false” and the members in a new collection at the Destination. If the Overwrite
destination resource is a collection, then the COPY method header is "false" and the destination resource is a collection,
does not duplicate its external members, but is propagated then the COPY method does not duplicate its external members, but
to all internal members. is propagated to all internal members.
3.5.3.4 Type Interactions 3.5.3.4 Type Interactions
If the destination resource identifies a property and the If the destination resource identifies a property and the source
source resource is not a property, then the copy SHOULD resource is not a property, then the copy SHOULD fail.
fail.
If the destination resource identifies a collection and the If the destination resource identifies a collection and the
Overwrite header is “true,” prior to performing the copy, Overwrite header is "true," prior to performing the copy, the
server MUST perform a DELETE operation on the collection.
the server MUST perform a DELETE operation on the
collection.
3.5.4 The Response 3.5.4 The Response
200 (OK) The source resource was successfully copied to a 200 (OK) The source resource was successfully copied to a pre-
pre-existing destination resource. existing destination resource.
201 (Created) The source resource was successfully copied. 201 (Created) The source resource was successfully copied. The
The copy operation resulted in the creation of a new copy operation resulted in the creation of a new resource.
resource.
207 (Partial Success) Only some of the member resources were 207 (Partial Success) Only some of the member resources were
copied. The return entity body describes the status code for copied. The return entity body describes the status code for each
each resource. resource.
412 (Precondition Failed) This status code MUST be returned 412 (Precondition Failed) This status code MUST be returned if
if the server was unable to maintain the liveness of the the server was unable to maintain the liveness of the properties
properties listed in the Enforce-Live-Properties header, or listed in the Enforce-Live-Properties header, or if the Overwrite
if the Overwrite header is false, and the state of the header is false, and the state of the destination resource is
destination resource is non-null. non-
null.
500 (Server Error) The resource was in such a state that it 500 (Server Error) The resource was in such a state that it could
could not be copied. This may occur if the Destination not be copied. This may occur if the Destination header indicated
header indicated an external (from the point of view of the an external (from the point of view of the server) resource and
server) resource and the server has no capability to copy to the server has no capability to copy to an external resource.
an external resource.
502 (Bad Gateway) - This may occur when copying to external 502 (Bad Gateway) - This may occur when copying to external
resources and the destination server refused to accept the resources and the destination server refused to accept the
resource. resource.
3.5.5 Examples 3.5.5 Examples
3.5.5.1 Overwrite Example 3.5.5.1 Overwrite Example
This example shows resource This example shows resource
http://www.ics.uci.edu/~fielding/index.html being copied to http://www.ics.uci.edu/~fielding/index.html being copied to the
the location location http://www.ics.uci.edu/users/f/fielding/index.html. The
http://www.ics.uci.edu/users/f/fielding/index.html. The contents of the destination resource were overwritten, if non-
contents of the destination resource were overwritten, if null.
non-null.
COPY /~fielding/index.html HTTP/1.1 COPY /~fielding/index.html HTTP/1.1
Host: www.ics.uci.edu Host: www.ics.uci.edu
Destination: Destination:
http://www.ics.uci.edu/users/f/fielding/index.html http://www.ics.uci.edu/users/f/fielding/index.html
Overwrite: “true” Overwrite: "true"
HTTP/1.1 200 OK HTTP/1.1 200 OK
3.5.5.2 No Overwrite Example 3.5.5.2 No Overwrite Example
The following example shows the same copy operation being The following example shows the same copy operation being
performed, except with the Overwrite header set to “false.” performed, except with the Overwrite header set to "false." A
A response of 412, Precondition Failed, is returned because response of 412, Precondition Failed, is returned because the
the destination resource has a non-null state. destination resource has a non-null state.
COPY /~fielding/index.html HTTP/1.1 COPY /~fielding/index.html HTTP/1.1
Host: www.ics.uci.edu Host: www.ics.uci.edu
Destination: Destination:
http://www.ics.uci.edu/users/f/fielding/index.html http://www.ics.uci.edu/users/f/fielding/index.html
HTTP/1.1 412 Precondition Failed HTTP/1.1 412 Precondition Failed
3.6 MOVE Method 3.6 MOVE Method
3.6.1 Problem Description 3.6.1 Problem Description
The move operation on a resource is the logical equivalent The move operation on a resource is the logical equivalent of a
of a copy followed by a delete. copy followed by a delete.
In HTTP 1.1, the procedure could be performed in several In HTTP 1.1, the procedure could be performed in several steps.
steps. First, the client could issue a GET to retrieve a First, the client could issue a GET to retrieve a representation
representation of a resource, issue a DELETE to remove the of a resource, issue a DELETE to remove the resource from the
resource from the server, then use PUT to place the resource server, then use PUT to place the resource on the server with a
on the server with a new URI. As is the case for COPY - new URI. As is the case for COPY - because of the network traffic
because of the network traffic involved in making a move, involved in making a move, and because there is often no way to
and because there is often no way to fully express a fully express a resource as an entity without a loss of fidelity
resource as an entity without a loss of fidelity - server - server move functionality is preferable.
move functionality is preferable.
With a DAV server, a principal may accomplish this task by With a DAV server, a principal may accomplish this task by
issuing a COPY and then DELETE. Network load decreases, but issuing a COPY and then DELETE. Network load decreases, but the
the server load may still be significant because the server server load may still be significant because the server must
must create a duplicate resource. Were a server to know create a duplicate resource. Were a server to know beforehand
beforehand that a principal intended to perform COPY and that a principal intended to perform COPY and DELETE operations
DELETE operations in succession, it could avoid the creation in succession, it could avoid the creation of a duplicate
of a duplicate resource. resource.
3.6.2 Solution Requirements 3.6.2 Solution Requirements
The solution: The solution:
- Must prevent the unneeded transfer of entity bodies from and
Must prevent the unneeded transfer of entity bodies from and
to the server. to the server.
- Must prevent the unneeded creation of copies by the server.
Must prevent the unneeded creation of copies by the server.
3.6.3 The Request 3.6.3 The Request
The MOVE method is defined as the logical equivalent of a The MOVE method is defined as the logical equivalent of a COPY
COPY followed by a DELETE of the source resource, performed followed by a DELETE of the source resource, performed
atomically. atomically.
3.6.4 The Response 3.6.4 The Response
200 (OK) - The resource was moved. A successful response 200 (OK) - The resource was moved. A successful response must
must contain the Content-Location header, set equal to the contain the Content-Location header, set equal to the URI in
URI in source. This lets caches properly flush any cached source. This lets caches properly flush any cached entries for
entries for the source. Unfortunately the Content-Location the source. Unfortunately the Content-Location header only allows
header only allows a single value so it is not possible for a single value so it is not possible for caches unfamiliar with
caches unfamiliar with the MOVE method to properly clear the MOVE method to properly clear their caches.
their caches.
207 (Partial Success) Only some of the member resources were 207 (Partial Success) Only some of the member resources were
moved. The return entity body will give the status code for moved. The return entity body will give the status code for each
each resource. resource.
412 (Precondition Failed) This status code MUST be returned 412 (Precondition Failed) This status code MUST be returned if
if the server was unable to maintain the liveness of the the server was unable to maintain the liveness of the properties
properties listed in the Enforce-Live-Properties header, or listed in the Enforce-Live-Properties header, or if the Overwrite
if the Overwrite header is false, and the state of the header is false, and the state of the destination resource is
destination resource is non-null. non-
null.
501 (Not Implemented) - This may occur if the Destination 501 (Not Implemented) - This may occur if the Destination header
header specifies a resource which is outside its domain of specifies a resource which is outside its domain of control
control (e.g., stored on another server) resource and the (e.g., stored on another server) resource and the server either
server either refuses or is incapable of moving to an refuses or is incapable of moving to an external resource.
external resource.
502 (Bad Gateway) - This may occur when moving to external 502 (Bad Gateway) - This may occur when moving to external
resources and the destination server refused to accept the resources and the destination server refused to accept the
resource. resource.
3.6.5 Examples 3.6.5 Examples
3.6.5.1 Overwrite Example 3.6.5.1 Overwrite Example
This example shows resource This example shows resource
http://www.ics.uci.edu/~fielding/index.html being moved to http://www.ics.uci.edu/~fielding/index.html being moved to the
the location location http://www.ics.uci.edu/users/f/fielding/index.html. The
http://www.ics.uci.edu/users/f/fielding/index.html. The contents of the destination resource were overwritten, if non-
contents of the destination resource were overwritten, if null.
non-null.
MOVE /~fielding/index.html HTTP/1.1 MOVE /~fielding/index.html HTTP/1.1
Host: www.ics.uci.edu Host: www.ics.uci.edu
Destination: Destination:
http://www.ics.uci.edu/users/f/fielding/index.html http://www.ics.uci.edu/users/f/fielding/index.html
Overwrite: true Overwrite: true
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Location: Content-Location:
http://www.ics.uci.edu/users/f/fielding/index.html http://www.ics.uci.edu/users/f/fielding/index.html
3.7 Multi-Status Response 3.7 ADDREF Method
3.7.1 Problem Definition 3.7.1 Problem Definition
Certain methods (COPY, MOVE, and DELETE) when applied to a There needs to be a way to add an external member to a
collection might be recursively applied to all sub-members collection.
of the collection. In this case, it is possible that the
operation will succeed on some member resources and fail on
others, thus generating a 207 (Partial Success) status code.
A principal may need to know which members of the
collection succeeded and which failed.
3.7.2 Solution Requirements 3.7.2 Solution Requirements
The solution must: The solution must:
- allow access control
- allow referencing to URIs of external members
- not require a body
- communicate the status code and reason 3.7.3 The Request
- give the URI of the resource on which the method was
invoked
- be consistent with other return body formats
3.7.3 Multi-Status Response
The default multi-status response body is an application/xml
HTTP entity that contains a single XML element called
multiresponse, which contains a set of XML elements called
response, one for each 200, 300, 400, and 500 series status
code generated during the method invocation. 100 series
status codes MUST NOT be recorded in a response XML element.
Each response XML element contains two sub-entities, ref,
the URI of the resource on which the method was invoked, and
status, which holds the status-line from the method
invocation.
A multi-status response MUST be present when a 207 (Partial
Success) status code is returned by the initial method
invocation.
3.7.3.1 MultiResponse
Name:
http://www.ietf.org/standards/dav/multiresponse/multi
response
Purpose: Contains multiple response messages.
Schema: http://www.ietf.org/standards/dav/multiresponse/
Parent: <XML>
Value:1*Response
3.7.3.2 Response
Name:
http://www.ietf.org/standards/dav/multiresponse/respo
nse
Purpose: Holds a single response
Schema: http://www.ietf.org/standards/dav/multiresponse/
Parent: MultiResponse
Value:Ref, Status
3.7.3.3 Status
Name:
http://www.ietf.org/standards/dav/multiresponse/statu
s
Purpose: Holds a single HTTP status-line
Schema: http://www.ietf.org/standards/dav/multiresponse/
Parent: Response
Value:status-line ;status-line defined in [HTTP11]
3.7.4 Example
COPY /users/jdoe/collection/ HTTP/1.1
Host: www.doecorp.com
Destination:
http://www.doecorp.com/users/jdoe/othercollection/
Depth: infinity
Overwrite: false
HTTP/1.1 207 Partial Success
Content-Type: application/xml
Content-Length: xxx
<XML>
<XML:Namespace><Ref>http://www.ietf.org/standards/dav/multir
esponse/</><As>R</></>
<R:MultiResponse>
<Response>
<XML:Ref>http://www.doecorp.com/users/jdoe/collection/i The ADDREF method adds the URI specified in the Collection-Member
ndex.html</> header as an external member to the collection specified by the
<Status>HTTP/1.1 412 Precondition Failed</> Request-URI. The value in the Collection-Member header MUST be an
</>
<Response>
<XML:Ref>http://www.doecorp.com/users/jdoe/collection/r absolute URI meeting the requirements of an external member URI.
eport.html</> The propagation type of the external URI is specified in the
<Status>HTTP/1.1 200 OK</> Collection-Member Header.
</>
</>
</>
3.8 ADDREF Method 3.8 DELREF Method
3.8.1 Problem Definition 3.8.1 Problem Definition
There needs to be a way to add an external member to a There needs to be a way to remove an external member from a
collection. collection.
3.8.2 Solution Requirements 3.8.2 Solution Requirements
The solution must: The solution must:
- allow access control
allow access control - allow referencing to URIs of external members
- not require a body
allow referencing to URIs of external members
not require a body
3.8.3 The Request 3.8.3 The Request
The ADDREF method adds the URI specified in the Collection- The DELREF method removes the URI specified in the Collection-
Member header as an external member to the collection Member header from the collection specified by the Request-URI.
specified by the Request-URI. The value in the Collection-
Member header MUST be an absolute URI meeting the
requirements of an external member URI. The propagation
type of the external URI is specified in the Collection-
Member Header.
3.9 DELREF Method 3.9 PATCH Method
3.9.1 Problem Definition 3.9.1 Problem Definition
There needs to be a way to remove an external member from a At present, if a principal wishes to modify a resource, they must
collection. issue a GET against the resource, modify their local copy of the
resource, and then issue a PUT to place the modified resource on
3.9.2 Solution Requirements the server. This procedure is inefficient because the entire
entity for a resource must be transmitted to and from the server
The solution must: in order to make even small changes. Ideally, the update entity
transmitted to the server should be proportional in size to the
allow access control
allow referencing to URIs of external members
not require a body
3.9.3 The Request
The DELREF method removes the URI specified in the
Collection-Member header from the collection specified by
the Request-URI.
3.10 PATCH Method
3.10.1 Problem Definition
At present, if a principal wishes to modify a resource, they
must issue a GET against the resource, modify their local
copy of the resource, and then issue a PUT to place the
modified resource on the server. This procedure is
inefficient because the entire entity for a resource must be
transmitted to and from the server in order to make even
small changes. Ideally, the update entity transmitted to
the server should be proportional in size to the
modifications. modifications.
3.10.2 Solution Requirements 3.9.2 Solution Requirements
The solution must: The solution must:
- allow partial modification of a resource without having to
allow partial modification of a resource without having to
transmit the entire modified resource transmit the entire modified resource
- allow byte-range patching
allow byte-range patching - allows extensions so that patches can be done beyond simple
allows extensions so that patches can be done beyond simple
byte-range patching byte-range patching
- allow ranges to be deleted, inserted, and replaced
allow ranges to be deleted, inserted, and replaced 3.9.3 The Request
3.10.3 The Request
The PATCH method contains a list of differences between the The PATCH method contains a list of differences between the
original version of the resource identified by the Request- original version of the resource identified by the Request-URI
URI and the desired content of the resource after the PATCH and the desired content of the resource after the PATCH action
action has been applied. The list of differences is in a has been applied. The list of differences is in a format defined
format defined by the media type of the entity (e.g., by the media type of the entity (e.g., "application/diff") and
"application/diff") and must include sufficient information must include sufficient information to allow the server to
to allow the server to convert the original version of the convert the original version of the resource to the desired
resource to the desired version. version.
Since the semantics of PATCH are non-idempotent, responses Since the semantics of PATCH are non-idempotent, responses to
to this method are not cacheable. this method are not cacheable.
If the request appears (at least initially) to be If the request appears (at least initially) to be acceptable, the
acceptable, the server MUST transmit an interim 100 response server MUST transmit an interim 100 response message after
message after receiving the empty line terminating the receiving the empty line terminating the request headers and
request headers and continue processing the request. continue processing the request.
While server support for PATCH is optional, if a server does While server support for PATCH is optional, if a server does
support PATCH, it MUST support at least the application/xml support PATCH, it MUST support at least the application/xml diff
diff format defined below. Support for the VTML difference format defined below. Support for the VTML difference format
format [VTML] is recommended, but not required. [VTML] is recommended, but not required.
3.10.4 application/XML elements for PATCH
The resourceupdate XML elementXML element contains a set of
XML sub-entities that describe modification operations. The
name and meaning of these XML elements is given below.
Processing of these directives MUST be performed in the
order encountered within the XML document. A directive
operates on the resource as modified by all previous
directives (executed in sequential order).
3.10.4.1 ResourceUpdate 3.9.4 application/XML elements for PATCH
Name: The resourceupdate XML elementXML element contains a set of XML
http://www.ietf.org/standards/dav/patch/resourceupdat sub-entities that describe modification operations. The name and
e meaning of these XML elements is given below. Processing of these
directives MUST be performed in the order encountered within the
XML document. A directive operates on the resource as modified
by all previous directives (executed in sequential order).
Purpose: Contains an ordered set of changes to a non- 3.9.4.1 ResourceUpdate
collection, non-property resource.
Name: http://www.ietf.org/standards/dav/patch/resourceupdate
Purpose: Contains an ordered set of changes to a non-collection,
non-property resource.
Schema: http://www.ietf.org/standards/dav/patch/ Schema: http://www.ietf.org/standards/dav/patch/
Parent: <XML> Parent: <XML>
Value:*(Insert | Delete | Replace) Value:*(Insert | Delete | Replace)
3.10.4.2 Insert 3.9.4.2 Insert
Name: http://www.ietf.org/standards/dav/patch/insert Name: http://www.ietf.org/standards/dav/patch/insert
Purpose: Insert the XML elementXML element’s contents starting
Purpose: Insert the XML elementXML element’s contents exactly at the specified octet.
starting exactly at the specified octet.
Schema: http://www.ietf.org/standards/dav/patch/ Schema: http://www.ietf.org/standards/dav/patch/
Parent: ResourceUpdate Parent: ResourceUpdate
Value: The insert XML elementXML element MUST contain an octet
XML elementXML element that specifies an octet position within
the body of a resource. A value of "end" specifies the end of
the resource. The body of the insert XML elementXML element
contains the octets to be inserted.
Value:The insert XML elementXML element MUST contain an 3.9.4.3 Delete
octet XML elementXML element that specifies an octet
position within the body of a resource. A value of “end”
specifies the end of the resource. The body of the insert
XML elementXML element contains the octets to be inserted.
3.10.4.3 Delete
Name: http://www.ietf.org/standards/dav/patch/delete Name: http://www.ietf.org/standards/dav/patch/delete
Purpose: Removes the specified range of octets. Purpose: Removes the specified range of octets.
Schema: http://www.ietf.org/standards/dav/patch/ Schema: http://www.ietf.org/standards/dav/patch/
Parent: ResourceUpdate Parent: ResourceUpdate
Value:The Delete XML elementXML element MUST contain an Value:The Delete XML elementXML element MUST contain an
octet-range XML elementXML element. The value of this XML octet-
elementXML element is empty. range XML elementXML element. The value of this XML elementXML
element is empty.
Discussion: The octets which are deleted are removed, which Discussion: The octets which are deleted are removed, which means
means the resource is collapsed and the length of the the resource is collapsed and the length of the resource is
resource is decremented by the size of the octet range. It decremented by the size of the octet range. It is not
is not appropriate to replace deleted octets with zeroed-out appropriate to replace deleted octets with zeroed-out octets,
octets, since zero is a valid octet value. since zero is a valid octet value.
3.10.4.4 Replace 3.9.4.4 Replace
Name: http://www.ietf.org/standards/dav/patch/replace Name: http://www.ietf.org/standards/dav/patch/replace
Purpose: Replaces the specified range of octets with the Purpose: Replaces the specified range of octets with the
contents of the XML element. If the number of octets in the contents of the XML element. If the number of octets in the XML
XML element is different from the number of octets element is different from the number of octets specified, the
specified, the update MUST be rejected. update MUST be rejected.
Schema: http://www.ietf.org/standards/dav/patch/ Schema: http://www.ietf.org/standards/dav/patch/
Parent: ResourceUpdate Parent: ResourceUpdate
Value: The Replace XML element MUST contain an octet-range XML
element. The contents of the entity are the replacement octets.
Value:The Replace XML element MUST contain an octet-range 3.9.4.5 Octet-Range Attribute
XML element. The contents of the entity are the replacement
octets.
3.10.4.5 Octet-Range Attribute
Name:
http://www.ietf.org/standards/dav/patch/octet-range
Name: http://www.ietf.org/standards/dav/patch/octet-
range
Purpose: Specifies a range of octets which the enclosing Purpose: Specifies a range of octets which the enclosing
property effects. property effects.
Schema: http://www.ietf.org/standards/dav/patch/ Schema: http://www.ietf.org/standards/dav/patch/
Parent: Insert, Delete, Replace Parent: Insert, Delete, Replace
Value: number ["-" (number | "end")]
Value: number [“-“ (number | “end”)]
Number = 1*Digit Number = 1*Digit
Description: Octet numbering begins with 0. If the octet contains
a single number then the operation is to begin at that octet and
to continue for a length specified by the operation. In the case
of a delete, this would mean to delete but a single octet. In the
case of an insert this would mean to begin the insertion at the
specified octet and to continue for the length of the included
value, extending the resource if necessary. In the case of
replace, the replace begins at the specified octet and overwrites
all that follow to the length of the included value. Octet
values MUST specify locations in the state of the resource prior
to the processing of the PATCH method.
Description: Octet numbering begins with 0. If the octet 3.9.5 The Response
contains a single number then the operation is to begin at
that octet and to continue for a length specified by the
operation. In the case of a delete, this would mean to
delete but a single octet. In the case of an insert this
would mean to begin the insertion at the specified octet and
to continue for the length of the included value, extending
the resource if necessary. In the case of replace, the
replace begins at the specified octet and overwrites all
that follow to the length of the included value. Octet
values MUST specify locations in the state of the resource
prior to the processing of the PATCH method.
3.10.5 The Response
200 (OK) - The request entity body was processed without 200 (OK) - The request entity body was processed without error,
error, resulting in an update to the state of the resource. resulting in an update to the state of the resource.
409 (Conflict) - If the update information in the request 409 (Conflict) - If the update information in the request message
message body does not make sense given the current state of body does not make sense given the current state of the resource
the resource (e.g., an instruction to delete a non-existent (e.g., an instruction to delete a non-existent line), this status
line), this status code MAY be returned. code MAY be returned.
415 (Unsupported Media Type) - The server does not support 415 (Unsupported Media Type) - The server does not support the
the content type of the update instructions in the request content type of the update instructions in the request message
message body. body.
416 (Unprocessable Entity) - A new status code. The server 416 (Unprocessable Entity) - A new status code. The server
understands the content type of the request entity, but was understands the content type of the request entity, but was
unable to process the contained instructions. unable to process the contained instructions.
3.10.6 Examples 3.9.6 Examples
3.10.6.1 HTML file modification 3.9.6.1 HTML file modification
The following example shows a modification of the title and The following example shows a modification of the title and
contents of the HTML resource contents of the HTML resource http://www.example.org/hello.html.
http://www.example.org/hello.html.
Before: Before:
<HTML> <HTML>
<HEAD> <HEAD>
<TITLE>Hello world HTML page</TITLE> <TITLE>Hello world HTML page</TITLE>
</HEAD> </HEAD>
<BODY> <BODY>
<P>Hello, world!</P> <P>Hello, world!</P>
</BODY> </BODY>
</HTML> </HTML>
PATCH Request: Response: PATCH Request: Response:
PATCH hello.html HTTP/1.1 PATCH hello.html HTTP/1.1
Host: www.example.org Host: www.example.org
Content-Type: application/xml Content-Type: application/xml
Content-Length: xxx Content-Length: xxx
HTTP/1.1 100 Continue HTTP/1.1 100 Continue
<XML> <XML>
<XML:Namespace><ref>http://www.ietf.org/standards/dav/p <XML:Namespace><ref>http://www.ietf.org/standards/dav/patch/
</><AS>D</></>
atch/</><AS>D</></>
<D:ResourceUpdate> <D:ResourceUpdate>
<Replace><octet-range>14</>&003CTITLE&003ENew <Replace><octet-range>14</>&003CTITLE&003ENew
Title&003C/TITLE&003E</> Title&003C/TITLE&003E</>
<Delete><octet-range>38-50</> <Delete><octet-range>38-50</>
<Insert><octet-range>86</>&003CP&003ENew <Insert><octet-range>86</>&003CP&003ENew
paragraph&003C/P&003E paragraph&003C/P&003E
</> </>
</></> </></>
HTTP/1.1 200 OK HTTP/1.1 200 OK
After: After:
skipping to change at line 2418 skipping to change at line 2060
<HTML> <HTML>
<HEAD> <HEAD>
<TITLE>New Title</TITLE> <TITLE>New Title</TITLE>
</HEAD> </HEAD>
<BODY> <BODY>
<P>Hello, world!</P> <P>Hello, world!</P>
<P>New paragraph</P> <P>New paragraph</P>
</BODY> </BODY>
</HTML> </HTML>
3.11 Headers 3.10 Headers
3.11.1 Depth 3.10.1 Depth
The Depth header determines the depth to which a method is The Depth header determines the depth to which a method is
propagated on a resource’s children. propagated on a resource’s children.
Depth = "Depth" ":" DepthToken
Depth = “Depth” “:” DepthToken
DepthToken = "0" | "1" | "infinity" | token DepthToken = "0" | "1" | "infinity" | token
The optional token allows for extension. A server MUST The optional token allows for extension. A server MUST ignore a
ignore a Depth header with an unknown value. Depth header with an unknown value.
3.11.2 Destination 3.10.2 Destination
The Destination header specifies a destination resource for The Destination header specifies a destination resource for
methods such as COPY and MOVE, which take two URIs as methods such as COPY and MOVE, which take two URIs as parameters.
parameters. Destination= "Destination" ":" URI
Destination= “Destination” “:” URI
3.11.3 Enforce-Live-Properties
The Enforce-Live-Properties header specifies properties that 3.10.3 Enforce-Live-Properties
MUST be “live” after they are copied (moved) to the
destination resource of a copy (or move). If the value “*”
is given for the header, then it designates all live
properties on the source resource.
EnforceLiveProperties = "Enforce-Live-Properties” “:" The Enforce-Live-Properties header specifies properties that MUST
(“*” | 1#( Property-Name )) be "live" after they are copied (moved) to the destination
Property-Name = <“> URI <“> resource of a copy (or move). If the value "*" is given for the
header, then it designates all live properties on the source
resource.
EnforceLiveProperties = "Enforce-Live-Properties" ":" ("*" |
3.11.4 Duplicate-Properties 1#( Property-Name ))
Property-Name = <"> URI <">
The Duplicate-Properties header instructs the server whether 3.10.4 Duplicate-Properties
to duplicate the source resource’s properties onto the
destination resource during a COPY or MOVE. A value of
“false” requires that the server MUST NOT duplicate on the
destination resource any properties that are defined on the
source resource. By default, the value of this header is
“true,” and a client MAY omit this header from a request
when its value is “true.”
Duplicate-Properties = “Duplicate-Properties” “:” The Duplicate-Properties header instructs the server whether to
(“true” | “false”) duplicate the source resource’s properties onto the destination
resource during a COPY or MOVE. A value of "false" requires that
the server MUST NOT duplicate on the destination resource any
properties that are defined on the source resource. By default,
the value of this header is "true," and a client MAY omit this
header from a request when its value is "true."
Duplicate-Properties = "Duplicate-Properties" ":" ("true" |
"false")
3.11.5 Overwrite 3.10.5 Overwrite
The Overwrite header specifies whether the server should The Overwrite header specifies whether the server should
overwrite the state of a non-null destination resource overwrite the state of a non-null destination resource during a
during a COPY or MOVE. A value of “false” states that the COPY or MOVE. A value of "false" states that the server MUST NOT
server MUST NOT perform the COPY or MOVE operation if the perform the COPY or MOVE operation if the state of the
state of the destination resource is non-null. By default, destination resource is non-null. By default, the value of
the value of Overwrite is “false,” and a client MAY omit Overwrite is "false," and a client MAY omit this header from a
this header from a request when its value is “false.” While request when its value is "false." While the Overwrite header
the Overwrite header appears to duplicate the functionality appears to duplicate the functionality of the If-Match: * header
of the If-Match: * header of HTTP/1.1, If-Match applies only of HTTP/1.1, If-Match applies only to the Request-URI, and not to
to the Request-URI, and not to the Destination of a COPY or the Destination of a COPY or MOVE.
MOVE. Overwrite = "Overwrite" ":" ("true" | "false")
Overwrite = “Overwrite” “:” (“true” | “false”)
3.11.6 Destroy Header 3.10.6 Destroy Header
When deleting a resource the client often wishes to specify When deleting a resource the client often wishes to specify
exactly what sort of delete is being enacted. The Destroy exactly what sort of delete is being enacted. The Destroy header,
header, used with PEP, allows the client to specify the end used with PEP [Connolly et al., 1997], allows the client to
result they desire. The Destroy header is specified as specify the end result they desire. The Destroy header is
follows: specified as follows:
DestroyHeader = "Destroy" ":" #Choices DestroyHeader = "Destroy" ":" #Choices
Choices = "VersionDestroy" | "NoUndelete" | "Undelete" Choices = "VersionDestroy" | "NoUndelete" | "Undelete" |
| Token Token
The Undelete token requests that, if possible, the resource The Undelete token requests that, if possible, the resource
should be left in a state such that it can be undeleted. The should be left in a state such that it can be undeleted. The
server is not required to honor this request. server is not required to honor this request.
The NoUndelete token requests that the resource MUST NOT be The NoUndelete token requests that the resource MUST NOT be left
left in a state such that it can be undeleted. in a state such that it can be undeleted.
The VersionDestroy token includes the functionality of the The VersionDestroy token includes the functionality of the
NoUndelete token and extends it to include having the server NoUndelete token and extends it to include having the server
remove all versioning references to the resource that it has remove all versioning references to the resource that it has
control over. control over.
3.11.7 Collection-Member Header 3.10.7 Mandatory header
The Collection-Member header specifies the URI of an The Mandatory header is used to indicate a list of other header
external resource to be added/deleted to/from a collection. field names which must be understood by the receiver before the
contents of the message can be stored, cached, or presented to a
user. This header is used to alert the receiver that, unlike the
default behavior, it cannot safely ignore the semantics of the
listed field-names if they are not understood.
CollectionMember = “Collection-Member” “:” PropType SP Mandatory = "Mandatory" ":" 1#field-name
URI
PropType = “propagation” “=” (“prop” | “noprop”)
3.12 Links 3.10.8 Collection-Member Header
3.12.1 Source Link Property Type The Collection-Member header specifies the URI of an external
resource to be added/deleted to/from a collection.
CollectionMember = "Collection-Member" ":" PropType SP URI
PropType = "propagation" "=" ("prop" | "noprop")
Name: http://www.ietf.org/standards/dav/link/source 3.11 Links
3.11.1 Source Link Property Type
Name: http://www.ietf.org/standards/dav/link/source
Purpose: The destination of the source link identifies the Purpose: The destination of the source link identifies the
resource that contains the unprocessed source of the link’s resource that contains the unprocessed source of the link’s
source. source.
Schema: http://www.ietf.org/standards/dav/link/ Schema: http://www.ietf.org/standards/dav/link/
Parent: Any. Parent: Any.
Value:An XML document with zero or more link XML elements. Value:An XML document with zero or more link XML elements.
Discussion: The source of the link (src) is typically the URI of
Discussion: The source of the link (src) is typically the the output resource on which the link is defined, and there is
typically only one destination (dst) of the link, which is the
URI of the output resource on which the link is defined, and URI where the unprocessed source of the resource may be accessed.
there is typically only one destination (dst) of the link, When more than one link destination exists, DAV asserts no policy
which is the URI where the unprocessed source of the on partial ordering.
resource may be accessed. When more than one link
destination exists, DAV asserts no policy on partial
ordering.
4 State Tokens 4 State Tokens
4.1 Overview 4.1 Overview
4.1.1 Problem Description 4.1.1 Problem Description
There are times when a principal will want to predicate There are times when a principal will want to predicate
successful execution of a method on the current state of a successful execution of a method on the current state of a
resource. While HTTP/1.1 provides a mechanism for resource. While HTTP/1.1 provides a mechanism for conditional
conditional execution of methods using entity tags via the execution of methods using entity tags via the "If-Match" and
“If-Match” and “If-None-Match” headers, the mechanism is not "If-
sufficiently extensible to express conditional statements None-Match" headers, the mechanism is not sufficiently extensible
involving more generic state indicators, such as lock to express conditional statements involving more generic state
tokens. indicators, such as lock tokens.
The fundamental issue with entity tags is that they can only The fundamental issue with entity tags is that they can only be
be generated by a resource. However there are times when a generated by a resource. However there are times when a client
client will want to be able to share state tokens between will want to be able to share state tokens between resources,
resources, potentially on different servers, as well as be potentially on different servers, as well as be able to generate
able to generate certain types of lock tokens without first certain types of lock tokens without first having to communicate
having to communicate with a server. with a server.
For example, a principal may wish to require that resource B For example, a principal may wish to require that resource B have
have a certain state in order for a method to successfully a certain state in order for a method to successfully execute on
execute on resource A. If the client submits an e-tag from resource A. If the client submits an e-tag from resource B to
resource B to resource A, then A has no way of knowing that resource A, then A has no way of knowing that the e-tag is meant
the e-tag is meant to describe resource B. to describe resource B.
Another example occurs when a principal wishes to predicate Another example occurs when a principal wishes to predicate the
the successful completion of a method on the absence of any successful completion of a method on the absence of any locks on
locks on a resource. It is not sufficient to submit an “If-
None-Match: *” as this refers to the existence of an entity,
not of a lock.
This draft defines the term “state token” as an identifier a resource. It is not sufficient to submit an "If-None-Match: *"
for a state of a resource. The sections below define as this refers to the existence of an entity, not of a lock.
requirements for state tokens and provide a state token
syntax, along with two new headers which can accept the new This draft defines the term "state token" as an identifier for a
state token syntax. state of a resource. The sections below define requirements for
state tokens and provide a state token syntax, along with two
new headers which can accept the new state token syntax.
4.1.2 Solution Requirements 4.1.2 Solution Requirements
4.1.2.1 Syntax 4.1.2.1 Syntax
Self-Describing. A state token must be self describing such Self-Describing. A state token must be self describing such that
that upon inspecting a state token it is possible to upon inspecting a state token it is possible to determine what
determine what sort of state token it is, what resource(s) sort of state token it is, what resource(s) it applies to, and
it applies to, and what state it represents. what state it represents.
This self-describing nature allows servers to accept tokens This self-describing nature allows servers to accept tokens from
from other servers and potentially be able to coordinate other servers and potentially be able to coordinate state
state information cross resource and cross site through information cross resource and cross site through standardized
standardized protocols. For example, the execution of a protocols. For example, the execution of a request on resource A
request on resource A can be predicated on the state of can be predicated on the state of resource B, where A and B are
resource B, where A and B are potentially on different potentially on different servers.
servers.
Client Generable. The state token syntax must allow, when Client Generable. The state token syntax must allow, when
appropriate, for clients to generate a state token without having
first communicated with a server.
appropriate, for clients to generate a state token without One drawback of entity tags is that they are set by the server,
having first communicated with a server. and there is no interoperable algorithm for calculating an entity
tag. Consequently, a client cannot generate an entity tag from a
One drawback of entity tags is that they are set by the particular state of a resource. However, a state token which
server, and there is no interoperable algorithm for encodes an MD5 state hash could be calculated by a client based
calculating an entity tag. Consequently, a client cannot on a client-held state of a resource, and then submitted to a
generate an entity tag from a particular state of a server in a conditional method invocation.
resource. However, a state token which encodes an MD5 state
hash could be calculated by a client based on a client-held
state of a resource, and then submitted to a server in a
conditional method invocation.
Another potential use for client generable state tokens is Another potential use for client generable state tokens is for a
for a client to generate lock tokens with wild card fields, client to generate lock tokens with wild card fields, and hence
and hence be able to express conditionals such as: “only be able to express conditionals such as: "only execute this GET
execute this GET if there are no write locks on this if there are no write locks on this resource."
resource.”
4.1.2.2 Conditonals 4.1.2.2 Conditonals
Universal. A solution must be applicable to all requests. Universal. A solution must be applicable to all requests.
Positive and Negative. Conditional expressions must allow for the
Positive and Negative. Conditional expressions must allow expression of both positive and negative state requirements.
for the expression of both positive and negative state
requirements.
4.2 State Token Syntax 4.2 State Token Syntax
State tokens are URLs employing the following syntax: State tokens are URLs employing the following syntax:
State-Token = "StateToken:" Type ":" Resources ":" State-Info
State-Token = “StateToken:” Type “:” Resources “:” State- Type = "Type" "=" Caret-encoded-URL
Info Resources = "Res" "=" Caret-encoded-URL
Type = “Type” “=” Caret-encoded-URL Caret-encoded-URL = "^" Resource "^"
Resources = “Res” “=” Caret-encoded-URL Resource = <A URI where all "^" characters are escaped>
Caret-encoded-URL = “^” Resource “^”
Resource = <A URI where all “^” characters are escaped>
State-Info = *(uchar | reserved) ; uchar, reserved defined State-Info = *(uchar | reserved) ; uchar, reserved defined
section 3.2.1 of RFC 2068 section 3.2.1 of RFC 2068
This proposal has created a new URL scheme for state tokens This proposal has created a new URL scheme for state tokens
because a state token names a network resource using its because a state token names a network resource using its normal
normal name, which is typically state-invariant, along with name, which is typically state-invariant, along with additional
additional information that specifies a particular state of information that specifies a particular state of the resource.
the resource. Encoding the state information into the
native URL scheme of the network resource was not felt to be
safe, since freedom from name space collisions could not be
guaranteed. If this proposal is accepted, the StateToken URL
scheme will need to be defined and registered with IANA.
State Token URLs begin with the URL scheme name “StateToken” Encoding the state information into the native URL scheme of the
rather than the name of the particular state token type they network resource was not felt to be safe, since freedom from name
represent in order to make the URL self describing. Thus it space collisions could not be guaranteed. If this proposal is
is possible to examine the URL and know, at a minimum, that accepted, the StateToken URL scheme will need to be defined and
it is a state token. registered with IANA.
Labeled name/value pairs are used within the token to allow State Token URLs begin with the URL scheme name "StateToken"
new fields to be added. Processors of state tokens MUST be rather than the name of the particular state token type they
prepared to accept the fields in whatever order they are represent in order to make the URL self describing. Thus it is
present and MUST ignore any fields they do not understand. possible to examine the URL and know, at a minimum, that it is a
state token.
The “Type” field specifies the type of the state information Labeled name/value pairs are used within the token to allow new
fields to be added. Processors of state tokens MUST be prepared
to accept the fields in whatever order they are present and MUST
ignore any fields they do not understand.
The "Type" field specifies the type of the state information
encoded in the state token. A URL is used in order to avoid encoded in the state token. A URL is used in order to avoid
namespace collisions. namespace collisions.
The “Res” field identifies the resource for which the state The "Res" field identifies the resource for which the state token
token specifies a particular state. Since commas and spaces specifies a particular state. Since commas and spaces are
are acceptable URL characters, a caret is used to delimit a acceptable URL characters, a caret is used to delimit a URL.
URL. Since a caret is an acceptable URL character, any Since a caret is an acceptable URL character, any instances of it
must be escaped using the % escape convention.
instances of it must be escaped using the % escape
convention.
The State-Info production is expanded upon in descriptions The State-Info production is expanded upon in descriptions of
of specific state token types, and is intended to contain specific state token types, and is intended to contain the state
the state description information for a particular state description information for a particular state token.
token.
4.3 State Token Conditional Headers 4.3 State Token Conditional Headers
4.3.1 If-State-Match 4.3.1 If-State-Match
If-State-Match = "If-State-Match" ":" (“AND” | “OR”) 1#(“<” If-State-Match = "If-State-Match" ":" ("AND" | "OR") 1#("<"
State-Token “>”) State-
Token ">")
The If-State-Match header is intended to have similar The If-State-Match header is intended to have similar
functionality to the If-Match header defined in section functionality to the If-Match header defined in section 14.25 of
14.25 of RFC 2068. RFC 2068.
If the AND keyword is used and all of the state tokens If the AND keyword is used and all of the state tokens identify
identify the state of the resource, then the server MAY the state of the resource, then the server MAY perform the
perform the requested method. If the OR keyword is used and requested method. If the OR keyword is used and any of the state
any of the state tokens identifies the current state of the tokens identifies the current state of the resource, then server
resource, then server MAY perform the requested method. If MAY perform the requested method. If neither of the keyword
neither of the keyword requirements is met, the server MUST requirements is met, the server MUST NOT perform the requested
NOT perform the requested method, and MUST return a 412 method, and MUST return a 412 (Precondition Failed) response.
(Precondition Failed) response.
4.3.2 If-None-State-Match 4.3.2 If-None-State-Match
If-None-State-Match = "If-None-State-Match" “:” 1#(“<” If-None-State-Match = "If-None-State-Match" ":" 1#("<" State-
State-Token “>”) Token ">")
The If-None-State-Match header is intended to have similar The If-None-State-Match header is intended to have similar
functionality to the If-None-Match header defined in section functionality to the If-None-Match header defined in section
14.26 of RFC 2068. 14.26 of RFC 2068.
If any of the state tokens identifies the current state of If any of the state tokens identifies the current state of the
the resource, the server MUST NOT perform the requested resource, the server MUST NOT perform the requested method.
method. Instead, if the request method was GET, HEAD, Instead, if the request method was GET, HEAD, INDEX, or GETMETA,
INDEX, or GETMETA, the server SHOULD respond with a 304 (Not
Modified) response, including the cache-related entity-
header fields (particularly ETag) of the current state of
the resource. For all other request methods, the server
MUST respond with a status of 412 (Precondition Failed).
If none of the state tokens identifies the current state of the server SHOULD respond with a 304 (Not Modified) response,
the resource, the server MAY perform the requested method. including the cache-related entity-header fields (particularly
ETag) of the current state of the resource. For all other
request methods, the server MUST respond with a status of 412
(Precondition Failed).
Note that the “AND” and “OR” keywords specified with the If- If none of the state tokens identifies the current state of the
State-Match header are intentionally not defined for If- resource, the server MAY perform the requested method.
None-State-Match, because this functionality is not
required. Note that the "AND" and "OR" keywords specified with the If-
State-
Match header are intentionally not defined for If-None-State-
Match, because this functionality is not required.
4.4 State Token Header 4.4 State Token Header
State-Token-Header = “State-Token” “:” 1#(“<” State-Token
“>”) State-Token-Header = "State-Token" ":" 1#("<" State-Token ">")
The State Token header is intended to have similar The State Token header is intended to have similar functionality
functionality to the etag header defined in section 14.20 of to the etag header defined in section 14.20 of RFC 2068. The
RFC 2068. The purpose of the tag is to return state tokens purpose of the tag is to return state tokens defined on a
defined on a resource in a response. The contents of the resource in a response. The contents of the state-token are not
state-token are not guaranteed to be exhaustive and are guaranteed to be exhaustive and are generally used to return a
generally used to return a new state token that has been new state token that has been defined as the result of a method.
defined as the result of a method. For example, if a LOCK For example, if a LOCK method were successfully executed on a
method were successfully executed on a resource the response resource the response would include a state token header with the
would include a state token header with the lock state token lock state token included.
included.
4.5 E-Tags 4.5 E-Tags
E-tags have already been deployed using the If-Match and If- E-tags have already been deployed using the If-Match and If-None-
None-Match headers. Introducing two mechanisms to express Match headers. Introducing two mechanisms to express e-tags
e-tags would only confuse matters, therefore e-tags should would only confuse matters, therefore e-tags should continue to
continue to be expressed using quoted strings and the If- be expressed using quoted strings and the If-Match and If-None-
Match and If-None-Match headers. Match headers.
5 Locking 5 Locking
5.1 Problem Description - Overview 5.1 Problem Description - Overview
Locking is used to arbitrate access to a resource amongst Locking is used to arbitrate access to a resource amongst
principals that have equal access rights to that resource. principals that have equal access rights to that resource.
This draft allows locks to vary over two parameters, the This draft allows locks to vary over two parameters, the number
number of principals involved and the type of access to be of principals involved and the type of access to be granted. This
granted. This draft will only provide for the definition of draft will only provide for the definition of locking for one
locking for one access type, write. However, the syntax is access type, write. However, the syntax is extensible enough to
extensible enough to allow for the specification of other allow for the specification of other access types. It is a goal
access types. It is a goal of this proposal that it use the of this proposal that it use the same access verbs as will be
same access verbs as will be defined in the access control defined in the access control draft.
draft.
5.1.1 Exclusive Vs. Shared Locks 5.1.1 Exclusive Vs. Shared Locks
The most basic form of LOCK is an exclusive lock. This is a The most basic form of LOCK is an exclusive lock. This is a lock
lock where the access right in question is only granted to a where the access right in question is only granted to a single
single principal. The need for this arbitration results from principal. The need for this arbitration results from a desire to
a desire to avoid having to constantly merge results. In avoid having to constantly merge results. In fact, many users so
fact, many users so dislike having to merge that they would dislike having to merge that they would rather serialize their
rather serialize their access to a resource rather than have access to a resource rather than have to constantly perform
to constantly perform merges. merges.
However, there are times when the goal of a lock is not to However, there are times when the goal of a lock is not to
exclude others from exercising an access right but rather to exclude others from exercising an access right but rather to
provide a mechanism for principals to indicate that they
intend to exercise their access right. Shared locks are provide a mechanism for principals to indicate that they intend
provided for this case. A shared lock allows multiple to exercise their access right. Shared locks are provided for
principals to receive a lock, hence any principal with this case. A shared lock allows multiple principals to receive a
appropriate access can get the lock. lock, hence any principal with appropriate access can get the
lock.
With shared locks there are two trust sets that affect a With shared locks there are two trust sets that affect a
resource. The first trust set is created by access resource. The first trust set is created by access permissions.
permissions. Principals who are trusted, for example, may Principals who are trusted, for example, may have permission to
have permission to write the resource, those who are not, write the resource, those who are not, don't. Among those who
don't. Among those who have access permission to write the have access permission to write the resource, the set of
resource, the set of principals who have taken out a shared principals who have taken out a shared lock also must trust each
lock also must trust each other, creating a (probably) other, creating a (probably) smaller trust set within the access
smaller trust set within the access permission write set. permission write set.
Starting with every possible principal on the Internet, in Starting with every possible principal on the Internet, in most
most situations the vast majority of these principals will situations the vast majority of these principals will not have
not have write access to a given resource. Of the small write access to a given resource. Of the small number who do
number who do have write access, some principals may decide have write access, some principals may decide to guarantee their
to guarantee their edits are free from overwrite conflicts edits are free from overwrite conflicts by using exclusive write
by using exclusive write locks in conjunction with a locks in conjunction with a precondition header (If-State-Match)
precondition header (If-State-Match) that checks for that checks for existence of the lock prior to writing the
existence of the lock prior to writing the resource. Others resource. Others may decide they trust their collaborators (the
may decide they trust their collaborators (the potential set potential set of collaborators being the set of principals who
of collaborators being the set of principals who have write have write permission) and use a shared lock, which informs their
permission) and use a shared lock, which informs their
collaborators that a principal is potentially working on the collaborators that a principal is potentially working on the
resource. resource.
The WebDAV extensions to HTTP do not need to provide all of The WebDAV extensions to HTTP do not need to provide all of the
the communications paths necessary for principals to communications paths necessary for principals to coordinate their
activities. When using shared locks, principals may use any out
coordinate their activities. When using shared locks, of band communication channel to coordinate their work (e.g.,
principals may use any out of band communication channel to face-to-face interaction, written notes, post-it notes on the
coordinate their work (e.g., face-to-face interaction, screen, telephone conversation, email). The intent of a shared
written notes, post-it notes on the screen, telephone lock is to let collaborators know who else is potentially working
conversation, email). The intent of a shared lock is to let on a resource.
collaborators know who else is potentially working on a
resource..
Why not use exclusive write locks all the time? Experience Why not use exclusive write locks all the time? Experience from
from initial Web distributed authoring systems has indicated initial Web distributed authoring systems has indicated that
that exclusive write locks are often too rigid. An exclusive write locks are often too rigid. An exclusive write
exclusive write lock is used to enforce a particular editing lock is used to enforce a particular editing process: take out
process: take out exclusive write lock, read the resource, exclusive write lock, read the resource, perform edits, write the
perform edits, write the resource, release the lock. What resource, release the lock. What happens if the lock isn't
happens if the lock isn't released? While the time-out released? While the time-out mechanism provides one solution, if
mechanism provides one solution, if you need to force the you need to force the release of a lock immediately, it doesn't
release of a lock immediately, it doesn't help much. help much. Granted, an administrator can release the lock for
Granted, an administrator can release the lock for you, but you, but this could become a significant burden for large sites.
this could become a significant burden for large sites. Further, what if the administrator can't be reached immediately?
Further, what if the administrator can't be reached
immediately?
Despite their potential problems, exclusive write locks are Despite their potential problems, exclusive write locks are
extremely useful, since often a guarantee of freedom from extremely useful, since often a guarantee of freedom from
overwrite conflicts is exactly what is needed. The overwrite conflicts is exactly what is needed. The solution:
solution: provide exclusive write locks, but also provide a provide exclusive write locks, but also provide a less strict
less strict mechanism in the form of shared locks which can mechanism in the form of shared locks which can be used by a set
be used by a set of people who trust each other and who have of people who trust each other and who have access to a
access to a communications channel external to HTTP which communications channel external to HTTP which can be used to
can be used to negotiate writing to the resource. negotiate writing to the resource.
5.1.2 Required Support 5.1.2 Required Support
A DAV compliant server is not required to support locking in A DAV compliant server is not required to support locking in any
any form. If the server does support locking it may choose form. If the server does support locking it may choose to support
to support any combination of exclusive and shared locks for any combination of exclusive and shared locks for any access
any access types. types.
The reason for this flexibility is that server implementers The reason for this flexibility is that server implementers have
have said that they are willing to accept minimum said that they are willing to accept minimum requirements on all
requirements on all services but locking. Locking policy services but locking. Locking policy strikes to the very heart of
strikes to the very heart of their resource management and their resource management and versioning systems and they require
versioning systems and they require control over what sort control over what sort of locking will be made available. For
of locking will be made available. For example, some systems example, some systems only support shared write locks while
only support shared write locks while others only provide others only provide support for exclusive write locks. As each
support for exclusive write locks. As each system is system is sufficiently different to merit exclusion of certain
sufficiently different to merit exclusion of certain locking locking features, the authors are proposing that locking be
features, the authors are proposing that locking be allowed allowed as the sole axis of negotiation within DAV.
as the sole axis of negotiation within DAV.
5.2 LOCK Method 5.2 LOCK Method
5.2.1 Operation 5.2.1 Operation
A lock method invocation creates the lock specified by the A lock method invocation creates the lock specified by the Lock-
Lock-Info header on the request-URI. Lock method requests Info header on the request-URI. Lock method requests SHOULD NOT
SHOULD NOT have a request body. A user-agent SHOULD submit have a request body. A user-agent SHOULD submit an Owner header
an Owner header field with a lock request. field with a lock request.
A successful response to a lock invocation MUST include a A successful response to a lock invocation MUST include a Lock-
Lock-Token header. If the server supports a time based lock Token header. If the server supports a time based lock removal
removal mechanism on the resource, a successful lock mechanism on the resource, a successful lock invocation SHOULD
invocation SHOULD return a Time-Out header. return a Time-Out header.
5.2.2 The Effect of Locks on Properties and Containers 5.2.2 Effect of Locks on Properties and Containers
By default a lock affects the entire state of the resource, By default a lock affects the entire state of the resource,
including its associated properties. As such it is illegal including its associated properties. As such it is illegal to
to specify a lock on a property. For containers, a lock also specify a lock on a property. For containers, a lock also affects
affects the ability to add or remove members. The nature of the ability to add or remove members. The nature of the effect
the effect depends upon the type of access control involved. depends upon the type of access control involved. The Depth
The Depth header expresses the general semantics of a LOCK header expresses the general semantics of a LOCK method request
method request when invoked on a collection (note that when invoked on a collection (note that specific lock types may
specific lock types may restrict the effect of a lock, for restrict the effect of a lock, for example limiting the allowable
example limiting the allowable values of the Depth header): values of the Depth header):
· A Depth header (defined in the namespace draft) may be used
A Depth header (defined in the namespace draft) may be used
on a LOCK method when the LOCK method is applied to a on a LOCK method when the LOCK method is applied to a
collection resource. The legal values for Depth on a LOCK collection
are 0, 1, and Infinity. A Depth of 0 instructs the resource. The legal values for Depth on a LOCK are 0, 1, and
resource to just lock the container. As previously Infinity. A Depth of 0 instructs the resource to just lock the
mentioned, depending on the type of lock, the lock affects container. As previously mentioned, depending on the type of
the ability to add or remove members of the container. lock, the lock affects the ability to add or remove members of
the container.
@.A Depth of 1 means that the container is locked and a LOCK · A Depth of 1 means that the container is locked and a LOCK
is executed on the container’s propagate members with a is executed on the container’s propagate members with a Depth
Depth of 0 and If-Range, If-Modified-Since, If-Unmodified- of
Since, If-Match and If-None-Match headers are dropped. 0 and If-Range, If-Modified-Since, If-Unmodified-Since, If-
However, the effects of the LOCK MUST be atomic in that Match
either the container and all of its members are locked or and If-None-Match headers are dropped. However, the effects of
no lock is granted. The result of a Depth 1 lock is a the LOCK MUST be atomic in that either the container and all of
single lock token which represents the lock on the its members are locked or no lock is granted. The result of a
container and all of its members. This lock token may be Depth 1 lock is a single lock token which represents the lock
used in an If-State-Match or If-Not-State-Match header on
against any of the resources covered by the lock. Since the container and all of its members. This lock token may be
the lock token represents a lock on all the resources, an used
UNLOCK using that token will remove the lock from all in an If-State-Match or If-Not-State-Match header against any
included resources, not just the resource the UNLOCK was of
executed on. the resources covered by the lock. Since the lock token
represents a lock on all the resources, an UNLOCK using that
token will remove the lock from all included resources, not
@.A Depth of infinity means that the LOCK is recursively just
executed, with a Depth of infinity, on the collection and the resource the UNLOCK was executed on.
all of its propagate members and all of their propagate · A Depth of infinity means that the LOCK is recursively
members. As with a Depth of 1, the LOCK must be granted in executed, with a Depth of infinity, on the collection and all of
total or not at all. Otherwise the lock operates in the its propagate members and all of their propagate members. As with
same manner as a Depth of 1 lock. a Depth of 1, the LOCK must be granted in total or not at all.
Otherwise the lock operates in the same manner as a Depth of 1
lock.
The default behavior when locking a container is to act as The default behavior when locking a container is to act as if a
if a “Depth: 0” header had been placed on the method. "Depth: 0" header had been placed on the method.
5.2.3 Locking Replicated Resources 5.2.3 Locking Replicated Resources
Some servers automatically replicate resources across Some servers automatically replicate resources across multiple
multiple URLs. In such a circumstance the server MAY only URLs. In such a circumstance the server MAY only accept a lock on
accept a lock on one of the URLs if the server can guarantee one of the URLs if the server can guarantee that the lock will be
that the lock will be honored across all the URLs. honored across all the URLs.
5.2.4 Interaction with other Methods 5.2.4 Interaction with other Methods
Only two methods, MOVE and DELETE, have side effects which Only two methods, MOVE and DELETE, have side effects which
involve locks. When a resource is moved, its lock SHOULD be involve locks. When a resource is moved, its lock SHOULD be moved
moved with it. However this may not always be possible and with it. However this may not always be possible and there is
there is currently no proposal to create a header which currently no proposal to create a header which would specify that
would specify that the lock request should fail if the the lock request should fail if the resource’s locks can not be
resource’s locks can not be maintained. A COPY MUST NOT copy maintained. A COPY MUST NOT copy any locks on the source resource
any locks on the source resource over to the destination over to the destination resource. Deleting a resource MUST remove
resource. Deleting a resource MUST remove all locks on the all locks on the resource.
resource.
5.2.5 Lock Compatibility Table 5.2.5 Lock Compatibility Table
The table below describes the behavior that occurs when a The table below describes the behavior that occurs when a lock
lock request is made on a resource. request is made on a resource.
Current lock state/ Shared Lock Exclusive Lock Current lock state/ Shared Lock Exclusive Lock
Lock request Lock request
None True True None True True
Shared Lock True False Shared Lock True False
Exclusive Lock False False* Exclusive Lock False False*
Legend: True = lock MAY be granted. False = lock MUST NOT
be granted. *=if the principal requesting the lock is the
owner of the lock, the lock MAY be regranted.
The current lock state of a resource is given in the Legend: True = lock MAY be granted. False = lock MUST NOT be
leftmost column, and lock requests are listed in the first granted. *=if the principal requesting the lock is the owner of
row. The intersection of a row and column gives the result the lock, the lock MAY be regranted.
of a lock request. For example, if a shared lock is held on
a resource, and an exclusive lock is requested, the table
entry is “false”, indicating the lock must not be granted.
If an exclusive lock is re-requested by the principal who The current lock state of a resource is given in the leftmost
owns the lock, the lock MAY be regranted. If the lock is column, and lock requests are listed in the first row. The
regranted, the same lock token that was previously issued intersection of a row and column gives the result of a lock
MUST be returned. request. For example, if a shared lock is held on a resource,
and an exclusive lock is requested, the table entry is "false",
indicating the lock must not be granted.
If an exclusive lock is re-requested by the principal who owns
the lock, the lock MAY be regranted. If the lock is regranted,
the same lock token that was previously issued MUST be returned.
5.2.6 Status Codes 5.2.6 Status Codes
412 “Precondition Failed” – The included state-token was not 412 "Precondition Failed" - The included state-token was not
enforceable on this resource. enforceable on this resource.
416 “Locked” – The resource is locked so the method has been 416 "Locked" - The resource is locked so the method has been
rejected. rejected.
5.2.7 Example 5.2.7 Example
LOCK /workspace/webdav/proposal.doc HTTP/1.1 LOCK /workspace/webdav/proposal.doc HTTP/1.1
Host: webdav.sb.aol.com Host: webdav.sb.aol.com
Lock-Info: LockType=Write LockScope=Exclusive Lock-Info: LockType=Write LockScope=Exclusive
Owner: <http://www.ics.uci.edu/~ejw/contact.html> Owner: <http://www.ics.uci.edu/~ejw/contact.html>
HTTP/1.1 200 OK HTTP/1.1 200 OK
State-Token: StateToken:Type=^DAV:/LOCK/DAVLOCK^:Res=^http:/ State-Token: StateToken:Type=^DAV:/LOCK/DAVLOCK^:Res=^http://www.
/www.ics.uci.edu/workspace/webdav/proposal.doc^:LockType=Wri ics.uci.edu/workspace/webdav/proposal.doc^:LockType=Write:LockSco
te:LockScope=Exclusive:ServerID=12382349AdfFFF pe=Exclusive:ServerID=12382349AdfFFF
Time-Out: ClockType=Activity TimeType=second;604800 Time-Out: ClockType=Activity TimeType=second;604800
This example shows the successful creation of an exclusive write
This example shows the successful creation of an exclusive lock on resource
write lock on resource
http://webdav.sb.aol.com/workspace/webdav/proposal.doc. The http://webdav.sb.aol.com/workspace/webdav/proposal.doc. The
resource http://www.ics.uci.edu/~ejw/contact.html contains resource http://www.ics.uci.edu/~ejw/contact.html contains
contact information for the owner of the lock. The server contact information for the owner of the lock. The server has an
has an activity-based timeout policy in place on this activity-based timeout policy in place on this resource, which
resource, which causes the lock to automatically be removed causes the lock to automatically be removed after 1 week (604800
after 1 week (604800 seconds). The response has a Lock-Token seconds). The response has a Lock-Token header that gives the
header that gives the state token URL for the lock token state token URL for the lock token generated by this lock
generated by this lock request. request.
5.2.8 Lock-Info Request Header 5.2.8 Lock-Info Request Header
The Lock-Info header specifies the scope and type of a lock The Lock-Info header specifies the scope and type of a lock for a
for a LOCK method request. The syntax specification below is LOCK method request. The syntax specification below is
extensible, allowing new type and scope identifiers to be extensible, allowing new type and scope identifiers to be added.
added. LockInfo = "Lock-Info" ":" DAVLockType SP DAVLockScope CRLF
DAVLockType = "LockType" "=" DAVLockTypeValue
LockInfo = “Lock-Info” “:” DAVLockType SP DAVLockScope CRLF DAVLockTypeValue = ("Write" | *(uchar | reserved))
DAVLockType = “LockType” “=” DAVLockTypeValue DAVLockScope = "LockScope" "=" DAVLockScopeValue
DAVLockTypeValue = (“Write” | *(uchar | reserved)) DAVLockScopeValue = ("Exclusive" |"Shared" | *(uchar | reserved))
DAVLockScope = “LockScope” “=” DAVLockScopeValue
DAVLockScopeValue = (“Exclusive” |”Shared” | *(uchar |
reserved))
5.2.9 Owner Request Header 5.2.9 Owner Request Header
5.2.9.1 Problem Description 5.2.9.1 Problem Description
When discovering the list of owners of locks on a resource, When discovering the list of owners of locks on a resource, a
a principal may want to be able to contact the owner principal may want to be able to contact the owner directly. For
directly. For this to be possible the lock discovery this to be possible the lock discovery mechanism must provide
mechanism must provide enough information for the lock owner enough information for the lock owner to be contacted.
to be contacted.
5.2.9.2 Solution Requirements 5.2.9.2 Solution Requirements
Not all systems have authentication procedures that provide Not all systems have authentication procedures that provide
sufficient information to identify a particular user in a sufficient information to identify a particular user in a way
way that is meaningful to a human. In addition, many systems that is meaningful to a human. In addition, many systems that do
that do have sufficient information, such as a name and e- have sufficient information, such as a name and e-mail address,
mail address, do not have the ability to associate this do not have the ability to associate this information with the
information with the lock discovery mechanism. Therefore a lock discovery mechanism. Therefore a means is needed to allow
means is needed to allow principals to provide principals to provide authentication in a manner which will be
authentication in a manner which will be meaningful to a meaningful to a human.
human.
The From header (defined in RFC 2068), which contains only The From header (defined in RFC 2068), which contains only an
an email mailbox, is not sufficient for the purposes of email mailbox, is not sufficient for the purposes of quick
quick identification. When desperately looking for someone
to remove a lock, e-mail is often not sufficient. A
telephone number (cell number, pager number, etc.) would be
better. Furthermore, the email address in the From field may
or may not support including the owners name and that name
is often set to an alias anyway. Therefore a header more
flexible than From is required.
5.2.9.3 Syntax identification. When desperately looking for someone to remove a
lock, e-mail is often not sufficient. A telephone number (cell
number, pager number, etc.) would be better. Furthermore, the
email address in the From field may or may not support including
the owners name and that name is often set to an alias anyway.
Therefore a header more flexible than From is required.
Owner = "Owner" ":" ((“<” URI “>”) | quoted-string) 5.2.9.3 Syntax
The URI SHOULD provide a means for either directly Owner = "Owner" ":" (("<" URI ">") | quoted-string)
contacting the principal (such as a telephone number or e- The URI SHOULD provide a means for either directly contacting the
mail URI), or for discovering the principal (such as the principal (such as a telephone number or e-mail URI), or for
URL of a homepage). The quoted string SHOULD provide a discovering the principal (such as the URL of a homepage). The
means for directly contacting the principal, such as a name quoted string SHOULD provide a means for directly contacting the
and telephone number. principal, such as a name and telephone number.
5.2.10 Time-Out Header 5.2.10 Time-Out Header
5.2.10.1 Problem Description 5.2.10.1 Problem Description
In a perfect world principals take out locks, use the In a perfect world principals take out locks, use the resource as
resource as needed, and then remove the lock when it is no needed, and then remove the lock when it is no longer needed.
longer needed. However, this scenario is frequently not However, this scenario is frequently not completed, leaving
completed, leaving active but unused locks. Reasons for this active but unused locks. Reasons for this include client programs
include client programs crashing and loosing information crashing and loosing information about locks, users leaving their
about locks, users leaving their systems for the day and systems for the day and forgetting to remove their locks, etc. As
forgetting to remove their locks, etc. As a result of this a result of this behavior, servers need to establish a policy by
behavior, servers need to establish a policy by which they which they can remove a lock without input from the lock owner.
can remove a lock without input from the lock owner. Once Once such a policy is instituted, the server also needs a
such a policy is instituted, the server also needs a
mechanism to inform the principal of the policy. mechanism to inform the principal of the policy.
5.2.10.2 Solution Requirements 5.2.10.2 Solution Requirements
There are two basic lock removal policies, administrator and There are two basic lock removal policies, administrator and time
time based remove. In the first case a principal other than based remove. In the first case a principal other than the lock
the lock owner has sufficient access rights to order the owner has sufficient access rights to order the lock removed,
lock removed, even though they did not take it out. User- even though they did not take it out. User-agents MUST assume
agents MUST assume that such a mechanism is available and that such a mechanism is available and thus locks may arbitrarily
thus locks may arbitrarily disappear at any time. If their disappear at any time. If their actions require confirmation of
actions require confirmation of the existence of a lock then the existence of a lock then the If-State headers are available.
the If-State headers are available.
The second solution, is the time based removal policy. The second solution, is the time based removal policy. Activity
Activity based systems set a timer as soon as the lock is based systems set a timer as soon as the lock is taken out. Every
taken out. Every time a method is executed on the resource, time a method is executed on the resource, the timer is reset. If
the timer is reset. If the timer runs out, the lock is the timer runs out, the lock is removed.
removed.
Finally, some systems only allow locks to exist for the Finally, some systems only allow locks to exist for the duration
duration of a session, where a session is defined as the of a session, where a session is defined as the time when the
time when the HTTP connection that was used to take out the HTTP connection that was used to take out the lock remains
lock remains connected. This mechanism is used to allow connected. This mechanism is used to allow programs which are
programs which are likely to be improperly exited, such as likely to be improperly exited, such as JAVA programs running in
JAVA programs running in a browser, to take out locks a browser, to take out locks without leaving a lot of ownerless
without leaving a lot of ownerless locks around when they locks around when they are improperly exited.
are improperly exited.
5.2.10.3 Syntax 5.2.10.3 Syntax
TimeOut = "Time-Out" ":" ((TimeOutType SP Session) | TimeOut = "Time-Out" ":" ((TimeOutType SP Session) | TimeOutVal |
TimeOutVal |
Session) CRLF Session) CRLF
TimeOutType = ClockType SP TimeType TimeOutType = ClockType SP TimeType
ClockType = “ClockType” “=” ClockTypeValue ClockType = "ClockType" "=" ClockTypeValue
ClockTypeValue = “Activity”
TimeType = “TimeType” “=” TimeTypeValue ClockTypeValue = "Activity"
TimeTypeValue = “Second” “;” DAVTimeOutVal TimeType = "TimeType" "=" TimeTypeValue
TimeTypeValue = "Second" ";" DAVTimeOutVal
DAVTimeOutVal = 1*digit DAVTimeOutVal = 1*digit
Session = “Session” “=” (“Yes” | “No”) Session = "Session" "=" ("Yes" | "No")
The “Second” TimeType specifies the number of seconds that The "Second" TimeType specifies the number of seconds that may
may elapse before the lock is automatically removed. A elapse before the lock is automatically removed. A server MUST
server MUST not generate a time out value for “second” not generate a time out value for "second" greater than 2^32-1.
greater than 2^32-1.
If no time based system is in use then a Time-Out header If no time based system is in use then a Time-Out header MUST NOT
MUST NOT be returned. The Time-Out header MUST only be be returned. The Time-Out header MUST only be returned in a
returned in a response to a LOCK request.When session is set response to a LOCK request.When session is set to yes then
to yes then whatever clocktype and timetype is being used, whatever clocktype and timetype is being used, their effects are
their effects are scoped within that particular session. So scoped within that particular session. So an absolute lock with a
an absolute lock with a ten day expiration period will only ten day expiration period will only remain active so long as the
remain active so long as the session remains active. A session remains active. A DAVTimeOutVal value must be greater
DAVTimeOutVal value must be greater than zero. than zero.
Clients MAY include TimeOut headers in their LOCK requests. Clients MAY include TimeOut headers in their LOCK requests.
However the server is not required to honor or even consider However the server is not required to honor or even consider the
the request. The primary purpose in allowing clients to request. The primary purpose in allowing clients to submit a
submit a TimeOut header is to inform the server if the TimeOut header is to inform the server if the client is
client is requesting a session based lock. If a timeout is requesting a session based lock. If a timeout is associated with
associated with the lock, the server MUST return a TimeOut the lock, the server MUST return a TimeOut header with a valid
header with a valid value. value.
5.2.11 State-Token Header 5.2.11 State-Token Header
5.2.11.1 Problem Definition 5.2.11.1 Problem Definition
Program A, used by User A, takes out a write lock on a Program A, used by User A, takes out a write lock on a resource.
resource. Program B, also run by User A, then proceeds to Program B, also run by User A, then proceeds to perform a PUT to
perform a PUT to the locked resource. The PUT will succeed the locked resource. The PUT will succeed because locks are
because locks are associated with a principal, not a associated with a principal, not a program, and thus program B,
program, and thus program B, because it is acting with because it is acting with principal A’s credential, will be
principal A’s credential, will be allowed to perform the allowed to perform the PUT. In reality program B had no knowledge
PUT. In reality program B had no knowledge of the lock and of the lock and had it had such knowledge, would not have
had it had such knowledge, would not have overwritten the overwritten the resource. Hence, a mechanism is needed to prevent
resource. Hence, a mechanism is needed to prevent different different programs from accidentally ignoring locks taken out by
programs from accidentally ignoring locks taken out by other other programs with the same authorization.
programs with the same authorization.
5.2.11.2 Solution Requirement 5.2.11.2 Solution Requirement
The solution must not require principals to perform The solution must not require principals to perform discovery in
discovery in order to prevent accidental overwrites as this order to prevent accidental overwrites as this could cause race
could cause race conditions. conditions.
The solution must not require that clients guess what sorts The solution must not require that clients guess what sorts of
of locks might be used and use if-state-match headers with locks might be used and use if-state-match headers with wildcards
wildcards to prevent collisions. The problem with trying to to prevent collisions. The problem with trying to "guess" which
“guess” which locks are being used is that new lock types locks are being used is that new lock types might be introduced,
might be introduced, and the program would not know to and the program would not know to "guess them". So, for example,
“guess them”. So, for example, a client might put in an if- a client might put in an if-state-match header with a wildcard
state-match header with a wildcard specifying that if any specifying that if any write lock is outstanding then the
write lock is outstanding then the operation should fail. operation should fail. However a new read/write lock could be
However a new read/write lock could be introduced which the introduced which the client would not know to put in the header.
client would not know to put in the header.
5.2.11.3 State-Token Header 5.2.11.3 State-Token Header
The State-Token header is returned in a successful response The State-Token header is returned in a successful response to
to the LOCK method or is used as a request header with the
UNLOCK method. the LOCK method or is used as a request header with the UNLOCK
method.
The State-Token header containing a lock token owned by the The State-Token header containing a lock token owned by the
request principal is used by the principal on arbitrary request principal is used by the principal on arbitrary method to
method to indicate that the principal is aware of the indicate that the principal is aware of the specified lock. If
specified lock. If the State-Token header with the the State-Token header with the appropriate lock token is not
appropriate lock token is not included the request MUST be included the request MUST be rejected, even though the requesting
rejected, even though the requesting principal has principal has authorization to make modifications specified by
authorization to make modifications specified by the lock the lock type. This injunction does not apply to methods that are
type. This injunction does not apply to methods that are not not affected by the principal’s lock.
affected by the principal’s lock.
For example, Program A, used by user A, takes out a write For example, Program A, used by user A, takes out a write lock on
lock on a resource. Program A then makes a number of PUT a resource. Program A then makes a number of PUT requests on the
requests on the locked resource, all the requests contain a locked resource, all the requests contain a State-Token header
State-Token header which includes the write lock state which includes the write lock state token. Program B, also run by
token. Program B, also run by User A, then proceeds to User A, then proceeds to perform a PUT to the locked resource.
perform a PUT to the locked resource. However program B was However program B was not aware of the existence of the lock and
not aware of the existence of the lock and so does not so does not include the appropriate state-token header. The
include the appropriate state-token header. The method is method is rejected even though principal A is authorized to
rejected even though principal A is authorized to perform perform the PUT. Program B can, if it so chooses, now perform
the PUT. Program B can, if it so chooses, now perform lock lock discovery and obtain the lock token. Note that program A and
discovery and obtain the lock token. Note that program A and B can perform GETs without using the state-token header because
B can perform GETs without using the state-token header the ability to perform a GET is not affected by a write lock.
because the ability to perform a GET is not affected by a
write lock.
Note that having a lock state token provides no special Note that having a lock state token provides no special access
access rights. Anyone can find out anyone else’s lock state rights. Anyone can find out anyone else’s lock state token by
token by performing lock discovery. Locks are to be enforced performing lock discovery. Locks are to be enforced based upon
based upon whatever authentication mechanism is used by the whatever authentication mechanism is used by the server, not
server, not based on the secrecy of the token values. based on the secrecy of the token values.
5.3 Write Lock 5.3 Write Lock
A write lock prevents a principal without the lock from A write lock prevents a principal without the lock from
successfully executing a PUT, POST, DELETE, MKCOL, successfully executing a PUT, POST, DELETE, MKCOL, PROPPATCH,
PROPPATCH, PATCH, ADDREF or DELREF on the locked resource. PATCH, ADDREF or DELREF on the locked resource. All other
All other methods, GET in particular, function independent methods, GET in particular, function independent of the lock.
of the lock.
While those without a write lock may not alter a property on While those without a write lock may not alter a property on a
a resource it is still possible for the values of live resource it is still possible for the values of live properties
properties to change, even while locked, due to the to change, even while locked, due to the requirements of their
requirements of their schemas. Only dead properties and live schemas. Only dead properties and live properties defined to
properties defined to respect locks are guaranteed to not respect locks are guaranteed to not change while locked.
change while locked.
It is possible to assert a write lock on a null resource in It is possible to assert a write lock on a null resource in order
order to lock the name. Please note, however, that locking a to lock the name. Please note, however, that locking a null
null resource effectively makes the resource non-null as the resource effectively makes the resource non-null as the resource
resource now has lock related properties defined on it. now has lock related properties defined on it.
Write locking a container also prevents adding or removing Write locking a container also prevents adding or removing
members of the container. This means that attempts to members of the container. This means that attempts to PUT/POST a
PUT/POST a resource into the immediate name space of the resource into the immediate name space of the write locked
write locked container MUST fail if the principal requesting container MUST fail if the principal requesting the action does
the action does not have the write lock on the container. In not have the write lock on the container. In order to keep the
order to keep the behavior of locking containers consistent behavior of locking containers consistent all locks on containers
all locks on containers MUST contain a Depth header equal to MUST contain a Depth header equal to infinity, any other value is
infinity, any other value is illegal. illegal.
5.4 Lock Tokens 5.4 Lock Tokens
5.4.1 Problem Description 5.4.1 Problem Description
It is possible that once a lock has been granted it may be It is possible that once a lock has been granted it may be
removed without the lock owner’s knowledge. This can cause removed without the lock owner’s knowledge. This can cause
serialization problems if the lock owner executes methods serialization problems if the lock owner executes methods
thinking their lock is still in effect. Thus a mechanism is thinking their lock is still in effect. Thus a mechanism is
needed for a principal to predicate the successful execution needed for a principal to predicate the successful execution of a
of a message upon the continuing existence of a lock. message upon the continuing existence of a lock.
5.4.2 Proposed Solution 5.4.2 Proposed Solution
The proposed solution is to provide a lock token in the The proposed solution is to provide a lock token in the response
response of a lock request. The lock token is a type of of a lock request. The lock token is a type of state token and
state token and describes a particular lock. The same lock describes a particular lock. The same lock token must never be
token must never be repeated on a particular resource. This repeated on a particular resource. This prevents problems with
prevents problems with long held outstanding lock tokens long held outstanding lock tokens being confused with newer
being confused with newer tokens. This uniqueness tokens. This uniqueness requirement is the same as for e-tags.
requirement is the same as for e-tags. This requirement also This requirement also allows for tokens to be submitted across
allows for tokens to be submitted across resources and resources and servers without fear of confusion.
servers without fear of confusion.
5.4.3 Lock Token Definition 5.4.3 Lock Token Definition
The lock token is returned in the State-Token header in the The lock token is returned in the State-Token header in the
response to a LOCK method. The lock token can also be response to a LOCK method. The lock token can also be discovered
discovered through lock discovery on a resource. through lock discovery on a resource.
Lock-Token-URL = "StateToken:" Type ":" Resources ":" State-Info
Lock-Token-URL = “StateToken:” Type “:” Resources “:” State- Type = "Type" "=" "^DAV:/LOCK/DAVLOCK^"
Info Resources = "Res" "=" 1*("^" Caret-Encoded-URI "^")
Type = “Type” “=” “^DAV:/LOCK/DAVLOCK^” Caret-Encoded-URI = <This is a URI which has all "^"s % encoded.>
State-Info = DAVLockScope ":" DAVLockType ":" ServerID ;
Resources = “Res” “=” 1*(“^” Caret-Encoded-URI “^”)
Caret-Encoded-URI = <This is a URI which has all “^”s %
encoded.>
State-Info = DAVLockScope “:” DAVLockType “:” ServerID ;
DAVLockScope, DAVLockType defined in Lock-Info header DAVLockScope, DAVLockType defined in Lock-Info header
ServerID = “ServerID” “=” *(uchar | reserved) ServerID = "ServerID" "=" *(uchar | reserved)
The ServerID is a field for use by the server. Its most The ServerID is a field for use by the server. Its most basic
basic purpose is to put in a unique identifier to guarantee purpose is to put in a unique identifier to guarantee that a
that a server will never confuse an old lock token with a server will never confuse an old lock token with a newer one.
newer one. However the server is free to use the field to However the server is free to use the field to record whatever
record whatever information it deems fit. The field is information it deems fit. The field is opaque to clients.
opaque to clients.
5.5 UNLOCK Method 5.5 UNLOCK Method
5.5.1 Problem Definition 5.5.1 Problem Definition
The UNLOCK method removes the lock identified by the lock The UNLOCK method removes the lock identified by the lock token
token in the State-Token header from the Request-URI. in the State-Token header from the Request-URI.
5.5.2 Example 5.5.2 Example
UNLOCK /workspace/webdav/proposal.doc HTTP/1.1 UNLOCK /workspace/webdav/proposal.doc HTTP/1.1
Host: webdav.sb.aol.com Host: webdav.sb.aol.com
State-Token: StateToken:Type=^DAV:/LOCK/DAVLOCK^:Res=^http:/ State-Token: StateToken:Type=^DAV:/LOCK/DAVLOCK^:Res=^http://www.
/www.ics.uci.edu/workspace/webdav/proposal.doc^:LockType=Wri ics.uci.edu/workspace/webdav/proposal.doc^:LockType=Write:LockSco
te:LockScope=Exclusive:ServerID=12382349AdfFFF pe=Exclusive:ServerID=12382349AdfFFF
HTTP/1.1 200 OK HTTP/1.1 200 OK
In this example, the lock from example of Section 2.9 is In this example, the lock from example of Section 2.9 is removed
removed from the resource at from the resource at
http://webdav.sb.aol.com/workspace/webdav/proposal.doc http://webdav.sb.aol.com/workspace/webdav/proposal.doc
5.6 Discovery Mechanisms 5.6 Discovery Mechanisms
5.6.1 Lock Type Discovery 5.6.1 Lock Type Discovery
5.6.1.1 Problem Definition 5.6.1.1 Problem Definition
Since server lock support is optional, a client trying to Since server lock support is optional, a client trying to lock a
lock a resource on a server can either try the lock and hope resource on a server can either try the lock and hope for the
for the best or can perform some form of discovery to best or can perform some form of discovery to determine what lock
determine what lock types the server actually supports, then types the server actually supports, then formulate a supported
formulate a supported request. This is known as lock type request. This is known as lock type discovery. Lock type
discovery. Lock type discovery is not the same as discovery is not the same as discovering what access control
discovering what access control types are supported, as types are supported, as there may be access control types without
there may be access control types without corresponding lock corresponding lock types.
types.
5.6.1.2 SupportedLock Property 5.6.1.2 SupportedLock Property
Name: http://www.ietf.org/standards/dav/lock/supportedlock Name: http://www.ietf.org/standards/dav/lock/supportedlock
Purpose: To provide a listing of the lock types supported by the
Purpose: To provide a listing of the lock types supported by resource.
the resource.
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Values: An XML document containing zero or more LockEntry XML
Values: An XML document containing zero or more LockEntry elements.
XML elements. Description: The SupportedLock property of a resource returns a
listing of the combinations of scope and access types which may
Description: The SupportedLock property of a resource be specified in a lock request on the resource. Note that the
actual contents are themselves controlled by access controls so a
returns a listing of the combinations of scope and access server is not required to provide information the client is not
types which may be specified in a lock request on the authorized to see. If SupportedLock is available on "*" then it
resource. Note that the actual contents are themselves MUST define the set of locks allowed on all resources on that
controlled by access controls so a server is not required to server.
provide information the client is not authorized to see. If
SupportedLock is available on “*” then it MUST define the
set of locks allowed on all resources on that server.
5.6.1.3 LOCKENTRY XML Element 5.6.1.3 LOCKENTRY XML Element
Name: http://www.ietf.org/standards/dav/lockentry Name: http://www.ietf.org/standards/dav/lockentry
Purpose: Defines a DAVLockType/LockScope pair which may be Purpose: Defines a DAVLockType/LockScope pair which may be
legally used with a LOCK on the specified resource. legally used with a LOCK on the specified resource.
Schema: HYPERLINK http://www.ietf.org/standards/dav/ Schema: HYPERLINK http://www.ietf.org/standards/dav/
Parent: A SupportedLock entry Parent: A SupportedLock entry
Values: LockType LockScope Values: LockType LockScope
5.6.1.4 LOCKTYPE XML Element 5.6.1.4 LOCKTYPE XML Element
Name: http://www.ietf.org/standards/dav/locktype Name: http://www.ietf.org/standards/dav/locktype
Purpose: Lists a DAVLockType Purpose: Lists a DAVLockType
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: LOCKENTRY Parent: LOCKENTRY
Values: DAVLockTypeValue Values: DAVLockTypeValue
5.6.1.5 LOCKSCOPE XML Element 5.6.1.5 LOCKSCOPE XML Element
Name: http://www.ietf.org/standards/dav/lockscope Name: http://www.ietf.org/standards/dav/lockscope
Purpose: Lists a DAVLockScope Purpose: Lists a DAVLockScope
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: LOCKENTRY Parent: LOCKENTRY
Values: DAVLockScopeValue Values: DAVLockScopeValue
5.6.2 Active Lock Discovery 5.6.2 Active Lock Discovery
5.6.2.1 Problem Definition 5.6.2.1 Problem Definition
If another principal locks a resource that a principal If another principal locks a resource that a principal wishes to
wishes to access, it is useful for the second principal to access, it is useful for the second principal to be able to find
be able to find out who the first principal is. out who the first principal is.
5.6.2.2 Solution Requirements 5.6.2.2 Solution Requirements
The lock discovery mechanism should provide a list of who The lock discovery mechanism should provide a list of who has the
has the resource locked, what locks they have, and what resource locked, what locks they have, and what their lock tokens
their lock tokens are. The lock tokens are useful in shared are. The lock tokens are useful in shared lock situations where
lock situations where two principals in particular may want two principals in particular may want to guarantee that they do
to guarantee that they do not overwrite each other. The lock not overwrite each other. The lock tokens are also useful for
tokens are also useful for administrative purposes so that administrative purposes so that an administrator can remove a
an administrator can remove a lock by referring to its lock by referring to its token.
token.
5.6.2.3 LOCKDISCOVERY Property 5.6.2.3 LOCKDISCOVERY Property
Name: http://www.ietf.org/standards/dav/lockdiscovery Name: http://www.ietf.org/standards/dav/lockdiscovery
Purpose: To discover what locks are active on a resource Purpose: To discover what locks are active on a resource
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Values= An XML document containing zero or more ActiveLock XML
Values= An XML document containing zero or more ActiveLock elements.
XML elements. Description: The LOCKDISCOVERY property returns a listing of who
has a lock, what type of lock they have, the time out type and
Description: The LOCKDISCOVERY property returns a listing of the time remaining on the time out, and the associated lock
who has a lock, what type of lock they have, the time out token. The server is free to withhold any or all of this
type and the time remaining on the time out, and the information if the requesting principal does not have sufficient
associated lock token. The server is free to withhold any or access rights to see the requested data.
all of this information if the requesting principal does not
have sufficient access rights to see the requested data.
5.6.2.4 ACTIVELOCK XML Element 5.6.2.4 ACTIVELOCK XML Element
Name: http://www.ietf.org/standards/dav/activelock Name: http://www.ietf.org/standards/dav/activelock
Purpose: A multivalued XML element that describes a particular
Purpose: A multivalued XML element that describes a active lock on a resource
particular active lock on a resource
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: A LOCKDISCOVERY entry Parent: A LOCKDISCOVERY entry
Values= LOCKTYPE LOCKSCOPE OWNER TIMEOUT LOCKTOKEN Values= LOCKTYPE LOCKSCOPE OWNER TIMEOUT LOCKTOKEN
5.6.2.5 OWNER XML Element 5.6.2.5 OWNER XML Element
Name: http://www.ietf.org/standards/dav/lock/owner Name: http://www.ietf.org/standards/dav/lock/owner
Purpose: Returns owner information Purpose: Returns owner information
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: ACTIVELOCK Parent: ACTIVELOCK
Values= XML:REF | {any valid XML string} Values= XML:REF | {any valid XML string}
5.6.2.6 TIMEOUT XML Element 5.6.2.6 TIMEOUT XML Element
Name: http://www.ietf.org/standards/dav/timeout Name: http://www.ietf.org/standards/dav/timeout
Purpose: Returns information about the timeout associated with
Purpose: Returns information about the timeout associated the lock
with the lock
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: ACTIVELOCK Parent: ACTIVELOCK
Values= CLOCKTYPE TIMETYPE TIMEOUTVAL Values= CLOCKTYPE TIMETYPE TIMEOUTVAL
5.6.2.7 CLOCKTYPE XML Element 5.6.2.7 CLOCKTYPE XML Element
Name: http://www.ietf.org/standards/dav/clocktype Name: http://www.ietf.org/standards/dav/clocktype
Purpose: Returns the clock type used with this lock Purpose: Returns the clock type used with this lock
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: TIMEOUT Parent: TIMEOUT
Values= ClockTypeValue Values= ClockTypeValue
5.6.2.8 TIMETYPE XML Element 5.6.2.8 TIMETYPE XML Element
Name: http://www.ietf.org/standards/dav/clocktype Name: http://www.ietf.org/standards/dav/clocktype
Purpose: Returns the time type used with this lock Purpose: Returns the time type used with this lock
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: TIMEOUT Parent: TIMEOUT
Values= TimeTypeValue Values= TimeTypeValue
5.6.2.9 TIMEOUTVAL XML Element 5.6.2.9 TIMEOUTVAL XML Element
Name: http://www.ietf.org/standards/dav/timeoutval Name: http://www.ietf.org/standards/dav/timeoutval
Purpose: Returns the amount of time left on the lock Purpose: Returns the amount of time left on the lock
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: TIMEOUT Parent: TIMEOUT
Values= DAVTimeOutVal Values= DAVTimeOutVal
5.6.2.10 LOCKTOKEN XML Element 5.6.2.10 LOCKTOKEN XML Element
Name: http://www.ietf.org/standards/dav/statetoken Name: http://www.ietf.org/standards/dav/statetoken
Purpose: Returns the lock token Purpose: Returns the lock token
Schema: http://www.ietf.org/standards/dav/ Schema: http://www.ietf.org/standards/dav/
Parent: ACTIVELOCK Parent: ACTIVELOCK
Values= XML:REF Values= XML:REF
Description: The REF contains a Lock-Token-URL. Description: The REF contains a Lock-Token-URL.
6 Version Control 6 Version Control
[TBD] [TBD]
7 Internationalization Support 7 Internationalization Support
[TBD] [TBD]
8 Security Considerations 8 Security Considerations
[TBD] [TBD]
skipping to change at line 3497 skipping to change at line 3042
6 Version Control 6 Version Control
[TBD] [TBD]
7 Internationalization Support 7 Internationalization Support
[TBD] [TBD]
8 Security Considerations 8 Security Considerations
[TBD] [TBD]
9 Acknowledgements 9 Acknowledgements
Roy Fielding, Richard Taylor, Larry Masinter, Henry Sanders,
Judith Slein, Dan Connolly, David Durand, Henrik Nielsen, Terry Allen, Harald Alvestrand, Alan Babich, Dylan Barrell,
Paul Leach. Kenji Ota, Kenji Takahashi. Jim Cunningham. Bernard Chester, Dan Connolly, Jim Cunningham, Ron Daniel, Jr.,
Others, TBD. Keith Dawson, Mark Day, Martin Duerst, David Durand, Lee Farrell,
Chuck Fay, Roy Fielding, Mark Fisher, Alan Freier, George
Florentine, Jim Gettys, Phill Hallam-Baker, Dennis Hamilton,
Steve Henning, Alex Hopmann, Andre van der Hoek, Ben Laurie, Paul
Leach, Ora Lassila, Karen MacArthur, Steven Martin, Larry
Masinter, Michael Mealling, Keith Moore, Henrik Nielsen, Kenji
Ota, Bob Parker, Glenn Peterson, Jon Radoff, Saveen Reddy, Henry
Sanders, Christopher Seiwald, Judith Slein, Mike Spreitzer, Einar
Stefferud, Ralph Swick, Kenji Takahashi, Robert Thau, Sankar
Virdhagriswaran, Fabio Vitali, Gregory Woodhouse, Lauren Wood
10 References 10 References
[Berners-Lee, 1997] T. Berners-Lee, "Metadata Architecture." [Berners-Lee, 1997] T. Berners-Lee, "Metadata Architecture."
Unpublished white paper, January 1997. Unpublished white paper, January 1997.
http://www.w3.org/pub/WWW/DesignIssues/Metadata.html. http://www.w3.org/pub/WWW/DesignIssues/Metadata.html.
[Bray, 1997] T. Bray, C. M. Sperberg-McQueen, “Extensible [Bray, Sperberg-McQueen, 1997] T. Bray, C. M. Sperberg-McQueen,
Markup Language (XML): Part I. Syntax”, WD-xml-lang.html, "Extensible Markup Language (XML): Part I. Syntax", WD-xml-
http://www.w3.org/pub/WWW/TR/WD-xml-lang.html. lang.html, http://www.w3.org/pub/WWW/TR/WD-xml-lang.html.
[Connolly, 1997] D. Connolly, R. Khare, H.F. Nielsen, “PEP - [Connolly et al, 1997] D. Connolly, R. Khare, H.F. Nielsen, "PEP
an Extension Mechanism for HTTP”, Internet draft, work-in- - an Extension Mechanism for HTTP", Internet draft, work-in-
progress. draft-ietf-http-pep-03.txt, progress. draft-ietf-http-pep-04.txt,
ftp://ds.internic.net/internet-drafts/draft-ietf-http-pep- ftp://ds.internic.net/internet-drafts/draft-ietf-http-pep-04.txt.
03.txt.
[Fielding et al., 1997] R. Fielding, J. Gettys, J. Mogul, H.
Frystyk, T. Berners-Lee, "Hypertext Transfer Protocol --
HTTP/1.1." RFC 2068. U.C. Irvine, DEC, MIT/LCS. January, 1997.
[Lasher, Cohen, 1995] R. Lasher, D. Cohen, "A Format for [Lasher, Cohen, 1995] R. Lasher, D. Cohen, "A Format for
Bibliographic Records," RFC 1807. Stanford, Myricom. June, Bibliographic Records," RFC 1807. Stanford, Myricom. June, 1995.
1995.
[Maloney, 1996] M. Maloney, "Hypertext Links in HTML." [Maloney, 1996] M. Maloney, "Hypertext Links in HTML." Internet
Internet draft (expired), work-in-progress, January, 1996. draft (expired), work-in-progress, January, 1996.
[MARC, 1994] Network Development and MARC Standards, Office, [MARC, 1994] Network Development and MARC Standards, Office, ed.
ed. 1994. "USMARC Format for Bibliographic Data", 1994. 1994. "USMARC Format for Bibliographic Data", 1994. Washington,
Washington, DC: Cataloging Distribution Service, Library of DC: Cataloging Distribution Service, Library of Congress.
Congress.
[Miller et.al., 1996] J. Miller, T. Krauskopf, P. Resnick, [Miller et al., 1996] J. Miller, T. Krauskopf, P. Resnick, W.
W. Treese, "PICS Label Distribution Label Syntax and Treese, "PICS Label Distribution Label Syntax and Communication
Communication Protocols" Version 1.1, W3C Recommendation Protocols" Version 1.1, W3C Recommendation REC-PICS-labels-
REC-PICS-labels-961031. http://www.w3.org/pub/WWW/TR/REC- 961031. http://www.w3.org/pub/WWW/TR/REC-PICS-labels-961031.html.
PICS-labels-961031.html.
[WebDAV, 1997] WEBDAV Design Team. “A Proposal for Web [Slein et al., 1997] J. A. Slein, F. Vitali, E. J. Whitehead,
Metadata Operations.” Unpublished manuscript. Jr., D. Durand, "Requirements for Distributed Authoring and
http://www.ics.uci.edu/~ejw/authoring/proposals/metadata.htm Versioning on the World Wide Web." Internet-draft, work-in-
l progress, draft-ietf-webdav-requirements-02.txt,
ftp://ds.internic.net/internet-drafts/draft-ietf-webdav-
requirements-02.txt.
[Weibel et al., 1995] S. Weibel, J. Godby, E. Miller, R. [WebDAV, 1997] WEBDAV Design Team. "A Proposal for Web Metadata
Daniel, "OCLC/NCSA Metadata Workshop Report." Operations." Unpublished manuscript.
http://www.ics.uci.edu/~ejw/authoring/proposals/metadata.html
[Weibel et al., 1995] S. Weibel, J. Godby, E. Miller, R. Daniel,
"OCLC/NCSA Metadata Workshop Report."
http://purl.oclc.org/metadata/dublin_core_report. http://purl.oclc.org/metadata/dublin_core_report.
[Yergeau, 1997] F. Yergeau, “UTF-8, a transformation format [Yergeau, 1997] F. Yergeau, "UTF-8, a transformation format of
of Unicode and ISO 10646”, Internet Draft, work-in-progress, Unicode and ISO 10646", Internet Draft, work-in-progress, draft-
draft-yergeau-utf8-rev-00.txt, yergeau-utf8-rev-00.txt, http://www.internic.net/internet-
http://www.internic.net/internet-drafts/draft-yergeau-utf8- drafts/draft-yergeau-utf8-rev-00.txt.
rev-00.txt.
11 Authors' Addresses 11 Authors' Addresses
Yaron Y. Goland
Y. Y. Goland
Microsoft Corporation Microsoft Corporation
One Microsoft Way One Microsoft Way
Redmond, WA 98052-6399 Redmond, WA 98052-6399
Email yarong@microsoft.com Email yarong@microsoft.com
E. J. Whitehead, Jr. E. J. Whitehead, Jr.
Dept. Of Information and Computer Science Dept. Of Information and Computer Science
University of California, Irvine University of California, Irvine
Irvine, CA 92697-3425 Irvine, CA 92697-3425
Email: ejw@ics.uci.edu Email: ejw@ics.uci.edu
Asad Faizi A. Faizi
Netscape Netscape
685 East Middlefield Road 685 East Middlefield Road
Mountain View, CA 94043 Mountain View, CA 94043
Email: asad@netscape.com Email: asad@netscape.com
Stephen R Carter S. R Carter
Novell Novell
1555 N. Technology Way 1555 N. Technology Way
M/S ORM F111 M/S ORM F111
Orem, UT 84097-2399 Orem, UT 84097-2399
Fax (801) 228 5176
Email srcarter@novell.com Email srcarter@novell.com
Del Jensen D. Jensen
Novell Novell
1555 N. Technology Way 1555 N. Technology Way
M/S ORM F111 M/S ORM F111
Orem, UT 84097-2399 Orem, UT 84097-2399
Fax (801) 228 5176
Email dcjensen@novell.com Email dcjensen@novell.com
Appendix 1 - Content Type Application/XML
This is a digest of the XML data specification available at
http://www.w3.org/TR/WD-xml-lang.html
Syntax
The application/XML content type contains an XML document.
Its syntax is as defined below.
XML = XMLStart *XMLEntity Close
XMLStart = “<” “XML” “>”
XMLEntity= Open *(XMLText | XMLEntity) Close
Close = “</>” | “<”“/”Entity-Name Markup“>”
Open = “<” Entity-Name *Attribute “>”
Attribute = Entity-Name “=” Quoted-String
XMLText = <An Octet Stream which uses XML encoding for “<”
and “>”>
Entity-Name = ([As-Tag “:”] Name) | (As-Tag “:”)
As-Tag = 1*Alpha
Name = (alpha | “_”) *(alpha | digit | “.” | “-“ | “_” |
other)
Other = <Other characters must be encoded>
XML element
An XML element, as defined in the BNF, is an open tag with
content followed by a close tag. In order to prevent
confusion with the term entity as used in HTTP, the term XML
element will be used.
The first XML element of a XML document MUST be the <XML>
XML element. This XML element tells the parser that it is
dealing with an XML document. So long as this XML element is
present the parser can be sure that it can parse the
document, even if XML has been extended. If XML is ever
altered in a manner that is not backwards compatible with
this specification then the content-type and the outer most
XML element MUST be changed.
Entity-Name
All XML element names must map to URIs. However due to
historical restrictions on what characters may appear in an
XML element name, URIs cannot be expressed in an XML element
name. This issue is dealt with in more detail in section 10.
Entity-Names without [AS] are relative URIs whose base is
the enclosing Entity-Name. If the enclosing Entity-Name is
<XML> then the Entity-Name MUST use an [AS].
Close
The close production marks the end of a XML element.
XML Encoding
In different contexts certain characters are reserved, for
example “/” can not be used in an XML element name and
“>”/”<” can not be used in a value. As such these values
must be encoded as follows:
Encoding = Decimal | Hex4
Decimal = “&” Non-Zero *(“0” | Non-Zero)
Hex4 = “&u-“ 4(Hex)
Non-Zero = “1” | “2” | “3” | “4” | “5” | “6” | “7” | “8” |
“9”
Hex = “0” | Non-Zero | “A” | “B” | “C” | “D” | “E” | “F”
The numbers MUST map to the UTF8 character encodings. Please
note that the “&” character must always be encoded.
Markup Modifier
The markup modifier, (“-”, after the end of an XML element)
instructs the principal how to treat a XML element with an
unknown name. If the modifier is used and the XML element is
not recognized then the XML element name MUST be stripped
and the XML element’s contents promoted one level in the
parse tree. If the modifier is not used and the XML element
name is unknown then the XML element and its contents MUST
be ignored.
XML Syntax Shorthand
The following template is recommended for efficiently
providing a description of an XML element.
Name: The name of the XML element
Purpose: A one line description of the XML element’s
purpose.
Schema: The schema, if any, that the XML element belongs to
Parent: XML elements that this XML element may be a child
of.
Values: A description, usually a BNF, of the simple and
compound values that the XML element supports.
Description: Further information.
Example: An example of the XML element’s use.
Appendix 2 - Parameter Syntax for Content-Type
Application/XML
HTTP 1.1 provides for a mechanism to include a parameter
with a content type. In order to prevent namespace
collisions the parameters for application/XML must use the
following syntax:
Parameter = #(<”>URI<”> [“=” (token | Quoted-String)])
Schema Content-Type Parameter
Parameter = <”> http://www.w3.org/standards/xml/content-
type/schema <”> “=” <”> #URI <”>
The http://www.w3.org/standards/xml/content-type/schema/ URL
is used as a parameter to an application/xml content type.
The URL indicates that its value lists some subset of the
schemas defined in NameSpace parameters within the enclosed
document. The URI can also be used in requests to indicate
schemas that should appear in the result.
An example of the use of this parameter is to include it in
an accept-type header on a request to indicate that the
response should contain the specified namespace. Thus the
client is able to inform the server of its support for a
particular set of namespaces. The server is not required to
return a result with the specified namespaces.
Appendix 3 – URI Path Encoding
Problem Definition
A mechanism is needed to refer to specific DAV properties in
a manner that can handle simple, composite, and multivalued
DAV properties.
Solution Requirement
The reference mechanism must use the standard URL syntax so