Class Metadata

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

public class Metadata extends Object implements Serializable
Metadata field configuration.
See Also:
  • Constructor Details

  • Method Details

    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • isHasLabel

      public boolean isHasLabel()

      isHasLabel.

      Returns:
      a boolean.
    • getLabel

      public String getLabel()

      Getter for the field label.

      Returns:
      the label
    • getMasterValue

      public String getMasterValue()

      Getter for the field masterValue.

      Returns:
      a String object.
    • getType

      public int getType()

      Getter for the field type.

      Returns:
      the type
    • setType

      public Metadata setType(int type)
      Parameters:
      type - the type to set
      Returns:
      this
    • getSortFields

      public List<StringPair> getSortFields()
      Returns:
      List
    • getSortField

      public String getSortField()
      Returns:
      the sortField
    • setSortField

      public Metadata setSortField(String sortField)
      Parameters:
      sortField - the sortField to set
      Returns:
      this
    • getValues

      public List<MetadataValue> getValues()

      Getter for the field values.

      Returns:
      the values
    • getValuesForOwner

      public List<MetadataValue> getValuesForOwner(String ownerIddoc)
      Parameters:
      ownerIddoc -
      Returns:
      Sublist of all values that belong to ownerIddoc; all values if ownerIddoc null
    • setParamValue

      public void setParamValue(int valueIndex, int paramIndex, List<String> inValues, String paramLabel, String url, Map<String,String> options, String groupType, Locale locale)

      setParamValue.

      Parameters:
      valueIndex - a int.
      paramIndex - a int.
      inValues - List with values
      paramLabel - a String object.
      url - a String object.
      options - a Map object.
      groupType - value of METADATATYPE, if available
      locale - a Locale object.
    • setParamValue

      public void setParamValue(int valueIndex, int paramIndex, List<String> inValues, RelationshipMetadataContainer relatedMetadata, String paramLabel, String url, Map<String,String> options, String groupType, Locale locale)
    • getParams

      public List<MetadataParameter> getParams()

      Getter for the field params.

      Returns:
      the params
    • hasParam

      public boolean hasParam(String paramName)

      hasParam.

      Parameters:
      paramName - a String object.
      Returns:
      a boolean.
    • getParamCount

      public int getParamCount()
      Returns:
      Number of params
    • getParamValue

      public String getParamValue(String field)
    • isBlank

      public boolean isBlank()
      Checks whether any parameter values are set. 'empty' seems to be a reserved word in JSF, so use 'blank'.
      Returns:
      true if all paramValues are empty or blank; false otherwise.
    • isBlank

      public boolean isBlank(String ownerIddoc)
      Parameters:
      ownerIddoc -
      Returns:
      true if this metadata contains no non-blank values; false otherwise
    • populate

      public boolean populate(StructElement se, String ownerIddoc, List<StringPair> sortFields, Locale locale) throws IndexUnreachableException, PresentationException
      Populates the parameters of the given metadata with values from the given StructElement.
      Parameters:
      se - a StructElement object.
      ownerIddoc - IDDOC of the owner document (either docstruct or parent metadata)
      sortFields -
      locale - a Locale object.
      Returns:
      a boolean.
      Throws:
      IndexUnreachableException - if any.
      PresentationException - if any.
    • getPersonDisplayName

      public static String getPersonDisplayName(String aggregatedMetadata)
      Converts aggregated person/corporation metadata to just the displayable name.
      Parameters:
      aggregatedMetadata - a String object.
      Returns:
      a String object.
    • getNumber

      public int getNumber()

      Getter for the field number.

      Returns:
      a int.
    • setNumber

      public Metadata setNumber(int number)
      Parameters:
      number - the number to set
      Returns:
      this
    • isGroup

      public boolean isGroup()

      isGroup.

      Returns:
      the group
    • setGroup

      public Metadata setGroup(boolean group)
      Parameters:
      group - the group to set
      Returns:
      this
    • isSingleString

      public boolean isSingleString()
      Returns:
      the singleString
    • setSingleString

      public Metadata setSingleString(boolean singleString)
      Parameters:
      singleString - the singleString to set
      Returns:
      this
    • isHideIfOnlyMetadataField

      public boolean isHideIfOnlyMetadataField()
      Returns:
      the hideIfOnlyMetadataField
    • setHideIfOnlyMetadataField

      public Metadata setHideIfOnlyMetadataField(boolean hideIfOnlyMetadataField)
      Parameters:
      hideIfOnlyMetadataField - the hideIfOnlyMetadataField to set
      Returns:
      this
    • isTopstructOnly

      public boolean isTopstructOnly()
      Returns:
      the topstructOnly
    • setTopstructOnly

      public Metadata setTopstructOnly(boolean topstructOnly)
      Parameters:
      topstructOnly - the topstructOnly to set
      Returns:
      this
    • getLabelField

      public String getLabelField()
      Returns:
      the labelField
    • setLabelField

      public Metadata setLabelField(String labelField)
      Parameters:
      labelField - the labelField to set
      Returns:
      this
    • getSeparator

      public String getSeparator()
      Returns:
      the separator
    • setSeparator

      public Metadata setSeparator(String separator)
      Parameters:
      separator - the separator to set
      Returns:
      this
    • getOwnerDocstrctType

      public String getOwnerDocstrctType()
      Returns:
      the ownerDocstrctType
    • setOwnerDocstrctType

      public Metadata setOwnerDocstrctType(String ownerDocstrctType)
      Parameters:
      ownerDocstrctType - the ownerDocstrctType to set
      Returns:
      this
    • getCitationTemplate

      public String getCitationTemplate()
      Returns:
      the citationTemplate
    • setCitationTemplate

      public Metadata setCitationTemplate(String citationTemplate)
      Parameters:
      citationTemplate - the citationTemplate to set
      Returns:
      this
    • getCitationProcessorWrapper

      public CitationProcessorWrapper getCitationProcessorWrapper()
      Returns:
      the citationProcessorWrapper
    • setCitationProcessorWrapper

      public void setCitationProcessorWrapper(CitationProcessorWrapper citationProcessorWrapper)
      Parameters:
      citationProcessorWrapper - the citationProcessorWrapper to set
    • getParentMetadata

      public Metadata getParentMetadata()
      Returns:
      the parentMetadata
    • setParentMetadata

      public void setParentMetadata(Metadata parentMetadata)
      Parameters:
      parentMetadata - the parentMetadata to set
    • isHasChildren

      public boolean isHasChildren()
      Returns:
      true if childMetadata not empty; false otherwise
    • getChildMetadata

      public List<Metadata> getChildMetadata()
      Returns:
      the childMetadata
    • getIndentation

      public int getIndentation()
      Returns:
      the indentation
    • setIndentation

      public Metadata setIndentation(int indentation)
      Parameters:
      indentation - the indentation to set
      Returns:
      this
    • filterMetadata

      public static List<Metadata> filterMetadata(List<Metadata> metadataList, String language, String field)
      Returns a metadata list that contains the fields of the given metadata list minus any language-specific fields that do not match the given language.
      Parameters:
      metadataList - a List object.
      language - a String object.
      field -
      Returns:
      Metadata list without any fields with non-matching language; original list if no language is given
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getCombinedValue

      public String getCombinedValue(String separator)