Chapter 5 Customizing Generation with GTL


Creating a template and a generated file

GTL templates are commonly used for generating files. If your template is going to be used in generation, it must be referenced in a generated file.

Steps To create a generated file:

  1. In the resource editor, right click a metaclass in the Profile category, and select New→Generated File from the contextual menu.

Steps To create a template:

  1. In the resource editor, right click a metaclass in the Profile category, and select New→Template from the contextual menu.

Note   Template naming convention
We encourage you to name your templates using camelCase, starting with a lowercase letter, in order to avoid clashes with property and collection names which, by convention use full CamelCase.

Steps To reference a template in a generated file:

  1. In the resource editor, select the appropriate generated file in the Profile category, and insert the name of the template between percent signs. For example:

%myTemplate%

 


Copyright (C) 2008. Sybase Inc. All rights reserved.