de.innovationgate.wga.server.api.tml
public interface Form
Modifier and Type | Method and Description |
---|---|
void |
addfile(File source)
Adds a file from the servers file system to the form
|
void |
addfile(File source,
String fileName)
Adds a file from the servers file system to the form
|
void |
addfile(InputStream stream,
String fileName)
Adds a file from the servers file system to the form
|
void |
addmessage(String message)
Adds a new global validation message
|
void |
appendtofield(String name,
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
|
Object |
enteredvalue(String fieldname)
Returns the unprocessed value of a field like the user entered it
|
Object |
field(String name)
Returns the value of a field as a single value.
|
List<Object> |
fieldlist(String name)
Returns the value of a field as a list value.
|
String |
fileurl(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
|
List<String> |
geterrors()
Lists data type conversion errors
|
List<String> |
getfieldnames()
Lists the names of the fields on this form
|
File |
getfile(String name)
Returns a Java file object for an uploaded file
|
List |
getfilenames()
Lists the names of files that have been uploaded to this form
|
String |
getfiletext(String name)
Returns the text contents of an uploaded file
|
String |
getformid()
Returns the ID of the form
|
FormInfo |
getforminfo()
Grants access to the FormInfo object of this WebTML form
|
List<String> |
getglobalmessages()
Returns all validation messages that are global, i.e. not bound to a specific field
|
List |
getinvalidfields()
Lists names of fields with validation errors
|
String |
getmessage(String field)
Returns the validation message of a field with failed validation
|
List<String> |
getmessages()
Lists all current validation messages
|
ProcessContext |
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(String name)
Tests if the form contains a field of the given name
|
boolean |
hasmessage(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(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
|
String |
mode()
Returns the display mode of the WebTML form
|
Object |
parsedvalue(String fieldname)
Returns the processed value of the field in its target type
|
void |
remove()
Removes the current form from form registry
|
void |
removefield(String name)
Removes a field from the form and its data
|
boolean |
removefile(String filename)
Removes a file from the form
|
void |
reset()
Clears all fields and uploaded files from the form, resetting it completely
|
void |
setfield(String name,
Object value)
Sets the value of a field
|
void |
setmessage(String fieldName,
String message)
Adds a new validation message related to the specified input field
|
String |
source()
Returns the source type of the form
|
boolean |
store()
Stores the form data to the source of the form
|
void |
storefield(String fieldName,
de.innovationgate.webgate.api.WGDocument doc)
Stores a single form field to a document.
|
void |
storefield(String fieldName,
de.innovationgate.webgate.api.WGDocument doc,
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(File source) throws IOException, NoSuchAlgorithmException
source
- The fileIOException
NoSuchAlgorithmException
void addfile(File source, String fileName) throws IOException, NoSuchAlgorithmException
source
- The file whose data is attachedfileName
- The name under which the file should get attachedIOException
NoSuchAlgorithmException
void addfile(InputStream stream, String fileName) throws IOException, NoSuchAlgorithmException
stream
- The input stream serving the files atafileName
- The name under which the file should get attachedIOException
NoSuchAlgorithmException
void addmessage(String message)
message
- The messagevoid appendtofield(String name, 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 IOException, de.innovationgate.webgate.api.WGAPIException
doc
- IOException
de.innovationgate.webgate.api.WGAPIException
void clearmessages()
Object enteredvalue(String fieldname)
fieldname
- The field nameObject field(String name)
name
- Name of the fieldList<Object> fieldlist(String name)
name
- Name of the fieldString fileurl(String fileName) throws org.apache.commons.httpclient.URIException
fileName
- Name of the fileorg.apache.commons.httpclient.URIException
de.innovationgate.webgate.api.WGDocument getcreateddoc()
File getfile(String name) throws de.innovationgate.webgate.api.WGAPIException, IOException
name
- Name of the filede.innovationgate.webgate.api.WGAPIException
IOException
List getfilenames()
String getfiletext(String name) throws IOException, de.innovationgate.webgate.api.WGAPIException
name
- Name of the fileIOException
de.innovationgate.webgate.api.WGAPIException
String getformid()
FormInfo getforminfo()
List<String> getglobalmessages()
List getinvalidfields()
String getmessage(String field)
field
- Name of the fieldProcessContext getprocesscontext()
Context gettargetcontext()
boolean hasfield(String name)
name
- Name of the fieldboolean hasmessage(String field)
field
- Name of the fieldboolean hasmessages()
boolean iseditable()
boolean isfilesdropped()
boolean ispersistent()
boolean issubmitted()
String mode()
Object parsedvalue(String fieldname)
fieldname
- Name of the fieldvoid remove()
void removefield(String name)
name
- Name of the fieldboolean removefile(String filename)
filename
- Name of the filevoid reset() throws de.innovationgate.webgate.api.WGAPIException
de.innovationgate.webgate.api.WGAPIException
void setfield(String name, Object value) throws de.innovationgate.webgate.api.WGException
name
- Name of the fieldvalue
- Value of the fieldde.innovationgate.webgate.api.WGException
void setmessage(String fieldName, String message)
fieldName
- The field for which the message is determinedmessage
- The validation error messageString source()
boolean store() throws de.innovationgate.webgate.api.WGException
de.innovationgate.webgate.api.WGException
void storefield(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(String fieldName, de.innovationgate.webgate.api.WGDocument doc, 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, IOException
de.innovationgate.webgate.api.WGException
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(String fieldName)
fieldName
- Then name of the field