Example: Master and sales catalog descriptions
You can insert, replace, or delete multiple master and sales catalog descriptions simultaneously by using the Data Load utility. These examples use a load file to demonstrate how to insert, replace, or delete your master and sales catalog description 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.
CSV column and XML element definitions
- Identifier
- (String) The catalog identifier. Either this field or the CatalogUniqueId is required.
- CatalogUniqueId
- (BigInt) The internal unique reference number of the catalog. Either this field or the Identifier is required.
- Name
- (String) The language-specific display name of this catalog.
- ShortDescription
- (String) A language-specific short description of this catalog.
- LongDescription
- (String) A language-specific long description of this catalog.
- Thumbnail
- (String) The language-specific thumbnail image path of this catalog.
For example,
images/G1.jpg
. - FullImage
- (String) The language-specific full image path of this catalog.
For example,
images/G1.jpg
. - Delete
- (String) A flag indicating whether to delete. Specify
1
to delete the row.
CSV file with sample catalog description data
Insert or replace
Identifier | Name | ShortDescription | LongDescription | Thumbnail | FullImage |
---|---|---|---|---|---|
Example_master_cat | Example master catalog | Example master catalog short description | Example master catalog long description | master_thumb/image.jpg | master_full/image.jpg |
Summer_sales_cat1 | Summer sales catalog | Summer sales catalog short description | Summer sales catalog long description | summer_thumb/image.jpg | summer_full/image.jpg |
Winter_sales_cat2 | Winter sales catalog | Winter sales catalog short description | Winter sales catalog long description | Winter_thumb/image.jpg | Winter_full/image.jpg |
Spring_sales_cat3 | Spring sales catalog | Spring sales catalog short description | Spring sales catalog long description | Spring_thumb/image.jpg | Spring_full/image.jpg |
Delete
Identifier | Name | ShortDescription | LongDescription | Thumbnail | FullImage | Delete |
---|---|---|---|---|---|---|
Example_master_cat | Example master catalog | Example master catalog short description | Example master catalog long description | master_thumb/image.jpg | master_full/image.jpg | 1 |
Summer_sales_cat1 | Summer sales catalog | Summer sales catalog short description | Summer sales catalog long description | summer_thumb/image.jpg | summer_full/image.jpg | 1 |
Winter_sales_cat2 | Winter sales catalog | Winter sales catalog short description | Winter sales catalog long description | Winter_thumb/image.jpg | Winter_full/image.jpg | 1 |
Spring_sales_cat3 | New spring sales catalog name | Spring sales catalog new short description | Spring sales catalog new long description | Spring_thumb/image.jpg | Spring_full/image.jpg |
Mapping data
The following code snippet from the catalog description loader configuration file demonstrates how to map each value to a business object logical schema path.
<_config:DataMapping>
<_config:mapping xpath="CatalogIdentifier/ExternalIdentifier/Identifier" value="Identifier" valueFrom="InputData"/>
<_config:mapping xpath="CatalogIdentifier/UniqueID" value="CatalogUniqueId" valueFrom="InputData"/>
<_config:mapping xpath="Description[0]/Name" value="Name" valueFrom="InputData" />
<_config:mapping xpath="Description[0]/ShortDescription" value="ShortDescription" valueFrom="InputData" />
<_config:mapping xpath="Description[0]/LongDescription" value="LongDescription" valueFrom="InputData" />
<_config:mapping xpath="Description[0]/Thumbnail" value="Thumbnail" valueFrom="InputData" />
<_config:mapping xpath="Description[0]/FullImage" value="FullImage" valueFrom="InputData" />
<_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.CatalogDescriptionMediator.