rfc-3648

Web Distributed Authoring and Versioning (WebDAV) Ordered Collections Protocol

J. Whitehead, J. Reschke (Editor)
date2003-12 streamIETF areaapp wgwebdav statusPROPOSED STANDARD pages30 canonicalhttps://www.rfc-editor.org/rfc/rfc3648 doi10.17487/RFC3648
This specification extends the Web Distributed Authoring and Versioning (WebDAV) Protocol to support the server-side ordering of collection members. Of particular interest are orderings that are not based on property values, and so cannot be achieved using a search protocol's ordering option and cannot be maintained automatically by the server. Protocol elements are defined to let clients specify the position in the ordering of each collection member, as well as the semantics governing the ordering.

Extracted elements (25)

design-rationale §4

An ordering is considered part of the state of a collection resource, so it is the same regardless of which URI is used to access the collection and is protected by locks and access control constraints on the collection. This design aligns ordering semantics with the existing WebDAV resource-state model.

http

design-rationale §4

Only one ordering can be attached to any collection. Multiple orderings of the same resources can be achieved by creating multiple collections referencing those resources with different orderings attached to each. This keeps the model simple while allowing flexibility.

http

design-rationale §7

The DAV:orderpatch-response element is defined even though this document defines no child elements for it. This ensures interoperability between future extensions that do define elements for the ORDERPATCH response body, allowing extensibility without breaking existing clients.

http

design-rationale §2

The protocol focuses on human-maintained orderings because orderings based on property values can be achieved via search protocol ordering options, but orderings not based on properties (e.g., a book's page order or a reading list) cannot be maintained automatically by the server and generally require human input.

http

interoperability-note §4.1.1

An ordering-aware client interacting with an ordering-unaware server (one implemented only to RFC 2518) SHOULD assume the collection is unordered if the collection does not have the DAV:ordering-type property. This ensures forward compatibility with legacy WebDAV servers.

http

interoperability-note §6.1

This specification does not mandate a specific implementation of MOVE operations within the same parent collection. Servers may implement MOVE as a simple rename (preserving position) or as remove-then-add (appending to end). Clients that need to preserve position during rename must explicitly read and re-set the Position header.

http

normative-requirement §4.1 SHOULD NOT

A DAV:allprop PROPFIND request SHOULD NOT return any of the properties defined in this document (specifically DAV:ordering-type).

http

normative-requirement §9 MUST

Both the ordering type (DAV:ordering-type property) and the ordering of collection members MUST be recorded upon CHECKIN or VERSION-CONTROL, and both MUST be restored upon CHECKOUT, UNCHECKOUT, or UPDATE for version-controlled ordered collections.

http

normative-requirement §5.1 SHOULD

Clients SHOULD identify the semantics of the ordering with a URI in the Ordering-Type header when creating an ordered collection, although they MAY use DAV:custom. Clients SHOULD NOT access the resource at the ordering-type URI to avoid overburdening its server.

http

normative-requirement §7 MUST

For ORDERPATCH, when multiple changes are requested and any problem is encountered, the server MUST return a 207 Multi-Status response containing DAV:response elements for either the request-URI (if DAV:ordering-type could not be modified) or URIs of members whose repositioning failed.

http

normative-requirement §7 MUST

If an ORDERPATCH request changes ordering semantics but does not specify positions for all members, the server MUST assign positions for unspecified members following the last client-specified position. If the request does not change ordering semantics, unspecified member positions MUST remain unchanged.

http

normative-requirement §6.1 MUST

If the Position header is not present when adding a new member to an ordered collection, the server MUST append the new member to the end of the ordering. If the request replaces an existing resource without a Position header, the server MUST preserve the resource's present ordering position.

http

normative-requirement §4 MUST

In an ordered collection, each internal member URI MUST appear in the ordering exactly once, and the ordering MUST NOT include any URIs that are not internal members. The server MUST remove a URI from the ordering when it is removed from the collection, and MUST add a URI when one is added.

http

normative-requirement §12 MUST

WebDAV applications MUST support the character set tagging, character set encoding, and language tagging functionality of the XML specification, ensuring human-readable content complies with IETF character set policy (RFC 2277).

http

normative-requirement §7 MUST

When an ORDERPATCH request is processed, the server MUST apply DAV:order-member changes in the order they appear in the XML element. The server MUST either apply all changes or none; if any error occurs, all executed changes MUST be undone and a proper error returned.

http

normative-requirement §5.1 MUST

When creating an ordered collection, the Ordering-Type header precondition DAV:ordered-collections-supported requires that the server MUST support ordered collections in the part of the URL namespace identified by the request URL. The postcondition DAV:ordering-type-set requires that the collection MUST be ordered unless the ordering type is DAV:unordered.

http

normative-requirement §8 MUST

When responding to a PROPFIND on an ordered collection, the server MUST order response elements according to the ordering defined on that collection. For Depth: infinity responses, members of different collections may be interleaved, but members of any ordered collection MUST appear in their defined order.

http

normative-requirement §6.1 MUST

When the Position header is present on a request adding a member, the server MUST insert the new member into the ordering at the specified location. If the request is replacing an existing resource and Position is present, the server MUST remove the URI from its current position and insert it at the newly requested position.

http

protocol-element §4.1.1

DAV:ordering-type is a protected live property that indicates whether a collection is ordered and, if so, uniquely identifies the semantics of the ordering via a URI. It cannot be set via PROPPATCH; it is set only via the Ordering-Type header on MKCOL or via ORDERPATCH. Two predefined values are DAV:custom (ordered, semantics not advertised) and DAV:unordered (not ordered).

http, registry

protocol-element §7

ORDERPATCH is a new HTTP method used to change the ordering semantics of a collection (via a DAV:ordering-type element), change the order of collection members (via DAV:order-member elements), or both. The request body MUST be a DAV:orderpatch XML element. On partial failure the server MUST return 207 Multi-Status.

http

protocol-element §10

The ordered-collections compliance class is a new WebDAV compliance class advertised in the DAV header of OPTIONS responses. Only a collection or null resource may include it. Including it signals that the resource's internal member URIs can be ordered, and implies the ORDERPATCH method is supported.

http

security-consideration §11.1

Sites whose URIs appear in DAV:ordering-type properties of widely-deployed collections may be at risk of denial-of-service attacks due to clients fetching those URIs to read ordering semantics. The risk is mitigated if clients use hard-coded values for common ordering semantics and follow the recommendation not to access the ordering-type URI.

security, http

wire-format §5.1

The Ordering-Type request header is sent with MKCOL to specify the ordering semantics of the new collection. Its BNF is: `Ordering-Type = "Ordering-Type" ":" absoluteURI`. The value DAV:unordered means unordered; DAV:custom means ordered with unadvertised semantics; any other URI identifies specific ordering semantics.

http

wire-format §7

The ORDERPATCH request body uses the DAV:orderpatch XML element containing an optional DAV:ordering-type child and zero or more DAV:order-member elements, each with a DAV:segment and a DAV:position (first, last, before, or after). The DTD is: `<!ELEMENT orderpatch (ordering-type?, order-member*)>`, `<!ELEMENT order-member (segment, position)>`, `<!ELEMENT position (first | last | before | after)>`.

http, json

wire-format §6.1

The Position request header specifies a new collection member's location in an ordered collection's ordering. Its BNF is: `Position = "Position" ":" ("first" | "last" | (("before" | "after") segment))`. The segment is interpreted relative to the collection being modified.

http