Guidelines for using the custom-output element
When you add a custom-output element to a summary page, if custom
properties are required to be used within a custom renderer class, you must add the properties to
the properties file for the summary page. The custom renderer class must then reference the required
properties directly.
For example, you can retrieve text from a properties file within a custom renderer by calling the
getLocalizedText(Component, RendererContext, String, List<String>) method. If
required, pass the property name and a list of arguments for the property as parameters into the
method. The localized text for the property is returned. Similarly, you can also retrieve images
from the resource store by calling the getLocalizedImageFromResourceStore(String,
RendererContext) method. Pass the name of the image as a parameter into the method, and the
relative image URI is returned. You can set the URI value as the source for an image element.
custom-output element enables data from a data store instance to be
retrieved and then rendered on a summary page by using custom HTML. When you use the
custom-output element, use the following guidelines:- API methods
- Several API methods are provided in the
curam.ieg.player.IEGCustomOutputRendererclass to handle the localization of the different data types that can be used within custom renderers. It is recommended that you use the methods to return localized versions for each of the data types within a custom renderer. No API methods are supplied for number formatting. The following table lists the data types for which localization APIs are provided:Table 1. Data types and associated API localization methods Data type Method String getLocalizedText(Component, RendererContext, String, List<String>)Codetable Note: Codetable hierarchies are not supported.getLocalizedCodeTableItemValue(String, String, RendererContext)Money getLocalizedMoneyString(String)Boolean getLocalizedBooleanString(RendererContext, String)Date getLocalizedDateString(String) - Retrieving entity data
-
- You must use data accessor classes to retrieve entity data that can then be rendered in a custom renderer class. Data accessor classes support only the reading of data from the data store. The editing of data store data within a data accessor class might cause adverse effects and is not supported.
- Retrieving a large amount of entity data from the data store within a data accessor class can
affect the overall performance of an IEG page. Therefore, take care when you consider how many
custom-outputelements are included on a summary page. - Within custom renderer classes, where it is possible to retrieve data such as images and properties, ensure that you retrieve data only from the resource store.
- Instantiating the
custom-outputelement - Import IEG script definitions that contain the new
custom-outputelement into the database by using one of the following options:ieg.importscriptcommand line build optiondatabasecommand line build option
custom-outputelements. Any associated properties that are specified for a custom renderer are not included in the script definition. Instead, the properties are defined directly in the associated property file of the summary page where thecustom-outputelements are instantiated. - Rendering custom HTML
-
- The HTML that is output by a custom renderer can contain only read-only fields. The HTML output must not contain any editable fields because no infrastructure is provided that allows data to be either entered or modified through the mechanism of the custom output feature.
- The custom HTML that is created must be valid HTML within the context of an IEG page. For
example, it is valid to insert a
divtag as a starting point for the custom HTML, but inserting anhtmltag as a starting point within a custom renderer might cause adverse effects. - Ensure that the custom renderer does not delegate to other renderers to output HTML on a summary page.
- Ensure that the custom HTML complies with accessibility standards.
- If specific custom HTML for right-to-left languages and high contrast mode is required, use the custom renderer to create the custom HTML.