Package com.adobe.xfa
Class AppModel
- java.lang.Object
-
- com.adobe.xfa.Obj
-
- com.adobe.xfa.Node
-
- com.adobe.xfa.Element
-
- com.adobe.xfa.Model
-
- com.adobe.xfa.AppModel
-
- All Implemented Interfaces:
Element.DualDomNode
,Model.DualDomModel
,Peer
public final class AppModel extends Model implements Model.DualDomModel
A class to represent the top level element in the XFA object model. All application-specific models are represented as sub-models of this one.Example: xfa <- this is the AppModel datasets <- this is the XFADataModel data <- this is $data in SOM expressions (a datagroup)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AppModel.LegacyMask
-
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
-
-
Constructor Summary
Constructors Constructor Description AppModel(LogMessenger messenger)
Instantiates an app model with the given messenger.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addFactory(ModelFactory factory)
Adds a model factory to the list of registered factories.void
addPseudoModel(java.lang.String sShortCutName, Obj obj)
Makes an object visible to the global scripting namespace.void
addScriptHandler(ScriptHandler handler)
Adds (registers) a script handler for this app model.void
appendChild(Node newChild, boolean bValidate)
Appends the given child to this element.boolean
bumpVersionOnRichTextLoad()
Gets a boolean which indicates whether the XFA version should be bumped when loading rich text containing features not supported by the form's current version.void
bumpVersionOnRichTextLoad(boolean bBumpVersion)
Sets a boolean which indicates whether the XFA version should be bumped when loading rich text containing features not supported by the form's current version.void
clearErrorList()
Clears this app model's current list of errors.void
clearScriptingContexts()
Clears any scripting contexts associated with all script handlers previously registered with this app model.Element
createElement(Element parent, Node prevSibling, java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes, int lineNumber, java.lang.String fileName)
Creates an element with the given parent, sibling, namespace uri, local name and SAX attributes.Node
createNode(int eTag, Element parent, java.lang.String aName, java.lang.String aNS, boolean bDoVersionCheck)
Create an element with the given tag, parent, name and uri.DependencyTracker
dependencyTracker()
void
dependencyTracker(DependencyTracker oDependencyTracker)
java.util.List<ModelFactory>
factories()
Returns the list of registered factories.boolean
getAllowThirdPartyXml()
Attribute
getAttribute(int eAttributeTag)
get an attribute value, will return the default attribute value if none exist NON validatingjava.lang.String
getBaseNS()
ScriptDynamicPropObj
getDynamicScriptProp(java.lang.String sPropertyName, boolean bPropertyOverride, boolean bPeek)
java.util.List<Element>
getErrorContextList()
Gets all the context nodes that correspond to entries in the error list.java.util.List<ExFull>
getErrorList()
Gets all the errors that have been generated by this app model since the last method call to clear the error list.EventManager
getEventManager()
the EventManager manages xfe:script scripts and their associated events (ie.boolean
getExternalProtosAreTransient()
Determines whether external proto fragments are marked as transient when they are resolved.java.util.List<java.lang.String>
getFragmentSearchPath()
return the fragment search path.java.lang.String
getHeadNS()
HrefHandler
getHrefHandler()
Gets the currentHrefService
handler.boolean
getIsFragmentDoc()
indicate whether this AppModel is used as a source for template fragmentsboolean
getLegacySetting(AppModel.LegacyMask nLegacyFlag)
Gets the boolean value of a particular legacy setting.LogMessenger
getLogMessenger()
Get the XFALogMessenger object.The XFALogMessenger object can be used to add or delete to the XFALogMessageHandlers active with the AppModel.java.lang.String
getNS()
Gets this element's namespace.int
getOutputBelow()
java.lang.String
getPacketList()
Gets the list of XFA packets to filter.Node
getPreviousXMLSibling()
Gets this node's previous XML sibling.int
getSchemaType(int eTag)
java.util.List<ScriptHandler>
getScriptHandlers()
Gets the list of script handlers registered with this app model.ScriptTable
getScriptTable()
int
getSourceBelow()
int
getVersionRestriction()
boolean
getWillDirty()
static boolean
includePacket(java.lang.String aPacketName, java.lang.String sInList)
Determines if a packet should be included based on a packet list.void
insertChild(Node newChild, Node refChild, boolean bValidate)
Inserts a child before a specific child in the child list.boolean
isValidAttr(int eTag, boolean bReport, java.lang.String value)
Determine if a specified attribute tag is valid for this node.boolean
isValidChild(int eTag, int nError, boolean bBeforeInsert, boolean bOccurrenceErrorOnly)
static boolean
isXFANode(Element node)
Is the given element the root node of an XDP document.boolean
isXFANode(java.lang.String uri, java.lang.String localName, java.lang.String qName)
Is this element the root node of an XDP document.Obj
lookupPseudoModel(java.lang.String sShortCutName)
Looks up a scripting object registered with the global scripting namespace.Element
newDOM()
Creates a new node hierarchy of a new XFA DOM.void
preSave(boolean bSaveXMLScript)
Prepares thisModel
to be saved.boolean
publish(Model.Publisher publisher)
Publish the model to an Application Storage facility.boolean
ready(boolean bForced)
Indicates that the model is ready.void
removePseudoModel(java.lang.String sShortCutName)
Removes a scripting object shortcut from the global scripting namespace.void
setAttribute(Attribute oValue, int eAttributeTag)
Sets the value of an attributevoid
setExternalProtosAreTransient(boolean bExternalProtosAreTransient)
Determines whether external proto fragments are marked as transient when they are resolved.void
setFragmentSearchPath(java.util.List<java.lang.String> oSearchPath)
Set the fragment search path.void
setHrefHandler(HrefHandler handler)
Sets theHrefService
handler associated with thisAppModel
.void
setIsFragmentDoc(boolean bIsFragmentDoc)
flag this AppModel as being a source for template fragments (or not)void
setPacketHandler(PacketHandler oPacketHandler, java.lang.Object oHandlerData)
Sets this app model's packet handler.void
setPacketList(java.lang.String sPackets)
Sets the list of XFA packets to filter.void
setResolveAllExternalProtos(boolean bResolveAllExternalProtos)
void
setSourceAbove(int eSouceAbove)
void
setSourceBelow(int eSouceBelow)
void
setVersionRestriction(int nVersion, int eOutputBelow)
void
setWillDirty(boolean bWillDirty)
boolean
updateOriginalVersion()
Get a boolean that indicates if the originalXFAVersion processing instruction should be updated when each XFA Model child is saved.void
updateOriginalVersion(boolean bUpdate)
Set a boolean that indicates if the originalXFAVersion processing instruction should be updated when each XFA Model child is saved.-
Methods inherited from class com.adobe.xfa.Model
addErrorList, addUseHRefNode, addUseNode, addXMLLoadErrorContext, allowUpdates, checkforCompatibleNS, clone, createElement, createElement, createElement, createElement, createTextNode, createTextNode, doAttributeCleanup, getAliasNode, getAppModel, getAppModelIsTransient, getCachedLocale, getContext, getCurrentVersion, getDelta, getDeltas, getDocument, getGenerator, getHeadVersion, getIDValueMap, getName, getNeedsNSNormalize, getNode, getOriginalVersion, getOriginalVersionNode, getOriginalXFAVersion, getProtoList, getSchema, getVersion, getXmlPeer, isCompatibleNS, isContainer, isLoading, isVersionCompatible, loadNode, loadRootAttributes, loadSpecialAttribute, loadSpecialNode, modelCleanup, nodeCleanup, normalizeNameSpaces, normalizeNameSpaces, normalizeNameSpaces, preLoadNode, remapTag, remove, removeLastError, removeReferences, resolveNodes, resolveProtos, 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, appendPI, appendPI, assignNode, clone, connectPeerToDocument, constructKey, constructKeys, copyContent, defaultAttribute, defaultElement, defaultElement, establishID, evaluate, explodeQName, findAttr, findSchemaAttr, foundBadAttribute, foundBadAttribute, getAll, getAtom, getAttr, 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, getScriptMethodInfo, getSibling, getText, getXFAChild, getXMLChild, getXMLName, getXPath, getXsiNilAttribute, inhibitPrettyPrint, inhibitPrettyPrint, isFragment, isHidden, isHidden, isIndexed, isInstalledLocaleAmbient, isLeaf, isNameSpaceAttr, isPropertySpecified, isPropertySpecified, isPropertyValid, isSpecified, isSpecified, isSpecified, isTransient, isTransparent, 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, 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, getPrivateName, getPropName, getSOMExpression, getSOMExpression, getSomName, getUniqueSOMName, 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, 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
-
-
-
-
Field Detail
-
XFA_LEGACY_POSITIONING
public static final AppModel.LegacyMask XFA_LEGACY_POSITIONING
-
XFA_LEGACY_EVENTMODEL
public static final AppModel.LegacyMask XFA_LEGACY_EVENTMODEL
-
XFA_LEGACY_PLUSPRINT
public static final AppModel.LegacyMask XFA_LEGACY_PLUSPRINT
-
XFA_LEGACY_PERMISSIONS
public static final AppModel.LegacyMask XFA_LEGACY_PERMISSIONS
-
XFA_LEGACY_CALCOVERRIDE
public static final AppModel.LegacyMask XFA_LEGACY_CALCOVERRIDE
-
XFA_LEGACY_RENDERING
public static final AppModel.LegacyMask XFA_LEGACY_RENDERING
-
XFA_LEGACY_V26_HIDDENPOSITIONED
public static final AppModel.LegacyMask XFA_LEGACY_V26_HIDDENPOSITIONED
-
XFA_LEGACY_V27_MULTIRECORDCONTEXTCACHE
public static final AppModel.LegacyMask XFA_LEGACY_V27_MULTIRECORDCONTEXTCACHE
-
XFA_LEGACY_V27_LAYOUT
public static final AppModel.LegacyMask XFA_LEGACY_V27_LAYOUT
-
XFA_LEGACY_V27_SCRIPTING
public static final AppModel.LegacyMask XFA_LEGACY_V27_SCRIPTING
-
XFA_LEGACY_V27_EVENTMODEL
public static final AppModel.LegacyMask XFA_LEGACY_V27_EVENTMODEL
-
XFA_LEGACY_V27_TRAVERSALORDER
public static final AppModel.LegacyMask XFA_LEGACY_V27_TRAVERSALORDER
-
XFA_LEGACY_V27_XHTMLVERSIONPROCESSING
public static final AppModel.LegacyMask XFA_LEGACY_V27_XHTMLVERSIONPROCESSING
-
XFA_LEGACY_V27_ACCESSIBILITY
public static final AppModel.LegacyMask XFA_LEGACY_V27_ACCESSIBILITY
-
XFA_LEGACY_V28_LAYOUT
public static final AppModel.LegacyMask XFA_LEGACY_V28_LAYOUT
-
XFA_LEGACY_V28_SCRIPTING
public static final AppModel.LegacyMask XFA_LEGACY_V28_SCRIPTING
-
XFA_LEGACY_V29_LAYOUT
public static final AppModel.LegacyMask XFA_LEGACY_V29_LAYOUT
-
XFA_LEGACY_V29_SCRIPTING
public static final AppModel.LegacyMask XFA_LEGACY_V29_SCRIPTING
-
XFA_LEGACY_V30_LAYOUT
public static final AppModel.LegacyMask XFA_LEGACY_V30_LAYOUT
-
XFA_LEGACY_V30_SCRIPTING
public static final AppModel.LegacyMask XFA_LEGACY_V30_SCRIPTING
-
XFA_LEGACY_V29_TRAVERSALORDER
public static final AppModel.LegacyMask XFA_LEGACY_V29_TRAVERSALORDER
-
XFA_PATCH_B_02518
public static final AppModel.LegacyMask XFA_PATCH_B_02518
-
XFA_LEGACY_V29_FIELDPRESENCE
public static final AppModel.LegacyMask XFA_LEGACY_V29_FIELDPRESENCE
-
XFA_PATCH_W_2393121
public static final AppModel.LegacyMask XFA_PATCH_W_2393121
-
XFA_PATCH_W_2447677
public static final AppModel.LegacyMask XFA_PATCH_W_2447677
-
XFA_LEGACY_V32_SCRIPTING
public static final AppModel.LegacyMask XFA_LEGACY_V32_SCRIPTING
-
XFA_LEGACY_V31_LAYOUT
public static final AppModel.LegacyMask XFA_LEGACY_V31_LAYOUT
-
XFA_LEGACY_V32_LAYOUT
public static final AppModel.LegacyMask XFA_LEGACY_V32_LAYOUT
-
XFA_LEGACY_V32_RENDERING
public static final AppModel.LegacyMask XFA_LEGACY_V32_RENDERING
-
XFA_LEGACY_V32_CANONICALIZATION
public static final AppModel.LegacyMask XFA_LEGACY_V32_CANONICALIZATION
-
XFA_PATCH_W_2757988
public static final AppModel.LegacyMask XFA_PATCH_W_2757988
-
XFA_LEGACY_35_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_35_DEFAULT
-
XFA_LEGACY_HEAD_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_HEAD_DEFAULT
-
XFA_LEGACY_34_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_34_DEFAULT
-
XFA_LEGACY_33_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_33_DEFAULT
-
XFA_LEGACY_32_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_32_DEFAULT
-
XFA_LEGACY_31_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_31_DEFAULT
-
XFA_LEGACY_30_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_30_DEFAULT
-
XFA_LEGACY_29_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_29_DEFAULT
-
XFA_LEGACY_28_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_28_DEFAULT
-
XFA_LEGACY_27_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_27_DEFAULT
-
XFA_LEGACY_26_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_26_DEFAULT
-
XFA_LEGACY_25_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_25_DEFAULT
-
XFA_LEGACY_24_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_24_DEFAULT
-
XFA_LEGACY_23_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_23_DEFAULT
-
XFA_LEGACY_22_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_22_DEFAULT
-
XFA_LEGACY_21_DEFAULT
public static final AppModel.LegacyMask XFA_LEGACY_21_DEFAULT
-
XFA_LEGACY_21_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_21_DEPRECATED
-
XFA_LEGACY_22_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_22_DEPRECATED
-
XFA_LEGACY_23_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_23_DEPRECATED
-
XFA_LEGACY_24_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_24_DEPRECATED
-
XFA_LEGACY_25_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_25_DEPRECATED
-
XFA_LEGACY_26_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_26_DEPRECATED
-
XFA_LEGACY_27_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_27_DEPRECATED
-
XFA_LEGACY_28_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_28_DEPRECATED
-
XFA_LEGACY_29_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_29_DEPRECATED
-
XFA_LEGACY_30_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_30_DEPRECATED
-
XFA_LEGACY_31_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_31_DEPRECATED
-
XFA_LEGACY_32_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_32_DEPRECATED
-
XFA_LEGACY_33_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_33_DEPRECATED
-
XFA_LEGACY_34_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_34_DEPRECATED
-
XFA_LEGACY_35_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_35_DEPRECATED
-
XFA_LEGACY_HEAD_DEPRECATED
public static final AppModel.LegacyMask XFA_LEGACY_HEAD_DEPRECATED
-
-
Constructor Detail
-
AppModel
public AppModel(LogMessenger messenger)
Instantiates an app model with the given messenger.- Parameters:
messenger
- a log messenger, if any.
-
-
Method Detail
-
includePacket
public static boolean includePacket(java.lang.String aPacketName, java.lang.String sInList)
Determines if a packet should be included based on a packet list.- Parameters:
aPacketName
- the packet to test forsInList
- the list of packets- Returns:
- boolean -- in or out.
-
addFactory
public void addFactory(ModelFactory factory)
Adds a model factory to the list of registered factories.Factories are added for models that are to be loaded with a full implementation. If no model is explicitly added, a default model with minimal functionality will be used.
- Parameters:
factory
- the factory to add.
-
addPseudoModel
public void addPseudoModel(java.lang.String sShortCutName, Obj obj)
Makes an object visible to the global scripting namespace. Theobj
parameter will typically be derived fromPseudoModel
. The shortcut name must start with a dollar sign ($). For example, an application might use this method to add an object derived fromHostPseudoModel
and register it with the name$host
.- Parameters:
sShortCutName
- the name of the scripting object.obj
- the scriptable object- See Also:
removePseudoModel(String)
-
addScriptHandler
public void addScriptHandler(ScriptHandler handler)
Adds (registers) a script handler for this app model. Script handlers are added to provide scripting support for various languages.- Parameters:
handler
- the script handler to add.
-
clearScriptingContexts
public void clearScriptingContexts()
Clears any scripting contexts associated with all script handlers previously registered with this app model.- See Also:
addScriptHandler(ScriptHandler)
-
bumpVersionOnRichTextLoad
public boolean bumpVersionOnRichTextLoad()
Gets a boolean which indicates whether the XFA version should be bumped when loading rich text containing features not supported by the form's current version. This isfalse
by default. Only Designer is expected to make use of this flag.- Returns:
true
if version bumping is enabled for rich text loading.
-
bumpVersionOnRichTextLoad
public void bumpVersionOnRichTextLoad(boolean bBumpVersion)
Sets a boolean which indicates whether the XFA version should be bumped when loading rich text containing features not supported by the form's current version. This isfalse
by default. Only Designer is expected to make use of this flag- Parameters:
bBumpVersion
-true
to enable version bumping when loading rich text.
-
appendChild
public void appendChild(Node newChild, boolean bValidate)
Description copied from class:Element
Appends the given child to this element.- Overrides:
appendChild
in classElement
- Parameters:
newChild
- the child node being appended.bValidate
- when true, ensures the given child is valid per the model's schema and throws anExFull
if not.- See Also:
Element.appendChild(Node, boolean)
-
clearErrorList
public void clearErrorList()
Clears this app model's current list of errors.- Overrides:
clearErrorList
in classModel
- See Also:
Model.clearErrorList()
-
createNode
public Node createNode(int eTag, Element parent, java.lang.String aName, 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:
eTag
- the element's tag.parent
- the element's parent.aName
- 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)
-
createElement
public Element createElement(Element parent, Node prevSibling, java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes, int lineNumber, java.lang.String fileName)
Description copied from class:Model
Creates an element with the given parent, sibling, namespace uri, local name and SAX attributes.- Overrides:
createElement
in classModel
- Parameters:
parent
- the element's parent, if any.prevSibling
- the element's previous sibling, if any.uri
- the element's namespace. This string must be interned.localName
- the element's name. This string must be interned.qName
- the element's qualified name. This string must be interned.attributes
- the element's (SAX) attribute definitions.- Returns:
- a new element conformant to our schema.
- See Also:
Model.createElement(Element, Node, String, String, String, Attributes, int, String)
-
dependencyTracker
public DependencyTracker dependencyTracker()
-
dependencyTracker
public void dependencyTracker(DependencyTracker oDependencyTracker)
-
getAllowThirdPartyXml
public boolean getAllowThirdPartyXml()
-
factories
public java.util.List<ModelFactory> factories()
Returns the list of registered factories.- Returns:
- a list of Model factories.
-
getAttribute
public Attribute getAttribute(int eAttributeTag)
get an attribute value, will return the default attribute value if none exist NON validating- Overrides:
getAttribute
in classElement
-
getDynamicScriptProp
public ScriptDynamicPropObj getDynamicScriptProp(java.lang.String sPropertyName, boolean bPropertyOverride, boolean bPeek)
-
getErrorContextList
public java.util.List<Element> getErrorContextList()
Gets all the context nodes that correspond to entries in the error list.- Overrides:
getErrorContextList
in classModel
- Returns:
- A list of Element objects where the load discovered a problem.
-
getErrorList
public java.util.List<ExFull> getErrorList()
Gets all the errors that have been generated by this app model since the last method call to clear the error list. This involves getting the error lists for all the descendant models and concatenating them together.- Overrides:
getErrorList
in classModel
- Returns:
- the current list of
ExFull
error objects.
-
getEventManager
public EventManager getEventManager()
the EventManager manages xfe:script scripts and their associated events (ie. events that cause the scripts to execute)- Overrides:
getEventManager
in classModel
-
getExternalProtosAreTransient
public boolean getExternalProtosAreTransient()
Determines whether external proto fragments are marked as transient when they are resolved. When proto fragments are marked as transient, theDOMSaveOptions.setSaveFragment(boolean)
setting controls whether resolved fragments are included when the model is serialized. The default isfalse
which means that resolved fragments are always serialized. This flag is only relevant ifsetHrefHandler(HrefHandler)
has been called.- Returns:
true
if external fragments should be transient (i.e. left as references when serialized), orfalse
if they should be non-transient (i.e. expanded when serialized).- See Also:
setExternalProtosAreTransient(boolean)
-
getFragmentSearchPath
public java.util.List<java.lang.String> getFragmentSearchPath()
return the fragment search path.- Returns:
- an array of File objects
-
getHrefHandler
public HrefHandler getHrefHandler()
Gets the currentHrefService
handler.- Returns:
- the
HrefService
handler associated with theAppModel
.
-
getIsFragmentDoc
public boolean getIsFragmentDoc()
indicate whether this AppModel is used as a source for template fragments- Returns:
- true if a fragment source
-
getLegacySetting
public boolean getLegacySetting(AppModel.LegacyMask nLegacyFlag)
Description copied from class:Model
Gets the boolean value of a particular legacy setting.- Overrides:
getLegacySetting
in classModel
- Parameters:
nLegacyFlag
- the specific legacy setting to check- Returns:
true
if the legacy setting is set, or is the default the original version.- See Also:
Model.getLegacySetting(AppModel.LegacyMask)
-
getLogMessenger
public LogMessenger getLogMessenger()
Get the XFALogMessenger object.The XFALogMessenger object can be used to add or delete to the XFALogMessageHandlers active with the AppModel.- Overrides:
getLogMessenger
in classModel
- Returns:
- The log messenger.
-
getNS
public java.lang.String getNS()
Description copied from class:Element
Gets this element's namespace.- Overrides:
getNS
in classModel
- Returns:
- the namespace URI.
- See Also:
Element.getNS()
-
getOutputBelow
public int getOutputBelow()
-
getPacketList
public java.lang.String getPacketList()
Gets the list of XFA packets to filter.- Returns:
- the packet list.
-
getPreviousXMLSibling
public Node getPreviousXMLSibling()
Description copied from class:Node
Gets this node's previous XML sibling. Note that this may be a fairly expensive operation, as it involves iterating through the parent's children looking for this node.- Overrides:
getPreviousXMLSibling
in classNode
- Returns:
- the previous sibling, or null, if none.
- See Also:
Node.getPreviousXMLSibling()
-
getSchemaType
public int getSchemaType(int eTag)
- Overrides:
getSchemaType
in classElement
-
getScriptHandlers
public java.util.List<ScriptHandler> getScriptHandlers()
Gets the list of script handlers registered with this app model.- Returns:
- the list of script handlers.
-
getScriptTable
public ScriptTable getScriptTable()
- Overrides:
getScriptTable
in classModel
-
getSourceBelow
public int getSourceBelow()
- Overrides:
getSourceBelow
in classModel
- See Also:
Model.getSourceBelow()
-
getVersionRestriction
public int getVersionRestriction()
-
getWillDirty
public boolean getWillDirty()
- Overrides:
getWillDirty
in classNode
-
insertChild
public void insertChild(Node newChild, Node refChild, boolean bValidate)
Description copied from class:Element
Inserts a child before a specific child in the child list.- Overrides:
insertChild
in classElement
- Parameters:
newChild
- the child to be insertedrefChild
- the child to insert beforebValidate
- if true, validate the insertion- See Also:
Element.insertChild(Node, Node, boolean)
-
isValidAttr
public boolean isValidAttr(int eTag, boolean bReport, java.lang.String value)
Description copied from class:Element
Determine if a specified attribute tag is valid for this node.- Overrides:
isValidAttr
in classElement
- Parameters:
eTag
- the XFA tag to check- Returns:
- true if valid.
- See Also:
Element.isValidAttr(int, boolean, String)
-
isValidChild
public boolean isValidChild(int eTag, int nError, boolean bBeforeInsert, boolean bOccurrenceErrorOnly)
- Overrides:
isValidChild
in classElement
- Parameters:
eTag
- the class tag of the node that will be or has been appendedbBeforeInsert
- iftrue
, then the child has not yet been inserted into the child list of this element.- Returns:
true
if eTag is a valid child.- See Also:
Element.isValidChild(int, int, boolean, boolean)
-
isXFANode
public boolean isXFANode(java.lang.String uri, java.lang.String localName, java.lang.String qName)
Is this element the root node of an XDP document.- Parameters:
uri
- the namespace of this elementlocalName
- the local name of this elementqName
- the qualified name of this element- Returns:
- boolean true if this is the root node of XDP
-
isXFANode
public static boolean isXFANode(Element node)
Is the given element the root node of an XDP document.
-
lookupPseudoModel
public Obj lookupPseudoModel(java.lang.String sShortCutName)
Looks up a scripting object registered with the global scripting namespace.- Parameters:
sShortCutName
- the scripting shortcut name.- Returns:
- a scripting object (typically derived from
PseudoModel
), ornull
if not found.
-
newDOM
public Element newDOM()
Creates a new node hierarchy of a new XFA DOM. The returned node will always be theAppModel
. The children that this node has depends on which factories have been added viaaddFactory()
. Each installed factory will create some default node or tree of nodes under theAppModel
node.- Returns:
- The root node of the new hierarchy.
-
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:
Node.preSave(boolean)
-
ready
public boolean ready(boolean bForced)
Description copied from class:Model
Indicates that the model is ready. This causes the "ready" event to be issued so that script waiting on that event will execute. When applied to anAppModel
, this call recursively callsready()
on each child model (as a convenience). Some applications may choose to call theready()
on each model individually. Callingready()
a second time on a given model has no effect.
-
publish
public boolean publish(Model.Publisher publisher)
Description copied from class:Model
Publish the model to an Application Storage facility. This involves updating all external references (such as image hrefs) such that they point to local collateral. The actual details of this are left up to the implementer of the class derived from Model.Publisher specified in the oPublisher parameter. What publish() itself does is recursively traverse the tree structure of the model. When an external reference is encountered (for example, the href attribute of an image node), the updateExternalRef() method is called. The node, attribute identifier and original value of the external reference are passed to updateExternalRef(). The derived class should copy the collateral to the application storage area (if desired), and should update the value of sExternalRefValue to indicate the new value for the external reference (probably some sort of relative path). If an external reference stored as an element value (for example, a uri node) is encountered, updateExternalRef is called with node and the eAttribute arg is set to XFA.TEXTNODETAG. Two or more instances of an identical external reference result in only one call to updateExternalRef(), because returned values are cached and reused. If called on the AppModel, this method recursively calls publish on all contained models.- Overrides:
publish
in classModel
- Parameters:
publisher
- an instance of a class derived from TemplateModel.Publisher.- See Also:
Model.publish(com.adobe.xfa.Model.Publisher)
-
removePseudoModel
public void removePseudoModel(java.lang.String sShortCutName)
Removes a scripting object shortcut from the global scripting namespace.- Parameters:
sShortCutName
- the shortcut name of a scripting object- See Also:
addPseudoModel(String, Obj)
-
setAttribute
public void setAttribute(Attribute oValue, int eAttributeTag)
Sets the value of an attribute- Overrides:
setAttribute
in classElement
- Parameters:
oValue
- the attribute.eAttributeTag
- The XFA tag name of the attribute being set.
-
setExternalProtosAreTransient
public void setExternalProtosAreTransient(boolean bExternalProtosAreTransient)
Determines whether external proto fragments are marked as transient when they are resolved. When proto fragments are marked as transient, theDOMSaveOptions.setSaveFragment(boolean)
setting controls whether resolved fragments are included when the model is serialized. The default isfalse
which means that resolved fragments are always serialized. This flag is only relevant ifsetHrefHandler(HrefHandler)
has been called.- Parameters:
bExternalProtosAreTransient
-true
if external fragments should be transient (i.e. left as references when serialized), orfalse
if they should be non-transient (i.e. expanded when serialized).- See Also:
getExternalProtosAreTransient()
,setHrefHandler(HrefHandler)
-
setFragmentSearchPath
public void setFragmentSearchPath(java.util.List<java.lang.String> oSearchPath)
Set the fragment search path.- Parameters:
oSearchPath
- fragment search path
-
setHrefHandler
public void setHrefHandler(HrefHandler handler)
Sets theHrefService
handler associated with thisAppModel
.- Parameters:
handler
- theHrefService
handler.The href service handles the URL resolution and fragment loading for all usehref attribute values on
ProtoableNode
s.
-
setIsFragmentDoc
public void setIsFragmentDoc(boolean bIsFragmentDoc)
flag this AppModel as being a source for template fragments (or not)- Parameters:
bIsFragmentDoc
- true if this is a source for template fragments.
-
setPacketHandler
public void setPacketHandler(PacketHandler oPacketHandler, java.lang.Object oHandlerData)
Sets this app model's packet handler.- Parameters:
oPacketHandler
- a packet handler.oHandlerData
- some handler data.
-
setPacketList
public void setPacketList(java.lang.String sPackets)
Sets the list of XFA packets to filter.- Parameters:
sPackets
- the packet list.
-
setResolveAllExternalProtos
public void setResolveAllExternalProtos(boolean bResolveAllExternalProtos)
-
setSourceAbove
public void setSourceAbove(int eSouceAbove)
-
setSourceBelow
public void setSourceBelow(int eSouceBelow)
-
setVersionRestriction
public void setVersionRestriction(int nVersion, int eOutputBelow)
-
setWillDirty
public void setWillDirty(boolean bWillDirty)
- Overrides:
setWillDirty
in classNode
-
updateOriginalVersion
public boolean updateOriginalVersion()
Get a boolean that indicates if the originalXFAVersion processing instruction should be updated when each XFA Model child is saved.- Returns:
- TRUE if the processing instruction should be updated, otherwise FALSE. This function is only for Designer so when they create a new document they can avoid creating the originalXFAVersion.
-
updateOriginalVersion
public void updateOriginalVersion(boolean bUpdate)
Set a boolean that indicates if the originalXFAVersion processing instruction should be updated when each XFA Model child is saved.- Parameters:
bUpdate
- - TRUE if the processing instruction should be updated, otherwise FALSE. This function is only for Designer so when they create a new document they can avoid creating the originalXFAVersion.
-
-