com.xmlserv.app.shared
Class DBDocument

java.lang.Object
  |
  +--com.xmlserv.app.shared.DBDocument

public class DBDocument
extends java.lang.Object

This class has a twofold purpose:

In the first case an existing SODocument must be given as an argument to the constructor. Later on save() can be used to write data to the DB.
When used to read data from the DB, no SODocument is needed. The XML version as well as the original document are available via DBDocument.


Constructor Summary
DBDocument(java.sql.Connection con, int id)
          Load the given document.
DBDocument(SODocument sodoc)
          Create a new document in the DB.
DBDocument(SODocument sodoc, int id)
          Replace the given existing document.
 
Method Summary
 java.io.InputStream getDocument(java.sql.Connection con)
          Get original document as saved in the document table.
 int getId()
           
 org.jdom.Document getXHTMLDocument(java.sql.Connection con)
          Get XHTML version of document.
protected  void load(java.sql.Connection con, int id)
           
protected  void load(SODocument sodoc, int id)
           
static void main(java.lang.String[] args)
           
 void save(java.sql.Connection con, javax.xml.transform.Source stylesheet, java.lang.String uid)
          Set systemid on stylesheet before calling...
 void save(java.sql.Connection con, java.lang.String stylesheet, java.lang.String uid)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DBDocument

public DBDocument(java.sql.Connection con,
                  int id)
           throws java.sql.SQLException
Load the given document.

DBDocument

public DBDocument(SODocument sodoc)
           throws java.io.IOException
Create a new document in the DB.

DBDocument

public DBDocument(SODocument sodoc,
                  int id)
           throws java.io.IOException
Replace the given existing document. The id is the dociment.id field, not xmldocument.id...
Method Detail

getDocument

public java.io.InputStream getDocument(java.sql.Connection con)
                                throws java.sql.SQLException
Get original document as saved in the document table.

getXHTMLDocument

public org.jdom.Document getXHTMLDocument(java.sql.Connection con)
                                   throws java.sql.SQLException,
                                          org.jdom.JDOMException
Get XHTML version of document.

save

public void save(java.sql.Connection con,
                 java.lang.String stylesheet,
                 java.lang.String uid)
          throws java.sql.SQLException,
                 java.io.IOException,
                 XMLServException

save

public void save(java.sql.Connection con,
                 javax.xml.transform.Source stylesheet,
                 java.lang.String uid)
          throws java.sql.SQLException,
                 java.io.IOException,
                 XMLServException
Set systemid on stylesheet before calling...
Parameters:
uid - Numeric user id.

load

protected void load(SODocument sodoc,
                    int id)
             throws java.io.IOException

load

protected void load(java.sql.Connection con,
                    int id)
             throws java.sql.SQLException

getId

public int getId()

main

public static void main(java.lang.String[] args)