Notes The initialize method is a static method belonging to the DTK class.
Note: About Binding Your Applications to the API
When you initialize the API, the initialize method determines which version of the API to use based on the parameters you pass it. This allows you to exercise a great deal of control over which version of the API is used by your applications, and prevents the problems normally associated with DLL files.
The initialize method relies on a configuration file to determine which version of the API will bind to any application. This allows multiple versions of the API to co-exist on your computer, and ensures that your applications use the correct version of the API.
The configuration file is called PureEdgeAPI.ini and is installed with the API.
Note: You should redistribute the PureEdgeAPI.ini file with any applications that use the API. See Developing and distributing applications API 8 Java.
The configuration file contains a section for each application that uses the API, plus a default [API] section. Each section contains a list of version numbers in the following format:
For example, the configuration file on a Windows® system might look like this:
<version of application> = <path to API>
The above example contains the default [API] section and a section for the formSample application. The asterisk acts as a wildcard. In the example, 8.0.* corresponds to 8.0.0, 8.0.1, and so on.
The initialize method checks the configuration file to see if your application is listed. For example, using the configuration example above, if you make an initialization call as follows:
8.0.* = C:\Program Files\IBM\Forms Server\8.0\API\redist\Win32\PureEdge\80
1.1.0 = C:\Program Files\IBM\Forms Server\8.0\API\redist\Win32\PureEdge\80
1.0.0 = C:\Program Files\IBM\Lotus Forms\Server\8.0\API\redist\msc32\PureEdge\76
the application binds to the API in C:\Program Files\IBM\Forms Server\8.0\API\redist\Win32\PureEdge\80 because the entry for version 1.1.0 in the formSample section points to C:\Program Files\IBM\Forms Server\8.0\API\redist\Win32\PureEdge\80.
If your application is not listed in the configuration file, the initialization call uses the version of the API in the apiVer parameter. For example, if you make an initialization call as follows:
DTK.initialize("formSample", "1.1.0", "8.8.0")
the application binds to the API in the [API] section that corresponds to 8.0.0 because there is no entry for version 2.0.0 in the formSample section.
You can add your own entries to the configuration file before distributing it to your customers, or you can rely on the default API entries.
DTK.initialize("formSample", "2.0.0", "8.0.0")