1.5 Extended Example, Concepts, and Terminology

This section introduces an extended example, used throughout this book to illustrate WebDAV with a consistent set of users and files. Our users are Alice, Bob, and Carl, who all work in a Web content publishing team within the HR department of a mid-sized corporation. Whenever the HR department needs to share files internally or publish content to the rest of the company, this team gets involved. The company has bet heavily on the Web for internal information exchange, so this process always involves Web publishing. Since the company is not very large, the HR department's processes are still somewhat ad hoc.

The extended example can be broken down into three sections, illustrating WebDAV first in terms of distributed authoring, then for a simple publishing process, and finally for the quick creation of a custom application.

1.5.1 Distributed Web Authoring

The original purpose of WebDAV was to allow several people who use Web authoring tools to collaborate on a set of Web pages. Alice, Bob, and Carl use WebDAV most frequently to collaboratively author Web content.

Alice is the manager of a content publishing team within the HR department. Her team maintains the internal HR Web site, which consists mostly of a set of documents for employee reference, and writes and updates those documents. The story in Table 1-1 illustrates how typical Web authoring tasks map to the basic WebDAV terminology.

Figure 1-1 shows the relationships among collections, resources, and URLs. In WebDAV, the information about what collection each resource is in makes up the path part of the URL. Since the hr/ collection contains the resource index.html, hr/ must appear in the path of the URL for index.html.

Figure 1-1. WebDAV URLs and resources.

graphics/01fig01.jpg

1.5.2 Simple Publishing Process

Sometimes, multiple authors working together need a process to help them coordinate their work. Publishing processes and simple workflow processes can easily be applied to WebDAV resources. These applications are similar to the basic distributed authoring scenario as far as most interactions go, but some custom behavior is usually added.

Table 1-1. Example Illustrating Basic WebDAV Terminology

What the User Does

What Is Happening in WebDAV Terms

Alice needs to post information on ergonomics for employees. This is a new project, so there isn't even a place to put such information. Alice wants to create a new folder under the hr folder, so she uses Windows Explorer to navigate to the hr folder on the WebDAV server.

The folder is called a collection. A WebDAV collection contains other WebDAV resources. Collections are not expected to have document bodies, but they do have properties.

A collection is a type of resource. A resource might also be any type of file. Files usually have a document body or content, such as the HTML code for a Web page. Resources can be created, moved, copied, and deleted.

Alice lists the files inside the hr folder.

Every resource in every WebDAV collection has a set of properties. Among other things, properties allow the client to get a listing of folder contents.

Each property has a name and a value. For example, every file has the property named getlastmodified with a timestamp value. A resource may have only the minimum required set of properties (fewer than 10), or it may have hundreds of user-writable custom properties.

Alice creates a new folder in hr called ergonomics.

WebDAV defines a method specifically for creating collections.

Alice then copies a file from another folder to use as a template. Once the file is copied to the ergonomics folder, she renames it posture.doc.

WebDAV supports copy and rename (rename is done with the move command). Properties are moved or copied with the resource.

The new file has the URL http://www.example.com/hr/ergonomics/posture.doc.

Every WebDAV resource gets its own Uniform Resource Locator (URL), which is an address to locate the resource. It is an HTTP URL so that the resource can be accessed via any Web browser. When WebDAV is used, the URL for any resource must consist of the URL for its parent collection plus the name of the resource. See Figure 1-1.

Alice opens the file using Word to edit it (she is composing a guide on posture for computer users). Word downloads and automatically locks the file.

Files can be opened by downloading them with a normal HTTP GET request. This doesn't protect the files from being edited by other users. WebDAV supports locking with explicit lock requests. When a file is locked, no other user can lock the file or edit it. The file is protected from lost updates.

Alice asks Bob to add new material to the posture guide. Bob tries to do this while Alice still has the file open in Word, and his client software lets him know that the file is read-only.

Since the file is currently locked, Bob's software correctly opens the file but notifies Bob that he won't be allowed to save the file. Only Alice can make changes to the file until her Word client releases the lock. Even if Bob's software attempted to overwrite the file, the server would prevent this change.

Bob checks the file and sees that Alice still has the file locked. Now he can remind Alice to close the file and save her changes before he begins.

Currently, lock information is organized as a property, which can be directly queried on a resource. Bob can see whether the file is currently locked, and if it is locked, who imposed the lock.

Web Folders wouldn't allow Bob to view the lock information, but other WebDAV clients do.

For Alice, Bob, and Carl, "publishing" simply means posting Web pages where everybody else in the company can see them. In the Web world, this is also called going live. If only the HR department employees can see a Web page, it's not live yet. Nobody wants to publish pages before they're ready or publish the wrong set of pages and have inconsistent information. Some process is needed to control publishing and improve reliability. Alice's team uses a simple publishing process, and WebDAV makes it possible.

Alice's coworker Carl wrote a dynamic page to serve as the main navigation page for the HR Web site. It's a simple page with a little scripting to automatically include links to documents that are in a published state, but it omits documents that are still drafts. The script finds out which documents to link to by looking in certain collections for resources with a WebDAV property named publish. If the value of the publish property is "true," the page includes a link to that document. The navigation page doesn't have to be altered often, because new documents automatically get included if the publish value is true. The team can focus on creating new content, rather than always updating the navigation page.

Even after a document is published in this scenario, it can still be altered. WebDAV can also be used to move or rename the document (without losing the value of the publish property) or update its content or properties.

1.5.3 Custom Application Example

Custom applications can easily be built on top of WebDAV. Because WebDAV's data model includes a document body, it is suitable for any file-based application. Resources can have property names and property values, so many database-like applications can also be mapped onto the WebDAV model.

Our sample custom application is a repository for employee photos. Carl is responsible for the development and maintenance of a simple Web-based organization chart including employee photos. All the photo image files are stored as WebDAV resources in a WebDAV employees/ collection, and some properties like date-taken are created and given values at this time.

Each resource representing an employee has properties for the employee's first name, last name, start date, division, manager, employees, and the date the photo was taken. The body or content of each resource is a GIF (Graphics Interchange Format) file, an image of the employee.

Carl's Web pages use this data to allow any employee to browse the organization chart. This application automatically constructs Web pages for the chart. Each page shows an employee's full name, photo, and division name, and contains links to similar pages for his or her manager and subordinates.

Another Web page, only accessible to the HR department, allows employee information to be updated. Updating the photos is even easier; since the photos are simply WebDAV resources in a collection, a WebDAV-enabled image-editing tool can be used to save the photos directly to the image folder. The image folder can be sorted based on the date-taken property, to see which employees need an updated photo.



WebDAV. Next Generation Collaborative Web Authoring
WebDAV. Next Generation Collaborative Web Authoring
ISBN: 130652083
EAN: N/A
Year: 2003
Pages: 146

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net