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
FieldsModifier and TypeFieldDescriptionprotected final Configurationprotected final DataRetrieverprotected final intprotected final intprotected final AbstractApiUrlManagerprotected final AbstractBuilder -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractBuilder(AbstractApiUrlManager apiUrlManager) Constructor for AbstractBuilder. -
Method Summary
Modifier and TypeMethodDescriptionabsolutize(String uri) absolutize(URI uri) voidaddMetadata(de.intranda.api.iiif.presentation.v3.AbstractPresentationModelElement3 manifest, StructElement ele) addMetadata.protected booleanReturn true if the field is contained in displayFields, accounting for wildcard charactersprotected de.intranda.api.iiif.presentation.v3.Collection3protected de.intranda.metadata.multilanguage.IMetadataValuecreateLabel(String text) protected de.intranda.api.iiif.presentation.v3.Manifest3protected StringgetAnnotationListURI(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 fromApiUrlsgetAutoSuggestURI(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 StringgetFilename(String path) getImageAnnotationURI(String pi, int order) getImageAnnotationURI.protected Optional<de.intranda.metadata.multilanguage.IMetadataValue> getLabel(StructElement ele) getDescription.protected de.intranda.metadata.multilanguage.IMetadataValueOptional<de.intranda.metadata.multilanguage.IMetadataValue> getLabelIfExists(org.apache.solr.common.SolrDocument solrDocument) Simple method to create a label for aSolrDocumentfromSolrConstants.LABEL,SolrConstants.TITLEorSolrConstants.DOCSTRCTgetLidoResolverUrl.protected LocalegetLocale.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.IIIFAgentgetProvider(ProviderConfiguration providerConfig) getRangeURI(String pi, String logId) getRangeURI.protected de.intranda.metadata.multilanguage.MetadataGet URL to search service fromApiUrlsgetSearchURI(String pi, String query, List<String> motivation) getSearchURI.getSolrFieldValue(StructElement ele, String fieldName) protected de.intranda.api.annotation.wa.ImageResourcegetThumbnail(PhysicalElement page) Thumbnail (individual pages of a record manifest).protected de.intranda.api.annotation.wa.ImageResourceThumbnail (record).protected de.intranda.api.annotation.wa.ImageResourcegetThumbnail(StructElement ele, int pageNo) Thumbnail (page manifest).protected de.intranda.api.annotation.wa.ImageResourcegetThumbnail(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- aStructElementobject.- Returns:
- METS resolver link for the DFG Viewer
-
getLidoResolverUrl
getLidoResolverUrl.
- Parameters:
ele- aStructElementobject.- Returns:
- LIDO resolver link for the DFG Viewer
-
getViewUrl
getViewUrl.
- Parameters:
ele- aPhysicalElementobject.pageType- aPageTypeobject.- 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 aSolrDocumentfromSolrConstants.LABEL,SolrConstants.TITLEorSolrConstants.DOCSTRCT- Parameters:
solrDocument- aSolrDocumentobject.- Returns:
- a
Optionalobject.
-
addMetadata
public void addMetadata(de.intranda.api.iiif.presentation.v3.AbstractPresentationModelElement3 manifest, StructElement ele) addMetadata.
- Parameters:
manifest- aAbstractPresentationModelElement3object.ele- aStructElementobject.
-
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- aStructElementobject.- Returns:
- a
Optionalobject.
-
getLabel
getDescription.
- Parameters:
ele- aStructElementobject.- Returns:
- a
Optionalobject.
-
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- aURIobject.- 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
URIobject.
-
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- aStringobject.order- a int.type- aAnnotationTypeobject.annoNum- a int.- Returns:
- a
URIobject. - 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:
IndexUnreachableExceptionPresentationExceptionViewerConfigurationException
-
getThumbnail
Thumbnail (record).- Parameters:
ele-- Returns:
ImageResource
-
getThumbnail
Thumbnail (page manifest).- Parameters:
ele-pageNo-- Returns:
ImageResource
-
getThumbnail
Thumbnail (individual pages of a record manifest).- Parameters:
page-- Returns:
ImageResource
-
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
-
escapeURI
-