Presets Viewer

The Presets Viewer tab

The Presets Viewer tab

As described in Concepts: Task based code generation, the generator engine works by executing tasks defined in a given order. Which tasks and in which order is defined in a so called preset, stored in a preset file, which is a file with the extension .preset. To view which preset files are available and to edit them, you use the Presets Viewer.

The Presets Viewer is opened by selecting Tools -> Presets Viewer from the main menu, or by clicking the Presets Viewer button button on the toolbar.

The Presets Viewer consists of three parts: Filters, Found Presets and the Task / Task Group definitions defined in the selected preset file. These areas are described more in detail below. The Presets Viewer views only presets files which are known by the system. See the section about refreshing code generation meta-data below for how to update the known set of files.

Filter area

There are multiple frameworks supported by the designer, supporting multiple platforms, languages etc. and this results in a lot of preset files. To limit down the list of preset files to select from, the Filters area can be used. When a project is loaded, the target framework of the Entity Model in the project is used to set the Framework filter when the Presets Viewer is opened.

If you don't want to use a particular filter element, select its <Any> option.

Found Presets area

The Found Presets area is the area which allows you to work with the preset files which match the filters specified. You can select a preset file from the Name combo box and edit the preset file by clicking Edit as XML. This will allow you to edit the preset file in the Text Editor (with intellisense).

To create a new preset file, either create a copy from an existing one by clicking the Copy as New button or by creating a completely new one by clicking the New... button. Copy as New will create an exact copy of the selected preset file and allow you to specify a different name and filename. After that the file is opened in the Text Editor.

The new preset file can only be saved in a folder that's reachable by the designer, e.g. a folder specified in the Additional Tasks Folder in the Designer Preferences.

Task / Task Group definitions area

This area shows all Tasks / Task Groups defined in the selected preset file. It's for easy viewing of the selected preset without having to read XML.

Refreshing Code Generation Meta-data

The designer uses an internal code generation meta-data storage, which contains preset files, framework definition files and other code generation related files read from the default folders and additional folders specified in the project.

When you change these files on disk, the designer doesn't know about these changes until you decide to refresh the internal code generation meta-data storage. To do that, you can select Tools -> Refresh Code Generation Meta-Data from the main menu or click the Refresh Code Generation Button button on the toolbar next to the Template Bindings Viewer button.

Newly created preset files in the Designer through the Preset Viewer are picked up automatically. You only need to refresh the meta-data if you edit the files in an external editor.