After functional developers create an XUI file, IBM® WebSphere® Multichannel Bank Transformation
Toolkit automatically
generates a JSP file for the XUI file when Generate Dojo is selected.
To generate proper JSP tags for the customized widget, a technical
developer must create a new widget mapping file and the register it
as a plugin extension.
After a technical developer creates a widget mapping file, they
must register the mapping file. To register the widget mapping file,
refer to the Registering a widget mapping section in this
topic.
Creating a widget mapping file
Figure 1 is a sample widget mapping file.
Figure 1. Sample widget mapping file<mappings prefix="bttdojo:">
<widget-mapping widgetName="AccountWidget" tagName="account">
<property-mapping propName="labelColor" attrName="color" />
<property-mapping propName="balanceColor" rule="RGBValueRule" />
</widget-mapping>
</mappings>
A widget mapping file must contain one <mappings> tag.
The prefix attribute is the only attribute for the <mappings> tag.
The prefix attribute specifies the prefix text for the tag when mapping
the widget to the JSP file. The value should be the same as prefix
attribute of ‘tablib' directive in JSP file.
Each widget
requires a <widget-mapping> element to describe how a widget is
mapped to a JSP tag. The <widget-mapping> tag has the following
two attributes:
- widgetName
- Is the name for the given widget. The name should match with the
name defined in the widget extension point. For more information on
adding widget extension points, refer to the Importing a widget topic.
- tagName
- Is the JSP tag name for this widget.
By default, each widget property name is mapped
to the same attribute name of the JSP tag directly. For properties,
without mapping definition, default mapping will be handled automatically.
To customize property mapping, a technical developer can define a
‘property-mapping' element to specialize the mapping from widget
property to a tag attribute. There are 3 attributes for ‘property-mapping'
tag:
- propName
- Is the name of a property. The value of the propName attribute
must be the same as the name of the property as defined in the widget
definition .xml file. For more information on
the widget definition .xml file, refer to the Defining a widget topic.
- attrName
- Is the name of the attribute that maps a property to a JSP tag.
- rule
- Specifies the property mapping rule, which can handle more flexible
property mapping scenarios. For information on how to implement a
property mapping rule, refer to the Creating a customized property mapping rule topic.
Registering a widget mapping
- In the Extensions tab of plugin file, click Add to
open the New Extension window, and then select com.ibm.btt.tools.xui.editor2.generator.
Click Finish.
- Right click com.ibm.btt.tools.xui.editor2.generator,
and then click .
- In the Extension Details panel, select the mapping file that you
defined in the file field.