Control File

The core of the template is a control file named "control.xml". It is an XML file containing information about files to be generated. It is structured as follows:

 

<product>

The top level is the product level identified by the <product> tag. (The tag name "product" will be replaced by unique product name identifier in respective products.) It gives a brief description of the template and serves for product and version information purpose. The code generator will monitor changes in this tag before generating scripts with the template.

Syntax:

 

Attributes Description
date Template creation date
version Template version number
desc Brief description of the template
language Language of the template
author Author of the template

 

<control>

The next level is the control level identified by the <control> tags. Each <control> tag specify an output file or a set of output files to be generated by the code generator.

Syntax:

 

Attributes Description
id Control ID. This attribute identifies the page(s) to be generated.
Notes
  1. It should only contain [a-z0-9_.].
  2. The "_" and "." are only used as delimiters, in some cases they are ignored, e.g. "reset_password" is same as "resetpassword". DO NOT use IDs that differ in "_" or "." only. When you add a new control (e.g. in extensions), make sure you use a unique ID which is not already used.
  3. Do not use ID starting with @ character as it is reserved for internal use by the product only.
ofile Output file name. If ofile and oext are not provided, the input file name and extension will be used.
oext Output file extension. For use with ofile. If ofile and oext are not provided, the input file name and extension will be used.
tagext Optional. Control tag extension. It is used to distinguish control tags with the same id. Some control tags have same id because they are related, usually one is a class file, the other a page using the class. Possible value is "class" only.
type Control type. Possible values are:
folder Define folder name by an ID. The folder ID is to be used by ofolderid attribute (see below) of other controls. The control must have id and ofolder attribute (see below).
table Table-related files. An output file will be generated for EACH table. For example, the control with id="list" generates List page for each table.
other or simple Non table-related files.
copy Copy file or folder from the template to the output folder directly.
system Internal control used by system. The id is started with @. DO NOT CHANGE.
ifiles Input file(s). (Currently it is always one file for each control only.)
ofolder Optional. Output folder (relative to project folder). If no ofolder or ofolderid is specified, the default output folder is the project folder.
ofolderid Optional. Output folder id. The id is used to get the output folder defined by controls with type="folder" (see above). If no ofolder or ofolderid is specified, the default output folder is the project folder.
rtl Optional. For use with .css or .scss files only. Value is "true" or "false". If "true", RTL version of the .css file will be generated.
remark Remark to be shown in the generation file list before generation.
cond Condition for the control. If condition specified, the file(s) will only be generated if the condition is met. If no condition, the file(s) will always be generated.

The syntax of condition is similar to JavaScript expression:

<condition> [[<logical operator> <condition2>] ...]

Condition syntax:

<object>.<property> <comparison operator> <value>

See Object Properties for available objects and properties.

Supported logical operator:

&& AND
|| OR
! NOT

Note Parentheses are supported.

Supported comparison operators:

== equal
!= not equal
> greater than
>= greater than or equal to
< less than
<= less than or equal to

Value:
value for comparison

 

 ©2002-2025 e.World Technology Ltd. All rights reserved.