Interface FormQuestionType
- All Known Implementing Classes:
AbstractFormQuestionType
,AbstractStaticFormQuestionType
,CheckBoxQuestionType
,ChoicesListQuestionType
,ComputedQuestionType
,DateTimeQuestionType
,FileQuestionType
,MatrixQuestionType
,NumberQuestionType
,RichTextQuestionType
,SimpleTextQuestionType
,TextAreaQuestionType
public interface FormQuestionType
Interface for question's types
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
canBeAnsweredByUser
(FormQuestion question) Returntrue
if the type of question can be answered by user.void
doAdditionalOperations
(FormQuestion question, Map<String, Object> values) Do additional operations to create or edit the questionGet the category of question typeGet the default title depending on typeGet description of question typeGet display order of the question typeGet the display XSLT filegetEntryModel
(FormQuestion question) Get the form entry model for the question typegetFieldToDisableIfFormPublished
(FormQuestion question) Get field to disable if form is publishedGet icon of question type buttongetId()
Get id of the question typedefault String
getJSConverter
(FormQuestion question) Get the js converter for the choice listdefault String
getJSRenderer
(FormQuestion question) Get the js renderer for the choice listgetLabel()
Get label of question typegetModel()
Get the form question modelGet the scripts to importgetStorageType
(FormQuestion question) Get the storage type of the question typegetView()
Get the form question viewboolean
isQuestionConfigured
(FormQuestion question) Say if question needs more configuration to be useddefault boolean
onlyForDisplay
(FormQuestion question) Returntrue
if the type of question is only for display.void
saxAdditionalInfos
(ContentHandler contentHandler, FormQuestion question) Sax additional informations for the question typevoid
saxEntryValue
(ContentHandler contentHandler, FormQuestion question, FormEntry entry) Sax the entry value depending on the question typevoid
validateEntryValues
(FormQuestion question, Map<String, Object> values, Multimap<String, I18nizableText> errors) Validate values to create a form entryvoid
validateQuestionValues
(Map<String, Object> values, Map<String, I18nizableText> errors) Validate values to create or edit the questiondefault Object
valueToJSONForClient
(Object value, FormQuestion question, FormEntry entry, ModelItem modelItem) Convert the entry value into a JSON object to use client side
-
Method Details
-
getId
Get id of the question type- Returns:
- the id
-
getLabel
Get label of question type- Returns:
- the label
-
getDescription
Get description of question type- Returns:
- the description
-
getDisplayOrder
Get display order of the question type- Returns:
- the display order
-
getIconGlyph
Get icon of question type button- Returns:
- the icon-glyph name
-
getScripts
Get the scripts to import- Returns:
- the list of scripts
-
getCategory
Get the category of question type- Returns:
- the name of the category in questionTypeButtonMenu
-
getDisplayXSLT
Get the display XSLT file- Returns:
- the display XSLT file
-
getView
Get the form question view- Returns:
- a view of question model
-
getModel
Get the form question model- Returns:
- the form question model
-
getEntryModel
Get the form entry model for the question type- Parameters:
question
- the question- Returns:
- the form entry model
-
getStorageType
Get the storage type of the question type- Parameters:
question
- the question- Returns:
- the storage type
-
getDefaultTitle
Get the default title depending on type- Returns:
- the default title
-
saxAdditionalInfos
Sax additional informations for the question type- Parameters:
contentHandler
- the content handlerquestion
- the question- Throws:
SAXException
- if a saxing error occurred
-
validateQuestionValues
Validate values to create or edit the question- Parameters:
values
- the valueserrors
- the errors
-
validateEntryValues
void validateEntryValues(FormQuestion question, Map<String, Object> values, Multimap<String, I18nizableText> errors) Validate values to create a form entry- Parameters:
question
- the questionvalues
- the valueserrors
- the errors
-
doAdditionalOperations
Do additional operations to create or edit the question- Parameters:
question
- the questionvalues
- the values
-
getFieldToDisableIfFormPublished
Get field to disable if form is published- Parameters:
question
- the form question- Returns:
- the list of field name
-
saxEntryValue
void saxEntryValue(ContentHandler contentHandler, FormQuestion question, FormEntry entry) throws SAXException Sax the entry value depending on the question type- Parameters:
contentHandler
- the content handlerquestion
- the question getting saxedentry
- the entry- Throws:
SAXException
- exception while saxing entry
-
isQuestionConfigured
Say if question needs more configuration to be used- Parameters:
question
- the current question- Returns:
- false if question needs more configuration, true by default
-
getJSRenderer
Get the js renderer for the choice list- Parameters:
question
- the question- Returns:
- the js renderer
-
getJSConverter
Get the js converter for the choice list- Parameters:
question
- the question- Returns:
- the js converter
-
valueToJSONForClient
default 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
-
onlyForDisplay
Returntrue
if the type of question is only for display.- Parameters:
question
- the question- Returns:
true
if the type of question is only for display.
-
canBeAnsweredByUser
Returntrue
if the type of question can be answered by user.- Parameters:
question
- the question- Returns:
true
if the type of question can be answered by user.
-