Scenario: Catalog entry update load
You can configure the Data Load utility to run in an update mode to update catalog entry information. The update mode compares the catalog entry data in the input file with the corresponding data for the catalog entries in the database. The update mode then replaces or adds data for only the columns that are specified in the input file. All other columns remain unchanged.
When you run the Data Load utility in replace mode, the Data Load utility assumes that the input file is a new master copy of the data for the objects within the file. During a load operation, the utility replaces any data in the database with the input file data. If the input file does not include data to load into a database column, the utility loads the default value for the column if a value is configured. If no value exists in the input file and no default value is configured, the utility deletes the data in the corresponding database column for the object.
With the Data Load utility in replace mode, administrators must include data for all columns to prevent the load process from deleting data from the database or resetting the data to a default value. You can also configure a column exclusion list to prevent the utility from updating specific columns, but the utility can still erase data if values are missing for an object for any column that is not excluded.
"Update"
for
the load order configuration file property, dataLoadMode
.
For example, <_config:LoadOrder dataLoadMode="Update" >
You can also include the dataLoadMode
property
in the configuration for specific load items, for example: <_config:LoadItem name="CatalogEntryUpdate" dataLoadMode="Update">
- utilities_root\samples\DataLoad\Catalog\CatalogEntryUpdate
- WCDE_installdir\samples\DataLoad\Catalog\CatalogEntryUpdate
When the Data Load utility runs in update mode, the business object mediator sends a list of table data objects to the JDBCDataWriter. These data objects include the input file values. The data writer can then persist the table data objects to the database. For each object, the data writer retrieves the corresponding database row and compares the column values between the database and the data object. If a value is different, the data writer replaces the value in the database with the value in the table data object. If the values are the same or no value exists in the table data object, no update occurs. The existing database column value remains.
Catalog Upload
Business users can also use the Catalog Upload in update mode to upload catalog entry and catalog entry description information into the Catalogs tool. If you must provide business users with CSV or XML files to use for uploading data, ensure that you include the correct keywords within the input files. To upload catalog entry information in update mode, the CSV or XML file, use one of the following keywords:CatalogEntryUpdate
- Indicates that the upload includes updates for catalog entry data, such as name or manufacturer name.
CatalogEntryDescriptionUpdate
- Indicates that the upload includes updates for catalog entry descriptive data, such as short description or long description.
Sample
Update
data load mode, a small
commit count, and batch size, and without a fixed keyrange:
<_config:LoadOrder commitCount="10" batchSize="1" dataLoadMode="Update"
>
<_config:property name="firstTwoLinesAreHeader" value="true" />
<_config:LoadItem name="CatalogEntryUpdate" loadSequence="3.1" businessObjectConfigFile="wc-loader
-catalog-entry-update.xml">
<_config:DataSourceLocation location="CatalogEntriesUpdate.csv" oldLocation="" />
<_config:BusinessContext languageId="-1"/>
</_config:LoadItem>
</_config:LoadOrder>
This
sample sets the dataLoadMode
in only the load order configuration, but you can also
set it within the load item configuration.0
:<_config:IDResolver className="com.ibm.commerce.foundation.dataload.idresolve.IDResolverImpl"
cacheSize="0" />