Accessing database resources using a WebDAV client

WebDAV uses a containment hierarchy -- much like a file system directory -- to organize files into groups called collections. A collection can contain other collections and/or files. In Domino®, this hierarchy is represented using the name of each design element (the value stored in the $TITLE field for each element) as the file name. For example, a graphic resource named images/logo.gif would appear in a WebDAV collection as a file named logo.gif in the root collection named images. In the Domino Designer client, collection elements appear in the Shared File Resources design list with a trailing slash appended to the name in the $TITLE field and an optional comment. Collection elements are file resource design elements with the additional design flag '/' in the $Flags field.

Virtual collections

When a design element is inserted into a Domino database via WebDAV, Domino creates collection elements to represent all of the collections in the containment hierarchy of the files inserted. These collection elements hold properties for the collection and represent collections that may be, or might later become, empty (that is, have no contained elements). A collection can exist, however, without a collection element to represent it. This can happen when elements are created or renamed using the Designer client. In this case, the collection is referred to as a virtual collection. A virtual collection exists when a design element specifies the name of a collection in its path name, but a collection element for the collection does not exist. For example, if the design collection for a database contains an image resource titled images/logo.gif, but does not contain a collection element named images, then images is a virtual collection.

Virtual collections behave much like non-virtual collections with the following exceptions:

  • The properties of a virtual collection are a set of defaults based on the properties of the database. For example, the creation date of a virtual collection is the creation date of the database.
  • A virtual collection that no longer contains elements disappears.
  • If a WebDAV client attempts to set properties on a virtual collection, the Domino server attempts to create a collection element for the collection, transforming the virtual collection to an actual one.

Accessing database elements

When using a WebDAV client to access a database, you start by creating a connection from the client to a database on a specified server. For example, in Windows™ Explorer for windows 2000, you create a Network Place. To identify the database, you enter a URL that specifies the hostname of the Web site, the database name, and append the string $files to the end of the path to indicate to the server that this is a WebDAV request. For example, to open the database named sales.nsf as a Web folder from Windows Explorer, you enter the path as follows:

http://servername/sales.nsf$files

Once you have mapped a database to a WebDAV client, you can use the interface of the WebDAV client to browse the database and select elements within the database to open.

To display the contents of a resource within a database from a Web browser using a URL, you append the name of the resource (the value of the associated $TITLE field) to the folder name. For example,

http://servername/sales.nsf$files/images/logo.gif
Note: You cannot use Microsoft's Internet Explorer to access a WebDAV database that is located in a subdirectory of the Domino server's data directory. Use Windows Explorer instead.

Once you have established a connection to a Domino database using a WebDAV client, you can open a resource, edit it, and save it back to the database. Or you can add an element that you have created using a third-party editor to the database.

CAUTION: WebDAV clients do not maintain operating system attributes, such as a read-only state. For example, if you create a HTML page, and flag it as being a "read-only" file in Windows, the page will not be flagged as read-only if you add it to a database and view it from Designer.

Avoiding and resolving naming conflicts

WebDAV requires a unique name for each resource. Because a Domino database can contain more than one element with the same value in the $TITLE field, naming conflicts can sometimes occur. For example, a naming conflict can happen if two authors are working on different replicas of the same database and they both create a new element with the same name. When the databases are replicated, each replica will contain two different design elements with the same $TITLE value.

Note: Design locking does not prevent naming conflicts because in Domino locking is based on the noteID, not the name of a note.

Domino deals with naming conflicts by dynamically adorning the names of conflicting elements with the NoteID of the element using the form "Name(NoteID).ext." The server uses this form to uniquely identify each element involved in a name collision, but does not actually rename the elements in the database. If you see this naming convention using a WebDAV client, try to resolve the conflict to avoid problems. You can use Windows Explorer or any other WebDAV client to rename one or more of the conflicting resources. When the name collision is resolved in this way, the other affected resource name reverts back to the unadorned form of the name in $TITLE. You may need to refresh the view of a WebDAV client in order to see the changes. You can also change the name of an element in the Designer client.

When a name collision involves a collection element, the collection element name is adorned as described previously. However, if the collection contains any elements, then an unadorned virtual collection will be used to hold the contents of the collection. The result is that when viewed from a WebDAV client, there will be both a name-adorned collection which contains no elements, and an unadorned collection which contains all of the elements in the collection. Collections with adorned names cannot be the target of a move or copy operation and you cannot create elements in collections with adorned names -- that is, they will always be empty. You can, however, rename or delete a collection with an adorned name in order to attempt to resolve the name collision. Deleting a collection with an adorned name only deletes the collection element that is involved in the name conflict. It does not delete any of the elements that are contained in the virtual collection with the unadorned name.

Note: The previous discussion implies that names that match the adorned name style ("Name(NoteID).ext)", where NoteID is the ASCII representation of an eight-digit hexadecimal number, should be avoided in design element names. While the Domino server will not allow you to create or name a design element from a WebDAV client with a name that could be confused with an adorned name, the Designer client will allow you to do this.