| Modifier and Type | Class and Description |
|---|---|
static class |
TMLForm.FileUploadInputStream |
static class |
TMLForm.FileUploadLimitExceededException |
static class |
TMLForm.FormParseInfo |
static class |
TMLForm.MultipartFormData |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
RELATION_NULLPLACE_HOLDER |
static java.lang.String |
SYSTEMFIELD_AJAXCALLID |
static java.lang.String |
SYSTEMFIELD_AJAXGRAYDIV |
static java.lang.String |
SYSTEMFIELD_AJAXMODE |
static java.lang.String |
SYSTEMFIELD_FORMACTION |
static java.lang.String |
SYSTEMFIELD_FORMINFO |
static java.lang.String |
SYSTEMFIELD_PARSEINFO |
static java.lang.String |
SYSTEMFIELD_PORTLETSTATES |
static java.lang.String |
VALIDATIONVAR_ENTEREDVALUE |
static java.lang.String |
VALIDATIONVAR_FIELDNAME |
static java.lang.String |
VALIDATIONVAR_PARSEDVALUE |
| Constructor and Description |
|---|
TMLForm(WGACore core,
TMLForm.MultipartFormData formData)
Constructor to read form from posted data
|
TMLForm(WGACore core,
TMLFormInfo formInfo,
TMLContext context)
Constructor to create a new form
|
| Modifier and Type | Method and Description |
|---|---|
void |
addfile(java.io.File source)
Adds a file from the servers file system to the form
|
void |
addfile(java.io.File source,
java.lang.String fileName)
Adds a file from the servers file system to the form
|
void |
addfile(java.io.InputStream stream,
java.lang.String fileName)
Adds a file from the servers file system to the form
|
void |
addmessage(java.lang.String message)
Adds a new global validation message
|
void |
appendtofield(java.lang.String name,
java.lang.Object value)
Appends a value to the value list of a field
|
boolean |
attach(TMLUserProfile obj) |
boolean |
attach(de.innovationgate.webgate.api.WGDocument doc)
Attaches all files stored on this form to a document
|
boolean |
attach(de.innovationgate.webgate.api.WGDocument doc,
java.lang.String altFileName) |
void |
attachimage(de.innovationgate.webgate.api.WGDocument doc,
int size) |
void |
attachimage(de.innovationgate.webgate.api.WGDocument doc,
java.lang.String fit2size,
java.lang.String compression,
java.lang.String width,
java.lang.String height) |
void |
attachimage(de.innovationgate.webgate.api.WGDocument doc,
java.lang.String altFileName,
java.lang.String fit2size,
java.lang.String compression,
java.lang.String width,
java.lang.String height) |
long |
attachmentsize(java.lang.String fieldname) |
void |
attachscaledimage(de.innovationgate.webgate.api.WGDocument doc,
de.innovationgate.utils.ImageScaler scaler) |
void |
attachscaledimage(de.innovationgate.webgate.api.WGDocument doc,
de.innovationgate.utils.ImageScaler scaler,
java.lang.String targetFileName) |
void |
clearFiles() |
void |
clearmessages()
Clears all validation messages on the form
|
boolean |
conditionFailed(java.lang.String condition)
checks if the given condition (globalFormValdation) failed
used by tml:validate to decide to display the message or not
|
java.lang.Object |
enteredvalue(java.lang.String fieldname)
Returns the unprocessed value of a field like the user entered it
|
de.innovationgate.wgaservices.types.Form |
exportServicesForm() |
FormSource |
fetchFormSource(TMLContext cx) |
java.lang.Object |
field(java.lang.String name)
Returns the value of a field as a single value.
|
java.util.List |
fieldlist(java.lang.String name)
Returns the value of a field as a list value.
|
java.lang.String |
fileurl(java.lang.String fileName)
Returns a URL to the uploaded file of the given name
|
de.innovationgate.webgate.api.WGDocument |
getcreateddoc()
Retrieves the document that was created by a TMLForm store operation
|
java.util.List |
getEnteredOrParsedValues(java.lang.String fieldname)
returns the valuelist for the given fieldname
the valuelist contains the parsedvalue, if successfully parsed
otherwise the valuelist contains the enteredvalue
|
java.util.List |
geterrors()
Lists data type conversion errors
|
java.util.List<java.lang.String> |
getfieldnames()
Lists the names of the fields on this form
|
java.io.File |
getfile(java.lang.String name)
Returns a Java file object for an uploaded file
|
java.util.List |
getfilenames()
Lists the names of files that have been uploaded to this form
|
long |
getfilesize(java.lang.String name) |
java.lang.String |
getfiletext(java.lang.String name)
Returns the text contents of an uploaded file
|
java.lang.String |
getformaction() |
java.lang.String |
getformid()
Returns the ID of the form
|
TMLFormInfo |
getforminfo()
Grants access to the FormInfo object of this WebTML form
|
java.util.List<java.lang.String> |
getglobalmessages()
Returns all validation messages that are global, i.e. not bound to a specific field
|
java.util.List |
getinvalidfields()
Lists names of fields with validation errors
|
java.lang.String |
getmessage(java.lang.String field)
Returns the validation message of a field with failed validation
|
java.util.List<java.lang.String> |
getmessages()
Lists all current validation messages
|
java.lang.String |
getmode()
returns the formmode
|
java.lang.Object |
getpasswordsalt() |
TMLFormProcessContext |
getprocesscontext()
Provides a ProcessContext to store arbitrary data for the form process
|
java.lang.String |
getprocessid() |
java.lang.String |
getsource()
returns the sourcetype ('content', 'portlet', etc.) of the form
|
TMLContext |
gettargetcontext()
Returns the context for which this form was instantiated.
|
boolean |
hasfield(java.lang.String name)
Tests if the form contains a field of the given name
|
boolean |
hasmessage(java.lang.String field)
Tests if a field specific validation message exists for the given field
|
boolean |
hasmessages()
Tests if any validation messages exist
|
void |
importForm(TMLForm form) |
void |
importServicesForm(de.innovationgate.wgaservices.types.Form form) |
boolean |
iseditable()
Returns if this form is currently in edit mode
|
boolean |
isempty(java.lang.String fieldName)
Returns if a field is empty.
|
boolean |
isfilesdropped()
Indicates if an uploaded file has been dropped because of its size
|
boolean |
ispersistent()
Shows if the form is persistent
|
boolean |
issubmitted()
Shows if the form was submitted from a previous request
|
java.lang.String |
mode()
Returns the display mode of the WebTML form
|
java.lang.Object |
parsedvalue(java.lang.String fieldname)
Returns the processed value of the field in its target type
|
void |
processrtf(java.lang.String fieldName) |
void |
pushFields(de.innovationgate.webgate.api.WGDocument doc) |
boolean |
pushFiles(de.innovationgate.webgate.api.WGDocument doc) |
void |
remove()
Removes the current form from form registry
|
void |
removefield(java.lang.String name)
Removes a field from the form and its data
|
boolean |
removefile(java.lang.String filename)
Removes a file from the form
|
void |
reset()
Clears all fields and uploaded files from the form, resetting it completely
|
boolean |
retainFiles(de.innovationgate.webgate.api.WGDocument doc) |
void |
setcreateddoc(de.innovationgate.webgate.api.WGDocument createdDoc) |
void |
setfield(java.lang.String name,
java.lang.Object value)
Sets the value of a field
|
void |
setFormInfo(TMLFormInfo formInfo) |
void |
setmessage(java.lang.String fieldName,
java.lang.String message)
Adds a new validation message related to the specified input field
|
void |
setWasValidatedInThisRequest(boolean wasValidatedInThisRequest) |
java.lang.String |
source()
Returns the source type of the form
|
boolean |
store()
Stores the form data to the source of the form
|
void |
storefield(java.lang.String fieldName,
de.innovationgate.webgate.api.WGDocument doc)
Stores a single form field to a document.
|
void |
storefield(java.lang.String fieldName,
de.innovationgate.webgate.api.WGDocument doc,
java.lang.String targetName)
Stores a single form field to a document
|
boolean |
storeincontent()
Stores the fields of the form to the content document on the forms target context
|
boolean |
storeincontent(de.innovationgate.webgate.api.WGContent content)
Stores the fields of the form to a content document
|
boolean |
storeindocument(de.innovationgate.webgate.api.WGDocument doc) |
boolean |
storeinhdb() |
boolean |
storeinhdb(java.lang.Object parameter) |
boolean |
storeinportlet()
Stores the form data into the configuration of the current portlet of the WebTML environment
|
boolean |
storeinportlet(Portlet portlet)
Stores the form data into the a portlet configuration
|
boolean |
storeinprofile()
Stores the form data on the users personalisation profile
|
boolean |
storeinprofile(TMLUserProfile profile) |
boolean |
validate()
Manually triggers the form validation
|
boolean |
wasValidatedInThisRequest() |
boolean |
writecsv(java.lang.String destination,
boolean includeHeaders) |
boolean |
writecsv(java.lang.String destination,
boolean includeHeaders,
java.lang.String delimiter) |
public static final java.lang.String VALIDATIONVAR_PARSEDVALUE
public static final java.lang.String VALIDATIONVAR_ENTEREDVALUE
public static final java.lang.String VALIDATIONVAR_FIELDNAME
public static final java.lang.String RELATION_NULLPLACE_HOLDER
public static final java.lang.String SYSTEMFIELD_PARSEINFO
public static final java.lang.String SYSTEMFIELD_FORMINFO
public static final java.lang.String SYSTEMFIELD_AJAXCALLID
public static final java.lang.String SYSTEMFIELD_AJAXGRAYDIV
public static final java.lang.String SYSTEMFIELD_AJAXMODE
public static final java.lang.String SYSTEMFIELD_FORMACTION
public static final java.lang.String SYSTEMFIELD_PORTLETSTATES
public TMLForm(WGACore core, TMLFormInfo formInfo, TMLContext context) throws de.innovationgate.webgate.api.WGException
core - The WGA coreformInfo - Information about the form to createcontext - Target context path for the form (if not already set on forminfo)de.innovationgate.webgate.api.WGExceptionpublic TMLForm(WGACore core, TMLForm.MultipartFormData formData) throws de.innovationgate.webgate.api.WGException, java.io.UnsupportedEncodingException
core - The WGACore objectformData - The posted datade.innovationgate.webgate.api.WGExceptionjava.io.UnsupportedEncodingExceptionpublic de.innovationgate.webgate.api.WGDocument getcreateddoc()
Formgetcreateddoc in interface Formpublic boolean validate()
Formpublic java.lang.String getformid()
Formpublic java.util.List<java.lang.String> getfieldnames()
Formgetfieldnames in interface Formpublic boolean hasfield(java.lang.String name)
Formpublic java.lang.Object field(java.lang.String name)
Formpublic void setfield(java.lang.String name,
java.lang.Object value)
throws de.innovationgate.webgate.api.WGException
Formpublic void appendtofield(java.lang.String name,
java.lang.Object value)
throws de.innovationgate.webgate.api.WGException
Formappendtofield in interface Formname - Name of the fieldvalue - Value to appendde.innovationgate.webgate.api.WGExceptionpublic void removefield(java.lang.String name)
Formremovefield in interface Formname - Name of the fieldpublic java.util.List fieldlist(java.lang.String name)
Formpublic java.lang.Object parsedvalue(java.lang.String fieldname)
Formparsedvalue in interface Formfieldname - Name of the fieldpublic java.lang.Object enteredvalue(java.lang.String fieldname)
Formenteredvalue in interface Formfieldname - The field namepublic java.util.List getEnteredOrParsedValues(java.lang.String fieldname)
fieldname - public boolean storeinprofile(TMLUserProfile profile) throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic boolean storeinprofile()
throws de.innovationgate.webgate.api.WGException
Formstoreinprofile in interface Formde.innovationgate.webgate.api.WGExceptionpublic boolean storeindocument(de.innovationgate.webgate.api.WGDocument doc)
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic void pushFields(de.innovationgate.webgate.api.WGDocument doc)
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionpublic void storefield(java.lang.String fieldName,
de.innovationgate.webgate.api.WGDocument doc)
throws de.innovationgate.webgate.api.WGAPIException
Formstorefield in interface FormfieldName - The name of the fielddoc - The document to store the field tode.innovationgate.webgate.api.WGAPIExceptionpublic void storefield(java.lang.String fieldName,
de.innovationgate.webgate.api.WGDocument doc,
java.lang.String targetName)
throws de.innovationgate.webgate.api.WGAPIException
Formstorefield in interface FormfieldName - The name of the fielddoc - The document to store the field totargetName - The name of the item to store this field to.de.innovationgate.webgate.api.WGAPIExceptionpublic void processrtf(java.lang.String fieldName)
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic boolean storeincontent(de.innovationgate.webgate.api.WGContent content)
throws de.innovationgate.webgate.api.WGException
Formstoreincontent in interface Formcontent - The document to store the fields tode.innovationgate.webgate.api.WGExceptionpublic boolean storeinhdb()
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic boolean storeinhdb(java.lang.Object parameter)
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic boolean storeincontent()
throws de.innovationgate.webgate.api.WGException,
java.io.IOException
Formstoreincontent in interface Formde.innovationgate.webgate.api.WGExceptionjava.io.IOExceptionpublic TMLContext gettargetcontext()
Formgettargetcontext in interface Formpublic boolean storeinportlet(Portlet portlet) throws de.innovationgate.webgate.api.WGException
Formstoreinportlet in interface Formportlet - The portlet to store the configuration tode.innovationgate.webgate.api.WGExceptionpublic boolean storeinportlet()
throws de.innovationgate.webgate.api.WGException
Formstoreinportlet in interface Formde.innovationgate.webgate.api.WGExceptionpublic boolean writecsv(java.lang.String destination,
boolean includeHeaders,
java.lang.String delimiter)
public boolean writecsv(java.lang.String destination,
boolean includeHeaders)
public java.util.List geterrors()
Formpublic java.util.List getfilenames()
Formgetfilenames in interface Formpublic java.io.File getfile(java.lang.String name)
throws de.innovationgate.webgate.api.WGAPIException,
java.io.IOException
Formpublic long getfilesize(java.lang.String name)
throws java.io.IOException
java.io.IOExceptionpublic java.lang.String getfiletext(java.lang.String name)
throws java.io.IOException,
de.innovationgate.webgate.api.WGAPIException
Formgetfiletext in interface Formname - Name of the filejava.io.IOExceptionde.innovationgate.webgate.api.WGAPIExceptionpublic boolean attach(TMLUserProfile obj) throws java.io.IOException, de.innovationgate.webgate.api.WGAPIException
java.io.IOExceptionde.innovationgate.webgate.api.WGAPIExceptionpublic boolean attach(de.innovationgate.webgate.api.WGDocument doc,
java.lang.String altFileName)
throws java.io.IOException,
de.innovationgate.webgate.api.WGAPIException
java.io.IOExceptionde.innovationgate.webgate.api.WGAPIExceptionpublic boolean pushFiles(de.innovationgate.webgate.api.WGDocument doc)
throws de.innovationgate.webgate.api.WGAPIException,
java.io.IOException
de.innovationgate.webgate.api.WGAPIExceptionjava.io.IOExceptionpublic boolean retainFiles(de.innovationgate.webgate.api.WGDocument doc)
throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIExceptionpublic boolean attach(de.innovationgate.webgate.api.WGDocument doc)
throws java.io.IOException,
de.innovationgate.webgate.api.WGAPIException
Formpublic long attachmentsize(java.lang.String fieldname)
throws java.io.IOException
java.io.IOExceptionpublic void attachimage(de.innovationgate.webgate.api.WGDocument doc,
int size)
public void attachimage(de.innovationgate.webgate.api.WGDocument doc,
java.lang.String fit2size,
java.lang.String compression,
java.lang.String width,
java.lang.String height)
public void attachscaledimage(de.innovationgate.webgate.api.WGDocument doc,
de.innovationgate.utils.ImageScaler scaler,
java.lang.String targetFileName)
throws java.io.IOException,
de.innovationgate.webgate.api.WGAPIException
java.io.IOExceptionde.innovationgate.webgate.api.WGAPIExceptionpublic void attachscaledimage(de.innovationgate.webgate.api.WGDocument doc,
de.innovationgate.utils.ImageScaler scaler)
throws java.io.IOException,
de.innovationgate.webgate.api.WGAPIException
java.io.IOExceptionde.innovationgate.webgate.api.WGAPIExceptionpublic void attachimage(de.innovationgate.webgate.api.WGDocument doc,
java.lang.String altFileName,
java.lang.String fit2size,
java.lang.String compression,
java.lang.String width,
java.lang.String height)
public java.lang.String getformaction()
public void importForm(TMLForm form) throws de.innovationgate.webgate.api.WGAPIException
form - de.innovationgate.webgate.api.WGAPIExceptionpublic void reset()
throws de.innovationgate.webgate.api.WGAPIException
Formpublic void remove()
Formpublic boolean iseditable()
Formiseditable in interface Formpublic boolean ispersistent()
Formispersistent in interface Formpublic java.util.List<java.lang.String> getmessages()
Formgetmessages in interface Formpersistent - The persistent to set.public java.util.List<java.lang.String> getglobalmessages()
Formgetglobalmessages in interface Formpublic java.lang.String getmessage(java.lang.String field)
Formgetmessage in interface Formfield - Name of the fieldpublic boolean hasmessages()
Formhasmessages in interface Formpublic boolean hasmessage(java.lang.String field)
Formhasmessage in interface Formfield - Name of the fieldpublic void addmessage(java.lang.String message)
Formaddmessage in interface Formmessage - The messagepublic void setmessage(java.lang.String fieldName,
java.lang.String message)
Formsetmessage in interface FormfieldName - The field for which the message is determinedmessage - The validation error messagepublic boolean conditionFailed(java.lang.String condition)
condition - public TMLFormInfo getforminfo()
Formgetforminfo in interface Formpublic void setFormInfo(TMLFormInfo formInfo)
public void clearmessages()
Formclearmessages in interface Formpublic java.util.List getinvalidfields()
Formgetinvalidfields in interface Formpublic java.lang.String getsource()
public java.lang.String source()
Formpublic java.lang.String getmode()
public java.lang.String mode()
Formpublic boolean wasValidatedInThisRequest()
public void setWasValidatedInThisRequest(boolean wasValidatedInThisRequest)
public void importServicesForm(de.innovationgate.wgaservices.types.Form form)
throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic de.innovationgate.wgaservices.types.Form exportServicesForm()
throws java.io.IOException,
de.innovationgate.webgate.api.WGAPIException
java.io.IOExceptionde.innovationgate.webgate.api.WGAPIExceptionpublic boolean issubmitted()
Formissubmitted in interface Formpublic boolean removefile(java.lang.String filename)
Formremovefile in interface Formfilename - Name of the filepublic void addfile(java.io.File source,
java.lang.String fileName)
throws java.io.IOException,
java.security.NoSuchAlgorithmException
Formpublic void addfile(java.io.File source)
throws java.io.IOException,
java.security.NoSuchAlgorithmException
Formpublic void addfile(java.io.InputStream stream,
java.lang.String fileName)
throws java.io.IOException,
java.security.NoSuchAlgorithmException
Formpublic java.lang.String getprocessid()
public TMLFormProcessContext getprocesscontext()
Formgetprocesscontext in interface Formpublic boolean isempty(java.lang.String fieldName)
Formpublic void clearFiles()
public boolean isfilesdropped()
Formisfilesdropped in interface Formpublic java.lang.String fileurl(java.lang.String fileName)
throws org.apache.commons.httpclient.URIException
Formpublic void setcreateddoc(de.innovationgate.webgate.api.WGDocument createdDoc)
public boolean store()
throws de.innovationgate.webgate.api.WGException
Formpublic FormSource fetchFormSource(TMLContext cx) throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGExceptionpublic java.lang.Object getpasswordsalt()