CM
cm set mentdbcm set as400cm set db2cm set derby_embeddedcm set derby_servercm set firebirdcm set h2_embeddedcm set h2_servercm set hsql_embeddedcm set hsql_servercm set mysqlcm set oraclecm set postgresqlcm set sqlservercm set filecm set ftpcm set ftpscm set sftpcm set sshcm set cifscm set smtpcm set pop3cm set imapcm show_scrudcm showcm show_objcm getcm generate_updatecm existcm remove

cm set mentdb <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_mentdb" {execute "mentdb.remote.config.get" "[hostname]" "localhost" "[port]" "9998" "[key]" "pwd" "[user]" "admin" "[password]" "pwd" "[connectTimeout]" "10000" "[readTimeout]" "30000" "[subTunnels]" (mql { tunnel execute_hot "tunnelId1" {cm get "demo_cm_mentdb";} (mql { tunnel execute_hot "tunnelId2" {cm get "demo_cm_mentdb";} (mql { [MQL_TO_REPLACE] }); }); }) ;};
mentdb
1

cm set as400 <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_as400" {execute "db.as400.config.get" "[hostname]" "localhost" "[port]" "8471" "[database]" "test_db" "[user]" "bob" "[password]" "pwd" ;};
mentdb
1

cm set db2 <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_db2" {execute "db.db2.config.get" "[hostname]" "localhost" "[port]" "50000" "[database]" "test_db" "[user]" "db2admin" "[password]" "pwd" ;};
mentdb
1

cm set derby_embedded <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_derby_embedded" {execute "db.derby.embedded.config.get" "[database]" "test_db" "[user]" "sa" "[password]" "sa" ;};
mentdb
1

cm set derby_server <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_derby_server" {execute "db.derby.server.config.get" "[hostname]" "localhost, 127.0.0.1" "[port]" "1527" "[database]" "test_db" "[user]" "sa" "[password]" "sa" ;};
mentdb
1

cm set firebird <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_firebird" {execute "db.firebird.config.get" "[hostname]" "localhost" "[port]" "3050" "[database]" "test_db" "[user]" "SYSDBA" "[password]" "masterkey" ;};
mentdb
1

cm set h2_embedded <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_h2_embedded" {execute "db.h2.embedded.config.get" "[database]" "dir/test_db" "[user]" "sa" "[password]" "sa" ;};
mentdb
1

cm set h2_server <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_h2_server" {execute "db.h2.server.config.get" "[hostname]" "localhost, 127.0.0.1" "[port]" "9091" "[database]" "test_db" "[user]" "sa" "[password]" "sa" ;};
mentdb
1

cm set hsql_embedded <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_hsql_embedded" {execute "db.hsql.embedded.config.get" "[database]" "test_db" "[user]" "SA" "[password]" "SA" ;};
mentdb
1

cm set hsql_server <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_hsql_server" {execute "db.hsql.server.config.get" "[hostname]" "localhost, 127.0.0.1" "[port]" "9001" "[database]" "test_db" "[user]" "SA" "[password]" "SA" ;};
mentdb
1

cm set mysql <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_mysql" {execute "db.mysql.config.get" "[hostname]" "localhost" "[port]" "3306" "[database]" "test_db" "[user]" "bob" "[password]" "pwd" ;};
mentdb
1

cm set oracle <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_oracle" {execute "db.oracle.config.get" "[hostname]" "localhost" "[port]" "1521" "[database]" "xe" "[user]" "sys" "[password]" "pwd" ;};
mentdb
1

cm set postgresql <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_postgresql" {execute "db.postgresql.config.get" "[hostname]" "localhost" "[port]" "5432" "[database]" "test_db" "[user]" "postgres" "[password]" "pwd" ;};
mentdb
1

cm set sqlserver <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_sqlserver" {execute "db.sqlserver.config.get" "[hostname]" "localhost" "[port]" "1195" "[database]" "test_db" "[user]" "sa" "[password]" "pwd" ;};
mentdb
1

cm set file <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_file" {execute "file.local.config.get" "[dir]" "/Users/jimmitry/Desktop" ;};
mentdb
1

cm set ftp <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_ftp" {execute "file.remote.ftp.config.get" "[hostname]" "localhost" "[port]" "21" "[user]" "bob" "[password]" "pwd" ;};
mentdb
1

cm set ftps <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_ftps" {execute "file.remote.ftps.config.get" "[hostname]" "localhost" "[port]" "21" "[user]" "bob" "[password]" "pwd" "[protocol]" "TLS" "[isImplicit]" false "[connectTimeout]" 10000 "[dataTimeout]" 30000 "[keepAliveTimeout]" 300 ;};
mentdb
1

cm set sftp <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_sftp" {execute "file.remote.sftp.config.get" "[hostname]" "localhost" "[port]" "22" "[user]" "bob" "[password]" "pwd" "[connectTimeout]" 10000 "[dataTimeout]" 30000 ;};
mentdb
1

cm set ssh <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_ssh" {execute "file.remote.ssh.config.get" "[hostname]" "localhost" "[port]" "22" "[user]" "bob" "[password]" "pwd" "[connectTimeout]" 10000 ;};
mentdb
1

cm set cifs <key> <object>


Description

    Set a connection

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_cifs" {execute "file.remote.cifs.config.get" "[hostname]" "192.168.220.130" "[port]" "445" "[domain]" "domain" "[user]" "bob" "[password]" "pwd" "[connectTimeout]" "10000" "[readTimeout]" "30000" ;};
mentdb
1

cm set smtp <key> <object>


Description

    Set an SMTP connection (used by 'mail send').
Fields of the JSON object:
- hostname, port, sender, user, password.
- authentication: 1 = login with user / password, 0 = no login.
- tls: 1 = SMTPS, SSL from the start of the connection (usually port 465). 0 = SMTP without SSL at the connection.
- starttls (optional, since 4.2.1): only with tls=0. 1 = the connection is upgraded to TLS before the login (usually port 587: Office 365, most providers). STARTTLS is then required: nothing is sent if the server does not accept it.
  Warning: with tls=0 and without starttls=1, the password and the mails are sent without encryption.
- connectTimeout, sessionTimeout: in milliseconds.
The script 'mail.smtp.config.get' builds the main fields; an optional field is added with 'json iobject' (second example).

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_smtp" {execute "mail.smtp.config.get" "[hostname]" "smtp.gmail.com" "[port]" "465" "[sender]" "your-account@gmail.com" "[user]" "your-account@gmail.com" "[password]" "pwd" "[authentication]" true "[tls]" true "[connectTimeout]" "10000" "[sessionTimeout]" "60000" ;};
mentdb
1
admin
json load "cm" (execute "mail.smtp.config.get" "[hostname]" "smtp.office365.com" "[port]" "587" "[sender]" "your-account@company.com" "[user]" "your-account@company.com" "[password]" "pwd" "[authentication]" true "[tls]" false "[connectTimeout]" "10000" "[sessionTimeout]" "60000" ); json iobject "cm" / "starttls" "1" STR; cm set "demo_cm_smtp_587" (json doc "cm");
mentdb
1

cm set pop3 <key> <object>


Description

    Set a POP3 connection (used by 'mail download pop3').
Fields of the JSON object:
- hostname, port, user, password.
- ssl: 1 = SSL from the start of the connection (usually port 995).
- tls: 1 = STARTTLS.
- connectTimeout, sessionTimeout: in milliseconds.
- inFolder (optional): the folder to read (default: INBOX).
An optional field is added with 'json iobject' (see 'cm set imap').

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_pop3" {execute "mail.pop3.config.get" "[hostname]" "pop.gmail.com" "[port]" "995" "[user]" "your-account@gmail.com" "[password]" "pwd" "[tls]" false "[ssl]" true "[connectTimeout]" "10000" "[sessionTimeout]" "60000" ;};
mentdb
1

cm set imap <key> <object>


Description

    Set an IMAP connection (used by 'mail download imap' and 'mail download imap_disk').
Fields of the JSON object:
- hostname, port, user, password.
- auth: 1 = LOGIN authentication allowed, 0 = disabled.
- ssl: 1 = SSL from the start of the connection (usually port 993).
- tls: 1 = STARTTLS (usually port 143).
- connectTimeout, sessionTimeout: in milliseconds.
Optional fields (added with 'json iobject', second example):
- inFolder: the folder to read (default: INBOX).
- alternateSubDir: the directory where the mails are saved, instead of a new sub directory '<output_dir>/<timestamp>' (this directory is not created: it must exist).
- xoauth2_scope: 1 = OAuth2 connection (Office 365, Gmail): IMAPS with SASL XOAUTH2, the 'password' field must contain the access token; auth, ssl and tls are then ignored.
- fetchsize (imap_disk only): size of the blocks read from the server, in bytes (default: 1048576; 'mail download imap' always uses 819200).
- partialfetch (imap_disk only): false = each message is read in one block (some Exchange servers cut the big attachments in partial mode). Default: JavaMail default (true).
- max_buffer (imap_disk only): size of the buffer used to write the attachments on the disk, in bytes (default: 8192).
- mark_msgs_order (imap_disk only): actions to replay, see 'mail download imap_disk'.

Parameters

    key:   The key - string - required
    object:   The JSON object - string - required
admin
cm set "demo_cm_imap" {execute "mail.imap.config.get" "[hostname]" "imap.gmail.com" "[port]" "993" "[user]" "your-account@gmail.com" "[password]" "pwd" "[auth]" false "[tls]" false "[ssl]" true "[connectTimeout]" "10000" "[sessionTimeout]" "60000" ;};
mentdb
1
admin
json load "cm" (execute "mail.imap.config.get" "[hostname]" "outlook.office365.com" "[port]" "993" "[user]" "your-account@company.com" "[password]" [access_token] "[auth]" false "[tls]" false "[ssl]" true "[connectTimeout]" "10000" "[sessionTimeout]" "60000" ); json iobject "cm" / "xoauth2_scope" "1" STR; json iobject "cm" / "inFolder" "INBOX/Invoices" STR; json iobject "cm" / "partialfetch" "false" STR; cm set "demo_cm_imap_o365" (json doc "cm");
mentdb
1

cm show_scrud


Description

    Show all database connections available for SCRUD operations (MySQL or H2 only)

admin
cm show_scrud;
mentdb
[ "MENTDB" ]

cm show <type>


Description

    Show all connections

Parameters

    type:   The connection type (db|file|cifs|ftp|ftps|sftp|ssh|imap|pop3|smtp|mentdb) - string - not required
admin
cm show;
mentdb
[ "demo_cm_as400", "demo_cm_cifs", "demo_cm_db2", "demo_cm_derby_embedded", "demo_cm_derby_server", "demo_cm_file", "demo_cm_firebird", "demo_cm_ftp", "demo_cm_ftps", "demo_cm_h2_embedded", "demo_cm_h2_server", "demo_cm_hsql_embedded", "demo_cm_hsql_server", "demo_cm_imap", "demo_cm_mentdb", "demo_cm_mysql", "demo_cm_oracle", "demo_cm_pop3", "demo_cm_postgresql", "demo_cm_sftp", "demo_cm_smtp", "demo_cm_ssh" ]

cm show_obj <type>


Description

    Show all connections as a JSON object

Parameters

    type:   The connection type (db|file|cifs|ftp|ftps|sftp|ssh|imap|pop3|smtp|mentdb) - string - not required
admin
cm show_obj;
mentdb
{ "demo_cm_as400":0, "demo_cm_cifs":0, "demo_cm_db2":0, "demo_cm_derby_embedded":0, "demo_cm_derby_server":0, "demo_cm_file":0, "demo_cm_firebird":0, "demo_cm_ftp":0, "demo_cm_ftps":0, "demo_cm_h2_embedded":0, "demo_cm_h2_server":0, "demo_cm_hsql_embedded":0, "demo_cm_hsql_server":0, "demo_cm_imap":0, "demo_cm_mentdb":0, "demo_cm_mysql":0, "demo_cm_oracle":0, "demo_cm_pop3":0, "demo_cm_postgresql":0, "demo_cm_sftp":0, "demo_cm_smtp":0, "demo_cm_ssh":0 }

cm get <key>


Description

    Get a connection

Parameters

    key:   The key - string - required
admin
cm get "demo_cm_mysql";
mentdb
{ "driver": "com.mysql.cj.jdbc.Driver", "defaultSchema": "test_db", "subType": "MySQL", "loginTimeout": "10000", "jdbc": "jdbc:mysql://localhost:3306/test_db", "type": "db", "properties": { "password": "pwd", "allowMultiQueries": "true", "user": "bob" } }

cm generate_update <key>


Description

    Update a connection

Parameters

    key:   The key - string - required
admin
cm generate_update "demo_cm_mysql";
mentdb
json load "tmpCm" (cm get "demo_cm_mysql"); json uobject "tmpCm" / "driver" "com.mysql.cj.jdbc.Driver" STR; json uobject "tmpCm" / "defaultSchema" "test_db" STR; json uobject "tmpCm" / "subType" "MySQL" STR; json uobject "tmpCm" / "loginTimeout" "10000" STR; json uobject "tmpCm" / "jdbc" "jdbc:mysql://localhost:3306/test_db" STR; json uobject "tmpCm" / "type" "db" STR; json uobject "tmpCm" /properties "password" "pwd" STR; json uobject "tmpCm" /properties "allowMultiQueries" "true" STR; json uobject "tmpCm" /properties "user" "bob" STR; cm set "demo_cm_mysql" {json doc "tmpCm"};

cm exist <key> <type>


Description

    Check if a connection id already exists

Parameters

    key:   The key - string - required
    type:   The connection type (db|file|cifs|ftp|ftps|sftp|ssh|imap|pop3|smtp|mentdb) - string - not required
admin
cm exist "demo_cm_mysql"
mentdb
1

cm remove <key>


Description

    Remove a connection

Parameters

    key:   The key - string - required
admin
cm remove "demo_cm_mysql";
mentdb
1