Static Pages Design Document
By Brandoch Calef
Essentials
static-pages-procs.tcl
static-page package
Data model:
static-pages-create.sql
static-pages-drop.sql
Introduction
This is the design document for the Static Pages package, which
allows users to make comments on a web
site's static pages, and
loads the pages into the content repository so they
are available to other packages.
The functions are described in detail in the requirements document.
Although this package enables commenting and searching, those services are actually
performed by the General Comments and Site-wide Search packages, respectively.
Historical Considerations
The ACS 3.x version of Static Pages implemented a number of features
(such as clickstream analysis and broken link searching) which, in the
interest of modularity, have been excluded from this version of the
package.
API
The two primary functions offered by the Tcl API for Static Pages
are
sp_sync_cr_with_filesystem, which
synchronized the content repository with the filesystem, adding,
updating, and deleting content repository entries as necessary;
and
sp_serve_html_page,
which is registered with the request processor to serve static
pages. Before serving a page, it checks to see if the user
should be offered the opportunity to make comments on it, and
creates the appropriate link if necessary.
The sp_sync_cr_with_filesystem proc
is fairly general, taking a starting path in the filesystem, a
root folder id in the content repository (corresponding to the starting
path), and a regexp to identify what files should be considered.
The PL/SQL API is contained in the
static_page package, which contains
functions for creating and manipulating static pages.
Data Model Discussion
The Static Pages data model is simple: file contents are stored in BLOBs
in the content repository, and two tables,
static_pages and
sp_folders, describe the basic
file hierarchy (since this information is not easily extracted from the
content repository API). A package_id
is stored along with each entry in
sp_folders so that an instance of
Static Pages is able to distinguish its root folder from the root
folders of other services that may be using Static Pages to mirror
the filesystem in the content repository.
User Interface
There are two main user interface pages:
www/admin/fs-scan
(or www/admin/fs-scan-progress) and
www/admin/commentability.
www/admin/fs-scan simply performs
sp_sync_cr_with_filesystem and
reports the results. www/admin/commentability
allows the administrator to change the commentability settings (by means
of static_page.grant_permission and
other functions in the PL/SQL API).
Future Improvements/Areas of Likely Change
There are a few useful features that will likely be added in later
releases.
When a file is moved, the file sync procedure will think that
one file has been deleted and another created. Therefore any
comments made on the file before moving it are lost. One
possible solution (proposed by
Jeff Teeters)
would be to add an HTML comment (containing the page id) to each
file when it is first loaded into the system. The file could be
identified in subsequent scans by the presence of the comment.
However, modifying the static pages in the filesystem may raise
other problems.
There is not presently any way to exclude pages from the
site-wide search.
Authors
System creator: Brandoch Calef
System owner: Brandoch Calef
Documentation author: Brandoch Calef
Revision History
Document Revision #
Action Taken, Notes
When?
By Whom?
0.1
Creation
2001/03/05
Brandoch Calef
($Id: design.xml,v 1.1 2001/04/20 20:51:23 donb Exp $)