Configuring the Widget

To configure the photograph widget, the data must be in a domain that is specific to photographs. Here, the SAMPLE_PHOTO_XML domain is assumed. The DomainsConfig.xml file should be added to the client application component, or the existing file should be modified if it already exists, to associate the view-renderer plug-in class with that domain. To access data in XML form and use the path extension feature described earlier a "marshal" plug-in must also be configured exactly as shown below. Failure to do so will mean that individual values cannot be retrieved from the XML document as shown earlier.

Figure 1. Configuring the E-Mail Address Widget
<?xml version="1.0" encoding="ISO-8859-1"?>
<dc:domains
  <dc:domain name="SAMPLE_PHOTO_XML">
    <dc:plug-in
      name="view-renderer"
      class="sample.PhotoViewRenderer"
      />
    <dc:plug-in
      name="marshal"
      class="curam.util.client.domain.marshal.SimpleXPathMarshal"
      />
  </dc:domain>

</dc:domains>

Applying the above configuration, the view-renderer of the custom widget will now be invoked anywhere a UIM FIELD element has a source connection to a server interface property in the SAMPLE_PHOTO_XML domain. If the UIM FIELD has a target connection, the edit-renderer will be used instead. As no edit renderer is defined in this configuration, the edit-renderer of the parent or other ancestor domain, will be inherited and used. Typically, this will be the TextEditRenderer associated by default with the SVR_STRING domain. However, this type of widget is displaying a subset of the information the Cúram application captures about a person. An editable version of this widget would not be expected. Instead the information would edited through the standard Cúram screens associated with a person, for example if the person's name required updating.

More information about configuring renderers and other plug-ins is provided in Configuring Renderers.