Use the InterPlay Runtime command tool

InterPlay Tools is the command tool for InterPlay Runtime. You can use this tool to run different commands, including one to import documents to InterPlay .

The available commands in InterPlay tools are:

Configure InterPlay Tools

You can configure InterPlay Tools at installation using the file: [Installation_Path]/InterPlay/extra/Tools/configuration/configuration.properties

You need to configure InterPlay Tools to connect to the Repository database and identify the InterPlay Runtime instance using the component name. Then, information about InterPlay Runtime, such as the URL, is used to access it and to call the REST APIs exposed by InterPlay. All required parameters are documented in the configuration file.

Logging

Use the following file to configure the command tools logs: [Installation_Path]/InterPlay/extra/Tools/configuration/log4j2.yml

By default it will log into: [Installation_Path]/InterPlay/extra/Tools/logs/iplaytools.log

For more information, see the Readme.txt file delivered in

[Installation_Path]/InterPlay/extra/Tools/Readme.txt

Use InterPlay Tools

Use the following commands to start the console:

  • Windows: [Installation_Path]/InterPlay/extra/Tools/startConsole.bat
  • Unix: [Installation_Path]/InterPlay/extra/Tools/startConsole.sh

You can run the commands in two modes:

Interactive mode

Use the startConsole.* command to start the console. You can then run several commands until you call exit or you close the console.

You can enter the user name and password using one of the following methods:

  • Using command arguments -u and -p respectively. Example: purge -e “MODIFICATION_AUTHOR=\”John\” -u Alex -p pswd
  • OR
  • Entering your username and password when prompted after writing the command and pressing ENTER.

If you have already entered valid credentials, the CLI no longer prompts you to enter them when issuing subsequent commands. If you wish to modify them, you need to specify new credentials using the -u and -p arguments.

In case the username and/or password are invalid, when issuing new commands, the CLI prompts you for them until a valid combination is entered.

To enter an argument value which contains white-space characters, you must wrap it in double quotes. If an argument value needs to contain double quotes as a normal character, you must place a backslash before it.

Example:

09:40:05: Opening application default of repository url: jdbc:oracle:thin:@//ITEM-AX12345:1521/AISRepository, user: root

09:40:05: Enter interactive mode

> help

Use "help [-c,--command <COMMAND>] " to find out more about a command.

Available commands:

importDocument

- Import a document from specified files (data, properties, error files) using collection type name and version to identify the format (files should be accessible from web server)

serverConfiguration

- Manage server configuration: get info, update & clean (this will remove all your data!!!)

importDocuments

- Import documents from specified folder (folder should be accessible from web server)

createWar

- Create and overwrite interplay-web archive

forceUnlock

- Force unlock a list of collections identified by filter that are locked or have locked objects

purge

- Delete a list of collections identified by filter

exportDocuments

- Export documents to specified folder

help

- Displays all commands available or the help and usage for a specific command if given as parameter

Additionally, you can type 'exit' to close the session

Batch mode

You can run a single command without opening the console by adding the command and all its parameters when running the startConsole.* script file.

Example:

<PATH>/startConsole.bat help -c importDocuments

17:23:20: Opening application default of repository url: jdbc:mysql://ITEM-AX30768:44346/AISRepository, user: root

17:23:20: Execute single command

usage: importDocuments [--authorStatus <AUTHORSTATUS>] [-e <EXTENSIONS>] -f <FOLDER> [--hasErrors <HASERRORS>] [-l

--authorStatus <AUTHORSTATUS>

….

17:23:20: Shutdown requested

<PATH>/

help command

Description

Displays all commands available or the help and usage for a specific command if given as parameter.

Syntax

> help

[-c|--command COMMAND]

Parameters

  • command - Name of the command
  • If no command is specified, the help command lists all the available commands with their description.

Examples

List all available commands: > help

List help for a specific command, short form: > help -c importDocuments

List help for a specific command, long form: > help --command importDocuments

importDocuments command

Description

Import documents from a specified folder (the folder should be accessible from the web server).

Syntax

>importDocuments

  • -f|--folder <FOLDER>
  • [--authorStatus <AUTHORSTATUS>]
  • [-e|--extensions <EXTENSIONS>]
  • [--hasErrors <HASERRORS>]
  • [-l|--language <LANGUAGE>]
  • [-m|--mode <MODE>]
  • [--modificationState <MODIFICATIONSTATE>]
  • [-s|--status <STATUS>]
  • [-p,--password <USER_PASSWORD]
  • [-u,--user <USER_NAME>]

Parameters

  • folder - The path for the data, property and error files (the folder must be accessible from the web server)..
  • authorStatus - (Optional) The user name used for the change status author property in the collection. By default, the value is the connection user name.
  • extensions - (Optional) Valid extensions for the data files. By default, the value is xml.
  • hasErrors - (Optional) Override the configuration of the has errors reader. Possible values: true, false.
  • mode - (Optional) Import mode index that defines the strategy to apply when a Collection with the same identifier already exists: 1 - RESET, 2 - REJECT, 3 - CHILD, 4 - NEW, 5 - MERGE. The default value is 4 – NEW.
  • modificationState - (Optional) Modification states: Untouched, Added. The default value is Untouched.
  • status- (Optional) Lifecycle status for the collection to create. The default value is defined in the configuration.
  • user - (Optional) The user name.
  • password - (Optional) The user password.

Example

Import documents from a specific folder, the data files are *.txt files:

> importDocuments -f d:/importdata -e txt

Import documents from a specific folder, the data files are *.txt files and import the collections with status 4 - NEW :

> importDocuments -f d:/importdata -e txt -m 4

importDocument command

Description

Import a document from specified files (data, properties, error files) using collection type name and version to identify the format (files should be accessible from web server).

Syntax

>importDocument

  • [--authorStatus <AUTHORSTATUS>]
  • --collectionTypeName <COLLECTIONTYPENAME>
  • --collectionTypeVersion <COLLECTIONTYPEVERSION>
  • [--errorFile <ERRORFILE>]
  • -f,--dataFile <DATAFILE>
  • [--hasErrors <HASERRORS>]
  • [-l,--language <LANGUAGE>]
  • [-m,--mode <MODE>]
  • [--modificationState <MODIFICATIONSTATE>]
  • [-s <STATUS>]
  • [--propertyFile <PROPERTYFILE>]
  • [-p,--password <USER_PASSWORD>]
  • [-u,--user <USER_NAME>]

Parameters

  • authorStatus - (Optional) The user name that must be used for the change status author property in the collection. By default, the value is the connection user name.
  • collection type name - Used to identify the format of the document.
  • collection type version - Used to identify the format of the document.
  • error file - (Optional) The path for the error file (the file must be accessible from web server).
  • data file - The path for the data file (the file must be accessible from web server).
  • has errors- (Optional) Override has errors reader configuration. Possible values: true, false.
  • language - (Optional) The language for the imported file. By default, the value is English.
  • mode - (Optional) Import mode index that defines the strategy to apply when a Collection with the same identifier already exists: 1 - RESET, 2 - REJECT, 3 - CHILD, 4 - NEW, 5 – MERGE. The default value is 4 – NEW.
  • modification state - (Optional) The modification state: Untouched, Added. The default value is Untouched.
  • status - (Optional) The lifecycle status for the collection to create. The default value is defined in the configuration.
  • property file - (Optional) The path for the property file (the file must be accessible from web server).
  • user - (Optional) The user name
  • .password - (Optional) The user password.

Examples

Import only collections of a certain type and a certain version from a specific file:

> importDocuments -f d:/importfolder/importdocument.txt --collectionTypeName CollTeh1 --collectionTypeVersion 1

exportDocuments command

Description

Export collections from InterPlay to a specified folder.

Syntax

> exportDocuments

  • -f|--folder <FOLDER>
  • [-e|--filter <FILTER>]
  • [-l|--language <LANGUAGE>]
  • [-s|--status <STATUS>]
  • [-p,--password <USER_PASSWORD]
  • [-u,--user <USER_NAME>]

Parameters

  • folder - The path where the export files are saved. The folder is created if it does not exist.
  • filter - (Optional) The expression used to filter the collections. Example: “FILE_NAME=\"ACCOUNTS\" AND MODIFICATION_AUTHOR=\"user\"”.
  • language - (Optional) The language used for decimal formatting. By default, the value is english.
  • status - (Optional) If set, after export, the status of the exported collections will be modified to the given value.
  • user - (Optional) The user name.
  • password - (Optional) The user password.

Example

Export all collections to a specific folder:

> exportDocuments -f D:/exportdata

Export collections modified by John:

> exportDocuments -f ./ --filter MODIFICATION_AUTHOR=\"John\"

Export all collections using comma decimal separator in the export files

> exportDocuments -f D:/work/exportdata -l french

Export all collections and change their status to “Recycled”:

> exportDocuments -f export -s Recycled

partialExportDocuments command

Description

Partial export data from some filtered business collections.

Syntax

>partialExportDocuments

  • [--filterSourceCollection <FILTERSOURCECOLLECTION>]
  • [--filterObject <FILTEROBJECT>]
  • [--filterTargetCollection <FILTERTARGETCOLLECTION>]
  • [--export <EXPORT>]
  • [-f, --folder <FOLDER>]
  • [-s, --status <STATUS>]
  • [-l, --language <LANGUAGE>]
  • [-p,--password <USER_PASSWORD>]
  • [-u,--user <USER_NAME>]

Parameters

  • filterSourceCollection - (Optional) A filter expression for filtering the business collections from which partial data is moved into the target collection(s). If not set, all collections are taken into account for the partial export.
  • This filter is used to filter the source collections from where the partial data is exported. If is not set then the partial data is taken from all available collections. If the filter returns no collections then nothing is exported.
  • To see the format of the filter, see
  • filterObject - (Optional) A filter expression for filtering the business objects to be moved into the target collection(s). If not set, all the business objects are taken into account from the collections that are partially exported.
  • This filter is used to filter the objects (partial data) that are involved in the export. If is not set then all the objects are taken into account for the export.
  • To see the format of the filter, see Object filter.
  • There is a correlation between the filterSourceCollection and the filterObject. Both represent the source data that is involved in the export. First the collections are filtered and then, based on the object filter, the data to be exported is determined. If the filter object returns no object then nothing is exported.
  • filterTargetCollection - (Optional) A filter expression for filtering the target business collections in which the partial data is moved. If not set, then for every collection that is partially exported a child collection will be created.
  • This filter is used to filter the target collections. As a result, only one collection per type is returned or none. Even if multiple collections are returned by the filter per collection type, only one is taken into account per collection type. If the target collection has all properties values empty, then its properties values are copied from the source collection.
  • If filterTargetCollection is not set, then a collection is created for each collection determined by the filterSourceCollection. The created collection has the same type and version as the source one. The values of the properties of the new collection are copied from the properties of the source collection.
  • To see the format of the filter, see Source/Target collection filter.
  • The data to be exported is represented by the data stored in objects. This data is moved from some source collections to some target collection(s). As the target filter returns a maximum of one collection per type, then, when the case, the rest of the target collections are created.
  • If the target collection returns the source collection as result, then target collections are created. The source collection cannot be used as target collection.
  • When moving the objects from source collection to target collection, also the associated business errors of the objects will be moved.
  • At the creation of new target collections, the create exits are executed. If any errors, then these are registered in the database.
  • export - (Optional) A boolean confirming the export of the target collection(s). Default value is true. Possible values: true, false.
  • This parameter can transform the partialExport operation into a simple move operation if is set on false. So in this case the data to be exported (the corresponding objects) is only moved from the source collection(s) to the target collection(s). By default the value is on true, the export is performed.
  • folder - (Optional) A folder into which the target collection(s) will be exported. No need to be set if --export is set on false.
  • This parameter is used only if the export is set on true and represents the folder where the exported files can be found.
  • If this parameter is not set, but export is set on true, then the exported files are created in <installation_folder>/InterPlay/extra/work/tempExportFiles and registered in Repository to download them.
  • When the parameter is specified, itss path can be relative or absolute. In case the path is relative, it is be relative to work/output.
  • For every export, a new temp folder is created. The name of the temp folder can be specified in Administration as a dynamic property: tempFolderPatter. The default value is: temp_*, where the ‘*’ is replaced with the current date (having the format yyyy_MM_dd_HH_mm_ss_SSS). If the pattern does not contain the '*' character, the dateTime is added at the end.
  • If no collection is exported, the temp folder is deleted.
  • language - (Optional) The language used for the localization of the exported properties of type Number. By default, the value is english.
  • This parameter is used for the localization of the Number properties. The default value is English. Only English and French languages are supported. If another language is provided, then the export uses the default english.
  • status - (Optional) A lifecycle status (name or id) that will be used for changing the status of the target collection(s). Accepted values are defined in configuration. If not set, then the change status is not performed.
  • This parameter represents the new status of the target collection(s) after the move operation, this means that if export is set on false, the change of status is still performed.
  • The status is provided as label or id.
  • If the status is invalid (incorrect label or id) or null, there is an error (Invalid status) and the partial export is canceled.
  • user - (Optional) The user name.
  • password - (Optional) The user password.

Example

partialExportDocuments --export true -f "D:\\exportFolder" --filterSourceCollection "NAME=\"CollTeh\"" --filterObject "[ObjTeh_1:Object_Name=\"ObjTeh1\"]" --filterTargetCollection "NAME=\"CollTeh3\"" -l english

Filters involved in partialExportDocuments

The following filters are related to the partialExportDocumments command.

Source/Target collection filter

The source and target collection filters are constructed in similar ways.

The format of the filter is: SYS_PROP1 REL_OP1 "VAL1" LOGICAL_OP1 USER_PROP1 REL_OP2 "VAL2"...

The expression is composed of a conjunction of tests where each test is expressed as <property> <operator> <value>.

The possible operators are: AND, OR, is null, not null, like, not like, =, !=, >, <, >=, <=, in { <v1> , <v2>}. Values must be written between double quotes.

Example: FILE_NAME=\"ACCOUNTS\".

If there are properties with the same name and different types in all the collections, their full name must be specified: <T>#<property>, where T can be S, N or D, depending on the property type.

Examples:

  • S#FILE_NAME=\"ACCOUNTS\"
  • LIFECYCLE_STATUS = \"Corrected\" AND Coll_Name != \"NoCollName\"

The response of the filter can be:

  • For source filter: no collection, or multiple collections of different types, or only one collection of a specific type, or more collections of the same type.
  • For target filter: no collection or a collection per type. The target filter will never respond with multiple collections of the same type.

Object filter

The object filter can be constructed in 3 different ways depending of whether the object type is specified or not, as in the following categories:

CATEGORY 1 - Object Type not specified

  1. SYS_PROP1 REL_OP1 "VAL1" LOGICAL_OP1 SYS_PROP2 REL_OP2 "VAL2"...
  2. SYS_PROP1 REL_OP1 "VAL1" LOGICAL_OP1 SYS_PROP2 REL_OP2 "VAL2"... OBJECT_TYPE_PATH/USER_PROP1 REL_OPn "VALn" LOGICAL_OPn OBJECT_TYPE_PATH/USER_PROP2 REL_OPn+1 "VALn+1"...
  3. OBJECT_TYPE_PATH/USER_PROP1 REL_OP1 "VAL1" LOGICAL_OP1 OBJECT_TYPE_PATH/USER_PROP2 REL_OP2 "VAL2"...

For 2 and 3, OBJECT_TYPE_PATH is the same for all the collection business object types. Also the USER_PROP1, USER_PROP2... are properties that exists for all the collection business object types.

When a filter from this category is applied for the objects of a collection, then for each business object type, objects are filtered using the given filter. That is why the OBJECT_TYPE_PATH and user properties have to exist for all business object types and all collection types involved in the source part. Error are logged for all items not respecting this condition and success only for those respecting. The command will end in ERROR.

Example: "Teh/ObjPropertyLong2Z1>\"111\" AND Teh/ObjPropDec4Z2=\"334\""

CATEGORY 2 - Object Type is specified

[NAME1_VERSION1:FILTER1], [NAME2_VERSION2:FILTER2],....

[NAME1_VERSION1, NAME2_VERSION2,...:FILTER1],....

The object types are specified by name and version. Also, a specific filter, that is applied only for objects of the given types, is provided - FILTER1, FILTER2,...

The FILTERi can have one of the following forms:

  • A filter that checks the form 1 specified in the CATEGORY 1
  • A filter that checks the form 2 and 3 specified in the CATEGORY 1 but with OBJECT_PATH optional.

If OBJECT_PATH is specified for a user property, then all the given object types NAMEi_VERSIONi have the same path (equal to OBJECT_PATH).

If more than one business object type is specified, then all the user properties should exist for all business object types.

Example: "[ObjTeh_1:ObjPropertyLong2Z1>\"111\" AND ObjPropDec4Z2=\"334\"], [ObjTeh3_1:Obj2PropertyLong2Z1=\"432\"], [ObjTeh2_1:Obj2PropertyLong2Z1>\"88\"]"

CATEGORY 3 - combination of the first 2 categories

[FILTER1], [FILTER2],...,[NAME1_VERSION1:FILTERn], [NAME2_VERSION2:FILTERn+1]...

In this situation, the filters FILTER1, FILTER2,...have one of the forms from CATEGORY 1 and [NAME1_VERSION1:FILTERn], [NAME2_VERSION2:FILTERn+1]... have one of the forms from CATEGORY 2

Example: "[ObjTeh_1:ObjPropertyLong2Z1>\"111\" AND ObjPropDec4Z2=\"334\"], [ObjTeh3/Obj2PropertyLong2Z1=\"432\"], [ObjTeh2_1:Obj2PropertyLong2Z1>\"88\"]"

Whenever the filter of type 1 is used, if the following rule is not respected: OBJECT_TYPE_PATH and user properties have to exist for all business object types and all collection types involved in the source part, then the command ends in ERROR.

Examples of commands for filters of different categories:

  • CATEGORY 2 → partialExportDocuments --filterObject "[ObjTeh_1:ObjPropertyLong2Z2>\"10\" AND ObjPropDec4Z2=\"334\"]"
  • CATEGORY 2 → partialExportDocuments --filterObject "[ObjTeh_1:ObjPropertyLong2Z2>\"10\" AND ObjPropDec4Z2=\"334\"], [Obj2Teh2_1:ObjPropInteger=\"322\"]"
  • CATEGORY 3 → partialExportDocuments --filterObject "[Teh/ObjPropertyLong2Z2>\"10\" AND Teh/ObjPropDec4Z2=\"334\"], [ObjTeh2_1:Obj2PropertyLong2Z2>\"10\"]"

createWar command

Description

Creates a new interplay-web.war archive in the <InterPlayInstall> folder based on the <InterPlayInstall>/war folder. The new war archive overwrites the old one. The purpose of this command is to rapidly include modifications made (e.g., adding/removing exits) and send them to another administrator.

Example

> createWar

changeCollectionStatus command

Description

Change status for the collections resulted after applying a specific filter.

Syntax

> changeCollectionStatus

  • -e|--filter <FILTER>
  • -s|--status <STATUS>
  • [-p,--password <USER_PASSWORD>]
  • [-u,--user <USER_NAME>]

Parameters

  • filter -The expression used to filter the collections. Example: “FILE_NAME="ACCOUNTS" AND MODIFICATION_AUTHOR="user"
  • status - Status set to the filtered collections. Provide label for status.
  • user - (Optional) The user name.
  • password - (Optional) The user password.

Example

Change status of the collections modified by John with the status Recycled:

> changeCollectionStatus –-filter MODIFICATION_AUTHOR=\"John\" -s Recycled

OR

> changeCollectionStatus -e MODIFICATION_AUTHOR=\"John\" -s Recycled

forceUnlock command

Description

Force unlock a list of collections identified by filter that are locked or have locked objects.

Syntax

> forceUnlock

  • [-e,--filter <FILTER>]
  • [-p,--password <USER_PASSWORD>]
  • [-u,--user <USER_NAME>]

Parameters

  • filter - (Optional) The expression used to filter the collections. Example: “FILE_NAME=\"ACCOUNTS\" AND MODIFICATION_AUTHOR=\"user\"“
  • user - (Optional) The user name.
  • password - (Optional) The user password.

Example

Unlock all collections locked by John.

> forceUnlock -e MODIFICATION_AUTHOR=\”John\”

purge command

Description

Delete a list of collections identified by filter.

Syntax

> purge

  • [-e,--filter <FILTER>]
  • [-p,--password <USER_PASSWORD>]
  • [-u,--user <USER_NAME>]

Parameters

  • filter - The expression used to filter collections. Example: purge -e “FILE_NAME=\"ACCOUNTS\" AND MODIFICATION_AUTHOR=\"user\"”
  • user - (Optional) The user name.
  • password - (Optional) The user password.

Example

Delete all collections last modified by user John:

purge -e MODIFICATION_AUTHOR=\”John\”

serverConfiguration command

Description

Manage server configuration: get info, update and clean.

Caution   The clean action removes all your data. Use mode parameter to specify the action.

Syntax

> serverConfiguration

  • [-m,--mode <MODE>]
  • [-p,--password <USER_PASSWORD>]
  • [-u,--user <USER_NAME>]

Parameters

  • mode - Choose the action you want to do on the server configuration. Possible values:
    • INFO - Display information about server configuration and repository configuration;
    • UPDATE - Update server configuration according to the repository configuration;
    • CLEAN - This mode requires confirmation and will not be executed in batch mode;
  • Default value when MODE is not specified is INFO.
  • user - (Optional) The user name.
  • password - (Optional) The user password.

Example

Display information about server configuration:

serverConfiguration -m INFO

Related Links