Webgenz - Content Management System Webgenz Detailed Overview

Home
Overview
Getting Started
User Guide
Terms
Details
Project Files
Template Files
Content Files
Command Line Interface
Tips & Tricks
FAQs
Download
Order Now
Message Board
Search
Contact Us
The goal of this detailed overview is to describe exactly what Webgenz does when it generates a project. Webgenz generates a project by executing the following steps:
  1. Webgenz reads in the Project Definition File. For each line in the Project Definition File, Webgenz does the following:
     
  2. Webgenz reads in the Template File and the Content File(s) referenced on the line.
     
  3. Webgenz processes the Template File one line at a time. As Webgenz finds a Macro Tag in the Template File, Webgenz searches for the Macro Value associated with the Macro Tag.
     
  4. Webgenz searches for the Macro Value by inspecting the Content File(s). Webgenz starts by searching the first Content File defined on the line, and then inspects any inherited content files, if they exist. As soon as Webgenz finds the Macro Value for the Macro Tag, it stops searching.
     
  5. Webgenz replaces the Macro Tag in the Template File with the Macro Value. (Note: the Macro Value may include other Macro Tags -- "nesting" of Macro Tags is OK).
     
  6. If a Macro Value is not found for the Macro Tag (or if the Macro Value is blank) then the entire line in the Template File that includes the Macro Tag is deleted. This behavior is usually desirable, however it can be overridden by setting an option on the "Project Properties" screen.
     
  7. Since Macro Tags can be nested, Webgenz will process the Template File repeatedly until no Macro Tags remain. In the "Project Properties" screen you can set the maximum number of times that Webgenz will process a Template File looking for Macro Tags. However, Webgenz will not process the Template File unnecessarily. If Webgenz does not find any additional Macro Tags, it will automatically stop processing the file.

Notes:

  • In Step 4 above, it is possible to control the starting point from which Webgenz will search for a Macro Value. For example, it is possible to indicate that Webgenz should start searching for the Macro Value from an inherited Content File. To do this, a special format is used in the Macro Tag. That format is:
      [@^MY_TAG]
      
    The "^" in the Macro Tag indicates that Webgenz should start looking for the Macro Value one level up in the hierarchy from where the Macro Tag is used. This feature provides a way to "subclass" Macros.
     
  • When Webgenz finds a Macro Value, it may alter that Macro Value before it replaces the Macro Tag with the Macro Value. Why would Webgenz do this? Webgenz would do this in order to preserve the formatting of the final HTML document that is generated by Webgenz. Here's and example:

    Consider the following Template File:

      <HTML>
      <HEAD>
      <TITLE>My Title</TITLE>
      </HEAD>
      <BODY>
      <TABLE>
        <TR>
          <TD>
            [@MY_CONTENT]
          </TD>
        </TR>
      </TABLE>
      </BODY>
      </HTML>
      

    And the following Content File:

      [@MY_CONTENT]:
      This is a block of content that
      is a few lines long. This is
      just an example.
      [@]
      

    If Webgenz were to simply insert the Macro Value in place of the Macro Tag, the result would be the following:

      <HTML>
      <HEAD>
      <TITLE>My Title</TITLE>
      </HEAD>
      <BODY>
      <TABLE>
        <TR>
          <TD>
      This is a block of content that
      is a few lines long. This is
      just an example.
          </TD>
        </TR>
      </TABLE>
      </BODY>
      </HTML>
      

    Since the formatting of this output is undesirable, Webgenz will alter the Macro Value. Webgenz will add whatever characters appear before and after the Macro Tag in the Template file (usually just white space) to each line of the Macro Value. In the example above, the output will be as follows:

      <HTML>
      <HEAD>
      <TITLE>My Title</TITLE>
      </HEAD>
      <BODY>
      <TABLE>
        <TR>
          <TD>
            This is a block of content that
            is a few lines long. This is
            just an example.
          </TD>
        </TR>
      </TABLE>
      </BODY>
      </HTML>
      

    As you can see, this formatting is much more desirable and reflects the formatting that the author of the Template File intended. However, this feature can be the source of confusion. To see what I mean, lets assume that the Template File in the example above is the following:

      <HTML>
      <HEAD>
      <TITLE>My Title</TITLE>
      </HEAD>
      <BODY>
      <TABLE>
        <TR>
          <TD>[@MY_CONTENT]</TD>
        </TR>
      </TABLE>
      </BODY>
      </HTML>
      

    In this case, Webgenz will generate the following:

      <HTML>
      <HEAD>
      <TITLE>My Title</TITLE>
      </HEAD>
      <BODY>
      <TABLE>
        <TR>
          <TD>This is a block of content that</TD>
          <TD>is a few lines long. This is</TD>
          <TD>just an example.</TD>
        </TR>
      </TABLE>
      </BODY>
      </HTML>
      

    Obviously, this is very undesirable. However, it is a side effect of the fact that Webgenz is designed to maintain the formatting and indentation that appears in the Template File so that the generated file will have the same formatting that it would have if you were to write it by hand. So, if you find yourself with Webgenz output that you do not understand, just make sure that you place the Macro Tag on a line by itself in the Template File.


Created with Webgenz Copyright(c) 1997-2002. Dave Krupinski. All rights reserved. Page Updated: 1/10/2002 6:58:51 AM