Class ManualSourceType
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.forms.question.sources.AbstractSourceType
org.ametys.plugins.forms.question.sources.ManualSourceType
- All Implemented Interfaces:
LazyEnumerator<ChoiceOption>
,ChoiceSourceType
,LogEnabled
,PluginAware
,Configurable
,Serviceable
Class for creating choice list from manual source
-
Field Summary
Modifier and TypeFieldDescriptionMap of ModelItems specific to ManualSourceTypestatic final String
Constant for element definition name of the select gridFields inherited from class org.ametys.plugins.forms.question.sources.AbstractSourceType
_id, _jsonUtils, _label, _pluginName, QUESTION_PARAM_KEY
Fields inherited from interface org.ametys.plugins.forms.enumerators.LazyEnumerator
LANG_PARAMETER_KEY, PATTERN_PARAMETER_KEY, SORT_PARAMETER_KEY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetEntry
(ChoiceOption value, Map<String, Object> contextParams) Retrieves a single label from a value.Get field to disable if form is publishedGet the type model itemsgetTypedEntries
(Map<String, Object> contextParams) Provides the enumerated values with their optional label.Get the view items for the main tabboolean
true
if the enumerator has remote data and need lazy loadingsearchEntries
(Map<String, Object> contextParams, int limit, Object paginationData) Provides the enumerated values with their optional label.Methods inherited from class org.ametys.plugins.forms.question.sources.AbstractSourceType
_getComputedComplexValue, _getComputedStringValue, _getQuestionFromParam, configure, getId, getJSConverter, getJSRenderer, getLabel, getStorageType, removeEmptyOrOtherValue, service, setPluginInfo, valueToJSONForClient
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ATTRIBUTE_GRID
Constant for element definition name of the select grid- See Also:
-
_manualChoicesItems
Map of ModelItems specific to ManualSourceType
-
-
Constructor Details
-
ManualSourceType
public ManualSourceType()
-
-
Method Details
-
getModelItems
Description copied from interface:ChoiceSourceType
Get the type model items- Returns:
- a map of the model items
-
getViewItems
Description copied from interface:ChoiceSourceType
Get the view items for the main tab- Returns:
- a list of view items
-
getFieldToDisableIfFormPublished
Description copied from interface:ChoiceSourceType
Get field to disable if form is published- Specified by:
getFieldToDisableIfFormPublished
in interfaceChoiceSourceType
- Overrides:
getFieldToDisableIfFormPublished
in classAbstractSourceType
- Returns:
- the list of field name
-
remoteData
Description copied from interface:ChoiceSourceType
true
if the enumerator has remote data and need lazy loading- Returns:
true
if the enumerator has remote data and need lazy loading
-
getEntry
public I18nizableText getEntry(ChoiceOption value, Map<String, Object> contextParams) throws ExceptionDescription copied from interface:LazyEnumerator
Retrieves a single label from a value.- Parameters:
value
- the value.contextParams
- the search contextual parameters- Returns:
- the label or
null
if not found. - Throws:
Exception
- if an error occurs.
-
getTypedEntries
public Map<ChoiceOption,I18nizableText> getTypedEntries(Map<String, Object> contextParams) throws ExceptionDescription copied from interface:LazyEnumerator
Provides the enumerated values with their optional label.- Parameters:
contextParams
- the search contextual parameters- Returns:
- the enumerated values and their label.
- Throws:
Exception
- if an error occurs.
-
searchEntries
public Map<ChoiceOption,I18nizableText> searchEntries(Map<String, Object> contextParams, int limit, Object paginationData) throws ExceptionDescription copied from interface:LazyEnumerator
Provides the enumerated values with their optional label.- Parameters:
contextParams
- the search contextual parameterslimit
- the limit of entriespaginationData
- the data to process pagination- Returns:
- the enumerated values and their label.
- Throws:
Exception
- if an error occurs.
-