Class MetadataElement

java.lang.Object
io.goobi.viewer.model.metadata.MetadataElement
All Implemented Interfaces:
Serializable

public class MetadataElement extends Object implements Serializable

MetadataElement class.

See Also:
  • Constructor Details

    • MetadataElement

      public MetadataElement()
  • Method Details

    • init

      public MetadataElement init(StructElement se, int metadataViewIndex, Locale sessionLocale) throws PresentationException, IndexUnreachableException
      Parameters:
      se - StructElement
      metadataViewIndex - Metadata view index
      sessionLocale -
      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

      public List<MetadataElement.MetadataType> getMetadataTypes()
      Returns a sorted list of all metadata types contained in metadataList.
      Returns:
      a List object.
    • hasMetadataTypeLabels

      public boolean hasMetadataTypeLabels(int viewIndex)
    • getMetadata

      public Metadata getMetadata(String name)
      Returns the first instance of a Metadata object whose label matches the given field name.
      Parameters:
      name - a String object.
      Returns:
      a Metadata object.
    • getMetadata

      public Metadata getMetadata(String name, String language)
      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.
      Parameters:
      name - a String object.
      language - Optional language
      Returns:
      a Metadata object.
    • getMetadata

      public List<Metadata> getMetadata(List<String> fields)

      getMetadata.

      Parameters:
      fields - a List object.
      Returns:
      List of Metadata objects that match the given field names
    • setMetadataList

      public void setMetadataList(List<Metadata> metadataList)

      Setter for the field metadataList.

      Parameters:
      metadataList - the metadataList to set
    • getMetadataList

      public List<Metadata> 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

      public List<Metadata> getSidebarMetadataList()

      Getter for the field sidebarMetadataList.

      Returns:
      the sidebarMetadataList
    • setSidebarMetadataList

      public void setSidebarMetadataList(List<Metadata> sidebarMetadataList)

      Setter for the field sidebarMetadataList.

      Parameters:
      sidebarMetadataList - the sidebarMetadataList to set
    • isHasSidebarMetadata

      public boolean isHasSidebarMetadata()

      isHasSidebarMetadata.

      Returns:
      a boolean.
    • getDocStructTypeLabel

      public String 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

      public String getLabel()

      Getter for the field label.

      Returns:
      a String object.
    • setLabel

      public void setLabel(String label)

      Setter for the field label.

      Parameters:
      label - a String object.
    • getTitle

      public String getTitle()

      Getter for the field title.

      Returns:
      the title
    • getUrl

      public String getUrl()

      Getter for the field url.

      Returns:
      a String object.
    • setUrl

      public void setUrl(String url)

      Setter for the field url.

      Parameters:
      url - a String object.
    • isTopElement

      public boolean isTopElement()
      Returns true if this MetadataElement represents a stand-alone record, volume or anchor element.
      Returns:
      topElement
    • getDocType

      public String getDocType()

      Getter for the field docType.

      Returns:
      the docType
    • getDocStructType

      public String getDocStructType()

      Getter for the field docStructType.

      Returns:
      the docStructType
    • getGroupType

      public String getGroupType()
      Returns:
      the groupType
    • isAnchor

      public boolean isAnchor()

      isAnchor.

      Returns:
      a boolean.
    • isFilesOnly

      public boolean isFilesOnly()

      isFilesOnly.

      Returns:
      a boolean.
    • getFirstMetadataValue

      public String getFirstMetadataValue(String name)

      getFirstMetadataValue.

      Parameters:
      name - The name of the metadata
      Returns:
      the best available metadata value, or an empty string if no metadata was found
    • getFirstMetadataValueIfExists

      public Optional<String> getFirstMetadataValueIfExists(String name)

      getFirstMetadataValueIfExists.

      Parameters:
      name - a String object.
      Returns:
      a Optional object.
    • getFirstMetadataValue

      public String getFirstMetadataValue(String prefix, String name, String suffix)

      getFirstMetadataValue.

      Parameters:
      prefix - a String object.
      name - a String object.
      suffix - a String object.
      Returns:
      a String object.
    • setSelectedRecordLanguage

      public MetadataElement setSelectedRecordLanguage(String language)

      Setter for the field selectedRecordLanguage.

      Parameters:
      language - a String object.
      Returns:
      this