public class FormModel extends Model
Modifier and Type | Class and 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.
|
Model.DualDomModel, Model.Publisher
Element.DualDomNode, Element.ReplaceContent
Node.ChangeLogger
AttrIsDefault, AttrIsFragment, AttrIsTransient, CREATEACTION
CREATE_ALWAYS_NEW, CREATE_IF_NOT_EXIST, CREATE_MUST_NOT_EXIST, CREATE_REPLACE, gsXFANamespacePrefix
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
Constructor and Description |
---|
FormModel(Element parent,
Node prevSibling) |
Modifier and Type | Method and Description |
---|---|
void |
addUseHRefNode(Element useHRefNode)
Not supported on FormModel
|
void |
addUseNode(Element useNode)
add a new new node to the useNodeList
|
void |
clearFocus()
Resets the focus.
|
Node |
createNode(int eClassTag,
Element parent,
String aNodeName,
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(String sActivity,
Obj container)
Notifies event listeners that an event has occurred on a container.
|
void |
exportConnectionData(String strConnectionName,
String sDataDescriptionName) |
boolean |
getAdjustData()
Determines whether the next
remerge() operation will adjust the
structure of the DataModel to match the TemplateModel. |
String |
getAmbientLocale()
Gets the ambient locale override for the top level subform.
|
String |
getBaseNS() |
boolean |
getCalculationsEnabled()
Determines if calculations are enabled.
|
FormModel.Validate |
getDefaultValidate()
Gets the default Validate object.
|
Obj |
getDelta(Element node,
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 the
formState packet has been removed. |
String |
getFriendlyName(Element formNode)
Gets the friendly name (to use in user-facing communication) for a form
node
|
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.
|
List<ProtoableNode> |
getProtoList()
Keep track of proto Nodes and 'use' tags for quick lookup later our
|
int |
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.
|
String |
getSubmitURL()
Gets the submit URL override for the top level subform.
|
boolean |
getValidationsEnabled()
Determines whether validations are enabled.
|
void |
importConnectionData(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 nodes
|
boolean |
isCompatibleNS(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,
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 this
Model to be saved. |
boolean |
recalculate(boolean bFullRecalculate,
FormModel.Validate validate,
boolean bIgnoreCalcEnabledFlag)
Executes calculation and validation scripts.
|
static void |
recurseConnectOnNode(Node node,
String strConnectionName,
int eUsage,
FormModel.ConnectHandler handler,
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 model
|
void |
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 node
|
void |
setAdjustData(boolean bAdjustData)
Sets whether the next
remerge() operation will adjust the
structure of the DataModel to match the structure of the TemplateModel. |
void |
setAmbientLocale(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 next
remerge() operation will do an empty
merge. |
void |
setExcludedActivities(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(Boolean bVal) |
void |
setPostMergeHandler(FormModel.PostMergeHandler handler,
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(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.
|
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
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
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
addPeer, addPeeredNode, clearPeers, deafen, getClassAtom, getClassTag, getPeer, getScriptProperty, getScriptThis, invokeFunction, isDeaf, isMute, isSameClass, isSameClass, isSameClass, mute, peerRemoved, removePeer, removePeeredNode, setClass, setClassTag, setScriptProperty, unDeafen, unMute
public static FormModel getFormModel(AppModel appModel, boolean bCreateIfNotFound)
appModel
- the AppModel to searchbCreateIfNotFound
- if true
, and the FormModel does not exist,
then one will be created and returned; if false
and the FormModel does not exist, null
is
returnednull
if
not found and bCreateIfNotFound is false
.public static void recurseConnectOnNode(Node node, String strConnectionName, int eUsage, FormModel.ConnectHandler handler, Object handlerData)
public void addUseNode(Element useNode)
Model
addUseNode
in class Model
public void addUseHRefNode(Element useHRefNode)
addUseHRefNode
in class Model
public void clearFocus()
public int mergeMode()
public Node createNode(int eClassTag, Element parent, String aNodeName, String aNS, boolean bDoVersionCheck)
Model
createNode
in class Model
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.Model.createNode(int, Element, String, String, boolean)
public void createPanelOverlayData(int nPanel)
nPanel
- the panel to create the overlayData section forpublic boolean eventOccurred(String sActivity, Obj container)
sActivity
- the name of the eventcontainer
- the container on which the event occurstrue
if one or more events were dispatched.public void exportConnectionData(String strConnectionName, String sDataDescriptionName)
public boolean getAdjustData()
remerge()
operation will adjust the
structure of the DataModel to match the TemplateModel. The default value
is false
.true
if the next remerge()
operation will
adjust the structure of the DataModel to match the TemplateModel.remerge()
,
setAdjustData(boolean)
public String getAmbientLocale()
public String getBaseNS()
getBaseNS
in class Model
Model.getBaseNS()
public boolean getCalculationsEnabled()
true
if calculations are enabled.public FormModel.Validate getDefaultValidate()
validate(Validate, Element, boolean, boolean)
or
recalculate(boolean, Validate, boolean)
and null
is passed to the validate parameter. For example, the default Validate
object is used when validation is initiated by the
execValidate
scripting method of the FormModel.null
if no default Validate object has been set.setDefaultValidate(Validate)
,
validate(Validate, Element, boolean, boolean)
,
recalculate(boolean, Validate, boolean)
public FormModel.Execute getExecute()
public FormField getFocus()
public boolean getFormStateRemoved()
formState
packet has been removed.true
if the formState
packet has been removedpublic String getFriendlyName(Element formNode)
formNode
- a FormSubform
, FormField
or
FormExclGroup
to get a user-friendly name for.public String getHeadNS()
getHeadNS
in class Model
Model.getHeadNS()
public HostPseudoModel getHost()
public boolean getOverlayDataMergeUsage()
public int getPanelToMergeAgainst()
public FormModel.PostMergeHandler getPostMergeHandler()
public List<ProtoableNode> getProtoList()
Model
getProtoList
in class Model
Model.getProtoList()
public int getRunScripts()
EnumAttr.RUNSCRIPTS_CLIENT
,
EnumAttr.RUNSCRIPTS_SERVER
,
EnumAttr.RUNSCRIPTS_BOTH
or
EnumAttr.RUNSCRIPTS_NONE
setRunScripts(int)
public ScriptTable getScriptTable()
getScriptTable
in class Model
Model.getScriptTable()
public FormModel.ServerExchange getServerExchange()
null
if no
ServerExchange has been set.setServerExchange(ServerExchange)
public FormModel.Submit getSubmit()
public String getSubmitURL()
public boolean getValidationsEnabled()
true
if validations are enabled.public void importConnectionData(String strConnectionName)
public Element importNode(ProtoableNode templateNode, Element formParent, boolean bFull)
templateNode
- the template node to importformParent
- the parent we'll add the created form node toobFull
- if true, do merge and process the children.public boolean initialize()
true
if one or more events were dispatched.public boolean initializeNewContentNodes()
true
if one or more events were dispatched.public boolean isCompatibleNS(String aNS)
Model
isCompatibleNS
in class Model
aNS
- The namespace to compare.Model.isCompatibleNS(String)
public void merge(boolean bEmptyMerge, boolean bAdjustData, boolean bInitialize, boolean bRestoreDeltas, boolean bForceRestore)
setEmptyMerge(boolean)
and setAdjustData(boolean)
respectively.bEmptyMerge
- if true
then merge against an empty DataModel,
if false
use the DataModel found in the
AppModelbAdjustData
- if true
adjust the structure of the DataModel
to match the structure of the TemplateModel; if
false
don't modify the DataModel.bInitialize
- if true
all the initialize events will be
fired; if false
no initialization is performedbRestoreDeltas
- if true
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
- if true
, restore the state regardless of the the
restoreState property on the form's root subform.public void merge(boolean bEmptyMerge, boolean bAdjustData, String sConnectionName, boolean bInitialize, boolean bRestoreDeltas, boolean bForceRestore)
bEmptyMerge
- if true
then merge against an empty DataModel, if
false
use the DataModel found in the AppModelbAdjustData
- if true
, adjust the structure of the DataModel to
match the structure of the TemplateModel; if
false
, 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
- if true
, all the initialize events will be fired;
if false
, no initialization is performedbRestoreDeltas
- if true
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
- if true
, restore the state regardless of the the
restoreState property on the form's root subform.public void mergeOverlayData(Node formNode, Node overlayData)
formNode
- The subform to merge withoverlayData
- The data to merge withpublic void normalizeNameSpaces()
normalizeNameSpaces
in class Model
Model.normalizeNameSpaces()
public void preSave(boolean bSaveXMLScript)
Model
Model
to be saved. Any model maintenance that
may have been deferred is performed to ensure that the serialized form of
the Model
is correct. This method is called automatically
before a Model
is serialized to a stream, so it does not
normally need to be called directly. The exception is when a
Document
is saved using
Document.saveAs(java.io.OutputStream, Node, DOMSaveOptions)
or
Document.saveXML(java.io.OutputStream, DOMSaveOptions)
.preSave
in class Model
Model.preSave(boolean)
public boolean recalculate(boolean bFullRecalculate, FormModel.Validate validate, boolean bIgnoreCalcEnabledFlag)
false
to perform only those calculations and validations
that are dependent on the changed data values.bFullRecalculate
- if true
all calculations and validations are
run. If false
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. If null
the
default Validate is used, and if the default Validate is also null,
no validations are performed.bIgnoreCalcEnabledFlag
- if true
the calculations will be performed even
if they are disabled on the host.true
if any calculations were performedsetDefaultValidate(Validate)
,
getDefaultValidate()
public boolean registerNewEvents(boolean bAllow)
bAllow
- the new value of mbRegisterEventspublic void remerge()
merge(boolean, boolean, boolean, boolean, boolean)
, and
specifying getEmptyMerge()
and getAdjustData()
for the
bEmptyMerge and bAdjustData parameters, and specifying true
,
false
, false
for the bInitialize,
bRestoreDeltas and bForceRestore parameters.public void remove()
remove
in class Model
Node.remove()
public void removeReferences(Node node)
removeReferences
in class Model
node
- the Node to be unmapped.public void reset()
public void resetData(Obj container)
null
then it
will reset the root subform, and therefore all fields in the form.container
- the container to be resetpublic void resolveProtos(boolean bForceExternalProtoResolve)
resolveProtos
in class Model
public void restoreValidateDisableAll(Element formNode, Node delta)
public void setAdjustData(boolean bAdjustData)
remerge()
operation will adjust the
structure of the DataModel to match the structure of the TemplateModel.bAdjustData
- if true
the next remerge()
operation
will adjust the structure of the DataModel to match the
structure of the TemplateModel.getAdjustData()
,
remerge()
,
merge(boolean, boolean, boolean, boolean, boolean)
public void setAmbientLocale(String sLocale)
sLocale
- the ambient locale (i.e. en_US).public void setDefaultValidate(FormModel.Validate validate)
recalculate(boolean, Validate, boolean)
or
validate(Validate, Element, boolean, boolean)
, or when validate or recalculate
are called and null
is passed to the validate parameter.
If no Validate instance is available, then no validations are performed.validate
- a reference to an object derived from Validate.getDefaultValidate()
public void setEmptyMerge(boolean bEmptyMerge)
remerge()
operation will do an empty
merge. This property is also set implicity from the first parameter of
any call to merge(boolean, boolean, boolean, boolean, boolean)
.public void setExcludedActivities(String sExclude)
sExclude
- a space-delimited list of activities.public void setExecute(FormModel.Execute execute)
execute
- an object derived from Execute. It will be cloned,
so the original can be discarded. May be null.public void setFocus(FormField field)
field
- the field that has focus.public void setPostMergeHandler(FormModel.PostMergeHandler handler, Object clientData)
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 to FormModel.PostMergeHandler.handlePostMerge(Object)
when the callback method is invoked.getPostMergeHandler()
public void setRunScripts(int eRunAtSetting)
eRunAtSetting
- one of: EnumAttr.RUNSCRIPTS_CLIENT
,
EnumAttr.RUNSCRIPTS_SERVER
,
EnumAttr.RUNSCRIPTS_BOTH
or
EnumAttr.RUNSCRIPTS_NONE
getRunScripts()
public void setServerExchange(FormModel.ServerExchange serverExchange)
serverExchange
- an implementation ServerExchange. It will be cloned, so the
original can be discarded. May be null.getServerExchange()
public void setSubmit(FormModel.Submit submit)
submit
- an object derived from Submit. It will be cloned,
so the original can be discarded. May be null.public void setSubmitURL(String sSubmitURL)
sSubmitURL
- the submit URL.public void setValidateBeforeExecute(boolean bValidate)
bValidate
- if true, validate before executing, don't validate otherwise.public void setValidateBeforeSubmit(boolean bValidate)
bValidate
- if true, validate before submitting, don't validate otherwise.public boolean wasIncrementalMerge()
public void setDisableFormRemerge(boolean bDisable)
public boolean getDisableFormRemerge()
public void setGlobalConsumption(Boolean bVal)
Copyright © 2010 - 2020 Adobe. All Rights Reserved