Creating 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 you will need to create a custom business object mediator in order for the Data Load utility to understand them.
Before you begin
Ensure that you understand the following information:
- The logical model of the business objects the custom mediator will work with.
- The API for the com.ibm.commerce.foundation.dataload.businessobjectmediator.AbstractBusinessObjectMediator abstract class.
- The API for the com.ibm.commerce.foundation.dataload.businessobjectmediator.BusinessObjectMediator interface.
- The API for the com.ibm.commerce.foundation.dataload.object.TableDataObject class.
About this task
Procedure
- Open 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 your customized mediator.
- Save and close the file.
- Repeat steps 5 and 6 for each of your business object configuration files.