Class CmsRestrictionRule


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

      • CmsRestrictionRule

        public CmsRestrictionRule​(java.lang.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​(java.lang.String field,
                                  java.lang.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 Detail

      • getFieldForLocale

        public java.lang.String getFieldForLocale​(java.util.Locale l)
        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

        public CmsRestrictionRule.MatchType 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 java.lang.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 java.lang.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.