Example: Catalog entry descriptive attributes and attribute values

We can insert, replace, or delete descriptive attributes and attribute values data using the Data Load utility. These examples use a CSV file to demonstrate how to insert, replace, or delete your descriptive attributes and attribute values data.

This example uses a CSV file to demonstrate how to insert, replace, or delete your data. We 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

Other optional fields not included in the example are:


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, which is 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


Mapping 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.

If you perform an insert or replace operation, do not specify the "Delete" column in the CSV file or we can leave the "Delete" column empty.


Business object mediator

The mediator class name is CatalogEntryAttributeMediator.

Note: When we use a mediator that is provided with WebSphere Commerce with the Data Load utility, the utility assumes that we are loading data for all columns for a business object. To update the data in only specific columns, configure a column exclusion list for the load process. A column exclusion list causes the Data Load utility to ignore specific columns during the load operation. If you do not use a column exclusion list, the utility updates all columns in the row of a database table row when the utility updates the row. If no value is set in the input file, the utility can replace the existing column value with a default value or set the value to be null. See Configure a column exclusion list.