Class RSSFeed

java.lang.Object
io.goobi.viewer.model.rss.RSSFeed

public final class RSSFeed extends Object
Builds and serialises an RSS feed from Solr search results for the viewer's RSS endpoint.
  • 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 instance
      query - Solr query string to select feed entries
      maxItems - 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

      public static List<String> getFieldsWithTranslation(Locale locale)
      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 instance
      query - Solr query string to select feed entries
      filterQueries - additional Solr filter queries to restrict results
      language - BCP-47 language tag for feed language and translations
      maxItems - maximum number of feed items to return
      sortField - Solr field name used for sorting
      sortDescending - 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 instance
      query - Solr query string to select feed entries
      rssFeedItems - 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 instance
      query - Solr query string to select feed entries
      filterQueries - additional Solr filter queries to restrict results
      rssFeedItems - maximum number of feed items to return
      language - BCP-47 language tag for feed language and translations
      sortField - Solr field name used for sorting
      sortDescending - 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

      public static String createLink(String rootPath, String pi, int pageNo, PageType pageType)
      createLink.
      Parameters:
      rootPath - base URL of the viewer instance
      pi - persistent identifier of the record
      pageNo - representative page number for URL construction
      pageType - 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 translations
      maxHits - maximum number of feed items to return
      subtheme - subtheme/partner identifier to filter results
      query - optional Solr query string to filter results
      facets - active facet string to apply as filter queries
      servletRequest - HTTP servlet request used to determine base URL and locale
      sortField - Solr field name used for sorting
      sortDescending - 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 translations
      maxHits - maximum number of feed items to return
      subtheme - subtheme/partner identifier to filter results
      query - optional Solr query string to filter results
      facets - active facet string to apply as filter queries
      servletRequest - HTTP servlet request used to determine base URL and locale
      sortField - Solr field name used for sorting
      sortDescending - 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 translations
      maxHits - maximum number of feed items to return
      subtheme - subtheme/partner identifier to filter results
      query - optional Solr query string to filter results
      facets - active facet string to apply as filter queries
      servletRequest - HTTP servlet request used to determine base URL and locale
      sortField - Solr field name used for sorting
      sortDescending - true to sort descending; false for ascending
      Returns:
      SyndFeed
      Throws:
      PresentationException
      IndexUnreachableException
      ViewerConfigurationException
      DAOException