Appendix B. Theon Model Toolkit

The modelling toolkit actions are accessed by using the Theon toolkit command with the model sub-command - that is by doing: theontk model, ttk model to use the abbreviated toolkit command name or just ttkm which is the abbreviated model toolkit command name.

All the modelling specific actions and arguments then follow this, for example theontk model create, ttk model create or just ttkm create.

All the standard Theon toolkit command options (always given immediately after the base toolkit commmand) are available, for further details on these use theontk -h, ttk -h or just ttkm -h.

Table B.1. Actions Summary

Action Syntax Arguments Syntax Description

[ ( this | MODEL ) ] attach

[ at LIBRARY ] [ upon PROFILE ] [ aok ] [ using ( ( CONNP = VALUE )* | self = PROFILE ) ]

Attach or re-attach a LiveProfile for a ModelLibrary.

create

Creates the XSDDB physical database.

delete

Drops the XSDDB physical database.

[ ( this | MODEL ) ] derive

[ at LIBRARY ] [ TRANSFORM [ . SUBSIDIARY ] ] [ complete ] [ from FRAGMENT : NODE ] [ into PATH ] [ using ( valid | self = PROFILE | collate = TRANSFORM ) ]

Apply a transform against the SchemaTree of a model.

[ ( this | MODEL ) ] destroy

[ at LIBRARY ] [ upon PROFILE ] [ aok ]

Drops a physical PostgreSQL database that is an instantiation of a model.

[ ] display

Return information on the release(s) of a ModelLibrary.

[ ( this | MODEL ) ] export

[ at LIBRARY ] [ just ELEMENT [ : NODE ] ] [ into PATH ] [ using ( uri = VALUE | nsuri = VALUE | self = PROFILE | prefix = VALUE | untidy ) ]

Build the SchemaTree for a model.

[ ( this | MODEL ) ] gather

[ at LIBRARY ] [ against GENERATOR [ : INSTANCE ] ] [ for TEMPLATE ] [ using ( self = PROFILE ) ]

Run Schema Factory generators associated with a model.

[ ( this | MODEL ) ] import

[ at LIBRARY ] [ upon PROFILE ] [ using ( self = PROFILE ) ]

Imports physical database associated with a model.

[ ( this | MODEL ) ] install

[ at LIBRARY ] [ upon PROFILE ] [ complete ] [ noschema ] [ aok ]

Instantiate a model as a physical PostgreSQL database.

[ ( this | MODEL ) ] launch

[ at LIBRARY ] [ as MODEL ] [ into PATH ] [ aok ] [ using ( novcs | orphan | profile = PROFILE ) ]

Initialize or re-initialize a ModelLibrary.

[ ( this | MODEL ) ] package

Build the package for a release of a ModelLibrary.

[ ( this | MODEL ) ] release

Build a release for a ModelLibrary.

[ ( this | MODEL ) ] reload

[ at LIBRARY ] [ upon PROFILE ] [ complete ] [ aok ]

Reload a model into the XSDDB from the SchemaTree.

[ ( this | MODEL ) ] server

[ at LIBRARY ] ( ui | gw ) [ on ( PORT | ADDRESS [ : PORT ] | socket FILE ) ] [ using ( logfile = FILE | config = FILE ) ]

Run a reference/test server for a model.

[ ( this | MODEL ) ] stream

[ at LIBRARY ] [ upon PROFILE ] [ agent STREAM ] [ refresh [ from PATH ] [ to COUPLE ] ] [ couple ( none | ( all | COUPLE [ on HANDLE ] ) ) ] [ passing ( NAME as "VALUE" ) + ] [ using ( self = PROFILE ) ]

Apply stream couples associated with a model.

[ ( this | MODEL ) ] upgrade

[ at LIBRARY ] [ upon PROFILE ] [ complete ] [ noschema ] [ aok ] [ using ( current = URI ) ]

Upgrade a model realised as a physical PostgreSQL database.


Table B.2. Attach Action: Syntax and Usage

ACTION

[ QUALIFIER ] attach [ ARGUMENTS ]

DETAILS

Attach or re-attach a LiveProfile for a ModelLibrary.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The following positional arguments can be used which, when used, must be used in the numerical order given below.

(1) [ at LIBRARY ]

(2) [ upon PROFILE ]

Attach (create or update) the LiveProfile with the name PROFILE rather than the default profile name (default). The profile defines connection parameters for the PostgreSQL service to use.

(3) [ aok ]

Suppress any warning prompts preceeding destructive actions.

(4) [ using ( ( CONNP = VALUE )* | self = PROFILE ) ]

Override any of the default connection parameters used for the LiveProfile taken from the ModelLibrary. Supported connection parameters (CONNP) are: dbname, host, hostaddr, port, user, password and service. Also schema can be used to specify an alternative schema to use in the connnection session. Use self to specify the named LiveProfile to define connection parameters for the PostgreSQL instance to use for XSDDB. If this argument is not given the default named profile is used.


Table B.3. Create Action: Syntax and Usage

ACTION

create [ ARGUMENTS ]

DETAILS

Creates the XSDDB physical database.

ARGUMENTS

The positional arguments which can be used are the same as and must be used in the same numerical order as for the install action.


Table B.4. Delete Action: Syntax and Usage

ACTION

delete [ ARGUMENTS ]

DETAILS

Drops the XSDDB physical database.

ARGUMENTS

The positional arguments which can be used are the same as and must be used in the same numerical order as for the destroy action.


Table B.5. Derive Action: Syntax and Usage

ACTION

[ QUALIFIER ] derive [ ARGUMENTS ]

DETAILS

Apply a transform against the SchemaTree of a model.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The following positional arguments can be used which, when used, must be used in the numerical order given below.

(1) [ at LIBRARY ]

(2) [ TRANSFORM [ . SUBSIDIARY ] ]

Apply the named TRANSFORM. If this argument is not used the collated schema file is generated, without any transformation being applied (except with using collate option, see below). Optionally specify the named transform subsidiary SUBSIDIARY, useful for running smaller parts of large and time consuming derivations.

(3) [ complete ]

Do not use a collated schema file pre-generated from the schema tree prior to applying the transform. If this argument is not used a collated schema file may or may not be used depending on whether an instance can be found.

(4) [ from FRAGMENT : NODE ]

Only apply the transform to a part of the schema tree rooted at the named FRAGMENT directory and NODE file. If this argument is not used the transform is applied to the root of the entire schema tree.

(5) [ into PATH ]

The transform output is generated into the specified PATH. If this argument is not used the transform output is generated into the LIBRARY.

(6) [ using ( valid | self = PROFILE | collate = TRANSFORM ) ]

Use valid to force XSD validation during SchemaTree processing. Use self to specify the named LiveProfile to define connection parameters for the PostgreSQL instance to use for XSDDB. If this argument is not given the default named profile is used. Use collate to specify a transform to apply only when generating the collated schema file.


Table B.6. Destroy Action: Syntax and Usage

ACTION

[ QUALIFIER ] destroy [ ARGUMENTS ]

DETAILS

Drops a physical PostgreSQL database that is an instantiation of a model.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The following positional arguments can be used which, when used, must be used in the numerical order given below.

(1) [ at LIBRARY ]

(2) [ upon PROFILE ]

Use the named LiveProfile to define connection parameters for the PostgreSQL instance to use. If this argument is not given the default named profile is used.

(3) [ aok ]

Suppress any warning prompts preceeding destructive actions.


Table B.7. Display Action: Syntax and Usage

ACTION

[ QUALIFIER ] display [ ARGUMENTS ]

DETAILS

Return information on the release(s) of a ModelLibrary.

ARGUMENTS

The positional arguments which can be used are the same as and must be used in the same numerical order as for the display action of the build toolkit command.


Table B.8. Export Action: Syntax and Usage

ACTION

[ QUALIFIER ] export [ ARGUMENTS ]

DETAILS

Build the SchemaTree for a model.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The following positional arguments can be used which, when used, must be used in the numerical order given below.

(1) [ at LIBRARY ]

(2) [ just ELEMENT [ : NODE ] ]

Build a SchemaTree Fragment for the named ELEMENT. By default the whole SchemaTree is built. An element can be cluster, conduit, desktop, model, panel, path, entity, role, schema, stream or profile. Not all elements necessarily exist in a model. If a NODE is named a SchemaTree Fragment is only built for matching nodes of the ELEMENT. A NODE argument is ignored for the profile element.

(3) [ into PATH ]

Build the SchemaTree at the location specified by PATH. By default the SchemaTree is built in the LIBRARY location.

(4) [ using ( uri = VALUE | nsuri = VALUE | self = PROFILE | prefix = VALUE | untidy ) ]

Override the default base URI and Namespace URI to use in the created schema tree. Override the default LiveProfile to define connection parameters for the PostgreSQL instance where XSDDB is. Use prefix to override the model and/or default name prefix for Theon generated components. Use untidy to produce raw unformatted XML output (faster but poor for comparison and version control).


Table B.9. Gather Action: Syntax and Usage

ACTION

[ QUALIFIER ] gather [ ARGUMENTS ]

DETAILS

Run Schema Factory generators associated with a model.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The following positional arguments can be used which, when used, must be used in the numerical order given below.

(1) [ at LIBRARY ]

(2) [ against GENERATOR [ : INSTANCE ] ]

Only produce output for templates using the named GENERATOR class. Where an INSTANCE is also specified then only produce output for templates using that specific instance of the class. If this argument is not used output is produced for all the templates irrespective of generator class and instance.

(2) [ for TEMPLATE ]

Only produce output for the named template.

(4) [ using ( self = PROFILE ) ]

Use to specify the named LiveProfile to define connection parameters for the PostgreSQL instance to use for XSDDB. If this argument is not given the default named profile is used.


Table B.10. Import Action: Syntax and Usage

ACTION

[ QUALIFIER ] import [ ARGUMENTS ]

DETAILS

Imports physical database associated with a model.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The following positional arguments can be used which, when used, must be used in the numerical order given below.

(1) [ at LIBRARY ]

(2) [ upon PROFILE ]

Use the named LiveProfile to define connection parameters for the PostgreSQL instance to use. If this argument is not given the default named profile is used.

(3) [ using ( self = PROFILE ) ]

Use to specify the named LiveProfile to define connection parameters for the PostgreSQL instance to use for XSDDB. If this argument is not given the default named profile is used.


Table B.11. Install Action: Syntax and Usage

ACTION

[ QUALIFIER ] install [ ARGUMENTS ]

DETAILS

Instantiate a model as a physical PostgreSQL database.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The following positional arguments can be used which, when used, must be used in the numerical order given below.

(1) [ at LIBRARY ]

(2) [ upon PROFILE ]

Use the named LiveProfile to define connection parameters for the PostgreSQL instance to use. If this argument is not given the default named profile is used.

(3) [ complete ]

Where applicable force complete regeneration of intermediate results. If this argument is not used intermediate results may or may not be regenerated first depending on whether a sufficiently recent instance can be found.

(4) [ noschema ]

Do not create and load the meta data table holding the SchemaTree representation of the realised model. This is used during model upgrades but is not mandatory as long as the represented SchemaTree is available somewhere as a source for the differential transform.

(5) [ aok ]

Suppress any warning prompts preceeding destructive actions.


Table B.12. Launch Action: Syntax and Usage

ACTION

[ QUALIFIER ] launch [ ARGUMENTS ]

DETAILS

Initialize or re-initialize a ModelLibrary.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The following positional arguments can be used which, when used, must be used in the numerical order given below.

(1) [ at LIBRARY ]

(2) [ as MODEL ]

Create the ModelLibrary with the name MODEL rather than the original name or database name.

(4) [ into PATH ]

Create the ModelLibrary at the specified PATH. If this argument is not used the ModelLibrary is created in the LIBRARY.

(5) [ aok ]

Suppress any warning prompts preceeding destructive actions.

(6) [ using ( novcs | orphan | profile = PROFILE ) ]

Use novcs if this ModelLibrary will be represented (outside of this toolkit support) in an external Version Control System, or if no VCS is required. If not specified Git will be used. Use orphan to disconnect the new ModelLibrary from its origin (where it has one). Use profile to set the default LiveProfile to use for connecting to XSDDB when using this ModelLibrary (instead of default).


Table B.13. Package Action: Syntax and Usage

ACTION

[ QUALIFIER ] package [ ARGUMENTS ]

DETAILS

Build the package for a release of a ModelLibrary.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The positional arguments which can be used are the same as and must be used in the same numerical order as for the package action of the build toolkit command.


Table B.14. Release Action: Syntax and Usage

ACTION

[ QUALIFIER ] release [ ARGUMENTS ]

DETAILS

Build a release for a ModelLibrary.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The positional arguments which can be used are the same as and must be used in the same numerical order as for the release action of the build toolkit command.


Table B.15. Reload Action: Syntax and Usage

ACTION

[ QUALIFIER ] reload [ ARGUMENTS ]

DETAILS

Reload a model into the XSDDB from the SchemaTree.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The following positional arguments can be used which, when used, must be used in the numerical order given below.

(1) [ at LIBRARY ]

(2) [ upon PROFILE ]

Use the named LiveProfile to define connection parameters for the PostgreSQL instance to use. If this argument is not given the default named profile is used.

(3) [ complete ]

Where applicable force complete regeneration of intermediate results. If this argument is not used intermediate results may or may not be regenerated first depending on whether a sufficiently recent instance can be found.

(4) [ aok ]

Suppress any warning prompts preceeding destructive actions.


Table B.16. Server Action: Syntax and Usage

ACTION

[ QUALIFIER ] server [ ARGUMENTS ]

DETAILS

Run a reference/test server for a model.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The following positional arguments can be used which, when used, must be used in the numerical order given below.

(1) [ at LIBRARY ]

(2) ( ui | gw )

The specfic server type to run.

(3) [ on ( PORT | ADDRESS [ : PORT ] | socket FILE ) ]

Run the server on a specific port PORT, address ADDRESS (and optionally port PORT) or socket file FILE. By default the server runs on address 127.0.0.1 and port 8000/8001 (ui/gw).

(4) [ using ( logfile = FILE | config = FILE ) ]

Use logfile to redirect the server logs to file FILE rather then the stdout default. Use config to set a specific server configuration file to use on startup.


Table B.17. Stream Action: Syntax and Usage

ACTION

[ QUALIFIER ] stream [ ARGUMENTS ]

DETAILS

Apply stream couples associated with a model.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The following positional arguments can be used which, when used, must be used in the numerical order given below.

(1) [ at LIBRARY ]

(2) [ upon PROFILE ]

Use the named LiveProfile to define connection parameters for the PostgreSQL instance to use. If this argument is not given the default named profile is used.

(3) [ agent STREAM ]

The name of the stream agent to apply.

(4) [ refresh [ from PATH ] [ to COUPLE ] ]

Reload the stream source data table where applicable. If a filename path is given reload from that, otherwise reloads from stdin. If a couple is specified its own source table will be reloaded instead of the stream source table.

(5) [ couple ( none | ( all | COUPLE [ on HANDLE ] ) ) ]

The name of a specific couple within the stream agent, only that one couple is then applied (rather than all). The couple if specified can be optionally constrained by the given slash separated handle values (use * as a positional wildcard). Using all will run all stream couples (optionally applying the same handle to each). Using none will not run any.

(6) [ passing ( NAME as VALUE ) + ]

Specify any number of comma separated stream/couple specific parameters. Each value must be quoted (in double quotes, which will need shell escaped).

(7) [ using ( self = PROFILE ) ]

Use self to specify the named LiveProfile to define connection parameters for the PostgreSQL instance to use for XSDDB. If this argument is not given the default named profile is used.


Table B.18. Upgrade Action: Syntax and Usage

ACTION

[ QUALIFIER ] upgrade [ ARGUMENTS ]

DETAILS

Upgrade a model realised as a physical PostgreSQL database.

QUALIFIER

( this | MODEL )

If the qualifier is not given or this is used as the qualifier then the CWD must be a ModelLibrary and the model within it is used for the action. Otherwise a named MODEL must be given as the qualifier and will be used for the action. The ModelLibrary Search Path will be used to find a named MODEL (as a Folder) and this by default includes the CWD.

ARGUMENTS

The following positional arguments can be used which, when used, must be used in the numerical order given below.

(1) [ at LIBRARY ]

(2) [ upon PROFILE ]

Use the named LiveProfile to define connection parameters for the PostgreSQL instance to use. If this argument is not given the default named profile is used.

(3) [ complete ]

Where applicable force complete regeneration of intermediate results. If this argument is not used intermediate results may or may not be regenerated first depending on whether a sufficiently recent instance can be found.

(4) [ noschema ]

Do not create and load the meta data table holding the SchemaTree representation of the realised model. This is used during model upgrades but is not mandatory as long as the represented SchemaTree is available somewhere as a source for the differential transform.

(5) [ aok ]

Suppress any warning prompts preceeding destructive actions.

(7) [ using ( current = URI ) ]

Use current to specify a path to the ModelLibrary holding the current SchemaTree in force for the upgrade. This will be used in place of the SchemaTree taken from the database itself, this option is therefore mandatory if the model was last installed or upgraded with the noschema option.