Class CollectionsResource
- Author:
- Florian Alpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncontentAssist(String input) Returns collection names starting with the given input, expanded to every hierarchy level and excluding names already configured as CMS collections.de.intranda.api.iiif.presentation.v2.Collection2getAllCollections(String grouping, String ignoreString) Returns the top-level collections of a Solr field's collection hierarchy as a IIIF Presentation 2.1.1 collection.de.intranda.api.iiif.presentation.v2.Collection2getCollection(String inCollectionName, String grouping, String ignoreString) Returns a single collection of a Solr field's hierarchy, together with its immediate child collections and directly contained records, as a IIIF Presentation 2.1.1 collection.
-
Constructor Details
-
CollectionsResource
public CollectionsResource(@PathParam("field") String solrField, @Context HttpServletRequest request)
-
-
Method Details
-
getAllCollections
@GET @Produces("application/json") public de.intranda.api.iiif.presentation.v2.Collection2 getAllCollections(@QueryParam("grouping") String grouping, @QueryParam("ignore") String ignoreString) throws PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException, URISyntaxException, ViewerConfigurationException Returns the top-level collections of a Solr field's collection hierarchy as a IIIF Presentation 2.1.1 collection.Passing a grouping field attaches a tag list service to each returned collection, listing that field's facet values for the collection's records. Names listed in the ignore parameter are removed from the result before it is checked; a field that yields no collections at all results in a not-found response instead of an empty one.
- Parameters:
grouping- add values of this field to response to allow grouping of resultsignoreString- comma separated list of collections to ignore in response- Returns:
- the IIIF Presentation 2.1.1 collection listing the field's top-level collections
- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException- if no collections exist for the given fieldPresentationExceptionIndexUnreachableExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionURISyntaxExceptionViewerConfigurationException
-
getCollection
@GET @Path("/{collection}") @Produces("application/json") public de.intranda.api.iiif.presentation.v2.Collection2 getCollection(@PathParam("collection") String inCollectionName, @QueryParam("grouping") String grouping, @QueryParam("ignore") String ignoreString) throws PresentationException, IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException, URISyntaxException, ViewerConfigurationException Returns a single collection of a Solr field's hierarchy, together with its immediate child collections and directly contained records, as a IIIF Presentation 2.1.1 collection.A collection name that does not resolve to any element in the field's hierarchy falls back to the field's top-level collections, but with the first one in sort order removed; for a field with only one top-level collection this fallback is empty and results in the same not-found response as a field with no collections at all. Passing a grouping field attaches a tag list service to the returned collection and its children, listing that field's facet values.
- Parameters:
inCollectionName- name of the collection. Must be a value of the Solr field the collection is based ongrouping- add values of this field to response to allow grouping of resultsignoreString- comma separated list of subcollections to ignore in response- Returns:
- the IIIF Presentation 2.1.1 collection for the given collection name
- Throws:
de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException- if the requested collection has no membersPresentationExceptionIndexUnreachableExceptionde.unigoettingen.sub.commons.contentlib.exceptions.ContentLibExceptionURISyntaxExceptionViewerConfigurationException
-
contentAssist
@GET @Path("/contentassist") @Produces("application/json") public List<String> contentAssist(@QueryParam("query") String input) throws IndexUnreachableException, de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException, de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException Returns collection names starting with the given input, expanded to every hierarchy level and excluding names already configured as CMS collections.Passing "-" as the input returns all collection names for the field instead of filtering by prefix. Results are sorted by hierarchy depth first, then alphabetically. A Solr field name that is syntactically valid but does not exist in the index results in a not-found response.
- Parameters:
input- user input for which content assist is requested- Returns:
- list of matching collection names
- Throws:
IndexUnreachableException- if the Solr index is unreachable or rejects the collection queryde.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException- if the Solr field does not exist in the indexde.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException
-