java.lang.Object
io.goobi.viewer.model.iiif.presentation.v3.builder.AbstractBuilder
Direct Known Subclasses:
CanvasBuilder, CollectionBuilder, ManifestBuilder, RangeBuilder

public abstract class AbstractBuilder extends Object

Abstract AbstractBuilder class.

Author:
Florian Alpers
  • Field Details

    • urls

      protected final AbstractApiUrlManager urls
    • dataRetriever

      protected final DataRetriever dataRetriever
    • v1Builder

      protected final AbstractBuilder v1Builder
    • thumbWidth

      protected final int thumbWidth
    • thumbHeight

      protected final int thumbHeight
  • Constructor Details

    • AbstractBuilder

      protected AbstractBuilder(AbstractApiUrlManager apiUrlManager)

      Constructor for AbstractBuilder.

      Parameters:
      apiUrlManager -
  • Method Details

    • getLabel

      protected de.intranda.metadata.multilanguage.IMetadataValue getLabel(String key)
      Parameters:
      key -
      Returns:
      IMetadataValue
    • absolutize

      public URI absolutize(URI uri)
      Parameters:
      uri -
      Returns:
      URI
    • absolutize

      public URI absolutize(String uri)
      Parameters:
      uri -
      Returns:
      URI
    • getLocale

      protected Locale getLocale(String language)

      getLocale.

      Parameters:
      language - a String object.
      Returns:
      a Locale object.
    • getMetsResolverUrl

      public URI getMetsResolverUrl(StructElement ele)

      getMetsResolverUrl.

      Parameters:
      ele - a StructElement object.
      Returns:
      METS resolver link for the DFG Viewer
    • getLidoResolverUrl

      public URI getLidoResolverUrl(StructElement ele)

      getLidoResolverUrl.

      Parameters:
      ele - a StructElement object.
      Returns:
      LIDO resolver link for the DFG Viewer
    • getViewUrl

      public String getViewUrl(PhysicalElement ele, PageType pageType)

      getViewUrl.

      Parameters:
      ele - a PhysicalElement object.
      pageType - a PageType object.
      Returns:
      viewer url for the given page in the given PageType
    • getLabelIfExists

      public Optional<de.intranda.metadata.multilanguage.IMetadataValue> getLabelIfExists(org.apache.solr.common.SolrDocument solrDocument)
      Simple method to create a label for a SolrDocument from io.goobi.viewer.controller.SolrConstants.LABEL, io.goobi.viewer.controller.SolrConstants.TITLE or io.goobi.viewer.controller.SolrConstants.DOCSTRUCT
      Parameters:
      solrDocument - a SolrDocument object.
      Returns:
      a Optional object.
    • addMetadata

      public void addMetadata(de.intranda.api.iiif.presentation.v3.AbstractPresentationModelElement3 manifest, StructElement ele)

      addMetadata.

      Parameters:
      manifest - a de.intranda.api.iiif.presentation.AbstractPresentationModelElement object.
      ele - a StructElement object.
    • getSolrFieldValue

      protected Optional<String> getSolrFieldValue(StructElement ele, String fieldName)
      Parameters:
      ele -
      fieldName -
      Returns:
      Optional
    • getRightsStatement

      protected Optional<URI> getRightsStatement(StructElement ele)
      Parameters:
      ele -
      Returns:
      Optional
    • contained

      protected boolean contained(String field, List<String> displayFields)
      Return true if the field is contained in displayFields, accounting for wildcard characters
      Parameters:
      field -
      displayFields -
      Returns:
      a boolean
    • getAttributions

      protected List<de.intranda.metadata.multilanguage.IMetadataValue> getAttributions()
      Gets the attribution text configured in webapi.iiif.attribution and returns all translations if any are found, or the configured string itself otherwise
      Returns:
      the configured attribution
    • getDescription

      protected Optional<de.intranda.metadata.multilanguage.IMetadataValue> getDescription(StructElement ele)

      getDescription.

      Parameters:
      ele - a StructElement object.
      Returns:
      a Optional object.
    • getLabel

      protected Optional<de.intranda.metadata.multilanguage.IMetadataValue> getLabel(StructElement ele)

      getDescription.

      Parameters:
      ele - a StructElement object.
      Returns:
      a Optional object.
    • getCollectionURI

      public URI getCollectionURI(String collectionField, String baseCollectionName)

      getCollectionURI.

      Parameters:
      collectionField - a String object.
      baseCollectionName - a String object.
      Returns:
      a URI object.
    • getManifestURI

      public URI getManifestURI(String pi)

      getManifestURI.

      Parameters:
      pi - a String object.
      Returns:
      a URI object.
    • getRangeURI

      public URI getRangeURI(String pi, String logId)

      getRangeURI.

      Parameters:
      pi - a String object.
      logId - a String object.
      Returns:
      a URI object.
    • getCanvasURI

      public URI getCanvasURI(String pi, int pageNo)

      getCanvasURI.

      Parameters:
      pi - a String object.
      pageNo - a int.
      Returns:
      a URI object.
    • getPageOrderFromCanvasURI

      public Integer getPageOrderFromCanvasURI(URI uri)
      Get the page order (1-based) from a canavs URI. That is the number in the last path parameter after '/canvas/' If the URI doesn't match a canvas URI, null is returned
      Parameters:
      uri - a URI object.
      Returns:
      a Integer object.
    • getPIFromCanvasURI

      public String getPIFromCanvasURI(URI uri)
      Get the persistent identifier from a canvas URI. This is the URI path param between '/iiif/manifests/' and '/canvas/'
      Parameters:
      uri - a URI object.
      Returns:
      The pi, or null if the URI doesn't match a iiif canvas URI
    • getAnnotationListURI

      public URI getAnnotationListURI(String pi, int pageNo, de.intranda.api.iiif.presentation.enums.AnnotationType type, boolean openAnnotation)

      getAnnotationListURI.

      Parameters:
      pi - a String object.
      pageNo - a int.
      type - a AnnotationType object.
      openAnnotation -
      Returns:
      a URI object.
    • getAnnotationListURI

      public URI getAnnotationListURI(String pi, de.intranda.api.iiif.presentation.enums.AnnotationType type)

      getAnnotationListURI.

      Parameters:
      pi - a String object.
      type - a AnnotationType object.
      Returns:
      a URI object.
    • getCommentAnnotationURI

      public URI getCommentAnnotationURI(long id)

      getCommentAnnotationURI.

      Parameters:
      id - a long.
      Returns:
      a URI object.
    • getImageAnnotationURI

      public URI getImageAnnotationURI(String pi, int order)

      getImageAnnotationURI.

      Parameters:
      pi - a String object.
      order - a int.
      Returns:
      a URI object.
    • getAnnotationURI

      public URI getAnnotationURI(String pi, int order, de.intranda.api.iiif.presentation.enums.AnnotationType type, int annoNum) throws URISyntaxException

      getAnnotationURI.

      Parameters:
      pi - a String object.
      order - a int.
      type - a AnnotationType object.
      annoNum - a int.
      Returns:
      a URI object.
      Throws:
      URISyntaxException - if any.
    • getAnnotationURI

      public URI getAnnotationURI(String id)

      getAnnotationURI.

      Parameters:
      id - a String object.
      Returns:
      a URI object.
    • getSearchServiceURI

      public URI getSearchServiceURI(String pi)
      Get URL to search service from ApiUrls
      Parameters:
      pi - The persistent identifier of the work to search
      Returns:
      the service URI
    • getAutoCompleteServiceURI

      public URI getAutoCompleteServiceURI(String pi)
      Get URL to auto complete service from ApiUrls
      Parameters:
      pi - The persistent identifier of the work to search for autocomplete
      Returns:
      the service URI
    • getSearchURI

      public URI getSearchURI(String pi, String query, List<String> motivation)

      getSearchURI.

      Parameters:
      pi - a String object.
      query - a String object.
      motivation - a List object.
      Returns:
      a URI object.
    • getAutoSuggestURI

      public URI getAutoSuggestURI(String pi, String query, List<String> motivation)

      getAutoSuggestURI.

      Parameters:
      pi - a String object.
      query - a String object.
      motivation - a List object.
      Returns:
      a URI object.
    • createRecordLink

      protected de.intranda.api.iiif.presentation.v3.Manifest3 createRecordLink(StructElement rec)
      Parameters:
      rec -
      Returns:
      Manifest3
    • createAnchorLink

      protected de.intranda.api.iiif.presentation.v3.Collection3 createAnchorLink(StructElement rec)
      Parameters:
      rec -
      Returns:
      Collection3
    • getRequiredStatement

      protected de.intranda.metadata.multilanguage.Metadata getRequiredStatement()
    • getProvider

      protected de.intranda.api.iiif.presentation.v3.IIIFAgent getProvider(ProviderConfiguration providerConfig)
      Parameters:
      providerConfig -
      Returns:
      IIIFAgent
    • getThumbnail

      protected de.intranda.api.annotation.wa.ImageResource getThumbnail(String pi) throws IndexUnreachableException, PresentationException, ViewerConfigurationException
      Parameters:
      pi -
      Returns:
      ImageResource
      Throws:
      IndexUnreachableException
      PresentationException
      ViewerConfigurationException
    • getThumbnail

      protected de.intranda.api.annotation.wa.ImageResource getThumbnail(StructElement ele)
      Parameters:
      ele -
      Returns:
      ImageResource
    • getThumbnail

      protected de.intranda.api.annotation.wa.ImageResource getThumbnail(StructElement ele, int pageNo)
    • createLabel

      protected de.intranda.metadata.multilanguage.IMetadataValue createLabel(String text)
      Parameters:
      text -
      Returns:
      a simple metadata value with the given text, or null if text is blank
    • getFilename

      protected String getFilename(String path)
      Parameters:
      path -
      Returns:
      File name