Class SimpleTextQuestionType
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.plugins.forms.question.types.AbstractStaticFormQuestionType
org.ametys.plugins.forms.question.types.AbstractFormQuestionType
org.ametys.plugins.forms.question.types.SimpleTextQuestionType
- All Implemented Interfaces:
FormQuestionType
,ConfidentialAwareQuestionType
,DescriptibleFormQuestionType
,IllustrableFormQuestionType
,MandatoryAwareFormQuestionType
,RestrictiveQuestionType
,LogEnabled
,PluginAware
,Configurable
,Serviceable
Class for creating simple text questions
-
Field Summary
Modifier and TypeFieldDescriptionprotected CurrentUserProvider
The current user providerprotected UserManager
The users managerstatic final String
Constant for autofill attribute.static final String
Constant for custom regexp attribute.static final String
Constant for default value attribute.static final String
Constant for placeholder attribute.static final String
Constant for regexp attribute.static final String
Name of autofillStaticEnumerator entry that enable default value fieldstatic final String
Name of regexStaticEnumerator entry that enable custom regex fieldstatic final String
Constant for default titlestatic final String
Name of email autofillStaticEnumerator entrystatic final String
Name of email regexStaticEnumerator entrystatic final String
Name of empty autofillStaticEnumerator entrystatic final String
Name of empty regexStaticEnumerator entrystatic final String
Name of firstName autofillStaticEnumerator entrystatic final String
Name of fullname autofillStaticEnumerator entrystatic final String
Name of id autofillStaticEnumerator entrystatic final String
Name of lastName autofillStaticEnumerator entrystatic final String
Name of phone regexStaticEnumerator entryFields inherited from class org.ametys.plugins.forms.question.types.AbstractFormQuestionType
_workflowHelper
Fields inherited from class org.ametys.plugins.forms.question.types.AbstractStaticFormQuestionType
_category, _description, _formQuestionModel, _i18nUtils, _iconGlyph, _id, _label, _pluginName, _priority, _scripts, _xslt
Fields inherited from interface org.ametys.plugins.forms.question.types.ConfidentialAwareQuestionType
ATTRIBUTE_CONFIDENTIALITY
Fields inherited from interface org.ametys.plugins.forms.question.types.DescriptibleFormQuestionType
ATTRIBUTE_DESCRIPTION
Fields inherited from interface org.ametys.plugins.forms.question.types.IllustrableFormQuestionType
ATTRIBUTE_PICTURE, ATTRIBUTE_PICTURE_ALTERNATIVE
Fields inherited from interface org.ametys.plugins.forms.question.types.MandatoryAwareFormQuestionType
ATTRIBUTE_MANDATORY
Fields inherited from interface org.ametys.plugins.forms.question.types.RestrictiveQuestionType
ATTRIBUTE_READING, ATTRIBUTE_READING_CHECKBOX, ATTRIBUTE_WRITING, ATTRIBUTE_WRITING_CHECKBOX, INITIAL_WORKFLOW_ID
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected SimpleViewItemGroup
Define the content of the advanced tabprotected String
_getAutofillValue
(FormQuestion question, User user) Get autofill valueprotected ModelItem
_getEntryModelItem
(FormQuestion question) Define the entry model itemsprotected String
_getEntryRegExpPattern
(FormQuestion question) Get the validation pattern for entries.Get the list of ModelItemsprotected String
_getRegExpPattern
(FormQuestion question) Get the validation pattern.Get the default title depending on typegetFieldToDisableIfFormPublished
(FormQuestion question) Get field to disable if form is publishedgetStorageType
(FormQuestion question) Get the storage type of the question typeboolean
isCacheable
(FormQuestion question) Returntrue
if the type of question can be cacheable.void
saxAdditionalInfos
(ContentHandler contentHandler, FormQuestion question) Sax additional informations for the question typevoid
service
(ServiceManager manager) void
validateQuestionValues
(Map<String, Object> values, Map<String, I18nizableText> errors) Validate values to create or edit the questionMethods inherited from class org.ametys.plugins.forms.question.types.AbstractFormQuestionType
_getMainTab, _getTabs, getWorkflowDescriptor
Methods inherited from class org.ametys.plugins.forms.question.types.AbstractStaticFormQuestionType
_createAdvancedTab, _createMainTab, _getRulesTab, configure, doAdditionalOperations, getCategory, getDescription, getDisplayOrder, getDisplayXSLT, getEntryModel, getIconGlyph, getId, getLabel, getModel, getScripts, getView, isQuestionConfigured, saxEntryValue, setPluginInfo, validateEntryValues
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.plugins.forms.question.types.ConfidentialAwareQuestionType
getConfidentialityModelItem, getConfidentialityViewElement
Methods inherited from interface org.ametys.plugins.forms.question.types.DescriptibleFormQuestionType
getDescription, getDescriptionModelItem, getDescriptionViewElement
Methods inherited from interface org.ametys.plugins.forms.question.FormQuestionType
canBeAnsweredByUser, getJSConverter, getJSRenderer, onlyForDisplay, valueToJSONForClient
Methods inherited from interface org.ametys.plugins.forms.question.types.IllustrableFormQuestionType
getIllustration, getIllustrationAlternative, getIllustrationModelItems, getIllustrationTab
Methods inherited from interface org.ametys.plugins.forms.question.types.MandatoryAwareFormQuestionType
getMandatoryModelItem, getMandatoryValidator, getMandatoryViewElement, isMandatory
Methods inherited from interface org.ametys.plugins.forms.question.types.RestrictiveQuestionType
getReadingSteps, getRestrictiveModelItems, getRestrictiveTab, getWritingSteps, isModifiable, isReadRestricted
-
Field Details
-
ATTRIBUTE_REGEXP
Constant for regexp attribute.- See Also:
-
ATTRIBUTE_CUSTOM_REGEX
Constant for custom regexp attribute.- See Also:
-
ATTRIBUTE_AUTOFILL
Constant for autofill attribute.- See Also:
-
ATTRIBUTE_DEFAULT_VALUE
Constant for default value attribute.- See Also:
-
EMPTY_REGEX_VALUE
Name of empty regexStaticEnumerator entry- See Also:
-
EMAIL_REGEX_VALUE
Name of email regexStaticEnumerator entry- See Also:
-
PHONE_REGEX_VALUE
Name of phone regexStaticEnumerator entry- See Also:
-
CUSTOM_REGEX_VALUE
Name of regexStaticEnumerator entry that enable custom regex field- See Also:
-
EMPTY_AUTOFILL_VALUE
Name of empty autofillStaticEnumerator entry- See Also:
-
EMAIL_AUTOFILL_VALUE
Name of email autofillStaticEnumerator entry- See Also:
-
ID_AUTOFILL_VALUE
Name of id autofillStaticEnumerator entry- See Also:
-
FULLNAME_AUTOFILL_VALUE
Name of fullname autofillStaticEnumerator entry- See Also:
-
FIRSTNAME_AUTOFILL_VALUE
Name of firstName autofillStaticEnumerator entry- See Also:
-
LASTNAME_AUTOFILL_VALUE
Name of lastName autofillStaticEnumerator entry- See Also:
-
CUSTOM_AUTOFILL_VALUE
Name of autofillStaticEnumerator entry that enable default value field- See Also:
-
ATTRIBUTE_PLACEHOLDER
Constant for placeholder attribute.- See Also:
-
DEFAULT_TITLE
Constant for default title- See Also:
-
_currentUserProvider
The current user provider -
_userManager
The users manager
-
-
Constructor Details
-
SimpleTextQuestionType
public SimpleTextQuestionType()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Overrides:
service
in classAbstractFormQuestionType
- Throws:
ServiceException
-
_getModelItems
Description copied from class:AbstractStaticFormQuestionType
Get the list of ModelItems- Overrides:
_getModelItems
in classAbstractFormQuestionType
- Returns:
- a list of ModelItems
-
_getAdvancedTab
Description copied from class:AbstractFormQuestionType
Define the content of the advanced tab- Overrides:
_getAdvancedTab
in classAbstractFormQuestionType
- Returns:
- the advanced tab definition
-
getStorageType
Description copied from interface:FormQuestionType
Get the storage type of the question type- Parameters:
question
- the question- Returns:
- the storage type
-
_getEntryModelItem
Description copied from class:AbstractStaticFormQuestionType
Define the entry model items- Overrides:
_getEntryModelItem
in classAbstractFormQuestionType
- Parameters:
question
- the question- Returns:
- the entry model item
-
saxAdditionalInfos
public void saxAdditionalInfos(ContentHandler contentHandler, FormQuestion question) throws SAXException Description copied from interface:FormQuestionType
Sax additional informations for the question type- Specified by:
saxAdditionalInfos
in interfaceFormQuestionType
- Overrides:
saxAdditionalInfos
in classAbstractStaticFormQuestionType
- Parameters:
contentHandler
- the content handlerquestion
- the question- Throws:
SAXException
- if a saxing error occurred
-
_getAutofillValue
Get autofill value- Parameters:
question
- the questionuser
- the user- Returns:
- the autofill value.
null
if there is not autofill value
-
_getRegExpPattern
Get the validation pattern.- Parameters:
question
- the question- Returns:
- the validation pattern.
-
_getEntryRegExpPattern
Get the validation pattern for entries.- Parameters:
question
- the question- Returns:
- the validation pattern.
-
validateQuestionValues
Description copied from interface:FormQuestionType
Validate values to create or edit the question- Specified by:
validateQuestionValues
in interfaceFormQuestionType
- Overrides:
validateQuestionValues
in classAbstractStaticFormQuestionType
- Parameters:
values
- the valueserrors
- the errors
-
getDefaultTitle
Description copied from interface:FormQuestionType
Get the default title depending on type- Returns:
- the default title
-
getFieldToDisableIfFormPublished
Description copied from interface:FormQuestionType
Get field to disable if form is published- Specified by:
getFieldToDisableIfFormPublished
in interfaceFormQuestionType
- Overrides:
getFieldToDisableIfFormPublished
in classAbstractFormQuestionType
- Parameters:
question
- the form question- Returns:
- the list of field name
-
isCacheable
Description copied from interface:FormQuestionType
Returntrue
if the type of question can be cacheable.- Parameters:
question
- the question- Returns:
true
if the type of question can be cacheable.
-