Package org.ametys.core.util
Class UsersAndGroupsDataDisableConditionsEvaluator
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.runtime.model.disableconditions.AbstractDisableConditionsEvaluator<Void>
org.ametys.core.util.UsersAndGroupsDataDisableConditionsEvaluator
- All Implemented Interfaces:
DisableConditionsEvaluator<Void>
,LogEnabled
,Component
public class UsersAndGroupsDataDisableConditionsEvaluator
extends AbstractDisableConditionsEvaluator<Void>
Evaluator for
DisableConditions
on users and groups data
Users and groups data can not be accessed by a specific object, so
Void
is used to type this evaluatorgetStoredValue
can not be implemented
-
Nested Class Summary
Nested classes/interfaces inherited from class org.ametys.runtime.model.disableconditions.AbstractDisableConditionsEvaluator
AbstractDisableConditionsEvaluator.DefinitionAndValue
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
containsValue
(ModelItemAccessor modelItemAccessor, String conditionDataPath, Map<String, Object> values, Map<String, Object> contextualParameters) Check if the valuesMap
contains a value for the conditionprotected ModelItem
getModelItem
(ModelItemAccessor modelItemAccessor, String dataPath, Map<String, Object> contextualParameters) Retrieves the model itemprotected Object
getStoredValue
(String conditionDataPath, Optional<String> oldConditionDataPath, Void object, Map<String, Object> contextualParameters) Retrieves the condition value from data stored in the given objectprotected Object
getValueFromMap
(ModelItemAccessor modelItemAccessor, String conditionDataPath, Map<String, Object> values, Map<String, Object> contextualParameters) Retrieves the condition value from the valuesMap
Methods inherited from class org.ametys.runtime.model.disableconditions.AbstractDisableConditionsEvaluator
_emptyStringToNull, _getConditionDefinitionAndValue, _resultIsSufficient, evaluateDisableCondition, evaluateDisableConditions, evaluateDisableConditions, evaluateDisableConditions, evaluateDisableConditions, evaluateDisableConditionValue
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The Avalon role -
DEFINITIONS_PARAMETER_KEY
The contextual parameter key for parameter's definitions- See Also:
-
PREFIX_PARAMETER_KEY
The contextual parameter key for values prefix- See Also:
-
-
Constructor Details
-
UsersAndGroupsDataDisableConditionsEvaluator
-
-
Method Details
-
getModelItem
protected ModelItem getModelItem(ModelItemAccessor modelItemAccessor, String dataPath, Map<String, Object> contextualParameters) throws UndefinedItemPathExceptionDescription copied from class:AbstractDisableConditionsEvaluator
Retrieves the model item- Overrides:
getModelItem
in classAbstractDisableConditionsEvaluator<Void>
- Parameters:
modelItemAccessor
- the relative accessor to the given data pathdataPath
- the data path of the model item to retrievecontextualParameters
- the contextual parameters- Returns:
- the model item
- Throws:
UndefinedItemPathException
- If no item is found for the given path
-
containsValue
protected boolean containsValue(ModelItemAccessor modelItemAccessor, String conditionDataPath, Map<String, Object> values, Map<String, Object> contextualParameters) Description copied from class:AbstractDisableConditionsEvaluator
Check if the valuesMap
contains a value for the condition- Specified by:
containsValue
in classAbstractDisableConditionsEvaluator<Void>
- Parameters:
modelItemAccessor
- the relative accessor to the given condition pathconditionDataPath
- the absolute data path of the conditionvalues
- the valuesMap
contextualParameters
- the contextual parameters- Returns:
true
if there is a value (even empty) for the condition in the valuesMap
,false
otherwise
-
getValueFromMap
protected Object getValueFromMap(ModelItemAccessor modelItemAccessor, String conditionDataPath, Map<String, Object> values, Map<String, Object> contextualParameters) Description copied from class:AbstractDisableConditionsEvaluator
Retrieves the condition value from the valuesMap
- Specified by:
getValueFromMap
in classAbstractDisableConditionsEvaluator<Void>
- Parameters:
modelItemAccessor
- the relative accessor to the given condition pathconditionDataPath
- the absolute data path of the conditionvalues
- the valuesMap
contextualParameters
- the contextual parameters- Returns:
- the condition value found in the values
Map
-
getStoredValue
protected Object getStoredValue(String conditionDataPath, Optional<String> oldConditionDataPath, Void object, Map<String, Object> contextualParameters) Description copied from class:AbstractDisableConditionsEvaluator
Retrieves the condition value from data stored in the given object- Specified by:
getStoredValue
in classAbstractDisableConditionsEvaluator<Void>
- Parameters:
conditionDataPath
- the absolute data path of the conditionoldConditionDataPath
- the absolute old data path of the conditionobject
- the object holding the data to evaluate and the condition valuecontextualParameters
- the contextual parameters- Returns:
- the condition value from data stored in the object
-