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:
  • Linuxutilities_root/samples/DataLoad/Catalog
  • HCL 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. HCL Commerce DeveloperOn a command line, go to the WCDE_installdir\bin directory.
  2. LinuxOpen a command line in the . Change the directory to utilities_root/bin directory. For information about entering and leaving containers, see Running utilities from the Utility server Docker container.
  3. Enter the following command for a non-ATP store:
    • Linux./dataload.sh ../samples/DataLoad/Catalog/IntegrateScenario/wc-dataload.XML
    • HCL Commerce Developerdataload ..\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:

    • Linux./dataload.sh ../samples/DataLoad/Catalog/IntegrateScenario/wc-dataload-ATP.xml
    • HCL Commerce Developerdataload ..\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.