<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML
><HEAD
><TITLE
>Developer's guide</TITLE
><META
NAME="GENERATOR"
CONTENT="aD Hack of: Modular DocBook HTML Stylesheet Version 1.60"><LINK
REL="HOME"
TITLE="Static Pages"
HREF="index.html"><LINK
REL="PREVIOUS"
TITLE="ACS Administrator's guide"
HREF="acs-admin-guide.html"><LINK
REL="NEXT"
TITLE="Static Pages Requirements"
HREF="static-pages-requirements.html"><LINK
REL="STYLESHEET"
TYPE="text/css"
HREF="ad-doc.css"></HEAD
><BODY
CLASS="chapter"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Static Pages</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="acs-admin-guide.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="static-pages-requirements.html"
>Next</A
></TD
></TR
></TABLE
><HR
SIZE="1"
NOSHADE="NOSHADE"
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="chapter"
><H1
><A
NAME="dev-guide"
>Chapter 2. Developer's guide</A
></H1
><DIV
CLASS="sect1"
><H1
CLASS="sect1"
><A
NAME="static-pages-design"
>2.1. Static Pages Design Document</A
></H1
><DIV
CLASS="TOC"
><DL
><DT
><B
>Table of Contents</B
></DT
><DT
>2.1.1. <A
HREF="dev-guide.html#static-pages-design-essentials"
>Essentials</A
></DT
><DT
>2.1.2. <A
HREF="dev-guide.html#static-pages-design-introduction"
>Introduction</A
></DT
><DT
>2.1.3. <A
HREF="dev-guide.html#static-pages-design-historical-consid"
>Historical Considerations</A
></DT
><DT
>2.1.4. <A
HREF="dev-guide.html#static-pages-design-api"
>API</A
></DT
><DT
>2.1.5. <A
HREF="dev-guide.html#static-pages-design-data-model"
>Data Model Discussion</A
></DT
><DT
>2.1.6. <A
HREF="dev-guide.html#static-pages-design-ui"
>User Interface</A
></DT
><DT
>2.1.7. <A
HREF="dev-guide.html#static-pages-design-future"
>Future Improvements/Areas of Likely Change</A
></DT
><DT
>2.1.8. <A
HREF="dev-guide.html#static-pages-design-authors"
>Authors</A
></DT
><DT
>2.1.9. <A
HREF="dev-guide.html#static-pages-design-revision-history"
>Revision History</A
></DT
></DL
></DIV
><DIV
CLASS="authorblurb"
><A
NAME="AEN69"
></A
><P
>By <A
HREF="mailto:bcalef@arsdigita.com"
TARGET="_top"
>Brandoch Calef</A
></P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="static-pages-design-essentials"
>2.1.1. Essentials</A
></H2
><UL
><LI
><P
CLASS="listitem"
><A
HREF="/api-doc/procs-file-view?path=packages/static-pages/tcl/static-pages-procs.tcl"
TARGET="_top"
>static-pages-procs.tcl</A
></P
></LI
><LI
><P
CLASS="listitem"
><A
HREF="/api-doc/plsql-subprogram-one?type=PACKAGE&name=STATIC%5fPAGE"
TARGET="_top"
>static-page package</A
></P
></LI
><LI
><P
CLASS="listitem"
>Data model:
	  <UL
><LI
><P
CLASS="listitem"
><A
HREF="/doc/sql/display-sql?url=static-pages-create.sql&package_key=static-pages"
TARGET="_top"
>static-pages-create.sql</A
></P
></LI
><LI
><P
CLASS="listitem"
><A
HREF="/doc/sql/display-sql?url=static-pages-drop.sql&package_key=static-pages"
TARGET="_top"
>static-pages-drop.sql</A
></P
></LI
></UL
>
	</P
></LI
><LI
><P
CLASS="listitem"
><A
HREF="static-pages-requirements.html"
>Static Pages Requirements</A
></P
></LI
></UL
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="static-pages-design-introduction"
>2.1.2. Introduction</A
></H2
><P
>&#13;      This is the design document for the Static Pages package, which 
      <UL
><LI
><P
CLASS="listitem"
>allows users to make comments on a web 
	    site's static pages, and</P
></LI
><LI
><P
CLASS="listitem"
>loads the pages into the content repository so they 
	    are available to other packages.</P
></LI
></UL
>
      The functions are described in detail in the requirements document.
    </P
><P
>&#13;      Although this package enables commenting and searching, those services are actually
      performed by the General Comments and Site-wide Search packages, respectively.
    </P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="static-pages-design-historical-consid"
>2.1.3. Historical Considerations</A
></H2
><P
>&#13;      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.
    </P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="static-pages-design-api"
>2.1.4. API</A
></H2
><P
>&#13;      The two primary functions offered by the Tcl API for Static Pages 
      are 
      <UL
><LI
><P
CLASS="listitem"
>&#13;	    <TT
CLASS="computeroutput"
>sp_sync_cr_with_filesystem</TT
>, which
	    synchronized the content repository with the filesystem, adding,
	    updating, and deleting content repository entries as necessary;
	    and
	  </P
></LI
><LI
><P
CLASS="listitem"
><TT
CLASS="computeroutput"
>sp_serve_html_page</TT
>,
	    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.
	  </P
></LI
></UL
>
      The <TT
CLASS="computeroutput"
>sp_sync_cr_with_filesystem</TT
> 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.
    </P
><P
>&#13;      The PL/SQL API is contained in the 
      <TT
CLASS="computeroutput"
>static_page</TT
> package, which contains
      functions for creating and manipulating static pages.
    </P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="static-pages-design-data-model"
>2.1.5. Data Model Discussion</A
></H2
><P
>&#13;      The Static Pages data model is simple: file contents are stored in BLOBs
      in the content repository, and two tables,
      <TT
CLASS="computeroutput"
>static_pages</TT
> and 
      <TT
CLASS="computeroutput"
>sp_folders</TT
>, describe the basic
      file hierarchy (since this information is not easily extracted from the
      content repository API).  A <TT
CLASS="computeroutput"
>package_id</TT
>
      is stored along with each entry in 
      <TT
CLASS="computeroutput"
>sp_folders</TT
> 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.
    </P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="static-pages-design-ui"
>2.1.6. User Interface</A
></H2
><P
>&#13;      There are two main user interface pages:
      <TT
CLASS="filename"
>www/admin/fs-scan</TT
>
      (or <TT
CLASS="filename"
>www/admin/fs-scan-progress</TT
>) and
      <TT
CLASS="filename"
>www/admin/commentability</TT
>.
      <TT
CLASS="filename"
>www/admin/fs-scan</TT
> simply performs
      <TT
CLASS="computeroutput"
>sp_sync_cr_with_filesystem</TT
> and
      reports the results.  <TT
CLASS="filename"
>www/admin/commentability</TT
>
      allows the administrator to change the commentability settings (by means
      of <TT
CLASS="computeroutput"
>static_page.grant_permission</TT
> and
      other functions in the PL/SQL API).
    </P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="static-pages-design-future"
>2.1.7. Future Improvements/Areas of Likely Change</A
></H2
><P
>&#13;      There are a few useful features that will likely be added in later
      releases.
      <UL
><LI
><P
CLASS="listitem"
>&#13;	    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 
	    <A
HREF="mailto:teeters@arsdigita.com"
TARGET="_top"
>Jeff Teeters</A
>)
	    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.
	    </P
></LI
><LI
><P
CLASS="listitem"
>&#13;	    There is not presently any way to exclude pages from the 
	    site-wide search.
	  </P
></LI
></UL
>
    </P
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="static-pages-design-authors"
>2.1.8. Authors</A
></H2
><UL
><LI
><P
CLASS="listitem"
>System creator: Brandoch Calef</P
></LI
><LI
><P
CLASS="listitem"
>System owner: Brandoch Calef</P
></LI
><LI
><P
CLASS="listitem"
>Documentation author: Brandoch Calef</P
></LI
></UL
></DIV
><DIV
CLASS="sect2"
><H2
CLASS="sect2"
><A
NAME="static-pages-design-revision-history"
>2.1.9. Revision History</A
></H2
><DIV
CLASS="informaltable"
><A
NAME="AEN155"
></A
><TABLE
BORDER="1"
CLASS="CALSTABLE"
CELLPADDING="10"
><THEAD
><TR
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
>Document Revision #</TH
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
>Action Taken, Notes</TH
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
>When?</TH
><TH
ALIGN="LEFT"
VALIGN="MIDDLE"
>By Whom?</TH
></TR
></THEAD
><TBODY
><TR
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>0.1</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Creation</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>2001/03/05</TD
><TD
ALIGN="LEFT"
VALIGN="MIDDLE"
>Brandoch Calef</TD
></TR
></TBODY
></TABLE
></DIV
><P
><B
CLASS="phrase"
>($Id: dev-guide.html,v 1.1 2001/04/20 20:51:23 donb Exp $)</B
></P
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
SIZE="1"
NOSHADE="NOSHADE"
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="acs-admin-guide.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="static-pages-requirements.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>ACS Administrator's guide</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
>&nbsp;</TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Static Pages Requirements</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>