Work with HTML Templates
|
|
Use TemplateMaker to create HTML pages and incorporate database calls into those pages, specifying the style and format for data submitted and returned. TemplateMaker provides an easy interface for working with HTML tags although, if you prefer working in another HTML editing program, you can create pages in that program and use TemplateMaker just for coding the database interactions. Use SQLEditor to enter the SQL statements that your templates use to retrieve and post data. Your templates refer to a SQL statement by its command ID.
To work with TemplateMaker, you should be familiar with the HTML specification version 3.2 or later. For more information, refer to the World Wide Web consortium Web site.
You can work on multiple templates simultaneously by creating several new templates or opening a group of existing templates.
To check out the template again, see Open a Template on the Server.
Search for and Replace Text in a Template
TemplateMaker does not validate the HTML syntax.
|
To define |
Use |
|
Basic document structure such as centering text, using a style sheet, and so on | |
|
Applets, scripts, ActiveX controls, and so on | |
|
Form input data, select lists, buttons, and so on | |
|
Frames in a page | |
|
Images to display and image maps | |
|
Anchor tags for links | |
|
Definition, ordered, or unordered lists | |
|
Table caption, size, rows, and columns | |
|
Text format such as bold, line breaks, citations, and so on. |
Incorporate Data and Dynamic Behavior in a Page
|
To define |
Use |
|
Format of data retrieved from a database. Options include tables, radio buttons, check boxes, select lists, and so on. Processed after <REP>. | |
|
Text and template used for display of error messages requested by another template. Processed after the <CMD> tag if an error arises. | |
|
Insertion of another template in a current template. Processed first among XLiRAD tags. | |
|
Replacement of page variables with data retrieved from a database. Processed after <INC>. | |
|
Replacement of page variables from a result set different from the one used with a preceding <REP> tag. Processed after <CMD> provided no error occurs. |
Use the following user-interface elements of TemplateMaker to create and manage templates in XLiRAD:
For information about dialog boxes presented when you work with TemplateMaker, see:
The TemplateMaker provides a user interface for viewing, authoring, and editing standard HTML and custom command syntax used in templates.
As shown in the following illustration, the TemplateMaker window provides access to functions through toolbar buttons, window menus, and a shortcut menu.
A status bar at the bottom of the window provides the following information about the current template:
As shown in the following illustration, the Command Tag dialog box provides a sample output box where you can view a typical display that might result from using the specific tag attribute.
|
Button |
ToolTip |
|
|
New Template |
|
|
Open Local Template |
|
|
Print Template |
|
|
Browser View |
|
|
Save Template Locally |
|
|
Open Template From Server |
|
|
Save Template On Server |
|
|
Cut Text |
|
|
Copy Text |
|
|
Paste Text |
|
|
<CMD> |
|
|
<ERR> |
|
|
<INC> |
|
|
<REP> |
|
|
<REP2> |
|
|
Refresh Server Lists |
Use the File menu to manage template files on the server or on the local computer.
|
Command Name |
Description |
|
New |
Presents a blank area in the TemplateMaker window for creating a new template. |
|
Open Local |
Opens a template stored on the local computer. |
|
Save Local |
Saves a template on the local computer. |
|
Save As Local |
Saves a template under a new name on the local computer and leaves original template intact. |
|
Open From Server |
Opens a template stored on the server. |
|
Save On Server |
Saves a template on the server. |
|
Save As On Server |
Saves a template under a new name on the server and leaves original template intact. |
|
Check In |
Saves the current template to the server and sets it to read-only mode. |
|
Revision Viewer |
Presents a window for display of comments describing revisions to a template. |
|
Browser View |
Displays the template as it would appear in an HTML browser. |
|
Refresh Server Data |
Connects to the server and displays the current template data. |
|
|
Outputs the template to a printer. |
|
Exit |
Closes the TemplateMaker user interface. |
Use the Edit menu to manipulate text in a template.
|
Command |
Description |
|
Cut |
Removes selected text from its current cursor position in the current template and copies it to the Clipboard. You can paste it into another area of the template or into another template. |
|
Copy |
Copies selected text from the current cursor position in the current template into the Clipboard. You can paste it into another area of the template or into another template. |
|
Paste |
Adds at the cursor position any text that you placed in the Clipboard using Cut or Copy. |
|
Find |
Displays a dialog box where you can specify text to locate in the current template. |
|
Find Again |
Repeats a search defined using the Find command. |
|
Replace |
Displays a dialog box where you can specify text to locate as well as text to paste in its place. |
The XLiRAD Tags menu provides menu commands that display dialog boxes for defining how your template page presents data retrieved from the database by means of SQL statements defined in SQLEditor. The menu contains the following commands.
FormProcessor, the DBServer component that processes templates, interprets XLiRAD tags in the following order:
Use the option tabs to define the format you
want. TemplateMaker inserts beginning and ending <CMD> tags followed by the available options and the
values you define in the format dialog box. The template strings these options
and values together in the syntax:
&OPTION_NAME=your_value
Message or comment text (if supported in the dialog box for the format) appears in square brackets.
All formats support error handling.
For an illustration of how a browser might display tag format, see the Sample Output box in the right corner of the Command Tag dialog box.
To modify <CMD> tag settings, right-click the tag code and point to Edit Command.
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Command ID |
The number of the SQL statement as it
appears in SQLEditor. The statement must contain a SELECT operation that retrieves one row with six
columns containing data in this order: |
|
Error Condition |
A type of error handling. The options are: None.The template displays nothing when an error occurs.
|
|
CommandName |
A name for the SQL statement identified by number under Command ID. |
|
Error Template |
The name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
|
Mask Null Values |
Select this check box to convert null values to spaces. |
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Command ID |
The number of the SQL statement as it appears in SQLEditor. The statement must return a two column result set. The template assigns the name of the first column to the check boxes. In addition, the template assigns the values of the first column as the values of the check boxes and the displays the values of the second column on the page. |
|
Error Condition |
A type of error handling. The options
are: |
|
CommandName |
A name for the SQL statement identified by number under Command ID. |
|
Error Template |
A name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
|
Mask Null Values |
This check box to convert null values to spaces. |
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Command ID |
The number of the SQL statement as it appears in SQLEditor. The statement contain return a single row. If the query produces multiple rows, the template uses only the first row. |
|
Error Condition |
A type of error handling. The options
are: |
|
CommandName |
A name for the SQL statement identified by number under Command ID. |
|
Error Template |
A name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
|
Mask Null Values |
This check box to convert null values to spaces. |
|
Hidden Fields |
The names of fields (columns) that the template should not display. Data specified as hidden is still available for use on the form. |
|
Static Fields |
The names of fields (columns) that the template should not display but which should not be available for editing use in the form. |
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Known External Functions |
An external function ID. |
|
Error Template |
A name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Command ID |
The number of the SQL statement as it appears in SQLEditor. |
|
Error Condition |
A type of error handling. The options
are: |
|
CommandName |
A name for the SQL statement identified by number under Command ID. |
|
Error Template |
A name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
|
Mask Null Values |
This check box to convert null values to spaces. |
|
Ignored Columns |
The names of the columns (fields) that you want to omit from the template data. |
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Command ID |
The number of the SQL statement as it appears in SQLEditor. This statement retrieves the initial result set and creates variables for each row with the column name as the name of the variable. |
|
Error Condition |
A type of error handling. The options
are: |
|
CommandName |
A name for the SQL statement identified by number under Command ID. |
|
Error Template |
A name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
|
Execution ID |
The number of the SQL statement that receives data from the preceding statement. This statement must process the variables input from the preceding statement one row at a time. |
|
Break on Error |
This check box to terminate the "looping" of data from the first statement to the next when an error occurs. |
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Command ID |
The number of the SQL statement as it appears in SQLEditor. |
|
Error Condition |
A type of error handling. The options
are: |
|
CommandName |
A name for the SQL statement identified by number under Command ID. |
|
Error Template |
A name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Command ID |
The number of the SQL statement as it appears in SQLEditor. The statement should contain a SELECT operation that returns a single row. The template creates a name-value pair from the row data. The name-value pair associates a column name from the query with its value to form a new variable for use throughout the template. If the query returns multiple rows, the template uses only the values from the first row for the name-value pair. If the result set from the query is empty, TemplateMaker creates no new variables. |
|
Error Condition |
A type of error handling. The options
are: |
|
CommandName |
A name for the SQL statement identified by number under Command ID. |
|
Error Template |
A name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
|
Mask Null Values |
This check box to convert null values to spaces. |
|
Money Fields |
The names of fields (columns) that contain monetary values. TemplateMaker rounds these values to two decimal places. Notice that TemplateMaker does not precede these values with a dollar sign ($) so you can treat the values as floating-point variables.) |
To substitute values in the template after using Pairs, use <REP2> rather than <REP> for the substitution. Because TemplateMaker executes <REP> tags before all other commands and tags, including <CMD> and < Pairs >, using the <REP> would cancel the effect of those tags.
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Command ID |
The number of the SQL statement as it appears in SQLEditor. The statement must be a two-column query. The template assigns the name of the first column to the radio control. In addition, the template selects the values of the first column in the control, and displays the values of the second column in the template. |
|
Error Condition |
A type of error handling. The options
are: |
|
CommandName |
A name for the SQL statement identified by number under Command ID. |
|
Error Template |
A name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
|
Mask Null Values |
This check box to convert null values to spaces. |
|
Selected Value |
The column (field) name from the statement for which a radio-button value appears selected in the template. By default, the template shows the first value from the statement selected. |
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Command ID |
The number of the SQL statement as it appears in SQLEditor. |
|
Error Condition |
A type of error handling. The options
are: |
|
CommandName |
A name for the SQL statement identified by number under Command ID. |
|
Error Template |
A name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
|
Mask Null Values |
This check box to convert null values to spaces. |
|
Row Template |
The name of the template used for formatting row data. |
|
Rows Per Page |
The maximum number of rows to display on the table for a large result set. The default page size for table formats is 25 rows. If the number of rows in the table exceeds the value for Rows Per Page, XLiRAD automatically breaks the pages and inserts "Next" and "Previous" links beneath the table for navigation through the remaining pages. |
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Command ID |
The number of the SQL statement as it appears in SQLEditor. The statement must be a two-column query. The template assigns the name of the first column to the list control. In addition, the template selects the values of the first column in the control, and displays the values of the second column in the template. |
|
Error Condition |
A type of error handling. The options
are: |
|
CommandName |
A name for the SQL statement identified by number under Command ID. |
|
Error Template |
A name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
|
Mask Null Values |
This check box to convert null values to spaces. |
|
Selected Value |
The column (field) name from the statement for which a value appears selected in the template. By default, the template shows the first value from the statement selected. |
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Command ID |
The number of the SQL statement as it appears in SQLEditor. |
|
Error Condition |
A type of error handling. The options
are: |
|
CommandName |
A name for the SQL statement identified by number under Command ID. |
|
Error Template |
A name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
|
Mask Null Values |
This check box to convert null values to spaces. |
|
Hidden Fields |
The name of data-table columns (fields) that should not appear in the template as a column name. You might use this field for a link. |
|
Use Auto Header |
This check box to create a row of headers with the field names from the SQL statement. |
|
Money Fields |
The name of any data-table column (field) that contains a monetary value. When displayed, the value appears preceded by a dollar sign and rounded to two decimal places. |
|
Show Row Count |
This check box to display the number of rows at the bottom of the table. |
|
Row Colors |
To define a single background color for the table, A color in the only leftmost list box. To define two alternating colors, A color in both the left and right list boxes. |
|
Link Column |
The name of the column (field) in this result set that you want to link to from another template. |
|
Link Template |
A name of the template to link to. |
|
Link Fields |
The name of a field to send to the linked template. Separate the link fields with commas. |
|
Rows Per Page |
The maximum number of rows to display on the table for a large result set. The default page size for table formats is 25 rows. If the number of rows in the table exceeds the value for Rows Per Page, XLiRAD automatically breaks the pages and inserts "Next" and "Previous" links beneath the table for navigation through the remaining pages. |
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Command ID |
The number of the SQL statement as it appears in SQLEditor. |
|
Error Condition |
A type of error handling. The options
are: |
|
CommandName |
A name for the SQL statement identified by number under Command ID. |
|
Error Template |
A name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
|
Mask Null Values |
This check box to convert null values to spaces. |
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Command ID |
The number of the SQL statement as it appears in SQLEditor. |
|
Error Condition |
A type of error handling. The options
are: |
|
CommandName |
A name for the SQL statement identified by number under Command ID. |
|
Error Template |
A name of the template you want displayed when an error occurs. |
|
Error Message |
Custom text to display in the error template. |
|
Mask Null Values |
This check box to convert null values to spaces. |
|
Tree Node |
The field names from the statement as the nodes of the tree. Specify the nodes in order from highest to lowest and separate column (field) names with commas. To skip a field, type two consecutive commas. To skip the first column (field), start the list with a comma. The template does not display column (field) names if their names don't appear in this box. |
|
Tree Links |
The names of the templates that you want nodes to link to, if any. If none, leave this box blank. When typing multiple template names, separate the names with commas. |
Do not use this attribute with an extremely large result set. Tree does not have paging functionality; therefore, TemplateMaker converts the entire result set into a tree. When working with a very large result set, this conversion might result in a substantial strain on the servlet manager's memory resources and possibly cause low-memory errors. |
Use <ERR> to display errors generated from commands on the current template or another template. The <ERR> tag inserts the ERROR= attribute with a value that corresponds to the error message text. If no error occurs, TemplateMaker discards the <ERR> tag.
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Previous Template |
The name of a template or accept the default shown (the previous template used) to display when an error occurs. |
Use the <INC> tag to include other templates in the current template. TemplateMaker processes <INC> tags before other commands.
Complete the options as needed and click Include.
|
For this option |
Type or click |
|
Template Name |
A name of the template to include in this list box. |
|
Cache Template |
This check box to have TemplateMaker retain the template in the cache for better performance. |
Use <REP> to replace variables declared in a template with values retrieved earlier from the database using a different template linked or redirected to the current template. TemplateMaker processes <REP> tags after INC tags. Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Variable for Substitution |
The name of the variable you inserted in the template. TemplateMaker replaces that variable with the data retrieved from the database, if any. Otherwise, TemplateMaker disregards the variable. |
|
Use URL Encoding |
This check box to pass the variable in encoded form in the template's URL. |
Similar to <REP>, use <REP2> to replace variables declared in a template with values retrieved earlier from the database using a different template linked or redirected to the current template. However, unlike REP, you can also use REP to replace data retrieved by commands in the current template. TemplateMaker processes <REP2> tags after all other tags except <ERR>.
Complete the options as needed and click Submit.
|
For this option |
Type or click |
|
Variable for Substitution |
The name of the variable you inserted in the template. TemplateMaker replaces that variable with the data retrieved from the database, if any. Otherwise, TemplateMaker disregards the variable. |
|
Use URL Encoding |
This check box to pass the variable in encoded form in the template's URL. |
The HTML Tags menu provides commands that display dialog boxes used to define the HTML syntax and effects used on a template page. The menu contains the following commands.
|
|
|
Option |
Used to |
|
Define a background image, background and text colors, class, style, and link colors | |
|
<CENTER> |
Insert starting and ending tags for centered text. |
|
Define the appearance of a horizontal row in this page. | |
|
<STYLE> |
Insert a tag for specifying a cascading style sheet (.css) file used for this page. |
Complete the values as appropriate and click Submit.
For this option |
Type or click |
Example |
Background Color |
A color in this list box. |
BGCOLOR="Blue" |
Text Color |
A color in this list box. |
TEXT="Fuchsia" |
Class |
The name of the class that you want the tag to use. |
CLASS="class_name" |
Style |
The name of the style that you want the heading level tag to use. |
STYLE="style_name" |
Background Image |
The name of an image file to display. |
BACKGROUND= |
Link Color |
A color in this list box. |
LINK="Lime" |
Visited Link Color |
A color in this list box. |
VLINK="Black" |
Active Link Color |
A color option in this list box. |
ALINK="Teal" |
Complete the values as appropriate and click Submit.
|
For this option |
Type or click |
Example |
|
Identification |
An identifier for this tag. This can be a numeral or a name. |
ID="ID_name". |
|
Alignment |
An alignment attribute in this list box. Left, Center, and Right are available options. | ALIGN="Left". |
|
Class |
The name of the class that you want the tag to use. | CLASS="class_name". |
|
Style |
The name of the style that you want the heading level tag to use. | STYLE="style_name". |
|
Size |
A value for the thickness of the rule. | SIZE="value" |
|
Width |
A value for the width of the rule. |
WIDTH=" value " |
|
Option |
Used to |
|
Define a Java applet to run in this page. | |
|
Define an object to include on this page (for browsers other than Microsoft Internet Explorer Netscape Navigator version) | |
|
Include an ActiveX control on this page. | |
|
Specify parameters for a control. | |
|
Define JavaScript or VBScript to run on this page. |
Complete the dialog box options and click Submit.
|
For this option |
Type or click |
Example |
|
Code |
The name of the file that contains the applet. |
CODE=" |
|
Code Base |
The URL for the folder that contains the applet. |
CODEBASE="URL" |
|
Archives |
The name of the archive file that contains the compressed applet. |
ARCHIVE="file_name" |
|
Height |
The height used for display of the object in relation to the entire page. |
HEIGHT="value" |
|
Width |
The width used for display of the object in relation to the entire page. |
WIDTH="value" |
|
Horizontal |
The amount of horizontal space on the left and right of the applet display. |
HSPACE="value" |
|
Vertical |
The amount of vertical space above and below the applet display. |
VSPACE="value" |
|
Name |
A name used to refer to an instance of this applet in the page. When you have multiple applets in the page, they can communicate with each other using this reference. |
NAME="instance_name" |
|
ID |
An identifier for this tag. This can be a numeral or a name. |
ID="ID_name" |
|
Alignment |
An alignment attribute in this list box. Left, Center, and Right are available options. |
ALIGN="Left" |
|
Class |
The name of the class that you want the tag to use. |
CLASS="class_name" |
|
Style |
The name of the style that you want the heading level tag to use. |
STYLE="style_name" |
Complete the values as appropriate and click Submit.
|
For this option |
Type or click |
Example |
|
Name |
The name of the embedded object. |
NAME="object_name" |
|
Hidden |
This check box if you don't want the object to appear on the page. |
HIDDEN |
|
Source |
The URL of the object file. |
SRC="URL" |
|
Height |
The height used for display of the object in relation to the entire page. |
HEIGHT="value" |
|
Width |
The width used for display of the object in relation to the entire page. |
WIDTH="value" |
Complete the dialog box options and click Submit.
|
For this option |
Type or click |
Example |
|
Class ID |
The class ID of an ActiveX control or the name of the object. |
CLASSID= |
|
Code Type |
The path to the code required to run the object. |
CODETYPE="path" |
|
Code Base |
The URL for the folder that contains the object. |
CODEBASE="URL" |
|
Height |
The height used for display of the object in relation to the entire page. |
HEIGHT="value" |
|
Width |
The width used for display of the object in relation to the entire page. |
WIDTH="value" |
|
Horizontal |
The amount of horizontal space on the left and right of the object display. |
HSPACE="value" |
|
Vertical |
The amount of vertical space above and below the object display. |
VSPACE="value" |
|
Data |
The data that initializes the state of the object. |
DATA="data_value" |
|
Type |
The MIME type for the object. |
TYPE="MIME_type" |
|
Name |
A name used to refer to an instance of this object in the page. When you have multiple applets in the page, they can communicate with each other using this reference. |
NAME="instance_name" |
|
ID |
An identifier for this tag. This can be a numeral or a name. |
ID="ID_name" |
|
Alignment |
An alignment attribute in this list box. Left, Center, and Right are available options. |
ALIGN="Left" |
|
Border |
A value for the thickness of the border around the object. |
BORDER="value" |
|
Class |
The name of the class that you want the tag to use. |
CLASS="class_name" |
|
Map |
The name of the map. |
USEMAP="map_name" |
|
Style |
The name of the style that you want the heading level tag to use. |
STYLE="style_name" |
Complete the values as appropriate and click Submit.
|
For this option |
Type or click |
Example |
|
Identification |
An identifier for this tag. This can be a numeral or a name. |
ID="ID_name" |
|
Type |
The MIME type for the object. |
TYPE="MIME_type" |