Example: Deleting catalog filter catalog entry selections
You can delete your catalog filter catalog entry selections by using the Data Load utility. These examples use a CSV file to demonstrate how to delete your catalog filter catalog entry selection 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 file with sample catalog filter catalog entry selection data
CatalogFilterCatentry.csv Each column is delimited by a comma.
CatalogFilterName | StoreIdentifier | CatalogIdentifier | SelectionType | PartNumber |
---|---|---|---|---|
CatalogFilterA | Aurora | Aurora | Exclude | FULO-0301 |
CatalogFilterA | Aurora | Aurora | Include | FUOF-0101 |
CSV column and XML element definitions
- CatalogFilterName
- Required, String: The name of the catalog filter. Ensure that the combination of CatalogIdentifier, StoreIdentifier, and CatalogFilterName are unique.
- StoreIdentifier
- Required, String: The identifier of the store that the catalog filter belongs to.
- CatalogIdentifier
- Required, String: The identifier of the catalog that the catalog filter belongs to.
- SelectionType
- Required, String: The type of the catalog entry selection: Include, Exclude.
- PartNumber
- Required, String: The catalog entry part number to include or exclude in the catalog filter.
Other optional fields not included in the example:
- CatalogFilterId
- Optional, String: The reference number of the catalog filter. If the reference number is provided in the CSV, then it is used. If this field is provided, then the CatalogFilterName, CatalogFilterName, CatalogIdentifier is not needed.
- Delete
- Optional, String: Indicates whether to delete this record. This field takes effect when dataLoadMode is "replace". If the value of this field equals to deleteValue, the corresponding record is deleted. The default deleteValue is 1, deleteValue might be configured under DataMapping element in BusinessObjectConfigFile.
Business context data
The following code snippet from the wc-dataload-env.xml configuration file provides the required business context data:
<_config:BusinessContext storeIdentifier="AuroraESite" catalogIdentifier="Extended Sites Catalog Asset Store">
</_config:BusinessContext>
- storeIdentifier
- String: The store identifier. This parameter is used when the storeIdentifier is not provided in the CSV file. If the storeIdentifier is provided in the CSV file, it is used. The storeIdentifier is used to retrieve the storeID and the ownerID.
- catalogIdentifier
- String: The catalog identifier. This parameter is used when the catalog identifier is not provided in the CSV file. If the catalogIdentifier is provided in the CSV file, it is used.
Mapping data
<_config:DataReader
className="com.ibm.commerce.foundation.dataload.datareader.CSVReader"
firstLineIsHeader="true"
useHeaderAsColumnName="true" />
<_config:DataMapping>
<_config:mapping xpath="CatalogFilterIdentifier/UniqueID" value="CatalogFilterId" />
<_config:mapping xpath="CatalogFilterIdentifier/ExternalIdentifier/Identifier" value="CatalogFilterName" />
<_config:mapping xpath="CatalogFilterIdentifier/ExternalIdentifier/StoreIdentifier/ExternalIdentifier/NameIdentifier" value="StoreIdentifier" />
<_config:mapping xpath="CatalogFilterIdentifier/ExternalIdentifier/CatalogIdentifier/ExternalIdentifier/Identifier" value="CatalogIdentifier" />
<_config:mapping xpath="ProductSetSelection/selection" value="SelectionType" />
<_config:mapping xpath="ProductSetSelection/ProductSet/CatalogEntryIdentifier/ExternalIdentifier/PartNumber" value="PartNumber" />
<_config:mapping xpath="" value="Delete" deleteValue="1"/>
</_config:DataMapping>
Sample
XML fileBusiness object mediator
The mediator class name is com.ibm.commerce.catalogfilter.dataload.mediator.CatalogFilterCatentrySelectionMediator. The corresponding logical schema is CatalogFilter.xsd.