Notes initializeWithLocale is a static method belonging to the DTK class. To use this method call:
About binding your applications to the API:
When you initialize the API, the initializeWithLocale 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 common DLL files (often referred to as “DLL hell”).
initializeWithLocale uses 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 might call the API, plus a default “API” section. Each section contains a list of version numbers in the following format:
DTK.initializeWithLocale("progName", "progVer", "apiVer", "theLocale")
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, 7.6.* corresponds to 7.6.0, 7.6.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:
7.7.* = C:\Program Files\IBM\Forms Server\8.0\API\redist\msc32\PureEdge\76
7.5.* = C:\Program Files\IBM\Forms Server\8.0\API\redist\msc32\PureEdge\75
1.1.0 = C:\Program Files\IBM\Forms Server\8.0\API\redist\msc32\PureEdge\76
1.0.0 = C:\Program Files\IBM\Forms Server\8.0\API\redist\msc32\PureEdge\75
the application binds to the API in C:\Program Files\IBM\Forms Server\4.0\API\redist\msc32\PureEdge\76 because the entry for version 1.1.0 in the formSample section points to C:\Program Files\IBM\Forms Server\4.0\API\redist\msc32\PureEdge\76.
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", "7.7.0")
the application binds to the API in the [API] section that corresponds to 7.6.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", "7.6.0")