Ontimize 5.2072EN

com.ontimize.util.extend
Class ExtendedClientApplicationParser

java.lang.Object
  extended bycom.ontimize.util.extend.ExtendedClientApplicationParser

public class ExtendedClientApplicationParser
extends java.lang.Object


Field Summary
static java.lang.String ATRIBUTE_OP
           
static java.lang.String DELETE_MANAGER_OP
           
static java.lang.String DELETE_OP
           
static java.lang.String FORM_ATRIBUTE
           
static java.lang.String ID_ATRIBUTE
           
static java.lang.String INSERT_MANAGER_OP
           
static java.lang.String INSERT_OP
           
static java.lang.String MODIFY_MANAGER_OP
           
static java.lang.String MODIFY_OP
           
static java.lang.String NAME_ATRIBUTE
           
static java.lang.String PARENT_ATRIBUTE
           
static java.lang.String REPLACE_OP
           
static java.lang.String TAGNAME
           
static java.lang.String VALUE_ATRIBUTE
           
 
Constructor Summary
ExtendedClientApplicationParser()
           
 
Method Summary
protected  void executeOperation(org.w3c.dom.Document originalForm, ExtendedClientApplicationOperation operation)
           
protected  java.util.ArrayList extractOperationNodes(org.w3c.dom.Document extendDocument)
          This method iterate along the extend document extracting all nodes of operations
 org.w3c.dom.Document getDocumentModel(java.io.File f)
           
protected  InnerExtendedClientApplicationOperation getInternalNodeOperation(org.w3c.dom.Node node)
           
protected  ExtendedClientApplicationOperation getNodeOperation(org.w3c.dom.Node node)
          This method processes a node that contains an operaton and returns an instance of class XmlExtendsOperation with necessary information to apply this operation in original xml document
protected  boolean isExtendNode(org.w3c.dom.Node node)
          Returns true or false if the node parameter is a operation node
protected  boolean isInternalOperationNode(org.w3c.dom.Node node)
           
protected  org.w3c.dom.Document parse(org.w3c.dom.Document originalForm, org.w3c.dom.Document extendDocument)
          Executes all operations in extendDocument to modify the xml code in originalDocument
 org.w3c.dom.Document parseExtendedXml(org.w3c.dom.Document originalForm, org.w3c.dom.Document extendDocument)
           
 java.lang.String printDocument(org.w3c.dom.Document document)
           
protected  org.w3c.dom.Node searchNodeByAttr(org.w3c.dom.Node node, java.lang.String attrName, java.lang.String attrValue)
          Thes method makes a deep search of a node the by attr atribute.
protected  org.w3c.dom.Node searchNodeByElementName(org.w3c.dom.Node node, java.lang.String name)
          Thes method makes a deep search of a node the by element Name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSERT_OP

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

MODIFY_OP

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

REPLACE_OP

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

DELETE_OP

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

INSERT_MANAGER_OP

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

DELETE_MANAGER_OP

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

MODIFY_MANAGER_OP

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

ATRIBUTE_OP

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

PARENT_ATRIBUTE

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

NAME_ATRIBUTE

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

VALUE_ATRIBUTE

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

FORM_ATRIBUTE

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

ID_ATRIBUTE

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

TAGNAME

public static final java.lang.String TAGNAME
See Also:
Constant Field Values
Constructor Detail

ExtendedClientApplicationParser

public ExtendedClientApplicationParser()
Method Detail

parseExtendedXml

public org.w3c.dom.Document parseExtendedXml(org.w3c.dom.Document originalForm,
                                             org.w3c.dom.Document extendDocument)

executeOperation

protected void executeOperation(org.w3c.dom.Document originalForm,
                                ExtendedClientApplicationOperation operation)
                         throws java.lang.Exception
Throws:
java.lang.Exception

searchNodeByAttr

protected org.w3c.dom.Node searchNodeByAttr(org.w3c.dom.Node node,
                                            java.lang.String attrName,
                                            java.lang.String attrValue)
Thes method makes a deep search of a node the by attr atribute.

Parameters:
node - The node in that the search is made
attrName - name of attribute of node searched
attrValue - value of attribute of node searched
Returns:
the searched node or null if the node is not found

searchNodeByElementName

protected org.w3c.dom.Node searchNodeByElementName(org.w3c.dom.Node node,
                                                   java.lang.String name)
Thes method makes a deep search of a node the by element Name.

Parameters:
node - The node in that the search is made
name - element name of node searched
Returns:
the searched node or null if the node is not found

parse

protected org.w3c.dom.Document parse(org.w3c.dom.Document originalForm,
                                     org.w3c.dom.Document extendDocument)
Executes all operations in extendDocument to modify the xml code in originalDocument

Parameters:
originalForm - - The xml of the original file
extendDocument - - The xml containing the operations to apply in originalDocument
Returns:

extractOperationNodes

protected java.util.ArrayList extractOperationNodes(org.w3c.dom.Document extendDocument)
This method iterate along the extend document extracting all nodes of operations

Parameters:
extendDocument -
Returns:

getNodeOperation

protected ExtendedClientApplicationOperation getNodeOperation(org.w3c.dom.Node node)
                                                       throws java.lang.Exception
This method processes a node that contains an operaton and returns an instance of class XmlExtendsOperation with necessary information to apply this operation in original xml document

Parameters:
node - The node of operation
Returns:
An instance of class XmlExtendsOperation
Throws:
java.lang.Exception

getInternalNodeOperation

protected InnerExtendedClientApplicationOperation getInternalNodeOperation(org.w3c.dom.Node node)
                                                                    throws java.lang.Exception
Throws:
java.lang.Exception

isExtendNode

protected boolean isExtendNode(org.w3c.dom.Node node)
Returns true or false if the node parameter is a operation node

Parameters:
node - the node to checl
Returns:
true or falsse

isInternalOperationNode

protected boolean isInternalOperationNode(org.w3c.dom.Node node)

getDocumentModel

public org.w3c.dom.Document getDocumentModel(java.io.File f)

printDocument

public java.lang.String printDocument(org.w3c.dom.Document document)

Ontimize