Package org.ametys.web.search.model.impl
Class ContentPrivacyCriterionDefinition
java.lang.Object
org.ametys.runtime.model.AbstractModelItem
org.ametys.runtime.model.DefaultElementDefinition<Boolean>
org.ametys.cms.search.model.impl.AbstractCriterionDefinition<Boolean>
org.ametys.cms.search.model.impl.DefaultSearchModelCriterionDefinition<Boolean>
org.ametys.cms.search.model.impl.AbstractStaticSearchModelCriterionDefinition<Boolean>
org.ametys.web.search.model.impl.ContentPrivacyCriterionDefinition
- All Implemented Interfaces:
Comparable<ModelItem>,CriterionDefinition<Boolean>,SearchModelCriterionDefinition<Boolean>,ElementDefinition<Boolean>,ModelItem,Labelable,ModifiableLabelable,Component,Configurable,Contextualizable,Serviceable
public class ContentPrivacyCriterionDefinition
extends AbstractStaticSearchModelCriterionDefinition<Boolean>
implements Contextualizable
Custom boolean
It's generally used as a hidden criterion to force the "true" or "false" value.
SearchModelCriterionDefinition representing whether to take content
access restrictions ("content privacy") into account.It's generally used as a hidden criterion to force the "true" or "false" value.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContextThe avalon contextprotected JSONUtilsThe JSON utils.protected StringThe site criterion ID.protected SiteManagerThe site manager.Fields inherited from class org.ametys.cms.search.model.impl.AbstractStaticSearchModelCriterionDefinition
_criterionTypeExtensionPointFields inherited from class org.ametys.cms.search.model.impl.DefaultSearchModelCriterionDefinition
_operatorFields 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(Configuration configuration) voidcontextualize(Context context) Get the criterion Operator.getQuery(Object value, Query.Operator customOperator, Map<String, Object> allValues, String language, Map<String, Object> contextualParameters) Get theQueryassociated to the given value.protected StringRetrieves the id of the property's typebooleanTest if the element is multiple.voidservice(ServiceManager manager) voidsetSiteCriterionName(String siteCriterionName) Set the site criterion nameMethods inherited from class org.ametys.cms.search.model.impl.AbstractStaticSearchModelCriterionDefinition
getType, setMultipleOperandOperator, setOperatorMethods inherited from class org.ametys.cms.search.model.impl.DefaultSearchModelCriterionDefinition
_getDefaultOperator, _toJSON, copyTo, getModel, toSAXMethods inherited from class org.ametys.cms.search.model.impl.AbstractCriterionDefinition
_getCriterionDefinitionHelper, _getDefaultWidget, _getDefaultWidgetParameters, convertQueryValue, getJoinedPaths, getMultipleOperandOperator, getQueryContext, getSolrFacetFieldName, getWidget, getWidgetParameters, setJoinedPaths, setSolrFacetFieldNameMethods inherited from class org.ametys.runtime.model.DefaultElementDefinition
_defaultValueToJSON, _getDefaultValues, _getSimpleDefaultValue, _widgetToJSON, _widgetToSAX, getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumerator, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, of, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setType, setValidator, setValidatorConfiguration, setWidget, setWidgetParametersMethods inherited from class org.ametys.runtime.model.AbstractModelItem
_getModelItemHelper, _shouldJSONBeEmpty, _widgetParameterToSAX, addItemChecker, compareTo, disableConditionsToJSON, equals, getDescription, getDisableConditions, getItemCheckers, getLabel, getName, 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, getJoinedPaths, getQuery, getQuery, getSolrFacetFieldNameMethods inherited from interface org.ametys.runtime.model.ElementDefinition
getCustomEnumerator, getCustomValidator, getDefaultValue, getEnumerator, getEnumeratorConfiguration, getParsedDefaultValues, getValidator, getValidatorConfiguration, isEditable, setCustomEnumerator, setCustomValidator, setDefaultValue, setEnumerator, setEnumeratorConfiguration, setMultiple, setParsedDefaultValues, setValidator, setValidatorConfigurationMethods inherited from interface org.ametys.runtime.util.Labelable
getDescription, getLabel, getNameMethods inherited from interface org.ametys.runtime.model.ModelItem
addItemChecker, getDisableConditions, getItemCheckers, getParent, getPath, getPluginName, getWidget, getWidgetParameters, setDisableConditions, setModel, setParent, setPluginName, setType, setWidget, setWidgetParameters, toJSONMethods inherited from interface org.ametys.runtime.util.ModifiableLabelable
setDescription, setLabel, setName
-
Field Details
-
_siteManager
The site manager. -
_jsonUtils
The JSON utils. -
_context
The avalon context -
_siteCriterionName
The site criterion ID.
-
-
Constructor Details
-
ContentPrivacyCriterionDefinition
public ContentPrivacyCriterionDefinition()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractStaticSearchModelCriterionDefinition<Boolean>- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
configure
- Specified by:
configurein interfaceConfigurable- Overrides:
configurein classAbstractStaticSearchModelCriterionDefinition<Boolean>- Throws:
ConfigurationException
-
getTypeId
Description copied from class:AbstractStaticSearchModelCriterionDefinitionRetrieves the id of the property's type- Specified by:
getTypeIdin classAbstractStaticSearchModelCriterionDefinition<Boolean>- Returns:
- the id of the property's type
-
isMultiple
Description copied from interface:ElementDefinitionTest if the element is multiple.- Specified by:
isMultiplein interfaceElementDefinition<Boolean>- Overrides:
isMultiplein classDefaultElementDefinition<Boolean>- Returns:
trueif the metadata is multiple.
-
getOperator
Description copied from interface:SearchModelCriterionDefinitionGet the criterion Operator.- Specified by:
getOperatorin interfaceSearchModelCriterionDefinition<Boolean>- Overrides:
getOperatorin classDefaultSearchModelCriterionDefinition<Boolean>- Returns:
- the criterion Operator.
-
setSiteCriterionName
Set the site criterion name- Parameters:
siteCriterionName- the site criterion name to set
-
getQuery
public Query getQuery(Object value, Query.Operator customOperator, Map<String, Object> allValues, String language, Map<String, Object> contextualParameters) Description copied from interface:CriterionDefinitionGet theQueryassociated to the given value.- Specified by:
getQueryin interfaceCriterionDefinition<Boolean>- Overrides:
getQueryin classDefaultSearchModelCriterionDefinition<Boolean>- Parameters:
value- The user-submitted value (or the default value if not set) for this criterion.customOperator- In advanced search mode, the operator chosen by the user.nullto use the criterion-defined operator (simple search mode).allValues- All the user-submitted values.language- The current search language.contextualParameters- the search contextual parameters.- Returns:
Queryassociated to the given value.
-