Class StructureBuilder
java.lang.Object
io.goobi.viewer.model.iiif.presentation.v2.builder.AbstractBuilder
io.goobi.viewer.model.iiif.presentation.v2.builder.StructureBuilder
Builds the Range (structure) resources within a IIIF Presentation API v2 Manifest from the record's logical structure.
- Author:
- Florian Alpers
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstantBASE_RANGE_LABEL="CONTENT".protected ImageDeliveryBeanFields inherited from class io.goobi.viewer.model.iiif.presentation.v2.builder.AbstractBuilder
config, REQUIRED_SOLR_FIELDS, urls -
Constructor Summary
ConstructorsConstructorDescriptionStructureBuilder(AbstractApiUrlManager apiUrlManager) Creates a new StructureBuilder instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRenderings(de.intranda.api.iiif.presentation.v2.AbstractPresentationModelElement2 range, StructElement ele) List<de.intranda.api.iiif.presentation.v2.Range2> generateStructure(List<StructElement> elements, String pi, boolean useMembers) Generates the topmost range from the given elements.List<de.intranda.api.iiif.presentation.v2.Range2> getDescendents(de.intranda.api.iiif.presentation.v2.Range2 range) getDescendents.voidpopulate(StructElement ele, String pi, de.intranda.api.iiif.presentation.v2.Range2 range) Adds Metadata and links to external services to a range.voidpopulatePages(StructElement doc, String pi, de.intranda.api.iiif.presentation.v2.Range2 range) populatePages.Methods inherited from class io.goobi.viewer.model.iiif.presentation.v2.builder.AbstractBuilder
absolutize, absolutize, addCrowdourcingAnnotations, addEventMetadataToWorkElement, addLanguageFields, addMetadata, addRendering, addSeeAlso, contained, getAnnotationListURI, getAnnotationListURI, getAnnotationURI, getAnnotationURI, getAttributions, getAutoCompleteServiceURI, getAutoSuggestURI, getCanvasURI, getCollectionURI, getCommentAnnotationURI, getDescription, getDocument, getDocumentWithChildren, getEventFields, getExternalManifestURI, getImageAnnotationURI, getLabel, getLabel, getLabelIfExists, getLayerURI, getLidoResolverUrl, getLocale, getManifestURI, getManifestURI, getMetsResolverUrl, getPageManifestURI, getPageOrderFromCanvasURI, getPIFromCanvasURI, getRangeURI, getRenderings, getSearchServiceURI, getSearchURI, getSeeAlsos, getSequenceURI, getSolrFieldList, getViewUrl
-
Field Details
-
imageDelivery
-
BASE_RANGE_LABEL
ConstantBASE_RANGE_LABEL="CONTENT".- See Also:
-
-
Constructor Details
-
StructureBuilder
Creates a new StructureBuilder instance.- Parameters:
apiUrlManager- API URL manager for building IIIF resource URIs
-
-
Method Details
-
generateStructure
public List<de.intranda.api.iiif.presentation.v2.Range2> generateStructure(List<StructElement> elements, String pi, boolean useMembers) throws ViewerConfigurationException, IndexUnreachableException, DAOException, PresentationException, URISyntaxException Generates the topmost range from the given elements. This is an abstract "CONTENT" range if baseElement is a work, or the range representing the given baseElement otherwise.- Parameters:
elements- All elements to include in the listpi- persistent identifier of the recorduseMembers- if true, child canvases are listed as members instead of sub-ranges- Returns:
- a list of IIIF v2 ranges representing the structural hierarchy of the record
- Throws:
ViewerConfigurationException- if any.IndexUnreachableException- if any.DAOException- if any.PresentationException- if any.URISyntaxException- if any.
-
populate
public void populate(StructElement ele, String pi, de.intranda.api.iiif.presentation.v2.Range2 range) throws ViewerConfigurationException, IndexUnreachableException, DAOException, PresentationException Adds Metadata and links to external services to a range.- Parameters:
ele- structure element whose metadata and thumbnails are added to the rangepi- persistent identifier of the recordrange- IIIF Range2 to populate with metadata and links- Throws:
ViewerConfigurationException- if any.IndexUnreachableException- if any.DAOException- if any.PresentationException- if any.
-
addRenderings
public void addRenderings(de.intranda.api.iiif.presentation.v2.AbstractPresentationModelElement2 range, StructElement ele) - Parameters:
range- the presentation element to add rendering links toele- the structure element used to resolve rendering URIs
-
populatePages
public void populatePages(StructElement doc, String pi, de.intranda.api.iiif.presentation.v2.Range2 range) throws URISyntaxException, IndexUnreachableException populatePages.- Parameters:
doc- structure element whose page range is added to the IIIF rangepi- persistent identifier of the recordrange- IIIF Range2 to add canvas references to- Throws:
URISyntaxException- if any.IndexUnreachableException- if any.
-
getDescendents
public List<de.intranda.api.iiif.presentation.v2.Range2> getDescendents(de.intranda.api.iiif.presentation.v2.Range2 range) getDescendents.- Parameters:
range- parent range whose entire sub-tree is collected- Returns:
- a list of all descendant IIIF v2 ranges in the sub-tree of the given range
-