The JWare/AntX build-core(uism) package contains the AntX resource bundle message support framework.

The main script-facing components in this package are: UISMBundle(<msgsbundle>), InitUISMBundle(<managebundle>), UISMConfigureTask(<overlay-msgs>), CopyMsgTask(<copymsg>), and EchoBundleTask(<printbundle>). A value-URI handler ($message:) for extracting messages from resource bundles is also provided; see MessageValueURIHandler.

The AntX resource bundle framework enables AntX tasks to support strings defined in resource bundle properties files instead of embedded as literals within the build script. Every root AntX class but particularly the root Task class AssertableTask is designed to use resource bundle strings instead of literals.

At the core of the AntX resource bundle support is the JWare UI String Manager class UIStringManager(or UISM for short). This is the standard JWare interface to retrieve strings meant for the application's visible interface. AntX relies on the UISM implementation based on resource bundle properties files, BundleStringManager. The resource framework is essentially a bridge between the Ant world and UIStringManagers.

Within AntX there are two sources of strings: the internal AntX strings bundle and script supplied resource bundles. The internal AntX bundle contains messages used by the AntX implementation itself. This resource bundle is supplied with the AntX distribution in com/idaremedia/antx/uistrs/UIStrings.properties. Script-supplied resource bundles are used to process the "msgid" parameter supported by virtually every AntX task. The InitUISMBundle and UISMConfigureTask tasks control which build-supplied bundle is searched for script resource strings.

UIStringManagers are created and maintained at the build-iteration level which means they exist across project boundaries (a bundle installed in a project is seen by all child projects). The CopyMsgTask lets you transfer a resource based message into a regular Ant property at the project level. Starting with AntX 0.5, you can also extract messages without creating transient properties if you use a $message: value URI like: <echo message="${$message:greeting}"/>.

To debug message issues, we provide both the BundlePrinter display strategy (plugs into the general AntX print framework), and the (older) EchoBundleTask diagnostic print task.

[More Learning Materials]   [Documentation Problems]
( Updated: Apr 09 2005, 12:07 PM, -0400 )