Package io.goobi.viewer.model.viewer
Class StructElement
java.lang.Object
io.goobi.viewer.model.viewer.StructElementStub
io.goobi.viewer.model.viewer.StructElement
- All Implemented Interfaces:
Serializable
,Comparable<StructElementStub>
public class StructElement
extends StructElementStub
implements Comparable<StructElementStub>, Serializable
Each instance of this class represents a structure element. This class extends
StructElementStub
and contains additional
memory-intensive members such as the corresponding Solr document, references to parent and child StructElements and full-text.- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionclass
Shape metadata for docstructs that represent only a portion of a page (or several pages). -
Field Summary
Fields inherited from class io.goobi.viewer.model.viewer.StructElementStub
anchor, cmsPage, dataRepository, docStructType, docType, imageNumber, label, logid, luceneId, metadataFields, numVolumes, partnerId, pi, sourceDocFormat, volume, volumeNo, volumeNoSort, work
-
Constructor Summary
ConstructorDescriptionEmpty constructor for unit tests.StructElement
(long luceneId) Constructor for StructElement.StructElement
(long luceneId, org.apache.solr.common.SolrDocument doc) Constructor for StructElement.StructElement
(long luceneId, org.apache.solr.common.SolrDocument doc, org.apache.solr.common.SolrDocument docToMerge) Constructor for StructElement.StructElement
(org.apache.solr.common.SolrDocument doc) LikeStructElement(long, SolrDocument)
, but get the lucene Id from the SolrDocument -
Method Summary
Modifier and TypeMethodDescriptionstatic StructElement
create
(org.apache.solr.common.SolrDocument solrDoc) Returns a stub representation of this object that only contains simple members to conserve memory.generateEventElements
(Locale locale, boolean forSearchHit) generateEventElements.Getter for the fieldancestors
.getCollection.getCollections.getFirstPageFieldValue
(String field) getFirstPageFieldValue.getFirstVolume
(List<String> fields) getFirstVolume.getFirstVolumeFieldValue
(String field) getFirstVolumeFieldValue.Returns the group field name of a group document.getGroupLabel
(String groupIdentifier, String altValue) Returns the label for the group with the given identifier.Getter for the fieldgroupMemberships
.int
Getter for the fieldimageNumber
.getImageUrl
(int width, int height) getImageUrl.de.intranda.metadata.multilanguage.IMetadataValue
getMultiLanguageDisplayLabel.int
Returns the number of pages (for the entire record, not a particular docstruct).Loads and returns the immediate parent StructElement of this element.getPi()
Getter for the fieldpi
.getShapeMetadataForPage
(int order) getTitle()
Deprecated.Returns a StructElement that represents the top non-anchor element of the hierarchy (ISWORK=true).boolean
boolean
boolean
boolean
Returns true if the record has any ALTO documents indexed in its pages; false otherwise.boolean
isAnchorChild.boolean
isDeleted.boolean
isExists()
isExists.boolean
isFulltextAvailable.boolean
isGroupMember.boolean
Checks whether the Solr document represented by this StructElement has child elements in the index.boolean
isHasParent.boolean
isHasParentOrChildren.boolean
isHasTeiForLanguage
(String language) boolean
Returns true if the record has any NE_* tags indexed in its pages; false otherwise.boolean
isRtl()
void
setFulltextAvailable
(boolean fulltextAvailable) Setter for the fieldfulltextAvailable
.void
setRtl
(boolean rtl) void
setShapeMetadata
(List<StructElement.ShapeMetadata> shapeMetadata) void
setTopStruct
(StructElement topStruct) Methods inherited from class io.goobi.viewer.model.viewer.StructElementStub
compareTo, generateContextObject, getDataRepository, getDisplayLabel, getDocStructType, getDocType, getKEVForField, getLabel, getLabel, getLogid, getLuceneId, getMetadataFields, getMetadataUrl, getMetadataValue, getMetadataValueForLanguage, getMetadataValues, getMultiLanguageMetadataValue, getNumVolumes, getPartnerId, getSourceDocFormat, getUrl, getUrl, getUrl, getVolumeNo, getVolumeNoSort, isAnchor, isCmsPage, isGroup, isHasImages, isHasMetadata, isLidoRecord, isVolume, isWork, setAnchor, setCmsPage, setDataRepository, setDocStructType, setDocType, setImageNumber, setLabel, setLogid, setMetadataFields, setPartnerId, setPi, setSourceDocFormat, setVolume, setVolumeNo, setVolumeNoSort, setWork
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
-
Constructor Details
-
StructElement
public StructElement()Empty constructor for unit tests. -
StructElement
Constructor for StructElement.
- Parameters:
luceneId
-Long
- Throws:
IndexUnreachableException
- if any.
-
StructElement
public StructElement(long luceneId, org.apache.solr.common.SolrDocument doc) throws IndexUnreachableException Constructor for StructElement.
- Parameters:
luceneId
- a long.doc
- aSolrDocument
object.- Throws:
IndexUnreachableException
- if any.
-
StructElement
LikeStructElement(long, SolrDocument)
, but get the lucene Id from the SolrDocument- Parameters:
doc
-- Throws:
IndexUnreachableException
-
StructElement
public StructElement(long luceneId, org.apache.solr.common.SolrDocument doc, org.apache.solr.common.SolrDocument docToMerge) throws IndexUnreachableException Constructor for StructElement.
- Parameters:
luceneId
- a long.doc
- aSolrDocument
object.docToMerge
- aSolrDocument
object.- Throws:
IndexUnreachableException
- if any.
-
-
Method Details
-
getMetadataDocuments
public ComplexMetadataContainer getMetadataDocuments() throws PresentationException, IndexUnreachableException -
isHasParentOrChildren
isHasParentOrChildren.
- Returns:
- a boolean.
- Throws:
PresentationException
- if any.IndexUnreachableException
- if any.
-
isHasParent
public boolean isHasParent()isHasParent.
- Returns:
- a boolean.
-
getNumPages
public int getNumPages()Description copied from class:StructElementStub
Returns the number of pages (for the entire record, not a particular docstruct).- Overrides:
getNumPages
in classStructElementStub
- Returns:
- a int.
-
getParent
Loads and returns the immediate parent StructElement of this element.- Returns:
StructElement
- Throws:
IndexUnreachableException
- if any.
-
getParentLuceneId
- Returns:
- IDDOC value of the parent document as a
Long
-
isHasChildren
Checks whether the Solr document represented by this StructElement has child elements in the index.- Returns:
- a boolean.
- Throws:
IndexUnreachableException
- if any.PresentationException
- if any.
-
getTopStruct
Returns a StructElement that represents the top non-anchor element of the hierarchy (ISWORK=true). If the element itself is an anchor, itself will be returned. If no topStruct element is found because no metadataSolrConstants.IDDOC_TOPSTRUCT
is found or because it could not be resolved, null is returned- Returns:
- a
StructElement
object. - Throws:
PresentationException
- if any.IndexUnreachableException
- if any.
-
setTopStruct
-
isGroupMember
public boolean isGroupMember()isGroupMember.
- Returns:
- a boolean.
-
getGroupLabel
public String getGroupLabel(String groupIdentifier, String altValue) throws IndexUnreachableException Returns the label for the group with the given identifier.- Parameters:
groupIdentifier
- Group record identifieraltValue
- Message key to return if no label was found- Returns:
- label value for the group record; given message key if none found
- Throws:
IndexUnreachableException
- if any.
-
isExists
public boolean isExists()isExists.
- Returns:
- the exists
-
isDeleted
public boolean isDeleted()isDeleted.
- Returns:
- a boolean.
-
getPi
Getter for the field
pi
.- Overrides:
getPi
in classStructElementStub
- Returns:
- the pi
-
getImageNumber
public int getImageNumber()Getter for the field
imageNumber
.- Overrides:
getImageNumber
in classStructElementStub
- Returns:
- the imageNumber
-
getImageUrl
getImageUrl.
- Parameters:
width
- a int.height
- a int.- Returns:
- Image URL
- Throws:
ViewerConfigurationException
- if any.
-
generateEventElements
public List<EventElement> generateEventElements(Locale locale, boolean forSearchHit) throws IndexUnreachableException generateEventElements.
- Parameters:
locale
- aLocale
object.forSearchHit
- If true, only search hit metadata will be populated in the event; if false main and sidebar metadata- Returns:
- a
List
object. - Throws:
IndexUnreachableException
- if any.
-
isAnchorChild
isAnchorChild.
- Returns:
- a boolean.
- Throws:
IndexUnreachableException
- if any.
-
getCollection
getCollection.
- Returns:
- a
String
object.
-
getCollections
getCollections.
- Returns:
- a
List
object.
-
isFulltextAvailable
public boolean isFulltextAvailable()isFulltextAvailable.
- Returns:
- the fulltextAvailable
-
setFulltextAvailable
public void setFulltextAvailable(boolean fulltextAvailable) Setter for the field
fulltextAvailable
.- Parameters:
fulltextAvailable
- the fulltextAvailable to set
-
isAltoAvailable
Returns true if the record has any ALTO documents indexed in its pages; false otherwise.- Returns:
- the altoAvailable
- Throws:
IndexUnreachableException
- if any.PresentationException
- if any.
-
isNerAvailable
Returns true if the record has any NE_* tags indexed in its pages; false otherwise.- Returns:
- the nerAvailable
- Throws:
IndexUnreachableException
- if any.PresentationException
- if any.
-
isAccessPermissionDownloadMetadata
- Returns:
- true if permission granted; false otherwise
- Throws:
IndexUnreachableException
DAOException
RecordNotFoundException
-
isAccessPermissionGenerateIiifManifest
public boolean isAccessPermissionGenerateIiifManifest() throws IndexUnreachableException, DAOException- Returns:
- true if permission granted; false otherwise
- Throws:
IndexUnreachableException
DAOException
RecordNotFoundException
-
getTitle
Deprecated.getTitle.
- Returns:
- a
String
object.
-
isHasTeiForLanguage
- Parameters:
language
-- Returns:
- true if a TEI file name is indexed for the given language; false otherwise
-
createStub
Returns a stub representation of this object that only contains simple members to conserve memory.- Returns:
- a
StructElementStub
object.
-
getAncestors
Getter for the field
ancestors
.- Returns:
- the ancestors
-
getGroupMemberships
Getter for the field
groupMemberships
.- Returns:
- the groupMemberships
-
getMultiLanguageDisplayLabel
public de.intranda.metadata.multilanguage.IMetadataValue getMultiLanguageDisplayLabel()getMultiLanguageDisplayLabel.
- Returns:
- a
IMetadataValue
object.
-
getGroupIdField
Returns the group field name of a group document.- Returns:
- a
String
object.
-
getFirstVolumeFieldValue
public String getFirstVolumeFieldValue(String field) throws PresentationException, IndexUnreachableException getFirstVolumeFieldValue.
- Parameters:
field
- aString
object.- Returns:
- a
String
object. - Throws:
PresentationException
- if any.IndexUnreachableException
- if any.
-
getFirstVolume
public StructElement getFirstVolume(List<String> fields) throws PresentationException, IndexUnreachableException getFirstVolume.
- Parameters:
fields
- aList
object.- Returns:
- a
StructElement
object. - Throws:
PresentationException
- if any.IndexUnreachableException
- if any.
-
getFirstPageFieldValue
public String getFirstPageFieldValue(String field) throws PresentationException, IndexUnreachableException getFirstPageFieldValue.
- Parameters:
field
- aString
object.- Returns:
- a
String
object. - Throws:
PresentationException
- if any.IndexUnreachableException
- if any.
-
hasShapeMetadata
public boolean hasShapeMetadata() -
getShapeMetadataForPage
- Parameters:
order
- Page order- Returns:
- List
-
getShapeMetadata
- Returns:
- the shapeMetadata
-
setShapeMetadata
- Parameters:
shapeMetadata
- the shapeMetadata to set
-
isRtl
public boolean isRtl()- Returns:
- the rtl
-
setRtl
public void setRtl(boolean rtl) - Parameters:
rtl
- the rtl to set
-
create
-