Class FileQuestionType
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.FileQuestionType
- All Implemented Interfaces:
FormQuestionType
,ConfidentialAwareQuestionType
,DescriptibleFormQuestionType
,IllustrableFormQuestionType
,MandatoryAwareFormQuestionType
,LogEnabled
,PluginAware
,Configurable
,Serviceable
Class for creating file questions
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
Constant for all extensionsstatic final String
Constant for allowed extensions attribute.static final String
Constant for other allowed extensions attribute.static final String
Constant for max size attribute.static final String
Constant for audio extensionsstatic final String
Constant for default titlestatic final String
Constant for document extensionsstatic final String
Constant for image extensionsstatic final String
Constant for other extensionsstatic final String
Constant for video extensionsFields 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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected SimpleViewItemGroup
Define the content of the advanced tabprotected ModelItem
_getEntryModelItem
(FormQuestion question) Define the entry model itemsprotected SimpleViewItemGroup
Define the content of the main tabGet the list of ModelItemsGet 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 typevoid
saxAdditionalInfos
(ContentHandler contentHandler, FormQuestion question) Sax additional informations for the question typevoid
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
_getTabs
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, service, 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
-
Field Details
-
ATTRIBUTE_MAX_SIZE
Constant for max size attribute.- See Also:
-
ATTRIBUTE_EXTENSIONS
Constant for allowed extensions attribute.- See Also:
-
ATTRIBUTE_EXTENSIONS_OTHER
Constant for other allowed extensions attribute.- See Also:
-
DEFAULT_TITLE
Constant for default title- See Also:
-
ALL_EXTENSIONS_VALUE
Constant for all extensions- See Also:
-
IMAGE_EXTENSIONS_VALUE
Constant for image extensions- See Also:
-
VIDEO_EXTENSIONS_VALUE
Constant for video extensions- See Also:
-
AUDIO_EXTENSIONS_VALUE
Constant for audio extensions- See Also:
-
DOCUMENT_EXTENSIONS_VALUE
Constant for document extensions- See Also:
-
OTHER_EXTENSIONS_VALUE
Constant for other extensions- See Also:
-
-
Constructor Details
-
FileQuestionType
public FileQuestionType()
-
-
Method Details
-
_getModelItems
Description copied from class:AbstractStaticFormQuestionType
Get the list of ModelItems- Overrides:
_getModelItems
in classAbstractFormQuestionType
- Returns:
- a list of ModelItems
-
_getMainTab
Description copied from class:AbstractFormQuestionType
Define the content of the main tab- Overrides:
_getMainTab
in classAbstractFormQuestionType
- Returns:
- the main tab definition
-
_getAdvancedTab
Description copied from class:AbstractFormQuestionType
Define the content of the advanced tab- Overrides:
_getAdvancedTab
in classAbstractFormQuestionType
- Returns:
- the advanced tab definition
-
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
-
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
-
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
-