|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.swing.tree.DefaultMutableTreeNode
wxtpages.unit
wxtpages.unitDBContent
unitDBContent instances holds pieces of content that will be placed in templates to form a page. An instance of unitDBContent match a content element in the script.
Field Summary |
Fields inherited from class wxtpages.unit |
CONTENT_TYPE, DBCONTENT_TYPE, GROUP_TYPE, m_absoluteUri, m_description, m_Doc, m_GroupMaster, m_lastTimeUsed, m_myElement, m_name, m_optionMap, m_originalUri, m_parameterMap, m_propertyMap, m_txtContent, m_type, PAGE_TYPE, TEMPLATE_TYPE, TEXTCONTENT_TYPE, TRANSFORMATION_TYPE, UNIT_TYPE |
Fields inherited from class javax.swing.tree.DefaultMutableTreeNode |
allowsChildren, children, EMPTY_ENUMERATION, parent, userObject |
Constructor Summary | |
unitDBContent(unitGroup master,
org.w3c.dom.Element elt,
unit owner)
Creates a new instance of unitDBContent, as it appears in the script |
|
unitDBContent(unitGroup master,
java.lang.String loc,
unit owner)
Creates a new instance of unitDBContent, as atemporary unit in respons to a PI |
Method Summary | |
protected void |
accessDatabase(command cmd)
|
protected boolean |
establishDom()
Attempt to establish the DOM for this unit. |
protected org.w3c.dom.Document |
establishInputDom(java.lang.String text)
Attempt to establish the DOM for the input to the database. |
void |
execute(java.sql.Connection db,
java.lang.String sqlquery)
|
boolean |
exist(java.lang.String node)
|
org.w3c.dom.NodeList |
getNodeList(command cmd)
Get a list of nodes according to the xpath specifyed in cmd |
java.sql.Connection |
handleDBconn(java.lang.String passwd)
Connects to the spesified database on host |
void |
nodeProsess(org.w3c.dom.Node node,
java.lang.String tableName)
|
protected java.lang.String |
parseToXml(java.lang.String inputString,
java.sql.Connection dbConn)
Creates valid and structured xml from input. |
boolean |
prepare(unit p,
java.lang.String theCommonName,
java.lang.String theCommonValue)
Prepare this unitDBContent with imports from non-content files. |
protected java.lang.String |
putToDatabase(java.lang.String tablename,
java.lang.String xmlfile,
java.sql.Connection dbConn)
The methode takes a tablename for table to be updated / inserted to, and a xml file to be parsed into INSERT or UPDATE sql statments. |
static java.lang.String |
readFromFile(java.lang.String input)
Reads a file and put the content into a string |
Methods inherited from class javax.swing.tree.DefaultMutableTreeNode |
add, breadthFirstEnumeration, children, clone, depthFirstEnumeration, getAllowsChildren, getChildAfter, getChildAt, getChildBefore, getChildCount, getDepth, getFirstChild, getFirstLeaf, getIndex, getLastChild, getLastLeaf, getLeafCount, getLevel, getNextLeaf, getNextNode, getNextSibling, getParent, getPath, getPathToRoot, getPreviousLeaf, getPreviousNode, getPreviousSibling, getRoot, getSharedAncestor, getSiblingCount, getUserObject, getUserObjectPath, insert, isLeaf, isNodeAncestor, isNodeChild, isNodeDescendant, isNodeRelated, isNodeSibling, isRoot, pathFromAncestorEnumeration, postorderEnumeration, preorderEnumeration, remove, remove, removeAllChildren, removeFromParent, setAllowsChildren, setParent, setUserObject |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public unitDBContent(unitGroup master, org.w3c.dom.Element elt, unit owner) throws java.lang.Exception
master
- The unitGroup object that owns this content objectelt
- The element in the script that defines this unitContent objectowner
- The unit that owns this unitContent, normally a unitPage-object
java.lang.Exception
- when the object cannot be establishedpublic unitDBContent(unitGroup master, java.lang.String loc, unit owner) throws java.lang.Exception
master
- The unitGroup object that owns this content objectloc
- Where the unitContent object is storedowner
- The unit that owns this unitContent, normally a unitPage-object
java.lang.Exception
- when the object cannot be establishedMethod Detail |
public boolean prepare(unit p, java.lang.String theCommonName, java.lang.String theCommonValue)
prepare
in class unit
p
- The unit that will use this unit as content, may not be nulltheCommonName
- The name used for common resources in the materialtheCommonValue
- The value that we will use
public java.sql.Connection handleDBconn(java.lang.String passwd)
passwd
- Password for username
protected java.lang.String parseToXml(java.lang.String inputString, java.sql.Connection dbConn)
dbConn
- Connection ObjectinputString
- String with result from handleDBconn
protected java.lang.String putToDatabase(java.lang.String tablename, java.lang.String xmlfile, java.sql.Connection dbConn)
tablename
- Name of table to be used for update / insertionxmlfile
- XML-content file with information to be updated / inserteddbConn
- Database connection objectpublic void nodeProsess(org.w3c.dom.Node node, java.lang.String tableName) throws java.io.IOException
java.io.IOException
public boolean exist(java.lang.String node)
public void execute(java.sql.Connection db, java.lang.String sqlquery)
public static java.lang.String readFromFile(java.lang.String input)
input
- Location for file to be read
protected void accessDatabase(command cmd)
protected boolean establishDom()
establishDom
in class unit
protected org.w3c.dom.Document establishInputDom(java.lang.String text)
public org.w3c.dom.NodeList getNodeList(command cmd)
getNodeList
in class unit
cmd
- the command that controls the listproduction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |