Create custom data load business object mediators
Occasionally the default business objects provided with WebSphere Commerce are insufficient to describe the types of data used in certain businesses, making it is necessary to extend or create new business objects. If you have created custom business objects, then we will need to create a custom business object mediator in order for the Data Load utility to understand them.
Before beginning
Ensure that you understand the following information:
- The logical model of the business objects the custom mediator will work with.
- The API for the AbstractBusinessObjectMediator abstract class.
- The API for the BusinessObjectMediator interface.
- The API for the TableDataObject class.
Task info
To create a custom data load business object mediator, extend the AbstractBusinessObjectMediator abstract class, which is the default implementation of the BusinessObjectMediator interface.
Procedure
- Start WebSphere Commerce Developer..
- Switch to the Java EE perspective.
- In the Enterprise Explorer view, double-click WebSphereCommerceServerExtensionsLogic to open this project.
- In the WebSphereCommerceServerExtensionsLogic project, implement the transform() abstract method to transform the custom business objects into a list of physical objects using the TableDataObject class.
- Optional: Override the other methods in the class as necessary to achieve the required functionality to mediate your existing data.
- Open the sample business object configuration file located in the WCDE_installdir\samples\DataLoad directory.
- Change the value of the className attribute inside the <_config:BusinessObjectMediator> element with the class name of our customized mediator.
- Save and close the file.
- Repeat steps 5 and 6 for each of your business object configuration files.