Class FormQuestionSearchCriterionDefinition<T>
java.lang.Object
org.ametys.runtime.model.AbstractModelItem
org.ametys.runtime.model.DefaultElementDefinition<T>
org.ametys.cms.search.model.impl.AbstractCriterionDefinition<T>
org.ametys.web.frontoffice.search.metamodel.impl.AbstractSearchServiceCriterionDefinition<T>
org.ametys.plugins.forms.search.criteria.AbstractFormEntrySearchCriterionDefinition<T>
org.ametys.plugins.forms.search.criteria.FormQuestionSearchCriterionDefinition<T>
- Type Parameters:
T- the type of the criterion value
- All Implemented Interfaces:
Comparable<ModelItem>,CriterionDefinition<T>,ElementDefinition<T>,ModelItem,Labelable,ModifiableLabelable,SearchServiceCriterionDefinition<T>
public class FormQuestionSearchCriterionDefinition<T>
extends AbstractFormEntrySearchCriterionDefinition<T>
Form question search criterion definition, based on a form question. The criterion definition is used to create search criteria based on form questions, and to provide information about the criterion (label, widget, etc.).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FormQuestionThe form question on which the criterion is basedFields inherited from class org.ametys.plugins.forms.search.criteria.AbstractFormEntrySearchCriterionDefinition
_form, _formEntryDAO, _modelItemTypeEP, _userManagerFields inherited from class org.ametys.web.frontoffice.search.metamodel.impl.AbstractSearchServiceCriterionDefinition
_criterionTypeExtensionPoint, _searchServiceCriterionDefinitionHelperFields inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_criterionDefinitionHelper, _joinedPaths, _multipleOperandOperator, _solrFacetFieldNameFields inherited from class org.ametys.runtime.model.DefaultElementDefinition
_loggerFields inherited from class org.ametys.runtime.model.AbstractModelItem
__context, __serviceManagerFields inherited from interface org.ametys.runtime.model.ElementDefinition
CONFIG_DEFAULT_VALUE_TYPEFields inherited from interface org.ametys.runtime.model.ModelItem
ITEM_PATH_SEPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionConstructor of the criterion definition for a form question -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the enumerator.getFacetLabel(String value, Map<String, Object> contextualParameters) Gets the label of a facet valueGet the model item id of the form entry on which the criterion is based.Get the model item label of the form entry on which the criterion is based.getSolrFacetFieldName(Map<String, Object> contextualParameters) Retrieves the name of the criterion's solr facet fieldRetrieves the widget to use for rendering.Get the widget's parametersbooleanTest if the element is multiple.Methods inherited from class org.ametys.plugins.forms.search.criteria.AbstractFormEntrySearchCriterionDefinition
getEmptyValueQuery, getFormEntryDAO, getJoinedPaths, getLabel, getModelItemTypeEP, getName, getSearchable, getType, getUserManager, setSearchableMethods inherited from class org.ametys.web.frontoffice.search.metamodel.impl.AbstractSearchServiceCriterionDefinition
_getCriterionTypeExtensionPoint, _getSearchServiceCriterionDefinitionHelper, _toJSON, dispose, getRestrictedEnumerator, isEnumerated, isTooBigForStaticEnumeratorMethods inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_getCriterionDefinitionHelper, _getDefaultWidget, _getDefaultWidgetParameters, convertQueryValue, getMultipleOperandOperator, getQuery, getQueryContext, setJoinedPaths, setSolrFacetFieldNameMethods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_defaultValueToJSON, _getDefaultValues, _getSimpleDefaultValue, _widgetToJSON, _widgetToSAX, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, of, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setType, setValidator, setValidatorConfiguration, setWidget, setWidgetParameters, toSAXMethods inherited from class org.ametys.runtime.model.AbstractModelItem
_getModelItemHelper, _shouldJSONBeEmpty, _widgetParameterToSAX, addItemChecker, compareTo, disableConditionsToJSON, equals, getDescription, getDisableConditions, getItemCheckers, getModel, getParent, getPath, getPluginName, hashCode, setContext, setDescription, setDisableConditions, setLabel, setModel, setName, setParent, setPluginName, setServiceManager, toJSON, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface org.ametys.cms.search.model.CriterionDefinition
convertQueryValue, getQuery, getQuery, getQueryMethods inherited from interface org.ametys.runtime.model.ElementDefinition
getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, isEditable, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setValidator, setValidatorConfigurationMethods inherited from interface org.ametys.runtime.util.Labelable
getDescriptionMethods inherited from interface org.ametys.runtime.model.ModelItem
addItemChecker, getDisableConditions, getItemCheckers, getModel, getParent, getPath, getPluginName, setDisableConditions, setModel, setParent, setPluginName, setType, setWidget, setWidgetParameters, toJSON, toSAXMethods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setNameMethods inherited from interface org.ametys.web.frontoffice.search.metamodel.SearchServiceCriterionDefinition
convertRestrictedValue, facetValueToSAX, getContextPrefixLabel
-
Field Details
-
_question
The form question on which the criterion is based
-
-
Constructor Details
-
FormQuestionSearchCriterionDefinition
Constructor of the criterion definition for a form question- Parameters:
question- the form question
-
-
Method Details
-
getModelItemLabel
Description copied from class:AbstractFormEntrySearchCriterionDefinitionGet the model item label of the form entry on which the criterion is based.- Specified by:
getModelItemLabelin classAbstractFormEntrySearchCriterionDefinition<T>- Returns:
- the model item label of the form entry on which the criterion is based.
-
getModelItemId
Description copied from class:AbstractFormEntrySearchCriterionDefinitionGet the model item id of the form entry on which the criterion is based.- Specified by:
getModelItemIdin classAbstractFormEntrySearchCriterionDefinition<T>- Returns:
- the model item id of the form entry on which the criterion is based.
-
getWidget
Description copied from interface:ModelItemRetrieves the widget to use for rendering.- Specified by:
getWidgetin interfaceModelItem- Overrides:
getWidgetin classAbstractCriterionDefinition<T>- Returns:
- the widget or
nullif none is defined.
-
getWidgetParameters
Description copied from interface:ModelItemGet the widget's parameters- Specified by:
getWidgetParametersin interfaceModelItem- Overrides:
getWidgetParametersin classAbstractCriterionDefinition<T>- Returns:
- the widget's parameters
-
isMultiple
Description copied from interface:ElementDefinitionTest if the element is multiple.- Specified by:
isMultiplein interfaceElementDefinition<T>- Overrides:
isMultiplein classDefaultElementDefinition<T>- Returns:
trueif the metadata is multiple.
-
getEnumerator
Description copied from interface:ElementDefinitionRetrieves the enumerator.- Specified by:
getEnumeratorin interfaceElementDefinition<T>- Overrides:
getEnumeratorin classDefaultElementDefinition<T>- Returns:
- the enumerator or
nullif none is defined.
-
getSolrFacetFieldName
Description copied from interface:CriterionDefinitionRetrieves the name of the criterion's solr facet field- Specified by:
getSolrFacetFieldNamein interfaceCriterionDefinition<T>- Overrides:
getSolrFacetFieldNamein classAbstractCriterionDefinition<T>- Parameters:
contextualParameters- the search contextual parameters.- Returns:
- the name of the criterion's solr facet field. Can be
nullif the criterion is not facetable
-
getFacetLabel
public Optional<I18nizableText> getFacetLabel(String value, Map<String, Object> contextualParameters) Description copied from class:AbstractFormEntrySearchCriterionDefinitionGets the label of a facet value- Overrides:
getFacetLabelin classAbstractFormEntrySearchCriterionDefinition<T>- Parameters:
value- the facet valuecontextualParameters- the contextual parameters- Returns:
- the label of a facet value
-