A template module is created in a datasqill database file. This format is used by the datasqill database deployer (deploySheet.sh) to perform structure and data changes in the datasqill repository database.
This file is in HJSON format and in the case of module definitions contains only data that datasqill needs to register a module.
Within this file, the FreeMarker template code is also stored (see the example in the later chapter).
In the file it is defined what the module is called, which parameters it needs, and the FreeMarker script.
This file has a format for versioned deployment. The current repository version with which this file was last modified is in the json attribute version.
When defining a module, entries are made in the following views (effectively they are tables in which the entries are versioned):
In this table the module is made known to the datasqill server and the GUI. The following information is specified here:
| Json Attribute | Data Type | Meaning |
|---|---|---|
| module | String | Name as referenced by action attributes |
| module_name | String | Display name in the GUI |
| module_type_id | Number | Always fixed 2 (Java module) |
| description | String | Help text for the mouseover |
| module_command | String | Always fixed "DsModTemplateSQL" |
| module_action_data_type | String | Always fixed "SQL" |
The possible module triggers are specified here. Since these are identical for all templates, only this section needs to be copied from the following example and used.
The attributes that define this module are inserted here.
The attributes named "Truncate Before" and "Loop Query" are predefined in the Java code and are executed there.
| Json Attribute | Data Type | Meaning |
|---|---|---|
| action_type | String | Name of the module. References vv_sqts_module.module |
| attr_name | String | Name of the attribute |
| attr_label | String | Display name in the GUI |
| attr_data_type | String | Data type for the GUI (BOOLEAN, CHAR, CLOB, CONNECTION, NUMBER or SQL) |
| default_value | String | Default value for the attribute value |
| attr_description | String | Help text for the mouseover |
| attr_position | String | Position (order) for displaying the attributes in the GUI. If -1, it is not displayed in the GUI |
Base values for datasqill are stored in this table. There are 4 primary columns (config_key1 - config_key2), as well as some data columns.
| Json Attribute | Data Type | Meaning |
|---|---|---|
| config_key1 | String | 1st PK: Always fixed "VARIABLE" |
| config_key2 | String | 2nd PK: Always fixed "Template" |
| config_key3 | String | 3rd PK: Always fixed "MODULE" |
| config_key4 | String | 4th PK: To be filled with the name of the module (vv_sqts_module.module) |
| config_value | String | The template for the module |
| config_sort | String | Not used. Can be set to NULL |
| config_comment | String | Not used so far. Short description for the template |
When all these entries have been made in a dsdb file, you can deploy this module to the datasqill server:
deploySchema.sh --version 0 --dbid SQTS_DB_0 < mod_xxxx.dsdb
And the new module is created in datasqill.