public class FileUploadControl extends DataBoundControl
Behavior, according to the request parameters:
<control id>_prevFileId
must contain the original fileId
if the control currently has a file data value.
<control id>_clearFile
has value equals to true
, then this control's data
fullPath
is set to null
, to indicate that the file should be
removed, and the upload is ignored.
filenameField
tag,
is present, the current file (if present) is renamed to the parameter's value.
<control id>_replaceFile
has value equals to true
, then the control's value will be changed to the uploaded file.
<control id>_clearFile
has value equals to false
, then
case the parameter <control id>.applyImageEdition
has value equals to true
and there is no previous file
or the parameter <control id>_replaceFile
has value equals to false
,
then the control's value will be set with the file created from an image edition.
FORCE_CASE_LOWER, FORCE_CASE_NONE, FORCE_CASE_UPPER, forceCase, requestParameterName, UNKNOWN_DATA_TYPE, value, valuePreviouslySet
childControls, controlContainer, controlDefinitionNode, controlResource, douiContext, hasValidatorSubControls, isValid, locale, ON_EVENT_CLOSE_WINDOW, ON_EVENT_LINK, ON_EVENT_POPUP_LINK_OR_RUNTIME_INTERFACE, ON_EVENT_POPUP_RUNTIME_INTERFACE, ON_EVENT_PROCESS_ACTION, ON_EVENT_RENDER_ACTION, ON_EVENT_REPLACE_INTERFACE, ON_EVENT_SCRIPT, ON_EVENT_VALIDATE, onEventScripts, PARAMETER_TYPE_FIRST_SELECTED, PARAMETER_TYPE_GET_VALUE, parentControl, resources, type, VALIDATION_SELECTED_MANY, VALIDATION_SELECTED_ONE
Constructor and Description |
---|
FileUploadControl() |
Modifier and Type | Method and Description |
---|---|
protected void |
addImageEditorControls()
Add controls for the image edition functionality.
|
void |
buildSubControls() |
protected File |
getEditedImageFile()
Returns the edited image file or null if it does not exist.
|
protected String |
getFilenameParameterName(String fieldId) |
static String |
getImageEditionFolderPath(SessionConfig sessionConfig,
String imageEditionId)
Returns the image edition folder path of the given image edition id.
|
IDataControlRequestHelpDefinition |
getRequestHelpDefinition()
Returns the request parameters help definition.
|
protected Map<String,String> |
getStringsToLocalize() |
protected Class |
getValueClass()
Returns the class the possible values of this control are assignable to.
|
void |
init(Node controlDefinitionNode,
ControlContainer controlContainer,
IControl parentControl) |
void |
loadFromRequest() |
void |
setRenderData() |
autoAddDateTimeValueValidator, autoAddDoubleValueValidator, autoAddFileSizeValidator, autoAddIntegerValueValidator, autoAddLengthValidator, autoAddLongValueValidator, autoAddRequiredValueValidator, autoAddValidators, createConverter, createDataType, getDataId, getFieldName, getProcessActionHandlerParameterName, getReload, getRuntimeDefaultSource, getSource, getSourceById, getSourceContext, getUnboundedConverter, setDefaultValue, setRawValue, setReload, setSourceParameter, setValid, setValueFromSource, setValueFromSource, update
convertValueToControlValue, getConverter, getDataType, getDefaultValue, getParameterValue, getProcessActionIds, getRequestParameterName, getValue, getValue, initProcessActionIds, isTrim, loadSubControlFromRequest, loadSubControlsFromRequest, setProcessActionHandlerParameter, setProcessActionHandlerParameter, setProcessActionHandlerParameters, setSourceParameter, setSourceParameters, setTrim, setValue, valueIsArray
appendSubControl, appendSubControls, applyOnEventScripts, convertToStandardValue, createContainer, disconnect, fixedIdentifierRequired, generateControlId, generateControlIdPrefix, getAdditionalParameters, getAdditionalParameters, getAncestor, getChildControls, getClientEventHandlerScript, getControlResource, getId, getLocale, getName, getNamespace, getParentControl, getPrepareForReadScript, getRenderData, getResources, getScriptActionValidation, getType, getValidationScript, getWindowProperties, getWindowProperties, isRequired, isValid, localize, localizeStrings, processCustomTags, registerOnEventScript, removeChild, removeChildren, resolveVariable, setName, setRuntimeAttributes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConverter, getProcessActionIds, getValue, getValue, setProcessActionHandlerParameters, setValue
createContainer, disconnect, getChildControls, getControlResource, getId, getName, getParentControl, getPrepareForReadScript, getRenderData, getResources, getType, isValid, registerOnEventScript, removeChild, removeChildren, setRuntimeAttributes
getResources
public void init(Node controlDefinitionNode, ControlContainer controlContainer, IControl parentControl) throws PortalException
init
in interface IControl
init
in class DataBoundControl
PortalException
public void buildSubControls() throws PortalException
buildSubControls
in interface IControl
buildSubControls
in class DataBoundControl
PortalException
protected void addImageEditorControls() throws PortalException
PortalException
protected Class getValueClass() throws PortalException
DataControl
This default implementation uses IDouiDataType.getValueClass()
of the data type of this control.
getValueClass
in class DataControl
PortalException
public void loadFromRequest() throws PortalException
loadFromRequest
in interface IDataControl
loadFromRequest
in class DataBoundControl
PortalException
public void setRenderData() throws PortalException
setRenderData
in interface IControl
setRenderData
in class DataBoundControl
PortalException
protected File getEditedImageFile() throws UnexpectedException
UnexpectedException
public static String getImageEditionFolderPath(SessionConfig sessionConfig, String imageEditionId)
sessionConfig
- the user's session.imageEditionId
- the image edition idprotected Map<String,String> getStringsToLocalize()
getStringsToLocalize
in class Control
public IDataControlRequestHelpDefinition getRequestHelpDefinition() throws PortalException
IDataControl
getRequestHelpDefinition
in interface IDataControl
getRequestHelpDefinition
in class DataBoundControl
PortalException
LumisXP 12.0.0.190809 - Copyright © 2006–2019 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.