HELIOS ImageServer addendum


1 Script Server
1.1 Configuring a script queue

1.2 Automatic Script Server configuration

1.3 "Script" menu

1.4 "Script Jobs" window

1.5 Script Server preferences

1.6 Script queue preferences



The HELIOS Script Server and the scripts are no longer configured in the configuration file "scriptsrv.conf". Instead, they are now configured and adjusted in HELIOS Admin, via preferences. Note that you need to have update u0533 installed on the server.

Global Script Server settings are defined in HELIOS Admin:

From the Settings menu in HELIOS Admin open the Script Server Settings window (Fig. 1).
The Script Delay field allows specifying the time interval (in seconds) before the script is started after the file event is received. Script Timeout specifies the maximum script runtime. The value 0 may let the script run forever. Simultaneous Scripts determines the maximum number of concurrently executing scripts in order to limit server load. The value for Simultaneous Scripts should be less or equal to the number of physical CPUs. If you leave this field empty Script Server automatically determines an appropriate value by checking the number of CPUs.
Fig. 1: HELIOS Admin Script Server Settings window


1.1 Configuring a script queue
In the Scripts tab you can set up script queues with different configurations for different purposes.

Note: If the Scripts tab is not available after the first login, activate Scripts in the Lists menu.

The list in the Scripts tab (Fig. 2) shows all script queues known to the host. The HELIOS Admin server automatically creates it by inspecting script related entries in the "Preferences" file.
Fig. 2: HELIOS Admin Scripts list


The Name column shows the script queue name, while the the used script itself is displayed in the Script column.
Wait, Run and Done list the status of the scripts. Wait means that they are spooled but not yet processed. Run signifies that a script queue is being processed, and Done that the script has finished.
The path to the specified hot folder, the place where the script "looks" for files or directories to be processed, is displayed in the Hot Folder column. Types and Suffixes list all defined file types and file suffixes per queue.
Changing script data
To change the settings for a particular script queue, open the Script window (Fig. 3).
Select the desired script queue from the list and choose Settings from the Script menu.
Fig. 3: HELIOS Admin Script window - General tab


The General tab (Fig. 3) is always displayed first. It shows the general settings for the particular queue. The Enable checkbox activates the queue for the Script Server. If a script queue is not enabled the queue name in the Scripts list appears grayed out (see topmost entry in Fig. 2).

Note: Although the script queue configuration is usually done manually, the HELIOS Script Server also allows reading out configuration data directly from the script. See 1.1.3 "Automatic Script Server configuration".

Specify a name for the script queue in the Name field and the desired script in the Script field. You may write the script path and name directly into the field, or select it by use of the Browse- button.

Note: If two or more script queues use the same hot folder, and do not differ in file type or suffix specification, the scripts are executed in alphabetical order. You may have to rename the script queue names according to your needs.

A click on the folder icon (see arrow in Fig. 3) opens the selected script file for editing. When being in the General tab, you may also choose Open from the File menu.
Then specify the path to the hot folder in the Hot Folder field, either manually or via the Browse- button.

Important: Make sure that the specified path already exists. Otherwise Script Server will ignore the configuration!

The Include Subdirectories checkbox is not active by default. This avoids subdirectories in the specified path being considered as hot folders as well. However, if it is desired that all subdirectories underneath the specified path are considered, the checkbox must be switched on.
In addition, the name of the user the script should run as can be entered in the User field. If this field is left empty, the script is executed as superuser.
The Timeout field determines the maximum script runtime. The value 0 may let the script run forever. If a value is specified in this field, it overrides the global setting (compare to Fig. 1).
The Debugging checkbox specifies whether verbose output is written. The value is exported as SCRIPTDEBUG environment to the script.
To make the hot folder react only on certain file types and suffixes, you must define these for the script queue. File types and suffixes are added in the File Types tab (Fig. 4).
Enter the 4-character file type code into the respective field and click the Add button. Do likewise for the file suffix.

Note: The file type specification always demands 4 characters, even if blanks are included, e.g. "PDF ".

Enable the option Folder Changes if you wish that directory events rather than file events are notified to the Script Server. In this case, file events are ignored and the Types and the Suffixes column in the Scripts list appear grayed out and the settings are ignored. In addition, the leading icon changes from a "files" symbol to a "directory" symbol (see third entry in Fig. 2).
Fig. 4: HELIOS Admin Script window - File Types tab


Depending on the used script, it may be necessary to define additional environment variables for the script queue. Environment variables and their values can be added in the Environment tab (Fig. 5).
Enter the variable name into the respective field and assign the respective value. Then click the Add button.

Important: Environment variables are handed over to Perl via shell. Therefore, used charcters are limited to ASCII. This is because some shells (especially Windows) as well as Perl are not able to handle UTF8 characters.

To remove an entry from the Environment list, highlight it and select Clear from the Edit menu. Another way is to double-click the entry, which makes it disappear from the list, whereas variable and value are displayed in the definition fields.

Note: After double-clicking the entry, you may also edit variables and values in the fields. You must only save them anew.

Fig. 5: HELIOS Admin Script window - Environment tab

Creating a script queue
A new script queue is created as follows:
In HELIOS Admin activate the Scripts tab and choose New from the File menu.
If you wish to create a new script queue that should adopt most of the settings of an already existing queue, a very convenient way is to duplicate the script queue data by copying a queue entry from the Scripts list and then pasting it into the list. A script queue data window opens to adjust the settings for the new queue. Instead of copying/pasting the script queue entry you may also highlight it in the Scripts list and drag and drop it with the mouse within the list.
After filling in the script queue data window and confirming the changes, the new script queue is added to the list. If the script queue data window is closed without saving, the new script queue entry is discarded.
Deleting a script queue
A script queue is deleted as follows:
In the Scripts list select the script queue that you wish to delete and choose Clear from the Edit menu. You may also click the window's "trash can" icon.
1.2 Automatic Script Server configuration
When setting up a new script queue, HELIOS Admin can read out the configuration from the referenced script and complete the respective fields with default values. For this to work, the script must contain the configuration data, initialized by the <settings> tag and terminated with </settings>. Furthermore, the script must be selected via the Browse- button (compare Fig. 3). The following example shows, in a script excerpt for the queue "For_HTML", the defined default configuration values:
webpicts.pl:

#
# Sample configuration
#
my $default_settings = <<'</SETTINGS>'; # Let Perl ignore the settings block
<SETTINGS>
<General
Enable="true"
Hot_Folder="/scriptserver/For_HTML"
Include_Subdirectories="false"
User=""
Timeout=""
/>
<File_Types
Types="TIFF,JPEG,EPSF,8BIM,8BPS,PICT,BMP ,PNGf,..CT,PDF "
Suffixes="tif,jpg,eps,psd,pct,bmp,png,sct,pdf"
Folder_Changes="false"
/>
<Environment
OUTDIR="DONE"
/>
</SETTINGS>
Fig. 6: HELIOS Admin Script window - File Types tab


Each time a script has been selected via the Browse- button in the the General tab, an additional button - Set Script File Defaults - becomes available in both the File Types and Environment tabs (Fig. 6 and Fig. 7). This applies also if another script has been choosen via the Browse- button. Set Script File Defaults allows restoring the default settings which are defined in the selected script.
Fig. 7: HELIOS Admin Script window - Environment tab


1.3 "Script" menu
The Script menu becomes available in the menu bar if a script queue has been highlighted in the HELIOS Admin Scripts list. It offers access to the script queue settings, and allows enabling/disabling a script queue (compare Fig. 3).
Fig. 8: HELIOS Admin Script menu


1.4 "Script Jobs" window
The status of a script queue is displayed in the Script Jobs window. As soon as a script starts being spooled, "Waiting" is displayed in the Script Status column. When it is being executed, the status changes to "Running". The moment the script has been accomplished, "Running" disappears from the Script Status column. The accounting (see arrow in Fig. 9) informs about the status of all processed jobs, and additionally counts the accomplished jobs ("Done").

Note: The accounting is reset if the configuration is changed or the "scriptsrv" process is restarted. Furthermore, the accounted number of jobs in the Script Jobs window need not be the total number of jobs.

Fig. 9: HELIOS Admin Script Jobs window

1.5 Script Server preferences
Key: Programs/scriptsrv/<preference>
Preference
Type Default (""=empty string)
TelnetPort
int 2024
Specifies the Script Server service port.
HoldTime
int 10
Specifies the time interval (in seconds) after the file event is received before the script is started. The setting reflects that of the Script Delay field in the HELIOS Admin Script Server Settings window.
RunTime
int 120
This preference determines how long a script may run. Specifying - 0 disables the running time (i.e. "run forever"). The setting reflects that of the Script Timeout field in the HELIOS Admin Script Server Settings window.
TermTime
int 30
This preference determines how long "scriptsrv" should wait before the process is killed. This happens only if RunTime (see above) has timed out.
MaxProc
int <number of CPUs>
Specifies the maximum number of concurrently executing scripts in order to limit server load. The setting reflects that of the Simultaneous Scripts field in the HELIOS Admin Script Server Settings window.

Note: It is recommended that the value for MaxProc be less or equal to the number of physical CPUs.

scriptdebug
int 0
Specifies whether verbose output is written. The value is exported as SCRIPTDEBUG environment.
RemoteAccess
bool FALSE
If set to TRUE, access to the Script Server service port is enabled to remote users (subject to the restrictions in the ipaccess list).
ipaccess
str ipaccess
Specifies the file name of the IP access list that controls client access to the Script Server.
1.6 Script queue preferences
Key: Programs/scriptsrv/Config/<queue>
/<preference>
Path
str ""
Specifies the path to the Script Server hot folder. The setting reflects that of the Hot Folder field in the General tab of the HELIOS Admin Script configuration window.
Script
str ""
Specifies the desired script for the script queue. The setting reflects that of the Script field in the General tab of the HELIOS Admin Script configuration window.
User
str <see text>
Specifies the user whose permissions are used to execute the script. The setting reflects that of the User field in the General tab of the HELIOS Admin Script configuration window. If this preference is not specified, the script is executed as superuser.
Enabled
bool FALSE
Determines whether the script queue is active at all. The setting reflects that of the Enable checkbox in the General tab of the HELIOS Admin Script configuration window.
Timeout
int <see text>
This preference determines how long the script may run. Specifying - 0 disables the running time (i.e. "run forever"). The setting reflects that of the Timeout field in the General tab of the HELIOS Admin Script configuration window. If this preference is not specified, Script Server uses the global value RunTime.
Recursive
bool FALSE
Determines that all subdirectories underneath the specified directory for the hot folder (see Path) are considered. The setting reflects that of the Include Subdirectories checkbox in the General tab of the HELIOS Admin Script configuration window.
Directory
bool FALSE
Determines that directory events rather than file events are notified to the Script Server. The setting reflects that of the Folder Changes checkbox in the File Types tab of the HELIOS Admin Script configuration window.
scriptdebug
int <see text>
Specifies whether verbose output is written. The value is exported as SCRIPTDEBUG environment. The setting reflects that of the Debugging checkbox in the General tab of the HELIOS Admin Script configuration window. If this preference is not specified, Script Server uses the global value scriptdebug.
Ftypes
strlist ""
Allows specifying file types for which script execution should be triggered. If no type is specified, the script is executed for any file event. The setting reflects that of the entries in the Types list in the File Types tab of the HELIOS Admin Script configuration window.
Suffixes
strlist ""
Allows specifying file suffixes for which script execution should be triggered. If no suffix is specified, the script is executed for any file event. The setting reflects that of the entries in the Suffixes list in the File Types tab of the HELIOS Admin Script configuration window.
Environment
strlist ""
Allows specifying additional environment variables which are considered while the script is executed. The setting reflects that of the entries in the Environment list in the Environment tab of the HELIOS Admin Script configuration window.

© 2006 HELIOS Software GmbH