Tutorials > Program model > Customize the Data Load utility

< Previous | Next >


Configure the Data Load utility

In this step of the tutorial, you configure the environment variable settings file, data load order file, and business object configuration file.

You are provided with the following files:

Environment variable file

In this file, you specify the business context information, database connection property, ID Resolver, and data writer class. See wc-dataload-env.xsd for more information.

Data load order file

In this file, you specify a pointer to the XML input file, environment settings file, and business configuration file. You also specify which data load mode to perform. See wc-dataload.xsd for more information.

Business object configuration file

In this file, you specify the data reader, business object builder and business object mediator. See wc-dataload-businessobject.xsd for more information.


Procedure

  1. Create the data load environment settings file.

    The environment variables used by the Data Load utility is configured in an XML file called wc-dataload-env.xml.

    1. Copy the wc-dataload-env.xml file into the WCDE_INSTALL\samples\DataLoad\warranty directory.

    2. Open the wc-dataload-env.xml file and examine its content.

      In the wc-dataload-env.xml file:

      • The attribute values inside the <_config:BusinessContext > element is changed to match the store settings.

        <_config:BusinessContext storeIdentifier="Madisons" catalogIdentifier="Madisons"  />
        

      • The attribute values inside the <_config:Database> element is changed to match the database environment properties.

        <_config:Database name="..\db\mall" type="derby" />    
        

      • The attribute values inside the <_config:DataWriter> element is changed to match the data writer class.

        <_config:DataWriter className="com.ibm.commerce.foundation.dataload.datawriter.JDBCDataWriter" />
        

      To know more about configuring the data load environment settings, see Configure the data load environment settings.

  2. Create the business object configuration file.

    1. Copy the wc-warrantyobject-loader.xml file into the WCDE_INSTALL\samples\DataLoad\warranty directory.

    2. Open the wc-warrantyobject-loader.xml file, and examine its contents.

      In the wc-warrantyobject-loader.xml file:

      • The attribute value in the <_config:DataReader> element is changed to specify the data reader class you implemented.

        <_config:DataReader className="com.mycompany.commerce.dataload.reader.WarrantyReader" />
        

      • The attribute value in the <_config:BusinessObjectBuilder> element is changed to specify the business object builder class you implement. For the custom data reader, it returns a DataLoadBusinessObject, so you do not need to specify a business object builder class.

        <_config:BusinessObjectBuilder className="" >
        

      • The attribute value in the <_config:BusinessObjectMediator> element is changed to specify the business object mediator class. In this tutorial, the warranty and care instruction data are extension of the CatalogEntry business object, so the CatalogEntryMediator class is specified.

        <_config:BusinessObjectMediator className="com.ibm.commerce.catalog.dataload.mediator.CatalogEntryMediator" componentId="com.ibm.commerce.catalog"/>
        

  3. Configure the data load order file.

    The data load order file defines the mode in which the Data Load utility uses to load data.

    1. Copy the wc-dataload-warranty.xml file into the WCDE_INSTALL\samples\DataLoad\warranty directory.

    2. Open the wc-dataload-warranty.xml file, and examine its contents.

      In the wc-dataload-warranty.xml file:

      If you want to know more information on configuring your data load order, see Configure the data load order.

In the workspace_dir\WC\xml\config\dataload\logging.properties, you can specify the trace level, and enable console and file logging. The following settings are used by default:

You do not need to modify the log file location. However, you might want to change the trace level when debugging a data load problem. The Data Load utility provides some command line options to change the trace level. See the Data Load utility for more information.

An error log file is generated per load item, if there are any errors. The error file name and location is specified in the summary report on the console. The error log file is located in the same directory as the wc-dataload.log file.

< Previous | Next >


+

Search Tips   |   Advanced Search