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


Example: Relationship data for SKUs and products

Use the data load utility to efficiently replace, or delete existing relationship data between multiple products and SKUs.


CSV file column definitions

PartNumber

Required: (String) The unique part number of this catalog entry. This field is cannot be NULL and it must be unique.

Sequence

(Double) An optional number used to control the order in which the items appear under the parent product.

ParentPartNumber

Required: (String) The catalog entry identifier of the parent product of the SKU.

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:

ParentToChildCatEntryRelField1

(String) A user defined field available for customization of the parent product to child SKU relationship.

ParentToChildCatEntryRelField2

(Integer) A user defined field available for customization of the parent product to child SKU relationship.

ParentToChildCatEntryRelField3

(Double) A user defined field available for customization of the parent product to child SKU relationship.


CSV file with sample product and SKU relationship data


Replace

In this example, the CSV file contains sample SKU and product relationship data. Each column is delimited by a comma. CSV file with sample product and SKU relationship data.

Formatted CSV file with column headings
PartNumber Sequence ParentPartNumber
230092 1 3004
230093 2 3004


Delete

In this example, the CSV file contains sample SKU and product relationship data that will be deleted. CSV file with sample product and SKU relationship data.

Formatted CSV file with column headings
PartNumber Sequence ParentPartNumber Delete
230092 1 3004 1
230093 2 3004 1


Map data

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

<_config:DataMapping>     <_config:mapping xpath="CatalogEntryIdentifier/ExternalIdentifier/PartNumber" value="PartNumber" />     <_config:mapping xpath="ParentCatalogEntryIdentifier/ExternalIdentifier/PartNumber" value="ParentPartNumber" />     <_config:mapping xpath="displaySequence" value="Sequence" />     <_config:mapping xpath="" value="Delete" 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 CatalogEntryParentProductMediator.


+

Search Tips   |   Advanced Search