Retrieving Management Center objects by transforming nouns into XML
When data is sent in the form of a noun from the WebSphere Commerce Server to Management Center, the Management Center web application transforms the noun into an XML representation. The JSP file that represents the Struts action forward is used to transform a noun into an XML formatted object.
- Controller JSP pages. The controller JSPs use the
wcf:getData
tag to invoke component services. These JSPs are also used to store the noun data that is returned in service responses. These JSP files store this data in JSTL expression language variables that are then used by the serialization JSP fragments to transform the data. For an example of a controller JSP, see GetCatalogEntry.jsp example - Serialization JSP fragments. The serialization JSP fragments help to create the response message by formatting the noun data into the XML object representation that is required by Management Center. For more information about serialization JSPs, see creating and registering a serialization JSP file.
Adding more data by using the built-in UserData support
If
you customize the Management Center to add UserData into an existing
noun, the UserData must be transformed into an XML object. The serialization
JSP fragments that are provided by default can serialize new UserData
values for existing nouns. This default serialization support ensures
that UserData can be included in Management Center XML objects that
are provided by default. UserData must use parameters with the format prefix_name
.
For example, xdesc_WarrantyTerms
. The prefix
must
begin with the letter x
and identifies the field
as UserData. For example, xattr_
, xdesc_
,
or xattrdesc_
. The name part of
the UserData parameter format is the name of the UserData field. For
example, WarrantyTerms
.
<c:forEach var="userDataField" items="${catalogEntry.userData.userDataField}">
<xattr_${userDataField.typedKey}>${userDataField.typedValue}</xattr_${userDataField.typedKey}>
</c:forEach>
Since a noun can have UserData at multiple levels,
append an identifier to the x
prefix to distinguish
between UserData with the same field name at different levels of a
noun. For instance, xattr_
, xdesc_
,
and xattrdesc_
. When a get URL request is called,
the configured UserData is returned as a property of a Management
Center object. For example, if a UserData field is xattr_WarrantyTerms
and
a get URL request is called for a noun that includes this field, the
UserData is returned as a warranty term property for the Management
Center object. For more information about User Data, see Adding data to an existing Management Center object.
Notes
- The XML format must begin with
<?xml version="1.0" encoding="UTF-8"?>
to ensure multilingual support. - All Management Center objects must have one property that can uniquely identify an object. Although an object can be uniquely identified with two properties, the Management Center can use only one property to identify an object. For information about defining Management Center objects, see Object definitions.
- The names of the JSP files must follow the existing naming conventions
that indicate the purpose of the JSP file. For example,
GetSalesCatalog.jsp
andSerializeCatalogEntries.jspf
. - The result set that is returned when multiple objects are returned
for Find services must be wrapped in the objects document.
For more information about Get result paging, see Get Request and the Show Response.<objects recordSetReferenceId="${show.recordSetReferenceId}" recordSetCompleteIndicator="${show.recordSetCompleteIndicator}" recordSetTotal="${show.recordSetTotal}" recordSetCount="${show.recordSetCount}" recordSetStartNumber="${show.recordSetStartNumber}">
Examples
The following examples are JSP files and the output XML format that are generated during a noun to XML transformation: