Class CollectionsResource

java.lang.Object
io.goobi.viewer.api.rest.v1.collections.CollectionsResource

@Path("/collections/{field}") public class CollectionsResource extends Object
REST resource for browsing collection hierarchies and retrieving collection metadata.
Author:
Florian Alpers
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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.Collection2
    getAllCollections(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.Collection2
    getCollection(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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • 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 results
      ignoreString - 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 field
      PresentationException
      IndexUnreachableException
      de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
      URISyntaxException
      ViewerConfigurationException
    • 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 on
      grouping - add values of this field to response to allow grouping of results
      ignoreString - 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 members
      PresentationException
      IndexUnreachableException
      de.unigoettingen.sub.commons.contentlib.exceptions.ContentLibException
      URISyntaxException
      ViewerConfigurationException
    • 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 query
      de.unigoettingen.sub.commons.contentlib.exceptions.ContentNotFoundException - if the Solr field does not exist in the index
      de.unigoettingen.sub.commons.contentlib.exceptions.IllegalRequestException