Package org.nuxeo.ecm.webengine.forms
Class FormData
- java.lang.Object
-
- org.nuxeo.ecm.webengine.forms.FormData
-
- All Implemented Interfaces:
FormDataProvider
,FormInstance
public class FormData extends Object implements FormInstance
- Author:
- Bogdan Stefanescu
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.fileupload.RequestContext
ctx
static String
DOCTYPE
protected static org.apache.commons.fileupload.servlet.ServletFileUpload
fu
protected boolean
isMultipart
protected Map<String,List<org.apache.commons.fileupload.FileItem>>
items
static String
MAJOR
static String
MINOR
static String
PROPERTY
protected javax.servlet.http.HttpServletRequest
request
static String
TITLE
static String
VERSIONING
-
Constructor Summary
Constructors Constructor Description FormData(javax.servlet.http.HttpServletRequest request)
-
Method Summary
-
-
-
Field Detail
-
PROPERTY
public static final String PROPERTY
- See Also:
- Constant Field Values
-
TITLE
public static final String TITLE
- See Also:
- Constant Field Values
-
DOCTYPE
public static final String DOCTYPE
- See Also:
- Constant Field Values
-
VERSIONING
public static final String VERSIONING
- See Also:
- Constant Field Values
-
MAJOR
public static final String MAJOR
- See Also:
- Constant Field Values
-
MINOR
public static final String MINOR
- See Also:
- Constant Field Values
-
fu
protected static org.apache.commons.fileupload.servlet.ServletFileUpload fu
-
request
protected final javax.servlet.http.HttpServletRequest request
-
isMultipart
protected boolean isMultipart
-
ctx
protected org.apache.commons.fileupload.RequestContext ctx
-
-
Method Detail
-
getString
protected String getString(org.apache.commons.fileupload.FileItem item)
-
getIsMultipartContent
protected boolean getIsMultipartContent()
-
isMultipartContent
public boolean isMultipartContent()
-
getFormFields
public Map<String,String[]> getFormFields()
- Specified by:
getFormFields
in interfaceFormDataProvider
- Specified by:
getFormFields
in interfaceFormInstance
-
getMultiPartItems
public Map<String,List<org.apache.commons.fileupload.FileItem>> getMultiPartItems()
-
getKeys
public Collection<String> getKeys()
- Specified by:
getKeys
in interfaceFormDataProvider
-
getBlob
public Blob getBlob(String key)
- Specified by:
getBlob
in interfaceFormInstance
-
getBlobs
public Blob[] getBlobs(String key)
- Specified by:
getBlobs
in interfaceFormInstance
-
getBlobFields
public Map<String,Blob[]> getBlobFields()
XXX TODO implement it- Specified by:
getBlobFields
in interfaceFormInstance
-
getFirstBlob
public Blob getFirstBlob()
-
getBlob
protected Blob getBlob(org.apache.commons.fileupload.FileItem item)
-
getFileItem
public final org.apache.commons.fileupload.FileItem getFileItem(String key)
-
getMultiPartFormItems
public Object[] getMultiPartFormItems(String key)
- Returns:
- an array of strings or an array of blobs
-
getMultiPartFormItems
public Object[] getMultiPartFormItems(List<org.apache.commons.fileupload.FileItem> list)
-
getFileItemValue
public final Object getFileItemValue(org.apache.commons.fileupload.FileItem item)
-
getString
public String getString(String key)
- Specified by:
getString
in interfaceFormDataProvider
-
getList
public String[] getList(String key)
- Specified by:
getList
in interfaceFormDataProvider
-
get
public Object[] get(String key)
- Specified by:
get
in interfaceFormInstance
-
fillDocument
public void fillDocument(DocumentModel doc)
- Specified by:
fillDocument
in interfaceFormInstance
-
fillDocumentFromForm
public void fillDocumentFromForm(DocumentModel doc) throws PropertyException
- Throws:
PropertyException
-
fillDocumentFromMultiPartForm
public void fillDocumentFromMultiPartForm(DocumentModel doc) throws PropertyException
- Throws:
PropertyException
-
getVersioningOption
public VersioningOption getVersioningOption()
-
getDocumentType
public String getDocumentType()
-
getDocumentTitle
public String getDocumentTitle()
-
validate
public <T extends Form> T validate(Class<T> type) throws ValidationException
- Throws:
ValidationException
-
-