com.ontimize.util.extend
Class ExtendedXmlParser
java.lang.Object
com.ontimize.util.extend.ExtendedXmlParser
- Direct Known Subclasses:
- ExtendedFormXmlParser
- public abstract class ExtendedXmlParser
- extends java.lang.Object
|
Method Summary |
protected abstract void |
executeOperation(org.w3c.dom.Document originalForm,
ExtendedXmlOperation 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)
|
static java.lang.String |
getExtendedFile(java.lang.String fileURI)
|
static java.io.InputStream |
getExtendedFile(java.lang.String fileURI,
java.lang.String baseCP)
|
static java.io.InputStream |
getExtendedInput(java.lang.String fileURI)
|
protected ExtendedXmlOperation |
getNodeOperation(org.w3c.dom.Node node)
This method processes a node that contains an operation and returns an
instance of class XmlExtendsOperation with necessary information to apply
this operation in original xml document |
protected boolean |
isExtendedNode(org.w3c.dom.Node node)
Returns true or false if the node parameter is a operation 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)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEBUG
public static boolean DEBUG
INSERT_AFTER_OP
public static final java.lang.String INSERT_AFTER_OP
- See Also:
- Constant Field Values
INSERT_BEFORE_OP
public static final java.lang.String INSERT_BEFORE_OP
- See Also:
- Constant Field Values
REMOVE_OP
public static final java.lang.String REMOVE_OP
- See Also:
- Constant Field Values
REPLACE_OP
public static final java.lang.String REPLACE_OP
- See Also:
- Constant Field Values
ATTR_ATRIBUTE
public static final java.lang.String ATTR_ATRIBUTE
- See Also:
- Constant Field Values
CONTAINER_ATRIBUTE
public static final java.lang.String CONTAINER_ATRIBUTE
- See Also:
- Constant Field Values
LEVELS_ATRIBUTE
public static final java.lang.String LEVELS_ATRIBUTE
- See Also:
- Constant Field Values
FORM_EXTENDS
public static final java.lang.String FORM_EXTENDS
- See Also:
- Constant Field Values
MENU_EXTENDS
public static final java.lang.String MENU_EXTENDS
- See Also:
- Constant Field Values
TOOLBAR_EXTENDS
public static final java.lang.String TOOLBAR_EXTENDS
- See Also:
- Constant Field Values
ExtendedXmlParser
public ExtendedXmlParser()
executeOperation
protected abstract void executeOperation(org.w3c.dom.Document originalForm,
ExtendedXmlOperation operation)
throws java.lang.Exception
- Throws:
java.lang.Exception
parseExtendedXml
public org.w3c.dom.Document parseExtendedXml(org.w3c.dom.Document originalForm,
org.w3c.dom.Document extendDocument)
throws java.lang.Exception
- Throws:
java.lang.Exception
parse
protected org.w3c.dom.Document parse(org.w3c.dom.Document originalForm,
org.w3c.dom.Document extendDocument)
throws java.lang.Exception
- Executes all operations in extendDocument to modify the xml code in originalDocument
- Parameters:
originalForm - - The xml of the original fileextendDocument - - The xml containing the operations to apply in originalDocument
- Returns:
-
- Throws:
java.lang.Exception
getNodeOperation
protected ExtendedXmlOperation getNodeOperation(org.w3c.dom.Node node)
throws java.lang.Exception
- This method processes a node that contains an operation 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
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:
isExtendedNode
protected boolean isExtendedNode(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
getDocumentModel
public org.w3c.dom.Document getDocumentModel(java.io.File f)
printDocument
public java.lang.String printDocument(org.w3c.dom.Document document)
getExtendedFile
public static java.lang.String getExtendedFile(java.lang.String fileURI)
getExtendedInput
public static java.io.InputStream getExtendedInput(java.lang.String fileURI)
getExtendedFile
public static java.io.InputStream getExtendedFile(java.lang.String fileURI,
java.lang.String baseCP)