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 sample contains data for the Madisons
starter store. This sample does not work if you are using a different
starter store.
About this sample
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)
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
- Copy the Data Load utility loader file samples
to the samples directory for feature enabled sites. If your site uses
features that are available with WebSphere Commerce Feature Packs,
such as Solr search indexing, the new list price implementation, or
other features, use these directories for your Data Load utility samples.
- Navigate to the following directory that contains sample Data
Load utility loader files:
- WC_installdir/components/foundation/samples/DataLoad/Catalog
- WCDE_installdir\components\foundation\samples\DataLoad\Catalog
- Copy the wc-loader-catalog-entry.xml loader file.
- Navigate to and paste your copied loader file into the following
directory:
- WC_installdir/samples/DataLoad/Catalog
- WCDE_installdir\samples\DataLoad\Catalog
- Navigate to the following directory that contains sample Data
Load utility integrate scenario files:
- WC_installdir/components/foundation/samples/DataLoad/Catalog/IntegrateScenario
- WCDE_installdir\components\foundation\samples\DataLoad\Catalog\IntegrateScenario
- Copy all of the files within this IntegrateScenario directory.
- Navigate to and paste your copied files into the following directory:
- WC_installdir/samples/DataLoad/Catalog/IntegrateScenario
- WCDE_installdir\samples\DataLoad\Catalog\IntegrateScenario
- Navigate to the following directory that contains sample Data
Load utility loader files:
- Open the command-line interface and navigate to the appropriate
directory:
- WC_installdir/bin
- WCDE_installdir\bin
- Enter the following command for a non-ATP store:
- ./dataload.sh ../samples/DataLoad/Catalog/IntegrateScenario/wc-dataload.xml
- dataload ..\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:
- ./dataload.sh ../samples/DataLoad/Catalog/IntegrateScenario/wc-dataload-ATP.xml
- dataload ..\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.