Develop > Controller layer > Management Center Web application > Customize the Management Center Web application > Create new objects


Define retrieval services for a custom Management Center object

To define a Management Center object to be returned to the Management Center, create JSP fragments to transform the information returned by the WebSphere Commerce service into the XML representation expected by the Management Center.


Before you begin

These JSP fragments can be reused to support multiple get and find URL requests to retrieve these Management Center objects. After creating the mediation JSP fragments, create a Struts forward and controller JSP file to invoke the search expression to retrieve the information. Include the JSP fragment to mediate the object returned by the service into the Management Center object representation that is expected by the Management Center. Examples of the controller JSP pages and serialization JSP fragments can be found in the WebSphere Commerce development environment, in the LOBTools project, under the WebContent/jsp/catalog/Find*.jsp and WebContent/jsp/catalog/serialization/*.jsp directories.

To define a Management Center object to be returned to the Management Center:


Procedure

  1. Open WebSphere Commerce Developer.

  2. Navigate to the LOBTools web application project.

  3. If this project does not exist, create a directory under the WebContent/jsp directory that classifies the purpose of the Management Center object. For example, if the Management Center object is an extension of the catalog tooling, create a directory called mycompany/catalog such that mycompany indicates the Management Center object extensions and catalog represents the catalog tooling.

  4. Create a JSP fragment file named SerializeClientObject.jspf.

  5. Implement the JSP fragment assuming a variable name representing the Management Center object has been specified and the JSP fragment that transforms the Management Center object to the Management Center object representation.

  6. In the same directory, create a controller JSP page to retrieve the Management Center object from the service. Use jsp:directive.include to use the serialization fragment to transform the object into the Management Center object representation. The name of the controller JSP page should match its usage. For example if the purpose of the request is to get the Warranty information of a Product, the name of the JSP file would be GetProductChildren-Warranty.jsp.

  7. Open the WebContent/WEB-INF/struts-extension.xml file and add a new forward action, which will be forwarded to the newly created JSP page. The name of the Struts action should be the same as the name of the JSP page.

  8. Restart the WebSphere Commerce server and test the changes.

  9. Deploy the changes to the production environment.

Related reference

Retrive Management Center objects by transforming Nouns into XML


+

Search Tips   |   Advanced Search