Example: Catalog entry defining attribute allowed values

We can use the Data Load utility to insert, replace, or delete allowed values for defining attributes at the product level. We can enter multiple allowed values for each attribute at the same time.

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 defining attribute data

Insert or replace

In this example, the CSV file contains sample allowed values for defining attributes. CSV file with sample defining attribute allowed values. Due to the large number of fields in the CSV file, the table is split into two sections:

Formatted CSV file with column headings
PartNumber Name ValueSequence Value
Example-PN-10001 Color 1 Red
Example-PN-10001 Color 2 Blue
Example-PN-10002 Size 3 Large
Example-PN-10002 Size 4 Small

Formatted CSV file with column headings - continued
Image1 Image2 AttachmentID
Red1/image.jpg Red2/image.jpg 1221
Blue1/image.jpg Blue2/image.jpg
Large1/image.jpg Large2/image.jpg 1222
Small1/image.jpg Small2/image.jpg

Delete

In this example, the CSV file contains sample allowed values for defining attributes that are to be deleted. CSV file with sample defining attribute allowed values. Due to the large number of fields in the CSV file, the table is split into two sections:

Formatted CSV file with column headings
PartNumber Name ValueSequence Value
Example-PN-10001 Color 1 Red
Example-PN-10001 Color 2 Blue
Example-PN-10002 Size 3 Large
Example-PN-10002 Size 4 Small

Formatted CSV file with column headings - continued
Image1 Image2 UnitOfMeasure AttachmentID Delete
Red1/image.jpg Red2/image.jpg 1221 1
Blue1/image.jpg Blue2/image.jpg 1
Large1/image.jpg Large2/image.jpg 1222 1
Small1/image.jpg Small2/image.jpg 1


Mapping data

The following code snippet from the catalog entry defining attribute allowed values 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.