Samples > Data load utility samples > Examples: Mapping data > Examples: Mapping catalog data > Examples: Mapping catalog entry data


Example: Catalog entries

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


CSV file column definitions

PartNumber

(Mandatory, String) The catalog entry identifier. This field is mandatory (cannot be NULL) and it must be unique.

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 will be 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 will be found in the context.

ParentGroupIdentifier

(String) An optional identifier for the category to which the PartNumber belongs.

Sequence

(Double) An optional number 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 used to control the order in which the items appears 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

(Mandatory, 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 '/' should 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 '/' should 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 to availability of this catalog entry. Do not use this column to indicate inventory levels. Default value = 1.

Published

(Integer) Indicates whether this catalog entry should be displayed. : 0 = catalog entry should not be displayed, 1= catalog entry should be displayed.

AvailabilityDate_LocaleSpecific

(Timestamp) The date this catalog entry becomes available.

Keyword

(String) A keyword used for searching.

To include multiple keywords, separated by commas, include the entire string in double quotes. Example "keyword 1, keyword 2, keyword3". This field is language sensitive.

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.

Other optional fields not included in the example are:

ManufacturerPartNumber

(String) The manufacturer part number 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 a manufacturer stops producing a product, or the date the store stops selling the product. IBM recommends 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 associated with the catalog entry.

Width

(Double) The width associated with the catalog entry.

Height

(Double) The height associated with the catalog entry.

SizeMeasure

(String) The unit of measurement for LENGTH, WIDTH, and HEIGHT.

NominalQuantity

(Double) A nominal quantity for a product, 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 amount of fields in the CSV file, the table has been split into 4 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. On the other hand, when you use the physical delete 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.

To use the physical delete option, you need to set the markForDelete attribute in the CatalogEntryMediator to "true". 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="true" />
</_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 amount of fields in the CSV file, the table has been split into 4 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


Map 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 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 mediator class name is CatalogEntryMediator.


+

Search Tips   |   Advanced Search