Class RSSResource
- Author:
- Florian Alpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetRssFeed(String subtheme, String language, Integer maxHits, String query, String facets, String sortField, Boolean sortDescending) Returns an RSS feed of the most recent records as an XML string.getRssJsonFeed(String subtheme, String language, Integer maxHits, String query, String facets, String sortField, Boolean sortDescending) Returns an RSS feed of the most recent records as a JSON object.
-
Constructor Details
-
RSSResource
public RSSResource()
-
-
Method Details
-
getRssFeed
@GET @Produces("text/xml") public String getRssFeed(@QueryParam("subtheme") String subtheme, @QueryParam("lang") String language, @QueryParam("max") Integer maxHits, @QueryParam("query") String query, @QueryParam("facets") String facets, @QueryParam("sortField") String sortField, @QueryParam("sortDescending") Boolean sortDescending) throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException Returns an RSS feed of the most recent records as an XML string.The query, subtheme and facets parameters are combined into a single Solr query aggregated to the top-level structure of each matching record; facets is parsed as an active facet string and applied as separate filter queries. Parameters left out fall back to configuration or request defaults: max to the configured feed item count, sortField to DATECREATED, sortDescending to true, and lang to the request's locale. A Solr query rejected for invalid syntax is reported as a client error instead of an internal one.
- Parameters:
subtheme- Subtheme: results are filtered to values within the given subtheme (optional)language- language of the returned metadata labels and values (optional)maxHits- limit for results to return (optional)query- search query to filter results (optional)facets- facet query. Several queries may be entered as ';;' separated list (optional)sortField- the Solr field to sort the results by. Default is 'DATECREATED' (optional)sortDescending- set to 'false' to sort entries in ascending order. Default is 'true' (optional)- Returns:
- the RSS feed as an XML string
- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException- if the Solr query is malformed or the index cannot be reached
-
getRssJsonFeed
@GET @Path("/channel.json") @Produces("application/json") public Channel getRssJsonFeed(@QueryParam("subtheme") String subtheme, @QueryParam("lang") String language, @QueryParam("max") Integer maxHits, @QueryParam("query") String query, @QueryParam("facets") String facets, @QueryParam("sortField") String sortField, @QueryParam("sortDescending") Boolean sortDescending) throws de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException Returns an RSS feed of the most recent records as a JSON object.The query, subtheme and facets parameters are combined into a single Solr query searched without aggregating hits to a record's top-level structure; facets is parsed as an active facet string and applied as separate filter queries. Parameters left out fall back to configuration or request defaults: max to the configured feed item count, sortField to DATECREATED, sortDescending to true, and lang to the request's locale. A Solr query rejected for invalid syntax is reported as a client error instead of an internal one.
- Parameters:
subtheme- Subtheme: results are filtered to values within the given subtheme (optional)language- language of the returned metadata labels and values (optional)maxHits- limit for results to return (optional)query- search query to filter results (optional)facets- facet query. Several queries may be entered as ';;' separated list (optional)sortField- the Solr field to sort the results by. Default is 'DATECREATED' (optional)sortDescending- set to 'false' to sort entries in ascending order. Default is 'true' (optional)- Returns:
- the RSS feed as a
Channel - Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException- if the Solr query is malformed or the index cannot be reached
-