Customizing web feed integration: Populate a URL or its contents in a custom table
Without customization, the mediators that are provided with the web feed integration feature load data into only specific database tables. To load content into other tables, you must use the com.ibm.commerce.foundation.dataload.businessobjectmediator.TableObjectMediator mediator during the load process.
Without customization, the
mediators that are provided with the web feed integration feature
load data into the ATCHAST, ATCHTGT, ATCHREL, and CMFILE tables.
The URL content, the content source, content title, or name from the
feed map can be passed to the TableObjectMediator
mediator.
Before you begin
About this task
IDResolve
is configured.Procedure
- Create a Web-feed-config.xml file.
- In a command-line utility, go to the following directory:
- WC_installdir/bin
- WC_installdir\bin
- WCDE_installdir\bin
- Run the
webFeedLoad
utility with theGenerateDataLoadConfigOnly
option:- ./webFeedLoad.sh ../samples/DataLoad/Content/Web-feed-config.xml -DGenerateDataLoadConfigOnly=true -Dwaspath=WC_ear -DlogFileWithTimestamp=true
- webFeedLoad.cmd ..\samples\DataLoad\Content\Web-feed-config.xml -DGenerateDataLoadConfigOnly=true -Dwaspath=WC_ear -DlogFileWithTimestamp=true
- webFeedLoad.bat ..\samples\DataLoad\Content\Web-feed-config.xml -DGenerateDataLoadConfigOnly=true -DlogFileWithTimestamp=true
A wc-loader-URLAttachment.xml file is generated within the directory that is specified in the Web-feed-config.xml for the Data Load order configuration file. For example, if the Web-feed-config.xml file specifies a temp directory, the wc-loader-URLAttachment.xml file can be generated in the following directory:- WC_installdir/samples/DataLoad/Content/WebFeed/temp/wc-loader-URLAttachment.xml
- WC_installdir\samples\DataLoad\Content\WebFeed\temp\wc-loader-URLAttachment.xml
- WCDE_installdir\samples\DataLoad\Content\WebFeed\temp\wc-loader-URLAttachment.xml
- Open the generated wc-loader-URLAttachment.xml business
object configuration file for editing. Add a
BusinessObjectBuilder
for the custom tables that you want to load data into with theTableObjectMediator
.For example, If you wanted to load data into the COLLDESC, ATCHREL, and COLLATERAL database tables, the business object builder configuration can resemble the following code snippet. You can use a similar approach to load data to other tables.<_config:BusinessObjectBuilder className="com.ibm.commerce.foundation.dataload.businessobjectbuilder.TableObjectBuilder"> <!-- Table: COLLATERAL Columns: COLLATERAL_ID,COLLTYPE_ID,STOREENT_ID,NAME --> <_config:Table name="COLLATERAL" > <_config:Column name="COLLATERAL_ID" value="CollateralId" valueFrom="IDResolve"> <_config:IDResolve tableName="COLLATERAL" generateNewKey="true"> </_config:IDResolve> </_config:Column> <_config:Column name="COLLTYPE_ID" value="1" valueFrom="fixed"> </_config:Column> <_config:Column name="NAME" value="Name"> </_config:Column> <_config:Column name="STOREENT_ID" value="storeId" valueFrom="BusinessContext"/> </_config:Table> <!-- Table: COLLDESC Columns: COLLATERAL_ID,LANGUAGE_ID --> <_config:Table name="COLLDESC" > <_config:Column name="COLLATERAL_ID" value="CollateralId" valueFrom="IDResolve"> <_config:IDResolve tableName="COLLATERAL" primaryKeyColumnName="COLLATERAL_ID" > <_config:UniqueIndexColumn name="NAME" value="Name"/> <_config:UniqueIndexColumn name="STOREENT_ID" value="storeId" valueFrom="BusinessContext"/> </_config:IDResolve> </_config:Column> <_config:Column name="LANGUAGE_ID" value="langId" valueFrom="BusinessContext"> </_config:Column> </_config:Table> <!-- Table: ATCHREL Columns: OBJECT_ID, ATCHOBJTYP_ID, ATCHRLUS_ID, ATCHTGT_ID --> <_config:Table name="ATCHREL" > <_config:Column name="ATCHREL_ID" value="AtchRelId" valueFrom="IDResolve"> <_config:IDResolve tableName="ATCHREL" generateNewKey="true"> </_config:IDResolve> </_config:Column> <_config:Column name="ATCHOBJTYP_ID" value="4" valueFrom="fixed"> </_config:Column> <_config:Column name="ATCHRLUS_ID" value="0" valueFrom="fixed"> </_config:Column> <_config:Column name="OBJECT_ID" value="CollateralId2" valueFrom="IDResolve"> <_config:IDResolve tableName="COLLATERAL" primaryKeyColumnName="COLLATERAL_ID" > <_config:UniqueIndexColumn name="NAME" value="Name"/> <_config:UniqueIndexColumn name="STOREENT_ID" value="storeId" valueFrom="BusinessContext"/> </_config:IDResolve> </_config:Column> <_config:Column name="ATCHTGT_ID" value="AttachmentId" valueFrom="IDResolve"> <_config:IDResolve tableName="ATCHTGT" primaryKeyColumnName="ATCHTGT_ID" > <_config:UniqueIndexColumn name="IDENTIFIER" value="Category"/> <_config:UniqueIndexColumn name="STOREENT_ID" value="storeId" valueFrom="BusinessContext"/> <_config:UniqueIndexColumn name="MEMBER_ID" value="storeOwnerId" valueFrom="BusinessContext"/> </_config:IDResolve> </_config:Column> </_config:Table> <_config:BusinessObjectMediator className="com.ibm.commerce.foundation.dataload.businessobjectmediator.TableObjectMediator"/> </_config:BusinessObjectBuilder>
- Run the
webFeedLoad
utility without theGenerateDataLoadConfigOnly
option specified.- ./webFeedLoad.sh ../samples/DataLoad/Content/Web-feed-config.xml -Dwaspath=WC_ear -DlogFileWithTimestamp=true
- webFeedLoad.cmd ..\samples\DataLoad\Content\Web-feed-config.xml -Dwaspath=WC_ear -DlogFileWithTimestamp=true
- webFeedLoad.bat ..\samples\DataLoad\Content\Web-feed-config.xml -DlogFileWithTimestamp=true