use of net.jforum.util.rss.TopicPostsRSS in project jforum2 by rafaelsteil.
the class RSSAction method topicPosts.
/**
* RSS for all N first posts for some given topic
*/
public void topicPosts() {
int topicId = this.request.getIntParameter("topic_id");
PostDAO pm = DataAccessDriver.getInstance().newPostDAO();
TopicDAO tm = DataAccessDriver.getInstance().newTopicDAO();
Topic topic = tm.selectById(topicId);
if (!TopicsCommon.isTopicAccessible(topic.getForumId()) || topic.getId() == 0) {
JForumExecutionContext.requestBasicAuthentication();
return;
}
tm.incrementTotalViews(topic.getId());
List posts = pm.selectAllByTopic(topicId);
String[] p = { topic.getTitle() };
String title = I18n.getMessage("RSS.TopicPosts.title", p);
String description = I18n.getMessage("RSS.TopicPosts.description", p);
RSSAware rss = new TopicPostsRSS(title, description, topic.getForumId(), posts);
this.context.put("rssContents", rss.createRSS());
}