ca.cbc.sportwire.servlet.data
Class JDOMtext

java.lang.Object
  |
  +--ca.cbc.sportwire.servlet.data.DOMFile
        |
        +--ca.cbc.sportwire.servlet.data.JDOMFile
              |
              +--ca.cbc.sportwire.servlet.data.JDOMtext
All Implemented Interfaces:
GlobalCacheProperties, java.lang.Runnable, SportPageProperties

public class JDOMtext
extends JDOMFile

JDOMtext.java: Highly experimental -- uses an external process to create an HTML version of an ascii string, and then parses that text to get at the JDOM model.

Created: Mon Mar 4 00:51:28 2002
 $Log$

 

Version:
$Id$
Author:
Gary Lawrence Murphy

Field Summary
(package private) static org.apache.log4j.Category cat
           
private  java.lang.String html
           
 
Fields inherited from class ca.cbc.sportwire.servlet.data.JDOMFile
builder, document, filename, saxclass, sc, xml
 
Fields inherited from interface ca.cbc.sportwire.servlet.data.SportPageProperties
BEAN_SUFFIX, BEANFACTORY_VAR, CONTEXT_VAR, DATE_VAR, DEFAULT_EXTS, DEFAULT_INDEXES, DEFAULT_PAGE_SUFFIX, DEFAULT_SAX_DRIVER_CLASS, DEFAULT_TIMEZONE, DEFAULT_TOPIC, DOM_VAR, ERROR_TEMPLATE_VAR, EXCEPTION_VAR, EXTENSIONS_VAR, FALSE, GLOBAL_VAR, HOME_PROPERTY, INCLUDE_EXTS_PROPERTY, INCLUDE_VAR, INDEX_INDICATOR_VAR, INDEX_TEMPLATE_VAR, LAYOUT_TEMPLATE_VAR, MACRO_LIB_PROPERTY, MISSING_TEMPLATE_VAR, OUTPUT_VAR, PAGE_EXPIRE, PAGE_TEMPLATE_VAR, PANIC_404_PAGE, PANIC_404_PROPERTY, PANIC_500_PAGE, PANIC_500_PROPERTY, PARAM_PARSER_VAR, PATH_VAR, REQUEST_VAR, RESPONSE_VAR, SAX_CLASS_PROPERTY, SERVLET_DEBUG, SERVLET_LOGCONF_PROPERTY, SQL_SUFFIX, TEMPLATE_PATHS_PROPERTY, TIMEZONE_PROPERTY, TRUE, URI_VAR, VELOCITY_LOGFILE_DEFAULT, VELOCITY_LOGFILE_PROPERTY, XML_EXTS, XML_EXTS_PROPERTY, XML_PATHS_PROPERTY, XML_SUFFIX, XSL_EXTS, XSL_EXTS_PROPERTY, XSL_PATHS_PROPERTY
 
Fields inherited from interface ca.cbc.sportwire.servlet.data.GlobalCacheProperties
CACHE_DEFAULT_PERIOD, CACHE_DEFAULT_TIMEOUT, CACHE_PERIOD, CACHE_TIMEOUT, MRU_PROPERTY, MRU_VAR, TTL_PROPERTY, TTL_VAR
 
Constructor Summary
protected JDOMtext(org.apache.velocity.context.Context context)
           
protected JDOMtext(org.apache.commons.collections.ExtendedProperties sc)
           
protected JDOMtext(org.apache.commons.collections.ExtendedProperties sc, java.lang.String ascii)
           
 
Method Summary
 java.lang.String getHtml()
           
static JDOMFile getInstance(org.apache.velocity.context.Context context)
          getInstance: Creates a JDOMFile object with no document defined; does not cache the object.
static JDOMFile getInstance(org.apache.velocity.context.Context context, java.lang.String ascii)
          getInstance: Extracts the global properties from the context and calls that getInstance method.
static JDOMFile getInstance(org.apache.commons.collections.ExtendedProperties sc)
          getInstance: calls the (sc,file) version with a null filename)
static JDOMFile getInstance(org.apache.commons.collections.ExtendedProperties sc, java.lang.String ascii)
          getInstance: Returns the JDOM object if the filename is null, otherwise attempts to find a cached JDOM object in the MRU cache or creates a new one, loads the Document and then stashes the new object in the TTL.
 void run()
          run is the Thread method to parse the text and create the document.
 void setDocument(java.lang.String ignored)
          setDocument: spawns the thread to convert the "filename" String into HTML and from there into JDOM
 JDOMtext toJDom(java.lang.String ascii)
           
 
Methods inherited from class ca.cbc.sportwire.servlet.data.JDOMFile
getDocument, getFilename, getRootElement, getSaxclass, getXml, getXml, setFilename, setSaxclass, transform, transform, xpath, xpath
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

cat

static org.apache.log4j.Category cat

html

private java.lang.String html
Constructor Detail

JDOMtext

protected JDOMtext(org.apache.velocity.context.Context context)
            throws java.io.FileNotFoundException,
                   java.io.IOException

JDOMtext

protected JDOMtext(org.apache.commons.collections.ExtendedProperties sc)
            throws java.io.FileNotFoundException,
                   java.io.IOException

JDOMtext

protected JDOMtext(org.apache.commons.collections.ExtendedProperties sc,
                   java.lang.String ascii)
            throws java.io.FileNotFoundException,
                   java.io.IOException
Method Detail

getHtml

public java.lang.String getHtml()

getInstance

public static JDOMFile getInstance(org.apache.velocity.context.Context context)
                            throws java.io.FileNotFoundException,
                                   java.io.IOException
Description copied from class: JDOMFile
getInstance: Creates a JDOMFile object with no document defined; does not cache the object. It actually just extracts the global properties from the context and calls that version of getInstance.
Following copied from class: ca.cbc.sportwire.servlet.data.JDOMFile
Parameters:
context - a Context value
Returns:
a JDOMFile value
Throws:
java.io.FileNotFoundException - if an error occurs
java.io.IOException - if an error occurs

getInstance

public static JDOMFile getInstance(org.apache.velocity.context.Context context,
                                   java.lang.String ascii)
                            throws java.io.FileNotFoundException,
                                   java.io.IOException
getInstance: Extracts the global properties from the context and calls that getInstance method.
Parameters:
context - a Context value
filename - a String value
Returns:
a JDOMFile value
Throws:
java.io.FileNotFoundException - if an error occurs
java.io.IOException - if an error occurs

getInstance

public static JDOMFile getInstance(org.apache.commons.collections.ExtendedProperties sc)
                            throws java.io.FileNotFoundException,
                                   java.io.IOException
getInstance: calls the (sc,file) version with a null filename)
Parameters:
sc - an ExtendedProperties value
Returns:
a JDOMFile value
Throws:
java.io.FileNotFoundException - if an error occurs
java.io.IOException - if an error occurs

getInstance

public static JDOMFile getInstance(org.apache.commons.collections.ExtendedProperties sc,
                                   java.lang.String ascii)
                            throws java.io.FileNotFoundException,
                                   java.io.IOException
getInstance: Returns the JDOM object if the filename is null, otherwise attempts to find a cached JDOM object in the MRU cache or creates a new one, loads the Document and then stashes the new object in the TTL.
Parameters:
sc - a ExtendedProperties value
filename - a String value
Returns:
a JDOMFile value
Throws:
java.io.FileNotFoundException - if an error occurs
java.io.IOException - if an error occurs

toJDom

public JDOMtext toJDom(java.lang.String ascii)
                throws java.io.FileNotFoundException,
                       java.io.IOException

setDocument

public void setDocument(java.lang.String ignored)
                 throws java.io.FileNotFoundException,
                        java.io.IOException
setDocument: spawns the thread to convert the "filename" String into HTML and from there into JDOM
Overrides:
setDocument in class JDOMFile
Parameters:
ignored - String value
Throws:
java.io.FileNotFoundException - if an error occurs
java.io.IOException - if an error occurs

run

public void run()
run is the Thread method to parse the text and create the document. This is only called once, when the constructor is given an ASCII string.
Overrides:
run in class JDOMFile