java.lang.Object
org.opencms.jsp.search.config.parser.simplesearch.preconfiguredrestrictions.CmsRestrictionRule

public class CmsRestrictionRule extends Object
A single restriction rule, telling for which field and type what kind of restriction should be enforced.
  • Constructor Details

    • CmsRestrictionRule

      public CmsRestrictionRule(String field)
      Constructs a restriction rule for the provided field that has no type restriction and default combination mode and match type.
      Parameters:
      field - the field to put the restriction on.
    • CmsRestrictionRule

      public CmsRestrictionRule(String field, String type, CmsRestrictionRule.MatchType matchType, CmsConfigurationBean.CombinationMode combinationModeBetweenFields, CmsConfigurationBean.CombinationMode combinationModeInField)
      Constructs restriction rule with the provided settings.
      Parameters:
      field - the field the restriction has to be enforced on.
      type - the resource type the restriction should be enforced on.
      matchType - the way how values should be treated.
      combinationModeBetweenFields - the way how values in different fields should be combined.
      combinationModeInField - the way how values in different fields in one field should be combined.
  • Method Details

    • getCombinationModeBetweenFields

      Returns the way values of different input fields are combined (match any or all).
      Returns:
      the way values of different input fields are combined (match any or all).
    • getCombinationModeInField

      Returns the way values of different input fields are combined (match any or all).
      Returns:
      the way values of different input fields are combined (match any or all).
    • getFieldForLocale

      Returns the name of the solr field, the restrictions should be enforced on for, dependent on the provided locale.
      Parameters:
      l - the search locale.
      Returns:
      the name of the solr field, the restrictions should be enforced on for, dependent on the provided locale.
    • getMatchType

      Returns the match type for values, e.g., exact, as-is, prefix, ....
      Returns:
      the match type for values, e.g., exact, as-is, prefix, ....
    • getRawField

      public String getRawField()
      Returns the name of the solr field, the restrictions should be enforced on, but without resolving the locale placeholder.
      Returns:
      the name of the solr field, the restrictions should be enforced on, but without resolving the locale placeholder.
    • getType

      public String getType()
      Returns the name of the resource type, the restriction should be enforced for.
      Returns:
      the resource type, the restriction should be enforced for. null is returned iff the restriction should hold for all resource types.