Working with Data Models › Forward Engineer/Alter Script › The Template Editor › Customize a Template File
Customize a Template File
You can customize a default template file in the Template Editor. Your customizations can be used to change syntax or add to or modify the options in the Forward Engineer and Alter Script dialogs. For example, you can add or modify templates to navigate or extract content from your model.
Each database has a corresponding forward engineering template file. The template files are automatically installed to the \Program Files\CA\ERwin Data Modeler r9\BackupFiles\Templates folder. These template files are quite extensive so they cover all of the SQL required for CA ERwin Data Modeler's processes. Therefore, when you customize a template file, you should begin with the default template file and modify it for your specific needs. Save the template file using either the existing file name or providing a new name, and then associate it with a model for schema generation tasks.
Note: When you save a forward engineering template file using the default file name provided in this product, you are overwriting the template file. If you need to revert to the original, unchanged forward engineering template file, read-only backup copies are located in the \BackupFiles\Templates folder.
To customize a template file
- Select Forward Engineer, Forward Engineering Templates from the Actions menu (in either a physical or logical/physical model).
The Template Editor opens.
- Select the template file that you want to customize. By default, the Template Editor opens using the default template file for the target database of your model. If you want to use a different template file, click the Open Template File icon to open the Open dialog and select the template file that you want.
- Customize the template using any of the following features in the Template Editor:
- Use the Sample Context box to select the starting object to use for the expansion of the template. You can change this selection at any time to view the impact of changes to a template. You can select the Show all check box so that all objects that are valid as sample contexts are added to the Sample Context box.
- Use the Templates pane to select a template and double-click it to add the template content (code) to the Template Source pane.
- Use the Template Source pane to navigate and edit the code, insert macros, or print the text. The code is syntax-colored for the brand of SQL of the current model. You can also use the Toggle Auto Indent tool to automatically indent the code as needed.
- Use the Macros pane to select a macro to insert into the Template Source pane. Highlight (select) the area in the template source where you want to insert the macro and then double-click the macro to insert it. You can also use the Toggle Macro Categories tool to toggle between alphabetical and category display. Use the Edit Macro Categories tool create new macros.
- Use the Expanded Text pane to view the read-only results of expanding the current template against the currently selected sample context object. The results are syntax-colored for the brand of SQL of the current model. You can change the sample context object by selecting a new object from the Sample Context drop-down list. Once you begin making changes to the template, the Expanded Text pane clears to recalculate and display the new results. The results include information about the parsing and execution status (failure or success). If the current TLX template does not parse correctly, it will display parser information.
- Click the Save Template File icon after you complete customizing the template.
- Enter a file name to save it as a new (*.fet) template file or use the existing file name and click Save.
The new, customized template is ready to use for schema generation tasks.
More information:
Sample Context
Templates Pane
Template Source Pane
Macros Pane
Expanded Text Pane
Copyright © 2013 CA.
All rights reserved.
|
|