ccl.servlet
Class XMLExporter

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--ccl.servlet.XMLExporter
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public abstract class XMLExporter
extends javax.servlet.http.HttpServlet

This servlet provides code to export data from a database and print them out as xml. To make use of this class inherit from this one and implement the 'getConnection' and 'getDatabase' methods.

See Also:
Serialized Form

Constructor Summary
XMLExporter()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Invoked from the servlet engine to serve the database content as xml page.
abstract  java.sql.Connection getConnection()
          Creates a connection object in the class which uses this class.
abstract  java.lang.String getDatabase()
          Returns a database name used for the xml to specify this database.
static java.lang.String printEscaped(char ch)
          Deprecated. Use ccl.xml.XMLUtil.escaped(char) instead.
static java.lang.String printEscaped(java.lang.String source)
          Deprecated. Use ccl.xml.XMLUtil.escaped(String) instead.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLExporter

public XMLExporter()
Method Detail

printEscaped

public static java.lang.String printEscaped(char ch)
Deprecated. Use ccl.xml.XMLUtil.escaped(char) instead.

If there is a suitable entity reference for this character, print it. The list of available entity references is almost but not identical between XML and HTML.


printEscaped

public static java.lang.String printEscaped(java.lang.String source)
Deprecated. Use ccl.xml.XMLUtil.escaped(String) instead.

Escapes a string so it may be printed as text content or attribute value. Non printable characters are escaped using character references. Where the format specifies a deault entity reference, that reference is used (e.g. <).

Parameters:
source - the string to escape or "" for null.

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
Invoked from the servlet engine to serve the database content as xml page.

Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
java.io.IOException - in case anything goes wrong writing output to the http servlet response.
javax.servlet.ServletException - in case the servlet has a failure.

getConnection

public abstract java.sql.Connection getConnection()
Creates a connection object in the class which uses this class.


getDatabase

public abstract java.lang.String getDatabase()
Returns a database name used for the xml to specify this database.