Package org.ametys.cms.search.model
Class SearchCriterionHelper
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.search.model.SearchCriterionHelper
- All Implemented Interfaces:
LogEnabled,Component,Serviceable
Helper for
SearchCriterion-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContentTypeExtensionPointThe content type extension pointprotected AmetysObjectResolverThe ametys object resolver.protected SearchModelHelperThe searchModelHelperprotected UserManagerThe user manager.protected UserPopulationDAOThe user population DAOstatic final StringThe component role. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetAllContentTypes(SearchModel model, Map<String, Object> contextualParameters) Get all the real content types that a model works on (the included content types, minus the excluded types).getCustomCriteriaConfiguration(SearchModel searchModel, Optional<Configuration> originalConf, Set<String> baseContentTypeIds, String customCriterionId, Optional<I18nizableText> group) Get the configuration of a custom criteria component.getFacetLabel(SearchCriterion criterion, String value, Locale currentLocale) Get the label of a facet value for the given criterion.getIndexingFieldCriteriaConfiguration(Optional<Configuration> originalConf, Set<String> baseContentTypeIds, String path, Optional<Query.Operator> operator, Optional<I18nizableText> group) Get the configuration of a criteria component.getIndexingFieldCriteriaConfiguration(SearchModel searchModel, Optional<Configuration> originalConf, Set<String> baseContentTypeIds, String path, Optional<Query.Operator> operator, Optional<I18nizableText> group) Get the configuration of a criteria component.getSystemCriteriaConfiguration(Optional<Configuration> originalConf, Set<String> baseContentTypeIds, String propertyId, Optional<I18nizableText> group) Get the configuration of a system criteria component.getSystemCriteriaConfiguration(SearchModel searchModel, Optional<Configuration> originalConf, Set<String> baseContentTypeIds, String propertyId, Optional<I18nizableText> group) Get the configuration of a system criteria component.voidservice(ServiceManager manager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The component role. -
_resolver
The ametys object resolver. -
_contentTypeExtensionPoint
The content type extension point -
_searchModelHelper
The searchModelHelper -
_userManager
The user manager. -
_userPopulationDAO
The user population DAO
-
-
Constructor Details
-
SearchCriterionHelper
public SearchCriterionHelper()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
getIndexingFieldCriteriaConfiguration
public Configuration getIndexingFieldCriteriaConfiguration(Optional<Configuration> originalConf, Set<String> baseContentTypeIds, String path, Optional<Query.Operator> operator, Optional<I18nizableText> group) throws ConfigurationException Get the configuration of a criteria component.- Parameters:
originalConf- the optional original criteria configuration.baseContentTypeIds- the "base" content type identifiers.path- the field path.operator- the optional criteria operatorgroup- the optional group- Returns:
- the configuration to provide to the criteria component.
- Throws:
ConfigurationException- if an error occurs.
-
getIndexingFieldCriteriaConfiguration
public Configuration getIndexingFieldCriteriaConfiguration(SearchModel searchModel, Optional<Configuration> originalConf, Set<String> baseContentTypeIds, String path, Optional<Query.Operator> operator, Optional<I18nizableText> group) throws ConfigurationException Get the configuration of a criteria component.- Parameters:
searchModel- the search model.originalConf- the optional original criteria configuration.baseContentTypeIds- the "base" content type identifiers.path- the field path.operator- the optional criteria operatorgroup- the optional group- Returns:
- the configuration to provide to the criteria component.
- Throws:
ConfigurationException- if an error occurs.
-
getSystemCriteriaConfiguration
public Configuration getSystemCriteriaConfiguration(Optional<Configuration> originalConf, Set<String> baseContentTypeIds, String propertyId, Optional<I18nizableText> group) throws ConfigurationException Get the configuration of a system criteria component.- Parameters:
originalConf- the optional original criteria configuration.baseContentTypeIds- the "base" content type identifiers.propertyId- the system property identifier.group- The optional group.- Returns:
- the configuration to provide to the system criterion component.
- Throws:
ConfigurationException- if an error occurs.
-
getSystemCriteriaConfiguration
public Configuration getSystemCriteriaConfiguration(SearchModel searchModel, Optional<Configuration> originalConf, Set<String> baseContentTypeIds, String propertyId, Optional<I18nizableText> group) throws ConfigurationException Get the configuration of a system criteria component.- Parameters:
searchModel- the search model.originalConf- the optional original criteria configuration.baseContentTypeIds- the "base" content type identifiers.propertyId- the system property identifier.group- The optional group.- Returns:
- the configuration to provide to the system criterion component.
- Throws:
ConfigurationException- if an error occurs.
-
getCustomCriteriaConfiguration
public Configuration getCustomCriteriaConfiguration(SearchModel searchModel, Optional<Configuration> originalConf, Set<String> baseContentTypeIds, String customCriterionId, Optional<I18nizableText> group) throws ConfigurationException Get the configuration of a custom criteria component.- Parameters:
searchModel- the search model.originalConf- the original criteria configuration.baseContentTypeIds- the "base" content type identifiers.customCriterionId- the custom criterion idgroup- The group. Can be null.- Returns:
- the configuration to provide to the custom criterion component.
- Throws:
ConfigurationException- if an error occurs.
-
getAllContentTypes
Get all the real content types that a model works on (the included content types, minus the excluded types).- Parameters:
model- the search model.contextualParameters- the contextual parameters.- Returns:
- a Set of the content type IDs.
-
getFacetLabel
Get the label of a facet value for the given criterion.- Parameters:
criterion- the criterionvalue- the facet value.currentLocale- the current locale- Returns:
- the label, or null if the value does not exist.
-