Develop > Persistence layer > Data assets > Work with the Data load utility > Customize the data load utility
Load extension tables
Use the data load utility to load UserData into custom extension tables in the WebSphere Commerce database. There are two ways to load data into custom extension tables:
- Map the extension table data to the logic noun UserData fields. If extend the logic noun in the Management Center tool or generate custom SDO extensions, use this method.
- Use the TableObjectBuilder and TableObjectMediator to load data directly into the custom extension table. If you did not customize the Management Center tool or you did not generate custom SDO extensions, use this method.
The TableObjectMediator does not support workspace locking.
The following procedure shows you how to load data into custom extension table using the first method.
Before you begin
Read the tutorial Add new properties to a WebSphere Commerce service using the data service layer for an example of how to create custom extension tables.
Procedure
- Run the Data Service Layer wizard in your development environment.
- Package the generated physical SDOs into a JAR file and deploy it to the WC_INSTALL/ext/lib directory of the runtime environment.
- Deploy the extension configuration directory generated by the Data Service Layer wizard into the WC_INSTALL/instances/instance/xml/config directory of the runtime environment. The generated extension configuration directory is located in the WC_EAR/xml/config directory.
- In the runtime environment, open the business object configuration file for the associated business objects to load.
- Add the appropriate mappings inside the <_config:DataMapping> element. For example, the following snippet shows the customization of the CatalogEntry noun to support warranty information:
<_cat:CatalogEntry catalogEntryTypeCode="ProductBean"> <_cat:CatalogEntryIdentifier> <_wcf:UniqueID>10251</_wcf:UniqueID> <_wcf:ExternalIdentifier ownerID="7000000000000000101"> <_wcf:PartNumber>FULO-01</_wcf:PartNumber> </_wcf:ExternalIdentifier> </_cat:CatalogEntryIdentifier> <_cat:Description language="-1"> <_cat:Attributes name="careinstruction">Warranty care instructions.</_cat:Attributes> </_cat:Description> <_wcf:UserData> <_wcf:UserDataField name="warterm">30</_wcf:UserDataField> <_wcf:UserDataField name="wartype">LIMITED</_wcf:UserDataField> </_wcf:UserData> </_cat:CatalogEntry>
The catalog entry mediator supports loading custom catalog entry UserData using the catalog entry mediator. You do not need to create a custom mediator to support UserData.
Add the following code in the business object configuration file to map the warranty userdata:
<_config:mapping xpath="UserData/UserDataField/warterm" value="WarrantyTerm" /> <_config:mapping xpath="UserData/UserDataField/wartype" value="WarrantyType" /> <_config:mapping xpath="Description/Attributes/careinstruction" value="CareInstruction" />
- Save and close the file.
- Run the data load utility.
Related tasks
Create custom data load business object mediators
Configure the business object configuration file