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:

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

  1. Run the Data Service Layer wizard in your development environment.

  2. Package the generated physical SDOs into a JAR file and deploy it to the WC_INSTALL/ext/lib directory of the runtime environment.

  3. 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.

  4. In the runtime environment, open the business object configuration file for the associated business objects to load.

  5. 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"  />
    

  6. Save and close the file.

  7. Run the data load utility.


Related tasks

Create custom data load business object mediators

Create custom data readers

Configure the CSV data reader

Configure the business object configuration file


+

Search Tips   |   Advanced Search