Sample: Loading attributes, attribute values, and allowed values

This sample demonstrates how to load attributes together with the associated allowed values and attribute values in a single load operation. If we use an attribute dictionary, see Sample: Loading attribute dictionary data.


About this sample

Part numbers, attributes, and attribute values loaded in this sample.
Attribute Identifier Attribute type Attribute Value 1 Attribute Value 2
CordsColor Defining attribute Black Brown
CordsSize Defining attribute 29W x 28L
DressPantColor Defining attribute Black Blue
DressPantSize Defining attribute 29W x 32L
DressShirtColor Defining attribute White
DressShirtSize Defining attribute 15 16
CasualShirtColor Defining attribute White Blue
CasualShirtSize Defining attribute Small Medium
BodysuitColor Defining attribute Black
BodysuitSize Defining attribute Petit


Procedure

  1. (Developer) On a command line, go to the WCDE_installdir\bin directory.

  2. (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.

  3. Load the products and SKUS:For non-ATP store:

    • (Linux) ./dataload.sh ../samples/DataLoad/Catalog/wc-dataload-catalog-entry.XML

    • (Developer) dataload ..\samples\DataLoad\Catalog\wc-dataload-catalog-entry.XML

    For ATP store:

    • (Linux) ./dataload.sh ../samples/DataLoad/Catalog/wc-dataload-ATP-catalog-entry.XML

    • (Developer) dataload ..\samples\DataLoad\Catalog\wc-dataload-ATP-catalog-entry.XML

  4. Load attributes, allowed values, and specific values for the SKUs:

    • (Linux) ./dataload.sh ../samples/DataLoad/Catalog/CatalogEntryAttribute/wc-dataload.xml

    • (Developer) dataload ..\samples\DataLoad\Catalog\CatalogEntryAttribute\wc-dataload.xml

  5. Optional: Load attributes and allowed values in other national languages. For example, to load attributes and allowed values in French:

    • (Linux) ./dataload.sh ../samples/DataLoad/Catalog/CatalogEntryAttribute/wc-dataload-attribute-multi-langs.xml

    • (Developer) dataload ..\samples\DataLoad\Catalog\CatalogEntryAttribute\wc-dataload-attribute-multi-langs.xml


Verifying results

The wc-dataload.xml configuration file loads attribute data from the CatalogEntryDefiningAttributeAndAllowedValue.csv source file. The file is used to create the attributes and the range of allowed values for the products. The wc-dataload.xml file then calls the wc-loader-catalog-entry-defining-attribute-value.xml configuration file to load the specific attribute values to each SKU from the CatalogEntryDefiningAttributeValue.csv source file.Verify that the data is loaded by running the following SQL statements:

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


Cleaning up the data

To remove the data loaded in this sample from the database, run the CleanUp.sql file in the /samples/DataLoad/Catalog/CatalogEntryAttribute directory.