Example: Inserting and deleting catalog filter catalog entry selections

We can insert or delete catalog entry information for a catalog filter. In the CSV file, the required information is the catalog filter name, store identifier, catalog identifier, selection type (Exclude or Include), and catalog entry part number. The catalog entry can be inserted or deleted, it cannot be replaced. For example, we cannot change an included catalog entry to exclude.

This example uses a CSV file to demonstrate how to insert or delete your data. We can also create and use an XML formatted file instead of a CSV file. If you choose to create an use an XML file, ensure that your XML elements use the same names as are used for CSV column names.


Prerequisites


CSV file with sample catalog filter catalog entry selection data

CatalogFilterCatentry.csv file

The file contains catalog filter catalog entry selection data. Each column is delimited by a comma.

Table 1. CatalogFilterCatentry
CatalogFilterId CatalogFilterName StoreIdentifier CatalogIdentifier SelectionType PartNumber Delete
CatalogFilterA Aurora Aurora Include CAC024_2401 0
CatalogFilterA Aurora Aurora Include CAC024_2402 0
CatalogFilterA Aurora Aurora Exclude CAC024_2403 0
CatalogFilterA Aurora Aurora Exclude CAC024_2404 0


CSV column and XML element definitions

Other optional fields not included in the example are:


Business context data

The following code snippet from the wc-dataload-env.xml configuration file provides the required business context data:


Mapping data

The following snippet from the sample configuration file demonstrates how to map each column of data in the source CSV file to a value.

The following snippet from the sample configuration file demonstrates how to map each column of the data in the CSV file to a business object logical schema path. The attribute 'value' represents the name of a column of the CSV file which is defined in the configuration snippet above. Each column in the CSV file must have a mapping to the logical schema path. If the optional fields specified above are present in the CSV file, the mapping for them must be added. The mapping logical schema path is specified in the following table.

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.


Business object mediator

The mediator class name is CatalogFilterCatentrySelectionMediator. The corresponding logical schema is
CatalogFilter.xsd.