com.qanavigation.XMLDB
Class XMLDB

java.lang.Object
  extended by com.qanavigation.Basics.Rslt
      extended by com.qanavigation.XMLDB.XMLDBbasics
          extended by com.qanavigation.XMLDB.XMLDB
All Implemented Interfaces:
IRslt

public class XMLDB
extends XMLDBbasics

Service Class for XMLs in a DB. XMLDB isA XMLDBbasics. Service calls do not spoil the status of this object on failure. The actual status is found with the object returned.


Field Summary
 
Fields inherited from class com.qanavigation.XMLDB.XMLDBbasics
m_DB
 
Constructor Summary
XMLDB(DBacc2 p_DBAcc, java.lang.String p_UIDservHostName, int p_port)
           
 
Method Summary
 RsltString appSubTree(java.lang.String p_UID, RsltXMLNode p_Node, boolean p_wChk)
          Appends a (new) sub tree to an existing node in the DB
 Rslt deleteSubTree(java.lang.String p_pUID, java.lang.String p_nodeName, boolean p_single)
           
 RsltString export2File(java.lang.String p_UID, java.lang.String p_ApplInfo)
          Exports an XML.
 Rslt export2File(java.lang.String p_UID, java.lang.String p_FileName, java.lang.String p_ApplInfo)
          Exports an XML to a file.
 RsltString getAttrString(java.lang.String p_UID)
          Gets the list of attributes for a node as a string.
 SetList getDocUIDsByVal(java.lang.String p_ElemType, java.lang.String p_Text, boolean p_CaseSens)
          Gets all documents of the given type where the content or a title has the requested value.
 RsltTable getNodeAttrs(RsltString p_UID)
          Gets the list of attributes for a node as table.
 RsltTable getNodeLstByAttrs(java.lang.String p_ElemType, Rslt2DArray p_AttrSet)
          Gets the list of nodes, which match the given attribute values.
 RsltString getNodeVal(RsltString p_UID)
          Gets the value of a node.
 RsltString getNodeValByParent(java.lang.String p_ElemType, java.lang.String p_ParUID)
           
 RsltTable getSubNodesByAttr(java.lang.String p_parentUID, java.lang.String p_SubNodeName, Rslt2DArray p_attrLst)
           
 RsltTable getTopNodeLst()
           
 RsltTable getTopNodeLst(java.lang.String p_ElemType)
          Gets the list of top XML nodes.
 SetList getTopNodesByAttr(java.lang.String p_TopElemType, java.lang.String p_ElemType, Rslt2DArray p_AttrSet)
           
 RsltString getTopNodeUID(java.lang.String p_UID)
          Gets the UID of the top node of the document, to which the node with the UID belongs to.
 RsltString getTopNodeUID(java.lang.String p_TopElemType, java.lang.String p_UID)
          Gets the UID of the top node of the specified element type (if there is) of the document, to which the node with the UID bleongs to.
 XMLDBNode getXMLsubTree(RsltString p_UID)
          Gets the subtree, starting from the node specified with the UID, which can be the entire XML document, if the UID points to it.
 XMLDBNode getXMLsubTree(java.lang.String p_UID)
          Gets the subtree, starting from the node specified with the UID, which can be the entire XML document, if the UID points to it.
 RsltString importXMLFile(java.lang.String p_XMLfile)
          Imports an XML from the given file to the DB.
 Rslt setAttrVal(java.lang.String p_NodeUID, java.lang.String p_AttrName, java.lang.String p_AttrVal)
          Updates the attribute, if it already existed, or sets it.
 Rslt setSubNodeVal(java.lang.String p_pUID, java.lang.String p_nodeName, java.lang.String p_newVal)
          Updates or sets a sub node value.
 
Methods inherited from class com.qanavigation.XMLDB.XMLDBbasics
chkDoc, deleteNode, deleteXML, getAttrVal, getDTDInfo, getFileInfo, getFirstUIDByParent, getLastQCommand, getNodeAsTable, getNodeAttrs, getNodeName, getNodes, getNodesByAttr, getNodesByAttr, getNodesByAttrExclByAttr, getNodesByType, getNodeVal, getParentID, getSubNodeVals, getTopNodeUID, getTopNodeUID, getUIDLstByParent, getXNodeLstByParent, importXML, newUID, writeFileInfo
 
Methods inherited from class com.qanavigation.Basics.Rslt
addRsltAddFailInfo, addRsltAddFailInfoIf, addRsltAddInfo, addRsltAddInfo, addRsltFinalInfo, addRsltInitialInfo, checkRslt, checkRslt, checkRslt, checkRslt, getRslt, getRsltAddInfo, getRsltFinalInfo, getRsltFinalMsg, getRsltInitialInfo, getRsltInitialMsg, getRsltStatVal, getRsltStatValLbl, isInStat, isOK, isOK, notOK, notOK, resetRslt, setInError, setOK, setRsltByExcp, setRsltByExcp, setRsltByExcp, setRsltStat, setRsltStat, setRsltStat, setRsltStat, setSelfReflect
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLDB

public XMLDB(DBacc2 p_DBAcc,
             java.lang.String p_UIDservHostName,
             int p_port)
Parameters:
p_DBAcc -
p_UIDservHostName -
p_port -
Method Detail

appSubTree

public RsltString appSubTree(java.lang.String p_UID,
                             RsltXMLNode p_Node,
                             boolean p_wChk)
Appends a (new) sub tree to an existing node in the DB

Parameters:
p_UID -
p_Node -
p_wChk - The existence of the parent node is checked
Returns:
The new UID of the top node of the tree

deleteSubTree

public Rslt deleteSubTree(java.lang.String p_pUID,
                          java.lang.String p_nodeName,
                          boolean p_single)
Parameters:
p_pUID - Parent UID.
p_nodeName -
p_single - Only one node expected?
Returns:

export2File

public RsltString export2File(java.lang.String p_UID,
                              java.lang.String p_ApplInfo)
Exports an XML. The file name (w/o path) is retrieved from the DB. Fails if file name is not available.

Parameters:
p_UID -
p_ApplInfo -
Returns:

export2File

public Rslt export2File(java.lang.String p_UID,
                        java.lang.String p_FileName,
                        java.lang.String p_ApplInfo)
Exports an XML to a file.

Parameters:
p_UID -
p_FileName -
p_ApplInfo - is used for comment "Generated by " + p_ApplInfo
Returns:

getAttrString

public RsltString getAttrString(java.lang.String p_UID)
Gets the list of attributes for a node as a string.

Parameters:
p_UID -
Returns:

getDocUIDsByVal

public SetList getDocUIDsByVal(java.lang.String p_ElemType,
                               java.lang.String p_Text,
                               boolean p_CaseSens)
Gets all documents of the given type where the content or a title has the requested value.

Parameters:
p_ElemType -
p_Text -
p_CaseSens -
Returns:

getNodeAttrs

public RsltTable getNodeAttrs(RsltString p_UID)
Gets the list of attributes for a node as table.

Parameters:
p_UID -
Returns:
RsltTable; Cols: Name, Value.

getNodeLstByAttrs

public RsltTable getNodeLstByAttrs(java.lang.String p_ElemType,
                                   Rslt2DArray p_AttrSet)
Gets the list of nodes, which match the given attribute values. Requires the ElemType (name of the top node, Empty string for any) plus a Rslt2DArray with attribute names and values.

Parameters:
p_ElemType -
p_AttrSet -
Returns:
RsltTable; Col sequence: UID, Name, Attribs.

getNodeVal

public RsltString getNodeVal(RsltString p_UID)
Gets the value of a node.

Parameters:
p_UID -
Returns:

getNodeValByParent

public RsltString getNodeValByParent(java.lang.String p_ElemType,
                                     java.lang.String p_ParUID)
Parameters:
p_ElemType -
p_ParUID -
Returns:

getSubNodesByAttr

public RsltTable getSubNodesByAttr(java.lang.String p_parentUID,
                                   java.lang.String p_SubNodeName,
                                   Rslt2DArray p_attrLst)
Parameters:
p_parentUID -
p_SubNodeName -
p_attrLst -
Returns:

getTopNodeLst

public RsltTable getTopNodeLst()
Returns:
RsltTable; Col sequence: UID, Node Name, Attrib String.

getTopNodeLst

public RsltTable getTopNodeLst(java.lang.String p_ElemType)
Gets the list of top XML nodes. Requires the ElemType (name of the top node element). Returns a table with UID, node name and the assigned attributes.

Parameters:
p_ElemType -
Returns:
RsltTable; Col sequence: UID, Node Name, Attrib String.

getTopNodesByAttr

public SetList getTopNodesByAttr(java.lang.String p_TopElemType,
                                 java.lang.String p_ElemType,
                                 Rslt2DArray p_AttrSet)
Parameters:
p_TopElemType -
p_ElemType -
p_AttrSet -
Returns:

getTopNodeUID

public RsltString getTopNodeUID(java.lang.String p_UID)
Gets the UID of the top node of the document, to which the node with the UID belongs to.

Parameters:
p_UID -
Returns:

getTopNodeUID

public RsltString getTopNodeUID(java.lang.String p_TopElemType,
                                java.lang.String p_UID)
Gets the UID of the top node of the specified element type (if there is) of the document, to which the node with the UID bleongs to. Walks up the tree until it finds the requested element type.

Parameters:
p_TopElemType -
p_UID -
Returns:
The UID.

getXMLsubTree

public XMLDBNode getXMLsubTree(RsltString p_UID)
Gets the subtree, starting from the node specified with the UID, which can be the entire XML document, if the UID points to it.

Parameters:
p_UID -
Returns:

getXMLsubTree

public XMLDBNode getXMLsubTree(java.lang.String p_UID)
Gets the subtree, starting from the node specified with the UID, which can be the entire XML document, if the UID points to it.

Parameters:
p_UID -
Returns:
The requested.

importXMLFile

public RsltString importXMLFile(java.lang.String p_XMLfile)
Imports an XML from the given file to the DB.

Parameters:
p_XMLfile -
Returns:
The UID of the XML

setAttrVal

public Rslt setAttrVal(java.lang.String p_NodeUID,
                       java.lang.String p_AttrName,
                       java.lang.String p_AttrVal)
Updates the attribute, if it already existed, or sets it.

Parameters:
p_NodeUID -
p_AttrName -
p_AttrVal -
Returns:
The state of the update.

setSubNodeVal

public Rslt setSubNodeVal(java.lang.String p_pUID,
                          java.lang.String p_nodeName,
                          java.lang.String p_newVal)
Updates or sets a sub node value.

Parameters:
p_pUID -
p_nodeName -
p_newVal -
Returns:


Copyright © 2003 - 20011 Ronald D. Grindle. All Rights Reserved.