Samples > Data load utility samples > Examples: Mapping data > Examples: Mapping catalog data > Examples: Mapping catalog entry data
Example: Catalog entry and attribute dictionary attribute values
Use the data load utility to insert, replace, and delete relationship between catalog entry and attribute dictionary attribute values simultaneously.
CSV file column definitions
- PartNumber
- (Mandatory, String) The catalog entry identifier (SKU). Either this field or the CatalogEntryUniqueId is mandatory.
- CatalogEntryUniqueId
- (Mandatory, BigInt) The internal unique reference number of the catalog entry (SKU). Either this field or the PartNumber is mandatory.
- 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 AttributeIdentifier is mandatory.
- ValueIdentifier
- (String) The attribute value identifier.
- Usage
- (String) The usage of the attribute in relation to the catalog entry. It is null or '1' for sku resolution, '2' for descriptive attribute. '0' through '9' are reserved for IBM internal use.
- Sequence
- (Double) A number that determines the display order of an attribute for a given catalog entry.
- 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.
CSV file with sample attribute dictionary attribute and value data
In this example, the CSV file contains attribute dictionary data.
PartNumber AttributeIdentifier ValueIdentifier Shirt-Red-Large ShirtColor Red Shirt-Red-Large ShirtSize Large
Map data
The following code snippet from the catalog entry and attribute relationship load 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/ExternalIdentifier/Identifier" value="AttributeIdentifier" valueFrom="InputData"/> <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/AttributeIdentifier/UniqueID" value="AttributeUniqueId" valueFrom="InputData"/> <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/Value/identifier" value="ValueIdentifier" valueFrom="InputData" /> <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/Value/value" value="Value" /> <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/usage" value="Usage" valueFrom="InputData" /> <_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/displaySequence" value="Sequence" 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 data load framework provides a business object mediator for inserting, replacing, and deleting relationship between catalog entries and attribute dictionary attributes. The mediator class name is CatalogEntryAttributeDictionaryAttributeMediator.