Class MetadataValue

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

public class MetadataValue extends Object implements Serializable
Wrapper class for metadata parameter value groups, so that JSF can iterate through them properly.
See Also:
  • Method Details

    • isParamValueBlank

      public boolean isParamValueBlank(int index)
      Parameters:
      index - zero-based parameter index to check
      Returns:
      true if value at index blank; false otherwise
    • isAllParamValuesBlank

      public boolean isAllParamValuesBlank()
      Returns:
      true if all of the param values are empty or blank; false otherwise
    • getDisplayParamValue

      public String getDisplayParamValue(int index)
    • getComboValueShort

      public String getComboValueShort(int index)
      getComboValueShort.
      Parameters:
      index - zero-based parameter index to retrieve
      Returns:
      the formatted combined metadata value for the given parameter index
    • getParamLabelWithColon

      public String getParamLabelWithColon(int index)
      getParamLabelWithColon.
      Parameters:
      index - zero-based parameter index to look up
      Returns:
      the translated label for the given parameter index with an appended colon, or an empty string if the index is out of range
    • getParamLabels

      public List<String> getParamLabels()
      Getter for the field paramLabels.
      Returns:
      the list of label keys for each metadata parameter
    • getParamValues

      public List<List<String>> getParamValues()
      Getter for the field paramValues.
      Returns:
      the list of value lists for each metadata parameter
    • getParamMasterValueFragments

      public List<String> getParamMasterValueFragments()
      Getter for the field paramMasterValueFragments.
      Returns:
      the list of master value template fragments associated with each metadata parameter
    • getParamPrefixes

      public List<String> getParamPrefixes()
      Getter for the field paramPrefixes.
      Returns:
      the list of prefix strings prepended to each parameter value during rendering
    • getParamSuffixes

      public List<String> getParamSuffixes()
      Getter for the field paramSuffixes.
      Returns:
      the list of suffix strings appended to each parameter value during rendering
    • getParamUrls

      public List<String> getParamUrls()
      Getter for the field paramUrls.
      Returns:
      the list of URLs associated with each metadata parameter value
    • getNormDataUrls

      public Map<String,String> getNormDataUrls()
      Getter for the field normDataUrls.
      Returns:
      the map of norm data type keys to their resolved URLs
    • getNormDataUrlKeys

      public List<String> getNormDataUrlKeys()
      getNormDataUrlKeys.
      Returns:
      a list of norm data URL keys stored in this metadata value
    • getNormDataUrl

      public String getNormDataUrl(String key)
      getNormDataUrl.
      Parameters:
      key - norm data type identifier key
      Returns:
      Not URL-encoded norm data URL
    • getNormDataUrl

      public String getNormDataUrl(String key, boolean urlEncode)
      getNormDataUrl.
      Parameters:
      key - norm data type identifier key
      urlEncode - true to return a URL-encoded value
      Returns:
      if urlEncode=true, then URL-encoded norm data URL; otherwise not encoded norm data URL
    • getCitationValues

      public Map<String,List<String>> getCitationValues()
    • getChildMetadata

      public List<Metadata> getChildMetadata()
    • isAccessRestricted

      public boolean isAccessRestricted()
      Returns:
      true if thids.accessConditions not empty; false otherwise
    • getAccessConditions

      public Set<String> getAccessConditions()
    • hasParamValue

      public boolean hasParamValue(String paramLabel)
      hasParamValue.
      Parameters:
      paramLabel - label key identifying the parameter
      Returns:
      true if this metadata value has a value for the parameter identified by the given label, false otherwise
    • getParamValue

      public String getParamValue(String paramLabel)
      getParamValue.
      Parameters:
      paramLabel - label key identifying the parameter
      Returns:
      the first value for the parameter identified by the given label, or an empty string if not found
    • getParamValues

      public List<String> getParamValues(String paramLabel)
      Parameters:
      paramLabel - label key identifying the parameter
      Returns:
      List of parameter values for the given paramLabel
    • applyHighlightingToParamValue

      public void applyHighlightingToParamValue(int paramIndex, Set<String> searchTerms)
      Applies (full HTML) search hit value highlighting to all values for the given parameter index.
      Parameters:
      paramIndex - Metadata parameter index
      searchTerms - Set of search terms
    • getIddoc

      public String getIddoc()
    • setIddoc

      public void setIddoc(String iddoc)
    • getOwnerIddoc

      public String getOwnerIddoc()
    • setOwnerIddoc

      public void setOwnerIddoc(String ownerIddoc)
    • getDisplayValue

      public String getDisplayValue()
      Returns:
      Display value for the current locale
    • getDisplayValue

      public String getDisplayValue(boolean includeLabels)
      Parameters:
      includeLabels - if true, prepend parameter labels to each value
      Returns:
      Display value for the current locale
    • getDisplayValue

      public String getDisplayValue(Locale locale)
      Parameters:
      locale - locale for translation lookup
      Returns:
      Display value for the given locale
    • getDisplayValue

      public String getDisplayValue(Locale locale, boolean includeLabels)
      Parameters:
      locale - locale for translation lookup
      includeLabels - if true, prepend parameter labels to each value
      Returns:
      Display value for the given locale
    • getMasterValue

      public String getMasterValue()
      Getter for the field masterValue.
      Returns:
      the template string into which parameter values are substituted during rendering, defaulting to "{0}" if empty
    • setMasterValue

      public void setMasterValue(String masterValue)
      Setter for the field masterValue.
      Parameters:
      masterValue - the template string into which parameter values are substituted during rendering
    • getGroupTypeForUrl

      public String getGroupTypeForUrl()
      getGroupTypeForUrl.
      Returns:
      the METADATATYPE value of the owning grouped metadata structure element, or "-" if not set
    • setGroupType

      public MetadataValue setGroupType(String groupType)
      Setter for the field groupType.
      Parameters:
      groupType - the METADATATYPE value of the owning grouped metadata structure element
      Returns:
      this
    • getDocstrct

      public String getDocstrct()
    • setDocstrct

      public MetadataValue setDocstrct(String docstrct)
      Parameters:
      docstrct - the document structure type of the owning structure element
      Returns:
      this
    • getTopstruct

      public String getTopstruct()
    • setTopstruct

      public void setTopstruct(String topstruct)
    • getLabel

      public String getLabel()
    • setLabel

      public MetadataValue setLabel(String label)
      Parameters:
      label - the display label for this metadata value
      Returns:
      this
    • setCitationProcessor

      public MetadataValue setCitationProcessor(de.undercouch.citeproc.CSL citationProcessor)
      Parameters:
      citationProcessor - the configured CSL citation processor used to format this value as a citation
      Returns:
      this
    • setCitationItemDataProvider

      public MetadataValue setCitationItemDataProvider(CitationDataProvider citationItemDataProvider)
      Parameters:
      citationItemDataProvider - the data provider that supplies citation item data to the CSL processor
      Returns:
      this
    • toString

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

      public String getCombinedValue()