Creating Resource Bundles
A resource bundle describes the adapter resources to Integration Server. For example, connection factories, notification templates. You set the names of all connection factories and notification implementation classes in an AdapterTypeInfo object in your adapter's implementation of the fillAdapterTypeInfo method. Set these names when you implement the connections and notifications.
A resource bundle contains all the display strings and messages used by the adapter at run time and at design time.
A resource bundle is specific to a particular locale. If you plan to run your adapter in multiple locales, you can include multiple locale specific resource bundles. Creating a resource bundle for each locale enables you to internationalize an adapter quickly, without having to change any code in the adapter. An adapter must have one or more resource bundles.
A resource bundle consists of lookup keys that provide locale specific objects (normally text strings). A lookup key consists of a constant provided by the
com.wm.adk.ADKGLOBAL class (a class provided by the ADK's API) combined with your adapter's class name or a parameter name. For a list of these constants, see
Resource Bundle Lookup Keys. For example, the ADK uses the following lookup key whenever the display name of the adapter is required. (Assume that the
MyAdapter.
getAdapterName method returns the class name
MyAdapter where
MyAdapter is the
WmAdapter implementation class.)
MyAdapter.class.getName() + ADKGLOBAL.RESOURCEBUNDLEKEY_DISPLAYNAME
The following lookup key produces a description for a parameter named password, which is used to configure a connection pool:
"password" + ADKGLOBAL.RESOURCEBUNDLEKEY_DESCRIPTION
The adapter automatically references lookup keys to provide the following:
Display names, and property descriptions of the:
Adapter definition
Connection types
Adapter service templates
Polling notification templates
Text, display names, and property descriptions for the following elements of your adapter:
Parameters used to configure nodes
Metadata group names
Log entries
Exception text
Note:
You may also make explicit use of a resource bundle to localize other data, such as resource domain values, especially if those values are known at development time (for example, a list of known record status values). In these cases, the strategy for key composition is left to your discretion. For more information, see
Using Resource Bundles with Resource Domain
Values. Resource domain values are discussed in detail in
Resource Domains.
Resource Bundle Lookup Keys
The following table describes the automatic resource bundle lookups performed for each type of adapter element, and describes how the results are used.
Adapter Element | Key Format | Usage |
Adapter definition | adapterName + ADKGLOBAL. RESOURCEBUNDLEKEY_DISPLAYNAME | Required. Displays adapter name in Integration Server Administrator and in adapter interface. |
| adapterName + ADKGLOBAL. RESOURCEBUNDLEKEY_DESCRIPTION | Required. Displays adapter description in adapter interface's About window. |
| adapterName + ADKGLOBAL. RESOURCEBUNDLEKEY_VENDORNAME | Optional. Displays adapter vendor name in adapter interface's About window. |
| adapterName + ADKGLOBAL. RESOURCEBUNDLEKEY_ THIRDPARTYCOPYRIGHTURL | Optional. Displays adapter's copyright for third parties in the adapter interface's About window. |
| adapterName + ADKGLOBAL. RESOURCEBUNDLEKEY_ COPYRIGHTENCODING | Optional. Encoding used to display adapter's copyright for third parties in the adapter interface's About window. Required only if the ADKGLOBAL. RESOURCEBUNDLEKEY_ THIRDPARTYCOPYRIGHTURL is specified. |
Connection type | ConnectionFactoryName.class.getName() + ADKGLOBAL. RESOURCEBUNDLEKEY_DISPLAYNAME | Displays connection type column in adapter interface. |
| ConnectionFactoryName.class.getName() + ADKGLOBAL. RESOURCEBUNDLEKEY_DESCRIPTION | Displays description column in connection type listing when configuring connections. |
Adapter service template | AdapterServiceName.class.getName() + ADKGLOBAL. RESOURCEBUNDLEKEY_DISPLAYNAME | Displays adapter service template name when selecting a template to create an adapter service in Designer. |
| AdapterServiceName.class.getName() + ADKGLOBAL. RESOURCEBUNDLEKEY_DESCRIPTION | Displays adapter service template description when selecting a template to create an adapter service in Designer. |
Polling notification template | AdapterNotificationName.class.getName() + ADKGLOBAL. RESOURCEBUNDLEKEY_DISPLAYNAME | Displays template name column when selecting a template to create polling notification in Designer. |
| AdapterNotificationName.class.getName() + ADKGLOBAL. RESOURCEBUNDLEKEY_DESCRIPTION | Displays template description column when selecting a template to create polling notification in Designer. |
Parameters used to configure nodes | parameterName + ADKGLOBAL. RESOURCEBUNDLEKEY_DISPLAYNAME | Displays property display name when editing connection, adapter service, and polling notification properties in adapter interface and Designer. |
| parameterName + ADKGLOBAL. RESOURCEBUNDLEKEY_DESCRIPTION | Displays tool tip when mouse is over parameter name when editing service and polling notification properties in Designer. |
Metadata group names | groupName + ADKGLOBAL.RESOURCEBUNDLEKEY_DISPLAYNAME | Displays property display name when editing parameter group for polling notification in Designer. |
| groupName + ADKGLOBAL. RESOURCEBUNDLEKEY_GROUPURL | Overrides Designer help hyperlink on each tab associated with group. |
Log entries | new Integer(minorCode).toString() | Text in all log repositories (server locale) |
Exception text | new Integer(minorCode).toString() | Text in all log repositories (server locale) |
Note:
By default, if you do not specify the DISPLAYNAME lookup key in your resource bundle, the parameter or class name is used as the display name. Other lookup keys that are not specified, display nothing.
Considerations for Adapter Definition Lookup Keys
As specified in the preceding table, the lookup keys specifying the adapter's display name, description, and vendor name are required. All other lookup keys are optional, but not specifying the optional lookup keys, can result in generating error messages in the log, thereby making the adapter more difficult to use.
The adapterName reference in the Key Format column of the preceding table refers to the name of the adapter returned by the WmAdapter implementation class's method getAdapterName. You may use the name of your WmAdapter implementation class if it is also returned by the getAdapterName method.
Note:
The adapter name must be unique within the scope of Integration Server.
Alternatively, you may define a constant that both the lookup key and getAdapterName use. However, do not call WmAdapter implementation class's getInstance.getAdapterName method to retrieve the adapter name from either of these static initializers, or in the resource bundle constructor. Integration Server instantiates the resource bundle data during execution of the WmAdapter implementation class's constructor super(); calling getInstance method from that point produces undesirable results.
Considerations for Specifying URLs in Resource Bundles
Some lookup keys reference documents, such as copyright and other information. If you include these document files with your adapter, place them under
adapterPackageName\pub (where
adapterPackageName is the file system folder under the
Integration Server's packages folder where your adapter resides). For more information about the
Integration Server file system structure, see
Creating an Adapter Package.
In your lookup key, identify the resource file using the file path relative to the pub subfolder. For example, to specify the location of the copyright file for MyAdapter, a resource bundle would include the data value:
{ADAPTER_NAME +
ADKGLOBAL.RESOURCEBUNDLEKEY_THIRDPARTYCOPYRIGHTURL,
IS_PKG_NAME + "copyright.html"}
This relative path is equivalent to the following path:
Integration Server_directory \instance\<instance_name>\packages\MyAdapter\pub\copyright.html
This relative path scheme must be used for all URL references used by Designer as well as for the ADKGLOBAL. RESOURCEBUNDLEKEY_ THIRDPARTYCOPYRIGHTURL clause. Other URL references accessed through the Integration Server Administrator or the adapter's administrative interface may use other URL referencing schemes such as absolute paths or valid Internet addresses.