ca.cbc.sportwire.servlet.data
Class DOMDBFactory

java.lang.Object
  |
  +--ca.cbc.sportwire.servlet.data.DOMDBFactory
All Implemented Interfaces:
DOMFactory, GlobalCacheProperties, SportPageProperties

public class DOMDBFactory
extends java.lang.Object
implements DOMFactory, SportPageProperties, GlobalCacheProperties

DOMDBFactory: creates DocumentFile DOM xml-doc data object; installed by the BasicPageHandler as the $xml variable into the context; this provides access to a DOM built from the remainder of the pathinfo.

This class is a little strange; historically, it was a page handler but it migrated to become a factory for the DefaultPageHandler's selection of the means to load a page ending in the XML_SUFFIX. Note too that it can't be a singleton because it needs the webapp properties to function, so it stashes itself in the global ExtendedProperties' MRU

Created: Wed Dec 5 23:49:11 2001
 $Log: DOMFileFactory.java,v $
 Revision 1.6  2002/02/10 05:45:43  garym
 implement $xml.doms(perlregex)

 Revision 1.5  2002/01/31 05:36:59  garym
 added xsl example

 Revision 1.4  2002/01/31 05:33:27  garym
 fixed bug in search for xsl files

 Revision 1.3  2002/01/29 19:33:45  garym
 fixed concurrency bug with global config

 Revision 1.2  2002/01/28 07:01:36  garym
 Implement JDOM transform caching and document parse thread.

 Revision 1.1  2002/01/24 19:50:20  garym
 Major restructuring of beans and pagehandlers

 Revision 1.12  2002/01/14 21:51:46  garym
 bug fixes in topics and config files migration to Extended Properties

 Revision 1.11  2002/01/04 06:12:46  garym
 default page handling of XML files obsolesces DOMPageHandler

 Revision 1.10  2002/01/03 03:36:27  garym
 Abstracted periodic-refresh data cache objects

 Revision 1.9  2001/12/24 05:47:56  garym
 Fixed interface error on DOM data item loading

 Revision 1.8  2001/12/23 17:55:23  garym
 Allow for multiple SportPage apps on one JVM

 Revision 1.7  2001/12/17 09:36:28  garym
 default page bug fixed. debug msg errors in Lineup and vcal

 Revision 1.5  2001/12/15 02:15:59  garym
 initial release to CBC staging server

 Revision 1.4  2001/12/14 21:12:29  garym
 include file debugging

 Revision 1.3  2001/12/08 02:53:15  garym
 Defaults are overlaid with the topic defaults

 Revision 1.2  2001/12/06 21:03:24  garym
 Needed List wrapper around W3C NodeList

 Revision 1.1  2001/12/06 16:29:51  garym
 Implemented DOM object support and the Bio page handler


 

Version:
$Id: DOMDBFactory.java,v 1.6 2002/02/10 05:45:43 garym Exp $
Author:
Gary Lawrence Murphy
See Also:
BioPageHandler, DocumentFile

Field Summary
(package private) static org.apache.log4j.Category cat
           
private static java.lang.String DOMDBFACTORY_PROPERTY
           
protected  org.apache.commons.collections.ExtendedProperties sc
          sc: holds the webapp configuration; set when the first instance is created.
 
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
private DOMDBFactory(org.apache.commons.collections.ExtendedProperties sc)
           
 
Method Summary
 DOMFile dom(PathList pathinfo)
          dom: Returns the DOM object from pathlist; this is used in SportPage to get a DOM from the remainder of the path_info (not yet implemented for the SQL case)
 DOMFile dom(java.lang.String spec)
          dom returns the DOM object according to a possibly custom DOM class specified by a dom.data.class property.
static DOMDBFactory getInstance(org.apache.commons.collections.ExtendedProperties sc)
          getInstance: returns a factory for use in a template
 DOMFile loadDom(java.lang.String sql)
          loadDom: fetches the SQL as a DOMFile, based on the dom.db.class property setting for the type of DOM object
 
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

DOMDBFACTORY_PROPERTY

private static final java.lang.String DOMDBFACTORY_PROPERTY

sc

protected org.apache.commons.collections.ExtendedProperties sc
sc: holds the webapp configuration; set when the first instance is created.
Constructor Detail

DOMDBFactory

private DOMDBFactory(org.apache.commons.collections.ExtendedProperties sc)
Method Detail

getInstance

public static DOMDBFactory getInstance(org.apache.commons.collections.ExtendedProperties sc)
getInstance: returns a factory for use in a template
Parameters:
sc - an ExtendedProperties value
Returns:
the DOMDBFactory value

dom

public DOMFile dom(PathList pathinfo)
dom: Returns the DOM object from pathlist; this is used in SportPage to get a DOM from the remainder of the path_info (not yet implemented for the SQL case)
Specified by:
dom in interface DOMFactory
Parameters:
pathinfo - a PathList value
Returns:
a JDOMFile value

dom

public DOMFile dom(java.lang.String spec)
dom returns the DOM object according to a possibly custom DOM class specified by a dom.data.class property. If the SQL cannot be fetched, a null is returned and the trouble logged.
Specified by:
dom in interface DOMFactory
Parameters:
spec - a String SQL value
Returns:
a JDOMFile value or null if there were problems

loadDom

public DOMFile loadDom(java.lang.String sql)
loadDom: fetches the SQL as a DOMFile, based on the dom.db.class property setting for the type of DOM object
Parameters:
filename - a String value
Returns:
a JDOMFile value