Sample: Loading offer price data into price lists
This sample demonstrates how to load offer prices into price lists with the Data Load utility. After you load the data, Management Center users can view and manage the offer prices in the Catalog Filter and Pricing tool.
About this sample
When you load the data within this sample, we are populating existing WebSphere Commerce price lists with offer prices. This sample does not load data to create the price lists. For a sample that does load the data to create the price lists that we are loading offer prices into with this sample, see Sample: Loading price list data. The CSV input file and Data Load utility configuration files for this sample are in the following directory:
- (Linux) utilities_root/samples/DataLoad/Price/Offer
(Developer) WCDE_installdir\samples\DataLoad\Price\Offer
The Data Load utility environment configuration file, wc-dataload.env.xml, is in the parent directory called Price.
Note: We can also load data for offer prices 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 we 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.
Sample input file Description Offer.csv For more information about the type of data that we can include in this input file, see Offer price list input file
The Data Load utility uses this sample input file to load the offer price data into price lists for catalog entries. After the utility loads the data, the offer price data is 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.OfferMediator
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 each input file. For more information about load order configuration files, see Configure the data load order.
- wc-dataload-env.xml
- The data load environment configuration file, which includes the environment variables for the 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 the store.
- Database environment settings, including the database type, name, and schema.
- wc-loader-offer.xml
- The business object configuration file that defines how the offer price 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 the environment settings are different, change the configured values in these files to match the environment.
Procedure
(Developer) On a command line, go to the WCDE_installdir\bin directory.
- (Linux) Open a command line in the Utility server Docker container. Change the directory to utilities_root/bin directory.
For information about entering and leaving containers, see Running utilities from the Utility server Docker container.- Enter the following command to run the sample data load order file and load the information that included in this sample:
- (Linux) ./dataload.sh ../samples/DataLoad/Price/Offer/wc-dataload.xml
(Developer) dataload ..\samples\DataLoad\Price\Offer\wc-dataload.xml
Verifying results
To verify that the utility loaded the offer price 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 the database and verify that the offer price data in your input file exists in the database.
- In Management Center, verify that we can view the offer prices within the appropriate price lists in the Catalog Filter and Pricing tool.