Sample: Loading price list data

This sample demonstrates how to load price lists with the Data Load utility. After you load the data, Management Center users can view and manage the price list in the Catalog Filter and Pricing tool.

About this sample

When you load the data within this sample, you create only price list objects in the WebSphere Commerce database. This sample does not populate the price lists with any offer price data. For a sample that does populate the price lists that you create in this sample with offer price data, see Sample: Loading offer price data into price lists.

The CSV input file and Data Load utility configuration files for this sample are in the following directory:
  • LinuxAIXWC_installdir/samples/DataLoad/Price/PriceList
  • WindowsWC_installdir\samples\DataLoad\Price\PriceList
  • WebSphere Commerce DeveloperWCDE_installdir\samples\DataLoad\Price\PriceList
The Data Load utility environment configuration file, wc-dataload.env.xml, is in the parent directory that is called Price.
Note: You can also load data for price lists in CSV formatted files with the Price Upload feature in the Catalog Filter and Pricing tool.

Sample input and configuration files

The following table lists the input file that you use to load the sample data. The table also identifies the business object mediators and business object configuration files that the Data Load utility uses to load the sample data.

Input file for loading price list data.

Sample input file Description
Pricelist.csv

For more information about the type of data that you can include in this input file, see Price list input file

The Data Load utility uses this sample input file to load the data to create price lists. After the utility loads the data, the price lists are available in the Catalog Filter and Pricing tool.

The Data Load utility uses the following business object mediator to load the data in this input file.

Business object mediator

com.ibm.commerce.price.dataload.mediator.PriceListMediator

The sample directories also include the following Data Load utility configuration files:
wc-dataload.xml
The data load order configuration file, which identifies the CSV input file and the appropriate business object configuration file to use to load the input file. For more information about load order configuration files, see Configuring the data load order.
wc-dataload-env.xml
The data load environment configuration file, which includes the environment variables for your WebSphere Commerce instance. These variables include the following information:
  • Business context variables, including the store identifier, catalog identifier, and the default language and currency for your store.
  • Database environment settings, including the database type, name, and schema.
wc-loader-pricelist.xml
The business object configuration file that defines how the price list data is loaded into the database. The file also defines the appropriate business object mediator to use to load the data.
Note: These configuration files include values for a default WebSphere Commerce Developer environment that uses an Apache Derby database. If your environment settings are different, you must change the configured values in these files to match your environment.

Procedure

  1. Open a command-line utility and go to the appropriate directory:
    • LinuxAIXWC_installdir/bin
    • WindowsWC_installdir\bin
    • WebSphere Commerce DeveloperWCDE_installdir\bin
  2. Enter the following command to run the sample data load order file and load the information in this sample:
    • LinuxAIX./dataload.sh ../samples/DataLoad/Price/PriceList/wc-dataload.xml
    • Windowsdataload.bat ..\samples\DataLoad\Price\PriceList\wc-dataload.xml
    • WebSphere Commerce Developerdataload ..\samples\DataLoad\Price\PriceList\wc-dataload.xml

Verifying results

To verify that the utility loaded the price list data successfully, complete the following tasks:
  • Review the data load summary report. For more information about the location and contents of this summary report, see Verifying the results of the data load.
  • Review the data in your database and verify that the price list data exists in your database.
  • In Management Center, verify that you can view the price lists in the Catalog Filter and Pricing tool.