Configure Document Generator in the Workbench
It is possible to configure local templates to be used in the Gendoc
Wizard. Once the template is configured, the template will be available in
the combo box of the Gendoc Wizard. The templates can be configured to be
available for the entire workspace, or per project. The configuration
specific to a project is stored together with the project file (.gendoc
file in the project) and can be shared if using any source version control
system. The workspace gendoc configuration is local to the workspace and
it is done through the workspace preferences.
To configure templates in the workspace, open the preferences (Window
> Preferences) and select Gendoc Templates.
To configure templates for a project, open the properties for the project
(Project > Properties):

To add a new template click on the button New... and
provide the information in the dialog:

- Name: A descriptive name for the template.
- Description: Information about the template, what it
provides, what type of information will contain, in which case can the
template be used for, etc...
- Model File regexp: A java regular expression that
match the model files to which this template is applicable. It can be a
filename also.
- For papyrus files: .*\.uml.
- For a ecore model: .*\.ecore
It is possible to configure parameters to be provided when launching the
generation. The value for those parameter will be required by the wizard
before launch the generation of the document. To add a new parameter for
this generator, click the button New... in the section Parameters.
A dialog will be displayed to provide the new parameter information:

- Parameter Key: The name of the variable that will be
available in the template scripts parts by using ${parameter_key} to
refer to the value of the parameter provided in the Gendoc wizard.
- Parameter Label: The label the Gendoc wizard will for
this parameter.
The last information required, it is the template file itself. Click on
the New... button in the Templates
section. A dialog will request some information to catalog the template
file.

- Template File URL: The URL to the template file. It
could be a local file (file:/...), workspace file
(platform:/resource/), or any other url kind supported by eclipse.
- Output Format: As gendoc support different output
file formats, we indicate the output format of the selected template.
- Output parameter: The output file is required in the
<output> tag. In order to be able to select the
output file in the Gendoc wizard, a variable is used and the template
should configure the output tag as: <output
path="${output_variable}">. This output_variable is
the one to set here.
- Model parameter: Similar as for the Output Parameter,
but for the model attribute in the <context>
tag, <config model="${model_variable}"...>.
- Description: A description for the template file.
Multiple template files can be added for different output formats. Which
one to use, can be selected in the Gendoc Wizard.
Now the template should be available when launching the document
generation for any model in the project (or in the workspace if it is a
template configured in the gendoc workbench preferences.).