Feed formatting JSP files for Atom feeds
The WebSphere Commerce RESTful framework uses JSP files to format the content of an Atom feed. These JSP files control the images and text to include in the Atom feed, and perform some additional feed configuration functions. When a feed reader or widget initiates a request to display a feed, the RESTful framework uses these feed formatting JSP files to convert the service data object (SDO) to an Atom feed.
Data provided to the feed formatting JSP files
The RESTful framework passes the following information to the feed formatting JSP files:
- The SDO returned from the Web service
- The business context parameters, for example, the
storeId, catalogId, locale
, andlangId
- Store configuration information, for example, the Web server host name
Function of feed formatting JSP files
A feed formatting JSP file must:- Get the data from the SDO returned from the Web service. The following
is an example of the JSP code that gets data from an SDO returned
from the Get MarketingSpotData service:
<c:set var="marketingSpotDatas" value="${dataObject.marketingSpotData[0]}"/>
- Specify the data to include in the feed and produce a valid output according to the Atom Syndication Format 1.0 specification. This specification is available on the Internet. It lists the mandatory and optional elements to use in an Atom feed and includes examples of valid Atom-format XML documents.
Feed formatting JSP files supplied with WebSphere Commerce
WebSphere Commerce includes several sets of feed formatting JSP files for supported WebSphere Commerce Web services. There is one set for e-Marketing Spot Atom feeds and another set for wish list Atom feeds. These feed formatting JSP files produce a default feed output, but you can create a custom set if your site requires a different output.The top-level JSP file in each set is invoked. The additional JSPF files in the each set perform various functions when formatting the Atom feed. The following table summarizes the function of each file in the set; for additional details about each file, open the file and read the comments within the file. The default files are located here:
WCDE_installdir/Rest/WebContent/atom/site-default/
File in the set | Purpose | Name of file for each feed type |
---|---|---|
Top-level feed formatting JSP file |
The primary purpose of this file to get data from the SDO returned from the service. For example, for e-Marketing Spot feeds, this file includes the following line of code:
This file also specifies certain configurable settings for the Atom feed, for example:
This file is specified in the Struts configuration file because it is the top-level file. Two JSP files from the set are included in this file:
|
For e-Marketing Spot
feeds: SerializeShowMarketingSpotDataDataAreaTypeAtom.jsp For wish list feeds: SerializeShowGiftListDataAreaTypeAtom.jsp |
Feed environment JSP file | This file sets common variables used for all feed types, that is, e-Marketing
Spot feeds and wish list feeds. By default, all top-level feed formatting JSP files point to the
same feed environment file. Functions of this file include:
|
For all feeds: FeedEnvironment.jspf |
Feed formatting JSP file for the Atom feed element |
This file defines the mandatory and optional content for the For certain elements, the values are not specified directly in the JSP file; instead, the JSP file references a properties file that contains the actual text strings. This file includes the feed formatting JSP file for feed entries. |
For e-Marketing Spot
feeds: SerializeMarketingSpotDataAtom.jspf For wish list feeds: SerializeGiftListDataAtom.jspf |
Feed formatting JSP files for the Atom feed entry
element |
These files define the content for the atom:entry element,
based on the Atom Syndication Format requirements. Each file gathers the specific data required to
create a feed entry, based on the type of store data the feed displays. For example, the
SerializeMarketingSpotDataCatalogEntryAtom.jspf file gathers the following feed
entry data about a catalog entry:
Important: Each of these files contains feed elements that are Atom standard
elements, that is, elements that are defined in the Atom Syndication Format specification. In
addition, each file includes a set of Atom extension elements:
|
For e-Marketing Spot feeds:
For wish list feeds: SerializeGiftListDataCatalogEntryAtom.jspf |