Example: Relationship data for catalog entries and categories
You 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. You 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 that are associated with catalog entries in your sales categories. When you 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 your 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.
- Products
- Categories
- Category - Product relationships
- SKUs
CSV column and XML element definitions
- PartNumber
- (String) The part number of the catalog entry. Either this field or the CatalogEntryUniqueId is required. The part number for a catalog entry displays in Management Center as the value for the catalog entry Code property.
- CatalogEntryUniqueId
- (Integer) The internal unique reference number of the catalog entry. Either this field or the PartNumber is required.
- ParentGroupIdentifier
- (String) The identifier of the parent category. Either this field or the ParentGroupUniqueId is required.
- ParentGroupUniqueId
- (Integer) The unique reference number of the parent category. Either this field or the ParentGroupIdentifier is required.
- ParentStoreIdentifier
- (String) The identifier of the store that owns the parent category. Use this field when your site uses the extended sites model, where the store that owns the parent category is different from the store that owns the catalog entry.
- ParentStoreUniqueId
- (Integer) The unique reference number of the store that owns the parent category.
- Sequence
- (Decimal) An optional number that is used to control the order in which the catalog entry appears in the parent category.
- Delete
- (String) A flag that indicates whether to delete. Specify
1
to delete the row.
CSV file with sample catalog entry and category relationship data
Update
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.
PartNumber | Sequence | ParentPartNumber | Delete |
---|---|---|---|
'AuroraWMDRS-2' | 1 | 10006 | 1 |
'AuroraWMDRS-3' | 1 | 10006 | 1 |
Mapping data
<_config:DataMapping>
<_config:mapping xpath="CatalogEntryIdentifier/UniqueID" value="CatalogEntryUniqueId" />
<_config:mapping xpath="CatalogEntryIdentifier/ExternalIdentifier/PartNumber" value="PartNumber" />
<_config:mapping xpath="ParentCatalogGroupIdentifier/UniqueID" value="ParentGroupUniqueId" />
<_config:mapping xpath="ParentCatalogGroupIdentifier/ExternalIdentifier/GroupIdentifier" value="ParentGroupIdentifier" />
<_config:mapping xpath="ParentCatalogGroupIdentifier/ExternalIdentifier/StoreIdentifier/UniqueID" value="ParentStoreUniqueId" />
<_config:mapping xpath="ParentCatalogGroupIdentifier/ExternalIdentifier/StoreIdentifier/ExternalIdentifier/NameIdentifier" value="ParentStoreIdentifier" />
<_config:mapping xpath="displaySequence" value="Sequence" />
<_config:mapping xpath="" value="Delete" deleteValue="1" />
</_config:DataMapping>
If you perform an insert or
replace operation, do not specify the "Delete" column in the CSV file
or you can leave the "Delete" column empty.Business object mediator
The mediator class name is com.ibm.commerce.catalog.dataload.mediator.CatalogEntryParentCatalogGroupMediator.