Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.platform.ui.web.component.file
Class UIInputFile

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.UIInput
                  extended by org.nuxeo.ecm.platform.ui.web.component.file.UIInputFile
All Implemented Interfaces:
EditableValueHolder, NamingContainer, StateHolder, ValueHolder

public class UIInputFile
extends UIInput
implements NamingContainer

UIInput file that handles complex validation.

Attribute value is the file to be uploaded. Its submitted value as well as filename are handled by sub components. Rendering and validation of subcomponents are handled here.

Author:
Anahide Tchertchian

Field Summary
static String COMPONENT_FAMILY
           
static String COMPONENT_TYPE
           
 
Fields inherited from class javax.faces.component.UIInput
CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID, UPDATE_MESSAGE_ID
 
Fields inherited from interface javax.faces.component.NamingContainer
SEPARATOR_CHAR
 
Constructor Summary
UIInputFile()
           
 
Method Summary
 void decode(FacesContext context)
           
 void encodeBegin(FacesContext context)
           
 Blob getCurrentBlob()
           
 String getCurrentFilename()
           
 Boolean getEditFilename()
           
 InputFileInfo getFileInfoLocalValue()
           
 InputFileInfo getFileInfoSubmittedValue()
           
 InputFileInfo getFileInfoValue()
           
 String getFilename()
           
 String getOnchange()
           
 String getOnclick()
           
 String getOnselect()
           
 String getRendererType()
           
 Object getValue()
          Override value so that an InputFileInfo structure is given instead of the "value" attribute resolution.
 void restoreState(FacesContext context, Object state)
           
 Object saveState(FacesContext context)
           
 void setEditFilename(Boolean editFilename)
           
 void setFilename(String filename)
           
 void setOnchange(String onchange)
           
 void setOnclick(String onclick)
           
 void setOnselect(String onselect)
           
 void updateFilename(FacesContext context, String newFilename)
           
 void updateModel(FacesContext context)
           
 void validate(FacesContext context)
          Process validation.
 void validateBlob(FacesContext context, InputFileInfo submitted)
          Validates submitted blob.
 void validateFilename(FacesContext context, InputFileInfo submitted)
           
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, getConverterMessage, getFamily, getRequiredMessage, getSubmittedValue, getValidator, getValidatorMessage, getValidators, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, resetValue, setConverterMessage, setImmediate, setLocalValueSet, setRequired, setRequiredMessage, setSubmittedValue, setValid, setValidator, setValidatorMessage, setValue, setValueChangeListener
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
broadcast, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacet, getFacetCount, getFacets, getFacetsAndChildren, getId, getParent, getRendersChildren, getValueBinding, invokeOnComponent, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class javax.faces.component.UIComponent
encodeAll, getContainerClientId, getValueExpression, setValueExpression
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, setConverter
 

Field Detail

COMPONENT_TYPE

public static final String COMPONENT_TYPE

COMPONENT_FAMILY

public static final String COMPONENT_FAMILY
See Also:
Constant Field Values
Constructor Detail

UIInputFile

public UIInputFile()
Method Detail

getRendererType

public String getRendererType()
Overrides:
getRendererType in class UIComponentBase

getValue

public Object getValue()
Override value so that an InputFileInfo structure is given instead of the "value" attribute resolution.

Specified by:
getValue in interface ValueHolder
Overrides:
getValue in class UIOutput

getFilename

public String getFilename()

setFilename

public void setFilename(String filename)

getEditFilename

public Boolean getEditFilename()

setEditFilename

public void setEditFilename(Boolean editFilename)

getFileInfoValue

public InputFileInfo getFileInfoValue()

getFileInfoLocalValue

public InputFileInfo getFileInfoLocalValue()

getFileInfoSubmittedValue

public InputFileInfo getFileInfoSubmittedValue()

getOnchange

public String getOnchange()

setOnchange

public void setOnchange(String onchange)

getOnclick

public String getOnclick()

setOnclick

public void setOnclick(String onclick)

getOnselect

public String getOnselect()

setOnselect

public void setOnselect(String onselect)

decode

public void decode(FacesContext context)
Overrides:
decode in class UIInput

validate

public void validate(FacesContext context)
Process validation. Sub components are already validated.

Overrides:
validate in class UIInput

validateFilename

public void validateFilename(FacesContext context,
                             InputFileInfo submitted)

validateBlob

public void validateBlob(FacesContext context,
                         InputFileInfo submitted)
                  throws ValidatorException
Validates submitted blob.

Throws ValidatorException as a flag when blob is null and file is not required to set choice back to "no file" (see NXP-1732).

Throws:
ValidatorException

updateFilename

public void updateFilename(FacesContext context,
                           String newFilename)

updateModel

public void updateModel(FacesContext context)
Overrides:
updateModel in class UIInput

getCurrentBlob

public Blob getCurrentBlob()

getCurrentFilename

public String getCurrentFilename()

encodeBegin

public void encodeBegin(FacesContext context)
                 throws IOException
Overrides:
encodeBegin in class UIComponentBase
Throws:
IOException

saveState

public Object saveState(FacesContext context)
Specified by:
saveState in interface StateHolder
Overrides:
saveState in class UIInput

restoreState

public void restoreState(FacesContext context,
                         Object state)
Specified by:
restoreState in interface StateHolder
Overrides:
restoreState in class UIInput

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.