Example: Catalog entry merchandising associations
You can use the Data Load utility to replace, or delete multiple catalog entry merchandising associations at the same time.
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.
CSV column and XML element definitions
- PartNumber
- (Required, String) The unique part number that is used to identify the source catalog entry in the association. This field cannot be null. The part number for a catalog entry displays in Management Center as the value for the catalog entry Code property.
- AssociationType
- (Required, String) The type of merchandising association you
want to use. The available values are
CrossSell, UpSell, Accessory,
, andReplacement
. This field cannot be null. - TargetPartNumber
- (Required, String) The unique part number that is used to identify the target catalog entry in the association. This field cannot be null.
- TargetStoreIdentifier
- (String) The unique identifier of the store the target catalog entry belongs to. If the TargetStoreIdentifier is not provided in the CSV source file, then the StoreIdentifier in the context data is used.
- Sequence
- (Decimal) The order in which the merchandising associations are displayed.
- SemanticSpecifier
- (Required, String) The semantic specifier of the merchandising
association. Examples of semantic specifiers are
comes_with, none, requires
, ortemp
. This field cannot be null. - Quantity
- (double) The quantity of target catalog entries that are associated to the source. For example, if the source catalog entry is a camera, and the target catalog entry is the type of battery it uses, the quantity indicates the number of batteries required.
- Delete
- (String) A flag indicating whether to delete. Specify
1
to delete the row.
Other optional fields not included in the example are:
- Field1
- (String) A user-defined field available for merchandising association customization purposes.
- Field2
- (Integer) A user-defined field available for merchandising association customization purposes.
- Field3
- (Decimal) A user-defined field available for merchandising association customization purposes.
- Date1
- (Timestamp) A user-defined field available for merchandising association customization purposes.
CSV file with sample catalog entry merchandising associations
Insert or replace
In this example, the CSV file contains sample catalog entry merchandising association data. Each column is delimited by a comma. CSV file with sample catalog entry merchandising association data.
PartNumber | AssociationType | TargetPartNumber | TargetStoreIdentifier | Sequence | SemanticSpecifier | Quantity |
---|---|---|---|---|---|---|
Example-PN-10001 | UpSell | Example-PN-10004 | ExampleTargetB2BStore | 1 | NONE | 23 |
Example-PN-10002 | Accessory | Example-PN-10005 | ExampleTargetB2BStore | 2 | NONE | 11 |
PartNumber | AssociationType | TargetPartNumber | TargetStoreIdentifier | Sequence | SemanticSpecifier | Quantity | Delete |
---|---|---|---|---|---|---|---|
Example-PN-10001 | UpSell | Example-PN-10004 | ExampleTargetB2BStore | 1 | NONE | 23 | 1 |
Example-PN-10002 | Accessory | Example-PN-10005 | ExampleTargetB2BStore | 2 | NONE | 11 | 1 |
Mapping data
<_config:DataMapping>
<_config:mapping xpath="CatalogEntryIdentifier/ExternalIdentifier/PartNumber" value="PartNumber" />
<_config:mapping xpath="Association/Name" value="AssociationType" />
<_config:mapping xpath="Association/CatalogEntryReference/CatalogEntryIdentifier/ExternalIdentifier/PartNumber" value="TargetPartNumber" />
<_config:mapping xpath="Association/CatalogEntryReference/CatalogEntryIdentifier/ExternalIdentifier/StoreIdentifier/ExternalIdentifier/NameIdentifier" value="TargetStoreIdentifier" />
<_config:mapping xpath="Association/displaySequence" value="Sequence" />
<_config:mapping xpath="Association/semantic" value="SemanticSpecifier" />
<_config:mapping xpath="Association/quantity" value="Quantity" />
<_config:mapping xpath="Association/Attributes/field1" value="Field1" />
<_config:mapping xpath="Association/Attributes/field2" value="Field2" />
<_config:mapping xpath="Association/Attributes/field3" value="Field3" />
<_config:mapping xpath="Association/Attributes/date1" value="Date1" />
<_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.CatalogEntryAssociationMediator.