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


Example: Catalog entry descriptive attributes and attribute values

You can insert, replace, or delete descriptive attributes and attribute values data using the data load utility. These examples uses a CSV file to demonstrate how to insert, replace, or delete the descriptive attributes and attribute values data.


CSV file column definitions

PartNumber

(Mandatory, String) The catalog entry identifier (product or SKU). Either this field or the CatalogEntryUniqueId is mandatory.

CatalogEntryUniqueId

(Mandatory, BigInt) The unique reference number of the catalog entry (product or SKU). Either this field or the PartNumber is mandatory.

Type

(String) The data type of the attribute, such as string, integer or float. This filed is mandatory and cannot be NULL.

Name

(String) The name of this attribute. This field is language sensitive.

Sequence

(Double) A sequence number used to control the order in which attributes are displayed in a product. This value cannot be NULL. The default value = 0.

Description

(String) A description of this attribute. This field is language sensitive.

SecondaryDescription

(String) A secondary description of this attribute. This field is language sensitive.

GroupName

(String) The name of the attribute group this attribute belongs to.

Field1

(String) A customizable field for this attribute.

Footnote

(String) Additional attribute data such as a footnote.

ValueName

(String) The name of this attribute value. This field is language sensitive.

Value

(String|Integer|Float) The value of the attribute.

Image1

(String) The path of the first image of the attribute. This field is language sensitive. The forward slash '/' should be used in the path. Do not use backward slash '\'. For example, images/G1.jpg.

Image2

(String) The path of the second image of the attribute. This field is language sensitive. The forward slash '/' should be used in the path. Do not use backward slash '\'. For example, images/G1.jpg .

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:

ValueField1

(Integer) A customizable field for this attribute.

ValueField2

(String) A customizable field for this attribute.

ValueField3

(String) A customizable field for this attribute.

UnitOfMeasure

(String) The unit in which this attribute value is measured.

AttachmentID

(Integer) The reference number of an attachment that is associated with the attribute value.


CSV file with sample catalog entry descriptive attribute data


Insert or replace

In this example, the CSV file contains sample catalog entry descriptive attribute and attribute value data: CSV file with sample catalog entry descriptive attribute data. The formatted CSV file, divided into three sections, is shown in the following tables:

Formatted CSV file with column headings
PartNumber Type Name Sequence Description
Example-PN-10001 String WashMethod 1 Wash method
Example-PN-10002 String WashMethod 2 Wash method

Formatted CSV file with column headings - continued
SecondaryDescription GroupName Field1 Footnote
  Clothing A A
  Clothing B B

Formatted CSV file with column headings - continued
ValueName Value Image1 Image2
dryCleanOnly Dry clean only dry_clean_1/image.jpg dry_clean_2/image.jpg
handWashable Hand Washable handwash_thumb1/image.jpg handwash_thumb2/image.jpg


Delete

In this example, the CSV file contains sample catalog entry descriptive attribute and attribute value data to delete. CSV file with sample catalog entry descriptive attribute data.

Formatted CSV file with column headings
PartNumber Type Name Sequence Description
Example-PN-10001 String WashMethod 1 Wash method
Example-PN-10002 String WashMethod 2 Wash method

Formatted CSV file with column headings - continued
SecondaryDescription GroupName Field1 Footnote
  Clothing A A
  Clothing B B

Formatted CSV file with column headings - continued
ValueName Value Image1 Image2 Delete
dryCleanOnly Dry clean only dry_clean_1/image.jpg dry_clean_2/image.jpg 1
handWashable Hand Washable handwash_thumb1/image.jpg handwash_thumb2/image.jpg 1


Map data

The following code snippet from the catalog entry descriptive attributes 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" valueFrom="InputData"/>     <_config:mapping xpath="CatalogEntryIdentifier/UniqueID" value="CatalogEntryUniqueId" valueFrom="InputData"/>     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/AttributeIdentifier/UniqueID" value="AttributeUniqueId" valueFrom="InputData"/>     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/AttributeDataType" value="Type" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/Name" value="Name" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/usage" value="Descriptive" valueFrom="Fixed" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/displaySequence" value="Sequence" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/Description" value="Description" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/ExtendedData/SecondaryDescription" value="SecondaryDescription" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/ExtendedData/DisplayGroupName" value="GroupName" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/ExtendedData/Field1" value="Field1" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/ExtendedData/Footnote" value="Footnote" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/ExtendedData/UnitOfMeasure" value="UnitOfMeasure" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/AllowedValue/identifier" value="Value" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/AllowedValue/Value" value="Value" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/AllowedValue/ExtendedValue/Image1" value="Image1" valueFrom="InputData"/>     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/AllowedValue/ExtendedValue/Image2" value="Image2" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/AllowedValue/ExtendedValue/Field1" value="ValueField1" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/AllowedValue/ExtendedValue/Field2" value="ValueField2" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/AllowedValue/ExtendedValue/Field3" value="ValueField3" valueFrom="InputData" />     <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/AllowedValue/ExtendedValue/AttachmentID" value="AttachmentID" valueFrom="InputData" />     <_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 CatalogEntryAttributeMediator.


+

Search Tips   |   Advanced Search