view Side-By-Side changes
INTERNET DRAFT E.J. Whitehead, Jr.,U.C.UC Irvine<draft-ietf-webdav-protocol-04><draft-ietf-webdav-protocol-05> A. Faizi, NetscapeS. RS.R. Carter, Novell D. Jensen, Novell ExpiresApril 20,April, 1998October 12,November 19, 1997 Extensions for Distributed Authoringand Versioningon the World Wide Web -- WEBDAV Status of this Memo This document is an Internet-Draft. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet-Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or made obsolete by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress". To learn the current status of any Internet-Draft, please check the "1id-abstracts.txt" listing contained in the Internet-Drafts Shadow Directories on ftp.is.co.za (Africa), nic.nordu.net (Europe), munnari.oz.au (Pacific Rim), ds.internic.net (US East Coast), or ftp.isi.edu (US West Coast). Distribution of this document is unlimited. Please send comments to the Distributed Authoring and Versioning (WEBDAV) working group at <w3c-dist-auth@w3.org>, which may be joined by sending a message with subject "subscribe" to<w3c-dist-auth- request@w3.org>.<w3c-dist-auth-request@w3.org>. Discussions of the WEBDAV working group are archived at <URL:http://www.w3.org/pub/WWW/Archives/Public/w3c-dist-auth>. Abstract ThisDocumentdocument specifies a set ofmethodsmethods, headers, and content-types ancillary to HTTP/1.1 for the management of resource properties,simple name spacecreation and management of resource collections, namespace manipulation,simpleresource locking (collisionavoidance)avoidance), and efficient transmission of resourceversion control. Tablechanges. Changes 1.1. Changes since draft-ietf-webdav-protocol-04.txt [Editor's note: This section will not appear in the final form ofContents Abstract 1 Terminology 2 Data Model and Methodsthis document. Its purpose is to provide a concise list of changes from the previous revision of the draft forDAV Properties 2.1 Introduction 2.1.1 The DAV Property 2.1.2 Existing Metadata Proposals 2.1.3 Properties and HTTP Headers 2.2 A Property Modeluse by reviewers.] Added this change section. INTERNET-DRAFT WebDAV November 19, 1997 Removed scoping forHTTP Resources 2.2.1 Overview 2.2.2 Property Namespace 2.3 Schemas 2.3.1 PropSchema XML Element 2.3.2 DTD XML Element 2.3.3 DefinedProps XML Element 2.3.4 PropEntries XML Element 2.3.5 Live XML Element 2.4 DAV Schema 2.4.1namespaces so the namespace for every element is explicitly stated. Changed the syntax from <?XML:Namespace.../> to <?namespace...?>. Removed propfindresult, this was left over from the old search format. Changed all the DAVProperty 2.4.2 Level XML Element 2.4.3 PropXML element2.4.4 PropLoc XML Attribute 2.4.5 Example 2.5 Property Identifiers 2.5.1 Problem Definition 2.6 Link XML Element 2.6.1 Problem Description 2.6.2 Solution Requirements 2.6.3 Link XML Element 2.6.4 Src XML Element 2.6.5 Dst XML Element 2.6.6 Example 2.7 Multi-Status Response 2.7.1 Problem Definition 2.7.2 Solution Requirements 2.7.3 Multi-Status Response 2.8 Propertiesnames to lower case. Changed the property format to use Name andMethods 2.8.1 DELETE 2.8.2 GET 2.8.3 PROPPATCH 2.8.4 PUT 2.8.5 PROPFIND 3 A Proposal for Collections of Web ResourcesNamespace rather than name andName Space Operations 3.1 Observationsschema. Removed proploc attribute and removed section on GETting, DELETEing, and PUTing properties since we do not provide a mechanism for getting a URI for properties. Also removed the requirement that properties be URI addressable. Removed quoted string choice from owner header, it is just XML. Made all the HTTPObject Model 3.1.1 Collection Resources 3.1.2 Creation and Retrieval of Collection Resources 3.1.3 Source Resources and Output Resources 3.2 MKCOL Method 3.2.1 Problem Description 3.2.2 Solution Requirements 3.2.3 Request 3.2.4 Response 3.2.5 Example 3.3 Standard DAV Properties 3.3.1 IsCollection Property 3.3.2 DisplayName Property 3.3.3 CreationDate Property 3.3.4 GETentity Property 3.3.5 INDEXentity Property 3.3.6 Content-Type XML Element 3.3.7 Content-Length XML Element 3.3.8 Content-Language XML Element 3.3.9 Last-Modified XML Element 3.3.10 Etag XML Element 3.4 INDEX Method 3.4.1 Problem Description 3.4.2 Solution Requirements 3.4.3 The Request 3.4.4 The Response 3.4.5 ResInfo XML Element 3.4.6 Members XML Element 3.4.7 Href XML Element 3.4.8 Example 3.5 Behavior of RFC 2068 Methods on Collections 3.5.1 GET, HEAD for Collections 3.5.2 POST for Collections 3.5.3 PUT for Collections 3.5.4 DELETE for Collections 3.5.5 DELETE Method for Non-Collection Resources 3.6 COPY Method 3.6.1 Problem Description 3.6.2 Solution Requirements 3.6.3 The Request 3.6.4 The Response 3.6.5 Examples 3.7 MOVE Method 3.7.1 Problem Description 3.7.2 Solution Requirements 3.7.3 The Request 3.7.4 The Response 3.7.5 Examples 3.8 ADDREF Method 3.8.1 Problem Definition 3.8.2 Solution Requirements 3.8.3 The Request 3.8.4 Example 3.9 DELREF Method 3.9.1 Problem Definition 3.9.2 Solution Requirements 3.9.3 The Request 3.9.4 Example 3.10 PATCH Method 3.10.1 Problem Definition 3.10.2 Solution Requirements 3.10.3 The Request 3.10.4 text/xml elements for PATCH 3.10.5 The Response 3.10.6 Examples 3.11 Headers 3.11.1 Destination Header 3.11.2 Enforce-Live-Properties Header 3.11.3 Overwrite Header 3.11.4 Destroy Header 3.11.5 Collection-Member Header 3.12 Links 3.12.1 Source Link Property Type 4 State Tokens 4.1 Overview 4.1.1 Problem Description 4.1.2 Solution Requirements 4.2 State Token Syntax 4.3 State Token Conditional Headers 4.3.1 If-State-Match 4.3.2 If-None-State-Match 4.4 State Token Header 4.5 E-Tag 5 Locking 5.1 Locking: Introduction 5.1.1 Exclusive Vs. Shared Locks 5.1.2 Required Support 5.2 LOCK Method 5.2.1 Operation 5.2.2 The Effect of Locks on Properties and Containers 5.2.3 Locking Replicated Resources 5.2.4 Locking Multiple Resources 5.2.5 Interaction with other Methods 5.2.6 Lock Compatibility Table 5.2.7 Status Codes 5.2.8 Lock-Info Request Header 5.2.9 Owner Request Header 5.2.10 Time-Out Header 5.2.11 Lock Response 5.2.12 Example - Simple Lock Request 5.2.13 Example - Multi-Resource Lock Request 5.3 Write Lock 5.3.1 Methods Restricted by Write Locks 5.3.2 Write Locks and Properties 5.3.3 Write Locks and Null Resources 5.3.4 Write Locks and Collections 5.3.5 Write Locks and COPY/MOVE 5.3.6 Re-issuing Write Locks 5.3.7 Write Locks and The State-Token Header 5.4 Lock Tokens 5.4.1 Problem Description 5.4.2 Lock Token Introduction 5.4.3 Generic Lock Tokens 5.4.4 OpaqueLockToken Lock Token 5.5 UNLOCK Method 5.5.1 Problem Definition 5.5.2 Example 5.6 Discovery Mechanisms 5.6.1 Lock Capability Discovery 5.6.2 Active Lock Discovery 6 Version Control 7 Internationalization Support 8 Security Considerations 9 Copyright 10 Acknowledgements 11 References 12 Authors' Addresses 1 Terminology Collection - A resource that contains member resources. Member Resource - a resource referred to by a collection. There are two types of member resources: external and internal. Internal Member Resource - the name given to a member resource of a collection whose URI is relative to the URI of the collection. External Member Resource - a member resource with an absolute URI that is not relative to its parent’s URI. Properties - A set of name/value pairs that contain descriptive information about a resource. Live Properties - Properties whose semantics and syntax are enforced by the server. For example, a live "read-only" property that is enforced by the server would disallow PUTs to the associated resource. 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 and thus would not be used by the server as a reason to disallow a PUT on the associated resource. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 [Bradner, 1997]. 2 Data Model and Methods for DAV Properties 2.1 Introduction 2.1.1 The DAV Property Properties are pieces of data that describe the state of a resource. Properties are data about data. The term property is used within this specification to disambiguate the concept from the overloaded terms "metadata" and "attribute". Properties are used within distributed authoring environments to provide for efficient discovery and management of resources. For example, a 'subject' property might allow for the indexing of all resources by their subject, and an 'author' property might allow for the discovery of what authors have written which documents. 2.1.2 Existing Metadata Proposals Properties have a long played an essential role in the maintenance of large document repositories, and many current proposals contain some notion of a property. These include PICS [Miller et al., 1996], PICS-NG, the Rel/Rev draft [Maloney, 1996], Web Collections, XML [Bray, Sperberg-McQueen, 1997], several proposals on representing relationships within HTML, digital signature manifests (DCMF), and a position paper on Web metadata architecture [Berners-Lee, 1997]. Some proposals come from a digital library perspective. These include the Dublin Core [Weibel et al., 1995] metadata set and the Warwick Framework [Lagoze, 1996], a container architecture for different metadata schemas. The literature includes many examples of metadata, including MARC [MARC, 1994], a bibliographic metadata format, RFC 1807 [Lasher, Cohen, 1995], a technical report bibliographic format employed by the Dienst 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 [Lagoze, 1996], noted that, "new metadata sets will develop as the networked infrastructure matures" and "different communities will propose, design, and be responsible for different types of metadata." These observations can be corroborated by noting that many community-specific sets of metadata already exist, and there is significant motivation for the development of new forms of metadata as many communities increasingly make their data available in digital form, requiring a metadata format to assist data location and cataloging. 2.1.3 Properties and HTTP Headers Properties already exist, in a limited sense, within HTTP through the use of message headers. However, in distributed authoring environments a relatively large number of properties are needed to describe the state of a resource, and setting/returning them all through HTTP headers is inefficient. Thus a mechanism is needed which allows a principal to identify a set of properties in which the principal is interested and to then set or retrieve just those properties. 2.2 A Property Model for HTTP Resources 2.2.1 Overview The DAV property model is based on name/value doubles. The name of a property identifies the property's syntax and semantics, and provides an address with which to refer to a property. The name and value of a property is expressed as a well-formed XML element, where the name of the property is the name of the XML element, and the value of the property MUST be either blank, or a well-formed XML element value. 2.2.2 Property Namespace 2.2.2.1 Problem Definition The requirement is to be able to associate a value with a property name on a resource. It must be possible to associate a URL with the property name. 2.2.2.2 Solution Requirement Ideally a property namespace should work well with extant property implementations as well as database systems. The DAV property namespace has been specified with the following two facts in mind: · Namespaces associated with flat file systems are 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 a table with name and value, where the value is a series of indexes into other tables and each index represents a specific value. However most RDBS do not provide for table pointers, only index values. Such a system would have to be jury-rigged to handle table pointers. In addition, 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, inducing a natural isomorphism between DAV and most native file systems. Adopting such a model will not restrict RDBS from taking full advantage of their search facilities. However, it seems that future trends might be toward hierarchical properties. Therefore, DAV requirements [Slein et al.] stipulate that the design of the flat property system MUST be such that it will be possible to add true hierarchical properties later without breaking downlevel clients. Specifically, a flat client MUST be able to speak to a hierarchical server and a hierarchical client MUST be able to speak to a flat server. Worst case either way MUST be that the request fails. 2.2.2.3 Property Names A property name identifies both the syntax and semantics of the property's value. It is critical that property names do not collide, e.g., two principals defining the same property name with two different meanings. The URI framework provides 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. Since a property is also an XML element, the name of the XML element is a URI. 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 B but not a property A/B, where A is also a property defined on the resource. Finally, it is not possible to define the same property twice as this would cause a collision in the resource's property namespace. 2.3 Schemas A schema is a group of property names and XML elements. Schema discovery is used to determine if a system supports a group of properties or XML elements. A property does not necessarily contain sufficient information to identify any schema(s) to which it may belong. As with property names, schemas MUST use URIs as their names. 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. 2.3.1 PropSchema XML Element Name: http://www.ietf.org/standards/dav/PropSchema Purpose: To provide information about properties 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. 2.3.2 DTD XML Element 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/ Parent: Any Values: XML Declaration statements 2.3.3 DefinedProps XML Element 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/ Parent: Any Values= 1*PropEntries 2.3.4 PropEntries XML Element 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/ 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. 2.3.5 Live XML Element 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/ Parent: PropEntries 2.4 DAV Schema The DAV Schema is specified as http://www.ietf.org/standards/dav/. This schema is used to indicate support for · properties that may be defined on a resource and · XML elements that may be returned in responses. 2.4.1 DAV Property Name: http://www.ietf.org/standards/dav 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. 2.4.2 Level XML Element Name: http://www.ietf.org/standards/dav/level 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. 2.4.3 Prop XML element Name: http://www.ietf.org/standards/dav/prop Purpose: Contains properties related to a resource. 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.4 PropLoc XML Attribute 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. 2.4.5 Example <?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> </D:Prop> 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. 2.5 Property Identifiers 2.5.1 Problem Definition 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. A server is free to assign whatever URI it chooses to identify an instance of a property defined on a resource. In fact, a server 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.6 Link XML Element 2.6.1 Problem Description A mechanism is needed to associate resources with other resources. These associations, known as links, consist of three values, a type describing the nature of the association, the source of the link, and the destination of the link. In the case of annotation, neither the source nor the destination of a link need be the resource upon which the link is recorded. 2.6.2 Solution Requirements The association mechanism MUST make useerror codes use the same format. Changed the name of theDAV property mechanismcreate element inorderPROPPATCH tomake the existence ofset, theassociations searchable. 2.6.3 Link XML Element Name: http://www.ietf.org/standards/dav/link Purpose: To identify a property as a link andnew name seems tocontaincause less confusion. Moved all headers in thesource and destination of that link. Schema: http://www.ietf.org/standards/dav/ Values= 1*Src 1*Dst Description:Link is useddraft toprovide the sources and destinations ofalink. The typesingle section. Deleted the state token section of theproperty containingdraft and moved theLink XML element providesstate token headers to thetypeheader section of thelink. Link is a multi-valued element, so multiple Links may be used together to indicate multiple links with the same type. 2.6.4 Src XML Element Name: http://www.ietf.org/standards/dav/src Purpose: To indicatedraft. Removed thesource of a link. Schema: http://www.ietf.org/standards/dav/ Parent: http://www.ietf.org/standards/dav/link Values= URI 2.6.5 Dst XML Element Name: http://www.ietf.org/standards/dav/Dst Purpose: To indicatestate token header. Changed thedestination ofwrite lock section to state that alink Schema: http://www.ietf.org/standards/dav/ Parent: http://www.ietf.org/standards/dav/link Values= URI 2.6.6 Example <?XML:Namespace href = "http://www.ietf.org/standards/dav/" AS = "D"/> <?XML:Namespace href = "http://www.foocorp.com/Project/" AS = "F"/> <D:Prop> <Source> <Link> <F:ProjFiles>Source</F:ProjFiles> <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> In this example the resource http://foo.bar/program hasLock-Token request header, not asource property defined which contains three links. Each link contains three elements, two of which, src and dst, are part of the DAV schema defined in this document, and one whichstate-token request header, isdefined 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 seeingto be submitted on request for write locked resources. Created a "generic" XML element section for XML elements that get repeatedly re-used throughout theexpected sourcespec. I moved LINK XML element to this section. Made multistatus anddestination links. An enhanced client may know aboutSchema discovery their own level one sections. Collected all thefoocorp elements and be ableproperties together. Removed all references topresent the user with additional information aboutthelinks. 2.7 Multi-Status Response 2.7.1 Problem Definition Some methods effect more than one resource. The effectpossibility of properties have their own URIs. This includes removing themethodproperty identifier section. Separated the section oneach ofweb collections and namespaces into two separate sections. Collected all thescoped resources may be different, as such a return format that can specifynew response codes together into their own section. INTERNET-DRAFT WebDAV November 19, 1997 Changed theeffectXML multiresponse element name to multistatus. Added a stand alone section on levels oftheDAV compliance. I also went methodon each resource is needed. 2.7.2 Solution Requirements The solution must: - communicateby method, property by property, to specify compliance requirements. Added an introduction. Changed all thestatus code"True" andreason - give"False" to "T" and "F". Altered theURIfirst two paragraphs of theresource on whichProperty Names section to make themethod was invokedrelationship between a property's name and its schema a little clearer. I also added some text in the same section defining a property name as a namespace and element. Added a second paragraph to property model for http resources -be consistentoverview. This paragraph clarifies why XML was chosen. Added a 409 Conflict error to move to cover attempts to move a collection withother return body formats 2.7.3 Multi-Status Response The default multi-status response body is an text/xml HTTP entity that containsmembers. Changed the collection requirement to read the collections SHOULD end with "/". Also added asingle XML element called multiresponse, which containsSHOULD about returning aset of XML elements called response, one for each 200, 300, 400, and 500 series status code generated duringlocation header if themethod invocation. 100 series status codes MUST NOT be recorded inclient submits aresponse XML element. 2.7.3.1 MultiResponse Name: http://www.ietf.org/standards/dav/multiresponse Purpose: Contains multiple response messages. Schema: http://www.ietf.org/standards/dav/ Parent: Any Value: 1*Response [ResponseDescription] Description:The ResponseDescription atURL for a collection without a trailing "/". Moved thetop levelowner header into the body due to size concerns. Replaced the iscollection xml element with resourcetype. Moved the DAV property to the DAV header that isusedreturned with OPTIONS. Folded the tree draft into this draft. Changed the DELETE, COPY, and MOVE sections toprovideinclude their effect on collections as taken from the tree draft. Created a Depth header section and put in the generalmessage describingrules that were in theover arching nature ofintroduction to theresponse. If this value is available an application MAY use it instead of presentingtree draft. I also added theindividual102 responsedescriptions contain withinand response-status header. Removed theresponses. 2.7.3.2 Response Name: http://www.ietf.org/standards/dav/response Purpose: Holdsversioning section. Put all the methods into a singleresponse Schema: http://www.ietf.org/standards/dav/ Parent: Any Value: (Prop | HREF) Status [ResponseDescription] Description: Prop MUST contain one or more empty XML elements representingsection. Replaced thename of properties. Multiple properties may be included ifPROPFIND request body with a propfind header. Now thesameresponseapplies to them all. If HREFcan be cached just using vary. Nuked resinfo for INDEX and combined it with multistatus which is now usedthenfor both INDEX and PROPFIND. Stripped down INDEX as agreed. Removed theresponse refersproblem definition and proposed solution sections. We can always cut and paste them together from the older version if we feel we need them but this draft is supposed to be a dry run for INTERNET-DRAFT WebDAV November 19, 1997 last call and last call documents do not have problemwithdefinition/proposed solution sections. Killed thereferenced resource, not a property. 2.7.3.3 Status Name: http://www.ietf.org/standards/dav/status Purpose: Holds a single HTTP status-line Schema: http://www.ietf.org/standards/dav/ Parent: Response Value: status-line ;status-line defined in [Fielding et al., 1997] 2.7.3.4 ResponseDescription Name: http://www.ietf.org/standards/dav/ResponseDescription Purpose: Contains a message that cansection on schema discovery, it is controversial and we aren't going to bedisplayedable to require it. We should specify it in a different spec. Added a section on notational conventions used within theuser explainingdocument. Moved thenatureterminology section to the end of theresponse. Schema: http://www.ietf.org/standards/dav/ Parent: Multiresponse and/or Response Value: Any Description: This XML element provides information suitabledocument tobe presentedprovide better flow from the high-level introduction toa user. 2.8 Properties and Methods 2.8.1 DELETE As properties are resources,thedeletionspecific introduction sections. Increased the numeric value ofa property causesthesame result as4xx status codes introduced in this specification to avoid conflicts with thedeletionnew revision ofany resource. It is worth pointing out thatthedeletionHTTP/1.1 specification, which introduces two new 4xx status codes. Wrote internationalization concerns section. Added XML version number to all examples. INTERNET-DRAFT WebDAV November 19, 1997 Contents STATUS OF THIS MEMO...................................................1 ABSTRACT..............................................................1 CHANGES...............................................................1 1.1. Changes since draft-ietf-webdav-protocol-04.txt..................1 CONTENTS..............................................................5 2. INTRODUCTION.......................................................8 3. DATA MODEL FOR RESOURCE PROPERTIES.................................9 3.1. The Resource Property Model......................................9 3.2. Existing Metadata Proposals.....................................10 3.3. Properties and HTTP Headers.....................................10 3.4. Property Values.................................................10 3.5. Property Names..................................................11 4. COLLECTIONS OF WEB RESOURCES......................................11 4.1. Collection Resources............................................11 4.2. Creation and Retrieval ofa property effects both direct manipulation, that isCollection Resources..................12 4.3. HTTP URL Namespace Model........................................13 4.4. Source Resources and Output Resources...........................13 5. LOCKING...........................................................14 5.1. Exclusive Vs. Shared Locks......................................14 5.2. Required Support................................................15 5.3. Lock Tokens.....................................................16 5.4. opaquelocktoken Lock Token URI Scheme...........................16 5.5. Lock Capability Discovery.......................................16 5.6. Active Lock Discovery...........................................17 6. WRITE LOCK........................................................17 6.1. Methods Restricted bythe property's URL, as well as indirect discoveryWrite Locks...............................17 6.2. Write Locks andmanipulation, that is PROPPATCHProperties......................................17 6.3. Write Locks andPROPFIND. 2.8.2 GET A GET with a Request-URI that identifies a property returnsNull Resources..................................17 6.4. Write Locks and Collections.....................................18 6.5. Write Locks and COPY/MOVE.......................................18 6.6. Re-issuing Write Locks..........................................18 6.7. Write Locks and The Lock-Token Request Header...................18 7. NOTATIONAL CONVENTIONS............................................19 8. HTTP METHODS FOR DISTRIBUTED AUTHORING............................19 8.1. PROPFIND........................................................19 8.2. PROPPATCH.......................................................23 8.3. MKCOL Method....................................................25 8.4. INDEX Method....................................................26 8.5. DELREF Method...................................................28 8.6. ADDREF Method...................................................28 8.7. GET, HEAD for Collections.......................................29 8.8. POST for Collections............................................29 8.9. DELETE..........................................................29 8.10. PUT............................................................31 INTERNET-DRAFT WebDAV November 19, 1997 8.11. COPY Method....................................................31 8.12. MOVE Method....................................................35 8.13. LOCK Method....................................................38 8.14. UNLOCK Method..................................................42 8.15. PATCH Method...................................................43 9. DAV HEADERS.......................................................47 9.1. Collection-Member Header........................................47 9.2. DAV Header......................................................47 9.3. Depth Header....................................................47 9.4. Destination Header..............................................48 9.5. Destroy Header..................................................48 9.6. Enforce-Live-Properties Header..................................49 9.7. If-None-State-Match.............................................49 9.8. If-State-Match..................................................50 9.9. Lock-Info Request Header........................................50 9.10. Lock-Token Request Header......................................51 9.11. Lock-Token Response Header.....................................51 9.12. Overwrite Header...............................................52 9.13. Propfind Request Header........................................52 9.14. Status-URI Response Header.....................................52 9.15. Timeout Header.................................................52 10. RESPONSE CODE EXTENSIONS TO RFC 2068.............................54 10.1. 102 Processing.................................................54 10.2. 207 Multi-Status...............................................54 10.3. 418 Unprocessable Entity.......................................54 10.4. 419 Insufficient Space on Resource.............................54 10.5. 420 Method Failure.............................................54 11. MULTI-STATUS RESPONSE............................................54 11.1. multistatus XML Element........................................55 11.2. response XML Element...........................................55 11.3. status XML Element.............................................55 11.4. responsedescription XML Element................................55 12. GENERIC DAV XML ELEMENTS.........................................55 12.1. href XML Element...............................................56 12.2. link XML Element...............................................56 12.3. prop XML element...............................................57 13. DAV PROPERTIES...................................................57 13.1. creationdate Property..........................................57 13.2. displayname Property...........................................57 13.3. get-content-language Property..................................58 13.4. get-content-length Property....................................58 13.5. get-content-type Property......................................58 13.6. get-etag Property..............................................58 13.7. get-last-modified Property.....................................59 13.8. index-content-language Property................................59 INTERNET-DRAFT WebDAV November 19, 1997 13.9. index-content-length Property..................................59 13.10. index-content-type Property...................................59 13.11. index-etag Property...........................................59 13.12. index-last-modified Property..................................60 13.13. lockdiscovery Property........................................60 13.14. resourcetype Property.........................................62 13.15. Source Link Property Type.....................................62 13.16. supportedlock Property........................................63 14. DAV COMPLIANCE LEVELS............................................64 14.1. Level 1........................................................64 14.2. Level 2........................................................64 15. INTERNATIONALIZATION SUPPORT.....................................65 16. SECURITY CONSIDERATIONS..........................................66 17. TERMINOLOGY......................................................66 18. COPYRIGHT........................................................66 19. ACKNOWLEDGEMENTS.................................................67 20. REFERENCES.......................................................69 21. AUTHORS' ADDRESSES...............................................71 INTERNET-DRAFT WebDAV November 19, 1997 2. Introduction This document describes an extension to thename and value ofHTTP/1.1 protocol thatproperty. Accept types may be usedallows clients tospecify the format of the return value, but all DAV compliant servers MUST at minimum supportperform remote web content authoring operations. This extension provides areturn typecoherent set oftext/xml. If text/xml is used as the response format then it MUST return the namemethods, headers, request entity body formats, andvalue of the property using the Prop XML element. 2.8.2.1 Example The following example assumesresponse entity body formats thatthe 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 HTTP/1.1 200 OK Content-Type: text/xml Content-Length: xxxx E-tag: "1234" Last-Modified: xxxx <?XML:Namespace href = "http://www.ietf.org/standards/dav/" AS = "D"/> <?XML:Namespace href = "http://www.w3.com/standards/z39.50/"AS = "Z"/> <D:prop> <Z:Authors> <Z:Author>Jane Doe</Z:Author> <Z:Author>Joe Doe</Z:Author> <Z:Author>Lots o'Doe</Z:Author> </Z:Authors> </D:prop> 2.8.3 PROPPATCHprovide operations for: Properties: ThePROPPATCH method processes instructions specified in the request bodyability tocreate and/or remove properties defined on the resource identified by Request-URI. All DAV compliant servers MUST process instructions which are specified using the PropertyUpdate, Create,create, remove, andRemove XML elements ofquery information about Web pages, such as its author, creation date, etc. Also, theDAV schema.ability to link pages of any media type to related pages. Collections: Therequest message body MUST contain at least one PropertyUpdate XML element. Instruction processing MUST occur in the order instructions are received (i.e., from topability tobottom),create sets of related documents, andMUST be performed atomically. 2.8.3.1 PropertyUpdate XML element Name: http://www.ietf.org/standards/dav/PropertyUpdate Purpose: To contain a requesttoalter the properties onreceive aresource. Schema: http://www.ietf.org/standards/dav/ Parent: Any Values= *(Create | Remove) Description:This XML element islisting of pages at acontainer for the information requiredparticular hierarchy level (like a directory listing in a file system). Locking: The ability tomodify the propertieskeep more than one person from working on a document at theresource.same time. ThisXML element is multi-valued. 2.8.3.2 Create XML element Name: http://www.ietf.org/standards/dav/create Purpose: To createprevents theDAV properties specified inside"lost update problem" in which modifications are lost as first one author, then another writes their changes without merging theCreate XML element. Schema: http://www.ietf.org/standards/dav/ Parent: http://www.ietf.org/standards/dav/PropertyUpdate Values= Prop Description:This XML element MUST contain only a Prop XML element.other author's changes Namespace Operations: Theelements contained by Prop specify the nameability to copy andvaluemove Web resources Efficient Update: The ability to send changes which are proportional to the size ofproperties thatthe change rather than retransmitting the entire resource. Requirements and rationale for these operations arecreated on Request-URI. Ifdescribed in aproperty already exists then its value is replaced. The Prop XML element MUST NOT containcompanion document, "Requirements for aPropLoc XML attribute. 2.8.3.3 Remove XML element Name: http://www.ietf.org/standards/dav/remove Purpose: To removeDistributed Authoring and Versioning Protocol for theDAVWorld Wide Web" [Slein et al., 1997]. The sections below provide a detailed introduction to resource propertiesspecified inside(Section 3), collections of resources (Section 4), and locking operations (Section 5). These sections introduce theRemove XML element. Schema: http://www.ietf.org/standards/dav/ Parent: http://www.ietf.org/standards/dav/PropertyUpdate Values= Prop Description:Remove specifies thatabstractions manipulated by theproperties specifiedWebDAV-specific HTTP methods described in Section 8, "HTTP Methods for Distributed Authoring". In HTTP/1.1, method parameter information was exclusively encoded in HTTP headers. Unlike HTTP/1.1, WebDAV, encodes method parameter information either inProp should be removed. Specifying the removal of a property that does not exist is notanerror. AllExtensible Markup Language (XML) [Bray, Sperberg-McQueen, 1997] request entity body, or in an HTTP header. The use of XML to encode method parameters was motivated by the ability to add extra XML elements to existing structures, providing extensibility, and by XML's ability to encode information inProp MUST be empty, as only the namesISO 10646 character sets, providing internationalization support. As a rule ofproperties to be removedthumb, parameters arerequired. 2.8.3.4 Response The response MUSTencoded in XML entity bodies when they havea response body that contains a multiresponse identifying the results for each property. 2.8.3.5 Response Codes 200 OK - The command succeeded. As there canunbounded length, or when they may be shown to amixture of Createhuman user andRemoveshence require encoding ina 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 semanticsan ISO 10646 character set. Otherwise, parameters arenot appropriate forencoded within an HTTP header. Section 9 describes theproperty. This includes tryingnew HTTP headers used with WebDAV methods. INTERNET-DRAFT WebDAV November 19, 1997 In addition toset read only properties. 413 Request Entity Too Long - If a particular propertyencoding method parameters, XML istoo longused in WebDAV tobe recorded then a composite XML error will be returned indicatingencode theoffending property. 417 Insufficient Space on Resource - The resource does not have sufficient space to recordresponses from methods, providing thestateextensibility and internationalization advantages of XML for method output, as well as input. XML elements used in this specification are defined in Section 12. While theresource afterresponse codes provided by HTTP/1.1 are sufficient to describe theexecutionpreponderance ofthis method. 418 Atomicity Failure - The command waserror conditions encountered by WebDAV methods, there are some errors that do notexecuted because of an atomicity failure elsewherefall neatly into thecausedexisting categories. New status codes developed for theentire commandWebDAV methods are defined in Section 10. Since some WebDAV methods may operate over many resources, the multiresponse status type has been introduced tobe aborted. 2.8.3.6 Example PROPPATCH /bar.html HTTP/1.1 Host: www.foo.com Content-Type: text/xml Content-Length: xxxx <?XML:Namespace href = "http://www.ietf.org/standards/dav/" AS = "D"/> <?XML:Namespace href = "http://www.w3.com/standards/z39.50/" AS = "Z"/> <D:PropertyUpdate> <Create> <prop> <Z:authors> <Z:Author>Jim Whitehead</Z:Author> <Z:Author>Roy Fielding</Z:Author> </Z:authors> </Prop> </Create> <Remove> <prop><Z:Copyright-Owner/></prop> </Remove> </D:PropertyUpdate> HTTP/1.1 405 Conflict Content-Type: text/xml Content-Length: xxxxx <?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> 2.8.4 PUT A PUTreturn status information for multiple resources. Multiresponse status isspecifieddescribed inorder to control whatSection 11. The properties mechanism isreturnedemployed by WebDAV to store information about the current state of the resource. For example, when aGET. However a GETlock is taken out on aproperty always returnsresource, apredefinedlock information propertycontainment format. Therefore PUT can not bedescribes the current state of the lock. Section 13 defines the properties usedifwithin theRequest- URI refersWebDAV specification. Finishing off the specification are sections on what it means toa property. 2.8.5 PROPFIND The PROPFIND method retrieves properties definedbe compliant with this specification (Section 14), onRequest-URI.internationalization support (Section 15), and on security (Section 16). 3. Data Model for Resource Properties 3.1. Therequest message body is an XML documentResource Property Model Properties are pieces of data thatMUST contain only one PropFind XML element, which specifiesdescribe the state of a resource. Properties are data about data. Properties are used in distributed authoring environments to provide for efficient discovery and management of resources. For example, a 'subject' property might allow for the indexing of all resources by their subject, and an 'author' property might allow for thetypediscovery of what authors have written which documents. The DAV propertyfind action to be performed.model consists of name/value pairs. TheXML element contained by PropFind specifies the typename ofaction to be performed: retrieve alla propertynamesidentifies the property's syntax andvalues (AllProp), retrieve only specified property namessemantics, andvalues (Prop), or retrieve only a listprovides an address by which to refer to that syntax and semantics. There are two categories ofallproperties: "live" and "non-live". A live propertynames (Propname). When a Prop XML element is present, it specifies a list ofhas its syntax and semantics enforced by thenamesserver. This represents the two cases ofproperties whose name anda) the valueare to be returned. The Prop element, when used withinof aFINDPROP request body MUST be empty. The responseproperty isa text/xml message body that contains a MultiResponse XML element which describesread- only, maintained by theresultsserver, and b) the value of theattempts to retrieveproperty is maintained by thevarious properties. If aclient, but server performs syntax checking on submitted values. A non-live propertywas successfully retrieved thenhas its syntax and semantics enforced by the client; the server merely records the valueMUST be returnedof the property verbatim. INTERNET-DRAFT WebDAV November 19, 1997 3.2. Existing Metadata Proposals Properties have long played an essential role in thepropmaintenance of large document repositories, and many current proposals contain some notion of a property, or discuss web metadata more generally. These include PICS [Miller et al., 1996], PICS-NG, the Rel/Rev draft [Maloney, 1996], Web Collections, XMLelement. In[Bray, Sperberg-McQueen, 1997], several proposals on representing relationships within HTML, digital signature manifests (DCMF), and a position paper on Web metadata architecture [Berners-Lee, 1997]. Work on PICS-NG and Web Collections has been subsumed by thecaseResource Definition Framework (RDF) metadata activity ofAllprop and Findprop, if a principal does not havetheright to know ifWorld Wide Web Consortium, which consists of aparticular property exists,network-based data model and anerror MUST NOT be returned. The results of this method SHOULD NOT be cached. 2.8.5.1 PropfindXMLelement Name: http://www.ietf.org/standards/dav/Propfind Purpose: To specifyrepresentation of that model. Some proposals come from a digital library perspective. These include the Dublin Core [Weibel et al., 1995] metadata setof matching properties Schema: http://www.ietf.org/standards/dav/ Parent: Any Values= (Prop | Allprop | Propname) Description: Propfind isand the Warwick Framework [Lagoze, 1996], a containerelementarchitecture forthe exact specificationdifferent metadata schemas. The literature includes many examples of metadata, including MARC [MARC, 1994], aPROPFIND request. 2.8.5.2 Allprop 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/ Parent: Propfind Description: Its presence inbibliographic metadata format, and RFC 1807 [Lasher, Cohen, 1995], aPROPFIND request specifiestechnical report bibliographic format employed by thename and valueDienst system. Additionally, the proceedings from the first IEEE Metadata conference describe many community-specific metadata sets. Participants ofall properties defined ontheresource MUST1996 Metadata II Workshop in Warwick, UK [Lagoze, 1996], noted that, "new metadata sets will develop as the networked infrastructure matures" and "different communities will propose, design, and bereturned. 2.8.5.3 Propname Name: http://www.ietf.org/standards/dav/Propname Purpose: To specifyresponsible for different types of metadata." These observations can be corroborated by noting thatthe namesmany community-specific sets ofall properties defined onmetadata already exist, and there is significant motivation for theresource aredevelopment of new forms of metadata as many communities increasingly make their data available in digital form, requiring a metadata format tobe returned. Schema: http://www.ietf.org/standards/dav/ Parent: Propfind Description: Its presenceassist data location and cataloging. 3.3. Properties and HTTP Headers Properties already exist, in aPROPFIND request specifies the namelimited sense, in HTTP message headers. However, in distributed authoring environments a relatively large number ofallpropertiesdefined on the resource MUST be returned. 2.8.5.4 PropFindResult XML element Name: http://www.ietf.org/standards/dav/PropFindResult Purpose: To containare needed to describe theresultsstate of aSEARCH request Schema: http://www.ietf.org/standards/dav/ Parent: Any Values: Prop 2.8.5.5 Example 1 - Prop PROPFIND /container/ HTTP/1.1 Host: www.foo.bar Content-Length: xxxx Content-Type: text/xml <?XML:Namespace href = "http://www.ietf.org/standards/dav/" AS = "G"/> <?XML:Namespace href = "http://www.foo.bar/boxschema/" AS = "B"/> <G:PROPFIND> <prop> <B:bigbox> <B:author> <B:DingALing> <B:Random> </prop> </G:PROPFIND> HTTP/1.1 207 Multi-Response Content-Type: text/xml Content-Length: xxxxx <?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 result will returnresource, and setting/returning them allproperties on the container. In this case only two properties were found. Thethrough HTTP headers is inefficient. Thus a mechanism is needed which allows a principaldid not have sufficient access rightstosee the third and fourthidentify a set of propertiesso an error was returned. 2.8.5.6 Example 2 - Allprop PROPFIND /container/ HTTP/1.1 Host: www.foo.bar Content-Length: xxxx Content-Type: text/xml <?XML:Namespace href = "http://www.ietf.org/standards/dav/" AS = "G"/> <G:PROPFIND> <Allprop/> </G:PROPFIND> HTTP/1.1 200 Success Content-Type: text/xml Content-Length: xxxxx <?XML:Namespace href = "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> This particular client only hadin which theright to see two properties, BoxTypeprincipal is interested andAuthor. No errorto then set or retrieve just those properties. 3.4. Property Values The value of a property is expressed as a well-formed XML document. INTERNET-DRAFT WebDAV November 19, 1997 XML has been chosen because it isreturneda flexible, self-describing, structured data format that supports rich schema definitions, and because of its support forthe remaining properties, as the client does not even have sufficient rightsmultiple character sets. XML's self- describing nature allows any property's value toknowbe extended by adding new elements. Older clients will not break because theyexist. If the client didwill still have theright to knowdata specified in the original schema and will ignore elements theyexisted but diddo nothave the rightunderstand. XML's support for multiple character sets allows human-readable properties tosee their value,be encoded and read in a207 multi-responsecharacter set familiar to the user. 3.5. Property Names A property name is a universally unique identifier that is associated with amultiresponse, as used inschema that provides information about theprevious example, would have been returned. 2.8.5.7 Example 3 - Propname PROPFIND /container/ HTTP/1.1 Host: www.foo.bar Content-Length: xxxx Content-Type: text/xml <?XML:Namespace href = "http://www.ietf.org/standards/dav/" AS = "G"/> <G:PROPFIND> <Propname/> </G:PROPFIND> HTTP/1.1 200 Success Content-Type: text/xml Content-Length: xxxxx <?XML:Namespace href = "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"/> <R:author D:Proploc="http://prop.com/Author"/> <R:DingALing/> <R:Random/> </Prop> <Status>HTTP/1.1 200 Success</Status> </S:MultiResponse> In this case only twosyntax and semantics of the property. Because a property's name is universally unique, clients can depend upon consistent behavior for a particular property across multiple resources, so long as that property is "live" on the resources in question. The XML namespace mechanism, which is based on URIs, is used to name propertieshave direct URLs available, whilebecause it provides a mechanism to prevent namespace collisions and for varying degrees of administrative control. The property namespace is flat; that is, no hierarchy of properties is explicitly recognized. Thus, if a property A and a property A/B exist on a resource, there is no recognition of any relationship between theothertwoproperties can onlyproperties. It is expected that a separate specification will eventually bereferenced via PROPFIND and PROPPATCH. 3 A Proposal forproduced which will address issues relating to hierarchical properties. Finally, it is not possible to define the same property twice on a single resource, as this would cause a collision in the resource's property namespace. 4. Collections of Web Resourcesand Name Space Operations 3.1 Observations on the HTTP Object ModelThis section provides a description of a new type of Web resource, the collection, and discusses its interactions with the HTTP URL namespace.This discussionThe purpose of a collection resource is to model collection-like objects (e.g., filesystem directories) within aprerequisite forserver's namespace. All DAV compliant resources MUST support thespecification of methods that operate on collections, given later in this document. 3.1.1HTTP URL namespace model specified herein. 4.1. Collection Resources A collection is a resource whose state consists ofaan unordered list of internal members,aan unordered list of external members, and a INTERNET-DRAFT WebDAV November 19, 1997 set of properties. An internal member resource MUST have a URI that is immediately relative to the base URI of the collection, that is, a relative URI in which "../" is illegal, whichmustMUST begin with "./" and whichMAYSHOULD containonly one othera "/" at the end of theURI.URI if the internal member resource is itself a collection. An external member resource MUST be an absolute URI that is not an internal URI. Any given internal or external URI MUST only belong to the collection once, i.e., it is illegal to have multiple instances ofURIsthe same URI in acollection are illegal.collection. Properties defined on collectionshave no special distinction, andbehave exactly as do properties on non-collection resources.The purpose ofThere is a standing convention that when a collectionresourceis referred tomodel collection-like objects (e.g.,by its name without afilesystem directory) withintrailing slash, the trailing slash is automatically appended. Due to this, aserver's namespace. Once these objects have been modeled with collections,resource MAY accept aclient may perform an INDEX, add and remove external members using ADDREF and DELREF, and perform recursive operations, such asURI without afull hierarchy copy. To support methods which operate on collections,trailing "/" to point to aservercollection. In this case it SHOULDmodel its collection-like objectsreturn a location header in the response pointing to the URL ending withcollection resources.the "/". For example, if aserver which is implemented on top of a filesystem SHOULD treat all filesystem directories exposed byclient performs an INDEX on http://foo.bar/blah (no trailing slash), theserverresource http://foo.bar/blah/ (trailing slash) MAY respond ascollection resources. 3.1.2if the operation were invoked on it, and SHOULD return a location header with http://foo.bar/blah/ in it. 4.2. Creation and Retrieval of Collection Resources This document specifies the MKCOL method to create new collection resources,andrather than using theINDEX method to list their contents.existing HTTP/1.1 PUT or POST method, for the following reasons In HTTP/1.1, the PUT method is defined to store therequest body atrequest body at the location specified by the Request-URI. While a description format for a collection can readily be constructed for use 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 _create a collection_ POST command could be constructed, this is undesirable because it would be difficult to separate access control for collection creation from other uses of POST. This document specifies the INDEX method for listing the contents of a collection, rather than relying on the existing HTTP/1.1 GET method. This is to avoid conflict with the de-facto standard practice of redirecting a GET request on a directory to its index.html resource. INTERNET-DRAFT WebDAV November 19, 1997 The exact definition of the behavior of GET and PUT on collections is defined later in this document. 4.3. HTTP URL Namespace Model The HTTP URL Namespace is a hierarchical namespace where the hierarchy is delimited with the "/" character. DAV compliant resources MUST maintain thelocation specified by Request-URI. Whileconsistency of the HTTP URL namespace. Any attempt to create adescription format forresource (excepting the root member of acollection can readily be constructednamespace) thatcouldwould not beused with PUT,theimplicationsinternal member ofsending suchadescription to the server are undesirable.collection MUST fail. For example, if the collection http://www.foo.bar.org/a/ exists, but http://www.foo.bar.org/a/b/does not exist, an attempt to create http://www.foo.bar.org/a/b/c must fail. 4.4. Source Resources and Output Resources For many resources, the entity returned by adescriptionGET method exactly matches the persistent state of the resource, for example, acollection that omitted some existing resources were PUT toGIF file stored on aserver,disk. For thismight be interpreted assimple case, the URL at which acommand to remove those members. This would extend PUTresource is accessed is identical toperform DELETE functionality,the URL at whichis undesirable since it changesthesemanticssource (the persistent state) ofPUT, and makes it difficult to control DELETE functionality with an access control scheme based on methods. WhilethePOST methodresource issufficiently open-endedaccessed. This is also the case for HTML source files that are not processed by the server prior to transmission. However, the server can sometimes process HTML resources before they are transmitted as a"createreturn entity body. For example, server-side- include directives within an HTML file instruct acollection" POST command could be constructed,server to replace the directive with another value, such as the current date. In this case, what isundesirable because it would be difficult to separate access control for collection creationreturned by GET (HTML plus date) differs fromother usesthe persistent state ofPOST if they both usethesame method. While it might seem desirableresource (HTML plus directive). Typically there is no way tohaveaccess the HTML resource containing the unprocessed directive. Sometimes the entity returned by GETreturn a listing ofis themembersoutput of acollection, thisdata- producing process that isfoileddescribed by one or more source resources (that may not even have a location in theexistenceURL namespace). A single data-producing process may dynamically generate the state of a potentially large number of output resources. An example of this is a CGI script that describes a "finger" gateway process that maps part of the"index.html" de-facto standardnamespaceredirection, in which a GET request onof acollectionserver into finger requests, such as http://www.foo.bar.org/finger_gateway/user@host. In the absence of distributed authoring capabilities, it isautomatically redirectedacceptable tothe index.html resource. The exact definitionhave no mapping of source resource(s) to thebehaviorURI namespace. In fact, preventing access to the source resource(s) has desirable security benefits. However, if remote editing ofGET and PUT on collections is defined later in this document. 3.1.2.1 Example The structured resource http://foo/bar is created with a PUT. Barthe source resource(s) isa multipart/related file with two members http://foo/bar/a and http://foo/bar/b. If bar were deleted then both a and b would alsodesired, the source resource(s) should bedeleted since they are all really just one resource. If http://foo/bar/a/c was PUT then a DELETE on http://foo/bar/a would also delete http://foo/bar/a/c as c was created withgiven aPUTlocation in the URI namespace. This source location should nota MKCOL. If http://foo/bar/b/dbe 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 INTERNET-DRAFT WebDAV November 19, 1997 process output resources. There iscreated withoften aMKCOLmany-to-many relationship between source resources andhttp://foo/bar/b/d/e was created thenoutput resources. On WebDAV compliant servers, for all output resources which have aDELETE on d would fail because d issingle source resource (and that source resource has acollection with an internal member. HoweverURI), theexistenceURI of thecollection d is something of an illusion. Ifsource resource SHOULD be stored in aDELETE was executedlink onhttp://foo/bar then everything would be deleted, even though http://foo/bar/b/d was createdthe output resource witha MKCOL. Thustype http://www.ietf.org/standards/dav/source. Note that by storing theeffectsource URIs in links on the output resources, the burden ofa MKCOL within a composite resource’s namespacediscovering the source isfeltplaced onits children, not its ancestors.the authoring client. 5. Locking Thechildren of d MUST be treated as members ofability to lock acollection whenresource provides amethod is executed on d. Butmechanism for serializing access to that resource. Using amethod executed on b orlock, an authoring client can provide a reasonable guarantee that another principal will not modify a resource while it istreated as if there only existedbeing edited. In this way, anon-collection resource. 3.1.3 Source Resources and Output Resources For many resources,client can prevent theentity returned by GET exactly matches"lost update" problem. This specification allows locks to vary over two client-specified parameters, thepersistent statenumber of principals involved (exclusive vs. shared) and theresource, for example, a GIF file stored on a disk. Fortype of access to be granted. Furthermore, thissimple case,document only provides theURL at which a resource is accessed is identical todefinition of locking for one lock access type, the write lock. However, theURL at whichsyntax is extensible, and permits thesource (the persistent state)eventual specification ofthe resourceother access types. 5.1. Exclusive Vs. Shared Locks The most basic form of lock isaccessed.an exclusive lock. This isalsoa lock where thecaseaccess right in question is only granted to a single principal. The need forHTML source files that are not processed by the server priorthis arbitration results from a desire totransmission.avoid having to constantly merge results. However,the server can sometimes process HTML resources before theythere aretransmitted astimes when the goal of areturn entity body. For example, server-side-include directives withinlock is not to exclude others from exercising anHTML file instructaccess right but rather to provide aservermechanism for principals toreplace the directive with another value, such as the current date. Inindicate that they intend to exercise their access right. Shared locks are provided for thiscase, what is returned by GET (HTML plus date) differs from the persistent state ofcase. A shared lock allows multiple principals to receive a lock. Hence any principal with appropriate access can get theresource (HTML plus directive). Typicallylock. With shared locks there are two trust sets that affect a resource. The first trust set isno waycreated by access permissions. Principals who are trusted, for example, may have permission to write the resource. Those who are not, don't. Among those who have access permission to write theHTML resource containingresource, the set of principals who have taken out a shared lock also must trust each other, creating a (typically) smaller trust set within theunprocessed directive. Sometimesaccess permission write set. Starting with every possible principal on theentity returned by GET isInternet, in most situations theoutputvast majority ofa data- producing process that is described by one or more source resources (that maythese principals will notevenhave write INTERNET-DRAFT WebDAV November 19, 1997 access to alocation in the URL namespace). A single data-producing process may dynamically generategiven resource. Of thestate of a potentially largesmall number who do have write access, some principals may decide to guarantee their edits are free from overwrite conflicts by using exclusive write locks. Others may decide they trust their collaborators will not overwrite their work (the potential set ofoutput resources. An examplecollaborators being the set ofthis isprincipals who have write permission) and use aCGI scriptshared lock, which informs their collaborators thatdescribesa"finger" gateway process that maps partprincipal is potentially working on the resource. The WebDAV extensions to HTTP do not need to provide all of thenamespacecommunications paths necessary for principals to coordinate their activities. When using shared locks, principals may use any out ofa server into finger requests, such as http://www.foo.bar.org/finger_gateway/user@host. Inband communication channel to coordinate their work (e.g., face-to- face interaction, written notes, post-it notes on theabsencescreen, telephone conversation, Email, etc.) The intent ofdistributed authoring capability, ita shared lock isacceptabletohave no mapping of source resource(s)let collaborators know who else is potentially working on a resource. Shared locks are included because experience from web distributed authoring systems has indicated that exclusive write locks are often too rigid. An exclusive write lock is used tothe URI namespace, and in fact has desirable security benefits. However, if remoteenforce a particular editingofprocess: take out exclusive write lock, read thesource resource(s) is desired,resource, perform edits, write thesource resource(s) should be given a location inresource, release theURI namespace.lock. Thissource location should not be one of the locations at which the generated output is retrievable, since in general it is impossible forediting process has theserver to differentiate requests for source resources from requestsproblem that locks are not always properly released, forprocess output resources. There is oftenexample when amany-to-many relationship between source resources and output resources. For DAV compliant servers all output resources which haveprogram crashes, or when asingle source resource (and that source resource haslock owner leaves without unlocking aURI),resource. While both timeouts and administrative action can be used to remove an offending lock, neither mechanism may be available when needed; theURI oftimeout may be long or thesource resource SHOULDadministrator may not bestored inavailable. Despite their potential problems, exclusive write locks are extremely useful, since often asingle link on the output resource with type http://www.ietf.org/standards/dav/source. Note that by storing the source URI in links on the output resources, the burdenguarantee ofdiscovering the sourcefreedom from overwrite conflicts isplaced on the authoring client. 3.2 MKCOL Method 3.2.1 Problem Description A client must be able to create a collection. 3.2.2 Solution Requirements The solution must ensure that a collection has been made (i.e. that it responds towhat is needed. This specification provides both exclusive write locks and theINDEX method) as opposedless strict mechanism of shared locks. 5.2. Required Support A WebDAV compliant server is not required toa non- collection resource.support locking in any form. Ifa collection could not be made,the server does support locking itmust indicateMAY choose to support any combination of exclusive and shared locks for any access types. The reason for thisfailureflexibility is that locking policy strikes to theuser-agent. 3.2.3 Request MKCOL creates a new collection resource atvery heart of thelocation specifiedresource management and versioning systems employed bythe Request-URI. If the Request-URI exists, then MKCOL must fail. During MKCOL processing, a server MUST make the Request-URI a membervarious storage repositories. These repositories require control over what sort ofits parent collection. Iflocking will be made available. For example, some repositories only support shared write locks while others only provide support for exclusive write locks while yet others use nosuch an ancestor exists, the method MUST fail. Whenlocking at all. As each system is sufficiently different to merit exclusion of certain locking features, this specification leaves locking as theMKCOL operation createssole axis of negotiation within WebDAV. INTERNET-DRAFT WebDAV November 19, 1997 5.3. Lock Tokens A lock token is anew collection resource, all ancestors MUST already exist, or the method MUST fail withURI that identifies a409 Conflict status code. For example, ifparticular lock. A lock token is returned by every successful LOCK operation in the lock- token response header, and can also be discovered through lock discovery on arequestresource. Lock token URIs are required tocreate collection /a/b/c/d/ is made,be unique across all resources for all time. This uniqueness constraint allows lock tokens to be submitted across resources andneither /a/b/ nor /a/b/c/ exist, the request MUST fail. 3.2.3.1 MKCOL Without Request Body When MKCOL is invokedservers withouta request body, the newly created collection has no members. 3.2.3.2 MKCOL With Request Body A MKCOL request message MAY contain a message body. The behaviorfear of confusion. This specification provides aMKCOL request whenlock token URI scheme called opaquelocktoken that meets thebody is present is limiteduniqueness requirements. However resources are free tocreating collections, members of a collection, bodies of members and properties on the collections or members. If the server receives a MKCOL request entity type it does not support or understandreturn any URI scheme so long as itMUST respond with a 415 (Unsupported Media Type) status code.meets the uniqueness requirements. 5.4. opaquelocktoken Lock Token URI Scheme Theexact behavior of MKCOL for various request media typesopaquelocktoken URI scheme isundefined in this document, and willdesigned to bespecifiedunique across all resources for all time. Due to this uniqueness quality, a client MAY submit an opaque lock token inseparate documents. 3.2.4 Response Responses fromaMKCOLLock-Token requestare not cacheable, since MKCOL has non-idempotent semantics. 201 (Created) - The collection or structuredheader and an if-state[-not]-match header on a resourcewas created in its entirety. 403 (Forbidden) - This indicates at leastother than the oneof two conditions: 1) The server doesthat returned it. All resources MUST recognize the opaquelocktoken scheme and, at minimum, recognize that the lock token was notallowgenerated by the resource. Note, however, that resources are not required to generate opaquelocktokens in LOCK method responses. In order to guarantee uniqueness across all resources for all time thecreationopaquelocktoken requires the use ofcollections atthegiven location in its namespace, and 2) The parent collectionGUID mechanism. Opaquelocktoken generators, however, have a choice of how they create these tokens. They can either generate a new GUID for every lock token they create, which is potentially very expensive, or they can create a single GUID and then add extension characters. If theRequest-URI exists but cannot accept members. 409 (Conflict) - A collection cannotsecond method is selected then the program generating the extensions MUST guarantee that the same extension will never bemade atused twice with theRequest-URI until one or more intermediate collections have been created. 415 (Unsupported Media Type)- Theassociated GUID. Opaque-Lock-Token = "opaquelocktoken" ":" GUID [Extension] GUID = ; As defined in [Leach, Salz, 1997] Extension = *urlc ;urlc is defined in [Berners-Lee et al., 1997] (draft-fielding-url-syntax-07.txt) 5.5. Lock Capability Discovery Since serverdoes notlock supportthe request type of the body. 417 (Insufficient Space on Resource) - The resource does not have sufficient spaceis optional, a client trying torecord the state of thelock a resourceafteron a server can either try theexecutionlock and hope for the best, or perform some form ofthis method. 3.2.5 Example This example creates a container collection called /webdisc/xfiles/ ondiscovery to determine what lock capabilities the serverwww.server.org. MKCOL /webdisc/xfiles/ HTTP/1.1 Host: www.server.org HTTP/1.1 201 Created 3.3 Standard DAV Properties The following properties are defined onsupports. This is known as lock capability discovery. Lock capability discovery differs from discovery of INTERNET-DRAFT WebDAV November 19, 1997 supported access control types, since there may be access control types without corresponding lock types. A client can determine what lock types the server supports by retrieving the supportedlock property. Any DAV compliantresources. All enclosed properties are part ofresource that supports theDAV Schema. 3.3.1 IsCollection Property Name: http://www.ietf.org/standards/dav/iscollection Purpose: This property containsLOCK method MUST support the supportedlock property. 5.6. Active Lock Discovery If another principal locks aBoolean valueresource that a principal wishes to access, it issetuseful for the second principal to"true" ifbe able to find out who theresourcefirst principal is. For this purpose the lockdiscovery property isa collection Schema: http://www.ietf.org/standards/dav/ Value: ("true" | "false") Description:provided. This propertyMUST be defined onlists all outstanding locks, describes their type, and provides their lock token. Any DAV compliantresources. 3.3.2 DisplayName Property Name: http://www.ietf.org/standards/dav/displayname Purpose: A name for theresource thatis suitable for presentation to a user. Schema: http://www.ietf.org/standards/dav/ Value: Any valid XML character data (as defined in [Bray, Sperberg-McQueen, 1997]) Description:supports the LOCK method MUST support the lockdiscovery property. 6. Write Lock Thisproperty SHOULD be defined on all DAV compliant resources. If present,section describes theproperty contains a description ofsemantics specific to theresource that is suitablewrite access type forpresentation to a user. 3.3.3 CreationDate Property Name: http://www.ietf.org/standards/dav/creationdate Purpose:locks. Thetimewrite lock is a specific instance of a lock type, anddateis theresource was created. Schema: http://www.ietf.org/standards/dav/ Value: The time and date MUST be givenonly lock type described inISO 8601 format [ISO8601] Description: This property SHOULD be defined on allthis specification. A DAV compliantresources. If present, it contains a timestamp of the moment when theresourcewas created (i.e., the moment it had non-null state). 3.3.4 GETentity Property Name: http://www.ietf.org/standards/dav/GETentity Purpose: ContainsMAY support thevalue of headers that are returnedwrite lock. 6.1. Methods Restricted by Write Locks A write lock prevents aGETprincipal withoutAccept headers. Schema: http://www.ietf.org/standards/dav/ Value: Content-Type Content-Length Content-Language Last- Modified Etag Creation-Date Description: This property MUST be definedthe lock from successfully executing a PUT, POST, PATCH, PROPPATCH, MOVE, DELETE, MKCOL, ADDREF or DELREF onall DAV compliant resources unlessthe locked resource. All other current methods, GETis not supported,inwhich case this property MUST NOT be defined. This property MUST contain at most one instanceparticular, function independent ofeach element in its Value, if they are defined. 3.3.5 INDEXentity Property Name: http://www.ietf.org/standards/dav/INDEXentity Purpose: Containsthevalue of headerslock. Note, however, that as new methods arereturned by an INDEX. Schema: http://www.ietf.org/standards/dav/ Value: Content-Type Content-Length Content-Language Last- Modified Etag Creation-Date Description: This property MUSTcreated it will bedefined on all DAV compliant resources unless INDEX isnecessary to specify how they interact with a write lock. 6.2. Write Locks and Properties While those without a write lock may notsupported, in which case this property MUST NOT be defined. Thisalter a propertyMUST contain at most one instance of each element in its Value, if they are defined. 3.3.6 Content-Type XML Element Name: http://www.ietf.org/standards/dav/content-type Purpose: The content-type ofon a resource it is still possible for themember resource. Schema: http://www.ietf.org/standards/dav/ Parent: GETentity or INDEXentity Value: media-type ; defined in Section 3.7values of[Fielding et al., 1997] Description: Iflive properties to change, even while locked, due to theparentrequirements ofthis elementtheir schemas. Only dead properties and live properties defined to respect locks are guaranteed not to change while write locked. 6.3. Write Locks and Null Resources It isGETentity, the value MUST be identicalpossible to assert a write lock on a null resource in order to lock thecontent-type returned byname. Please note, however, that locking aGET on thenull resourcewithout Accept headers. If the parent is INDEXentity,effectively makes thevalue MUST be identical toresource non-null, as thecontent-type returned by an INDEXresource now has lock related properties defined on it. INTERNET-DRAFT WebDAV November 19, 1997 6.4. Write Locks and Collections A write lock on a collection prevents theresource. If no content-type is available, this element MUST NOT be defined. 3.3.7 Content-Length XML Element Name: http://www.ietf.org/standards/dav/content-length Purpose: Describes the default content-lengthaddition or removal ofthe resource. Schema: http://www.ietf.org/standards/dav/ Value: content-length ; see section 14.14members ofRFC 2068 Description: Iftheparentcollection. As a consequence, when a principal issues a request to create a new internal member ofthis element is GETentity, this element MUST haveavalue equalcollection using PUT or POST, or to remove an existing internal member of a collection using DELETE, this request MUST fail if thecontent-length header returned byprincipal does not have aGETwrite lock on theresource without Accept headers. If the parentcollection. However, if a write lock request isINDEXentity, the value MUST be identicalissued to a collection containing internal member resources that are currently locked in a manner which conflicts with thecontent-length returned by an INDEX onwrite lock, theresource. If no content-length is available, this elementrequest MUSTNOT be defined. 3.3.8 Content-Language XML Element Name: http://www.ietf.org/standards/dav/content-language Purpose: Describes the default natural language offail with aresource. Schema: http://www.ietf.org/standards/dav/ Value: language-tag ;language-tag is defined in section 14.13 of RFC 2068 Description: If the parent409 Conflict status code. 6.5. Write Locks and COPY/MOVE The owner ofthis element is GETentity, this element MUST haveavalue equal to the content-language header returned bywrite lock MUST NOT execute aGETMOVE method onthea resourcewithout Accept headers. If the parenthe has locked. This specification intentionally does not define what happens if a MOVE method request isINDEXentity, the value MUST be identical to the content-language header returned by an INDEXmade on a locked resource by theresource. If no content-language header is available, this elementlock's owner. A COPY method invocation MUST NOTbe defined. 3.3.9 Last-Modified XML Element Name: http://www.ietf.org/standards/dav/last-modified Purpose: The date the resource was last modified. Schema: http://www.ietf.org/standards/dav/ Parent: GETentity or INDEXentity Value: The date MUST be given in RFC 1123 format usingduplicate any write locks active on therfc-1123 production, defined in section 3.3.1 of [Fielding et al., 1997]. Description:source. 6.6. Re-issuing Write Locks Ifthe parent of this element is GETentity, this element MUST haveavalue equal to the last-modified header returned byprincipal already owns aGETwrite lock on a resource, any future requests for the same type of write lock, on theresource without Accept headers. Ifsame resource, while theparentprincipal's previous write lock isINDEXentity, the valuein effect, MUSTbe identical toresult in a successful response with thelast- modified header returned by an INDEX onsame lock token as provided for theresource. If no last-modified header is available, this element MUST NOTcurrently existing lock. Two lock requests are defined to bedefined. 3.3.10 Etag XML Element Name: http://www.ietf.org/standards/dav/etag Purpose:identical if their Lock-Info headers are identical. 6.7. Write Locks and Theentity tag of the resource. Schema: http://www.ietf.org/standards/dav/ Parent: GETentity or INDEXentity Value: entity-tag ; defined in Section 3.11 of [Fielding et al., 1997] Description:Lock-Token Request Header Ifthe parent of this elementa user agent isGETentity, this element MUSTnot required to have knowledge about a lock when requesting an operation on avalue equal tolocked resource, theentity-tag header returnedfollowing scenario might occur. Program A, run by User A, takes out aGETwrite lock on a resource. Program B, also run by User A, has no knowledge of theresource without Accept headers. Iflock taken out by Program A, yet performs a PUT to theparentlocked resource. In this scenario, the PUT succeeds because locks are associated with a principal, not a program, and thus program B, because it is acting with principal A's credential, isINDEXentity,allowed to perform thevalue MUST be identicalPUT. However, had program B known about the lock, it would not have overwritten the resource, preferring instead to present a dialog box describing theentity-tag header returned by an INDEX onconflict to theresource. If no entity-tag header is available,user. Due to thiselement MUST NOT be defined. 3.4 INDEX Method 3.4.1 Problem Description Ascenario, a mechanism is needed todiscover if a resourceprevent different programs from accidentally ignoring locks taken out by other programs with the same authorization. INTERNET-DRAFT WebDAV November 19, 1997 In order to prevent these collisions the lock token request header isa collectionintroduced. Please refer to the Lock Token Request Header section for details andif so, list its members. 3.4.2 Solution Requirements The solution: -requirements. 6.7.1. Write Lock Token Example COPY /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html Lock-Token: <opaquelocktoken:123AbcEfg1284h23h2> <opaquelocktoken:AAAASDFcalkjfdas12312> HTTP/1.1 200 OK In this example, both the source and destination are locked so two lock tokens mustallowbe submitted. If only one of the two resources was locked, then only one token would have to be submitted. 7. Notational Conventions Since this document describes aclientset of extensions to the HTTP/1.1 protocol, the augmented BNF used herein todiscoverdescribe protocol elements is exactly themembers of a collection - must always provide a machine-readable descriptionsame as described in Section 2.1 of RFC 2068, _Hypertext Transfer Protocol -- HTTP/1.1_ [Fielding et al., 1997]. Since this augmented BNF uses themembershipbasic production rules provided in Section 2.2 ofa collection - must be leveragedRFC 2068, these rules apply to this document asa more general mechanismwell. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are toprovide a list of contentsbe interpreted as described in RFC 2119 [Bradner, 1997]. 8. HTTP Methods forany resource which can profitably return a membership like listing. 3.4.3 The RequestDistributed Authoring 8.1. PROPFIND TheINDEXPROPFIND methodreturnsretrieves properties defined on the Request-URI, if it is amachine-readable representation ofnon-collection resource, or on themembership ofRequest-URI and potentially its member resources, if the resourceat the Request-URI. For a collection, INDEX MUST returnis alist of its members.collection. AllWebDAVDAV compliant resources MUST support thetext/xml response entity described below. The INDEX result forPROPFIND method. A client MAY submit a Depth header with a PROPFIND on a collectionMAY also returnwith alistvalue of "0", "1" or "infinity". DAV compliant servers MUST support themembers of child collections, to any depth. Collections that respond to an INDEX"0", "1" and "infinity" behaviors. By default, the PROPFIND methodwithon atext/xml entitycollection without a Depth header MUSTcontain only one ResInfo element. This ResInfo element contains an Href element, which gives the identifier(s) of the resource,act as if a Depth = infinity header was included. INTERNET-DRAFT WebDAV November 19, 1997 A client MUST submit a Propfind request header describing what information is being requested. It is possible to request particular property values, all property values, or aProp element, which gives selected propertieslist of theresource, and a Members element, which contains a ResInfo element for each membernames of thecollection. The Prop element MUST contain at least the following properties, if they are defined and available: DisplayName, IsCollection, CreationDate, GETentity, and INDEXentity.resource's properties. The responsefrom INDEXiscacheable, and SHOULD be accompanied by an ETag header (see section 13.3.4 of RFC 2068). If GET and INDEX return different entities for the same resource state, they MUST return different entity tags. 3.4.4 The Response 200 (OK) - The server MUST sendamachine readable response entity whichtext/xml message body that contains a multistatus XML element that describes themembershipresults of theresource. 3.4.5 ResInfo XML Element Name: http://www.ietf.org/standards/dav/resinfo Purpose: Describesattempts to retrieve the various properties. If aresource. Schema: http://www.ietf.org/standards/dav/ Parent: Any Value: Href Prop Members Description: Thereproperty was successfully retrieved then its value MUST beat least one Href element. Each Href element containsreturned in aURI forprop XML element. If the scope of PROPFIND covers more than a single resource,whichas is the case with Depth values of "1" and "infinity", each response XML element MUSTbecontain anabsolute URI. There MUST be a single Prophref XML elementthat contains a series of properties defined on the resource. Ifwhich identifies the resourceis a collection, it MAY have at most one Members element,on whichdescribesthemembers ofproperties in thecollection. 3.4.6 Membersprop XMLElement Name: http://www.ietf.org/standards/dav/members Purpose: Describeselement are defined. In themembershipcase of allprop and propname, if acollection resource. Schema: http://www.ietf.org/standards/dav/ Parent: ResInfo Value: ResInfo Description: Contains zero or more ResInfo elements, which describe members of the collection. 3.4.7 Href XML Element Name: http://www.ietf.org/standards/dav/href Purpose: To identify that the content ofprincipal does not have theelement is a URI. Schema: http://www.ietf.org/standards/dav/ Parent: Any Value: URI ; See section 3.2.1right to know if a particular property exists, an error MUST NOT be returned. The results of[Fielding et al., 1997] 3.4.8 Example INDEX /user/yarong/dav_drafts/this method SHOULD NOT be cached. 8.1.1. Example: Retrieving Named Properties PROPFIND /files/ HTTP/1.1 Host:www.microsoft.comwww.foo.bar Depth: 0 Propfind: <http://www.foo.bar/boxschema/bigbox> <http://www.foo.bar/ boxschema/author> <http://www.foo.bar/boxschema/DingALing> <http://w ww.foo.bar/boxschema/Random> HTTP/1.1200 OK207 Multi-Status Content-Type: text/xml Content-Length:xxx Last-Modified: Thu, 11 Sep 1997 23:45:12 GMT ETag: "fooyyybar" <?XML:Namespacexxxxx <?XML version="1.0"> <?namespace href ="http://www.ietf.org/standards/dav/" AS ="http://www.ietf.org/standards/dav/" as"D"?> <?namespace href ="D"/> <D:ResInfo> <XML:Href> http://www.microsoft.com/user/yarong/dav_drafts/ </XML:Href> <Prop> <DisplayName> WebDAV working drafts directory </DisplayName> <IsCollection>true</IsCollection> <CreationDate>19970418T070304Z</CreationDate> <GETentity> <Content-Type>text/html</Content-Type> <Content-Length>2754</Content-Length> <Content-Language>en</Content-Language> <Last-Modified> Fri, 22 Aug 1997 10:11:26 GMT </Last-Modified> <Etag>"8675309"</Etag> </GETentity> <INDEXentity> <Content-Type>text/xml</Content-Type> <Content-Length>xxx</Content-Length> <Last-Modified> Thu, 11 Sep 1997 23:45:12 GMT </Last-Modified> <Etag>"fooyyybar"</Etag> </INDEXentity> </Prop> <Members> <ResInfo> <XML:Href> http://www.microsoft.com/user/yarong/dav_drafts/base </XML:Href> <Prop> <IsCollection D:PropLoc="http://www.microsoft.com/user/yarong/dav_drafts/b ase;props=IsCollection"> False </IsCollection> <DisplayName>"http://www.foo.bar/boxschema" AS = R"?> <D:multistatus> <D:response> <D:prop> <R:bigbox> <R:BoxType>Box type A</R:BoxType> </R:bigbox> <R:author> <R:Name>J.J. Dingleheimerschmidt</R:Name> </R:author> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:response> <D:response> <D:prop><R:DingALing/><R:Random/></D:prop> <D:status>HTTP/1.1 403 Forbidden</D:status> <D:responsedescription> The user does not have access to the DingALing property. </D:responsedescription> </D:response> INTERNET-DRAFT WebDAVName Space Operations Draft </DisplayName> <Creation-Date>19970320T230525Z</Creation-Date> <GETentity> <Content-Type>application/msword</Content-Type> <Content-Length>1400</Content-Length> <Content-Language>en</Content-Language> <Last-Modified> Fri, 22 AugNovember 19, 199718:22:56 GMT </Last-Modified> <Etag>"8675309"</Etag> </GETentity> </Prop> </ResInfo> </Members> </D:ResInfo> This example shows<D:responsedescription> There has been an access violation error. </D:responsedescription> </D:multistatus> In this example, PROPFIND is executed on theresult ofcollection http://www.foo.bar/files/. The specified depth is zero, hence theINDEX method appliedPROPFIND applies only to the collectionresource http://www.microsoft.com/user/yarong/dav_drafts/. It returns a response body in XML format, which gives information about the containeritself, and not to any of itssole member, http://www.microsoft.com/user/yarong/dav_drafts/base. The entry on the collection confirms that the resource the INDEX was executed on is a collection.members. Theresult also contains the URI of the IsCollection property onPropfind header specifies themember resource. 3.5 Behaviorname ofRFC 2068 Methods on Collections Withfour properties whose values are being requested. In this case only two properties were returned, since theintroduction ofprincipal issuing thecollection resource typerequest did not have sufficient access rights to see theHTTP object model, it is necessarythird and fourth properties. 8.1.2. Example: Using allprop todefine the behavior of the existing methods (defined in RFC 2068) whenRetrieve All Properties PROPFIND /container/ HTTP/1.1 Host: www.foo.bar Depth: 1 Propfind: allprop HTTP/1.1 200 OK Content-Type: text/xml Content-Length: xxxxx <?XML version="1.0"> <?namespace href = "http://www.ietf.org/standards/dav/" As = "S"?> <?namespace href = "http://www.foo.bar/boxschema/" AS = R"?> <S:multistatus> <S:response> <S:href>http://www.foo.bar/container/</S:href> <S:prop> <R:bigbox> <R:BoxType>Box type A</R:BoxType> </R:bigbox> <R:author> <R:Name>Hadrian</R:Name> </R:author> </S:prop> <S:status>HTTP 1.1 200 OK</S:status> </S:response> <S:response> <S:href>http://www.foo.bar/container/index.html</S:href> <S:prop> <R:bigbox> <R:BoxType>Box type B</R:BoxType> </R:bigbox> </S:prop> <S:status>HTTP 1.1 200 OK</S:status> </S:response> </S:multistatus> INTERNET-DRAFT WebDAV November 19, 1997 In this example, PROPFIND was invoked ona collectionthe resourceto avoid ambiguity. While some methods, such as OPTIONS and TRACE behave identically when applied to collections, GET, HEAD, POST, PUT, and DELETE require some additional explanation. 3.5.1 GET, HEAD for Collections The semantics of GET are unchanged when applied tohttp://www.foo.bar/container/ with acollection, since GET is defined as, "retrieve whatever information (in the formDepth header ofan entity) is identified by1, meaning theRequest-URI" [Fielding et al., 1997]. GET when appliedrequest applies toa collection MAY returnthecontents of an "index.html" resource,resource and its children, and ahuman-readable viewPropfind header of "allprop", meaning thecontents ofrequest should return thecollection, or something else altogether,name andhence it is possible the resultvalue ofa GETall properties defined on each resource. The resource http://www.foo.bar/container/ has two properties defined on it, named http://www.foo.bar/boxschema/bigbox, and http://www.foo.bar/boxschema/author, while resource http://www.foo.bar/container/index.html has only acollection will bear no correlation to the state of the collection. Similarly, since the definitionsingle resource defined on it, named http://www.foo.bar/boxschema/bigbox, another instance ofHEAD is a GET without a response message body,thesemantics of HEAD are unmodified when applied"bigbox" property type. 8.1.3. Example: Using propname tocollection resources. 3.5.2 POST for Collections Since by definition the actual function performed by POSTRetrieve all Property Names PROPFIND /container/ HTTP/1.1 Host: www.foo.bar Propfind: propname HTTP/1.1 200 OK Content-Type: text/xml Content-Length: xxxx <?XML version="1.0"> <?namespace href = "http://www.ietf.org/standards/dav/" As = "D"?> <?namespace href = "http://www.foo.bar/boxschema/" AS = "R"?> <D:multistatus> <D:response> <D:href>http://www.foo.bar/container/</D:href> <D:prop> <R:bigbox/> <R:author/> </D:prop> <D:status>HTTP 1.1 200 OK</D:status> </D:response> <D:response> <D:href>http://www.foo.bar/container/index.html</D:href> <D:prop> <R:bigbox/> </D:prop> <D:status>HTTP 1.1 200 OK</D:status> </D:response> </D:multistatus> In this example, PROPFIND isdetermined by the server and often dependsinvoked on theparticular resource, the behavior of POST when appliedcollection resource http://www.foo.bar/container/, with a Propfind header set tocollections cannot"propname", meaning the name of all properties should bemeaningfully modified because itreturned. Since no depth header islargely undefined. Thus the semanticspresent, it assumes its default value ofPOST are unmodified when applied to a collection. 3.5.3 PUT for Collections As defined in"infinity", meaning theHTTP/1.1 specification [Fielding et al., 1997],name of the"PUT method requests thatproperties on theenclosed entitycollection and all its progeny should bestored underreturned. INTERNET-DRAFT WebDAV November 19, 1997 Consistent with thesupplied Request-URI." Since submission of an entity representing a collection would implicitly encode creationprevious example, resource http://www.foo.bar/container/ has two properties defined on it, http://www.foo.bar/boxschema/bigbox, anddeletion of resources, this specification intentionally does not define a transmission format for creatinghttp://www.foo.bar/boxschema/author. The resource http://www.foo.bar/container/index.html, acollection using PUT. Instead,member of theMKCOL method is"container" collection, has only one property defined on it, http://www.foo.bar/boxschema/bigbox. 8.2. PROPPATCH The PROPPATCH method processes instructions specified in the request body tocreate collections. If a PUT is invokedset and/or remove properties defined ona collection resource it MUST fail. WhenthePUT operation creates a new non-collectionresourceall ancestorsidentified by Request-URI. All DAV compliant resources MUSTalready exist. If all ancestors do not exist,support the PROPPATCH method and MUSTfail with a 409 Conflict status code. For example, if resource /a/b/c/d.html is to be createdprocess instructions that are specified using the propertyupdate, set, and/a/b/c/ does not exist, thenremove XML elements of therequestDAV schema. Execution of the directives in this method is, of course, subject to access control constraints. DAV compliant resources MUSTfail. 3.5.3.1 PUT for Non-Collection Resources A PUT performed on an existing resource replacessupport theGET response entitysetting of arbitrary dead properties. The request message body of a PROPPATCH method MUST contain at least one propertyupdate XML element. Instruction processing MUST occur in theresource, butorder instructions are received (i.e., from top to bottom), and MUSTNOT changebe performed atomically. 8.2.1. propertyupdate XML element Name: propertyupdate Namespace: http://www.ietf.org/standards/dav/ Purpose: To contain a request to alter thevalue of any deadpropertiesdefinedonthea resource.LiveParent: None Values= 1*(set | remove) Description: This XML element is a container for the information required to modify the propertiesdefinedon theresource MAY be recomputed during PUT processing. 3.5.4 DELETE for Collections When DELETEresource. This XML element isapplied to a collection without internal membersmulti-valued. 8.2.2. set XML element Name: set Namespace: http://www.ietf.org/standards/dav/ Purpose: To set thecollection resource, along with its properties, and external members, MUST be deleted. A DELETE method applied to a collection resource containing internal member resourcesDAV properties specified inside the set XML element. Parent: propertyupdate Values= prop Description: This XML element MUSTfail withcontain only a409 Conflict status code. 3.5.5 DELETE Method for Non-Collection Resources Ifprop XML element. The elements contained by prop specify theDELETE method is issued to a non-collection resource which is an internal membername and value of properties that are set on the Request-URI. If acollection,property already exists thenduring DELETE processing a server MUSTits value is replaced. INTERNET-DRAFT WebDAV November 19, 1997 8.2.3. remove XML element Name: remove Namespace: http://www.ietf.org/standards/dav/ Purpose: To remove theRequest-URI from its parent collection. A server MAYDAV properties specified inside the remove XML element. Parent: propertyupdate Values= prop Description: Remove specifies that theURIproperties specified in prop should be removed. Specifying the removal of adeleted resource from any collections of which the resourceproperty that does not exist is not anexternal member. 3.6 COPY Method 3.6.1 Problem Description Currently,error. All the elements inorderprop MUST be empty, as only the names of properties tocreatebe removed are required. 8.2.4. Response Codes 200 OK - The command succeeded. As there can be acopymixture of sets and removes in aresource,body, a 201 Create seems inappropriate. 403 Forbidden - The client, for reasons theclient must GET an entity and then PUT that entityserver chooses not to specify, cannot alter one of thedesired destination.properties. 405 Conflict - The client has provided a value whose semantics are not appropriate for the property. Thisrequires (1) an entityincludes trying tobe transmittedset read- only properties. 413 Request Entity Too Long - If a particular property is too long toand frombe recorded then a composite XML error will be returned indicating the offending property. 8.2.5. Example PROPPATCH /bar.html HTTP/1.1 Host: www.foo.com Content-Type: text/xml Content-Length: xxxx <?XML version="1.0"> <?namespace href = "http://www.ietf.org/standards/dav/" AS = "D"?> <?namespace href = "http://www.w3.com/standards/z39.50/" AS = "Z"?> <D:propertyupdate> <D:set> <D:prop> <Z:authors> <Z:Author>Jim Whitehead</Z:Author> <Z:Author>Roy Fielding</Z:Author> </Z:authors> </D:prop> </D:set> <D:remove> <D:prop><Z:Copyright-Owner/></D:prop> </D:remove> </D:propertyupdate> INTERNET-DRAFT WebDAV November 19, 1997 HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: xxxxx <?XML version="1.0"> <?namespace href="http://www.ietf.org/standards/dav/" AS = "D"?> <?namespace href="http://www.w3.com/standards/z39.50/" AS = "Z"?> <D:multistatus> <D:response> <D:prop><Z:Authors/></D:prop> <D:status>HTTP/1.1 420 Method Failure</D:status> </D:response> <D:response> <D:prop><Z:Copyright-Owner/></D:prop> <D:status>HTTP/1.1 409 Conflict</D:status> </D:response> <D:responsedescription> Copyright Owner can not be deleted or altered.</D:responsedescription> </D:multistatus> In this example, the client requests the serverand (2) thatto set theresource be expressible as an entity with complete fidelity. This is problematic becausevalue of thenetwork traffic involved in making a copy,http://www.w3.com/standards/z39.50/Authors property, andbecause there is often no waytofully express a resource as an entity without a loss of fidelity. 3.6.2 Solution Requirementsremove the property http://www.w3.com/standards/z39.50/Copyright- Owner. Since the Copyright-Owner property could not be removed, no property modifications occur. The Method Failure response code for the Authors property indicates this action would have succeeded if it were not for the conflict with removing the Copyright-Owner property. 8.3. MKCOL Method Thesolution: - MUST allow a principalMKCOL method is used to create acopy of a resource without having to transmit the resource to and fromnew collection. All DAV compliant resources MUST support theserver. 3.6.3 TheMKCOL method. 8.3.1. RequestThe COPY methodMKCOL creates aduplicate ofnew collection resource at thesource resource, givenlocation specified by theRequest-URI, in the destination resource, given byRequest-URI. If theDestination header. The Destination headerRequest-URI exists, then MKCOL must fail. During MKCOL processing, a server MUSTbe present. The exact behavior of the COPY method depends onmake thetypeRequest-URI a member of its parent collection. If no such ancestor exists, thesource resource. 3.6.3.1 COPY for HTTP/1.1 resourcesmethod MUST fail. When thesource resource is notMKCOL operation creates acollection,new collection resource, all ancestors MUST already exist, or the method MUST fail with a 409 Conflict status code. For example, if a request to create collection /a/b/c/d/ is made, and neither /a/b/ nor /a/b/c/ exists, the request MUST fail. When MKCOL isnotinvoked without aproperty,request body, thebodynewly created collection has no members. INTERNET-DRAFT WebDAV November 19, 1997 A MKCOL request message MAY contain a message body. The behavior ofthe destination resource MUST be octet-for- octet identical toa MKCOL request when the bodyof the source resource. Alterations to the destination resource do not modify the source resource. Alterationsis present is limited tothe source resource do not modify the destination resource. Thus, all copies are performed "by-value". Allcreating collections, members of a collection, bodies of members and properties on thesource resource MUST be duplicated on the destination resource, subject to modifying headers, followingcollections or members. If thedefinition for copying properties. 3.6.3.2 COPY for Properties The following section defines how properties onserver receives aresource are handled duringMKCOL request entity type it does not support or understand it MUST respond with aCOPY operation. Live properties SHOULD415 Unsupported Media Type status code. The exact behavior of MKCOL for various request media types is undefined in this document, and will beduplicated as identically behaving live properties at the destination resource. Since theyspecified in separate documents. 8.3.2. Response Codes Responses from a MKCOL request arelive properties, thenot cacheable, since MKCOL has non-idempotent semantics. 201 Created - The collection or structured resource was created in its entirety. 403 Forbidden - This indicates at least one of two conditions: 1) The serverdeterminesdoes not allow thesyntaxcreation of collections at the given location in its namespace, andsemantics (hence value)2) The parent collection ofthese properties. Properties named bytheEnforce- Live- Properties header MUSTRequest-URI exists but cannot accept members. 405 Method Not Allowed - MKCOL can only beliveexecuted onthe destination resource, or the method MUST fail. Ifaproperty is not named by Enforce- Live- Properties anddeleted/non-existent resource. 409 Conflict - A collection cannot becopied live, then its value MUST be duplicated, octet-for-octet, in an identically named, dead resource onmade at thedestination resource. If a propertyRequest-URI until one or more intermediate collections have been created. 415 Unsupported Media Type- The server does not support the request type of the body. 419 Insufficient Space on Resource - The resource does not have sufficient space to record thesource already exists onstate of the resourceandafter theoverwrite headerexecution of this method. 8.3.3. Example This example creates a collection called /webdisc/xfiles/ on the server www.server.org. MKCOL /webdisc/xfiles/ HTTP/1.1 Host: www.server.org HTTP/1.1 201 Created 8.4. INDEX Method The INDEX method issetused toTRUE then the property atenumerate thedestinationmembers of a resource. All DAV compliant resources MUSTbe overwritten with the property from the source. If the overwrite header is false and the previous situation exists thensupport theCOPYINDEX method if they have members. INTERNET-DRAFT WebDAV November 19, 1997 8.4.1. The Request For a collection, INDEX MUSTfail withreturn a409 Conflict. 3.6.3.3 COPYlist of its members. All WebDAV compliant resources MUST support the text/xml response entity described below. The INDEX result forCollections A COPY ona collectioncausesMAY also return anew, empty collection resource to be created atlist of thedestinationmembers of child collections, to any depth. Collections that respond to an INDEX method withthe same properties as the source resource. All properties on the source collectiona text/xml entity MUSTbe duplicated on the destination collection, subject to modifying headers, followingcontain a single multistatus XML element which contains a response XML element for each member. A resource that supports INDEX MUST return thedefinitionresourcetype property forcopyingeach member. Note that the prop XML element MAY contain additional properties. 8.4.2. Example INDEX /user/yarong/dav_drafts/ HTTP/1.1 Host: www.microsoft.com HTTP/1.1 200 OK Content-Type: text/xml Content-Length: xxx Last-Modified: Thu, 11 Sep 1997 23:45:12 GMT ETag: _fooyyybar_ <?XML version="1.0"> <?namespace href = _http://www.ietf.org/standards/dav/_ as = _D_?> <D:multistatus> <D:response> <D:href>http://www.microsoft.com/user/yarong/dav_drafts/ </D:href> <D:prop> <D:resourcetype> <D:collection/> </D:resourcetype> </D:prop> <D:status>HTTP 1.1 200 OK</D:status> </D:response> <D:response> <D:href> http://www.microsoft.com/user/yarong/dav_drafts/base </D:href> <D:prop> <D:resourcetype/> </D:prop> <D:status>HTTP 1.1 200 OK</D:status> </D:response> </D:multistatus> INTERNET-DRAFT WebDAV November 19, 1997 8.5. ADDREF Method ThenewADDREF method is used to add external members to a resource. All DAV compliant collection resources MUSTNOT contain any members, internal or external. 3.6.3.4 Type Interactions If the destination resource identifies a property andsupport thesource resource is not a property, thenADDREF method. All other DAV compliant resources MAY support thecopy SHOULD fail. IfADDREF method as appropriate. 8.5.1. The Request The ADDREF method adds thedestination resource identifies a collection andURI specified in theOverwriteCollection-Member headeris "true," prioras an external member toperformingthecopy, the server MUST perform a DELETE operation oncollection specified by thecollection. 3.6.4 The Response 200 (OK) The source resource was successfully copied to a pre- existing destination resource. 201 (Created) The source resource was successfully copied.Request-URI. Thecopy operation resultedvalue in thecreation of a new resource. 412 (Precondition Failed) This status codeCollection-Member header MUST bereturnedan absolute URI meeting the requirements of an external member URI. It is not an error if theserver was unable to maintainURI specified in thelivenessCollection-Member header already exists as an external member of theproperties listedcollection. However, after processing the ADDREF there MUST be only one instance of the URI in theEnforce-Live-Properties header, or ifcollection. If theOverwrite header is false, andURI specified in thestateCollection-Member header already exists as an internal member of thedestinationcollection, the ADDREF method MUST fail with a 412 Precondition Failed status code. 8.5.2. Example ADDREF /~ejw/dav/ HTTP/1.1 Host: www.ics.uci.edu Collection-Member: http://www.ietf.org/standards/dav/ HTTP/1.1 200 OK This example adds the URI http://www.ietf.org/standards/dav/ as an external member resourceis non-null. 417 (Insufficient Space on Resource) -of the collection http://www.ics.uci.edu/~ejw/dav/. 8.6. DELREF Method Thedestination resource does not have sufficient spaceDELREF method is used torecordremove external members from a resource. All DAV compliant collection resources MUST support thestate ofDELREF method. All other DAV compliant resources MUST support theresource afterDELREF method only if they support theexecution of thisADDREF method.500 (Server Error)8.6.1. Theresource wasRequest The DELREF method removes the URI specified insuch a state that it could not be copied. This may occur iftheDestinationCollection-Member headerspecifies a resource that is outsidefrom thenamespacecollection specified by theresourceRequest-URI. DELREFing a URI which isable to interact with. 3.6.5 Examples 3.6.5.1 Overwrite Example This example shows resource http://www.ics.uci.edu/~fielding/index.html being copied to the location http://www.ics.uci.edu/users/f/fielding/index.html. The contentsnot a member of thedestination resource were overwritten, if non- null. COPY /~fielding/index.htmlcollection is not an error. DELREFing an internal member MUST fail with a 412 Precondition Failed status code. INTERNET-DRAFT WebDAV November 19, 1997 8.6.2. Example DELREF /~ejw/dav/ HTTP/1.1 Host:www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.htmlwww.ics.udi.edu Collection-Member: http://www.ietf.org/standards/dav/ HTTP/1.1 200 OK3.6.5.2 No Overwrite Example The followingThis exampleshows the same copy operation being performed, except withremoves theOverwrite header set to "false." A response of 412, Precondition Failed, is returned becauseURI http://www.ietf.org/standards/dav/, an external member resource, from thedestination resource has a non-null state. COPY /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html Overwrite: "false" HTTP/1.1 412 Precondition Failed 3.7 MOVE Method 3.7.1 Problem Descriptioncollection http://www.ics.uci.edu/~ejw/dav/. 8.7. GET, HEAD for Collections Themove operation onsemantics of GET are unchanged when applied to aresourcecollection, since GET is defined as, _retrieve whatever information (in thelogical equivalentform ofa copy followedan entity) is identified bya delete, where the actions are performed atomically. Using RFC 2068 methods only, this procedure could be performed in several steps. First,theclient could issue aRequest-URI_ [Fielding et al., 1997]. GET when applied toretrievearepresentationcollection MAY return the contents ofaan _index.html_ resource,issueaDELETE to removehuman-readable view of theresource fromcontents of theserver, then use PUT to placecollection, or something else altogether, and hence it is possible theresourceresult of a GET onthe server withanew URI. As iscollection will bear no correlation to thecase for COPY - becausestate of thenetwork traffic involved in making a move, and because therecollection. Similarly, since the definition of HEAD isoften no way to fully expressaresource as an entityGET without alossresponse message body, the semantics offidelity - server move functionalityHEAD are unmodified when applied to collection resources. 8.8. POST for Collections Since by definition the actual function performed by POST ispreferable. With a WEBDAV server, a principal may accomplish this taskdetermined byissuing a COPY and then DELETE. Network load decreases, butthe serverload may stilland often depends on the particular resource, the behavior of POST when applied to collections cannot besignificantmeaningfully modified because it is largely undefined. Thus theserver must create a duplicate resource. Were a serversemantics of POST are unmodified when applied toknow beforehand thataprincipal intended to perform COPY andcollection. 8.9. DELETEoperations in succession, it could avoid8.9.1. DELETE Method for Non-Collection Resources If thecreationDELETE method is issued to a non-collection resource which is an internal member of aduplicate resource. 3.7.2 Solution Requirements The solution: - Must preventcollection, then during DELETE processing a server MUST remove theunneeded transfer of entity bodiesRequest-URI fromand to the server. - Must preventits parent collection. A server MAY remove theunneeded creationURI ofcopies bya deleted resource from any collections of which theserver. 3.7.3 The Requestresource is an external member. 8.9.2. DELETE for Collections INTERNET-DRAFT WebDAV November 19, 1997 Themove operationDELETE method on aresource is the logical equivalent ofcollection MUST act as if acopy followed byDepth = Infinity header was used on it. A client MUST NOT submit adelete, where the actions are performed atomically. IfDepth header on aresource exists atDELETE on a collection with any value but Infinity. DELETE instructs that thedestination,collection specified in thedestination resource will be DELETEd as a side effect ofrequest-URI, theMOVE operation, subjectrecords of its external member resources, and all its internal member resources, are tothe restrictionsbe deleted. If any member cannot be deleted then all of theoverwrite header. 3.7.4 The Response 200 (OK) - The resource was moved. A successful response must contain the Content-Location header, set equalmember's progeny MUST NOT be deleted, so as to maintain theURInamespace. Any headers included with DELETE MUST be applied insource. This lets caches properly flush any cached entries for the source. Unfortunately the Content-Location header only allowsprocessing every resource to be deleted. In this case, asingle value so itheader of special interest isnot possible for caches unfamiliar withtheMOVEDestroy header, which specifies the method toproperly clear their caches. 412 (Precondition Failed) This status code MUSTbereturned if the server was unableused tomaintaindelete all resources in thelivenessscope of theproperties listed inDELETE. When theEnforce-Live-Properties header, or ifDELETE method has completed processing it MUST return a consistent namespace. The response SHOULD be a Multi-Status response that describes theOverwrite header is false, andresult of the DELETE on each affected resource. 8.9.2.1. Example DELETE /container/ HTTP/1.1 Host: www.foo.bar Destroy: NoUndelete HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: xxxxx <?XML version="1.0"> <?namespace href = "http://www.ietf.org/standards/dav/" As = "d"?> <d:multistatus> <d:response> <d:href>http://www.foo.bar/container/resource1</d:href> <d:href>http://www.foo.bar/container/resource2</d:href> <d:status>HTTP/1.1 200 OK</d:status> </d:response> <d:response> <d:href>http://www.foo.bar/container/</d:href> <d:status>HTTP/1.1 420 Method Failure</d:status> </d:response> <d:response> <d:href>http://www.foo.bar/container/resource3</d:href> <d:status>HTTP/1.1 412 Precondition Failed</d:status> </d:response> </d:multistatus> INTERNET-DRAFT WebDAV November 19, 1997 In this example thestate ofattempt to delete http://www.foo.bar/container/resource3 failed because thedestination resource is non-null. 501 (Not Implemented) - This may occur ifserver was unable to guarantee that resource3 would not be able to be undeleted. Consequently, theDestinationattempt to delete http://www.foo.bar/container/ also failed, but resource1 and resource2 were deleted. Even though a Depth headerspecifieshas not been included, aresource which is outside its domaindepth ofcontrol (e.g., stored on another server) resource andinfinity is assumed because theserver either refuses ormethod isincapable of moving toon a collection. As this example illustrates, DELETE processing need not be atomic. 8.10. PUT 8.10.1. PUT for Non-Collection Resources A PUT performed on anexternal resource. 502 (Bad Gateway) - This may occur when moving to external resources andexisting resource replaces thedestination server refused to acceptGET response entity of the resource.3.7.5 Examples 3.7.5.1 Overwrite Example This example showsProperties defined on the resourcehttp://www.ics.uci.edu/~fielding/index.html being moved toMAY be recomputed during PUT processing. For example, if a server recognizes thelocation http://www.ics.uci.edu/users/f/fielding/index.html. The contentscontent type of thedestination resource were overwritten, if non- null. MOVE /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html HTTP/1.1 200 OK Content-Location: http://www.ics.uci.edu/users/f/fielding/index.html 3.8 ADDREF Method 3.8.1 Problem Definition There needsrequest body, it may be able to automatically extract information that could be profitably exposed as properties. A PUT that would result in the creation of away to addresource without anexternal member to a collection. 3.8.2 Solution Requirements The solution must: - allow access control - allow referencing to URIs of external members - not requireappropriately scoped parent collection MUST fail with abody 3.8.3 The Request The ADDREF method adds the URI specified405 Method Not Allowed. 8.10.2. PUT for Collections As defined in theCollection-Member header as an external member to the collection specified byHTTP/1.1 specification [Fielding et al., 1997], theRequest-URI. The value in"PUT method requests that theCollection-Member header MUSTenclosed entity bean absolute URI meetingstored under therequirementssupplied Request-URI." Since submission of anexternal member URI. It is not an error if the URI specified in the Collection-Member header already exists as an external member of the collection, however, after processing ADDREF there MUST be only one instanceentity representing a collection would implicitly encode creation and deletion of resources, this specification intentionally does not define a transmission format for creating a collection using PUT. Instead, theURI in the collection.MKCOL method is defined to create collections. If a PUT is invoked on a collection resource it MUST fail. When theURI specified in the Collection-Member headerPUT operation creates a new non-collection resource all ancestors MUST alreadyexists as an internal member of the collection,exist. If all ancestors do not exist, theADDREFmethod MUST fail with a412 Precondition Failed409 Conflict status code.3.8.4 Example ADDREF /~whitehead/dav/ HTTP/1.1 HOST: www.ics.udi.edu Collection-Member: http://www.ietf.org/standards/dav/ HTTP/1.1 200 OK 3.9 DELREF Method 3.9.1 Problem Definition There needsFor example, if resource /a/b/c/d.html is to be created and /a/b/c/ does not exist, then the request must fail. 8.11. COPY Method The COPY method creates awayduplicate of the specified resource. All DAV compliant resources MUST support the COPY method. Support for the COPY method does not guarantee the ability toremove an external member fromcopy acollection. 3.9.2 Solution Requirements The solution must: - allow accessresource. For example, separate programs may control- allow referencing to URIs of external members -resources on the same server. As a result, it may notrequireeven be possible to copy abody 3.9.3resource to a location that appears to be on the same server. INTERNET-DRAFT WebDAV November 19, 1997 8.11.1. The Request TheDELREFCOPY methodremovescreates a duplicate of theURI specifiedsource resource, given by the Request-URI, in theCollection- Memberdestination resource, given by the Destination header. The Destination headerfromMUST be present. The exact behavior of thecollection specified byCOPY method depends on theRequest-URI. DELREFing a URI whichtype of the source resource. 8.11.1.1. COPY for HTTP/1.1 resources When the source resource is not amembercollection the body of thecollection is not an error. DELREFing an internal memberdestination resource MUSTfail with a 412 Precondition Failed status code. 3.9.4 Example DELREF /~whitehead/dav/ HTTP/1.1 Host: www.ics.udi.edu Collection-Member: http://www.ietf.org/standards/dav/ HTTP/1.1 200 OK 3.10 PATCH Method 3.10.1 Problem Definition At present, if a principal wishesbe octet-for-octet identical to the body of the source resource. Alterations to the destination resource do not modifyathe source resource. Alterations to the source resource do not modify the destination resource. Thus, all copies are performed _by-value_. All properties on the source resource MUST be duplicated on the destination resource,they must issuesubject to modifying headers, following the definition for copying properties. 8.11.1.2. COPY for Properties The following section defines how properties on aGET againstresource are handled during a COPY operation. Live properties SHOULD be duplicated as identically behaving live properties at theresource, modify their local copydestination resource. Since they are live properties, the server determines the syntax and semantics of these properties. Properties named by the Enforce-Live-Properties header MUST be live on the destination resource, or the method MUST fail. If a property is not named by Enforce-Live-Properties and cannot be copied live, then its value MUST be duplicated, octet-for-octet, in an identically named, dead property on theresource, and then issuedestination resource. If aPUT to place the modified resourceproperty on theserver. This procedure is inefficient becausesource already exists on theentire entity for adestination resourcemust be transmitted toandfromtheserver in orderOverwrite header is set tomake even small changes. Ideally,"T" then theupdate entity transmitted toproperty at theserver shoulddestination MUST beproportional in size tooverwritten with themodifications. 3.10.2 Solution Requirements The solution must: - allow partial modification of a resource without having to transmitproperty from theentire modified resource - allow byte-range patching - allows extensions so that patches can be done beyond simple byte-range patching - allow ranges to be deleted, inserted,source. If the Overwrite header is "F" andreplaced 3.10.3 The Request The request entity ofthePATCHprevious situation exists, then the COPY MUST fail with a 409 Conflict. 8.11.1.3. COPY for Collections The COPY methodcontainson alistcollection without a Depth header MUST act as if a Depth = infinity header was included. A client MAY submit a Depth header on a COPY on a collection with a value ofdifferences between the resource identified by"0" or "infinity". DAV compliant servers MUST support theRequest-URI"0" andthe desired content"infinity" behaviors. A COPY of depth infinity instructs that theresource aftercollection specified in thePATCH action has been applied. The listRequest-URI, the records ofdifferences is inits external member resources, and INTERNET-DRAFT WebDAV November 19, 1997 all its internal member resources, are to be copied to aformat defined bylocation relative to themedia typeDestination header. A COPY of depth "0" only instructs that theentity (e.g., "application/diff")collection, the properties, andmust include sufficient informationits external members, not its internal members, are to be copied. Any headers included with a COPY are to be applied in processing every resource toallow the serverbe copied. The exception toconvertthis rule is theoriginal version ofDestination header. This header only specifies theresourcedestination for the Request-URI. When applied to members of thedesired version. Processing performed by PATCH is atomic, hence all changes MUST be successfully executed orcollection specified in themethod fails. PATCH MUST fail if executed on a non-existent resource; i.e. PATCH does not create a resource as a side effect. Ifrequest-URI therequest appears (at least initially)value of Destination is to beacceptable,modified to reflect theserver MUST transmit an interim 100 response message after receivingcurrent location in theempty line terminatinghierarchy. So, if therequest headersrequest-URI is "a" andcontinue processingtherequest. Since the semantics of PATCH are non-idempotent, responses to this method are not cacheable. While server support for PATCHdestination isoptional, if"b" then when a/c/d is processed it MUST use aserver does support PATCH,destination of b/c/d. When the COPY method has completed processing it MUSTsupporthave created a consistent namespace atleast the text/xml diff format defined below. Support fortheVTML difference format [VTML]destination. Thus if it isrecommended, butnotrequired. 3.10.4 text/xml elements for PATCHpossible to COPY a collection with internal members, the internal members may still be copied but a collection will have to be created at the destination to contain them. Theresourceupdate XML element containsresponse is aset of XML sub-entitiesMulti-Status response thatdescribe modification operations. The name and meaningdescribes the result ofthese XML elementsthe COPY on each affected resource. The response is givenbelow. Processingfor the resource that was to be copied, not the resource that was created as a result ofthese directives MUST be performed intheorder encountered withincopy. In other words, each entry indicates whether theXML document. A directive operatescopy on the resourceas modified by all previous directives (executedspecified insequential order).the href succeeded or failed and why. Thelength ofexception to this rule is for errors that occurred on the destination. For example, if the destination was locked the response would indicate the destination URL and a 421 Destination Locked error. 8.11.1.4. Type Interactions If the destination resourceMAY be extended or reduced byidentifies aPATCH. The changes specified bycollection and theresourceupdate XML elementOverwrite header is _T_, prior to performing the copy the server MUSTbe executed atomically. 3.10.4.1 ResourceUpdate Name: http://www.ietf.org/standards/dav/patch/resourceupdate Purpose: Contains an ordered set of changesperform a DELETE operation on the collection. 8.11.2. Response Codes 200 OK - The source resource was successfully copied to anon- collection, non-propertypre- existing destination resource.Schema: http://www.ietf.org/standards/dav/patch/ Parent: Any Value: *(Insert | Delete | Replace) 3.10.4.2 Insert Name: http://www.ietf.org/standards/dav/patch/insert Purpose: Insert the XML element’s contents starting at the specified octet. Schema: http://www.ietf.org/standards/dav/patch/ Parent: ResourceUpdate Value:201 Created - Theinsert XML element MUST contain an Octet-Range XML element that specifies an octet position withinsource resource was successfully copied. The copy operation resulted in thebodycreation of a new resource.A value of "end" specifies412 Precondition Failed - This status code MUST be returned if theend ofserver was unable to maintain theresource. The bodyliveness of theinsert XML element contains the octets to be inserted. Please note thatproperties listed INTERNET-DRAFT WebDAV November 19, 1997 inorder to protectthewhiteEnforce-Live-Properties header, or if the Overwrite header is "F", and the state of the destination resource is non-null. 419 Insufficient Space on Resource - The destination resource does not have sufficient spacecontained in this XML elementto record thefollowing attribute/value MUST be included instate of theelement: XML-SPACE = "PRESERVE". 3.10.4.3 Delete Name: http://www.ietf.org/standards/dav/patch/delete Purpose: Removesresource after thespecified rangeexecution ofoctets. Schema: http://www.ietf.org/standards/dav/patch/ Parent: ResourceUpdate Value: The Delete XML element MUST contain an octet-range XML element. Discussion:this method. 421 Destination Locked _ Theoctets that are deleted are removed, which means thedestination resourceis collapsedwas locked and either a valid Lock-Token header was not submitted, or thelength ofLock- Token header identifies a lock held by another principal. 500 Server Error - The resource was in such a state that it could not be copied. This may occur if the Destination header specifies a resource that isdecremented byoutside thesize ofnamespace theoctet range. Itresource isnot appropriateable to interact with. 8.11.3. Overwrite Example This example shows resource http://www.ics.uci.edu/~fielding/index.html being copied toreplace deleted octets with zeroed-out octets, since zero is a valid octet value. 3.10.4.4 Replace Name: http://www.ietf.org/standards/dav/patch/replace Purpose: Replaces the specified range of octets withthe location http://www.ics.uci.edu/users/f/fielding/index.html. The contents of theXML element. If the number of octets indestination resource were overwritten, if non-null. COPY /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html HTTP/1.1 200 OK 8.11.4. No Overwrite Example The following example shows theXML element is different fromsame copy operation being performed, except with thenumberOverwrite header set to _F._ A response ofoctets specified,412 Precondition Failed is returned because theupdate MUST be rejected. Schema: http://www.ietf.org/standards/dav/patch/ Parent: ResourceUpdate Value: The Replace XML element MUST contain an octet- range XML element.destination resource has a non-null state. COPY /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html Overwrite: _F_ HTTP/1.1 412 Precondition Failed 8.11.5. Collection Example COPY /container/ HTTP/1.1 Host: www.foo.bar Destination: http://www.foo.bar/othercontainer/ Enforce-Live-Properties: * Depth: Infinity INTERNET-DRAFT WebDAV November 19, 1997 HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: xxxxx <?XML version="1.0"> <?namespace href = "http://www.ietf.org/standards/dav/" As = "d"?> <d:multistatus> <d:response> <d:href>http://www.foo.bar/othercontainer/resource1</d:href> <d:href>http://www.foo.bar/othercontainer/resource2</d:href> <d:href>http://www.foo.bar/othercontainer/</d:href> <d:href>http://www.foo.bar/othercontainer/R2/D2</d:href> <d:status>HTTP/1.1 201 Created</d:status> </d:response> <d:response> <d:href>http://www.foo.bar/othercontainer/R2/</d:href> <d:status>HTTP/1.1 412 Precondition Failed</d:status> </d:response> </d:multistatus> Thecontents of the entity areDepth header is unnecessary as thereplacement octets. Please note that in orderdefault behavior of COPY on a collection is toprotect the white space contained in this XML element the following attribute/value MUST be included in the element: XML-SPACE = "PRESERVE". 3.10.4.5 Octet-Range Attribute Name: http://www.ietf.org/standards/dav/patch/octet- range Purpose: Specifiesact as if arange"Depth: Infinity" header had been submitted. In this example most ofoctets thattheenclosing property effects. Schema: http://www.ietf.org/standards/dav/patch/ Parent: Insert, Delete, Replace Value: number ["-" (number | "end")] Number = 1*Digit Description: Octet numbering beginsresources, along with0. Iftheoctet contains a single number thencollection, were copied successfully. However theoperation iscollection R2 failed, most likely due tobegina problem with enforcing live properties. R2's member D2 was successfully copied. As a result a collection was created atthat octet andwww.foo.bar/othercontainer/R2 tocontinue forcontain D2. 8.12. MOVE Method The move operation on alength specified by the operation. Inresource is thecaselogical equivalent of a copy followed by a delete,this would meanwhere the actions are performed atomically. All DAV compliant resources MUST support the MOVE method. However, support for the MOVE method does not guarantee the ability todeletemove asingle octet. In the case of an insert this would meanresource tobegin the insertion ata particular destination. For example, separate programs may actually control different sets of resources on thespecified octet andsame server. Therefore, it may not even be possible to move a resource within a namespace that appears to belong tocontinue forthelength ofsame server. 8.12.1. The Request If a resource exists at theincluded value, extendingdestination, the destination resourceif necessary. Inwill be DELETEd as a side effect of thecaseMOVE operation, subject to the restrictions ofreplace,thereplace begins atOverwrite header. 8.12.2. MOVE for Collections MOVE instructs that the collection specifiedoctetin the Request-URI, the records of its external member resources, andoverwritesallthat followits internal INTERNET-DRAFT WebDAV November 19, 1997 member resources, are to be moved to a location relative to thelength of the included value. 3.10.5 The Response 200 (OK) -Destination header. Therequest entity bodyMOVE method on a collection MUST act as if a Depth "infinity" header wasprocessed without error, resultingused on it. A client MUST NOT submit a Depth header on a MOVE on a collection with any value but "infinity". Any headers included with MOVE are to be applied inan updateprocessing every resource to be moved. The exception to this rule is thestateDestination header. The behavior of this header is theresource. 409 (Conflict) - If the update information in the request message body does not make sensesame as given for COPY on collections. When thecurrent state of the resource (e.g., an instruction to deleteMOVE method has completed processing it MUST have created anon-existent line), this status code MAY be returned. 415 (Unsupported Media Type) - The server does not supportconsistent namespace on both thecontent type ofsource and destination, creating collections at theupdate instructionssource or destination as necessary. As specified in therequest message body. 416 (Unprocessable Entity) - A new status code.definition of MOVE, a MOVE of a collection over another collection causes the destination collection and all its members to be deleted. Theserver understandsresponse is a Multi-Status response that describes thecontent typeresult of therequest entity, but was unable to process the contained instructions. 417 (Insufficient SpaceMOVE onResource) -each effected resource. The response is given for the resourcedoes not have sufficient spacethat was torecord the state ofbe moved, not the resourceafter the execution of this method. 3.10.6 Examples 3.10.6.1 HTML file modification The following example showsthat was created as amodificationresult of thetitle and contents ofmove. In other words, each entry indicates whether the move on theHTMLresourcehttp://www.example.org/hello.html. Before: <HTML> <HEAD> <TITLE>Hello world HTML page</TITLE> </HEAD> <BODY> <P>Hello, world!</P> </BODY> </HTML> PATCH Request: Response: PATCH hello.html HTTP/1.1 Host: www.example.org Content-Type: text/xml Content-Length: xxx HTTP/1.1 100 Continue <?XML:Namespacespecified in the href= Shttp://www.ietf.org/standards/dav/patch/" AS = "D"/> <D:ResourceUpdate> <Replace XML-SPACE = "PRESERVE"><octet-range>14</octet- range>&003CTITLE&003ENew Title&003C/TITLE&003E</Replace> <Delete><octet-range>38-50</Delete> <Insert XML-SPACE = "PRESERVE"><octet-range>86</>& 003CP&003ENew paragraph&003C/P&003E</Insert> </D:ResourceUpdate> HTTP/1.1succeeded or failed and why. The exception to this rule is for errors that occurred on the destination. For example, if the destination was locked the response would indicate the destination URL and a 421 Destination Locked error. 8.12.3. Response Codes 200 OKAfter: <HTML> <HEAD> <TITLE>New Title</TITLE> </HEAD> <BODY> <P>Hello, world!</P> <P>New paragraph</P> </BODY> </HTML> 3.11 Headers 3.11.1 Destination Header- TheDestination header specifiesmove operation was successful. 409 Conflict _ The MOVE was attempted on adestination resource for methods such ascollection with members. While the COPYand MOVE, which take two URIs as parameters. Destination= "Destination" ":" URI 3.11.2 Enforce-Live-Properties Header The Enforce-Live-Properties header specifies properties thatpart of this operation could succeed the DELETE could not. Therefore the MOVE MUST fail. 412 Precondition Failed - This status code MUST be"live" after they are copied (moved) to the destination resource of a copy (or move). Ifreturned if thevalue "*" is given forserver was unable to maintain the liveness of theheader, then it designates all livepropertiesonlisted in thesource resource. IfEnforce-Live-Properties header, or if thevalueOverwrite header is"Omit" then"F", and theserver MUST NOT duplicate onstate of the destination resourceany properties that are defined onis non-null. 421 Destination Locked - The destination resource was locked and either a valid Lock-Token header was not submitted, or thesource resource. If thisLock- Token header identifies a lock held by another principal. 502 Bad Gateway - This may occur when the destination isnot included theno n another server and the destination serveris expectedrefuses toact as defined by the default property handling behavior ofaccept theassociated method. EnforceLiveProperties = "Enforce-Live-Properties" ":" ("*" | "Omit" | 1#(Property-Name)) Property-Name = "<" URI ">" 3.11.3 Overwrite Header Theresource INTERNET-DRAFT WebDAV November 19, 1997 8.12.4. Overwriteheader specifies whether the server should overwriteExample This example shows resource http://www.ics.uci.edu/~fielding/index.html being moved to thestatelocation http://www.ics.uci.edu/users/f/fielding/index.html. The contents ofa non-nullthe destination resourceduringwere overwritten, if non-null. MOVE /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html HTTP/1.1 200 OK 8.12.5. Collection Example MOVE /container/ HTTP/1.1 Host: www.foo.bar Destination: http://www.foo.bar/othercontainer/ Enforce-Live-Properties: * Overwrite: False Lock-Token: <OpaqueLockToken:xxxx> <OpaqueLockToken:xxxx> HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: xxxxx <?XML version="1.0"> <?namespace href = "http://www.ietf.org/standards/dav/" As = "D"?> <d:multistatus> <d:response> <d:href>http://www.foo.bar/container/resource1</d:href> <d:href>http://www.foo.bar/container/resource2</d:href> <d:href>http://www.foo.bar/container/</d:href> <d:href>http://www.foo.bar/container/C2/R2</d:href> <d:status>HTTP/1.1 201 Created</d:status> </d:response> <d:response> <d:href>http://www.foo.bar/container/C2</d:href> <d:status>HTTP/1.1 420 Method Failure</d:status> <d:response> <d:href>http://www.foo.bar/othercontainer/C2</d:href> <d:status>HTTP/1.1 409 Conflict</d:status> </d:response> </d:multistatus> In this example the client has submitted aCOPY or MOVE. A valuenumber of"false" states that the server MUST NOT performlock tokens with theCOPY or MOVE operation ifrequest. A lock token will need to be submitted for every resource, both source and destination, anywhere in thestatescope of the INTERNET-DRAFT WebDAV November 19, 1997 method, that is locked. In this case the proper lock token was not submitted for the destination http://www.foo.bar/othercontainer/C2. This means that the resourceis non-null. By default,continer/c2 could not be moved, although its child container/C2/R2 could be moved. 8.13. LOCK Method The following sections describe thevalue of OverwriteLOCK method, which is"true," and a client MAY omit this header fromused to take out arequest when its value is "true." Whilelock of any access type. These sections on theOverwrite header appearsLOCK method describe only those semantics that are specific toduplicatethefunctionalityLOCK method and are independent of theIf-Match: * headeraccess type ofHTTP/1.1, If-Match applies only totheRequest-URI, and not tolock being requested. Once theDestinationgeneral LOCK method has been described, subsequent sections describe the semantics ofa COPY or MOVE. Overwrite = "Overwrite" ":" ("true" | "false") If there is a conflictthe "write" access type, and theOverwritewrite lock. 8.13.1. Operation A LOCK method invocation creates the lock specified by the Lock-Info headerequals "true", or is absent and thus defaults to "true", thenon the Request-URI. Lock methodMUST fail withrequests SHOULD have a409 Conflict. 3.11.4 Destroy Header When deletingXML request body which contains an Owner XML element for this lock request. The LOCK request MAY have aresource the client often wishesTimeout header. A successful response tospecify exactly what sorta lock invocation MUST include Lock-Token and Timeout headers. Clients MUST assume that locks may arbitrarily disappear at any time, regardless ofdelete is being enacted. The Destroy header, used with the Mandatory header, allowstheclient to specifyvalue given in theend result they desire.Timeout header. TheDestroyTimeout headeris specified as follows: The Undelete token requests that,only indicates the behavior of the server ifpossible,"extraordinary" circumstances do not occur. For example, an administrator may remove a lock at any time or theresource should be leftsystem may crash ina statesuch a way that itcan be undeleted. The server is not required to honor this request. The NoUndelete token requests thatloses theresourcerecord of the lock's existence. The response MUSTNOT be leftalso contain the value of the lockdiscovery property in astate such that it can be undeleted.prop XML element. 8.13.2. TheVersionDestroy token includesEffect of Locks on Properties and Collections By default thefunctionalityscope of a lock is theNoUndelete tokenentire state of the resource, including its body andextends it to include havingassociated properties. As a result, a lock on a resource also locks theserver remove all versioning referencesresource's properties, and a lock on a property may lock a property's resource or may restrict the ability to lock theresource that it has control over. DestroyHeader = "Destroy" ":" #Choices Choices = "VersionDestroy" | "NoUndelete" | "Undelete" | token |"<" URI ">" ;property's resource. Only a single lock tokenextensionMUSTNOTbe usedunless it is specified inwhen aRFC16, otherwiselock extends to cover both aURI MUST be used for extensions. 3.11.5 Collection-Member Headerresource and its properties. Note that certain lock types MAY override this behavior. For collections, a lock also affects the ability to add or remove members. TheCollection-Member header specifiesnature of theURIeffect depends upon the type ofan external resource to be added/deleted to/fromaccess control involved. 8.13.3. Locking Replicated Resources Some servers automatically replicate resources across multiple URLs. In such acollection. CollectionMember = "Collection-Member" ":" URI 3.12 Links 3.12.1 Source Link Property Type Name: http://www.ietf.org/standards/dav/link/source Purpose: The destinationcircumstance the server MAY only accept a lock on one of INTERNET-DRAFT WebDAV November 19, 1997 thesource link identifiesURLs if theresourceserver can guarantee thatcontainstheunprocessed source oflock will be honored across all thelink’s source. Schema: http://www.ietf.org/standards/dav/link/ Parent: Any Value: An XML document with zero or more link XML elements. Discussion:URLs. 8.13.4. Locking Multiple Resources ThesourceLOCK method supports locking multiple resources simultaneously by allowing for the listing of several URIs in thelink (src) is typicallyLOCK request. These URIs, in addition to theURIRequest-URI, are then to be locked as a result of theoutput resource on whichLOCK method's invocation. When multiple resources are specified thelink is defined, and there is typicallyLOCK method onlyone destination (dst)succeeds if all specified resources are successfully locked. The Lock-Tree option of thelink, which is the URI where the unprocessed source oflock request specifies that the resourcemay be accessed. When more than one link destination exists, this specification asserts no policy on ordering. 4 State Tokens 4.1 Overview 4.1.1 Problem Description Thereand all its internal children (including internal collections, and their internal members) aretimes when a principal will wanttopredicate successful execution of a method on the current state of a resource. While HTTP/1.1 provides abe locked. This is another mechanism by which a request forconditional execution of methods using entity tags via the "If-Match" and "If-None-Match" headers, the mechanism is not sufficiently extensibleto express conditional statements involving more generic state indicators, such asa locktokens. The fundamental issue with entity tags is that theyon multiple resources canonlybegenerated by a resource. However there are times when a client will want tospecified. Currently existing locks can not beableextended toshare state tokens betweencover more or less resources,potentially on different servers, as well as be able to generate certain typesand any request to expand or contract the number of resources in a locktokens without first having to communicateMUST fail with aserver. For example, a principal may wish to require that resource B have a certain state in order409 Conflict status code. So, fora method to successfully execute onexample, if resourceA. IfA is exclusively write locked and then theclient submits an e-tag from resource Bsame principal asks toresourceexclusively write lock resources A,then A has no way of knowing thatB, and C, thee-tagrequest will fail as A ismeant to describe resource B. Another example occurs when a principal wishes to predicatealready locked and the lock can not be extended. A successfulcompletion ofresult will return amethod onsingle lock token which represents all theabsence of any locks on a resource. It is not sufficient to submitresources that have been locked. If an"If-None-Match: *" asUNLOCK is executed on thisrefers to the existence of an entity, not of a lock. This draft definestoken, all associated resources are unlocked. If theterm "state token" as an identifier forlock cannot be granted to all resources, astate of409 Conflict status code MUST be returned with aresource. The sections below define requirements for state tokens and provideresponse entity body containing astate token syntax, along with two new headersmultistatus XML element describing whichcan acceptresource(s) prevented thenew state token syntax. 4.1.2 Solution Requirements 4.1.2.1 Syntax Self-Describing. A state token must be self describing such that upon inspectinglock from being granted. 8.13.5. Interaction with other Methods The interaction of astate token itLOCK with various methods ispossible to determine what sortdependent upon the lock type. However, independent of lock type, a successful DELETE ofstate token it is, what resource(s) it applies to, and what state it represents. This self-describing nature allows serversa resource MUST cause all of its locks toaccept tokens from other servers and potentiallybeable to coordinate state information cross resource and cross site through standardized protocols. For example,removed. 8.13.6. Lock Compatibility Table The table below describes theexecution ofbehavior that occurs when a lock request is made onresource A cana resource. Current lock state/ Shared Lock Exclusive Lock request Lock None True True Shared Lock True False Exclusive Lock False False* INTERNET-DRAFT WebDAV November 19, 1997 Legend: True = lock MAY bepredicated ongranted. 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 resourceB, where Ais given in the leftmost column, andBlock requests arepotentially on different servers. Client Generable. The state token syntax must allow, when appropriate, for clients to generate a state token without havinglisted in the firstcommunicated withrow. The intersection of aserver. One drawbackrow and column gives the result ofentity tagsa lock request. For example, if a shared lock isthat they are setheld on a resource, and an exclusive lock is requested, the table entry is _false_, indicating the lock must not be granted. If an exclusive or shared lock is re-requested by theserver, and thereprincipal who owns the lock, the lock MUST be regranted. If the lock isno interoperable algorithmregranted, the same lock token that was previously issued MUST be returned. 8.13.7. Owner XML Element Name: owner Namespace: http://www.ietf.org/standards/dav/ Purpose: Provide information about the principal taking out a lock. Parent: Any Values: XML Elements Descripton: The Owner XML element provides information sufficient forcalculating an entity tag. Consequently,either directly contacting aclient cannot generate an entity tag fromprincipal (such as aparticular statetelephone number or Email URI), or for discovering the principal (such as the URL of aresource. However, a state token which encodes an MD5 state hash could be calculated byhomepage) who owns aclient based onlock. 8.13.8. Lock Response A successful lock response MUST contain aclient-held state ofLock-Token response header, aresource,Timeout header andthen submitted toaserverprop XML element ina conditional method invocation. Another potential use for client generable state tokensthe response body which contains the value of the lockdiscovery property. 8.13.9. Response Codes 409 Conflict - The resource isfor a client to generate lock tokens with wild card fields, and hence be able to express conditionals such as: "only execute this GET if there are no write lockslocked, so the method has been rejected. 412 Precondition Failed - The included Lock-Token was not enforceable on thisresource." 4.1.2.2 Conditonals Universal. A solution must be applicable to all requests. Positive and Negative. Conditional expressions must allow forresource or theexpression of both positive and negative state requirements. 4.2 State Token Syntax State tokens are URLs employingserver could not satisfy thefollowing syntax: State-Token = "StateToken:" Type ":" Resources ":" State-Info Type = "Type" "=" Caret-encoded-URL Resources = "Res" "=" Caret-encoded-URL Caret-encoded-URL = "^" Resource "^" Resourcerequest in the Lock-Info header. 8.13.10. Example - Simple Lock Request LOCK /workspace/webdav/proposal.doc HTTP/1.1 Host: webdav.sb.aol.com Lock-Info: LockType=Write LockScope=Exclusive Timeout: Infinite; Second-4100000000 Content-Type: text/xml INTERNET-DRAFT WebDAV November 19, 1997 Content-Length: xyz <?XML version="1.0"> <?namespace href="http://www.ietf.org/standards/dav/" AS =<A URI where all "^" characters are escaped> State-Info"D"?> <D:owner> <D:href>http://www.ics.uci.edu/~ejw/contact.html</D:href> </D:owner> HTTP/1.1 200 OK Lock-Token: opaquelocktoken:xyz122393481230912asdfa09s8df09s7df Timeout: Second-604800 Content-Type: text/xml Content-Length: xxxxx <?XML version="1.0"> <?namespace href ="http://www.ietf.org/standards/dav/" AS =*(uchar | reserved) ; uchar, reserved defined section 3.2.1"D"?> <D:prop> <D:lockdiscovery> <D:activelock> <D:locktype>write</D:locktype> <D:lockscope>exclusive</D:lockscope> <D:addlocks/> <D:owner> <D:href> http://www.ics.uci.edu/~ejw/contact.html </D:href> </D:owner> <D:timeout>Second-604800</D:timeout> <D:locktoken> <D:href> opaquelocktoken:xyz122393481230912asdfa09s8df09s7df </D:href> </D:locktoken> </D:activelock> </D:lockdiscovery> </D:prop> This example shows the successful creation ofRFC 2068 This proposal has created a new URL scheme for state tokens because a state token names a networkan exclusive write lock on resourceusing its normal name, which is typically state-invariant, along with additional information that specifies a particular state of the resource. Encoding the statehttp://webdav.sb.aol.com/workspace/webdav/proposal.doc. The resource http://www.ics.uci.edu/~ejw/contact.html contains contact informationintofor thenative URL schemeowner of thenetwork resource was not felt to be safe, since freedom from name space collisions could not be guaranteed. Iflock. The server has an activity- based timeout policy in place on thisproposal is accepted,resource, which causes theStateToken URL scheme will needlock to automatically bedefined and registered with IANA. State Token URLs begin with the URL scheme name "StateToken" rather than the name ofremoved after 1 week (604800 seconds). The response has a Lock-Token header that gives theparticular statelock tokentype they represent in order to make theURLself describing. Thus it is possible to examinethat uniquely identifies theURL and know, atlock created by this lock request. 8.13.11. Example - Multi-Resource Lock Request LOCK /workspace/webdav/proposal.doc HTTP/1.1 Host: webdav.sb.aol.com INTERNET-DRAFT WebDAV November 19, 1997 Lock-Info: LockType=Write LockScope=Exclusive Addlocks=<http://webdav.sb.aol.com/workspace/><http://foo.bar/blah> Timeout: Infinite, Second-4100000000 <?XML version="1.0"> <?namespace href="http://www.ietf.org/standards/dav/" AS = "D"?> <D:href>http://www.ics.uci.edu/~ejw/contact.html<D:href> HTTP/1.1 409 Conflict Content-Type: text/xml Content-Length: xxxxx <?XML version="1.0"> <?namespace href = "http://www.ietf.org/standards/dav/" As = "D"?> <D:multistatus> <D:response> <D:href> http://webdav.sb.aol.com/workspace/webdav/proposal.doc </D:href> <D:href> http://webdav.sb.aol.com/workspace/webdav/ </D:href> <D:status>HTTP/1.1 202 Accepted</D:status> </D:response> <D:response> <D:href>http://foo.bar/blah</D:href> <D:status>HTTP/1.1 403 Forbidden</D:status> </D:response> </D:multistatus> This example shows aminimum,request for an exclusive write lock on three resources, http://webdav.sb.aol.com/workspace/webdav/proposal.doc, http://webdav.sb.aol.com/workspace/, and http://foo.bar/blah. In this request, the client has specified that itisdesires an infinite length lock, if available, otherwise astate token. Labeled name/value pairs are used within the token to allow new fields to be added. Processorstimeout ofstate tokens MUST be prepared to accept the fields in whatever order they are present and MUST ignore any fields they do not understand.4.1 billion seconds, if available. The"Type"Owner header field specifies thetype of the stateweb address for contact informationencoded in the state token. A URL is used in order to avoid namespace collisions. The "Res" field identifies the resourceforwhichthestate token specifies a particular state. Since commas and spaces are acceptable URL characters, a caret is used to delimit a URL. Since a caret is an acceptable URL character, any instances of it must be escaped usingprincipal taking out the% escape convention. The State-Info production is expanded upon in descriptions of specific state token types, and is intended to containlock. This lock request has failed, because thestate description informationserver rejected the lock request fora particular state token. 4.3 State Token Conditional Headers 4.3.1 If-State-Match If-State-Match = "If-State-Match" ":" ("AND" | "OR") 1#("<" State-Token ">")http://foo.bar/blah. TheIf-State-Match header is intended to have similar functionality to409 Conflict status code indicates that theIf-Match header defined in section 14.25 of RFC 2068. Ifserver was unable to satisfy theAND keywordrequest because there isused and all of the state tokens identifya conflict between the state of theresource, then the server MAY performresources and therequested method. Ifoperation named in theOR keyword is used and any ofrequest. Within thestate tokens identifiesmultistatus, thecurrent state of202 Accepted status code indicates that theresource, then server MAY performlock method was accepted by therequested method. If neither ofresources, and would have been completed if all resources named in thekeyword requirements is met,request were able to be locked. The 403 Forbidden status code indicates that the serverMUST NOT perform the requested method, and MUST return a 412 (Precondition Failed) response. 4.3.2 If-None-State-Match If-None-State-Match = "If-None-State-Match" ":" 1#("<" State- Token ">")does not allow lock requests on this resource. 8.14. UNLOCK Method INTERNET-DRAFT WebDAV November 19, 1997 TheIf-None-State-Match header is intended to have similar functionality toUNLOCK method removes theIf-None-Match header definedlock identified by the lock token insection 14.26 of RFC 2068. If any ofthestate tokens identifiesLock-Token header from thecurrent state ofRequest-URI, and all other resources included in theresource,lock. Any DAV compliant resource which supports theserverLOCK method MUSTNOT performsupport therequestedUNLOCK method.Instead, if8.14.1. Example UNLOCK /workspace/webdav/info.doc HTTP/1.1 Host: webdav.sb.aol.com Lock-Token:opaquelocktoken:123AbcEfg1284h23h2 HTTP/1.1 200 OK In this example, therequest method was GET, HEAD, INDEX, or GETMETA,lock identified by theserver SHOULD respond with a 304 (Not Modified) response, includinglock token "opaquelocktoken:123AbcEfg1284h23h2" is successfully removed from thecache-related entity-header fields (particularly ETag) ofresource http://webdav.sb.aol.com/workspace/webdav/info.doc. If this lock included more than just one resource, thecurrent statelock was removed from those resources as well. 8.15. PATCH Method The PATCH method is used to modify parts of theresource. For all other request methods,entity returned in theserver MUST respond withresponse to astatus of 412 (Precondition Failed). If none of the state tokens identifiesGET method. DAV compliant resources MAY support thecurrent statePATCH method. 8.15.1. The Request The request entity of theresource, the server MAY performPATCH method contains a list of differences between therequested method. Note thatresource identified by the"AND"Request-URI 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 State-Token-Header = "State-Token" ":" 1#("<" State-Token ">") The State Token header is intended to have similar functionality totheetag header defined in section 14.20desired content ofRFC 2068.the resource after the PATCH action has been applied. Thepurposelist ofthe tagdifferences isto return state tokens defined on a resourcein aresponse. The contentsformat defined by the media type of thestate-token are not guaranteed to be exhaustiveentity (e.g., "application/diff") andare generally usedmust include sufficient information toreturn a new state token that has been defined asallow theresultserver to convert the original version ofa method. For example, if a LOCK method werethe resource to the desired version. Processing performed by PATCH is atomic. Hence all changes MUST be successfully executed or the method fails. PATCH MUST fail if executed on a non-existent resource; i.e., PATCH does not create a resource as a side effect. If the request appears (at least initially) to be acceptable, the server MUST transmit an interim 100 responsewould include a state token header withmessage after receiving thelock state token included. 4.5 E-Tags E-tags have already been deployed usingempty line terminating theIf-Matchrequest headers andIf-None- Match headers. Introducing two mechanisms to express e-tags would only confuse matters, therefore e-tags shouldcontinueto be expressed using quoted strings andprocessing theIf-Match and If-None- Match headers. 5 Locking 5.1 Locking: Introduction Locking is used to arbitrate accessrequest. Since the semantics of PATCH are non- idempotent, responses to this method are not cacheable. While server support for PATCH is optional, if aresource amongst principals that have equal access rights to that resource. This specification allows locks to vary over two parameters,server does support PATCH, it MUST support at least thenumbertext/xml diff format defined INTERNET-DRAFT WebDAV November 19, 1997 below. Support for the VTML difference format [VTML] is recommended, but not required. 8.15.2. text/xml elements for PATCH The resourceupdate XML element contains a set ofprincipals involvedXML sub-entities that describe modification operations. The name andthe typemeaning ofaccess tothese XML elements are given below. Processing of these directives MUST begranted. Furthermore, this document only providesperformed in thedefinition of locking for one access type, write. However,order encountered within thesyntax is extensible, and allowsXML document. A directive operates on thespecification of other access types. 5.1.1 Exclusive Vs. Shared Locksresource as modified by all previous directives (executed in sequential order). Themost basic formlength oflock is an exclusive lock. This is a lock wheretheaccess right in question is only granted toresource MAY be extended or reduced by asingle principal.PATCH. Theneed for this arbitration results from a desire to avoid having to constantly merge results. In fact, many users so dislike having to merge that they would rather serialize their access to a resource rather than have to constantly perform merges. However, there are times whenchanges specified by thegoal of a lock is not to exclude others from exercisingresourceupdate XML element MUST be executed atomically. 8.15.2.1. resourceupdate XML Element Name: resourceupdate Namespace: http://www.ietf.org/standards/dav/patch/ Purpose: Contains anaccess right but rather to provide a mechanism for principals to indicate that they intend to exercise their access right. Shared locks are provided for this case. A shared lock allows multiple principalsordered set of changes toreceivealock, hence any principal with appropriate access can getnon-collection, non-property resource. Parent: None Value= *(insert | delete | replace) 8.15.2.2. insert XML Element Name: insert Namespace: http://www.ietf.org/standards/dav/patch/ Purpose: Insert thelock. With shared locks there are two trust setsXML element's contents starting at the specified octet. Parent: resourceupdate Value: The insert XML element MUST contain an octet-range XML attribute thataffectspecifies an octet position within the body of a resource. A value of _end_ specifies the end of the resource. Thefirst trust set is created by access permissions. Principals who are trusted, for example, may have permission to writebody of theresource, those who are not, don't. Among those who have access permissioninsert XML element contains the octets towritebe inserted. Please note that in order to protect theresource,white space contained in this XML element thesetfollowing attribute/value MUST be included in the element: XML-SPACE = "PRESERVE". This attribute is defined in the XML specification [Bray, Sperberg-McQueen, 1997]. 8.15.2.3. delete XML Element Name: delete Namespace: http://www.ietf.org/standards/dav/patch/ Purpose: Removes the specified range ofprincipals who have taken out a shared lock also must trust each other, creating a (typically) smaller trust set withinoctets. Parent: resourceupdate Value: The delete XML element MUST contain an octet-range XML attribute. INTERNET-DRAFT WebDAV November 19, 1997 Discussion: The octets that are deleted are removed, which means theaccess permission write set. Starting with every possible principal onresource is collapsed and theInternet, in most situationslength of thevast majorityresource is decremented by the size ofthese principals willthe octet range. It is nothave write accessappropriate to replace deleted octets with zeroed-out octets, since zero is agiven resource. Of the small number who do have write access, some principals may decide to guarantee their edits are free from overwrite conflicts by using exclusive write locks. Others may decide they trust their collaborators (the potential setvalid octet value. 8.15.2.4. replace XML Element Name: replace Namespace: http://www.ietf.org/standards/dav/patch/ Purpose: Replaces the specified range ofcollaborators beingoctets with thesetcontents ofprincipals who have write permission) and use a shared lock, which informs their collaborators that a principal is potentially working ontheresource. The WebDAV extensions to HTTP do not need to provide allXML element. If the number of octets in thecommunications paths necessary for principals to coordinate their activities. When using shared locks, principals may use any outXML element is different from the number ofband communication channel to coordinate their work (e.g., face-to-face interaction, written notes, post-it notes onoctets specified, thescreen, telephone conversation, email, etc.)update MUST be rejected. Parent: resourceupdate Value: Theintentreplace XML element MUST contain an octet-range XML attribute. The contents ofa shared lock isthe entity are the replacement octets. Please note that in order tolet collaborators know who elseprotect the white space contained in this XML element the following attribute/value MUST be included in the element: XML-SPACE = "PRESERVE" . This attribute ispotentially working ondefined in the XML specification [Bray, Sperberg-McQueen, 1997]. 8.15.2.5. octet-range Attribute Name: octet-range Namespace: http://www.ietf.org/standards/dav/patch/ Purpose: Specifies aresource. Shared locks are included because experience from web distributed authoring systems has indicatedrange of octets thatexclusive write locks are often too rigid. An exclusive write lockthe enclosing property affects. Parent: insert | delete | replace Value: number [_-_ (number | _end_)] Number = 1*Digit Description: Octet numbering begins with 0. If the octet contains a single number then the operation isusedtoenforcebegin at that octet and to continue for a length specified by the operation. In the case of a delete, this would mean to delete aparticular editing process: take out exclusive write lock, readsingle octet. In theresource, perform edits, writecase of an insert this would mean to begin theresource, releaseinsertion at thelock. What happens ifspecified octet and to continue for thelock isn't released? Whilelength of thetime- out mechanism provides one solution,included value, extending the resource ifyou need to forcenecessary. In thereleasecase ofa lock immediately, it doesn't help much. Granted, an administrator can releasereplace, thelock for you, but this could become a significant burden for large sites. In addition there isreplace begins at theproblemspecified octet and overwrites all thatan administrator may not be immediately available. Despite their potential problems, exclusive write locks are extremely useful, since often a guaranteefollow to the length offreedom from overwrite conflicts is what is needed.the included value. 8.15.3. Response Codes 200 OK - Thetradeoff describedrequest entity body was processed without error, resulting inthis specification isan update toprovide exclusive write locks, but alsothe state of the resource. 409 Conflict - If the update information in the request message body does not make sense given the current state of the resource (e.g., an instruction toprovidedelete aless strict mechanismnon-existent line), this status code MAY be returned. INTERNET-DRAFT WebDAV November 19, 1997 415 Unsupported Media Type - The server does not support the content type of the update instructions in theformrequest message body. 418 Unprocessable Entity - The entity body submitted with the PATCH was not understood by the resource. 419 Insufficient Space on Resource - The resource does not have sufficient space to record the state ofshared locks which can be used bythe resource after the execution of this method. 8.15.4. HTML file modification Example The following example shows asetmodification ofpeople who trust each otherthe title andwho have access to a communications channel external to HTTP which can be used to negotiate writing tocontents of theresource. 5.1.2 Required Support AHTML resource http://www.example.org/hello.html. Before: <HTML> <HEAD> <TITLE>Hello world HTML page</TITLE> </HEAD> <BODY> <P>Hello, world!</P> </BODY> </HTML> PATCH Request: Response: PATCH hello.html HTTP/1.1 Host: www.example.org Content-Type: text/xml Content-Length: xxx HTTP/1.1 100 Continue <?XML version="1.0"> <?namespace href = _http://www.ietf.org/standards/dav/patch/_ AS = _D_?> <D:resourceupdate> <D:replace XML-SPACE = "PRESERVE"> <D:octet-range>14</D:octet-range>&003CTITLE&003ENew Title&003C/TITLE&003E</D:replace> <D:delete><D:octet-range>38-50</D:octet-range></D:delete> <D:insert XML-SPACE = "PRESERVE"><D:octet-range>86</D:octet- range>&003CP&003ENew paragraph&003C/P&003E</D:insert> </D:resourceupdate> HTTP/1.1 200 OK After: <HTML> INTERNET-DRAFT WebDAVcompliant serverNovember 19, 1997 <HEAD> <TITLE>New Title</TITLE> </HEAD> <BODY> <P>Hello, world!</P> <P>New paragraph</P> </BODY> </HTML> 9. HTTP Headers for Distributed Authoring 9.1. Collection-Member Header CollectionMember = "Collection-Member" ":" URI ; URI isnot required to support lockingdefined inany form. If the server does support locking it may choose to support any combinationsection 3.2.1 ofexclusive and shared locks for any access types.[Fielding et al., 1997] Thereason for this flexibility is that server implementers have said that they are willing to accept minimum requirements on all services but locking. Locking policy strikes toCollection-Member header specifies thevery heartURI oftheiran external resourcemanagement and versioning systems and they require control over what sort of locking willto bemade available. For example, some systems only support shared write locks while others only provide support for exclusive write locks while yet others use no locking at all. As each system is sufficiently differentadded/deleted to/from a collection. 9.2. DAV Header DAV = "DAV" ":" ("1" | "2" | extend) This header indicates that the resource supports the DAV schema and protocol tomerit exclusion of certain locking features,theauthors are proposing that locking be allowed aslevel indicated. All DAV compliant resources MUST return thesole axis of negotiation within WebDAV. 5.2 LOCK MethodDAV header on all OPTIONS responses. 9.3. Depth Header Depth = "Depth" ":" ("0" | "1" | "infinity") Thefollowing sections describe the LOCK method, whichDepth header is usedto take out a lock of any access type. These sectionswith methods executed on collections to indicate whether theLOCKmethoddescribeis to be applied onlythose semantics that are specificto theLOCK methodcollection (Depth = 0), to the collection andare independent ofits immediate children, (Depth = 1), or theaccess type ofcollection and all its progeny (Depth = infinity). Note that Depth = 1 and Depth = infinity behavior only applies to internal member resources, and not to external member resources. The Depth header is only supported if a method's definition explicitly provides for such support. The following rules are thelock being requested. Oncedefault behavior for any method that supports thegeneral LOCKdepth header. A methodhas been described, subsequent sections describeMAY override these defaults by defining different behavior in its definition. Methods which support thesemanticsdepth header MAY choose not to support all of the"write" access type,header's values and MAY define, on a case by case basis, the behavior of thewrite lock. 5.2.1 Operation A LOCKmethodinvocation createson a collection if a depth header is not present. For example, thelock specified byMOVE method only supports Depth = infinity and if a depth header is not present will act as if a Depth = infinity header had been applied. INTERNET-DRAFT WebDAV November 19, 1997 Clients MUST NOT rely upon methods executing on members of their hierarchies in any particular order or theLock- Info headerexecution being atomic. Note that methods MAY provide guarantees onthe Request-URI. Lockordering and atomicity. Upon execution, a methodrequests SHOULD NOT havewith arequest body. A user-agent SHOULD submit an Ownerdepth headerfield withwill perform as much of its assigned task as possible and then return alock request. A successfulresponse specifying what it was able toa lock invocation MUST include Lock- Tokenaccomplish andTime-Out headers. 5.2.2 The Effectwhat it failed to do. So, for example, an attempt to COPY a hierarchy may result in some ofLocks on Properties and Containers By defaultthescope ofmembers being copied and some not. Any headers on alock ismethod with a depth header MUST be applied to all resources in theentire statescope of theresource, includingmethod. For example, an if-match header will have itsbody and associated properties. As a result, a lock on avalue applied against every resourcealso locksin theresource's properties,method's scope and will cause the method to fail if the header fails to match. If alock on a property may lock a property's resourceresource, source ormay restrictdestination, within theability to lockscope of theproperty's resource. Onlymethod is locked in such asingleway as to prevent the successful execution of the method, then the lock token for that resource MUST beused whensubmitted with the request in the Lock-Token request header. 9.4. Destination Header Destination = "Destination" ":" URI The Destination header specifies alock extends to cover bothdestination resource for methods such as COPY and MOVE, which take two URIs as parameters. 9.5. Destroy Header DestroyHeader = "Destroy" ":" #Choices Choices = "VersionDestroy" | "NoUndelete" | "Undelete" | extend Extend = RFC-Reg | Coded-URL RFC-Req = Token ; This is aresource and its properties. Notetoken value (defined in section 2.2 of [Fielding et al., 1997]) thatcertain lock types MAY override this behavior. For containers,has been published as an RFC. Coded-URL = "<" URI ">" When deleting alock also affectsresource theabilityclient often wishes toadd or remove members. The naturespecify exactly what sort of delete should be performed. The Destroy header, used with theeffect depends upon the type of access control involved. 5.2.3 Locking Replicated Resources Some servers automatically replicate resources across multiple URLs. In such a circumstanceMandatory header, allows theserver MAY only accept a lock on one ofclient to specify theURLsend result it desires. The Destroy header is specified as follows: The Undelete token requests that, if possible, theserverresource should be left in a state such that it canguaranteebe undeleted. The server is not required to honor this request. INTERNET-DRAFT WebDAV November 19, 1997 The NoUndelete token requests that thelock willresource MUST NOT behonored across all the URLs. 5.2.4 Locking Multiple Resourcesleft in a state such that it can be undeleted. TheLOCK method supports locking multiple resources simultaneously by allowing forVersionDestroy token includes thelistingfunctionality ofseveral URIs intheLOCK request. These URIs, in additionNoUndelete token and extends it to include having theRequest-URI, are thenserver remove all versioning references tobe locked as a result of the LOCK method's invocation. When multiple resources are specifiedtheLOCK method only succeeds if all specified resources are successfully locked.resource that it has control over. 9.6. Enforce-Live-Properties Header EnforceLiveProperties = "Enforce-Live-Properties_ _:" (_*_ | "Omit" | 1*(Property-Name)) Property-Name = Coded-URL TheLock-Tree option of the lock requestEnforce-Live-Properties header specifies properties thatthe resource and all its internal children (including internal collections, and their internal members) are to be locked. This is another mechanism by which a request for a lock on multiple resources can be specified. Currently existing locks can notMUST beextended to cover more or less resources, and any request_live_ after they are copied (moved) toexpand or contractthenumberdestination resource ofresources in a lock MUST fail witha409 Conflict status code. So, for example, if resource A is exclusively write locked and then the same principal asked to exclusively write lock resources A, B, and C,copy (or move). If therequest would fail as Avalue _*_ isalready locked andgiven for thelock can not be extended. A successful result will return a single lock token which representsheader, then it designates all live properties on theresources that have been locked.source resource. Ifan UNLOCKthe value isexecuted"Omit" then the server MUST NOT duplicate onthis token, all associated resourcesthe destination resource any properties that areunlocked. Ifdefined on thelock cansource resource. If this header is notbe grantedincluded then the server is expected toall resources, a 406 Conflict status code MUST be returned with a response entity body containing a multiresponse XML element describing which resource(s) preventedact as defined by the default property handling behavior of the associated method. 9.7. If-None-State-Match If-None-State-Match = "If-None-State-Match" ":" 1#Coded-URL The If-None-State-Match header is intended to have similar functionality to the If-None-Match header defined in section 14.26 of RFC 2068. However thelock from being granted. 5.2.5 Interactionif-none-state-match header is intended for use withother Methods The interaction ofany URI which represents state information about aLOCK with various methodsresource, referred to as a state token. A typical example isdependent upon thea locktype. However, independenttoken. If any oflock type, a successful DELETEthe state tokens identifies the current state ofa resourcethe resource, the server MUSTcause all of its locks to be removed. 5.2.6 Lock Compatibility Table The table below describesNOT perform the requested method. Instead, if thebehavior that occurs when a lockrequestis made onmethod was GET, HEAD, INDEX, or PROPFIND, 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.Current lock state/ Shared Lock Exclusive Lock LockFor all other requestNone True True Shared Lock True False Exclusive Lock False False* Legend: True = lockmethods, the server MUST respond with a status of 412 Precondition Failed. If none of the state tokens identifies the current state of the resource, the server MAYbe granted. False = lockperform the requested method. If any of the tokens is not recognized then the method MUSTNOT be granted. *=iffail with a 412 Precondition Failed. INTERNET-DRAFT WebDAV November 19, 1997 Note that theprincipal requesting"AND" and "OR" keywords specified with thelockIf-State- Match header are intentionally not defined for If-None-State-Match, because this functionality is not required. 9.8. If-State-Match If-State-Match = "If-State-Match" ":" ("AND" | "OR") 1#Coded-URL The If-State-Match header is intended to have similar functionality to theownerIf-Match header defined in section 14.25 of RFC 2068. However thelock, the lock MAY be regranted. The current lockIf-State-Match header is intended for use with any URI which represents stateofinformation about aresourceresource. A typical example isgiven in the leftmost column, anda lockrequests are listed intoken. If thefirst row. The intersection of a rowAND keyword is used andcolumn givesall of theresultstate tokens identify the state ofa lock request. For example, if a shared lock is held on athe resource,and an exclusive lock is requested,then thetable entry is "false", indicatingserver MAY perform thelock must not be granted.requested method. Ifan exclusive or shared lockthe OR keyword isre-requested byused and any of theprincipal who ownsstate tokens identifies thelock,current state of thelock MUST be regranted.resource, then the server MAY perform the requested method. If thelockkeyword requirement for the the keyword used isregranted,not met, thesame lock token that was previously issuedserver MUSTbe returned. 5.2.7 Status Codes 409 "Conflict" - The resource is locked, soNOT perform themethod has been rejected.requested method, and MUST return a 412"Precondition Failed" - The included state-token was not enforceable on this resource or the request inPrecondition Failed response. If any of thelock-info header couldtokens is notbe satisfied byrecognized then theserver. 5.2.8method MUST fail with a 412 Precondition Failed. 9.9. Lock-Info Request HeaderThe Lock-Info request header specifies the scope and type of a lock for a LOCK method request. The syntax specification below is extensible, allowing new type and scope identifiers to be added.LockInfo = "Lock-Info" ":" DAVLockType SP DAVLockScope [SP AdditionalLocks] [SP Lock-Tree] DAVLockType = "LockType" "=" DAVLockTypeValue DAVLockTypeValue = ("Write" |*(uchar | reserved))Extend) DAVLockScope = "LockScope" "=" DAVLockScopeValue DAVLockScopeValue = ("Exclusive" |"Shared" |*(uchar | reserved))Extend) AdditionalLocks = "AddLocks" "=" 1*("<" URI ">") Lock-Tree = "Lock-Tree" "="("True"("T" |"False")"F") The Lock-Info request header specifies the scope and type of a lock for a LOCK method request. The syntax specification below is extensible, allowing new type and scope identifiers to be added. The LockType field specifies the access type of the lock. At present, this specification only defines one lock type, the "Write" lock. The LockScope field specifies whether the lock is an exclusive lock, or a shared lock. The AddLocks field specifies additional URIs, beyond the Request-URI, to which the lock request applies. The LockTree field is used to specify recursive locks. If the LockTree field is"true","T", the lock request applies to the hierarchy traversal of the internalmembersmember resources of the Request-URI, and the AddLocks URIs, inclusive of the Request-URI and the AddLocks URIs. It is not an error if LockTree istrue,"T", and the Request-URI or the AddLocks URIs have no internal member resources. By default, INTERNET-DRAFT WebDAV November 19, 1997 the value of LockTree is"false","F", and this field MAY be omitted when its value isfalse. 5.2.9 Owner"F". 9.10. Lock-Token Request Header5.2.9.1 Problem Description When discoveringLock-Token = "Lock-Token" ":" 1#Coded-URL The Lock-Token request header, containing a lock token owned by thelistrequesting principal, is used by the principal to indicate that the principal is aware ofownersthe existence oflocks onthe lock specified by the lock token. If the following conditions are met: 1) The method is restricted by aresource,lock type that requires the submission of aprincipal may wantlock token, such as a write lock, 2) The user-agent has authenticated itself as a principal, 3) The user-agent is submitting a method request to a resource on which the principal owns a write lock, Then: 1) The method request MUST include a Lock-Token header with the lock token, or, 2) The method MUST fail with a 409 Conflict status code. If multiple resources are involved with a method, such as a COPY or MOVE method, then the lock tokens, if any, for all involved resources, MUST beableincluded in the Lock-Token request header. For example, Program A, used by user A, takes out a write lock on a resource. Program A then makes a number of PUT requests on the locked resource. All the requests contain a Lock-Token request header that includes the write lock state token. Program B, also run by User A, then proceeds tocontactperform a PUT to the locked resource. However, program B was not aware of theowner directly. For thisexistence of the lock and so does not include the appropriate Lock-Token request header. The method is rejected even though principal A is authorized tobe possibleperform the PUT. Program B can, if it so chooses, now perform lock discoverymechanism must provide enough information forand obtain the lockowner to be contacted. Additionally,token. Note that programsmay wish to be able to record structured information inA and B can perform GETs without using theownerLock-Token headerso that other programs may be ablebecause the ability toparse it later. Note, however, that these programs mayperform a GET is notnecessarily be coordinating so there need beaffected by a write lock. Having a lock token provides noguarantee that the informationspecial access rights. Anyone can find out anyone else's lock token by performing lock discovery. Locks are to beparsed. 5.2.9.2 Solution Requirements Not all systems haveenforced based upon whatever authenticationprocedures that provide sufficient information to identify a particular user inmechanism is used by the server, not based on the secrecy of the token values. 9.11. Lock-Token Response Header INTERNET-DRAFT WebDAV November 19, 1997 Lock-Token = "Lock-Token" ":" Coded-URL If away thatresource ismeaningful tosuccessfully locked then aperson. In addition, many systemsLock-Token header will be returned containing the lock token thatdo have sufficient information, such asrepresents the lock. 9.12. Overwrite Header Overwrite = "Overwrite" ":" ("T" | "F") The Overwrite header specifies whether the server should overwrite the state of aname and e-mail address, do not havenon-null destination resource during a COPY or MOVE. A value of _F_ states that the server MUST NOT perform the COPY or MOVE operation if the state of theability to associate this information withdestination resource is non-null. By default, thelock discovery mechanism. Therefore a meansvalue of Overwrite isneeded to allow principals to provide authentication in a manner which will be meaningful to_T,_ and aperson. The Fromclient MAY omit this header(defined in RFC 2068), which contains only an email mailbox,from a request when its value isnot sufficient for_T._ While thepurposes of quick identification. When desperately looking for someoneOverwrite header appears toremove a lock, e-mail is often not sufficient. A telephone number (cell number, pager number, etc.) would be better. Furthermore,duplicate theemail address infunctionality of theFromIf- Match: * header of HTTP/1.1, If-Match applies onlyoptionally includes the owners name and that name is often settoan alias anyway. Therefore a header more flexible than From is required. The value also needs to be such that both man and machine can place values in itthe Request- URI, andlater retrieve those values. 5.2.9.3 Syntax Owner = "Owner" ":" (Coded-XML | quoted-string) Coded-XML = field-content ; XML where any character which isnotlegal in field-content (see section 4.2 of [Fielding et al., 1997]) is XML encoded The XML SHOULD provide information sufficient for either directly contactingto theprincipal (such asDestination of atelephone numberCOPY ore-mail URI),MOVE. If a COPY orfor discovering the principal (such asMOVE is not performed due to theURLvalue ofa homepage) who owns the lock. The quoted string SHOULD provide a means for directly contactingtheprincipal who ownsOverwrite header, thelock, such asmethod MUST fail with aname and telephone number. 5.2.10 Time-Out409 Conflict status code. 9.13. Propfind Request Header5.2.10.1 Problem Description In a perfect world principals take out locks, work on the resource, and then remove the lock when it is no longer needed. However, this processPropfind = "Propfind" ":" ("allprop" | "propname" | RFC-Reg | 1*(Property-Name)) The Propfind header isfrequently not completed, leaving active but unused locks. Reasons for this include client programs crashing and losing information about locks, users leaving their systems for the day and forgettingused toremove their locks, etc. As a result of this behavior, servers needspecify which properties are toestablishbe returned in apolicyPROPFIND method. The properties are identified bywhich they can remove a lock without input fromtheir URIs. Two special tokens are defined for use with thelock owner. Once such a policy is instituted,Propfind header, allprop and propname. The allprop token specifies that all property names and values on theserver also needs a mechanismresource are toinform the principalbe returned. The propname token specifies that only a list of property names on thepolicy. 5.2.10.2 Solution Requirements Thereresource aretwo basic lock removal policies: administrator and time based removal. In the case of administrator based removal, a principal other thanto be returned. 9.14. Status-URI Response Header The Status-URI response header MAY be used with thelock owner has sufficient access rights102 Processing response code toorderinform thelock removed, even though they did not take it out. The second policy type is time based removal. In this case, a timer is set as soonclient as to thelock is created. Every timestatus of amethodmethod. Status-URI = "Status-URI" ":" *(Status-Code "<" URI ">") ; Status- Code isexecuted on any resource covered by the lock,defined in 6.1.1 of [Fielding et al., 1997] The URIs listed in thetimer is reset. Ifheader are source resources which have been affected by thetimer runs out,outstanding method. The status code indicates thelock is removed. User-agents MUST assume that locks may arbitrarily disappear at any time. If their actions require confirmationresolution of theexistence ofmethod on the identified resource. So, for example, if a MOVE method on a collection is outstanding and alock then102 "Processing" response with a Status-URI response header is returned, theIf-State headers are available. 5.2.10.3 Syntaxincluded URIs will indicate resources that have had move attempted on them and what the result was. 9.15. Timeout Header INTERNET-DRAFT WebDAV November 19, 1997 TimeOut ="Time-Out""Timeout" ":" 1#TimeType TimeType = ("Second-" DAVTimeOutVal | "Infinite" |Extend)Other) DAVTimeOutVal = 1*digitExtend = RFC-Reg | URL "-" Token ; The URL format is used for unregistered TimeTypes RFC-ReqOther =TokenExtend field-value ;This is a TimeType that has been published as anSee section 4.2 of RFC 2068 Clients MAY includeTimeOutTimeout headers in their LOCK requests.HoweverHowever, the server is not required to honor or even considerthe request.these requests. Clients MUST NOT submit aTime-OutTimeout request header with any method other than a LOCK method. ATime-OutTimeout request header MUST contain at least one TimeType and MAY contain multiple TimeType entries. The purpose of listing multiple TimeType entries is to indicate multiple different values and value types that are acceptable to the client. The client lists the TimeType entries in order of preference. TheTime-OutTimeout response header MUST use a Second value, Infinite, or a TimeType the client has indicated familiarity with. The server MAY assume a client is familiar with any TimeType submitted in aTime-OutTimeout header. The"Second"_Second_ TimeType specifies the number of seconds that MUST elapse between granting of the lock at the server, and the automatic removal of the lock. A server MUST not generate atime outtimeout value for"Second"_Second_ greater than 2^32-1. Thetime outtimeout counter is restarted any time an owner of theclientlock sends a method to any member of the lock, including unsupported methods, or methods which are unsuccessful. It is recommended that the HEAD method be used when the goal is simply to restart thetime outtimeout counter. If the timeout expires then the lock is lost. Specifically the server SHOULD act as if an UNLOCK method was executed by the server on the resource using the lock token of the timed-out lock, performed with its override authority. Thuslogs, notifications, and other mechanisms that act as side effects to the granting and removal of a lock willlogs should beproperly informed as toupdated with the disposition of thelock.lock, notifications should be sent, etc., just as they would be for an UNLOCK request. Servers are advised to pay close attention to the values submitted by clients, as they will be indicative of the type of activity the client intends to perform. For example, an applet running in a browser may need to lock a resource, but because of the instability of the environment within which the applet is running, the applet may be turned off without warning. As a result, the applet is likely to ask for a relatively smalltime- outtimeout value so that if the applet dies, the lock can be quickly harvested.HoweverHowever, a document management system is likely to ask for an extremely longtime-outtimeout because its user may be planning on going off-line.5.2.11 LockINTERNET-DRAFT WebDAV November 19, 1997 10. ResponseA successful lock response MUST contain a Lock-TokenCode Extensions to HTTP/1.1 The following responseheader, a Time-Out header and a PROP elementcodes are added to those defined inthe response body which contains the value of the LockDiscovery property. 5.2.11.1 Lock-Token Response Header If a resource is successfully locked then a lock-token header will be returned containing the lock token that represents the lock. Lock-Token = "Lock-Token" ":" URI 5.2.12 Example - Simple Lock Request LOCK /workspace/webdav/proposal.doc HTTP/1.1 Host: webdav.sb.aol.com Lock-Info: LockType=Write LockScope=Exclusive Time-Out: Infinite; Second-4100000000 Owner: <?XML:Namespace href="http://www.ietf.org/standards/dav/" AS = "D"/><D:HREF>http://www.ics.uci.edu/~ejw/contact.html</D:HREF>HTTP/1.1200 OK Lock-Token: OpaqueLockToken:xyz122393481230912asdfa09s8df09s7df08 sd0f98a098sda Time-Out: Second-604800 Content-Type: text/xml Content-Length: xxxxx <?XML:Namespace href ="http://www.ietf.org/standards/dav/" AS = "D"/> <D:Prop> <lockdiscovery> <activelock> <locktype>write</locktype> <lockscope>exclusive</lockscope> <addlocks/> <owner> <HREF>http://www.ics.uci.edu/~ejw/contact.html</HREF> </owner> <timeout>Second-604800</timeout> <locktoken> <HREF> OpaqueLockToken:xyz122393481230912asdfa09s8df09s7d f08sd0f98a098sda </HREF> </locktoken> </activelock> </lockdiscovery> </D:Prop> This example shows the successful creation[Fielding et al., 1997]. 10.1. 102 Processing Methods can potentially take a long period ofan exclusive write lock on resource http://webdav.sb.aol.com/workspace/webdav/proposal.doc. The resource http://www.ics.uci.edu/~ejw/contact.html contains contact informationtime to process, especially methods that support the Depth header. In such cases the client may time-out the connection while waiting for a response. To prevent this theowner ofserver MAY return a 102 response code to indicate to the client that thelock. Theserverhas an activity-based timeout policy in place on this resource, which causesis still processing thelockmethod. If a method is taking longer than 20 seconds (a reasonable, but arbitrary value) toautomatically be removed after 1 week (604800 seconds).process the server SHOULD return a 102 "Processing" response. 10.2. 207 Multi-Status The responsehas a Lock-Token header that gives the state token URLrequires providing status for multiple independent operations. 10.3. 418 Unprocessable Entity The server understands the content type of thelock token generated by this lock request. 5.2.13 Example - Multi-Resource Lock Request LOCK /workspace/webdav/proposal.doc HTTP/1.1 Host: webdav.sb.aol.com Lock-Info: LockType=Write LockScope=Exclusive Addlocks=<http://webdav.sb.aol.com/workspace/><http://foo.bar/bla h> Time-Out: Infinite, Second-4100000000 Owner: <http://www.ics.uci.edu/~ejw/contact.html> HTTP/1.1 409 Conflict Content-Type: text/xml Content-Length: xxxxx <?XML:Namespace href = "http://www.ietf.org/standards/dav/" As = "D"/> <D:MultiResponse> <Response> <HREF> http://webdav.sb.aol.com/workspace/webdav/proposal.doc </HREF> <HREF> http://webdav.sb.aol.com/workspace/webdav/ </HREF> <Status>HTTP/1.1 202 Accepted</Status> </Response> <Response> <HREF>http://foo.bar/blah</HREF> <Status>HTTP/1.1 403 Forbidden</Status> </Response> </D:MultiResponse> This example shows arequestfor an exclusive write lockentity, but was unable to process the contained instructions. 10.4. 419 Insufficient Space onthree resources, http://webdav.sb.aol.com/workspace/webdav/proposal.doc, http://webdav.sb.aol.com/workspace/, and http://foo.bar/blah. InResource The resource does not have sufficient space to record the state of the resource after the execution of thisrequest,method. 10.5. 420 Method Failure The method was not executed on a particular resource within its scope because some part of theclient has specified that it desires an infinite length lock,method's execution failed causing the entire method to be aborted. For example, ifavailable, otherwiseatimeoutresource could not be moved as part of4.1 billion seconds, if available. The Owner header field specifies the web address for contact information fora MOVE method, all theprincipal taking outother resources would fail with a 420 Method Failure. 10.6. 421 Destination Locked The destination resource of a method is locked, and either thelock. This lockrequesthas failed, because the server rejecteddid not contain a valid Lock-Info header, or the Lock-Info header identifies a lockrequest for http://foo.bar/blah.held by another principal. 11. Multi-Status Response The409 Conflict status code indicates that the server was unable to satisfy the request because theredefault 207 Multi-Status response body is aconflict between the statetext/xml HTTP entity that contains a single XML element called multistatus, which contains a set ofthe resourcesXML elements called response, one for each 200, INTERNET-DRAFT WebDAV November 19, 1997 300, 400, andthe operation named in the request. Within the multiresponse, the 202 Accepted500 series status codeindicates thatgenerated during thelockmethodwas accepted by the resources, and would have been completed if all resources named in the request were able toinvocation. 100 series status codes MUST NOT belocked.recorded in a response XML element. 11.1. multistatus XML Element Name: multistatus Namespace: http://www.ietf.org/standards/dav/ Purpose: Contains multiple response messages. Parent: Any Value: 1*response [responsedescription] Description: The403 Forbidden status code indicates that the server does not allow lock requests on this resource. 5.3 Write Lock This section describes the semantics specific toresponsedescription at thewrite access type for locks. The write locktop level is used to provide aspecific instancegeneral message describing the overarching nature ofa lock type, and istheonly lock type described inresponse. If thisspecification. 5.3.1 Methods Restricted by Write Locks A write lock prevents a principal withoutvalue is available an application MAY use it instead of presenting the individual response descriptions contained within thelock from successfully executingresponses. 11.2. response XML Element Name: response Namespace: http://www.ietf.org/standards/dav/ Purpose: Holds aPUT, POST, PATCH, PROPPATCH, MOVE, DELETE, MKCOL, ADDREFsingle response Parent: multistatus Value: href [prop] status [responsedescription] Description: Prop MUST contain one orDELREF onmore empty XML elements representing thelocked resource. All other current methods, GET in particular, function independentnames ofthe lock. Note, however, that as new methods are created it willproperties. Multiple properties may benecessaryincluded if the same response applies to them all. If href is used then the response refers tospecify how they interact with a write lock. 5.3.2 Write Locks and Properties While those withoutawrite lock mayproblem with the referenced resource, notalteraproperty onproperty. 11.3. status XML Element Name: status Namespace: http://www.ietf.org/standards/dav/ Purpose: Holds aresource it is still possible for the values of live properties to change, even while locked, duesingle HTTP status-line Parent: response Value: status-line ;status-line defined in [Fielding et al., 1997] 11.4. responsedescription XML Element Name: responsedescription Namespace: http://www.ietf.org/standards/dav/ Purpose: Contains a message that can be displayed to therequirementsuser explaining the nature oftheir schemas. Only dead properties and live properties definedthe response. Parent: multistatus | response Value: Any Description: This XML element provides information suitable torespect locks are guaranteedbe presented tonot change while write locked. Ifapropertyuser. 12. Generic DAV XML Elements INTERNET-DRAFT WebDAV November 19, 1997 12.1. href XML Element Name: href Namespace: http://www.ietf.org/standards/dav/ Purpose: To identify that the content of the element iswrite locked thenaLOCK request on the associated resource MUST fail withURI. Parent: Any Value: URI ; See section 3.2.1 of [Fielding et al., 1997] 12.2. link XML Element Name: link Namespace: http://www.ietf.org/standards/dav/ Purpose: To identify a property as a409 "Conflict". Notelink and to contain the source and destination of that link. Values= 1*src 1*dst Description: Link is used to provide the sources and destinations of awrite lock on alink. The type of the propertyMAY be extended to includecontaining theassociated resource withoutlink XML element provides theprincipal having explicitly requestedtype of theextension. 5.3.3 Write Locks and Null Resources Itlink. Link ispossible to assert a write lock onanull resource in ordermulti-valued element, so multiple Links may be used together tolockindicate multiple links with thename. Please note, however, that lockingsame type. 12.2.1. src XML Element Name: src Namespace: http://www.ietf.org/standards/dav/ Purpose: To indicate the source of anull resource effectively makeslink. Parent: link Values= URI 12.2.2. dst XML Element Name: dst Namespace: http://www.ietf.org/standards/dav/ Purpose: To indicate theresource non-null asdestination of a link Parent: link Values= URI 12.2.3. Example <?XML version="1.0"> <?namespace href = "http://www.ietf.org/standards/dav/" AS = "D"?> <?namespace href = "http://www.foocorp.com/Project/" AS = "F"?> <D:prop> <D:Source> <D:link> <F:projfiles>Source</F:projfiles> <D:src>http://foo.bar/program</D:src> <D:dst>http://foo.bar/src/main.c</D:dst> </D:link> <D:link> <F:projfiles>Library</F:projfiles> INTERNET-DRAFT WebDAV November 19, 1997 <D:src>http://foo.bar/program</D:src> <D:dst>http://foo.bar/src/main.lib</D:dst> </D:link> <D:link> <F:projfiles>Makefile</F:projfiles> <D:src>http://foo.bar/program</D:src> <D:dst>http://foo.bar/src/makefile</D:dst> </D:link> </D:Source> </D:prop> In this example the resourcenowhttp://foo.bar/program haslock related properties defined on it. 5.3.4 Write Locks and Collections A write lock onacollection prevents the addition or removalsource property that contains three links. Each link contains three elements, two ofmemberswhich, src and dst, are part of thecollection. As a consequence, when a principal issues a request to create a new internal member of a collection using PUT or POST, or to remove an existing internal member of a collection using DELETE,DAV schema defined in thisrequest MUST fail ifdocument, and one which is defined by the schema http://www.foocorp.com/project/ (Source, Library, and Makefile). A client which only implements theprincipal doeselements in the DAV spec will nothave a write lock onunderstand thecollection. However, if a write lock request is issuedfoocorp 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 toa collection containing internal member resources that are currently locked,present therequest MUST failuser witha 409 Conflict status code. 5.3.5 Write Locks and COPY/MOVE The owneradditional information about the links. This example demonstrates the power of XML markup that allows for element values to be enhanced without breaking older clients. 12.3. prop XML element Name: prop Namespace: http://www.ietf.org/standards/dav/ Purpose: Contains properties related to awrite lock MUST NOT executeresource. Parent: Any Values: XML Elements Description: The prop XML element is aMOVE methodgeneric container for properties defined ona resource they have locked. This specification intentionally does notresources. All elements inside prop MUST definewhat happens if a MOVE method request is made onproperties related to the resource. No other elements may be used inside of alocked resource byprop element. 13. DAV Properties 13.1. creationdate Property Name: creationdate Namespace: http://www.ietf.org/standards/dav/ Purpose: The time and date thelock's owner. A COPY method invocationresource was created. Value: The time and date MUSTNOT duplicate any write locks activebe given in ISO 8601 format [ISO8601] Description: This property SHOULD be defined onthe source. 5.3.6 Re-issuing Write Locksall DAV compliant resources. Ifa principal already owns a write lock on a resource, any future requests for the same typepresent, it contains a timestamp ofwrite lock, onthesame resource, whilemoment when theprincipal's previous write lock is in effect, MUST result in a successful response withresource was created (i.e., thesame lock token as providedmoment it had non-null state). 13.2. displayname Property INTERNET-DRAFT WebDAV November 19, 1997 Name: displayname Namespace: http://www.ietf.org/standards/dav/ Purpose: A name for thecurrently existing lock. Two lock requests are definedresource that is suitable for presentation to a user. Value: Any valid XML character data (as defined in [Bray, Sperberg-McQueen, 1997]) Description:This property SHOULD beidentical if their Lock-Info headers are identical. 5.3.7 Write Locks and The State-Token Header 5.3.7.1 Problem Definitiondefined on all DAV compliant resources. If present, the property contains auser agentdescription of the resource that isnot requiredsuitable for presentation tohave knowledge about a lock when requesting an operation onalocked resource,user. 13.3. get-content-language Property Name: get-content-language Namespace: http://www.ietf.org/standards/dav/ Purpose: Contains thefollowing scenario might occur. Program A, runContent-Language header returned byUser A, takes out a write lock onaresource. Program B, also run by User A, hasGET without accept headers. If noknowledgeContent-Language header is available, this property MUST NOT exist. Value: language-tag ;language-tag is defined in section 14.13 of RFC 2068 13.4. get-content-length Property Name: get-content-length Namespace: http://www.ietf.org/standards/dav/ Purpose: Contains thelock taken outContent-Length header returned byProgram A, yet performsaPUT toGET without accept headers. If no Content-Length header is available, this property MUST NOT exist. Value: content-length ; see section 14.14 of RFC 2068 13.5. get-content-type Property Name: get-content-type Namespace: http://www.ietf.org/standards/dav/ Purpose: Contains thelocked resource. InContent-Type header returned by a GET without accept headers. If no Content-Type header is available, thisscenario,property MUST NOT exist. Value: media-type ; defined in Section 3.7 of [Fielding et al., 1997] 13.6. get-etag Property Name: get-etag Namespace: http://www.ietf.org/standards/dav/ Purpose: Contains thePUT succeeds because locks are associated with a principal, notETag header returned by aprogram, and thus program B, because it is acting with principal A’s credential,GET without accept headers. If no ETag header isallowed to performavailable, this property MUST NOT exist. Value: entity-tag ; defined in Section 3.11 of [Fielding et al., 1997] Description:Note that thePUT. However, had program B known aboutETag on some resource may reflect changes in any part of thelock, it would not have overwrittenstate of the resource,preferring instead to present a dialog box describing the conflict to the user. Due to this scenario,not necessarily just amechanism is neededchange toprevent different programs from accidentally ignoring locks taken out by other programs withthesame authorization. 5.3.7.2 Solution Requirement The solution must not require principals to perform discovery in order to prevent accidental overwrites as this could cause race conditions. The solution must not require that clients guess what sorts of locks might be used and use if-state-match headers with wildcards to prevent collisions. The problem with tryingresponse to"guess" which locks are being used is that new lock types might be introduced, andtheprogram would not know to "guess them". So, forGET method. For example, aclient might putchange inan if-state-match header with a wildcard specifying that if any write lock is outstanding thentheoperation should fail. However a new read/write lock could be introduced whichACL may cause theclient would not knowETag toput inchange. INTERNET-DRAFT WebDAV November 19, 1997 13.7. get-last-modified Property Name: get-last-modified Namespace: http://www.ietf.org/standards/dav/ Purpose: Contains theheader. 5.3.7.3 State-Token Header The State-Token header, containing a lock token ownedLast-Modified header returned bythe requesting principal,a GET method without accept headers. If no Last-Modified header isused by the principal to indicateavailable, this property MUST NOT exist. Value: HTTP-date ; defined in Section 3.3.1 of [Fielding et al., 1997] Description:Note that theprincipal is awarelast-modified date on some resource may reflect changes in any part of theexistencestate of thelock specified by the lock token. It is used inresource, not necessarily just a change to thefollowing way. Ifresponse to thefollowing conditions are met: 1.GET method. For example, auser-agent has authenticated itself aschange in aprincipal, 2.property may cause theuser-agent is submitting a method requestlast-modified date toa resource on which the principal owns a write lock, 3.change. 13.8. index-content-language Property Name: index-content-language Namespace: http://www.ietf.org/standards/dav/ Purpose: Contains themethod is restrictedContent-Language header returned bya write lock, asan INDEX without accept headers. If no Content-Language header is available, this property MUST NOT exist. Value: language-tag ;language-tag is defined inthesection"Methods Restricted14.13 of RFC 2068 13.9. index-content-length Property Name: index-content-length Namespace: http://www.ietf.org/standards/dav/ Purpose: Contains the Content-Length header returned bya Write Lock", thenan INDEX without accept headers. If no Content-Length header is available, this property MUST NOT exist. Value: content-length ; see section 14.14 of RFC 2068 13.10. index-content-type Property Name: index-content-type Namespace: http://www.ietf.org/standards/dav/ Purpose: Contains themethod requestContent-Type header returned by an INDEX without accept headers. If no Content-Type header is available, this property MUSTinclude a State-TokenNOT exist. Value: media-type ; defined in Section 3.7 of [Fielding et al., 1997] 13.11. index-etag Property Name: index-etag Namespace: http://www.ietf.org/standards/dav/ Purpose: Contains the ETag headerwithreturned by an INDEX without accept headers. If no ETag header is available, this property MUST NOT exist. INTERNET-DRAFT WebDAV November 19, 1997 Value: entity-tag ; defined in Section 3.11 of [Fielding et al., 1997] Description:Note that thelock tokenETag on some resource may reflect changes in any part of thewrite lock, orstate of themethod fails with a 409 Conflict status code. If multiple resources are involved with a method, such asresource, not necessarily just aCOPY or MOVE method, thenchange to thelock tokens, if any, for all involved resources, MUST be included inresponse to theState- Token request header.INDEX method. For example,Program A, used by user A, takes out a write lock on a resource. Program A then makesanumber of PUT requests onchange in thelocked resource, allACL may cause therequests contain a State-Token header which includesETag to change. 13.12. index-last-modified Property Name: index-last-modified Namespace: http://www.ietf.org/standards/dav/ Purpose: Contains thewrite lock state token. Program B, also runLast-Modified header returned byUser A, then proceeds to perform a PUT toan INDEX method without accept headers. If no Last-Modified header is available, this property MUST NOT exist. Value: HTTP-date ; defined in Section 3.3.1 of [Fielding et al., 1997] Description:Note that thelocked resource. However program B was not awarelast-modified date on some resource may reflect changes in any part of theexistencestate of thelock and so doesresource, notinclude the appropriate state-token header. The method is rejected even though principal A is authorizednecessarily just a change toperform the PUT. Program B can, if it so chooses, now perform lock discovery and obtainthelock token. Note that program A and B can perform GETs without usingresponse to thestate-token header becauseINDEX method. For example, a change in a property may cause theabilitylast-modified date toperformchange. 13.13. lockdiscovery Property Name: lockdiscovery Namespace: http://www.ietf.org/standards/dav/ Purpose: To discover what locks are active on aGET is not affected byresource Values= *activelock Description:The lockdiscovery property returns awrite lock. Havinglisting of who has a lock, what type of lockstate token provides no special access rights. Anyone can find out anyone else’s lock state token by performing lock discovery. Locks are to be enforced based upon whatever authentication mechanism is used by the server, not based onhe have, thesecrecy oftimeout type and thetoken values. 5.3.7.3.1 Example COPY /~fielding/index.html HTTP/1.1 Host: www.ics.uci.edu Destination: http://www.ics.uci.edu/users/f/fielding/index.html State-Token: <OpaqueLockToken:123AbcEfg1284h23h2> <OpaqueLockToken:AAAASDFcalkjfdas12312> HTTP/1.1 200 OK In this example, bothtime remaining on thesourcetimeout, anddestination are locked so twothe associated locktokens must be submitted. If only onetoken. The server is free to withhold any or all of this information if thetwo resources was locked, then only one token wouldrequesting principal does not have sufficient access rights tobe submitted. 5.4 Lock Tokens 5.4.1 Problem Description It is possible that once a lock has been granted it may be removed withoutsee thelock owner’s knowledge. This can cause serialization problems ifrequested data. A server which supports locks MUST provide thelock owner executes methods thinking their lock is still active. Due to this,lockdiscovery property on any resource with locks on it. 13.13.1. activelock XML Element Name: activelock Namespace: http://www.ietf.org/standards/dav/ Purpose: A multivalued XML element that describes amechanism is needed forparticular active lock on aprincipal to predicateresource Parent: lockdiscovery Values= locktype lockscope [addlocks] owner timeout locktoken 13.13.2. owner XML Element Name: owner Namespace: http://www.ietf.org/standards/dav/ Purpose: Returns owner information Parent: activelock Values= XML:REF | *PCDATA INTERNET-DRAFT WebDAV November 19, 1997 13.13.3. timeout XML Element Name: timeout Namespace: http://www.ietf.org/standards/dav/ Purpose: Returns information about the timeout associated with thesuccessful execution of a message uponlock Parent: activelock Values= TimeType 13.13.4. addlocks XML Element Name: addlocks Namespace: http://www.ietf.org/standards/dav/ Purpose: Lists additional resources associated with this lock, if any. Parent: activelock Values= 1*href 13.13.5. locktoken XML Element Name: locktoken Namespace: http://www.ietf.org/standards/dav/ Purpose: Returns thecontinuing existence of a lock. 5.4.2 Lock Token Introduction Alock tokenisParent: activelock Values= href Description:The href contains atype of state token that describesLock-Token-URL. 13.13.6. Example PROPFIND /container/ HTTP/1.1 Host: www.foo.bar Content-Length: xxxx Content-Type: text/xml <?XML version="1.0"> <?namespace href = "http://www.ietf.org/standards/dav/" AS = "D"?> <D:propfind> <D:prop><lockdiscovery/></D:prop> </D:propfind> HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: xxxxx <?XML version="1.0"> <?namespace href ="http://www.ietf.org/standards/dav/" AS = "D"?> <D:multistatus> <D:response> <D:prop> <D:lockdiscovery> <D:activelock> INTERNET-DRAFT WebDAV November 19, 1997 <D:locktype>write</D:locktype> <D:lockscope>exclusive</D:lockscope> <D:addlocks> <D:href>http://foo.com/doc/</D:href> </D:addlocks> <D:owner>Jane Smith</D:owner> <D:timeout>Infinite</D:timeout> <D:locktoken> <D:href>iamuri:unique!!!!!</D:href> </D:locktoken> </D:activelock> </D:lockdiscovery> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:response> </D:multistatus> This resource has aparticular lock. A lock token is returned by every successful LOCK operation, and can also be discovered throughsingle exclusive write lockdiscoveryona resource. There are two types of lock tokens, a generic lock token, which is unique only for a particular resource, andit, with anopaqueinfinite timeout. This same locktoken, which is unique across all resources for all time. Uniqueness for a particularalso covers the resourceprevents problems with long held outstanding lock tokens being confused with newer tokens.http://foo.com/doc/. 13.14. resourcetype Property Name: resourcetype Namespace: http://www.ietf.org/standards/dav/ Purpose: Thisuniqueness requirement is the same as for e-tags. Uniqueness across all resources for all time allows for tokens to be submitted across resources and servers without fearproperty contains a series ofconfusion. Generic lock tokens, becauseXML elements that specify information regarding the nature oftheir relaxed uniqueness requirements, are faster to generate than opaque lock tokens. 5.4.3 Generic Lock Tokens Any valid URI canthe resource. This specification only defines a single value, collection. Value: XML elements Description:This property MUST beused bydefined on all DAV compliant resources. The default value is empty. 13.14.1. collection XML Element Name: collection Namespace: http://www.ietf.org/standards/dav/ Purpose: Identifies the associated resource as ageneric lock token.collection. Collection resources MUST define this value with the resourcetype property. Parent: resourcetype Values: None 13.15. Source Link Property Type Name: source Namespace: http://www.ietf.org/standards/dav/link/ Purpose: Theonly requirement is thatdestination of thelock token MUST never have been issued previously on that resource. Because a lock token is only guaranteed to be unique onsource link identifies the resource thatgenerated it,contains thelock token MUST NOT be submitted in a state- token request headerunprocessed source of the link's source. Parent: None Value: An XML document with zero oran if-state[-not]-match header on any resource butmore link XML elements. INTERNET-DRAFT WebDAV November 19, 1997 Discussion: The source of the link (src) is typically the URI of the output resourcethat generated it. 5.4.4 OpaqueLockToken Lock Token The opaquelocktoken schemeon which the link isdesigned todefined, and there is typically only one destination (dst) of the link, which is the URI where the unprocessed source of the resource may beunique across all resources for all time. Due toaccessed. When more than one link destination exists, thisuniqueness quality,specification asserts no policy on ordering. 13.16. supportedlock Property Name: supportedlock Namespace: http://www.ietf.org/standards/dav/ Purpose: To provide aclient MAY submit an opaquelisting of the locktoken in a state-token request header and an if-state[-not]-match header oncapabilities supported by the resource. Values: An XML document containing zero or more LockEntry XML elements. Description:The supportedlock property of a resourceother than the one that returned it. All resources MUST recognizereturns a listing of theopaquelocktoken schemecombinations of scope and access types which may beable to, at minimum, recognize that thespecified in a locktoken was not generated byrequest on the resource.Note, however,Note thatresourcesthe actual contents are themselves controlled by access controls so a server is not required togenerate opaquelocktokens. In order to guarantee uniqueness across all resources for all timeprovide information theopaquelocktoken requiresclient is not authorized to see. If supportedlock is available on _*_ then it MUST define theuseset of locks allowed on all resources on that server. 13.16.1. lockentry XML Element Name: lockentry Namespace: http://www.ietf.org/standards/dav/ Purpose: Defines a DAVLockType/LockScope pair that may be legally used with a LOCK on theGUID mechanism. Opaquelocktoken generators however havespecified resource. Parent: supportedlock Values= locktype lockscope 13.16.2. locktype XML Element Name: locktype Namespace: http://www.ietf.org/standards/dav/ Purpose: Lists achoiceDAVLockType Parent: lockentry Values= DAVLockTypeValue 13.16.3. lockscope XML Element Name: lockscope Namespace: http://www.ietf.org/standards/dav/ Purpose: Lists a DAVLockScope Parent: lockentry Values: DAVLockScopeValue 13.16.4. Example PROPFIND /container/ HTTP/1.1 Host: www.foo.bar INTERNET-DRAFT WebDAV November 19, 1997 Content-Length: xxxx Content-Type: text/xml <?XML version="1.0"> <?namespace href = "http://www.ietf.org/standards/dav/" AS = "D"?> <D:propfind> <D:prop><supportedlock/></D:prop> </D:propfind> HTTP/1.1 207 Multi-Status Content-Type: text/xml Content-Length: xxxxx <?XML version="1.0"> <?namespace href ="http://www.ietf.org/standards/dav/" AS = "D"?> <D:multistatus> <D:response> <D:prop> <D:supportedlock> <D:LockEntry> <D:locktype>Write</D:locktype> <D:lockscope>Exclusive</D:lockscope> </D:LockEntry> <D:LockEntry> <D:locktype>Write</D:locktype> <D:lockscope>Shared</D:lockscope> </D:LockEntry> </D:supportedlock> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:response> </D:multistatus> 14. DAV Compliance Levels A DAV compliant resource can choose from two levels ofhow they create these tokens. Theycompliance. A client caneither generatediscover which level anew GUID for every lock token they create,resource supports by executing OPTIONS on the resource, and examining the "DAV" header which ispotentially very expensive, or they can create a single GUIDreturned. Since this document describes extensions to the HTTP/1.1 protocol, minimally all DAV compliant resources, clients, andthen add extension characters. Ifproxies MUST be compliant with RFC 2068 [Fielding et al., 1997]. 14.1. Level 1 A level 1 compliant resource MUST meet all "MUST" requirements in all sections of this document. 14.2. Level 2 INTERNET-DRAFT WebDAV November 19, 1997 A level 2 compliant resource MUST meet all level 1 requirements and support thesecond method is selected thensupportedlock property as well as theprogram generatingLOCK method. 15. Internationalization Considerations In theextensions MUST guarantee thatrealm of internationalization issues, this specification is substantively in compliance with thesame extension will neverIETF Character Set Policy [Alvestrand, 1997]. In this specification, human-readable fields can beused twice withfound in either theassociated GUID. Opaque-Lock-Token = "OpaqueLockToken" ":" GUID [Extension] GUID = ; As definedvalue of a property, or in[LEACH] Extension = *urlc ;urlc is definedan error message returned in[Berners-Lee et al., 1997] (draft-fielding-url-syntax-07.txt) 5.5 UNLOCK Method 5.5.1 Problem Definition The UNLOCK method removesa response entity body. In both cases, thelock identifiedhuman- readable content is encoded using XML, which has explicit provisions for character set tagging and encoding, and requires by default that XML processors read XML elements encoded using thelock token in the State-Token header from the Request-URI,UTF-8 andallUCS-2 encodings of the ISO 10646 basic multilingual plane. Furthermore, XML contains provisions for encoding XML elements using otherresources includedencoding schemes, notable among them UCS-4, which permits encoding of characters from any ISO 10646 character plane. The default character set encoding for XML data inthe lock. 5.5.2 Example UNLOCK /workspace/webdav/info.doc HTTP/1.1 Host: webdav.sb.aol.com State-Token: OpaqueLockToken:123AbcEfg1284h23h2 HTTP/1.1 200 OK Inthisexample,specification, and in general, is UTF-8. WebDAV compliant applications MUST support thelock identified byUTF-8 and UCS-2 character set encodings for XML elements, and SHOULD support thelock token "OpaqueLockToken:123AbcEfg1284h23h2"UCS-4 encoding. The XML character set encoding declaration for each supported character set MUST also be supported, since it issuccessfully removed from the resource http://webdav.sb.aol.com/workspace/webdav/info.doc. Ifby using thislock included more than just one resource,encoding declaration that an XML processor determines thelock is removed from those resources as well. 5.6 Discovery Mechanisms 5.6.1 Lock Capability Discovery 5.6.1.1 Problem Definition Since server lock support is optional, a client tryingencoding of an element. XML also provides language tagging capability which provides the ability tolock a resource on a server can either tryspecify thelocklanguage of the contents of a particular XML element. Although XML, andhopehence WebDAV, does not use RFC 1766 language tags for its language names, thebest, or perform some formbenefit ofdiscovery to determine what lock capabilitiesusing standard XML in this context outweighs theserver supports. This is known as lock capability discovery. Lock capability discovery differs from discoveryadvantage ofsupported access control types, since there may be access control types without corresponding lock types. 5.6.1.2 SupportedLock Property Name: http://www.ietf.org/standards/dav/lock/supportedlock Purpose: To provide a listingusing RFC 1766 language tags. Names used within this specification fall into two categories: names specific to protocol elements such as methods and headers, names ofthe lock capabilities supported by the resource. Schema: http://www.ietf.org/standards/dav/ Values: An XML document containing zero or more LockEntryXMLelements. Description: The SupportedLock propertyelements, and names ofa resource returns a listingproperties. Naming of protocol elements follows thecombinationsprecedent ofscope and access types which may be specifiedHTTP, using English names encoded ina lock request on the resource. Note that the actual contentsUSASCII for methods and headers. Since these protocol elements arethemselves controlled by access controls so a server isnotrequiredvisible toprovide information the client isusers, and are in fact simply long token identifiers, they do notauthorizedneed tosee. 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 Name: http://www.ietf.org/standards/dav/lockentry Purpose: Defines a DAVLockType/LockScope pair which may be legally used with a LOCK on the specified resource. Schema: http://www.ietf.org/standards/dav/ Parent: A SupportedLock entry Values: LockType LockScope 5.6.1.4 LOCKTYPE XML Element Name: http://www.ietf.org/standards/dav/locktype Purpose: Lists a DAVLockType Schema: http://www.ietf.org/standards/dav/ Parent: LOCKENTRY Values: DAVLockTypeValue 5.6.1.5 LOCKSCOPEsupport encoding in multiple character sets. Similarly, though the names of XMLElement Name: http://www.ietf.org/standards/dav/lockscope Purpose: Listselements used in this specification are English names encoded in UTF-8, these names are not visible to the user, and hence do not need to support multiple character set encodings. The name of aDAVLockScope Schema: http://www.ietf.org/standards/dav/ Parent: LOCKENTRY Values: DAVLockScopeValue 5.6.1.6 Example PROPFIND /container/ HTTP/1.1 Host: www.foo.bar Content-Length: xxxx Content-Type: text/xml <?XML:Namespace href = "http://www.ietf.org/standards/dav/" AS = "D"/> <D:PROPFIND> <prop><SupportedLock/></prop> </D:PROPFIND> HTTP/1.1 207 Multi-Response Content-Type: text/xml Content-Length: xxxxx <?XML:Namespace href ="http://www.ietf.org/standards/dav/" AS = "D"/> <D:MultiResponse> <Response> <Prop> <SupportedLock> <LockEntry> <LockType>Write</LockType> <LockScope>Exclusive</LockScope> </LockEntry> <LockEntry> <LockType>Write</LockType> <LockScope>Shared</LockScope> </LockEntry> </SupportedLock> </Prop> <Status>HTTP/1.1 200 Success</Status> </Response> </D:MultiResponse> 5.6.2 Active Lock Discovery 5.6.2.1 Problem Definition If another principal locksproperty defined on a resourcethatis aprincipal wishesURI. Although some applications (e.g., a generic property viewer) will display property URIs directly toaccess,their users, it isuseful for the second principal to be able to find out whoexpected that thefirst principal is. 5.6.2.2 Solution Requirements The lock discovery mechanism should providetypical application will use alistfixed set ofwho has the resource locked, what locks they have,properties, andwhat their lock tokens are. The lock tokens are usefulwill provide a mapping from the property name URI to a human-readable INTERNET-DRAFT WebDAV November 19, 1997 field when displaying the property name to a user. It is only inshared lock situationsthe case wheretwo principals may want to guarantee that they dothe set of properties is notoverwrite each other. The lock tokens are also useful for administrative purposes soknown ahead of time that anadministrator can removeapplication need display alock by referringproperty name URI toits token. 5.6.2.3 LOCKDISCOVERY Property Name: http://www.ietf.org/standards/dav/lockdiscovery Purpose: To discover what locks are active onaresource Schema: http://www.ietf.org/standards/dav/ Values= An XML document containing zero or more ActiveLock XML elements. Description: The LOCKDISCOVERYuser. We recommend that applications provide human-readable propertyreturns a listingnames wherever feasible. For error reporting, we follow the convention ofwho hasHTTP/1.1 status codes, including with each status code alock, what typeshort, English description oflock they have, the time out type andthetime remaining oncode (e.g., 421 Destination Locked). While thetime out,possibility exists that a poorly crafted user agent would display this message to a user, internationalized applications will ignore this message, and display an appropriate message in theassociated lock token. The server is free to withhold any or alluser's language and character set. Since interoperation of clients and servers does not require locale information, thisinformation if the requesting principalspecification does nothave sufficient access rights to see the requested data. A server which supports locks MUST provide the LOCKDISCOVERY property onspecify anyresource with locks on it. 5.6.2.4 ACTIVELOCK XML Element Name: http://www.ietf.org/standards/dav/activelock Purpose:mechanism for transmission of this information. 16. Security Considerations [TBD] 17. Terminology Collection - Amultivalued XML elementresource thatdescribes a particular active lock on acontains member resources. Member Resource - A resourceSchema: http://www.ietf.org/standards/dav/ Parent:contained by a collection. There are two types of member resources: external and internal. Internal Member Resource _ ALOCKDISCOVERY entry Values= LOCKTYPE LOCKSCOPE [ADDLOCKS] OWNER TIMEOUT LOCKTOKEN 5.6.2.5 OWNER XML Element Name: http://www.ietf.org/standards/dav/lock/owner Purpose: Returns owner information Schema: http://www.ietf.org/standards/dav/ Parent: ACTIVELOCK Values= XML:REF | {any valid XML string} 5.6.2.6 TIMEOUT XML Element Name: http://www.ietf.org/standards/dav/timeout Purpose: Returns information about the timeout associated withmember resource of a collection whose URI is relative to thelock Schema: http://www.ietf.org/standards/dav/ Parent: ACTIVELOCK Values= TimeType 5.6.2.7 ADDLOCKS XML Element Name: http://www.ietf.org/standards/dav/addlocks Purpose: Lists additional resources associated with this lock, if any. Schema: http://www.ietf.org/standards/dav/ Parent: ACTIVELOCK Values= 1*HREF 5.6.2.8 LOCKTOKEN XML Element Name: http://www.ietf.org/standards/dav/statetoken Purpose: ReturnsURI of thelock token Schema: http://www.ietf.org/standards/dav/ Parent: ACTIVELOCK Values= HREF Description: The HREF contains a Lock-Token-URL. 5.6.2.9 Example PROPFIND /container/ HTTP/1.1 Host: www.foo.bar Content-Length: xxxx Content-Type: text/xml <?XML:Namespace href = "http://www.ietf.org/standards/dav/" AS = "D"/> <D:PROPFIND> <prop><lockdiscovery/></prop> </D:PROPFIND> HTTP/1.1 207 Multi-Response Content-Type: text/xml Content-Length: xxxxx <?XML:Namespace href ="http://www.ietf.org/standards/dav/" AS = "D"/> <D:MultiResponse> <Response> <Prop> <lockdiscovery> <activelock> <locktype>write</locktype> <lockscope>exclusive</lockscope> <addlocks> <HREF>http://foo.com/doc/</HREF> </addlocks> <owner>Jane Smith</owner> <timeout>Infinite</timeout> <locktoken> <HREF>iamuri:unique!!!!!</HREF> </locktoken> </activelock> </lockdiscovery> </Prop> <Status>HTTP/1.1 200 Success</Status> </Response> </D:MultiResponse> Thiscollection. External Member Resource - A member resourcehasof asingle exclusive write lock on it,collection with aninfinite time out. This same lock also coversabsolute URI that is not relative to its parent's URI. Property - A name/value pair that contains descriptive information about a resource. Live Property _ A property whose semantics and syntax are enforced by theresource http://foo.com/doc/. 6 Version Control [TBD] 7 Internationalization Support [TBD] 8 Security Considerations [TBD] 9server. For example, a live "content-length" property would have its value, the length of the entity returned by a GET request, automatically calculated by the server. Dead Property _ A property whose semantics and syntax are not enforced by the server. The server only records the value of a dead property; the client is responsible for maintaining the consistency of the syntax and semantics of a dead property. 18. Copyright INTERNET-DRAFT WebDAV November 19, 1997 The following copyright notice is copied from RFC 2026 chapter 10.4, and describes the applicable copyright for this document Copyright (C) The Internet SocietyOctober 13,November 19, 1997. All Rights Reserved. This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English. The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assignees. This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.1019. Acknowledgements A specification such as this thrives on piercing critical review and withers from apathetic neglect. The authors gratefully acknowledge the contributions of the following people, whose insights were so valuable at every stage of our work. Terry Allen, Harald Alvestrand, Alan Babich, Dylan Barrell, Bernard Chester, Tim Berners-Lee, Dan Connolly, Jim Cunningham, Ron Daniel, Jr., Jim Davis, 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, Richard N. Taylor, Robert Thau, John Turner, Sankar Virdhagriswaran, Fabio Vitali, Gregory Woodhouse, and LaurenWood 11Wood. INTERNET-DRAFT WebDAV November 19, 1997 One from this list deserves special mention. The contributions by Larry Masinter have been invaluable, both in helping the formation of the working group and in patiently coaching the authors along the way. In so many ways he has set high standards we have toiled to meet. INTERNET-DRAFT WebDAV November 19, 1997 20. References [Alvestrand, 1997] H. T. Alvestrand, "IETF Policy on Character Sets and Languages." Internet-draft, work-in-progress. ftp://ds.internic.net/internet-drafts/draft-alvestrand-charset- policy-02.txt [Berners-Lee, 1997] T. Berners-Lee, "Metadata Architecture." Unpublished white paper, January 1997. http://www.w3.org/pub/WWW/DesignIssues/Metadata.html. [Bradner, 1997] S. Bradner, "Key words for use in RFCs to Indicate Requirement Levels." RFC 2119, BCP 14. Harvard University. March, 1997. [Bray, Sperberg-McQueen, 1997] T. Bray, C. M. Sperberg-McQueen, "Extensible Markup Language (XML): Part I. Syntax", WD-xml- lang.html, http://www.w3.org/pub/WWW/TR/WD-xml-lang.html.[Connolly et al, 1997] D. Connolly, R. Khare, H.F. Nielsen, "PEP - an Extension Mechanism for HTTP", Internet draft, work-in- progress. draft-ietf-http-pep-04.txt, ftp://ds.internic.net/internet-drafts/draft-ietf-http-pep-04.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. ftp://ds.internic.net/rfc/rfc2068.txt [Lasher, Cohen, 1995] R. Lasher, D. Cohen, "A Format for Bibliographic Records," RFC 1807. Stanford, Myricom. June, 1995. ftp://ds.internic.net/rfc/rfc1807.txt [Leach, Salz, 1997] P. J. Leach, R. Salz, "UUIDs and GUIDs." Internet-draft (expired), work-in-progress, February, 1997. http://www.internic.net/internet-drafts/draft-leach-uuids-guids- 00.txt [Maloney, 1996] M. Maloney, "Hypertext Links in HTML." Internet draft (expired), work-in-progress, January, 1996. [MARC, 1994] Network Development and MARC Standards, Office, ed. 1994. "USMARC Format for Bibliographic Data", 1994. Washington, DC: Cataloging Distribution Service, Library of Congress. [Miller et al., 1996] J. Miller, T. Krauskopf, P. Resnick, W. Treese, "PICS Label Distribution Label Syntax and Communication Protocols" Version 1.1, W3C RecommendationREC-PICS-labels- 961031.REC-PICS-labels-961031. http://www.w3.org/pub/WWW/TR/REC-PICS-labels-961031.html. [Slein et al., 1997] J. A. Slein, F. Vitali, E. J. Whitehead, Jr., D. Durand, "Requirements for Distributed Authoring and VersioningonProtocol for the World Wide Web."Internet-draft, work-in- progress, draft-ietf-webdav-requirements-04.txt, ftp://ds.internic.net/internet-drafts/draft-ietf-webdav- requirements-04.txt.RFC XXXX. Xerox, Univ. of Bologna, U.C. Irvine, Boston Univ. YYY, 1997. ftp://ds.internic.net/rfc/rfcXXXX.txt INTERNET-DRAFT WebDAV November 19, 1997 [WebDAV, 1997] WEBDAV Design Team. "A Proposal for Web Metadata 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. [Yergeau, 1997] F. Yergeau, "UTF-8, a transformation format of Unicode and ISO 10646", Internet Draft, work-in-progress, draft- yergeau-utf8-rev-00.txt, http://www.internic.net/internet- drafts/draft-yergeau-utf8-rev-00.txt.12INTERNET-DRAFT WebDAV November 19, 1997 21. Authors' Addresses Y. Y. Goland Microsoft Corporation One Microsoft Way Redmond, WA 98052-6399RR. Carter Novell 1555 N. Technology Way M/S ORM F111 Orem, UT 84097-2399