Chapter 4 Managing Profiles
The Generated Files category contains file entries. These entries define the files that will be generated for a given metaclass or for the instances of a metaclass with a selected stereotype or criterion.
You use the GTL to define a generated file. You can define generated file entries for any metaclass, however, only the files defined for objects belonging to a model or a package collection will be generated. Sub-objects, like attributes, columns, or parameters do not support file generation, however it can interesting to see the piece of code generated for these sub-objects in their Preview tab.
You can identify the model or package collections in the PowerDesigner metamodel.
For more information on the PowerDesigner metamodel, see the "PowerDesigner Public Metamodel" chapter.
For more information on the GTL syntax, see the "Generation Reference Guide" chapter.
If an extended model definition complementing the generation of an object language contains a generated file name identical to a generated file name defined in the object language, then the generated file defined in the extended model definition will replace the generated file in the object language.
In the previous version of PowerDesigner, you had to define a template corresponding to the file type to generate. Now, you can directly edit the template of the file to generate in the generated file property page.
Each generated file has the following properties:
Property | Description |
---|---|
Name | Name of the generated file entry in the resource editor |
File Name | Name of the file that will be generated, it can contain variables |
Encoding | Format of the generated file, PowerDesigner supports several formats. You can use the Ellipsis button to display the Text Output Encoding Format dialog box in which you can select a format in a list. In this dialog box, the Abort on Character Loss check box allows you stop generation if it causes the loss of characters |
Comment | Additional information about the generated file |
Use Package hierarchy as file path | Indicates that the package hierarchy should be used to generate the hierarchy of file directories |
Generated file template (text zone) | Template of the file to generate. You can open an editor using the Edit With tool, and if you are using templates, you can use the Browser tool to display the definition of this template. You can use the Browse tool to find all templates of the same name (see section Creating a template) |
If the File Name box is empty there is no file generated. However, it can be very useful because it allows you to preview the content of the file before generation. You can use the Preview tab of the corresponding object at any time for this purpose.
If the File Name box contains a '.' (dot) character there is no file generated either but it allows you to use the Preview tab, as explained above, with the addition of syntax color highlighting. You can add the extensions after the dot character to use the language editor of your choice (example: .dtd for XML).
To define a generated file:
Copyright (C) 2005. Sybase Inc. All rights reserved. |
![]() |