Class RSSService

java.lang.Object
org.fenixedu.cms.rss.RSSService

public class RSSService extends Object
Service that generates an RSS Feed from either a Site (in which case the feed info is that of the site, and all the site's posts) or a Category (in which case the feed info is that of the category, and all the category's posts). The generated RSS is compliant with the RSS 2.0 specification, implementing many of the optional feed elements.
Author:
João Carvalho (joao.pedro.carvalho@tecnico.ulisboa.pt)
  • Constructor Details

    • RSSService

      public RSSService()
  • Method Details

    • generateRSSForSite

      public static String generateRSSForSite(Site site, Locale locale) throws XMLStreamException
      Returns the RSS 2.0 feed for the given Site, containing all the site's posts as items.
      Parameters:
      site - The site to generate the feed for.
      locale - The locale in which to generate the feed.
      Returns:
      The XML of the feed
      Throws:
      XMLStreamException - If an exception occurs while generating the feed
    • generateRSSForCategory

      public static String generateRSSForCategory(Category category, Locale locale) throws XMLStreamException
      Returns the RSS 2.0 feed for the given Category, containing all the category's posts as items.
      Parameters:
      category - The category to generate the feed for.
      locale - The locale in which to generate the feed.
      Returns:
      The XML of the feed
      Throws:
      XMLStreamException - If an exception occurs while generating the feed