A WebDAV resource is an addressable Web object, such as a file or directory. An ordinary resource can be viewed as a file. It can have a content body of any MIME type [RFC2045], [RFC2046], including HTML-formatted text, other text, an image, an executable, or an Office document. It can have locks and properties. The specification for URI Syntax [RFC2396] defines a resource as "anything that has identity." HTTP/1.1 [RFC2616] defines a resource both as "a network data object or service" and "anything that has a URI." The WebDAV specification does not redefine a resource but works from these definitions. A collection resource follows all the same rules as a regular resource: It has a URL and properties, and it can be locked. Normally, a collection has no content body or an undefined content body. A collection has added functionality because it can contain other resources. Collections can be nested to form a hierarchy or tree to organize resources.
A lock is a restriction placed on a resource. Usually, it restricts users other than the owner of the lock from making any changes on the resource. A lock has a token to identify it, but that token is meaningful only in the context of the resource that is locked. A property is a name/value pair on a resource. Any resource can have any set of properties. A property is not independently addressable, but each property has a qualified name that uniquely identifies it on the resource where it appears. In all figures in this book, a couple of conventions are used to represent resources, locks, and properties. Figure 4-1 introduces most of those conventions. Figure 4-1. Figure conventions.Resources are represented with icons. Hierarchy is represented as a tree with dashed lines, sometimes arranged the same way an Explorer-style client displays hierarchy. Properties are represented as iconic tables to represent a list of property/value pairs. Locks are represented with a shaded box to show the scope of the lock. A property name is actually an XML qualified name, which means that it combines a short, readable element name with a unique XML namespace. Locks and properties are bound to individual resources. For example, to create a lock, the client must request that the resource be locked by giving the resource's address.
A WebDAV repository is a collection of WebDAV resources hosted at the same server address. Within a repository, it's possible to move and copy files from one collection to another. This isn't a concept defined or required for the WebDAV specification, but it's very useful to talk about WebDAV behavior. |