public final class TemplateModel extends Model
| Modifier and Type | Class and Description |
|---|---|
static class |
TemplateModel.Insertion
A class to define a mapping between a key and template fragment reference.
|
Model.DualDomModel, Model.PublisherElement.DualDomNode, Element.ReplaceContentNode.ChangeLoggerAttrIsDefault, AttrIsFragment, AttrIsTransient, CREATEACTIONCREATE_ALWAYS_NEW, CREATE_IF_NOT_EXIST, CREATE_MUST_NOT_EXIST, CREATE_REPLACE, gsXFANamespacePrefixATTR_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 |
|---|
TemplateModel(Element parent,
Node prevSibling) |
TemplateModel(Element parent,
Node prevSibling,
String uri,
String QName,
String name) |
| Modifier and Type | Method and Description |
|---|---|
void |
adjustForVersion(int nVersion)
Make any adjustments necessary for the specified version.
|
void |
applyFixups()
Applies fixups on the template model just after it has been loaded.
|
boolean |
cleanupLegacySetting(AppModel.LegacyMask nIgnoreLegacyFlags)
Removes the originalXFAVersion PI if the default legacy flags are equal to the current legacy flags.
|
void |
convertToGeographicalOrder()
Arrange XFA-Template DOM nodes in geographical order.
|
Element |
createElement(Element parent,
Node prevSibling,
String uri,
String localName,
String qName,
Attributes attributes,
int lineNumber,
String fileName)
Creates an element with the given parent, sibling, namespace uri,
local name and SAX attributes.
|
ProtoableNode |
createLeaderTrailer(String sReference,
Node oParentContainer,
boolean bPeek) |
Node |
createNode(int eTag,
Element parent,
String aName,
String aNS,
boolean bDoVersionCheck)
Create an element with the given tag, parent, name and uri.
|
boolean |
doAttributeCleanup(Node pNode,
int eAttributeTag,
String sAttrValue)
Return TRUE if the given attribute can be removed, aka cleaned up from a given node.
|
static void |
enumerateScripts(Model model,
Node node,
List<ScriptInfo> scripts,
String sSingleLanguage)
Static method to be shared by Form Model's version of enumerateScripts.
|
void |
fixupRenderCache()
Removes render cache from the template model just after it has been loaded.
|
String |
getBaseNS() |
String |
getHeadNS() |
boolean |
getLegacySetting(AppModel.LegacyMask nLegacyFlag)
Gets the boolean value of a particular legacy setting.
|
static Schema |
getModelSchema() |
String |
getOriginalVersion(boolean bDefault)
Override of Model.getOriginalVersion().
|
int |
getOriginalXFAVersion()
Gets the original version the template was authored with.
|
ScriptTable |
getScriptTable() |
static TemplateModel |
getTemplateModel(AppModel app,
boolean bCreateIfNotFound)
Gets the template model held within an XFA DOM hierarchy.
|
static String |
getValidationMessage(Element poValidateNode,
String aType) |
int |
getVersion(String sNS)
Override of Model.getVersion().
|
void |
invalidMethod(String sName)
we needed to add the form methods into the template (see below in
the scripting section) because Designer (for example) uses intellisence
and since it doesn't have a form DOM it can show the $form properties.
|
void |
loadNode(Element parent,
Node node,
Generator generator) |
boolean |
loadSpecialAttribute(Attribute attribute,
String aLocalName,
Element element,
boolean bCheckOnly)
loadSpecialAttribute should be called by the loadNode method.
|
void |
nodeCleanup(Node node,
boolean bHasAttrs,
boolean bHasChildren) |
void |
normalizeNameSpaces(String aNewNS)
Normalize the namespaces of the nodes under this model given a namespace.
|
void |
postLoad()
postLoad is called after we've stopped receiving DOM events to load the
DOM
|
Node |
preLoadNode(Element parent,
Node node,
Generator genTag)
Preprocess the node.
|
boolean |
publish(Model.Publisher publisher)
Publish the model to an Application Storage facility.
|
void |
setLegacySetting(AppModel.LegacyMask nLegacyFlags,
boolean bValue)
Sets the boolean value of a particular legacy settings
|
void |
setOriginalXFAVersion(int nXFAVersion) |
static void |
setValidationMessage(Element validateNode,
String sMessage,
String aType) |
List<TemplateModel.Insertion> |
splice(List<TemplateModel.Insertion> insertions,
boolean removeInsertionPoints)
Splices external template fragments into this template.
|
void |
synchronizeXMPMetaData(String sCreatorTool,
String sProducer)
Synchronize this template model with the peer x:xmpmeta packet.
|
static String |
templateNS()
Namespace
|
boolean |
validateGlobalField(Element poNodeImpl)
check if a node is a global field
|
addErrorList, addUseHRefNode, addUseNode, addXMLLoadErrorContext, allowUpdates, checkforCompatibleNS, clearErrorList, clone, createElement, createElement, createElement, createElement, createTextNode, createTextNode, getAliasNode, getAppModel, getAppModelIsTransient, getCachedLocale, getContext, getCurrentVersion, getDelta, getDeltas, getDocument, getErrorContextList, getErrorList, getEventManager, getGenerator, getHeadVersion, getIDValueMap, getLogMessenger, getName, getNeedsNSNormalize, getNode, getNS, getOriginalVersionNode, getProtoList, getSchema, getSourceBelow, getXmlPeer, isCompatibleNS, isContainer, isLoading, isVersionCompatible, loadRootAttributes, loadSpecialNode, modelCleanup, normalizeNameSpaces, normalizeNameSpaces, normalizeNameSpaces, preSave, ready, remapTag, remove, removeLastError, removeReferences, resolveNodes, resolveProtos, serialize, setAliasNode, setAppModel, setAppModelIsTransient, setContext, setCurrentVersion, setDOMProperties, setIDValueMap, setName, setNeedsNSNormalize, setXmlPeer, shortCutName, validateUsage, validateUsageFailedIsFatal, willDirtyDoc, willDirtyDocappendChild, 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, updateFromPeercheckAncestorPerms, 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, validateSchemaaddPeer, addPeeredNode, clearPeers, deafen, getClassAtom, getClassTag, getPeer, getScriptProperty, getScriptThis, invokeFunction, isDeaf, isMute, isSameClass, isSameClass, isSameClass, mute, peerRemoved, removePeer, removePeeredNode, setClass, setClassTag, setScriptProperty, unDeafen, unMutepublic static void enumerateScripts(Model model, Node node, List<ScriptInfo> scripts, String sSingleLanguage)
public static Schema getModelSchema()
public static TemplateModel getTemplateModel(AppModel app, boolean bCreateIfNotFound)
app - the application model.bCreateIfNotFound - when true, create a template model if needed.public static String getValidationMessage(Element poValidateNode, String aType)
public String getOriginalVersion(boolean bDefault)
getOriginalVersion in class Modelpublic int getVersion(String sNS)
getVersion in class Modelpublic static void setValidationMessage(Element validateNode, String sMessage, String aType)
public static String templateNS()
public void applyFixups()
Note that this Java implementation does not handle the full set of fixups that are currently handled in the C++ implementation.
public void fixupRenderCache()
public void convertToGeographicalOrder()
public Element createElement(Element parent, Node prevSibling, String uri, String localName, String qName, Attributes attributes, int lineNumber, String fileName)
ModelcreateElement in class Modelparent - 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.Model.createElement(com.adobe.xfa.Element, com.adobe.xfa.Node, java.lang.String, java.lang.String, java.lang.String, org.xml.sax.Attributes, int, java.lang.String)public Node createNode(int eTag, Element parent, String aName, String aNS, boolean bDoVersionCheck)
ModelcreateNode in class ModeleTag - 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.Model.createNode(int, Element, String, String, boolean)public ProtoableNode createLeaderTrailer(String sReference, Node oParentContainer, boolean bPeek)
public String getBaseNS()
getBaseNS in class ModelModel.getBaseNS()public String getHeadNS()
getHeadNS in class ModelModel.getHeadNS()public boolean getLegacySetting(AppModel.LegacyMask nLegacyFlag)
ModelgetLegacySetting in class ModelnLegacyFlag - the specific legacy setting to checktrue if the legacy setting is set, or is the default the original version.Model.getLegacySetting(AppModel.LegacyMask)public void normalizeNameSpaces(String aNewNS)
aNewNS - - the namespace to change to.public int getOriginalXFAVersion()
getOriginalXFAVersion in class Modelpublic ScriptTable getScriptTable()
getScriptTable in class Modelpublic boolean loadSpecialAttribute(Attribute attribute, String aLocalName, Element element, boolean bCheckOnly)
ModelloadSpecialAttribute in class Modeltrue if the attribute is handledpublic void nodeCleanup(Node node, boolean bHasAttrs, boolean bHasChildren)
nodeCleanup in class Modelpublic boolean doAttributeCleanup(Node pNode, int eAttributeTag, String sAttrValue)
doAttributeCleanup in class Modelpublic void postLoad()
Modelpublic void setLegacySetting(AppModel.LegacyMask nLegacyFlags, boolean bValue)
nLegacyFlags - the specific legacy settings to updatebValue - the new boolean value for the legacy settingpublic boolean cleanupLegacySetting(AppModel.LegacyMask nIgnoreLegacyFlags)
nIgnoreLegacyFlags - - the legacy flags that should be ignored in the comparison.public void setOriginalXFAVersion(int nXFAVersion)
setOriginalXFAVersion in class Modelpublic List<TemplateModel.Insertion> splice(List<TemplateModel.Insertion> insertions, boolean removeInsertionPoints)
extras element that in turn contain
a text element with the name "insertionPoint".
Elements containing an extras element that in turn contains
a text element with the name "insertionPointPlaceholder"
are removed.
The value contained within the text node is an insertion
key, and it is matched against each key in insertions. The
corresponding replacement reference identifies a template fragment that
is loaded and inserted into the template. Each insertion is done by
making a copy of the insertion point and inserting that copy before the
insertion point. The template fragment reference is then resolved, and the
resolved fragment is merged into the insertion point copy.
The values in insertions reference template fragments
using the same syntax that the usehref attribute uses to
reference external prototype fragments:
TemplateModel.
The caller is responsible for registering an HrefHandler
with the AppModel to allow any external references to be
resolved.insertions - the insertions to be spliced into the template.removeInsertionPoints - if true, then any insertion points in the
template are removed.List containing the entries from
insertions for which no corresponding insertion
point was found, or null if all insertions were
used.AppModel.getErrorList(),
AppModel.setHrefHandler(HrefHandler handler)public void synchronizeXMPMetaData(String sCreatorTool, String sProducer)
sCreatorTool - - The name of the tool that created the form (may be empty).sProducer - - The producer that created the form (may be empty).ExFull - if synchronizing the metadata fails.public boolean validateGlobalField(Element poNodeImpl)
public void invalidMethod(String sName)
public void adjustForVersion(int nVersion)
public boolean publish(Model.Publisher publisher)
publish in class Modelpublisher - an instance of a class derived from TemplateModel.Publisher.Model.publish(Publisher oPublisher)Copyright © 2010 - 2020 Adobe. All Rights Reserved