Configuring Domain Renderers

The Cúram Web Client Reference Manual provides detailed information about the customization of the domain configuration in the DomainsConfig.xml file of an application component. That information is not repeated here. The view-renderer and edit-renderer plug-ins are configured in the same file and in the same way as other domain plug-ins. The only difference is that the specific plug-in names view-renderer or edit-renderer are used in the plug-in elements of the configuration. An example is shown below.

What are the basic principles? Configuration inheritance for domain renderers, no inheritance for component renderers (styles). What is the default configuration? Only configure what you need to change; do not copy complete configurations, otherwise expected inheritance can be compromised in the future.

Figure 1. An Example of a DomainsConfig.xml File
<?xml version="1.0" encoding="ISO-8859-1"?>
  <dc:domain name="SAMPLE_DOMAIN">
    <dc:plug-in name="view-renderer"
                class="sample.SampleViewRenderer"/>
    <dc:plug-in name="edit-renderer"
                class="sample.SampleEditRenderer"/>
  </dc:domain>

</dc:domains>

It is possible to override all of the plug-ins associated with a domain (subject to some support limitations described in the previous section). However, it is very important that the developer only specify the plug-ins that need to be customized and not repeat the configuration of existing plug-ins without changing them. When the developer partially customizes a domain, any unspecified plug-ins will be resolved using the CDEJ default configuration or inherited from an ancestor domain of the configured domain. This is the preferred behavior.

Defining unnecessary custom configurations for plug-ins can have unwanted effects that may be hard to diagnose. For example, the developer might copy the CDEJ default configuration of a domain from the CDEJ default configuration file together with the configurations of all of that domain's plug-ins and use this as a template of sorts in the custom configuration file. The developer might now change only one plug-in element to customize the view-renderer class used for the domain and leave all of the other plug-in elements copied from the CDEJ intact and unchanged. All of these unchanged plug-in configurations are unnecessary, as the developer is not customizing them. If the CDEJ is now upgraded, any changes to the CDEJ default configuration of that domain will not be reflected in the application, as the developer has, in the custom configuration, effectively customized all of the plug-ins for that domain. While using the older version of the CDEJ, this went unnoticed, as the customization was the same as the default. However, on upgrading the CDEJ, the old CDEJ configuration that the developer copied to the custom configuration file continues to be given priority and any new CDEJ default configuration of any plug-in will not be reflected in the application. It is very important, therefore, that the developer customize only the plug-ins that must change and omit all references to other plug-ins.