Image Mapping

Images can also be used within the Cúram application to represent different values of displayed fields instead of presenting the value as text. For example, a typical boolean value of true or false could be represented by two images of, say, a green check mark and a red X.

The mapping between values and images is stored in the ImageMapConfig.xml file. There is no need to specify this in any way in UIM. If you use a property with a domain listed in the ImageMapConfig.xml file, it will automatically be displayed as an image.

Figure 1. A Sample ImageMapConfig.xml file
<map>
  <domain name="MY_BOOLEAN">
    <locale name="en">
      <mapping value="true"
               image="Images/ValuesToImages/true.gif"
               alt="True"/>
      <mapping value="false"
               image="Images/ValuesToImages/false.gif"
               alt="False"/>
    </locale>
    <locale name="fr">
      <mapping value="true"
               image="Images/ValuesToImages/true.gif"
               alt="Vrai"/>
      <mapping value="false"
               image="Images/ValuesToImages/false.gif"
               alt="Pas Vrai"/>
    </locale>
  </domain>
</map>

In the example, a field with domain type MY_BOOLEAN has been assigned an image mapping. Note that you should specify an image mapping for each available locale even if the images used are identical. This is because the alternative text ("alt text") attached to the image will be different for different locales. This text is important for accessibility reasons (users who have visual difficulties might use an audio browser, for example, which will read out the "alt text").

ImageMapConfig.xml files in different components are merged with all unique image mappings preserved. If the same value in the same locale is mapped in two ImageMapConfig.xml files in two different components, the mapping from the higher priority component prevails.