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.WGException
public 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.WGException
java.io.UnsupportedEncodingException
public de.innovationgate.webgate.api.WGDocument getcreateddoc()
Form
getcreateddoc
in interface Form
public boolean validate()
Form
public java.lang.String getformid()
Form
public java.util.List<java.lang.String> getfieldnames()
Form
getfieldnames
in interface Form
public boolean hasfield(java.lang.String name)
Form
public java.lang.Object field(java.lang.String name)
Form
public void setfield(java.lang.String name, java.lang.Object value) throws de.innovationgate.webgate.api.WGException
Form
public void appendtofield(java.lang.String name, java.lang.Object value) throws de.innovationgate.webgate.api.WGException
Form
appendtofield
in interface Form
name
- Name of the fieldvalue
- Value to appendde.innovationgate.webgate.api.WGException
public void removefield(java.lang.String name)
Form
removefield
in interface Form
name
- Name of the fieldpublic java.util.List fieldlist(java.lang.String name)
Form
public java.lang.Object parsedvalue(java.lang.String fieldname)
Form
parsedvalue
in interface Form
fieldname
- Name of the fieldpublic java.lang.Object enteredvalue(java.lang.String fieldname)
Form
enteredvalue
in interface Form
fieldname
- 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.WGException
public boolean storeinprofile() throws de.innovationgate.webgate.api.WGException
Form
storeinprofile
in interface Form
de.innovationgate.webgate.api.WGException
public boolean storeindocument(de.innovationgate.webgate.api.WGDocument doc) throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public void pushFields(de.innovationgate.webgate.api.WGDocument doc) throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIException
public void storefield(java.lang.String fieldName, de.innovationgate.webgate.api.WGDocument doc) throws de.innovationgate.webgate.api.WGAPIException
Form
storefield
in interface Form
fieldName
- The name of the fielddoc
- The document to store the field tode.innovationgate.webgate.api.WGAPIException
public void storefield(java.lang.String fieldName, de.innovationgate.webgate.api.WGDocument doc, java.lang.String targetName) throws de.innovationgate.webgate.api.WGAPIException
Form
storefield
in interface Form
fieldName
- 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.WGAPIException
public void processrtf(java.lang.String fieldName) throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public boolean storeincontent(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGException
Form
storeincontent
in interface Form
content
- The document to store the fields tode.innovationgate.webgate.api.WGException
public boolean storeinhdb() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public boolean storeinhdb(java.lang.Object parameter) throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public boolean storeincontent() throws de.innovationgate.webgate.api.WGException, java.io.IOException
Form
storeincontent
in interface Form
de.innovationgate.webgate.api.WGException
java.io.IOException
public TMLContext gettargetcontext()
Form
gettargetcontext
in interface Form
public boolean storeinportlet(Portlet portlet) throws de.innovationgate.webgate.api.WGException
Form
storeinportlet
in interface Form
portlet
- The portlet to store the configuration tode.innovationgate.webgate.api.WGException
public boolean storeinportlet() throws de.innovationgate.webgate.api.WGException
Form
storeinportlet
in interface Form
de.innovationgate.webgate.api.WGException
public 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()
Form
public java.util.List getfilenames()
Form
getfilenames
in interface Form
public java.io.File getfile(java.lang.String name) throws de.innovationgate.webgate.api.WGAPIException, java.io.IOException
Form
public long getfilesize(java.lang.String name) throws java.io.IOException
java.io.IOException
public java.lang.String getfiletext(java.lang.String name) throws java.io.IOException, de.innovationgate.webgate.api.WGAPIException
Form
getfiletext
in interface Form
name
- Name of the filejava.io.IOException
de.innovationgate.webgate.api.WGAPIException
public boolean attach(TMLUserProfile obj) throws java.io.IOException, de.innovationgate.webgate.api.WGAPIException
java.io.IOException
de.innovationgate.webgate.api.WGAPIException
public boolean attach(de.innovationgate.webgate.api.WGDocument doc, java.lang.String altFileName) throws java.io.IOException, de.innovationgate.webgate.api.WGAPIException
java.io.IOException
de.innovationgate.webgate.api.WGAPIException
public boolean pushFiles(de.innovationgate.webgate.api.WGDocument doc) throws de.innovationgate.webgate.api.WGAPIException, java.io.IOException
de.innovationgate.webgate.api.WGAPIException
java.io.IOException
public boolean retainFiles(de.innovationgate.webgate.api.WGDocument doc) throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIException
public boolean attach(de.innovationgate.webgate.api.WGDocument doc) throws java.io.IOException, de.innovationgate.webgate.api.WGAPIException
Form
public long attachmentsize(java.lang.String fieldname) throws java.io.IOException
java.io.IOException
public 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.IOException
de.innovationgate.webgate.api.WGAPIException
public void attachscaledimage(de.innovationgate.webgate.api.WGDocument doc, de.innovationgate.utils.ImageScaler scaler) throws java.io.IOException, de.innovationgate.webgate.api.WGAPIException
java.io.IOException
de.innovationgate.webgate.api.WGAPIException
public 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.WGAPIException
public void reset() throws de.innovationgate.webgate.api.WGAPIException
Form
public void remove()
Form
public boolean iseditable()
Form
iseditable
in interface Form
public boolean ispersistent()
Form
ispersistent
in interface Form
public java.util.List<java.lang.String> getmessages()
Form
getmessages
in interface Form
persistent
- The persistent to set.public java.util.List<java.lang.String> getglobalmessages()
Form
getglobalmessages
in interface Form
public java.lang.String getmessage(java.lang.String field)
Form
getmessage
in interface Form
field
- Name of the fieldpublic boolean hasmessages()
Form
hasmessages
in interface Form
public boolean hasmessage(java.lang.String field)
Form
hasmessage
in interface Form
field
- Name of the fieldpublic void addmessage(java.lang.String message)
Form
addmessage
in interface Form
message
- The messagepublic void setmessage(java.lang.String fieldName, java.lang.String message)
Form
setmessage
in interface Form
fieldName
- The field for which the message is determinedmessage
- The validation error messagepublic boolean conditionFailed(java.lang.String condition)
condition
- public TMLFormInfo getforminfo()
Form
getforminfo
in interface Form
public void setFormInfo(TMLFormInfo formInfo)
public void clearmessages()
Form
clearmessages
in interface Form
public java.util.List getinvalidfields()
Form
getinvalidfields
in interface Form
public java.lang.String getsource()
public java.lang.String source()
Form
public java.lang.String getmode()
public java.lang.String mode()
Form
public 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.WGException
public de.innovationgate.wgaservices.types.Form exportServicesForm() throws java.io.IOException, de.innovationgate.webgate.api.WGAPIException
java.io.IOException
de.innovationgate.webgate.api.WGAPIException
public boolean issubmitted()
Form
issubmitted
in interface Form
public boolean removefile(java.lang.String filename)
Form
removefile
in interface Form
filename
- Name of the filepublic void addfile(java.io.File source, java.lang.String fileName) throws java.io.IOException, java.security.NoSuchAlgorithmException
Form
public void addfile(java.io.File source) throws java.io.IOException, java.security.NoSuchAlgorithmException
Form
public void addfile(java.io.InputStream stream, java.lang.String fileName) throws java.io.IOException, java.security.NoSuchAlgorithmException
Form
public java.lang.String getprocessid()
public TMLFormProcessContext getprocesscontext()
Form
getprocesscontext
in interface Form
public boolean isempty(java.lang.String fieldName)
Form
public void clearFiles()
public boolean isfilesdropped()
Form
isfilesdropped
in interface Form
public java.lang.String fileurl(java.lang.String fileName) throws org.apache.commons.httpclient.URIException
Form
public void setcreateddoc(de.innovationgate.webgate.api.WGDocument createdDoc)
public boolean store() throws de.innovationgate.webgate.api.WGException
Form
public FormSource fetchFormSource(TMLContext cx) throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
public java.lang.Object getpasswordsalt()