Package io.goobi.viewer.model.rss
Class RSSFeed
java.lang.Object
io.goobi.viewer.model.rss.RSSFeed
Builds and serialises an RSS feed from Solr search results for the viewer's RSS endpoint.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateLink(String rootPath, String pi, int pageNo, PageType pageType) createLink.static com.rometools.rome.feed.synd.SyndFeedcreateRss.static com.rometools.rome.feed.synd.SyndFeedcreateRss(String rootPath, String query, List<String> filterQueries, String language, int maxItems, String sortField, boolean sortDescending) Creates RSS feed for the RSS REST API endpoint.static com.rometools.rome.feed.synd.SyndFeedcreateRssFeed(String language, Integer maxHits, String subtheme, String query, String facets, HttpServletRequest servletRequest, String sortField, boolean sortDescending) static ChannelcreateRssFeed(String rootPath, String query, int rssFeedItems) createRssFeed.static ChannelcreateRssFeed(String rootPath, String query, List<String> filterQueries, int rssFeedItems, String language, String sortField, boolean sortDescending) createRssFeed.static StringcreateRssFeedString(String language, Integer maxHits, String subtheme, String query, String facets, HttpServletRequest servletRequest, String sortField, boolean sortDescending) static ChannelcreateRssResponse(String language, Integer maxHits, String subtheme, String query, String facets, HttpServletRequest servletRequest, String sortField, boolean sortDescending) getFieldsWithTranslation(Locale locale) getFieldsWithTranslation.
-
Method Details
-
createRss
public static com.rometools.rome.feed.synd.SyndFeed createRss(String rootPath, String query, int maxItems) throws PresentationException, IndexUnreachableException, ViewerConfigurationException, DAOException createRss.- Parameters:
rootPath- base URL of the viewer instancequery- Solr query string to select feed entriesmaxItems- maximum number of feed items to return- Returns:
- the generated RSS 2.0 SyndFeed containing the matching entries
- Throws:
PresentationException- if any.IndexUnreachableException- if any.ViewerConfigurationException- if any.DAOException
-
getFieldsWithTranslation
getFieldsWithTranslation.- Parameters:
locale- locale whose language suffix is appended to each field name- Returns:
- list of base field names and their language-specific variants
-
createRss
public static com.rometools.rome.feed.synd.SyndFeed createRss(String rootPath, String query, List<String> filterQueries, String language, int maxItems, String sortField, boolean sortDescending) throws PresentationException, IndexUnreachableException, ViewerConfigurationException, DAOException Creates RSS feed for the RSS REST API endpoint.- Parameters:
rootPath- base URL of the viewer instancequery- Solr query string to select feed entriesfilterQueries- additional Solr filter queries to restrict resultslanguage- BCP-47 language tag for feed language and translationsmaxItems- maximum number of feed items to returnsortField- Solr field name used for sortingsortDescending- true to sort descending; false for ascending- Returns:
- the generated RSS 2.0 SyndFeed containing the matching entries with the given language and sort order
- Throws:
PresentationException- if any.IndexUnreachableException- if any.ViewerConfigurationException- if any.DAOException
-
createRssFeed
public static Channel createRssFeed(String rootPath, String query, int rssFeedItems) throws PresentationException, IndexUnreachableException, ViewerConfigurationException, DAOException createRssFeed.- Parameters:
rootPath- base URL of the viewer instancequery- Solr query string to select feed entriesrssFeedItems- maximum number of feed items to return- Returns:
- the generated RSS Channel containing the matching entries
- Throws:
PresentationException- if any.IndexUnreachableException- if any.ViewerConfigurationException- if any.DAOException
-
createRssFeed
public static Channel createRssFeed(String rootPath, String query, List<String> filterQueries, int rssFeedItems, String language, String sortField, boolean sortDescending) throws PresentationException, IndexUnreachableException, ViewerConfigurationException, DAOException createRssFeed.- Parameters:
rootPath- base URL of the viewer instancequery- Solr query string to select feed entriesfilterQueries- additional Solr filter queries to restrict resultsrssFeedItems- maximum number of feed items to returnlanguage- BCP-47 language tag for feed language and translationssortField- Solr field name used for sortingsortDescending- true to sort descending; false for ascending- Returns:
- the generated RSS Channel containing the matching entries with the given language and sort order
- Throws:
PresentationException- if any.IndexUnreachableException- if any.ViewerConfigurationException- if any.DAOException
-
createLink
createLink.- Parameters:
rootPath- base URL of the viewer instancepi- persistent identifier of the recordpageNo- representative page number for URL constructionpageType- viewer page type determining the URL pattern- Returns:
- fully qualified URL to the record page
-
createRssResponse
public static Channel createRssResponse(String language, Integer maxHits, String subtheme, String query, String facets, HttpServletRequest servletRequest, String sortField, boolean sortDescending) throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - Parameters:
language- BCP-47 language tag for feed language and translationsmaxHits- maximum number of feed items to returnsubtheme- subtheme/partner identifier to filter resultsquery- optional Solr query string to filter resultsfacets- active facet string to apply as filter queriesservletRequest- HTTP servlet request used to determine base URL and localesortField- Solr field name used for sortingsortDescending- true to sort descending; false for ascending- Returns:
Channel- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
createRssFeedString
public static String createRssFeedString(String language, Integer maxHits, String subtheme, String query, String facets, HttpServletRequest servletRequest, String sortField, boolean sortDescending) throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException - Parameters:
language- BCP-47 language tag for feed language and translationsmaxHits- maximum number of feed items to returnsubtheme- subtheme/partner identifier to filter resultsquery- optional Solr query string to filter resultsfacets- active facet string to apply as filter queriesservletRequest- HTTP servlet request used to determine base URL and localesortField- Solr field name used for sortingsortDescending- true to sort descending; false for ascending- Returns:
- RSS feed as
String - Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
-
createRssFeed
public static com.rometools.rome.feed.synd.SyndFeed createRssFeed(String language, Integer maxHits, String subtheme, String query, String facets, HttpServletRequest servletRequest, String sortField, boolean sortDescending) throws PresentationException, IndexUnreachableException, ViewerConfigurationException, DAOException - Parameters:
language- BCP-47 language tag for feed language and translationsmaxHits- maximum number of feed items to returnsubtheme- subtheme/partner identifier to filter resultsquery- optional Solr query string to filter resultsfacets- active facet string to apply as filter queriesservletRequest- HTTP servlet request used to determine base URL and localesortField- Solr field name used for sortingsortDescending- true to sort descending; false for ascending- Returns:
SyndFeed- Throws:
PresentationExceptionIndexUnreachableExceptionViewerConfigurationExceptionDAOException
-