Author: ts Date: Wed Sep 5 16:22:28 2007 New Revision: 5998 Log: - Intermediate commit. # Work in progress.
Modified: experimental/Webdav/design/rfc_overview.txt Modified: experimental/Webdav/design/rfc_overview.txt ============================================================================== --- experimental/Webdav/design/rfc_overview.txt [iso-8859-1] (original) +++ experimental/Webdav/design/rfc_overview.txt [iso-8859-1] Wed Sep 5 16:22:28 2007 @@ -398,22 +398,193 @@ ========= Allows the setting, updating and removing of 1 or more properties. 1 request -represents a transaction and can contain multiple manipulations. - +represents a transaction and can contain multiple manipulations of different +kinds on different resources. Header ====== +- XML === +<!ELEMENT propertyupdate (remove | set)+ > + Main element for the PROPPATCH request. Contains a set of property + manipulations to perform. + +<!ELEMENT remove (prop) > + Indicates that the property given inside <prop /> should be removed from the + resource. The property element cointained in <prop /> must be empty. + +<!ELEMENT set (prop) > + Indicates that the given property inside the <prop /> element should be set + to the given value. + +Response +======== + +Codes +----- + +Example response codes to be returned by this request. + +200 (OK) + The command succeeded. As there can be a mixture of sets and removes in a + body, a 201 (Created) seems inappropriate. +403 (Forbidden) + The client, for reasons the server chooses not to specify, cannot alter one + of the properties. +409 (Conflict) + The client has provided a value whose semantics are not appropriate for the + property. This includes trying to set read- only properties. +423 (Locked) + The specified resource is locked and the client either is not a lock owner or + the lock type requires a lock token to be submitted and the client did not + submit it. +507 (Insufficient Storage) + The server did not have sufficient space to record the property. + +Example +======= + +The PROPPATCH request only has 1 valid format. + +:: + + >>Request + + PROPPATCH /bar.html HTTP/1.1 + Host: www.foo.com + Content-Type: text/xml; charset="utf-8" + Content-Length: xxxx + + <?xml version="1.0" encoding="utf-8" ?> + <D:propertyupdate xmlns:D="DAV:" + xmlns:Z="http://www.w3.com/standards/z39.50/"> + <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> + + >>Response + + HTTP/1.1 207 Multi-Status + Content-Type: text/xml; charset="utf-8" + Content-Length: xxxx + + <?xml version="1.0" encoding="utf-8" ?> + <D:multistatus xmlns:D="DAV:" + xmlns:Z="http://www.w3.com/standards/z39.50"> + <D:response> + <D:href>http://www.foo.com/bar.html</D:href> + <D:propstat> + <D:prop><Z:Authors/></D:prop> + <D:status>HTTP/1.1 424 Failed Dependency</D:status> + </D:propstat> + <D:propstat> + <D:prop><Z:Copyright-Owner/></D:prop> + <D:status>HTTP/1.1 409 Conflict</D:status> + </D:propstat> + <D:responsedescription> Copyright Owner can not be deleted or + altered.</D:responsedescription> + </D:response> + </D:multistatus> + +===== +MKCOL +===== + +The MKCOL request is used to create a new collection resource. Collections +cannot be created using PUT or any other request, but only by MKCOL. + +Header +====== + +- + +XML +=== + +- + +Example +======= + +The MKCOL request is quite easy. + + >>Request + + MKCOL /webdisc/xfiles/ HTTP/1.1 + Host: www.server.org + + >>Response + + HTTP/1.1 201 Created + +====== +DELETE +====== + +Requests to delete a certain resource. May be used on non-collection and +collection resources. If used on collection resources, this request works like +"Depth: Infinity" header is set and deletes all descendants. + +Header +====== + +- + +XML +=== + +- + +Example +======= + +The following example shows a case were a descendant resource is locked and +therefore the delete failed. + + >>Request + + DELETE /container/ HTTP/1.1 + Host: www.foo.bar + + >>Response + + HTTP/1.1 207 Multi-Status + Content-Type: text/xml; charset="utf-8" + Content-Length: xxxx + + <?xml version="1.0" encoding="utf-8" ?> + <d:multistatus xmlns:d="DAV:"> + <d:response> + <d:href>http://www.foo.bar/container/resource3</d:href> + <d:status>HTTP/1.1 423 Locked</d:status> + </d:response> + </d:multistatus> ==== COPY ==== +Creates a duplicate of the requested resource at the destination defined by the +"Destination" header. The state of the duplicate result must match the origin +state as good as possible, regarding content and properties. The depth of the +duplication is defined by the "Depth" header, while the default is 0 here. + +The <propertybehaviour /> XML element can be used to define the handling of +properties while copying the resource. Header ====== @@ -429,9 +600,253 @@ If a child COPY fails, the rest of the COPY must be performed! (No transactional behaviour!!). +Destination +----------- + +Defines the destination resource to create a duplicate of the requested +resource at. + +Depth +----- + +Defined like the "Depth" header for the PROPFIND request. The default value +here is 0, which means to only copy the resource itself and not descendants. XML === + +<!ELEMENT propertybehavior (omit | keepalive) > + This XML element may be used to influence the way in which a server handles + properties during copy. + +<!ELEMENT keepalive (#PCDATA | href+) > + The <keepalive /> element may contain 1 or more URIs (inside a <href /> + each), to define, that the given list must be copied completly "live". + Alternatively, a * can be given instead of a list of elements, to indicate, + that all properties must be copied live. + +<!ELEMENT omit EMPTY > + Using this element, instead of <keepalive />, a client indicates to the + server that it should put "best efforts" into copying properties, but that + it must not fail, if a property copy fails. + +Response +======== + +Codes +----- + +201 (Created) + The source resource was successfully copied. The copy operation resulted in + the creation of a new resource. +204 (No Content) + The source resource was successfully copied to a pre-existing destination + resource. +403 (Forbidden) + The source and destination URIs are the same. +409 (Conflict) + A resource cannot be created at the destination until one or more + intermediate collections have been created. +412 (Precondition Failed) + The server was unable to maintain the liveness of the properties listed in + the propertybehavior XML element or the Overwrite header is "F" and the state + of the destination resource is non-null. +423 (Locked) + The destination resource was locked. +502 (Bad Gateway) + This may occur when the destination is on another server and the destination + server refuses to accept the resource. +507 (Insufficient Storage) + The destination resource does not have sufficient space to record the state + of the resource after the execution of this method. + +Examples +======== + +Overwriting COPY +---------------- + +The following example indicates a successful COPY request that has overwritten +the already existing destination resource (note: 204 indicates the overwrite!). + +:: + + >>Request + + COPY /~fielding/index.html HTTP/1.1 + Host: www.ics.uci.edu + Destination: http://www.ics.uci.edu/users/f/fielding/index.html + + >>Response + + HTTP/1.1 204 No Content + +Non-overwriting COPY +-------------------- + +In this example, the "Overwrite" header changed the overwriting behaviour. +Because the destination resource exists and cannot be overwritten, COPY fails. + +:: + + >>Request + + 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 + + >>Response + + HTTP/1.1 412 Precondition Failed + +Collection COPY +--------------- + +The following example shows the COPY of a collection resource. The "Depth" +header is just set to the default and could therefore be ignored. The COPY +operation suceeds almost on all resources, except for R2, which has +most-propably a problem with property copying. + +:: + + >>Request + + COPY /container/ HTTP/1.1 + Host: www.foo.bar + Destination: http://www.foo.bar/othercontainer/ + Depth: infinity + Content-Type: text/xml; charset="utf-8" + Content-Length: xxxx + + <?xml version="1.0" encoding="utf-8" ?> + <d:propertybehavior xmlns:d="DAV:"> + <d:keepalive>*</d:keepalive> + </d:propertybehavior> + + >>Response + + HTTP/1.1 207 Multi-Status + Content-Type: text/xml; charset="utf-8" + Content-Length: xxxx + + <?xml version="1.0" encoding="utf-8" ?> + <d:multistatus xmlns:d="DAV:"> + <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> + +==== +MOVE +==== + +The MOVE operation behaves similar to the COPY operation, followed by a DELETE +of the original resource. All in all, the MOVE request is handled very similar +to the COPY operation. + +Header +====== + +"Overwrite" and "Depth", as described with COPY. + +XML +=== + +- + +Response +======== + +Codes +----- + +201 (Created) + The source resource was successfully moved, and a new resource was created at + the destination. +204 (No Content) + The source resource was successfully moved to a pre-existing destination + resource. +403 (Forbidden) + The source and destination URIs are the same. +409 (Conflict) + A resource cannot be created at the destination until one or more + intermediate collections have been created. +412 (Precondition Failed) + The server was unable to maintain the liveness of the properties listed in + the propertybehavior XML element or the Overwrite header is "F" and the state + of the destination resource is non-null. +423 (Locked) + The source or the destination resource was locked. +502 (Bad Gateway) + This may occur when the destination is on another server and the destination + server refuses to accept the resource. + +Examples +======== + +MOVE non-collection +------------------- + +The following example shows a successful MOVE operation of a non-collection +resource. + +:: + + >>Request + + MOVE /~fielding/index.html HTTP/1.1 + Host: www.ics.uci.edu + Destination: http://www.ics.uci.edu/users/f/fielding/index.html + + >>Response + + HTTP/1.1 201 Created + Location: http://www.ics.uci.edu/users/f/fielding/index.html + +MOVE collection +--------------- + +In the following example, a collection-resource is MOVED, while a single +child-resource failed. + +:: + + >>Request + + MOVE /container/ HTTP/1.1 + Host: www.foo.bar + Destination: http://www.foo.bar/othercontainer/ + Overwrite: F + If: (<opaquelocktoken:fe184f2e-6eec-41d0-c765-01adc56e6bb4>) + (<opaquelocktoken:e454f3f3-acdc-452a-56c7-00a5c91e4b77>) + Content-Type: text/xml; charset="utf-8" + Content-Length: xxxx + + <?xml version="1.0" encoding="utf-8" ?> + <d:propertybehavior xmlns:d='DAV:'> + <d:keepalive>*</d:keepalive> + </d:propertybehavior> + + >>Response + + HTTP/1.1 207 Multi-Status + Content-Type: text/xml; charset="utf-8" + Content-Length: xxxx + + <?xml version="1.0" encoding="utf-8" ?> + <d:multistatus xmlns:d='DAV:'> + <d:response> + <d:href>http://www.foo.bar/othercontainer/C2/</d:href> + <d:status>HTTP/1.1 423 Locked</d:status> + </d:response> + </d:multistatus> + +==== +LOCK +==== + -- svn-components mailing list svn-components@lists.ez.no http://lists.ez.no/mailman/listinfo/svn-components