Package overit.geocall.basic.ui.control
Class InputUpload
java.lang.Object
overit.geocall.platform.ui.UINode
overit.geocall.ui.Component
overit.geocall.ui.Control
overit.geocall.basic.ui.control.Input
overit.geocall.basic.ui.control.InputUpload
- All Implemented Interfaces:
Serializable,overit.geocall.marks.MethodExposer,overit.geocall.marks.NameExposer,Arrangeable,Badgeable,ValueValidator,Identified,Tool,overit.geocall.ux.configurability.UIConfigurable,overit.geocall.ux.edm.ModelConfigurable
This class implements the graphic user interface element that allows you to select a resource from the filesystem
that will be sent to the server when the
It is important to insert this component into a form with the method parameter set to
On the server side, to retrieve the forwarded file, simply extract it from the web parameters using the
Form is submitted. It is important to insert this component into a form with the method parameter set to
FILE
(Form.setMETHOD(java.lang.String)); furthermore, submitting the form cannot be
done through an ajax event but must be executed as a page event. On the server side, to retrieve the forwarded file, simply extract it from the web parameters using the
WebParameters.getFile(java.lang.String) method, indicating the name of the resource.- See Also:
- GCApi:
- component
-
Nested Class Summary
Nested classes/interfaces inherited from class overit.geocall.ui.Component
Component.Configurable, Component.ConfigurableAttribute, Component.ConfigurableAttributes, Component.FilterCriteria, Component.Registry -
Field Summary
FieldsFields inherited from class overit.geocall.basic.ui.control.Input
_autofocus, _da, _dao, _dao0, _defaultFocus, _event, _eventicon, _eventmsg, _eventparam, _eventprompt, _eventsnumber, _eventtitle, _ff, _fullSize, _hidden, _hinter, _hints, _hintsCache, _key, _label2, _letterCase, _maxlength, _msg, _msgCampoObbligatorio, _msgErroreCampo, _notnull, _numeric, _placeholder, _query, _roevent, _size, _value, autocomplete, configuredFullSize, configuredNotNull, configuredSize, FILTER_CRITERION_ATTRIBUTE, filterCriteria, FULL_SIZE_ATTRIBUTE, NOT_NULL_ATTRIBUTE, promptEmpty, SIZE_ATTRIBUTEFields inherited from class overit.geocall.ui.Control
_blank, _cleaner, _dblink, _enabled, _ro, _title, altEventIconsList, altIcon, ariaDescription, ariaLabel, badge, badgeformat, FILTER_PREFIXES, LABEL_ATTRIBUTE, LABEL_IN_LINE_ATTRIBUTE, STATE_BLANK, STATE_NORMAL, STATE_RO, STATE_ROBLANKFields inherited from class overit.geocall.ui.Component
_basic, _childrenContainers, _currentId, _gridalign, _gridcols, _gridrows, _gridvalign, _iconElement, _id, _keylabel, _label, _layoutName, _name, _parentContainer, _registryName, _shortcut, _tabindex, _transformations, _valuesContainer, aliasField, BR, configHidden, configuredLabel, configuredLabelInLine, defaultHidden, ELEMENT_BR, ELEMENT_NULL, entityContainer, entityName, extendedField, fullHeight, important, labelInLine, layoutLabel, PIXEL_IMG, safeInlineService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.apache.ecs.ElementgetContentHtml(Object generationhandle, EntitySet es) Implements the interfaceArrangeable.org.apache.ecs.ElementReturns the html of the Input elementprotected StringvoidRestrict the type of the selectable files.protected voidsetAttributes(org.apache.ecs.html.Input i, boolean ro) voidsetMULTIPLE(String multiple) Indicates if the user is allowed to select more than one file.protected voidsetup()Setup the Componentprotected voidprotected voidvalidateConcreteValue(String name, Object value, boolean strong, Map arriving) protected voidvalidateNotNull(String name, Object value, boolean strong, Map arriving) static booleanverifyUploadedFile(UpFile upFile, String acceptedExtensions) Deprecated, for removal: This API element is subject to removal in a future version.Methods inherited from class overit.geocall.basic.ui.control.Input
addEventButtons, addHint, addHint, addHintsButton, ajaxQuery, buildDisplayScript, connect, control, getClassStyle, getConfigurableProperties, getDefaultValue, getDescriptionHtml, getFilterCriteriaToRemove, getFullSize, getGenerationHandle, getHIDDEN, getHiddenHtml, getHintsEventButton, getHintsFieldName, getInsideEventButton, getInsideEventButton, getLetterCase, getNOTNULL, getSize, getVisibleDescriptionHtml, isImportant, isNotNull, isValueIgnoredByCriterion, prepareValue, queryHints, registerValidators, setAUTOCOMPLETE, setAUTOFOCUS, setConfiguredProperty, setDA, setDAO, setDAO0, setDEFAULTFOCUS, setEVENT, setEVENTMSG, setEVENTPARAM, setEVENTPROMPT, setEVENTTITLE, setFILTERCRITERIA, setFULLSIZE, setHIDDEN, setHints, setHINTS, setHINTSCACHE, setICON, setIMPORTANT, setKEY, setLABEL2, setLETTERCASE, setMAXLENGTH, setModelProperties, setMSG, setNAME, setNOTNULL, setNUMERIC, setPARAM, setPLACEHOLDER, setPROMPT, setPROMPTEMPTY, setQUERY, setROEVENT, setSIZE, setupAutocomplete, setVALUE, validateChangingValue, validateUnchangingValue, validateValueMethods inherited from class overit.geocall.ui.Control
avoidNull, clean, getBadgeFormat, getBadgeValue, getBLANK, getCleaner, getDAValues, getDBLINK, getKEYLABEL, getLABEL, getRO, getState, getTITLE, getValues, getWM, isEnabled, isEnabledBasedOnFunction, isFunctionEnabled, isRoBasedOnFunction, nameWithNoFilterPrefix, setALTEVENTICON, setALTICON, setARIADESCRIPTION, setARIALABEL, setBADGEFORMAT, setBADGEVALUE, setBLANK, setCLEANER, setDBLINK, setENABLED, setFUNCTION, setRO, setTitle, setTITLEMethods inherited from class overit.geocall.ui.Component
adapt, appendAttribute, buildSetupScript, calcKeyLabel, calcLabel, calcShortcut, canBeConfigured, changed, clearConfiguredProperties, componentIterator, componentSize, containerIterator, createAjaxFrame, deprecate, fillSetupScript, generateFlexableFullHeightContainer, generateId, getBASIC, getBoolean, getBoolean, getChildrenComponents, getChildrenContainers, getDefaultLabel, getDefaultLayoutLabel, getEntityContainer, getEntityName, getFullHeight, getGridAlign, getGridCols, getGridRows, getGridVAlign, getHtmlLabel, getHtmlLabel, getIcon, getId, getIdentity, getint, getLayoutLabel, getLayoutName, getNAME, getParentComponent, getParentContainer, getPublishedChildrenList, getRegistryName, getSHORTCUT, getTabIndex, getTeacher, getValuesContainer, getWindow, initChilds, isActivable, isActive, isAliasField, isConfigHidden, isDefaultHidden, isExtendedField, isLabelInLine, onInit, setActivable, setActive, setAliasField, setBASIC, setConfigHidden, setDEFAULTHIDDEN, setEntityName, setExtendedField, setFULLHEIGHT, setGRIDALIGN, setGRIDCOLS, setGRIDROWS, setGRIDVALIGN, setIdentity, setLabel, setLABEL, setLABELINLINE, setLAYOUTLABEL, setLAYOUTNAME, setREGISTRYNAME, setTooltip, setValuesContainer, stringForJs, tabIndexerMethods inherited from class overit.geocall.platform.ui.UINode
addChild, addChildText, getChildren, getNodeId, getParent, getRoot, getSchema, setNodeId, setParent, setSchemaMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface overit.geocall.ui.Arrangeable
getDescriptionHtml, getGenerationHandle, getHiddenHtmlMethods inherited from interface overit.geocall.ui.Badgeable
badgeFormat, makeBadgedIcon
-
Field Details
-
_accept
-
_multiple
protected boolean _multiple
-
-
Constructor Details
-
InputUpload
public InputUpload()
-
-
Method Details
-
setACCEPT
Restrict the type of the selectable files.- Parameters:
mediaType- it's possible to restrict the accepted file using the following rules:- file_extension: A file extension starting with the dot character, e.g: .gif, .jpg, .png, .doc
- audio/*: All sound files are accepted
- video/*: All video files are accepted
- image/*: All image files are accepted
- media_type: A valid media type, with no parameters. Look at IANA Media Types for a complete list of standard media types
-
setMULTIPLE
Indicates if the user is allowed to select more than one file.- Parameters:
multiple- A string that represents a boolean value ("true" or "1", "false" or "0").
If the string is not recognized as a boolean value, it will be used the default value, that is false
-
prepareName
- Overrides:
prepareNamein classInput
-
setup
protected void setup()Description copied from class:ComponentSetup the Component -
getContentHtml
Description copied from class:InputImplements the interfaceArrangeable. It returns the html code that represents the active part of the input field, i.e. the field and the validation scripts- Specified by:
getContentHtmlin interfaceArrangeable- Overrides:
getContentHtmlin classInput- Parameters:
generationhandle- The handle of the generationes- TheEntitySetto which the element belongs- Returns:
- The html code of the input field or null if the field don't have a graphical representation
-
setAttributes
protected void setAttributes(org.apache.ecs.html.Input i, boolean ro) -
getHtml
Description copied from class:InputReturns the html of the Input element -
validate
-
validateNotNull
protected void validateNotNull(String name, Object value, boolean strong, Map arriving) throws ValidationException - Overrides:
validateNotNullin classInput- Throws:
ValidationException
-
validateConcreteValue
protected void validateConcreteValue(String name, Object value, boolean strong, Map arriving) throws ValidationException - Overrides:
validateConcreteValuein classInput- Throws:
ValidationException
-
verifyUploadedFile
@Deprecated(forRemoval=true, since="W3_2023") public static boolean verifyUploadedFile(UpFile upFile, String acceptedExtensions) Deprecated, for removal: This API element is subject to removal in a future version.useFileUtils.validateFileContentType(UpFile, List)insteadVerifies that the uploaded file has a content type that conforms to the rules defined by the "accept" attribute.
If t's not possible to find the uploaded file's contentType or the contentTypes defined by the "accept" attribute, a validation will be carried out on the type of the uploaded file based on its extension.- Parameters:
upFile- The uploaded file to be validated.acceptedExtensions- A list of contentType and extensions, separated by comma, which define the file types that will be accepted.- Returns:
trueif theUpFileit's valid,falseotherwise.
-
FileUtils.validateFileContentType(UpFile, List)instead