Package io.goobi.viewer.model.metadata
Class MetadataElement
java.lang.Object
io.goobi.viewer.model.metadata.MetadataElement
- All Implemented Interfaces:
Serializable
MetadataElement class.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassWrapper class for the metadata type numerical value. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGetter for the fielddocStructType.Returns the docstruct type or the group type if this is a record group.Getter for the fielddocType.getFirstMetadataValue(String name) getFirstMetadataValue.getFirstMetadataValue(String prefix, String name, String suffix) getFirstMetadataValue.getFirstMetadataValueIfExists.getLabel()Getter for the fieldlabel.getMetadata(String name) Returns the first instance of a Metadata object whose label matches the given field name.getMetadata(String name, String language) Returns the first instance of a Metadata object whose label matches the given field name.getMetadata(List<String> fields) getMetadata.Getter for the fieldmetadataList.Returns a sorted list of all metadata types contained in metadataList.Getter for the fieldsidebarMetadataList.getTitle()Getter for the fieldtitle.getUrl()Getter for the fieldurl.booleanhasMetadata.booleanhasMetadataTypeLabels(int viewIndex) booleanhasSidebarMetadata.init(StructElement se, int metadataViewIndex, Locale sessionLocale) booleanisAnchor()isAnchor.booleanisDisplayBoxed(int type) Checks whether all metadata fields for this element can be displayed in a single box (i.e. no table type grouped metadata are configured).booleanisFilesOnly.booleanisHasSidebarMetadata.booleanisSkip()booleanReturns true if this MetadataElement represents a stand-alone record, volume or anchor element.voidSetter for the fieldlabel.voidsetMetadataList(List<Metadata> metadataList) Setter for the fieldmetadataList.setSelectedRecordLanguage(String language) Setter for the fieldselectedRecordLanguage.voidsetSidebarMetadataList(List<Metadata> sidebarMetadataList) Setter for the fieldsidebarMetadataList.voidSetter for the fieldurl.
-
Constructor Details
-
MetadataElement
public MetadataElement()
-
-
Method Details
-
init
public MetadataElement init(StructElement se, int metadataViewIndex, Locale sessionLocale) throws PresentationException, IndexUnreachableException - Parameters:
se- StructElementmetadataViewIndex- Metadata view indexsessionLocale-- Returns:
- Constructed
MetadataElement - Throws:
PresentationExceptionIndexUnreachableException
-
isSkip
public boolean isSkip()- Returns:
- true if all available metadata fields for this element are marked as hidden; false otherwise
-
getMetadataTypes
Returns a sorted list of all metadata types contained in metadataList.- Returns:
- a
Listobject.
-
hasMetadataTypeLabels
public boolean hasMetadataTypeLabels(int viewIndex) -
getMetadata
Returns the first instance of a Metadata object whose label matches the given field name. -
getMetadata
Returns the first instance of a Metadata object whose label matches the given field name. If a language is given, a localized field name will be used. -
getMetadata
getMetadata.
- Parameters:
fields- aListobject.- Returns:
- List of Metadata objects that match the given field names
-
setMetadataList
Setter for the field
metadataList.- Parameters:
metadataList- the metadataList to set
-
getMetadataList
Getter for the field
metadataList.- Returns:
- the oneMetadataList
-
hasMetadata
public boolean hasMetadata()hasMetadata.
- Returns:
- a boolean.
-
isDisplayBoxed
public boolean isDisplayBoxed(int type) Checks whether all metadata fields for this element can be displayed in a single box (i.e. no table type grouped metadata are configured).- Parameters:
type-- Returns:
- true if all metadata are not configured as single string; false otherwise
-
hasSidebarMetadata
public boolean hasSidebarMetadata()hasSidebarMetadata.
- Returns:
- a boolean.
-
getSidebarMetadataList
Getter for the field
sidebarMetadataList.- Returns:
- the sidebarMetadataList
-
setSidebarMetadataList
Setter for the field
sidebarMetadataList.- Parameters:
sidebarMetadataList- the sidebarMetadataList to set
-
isHasSidebarMetadata
public boolean isHasSidebarMetadata()isHasSidebarMetadata.
- Returns:
- a boolean.
-
getDocStructTypeLabel
Returns the docstruct type or the group type if this is a record group.- Returns:
- docstruct type if record; group type if group
-
getLabel
Getter for the field
label.- Returns:
- a
Stringobject.
-
setLabel
Setter for the field
label.- Parameters:
label- aStringobject.
-
getTitle
Getter for the field
title.- Returns:
- the title
-
getUrl
Getter for the field
url.- Returns:
- a
Stringobject.
-
setUrl
Setter for the field
url.- Parameters:
url- aStringobject.
-
isTopElement
public boolean isTopElement()Returns true if this MetadataElement represents a stand-alone record, volume or anchor element.- Returns:
- topElement
-
getDocType
Getter for the field
docType.- Returns:
- the docType
-
getDocStructType
Getter for the field
docStructType.- Returns:
- the docStructType
-
getGroupType
- Returns:
- the groupType
-
isAnchor
public boolean isAnchor()isAnchor.
- Returns:
- a boolean.
-
isFilesOnly
public boolean isFilesOnly()isFilesOnly.
- Returns:
- a boolean.
-
getFirstMetadataValue
getFirstMetadataValue.
- Parameters:
name- The name of the metadata- Returns:
- the best available metadata value, or an empty string if no metadata was found
-
getFirstMetadataValueIfExists
getFirstMetadataValueIfExists.
-
getFirstMetadataValue
getFirstMetadataValue.
-
setSelectedRecordLanguage
Setter for the field
selectedRecordLanguage.- Parameters:
language- aStringobject.- Returns:
- this
-