Package com.adobe.xfa
Class Model
- java.lang.Object
-
- com.adobe.xfa.Obj
-
- com.adobe.xfa.Node
-
- com.adobe.xfa.Element
-
- com.adobe.xfa.Model
-
- All Implemented Interfaces:
Element.DualDomNode
,Peer
- Direct Known Subclasses:
AppModel
,ConfigurationModel
,ConnectionSetModel
,DataModel
,FormModel
,LocaleSetModel
,TemplateModel
public abstract class Model extends Element implements Element.DualDomNode
An abstract class from which to derive all other models.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Model.DualDomModel
A marker interface that indicates that a Model's contents are dual-DOM, as opposed to the model Element itself, which is always dual-DOM.static class
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 Abstract Methods Concrete Methods Modifier and Type Method Description void
addErrorList(ExFull error, int eSeverity, Element context)
void
addUseHRefNode(Element poUseHRefNode)
add a new new node to the useNodeHrefListvoid
addUseNode(Element poUse)
add a new new node to the useNodeListvoid
addXMLLoadErrorContext(Node oSrc, ExFull oEx)
This method is called by derived classes to output the filename and line number when an error occurs during the load of an XML File.void
allowUpdates(boolean bAllowUpdates)
Sets whether this model can be updated at runtime.static boolean
checkforCompatibleNS(java.lang.String aNS, java.lang.String aModelNS)
Helper function for isCompatibleNSvoid
clearErrorList()
Clears the model's current list of errors.Element
clone(Element parent, boolean bDeep)
Element
createElement(int eTag, java.lang.String name)
Create an element with the given element tag and name.Element
createElement(Element parent, Node prevSibling, java.lang.String uri, java.lang.String qName)
Creates an element with the given parent, previous sibling, namespace uri and qualified name.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.Element
createElement(java.lang.String name)
Creates an element with the given name.Element
createElement(java.lang.String className, java.lang.String name, Element parent)
Creates an element with the given class, name and parent.abstract 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.TextNode
createTextNode(Element parent, Node prevSibling, char[] ch, int start, int length)
TextNode
createTextNode(Element parent, Node prevSibling, java.lang.String text)
Creates a text node with the given text.boolean
doAttributeCleanup(Node node, int eAttributeTag, java.lang.String sAttrValue)
Return TRUE if the given attribute can be removed, aka cleaned up from a given node.Element
getAliasNode()
Returns the node that is represented by the alias for this model.AppModel
getAppModel()
boolean
getAppModelIsTransient()
abstract java.lang.String
getBaseNS()
java.lang.String
getCachedLocale()
Node
getContext()
Retrieves the current node, which is the starting node for calls toresolveNode()
andresolveNodes()
int
getCurrentVersion()
Gets the current version of this model.Obj
getDelta(Element node, java.lang.String sSOM)
Obj
getDeltas(Node oNode)
Document
getDocument()
Returns this model's document.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 model since the last method call to clear the error list.EventManager
getEventManager()
the EventManager manages xfe:script scripts and their associated events (ie.Generator
getGenerator()
abstract java.lang.String
getHeadNS()
int
getHeadVersion()
IDValueMap
getIDValueMap()
boolean
getLegacySetting(AppModel.LegacyMask nLegacyFlag)
Gets the boolean value of a particular legacy setting.LogMessenger
getLogMessenger()
Retrieves the log messenger associated with this model.java.lang.String
getName()
Gets this element's name.boolean
getNeedsNSNormalize()
Element
getNode(java.lang.String aID)
Look up an XFA ID.java.lang.String
getNS()
Gets this element's namespace.java.lang.String
getOriginalVersion(boolean bDefault)
ProcessingInstruction
getOriginalVersionNode(boolean bCreate, java.lang.String sValue)
Get the processing instruction that holds our version number.int
getOriginalXFAVersion()
java.util.List<ProtoableNode>
getProtoList()
Keep track of proto Nodes and 'use' tags for quick lookup later ourSchema
getSchema()
Return the schema definition for this model.ScriptTable
getScriptTable()
int
getSourceBelow()
int
getVersion(java.lang.String sNS)
Node
getXmlPeer()
boolean
isCompatibleNS(java.lang.String aNS)
Determine if a specified namespace string is compatible with the namespace of this model.boolean
isContainer()
Check to see if this is a container object.boolean
isLoading()
boolean
isVersionCompatible(int nVersion, int nTargetVersion)
void
loadNode(Element parent, Node node, Generator genTag)
boolean
loadRootAttributes()
boolean
loadSpecialAttribute(Attribute attr, java.lang.String aLocalName, Element element, boolean bCheckOnly)
loadSpecialAttribute should be called by the loadNode method.boolean
loadSpecialNode(Element parent, Node node, boolean bCheckOnly)
loadSpecialNode should be called by the loadNode method.void
modelCleanup(Node node)
void
nodeCleanup(Node pNode, boolean bHasAttrs, boolean bHasChildren)
void
normalizeNameSpaces()
boolean
normalizeNameSpaces(int nTargetVersion, java.util.List<NodeValidationInfo> oResult)
Walks through the XFA DOM and normalizes the namespaces of all the nodes.void
normalizeNameSpaces(Element poNode, java.lang.String aURI)
Helper function for normalizeNameSpaces().Node
preLoadNode(Element parent, Node node, Generator genTag)
Preprocess the node.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.int
remapTag(int eTag)
Remap a given tag to a new value.void
remove()
Removes this node from its parent child list.void
removeLastError()
void
removeReferences(Node node)
remove references to a given node.NodeList
resolveNodes(java.lang.String somNodes, boolean bPeek, boolean bLastInstance, boolean bNoProperties, DependencyTracker oDependencyTracker, BooleanHolder isAssociation)
Evaluates the Scripting Object Model expression, using this node as the current context.void
resolveProtos(boolean bForceExternalProtoResolve)
void
serialize(java.io.OutputStream outStream, DOMSaveOptions options, int level, Node prevSibling)
The helper function used by saveXML()void
setAliasNode(Element aliasNode)
Specify the node that is represented by the alias for this model.void
setAppModel(AppModel pNewModel)
void
setAppModelIsTransient(boolean bAppModelIsTransient)
void
setContext(Node node)
Specifies the current node, which is the starting node for calls to resolveNode and resolveNodes.void
setCurrentVersion(int nVersion)
void
setDOMProperties(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
All name properties (including those in attributes) must be interned strings.void
setIDValueMap(IDValueMap idValueMap)
void
setName(java.lang.String name)
Set the name for this modelvoid
setNeedsNSNormalize(boolean bNormalize)
void
setOriginalXFAVersion(int nXFAVersion)
void
setXmlPeer(Node peer)
java.lang.String
shortCutName()
boolean
validateUsage(int nXFAVersion, int nAvailability, boolean bUpdateVersion)
Validate if the given Version and Availability flags are valid for the current documentboolean
validateUsageFailedIsFatal(int nXFAVersion, int nAvailability)
Determines if disallowing a version should be considered a fatal error.boolean
willDirtyDoc()
void
willDirtyDoc(boolean bWillDirty)
-
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
-
checkforCompatibleNS
public static boolean checkforCompatibleNS(java.lang.String aNS, java.lang.String aModelNS)
Helper function for isCompatibleNS- Parameters:
aNS
- - namespace of node being checkedaModelNS
- - namespace of model being checked against.
-
getScriptTable
public ScriptTable getScriptTable()
- Overrides:
getScriptTable
in classElement
-
removeLastError
public final void removeLastError()
-
addUseHRefNode
public void addUseHRefNode(Element poUseHRefNode)
add a new new node to the useNodeHrefList
-
addUseNode
public void addUseNode(Element poUse)
add a new new node to the useNodeList
-
addXMLLoadErrorContext
public void addXMLLoadErrorContext(Node oSrc, ExFull oEx)
This method is called by derived classes to output the filename and line number when an error occurs during the load of an XML File.
-
allowUpdates
public void allowUpdates(boolean bAllowUpdates)
Sets whether this model can be updated at runtime. This should only betrue
for Designer.- Parameters:
bAllowUpdates
- -true
if this model can be modified at runtime, otherwisefalse
.
-
clearErrorList
public void clearErrorList()
Clears the model's current list of errors.
-
clone
public Element clone(Element parent, boolean bDeep)
- Overrides:
clone
in classElement
- See Also:
Element.clone(Element)
-
createElement
public Element createElement(Element parent, Node prevSibling, java.lang.String uri, java.lang.String qName)
Creates an element with the given parent, previous sibling, namespace uri and qualified name.- Parameters:
parent
- the element's parent, if any.prevSibling
- the element's previous sibling, if any.uri
- the element's namespace URI. This string must be interned.qName
- the element's qualified name. This string must be interned.- Returns:
- a new element conformant to our schema.
-
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)
Creates an element with the given parent, sibling, namespace uri, local name and SAX attributes.- 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.
-
createElement
public final Element createElement(int eTag, java.lang.String name)
Create an element with the given element tag and name.- Parameters:
eTag
- the element's tag.name
- the element's name, if known. This string must be interned.- Returns:
- a new element conformant to the XFA schema.
-
createElement
public final Element createElement(java.lang.String className, java.lang.String name, Element parent)
Creates an element with the given class, name and parent.- Parameters:
className
- the element's class name. This string must be interned.name
- the element's name, if known. This string must be interned.parent
- the element's parent.- Returns:
- a new element conformant to the XFA schema.
-
createElement
public Element createElement(java.lang.String name)
Creates an element with the given name.- Parameters:
name
- the element's name. This string must be interned.- Returns:
- a new element conformant to our schema.
-
createNode
public abstract 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.- 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.
-
createTextNode
public final TextNode createTextNode(Element parent, Node prevSibling, char[] ch, int start, int length)
-
createTextNode
public final TextNode createTextNode(Element parent, Node prevSibling, java.lang.String text)
Creates a text node with the given text.- Parameters:
parent
- the node's parent, if any.prevSibling
- the node's previous sibling, if any.text
- the node's text.- Returns:
- a new node conformant to our schema.
-
getAliasNode
public final Element getAliasNode()
Returns the node that is represented by the alias for this model. The returned model is normally the model itself, but not always. For example, while $template refers to the template model, by default, $data refers to the first child of the data model.- Returns:
- an Node that corresponds to the alias for this model.
-
getAppModel
public AppModel getAppModel()
- Overrides:
getAppModel
in classElement
-
getAppModelIsTransient
public boolean getAppModelIsTransient()
-
getBaseNS
public abstract java.lang.String getBaseNS()
-
getCachedLocale
public java.lang.String getCachedLocale()
-
getContext
public final Node getContext()
Retrieves the current node, which is the starting node for calls toresolveNode()
andresolveNodes()
- Returns:
- The current node.
-
getCurrentVersion
public int getCurrentVersion()
Gets the current version of this model.- Returns:
- the version number (times 10).
-
getDocument
public final Document getDocument()
Returns this model's document.- Returns:
- the document node.
-
getErrorContextList
public java.util.List<Element> getErrorContextList()
Gets all the context nodes that correspond to entries in the error list.- 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 model since the last method call to clear the error list. Note that these are not fatal errors. They are typically syntax problems discovered when loading the collateral. Some applications may choose to sift through the list and stop processing if they recognize specific problems. However most applications should simply dump the messages into the log file and continue processing. i.e. treat this as a list of warnings.- 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)
-
getGenerator
public Generator getGenerator()
-
getHeadNS
public abstract java.lang.String getHeadNS()
-
getHeadVersion
public int getHeadVersion()
-
getIDValueMap
public IDValueMap getIDValueMap()
-
getLegacySetting
public boolean getLegacySetting(AppModel.LegacyMask nLegacyFlag)
Gets the boolean value of a particular legacy setting.- Parameters:
nLegacyFlag
- the specific legacy setting to check- Returns:
true
if the legacy setting is set, or is the default the original version.
-
getLogMessenger
public LogMessenger getLogMessenger()
Retrieves the log messenger associated with this model.- Returns:
- The log messenger.
-
getName
public final java.lang.String getName()
Description copied from class:Element
Gets this element's name.The name of an element is the value of its name attribute, or the element name if there is no name attribute.
- Overrides:
getName
in classElement
- Returns:
- the name of the element.
- See Also:
Element.getName()
-
getNeedsNSNormalize
public boolean getNeedsNSNormalize()
-
getNode
public Element getNode(java.lang.String aID)
Look up an XFA ID. Since XFA IDs are only guaranteed to be unique within the scope of their model (to prevent conflicts with customer-controlled data), the lookup is done by namespace.Note: jfDomDocument::getElementByXFAId handles the conversion of versioned model namespace strings to unversioned ones.
- Parameters:
aID
- The node id- Returns:
- The node if found, null if not found.
-
getNS
public java.lang.String getNS()
Description copied from class:Element
Gets this element's namespace.- Overrides:
getNS
in classElement
- Returns:
- the namespace URI.
- See Also:
Element.getNS()
-
getOriginalVersion
public java.lang.String getOriginalVersion(boolean bDefault)
-
getOriginalVersionNode
public ProcessingInstruction getOriginalVersionNode(boolean bCreate, java.lang.String sValue)
Get the processing instruction that holds our version number.- Parameters:
bCreate
- - if true, create the PI if it doesn't existsValue
- - the value to use for the PI if we create it- Returns:
- the version node PI
-
getProtoList
public java.util.List<ProtoableNode> getProtoList()
Keep track of proto Nodes and 'use' tags for quick lookup later our- Returns:
- our list of protos
-
getSchema
public final Schema getSchema()
Return the schema definition for this model.- Returns:
- a class derived from Schema
-
getSourceBelow
public int getSourceBelow()
-
getVersion
public int getVersion(java.lang.String sNS)
-
setXmlPeer
public void setXmlPeer(Node peer)
- Specified by:
setXmlPeer
in interfaceElement.DualDomNode
-
getXmlPeer
public Node getXmlPeer()
- Specified by:
getXmlPeer
in interfaceElement.DualDomNode
-
isCompatibleNS
public boolean isCompatibleNS(java.lang.String aNS)
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).- Parameters:
aNS
- The namespace to compare.
-
isContainer
public final boolean isContainer()
Description copied from class:Node
Check to see if this is a container object. A container is defined as something that is not a leaf node not properties ( [0..1] occurrences ). It does NOT indicate whether this node derives from XFAContainer- Overrides:
isContainer
in classElement
- Returns:
- true if this node is a container, false otherwise
-
isLoading
public final boolean isLoading()
-
isVersionCompatible
public boolean isVersionCompatible(int nVersion, int nTargetVersion)
-
loadSpecialAttribute
public boolean loadSpecialAttribute(Attribute attr, java.lang.String aLocalName, Element element, boolean bCheckOnly)
loadSpecialAttribute should be called by the loadNode method. It scans for special attributes. Currently it only looks for event-related attributes (for automatic execution of script). The bCheckOnly flag can be set to TRUE to cause this routine to do nothing except return whether or not the attribute would be handled.- Returns:
true
if the attribute is handled
-
loadSpecialNode
public boolean loadSpecialNode(Element parent, Node node, boolean bCheckOnly)
loadSpecialNode should be called by the loadNode method. It checks for special nodes. Currently it only looks for event-related nodes (for automatic execution of script).- Returns:
true
if the node is handled
-
loadRootAttributes
public boolean loadRootAttributes()
-
modelCleanup
public void modelCleanup(Node node)
-
nodeCleanup
public void nodeCleanup(Node pNode, boolean bHasAttrs, boolean bHasChildren)
-
doAttributeCleanup
public boolean doAttributeCleanup(Node node, int eAttributeTag, java.lang.String sAttrValue)
Return TRUE if the given attribute can be removed, aka cleaned up from a given node. Return FALSE otherwise.
-
normalizeNameSpaces
public void normalizeNameSpaces()
-
normalizeNameSpaces
public void normalizeNameSpaces(Element poNode, java.lang.String aURI)
Helper function for normalizeNameSpaces().- Parameters:
poNode
- the node to normalize.aURI
- the new namespace.
-
normalizeNameSpaces
public boolean normalizeNameSpaces(int nTargetVersion, java.util.List<NodeValidationInfo> oResult)
Walks through the XFA DOM and normalizes the namespaces of all the nodes.- Parameters:
nTargetVersion
- the version of the schema desired. One ofXFAVERSION_10
, ...XFAVERSION_HEAD
.oResult
- a list ofNodeValidationInfo
objects: invalid children, attributes and attribute values based upon the target version. If this model is not a valid child of its parent, this model will be the first entry of oResult. If oResult is not null, this method will ensure all child nodes attributes and attribute values are valid for given the target version.- Returns:
- true if successful, else false.
-
preLoadNode
public Node preLoadNode(Element parent, Node node, Generator genTag)
Preprocess the node. The node may be removed.- Returns:
- the next XML sibling to be processed, or
null
if all siblings have been processed.
-
preSave
public void preSave(boolean bSaveXMLScript)
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 classElement
- See Also:
Node.preSave(boolean)
-
publish
public boolean publish(Model.Publisher publisher)
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.- Parameters:
publisher
- an instance of a class derived from TemplateModel.Publisher.
-
ready
public boolean ready(boolean bForced)
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.- Returns:
true
if ready scripts fire
-
remove
public void remove()
Description copied from class:Node
Removes this node from its parent child list.- Overrides:
remove
in classNode
- See Also:
Node.remove()
-
removeReferences
public void removeReferences(Node node)
remove references to a given node.
-
remapTag
public int remapTag(int eTag)
Remap a given tag to a new value. This gives a model a chance to remap a tag to a new value after it's determined that the original wasn't valid in the current context. The default implementation returns the input tag, which is a no-op.- Parameters:
eTag
- the original input tag.- Returns:
- the new remapped tag.
-
resolveNodes
public NodeList resolveNodes(java.lang.String somNodes, boolean bPeek, boolean bLastInstance, boolean bNoProperties, DependencyTracker oDependencyTracker, BooleanHolder isAssociation)
Description copied from class:Node
Evaluates the Scripting Object Model expression, using this node as the current context.- Overrides:
resolveNodes
in classNode
- See Also:
Node.resolveNodes(String, boolean, boolean, boolean)
-
resolveProtos
public void resolveProtos(boolean bForceExternalProtoResolve)
-
serialize
public void serialize(java.io.OutputStream outStream, DOMSaveOptions options, int level, Node prevSibling) throws java.io.IOException, java.io.IOException
Description copied from class:Node
The helper function used by saveXML()- Overrides:
serialize
in classElement
- Parameters:
outStream
- Streamfile to write tooptions
- save optionslevel
- the indent levelprevSibling
- our previous sibling -- needed for some markup options.- Throws:
java.io.IOException
- See Also:
Node.serialize(OutputStream, DOMSaveOptions, int, Node)
-
setAliasNode
public final void setAliasNode(Element aliasNode)
Specify the node that is represented by the alias for this model.- Parameters:
aliasNode
- The node that will represent this model.
-
setAppModel
public void setAppModel(AppModel pNewModel)
- Parameters:
pNewModel
-
-
setAppModelIsTransient
public void setAppModelIsTransient(boolean bAppModelIsTransient)
-
setContext
public void setContext(Node node)
Specifies the current node, which is the starting node for calls to resolveNode and resolveNodes.- Parameters:
node
- the new current node.resolveNode
andresolveNodes
differ fromNode.resolveNode()
andNode.resolveNodes()
in that the current node is the node set viasetContext()
, instead of "this" node.
-
setCurrentVersion
public void setCurrentVersion(int nVersion)
-
setDOMProperties
public final void setDOMProperties(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
Description copied from class:Element
All name properties (including those in attributes) must be interned strings.- Overrides:
setDOMProperties
in classElement
- See Also:
Element.setDOMProperties(String, String, String, Attributes)
-
setIDValueMap
public void setIDValueMap(IDValueMap idValueMap)
-
setName
public final void setName(java.lang.String name)
Set the name for this model
-
setNeedsNSNormalize
public void setNeedsNSNormalize(boolean bNormalize)
-
shortCutName
public java.lang.String shortCutName()
-
validateUsage
public boolean validateUsage(int nXFAVersion, int nAvailability, boolean bUpdateVersion)
Description copied from class:Obj
Validate if the given Version and Availability flags are valid for the current document- Overrides:
validateUsage
in classNode
- Parameters:
nXFAVersion
- The target XFA VersionnAvailability
- The target Availability flags, this indicates for what clients the script is availablebUpdateVersion
- indicates if the model version can be updated by the calling code- Returns:
- if true, Version and Availability flags are valid
- See Also:
Node.validateUsage(int, int, boolean)
-
validateUsageFailedIsFatal
public boolean validateUsageFailedIsFatal(int nXFAVersion, int nAvailability)
Description copied from class:Obj
Determines if disallowing a version should be considered a fatal error.This method is called after calling
Obj.validateUsage(int, int, boolean)
when that method returns false.- Overrides:
validateUsageFailedIsFatal
in classNode
- Parameters:
nXFAVersion
- The target XFA VersionnAvailability
- The target Availability flags, this indicates for what clients the script is available- Returns:
- true if disallowing nVersion should be considered a fatal error
- See Also:
Node.validateUsageFailedIsFatal(int, int)
-
willDirtyDoc
public void willDirtyDoc(boolean bWillDirty)
-
willDirtyDoc
public boolean willDirtyDoc()
-
getOriginalXFAVersion
public int getOriginalXFAVersion()
-
setOriginalXFAVersion
public void setOriginalXFAVersion(int nXFAVersion)
-
-