Interface ChoiceSourceType
- All Superinterfaces:
LazyEnumerator<ChoiceOption>
- All Known Implementing Classes:
AbstractSourceType
,ManualSourceType
,ManualWithCostsSourceType
,TableRefSourceType
,UsersSourceType
Interface for Choice source's types
-
Field Summary
Fields inherited from interface org.ametys.plugins.forms.enumerators.LazyEnumerator
LANG_PARAMETER_KEY, PATTERN_PARAMETER_KEY, SORT_PARAMETER_KEY
-
Method Summary
Modifier and TypeMethodDescriptionGet field to disable if form is publishedgetId()
Get the type idGet the js converter for the choice listGet the js renderer for the choice listgetLabel()
Get the type labelGet the type model itemsgetStorageType
(FormQuestion question) Get the storage type of the source typeGet the view items for the main tabboolean
true
if the enumerator has remote data and need lazy loadingremoveEmptyOrOtherValue
(Object value) Remove the empty values or values equal to '__interval_other' from received valuevalueToJSONForClient
(Object value, FormQuestion question, FormEntry entry, ModelItem modelItem) Convert the entry value into a JSON object to use client sideMethods inherited from interface org.ametys.plugins.forms.enumerators.LazyEnumerator
getEntry, getTypedEntries, searchEntries
-
Method Details
-
getId
Get the type id- Returns:
- the id
-
getLabel
Get the type label- Returns:
- the label
-
getModelItems
Get the type model items- Returns:
- a map of the model items
-
getViewItems
Get the view items for the main tab- Returns:
- a list of view items
-
getFieldToDisableIfFormPublished
Get field to disable if form is published- Returns:
- the list of field name
-
remoteData
boolean remoteData()true
if the enumerator has remote data and need lazy loading- Returns:
true
if the enumerator has remote data and need lazy loading
-
getStorageType
Get the storage type of the source type- Parameters:
question
- the question- Returns:
- the storage type
-
getJSRenderer
Get the js renderer for the choice list- Returns:
- the js renderer
-
getJSConverter
Get the js converter for the choice list- Returns:
- the js converter
-
removeEmptyOrOtherValue
Remove the empty values or values equal to '__interval_other' from received value- Parameters:
value
- the receive value- Returns:
- the value without empty sub-values or without '__interval_other' if the other option is chosen. If the value is empty or equal to the other value, it returns null.
-
valueToJSONForClient
Object valueToJSONForClient(Object value, FormQuestion question, FormEntry entry, ModelItem modelItem) throws Exception Convert the entry value into a JSON object to use client side- Parameters:
value
- the value to convertquestion
- the form questionentry
- the form entrymodelItem
- the model item- Returns:
- The value as JSON
- Throws:
Exception
- if an error occurred
-