Introduced in Feature Pack 2

Customizing web feed integration: Parse feeds from other feed sources

By default, the web feed integration feature parses and loads RSS 2.0 and Atom 1.0 feeds. If you want to use other types of feeds, for example older versions of RSS or Atom, implement a custom feed parser and configure it in the Web-feed-config.xml file.

Procedure

  1. Open WebSphere Commerce Developer.
  2. Locate the WebSphereCommerceServerExtensionsLogic project and add Foundation-DataLoad-FEP.jar to the build path of the project.
  3. Create a Java class that extends the existing com.ibm.commerce.foundation.dataload.feedreader.FeedReader interface.
  4. Implement all the methods in the FeedReader interface to return the parsed feed data.
  5. Package the custom feed parser class, and helper classes, in the WebSphereCommerceServerExtensionsLogic project to a JAR file.
  6. If it does not already exist, create the following directory: WCDE_installdir\ext\lib. Copy the JAR file to the WCDE_installdir\ext\lib directory.
  7. In the Web-feed-config.xml file configure the custom parser for each end point where a custom parser is used.
    The following code snippet shows a CustomRSSReader and CustomAtomReader for URL attachments and managed files.
    <config:feedEndPoint>
            <config:content>
                   <config:URLAttachment>
             <config:name>Content Links</config:name>
             <config:feedURL><![CDATA[http://localhost:90/foundation-    
                               tests/FeedReader/AtomHtml.xml]]&gt;</config:feedURL>
            <config:customParser>com.mycompany.test.CustomAtomReader</config:customParser>
         </config:URLAttachment>
    
        <config:managedAsset>
            <config:name>Product Images</config:name>
            <config:feedURL><![CDATA[http://localhost:90/foundation-
                                tests/FeedReader/RSSMixedLocal.xml]]&gt;</config:feedURL>
            <config:customParser>com.mycompany.test.CustomRssReader</config:customParser>
            <config:managedDirectory>/test/images</config:managedDirectory>
            <config:allowedTypes>*</config:allowedTypes>
            <config:tempFileLocation>/temp</config:tempFileLocation>
        </config:managedAsset>
             </config:content>
    </config:feedEndPoint>

Results

The feed is parsed using custom feed parsers and the data is loaded to the WebSphere Commerce system.