Management Center business object UserData
If you require more data in a noun and Management Center object, you can use UserData.
UserData is used as a data extension point for adding data for objects without changing your
WebSphere Commerce logical model. UserData must use parameters with the format
prefix_name
, where the prefix
must begin with
the letter x
and identifies the field as UserData. The name is
the name of the UserData field. Since a noun can have UserData at multiple levels, you must append
an identifier to the x
prefix to distinguish between UserData that has the same
field name at different levels of a noun. For instance, xattr_
,
xdesc_
, and xattrdesc_
.
If you use UserData, your configuration must include definitions for how to handle the mapping of
the UserData. UserData can be identified through different prefixes that are based on where the
UserData is in the noun. For example, in the configuration for catalog objects,
xasso_
indicates the UserData comes from merchandising associations, or
xattr_
for attributes. As an example, UserData for a catalog object can begin with
the prefix x_
, which has its mapping, which is defined in the catalog component
configuration file, wc-catalog-clientobjects.xml. In this file, the mapping of
UserData with the prefix x_
is defined with the following code snippet.
<_config:URLParameter name="x_" nounElement="/UserData/UserDataField" type="UserData"/>
Where
the type="UserData"
code identifies that URL parameters that begin with the prefix
x_
are mapped to the element in the catalog entry noun that is defined by the
XPath: /UserData/UserDataField
.
<c:forEach var="userDataField" items="${catalogEntry.userData.userDataField}">
<xdesc_${userDataField.typedKey}>${userDataField.typedValue}</xdesc_${userDataField.typedKey}>
</c:forEach>
When
a URL request is generated, the URL parameters are compared with the configuration file definitions
to get the instructions for mapping the parameters to the associated noun elements. If the URL
request requires an updated Management Center object to be returned, the noun is then transformed
into the object model XML that is required by Management Center. If this new property must display to business users, you can customize Management Center to display the data as an object property. For an example of customizing Management Center to display UserData for an object, see Tutorial: Adding fields in the Catalogs tool.