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
Modifier and TypeClassDescriptionclass
Wrapper class for the metadata type numerical value. -
Constructor Summary
-
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
.boolean
hasMetadata.boolean
hasMetadataTypeLabels
(int viewIndex) boolean
hasSidebarMetadata.init
(StructElement se, int metadataViewIndex, Locale sessionLocale) boolean
isAnchor()
isAnchor.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).boolean
isFilesOnly.boolean
isHasSidebarMetadata.boolean
isSkip()
boolean
Returns true if this MetadataElement represents a stand-alone record, volume or anchor element.void
Setter for the fieldlabel
.void
setMetadataList
(List<Metadata> metadataList) Setter for the fieldmetadataList
.setSelectedRecordLanguage
(String language) Setter for the fieldselectedRecordLanguage
.void
setSidebarMetadataList
(List<Metadata> sidebarMetadataList) Setter for the fieldsidebarMetadataList
.void
Setter 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:
PresentationException
IndexUnreachableException
-
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
List
object.
-
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
- aList
object.- 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
String
object.
-
setLabel
Setter for the field
label
.- Parameters:
label
- aString
object.
-
getTitle
Getter for the field
title
.- Returns:
- the title
-
getUrl
Getter for the field
url
.- Returns:
- a
String
object.
-
setUrl
Setter for the field
url
.- Parameters:
url
- aString
object.
-
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
- aString
object.- Returns:
- this
-