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


Example: Attribute dictionary attribute values

The example shows how to insert, replace, or delete values for multiple attribute dictionary attributes.


CSV file column definitions

AttributeIdentifier

(Mandatory, String) The attribute identifier. Either this field or the AttributeUniqueId is mandatory.

AttributeUniqueId

(Mandatory, BigInt) The internal unique reference number of the attribute. Either this field or the Identifier is mandatory.

Type

(String) This field defines the data type of the attribute. This field cannot be NULL. Examples of data types are STRING, INTEGER, and FLOAT.

ValueIdentifier

(String) The identifier of the attribute value.

Usage

(Integer)

1

Predefined allowed value. For example, an allowed value for Color might be Blue.

null

Assigned value. For example, the Length attribute might not have allowed values.

Sequence

(Double) A number used to determine the display order of a list of allowable attribute values for a given attribute.

Value

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

Image1

(String) The image path of this attribute value. 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 image path of this attribute value. 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:

Field1

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

Field2

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

Field3

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

UnitOfMeasure

The unit in which this attribute value is measured.


CSV file with sample attribute dictionary attribute values data


Insert or replace

In this example, the CSV file contains attribute dictionary attribute values. CSV file with sample attribute dictionary attribute values. Due to the large amount of fields in the CSV file, the table has been split into 2 sections:

Formatted CSV file with column headings
AttributeIdentifier Type ValueIdentifier Usage
ShirtSize string Shrit_Size_Large 1
ShirtColor string Shirt_Color_Red 1

Formatted CSV file with column headings - continued
Sequence Value Image1 Image2
2 Large Shirt_size_large/image1.jpg Shirt_size_large/image2.jpg
6 Red Shirt_color_red/image1.jpg Shirt_color_red/image2.jpg


Delete

In this example, the CSV file contains sample attribute dictionary attribute values that will be deleted. CSV file with sample attribute dictionary attribute values. Due to the large amount of fields in the CSV file, the table has been split into 2 sections:

Formatted CSV file with column headings
AttributeIdentifier Type ValueIdentifier Usage
ShirtSize string Shrit_Size_Large 1
ShirtColor string Shirt_Color_Red 1

Formatted CSV file with column headings - continued
Sequence Value Image1 Image2 Delete
2 Large Shirt_size_large/image1.jpg Shirt_size_large/image2.jpg 1
6 Red Shirt_color_red/image1.jpg Shirt_color_red/image2.jpg 1


Map data

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

<_config:DataMapping>     <_config:mapping xpath="AttributeIdentifier/ExternalIdentifier/Identifier" value="Identifier" valueFrom="InputData"/>     <_config:mapping xpath="AttributeIdentifier/UniqueID" value="AttributeUniqueId" valueFrom="InputData"/>     <_config:mapping xpath="AllowedValue/identifier" value="ValueIdentifier" valueFrom="InputData" />     <_config:mapping xpath="AllowedValue/displaySequence" value="Sequence" valueFrom="InputData" />     <_config:mapping xpath="AllowedValue/Value" value="Value" valueFrom="InputData" />     <_config:mapping xpath="AllowedValue/ExtendedValue/ValueUsage" value="ValueUsage" valueFrom="InputData" />     <_config:mapping xpath="AllowedValue/ExtendedValue/Image1" value="Image1" valueFrom="InputData" />     <_config:mapping xpath="AllowedValue/ExtendedValue/Image2" value="Image2" valueFrom="InputData" />     <_config:mapping xpath="AllowedValue/ExtendedValue/Field1" value="Field1" valueFrom="InputData" />     <_config:mapping xpath="AllowedValue/ExtendedValue/Field2" value="Field2" valueFrom="InputData" />     <_config:mapping xpath="AllowedValue/ExtendedValue/Field3" value="Field3" valueFrom="InputData" />     <_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 AttributeDictionaryAttributeMediator.


+

Search Tips   |   Advanced Search