Command Line Tools¶
Database Deployment¶
Prior to successfully starting the application itself, an initial database schema has to be created. Besides the application war file ( RegistryCxn.war ) a zip package (e.g. RegistryCxn.zip ) is provided that contains a script responsible for creating the DB.
- Extract the zip file into a selected folder.
- If you are using Oracle as database, first you need to download the recommended JDBC driver from here: https://www.oracle.com/database/technologies/appdev/jdbc-downloads.html
- Once it is downloaded, copy the driver (e.g.
ojdbc11.jar) into the extracted folder on the following path:RegistryCxn\lib - Make sure that the location of the registry.properties file containing the DB connectivity information is referred by the environment variable REGISTRYCXN_HOME.
- Start ./RegistryCxn bash script or RegistryCxn.bat in the RegistryCxn/bin folder of the extracted content (depending on the OS type). The following are available:
In order to create an initial DB schema or clean an existing one completely, please use the following command line:
Since version 16.09.05:
Clearing the Database¶
It is possible to clear all the structures from the database while keeping the configuration, users, groups and projects in the system. After running a script, the structure-related database tables will be cleared and the sequences will be reset. This method is designed for testing purposes, it is not recommended execute it on a production database.
In order to use this functionality, please use the database deployment script with the following argument:
Creating a group¶
To create a group with the Command Line Tool, you have to use the "create-group" command where you have to enter the name, roles and optionally the source of the group (by default it's DB). The syntax is:
(Before version 19.13.0 the -source attribute could not be used.)
Source can be either DB, AD, LDAP, SAMLSSO, OAUTH2.
Role names can be found here:https://docs.chemaxon.com/display/docs/Groups+and+roles
(Since version 19.13.0 you can add multiple roles by entering a list of role names separated by spaces.)
Updating a group¶
Since version 19.13.0 it is possible to update the roles defined by a group using the Command Line Tool. To do this, you have to use the "update-group" command where you have to enter the name, roles and optionally the source of the group (by default it's DB). The syntax is:
The arguments have the same meaning as in the "create-group" command.
Create a user¶
To create a user with the Command Line Tool, you can use the "create-user" where you have to enter the name, password, and group.
The syntax is:
Export/import configuration of the application¶
Since version 23.2.0 the current functionality of the export and import configuration of the system is moved from a command-line script to REST endpoints.
This feature is available since version 20.8.0 The configuration of the system at a given point can be exported with the migration command line tool. The application server needs to be stopped in order to correctly do the export or import. The configuration will be saved in JSON format.
The handled configurations involve the following items:
-Forms
-Dictionaries
-Fields and their form associations, dictionary associations
-Parameters
During import, the version of the configuration in the file is matched against the exact version of the target application. Import will be prevented in case of a mismatch.
Importing a configuration file will completely restore the configuration state of the application to the point when the configuration file was exported.
Usage¶
Export configuration¶
Command line arguments for the migration script:
First command line argument: export-configuration
Second command line argument: -path export-path
Options for the export-path:
-The path to a valid directory can be provided, in this case the configuration is exported with default file name and extension: "compreg-configuration-timestamp.json"
Where timestamp stands for the exact time of export.
-The path to a file can be provided, in this case no default filename will be used:
"my-exported-configuration.json"
Examples¶
Export to file with default name:
Export to file with custom name:
Import configuration¶
Command line arguments for the migration script:
First command line argument: import-configuration
Second command line argument: -path import-path
Options for the import-path:
-A valid path to an exported file has to be provided
Examples¶
Import file:
The content of the file before import is not validated. Please do not modify this, otherwise it can lead to unforeseen consequences for which we don't take responsibility for.
If a new file is exported with the same name, the old one will be overwritten.