Introduced in Feature Pack 1

Changing the content and configuration of an Atom feed for remote widgets

If the default feed formatting JSP files for e-Marketing Spots, wish lists, and gift registries do not meet your business needs, you can create a custom set. By customizing these files, you have more control over the feed data available for display in remote widgets and feed readers. For example, you can change the number of feed entries to include in the feed, or add additional pieces of store data to the feed, if the data is available from the web service. When you have completed the customization, you must register the top-level feed formatting JSP file in a Struts configuration file.

Before you begin

Review the following topics to understand the purpose and function of feed formatting JSP files and the Struts configuration file:

Procedure

  1. Open WebSphere Commerce Developer and switch to the Enterprise Explorer view.
  2. Create a directory in which to store your custom set of JSP files at the following path:

    WebSphere Commerce DeveloperWCDE_installdir/Rest/WebContent/atom/

    For example:

    WebSphere Commerce DeveloperWCDE_installdir/Rest/WebContent/atom/MyCustomFeedJSPs/

  3. Copy the full set of default feed formatting JSP files that you want to change to your new directory.
    The available sets are:
    Set Location of default files Names of files in the set
    E-Marketing Spot feed formatting JSP file set

    WebSphere Commerce DeveloperWCDE_installdir/workspace/Rest/WebContent/atom/site-default/

    SerializeShowMarketingSpotDataDataAreaTypeAtom.jsp SerializeMarketingSpotDataAtom.jspfSerializeMarketingSpotDataCatalogEntryAtom.jspfSerializeMarketingSpotDataCatalogGroupAtom.jspf SerializeMarketingSpotDataContentAtom.jspf

    Plus:

    FeedEnvironment.jspf

    Wish list feed formatting JSP file set

    WebSphere Commerce DeveloperWCDE_installdir/workspace/Rest/WebContent/atom/site-default/

    SerializeShowGiftListDataAreaTypeAtom.jspSerializeGiftListDataAtom.jspfSerializeGiftListDataCatalogEntryAtom.jspf

    Plus:

    FeedEnvironment.jspf

  4. Change any of the JSP files in the set.

    For a description of each file's purpose, see Feed formatting JSP files for Atom feeds. Each JSP file also includes comments throughout to help you customize the file.

  5. Save your changes.
  6. Open the Struts configuration file for the RESTful framework at the following path:

    WebSphere Commerce DeveloperWCDE_installdir/workspace/Rest/WebContent/WEB-INF/struts-extension.xml

  7. Add a new action mapping to register the top-level feed formatting JSP file in your new directory.
    For example, to register a customized set of feed formatting JSP files for e-Marketing Spots located in the MyCustomFeedJSPs directory, the new action mapping might look like the following line shown in bold text:
    <struts-config>
    <action-mappings  type="com.ibm.commerce.foundation.rest.struts.ECRestActionMapping">
            <action path="/ShowMarketingSpotDataDataAreaTypeAtom/0" forward="/atom/MyCustomFeedJSPs/SerializeShowMarketingSpotDataDataAreaTypeAtom.jsp" />
        </action-mappings>
    </struts-config>
  8. Save and close the Struts configuration file.
  9. Restart the WebSphere Commerce test server to make the new configuration available.
  10. Test your customized feed formatting JSP files by viewing the feed in various feed readers or in the widget editor you are using.
  11. Deploy your customized code.