API Reference

The Language Class

This class encapsulates information about the language, such as resource bundle postfix, possible encoding, and so on.

Fields

Name Description
locale Java object which represents locale.
bundlePostfix Resource bundle postfix. This postfix is used in resource bundle file names to identify the language. For example, the langNetwork_ger.properties bundle includes a ger bundle postfix.
charsets Character sets used to encode this language. Each language can have several character sets. For example, the Russian language is commonly encoded with the Cp866 and Windows-1251 encoding.
wmiCodes The list of WMI codes used by the Microsoft Windows OS to identify the language. All possible codes are listed at http://msdn.microsoft.com/en-us/library/aa394239(VS.85).aspx (the OSLanguage section). One of the methods for identifying the OS language is to query the WMI class OS for the OSLanguage property.
codepage Code page used with a specific language. For example, 866 is used for Russian machines and 437 for English machines. One of the methods for identifying the OS language is to retrieve its default codepage (for example, by the chcp command).

The executeCommandAndDecode Method

This method is intended to be used by business logic Jython scripts. It encapsulates the decoding operation and returns a decoded command output.

Arguments

Name Description
cmd The actual command to be executed.
keyword The keyword to be used for the decoding operation.
framework The Framework object passed to every executable Jython script in DFM.
timeout The command timeout.
waitForTimeout Specifies if client should wait when timeout is exceeded.
useSudo Specifies if sudo should be used (relevant only for UNIX machine clients).
language Enables specifying the language directly instead of automatically detecting a language.

The getCharsetName Method

This method returns the name of the most recently used character set.

The useCharset Method

This method sets the character set on the ShellUtils instance, which uses this character set for initial data decoding.

Arguments

Name Description
charsetName The name of the character set, for example, windows-1251 or UTF-8.

See also The getCharsetName Method.

The getLanguageBundle Method

This method should be used to obtain the correct resource bundle. This replaces the following API:

Framework.getEnvironmentInformation().getBundle(...)

Arguments

Name Description
baseName The name of the bundle without the language suffix, for example, langNetwork.
language The language object. The ShellUtils.osLanguage should be passed here.
framework The Framework, common object which is passed to every executable Jython script in DFM.

The osLanguage Field

This field contains an object that represents the language.

Parent topic: Support Localization in Jython Adapters