Example: Relationship data for catalog entries and categories

We can use the Data Load utility to create, update, or delete the parent-child relationship between categories and catalog entries for both the master catalog or a sales catalog.

This example uses a CSV file to demonstrate how to insert, replace, or delete your data. We can also create and use an XML formatted file to insert, replace, or delete your data. If you choose to create and use an XML formatted file, ensure that your XML elements use the same names as are used for CSV column names.

A relationship exists between your sales categories and any SKUs associated with catalog entries in your sales categories. When we are adding or removing the relationship between a parent category and a child product, any child SKUs for the product must first be added to, or removed from, the parent category. If you do not add or remove the child SKUs, searching for, or displaying, the SKUs in Management Center or the storefront might not function correctly. To add or remove the child SKUs, follow the same steps as for adding or removing catalog entries to or from a category.

If we are using loading sales categories, products, relationships between categories and catalog entries, and SKUs to be associated with the products, we must load your data in a specific order. If you load your data in an incorrect order, your products might not display for sale correctly in the storefront. We must ensure that you load your categories and catalog entries before you load the relationships between these categories and catalog entries. We must also load the relationship between your categories and catalog entries before you load SKUs for products that are within a sales category. For example, we can load you sales catalog data in the following order

  1. Products

  2. Categories

  3. Category - Product relationships

  4. SKUs


CSV column and XML element definitions


CSV file with sample catalog entry and category relationship data

Update In this example, the CSV file contains sample catalog entry and category relationship data. Each column is delimited by a comma. CSV file with sample catalog entry and category relationship data.

Formatted CSV file with column headings
PartNumber Sequence ParentGroupIdentifier
'AuroraWMDRS-1' 1 10006
'AuroraWMDRS-4' 1 10006

Delete

In this example, the CSV file contains sample catalog entry and category relationship data for deletion. CSV file with sample catalog entry and category relationship data for deletion.

Formatted CSV file with column headings
PartNumber Sequence ParentPartNumber Delete
'AuroraWMDRS-2' 1 10006 1
'AuroraWMDRS-3' 1 10006 1


Mapping data

The following code snippet demonstrates how to map each value to a business object logical schema path. This code snippet is from the wc-loader-catalog-entry-parent-catalog-group.xml catalog entry category relationship loader configuration file.

If you perform an insert or replace operation, do not specify the "Delete" column in the CSV file or we can leave the "Delete" column empty.


Business object mediator

The mediator class name is CatalogEntryParentCatalogGroupMediator.

Note: When we use a mediator that is provided with WebSphere Commerce with the Data Load utility, the utility assumes that we are loading data for all columns for a business object. To update the data in only specific columns, configure a column exclusion list for the load process. A column exclusion list causes the Data Load utility to ignore specific columns during the load operation. If you do not use a column exclusion list, the utility updates all columns in the row of a database table row when the utility updates the row. If no value is set in the input file, the utility can replace the existing column value with a default value or set the value to be null. See Configure a column exclusion list.