Package org.fenixedu.cms.rss
Class RSSService
java.lang.Object
org.fenixedu.cms.rss.RSSService
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringgenerateRSSForCategory(Category category, Locale locale) Returns the RSS 2.0 feed for the givenCategory, containing all the category's posts as items.static StringgenerateRSSForSite(Site site, Locale locale) Returns the RSS 2.0 feed for the givenSite, containing all the site's posts as items.
-
Constructor Details
-
RSSService
public RSSService()
-
-
Method Details
-
generateRSSForSite
Returns the RSS 2.0 feed for the givenSite, 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 givenCategory, 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
-