com.jaxfront.core.dom
Class Document

java.lang.Object
  extended by com.jaxfront.core.dom.Document

public class Document
extends java.lang.Object

Represents a JAXFront Type DOM. Every JAXFront Type refers to an XMLSchema Element and a XUIDefinition defined in the XUI file. The class DOMBuilder acts a a factory for creating JAXFront documents. A JAXFront DOM combines XMLSchema information (meta level), XMLInstance and XUI definitions. To create a JAXFront DOM, the existance of an XMLSchema is a must. Use the serialize method to create an XML OutputStream.

Version:
1.60
See Also:
DOMBuilder

Field Summary
 boolean _enforcePrefixSerialization
           
 boolean _isReleased
           
 long _lastDomUpdateTime
           
static java.lang.String BUILD_VERSION
           
static java.lang.String CLIENT_PROPERTY_HTTP_REQUEST
           
static java.lang.String DOM_ARGS
           
static java.lang.String GLOBAL_CODESET_DOC
           
 DoubleKeyHashtable itCache
           
 DoubleKeyHashtable parentCache
           
static java.lang.String TARGET_PI
           
 DoubleKeyHashtable xpCache
           
static java.lang.String XUI_VERSION
           
 
Constructor Summary
Document(XMLSchema schema, Type rootType)
          Creates a JAXFront DOM for a specific XMLSchema and root node.
Document(XMLSchema schema, Type rootType, java.util.Hashtable params)
          Creates a JAXFront DOM for a specific XMLSchema and root node.
 
Method Summary
 void addActionPerformListener(ActionPerformListener newListener)
          Register a new listener for receiving JAXFront ActionPerform events.
 void addDirtyChangeListener(DirtyChangeListener newListener)
          Register a new listener for receiving dirty changes.
 void addDOMChangeListener(DOMChangeListener newListener)
          Register a new listener for receiving JAXFront DOM events.
 void addDOMChangeListener(DOMChangeListener newListener, int pos)
          Register a new listener for receiving JAXFront DOM events.
 FormulaExpression addFormula(FormulaExpression formula)
           
 void addNotFiredInitializationRule(Type target, Rule initializationRule)
           
 void attachUISpecification(org.w3c.dom.Document xuiW3CDOM, boolean reinitializeGlobalDefinitions)
          Attaches the passed XUI Document to the internal ui specification.
 void bind(org.w3c.dom.Document dom)
          Binds the values of the source DOM (W3C DOM) to the JAXFront DOM.
 void bind(org.w3c.dom.Document dom, boolean reinitializeXUI)
          Binds the values of the source DOM (W3C DOM) to the JAXFront DOM.
 void cancelInstance()
          Fires a CANCEL-DOM event.
 void checkAutoCreateListItems(Type type)
           
 Document copy()
          Copies the current JAXFront-Document and returns it.
 void fireActionPerformed(ActionPerformEvent event)
          Informs all ActionPerformListeners about a performing action.
 void fireDirtyChange()
           
 void fireDOMChanged(DOMChangeEvent event)
          Informs all DOMChangeListeners about node changes.
 void fireDOMChanged(DOMChangeEvent event, boolean isTemporary)
          Informs all DOMChangeListeners about node changes (add/remove/cancel).
 java.lang.String getAppContext()
           
 java.awt.Color getApplicationFieldColor()
          Returns the color that is defined in the XUI-Document for all mandatory application fields.
 java.util.Hashtable getApplicationProperties()
           
 java.lang.Object getApplicationProperty(java.lang.String key)
           
 java.lang.String getAppVersionNo()
          Returns the application version number set in the xui file.
static java.lang.String getBuildVersion()
          Returns the build version of the current JAXFront Engine.
 java.lang.Object getClientProperty(java.lang.String key)
           
 ClipBoard getClipBoard()
           
 CodeTables getCodeTables()
          Returns the defined codeTables for this DOM domain (stored per XMLSchema).
 TypeController getController()
          Returns the TypeController for this DOM.
 long getCreatedTime()
           
 java.lang.String getDefaultNamespace()
           
 float getDividerLocation()
          Returns the global divider location.
 java.lang.String getDocumentID()
           
 EditablePanel getEditor()
          Returns the top level visual editor for this DOM if any, otherwise return null.
 java.lang.String getEncoding()
           
 java.awt.Color getErrorMarkingColor()
          Returns the color which marks errors in a visualizer view.
 java.util.List getFilters()
          Returns the defined search filters.
 FingerPrint getFingerPrint()
          Returns the fingerprint for this DOM.
 java.util.Collection getFormulas()
           
 GlobalDefinition getGlobalDefinition()
          Returns the global definitions for this DOM (XUI Global definitions).
 float getGlobalLabelIndent()
          Returns the global label indent.
 Rule getGlobalRule(java.lang.Object id)
           
 java.util.Hashtable getGlobalRules()
           
 DoubleKeyHashtable getGlobalXUIDefinitions()
           
 java.lang.String getInfo()
           
 java.util.Map getInfos()
           
 KeyKeyRefManager getKeyKeyRefManager()
           
 java.lang.String getLanguage()
          Returns the language that is defined in the XUI-Document
 long getLastDomUpdateTimeStamp()
           
 SimpleType getLeafType(java.lang.String xpath)
          Returns a simple type (leaf type) according to the given xpath or null.
 java.util.HashSet getLostComponents()
           
 NLS getNLS()
          Returns the NLS for this DOM.
 java.util.LinkedHashMap getNotFiredInitializationRules()
           
 java.awt.Color getOptionalFieldColor()
          Returns the color that is defined in the XUI-Document for all optional application fields.
 java.util.Hashtable getOriginalXmlHeaderAttributes()
          Start the serialization of this DOM to the passing Stringbuffer.
 JAXFrontPropertyChangeSupport getPropertyChangeSupport()
          Gets the PropertyChangeSupport helper instance for this type.
 Type getRootType()
          Returns the root type of the current document.
 XMLSchema getSchema()
          Returns the XML schema for this DOM.
 java.lang.String getSchemaLocation()
           
 java.awt.Color getSchemaRequiredFieldColor()
          Returns the color that is defined in the XUI-Document for all mandatory fields.
 java.awt.Dimension getScreenSize()
          Returns the default screensize or as defined in the XUI-Document.
 SearchDefinition getSearchDefinition()
          Returns a search definition as defined in the XUI-Document.
 SerializationModifier getSerializationModifier()
           
 int getStatus()
           
 java.util.List getTreeRoot()
          Returns the root nodes for visualizing in the navigation tree.
 Type getType(java.lang.String xpath)
          Returns the type that can be found with the given xpath.
 Type getType(java.lang.String xpath, Type baseType)
          Returns the type that can be found with the given xpath.
 java.util.List getTypes(java.lang.String xpath)
          Returns a list of types that can be found with the given xpath.
 java.util.List getTypes(java.lang.String xpath, Type rootType)
           
 java.util.List getTypes(java.lang.String xpath, Type rootType, boolean serializableOnly)
           
 JAXFrontUndoManager getUndoManager()
           
 int getVerticalScrollBarPolicy()
          Returns the usage of the vertical scrollbar as int.
 Type getViewHolderType(Type smartType)
          Retrieves the right viewHolder (container) type for the given type.
 java.util.Hashtable getXMLNamespaceMappings()
           
 Document getXUIDocument()
          Returns the current XUI-Document.
 java.util.Hashtable getXUINamespaceMappings()
           
 java.util.Hashtable getXUIPrefixNamespaceMappings()
           
 Type getXUIRootType()
          Returns the root type of the current XUI-Document.
static java.lang.String getXUIVersionNo()
          Returns the current supported XUI version of the JAXFront Engine.
 boolean hasChanged()
          Returns true if the state of a type within this DOM has changed.
 FormulaExpression hasFormula(FormulaExpression formula)
           
 void initializeGlobalRules(Type rules)
           
 void initUISpecification(Document uiDoc)
          Initializes the UserInterface-Specification (XUI-Document).
 void initUISpecification(Document uiDoc, boolean releaseOldUISpecification, boolean reinitializeGlobalDefinitions)
          Initializes the UserInterface-Specification (XUI-Document).
 void initUISpecification(Type xuiType)
          Initializes a xui component for all target nodes retrieved by processing the passed xpath statement.
 void initUISpecification(java.net.URL xuiURL)
           
 boolean isAllowingSavingWithErrors()
          Returns whether the document can be saved even if validation errors exist
 boolean isBinding()
           
 boolean isEditable()
          Returns whether the document can be modified or not.
 boolean isHistoryMode()
           
 boolean isImmutable()
           
 boolean isOrphan(org.w3c.dom.Node node)
          Check if the supplied node is an orphan, i.e. if its uppermost parent is of type Document (=> not orphaned) or another node (=> orphaned)
 boolean isPasteMode()
           
 boolean isPDFXUIDOM()
           
 boolean isRuleEngineBlocked()
           
 boolean isRunningInXUIEditor()
          Returns if JAXFront is running as XUIEditor.
 boolean isSerializingDefaults()
          Returns whether the defined defaults in the schema should be serialized or not.
 boolean isShowingTreeListContainer()
          Returns true if a container element (e.q. item(s)) for list types will be shown in the navigation tree.
 boolean isUsingBackwardButton()
          Returns true if the backwardButton in the editor is used or not.
 boolean isUsingButtonBar()
          Returns whether the button bar in the editor is visible or not.
 boolean isUsingForwardButton()
          Returns true if the forwardButton in the editor is used or not.
 boolean isUsingPlugins()
          Returns whether plug-ins are allowed to use or not.
 boolean isUsingStatusBar()
          Returns whether the status bar is used or not.
 boolean isValid()
           
 boolean isXPathCached()
           
 boolean isXUIDOMInstance()
           
 boolean isXUIInitialized()
           
 boolean keepXUIDOMinMemory()
           
 void keepXUIDOMinMemory(boolean isXuiDom)
           
 void lock(java.lang.String[] fieldsToUnlock)
          Locks the current DOM and all its visualizers.
 void maintainLostXUIComponent(Type xuiComponent)
           
 void maintainNoTargetXPathDefinitions(java.util.List definitions)
           
 void markNotEditableTypes(Type type, boolean unmark, boolean handleListItems)
           
 void printTypeTree()
          Writes the current DOM tree to the log file.
 void putApplicationProperty(java.lang.String key, java.lang.Object value)
           
 void putClientProperty(java.lang.String key, java.lang.Object value)
           
 void reApplyLostComponents()
           
 void refresh(org.w3c.dom.Document dom, Document uiDOM)
          Refreshes the given DOM and reinitialize the XUI definitions.
 void refreshUISpecification(Document uiDOM)
          Refreshes the current DOM with new XUI definitions.
 void reinitializeNLS()
           
 void reinitializeUISpecification()
           
 void release()
          Releases allocated resources for this DOM including type tree, XUI DOM, properties, visualizer cache, processing-instructions and type controller.
 void releaseController()
          Releases the current type controller.
 void releaseProperties()
          Releases the current properties.
 void removeActionPerformListener(ActionPerformListener newListener)
          Removes a ActionPerformListener.
 java.lang.Object removeApplicationProperty(java.lang.String key)
           
 void removeClientProperty(java.lang.String key)
           
 void removeDirtyChangeListener(DirtyChangeListener listener)
          Remove a listener for receiving dirty changes.
 void removeDOMChangeListener(DOMChangeListener newListener)
          Removes a DOMChangeListener.
 FormulaExpression removeFormula(FormulaExpression formula)
           
 void removeFormulaExpressions(Type forType)
           
 XUIDefinition removeXUIDefinition(Type type)
           
 void saveAs(java.io.File file)
          Saves the current document into a file.
 void saveAsZip(java.io.File file)
           
 java.lang.StringBuffer serialize()
          Serializes the current document into a StringBuffer and returns it.
 java.lang.StringBuffer serialize(boolean makeIndents)
           
 java.lang.StringBuffer serialize(boolean makeIndents, boolean serializeHeader)
          Serializes the current document into a StringBuffer and returns it.
 java.lang.StringBuffer serializeInternal(boolean makeIndents, boolean serializeHeader)
          Start the serialization of this DOM to the passing Stringbuffer.
 byte[] serializeToByteArray()
           
 byte[] serializeToByteArray(java.lang.String encoding)
           
 org.w3c.dom.Document serializeToW3CDocument()
          Serialize the current JAXFront document and creates a new W3C document instance.
 void setAppContext(java.lang.String appContext)
           
 void setEncoding(java.lang.String encoding)
           
 void setFingerPrint(FingerPrint fingerPrint)
          Sets the fingerprint for this DOM.
 void setGlobalCodeSet(org.w3c.dom.Document codesetDoc)
          Initialize the global Codest for this DOM document.
 void setHistoryMode(boolean enabled, java.util.Vector fingerprintActions)
           
 void setImmutable(boolean immutable)
           
 void setIsBinding(boolean isBinding)
           
 void setLanguage(java.lang.String language)
          Sets the language for this and all future DOM's so the defined language within a XUI definition will not be considered again.
 void setNLS(NLS nls)
          Sets the NLS properties to use.
 void setPasteMode(boolean pasting)
           
 void setPID(java.lang.String pid)
           
 void setRuleEngineBlocked(boolean blockRuleEngine)
           
 void setRunningAsXUIEditor(boolean isEditorMode)
           
 void setSchemaLocation(java.lang.String schemaLocation)
           
 void setSerializationModifier(SerializationModifier serializationModifier)
           
 void setStatus(int status)
           
 void setUndoManager(JAXFrontUndoManager undoManager)
           
 void setXMLNamespaceMappings(java.util.Hashtable mapping)
           
 void setXPathCached(boolean cache)
           
 void setXUIDocument(Document xuiDocument)
           
 void setXUINamespaceMappings(java.util.Hashtable mapping)
           
 boolean systemExitOnClose()
          Returns whether the system will exit when the window is closed or not.
 void unlock()
           
 boolean useOptionalCheckBox()
          Returns whether optional check boxes are used or not.
 void validate()
          Validates the current DOM according its XML Schema & the defined XUI rules.
 void validate(boolean isRunningOnServer)
          Validates the current DOM according its XML Schema & the defined XUI rules.
 void validateMandatoryAndCardinality(Type type, java.util.List errors, boolean checkValue)
          Checks if all mandatory leaf types derived from the passed type are not empty.
 java.util.Vector validatePageErrors(Type type, int pageIndex)
           
 void validateSchemaConstraints()
          Validates the current DOM according its mandatory fields.
 void validateXUIRules(boolean isRunningOnServer)
          Validates the current DOM according its defined save XUI rules.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

XUI_VERSION

public static final java.lang.String XUI_VERSION
See Also:
Constant Field Values

BUILD_VERSION

public static final java.lang.String BUILD_VERSION
See Also:
Constant Field Values

TARGET_PI

public static final java.lang.String TARGET_PI
See Also:
Constant Field Values

DOM_ARGS

public static final java.lang.String DOM_ARGS
See Also:
Constant Field Values

CLIENT_PROPERTY_HTTP_REQUEST

public static final java.lang.String CLIENT_PROPERTY_HTTP_REQUEST
See Also:
Constant Field Values

GLOBAL_CODESET_DOC

public static final java.lang.String GLOBAL_CODESET_DOC
See Also:
Constant Field Values

_isReleased

public boolean _isReleased

_lastDomUpdateTime

public long _lastDomUpdateTime

itCache

public DoubleKeyHashtable itCache

parentCache

public DoubleKeyHashtable parentCache

xpCache

public DoubleKeyHashtable xpCache

_enforcePrefixSerialization

public boolean _enforcePrefixSerialization
Constructor Detail

Document

public Document(XMLSchema schema,
                Type rootType,
                java.util.Hashtable params)
Creates a JAXFront DOM for a specific XMLSchema and root node.

Parameters:
schema - XML Schema
rootType - root node for this document

Document

public Document(XMLSchema schema,
                Type rootType)
Creates a JAXFront DOM for a specific XMLSchema and root node.

Parameters:
schema - XML Schema
rootType - root node for this document
Method Detail

addDOMChangeListener

public void addDOMChangeListener(DOMChangeListener newListener)
Register a new listener for receiving JAXFront DOM events.

Parameters:
newListener - a new listener

addDOMChangeListener

public void addDOMChangeListener(DOMChangeListener newListener,
                                 int pos)
Register a new listener for receiving JAXFront DOM events.

Parameters:
newListener - a new listener

fireDirtyChange

public void fireDirtyChange()

addDirtyChangeListener

public void addDirtyChangeListener(DirtyChangeListener newListener)
Register a new listener for receiving dirty changes.

Parameters:
newListener - a new listener

removeDirtyChangeListener

public void removeDirtyChangeListener(DirtyChangeListener listener)
Remove a listener for receiving dirty changes.

Parameters:
listener - a listener

addFormula

public FormulaExpression addFormula(FormulaExpression formula)

getFormulas

public java.util.Collection getFormulas()

hasFormula

public FormulaExpression hasFormula(FormulaExpression formula)

removeFormula

public FormulaExpression removeFormula(FormulaExpression formula)

removeFormulaExpressions

public void removeFormulaExpressions(Type forType)

addActionPerformListener

public void addActionPerformListener(ActionPerformListener newListener)
Register a new listener for receiving JAXFront ActionPerform events.

Parameters:
newListener - a new listener

cancelInstance

public void cancelInstance()
Fires a CANCEL-DOM event. Listeners may undo made changes.


copy

public Document copy()
              throws DocumentCreationException
Copies the current JAXFront-Document and returns it.

Returns:
a copy of the current JAXFront-Document
Throws:
DocumentCreationException - if the DOM couldn't be build

bind

public void bind(org.w3c.dom.Document dom)
Binds the values of the source DOM (W3C DOM) to the JAXFront DOM. The name of the root type must match the name of the root node in the passed W3C DOM.

Parameters:
dom - W3C DOM to bind

bind

public void bind(org.w3c.dom.Document dom,
                 boolean reinitializeXUI)
Binds the values of the source DOM (W3C DOM) to the JAXFront DOM. The name of the root type must match the name of the root node in the passed W3C DOM.

Parameters:
dom - W3C DOM to bind
reinitializeXUI - indicates if XUI should be reinitialized

setXPathCached

public void setXPathCached(boolean cache)

isXPathCached

public boolean isXPathCached()

getKeyKeyRefManager

public KeyKeyRefManager getKeyKeyRefManager()

setEncoding

public void setEncoding(java.lang.String encoding)

getEncoding

public java.lang.String getEncoding()

fireDOMChanged

public void fireDOMChanged(DOMChangeEvent event)
Informs all DOMChangeListeners about node changes.

Parameters:
event - DOMChangeEvent to fire

fireDOMChanged

public void fireDOMChanged(DOMChangeEvent event,
                           boolean isTemporary)
Informs all DOMChangeListeners about node changes (add/remove/cancel).

Parameters:
event - DOMChangeEvent to fire
isTemporary - true if this event is just temporary

fireActionPerformed

public void fireActionPerformed(ActionPerformEvent event)
Informs all ActionPerformListeners about a performing action.

Parameters:
event - DOMChangeEvent to fire

getCodeTables

public CodeTables getCodeTables()
Returns the defined codeTables for this DOM domain (stored per XMLSchema).


getController

public TypeController getController()
Returns the TypeController for this DOM.


getDividerLocation

public float getDividerLocation()
Returns the global divider location.


getErrorMarkingColor

public java.awt.Color getErrorMarkingColor()
Returns the color which marks errors in a visualizer view.


getFilters

public java.util.List getFilters()
Returns the defined search filters.


getGlobalLabelIndent

public float getGlobalLabelIndent()
Returns the global label indent.


getGlobalDefinition

public GlobalDefinition getGlobalDefinition()
Returns the global definitions for this DOM (XUI Global definitions).


getLeafType

public SimpleType getLeafType(java.lang.String xpath)
Returns a simple type (leaf type) according to the given xpath or null.

Parameters:
xpath - to look for a leaf type

getLanguage

public java.lang.String getLanguage()
Returns the language that is defined in the XUI-Document


getSchemaRequiredFieldColor

public java.awt.Color getSchemaRequiredFieldColor()
Returns the color that is defined in the XUI-Document for all mandatory fields.


getApplicationFieldColor

public java.awt.Color getApplicationFieldColor()
Returns the color that is defined in the XUI-Document for all mandatory application fields.


getOptionalFieldColor

public java.awt.Color getOptionalFieldColor()
Returns the color that is defined in the XUI-Document for all optional application fields.


getRootType

public Type getRootType()
Returns the root type of the current document.

Returns:
the root tpye

getSchema

public XMLSchema getSchema()
Returns the XML schema for this DOM.


getScreenSize

public java.awt.Dimension getScreenSize()
Returns the default screensize or as defined in the XUI-Document.

Returns:
the current screenSize

getSearchDefinition

public SearchDefinition getSearchDefinition()
Returns a search definition as defined in the XUI-Document.

Returns:
a search definition

getTreeRoot

public java.util.List getTreeRoot()
Returns the root nodes for visualizing in the navigation tree.

Returns:
a list of root nodes to visualize in navigation tree

getType

public Type getType(java.lang.String xpath)
Returns the type that can be found with the given xpath.

Parameters:
xpath - xpath of the type that should be accessed
Returns:
a type

getType

public Type getType(java.lang.String xpath,
                    Type baseType)
Returns the type that can be found with the given xpath.

Parameters:
xpath - xpath of the type that should be accessed
Returns:
a type

getTypes

public java.util.List getTypes(java.lang.String xpath)
Returns a list of types that can be found with the given xpath.

Parameters:
xpath - xpath of the type(s) that should be accessed
Returns:
a list of types

getTypes

public java.util.List getTypes(java.lang.String xpath,
                               Type rootType)

getTypes

public java.util.List getTypes(java.lang.String xpath,
                               Type rootType,
                               boolean serializableOnly)

isRunningInXUIEditor

public boolean isRunningInXUIEditor()
Returns if JAXFront is running as XUIEditor.

Returns:
true, if JAXFront is running as XUIEditor, false otherwise

setRunningAsXUIEditor

public void setRunningAsXUIEditor(boolean isEditorMode)

getVerticalScrollBarPolicy

public int getVerticalScrollBarPolicy()
Returns the usage of the vertical scrollbar as int.

Returns:
the usage of the vertical scrollbar

getXUIDocument

public Document getXUIDocument()
Returns the current XUI-Document.

Returns:
the current XUI-Document

setXUIDocument

public void setXUIDocument(Document xuiDocument)

getXUIRootType

public Type getXUIRootType()
Returns the root type of the current XUI-Document.

Returns:
the root type of the current XUI-Document

getXUIVersionNo

public static java.lang.String getXUIVersionNo()
Returns the current supported XUI version of the JAXFront Engine.


getBuildVersion

public static java.lang.String getBuildVersion()
Returns the build version of the current JAXFront Engine.


initUISpecification

public void initUISpecification(java.net.URL xuiURL)
                         throws DocumentCreationException
Throws:
DocumentCreationException

attachUISpecification

public void attachUISpecification(org.w3c.dom.Document xuiW3CDOM,
                                  boolean reinitializeGlobalDefinitions)
                           throws DocumentCreationException
Attaches the passed XUI Document to the internal ui specification.

Parameters:
xuiW3CDOM - new XUI DOM
reinitializeGlobalDefinitions - defines if global XUI definitions should be reinitialized with the passing XUI definitions
Throws:
DocumentCreationException

initUISpecification

public void initUISpecification(Document uiDoc)
                         throws DocumentCreationException
Initializes the UserInterface-Specification (XUI-Document).

Parameters:
uiDoc - the XUI-Document (JAXFront-Document)
Throws:
DocumentCreationException - if the DOM couldn't be build

initUISpecification

public void initUISpecification(Document uiDoc,
                                boolean releaseOldUISpecification,
                                boolean reinitializeGlobalDefinitions)
                         throws DocumentCreationException
Initializes the UserInterface-Specification (XUI-Document).

Parameters:
uiDoc - the XUI-Document (JAXFront-Document)
releaseOldUISpecification - defines if the old UISpecification should be released
reinitializeGlobalDefinitions - defines if the global definitions sould be reinitialized
Throws:
DocumentCreationException - if the DOM couldn't be build

setGlobalCodeSet

public void setGlobalCodeSet(org.w3c.dom.Document codesetDoc)
Initialize the global Codest for this DOM document. If a CodeSet url in the xui definition is null then the global CodeSet will be used. The search path for the CodeSet is first globalCodesetUrl itself, second location of the xsd file.


getNLS

public NLS getNLS()
Returns the NLS for this DOM.


initUISpecification

public void initUISpecification(Type xuiType)
Initializes a xui component for all target nodes retrieved by processing the passed xpath statement.

Parameters:
xuiType - xui component from the XUI DOM

maintainNoTargetXPathDefinitions

public void maintainNoTargetXPathDefinitions(java.util.List definitions)

maintainLostXUIComponent

public void maintainLostXUIComponent(Type xuiComponent)

reApplyLostComponents

public void reApplyLostComponents()

isAllowingSavingWithErrors

public boolean isAllowingSavingWithErrors()
Returns whether the document can be saved even if validation errors exist

Returns:
true if the document can be saved with errors, false otherwise

getEditor

public EditablePanel getEditor()
Returns the top level visual editor for this DOM if any, otherwise return null.


isEditable

public boolean isEditable()
Returns whether the document can be modified or not.

Returns:
true if the document can be modified, false otherwise

isOrphan

public boolean isOrphan(org.w3c.dom.Node node)
Check if the supplied node is an orphan, i.e. if its uppermost parent is of type Document (=> not orphaned) or another node (=> orphaned)

Parameters:
node - the node that should be checked
Returns:
true if the node is an orphan, false otherwise

isSerializingDefaults

public boolean isSerializingDefaults()
Returns whether the defined defaults in the schema should be serialized or not.


isShowingTreeListContainer

public boolean isShowingTreeListContainer()
Returns true if a container element (e.q. item(s)) for list types will be shown in the navigation tree.


isUsingBackwardButton

public boolean isUsingBackwardButton()
Returns true if the backwardButton in the editor is used or not.

Returns:
true if the backwardButton is used, false otherwise

isUsingButtonBar

public boolean isUsingButtonBar()
Returns whether the button bar in the editor is visible or not.

Returns:
true if the button bar is used, false otherwise

isUsingForwardButton

public boolean isUsingForwardButton()
Returns true if the forwardButton in the editor is used or not.

Returns:
true if the forwardButton is used, false otherwise

isUsingPlugins

public boolean isUsingPlugins()
Returns whether plug-ins are allowed to use or not.

Returns:
true if plug-ins are used, false otherwise

isUsingStatusBar

public boolean isUsingStatusBar()
Returns whether the status bar is used or not.

Returns:
true if the status bar is used, false otherwise

printTypeTree

public void printTypeTree()
Writes the current DOM tree to the log file.


refresh

public void refresh(org.w3c.dom.Document dom,
                    Document uiDOM)
             throws DocumentCreationException
Refreshes the given DOM and reinitialize the XUI definitions.

Parameters:
dom - a Document (W3C)
uiDOM - a XUI-Document (JAXFront-Document)
Throws:
DocumentCreationException - if the DOM couldn't be build

refreshUISpecification

public void refreshUISpecification(Document uiDOM)
                            throws DocumentCreationException
Refreshes the current DOM with new XUI definitions.

Parameters:
uiDOM - XUIDOM to initialize
Throws:
DocumentCreationException - if the DOM couldn't be build

release

public void release()
Releases allocated resources for this DOM including type tree, XUI DOM, properties, visualizer cache, processing-instructions and type controller.


releaseController

public void releaseController()
Releases the current type controller.


releaseProperties

public void releaseProperties()
Releases the current properties.


initializeGlobalRules

public void initializeGlobalRules(Type rules)

getGlobalRules

public java.util.Hashtable getGlobalRules()

getGlobalRule

public Rule getGlobalRule(java.lang.Object id)

removeDOMChangeListener

public void removeDOMChangeListener(DOMChangeListener newListener)
Removes a DOMChangeListener.

Parameters:
newListener - DOMChangeListener

removeActionPerformListener

public void removeActionPerformListener(ActionPerformListener newListener)
Removes a ActionPerformListener.

Parameters:
newListener - an existing ActionPerformListener

saveAs

public void saveAs(java.io.File file)
            throws ValidationException,
                   java.io.IOException
Saves the current document into a file.

Parameters:
file - File, into which the current document will be saved
Throws:
ValidationException - if the file couldn't be saved
java.io.IOException

saveAsZip

public void saveAsZip(java.io.File file)
               throws ValidationException,
                      java.io.IOException
Throws:
ValidationException
java.io.IOException

serialize

public java.lang.StringBuffer serialize()
                                 throws ValidationException
Serializes the current document into a StringBuffer and returns it.

Returns:
a StringBuffer that contains the serialized DOM
Throws:
ValidationException - if the file couldn't be saved

serializeToByteArray

public byte[] serializeToByteArray()
                            throws ValidationException,
                                   java.io.UnsupportedEncodingException
Throws:
ValidationException
java.io.UnsupportedEncodingException

serializeToByteArray

public byte[] serializeToByteArray(java.lang.String encoding)
                            throws ValidationException,
                                   java.io.UnsupportedEncodingException
Throws:
ValidationException
java.io.UnsupportedEncodingException

serialize

public java.lang.StringBuffer serialize(boolean makeIndents)
                                 throws ValidationException
Throws:
ValidationException

serialize

public java.lang.StringBuffer serialize(boolean makeIndents,
                                        boolean serializeHeader)
                                 throws ValidationException
Serializes the current document into a StringBuffer and returns it.

Parameters:
makeIndents - indicates if indents & carriage returns should be written
serializeHeader - true, if the xml header should be written
Returns:
a StringBuffer that contains the serialized DOM
Throws:
ValidationException - if the file couldn't be saved

getSchemaLocation

public java.lang.String getSchemaLocation()

getOriginalXmlHeaderAttributes

public java.util.Hashtable getOriginalXmlHeaderAttributes()
Start the serialization of this DOM to the passing Stringbuffer.

Parameters:
sb - Stringbuffer to serialize DOM into
makeIndents - indicates if indents & carriage returns should be written
serializeHeader - true, if the xml header should be written

serializeInternal

public java.lang.StringBuffer serializeInternal(boolean makeIndents,
                                                boolean serializeHeader)
Start the serialization of this DOM to the passing Stringbuffer.

Parameters:
sb - Stringbuffer to serialize DOM into
makeIndents - indicates if indents & carriage returns should be written
serializeHeader - true, if the xml header should be written

setSchemaLocation

public void setSchemaLocation(java.lang.String schemaLocation)

systemExitOnClose

public boolean systemExitOnClose()
Returns whether the system will exit when the window is closed or not.

Returns:
true if the system will exit when the window is closed, false otherwise

useOptionalCheckBox

public boolean useOptionalCheckBox()
Returns whether optional check boxes are used or not.

Returns:
true if optional check boxes are used, false otherwise

validate

public void validate()
Validates the current DOM according its XML Schema & the defined XUI rules.


validatePageErrors

public java.util.Vector validatePageErrors(Type type,
                                           int pageIndex)

validate

public void validate(boolean isRunningOnServer)
Validates the current DOM according its XML Schema & the defined XUI rules.


validateSchemaConstraints

public void validateSchemaConstraints()
Validates the current DOM according its mandatory fields. This validate only checks XML Schema cardinalitiy constraints. ValidationErrors will be thrown for any empty mandatory leaf type.


validateXUIRules

public void validateXUIRules(boolean isRunningOnServer)
Validates the current DOM according its defined save XUI rules.


getLastDomUpdateTimeStamp

public long getLastDomUpdateTimeStamp()

validateMandatoryAndCardinality

public void validateMandatoryAndCardinality(Type type,
                                            java.util.List errors,
                                            boolean checkValue)
Checks if all mandatory leaf types derived from the passed type are not empty. Also ensures that the cardinality of the list types are not violated.

Parameters:
type - type to check

getFingerPrint

public FingerPrint getFingerPrint()
Returns the fingerprint for this DOM. The fingerprint is initialized by the attached XUI document.


setPID

public void setPID(java.lang.String pid)

hasChanged

public boolean hasChanged()
Returns true if the state of a type within this DOM has changed.


getAppVersionNo

public java.lang.String getAppVersionNo()
Returns the application version number set in the xui file. Null if none defined.


setFingerPrint

public void setFingerPrint(FingerPrint fingerPrint)
Sets the fingerprint for this DOM.

Parameters:
fingerPrint -

setNLS

public void setNLS(NLS nls)
Sets the NLS properties to use.

Parameters:
nls - NLS properties

setLanguage

public void setLanguage(java.lang.String language)
Sets the language for this and all future DOM's so the defined language within a XUI definition will not be considered again.

Parameters:
language - language for all DOM's to use

putClientProperty

public void putClientProperty(java.lang.String key,
                              java.lang.Object value)

putApplicationProperty

public void putApplicationProperty(java.lang.String key,
                                   java.lang.Object value)

getApplicationProperty

public java.lang.Object getApplicationProperty(java.lang.String key)

removeApplicationProperty

public java.lang.Object removeApplicationProperty(java.lang.String key)

removeClientProperty

public void removeClientProperty(java.lang.String key)

getClientProperty

public java.lang.Object getClientProperty(java.lang.String key)

getGlobalXUIDefinitions

public DoubleKeyHashtable getGlobalXUIDefinitions()

getXMLNamespaceMappings

public java.util.Hashtable getXMLNamespaceMappings()

getXUINamespaceMappings

public java.util.Hashtable getXUINamespaceMappings()

getXUIPrefixNamespaceMappings

public java.util.Hashtable getXUIPrefixNamespaceMappings()

setXUINamespaceMappings

public void setXUINamespaceMappings(java.util.Hashtable mapping)

setXMLNamespaceMappings

public void setXMLNamespaceMappings(java.util.Hashtable mapping)

isXUIInitialized

public boolean isXUIInitialized()

keepXUIDOMinMemory

public boolean keepXUIDOMinMemory()

isXUIDOMInstance

public boolean isXUIDOMInstance()

keepXUIDOMinMemory

public void keepXUIDOMinMemory(boolean isXuiDom)

isPDFXUIDOM

public boolean isPDFXUIDOM()

reinitializeNLS

public void reinitializeNLS()

reinitializeUISpecification

public void reinitializeUISpecification()

setImmutable

public void setImmutable(boolean immutable)

isImmutable

public boolean isImmutable()

getPropertyChangeSupport

public JAXFrontPropertyChangeSupport getPropertyChangeSupport()
Gets the PropertyChangeSupport helper instance for this type.

Returns:
the PropertyChangeSupport helper instance for this type

isBinding

public boolean isBinding()

setIsBinding

public void setIsBinding(boolean isBinding)

isValid

public boolean isValid()

getNotFiredInitializationRules

public java.util.LinkedHashMap getNotFiredInitializationRules()

addNotFiredInitializationRule

public void addNotFiredInitializationRule(Type target,
                                          Rule initializationRule)

getViewHolderType

public Type getViewHolderType(Type smartType)
Retrieves the right viewHolder (container) type for the given type.

Parameters:
smartType - a given type

getLostComponents

public java.util.HashSet getLostComponents()
Returns:
Returns the _lostComponents.

lock

public void lock(java.lang.String[] fieldsToUnlock)
Locks the current DOM and all its visualizers. It is not possible to change any value or list item anymore until one unlocks the DOM.

Parameters:
fieldsToUnlock - list of xpath where the corresponding visualizer will still unlocked

unlock

public void unlock()

markNotEditableTypes

public void markNotEditableTypes(Type type,
                                 boolean unmark,
                                 boolean handleListItems)

checkAutoCreateListItems

public void checkAutoCreateListItems(Type type)

setRuleEngineBlocked

public void setRuleEngineBlocked(boolean blockRuleEngine)

isRuleEngineBlocked

public boolean isRuleEngineBlocked()

serializeToW3CDocument

public org.w3c.dom.Document serializeToW3CDocument()
                                            throws org.apache.xerces.xni.parser.XMLParseException,
                                                   org.xml.sax.SAXException,
                                                   java.io.IOException,
                                                   ValidationException
Serialize the current JAXFront document and creates a new W3C document instance.

Returns:
a new W3C Document
Throws:
org.apache.xerces.xni.parser.XMLParseException
org.xml.sax.SAXException
java.io.IOException
ValidationException

getAppContext

public java.lang.String getAppContext()

setAppContext

public void setAppContext(java.lang.String appContext)

setSerializationModifier

public void setSerializationModifier(SerializationModifier serializationModifier)

getSerializationModifier

public SerializationModifier getSerializationModifier()

getDefaultNamespace

public java.lang.String getDefaultNamespace()

getApplicationProperties

public java.util.Hashtable getApplicationProperties()

getUndoManager

public JAXFrontUndoManager getUndoManager()

setUndoManager

public void setUndoManager(JAXFrontUndoManager undoManager)

setStatus

public void setStatus(int status)

getStatus

public int getStatus()

getClipBoard

public ClipBoard getClipBoard()

getInfo

public java.lang.String getInfo()

getInfos

public java.util.Map getInfos()

isPasteMode

public boolean isPasteMode()

setPasteMode

public void setPasteMode(boolean pasting)

removeXUIDefinition

public XUIDefinition removeXUIDefinition(Type type)

getCreatedTime

public long getCreatedTime()

isHistoryMode

public boolean isHistoryMode()

getDocumentID

public java.lang.String getDocumentID()

setHistoryMode

public void setHistoryMode(boolean enabled,
                           java.util.Vector fingerprintActions)