Tutorials > Program model > Customize the Data Load utility
Create an XML input file
In this step of the tutorial, you create an XML file that contains the catalog entry information, warranty and care instruction data to load into the target database.
The XML file is based on the data created in tutorial "Adding new properties to a WebSphere Commerce service using the data service layer". This file contains CatalogEntry base information, CatalogEntry description information, warranty information and care instruction data which extends the CatalogEntry object.
Procedure
- Create the WCDE_INSTALL\samples\Dataload\warranty\ directory.
- Create a warranty.xml file in the WCDE_INSTALL\samples\Dataload\warranty\ directory.
- Copy the following content into the warranty.xml file.
<?xml version="1.0" encoding="utf-8"?> <customInfo> <customProductInfo partNumber="MW-0003" Type="ProductBean"> <warranty warrantyTerm="30" warrantyType="LIMITED"/> <attributes> <attribute name="manufacturerPartNumber" value="" /> <attribute name="manufacturer" value="MapleWear" /> <attribute name="url" value="" /> <attribute name="field1" value="1" /> <attribute name="field2" value="1" /> <attribute name="field3" value="1" /> <attribute name="field4" value="" /> <attribute name="field5" value="" /> <attribute name="onSpecial" value="1" /> <attribute name="onAuction" value="1" /> <attribute name="buyable" value="1" /> </attributes> <description language="-1" Name="Striped turtleneck" ShortDescription="Soft, stretchy rib-knit turtleneck." LongDescription="This soft, stretchy rib-knit turtleneck is perfect either on its own or layered under a jumper." Thumbnail="images/catalog/apparel/apparel_70x70/IMG_0003_e.jpg" FullImage="images/catalog/apparel/apparel_160x160/IMG_0003_e.jpg" Keyword=""> <attribute name="careinstruction" value="Avoid soap and water"/> <attribute name="auxDescription1" value=""/> <attribute name="auxDescription2" value=""/> <attribute name="available" value="1"/> <attribute name="availabilityDate" value="2008-09-03 16:00:00"/> <attribute name="published" value="1"/> </description> </customProductInfo> </customInfo>
The customProductInfo element maps to a CatalogEntry noun, while the description element maps to a CatalogEntry description noun part.
The data load utility supports creating, replacing, or deleting data objects in the database table.
To replace data objects in the database, ensure that you supply all attributes. In the preceding example, all CatalogEntry information is provided.
- Save and close the file.