Class MetadataParameter

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

public class MetadataParameter extends Object implements Serializable
Defines a single parameter within a metadata field configuration, specifying the Solr field and display options.
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
    • getSource

      public String getSource()
      Getter for the field source.
      Returns:
      the Solr field name from which this parameter's value is read
    • setSource

      public MetadataParameter setSource(String source)
      Parameters:
      source - the Solr field name from which this parameter's value is read
      Returns:
      this
    • getDestination

      public String getDestination()
    • setDestination

      public MetadataParameter setDestination(String destination)
      Parameters:
      destination - the target placeholder name in the master value template where this parameter's value is inserted
      Returns:
      this
    • getType

      Getter for the field type.
      Returns:
      the parameter type controlling how the value is retrieved and rendered
    • setType

      Setter for the field type.
      Parameters:
      type - the parameter type controlling how the value is retrieved and rendered
      Returns:
      this
    • getKey

      public String getKey()
      Getter for the field key.
      Returns:
      the Solr field name used as the primary key for value lookup
    • setKey

      public MetadataParameter setKey(String key)
      Parameters:
      key - the Solr field name used as the primary key for value lookup
      Returns:
      this
    • getAltKey

      public String getAltKey()
    • setAltKey

      public MetadataParameter setAltKey(String altKey)
      Parameters:
      altKey - the alternative Solr field name used as a fallback when the primary key yields no value
      Returns:
      this
    • getMasterValueFragment

      public String getMasterValueFragment()
      Getter for the field masterValueFragment.
      Returns:
      the message key referencing a fragment of the master value template for this parameter
    • setMasterValueFragment

      public MetadataParameter setMasterValueFragment(String masterValueFragment)
      Parameters:
      masterValueFragment - the message key referencing a fragment of the master value template for this parameter
      Returns:
      this
    • getDefaultValue

      public String getDefaultValue()
      Getter for the field defaultValue.
      Returns:
      the fallback value used when no value is found in the index
    • setDefaultValue

      public MetadataParameter setDefaultValue(String defaultValue)
      Parameters:
      defaultValue - the fallback value to use when no value is found in the index
      Returns:
      this
    • getPrefix

      public String getPrefix()
      Getter for the field prefix.
      Returns:
      the string prepended to the rendered value in the output
    • setPrefix

      public MetadataParameter setPrefix(String prefix)
      Parameters:
      prefix - the string prepended to the rendered value in the output
      Returns:
      this
    • getSuffix

      public String getSuffix()
      Getter for the field suffix.
      Returns:
      the string appended to the rendered value in the output
    • setSuffix

      public MetadataParameter setSuffix(String suffix)
      Parameters:
      suffix - the string appended to the rendered value in the output
      Returns:
      this
    • setScope

      public MetadataParameter setScope(String scope)
    • getScope

      public String getScope()
    • getCondition

      public String getCondition()
    • setCondition

      public MetadataParameter setCondition(String condition)
      Parameters:
      condition - the Solr-query-style condition that must be satisfied for this parameter to be rendered
      Returns:
      this
    • getInputPattern

      public String getInputPattern()
    • setInputPattern

      public MetadataParameter setInputPattern(String inputPattern)
      Parameters:
      inputPattern - the regular expression pattern applied to the raw input value before transformation
      Returns:
      this
    • getOutputPattern

      public String getOutputPattern()
    • setOutputPattern

      public MetadataParameter setOutputPattern(String outputPattern)
      Parameters:
      outputPattern - the replacement pattern applied to the value after input-pattern matching
      Returns:
      this
    • isAddUrl

      public boolean isAddUrl()
      isAddUrl.
      Returns:
      true if a hyperlink URL should be generated and attached to this parameter's rendered value, false otherwise
    • setAddUrl

      public MetadataParameter setAddUrl(boolean addUrl)
      Parameters:
      addUrl - true if a hyperlink URL should be generated and attached to this parameter's rendered value
      Returns:
      this
    • isTopstructValueFallback

      public boolean isTopstructValueFallback()
      isTopstructValueFallback.
      Returns:
      true if the top-level structure element's value should be used as a fallback when no value is found, false otherwise
    • setTopstructValueFallback

      public MetadataParameter setTopstructValueFallback(boolean topstructValueFallback)
      Parameters:
      topstructValueFallback - true if the top-level structure element's value should be used as a fallback when no value is found
      Returns:
      this
    • isRemoveHighlighting

      public boolean isRemoveHighlighting()
    • setRemoveHighlighting

      public MetadataParameter setRemoveHighlighting(boolean removeHighlighting)
      Parameters:
      removeHighlighting - true if search-term highlighting markup should be stripped from the rendered value
      Returns:
      this
    • getReplaceRules

      public List<MetadataReplaceRule> getReplaceRules()
      Getter for the field replaceRules.
      Returns:
      the list of find-and-replace rules applied to the value during rendering
    • setReplaceRules

      public MetadataParameter setReplaceRules(List<MetadataReplaceRule> replaceRules)
      Parameters:
      replaceRules - the list of find-and-replace rules applied to the value during rendering
      Returns:
      MetadataParameter
    • toString

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

      public static MetadataParameter createFromConfig(org.apache.commons.configuration2.HierarchicalConfiguration<org.apache.commons.configuration2.tree.ImmutableNode> config, boolean topstructValueFallbackDefaultValue)
      Parameters:
      config - the hierarchical configuration node to read from
      topstructValueFallbackDefaultValue - whether to fall back to topstruct value as default
      Returns:
      MetadataParameter