Example: Catalog entries

You can insert, replace, or delete product, SKU, bundle, and kit data by using the Data Load utility. These examples use a CSV file to demonstrate how to insert, replace, or delete multiple product, SKU, bundle, and kit data.

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.

Note: If your site uses SEO and plans to load SEO URLs for catalog entries with the Data Load utility, configure the Data Load utility to load SEO information. In the load order configuration file, you must include the loadSEO parameter with a value set to be "true". This parameter must be set within the data load order configuration file with the following format:
<_config:property name="loadSEO" value="true"/>

CSV column and XML element definitions

PartNumber
(Required, String) The catalog entry identifier. This field is required (cannot be NULL) and it must be unique. The part number for a catalog entry displays in Management Center as the value for the catalog entry Code property.
Type
(String) This field defines the type of catalog entry you want to load. The values for Type are "Item, "Product", "Bundle", "Package" and "DynamicKit".
CurrencyCode
(String) The currency of the ListPrice. This is a currency code as per ISO 4217 standards.
DefaultOfferPrice
(Double) The offer price of this catalog entry in the currency specified. If no currency is specified in the CSV file, the currency is found in the context. The default value = 0.00.
ListPrice
(Double) The list price of this catalog entry in the currency specified. If no currency is specified in the CSV file, the currency is found in the context.
ParentGroupIdentifier
(String) An optional identifier for the category to which the PartNumber belongs.
Sequence
(Double) An optional number that is used to control the order in which the catalog entry appears in a category. If the parent product is provided, this is an optional number that is used to control the order in which the items appear in a parent product.
Language_ID
(Integer) The language id for language sensitive fields (Name, ShortDescription, LongDescription, Thumbnail, FullImage, Published, and Keyword). For example: -1 = English, -2 = French
Name
(Required, String) The display name of this PartNumber. This field is language sensitive.
ShortDescription
(String) A short description of this catalog entry. This field is language sensitive.
LongDescription
(String) A long description of this catalog entry. This field is language sensitive.
Thumbnail
(String) The thumbnail image path of this catalog entry. This field is language sensitive. The forward slash '/' must be used in the path. Do not use backward slash '\'. For example, images/G1.jpg.
FullImage
(String) The full image path of this catalog entry. This field is language sensitive. The forward slash '/' must be used in the path. Do not use backward slash '\'. For example, images/G1.jpg .
AuxDescription1
(String) An auxiliary long description of this catalog entry. This field is language sensitive.
AuxDescription2
(String) An auxiliary description of this catalog entry. This field is language sensitive.
Available
(Integer) Indicates the length of time of availability of this catalog entry. This field is for your internal business use and information only. Do not use this column to indicate inventory levels. The default value is 1
Published
(Integer) Indicates whether this catalog entry must be displayed. : 0 = catalog entry must not be displayed, 1= catalog entry must be displayed.
AvailabilityDate_LocaleSpecific
(Timestamp) The date this catalog entry becomes available.
Keyword
(String) A keyword that is used for searching. To include multiple keywords, which are separated by commas, include the entire string in double quotation marks. Example "keyword 1, keyword 2, keyword3". This field is language sensitive.
Delete
(String) A flag indicating whether to delete. Specify 1 to delete the row.

Other optional fields not included in the example are:

ManufacturerPartNumber
(String) The manufacturer part number that is associated with the catalog entry.
Manufacturer
(String) The name of the manufacturer.
URL
(String) The URL to this catalog entry which can be used as the downloadable URL for the soft goods. Only the forward slash '/' is allowed to be used as the directory and path separator.
Field1
(Integer) A user-defined field available for customization purposes.
Field2
(Integer) A user-defined field available for customization purposes.
Field3
(Double) A user-defined field available for customization purposes.
Field4
(String) A user-defined field available for customization purposes.
Field5
(String) A user-defined field available for customization purposes.
OnSpecial
(Integer) This flag identifies if this catalog entry is on special.
OnAuction
(Integer) This flag identifies if this catalog entry is on auction.
Buyable
(Integer) Indicates whether this catalog entry can be purchased individually: 1 = yes and 0 = no.
StartDate
(Timestamp) The date the catalog entry is introduces. This field is for administrative information only.
EndDate
(Timestamp) The date the catalog entry is removed. This field is for administrative information only.
AvailabilityDate
(Timestamp) The date that the product is available to customers for purchase. This field is for administrative information only.
LastOrderDate
(Timestamp) The final date that the product is available for order. This is the latest date a customer can order the product. This field is for administrative information only.
EndOfServiceDate
(Timestamp) The date a product is no longer in service. For example, this date can be the date that a software manufacturer stops providing upgrades for a version of their product. This field is for administrative information only.
DiscontinueDate
(Timestamp) The date when the product is discontinued. For example, this date can be the date that a manufacturer stops producing a product, or the date your store stops selling the product. It is recommended that this column be used consistently to avoid confusion. This field is for administrative information only.
WeightMeasure
(String) The International System of Units (SI) unit of measurement code for the catalog entry weight.
Weight
(Double) The weight of the catalog entry.
Length
(Double) The length that is associated with the catalog entry.
Width
(Double) The width that is associated with the catalog entry.
Height
(Double) The height that is associated with the catalog entry.
SizeMeasure
(String) The unit of measurement for LENGTH, WIDTH, and HEIGHT.
NominalQuantity
(Double) A nominal quantity for a product, which is used for pricing. For example, if a product is priced as "3 for a dollar", then the nominal quantity of the product is 3, and the price of the product is one dollar. Default = 1.0.
QuantityMultiple
(Double) The product can be sold in quantities that are multiples of this quantity. Default = 1.0.
QuantityMeasure
(String) The unit of measurement for NominalQuantity and QuantityMultiple. The default value is 'C62'. C62 is the UN/CEFACT code that represents 'one'.
ParentPartNumber
Required: (String) This is the catalog entry identifier of the parent product if the catalog entry is a SKU.
ParentToChildCatEntryRelField1
(String) Customizable field for the parent product to child SKU relationship.
ParentToChildCatEntryRelField2
(Integer) Customizable field for the parent product to child SKU relationship.
ParentToChildCatEntryRelField3
(Double) Customizable field for the parent product to child SKU relationship.

CSV file with sample catalog entry data

Insert or replace

In this example the data source is a CSV file. The file contains sample catalog entry data: CSV file with sample catalog entry data. Due to the large number of fields in the CSV file, the table is split into four sections:

Formatted CSV file with column headings
PartNumber Type CurrencyCode DefaultOfferPrice ListPrice
Example-PN-10001 ProductBean USD 6795 6795
Example-PN-10002 ItemBean USD 3599 3999
Example-PN-10003 ItemBean CAD 1999 2450
Formatted CSV file with column headings - continued
ParentGroupIdentifier Sequence Language_ID Name ShortDescription
TV_category 8 -1 Color CRT television Color CRT short description
Appl_category 19 -1 200-watt microwave 200-watt microwave short description
Appl_category 20 -1 150-watt microwave 150-watt microwave short description
Formatted CSV file with column headings - continued
LongDescription Thumbnail FullImage AuxDescription1 AuxDescription2
Color CRT long description TV_thumb/image.jpg TV_full/image.jpg Color CRT auxiliary description 1 Color CRT auxiliary description 2
200-watt microwave long description 200_microw_thumb/image.jpg 200_microw_full/image.jpg 200-watt microwave auxiliary description 1 200-watt microwave auxiliary description 2
150-watt microwave long description 150_microw_thumb/image.jpg 150_microw_full/image.jpg 150-watt microwave auxiliary description 1 150-watt microwave auxiliary description 2
Formatted CSV file with column headings - continued
Available Published AvailabilityDate_LocaleSpecific Keyword
1 1 2008-04-20 16:00:00 CRT TV keyword
1 1 2008-04-20 16:00:00 200-watt microwave keyword
0 1 2008-04-20 16:00:00 150-watt microwave keyword

Delete

There are two ways to perform a delete operation on a catalog entry: mark for delete, and physical delete. When you use the mark for delete option, the catalog entry still exists in the database but the part number of the catalog entry is renamed, and the markForDelete column of the catalog entry is set to 1. When you use the physical delete option, which is the second option, the catalog entry is deleted from the database. By default, the data load utility uses the mark for delete option. This is the recommended option.

If you want to use the physical delete option, you must set the markForDelete attribute in the CatalogEntryMediator to "false". A sample catalog entry loader configuration file is shown:
<_config:BusinessObjectMediator className="com.ibm.commerce.catalog.dataload.mediator.CatalogEntryMediator" componentId="com.ibm.commerce.catalog">
	<_config:property name="markForDelete" value="false" />
</_config:BusinessObjectMediator>

In this example, the CSV file contains sample catalog entry data that will be deleted. Each column is delimited by a comma: CSV file with sample catalog entry data. Due to the large number of fields in the CSV file, the table is split into four sections:

Formatted CSV file with column headings
PartNumber Type CurrencyCode DefaultOfferPrice ListPrice
Example-PN-10001 ProductBean USD 6795 6795
Example-PN-10002 ItemBean USD 3599 3999
Example-PN-10003 ItemBean CAD 1999 2450
Formatted CSV file with column headings - continued
ParentGroupIdentifier Sequence Language_ID Name ShortDescription
TV_category 8 -1 Color CRT television Color CRT short description
Appl_category 19 -1 200-watt microwave 200-watt microwave short description
Appl_category 20 -1 150-watt microwave 150-watt microwave short description
Formatted CSV file with column headings - continued
LongDescription Thumbnail FullImage AuxDescription1 AuxDescription2
Color CRT long description TV_thumb/image.jpg TV_full/image.jpg Color CRT auxiliary description 1 Color CRT auxiliary description 2
200-watt microwave long description 200_microw_thumb/image.jpg 200_microw_full/image.jpg 200-watt microwave auxiliary description 1 200-watt microwave auxiliary description 2
150-watt microwave long description 150_microw_thumb/image.jpg 150_microw_full/image.jpg 150-watt microwave auxiliary description 1 150-watt microwave auxiliary description 2
Formatted CSV file with column headings - continued
Available Published AvailabilityDate_LocaleSpecific Keyword Delete
1 1 20/4/2008 CRT TV keyword 1
1 1 20/4/2008 200-watt microwave keyword 1
0 1 20/4/2008 150-watt microwave keyword 1

Mapping data

The following code snippet from the catalog entry loader 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" />
	<_config:mapping xpath="catalogEntryTypeCode" value="Type" />
	<_config:mapping xpath="ListPrice/Price/currency" value="CurrencyCode" />
	<_config:mapping xpath= value="DefaultOfferPrice" />
	<_config:mapping xpath="ListPrice/Price/value" value="ListPrice" />
	<_config:mapping xpath="ParentCatalogGroupIdentifier/ExternalIdentifier/GroupIdentifier" value="ParentGroupIdentifier"  />
	<_config:mapping xpath="displaySequence" value="Sequence" />
	<_config:mapping xpath="Description[0]/language" value="Language_ID" />
	<_config:mapping xpath="Description[0]/Name" value="Name"  />
	<_config:mapping xpath="Description[0]/ShortDescription" value="ShortDescription"   />
	<_config:mapping xpath="Description[0]/LongDescription" value="LongDescription"   />
	<_config:mapping xpath="Description[0]/Thumbnail" value="Thumbnail"   />
	<_config:mapping xpath="Description[0]/FullImage" value="FullImage"   />
	<_config:mapping xpath="Description[0]/Attributes/auxDescription1" value="AuxDescription1"   />
	<_config:mapping xpath="Description[0]/Attributes/auxDescription2" value="AuxDescription2"   />
	<_config:mapping xpath="Description[0]/Attributes/available" value="Available"   />
	<_config:mapping xpath="Description[0]/Attributes/published" value="Published"   />
	<_config:mapping xpath="Description[0]/Attributes/availabilityDate" value="AvailabilityDate_LocaleSpecific"   />
	<_config:mapping xpath="Description[0]/Keyword" value="Keyword"  />
	<_config:mapping xpath="" value="Delete" deleteValue="1"/>
</_config:DataMapping>
If you perform 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 com.ibm.commerce.catalog.dataload.mediator.CatalogEntryMediator.

Note: When you use a mediator that is provided with HCL Commerce with the Data Load utility, the utility assumes that you are loading data for all columns for a business object. If you want 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. For more information, see Configuring a column exclusion list.