com.qanavigation.XMLDB
Class XMLDBbasics

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

public class XMLDBbasics
extends Rslt

Class for handling XMLs in a DB. The concept of an XML file has been altered for this implementation. The topmost XML element here is also the parent element for all other elements, such as the document information. This has been done for the sake of the DB design. This allows any element (node, attribute, document info etc.) to have only one reference to a parent node and still enables the elements to be linked consistently without any ambiguity and still providing full navigability. 'get..' service calls do not spoil the status of this object on failure. The actual status is found with the object returned. XMLDBbasics isA Rslt


Field Summary
 DBacc2 m_DB
           
 
Method Summary
 Rslt chkDoc(java.lang.String p_UID)
           
 Rslt deleteNode(java.lang.String p_UID)
          Deletes a node.
 Rslt deleteXML(java.lang.String p_UID)
          Removes an entire XML from the DB.
 RsltString getAttrVal(java.lang.String p_UID, java.lang.String p_AttrName)
           
 java.lang.String[] getDTDInfo(java.lang.String p_parentUID)
           
 RsltTable getFileInfo(java.lang.String p_UID)
           
 RsltString getFirstUIDByParent(java.lang.String p_ElemType, java.lang.String p_ParUID)
          Gets the first occurrence of a sub element of the given type.
 java.lang.String getLastQCommand()
          Returns the last query command issued.
 RsltTable getNodeAsTable(java.lang.String p_UID)
          Should not deliver more than one!
 RsltTable getNodeAttrs(java.lang.String p_UID)
          Gets the list of attributes for a node as table.
 RsltString getNodeName(java.lang.String p_UID)
           
 SetList getNodes(java.lang.String p_ElemType)
          Retrieves only elements
 SetList getNodesByAttr(Rslt2DArray p_AttrSet)
          Provide the attributes and the values searched for in the QuerySet.
 SetList getNodesByAttr(java.lang.String p_ElemType, Rslt2DArray p_AttrSet)
          Provide the attributes and the values searched for in the QuerySet.
 SetList getNodesByAttrExclByAttr(java.lang.String p_ElemType, Rslt2DArray p_AttrSet, Rslt2DArray p_ExclAttrSet)
          Provide the element type name, the attributes and the values searched and the list of attributes and values to be excluded for in the QuerySet.
 RsltTable getNodesByType(java.lang.String p_ElemType)
           
 RsltString getNodeVal(java.lang.String p_UID)
          Gets the value of a node.
 RsltString getParentID(RsltString p_UID)
           
 RsltTable getSubNodeVals(java.lang.String p_UID, java.lang.String p_SubNodeName)
           
 RsltString getTopNodeUID(RsltString p_UID)
          Gets the UID of the top node of the document, to which the node with the UID belongs to.
 RsltString getTopNodeUID(RsltString p_tNodeElem, RsltString 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.
 SetList getUIDLstByParent(java.lang.String p_ElemType, java.lang.String p_ParUID)
          Gets the list of nodes of the specified element type that belong to the parent UID.
 RsltTable getXNodeLstByParent(java.lang.String p_ParUID)
           
 RsltString importXML(org.w3c.dom.Document p_XMLdoc)
           
 RsltString newUID()
          Service call to get a new UID.
 Rslt writeFileInfo(java.lang.String p_UID, java.lang.String p_XMLfile)
           
 
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
 

Field Detail

m_DB

public DBacc2 m_DB
Method Detail

chkDoc

public Rslt chkDoc(java.lang.String p_UID)
Parameters:
p_UID -
Returns:

deleteNode

public Rslt deleteNode(java.lang.String p_UID)
Deletes a node. Runs through the list of subnodes. Normally not required for MySQL.


deleteXML

public Rslt deleteXML(java.lang.String p_UID)
Removes an entire XML from the DB.


getAttrVal

public RsltString getAttrVal(java.lang.String p_UID,
                             java.lang.String p_AttrName)
Parameters:
p_UID -
p_AttrName -
Returns:
The attributes value

getDTDInfo

public java.lang.String[] getDTDInfo(java.lang.String p_parentUID)
Parameters:
p_parentUID -
Returns:
String[0]: dtdName, String[1]: pubDTDID,

getFileInfo

public RsltTable getFileInfo(java.lang.String p_UID)
Parameters:
p_UID -
Returns:
RsltTable; Cols: Name, Path.

getLastQCommand

public java.lang.String getLastQCommand()
Returns the last query command issued. For debugging purposes.

Returns:

getNodeAsTable

public RsltTable getNodeAsTable(java.lang.String p_UID)
Should not deliver more than one! (Not restricted yet.)

Parameters:
p_UID -
Returns:
RsltTable; Col sequence: pUID, Name, Type.

getNodeAttrs

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

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

getNodeName

public RsltString getNodeName(java.lang.String p_UID)
Parameters:
p_UID -

getNodes

public SetList getNodes(java.lang.String p_ElemType)
Retrieves only elements

Parameters:
p_ElemType -
Returns:
SetList of UIDs.

getNodesByAttr

public SetList getNodesByAttr(Rslt2DArray p_AttrSet)
Provide the attributes and the values searched for in the QuerySet.

Parameters:
p_AttrSet -
Returns:
SetList of UIDs.

getNodesByAttr

public SetList getNodesByAttr(java.lang.String p_ElemType,
                              Rslt2DArray p_AttrSet)
Provide the attributes and the values searched for in the QuerySet.

Parameters:
p_ElemType -
p_AttrSet -
Returns:
SetList of UIDs.

getNodesByAttrExclByAttr

public SetList getNodesByAttrExclByAttr(java.lang.String p_ElemType,
                                        Rslt2DArray p_AttrSet,
                                        Rslt2DArray p_ExclAttrSet)
Provide the element type name, the attributes and the values searched and the list of attributes and values to be excluded for in the QuerySet.

Parameters:
p_ElemType -
p_AttrSet - Provide rows with Name, compare value, compare operator and flag "isNumeric" as string.
p_ExclAttrSet -
Returns:
SetList of UIDs.

getNodesByType

public RsltTable getNodesByType(java.lang.String p_ElemType)
Parameters:
p_ElemType -
Returns:
RsltTable; Cols: UID, Name, Type

getNodeVal

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

Parameters:
p_UID -
Returns:

getParentID

public RsltString getParentID(RsltString p_UID)
Parameters:
p_UID -
Returns:

getSubNodeVals

public RsltTable getSubNodeVals(java.lang.String p_UID,
                                java.lang.String p_SubNodeName)
Parameters:
p_UID -
p_SubNodeName -
Returns:

getTopNodeUID

public RsltString getTopNodeUID(RsltString 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:
The UID.

getTopNodeUID

public RsltString getTopNodeUID(RsltString p_tNodeElem,
                                RsltString 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_tNodeElem -
p_UID -
Returns:
The UID.

getFirstUIDByParent

public RsltString getFirstUIDByParent(java.lang.String p_ElemType,
                                      java.lang.String p_ParUID)
Gets the first occurrence of a sub element of the given type.

Parameters:
p_ElemType -
p_ParUID -
Returns:

getUIDLstByParent

public SetList getUIDLstByParent(java.lang.String p_ElemType,
                                 java.lang.String p_ParUID)
Gets the list of nodes of the specified element type that belong to the parent UID.
If element type is empty (""), all subelement of all types are retrieved.

Parameters:
p_ElemType -
p_ParUID -
Returns:
list of UIDs

getXNodeLstByParent

public RsltTable getXNodeLstByParent(java.lang.String p_ParUID)
Parameters:
p_ParUID -
Returns:
RsltTable; Cols: UID, Name, Type.

importXML

public RsltString importXML(org.w3c.dom.Document p_XMLdoc)
Parameters:
p_XMLdoc -
Returns:
the UID; the given or a new one.

newUID

public RsltString newUID()
Service call to get a new UID.

Returns:
the UID.

writeFileInfo

public Rslt writeFileInfo(java.lang.String p_UID,
                          java.lang.String p_XMLfile)


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