public interface 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(de.innovationgate.webgate.api.WGDocument doc)
Attaches all files stored on this form to a document
|
void |
clearmessages()
Clears all validation messages on the form
|
java.lang.Object |
enteredvalue(java.lang.String fieldname)
Returns the unprocessed value of a field like the user entered it
|
java.lang.Object |
field(java.lang.String name)
Returns the value of a field as a single value.
|
java.util.List<java.lang.Object> |
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<java.lang.String> |
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<java.lang.Object> |
getfilenames()
Lists the names of files that have been uploaded to this form
|
java.lang.String |
getfiletext(java.lang.String name)
Returns the text contents of an uploaded file
|
java.lang.String |
getformid()
Returns the ID of the form
|
FormInfo |
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<java.lang.Object> |
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
|
TMLFormProcessContext |
getprocesscontext()
Provides a ProcessContext to store arbitrary data for the form process
|
Context |
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
|
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 |
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
|
void |
setfield(java.lang.String name,
java.lang.Object value)
Sets the value of a field
|
void |
setmessage(java.lang.String fieldName,
java.lang.String message)
Adds a new validation message related to the specified input field
|
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 |
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 |
validate()
Manually triggers the form validation
|
void addfile(java.io.File source) throws java.io.IOException, java.security.NoSuchAlgorithmException
source
- The filejava.io.IOException
java.security.NoSuchAlgorithmException
void addfile(java.io.File source, java.lang.String fileName) throws java.io.IOException, java.security.NoSuchAlgorithmException
source
- The file whose data is attachedfileName
- The name under which the file should get attachedjava.io.IOException
java.security.NoSuchAlgorithmException
void addfile(java.io.InputStream stream, java.lang.String fileName) throws java.io.IOException, java.security.NoSuchAlgorithmException
stream
- The input stream serving the files atafileName
- The name under which the file should get attachedjava.io.IOException
java.security.NoSuchAlgorithmException
void addmessage(java.lang.String message)
message
- The messagevoid appendtofield(java.lang.String name, java.lang.Object value) throws de.innovationgate.webgate.api.WGException
name
- Name of the fieldvalue
- Value to appendde.innovationgate.webgate.api.WGException
boolean attach(de.innovationgate.webgate.api.WGDocument doc) throws java.io.IOException, de.innovationgate.webgate.api.WGAPIException
doc
- java.io.IOException
de.innovationgate.webgate.api.WGAPIException
void clearmessages()
java.lang.Object enteredvalue(java.lang.String fieldname)
fieldname
- The field namejava.lang.Object field(java.lang.String name)
name
- Name of the fieldjava.util.List<java.lang.Object> fieldlist(java.lang.String name)
name
- Name of the fieldjava.lang.String fileurl(java.lang.String fileName) throws org.apache.commons.httpclient.URIException
fileName
- Name of the fileorg.apache.commons.httpclient.URIException
de.innovationgate.webgate.api.WGDocument getcreateddoc()
java.util.List<java.lang.String> geterrors()
java.util.List<java.lang.String> getfieldnames()
java.io.File getfile(java.lang.String name) throws de.innovationgate.webgate.api.WGAPIException, java.io.IOException
name
- Name of the filede.innovationgate.webgate.api.WGAPIException
java.io.IOException
java.util.List<java.lang.Object> getfilenames()
java.lang.String getfiletext(java.lang.String name) throws java.io.IOException, de.innovationgate.webgate.api.WGAPIException
name
- Name of the filejava.io.IOException
de.innovationgate.webgate.api.WGAPIException
java.lang.String getformid()
FormInfo getforminfo()
java.util.List<java.lang.String> getglobalmessages()
java.util.List<java.lang.Object> getinvalidfields()
java.lang.String getmessage(java.lang.String field)
field
- Name of the fieldjava.util.List<java.lang.String> getmessages()
TMLFormProcessContext getprocesscontext()
Context gettargetcontext()
boolean hasfield(java.lang.String name)
name
- Name of the fieldboolean hasmessage(java.lang.String field)
field
- Name of the fieldboolean hasmessages()
boolean iseditable()
boolean isfilesdropped()
boolean ispersistent()
boolean issubmitted()
java.lang.String mode()
java.lang.Object parsedvalue(java.lang.String fieldname)
fieldname
- Name of the fieldvoid remove()
void removefield(java.lang.String name)
name
- Name of the fieldboolean removefile(java.lang.String filename)
filename
- Name of the filevoid reset() throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIException
void setfield(java.lang.String name, java.lang.Object value) throws de.innovationgate.webgate.api.WGException
name
- Name of the fieldvalue
- Value of the fieldde.innovationgate.webgate.api.WGException
void setmessage(java.lang.String fieldName, java.lang.String message)
fieldName
- The field for which the message is determinedmessage
- The validation error messagejava.lang.String source()
boolean store() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
void storefield(java.lang.String fieldName, de.innovationgate.webgate.api.WGDocument doc) throws de.innovationgate.webgate.api.WGAPIException
fieldName
- The name of the fielddoc
- The document to store the field tode.innovationgate.webgate.api.WGAPIException
void storefield(java.lang.String fieldName, de.innovationgate.webgate.api.WGDocument doc, java.lang.String targetName) throws de.innovationgate.webgate.api.WGAPIException
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
boolean storeincontent() throws de.innovationgate.webgate.api.WGException, java.io.IOException
de.innovationgate.webgate.api.WGException
java.io.IOException
boolean storeincontent(de.innovationgate.webgate.api.WGContent content) throws de.innovationgate.webgate.api.WGException
content
- The document to store the fields tode.innovationgate.webgate.api.WGException
boolean storeinportlet() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
boolean storeinportlet(Portlet portlet) throws de.innovationgate.webgate.api.WGException
portlet
- The portlet to store the configuration tode.innovationgate.webgate.api.WGException
boolean storeinprofile() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
boolean validate()
boolean isempty(java.lang.String fieldName)
fieldName
- Then name of the field