Specifications

Document Structure
The example stories we will be using are short one- or two-paragraph news stories with a sin-
gle image, designed for people in a hurry. They are structured documents in as much as they
contain a headline and one or two paragraphs of text with an image.
The more structured a document is, the more easily it can be split up for storage in a database.
The advantage of this is that all the documents can be presented in a very consistent, structured
manner.
Take our news story example. We will store the headline in a field separate from the story text,
and by its nature the image is a separate component of the document.
With the headline as a separate item, we can define a standard typeface and style for that to be
displayed in, and can easily separate it from the rest of the story to form our main headlines
page.
Another approach for large documents would be to have a one-to-many relationship with the
individual paragraphs; that is, to store each paragraph as a separate row in the database, each
linked to a master document ID. That kind of dynamic document structure would allow you to
present a contents page for each document and display each section independently, or display
the whole document at once.
Using Metadata
We have already decided that each story record comprises a headline, story text, and an image.
However theres no reason we cant store other data in the same record.
Our system will automatically insert values for who created the story and when it was last
modified. These can be automatically displayed at the bottom of a story to sign and timestamp
it without the author needing to worry about adding the information.
It might also be useful to add data that is not displayed, known as metadata. A good example
of this is to store keywords that would be used for the search engine index.
Rather than scan the entire text of every story, the search engine will look at the keyword
metadata for each story and determine relevance solely from that. This allows the site adminis-
trator to have total control over which search words and phrases match which documents.
In our example, we will allow any number of keywords to be associated with a story, and
assign each keyword a weight value to indicate how relevant that keyword is on a scale from 1
to 10.
Building a Content Management System
C
HAPTER 26
26
CONTENT
MANAGEMENT
SYSTEMS
591
32 7842 ch26 3/6/01 3:36 PM Page 591