Package com.adobe.xfa.form
Class FormModel
- java.lang.Object
-
- com.adobe.xfa.Obj
-
- com.adobe.xfa.Node
-
- com.adobe.xfa.Element
-
- com.adobe.xfa.Model
-
- com.adobe.xfa.form.FormModel
-
- All Implemented Interfaces:
Element.DualDomNode
,Peer
public class FormModel extends Model
A class to represent the result of joining a template and data.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
FormModel.ConnectHandler
static class
FormModel.DatasetSelector
static class
FormModel.Execute
static interface
FormModel.PostMergeHandler
Defines the callback interface that will be invoked immediately after a merge but before any initialize events are fired.static class
FormModel.ServerExchange
Provides a mechanism for FormModel to execute an event on a server.static class
FormModel.Submit
static class
FormModel.Validate
A base class that an implementation can derive from to interact with the form validation process.-
Nested classes/interfaces inherited from class com.adobe.xfa.Model
Model.DualDomModel, Model.Publisher
-
Nested classes/interfaces inherited from class com.adobe.xfa.Element
Element.DualDomNode, Element.ReplaceContent
-
Nested classes/interfaces inherited from class com.adobe.xfa.Node
Node.ChangeLogger
-
-
Field Summary
-
Fields inherited from class com.adobe.xfa.Element
AttrIsDefault, AttrIsFragment, AttrIsTransient, CREATEACTION
-
Fields inherited from class com.adobe.xfa.Node
CREATE_ALWAYS_NEW, CREATE_IF_NOT_EXIST, CREATE_MUST_NOT_EXIST, CREATE_REPLACE, gsXFANamespacePrefix
-
Fields inherited from interface com.adobe.xfa.ut.Peer
ATTR_CHANGED, CHILD_ADDED, CHILD_REMOVED, DESCENDENT_ADDED, DESCENDENT_ATTR_CHANGED, DESCENDENT_REMOVED, DESCENDENT_VALUE_CHANGED, PARENT_CHANGED, PERMS_LOCK_CLEARED, PERMS_LOCK_SET, PROTO_ATTR_CHANGED, PROTO_CHILD_ADDED, PROTO_CHILD_REMOVED, PROTO_DESCENDENT_ADDED, PROTO_DESCENDENT_ATTR_CHANGED, PROTO_DESCENDENT_REMOVED, PROTO_DESCENDENT_VALUE_CHANGED, PROTO_VALUE_CHANGED, UPDATED, VALUE_CHANGED
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addUseHRefNode(Element useHRefNode)
Not supported on FormModelvoid
addUseNode(Element useNode)
add a new new node to the useNodeListvoid
clearFocus()
Resets the focus.Node
createNode(int eClassTag, Element parent, java.lang.String aNodeName, java.lang.String aNS, boolean bDoVersionCheck)
Create an element with the given tag, parent, name and uri.void
createPanelOverlayData(int nPanel)
Creates an overlayData section under dataSets.boolean
eventOccurred(java.lang.String sActivity, Obj container)
Notifies event listeners that an event has occurred on a container.void
exportConnectionData(java.lang.String strConnectionName, java.lang.String sDataDescriptionName)
boolean
getAdjustData()
Determines whether the nextremerge()
operation will adjust the structure of the DataModel to match the TemplateModel.java.lang.String
getAmbientLocale()
Gets the ambient locale override for the top level subform.java.lang.String
getBaseNS()
boolean
getCalculationsEnabled()
Determines if calculations are enabled.FormModel.Validate
getDefaultValidate()
Gets the default Validate object.Obj
getDelta(Element node, java.lang.String sSOM)
Obj
getDeltas(Element node)
boolean
getDisableFormRemerge()
Disable/enable calls to remerge()FormModel.Execute
getExecute()
Gets the Execute associated with this FormModel.FormField
getFocus()
Gets the field that has focus for the FormModel.static FormModel
getFormModel(AppModel appModel, boolean bCreateIfNotFound)
Returns the FormModel held within the AppModel.boolean
getFormStateRemoved()
Determines if theformState
packet has been removed.java.lang.String
getFriendlyName(Element formNode)
Gets the friendly name (to use in user-facing communication) for a form nodejava.lang.String
getHeadNS()
HostPseudoModel
getHost()
boolean
getOverlayDataMergeUsage()
Gets the OverlayDataMerge setting.int
getPanelToMergeAgainst()
Gets the panel to merge against.FormModel.PostMergeHandler
getPostMergeHandler()
Gets the callback method that is to be invoked after merge but before any initialization scripts are run.java.util.List<ProtoableNode>
getProtoList()
Keep track of proto Nodes and 'use' tags for quick lookup later ourint
getRunScripts()
Gets the runAt property that specifies where scripts should be executed (client, server or both).ScriptTable
getScriptTable()
FormModel.ServerExchange
getServerExchange()
Gets the ServerExchange implementation associated with this FormModel.FormModel.Submit
getSubmit()
Gets the Submit implementation associated with this FormModel.java.lang.String
getSubmitURL()
Gets the submit URL override for the top level subform.boolean
getValidationsEnabled()
Determines whether validations are enabled.void
importConnectionData(java.lang.String strConnectionName)
Element
importNode(ProtoableNode templateNode, Element formParent, boolean bFull)
Imports a template node into this model, while resolving any global or dataRef fields.boolean
initialize()
Fires the initialize event on all containers on the form, and fires the indexChange event on all subforms.boolean
initializeNewContentNodes()
Initializes the new content nodesboolean
isCompatibleNS(java.lang.String aNS)
Determine if a specified namespace string is compatible with the namespace of this model.void
merge(boolean bEmptyMerge, boolean bAdjustData, boolean bInitialize, boolean bRestoreDeltas, boolean bForceRestore)
Merges the TemplateModel and the DataModel to create the FormModel.void
merge(boolean bEmptyMerge, boolean bAdjustData, java.lang.String sConnectionName, boolean bInitialize, boolean bRestoreDeltas, boolean bForceRestore)
Merges the TemplateModel and the DataModel to create the FormModel.int
mergeMode()
Indicates whether the current merge mode is globally consumptive (XFAEnum::CONSUME_DATA) or not (XFAEnum::MATCH_TEMPLATE).void
mergeOverlayData(Node formNode, Node overlayData)
Merges overlayData with a subform (FormServer requirement)void
normalizeNameSpaces()
void
preSave(boolean bSaveXMLScript)
Prepares thisModel
to be saved.boolean
recalculate(boolean bFullRecalculate, FormModel.Validate validate, boolean bIgnoreCalcEnabledFlag)
Executes calculation and validation scripts.static void
recurseConnectOnNode(Node node, java.lang.String strConnectionName, int eUsage, FormModel.ConnectHandler handler, java.lang.Object handlerData)
boolean
registerNewEvents(boolean bAllow)
Helper function to permit the temporary update the mbRegisterNewEvents setting This should call registerNewEvents(false) before cloning any form node to orphaned nodes being registered with the event modelvoid
remerge()
Forces the remerging of the DataModel and TemplateModel to recreate this FormModel.void
remove()
Removes a FormModel from its parents child list.void
removeReferences(Node node)
Recursively unmaps node from any DataNode it is mapped to.void
reset()
Resets this FormModel to its initial state.void
resetData(Obj container)
Resets a container to its template default value.void
resolveProtos(boolean bForceExternalProtoResolve)
void
restoreValidateDisableAll(Element formNode, Node delta)
restore the validate.disableAll property for a form nodevoid
setAdjustData(boolean bAdjustData)
Sets whether the nextremerge()
operation will adjust the structure of the DataModel to match the structure of the TemplateModel.void
setAmbientLocale(java.lang.String sLocale)
Set the ambient locale override for the top level subform.void
setDefaultValidate(FormModel.Validate validate)
Sets the default Validate.void
setDisableFormRemerge(boolean bDisable)
Disable/enable calls to remerge()void
setEmptyMerge(boolean bEmptyMerge)
Sets whether the nextremerge()
operation will do an empty merge.void
setExcludedActivities(java.lang.String sExclude)
Sets event activites that are to be excluded from execution.void
setExecute(FormModel.Execute execute)
Associates an Execute object with this FormModel.void
setFocus(FormField field)
Lets the form model know which field has focus.void
setGlobalConsumption(java.lang.Boolean bVal)
void
setPostMergeHandler(FormModel.PostMergeHandler handler, java.lang.Object clientData)
Sets the callback method that is to be invoked after merge but before any initialize scripts are run.void
setRunScripts(int eRunAtSetting)
Sets the runAt property that specifies where scripts should be executed (client, server or both).void
setServerExchange(FormModel.ServerExchange serverExchange)
Sets the ServerExchange implementation with this FormModel.void
setSubmit(FormModel.Submit submit)
Associates a Submit object with this FormModel.void
setSubmitURL(java.lang.String sSubmitURL)
Sets the submit URL from the config.void
setValidateBeforeExecute(boolean bValidate)
Sets the flag for performing validations before executing.void
setValidateBeforeSubmit(boolean bValidate)
Sets the flag for performing validations before submitting.boolean
wasIncrementalMerge()
Returns true if the last merge was an incremental merge.-
Methods inherited from class com.adobe.xfa.Model
addErrorList, addXMLLoadErrorContext, allowUpdates, checkforCompatibleNS, clearErrorList, clone, createElement, createElement, createElement, createElement, createElement, createTextNode, createTextNode, doAttributeCleanup, getAliasNode, getAppModel, getAppModelIsTransient, getCachedLocale, getContext, getCurrentVersion, getDeltas, getDocument, getErrorContextList, getErrorList, getEventManager, getGenerator, getHeadVersion, getIDValueMap, getLegacySetting, getLogMessenger, getName, getNeedsNSNormalize, getNode, getNS, getOriginalVersion, getOriginalVersionNode, getOriginalXFAVersion, getSchema, getSourceBelow, getVersion, getXmlPeer, isContainer, isLoading, isVersionCompatible, loadNode, loadRootAttributes, loadSpecialAttribute, loadSpecialNode, modelCleanup, nodeCleanup, normalizeNameSpaces, normalizeNameSpaces, preLoadNode, publish, ready, remapTag, removeLastError, resolveNodes, serialize, setAliasNode, setAppModel, setAppModelIsTransient, setContext, setCurrentVersion, setDOMProperties, setIDValueMap, setName, setNeedsNSNormalize, setOriginalXFAVersion, setXmlPeer, shortCutName, validateUsage, validateUsageFailedIsFatal, willDirtyDoc, willDirtyDoc
-
Methods inherited from class com.adobe.xfa.Element
appendChild, appendChild, appendPI, appendPI, assignNode, clone, connectPeerToDocument, constructKey, constructKeys, copyContent, defaultAttribute, defaultElement, defaultElement, establishID, evaluate, explodeQName, findAttr, findSchemaAttr, foundBadAttribute, foundBadAttribute, getAll, getAtom, getAttr, getAttribute, getAttribute, getAttributeByName, getAttrIndex, getAttrName, getAttrNS, getAttrProp, getAttrQName, getAttrVal, getChildReln, getClassAll, getClassIndex, getClassName, getDeltas, getElement, getElement, getElementClass, getElementLocal, getEnum, getEnum, getEventTable, getFirstXFAChild, getFirstXMLChild, getID, getIndex, getInheritedNS, getInstalledLocale, getIsNull, getLastXMLChild, getLineNumber, getLocalName, getModel, getNode, getNodes, getNodeSchema, getNumAttrs, getOneOfChild, getOneOfChild, getPI, getPI, getPrefix, getProperty, getProperty, getSaveXMLSaveTransient, getSchemaType, getScriptMethodInfo, getSibling, getText, getXFAChild, getXMLChild, getXMLName, getXPath, getXsiNilAttribute, inhibitPrettyPrint, inhibitPrettyPrint, insertChild, isFragment, isHidden, isHidden, isIndexed, isInstalledLocaleAmbient, isLeaf, isNameSpaceAttr, isPropertySpecified, isPropertySpecified, isPropertyValid, isSpecified, isSpecified, isSpecified, isTransient, isTransparent, isValidAttr, isValidChild, isValidElement, loadXML, loadXML, makeDefault, makeNonDefault, newAttribute, optimizeNameSpace, peekAttribute, peekElement, peekOneOfChild, peekProperty, peekProperty, postSave, privateSetName, processTextChildrenDuringParse, removeAttr, removeAttr, removeChild, removePI, removePI, removeWhiteSpace, removeXsiNilAttribute, replaceChild, resetPostLoadXML, resolveAndEnumerateChildren, resolveNodeCreate, resolvePrefix, saveFilteredXML, saveXML, saveXML, setAttribute, setAttribute, setAttribute, setAttribute, setAttrProp, setDefaultFlag, setElement, setIsDataWindowRoot, setIsIndexed, setLineNumber, setLocalName, setModel, setNS, setOneOfChild, setProperty, setProperty, setQName, setSaveXMLSaveTransient, setTransparent, setXMLName, setXsiNilAttribute, updateFromPeer
-
Methods inherited from class com.adobe.xfa.Node
checkAncestorPerms, checkDescendentPerms, checkPerms, cleanDirtyFlags, compareVersions, getData, getFirstXMLChildElement, getLocked, getNextXFASibling, getNextXMLSibling, getNextXMLSiblingElement, getNodeAsXML, getOwnerDocument, getPIAsXML, getPIName, getPreviousXMLSibling, getPrivateName, getPropName, getSOMExpression, getSOMExpression, getSomName, getUniqueSOMName, getWillDirty, getXFAChildCount, getXFAParent, getXfaPeer, getXMLChildCount, getXMLParent, hasChanged, isDefault, isDirty, isMapped, isPermsLockSet, isTransient, locateChildByClass, locateChildByName, logValueChangeHelper, notifyPeers, performSOMAssignment, resolveNode, resolveNode, resolveNode, resolveNodes, sendMessenge, setDirty, setDocument, setLocked, setMapped, setPermsLock, setPrivateName, setWillDirty, setXfaPeer, unLock, validateSchema
-
Methods inherited from class com.adobe.xfa.Obj
addPeer, addPeeredNode, clearPeers, deafen, getClassAtom, getClassTag, getPeer, getScriptProperty, getScriptThis, invokeFunction, isDeaf, isMute, isSameClass, isSameClass, isSameClass, mute, peerRemoved, removePeer, removePeeredNode, setClass, setClassTag, setScriptProperty, unDeafen, unMute
-
-
-
-
Method Detail
-
getFormModel
public static FormModel getFormModel(AppModel appModel, boolean bCreateIfNotFound)
Returns the FormModel held within the AppModel.- Parameters:
appModel
- the AppModel to searchbCreateIfNotFound
- iftrue
, and the FormModel does not exist, then one will be created and returned; iffalse
and the FormModel does not exist,null
is returned- Returns:
- the FormModel contained within appModel;
null
if not found and bCreateIfNotFound isfalse
.
-
recurseConnectOnNode
public static void recurseConnectOnNode(Node node, java.lang.String strConnectionName, int eUsage, FormModel.ConnectHandler handler, java.lang.Object handlerData)
-
addUseNode
public void addUseNode(Element useNode)
Description copied from class:Model
add a new new node to the useNodeList- Overrides:
addUseNode
in classModel
-
addUseHRefNode
public void addUseHRefNode(Element useHRefNode)
Not supported on FormModel- Overrides:
addUseHRefNode
in classModel
-
clearFocus
public void clearFocus()
Resets the focus. No field will have focus after but the form model will remember which field had the focus last.
-
mergeMode
public int mergeMode()
Indicates whether the current merge mode is globally consumptive (XFAEnum::CONSUME_DATA) or not (XFAEnum::MATCH_TEMPLATE).
-
createNode
public Node createNode(int eClassTag, Element parent, java.lang.String aNodeName, java.lang.String aNS, boolean bDoVersionCheck)
Description copied from class:Model
Create an element with the given tag, parent, name and uri.- Specified by:
createNode
in classModel
- Parameters:
eClassTag
- the element's tag.parent
- the element's parent.aNodeName
- the element's name.aNS
- the element's namespace.bDoVersionCheck
- check the element's version.- Returns:
- a new element.
- See Also:
Model.createNode(int, Element, String, String, boolean)
-
createPanelOverlayData
public void createPanelOverlayData(int nPanel)
Creates an overlayData section under dataSets. This method is for Form Server support.- Parameters:
nPanel
- the panel to create the overlayData section for
-
eventOccurred
public boolean eventOccurred(java.lang.String sActivity, Obj container)
Notifies event listeners that an event has occurred on a container. This method may fire additional events before and/or after firing the event.- Parameters:
sActivity
- the name of the eventcontainer
- the container on which the event occurs- Returns:
true
if one or more events were dispatched.
-
exportConnectionData
public void exportConnectionData(java.lang.String strConnectionName, java.lang.String sDataDescriptionName)
-
getAdjustData
public boolean getAdjustData()
Determines whether the nextremerge()
operation will adjust the structure of the DataModel to match the TemplateModel. The default value isfalse
.- Returns:
true
if the nextremerge()
operation will adjust the structure of the DataModel to match the TemplateModel.- See Also:
remerge()
,setAdjustData(boolean)
-
getAmbientLocale
public java.lang.String getAmbientLocale()
Gets the ambient locale override for the top level subform. This will be used when resolving locales for fields and subforms. If a field/subform does not have a locale specified, then they will inherit it from their ancestory hierarchy.- Returns:
- the ambient locale (e.g. "en_US").
-
getBaseNS
public java.lang.String getBaseNS()
- Specified by:
getBaseNS
in classModel
- See Also:
Model.getBaseNS()
-
getCalculationsEnabled
public boolean getCalculationsEnabled()
Determines if calculations are enabled.- Returns:
true
if calculations are enabled.
-
getDefaultValidate
public FormModel.Validate getDefaultValidate()
Gets the default Validate object. The default Validate object is used whenever validation is initiated by some method that does not use a Validate parameter, or when validation is initiated byvalidate(Validate, Element, boolean, boolean)
orrecalculate(boolean, Validate, boolean)
andnull
is passed to the validate parameter. For example, the default Validate object is used when validation is initiated by theexecValidate
scripting method of the FormModel.- Returns:
- a reference to an object derived from Validate, or
null
if no default Validate object has been set. - See Also:
setDefaultValidate(Validate)
,validate(Validate, Element, boolean, boolean)
,recalculate(boolean, Validate, boolean)
-
getExecute
public FormModel.Execute getExecute()
Gets the Execute associated with this FormModel. May be null.- Returns:
- the Execute.
-
getFocus
public FormField getFocus()
Gets the field that has focus for the FormModel.- Returns:
- the field that has focus.
-
getFormStateRemoved
public boolean getFormStateRemoved()
Determines if theformState
packet has been removed.- Returns:
true
if theformState
packet has been removed
-
getFriendlyName
public java.lang.String getFriendlyName(Element formNode)
Gets the friendly name (to use in user-facing communication) for a form node- Parameters:
formNode
- aFormSubform
,FormField
orFormExclGroup
to get a user-friendly name for.- Returns:
- a string containing a user-friendly name for the form node.
-
getHeadNS
public java.lang.String getHeadNS()
- Specified by:
getHeadNS
in classModel
- See Also:
Model.getHeadNS()
-
getHost
public HostPseudoModel getHost()
-
getOverlayDataMergeUsage
public boolean getOverlayDataMergeUsage()
Gets the OverlayDataMerge setting.- Returns:
- true if OverlayDataMergeUsage must occur
-
getPanelToMergeAgainst
public int getPanelToMergeAgainst()
Gets the panel to merge against.- Returns:
- the panel (second-level subform) to merge against
-
getPostMergeHandler
public FormModel.PostMergeHandler getPostMergeHandler()
Gets the callback method that is to be invoked after merge but before any initialization scripts are run.
-
getProtoList
public java.util.List<ProtoableNode> getProtoList()
Description copied from class:Model
Keep track of proto Nodes and 'use' tags for quick lookup later our- Overrides:
getProtoList
in classModel
- Returns:
- our list of protos
- See Also:
Model.getProtoList()
-
getRunScripts
public int getRunScripts()
Gets the runAt property that specifies where scripts should be executed (client, server or both). The default is both.- Returns:
- one of:
EnumAttr.RUNSCRIPTS_CLIENT
,EnumAttr.RUNSCRIPTS_SERVER
,EnumAttr.RUNSCRIPTS_BOTH
orEnumAttr.RUNSCRIPTS_NONE
- See Also:
setRunScripts(int)
-
getScriptTable
public ScriptTable getScriptTable()
- Overrides:
getScriptTable
in classModel
- See Also:
Model.getScriptTable()
-
getServerExchange
public FormModel.ServerExchange getServerExchange()
Gets the ServerExchange implementation associated with this FormModel.- Returns:
- a ServerExchange implementation, or
null
if no ServerExchange has been set. - See Also:
setServerExchange(ServerExchange)
-
getSubmit
public FormModel.Submit getSubmit()
Gets the Submit implementation associated with this FormModel.- Returns:
- a pointer to a class derived from Submit.
-
getSubmitURL
public java.lang.String getSubmitURL()
Gets the submit URL override for the top level subform. This will be used to determine if we are submitting to FormServer.- Returns:
- String, the submit URL.
-
getValidationsEnabled
public boolean getValidationsEnabled()
Determines whether validations are enabled.- Returns:
true
if validations are enabled.
-
importConnectionData
public void importConnectionData(java.lang.String strConnectionName)
-
importNode
public Element importNode(ProtoableNode templateNode, Element formParent, boolean bFull)
Imports a template node into this model, while resolving any global or dataRef fields. This will simply walk the template DOM and create a form node for each one it encounters. This will also set up the appropriate proto relationships- Parameters:
templateNode
- the template node to importformParent
- the parent we'll add the created form node toobFull
- if true, do merge and process the children.- Returns:
- the newly created Form node
-
initialize
public boolean initialize()
Fires the initialize event on all containers on the form, and fires the indexChange event on all subforms.- Returns:
true
if one or more events were dispatched.
-
initializeNewContentNodes
public boolean initializeNewContentNodes()
Initializes the new content nodes- Returns:
true
if one or more events were dispatched.
-
isCompatibleNS
public boolean isCompatibleNS(java.lang.String aNS)
Description copied from class:Model
Determine if a specified namespace string is compatible with the namespace of this model. Essentially this determines if the two namespaces are equivalent (though the strings that represent them may not be identical).- Overrides:
isCompatibleNS
in classModel
- Parameters:
aNS
- The namespace to compare.- See Also:
Model.isCompatibleNS(String)
-
merge
public void merge(boolean bEmptyMerge, boolean bAdjustData, boolean bInitialize, boolean bRestoreDeltas, boolean bForceRestore)
Merges the TemplateModel and the DataModel to create the FormModel. The first two parameters are implicitly used to callsetEmptyMerge(boolean)
andsetAdjustData(boolean)
respectively.- Parameters:
bEmptyMerge
- iftrue
then merge against an empty DataModel, iffalse
use the DataModel found in the AppModelbAdjustData
- iftrue
adjust the structure of the DataModel to match the structure of the TemplateModel; iffalse
don't modify the DataModel.bInitialize
- iftrue
all the initialize events will be fired; iffalse
no initialization is performedbRestoreDeltas
- iftrue
and if the restoreState property on the form's root subform is "auto" (the default is "manual"), all deltas are restored from the form packet. The locale attribute is always restored from the form packet, regardless of the value of this parameter.bForceRestore
- iftrue
, restore the state regardless of the the restoreState property on the form's root subform.
-
merge
public void merge(boolean bEmptyMerge, boolean bAdjustData, java.lang.String sConnectionName, boolean bInitialize, boolean bRestoreDeltas, boolean bForceRestore)
Merges the TemplateModel and the DataModel to create the FormModel.- Parameters:
bEmptyMerge
- iftrue
then merge against an empty DataModel, iffalse
use the DataModel found in the AppModelbAdjustData
- iftrue
, adjust the structure of the DataModel to match the structure of the TemplateModel; iffalse
, don't modify the DataModelsConnectionName
- if specified get all the data for the merge from the !connectionData.sConnectionName part of the DataModel. Also, use connect elements rather than bind elements of the TemplateModelbInitialize
- iftrue
, all the initialize events will be fired; iffalse
, no initialization is performedbRestoreDeltas
- iftrue
and if the restoreState property on the form's root subform is "auto" (the default is "manual"), all deltas are restored from the form packet. The locale attribute is always restored from the form packet, regardless of the value of this parameter.bForceRestore
- iftrue
, restore the state regardless of the the restoreState property on the form's root subform.
-
mergeOverlayData
public void mergeOverlayData(Node formNode, Node overlayData)
Merges overlayData with a subform (FormServer requirement)- Parameters:
formNode
- The subform to merge withoverlayData
- The data to merge with
-
normalizeNameSpaces
public void normalizeNameSpaces()
- Overrides:
normalizeNameSpaces
in classModel
- See Also:
Model.normalizeNameSpaces()
-
preSave
public void preSave(boolean bSaveXMLScript)
Description copied from class:Model
Prepares thisModel
to be saved. Any model maintenance that may have been deferred is performed to ensure that the serialized form of theModel
is correct. This method is called automatically before aModel
is serialized to a stream, so it does not normally need to be called directly. The exception is when aDocument
is saved usingDocument.saveAs(java.io.OutputStream, Node, DOMSaveOptions)
orDocument.saveXML(java.io.OutputStream, DOMSaveOptions)
.- Overrides:
preSave
in classModel
- See Also:
Model.preSave(boolean)
-
recalculate
public boolean recalculate(boolean bFullRecalculate, FormModel.Validate validate, boolean bIgnoreCalcEnabledFlag)
Executes calculation and validation scripts. After a merge operation, a full recalculate must be done to ensure that all calculations and validations are done using current data values. If data values are changed, this should be called to re-run the calculations. The FormModel tracks changes to data values, so recalculation efficiency can be improved by setting the bFullRecalculate parameter tofalse
to perform only those calculations and validations that are dependent on the changed data values.- Parameters:
bFullRecalculate
- iftrue
all calculations and validations are run. Iffalse
calculations and validations are run as needed (i.e. if values that the validate or calculate script are dependent on have changed since the last recalculate).validate
- an object derived from Validate. Ifnull
the default Validate is used, and if the default Validate is also null, no validations are performed.bIgnoreCalcEnabledFlag
- iftrue
the calculations will be performed even if they are disabled on the host.- Returns:
true
if any calculations were performed- See Also:
setDefaultValidate(Validate)
,getDefaultValidate()
-
registerNewEvents
public boolean registerNewEvents(boolean bAllow)
Helper function to permit the temporary update the mbRegisterNewEvents setting This should call registerNewEvents(false) before cloning any form node to orphaned nodes being registered with the event model- Parameters:
bAllow
- the new value of mbRegisterEvents- Returns:
- the old value of mbRegisterEvents
-
remerge
public void remerge()
Forces the remerging of the DataModel and TemplateModel to recreate this FormModel. This is equivalent to callingmerge(boolean, boolean, boolean, boolean, boolean)
, and specifyinggetEmptyMerge()
andgetAdjustData()
for the bEmptyMerge and bAdjustData parameters, and specifyingtrue
,false
,false
for the bInitialize, bRestoreDeltas and bForceRestore parameters.
-
remove
public void remove()
Removes a FormModel from its parents child list. Since a FormModel can't really exist outside of the context of an AppModel (i.e., because of connections between the form and data models), the form gets reset before it is removed.- Overrides:
remove
in classModel
- See Also:
Node.remove()
-
removeReferences
public void removeReferences(Node node)
Recursively unmaps node from any DataNode it is mapped to.- Overrides:
removeReferences
in classModel
- Parameters:
node
- the Node to be unmapped.
-
reset
public void reset()
Resets this FormModel to its initial state. All children are removed.
-
resetData
public void resetData(Obj container)
Resets a container to its template default value. If container is a field it will reset it. If container is a subform it will recursively reset all the containers it contains. If container isnull
then it will reset the root subform, and therefore all fields in the form.- Parameters:
container
- the container to be reset
-
resolveProtos
public void resolveProtos(boolean bForceExternalProtoResolve)
- Overrides:
resolveProtos
in classModel
-
restoreValidateDisableAll
public void restoreValidateDisableAll(Element formNode, Node delta)
restore the validate.disableAll property for a form node
-
setAdjustData
public void setAdjustData(boolean bAdjustData)
Sets whether the nextremerge()
operation will adjust the structure of the DataModel to match the structure of the TemplateModel.- Parameters:
bAdjustData
- iftrue
the nextremerge()
operation will adjust the structure of the DataModel to match the structure of the TemplateModel.- See Also:
getAdjustData()
,remerge()
,merge(boolean, boolean, boolean, boolean, boolean)
-
setAmbientLocale
public void setAmbientLocale(java.lang.String sLocale)
Set the ambient locale override for the top level subform. This will be used when resolving locales for fields and subforms. If a field/subform does not have a locale specified, then they will inherit it from their ancestory hierarchy.- Parameters:
sLocale
- the ambient locale (i.e. en_US).
-
setDefaultValidate
public void setDefaultValidate(FormModel.Validate validate)
Sets the default Validate. The default Validate is used during validation when validation is initiated by some method other thanrecalculate(boolean, Validate, boolean)
orvalidate(Validate, Element, boolean, boolean)
, or when validate or recalculate are called andnull
is passed to the validate parameter. If no Validate instance is available, then no validations are performed.- Parameters:
validate
- a reference to an object derived from Validate.- See Also:
getDefaultValidate()
-
setEmptyMerge
public void setEmptyMerge(boolean bEmptyMerge)
Sets whether the nextremerge()
operation will do an empty merge. This property is also set implicity from the first parameter of any call tomerge(boolean, boolean, boolean, boolean, boolean)
.
-
setExcludedActivities
public void setExcludedActivities(java.lang.String sExclude)
Sets event activites that are to be excluded from execution.- Parameters:
sExclude
- a space-delimited list of activities.
-
setExecute
public void setExecute(FormModel.Execute execute)
Associates an Execute object with this FormModel. This allows a client to execute a connection.- Parameters:
execute
- an object derived from Execute. It will be cloned, so the original can be discarded. May be null.
-
setFocus
public void setFocus(FormField field)
Lets the form model know which field has focus.- Parameters:
field
- the field that has focus.
-
setPostMergeHandler
public void setPostMergeHandler(FormModel.PostMergeHandler handler, java.lang.Object clientData)
Sets the callback method that is to be invoked after merge but before any initialize scripts are run.- Parameters:
handler
- the PostMergeHandler implementation to be invoked after merge but before any initialize scripts are run.clientData
- this value will be passed as the parameter toFormModel.PostMergeHandler.handlePostMerge(Object)
when the callback method is invoked.- See Also:
getPostMergeHandler()
-
setRunScripts
public void setRunScripts(int eRunAtSetting)
Sets the runAt property that specifies where scripts should be executed (client, server or both). The default is both.- Parameters:
eRunAtSetting
- one of:EnumAttr.RUNSCRIPTS_CLIENT
,EnumAttr.RUNSCRIPTS_SERVER
,EnumAttr.RUNSCRIPTS_BOTH
orEnumAttr.RUNSCRIPTS_NONE
- See Also:
getRunScripts()
-
setServerExchange
public void setServerExchange(FormModel.ServerExchange serverExchange)
Sets the ServerExchange implementation with this FormModel. This allows a form to invoke a web service.- Parameters:
serverExchange
- an implementation ServerExchange. It will be cloned, so the original can be discarded. May be null.- See Also:
getServerExchange()
-
setSubmit
public void setSubmit(FormModel.Submit submit)
Associates a Submit object with this FormModel. This allows a client to submit data to the server.- Parameters:
submit
- an object derived from Submit. It will be cloned, so the original can be discarded. May be null.
-
setSubmitURL
public void setSubmitURL(java.lang.String sSubmitURL)
Sets the submit URL from the config. This will be used to determine if we are submitting to FormServer.- Parameters:
sSubmitURL
- the submit URL.
-
setValidateBeforeExecute
public void setValidateBeforeExecute(boolean bValidate)
Sets the flag for performing validations before executing.- Parameters:
bValidate
- if true, validate before executing, don't validate otherwise.
-
setValidateBeforeSubmit
public void setValidateBeforeSubmit(boolean bValidate)
Sets the flag for performing validations before submitting.- Parameters:
bValidate
- if true, validate before submitting, don't validate otherwise.
-
wasIncrementalMerge
public boolean wasIncrementalMerge()
Returns true if the last merge was an incremental merge.
-
setDisableFormRemerge
public void setDisableFormRemerge(boolean bDisable)
Disable/enable calls to remerge()
-
getDisableFormRemerge
public boolean getDisableFormRemerge()
Disable/enable calls to remerge()
-
setGlobalConsumption
public void setGlobalConsumption(java.lang.Boolean bVal)
-
-