Defining 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
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. About this task
Procedure
- Open WebSphere Commerce Developer.
- Navigate to the LOBTools web application project.
- 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 calledmycompany/catalog
such thatmycompany
indicates your Management Center object extensions andcatalog
represents the catalog tooling. - Create a JSP fragment
file named
SerializeClientObject.jspf
. - 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.
- 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 beGetProductChildren-Warranty.jsp.
- 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.
- Restart the WebSphere Commerce server and test your changes.
- Deploy your changes to your production environment.