The term content management is used very broadly in both Web and non-Web applications. It often encompasses the full production lifecycle for editing, storing, and version control of text and binary content used in on-line and printed information resources. Our focus here is much narrower, emphasizing only the aspects of content management that depend on XML vocabularies and their relationship to Web portal applications.
Define Business Vocabulary
The definition of business vocabularies is of fundamental importance to all XML applications. In Web applications, that importance is emphasized in the use case diagram by the convergence of dependency arrows upon the use case. This dependence is true regardless of whether those applications are wired or wireless. The XML vocabulary, which determines the structure of content created by content developers, defines the metadata that will be assigned to guide application personalization and is the basis for creating stylesheets that present the content within portal applications.
This use case is described in greater detail in Chapter 4, where the same requirements are critical in guiding e-business integration. In that situation, the XML business vocabularies determine the structure of message content and identify the document components exchanged as part of a workflow. That same content may be extracted from B2B messages and presented to users as part of a vertical market portal.
All Web applications depend on the creation of content that is presented to users. Some of this content is likely authored directly by human content developers and other content is extracted from databases that are part of other application components and legacy systems. In any case, this content is produced or extracted in the form of XML documents that become the primary source of information for the portal.
This use case depends foremost on the definition of a business vocabulary that specifies the XML structure of content documents. This chapter's examples focus on creating product catalog documents using the CatML vocabulary, although a complete application architecture would likely include several such vocabularies specifying other components in addition to the catalog content. The RSS vocabulary described in previous chapters is likely to be incorporated into portal content management. When legacy system integration is involved, their business vocabularies define the structure of XML documents extracted from those systems' database queries or transaction messages.
As shown in Figure 5-1, the Create Content use case is further specialized by two additional use cases; the hollow-headed arrow indicates a generalization relationship. UML class diagrams use generalization to represent inheritance of attributes and operations by subclasses; in a use case diagram the same type of relationship indicates that one use case specializes the behavior of another, more general use case. Create Content is specialized by use cases that describe the requirements for Create Product Catalog and Create News Channel.
Create Product Catalog
In our example application, the product catalog is created as an XML document based on the CatML vocabulary. This vocabulary may be used in many different ways as a guide to catalog creation. The most straightforward approach is to use an authoring tool such as XMetaL from SoftQuad that enables a word-processing interface for any XML DTD. The sample screen shot of XMetaL in Figure 5-2 illustrates a "normal view" of a product catalog. Alternatively, it supports viewing and editing XML documents in text-mode where all of the underlying XML tags are exposed.
XMetaL applies a CSS stylesheet to the XML document in order to produce the formatted view. An author can add new products or edit existing products using this word-processing like interface. The dialog panes on the right are created from the CatML DTD and are used by an author either to pick new types from a list of valid XML elements or to change attribute values for the current element being edited.
XMetaL was used to author the following XML definition of a CatML Product.
<Product xmi.id="sku-Z505JE"> <CatalogItem.name>Sony VAIO Z505</CatalogItem.name> <CatalogItem.description> The small size and weight of the Sony VAIO Z505 ... </CatalogItem.description> <CatalogItem.listPrice> <Money currency="USD"> <Money.amount>2499</Money.amount> </Money> </CatalogItem.listPrice> <CatalogItem.sku>Z505JE</CatalogItem.sku> <Product.photoURL>/examples/images/SonyZ505.jpg </Product.photoURL> <CatalogItem.category> <Category href="Taxonomy.xml#Laptop_Computer_System" xmi.label="Laptop Compter System"/> </CatalogItem.category> <CatalogItem.detail> <Resource href="http://www.ita.sel.sony.com/jump/z505/" xmi.label="Product Specifications"/> </CatalogItem.detail> <CatalogItem.supplier> <Party href="Suppliers.xml#Sony" xmi.label="Sony""/> </CatalogItem.supplier> </Product>
This CatML example, along with its vocabulary definition, DTD, and XML Schema, are described in great detail throughout the remainder of this book.
Figure 5-2 Editing a product catalog in XMetaL
Create News Channel
News headline summaries are becoming ubiquitous in Web portals. In many cases, these news channels are focused on general headlines from sources such as the New York Times or CNN, though the same techniques can be applied to create customized news feeds for any topic. Vertical market specialized newsfeeds are especially relevant in B2B vortals. The information used to produce many of these headline listings is communicated using the Rich Site Summary (RSS) vocabulary.
Because RSS is simply another XML vocabulary, we can easily transform our CatML catalog information into the RSS structure. If we produce an RSS headline document that represents special promotional offers from our product catalog, then this "news channel" could be immediately and easily used by any of the consumer portals available today. Each promotional item listed in the RSS document would include a hyperlink pointing back to the relevant page of our catalog portal, thereby allowing the consumer to get additional information or to purchase the product. This use of RSS is illustrated in a detailed example in Chapter 11, in the section "A Portlet for Promotional Discounts."
Assign Content Metadata
After the content documents have been created, it is often necessary to assign additional metadata attributes that describe the type of content contained within each document. These metadata might include general attributes such as title, subject, and language, or application-specific attributes such as target audience demographics, product category, and price range. In either case, the metadata are used either to enable more precise searching of the Web site or to write personalization rules that match content with user profile characteristics.
The use case diagram in Figure 5-1 specifies that Create Content includes Assign Content Metadata, which in turn includes Define Business Vocabulary. Thus, the metadata assignment depends on the definition of one or more vocabularies, although those vocabularies may be drawn from one of the shared public repositories. For example, an application could use a standard set of metadata attributes defined by the Dublin Core1 or combine them with other standard or customized metadata vocabularies specific to e-commerce.