Develop > Controller layer > Management Center Web application > Map between the Management Center client and WebSphere Commerce nouns
Retrive Management Center objects by transforming Nouns into XML
When data is sent from the WebSphere Commerce Server to the Management Center, the Management Center Web application transforms Nouns into the XML representation that is expected by the Management Center. The JSP file that represents the Struts action forward is used to transform Nouns into XML format.
The following types of JSP pages are used to transform WebSphere Commerce services Nouns into XML format:
- One controller JSP page creates, sends, and receives the BODs from the WebSphere Commerce Server, and then sends the Nouns from the response BOD to the serialization JSP fragments.
- One or more serialization JSP fragments format the Nouns into the XML representation that is expected by the Management Center, and then sends the XML representation to the Management Center. The Management Center expects data in a specific XML format.
Add more data using the built-in UserData supportIf you customized the Management Center to add UserData into your Noun, the serialization JSP fragments that are ready for you to use without modification ensure that this user data is transformed into the Management Center object. The following code snippet shows the structure of UserData:
<c:forEach var="userDataField" items="${catalogEntry.description.attributes}"> <xattr_${userDataField.typedKey}>${userDataField.typedValue}</xattr_ ${userDataField.typedKey}> </c:forEach>Management Center objects that correspond to information in a UserData element must use the naming convention of xattr_name, where name is the name attribute of the value and the property value is the value. When the change or process URL request is initiated, the configured UserData element that is associated with xattr is populated appropriately. For example, the UserData Noun might be xattr_WarrantyTerms. For more information about User Data, see Add data to an existing Management Center object.
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.
- The XML format must contain dynamic values only. Define all constant values in the Management Center.
- All Management Center objects must have only one property that uniquely identifies the object. Although the object can be uniquely identified with two properties, the Management Center can only use one property. For information on defining Management Center objects, see Object definitions.
- The names of the JSP files must follow the existing naming conventions to 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}">For more information on Get result paging, see Get Request and the Show Response.
Examples
The following examples are JSP files and the output XML format that are generated during a Noun to XML transformation:
- GetCatalogEntry.jsp example
This controller JSP page creates, sends, and receives BOD messages from the WebSphere Commerce Server.
- Serialization JSP fragment example
The serialization JSP fragments format Nouns from the controller JSP into XML format.
- XML output sample
This XML-formatted data is the result of the controller and serialization JSP sample pages.
Related tasks
Define retrieval services for a custom Management Center object
Add data to an existing Management Center object