


Configuring the Plug-in Runtime
There are two ways to configure the plug-in runtime: 1) programmatically using the SET CONFIGURATION or SET ENVIRONMENT variables, and 2) starting Version 4.1, bundling a configuration file into a library file along with the COBOL object files and resources.
If you choose the library file method, you should name the configuration file "cblconfi". If you choose to give it another name, you must specify the name using the OPTIONS keyword of the HTML EMBED tag when you include your COBOL object in your Web page.
For example, if your COBOL library file is named "myapp.acu" and you have bundled in it a configuration file named "myconfig", you would add the following line to your Web page:
<EMBED SRC="myapp.acu" WIDTH=400 HEIGHT=200 OPTIONS="-c myconfig">
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, LOCKS-PER-FILE, and FILE-PREFIX. The first three 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
The FILE-PREFIX variable cannot be set in the configuration file as usual, because the plug-in overrides any setting with the list of directories identified in the user's "acuauth.txt" file. "acuauth.txt" defines which directories your COBOL programs have access to on the user's machine. See "Plug-in Security" for more information.
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).
See Also