Package io.goobi.viewer.managedbeans
Class MetadataBean
java.lang.Object
io.goobi.viewer.managedbeans.MetadataBean
Provides the metadata for the current structure and event elements.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
displayChildStructs.getBottomMetadataElement
(int index) Returns the last element inmetadataElementList
, which is the bottom element in the hierarchy.getComplexMetadataFieldsToList
(String... fields) Convenience method for the metadata page/link label key, depending on the document type.Convenience method for the sidebar metadata widget label key, depending on the document type.Getter for the fieldevents
.getFirstMetadataValue
(int metadataViewIndex, String mainFieldName, String language, String subFieldName) getFirstMetadataValueForPage
(int metadataViewIndex, String mainFieldName, String language, String subFieldName, int order) Returns the firstString
values forsubFieldName
of a grouped metadata fieldmainFieldName
where the subfield value of MD_ORDER matches the givenorder
value.Convenience method forgetMetadataElementList(0)
.getMetadataElementList
(int index) Getter for the fieldmetadataElementList
.getMetadataList
(StructElement struct, String type) getMetadataValues
(int metadataViewIndex, String mainFieldName, String subFieldName, String language) getMetadataValuesForPage
(int metadataViewIndex, String mainFieldName, String language, String subFieldName, int order) Returns a list ofString
values forsubFieldName
of a grouped metadata fieldmainFieldName
where the subfield value of MD_ORDER matches the givenorder
value.getTopMetadataElement
(int index) getTopMetadataElement.loadMetadata
(int index, Locale locale) loadMetadata.range
(int start, int end) void
selectFirstMetadataViewOfLocation
(String location) Sets activeMetadataView to the first configured MetadataView with location="location".void
setActiveDocumentBean
(ActiveDocumentBean activeDocumentBean) Required setter for ManagedProperty injection.void
setActiveMetadataView
(MetadataView activeMetadataView) void
setEvents
(List<EventElement> events) Setter for the fieldevents
.void
setMetadataViewUrl
(String metadataViewUrl) void
setSelectedRecordLanguage
(String selectedRecordLanguage) setSelectedRecordLanguage.
-
Constructor Details
-
MetadataBean
public MetadataBean()Empty constructor.
-
-
Method Details
-
setActiveDocumentBean
Required setter for ManagedProperty injection.- Parameters:
activeDocumentBean
- the activeDocumentBean to set
-
loadMetadata
loadMetadata.
- Parameters:
index
-locale
-- Returns:
- a
String
object. - Throws:
IndexUnreachableException
- if any.DAOException
- if any.
-
getMetadataElementList
Convenience method forgetMetadataElementList(0)
.- Returns:
- the first metadata element list
-
getMetadataElementList
Getter for the field
metadataElementList
.- Parameters:
index
-- Returns:
- the metadataElementList
-
getTopMetadataElement
getTopMetadataElement.
- Parameters:
index
- Metadata view index- Returns:
- a
MetadataElement
object.
-
getBottomMetadataElement
Returns the last element inmetadataElementList
, which is the bottom element in the hierarchy. If the element contains no side bar metadata, the next higher element is checked until an element with sidebar metadata is found. TODO for some reason this method is called 6-15 times per page- Parameters:
index
- Metadata view index- Returns:
- a
MetadataElement
object.
-
getDefaultMetadataLabel
Convenience method for the metadata page/link label key, depending on the document type.- Returns:
- Message key for the label
-
getDefaultSidebarMetadataLabel
Convenience method for the sidebar metadata widget label key, depending on the document type.- Returns:
- Message key for the label
-
getEvents
Getter for the field
events
.- Returns:
- the events
-
setEvents
Setter for the field
events
.- Parameters:
events
- the events to set
-
displayChildStructs
public boolean displayChildStructs()displayChildStructs.
- Returns:
- a boolean.
-
setSelectedRecordLanguage
setSelectedRecordLanguage.
- Parameters:
selectedRecordLanguage
- aString
object.
-
getMetadataViews
- Returns:
- List of available
MetadataView
s
-
getMetadataViewUrl
- Returns:
- the metadataViewUrl
-
setMetadataViewUrl
- Parameters:
metadataViewUrl
- the metadataViewUrl to set
-
selectFirstMetadataViewOfLocation
Sets activeMetadataView to the first configured MetadataView with location="location".- Parameters:
location
- Location name
-
getActiveMetadataView
- Returns:
- the activeMetadataView
-
setActiveMetadataView
- Parameters:
activeMetadataView
- the activeMetadataView to set
-
getComplexMetadataFieldsToList
- Parameters:
fields
-- Returns:
- Given strings as List
-
getMetadataValuesForPage
public List<String> getMetadataValuesForPage(int metadataViewIndex, String mainFieldName, String language, String subFieldName, int order) Returns a list ofString
values forsubFieldName
of a grouped metadata fieldmainFieldName
where the subfield value of MD_ORDER matches the givenorder
value.- Parameters:
metadataViewIndex
- Index of the requested metadataView where the requested metadata is configuredmainFieldName
- Main metadata fieldlanguage
- Optional metadata field languagesubFieldName
- Child metadata fieldorder
- Page number- Returns:
- Metadata values of subFieldName; empty list if none found
-
getFirstMetadataValueForPage
public String getFirstMetadataValueForPage(int metadataViewIndex, String mainFieldName, String language, String subFieldName, int order) Returns the firstString
values forsubFieldName
of a grouped metadata fieldmainFieldName
where the subfield value of MD_ORDER matches the givenorder
value.- Parameters:
metadataViewIndex
- Index of the requested metadataView where the requested metadata is configuredmainFieldName
- Main metadata fieldlanguage
- Optional metadata field languagesubFieldName
- Child metadata fieldorder
- Page number- Returns:
- First value of subFieldName; null if none found
-
getFirstMetadataValue
public String getFirstMetadataValue(int metadataViewIndex, String mainFieldName, String language, String subFieldName) - Parameters:
metadataViewIndex
- Index of the requested metadataView where the requested metadata is configuredmainFieldName
- Main metadata fieldlanguage
- Optional metadata field languagesubFieldName
- Child metadata field- Returns:
- First value of subFieldName; null if none found
-
getMetadataValues
public List<String> getMetadataValues(int metadataViewIndex, String mainFieldName, String subFieldName, String language) - Parameters:
metadataViewIndex
- Index of the requested metadataView where the requested metadata is configuredmainFieldName
- Main metadata fieldlanguage
- Optional metadata field languagesubFieldName
- Child metadata field- Returns:
- Metadata values of subFieldName; empty list if none found
-
range
-
getMetadataList
-