


There are two ways to configure the plug-in runtime:
If you choose the library file method and include a configuration file in the library, you must specify the name of the file using the OPTIONS keyword of the HTML EMBED tag when you include your COBOL object on the web page. This ensures that the application uses the correct configuration file rather than defaulting to another that may reside on the user's system.
For example, if your COBOL library file is named "myapp.acu" and you have bundled in it a configuration file named "myconfig", add the following line to your Web page:
<EMBED SRC="myapp.acu" WIDTH=400 HEIGHT=200 OPTIONS="-c myconfig">
Similarly, if your object library contains a configuration file named "cblconfi", add this line to your Web page:
<EMBED SRC="myapp.acu" WIDTH=400 HEIGHT=200 OPTIONS="-c cblconfi">
The plug-in loads the configuration file by performing the equivalent of a SET CONFIGURATION statement for each line of the configuration file. Note that there are a few configuration variables that cannot be modified this way. They are MAX_FILES, MAX_LOCKS, and LOCKS_PER_FILE. These variables are used during the runtime initialization which occurs before the COBOL program is executed. In order to allow a wider range of applications to be used with the ACUCOBOL-GT Web Plug-in, these variables have been given new default values.
When using the ACUCOBOL-GT Web Plug-in these variables are initialized to the following values:
MAX_FILES 255
MAX_LOCKS 512
LOCKS_PER_FILE 256
Note that FILE_PREFIX is initially set to the location of the "acuauth.txt" security file. ("acuauth.txt") defines which directories your COBOL programs have access to on the user's machine.) The path given in this file must be enclosed in quotation marks. If you define an alternate FILE_PREFIX in the configuration file that you embed with your object library, that value overrides the "acuauth.txt" setting.
If you choose to configure the plug-in runtime programmatically, you should use the SET CONFIGURATION (or SET ENVIRONMENT) phrase in your source code.
For example, if your application uses a configuration file with the entries:
FILE_PREFIX @hal:/u2/serverfiles
COMPRESS_FILES 1
KEYSTROKE EDIT=PREVIOUS EXCEPTION=52 kl
Add the following lines to your COBOL initialization code:
SET CONFIGURATION "FILE_PREFIX" TO "@hal:/u2/serverfiles".
SET CONFIGURATION "COMPRESS_FILES" to "1".
SET CONFIGURATION "KEYSTROKE" TO "EDIT=PREVIOUS EXCEPTION=52 kl"
Again, MAX_FILES, MAX_LOCKS, and LOCKS_PER_FILE cannot be modified using the SET verb. Note that the COBOL program can read environment variables using ACCEPT FROM CONFIGURATION (or ACCEPT FROM ENVIRONMENT).