Class AbstractBuilder
java.lang.Object
io.goobi.viewer.model.iiif.presentation.v3.builder.AbstractBuilder
- Direct Known Subclasses:
CanvasBuilder
,CollectionBuilder
,ManifestBuilder
,RangeBuilder
Abstract AbstractBuilder class.
- Author:
- Florian Alpers
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Configuration
protected final DataRetriever
protected final int
protected final int
protected final AbstractApiUrlManager
protected final AbstractBuilder
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractBuilder
(AbstractApiUrlManager apiUrlManager) Constructor for AbstractBuilder. -
Method Summary
Modifier and TypeMethodDescriptionabsolutize
(String uri) absolutize
(URI uri) void
addMetadata
(de.intranda.api.iiif.presentation.v3.AbstractPresentationModelElement3 manifest, StructElement ele) addMetadata.protected boolean
Return true if the field is contained in displayFields, accounting for wildcard charactersprotected de.intranda.api.iiif.presentation.v3.Collection3
protected de.intranda.metadata.multilanguage.IMetadataValue
createLabel
(String text) protected de.intranda.api.iiif.presentation.v3.Manifest3
getAnnotationListURI
(String pi, int pageNo, de.intranda.api.iiif.presentation.enums.AnnotationType type, boolean openAnnotation) getAnnotationListURI.getAnnotationListURI
(String pi, de.intranda.api.iiif.presentation.enums.AnnotationType type) getAnnotationListURI.getAnnotationURI.getAnnotationURI
(String pi, int order, de.intranda.api.iiif.presentation.enums.AnnotationType type, int annoNum) getAnnotationURI.protected List<de.intranda.metadata.multilanguage.IMetadataValue>
Gets the attribution text configured in webapi.iiif.attribution and returns all translations if any are found, or the configured string itself otherwiseGet URL to auto complete service fromApiUrls
getAutoSuggestURI
(String pi, String query, List<String> motivation) getAutoSuggestURI.getCanvasURI
(String pi, int pageNo) getCanvasURI.getCollectionURI
(String collectionField, String baseCollectionName) getCollectionURI.getCommentAnnotationURI
(long id) getCommentAnnotationURI.protected Optional<de.intranda.metadata.multilanguage.IMetadataValue>
getDescription.protected String
getFilename
(String path) getImageAnnotationURI
(String pi, int order) getImageAnnotationURI.protected Optional<de.intranda.metadata.multilanguage.IMetadataValue>
getLabel
(StructElement ele) getDescription.protected de.intranda.metadata.multilanguage.IMetadataValue
Optional<de.intranda.metadata.multilanguage.IMetadataValue>
getLabelIfExists
(org.apache.solr.common.SolrDocument solrDocument) Simple method to create a label for aSolrDocument
fromSolrConstants.LABEL
,SolrConstants.TITLE
orSolrConstants.DOCSTRCT
getLidoResolverUrl.protected Locale
getLocale.getManifestURI
(String pi) getManifestURI.getMetsResolverUrl.Get the page order (1-based) from a canavs URI.getPIFromCanvasURI
(URI uri) Get the persistent identifier from a canvas URI.protected de.intranda.api.iiif.presentation.v3.IIIFAgent
getProvider
(ProviderConfiguration providerConfig) getRangeURI
(String pi, String logId) getRangeURI.protected de.intranda.metadata.multilanguage.Metadata
Get URL to search service fromApiUrls
getSearchURI
(String pi, String query, List<String> motivation) getSearchURI.getSolrFieldValue
(StructElement ele, String fieldName) protected de.intranda.api.annotation.wa.ImageResource
protected de.intranda.api.annotation.wa.ImageResource
getThumbnail
(StructElement ele, int pageNo) protected de.intranda.api.annotation.wa.ImageResource
getThumbnail
(String pi) getViewUrl
(PhysicalElement ele, PageType pageType) getViewUrl.
-
Field Details
-
urls
-
dataRetriever
-
v1Builder
-
thumbWidth
protected final int thumbWidth -
thumbHeight
protected final int thumbHeight -
config
-
-
Constructor Details
-
AbstractBuilder
Constructor for AbstractBuilder.
- Parameters:
apiUrlManager
-
-
-
Method Details
-
getLabel
- Parameters:
key
-- Returns:
IMetadataValue
-
absolutize
- Parameters:
uri
-- Returns:
URI
-
absolutize
- Parameters:
uri
-- Returns:
URI
-
getLocale
getLocale.
-
getMetsResolverUrl
getMetsResolverUrl.
- Parameters:
ele
- aStructElement
object.- Returns:
- METS resolver link for the DFG Viewer
-
getLidoResolverUrl
getLidoResolverUrl.
- Parameters:
ele
- aStructElement
object.- Returns:
- LIDO resolver link for the DFG Viewer
-
getViewUrl
getViewUrl.
- Parameters:
ele
- aPhysicalElement
object.pageType
- aPageType
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 aSolrDocument
fromSolrConstants.LABEL
,SolrConstants.TITLE
orSolrConstants.DOCSTRCT
- Parameters:
solrDocument
- aSolrDocument
object.- Returns:
- a
Optional
object.
-
addMetadata
public void addMetadata(de.intranda.api.iiif.presentation.v3.AbstractPresentationModelElement3 manifest, StructElement ele) addMetadata.
- Parameters:
manifest
- aAbstractPresentationModelElement3
object.ele
- aStructElement
object.
-
getSolrFieldValue
- Parameters:
ele
-fieldName
-- Returns:
- Optional
-
getRightsStatement
- Parameters:
ele
-- Returns:
- Optional
-
contained
Return true if the field is contained in displayFields, accounting for wildcard characters- Parameters:
field
-displayFields
-- Returns:
- a boolean
-
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
- aStructElement
object.- Returns:
- a
Optional
object.
-
getLabel
getDescription.
- Parameters:
ele
- aStructElement
object.- Returns:
- a
Optional
object.
-
getCollectionURI
getCollectionURI.
-
getRangeURI
getRangeURI.
-
getCanvasURI
getCanvasURI.
-
getPageOrderFromCanvasURI
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 -
getPIFromCanvasURI
Get the persistent identifier from a canvas URI. This is the URI path param between '/iiif/manifests/' and '/canvas/'- Parameters:
uri
- aURI
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.
-
getAnnotationListURI
public URI getAnnotationListURI(String pi, de.intranda.api.iiif.presentation.enums.AnnotationType type) getAnnotationListURI.
-
getCommentAnnotationURI
getCommentAnnotationURI.
- Parameters:
id
- a long.- Returns:
- a
URI
object.
-
getImageAnnotationURI
getImageAnnotationURI.
-
getAnnotationURI
public URI getAnnotationURI(String pi, int order, de.intranda.api.iiif.presentation.enums.AnnotationType type, int annoNum) throws URISyntaxException getAnnotationURI.
- Parameters:
pi
- aString
object.order
- a int.type
- aAnnotationType
object.annoNum
- a int.- Returns:
- a
URI
object. - Throws:
URISyntaxException
- if any.
-
getAnnotationURI
getAnnotationURI.
-
getSearchServiceURI
Get URL to search service fromApiUrls
- Parameters:
pi
- The persistent identifier of the work to search- Returns:
- the service URI
-
getAutoCompleteServiceURI
Get URL to auto complete service fromApiUrls
- Parameters:
pi
- The persistent identifier of the work to search for autocomplete- Returns:
- the service URI
-
getSearchURI
getSearchURI.
-
getAutoSuggestURI
getAutoSuggestURI.
-
createRecordLink
- Parameters:
rec
-- Returns:
Manifest3
-
createAnchorLink
- 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
- Parameters:
ele
-- Returns:
ImageResource
-
getThumbnail
-
createLabel
- Parameters:
text
-- Returns:
- a simple metadata value with the given text, or null if text is blank
-
getFilename
- Parameters:
path
-- Returns:
- File name
-
getManifestURI
getManifestURI.
-
getExternalManifestURI
-