Template Explained A template is a zip file. It is an archive of the necessary files needed to generate the output files. The core of the template file is a control file named control.xml. It is an XML file containing all the necessary instructions for the generation process. To generate output files, the code generator first unzips the template to the subfolder \<product name>\Templates\<template name> under your My Documents folder, pre-processes the scripts in the template, then parses the control.xml and follows the instructions to generate files one by one. If the unzipped template already exists, the code generator will skip the unzip process and reuse the pre-processed scripts. This can speed up the code-generation process and allow user to customize a template without unzipping and zipping the template archive.
The code generator processes the Template Tags, assembles the output files using the code snippets from template files and generate dynamic codes according to Template Object Properties. Template object properties are project settings either inputted from the GUI or restored from a project file. All the wordings in the template has been separated into a single Language File named lang.xml for easy translation to other languages and sharing. The values are not limited to text, you can use HTML tags if applicable.
A template is fully customizable. (See Customizing Template) However, note that customizing templates requires necessary knowledge in the related technologies and HTML. Advanced users can customize the dynamically generated codes by overriding an existing template tag. To override an existing template tag, you need to add your own function in the User Code File. (See Using User Code)
Furthermore, custom function is also allowed. To call the custom functions, you need to add the functions in the User Code File. Then just use template tag to call them in the template. (See Using User Code)
Also See: Control File
|
©2008 e.World Technology Ltd. All rights reserved. |