Example: Catalog entry and attribute dictionary attribute values (multiple attributes per CSV line)
Use the Data Load utility to insert, replace, and delete relationship between catalog entry and attribute dictionary attribute values simultaneously. This example differs from the previous one in that multiple attributes are specified per CSV line
This example uses a CSV file to demonstrate how to insert, replace, or delete your data. You can also create and use an XML formatted file to insert, replace, or delete your data. If you choose to create and use an XML formatted file, ensure that your XML elements use the same names as are used for CSV column names.
CSV column and XML element definitions
- PartNumber
- (Mandatory, String) The catalog entry identifier (SKU). Either this field or the CatalogEntryUniqueId is mandatory. The part number for a catalog entry displays in Management Center as the value for the catalog entry Code property.
- CatalogEntryUniqueId
- (Mandatory, Integer) The internal unique reference number of the catalog entry (SKU). Either this field or the PartNumber is mandatory.
- Color
- (String) The value of the Color attribute. If the value is omitted, the relationship is removed.
- Size
- (String) The value of the Size attribute. If the value is omitted, the relationship is removed.
CSV file with sample attribute dictionary attribute and value data
PartNumber | Color | Size |
---|---|---|
Shirt-Red-Large | Red | Large |
Shirt-Green-Small | Green | Small |
Mapping data
<_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="Color" valueFrom="Fixed" />
<_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/AttributeDataType" value="STRING" valueFrom="Fixed" />
<_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/displaySequence" value="1" valueFrom="Fixed" />
<_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/usage" value="Defining" valueFrom="Fixed" />
<_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/Value/identifier" value="Color" valueFrom="InputData" />
<_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/Value/value" value="Color" valueFrom="InputData" />
<_config:mapping xpath="CatalogEntryAttributes/Attributes[0]/AttributeType" value="AllowedValues" valueFrom="Fixed" />
<_config:mapping xpath="CatalogEntryAttributes/Attributes[1]/AttributeIdentifier/ExternalIdentifier/Identifier" value="Size" valueFrom="Fixed" />
<_config:mapping xpath="CatalogEntryAttributes/Attributes[1]/AttributeDataType" value="INTEGER" valueFrom="Fixed" />
<_config:mapping xpath="CatalogEntryAttributes/Attributes[1]/AttributeType" value="AllowedValues" valueFrom="Fixed" />
<_config:mapping xpath="CatalogEntryAttributes/Attributes[1]/displaySequence" value="2" valueFrom="Fixed" />
<_config:mapping xpath="CatalogEntryAttributes/Attributes[1]/usage" value="Defining" valueFrom="Fixed" />
<_config:mapping xpath="CatalogEntryAttributes/Attributes[1]/Value/identifier" value="Size" valueFrom="InputData" />
<_config:mapping xpath="CatalogEntryAttributes/Attributes[1]/Value/value" value="Size" valueFrom="InputData" />
</_config:DataMapping>
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 com.ibm.commerce.catalog.dataload.mediator.CatalogEntryAttributeDictionaryAttributeExtendedMediator.