Samples > Data load utility samples > Examples: Mapping data > Examples: Mapping catalog data > Examples: Mapping category data


Example: Category merchandising associations

You can use the data load utility to insert, replace, or delete multiple category merchandising associations at the same time. These examples uses a CSV file to demonstrate how to insert, replace, or delete category merchandising associations.


CSV file column definitions

GroupIdentifier

(Mandatory, string) The category identifier. This field cannot be null, and it must be unique.

AssociationType

(Mandatory, string) Use this field to indicate the type of association wanted. This field cannot be null. The default association options are CrossSell, UpSell, Accessory, and Replacement.

TargetGroupIdentifier

(Mandatory, string) The identifier of the category that is the target of the association.

Sequence

(Double) An optional number used to control the order in which the category merchandising associations are displayed.

SemanticSpecifier

(Mandatory, string) The semantic specifier to use for this merchandising association. This field cannot be null. Examples of semantic specifiers are comes_with, none, requires, or temp.

Quantity

(Double) The quantity of the association.

Date1

(Timestamp) A customizable field of timestamp type.

Delete

(String) Indicates whether to delete. If you are performing a delete operation, specify this column. A value of "1", indicates that the row should be deleted.

Other optional fields not included in the example are:

StoreIdentifier

(String) The identifier of the store the source category belongs to. This column is only needed if the source category belongs to a store which is different from the store defined in BusinessContext element of either the wc-dataload.xml configuration file or the catalog association loader configuration file. If this column is not provided in the CSV file, the StoreIdentifier in the business context will be used.

TargetStoreIdentifier

(String) The identifier of the store the target category belongs to. This column is only needed if the target category belongs to a store which is different from the store defined in BusinessContext element of either the wc-dataload.xml configuration file or the catalog association configuration file. If this column is not provided in the CSV file, the StoreIdentifier in the business context will be used.

Field 1

(String) A user defined field available for customization purposes.

Field 2

(Integer) A user defined field available for customization purposes.

Field 3

(Decimal) A user defined field available for customization purposes.


CSV file with sample category merchandising association data


Insert or replace

In this example, the CSV file contains sample category merchandising association data. Each column is delimited by a comma. CSV file with sample category merchandising association data.

Formatted CSV file with column headings
GroupIdentifier AssociationType TargetGroupIdentifier Sequence SemanticSpecifier Quantity Date1
TV_category CrossSell DVD_category 2 REQUIRES 1 2008-06-22 05.00.00
CRT_category UpSell LCD_category 1 COMES_WITH 1 2008-06-22 05.00.00


Delete

In this example, the CSV file contains sample category merchandising association data. The first row of data will be deleted. CSV file with sample category merchandising association data.

Formatted CSV file with column headings
GroupIdentifier AssociationType TargetGroupIdentifier Sequence SemanticSpecifier Quantity Date1 Delete
TV_category CrossSell DVD_category 2 REQUIRES 1 2008-06-22 05.00.00 1
CRT_category UpSell LCD_category 1 COMES_WITH 1 2008-06-22 05.00.00  


Map data

The following code snippet from the catalog association loader configuration file demonstrates how to map each value to a business object logical schema path.

<_config:DataMapping>     <_config:mapping xpath="CatalogGroupIdentifier/UniqueID" value="GroupUniqueId" />     <_config:mapping xpath="CatalogGroupIdentifier/ExternalIdentifier/GroupIdentifier" value="GroupIdentifier" />     <_config:mapping xpath="CatalogGroupIdentifier/ExternalIdentifier/StoreIdentifier/ExternalIdentifier/NameIdentifier" value="StoreIdentifier" valueFrom="DataSourceData" />     <_config:mapping xpath="Association/Name" value="AssociationType" />     <_config:mapping xpath="Association/CatalogGroupReference/CatalogGroupIdentifier/UniqueID" value="TargetGroupUniqueId" />     <_config:mapping xpath="Association/CatalogGroupReference/CatalogGroupIdentifier/ExternalIdentifier/GroupIdentifier" value="TargetGroupIdentifier" />     <_config:mapping xpath="Association/CatalogGroupReference/CatalogGroupIdentifier/ExternalIdentifier/StoreIdentifier/ExternalIdentifier/NameIdentifier" value="TargetStoreIdentifier" valueFrom="DataSourceData" />     <_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" valueFrom="InputData" deleteValue="1"/>
</_config:DataMapping>

If you are performing 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 CatalogGroupAssociationMediator.


+

Search Tips   |   Advanced Search