Configuring the business object configuration file
The business object configuration file defines how to load the data into the database. In this file, you specify the implementation classes for your Data Reader, Business Object Builder, and Business Object Mediator components. You also specify the attributes and properties for these components.
About this task
- WC_installdir/samples/DataLoad
- WCDE_installdir/samples/DataLoad
Procedure
-
Create a copy of a sample wc-loader-object.xml file and
rename the file.
For example, copy the wc-loader-catalog.xml file within the Catalog component directory.
- Open the new business object configuration file for editing.
-
Specify your data reader implementation class.
-
Specify your business object builder class.
- Optional:
Configure the Data Load utility to exclude any columns that you do not want the utility to load
data into or change.
To exclude columns, you can define a column exclusion list within the
<_config:DataLoader>
element. For more information, see Configuring a column exclusion list. -
Save and close the file.
As an example, the following snippet configures the business object configuration file for loading attribute dictionary attribute allowed value data:
<?xml version="1.0" encoding="UTF-8"?> <_config:DataloadBusinessObjectConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.ibm.com/xmlns/prod/commerce/foundation/config ../../../../ xml/config/xsd/wc-dataload-businessobject.xsd" xmlns:_config="http://www.ibm.com/xmlns/prod/commerce/foundation/config"> <_config:DataLoader className="com.ibm.commerce.foundation.dataload.BusinessObjectLoader" > <_config:DataReader className="com.ibm.commerce.foundation.dataload.datareader.CSVReader" firstLineIsHeader="true" useHeaderAsColumnName="true" > <_config:property name="keyColumns" value="Identifier,ValueIdentifier" /> </_config:DataReader> <_config:BusinessObjectBuilder className="com.ibm.commerce.foundation.dataload.businessobjectbuilder.BaseBusinessObjectBuilder" packageName="com.ibm.commerce.catalog.facade.datatypes.CatalogPackage" dataObjectType="AttributeDictionaryAttributeType" > <_config:DataMapping> <_config:mapping xpath="AttributeIdentifier/ExternalIdentifier/Identifier" value="Identifier" /> <_config:mapping xpath="AttributeIdentifier/UniqueID" value="AttributeUniqueId" /> <_config:mapping xpath="AllowedValue/identifier" value="ValueIdentifier" /> <_config:mapping xpath="AllowedValue/displaySequence" value="Sequence" /> <_config:mapping xpath="AllowedValue/Value" value="Value" /> <_config:mapping xpath="AllowedValue/ExtendedValue/ValueUsage" value="1" valueFrom="Fixed" /> <_config:mapping xpath="AllowedValue/ExtendedValue/AttributeValueField1" value="AttributeValueField1" /> <_config:mapping xpath="AllowedValue/ExtendedValue/AttributeValueField2" value="AttributeValueField2" /> <_config:mapping xpath="AllowedValue/ExtendedValue/AttributeValueField3" value="AttributeValueField3" /> <_config:mapping xpath="AllowedValue/ExtendedValue/Image1" value="Image1" /> <_config:mapping xpath="AllowedValue/ExtendedValue/Image2" value="Image2" /> <_config:mapping xpath="AllowedValue/ExtendedValue/Field1" value="Field1" /> <_config:mapping xpath="AllowedValue/ExtendedValue/Field2" value="Field2" /> <_config:mapping xpath="AllowedValue/ExtendedValue/Field3" value="Field3" /> <_config:mapping xpath="AllowedValue/language" value="Language" /> <_config:mapping xpath="AllowedValue/language" value="LanguageId" /> <_config:mapping xpath="" value="Delete" deleteValue="1" /> </_config:DataMapping> <_config:BusinessObjectMediator className="com.ibm.commerce.catalog.dataload.mediator.AttributeDictionaryAttributeMediator" componentId="com.ibm.commerce.catalog" > <_config:property name="allowChangeAttributeType" value="true" /> <_config:property name="validateAttribute" value="true" /> </_config:BusinessObjectMediator> </_config:BusinessObjectBuilder> </_config:DataLoader> </_config:DataloadBusinessObjectConfiguration>