Package com.ebasetech.ufs.kernel
Class UFSFormInterface
java.lang.Object
com.ebasetech.ufs.kernel.UFSFormInterface
- All Implemented Interfaces:
- java.io.Serializable
public class UFSFormInterface
extends java.lang.Object
implements java.io.Serializable
This class represents the external interface to a running Ebase form. It allows
 information to be extracted from the form for use by other programs or Java
 Server Pages (JSPs) running within the same web application. It also allows form
 field values to be changed.
 
Example of instantiating UFSFormInterface from a JSP is :
 <%@ page language="java" import="com.ebasetech.ufs.kernel.*"%>
 <% UFSFormInterface form = UFSFormInterface.getFormInterface(); %>
 
Information can then be extracted from the form and presented on the page. For example, to display the current page name :
Page name: <%=form.getCurrentPage()%>
- Version:
- 2.4
- Author:
- Jon Rickard 30 Jan 2002
- See Also:
- Serialized Form
- 
Constructor SummaryConstructors Constructor Description UFSFormInterface(com.ebasetech.ufs.runtime.HeadlessUserState headlessUserState)UFSFormInterface constructor - internal use only
- 
Method SummaryModifier and Type Method Description voidaddScratchPadObject(java.lang.String name, java.lang.Object obj)Add an object to the scratchpad areajava.lang.StringcalculateFontSize(java.lang.String sizeString)Deprecated.from V4.0 with no replacement.voidcommitTransaction()Commits the current transaction and starts a new transaction.voiddeleteAllRows(java.lang.String tableFieldName)Delete all rows from a tablecom.ebasetech.xi.api.ClientgetClientApi()Returns the ApiClientobject that provides information about the browser client.java.lang.StringgetCurrentPage()java.lang.StringgetFieldValue(java.lang.String fieldName)Returns the string value of the field requested, or null if the field does not exist in the form.com.ebasetech.ufs.beans.FormBeangetForm()com.ebasetech.xi.api.WebFormgetFormApi()Returns the ApiWebFormobject that provides access to the form Api.static UFSFormInterfacegetFormInterface()Returns the current UFSFormInterface object to external callers.java.lang.StringgetFormName()returns the name of the formcom.ebasetech.ufs.kernel.FormSessiongetFormSessionContext()Returns the FormSession context object for the user session.com.ebasetech.xi.api.GatewaygetGateway()Returns the ApiSystemobject that provides access to common services and information.com.ebasetech.ufs.runtime.HeadlessUserStategetHeadlessUserState()com.ebasetech.ufs.kernel.FormInterfaceLoggergetLogger()java.lang.StringgetMessageText(java.lang.String project, int messageId, java.util.Vector parms)Deprecated.from V5.0 usegetMessageText(String, List)insteadjava.lang.StringgetMessageText(java.lang.String messageId, java.util.List<java.lang.Object> parms)Returns a message text.java.lang.Object[]getPages(boolean allPages)Returns a list of the form's pages - in order as much as possiblejava.lang.StringgetRelativeFieldName(java.lang.String fieldName)java.lang.StringgetRelativePageName(java.lang.String pageName)java.lang.StringgetRelativeTextId(java.lang.String textId)java.lang.ObjectgetScratchPadObject(java.lang.String name)Get an object from the scratchpad areacom.ebasetech.ufs.scripts.ScriptContextgetScriptContext()com.ebasetech.xi.api.ServicesgetServicesApi()Returns the ApiServicesobject that provides access to various services such asFileServices.javax.servlet.http.HttpSessiongetSessionContext()Returns the HttpSession context object for the user session.com.ebasetech.xi.api.EbaseSystemgetSystem()Returns the ApiSystemobject that provides access to common services and information.TableDataInterfacegetTableData(java.lang.String tableFieldName)java.lang.StringgetText(int textId)Deprecated.getText(textId, namespace) should be used.java.lang.StringgetText(java.lang.String textId, java.lang.String namespace)returns the text for the corresponding textid in the form's languageintgetZoomAmount()Deprecated.from V4.0 with no replacement.voidinsertRow(java.lang.String tableFieldName, boolean empty)Insert a new row to a table.booleanisBatchMode()Returns true if the system is operating in batch mode.booleanisDisplayInColour()Deprecated.from V4.0 with no replacement.booleanisJavascriptEnabled()can Javascript be used with this browser connectionbooleanisUseStylesheets()Deprecated.from V4.0 with no replacement.voidlogFormError(java.lang.String errorMsg)Log an error message.voidlogFormInfo(java.lang.String infoMsg)Log an information message.voidremoveScratchPadObject(java.lang.String name)Remove an object from the scratchpad areavoidrollbackTransaction()Rolls back the current transaction and starts a new transaction.voidsetErrorMessage(int messageNo, java.util.Vector messageParameters)Deprecated.usesetErrorMessageText(String, List)insteadvoidsetErrorMessage(java.lang.String messageText)Add a simple error message to the current control where the error message text is supplied as messageText.voidsetErrorMessageText(java.lang.String textId, java.util.List<java.lang.String> messageParameters)Add an error message to the current control.voidsetFieldList(java.lang.String fieldName, java.util.Vector values)Use this method to dynamically add a list to a form field.voidsetFieldValue(java.lang.String fieldName, java.lang.Object value)Sets a new value for the specified type.voidsetHeadlessUserState(com.ebasetech.ufs.runtime.HeadlessUserState hadlessUserState)voidsetScriptContext(com.ebasetech.ufs.runtime.EventScriptContext scriptContext)voidsetTableData(java.lang.String tableFieldName, TableDataInterface tableData)voidsetWarningMessage(int messageNo, java.util.Vector messageParameters)Add an warning message to the current control.voidsetWarningMessageText(java.lang.String textId, java.util.List<java.lang.String> messageParameters)Add an warning message to the current control.Methods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
- 
Constructor Details- 
UFSFormInterfacepublic UFSFormInterface(com.ebasetech.ufs.runtime.HeadlessUserState headlessUserState)UFSFormInterface constructor - internal use only
 
- 
- 
Method Details- 
getHeadlessUserStatepublic com.ebasetech.ufs.runtime.HeadlessUserState getHeadlessUserState()
- 
getCurrentPagepublic java.lang.String getCurrentPage()
- 
getFieldValuepublic java.lang.String getFieldValue(java.lang.String fieldName)Returns the string value of the field requested, or null if the field does not exist in the form.
- 
getFormNamepublic java.lang.String getFormName()returns the name of the form
- 
getPagespublic java.lang.Object[] getPages(boolean allPages)Returns a list of the form's pages - in order as much as possible
- 
getTextpublic java.lang.String getText(int textId)Deprecated.getText(textId, namespace) should be used.returns the text for the corresponding textid in the form's language- Parameters:
- textId- is the unique text id number
 
- 
getTextpublic java.lang.String getText(java.lang.String textId, java.lang.String namespace)returns the text for the corresponding textid in the form's language- Parameters:
- textId- is the unique text id string
- namespace- is the text namespace and should be one of 'Local', 'Shared' or 'System'
 
- 
setErrorMessagepublic void setErrorMessage(int messageNo, java.util.Vector messageParameters) throws com.ebasetech.ufs.kernel.FormExceptionDeprecated.usesetErrorMessageText(String, List)insteadAdd an error message to the current control. This method supports multi-lingual messages, and substitution of values into the message text. messageNo - is a pre-defined message number within the same project as the form messageParameters - is a vector of Strings containing the same number of values as the number of replaceable variables within the message. e.g. Message : "Value && invalid for customer &&" requires a vector of two values. Calling this method stops form processing and returns the form page to the user displaying the error. No further FPL script commands will be executed.- Throws:
- com.ebasetech.ufs.kernel.FormException
 
- 
setErrorMessageTextpublic void setErrorMessageText(java.lang.String textId, java.util.List<java.lang.String> messageParameters) throws com.ebasetech.ufs.kernel.FormExceptionAdd an error message to the current control. This method supports multi-lingual messages, and substitution of values into the message text. Calling this method stops form processing and returns the form page to the user displaying the error. No further script commands will be executed.- Parameters:
- textId- the text id of the text to be added as a message, texts can be defined in form/component texts or in linked texts files
- messageParameters- a list of Strings containing the same number of values as the number of replaceable variables within the message. e.g. Message : "Value && invalid for customer &&" requires a list of two values.
- Throws:
- com.ebasetech.ufs.kernel.FormException
 
- 
setErrorMessagepublic void setErrorMessage(java.lang.String messageText) throws com.ebasetech.ufs.kernel.FormExceptionAdd a simple error message to the current control where the error message text is supplied as messageText. This method does not support warning messages, multi-lingual messages, or substitution of field values into messages. To use any of these options, use the alternative setErrorMessage and setWarningMessage methods. Calling this method stops form processing and returns the form page to the user displaying the error. No further FPL script commands will be executed.- Throws:
- com.ebasetech.ufs.kernel.FormException
 
- 
setFieldListpublic void setFieldList(java.lang.String fieldName, java.util.Vector values) throws com.ebasetech.ufs.kernel.FormExceptionUse this method to dynamically add a list to a form field. The values vector contains a list of com.ebasetech.ufs.kernel.SelectValue objects each one of which contains a display value, a return value, and optionally a display sequence. See SelectValue javadoc. If a list already exists for the field, it will be replaced.- Throws:
- com.ebasetech.ufs.kernel.FormException
 
- 
setFieldValuepublic void setFieldValue(java.lang.String fieldName, java.lang.Object value) throws com.ebasetech.ufs.kernel.FormExceptionSets a new value for the specified type. Will throw FormException if the field type is not compatible with the object type.- Throws:
- com.ebasetech.ufs.kernel.FormException
 
- 
setWarningMessagepublic void setWarningMessage(int messageNo, java.util.Vector messageParameters) throws com.ebasetech.ufs.kernel.FormExceptionAdd an warning message to the current control. This method supports multi-lingual messages, and substitution of values into the message text. messageNo - is a pre-defined message number within the same project as the form messageParameters - is a vector of Strings containing the same number of values as the number of replaceable variables within the message. e.g. Message : "Value && invalid for customer &&" requires a vector of two values.- Throws:
- com.ebasetech.ufs.kernel.FormException
 
- 
setWarningMessageTextpublic void setWarningMessageText(java.lang.String textId, java.util.List<java.lang.String> messageParameters) throws com.ebasetech.ufs.kernel.FormExceptionAdd an warning message to the current control. This method supports multi-lingual messages, and substitution of values into the message text.- Parameters:
- textId- the text id of the text to be added as a message, texts can be defined in form/component texts or in linked texts files
- messageParameters- a list of Strings containing the same number of values as the number of replaceable variables within the message. e.g. Message : "Value && invalid for customer &&" requires a list of two values.
- Throws:
- com.ebasetech.ufs.kernel.FormException
 
- 
addScratchPadObjectpublic void addScratchPadObject(java.lang.String name, java.lang.Object obj)Add an object to the scratchpad area
- 
getScratchPadObjectpublic java.lang.Object getScratchPadObject(java.lang.String name)Get an object from the scratchpad area
- 
removeScratchPadObjectpublic void removeScratchPadObject(java.lang.String name)Remove an object from the scratchpad area
- 
setScriptContextpublic void setScriptContext(com.ebasetech.ufs.runtime.EventScriptContext scriptContext)
- 
getRelativeFieldNamepublic java.lang.String getRelativeFieldName(java.lang.String fieldName)
- 
getRelativePageNamepublic java.lang.String getRelativePageName(java.lang.String pageName)
- 
getRelativeTextIdpublic java.lang.String getRelativeTextId(java.lang.String textId)
- 
getTableDatapublic TableDataInterface getTableData(java.lang.String tableFieldName) throws com.ebasetech.ufs.kernel.FormException- Throws:
- com.ebasetech.ufs.kernel.FormException
 
- 
setTableDatapublic void setTableData(java.lang.String tableFieldName, TableDataInterface tableData) throws com.ebasetech.ufs.kernel.FormException- Throws:
- com.ebasetech.ufs.kernel.FormException
 
- 
insertRowpublic void insertRow(java.lang.String tableFieldName, boolean empty) throws com.ebasetech.ufs.kernel.FormExceptionInsert a new row to a table.- Parameters:
- tableFieldName- field name for an existing table
- empty- true if the row should be marked as empty. see documentation for insertRow FPL command.
- Throws:
- com.ebasetech.ufs.kernel.FormException- will throw a FormException if tableFieldName is not a table
 
- 
deleteAllRowspublic void deleteAllRows(java.lang.String tableFieldName) throws com.ebasetech.ufs.kernel.FormExceptionDelete all rows from a table- Parameters:
- tableFieldName- field name for an existing table
- Throws:
- com.ebasetech.ufs.kernel.FormException- will throw a FormException if tableFieldName is not a table
 
- 
isJavascriptEnabledpublic boolean isJavascriptEnabled()can Javascript be used with this browser connection
- 
getZoomAmountpublic int getZoomAmount()Deprecated.from V4.0 with no replacement. The zoom facility is no longer supported.
- 
isDisplayInColourpublic boolean isDisplayInColour()Deprecated.from V4.0 with no replacement. The ability to suppress colour is no longer supported.
- 
isUseStylesheetspublic boolean isUseStylesheets()Deprecated.from V4.0 with no replacement. Output is always rendered using CSS regardless of whether this is supported by the browser.
- 
calculateFontSizepublic java.lang.String calculateFontSize(java.lang.String sizeString)Deprecated.from V4.0 with no replacement. Zoom options are not applicable in V4.0. Returns the value of sizeStringAdjusts the font size passed by incrementing it by the zoom amount and converting it to the appropriate units depending on whether or not the client browser supports style sheets. This allows the font size to react to dynamic changes such as the user clicking accessibility buttons The algorithms used in this calculation are the same as those used to adjust font sizes specified in the presentation template. sizeString can be a number ending in 'px', 'em' or '%'. e.g. '12px', '0.9em', '110%' Any other formats are returned unadjusted.
- 
getSessionContextpublic javax.servlet.http.HttpSession getSessionContext()Returns the HttpSession context object for the user session. This can be used to store and retrieve user-related parameters and data. Note that the HttpSession context and all attributes it contains are automatically released when the session expires.
- 
getFormSessionContextpublic com.ebasetech.ufs.kernel.FormSession getFormSessionContext()Returns the FormSession context object for the user session. There is one FormSession object for each end-user browser window. This can be used to store and retrieve parameters and data that relate to one specific execution of a form. This is in contrast to method getSessionContext() that returns the HttpSession object that applies to the entire session.
- 
logFormErrorpublic void logFormError(java.lang.String errorMsg)Log an error message. The message will appear on the server log and will also be visible to the designer using View --> execution log.
- 
logFormInfopublic void logFormInfo(java.lang.String infoMsg)Log an information message. The message will appear on the server log and will also be visible to the designer using View --> execution log.
- 
isBatchModepublic boolean isBatchMode()Returns true if the system is operating in batch mode. i.e. no browser client exists.
- 
rollbackTransactionpublic void rollbackTransaction() throws com.ebasetech.ufs.kernel.FormTransactionExceptionRolls back the current transaction and starts a new transaction.- Throws:
- com.ebasetech.ufs.kernel.FormTransactionException
 
- 
commitTransactionpublic void commitTransaction() throws com.ebasetech.ufs.kernel.FormTransactionExceptionCommits the current transaction and starts a new transaction.- Throws:
- com.ebasetech.ufs.kernel.FormTransactionException
 
- 
getMessageTextpublic java.lang.String getMessageText(java.lang.String project, int messageId, java.util.Vector parms) throws com.ebasetech.ufs.kernel.FormExceptionDeprecated.from V5.0 usegetMessageText(String, List)insteadReturns a message text. In a multi-lingual system, the same rules are applied to select the language as are used to display a text using the FPL message command. Parameters: project - the project name messageId - the message number parms - a Vector of String objects which will be substituted into && variables in the message text.- Throws:
- com.ebasetech.ufs.kernel.FormException
 
- 
getMessageTextpublic java.lang.String getMessageText(java.lang.String messageId, java.util.List<java.lang.Object> parms) throws com.ebasetech.ufs.kernel.FormExceptionReturns a message text. In a multi-lingual system, the same rules are applied to select the language as are used to display a text using the FPL message command or one of the Javascript API addXxxMessage() methods.- Parameters:
- messageId- text id of the text to be added as a message, texts can be defined in form/component texts or in linked texts files
- parms- a list of String objects which will be substituted into && variables in the message text.
- Throws:
- com.ebasetech.ufs.kernel.FormException
 
- 
getFormpublic com.ebasetech.ufs.beans.FormBean getForm()
- 
getFormApipublic com.ebasetech.xi.api.WebForm getFormApi()Returns the ApiWebFormobject that provides access to the form Api.- Returns:
- WebForm
- Since:
- V4.4
 
- 
getClientApipublic com.ebasetech.xi.api.Client getClientApi()Returns the ApiClientobject that provides information about the browser client.- Returns:
- Client
- Since:
- V4.4
 
- 
getServicesApipublic com.ebasetech.xi.api.Services getServicesApi()Returns the ApiServicesobject that provides access to various services such asFileServices.- Returns:
- Services
- Since:
- V5.1
 
- 
getSystempublic com.ebasetech.xi.api.EbaseSystem getSystem()Returns the ApiSystemobject that provides access to common services and information.- Returns:
- System
- Since:
- V4.4
 
- 
getGatewaypublic com.ebasetech.xi.api.Gateway getGateway()Returns the ApiSystemobject that provides access to common services and information.- Returns:
- System
- Since:
- V4.4
 
- 
getLoggerpublic com.ebasetech.ufs.kernel.FormInterfaceLogger getLogger()
- 
getFormInterfaceReturns the current UFSFormInterface object to external callers. This method is intended for use with JSP's to gain access to form information. Object is constructed on demand;
- 
setHeadlessUserStatepublic void setHeadlessUserState(com.ebasetech.ufs.runtime.HeadlessUserState hadlessUserState)
- 
getScriptContextpublic com.ebasetech.ufs.scripts.ScriptContext getScriptContext()
 
-