Templates/Metatemplates
 
 
Editing Meta-templates and Templates
 
An application site created by zeroCode includes information about templates in files called Meta-templates. For every application site, zeroCode creates four Meta-template families – standard, sample, noFrames and xmlSample. Meta-templates are used to generate templates in the zeroCode auto-generation sequence. (In the FreeMarker world, a template is any text file that contains FreeMarker tags. These tags control the behavior of the FreeMarker template processor.) You can make major changes in UI by modifying the existing meta-template families followed by regenerating the site. Alternatively, you can create an entirely new meta-template family to make UI changes that are to be reflected throughout the site. Remember to regenerate the site after the creation. You can use multiple meta-templates in the generation process for separate generation runs.
Each UI page (HTML page) has a different look and feel. When a site is generated, templates for all objects (tables) in a database schema are also generated by each meta-template. At runtime (in browser), if you would like to change the look and feel of the UI page, you can edit the meta-templates and can do the necessary modifications to have the desired UI.
Changes to the meta-template can be done in two ways. Either a new meta-template can be created with all changes ( changes have to be made to the meta-templates and then renamed) or changes can be made in the templates themselves. If the changes needed, apply to more than 15% of the templates, it's better to make them in a new meta-template. All such changes can be in any of the meta-templates like gen-time FreeMarker, run-time FreeMarker, the generated HTML and the generate JavaScript.
Each meta-template uses some FreeMarker tags at generation time that identifies the field name of the objects in the templates. This FreeMarker is the gen-time FreeMarker. Some FreeMarker tags are used at the runtime that replaces its tags with data values from the objects and thereby creates the HTML page, which it then passes down to the browser via the web server. The meta-template is not used at run-time - only the template for a page is used. There are six or seven meta-templates (one each for add, list, edit, etc.) and they are used at gen- time to create the hundreds of add, list, edit, etc. templates that a site needs.
If you want to change the UI for all the add UI pages in the browser, you can edit and do the necessary modifications in the html page of add meta-template. After performing the modifications, regeneration of the site reflects the modifications done by you to the add meta-template in all subsequent add templates. Regeneration implies the creation of the standard UDM with add functionality checked for the HTML and the others need not be checked, if UI of add pages have to be changed. Thus similar changes can be made to the other meta-templates too.
Templates are HTML pages with FreeMarker tags embedded in them. The changes to the templates can be identified by name and details of change, when there arises a need to change specific pages for UI processing. Each change can be marked as being in the run-time FreeMarker, the generated HTML or generated JavaScript.
By editing the Meta-templates and templates, you can therefore control the look and feel of your site with a very high degree of granularity.