• Nenhum resultado encontrado

Message text files are located in the/messagedirectory of a component. The Social Program Management Platform is shipped with a set of message files. These may be overridden by placing new message files in the SERVER_DIR/components/<custom

>/message directory, where<custom>is any new directory created under

components that conform to the same directory structure as components/core. This mechanism avoids the need to make changes directly to the out-of-the-box

application, which would complicate later upgrades.

Note: If thepackageattribute in the overridden message file is modified, then the customization will not work.

This override process involves merging all message files of the same name according to a precedence order. The order is based on the

SERVER_COMPONENT_ORDER environment variable. This environment variable contains a comma separated list of component names: the left most has the highest priority, and the right most the lowest.

The order in “Customizing a Message File” on page 92, shows that the precedence of Appealis higher than that of the samplecomponent. Thecorecomponent always has the lowest priority and as such does not need to be specified. Any components that are not specified are placed alphabetically abovecoreand below those that are specified.

Note: After changing the component precedence order in

SERVER_COMPONENT_ORDER it is necessary to perform a clean build to ensure that you are using the appropriate files. This is done by invokingbuild clean server.

When merging message files, the components listed in the

SERVER_COMPONENT_ORDER are taken in order of highest to lowest priority. In

“Customizing a Message File” on page 92 message files from thesample

component are merged with the message files located in thecorecomponent. The message files from ISProductare then merged into the intermediate results and the merge process continues until the messages in thecustomcomponent are merged.

Rules of Message Merges:

Message files are merged based on precedence order. As described above there is always a more important main/source message file, and a file which is being merged into it. The second file is called the merge file in the following sections.

The merging rules described below are applied to decide if the<message>and

<locale>elements should be merged into the new message file.

v A<message> will be merged into a new message file if the<message> is not already present in the new file.

v A<locale>will be merged into a named<message> element in the new message file if the<locale>is not already present in the<message>of the new message file.

Duplicate messages will always be overwritten by the message file in the

component with the highest precedence order. The main message file of “Rules of Message Merges,” and the merge file of “Rules of Message Merges,” illustrate these rules:

SERVER_COMPONENT_ORDER=custom,Appeal,ISProduct,sample Figure 58. SERVER COMPONENT ORDER example

As a result of the merge process the new message file produced would be:

<messages package="curam.message">

<message name="ERR_SAMPLE_VALIDATION_MSG">

<locale country="US" language="en">

The specified color is not valid.

</locale>

</message>

<message name="ERR_SAMPLE_ERROR_MSG">

<locale country="US" language="en">

An external resource is not available.

</locale>

</message>

</messages>

Figure 59. Sample main message file

<messages package="curam.message">

<message name="ERR_SAMPLE_VALIDATION_MSG">

<locale country="GB" language="en">

The specified colour is not valid.

</locale>

</message>

<message name="ERR_SAMPLE_NEW_MSG">

<locale country="GB" language="en">

An example of localisation.

</locale>

</message>

<message name="ERR_SAMPLE_REMOVED_MSG" removed="true">

<locale language="en">

This message will be removed.

</locale>

</message>

</messages>

Figure 60. Sample merge message file

<messages package="curam.message">

<message name="ERR_SAMPLE_VALIDATION_MSG">

<locale country="GB" language="en">

The specified colour is not valid.

</locale>

<locale country="US" language="en">

The specified color is not valid.

</locale>

</message>

<message name="ERR_SAMPLE_ERROR_MSG">

<locale country="US" language="en">

An external resource is not available.

</locale>

</message>

<message name="ERR_SAMPLE_NEW_MSG">

<locale country="GB" language="en">

An example of localisation.</locale>

</locale>

</message>

<message name="ERR_SAMPLE_REMOVED_MSG" removed="true">

<locale language="en">

This message will be removed.

</locale>

</message>

</messages>

Figure 61. Resulting Message File