*
* @return An RSS feed containing all the blog posts.
*/
public SyndFeed getFeed() {
// Create SCA Tours blog RSS feed
SyndFeed feed = new SyndFeedImpl();
feed.setTitle(FEED_TITLE);
feed.setDescription(FEED_DESCRIPTION);
feed.setAuthor(FEED_AUTHOR);
// Get all blog posts and convert to RSS entries
final List<BlogPost> blogEntries = getAllBlogPosts();
for (BlogPost blogEntry : blogEntries) {
SyndEntry entry = new SyndEntryImpl();
entry.setUri(nextBlogID());
entry.setAuthor(blogEntry.getAuthor());
entry.setTitle(blogEntry.getTitle());
SyndContent content = new SyndContentImpl();
content.setType("text");
content.setValue(blogEntry.getContent());
entry.setPublishedDate(blogEntry.getUpdated());
entry.setLink(blogEntry.getLink());
feed.getEntries().add(entry);
}
return feed;
}