Class CmsRestrictionRule
- java.lang.Object
-
- org.opencms.jsp.search.config.parser.simplesearch.preconfiguredrestrictions.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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
CmsRestrictionRule.MatchType
Match type of the restriction, i.e., how the values should be treated.
-
Constructor Summary
Constructors Constructor Description 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.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CmsConfigurationBean.CombinationMode
getCombinationModeBetweenFields()
Returns the way values of different input fields are combined (match any or all).CmsConfigurationBean.CombinationMode
getCombinationModeInField()
Returns the way values of different input fields are combined (match any or all).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.CmsRestrictionRule.MatchType
getMatchType()
Returns the match type for values, e.g., exact, as-is, prefix, ....java.lang.String
getRawField()
Returns the name of the solr field, the restrictions should be enforced on, but without resolving the locale placeholder.java.lang.String
getType()
Returns the name of the resource type, the restriction should be enforced for.
-
-
-
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
-
getCombinationModeBetweenFields
public CmsConfigurationBean.CombinationMode 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
public CmsConfigurationBean.CombinationMode 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
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.
-
-