Package io.goobi.viewer.managedbeans
Class MetadataBean
- java.lang.Object
-
- io.goobi.viewer.managedbeans.MetadataBean
-
@Named @RequestScoped public class MetadataBean extends Object
Provides the metadata for the current structure and event elements.
-
-
Constructor Summary
Constructors Constructor Description MetadataBean()
Empty constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
displayChildStructs()
displayChildStructs.MetadataView
getActiveMetadataView()
List<MetadataElement>
getAllMetadataElementsForPage(int index, int order)
Deprecated.MetadataElement
getBottomMetadataElement(int index)
Returns the last element inmetadataElementList
, which is the bottom element in the hierarchy.String
getDefaultMetadataLabel()
Convenience method for the metadata page/link label key, depending on the document type.String
getDefaultSidebarMetadataLabel()
Convenience method for the sidebar metadata widget label key, depending on the document type.List<EventElement>
getEvents()
Getter for the fieldevents
.List<MetadataElement>
getMetadataElementList()
Convenience method forgetMetadataElementList(0)
List<MetadataElement>
getMetadataElementList(int index)
Getter for the fieldmetadataElementList
.List<MetadataView>
getMetadataViews()
String
getMetadataViewUrl()
MetadataElement
getTopMetadataElement(int index)
getTopMetadataElement.String
loadMetadata(int index)
loadMetadata.void
setActiveDocumentBean(ActiveDocumentBean activeDocumentBean)
Required setter for ManagedProperty injectionvoid
setActiveMetadataView(MetadataView activeMetadataView)
void
setEvents(List<EventElement> events)
Setter for the fieldevents
.void
setMetadataViewUrl(String metadataViewUrl)
void
setSelectedRecordLanguage(String selectedRecordLanguage)
setSelectedRecordLanguage.
-
-
-
Method Detail
-
setActiveDocumentBean
public void setActiveDocumentBean(ActiveDocumentBean activeDocumentBean)
Required setter for ManagedProperty injection- Parameters:
activeDocumentBean
- the activeDocumentBean to set
-
loadMetadata
public String loadMetadata(int index) throws IndexUnreachableException, DAOException
loadMetadata.
- Parameters:
index
-- Returns:
- a
String
object. - Throws:
IndexUnreachableException
- if any.DAOException
- if any.
-
getMetadataElementList
public List<MetadataElement> getMetadataElementList()
Convenience method forgetMetadataElementList(0)
- Returns:
- the first metadata element list
-
getMetadataElementList
public List<MetadataElement> getMetadataElementList(int index)
Getter for the field
metadataElementList
.- Parameters:
index
-- Returns:
- the metadataElementList
-
getAllMetadataElementsForPage
@Deprecated public List<MetadataElement> getAllMetadataElementsForPage(int index, int order) throws IndexUnreachableException, DAOException
Deprecated.Returns a list ofMetadataElement
s for all structure elements contained on the given page (as opposed to just the immediate hierarchy down to the first element that BEGINS on the current page, such as returned bygetMetadataElementList
.- Parameters:
index
- Metadata view indexorder
- Page number- Returns:
- List of
MetadataElement
s for all structure elements contained on the given page - Throws:
IndexUnreachableException
DAOException
-
getTopMetadataElement
public MetadataElement getTopMetadataElement(int index)
getTopMetadataElement.
- Parameters:
index
- Metadata view index- Returns:
- a
MetadataElement
object.
-
getBottomMetadataElement
public MetadataElement getBottomMetadataElement(int index)
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
public String getDefaultMetadataLabel()
Convenience method for the metadata page/link label key, depending on the document type.- Returns:
- Message key for the label
-
getDefaultSidebarMetadataLabel
public String getDefaultSidebarMetadataLabel()
Convenience method for the sidebar metadata widget label key, depending on the document type.- Returns:
- Message key for the label
-
getEvents
public List<EventElement> getEvents()
Getter for the field
events
.- Returns:
- the events
-
setEvents
public void setEvents(List<EventElement> events)
Setter for the field
events
.- Parameters:
events
- the events to set
-
displayChildStructs
public boolean displayChildStructs()
displayChildStructs.
- Returns:
- a boolean.
-
setSelectedRecordLanguage
public void setSelectedRecordLanguage(String selectedRecordLanguage)
setSelectedRecordLanguage.
- Parameters:
selectedRecordLanguage
- aString
object.
-
getMetadataViews
public List<MetadataView> getMetadataViews()
- Returns:
- List of available
MetadataView
s
-
getMetadataViewUrl
public String getMetadataViewUrl()
- Returns:
- the metadataViewUrl
-
setMetadataViewUrl
public void setMetadataViewUrl(String metadataViewUrl)
- Parameters:
metadataViewUrl
- the metadataViewUrl to set
-
getActiveMetadataView
public MetadataView getActiveMetadataView()
- Returns:
- the activeMetadataView
-
setActiveMetadataView
public void setActiveMetadataView(MetadataView activeMetadataView)
- Parameters:
activeMetadataView
- the activeMetadataView to set
-
-