Script Console installation guide¶
Installation procedure¶
Script Console can be configured to run in different modes. Common scenarios are:
- standalone interactive console, connected to OTCS: mainly used for batch processing and administration tasks
- standalone script interpreter, connected to OTCS: mainly used for scheduling administration tasks
- standalone lightweight webserver (based on embedded application server), connected or not connected to OTCS
- web application deployed on external application server, connected or not connected to OTCS
This guide covers the standard installation procedure of the Content Script Console (standalone based on embedded application server) which is compliant with the options 1, 2 and 3 of the above list.
For alternative deployment scenarios, including deployment on an external application server, please make reference to AnswerModules Support Team and guides available through Support Portal.
- Run the Script Console Installer (WINDOWS), or extract the Script Console archive, and install the Script Console in your favourite location (this step should be executed by an user having local administrative privileges)
Environment variables
The Script Console requires an environment variable to be defined in order to work properly, for your convenience this variable is automatically defined on windows server by the Script Console installer:
- AM_CONSOLE_DATA: the Script Console's root folder
Step-by-Step procedure
The following screens will guide you through the deployment of Script Console runtime.
- Welcome Screen: Select “Next” when ready to start the installation.
- EULA Screen: Acceptance of the end-user license agreement is mandatory for proceeding with the installation
A copy of the agreement will be available, upon installation, in:
%AM_CONSOLE_DATA%/license/EULA Select “Next” when ready.
- AM_CONSOLE_DATA selection: Choose the location where the Script Console components will be installed.
E.g.
E:\AM\SC_2_7_0\
-
Script Console Application and Content Script Extension Packages: there are two different types of extensions that can be installed:
-
Content Script Extensions are extensions for the embedded Content Script Engine.
- Script Console Applications
11. Installation completed: Select “Finish” and return to the installation checklist to finalize the module setup.
- Copy Content Server's libraries to the Script Console runtime
Content Server libraries required
Some Content Script extension packages require additional Java libraries that are specific to the target Content Server environment, and are not distributed with the module. The required library files are:
- csapi.jar
- service-api-X.X.XX.jar
and can be found in the web app located in:
%OTCS\_HOME%\\webservices\\java\\webapps\\cws.war
- classificationsservice-api-X.X.XX.jar
which can be found in the web app located in:
%OTCS\_HOME%\\webservices\\java\\webapps\\cs-services-classifications.war
- physicalobjectsservice-api-X.X.XX.jar
which can be found in the web app located in:
%OTCS\_HOME%\\webservices\\java\\webapps\\cs-services-physicalobjects.war
- recordsmanagementservice-api-X.X.XX.jar
which can be found in the web app located in:
%OTCS\_HOME%\\webservices\\java\\webapps\\cs-services-recordsmanagement.war
- oml.jar
which can be found in:
%OTCS\_HOME%\\ojlib
To retrieve the files:
- copy the file named XXX.war to a temporary folder
- rename the file XXX.war in XXX.zip
- extract the zip archive contents locate the files in the WEB-INF/lib folder
Once the files have been located, copy them to the folder: %AM_CONSOLE_DATA%/runtime/amlib
Copy libraries form Content Script
All the libraries mentioned above but ** oml.jar ** are usually also found in the installation folder of the Content Script module:
%OTCS_HOME/module/anscontentscript_X_Y_Z/amlib
- Perform basic configuration of the Script Console. The main configuration file is located in:
%AM_CONSOLE_DATA%/config/cs-console-systemConfiguration.xml
Default configuration will be similar to the following:The base configuration allows to specify one or more “system” objects which represent OTCS instances to which the console will be able to connect.<?xml version="1.0" encoding="UTF-8" ?> <config> <systems> <system id="TEST"> <name>Content Server TEST Environment</name> <serverHost>localhost</serverHost> <serverPort>2099</serverPort> <local-repository-home>TEST</local-repository-home> <local-repository-encoding>UTF-8</local-repository-encoding> <otcs-repository-encoding>UTF-8</otcs-repository-encoding> <systemVars> <systemVar name="img">/</systemVar> <systemVar name="url"></systemVar <systemVar name="csModulePath"> </systemVars> <serviceVars> <serviceVar service="core" name="amcs.core.httpProxyHostname" ></serviceVar> <serviceVar service="core" name="amcs.core.httpProxyPort">80</serviceVar> <serviceVar service="core" name="amcs.core.httpProxyUsername"></serviceVar> <serviceVar service="core" name="amcs.core.httpProxyPassword"></serviceVar> <serviceVar service="core" name="amcs.core.httpMaxConnPerRoute">20</serviceVar> <serviceVar service="core" name="amcs.core.httpMaxConnTotal">50</serviceVar> <serviceVar service="core" name="amcs.core.httpOTCSSchema">http</serviceVar> <serviceVar service="core" name="amcs.core.tempFilePath">/tmp/</serviceVar> </serviceVars> <users></users> </system> </systems> </config>
How to setup your base configuration
The base configuration can be edited manually, or, alternatively, configuration parameters can be downloaded from a target Content Server instance. This feature comes particularly handy for installations that include multiple Content Script Extension Packages, each with its own configuration settings.
- Apply any available hotfix(es)
Hot to install a hotfix
Before you install any hotfix, please backup all essential files.
To install the hotfix, download the hotfix from the Support portal and save it to a temporary location.
Make sure Script Console services (or executable) are completely stopped. From the temporary location, extract the contents of the hotfix to the <Script_Console_home> directory and then restart it.
The directory (directories) and file(s) contained in the hotfix(es) you install will be copied to <Script_Console_home>
Please always make reference to the hotfix's description file:
Configure Script Console¶
To perform configuration against an OTCS instance, run the Script Console in shell mode. To do so, open a Windows Commands Processor and move to the folder: %AM_CONSOLE_DATA%/runtime/bin which includes the Script Console's executables scripts
- Run the
app-windows.bat
orapp.sh
script - The following prompt should appear:
Unix
- The default TEST system is selected. To list all available systems, use the system command with the list flag (
-l, --list
). E.g.system -l
:
Unix
-
To create a new system (for example, LOCAL) use the system command with the add flag
(-a, --add
) followed by the ID of the new system. E.g.system -a LOCAL
The shell will prompt for the required base values, such as
hostname
andport
number.
Unix
Upon creating a new system, the Script Console will require a restart and will automatically shutdown.
- Switch the active system to LOCAL using the system command with the system flag (
-s
) followed by the ID of the target system. E.g.system -s LOCAL
Unix
The active system indicator in the command prompt should now indicate LOCAL.
-
Synchronize ModuleSuite configuration parameters from the LOCAL system using the loadConfig command. To do this, you must first export the entire Module Suite configuration from the Content Server instance by following these steps:
- Go to the Administration page of the Content Server and under Core System - Feature Configuration click on Import and Export Administration Settings
- Open Export Administration Settings
- In this page, add the Setting_AnswerModules_BaseConfiguration to the Selected Settings list, flag Lean Versions (as showed in the screenshot below) and click on Export to export the XML file containing the Module Suite configuration.
- Copy eh file generated at the previous step on the server where Script Console is installed under the path
%AM_CONSOLE_DATA%/runtime/bin
- Run the command
loadConfig
specifying the file to be imported (-f, --file)
-
The configuration is complete. Try a simple ls command to test the console
Connect to Content Server
Script Console does not require to be connected to a Content Server instance, in fact in most cases the two systems do not need to be connected. To execute actions and scripts against an active Content Server instance, you must log-in using valid user credentials.
Unix
- Login to the LOCAL system using the
login
command
Unix
The active system indicator in the command prompt should now turn green to indicate that the system is ONLINE