Sample: Loading initial data

This sample demonstrates how to simultaneously load top categories, subcategories, products, SKUs, attributes, and prices. This data is typically the first data to be loaded to your store.

Note: This catalog sample can be loaded into your customer-facing store or into your catalog asset store as needed. If you load the data into your customer-facing store, such as an Aurora extended site store, then the these categories and products are owned and available in only the specified store. If you load the data into your catalog asset store, such as your extended sites catalog asset store, these categories and products are shared among all extended site stores that inherit from the catalog asset store.

About this sample

This sample loads initial data from the samples directory and its sub directories:
  • LinuxAIXWindowsWC_installdir/samples/DataLoad/Catalog
  • WebSphere Commerce DeveloperWCDE_installdir\samples\DataLoad\Catalog
This sample loads the following categories:
  • Men's fashions (top category)
  • Women's fashions (top category)
  • Pants (subcategory of Men's fashions)
  • Shirts (subcategory of Men's fashions)
  • Activeware (subcategory of Women's fashions)
  • Accessories (subcategory of Women's fashions)
The sample also loads defining attributes, allowed values, attribute values, list prices, and offer prices. Products are created automatically when you load the SKU and attribute data.
Note: If your site uses SEO and plans to load SEO URLs for catalog entries with the Data Load utility, configure the Data Load utility to load SEO information. In the load order configuration file, you must include the loadSEO parameter with a value set to be "true". This parameter must be set within the data load order configuration file with the following format:
<_config:property name="loadSEO" value="true"/>

Procedure

  1. Open the command-line interface and go to the following directory:
    • WC_installdir/bin
    • WebSphere Commerce DeveloperWCDE_installdir\bin
  2. Enter the following command for a non-ATP store:
    • LinuxAIX./dataload.sh ../samples/DataLoad/Catalog/IntegrateScenario/wc-dataload.xml
    • WebSphere Commerce DeveloperWindowsdataload ..\samples\DataLoad\Catalog\IntegrateScenario\wc-dataload.xml
    Note: If you prefer to work with data in XML format instead of in CSV format, you can edit the wc-dataload.xml file and change the location to reference the xml files provided.

    Alternatively for an ATP store, enter the following command:

    • LinuxAIX./dataload.sh ../samples/DataLoad/Catalog/IntegrateScenario/wc-dataload-ATP.xml
    • WebSphere Commerce DeveloperWindowsdataload ..\samples\DataLoad\Catalog\IntegrateScenario\wc-dataload-ATP.xml
    Note: If you prefer to work with data in XML format instead of in CSV format, you can edit the wc-xdataloadATP.xml file and change the location to reference the XML files provided.

Verifying results

The wc-dataload.xml configuration file calls the wc-loader-catalog-group.xml configuration file (in the parent directory) to load the categories from the CatalogGroup.csv source file. The wc-dataload.xml file then calls the wc-loader-catalog-entry-item.xml, wc-loader-catalog-entry-offerprice.xml, and the item attributes configuration files (wc-loader-bodysuit-attribute.xml, wc-loader-casual-shirt-attribute.xml, wc-loader-cords-attribute.xml, wc-loader-dress-pants-attribute.xml, wc-loader-dress-shirt-attribute.xml) to load SKUs from the various items source files:
  • BodysuitsWithAttributesPrice.csv
  • CasualShirtsWithAttributesPrice.csv
  • CordsWithAttributesPrice.csv
  • DressPantsWithAttributesPrice.csv
  • DressShirtsWithAttributesPrice.csv
  • ItemsWithAttributesPrice.csv
Verify that the data is loaded by running the following SQL statements:
  • To return all categories that were loaded, enter:
    select * from catgroup where identifier in ('Mens Fashions','Womens Fashions','Pants','Shirts','Activewear',
    'Accessory')
  • To return a product with the part number 'Cords' and the associated SKUs, enter:
    select * from catentry where partnumber like 'Cords%'
  • To return the attributes and values of the SKU with the part number 'Cords-Black-29W x 28L', enter:
    select * from attrvalue where catentry_id in (select catentry_id from catentry where partnumber 
    ='Cords-Black-29W x 28L')
  • To return the offer price of the SKU with the part number 'Cords-Black-29W x 28L', enter:
    select * from offerprice where offer_id in (select offer_id from offer where catentry_id 
    = (select catentry_id from catentry where partnumber ='Cords-Black-29W x 28L'))

You can also verify the load by viewing the data in the Management Center or in the storefront.

Updating the data

After you load the sample data, you can update the data by changing the content of the CSV files and running the sample again. You can also update the data by logging in to the Management Center and by using the Catalogs tool.

Cleaning up the data

To remove the data that is loaded in this sample from the database, run the CleanUp.sql file in the /samples/DataLoad/Catalog/IntegrateScenario directory.
Note: After you run the CleanUp.sql file, you might see that 0 rows are deleted for certain SQL statements. This result is expected, as not all rows are populated with data in this sample.