Background information
This sample shows how to use the REST Service Call Builder that was introduced in IBM® WebSphere® Portlet Factory 6.0.2 to invoke REST style services and display the results.
Sample description
The following describes the sample models provided by this article.
DeveloperWorksProvider Model
This model acts as a service provider for serving up a "Web development" Atom feed from the IBM Developer Works site.
For more information about Developer Works Atom feeds, see: http://www-128.ibm.com/developerworks/rss/atomfeeds.html
This model is used by the DeveloperWorksConsumer model.
To fetch the Atom feed, this model uses the REST Service Call builder.
This provider model exposes the following Service Operation.
getArticles - This operation fetches an Atom feed that contains articles related to Web Development. The result of this operation is the entire Atom feed. Because the "Restructure Feed Data" input is checked, all the "entry" elements are wrapped by a parent "entries" element. Using this input makes it easier to use the View & Form Builder where you only want to display the repeated data contained in the "entry" elements of the feed. This operation is consumed by the DeveloperWorksConsumer model.
EclipseNewsProvider Model
This model acts as a service provider for serving up a "Community News" RSS feed from the Eclipse site. For more information about the Community News RSS feed, see: http://www.eclipse.org/home
This model is used by the EclipseNewsConsumer model.
To fetch the RSS feed, this model uses the REST Service Call builder.
This provider exposes the following Service Operation.
getNews - This operation fetches an RSS feed that contains Community News. The result of this operation is the entire RSS feed. Because the "Restructure Feed Data" input is checked, all the "item" elements are wrapped by a parent "items" element. Using this option makes it easier to use the View & Form Builder where you only want to display the repeated data contained in the "item" elements of the feed. This operation is consumed by the EclipseNewsConsumer model.
DeveloperWorksConsumer Model
This model acts as a service consumer for displaying content from a "Web development" Atom feed from the IBM Developer Works site. For more information about Developer Works Atom feeds, see: http://www-128.ibm.com/developerworks/rss/atomfeeds.html
This model uses the DeveloperWorksProvider model to fetch the Atom feed.
The View & Form Builder uses the getArticles! "entry" elements from the Atom feed results. The "entry" elements are wrapped in an "entries" element. Using this option makes it easier to use the View & Form Builder where you only want to display the repeated data contained in the "entry" elements of the feed.
This model uses the /WEB-INF/samples/data_definitions/devworks_articles.xml RDD file to control the fields displayed by the View & Form Builder. The RDD file is specified in the Service Consumer Builder.
EclipseNewsConsumer Model
This mode l acts as a service consumer for displaying content from the "Community News" RSS feed from the Eclipse site. For more information about Developer Works Atom feeds, see: http://www-128.ibm.com/developerworks/rss/atomfeeds.html
This model is uses the EclipseNewsProvider model to fetch the RSS feed.
The View & Form Builder uses the getNews service operation to fetch the "Community News" RSS feed results.
This model uses the /WEB-INF/samples/data_definitions/eclipse_news.xml RDD file to control the fields displayed by the View & Form Builder. The RDD file is specified in the Service Consumer Builder.
Figure 1. This shows the running EclipseNewsConsumer Model

Figure 2. This shows the running DeveloperWorksConsumer Model

Notes on running the sample and prerequisites
- You must be using Portlet Factory 6.0.2 or higher.
- Download the sample ZIP file and import it into a project using the File, Import, WebSphere Portlet Factory Archive command.
- Open the DeveloperWorksConsumer or EclipseNewsConsumer model and run it.