Search in sources :

Example 1 with TopicRSS

use of net.jforum.util.rss.TopicRSS in project jforum2 by rafaelsteil.

the class RSSAction method forumTopics.

/**
	 * RSS for all N first topics for some given forum
	 */
public void forumTopics() {
    int forumId = this.request.getIntParameter("forum_id");
    if (!TopicsCommon.isTopicAccessible(forumId)) {
        JForumExecutionContext.requestBasicAuthentication();
        return;
    }
    List posts = DataAccessDriver.getInstance().newPostDAO().selectLatestByForumForRSS(forumId, SystemGlobals.getIntValue(ConfigKeys.TOPICS_PER_PAGE));
    Forum forum = ForumRepository.getForum(forumId);
    String[] p = { forum.getName() };
    RSSAware rss = new TopicRSS(I18n.getMessage("RSS.ForumTopics.title", p), I18n.getMessage("RSS.ForumTopics.description", p), forumId, posts);
    this.context.put("rssContents", rss.createRSS());
}
Also used : TopicRSS(net.jforum.util.rss.TopicRSS) List(java.util.List) Forum(net.jforum.entities.Forum) RSSAware(net.jforum.util.rss.RSSAware)

Aggregations

List (java.util.List)1 Forum (net.jforum.entities.Forum)1 RSSAware (net.jforum.util.rss.RSSAware)1 TopicRSS (net.jforum.util.rss.TopicRSS)1