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 AuthoringThe 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.1.5.2 Simple Publishing ProcessSometimes, 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.
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 ExampleCustom 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. |