Develop > Presentation layer > Work with Web service feeds


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 the 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, 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 new directory in which to store the custom set of JSP files at the following path:

    WCDE_INSTALL/Rest/WebContent/atom/ For example:

    WCDE_INSTALL/Rest/WebContent/atom/MyCustomFeedJSPs/

  3. Copy the full set of default feed formatting JSP files that to change to the 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

    WCDE_INSTALL/workspace/Rest/WebContent/atom/site-default/

    SerializeShowMarketingSpotDataDataAreaTypeAtom.jsp
    SerializeMarketingSpotDataAtom.jspf
    SerializeMarketingSpotDataCatalogEntryAtom.jspf
    SerializeMarketingSpotDataCatalogGroupAtom.jspf
    SerializeMarketingSpotDataContentAtom.jspf

    Plus:

    FeedEnvironment.jspf

    Wish list and gift registry feed formatting JSP file set

    WCDE_INSTALL/workspace/Rest/WebContent/atom/site-default/

    SerializeShowGiftListDataAreaTypeAtom.jsp
    SerializeGiftListDataAtom.jspf
    SerializeGiftListDataCatalogEntryAtom.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 the changes.

  6. Open the Struts configuration file for the RESTful framework at the following path:

    WCDE_INSTALL/workspace/Rest/WebContent/WEB-INF/struts-extension.xml

  7. Add a new action mapping to register the top-level feed formatting JSP file in the 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 the customized feed formatting JSP files by viewing the feed in various feed readers or in the widget editor you are using, such as KickApps App Studio. KickApps App Studio requires a machine that is accessible from the Internet to display feed data in a widget.

  11. Deploy your customized code.


+

Search Tips   |   Advanced Search