Templating & Design > How ExSite Creates Web Pages

How ExSite Creates Web Pages

posted on 7:55 PM, July 25, 2007
This document describes, in moderate technical detail, how ExSite constructs web pages for display on client browsers. It is intended as a primer for technically-oriented graphic designers who will be tinkering with templating tools at an advanced level, and as an introduction to the ExSite content management framework for web developers.

Before reading this document, it would be wise to brush up on ExSite's Content Model.

Overview

ExSite manages any number of websites (or website sections) that are collections of individual web pages.

Every web page produced by ExSite has both a static and dynamic representation. The static version is prepublished to disk, and is served as a traditional HTML document. The dynamic version is composed on the fly by the webserver, and served to the viewer immediately.

If the web page publishes to a simple HTML file and contains no recursive web applications, then the static representation of the page is the only one the public will normally see. A static web page typically has a URL that ends in filename.html. On the server side, this really is a simple, flat HTML file.

If the web page is configured to always render dynamically, then the dynamic representation is the one the public will normally see. A dynamic web page typically has a URL that ends in page.cgi?_id=NNN.

If the web page publishes to a simple HTML file, but contains web applications that may regenerate the page content, then the web page can appear both ways. The default view of the page will be published to a static file (and will appear as filename.html), but the page can be regenerated under different conditions (in which case subsequent page views appear as page.cgi?_id=NNN...).

In most cases, ExSite will automatically choose whether to display the static or dynamic representation of the page. Generally, it chooses the static representation (which is usually better for performance), unless one of the following is true:
  1. the page has restricted access. In this case, ExSite chooses dynamically whether to display the page, or issue an authentication challenge.
  2. the page has accepted parameters or form inputs to regenerate itself with different content.
  3. an administrator is previewing a new version of the page that has not been published yet.
  4. an administrator has explicitly configured the page to always render dynamically. (This is done in cases where the page is displaying content that changes too quickly to make republishing the page practical, such as with some database reports.)

Page identifiers

Pages can be referred to by their filename, or by their numeric page ID (the _id parameter to page.cgi). Either identifier can be used to locate the page.

Note however, that every page in the system has a unique page ID, but only pages in a particular site/section have a unique filename. If you specify a page by filename, ExSite will only look in the current site for a matching page.

How ExSite finds content

All page content is located in content objects, which have various names (text labels) that identify the content. For example, a particular block of text might be called "body" because it comprises the main body of text on a page. An image might be called logo, or banner_ad, or MyPhoto, or PZ10114s.jpg. The names are arbitrary - it's nice if they are meaningful to you, but ExSite doesn't really care.

A page is a collection of references to different content objects (eg. text, images, stylesheets, etc.) that are assembled to create the final page. Each time a new content object is referenced, ExSite must find that content object somewhere in the system. Here is how it searches:
  • First, it looks inside the page that is being built. Each page can define its own content objects that are unique to that page.
  • Next, it looks inside the graphic design template that the page uses to format itself. Each template can define content objects that can be used by every page that uses it. If the graphic design is derived from (or "spun off of") another graphic design, then those parent design(s) are also checked to see if they define our missing content object.
  • Next it looks inside any content libraries that exist in the current site or site section. Content libraries are places to put re-useable content objects that might need to be shared by different pages. ExSite will also look in shared content libraries in our parent sections and sites, in case the content is being provided to us by another site.
ExSite takes the first match it finds. If we're looking for a content object called logo, then a match in the current page is preferred over a match in the graphic design template, which is preferred to a match in the libraries. Note that matches might exist in all of these locations, but the preferred versions override the others. (This lets you define general-purpose content that will be used as a fall-back in cases where specific content has not been provided.)

How ExSite builds a page

To begin constructing a page, ExSite needs an initial starting point. It looks for a content object named page to begin. It searches for this content object using the above algorithm.

The page content object provides the initial HTML framework for the page. That is, when we load the page content object, and ask it for it's actual content data, we will receive a block of HTML that lays out the overall page structure, and will refer to other content objects that are needed to complete the page (such as images, stylesheets, menus, and text). These references to other content objects are specified using special tags in the HTML that are understood by ExSite (although they will look like HTML comments to any other HTML-handling program).

To illustrate, here is a very simple example of the type of HTML content that you might get in a "page" content object:


<!--$title-->


<!--content(body)-->


From this you can see that the bare essentials of the page are included: a head section, a body section, and a few other items inside those. A more realistic example would probably include all sorts of layout instructions (tables, divs, css, javascript, etc.).

There are three special tags in this example that refer to other content objects that are needed to complete the page:
<!--$title-->
This tells ExSite to insert the appropriate meta-data into this spot. Meta-data is not really content, but it can be inserted into the page just like content can.
[[logo]]
This tells ExSite to insert a URL to the logo content object into this spot. ExSite will perform a search for logo (as described above), and when it is found, will determine the best URL to use.
<!--content(body)-->
This tells ExSite to insert the HTML for the body content object into this spot. ExSite will perform a search for body (as described above), and when it is found, will determine the best HTML representation of the content to use.

Once these substitutions are complete, ExSite looks at the new, expanded, version of the page's HTML. New content references may have appeared as a result of the substitutions we performed, in which case, we have to repeat the process and search for the missing content, until no more references can be found. At that point, the page construction is complete, and it can be delivered to its destination - either the client browser (if the page is being rendered dynamically) or the publishing program (if the page is meant to be viewed statically).

More information on how to use substitution tags is given in the ExSite Templating Guide.

Programming

Web Application Developers Guide (Article)
-- Web Application Developers Guide -- -- Abstract -- This document describes how to develop web applications within the ExSite framework, how to port traditional web applications to the ExSite framework,... (posted 11:18 AM, July 16, 2010)

Glossary of Terms (Article)
ExSite documentation and code makes regular use of the terms that are defined below. Access A user's access level determines the general level of access they have to the ExSite system. It is normally... (posted 1:17 PM, October 1, 2009)

URI.pm (Article)
Handling URIs/URLs (posted 3:30 PM, July 12, 2009)

Tree.pm (Article)
* ExSite::Tree * Tree Contruction * Querying the tree * Tree Transforms * Example -- ExSite::Tree -- ExSite::Tree is a generic tool for managing heirarchical tree structures... (posted 3:29 PM, July 12, 2009)

Time.pm (Article)
* ExSite::Time * Usage * Validation * Adjusting Times * Displaying Times * Comparing Times -- ExSite::Time -- Utilities for handling dates and times in... (posted 3:28 PM, July 12, 2009)

Store.pm (Article)
* ExSite::Store * Storage Keys * Storage Lifetime * Garbage Collection * Notification Callbacks * Implementation * Store Configuration * Special Methods... (posted 3:27 PM, July 12, 2009)

Session.pm (Article)
* ExSite Session Management * Session Key * Session Lifetime * Fetching and Saving Session Data * Enabling Session Management * Inspecting Session Contents -- ExSite... (posted 3:26 PM, July 12, 2009)

RSS.pm (Article)
* RSS.pm * Usage: -- RSS.pm -- All-purpose simple RSS feed generator. -- Usage: -- Create the feed (the channel descriptors are accepted without validation, so you must ensure they... (posted 3:24 PM, July 12, 2009)

ReportBuilder.pm (Article)
* ReportBuilder * Input * Output * Dynamic Reports -- ReportBuilder -- This is a utility for building tabulated reports. It is content-agnostic, and simply handles the formatting... (posted 3:23 PM, July 12, 2009)

ObjectList.pm (Article)
* ExSite::ObjectList * Define an ObjectList * new(%opt) * load($match) * List Contents and Data * count() * index($i) * select($i) * reset() * setlist(@list)... (posted 3:22 PM, July 12, 2009)

Object.pm (Article)
* ExSite::Object * Attributes * Methods * new(%opt) * setup($type,$id) * type() * id($id) * name() * ok() * key() * get($attr) * getdata($key)... (posted 3:21 PM, July 12, 2009)

ML.pm (Article)
* ML - markup language generator * Document Handling * new(%opt) * Write() * Print(), PrintWithHeader() * Doc($text) * Append($text) * Prepend($text)... (posted 3:18 PM, July 12, 2009)

Misc.pm (Article)
* ExSite::Misc - miscellaneous utility functions needed by ExSite:: * Hash Encoding Tools * Datahash Array Conversion Functions: * Text Encoding/Decoding Functions * General Text-Processing... (posted 3:17 PM, July 12, 2009)

Input.pm (Article)
* ExSite::Input - tools for reading http inputs * Reading POST and GET data * query() * post() * query_or_post() * post_or_query() * combine() * Other... (posted 3:14 PM, July 12, 2009)

HTML.pm (Article)
* ExSite::HTML * HTML methods and templates * Boxes * Popups * Other HTML Constructions -- ExSite::HTML -- -- HTML methods and templates -- This package contains routines... (posted 3:12 PM, July 12, 2009)

FormBuilder.pm (Article)
* FormBuilder * Usage * Input Parameters * Input tag attributes * Input field flags * Other modifiers * Form Presets * Validation * Custom... (posted 3:10 PM, July 12, 2009)

Crypt.pm (Article)
* ExSite::Crypt - ExSite crypto driver * Usage * Strong or Fast? * Automatic Encrpytion * Key Security -- ExSite::Crypt - ExSite crypto driver -- The Crypt class encrypts/decrypts... (posted 3:05 PM, July 12, 2009)

Cookie.pm (Article)
* ExSite Cookie Management * Cookie Scope * Long-Duration Cookies * Internals -- ExSite Cookie Management -- ExSite::Cookie manages your cookie jar, which is a hash (%cookie)... (posted 3:04 PM, July 12, 2009)

Cache.pm (Article)
* ExSite::Cache * Cache Persistence * Invalidating Cached Items * Cache Keys * Primary Cache Keys -- ExSite::Cache -- ExSite::Cache is a generic cache tool for... (posted 2:51 PM, July 12, 2009)

Base.pm (Article)
* ExSite::Base - ExSite Base class * new(%opt) * initialize_object() * get($attribute) * set($attribute,$value) * unset($attribute) * Handlers * handler($name,$handler_code)... (posted 2:47 PM, July 12, 2009)

Config.pm (Article)
* ExSite::Config - ExSite configuration and initialization * Usage: * Configuration Management * Setup and Configuration Routines * server_autoconf() * read_exsite_conf()... (posted 2:37 PM, July 12, 2009)

Form.pm (Article)
* ExSite::Form - ExSite form management tools * Form Processing * get_data() - fetch raw input * get_action() - what are we supposed to do with this data? * do() - perform the requested... (posted 2:36 PM, July 12, 2009)

Report.pm (Article)
* ExSite::Report - general purpose tools for displaying database data * Obtaining Meta-data for Tables * primary_column() - select the primary display column(s) * title() -... (posted 2:33 PM, July 12, 2009)

DB.pm (Article)
* ExSite::DB - generic database driver wrapper for ExSite * new(%options) - DB constructor * Retrieving Data * fetch(), fetch_key() - fetch a record by its primary key ... (posted 2:32 PM, July 12, 2009)

SQL.pm (Article)
* ExSite::SQL - generic SQL database driver for ExSite * new(%options) : SQL driver constructor * get_tables() : return a list of tables in the database * dbget_columns($table) : return... (posted 2:30 PM, July 12, 2009)

Data Persistence (Article)
Because HTTP is a stateless protocol, the normal behaviour of websites is to forget everything about a visitor after a page has been served. If we are to remember things about a visitor on subsequent... (posted 1:54 PM, December 24, 2008)

Understanding Sections (Article)
Sections are an important tool for organizing your website's content and security. This document explains sections, and how to make best use of them. Sections are analogous to folders on your hard drive.... (posted 1:46 PM, December 11, 2008)

Scheduled Publishing (Article)
ExSite has a few features that allow you to automatically publish or republish pages at set times or intervals. You can also unpublish (remove published files) using the same features. Scheduled publishing... (posted 5:49 PM, November 20, 2008)

Security Issues (Article)
We are often asked, "Is ExSite secure? Can hackers break in?" It is normal for people to want to know that their website and data are secure from theft or vandalism, but the subject of security is ... (posted 7:46 PM, November 14, 2008)

Introduction to the ExSite Kernel (Article)
The ExSite kernel consists of the libraries that perform the core services of ExSite. These services include: * interacting with database(s) * user authentication and security * web page generation... (posted 5:56 PM, August 7, 2008)

WebDB (Article)
Manage your database records at a low level. (posted 3:56 PM, July 21, 2008)

Upload (Article)
Add large files to your site. (posted 3:41 PM, July 21, 2008)

Doctypes (Article)
Every web page can optionally declare its DOCTYPE using a special tag at the start of the document. This is not required, but without a DOCTYPE, the browser uses a special mode ("quirks" mode) whose... (posted 3:23 PM, July 18, 2008)

VersionMenu (Article)
Switch between different languages. (posted 3:13 PM, May 28, 2008)

Extranets and Member-only Areas (Article)
An "extranet" is a part of a website that is not publicly accessible. To gain access to the extranet, you must first provide some authentication information (typically a login ID and password). This... (posted 5:46 PM, February 20, 2008)

AJAX with ExSite (Article)
AJAX stands for Asynchronous Javascript And XML, which has become a bit of a misnomer. The term is generally used to refer to the technique of loading some content after the main page is loaded, using... (posted 1:39 PM, September 24, 2007)

Handling plain text files (Article)
You can place plain text files into your regular web page directory (such as a robots.txt file), and edit and manage the contents of these files using the Website Manager CMS tools. A few special configurations... (posted 5:03 PM, August 29, 2007)

Captchas (Article)
Captchas are small puzzles you have to perform to prove to a website that you are not an automated program. The word stands for "Completely Automated Public Turing test to tell Computers and Humans Apart".... (posted 3:45 PM, August 3, 2007)

Debugging & Profiling (Article)
-- Basic Debugging -- Standard perl debugging tools work with ExSite. In particular, we recommend using the build-in Perl debugger, and the Perl profiling tools, to help you solve difficult bugs. ExSite... (posted 5:22 PM, July 27, 2007)

Search System (Article)
ExSite comes with a built-in Search framework that provides simple but flexible searching capabilities. It allows plug-ins to hook into the search system and provide their own content for searching.... (posted 5:09 PM, July 27, 2007)

Example Plug-ins (Article)
-- Example 1 -- This first example is ExSite's equivalent of "Hello World". It inherits from BaseDCD, which allows us to skip over many of the basic DCD methods in our class. package Modules::HelloWorld;... (posted 5:07 PM, July 27, 2007)

Programming Best Practices (Article)
The following suggestions will produce ExSite DCDs that are interoperable, extensible, and which make fullest use of the ExSite framework. use Modules::BaseDCD The BaseDCD module provides important... (posted 5:04 PM, July 27, 2007)

Advanced Web Application Programming (Article)
Most DCDs will have many additional methods and routines; the read(), write(), and ioctl() methods are simply the ones that ExSite uses to interface to the DCD. In some cases, you may need to split... (posted 5:02 PM, July 27, 2007)

Introduction to Web Application Programming (Article)
An ExSite Web Application has the usual features associated with web applications, most importantly 2-way interactivity with the web site user, in which data is taken in, and dynamic web pages generated... (posted 5:01 PM, July 27, 2007)

The ExSite Content Model (Article)
This document describes how content is organized in the ExSite content management framework. This information is helpful for understanding how sites and pages are assembled and organized by ExSite Webware.... (posted 4:51 PM, July 27, 2007)

Advanced Installation Guide (Article)
-- System Requirements -- ExSite has been installed and run successfully on Linux and OS X, but it should work on most Unix-y webserving environments. One of our developers even had it running under... (posted 4:48 PM, July 27, 2007)

Working with Plug-ins (Article)
Plug-ins (sometimes called Modules) are programs that ExSite can call to perform tasks or generate content that the core system is not designed to do. (posted 2:36 AM, July 26, 2007)

How ExSite Creates Web Pages (Article)
This document describes, in moderate technical detail, how ExSite constructs web pages for display on client browsers. It is intended as a primer for technically-oriented graphic designers who will... (posted 7:55 PM, July 25, 2007)

RSS

permalink Link