com.sonoma
Class XMLUtility

java.lang.Object
  |
  +--com.sonoma.XMLUtility

public class XMLUtility
extends java.lang.Object

Utility 'helper' that handles XML operations to create, load, save, and add to documents. Other classes and JSP pages use this object instead of Xerces or XML. XMLUtility.java


Field Summary
protected  java.lang.String filename
           
 
Constructor Summary
XMLUtility()
          Creates new XMLUtility
 
Method Summary
 org.w3c.dom.Node createTextElement(org.w3c.dom.Document doc, java.lang.String partName, java.lang.String value)
          creates a new node based on the partName and value
 org.w3c.dom.Node createTextElement(java.lang.String partName, java.lang.String value)
          Deprecated.  
 org.w3c.dom.Node getNode(org.w3c.dom.Document doc, java.lang.String XPathQuery)
          Returns an XML node object from the XPath query
 org.w3c.dom.Document loadDoc(java.lang.String strFileName)
          Loads an XML file
 boolean saveDoc(org.w3c.dom.Document doc, java.lang.String strFileName)
          This function is not yet working! There seems to be some buffer size issues Use the XMLDocumentWriter instead (for now)
 java.lang.String setAdmin(java.lang.String sFileName, java.lang.String userName, java.lang.String password)
          setLogin should be moved to a security class Different from set Login.
 org.w3c.dom.Node setDocRootNode()
          Deprecated.  
 java.lang.String setLogin(java.lang.String sFileName, java.lang.String userName)
          setLogin should be moved to a security class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filename

protected java.lang.String filename
Constructor Detail

XMLUtility

public XMLUtility()
Creates new XMLUtility
Method Detail

setDocRootNode

public org.w3c.dom.Node setDocRootNode()
Deprecated.  

Set a document root and return a node - not supported!

loadDoc

public org.w3c.dom.Document loadDoc(java.lang.String strFileName)
Loads an XML file
Parameters:
FileName - full path to the xml file

setLogin

public java.lang.String setLogin(java.lang.String sFileName,
                                 java.lang.String userName)
setLogin should be moved to a security class
Parameters:
sFileName - full path to xml file
userName - the name of the user
Returns:
Returns the user directory (if found) or null (if not found)

setAdmin

public java.lang.String setAdmin(java.lang.String sFileName,
                                 java.lang.String userName,
                                 java.lang.String password)
setLogin should be moved to a security class Different from set Login. Using a password actually gives permissions to do stuff
Parameters:
sFileName - full path to xml file
userName - the name of the user
password - the user's password
Returns:
Returns the user directory (if found) or null (if not found)

createTextElement

public org.w3c.dom.Node createTextElement(java.lang.String partName,
                                          java.lang.String value)
Deprecated.  

Deprecated. Creates a new node based on the partName and value

createTextElement

public org.w3c.dom.Node createTextElement(org.w3c.dom.Document doc,
                                          java.lang.String partName,
                                          java.lang.String value)
creates a new node based on the partName and value

getNode

public org.w3c.dom.Node getNode(org.w3c.dom.Document doc,
                                java.lang.String XPathQuery)
Returns an XML node object from the XPath query
Parameters:
doc - the xml document to be queried
XPath - the XPath query to find the desired node
Returns:
The node if found or null

saveDoc

public boolean saveDoc(org.w3c.dom.Document doc,
                       java.lang.String strFileName)
This function is not yet working! There seems to be some buffer size issues Use the XMLDocumentWriter instead (for now)