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 controller and JSP file that is defined within the appropriate Spring bean definition is used to transform a noun into an XML formatted object.

The following types of JSPs can be used to transform noun data into XML formatted objects:
  • 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.
  • 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.
Multiple JSPs can be used to transform noun data into an XML object. By using separate JSPs for different parts of the transformation process, you can reuse JSPs to transform data from different services. If two different services are invoked, different controller JSPs can be used. Different controller JSPs can use the same serialization JSPs if the XML object that is returned by both services is the same. For example, one service can retrieve a catalog entry for a category and another service can search for catalog entries. Each of these services is invoked differently and uses different controller JSPs, but both can use the same serialization JSP to transform noun data into a catalog entry object.

Adding more data by using the built-in UserData support

If you customize 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.

For more information about adding UserData, see Management Center business object UserData.

Notes

The XML format and JSP files have the following characteristics:
  • 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, Management Center can use only one property to identify an object.
  • The names of the JSP files must follow the existing naming conventions that indicate the purpose of the JSP file. For example, GetSalesCatalog.jsp and SerializeCatalogEntries.jspf.
  • The result set that is returned when multiple objects are returned for find services must be wrapped in the objects document.
    <objects recordSetReferenceId="${show.recordSetReferenceId}" 
    recordSetCompleteIndicator="${show.recordSetCompleteIndicator}"
    recordSetTotal="${show.recordSetTotal}" 
    recordSetCount="${show.recordSetCount}" 
    recordSetStartNumber="${show.recordSetStartNumber}">

Example

This XML-formatted data is an example of the type of output that can result from a serialization JSP page. This type of XML-formatted data can be sent to Management Center as the response to a URL request.
<?xml version="1.0" encoding="UTF-8"?>
<objects recordSetTotal="1" recordSetCount="1" recordSetStartNumber="0" 
  recordSetReferenceId="74787c70-d095-11dc-b1fe-839f47a28653:1" recordSetCompleteIndicator="true">
  <object objectType="Product" objectId="10252">
    <type><![CDATA[Product]]></type>
    <catenttypeId readonly="true"><![CDATA[ProductBean]]></catenttypeId> 
    <catentryId><![CDATA[10251]]></catentryId>
    <ownerId><![CDATA[7000000000000000101]]></ownerId>
    <partnumber><![CDATA[FULO-01]]></partnumber>
    <onAuction><![CDATA[false]]></onAuction>
    <catalogId><![CDATA[10101]]></catalogId>
    <x_wartype><![CDATA[LIMITED]]></x_wartype>
    <x_catentryId><![CDATA[10251]]></x_catentryId>
    <x_warterm><![CDATA[30]]></x_warterm>		 		 		 
    <object objectType="CatalogEntryDescription">
      <languageId><![CDATA[-1]]></languageId>
      <catalogEntryId><![CDATA[10251]]></catalogEntryId>
      <name><![CDATA[White Fabric Roll Arm Chaise]]></name>
      <sDesc><![CDATA[Plumply padded for your ultimate comfort.]]></sDesc>
      <lDesc><![CDATA[Plumply padded for your ultimate comfort. Removable and reversible back cushion lets you adjust your comfort. 
               Measures 39&quot; in width, 34&quot; in depth, and 34&quot; in height. Some assembly required.]]></lDesc>
      <keyword><![CDATA[]]></keyword>
      <fImage><![CDATA[images/catalog/FULO_01.jpg]]></fImage>
      <tImage><![CDATA[images/catalog/FULO_01_sm.jpg]]></tImage>
      <xdesc_published><![CDATA[1]]></xdesc_published>
      <xdesc_auxDescription2><![CDATA[images/catalog/FULO_01_sm45.jpg]]></xdesc_auxDescription2>
      <xdesc_available><![CDATA[1]]></xdesc_available>
    </object>
    <object objectType="CatalogEntryListPrice">
      <listpriceId><![CDATA[10251_USD]]></listpriceId>
      <catentryId><![CDATA[10251]]></catentryId>
      <defaultCurrencyCode><![CDATA[USD]]></defaultCurrencyCode>
      <USD><![CDATA[449.99000]]></USD>
    </object>
    <object objectType="CatalogEntryExtraProperties">
      <extraPropertiesId><![CDATA[10251]]></extraPropertiesId>
      <catalogEntryId><![CDATA[10251]]></catalogEntryId>
      <xprop_buyable><![CDATA[1]]></xprop_buyable>
      <xprop_state><![CDATA[1]]></xprop_state>
    </object>
  </object>
</objects>