Feature Pack 8

Sample: Loading updates for catalog entry descriptions

This sample demonstrates how to use the Data Load utility update mode to update descriptive information for existing catalog entries. In this sample, the short descriptions for existing products and SKUs are changed.

Before you begin

Ensure that you load the data that is in the following sample: When you load the following sample, the Data Load utility updates the short descriptions of products and SKUs that were loaded in the initial catalog data sample.

About this sample

The CatEntryDescriptionUpdate.csv file in this sample updates only the product and SKU short descriptions. You can include more information in the CatalogEntriesUpdate.csv file to update other descriptive information for catalog entries. For example, to update or add descriptions in other languages for catalog entries. Any field that is left without a value is unchanged by the Data Load utility when the utility runs in update mode for loading catalog entry data. For more information about the information that you can include in this file, see CatalogEntryDescription.

This sample loads the following catalog entry data:
Part Number Short description that is loaded within initial catalog data sample Updated short description that is loaded within this sample
Cords null Men's designer Garment-dyed, lightly textured pants
Cords-Black-29W x 28L Men's corduroy pants - Black 29 Width x 28 Length Men's designer Garment-dyed, lightly textured pants - Black 29W x 28L
You can load data for updating catalog entry data in CSV or XML formatted input files. The following procedure loads only CSV input files. The sample CSV input file, load order configuration file, and business object configuration file for this sample are in the following folder
  • SolarisLinuxAIXWC_installdir/samples/DataLoad/Catalog/CatalogEntryUpdate
  • WindowsWC_installdir\samples\DataLoad\Catalog\CatalogEntryUpdate
  • WebSphere Commerce DeveloperWCDE_installdir\samples\DataLoad\Catalog\CatalogEntryUpdate
The wc-dataload-env.xml file is in the Catalog folder, which contains the CatalogEntryUpdate folder.
The sample folder includes the following files:
CatEntryDescriptionUpdate.csv
The Data Load utility uses this sample input file to load the catalog entry descriptive data.
wc-loader-catalog-entry-description-update.xml
The business object configuration file for loading the catalog entry data. This file defines the appropriate business object mediator to use to load the data. The Data Load utility uses this configuration file and mediator to load the data in the CatEntryDescriptionUpdate.csv input file into the CATENTDESC database table.
wc-dataload-catalog-entry-description-update.xml
The data load order configuration file, which indicates that the Data Load utility is to run in update mode. This file identifies the CSV input file to load, the data load environment configuration file, and the business object configuration file to use to load the input CSV file data.
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.

Procedure

  1. Open a command-line utility and go to the appropriate directory:
    • SolarisLinuxAIXWC_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 that included in this sample:
    • SolarisLinuxAIX./dataload.sh ../samples/DataLoad/Catalog/CatalogEntryUpdate/wc-dataload-catalog-entry-description-update.xml
    • Windowsdataload.bat ..\samples\DataLoad\Catalog\CatalogEntryUpdate\wc-dataload-catalog-entry-description-update.xml
    • WebSphere Commerce Developerdataload ..\samples\DataLoad\Catalog\CatalogEntryUpdate\wc-dataload-catalog-entry-description-update.xml
The Data Load utility uses the wc-loader-catalog-entry-description-update.xml configuration file to update the product and SKU data that is in the database with the data that is in the CatEntryDescriptionUpdate.csv source file.

Verifying results

  • Verify that the catalog entry data is loaded by reviewing 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.
  • You can also verify that the sample data is loaded by running the following SQL statements against your WebSphere Commerce database:
    select * from catentdesc where catentry_id in (select catentry_id from catentry where partnumber like
    '%Cords%');
    This SQL statement returns the description information for the product and SKU that is updated in this sample. Ensure that the value for the short description column is updated with the data that you loaded in this sample. The values for all other columns should remain unchanged.
  • In Management Center or the storefront, verify that you can view the catalog entry. Verify that the short description for the catalog entry is the updated short description from this sample and that all other information is unchanged.

Removing the sample data from the WebSphere Commerce database

To remove the sample data that you loaded in this sample from the database, run the CleanUp.sql file that is in the following folder:
  • SolarisLinuxAIXWC_installdir/samples/DataLoad/Catalog/IntegrateScenario
  • WindowsWC_installdir\samples\DataLoad\Catalog\IntegrateScenario
  • WebSphere Commerce DeveloperWCDE_installdir\samples\DataLoad\Catalog\IntegrateScenario

From a command prompt, connect to the database with your user ID and password. Run the following command.

Apache Derby
  • ij -f ..\components\foundation\samples\DataLoad\Catalog\IntegrateScenario\Cleanup.sql
DB2
  • SolarisLinuxAIXdb2 -tvf ../samples/DataLoad/Catalog/IntegrateScenario/Cleanup.sql
  • Windowsdb2 -tvf ..\samples\DataLoad\Catalog\IntegrateScenario\Cleanup.sql
Oracle
  • SolarisLinuxAIXsqlplus user_name/password@ database_name@ ../samples/DataLoad/Catalog/IntegrateScenario/Cleanup.sql
  • Windowssqlplus user_name/password@ database_name@ ..\samples\DataLoad\Catalog\IntegrateScenario\Cleanup.sql