Defining retrieval services for a custom Management Center object

If you want to display and manage a custom a Management Center object in Management Center, you must define a retrieval service to retrieve and display the object information. To define a retrieval service, create JSP fragments to retrieve the object information and transform the information into an XML-formatted representation that is expected by Management Center.

About this task

The JSP fragments that you define for your custom object can be reused to support multiple get and find URL requests for retrieving the object information.

After you create the mediation JSP fragments, you must define the Spring framework configuration to identify the controller JSP that invokes the search expression for retriving the object information. You must also define the Spring framework configuration to identify the serialization JSP fragments that mediate the transformation of the retrieved information into the XML-format that is expected by Management Center.

You can view examples of controller JSP files and serialization JSP fragments within your IBM WebSphere Commerce Developer environment within the following directories:
  • For controller JSP files, open the Enterprise Explorer view and expand LOBTools > WebContent > jsp > commerce > catalog > restricted. Review files that are named Find*.jsp.
  • For serialization JSP fragments, expand LOBTools > WebContent > jsp > commerce > catalog > restricted > serialize. Review files that are named *.jsp.

Procedure

  1. Open IBM WebSphere Commerce Developer.
  2. In the Enterprise Explorer view, expand LOBTools > WebContent > jsp > mycompany > component, where mycompany is the name of your company and component is the name of the object component. If the mycompany and component directories do not exist, create the directories.
    For example, if your custom object is an extension of the catalog component, your directory structure can be mycompany > catalog.
  3. Within the component directory, create a controller JSP page to retrieve the object information. Use existing controller JSP files as templates to help you create your file.
    • Within your file, include the element <jsp:directive:include file="" /> to identify the serialization JSP fragment to use to transform the the object into the expected XML representation.
    • The name of your controller JSP file should match the usage of the file. For instance, if the file defines a request to get warranty information for a product, the file name can be GetProductChildren-Warranty.jsp.
  4. In the component directory, create a folder with the name serialize.
  5. Within the new serialize directory, create a JSP fragment file that is named SerializeObject.jspf, where Object is the name of your custom Management Center object.
  6. Within your new serialization JSP fragment, define the code to transform the data for the object into an XML formated response. Use existing serialization JSP fragments as templates to help you create your file.
  7. Expand LOBTools > WebContent > WEB-INF.
  8. Open the spring-extension.xml file for editing and add <bean> element definitions to register your new JSP files.
  9. Restart the WebSphere Commerce Test Server and test your changes.