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 Details

    • MetadataBean

      public MetadataBean()
      Empty constructor.
  • Method Details

    • setActiveDocumentBean

      public void setActiveDocumentBean(ActiveDocumentBean activeDocumentBean)
      Required setter for ManagedProperty injection.
      Parameters:
      activeDocumentBean - the activeDocumentBean to set
    • loadMetadata

      public String loadMetadata(int index, Locale locale) throws IndexUnreachableException, DAOException

      loadMetadata.

      Parameters:
      index -
      locale -
      Returns:
      a String object.
      Throws:
      IndexUnreachableException - if any.
      DAOException - if any.
    • getMetadataElementList

      public List<MetadataElement> getMetadataElementList()
      Convenience method for getMetadataElementList(0).
      Returns:
      the first metadata element list
    • getMetadataElementList

      public List<MetadataElement> getMetadataElementList(int index)

      Getter for the field metadataElementList.

      Parameters:
      index -
      Returns:
      the metadataElementList
    • 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 in metadataElementList, 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 - a String object.
    • getMetadataViews

      public List<MetadataView> getMetadataViews()
      Returns:
      List of available MetadataViews
    • getMetadataViewUrl

      public String getMetadataViewUrl()
      Returns:
      the metadataViewUrl
    • setMetadataViewUrl

      public void setMetadataViewUrl(String metadataViewUrl)
      Parameters:
      metadataViewUrl - the metadataViewUrl to set
    • selectFirstMetadataViewOfLocation

      public void selectFirstMetadataViewOfLocation(String location)
      Sets activeMetadataView to the first configured MetadataView with location="location".
      Parameters:
      location - Location name
    • getActiveMetadataView

      public MetadataView getActiveMetadataView()
      Returns:
      the activeMetadataView
    • setActiveMetadataView

      public void setActiveMetadataView(MetadataView activeMetadataView)
      Parameters:
      activeMetadataView - the activeMetadataView to set
    • getComplexMetadataFieldsToList

      public List<String> getComplexMetadataFieldsToList(String... fields)
      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 of String values for subFieldName of a grouped metadata field mainFieldName where the subfield value of MD_ORDER matches the given order value.
      Parameters:
      metadataViewIndex - Index of the requested metadataView where the requested metadata is configured
      mainFieldName - Main metadata field
      language - Optional metadata field language
      subFieldName - Child metadata field
      order - 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 first String values for subFieldName of a grouped metadata field mainFieldName where the subfield value of MD_ORDER matches the given order value.
      Parameters:
      metadataViewIndex - Index of the requested metadataView where the requested metadata is configured
      mainFieldName - Main metadata field
      language - Optional metadata field language
      subFieldName - Child metadata field
      order - Page number
      Returns:
      First value of subFieldName; null if none found
    • getFirstMetadataValue

      public String getFirstMetadataValue(int metadataViewIndex, String mainFieldName, String language, String subFieldName)
      Returns the first String values for subFieldName of a grouped metadata field mainFieldName
      Parameters:
      metadataViewIndex - Index of the requested metadataView where the requested metadata is configured
      mainFieldName - Main metadata field
      language - Optional metadata field language
      subFieldName - 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)
      Returns a list of String values for subFieldName of a grouped metadata field mainFieldName
      Parameters:
      metadataViewIndex - Index of the requested metadataView where the requested metadata is configured
      mainFieldName - Main metadata field
      language - Optional metadata field language
      subFieldName - Child metadata field
      Returns:
      Metadata values of subFieldName; empty list if none found
    • range

      public List<Integer> range(int start, int end)
    • getMetadataList

      public List<Metadata> getMetadataList(StructElement struct, String type)