Online documentation - Websydian v6.0

Users Guide | Patterns Reference | WebsydianExpress | Search

 

Page Generators and Document Templates


When a user uses a web application, he/she sees HTML pages that are generated by the application on the server side.  In Websydian, this HTML page generation is performed by Page Generator functions.  For every HTML page that can appear in a Websydian application, there is a Page Generator function.

Generation of HTML Pages Controlled by Document Templates

In Websydian, Document Templates control the HTML page generation.  A Document Template is a regular HTML document that contains Replacement Markers.  These are codes that tell the Page Generator function that a value is to be inserted at that point in the template.  When an HTML page is to be generated, a Page Generator function is responsible for reading the Document Template for the HTML page that is to be output, substituting all Replacement Markers in the template with actual values.  The resulting HTML page is then sent to the web application user.

It is important to understand that Document Templates are regular HTML documents.  The Replacement Markers are just a special kind of text recognized by Page Generator functions while not violating the rules of HTML.

The Document Templates determine what the HTML pages in the web application look like.  All the Page Generator functions do is to substitute the Replacement Markers with run-time data values.

When the HTML layout of a Websydian application must be added or changed, only the Document Templates need to be edited.  The HTML pages of a web application can be changed completely without having to change a single line of AllFusion Plex code.

Since Document Templates are valid HTML documents, they can be edited using any HTML editor.

Run-time versus development-time

The figure illustrates the run-time generation of HTML documents sent as output to the web browser where Document Templates control the layout of the HTML page generated.  The figure also shows the generation of outline Document Templates at development time (see section below).

Websydian Generates First-Cut Document Templates at Development-Time

A feature of Websydian is the generation of first-cut Document Templates for each of the Page Generator functions.

Each page generator function has a Document Template Generator function scoped under it.  This function is supposed to be generated and executed by the Websydian developer at development-time.  When executed, it produces a first-cut Document Template using the information available in the AllFusion Plex model.  Such a first-cut Document Template is completely and fully operational, but with very modest graphical layout.  First-cut Document Templates usually suffice for testing and debugging purposes, allowing the developer to concentrate on functional aspects of the application.

The Document Template Generator functions save developers the tedious work of defining field texts, replacement markers, etc. for all the Document Templates in the web application.

The Document Template must be edited in order to obtain the visual layout and appearance required, i.e. field and grid positions, headlines, colors, static dividers etc.  The Document Templates may be enhanced with JavaScript code if the features of HTML are not sufficient for the web application.