org.dbforms.config
Class DbFormsConfig

java.lang.Object
  extended by org.dbforms.config.DbFormsConfig

public class DbFormsConfig
extends Object

This class gets populated with data from the dbforms-config.xml file by the ConfigServlet. This class is a kind of "single point of entry" for configuration data: it contains the definitions of tables, fields, fieldtypes, keys etc. and even the definitions of data sources (see dbforms-config.xml) Many components of the dbforms-frameworks use the data stored in this class.

Author:
Joe Peer

Field Summary
static String CONFIG
          DOCUMENT ME!
 
Constructor Summary
DbFormsConfig()
          Creates a new DbFormsConfig object.
 
Method Summary
 void addDbConnection(DbConnection dbConnection)
          DOCUMENT ME!
 void addInterceptor(Interceptor interceptor)
          Add an global interceptor
 void addParam(String name, String value)
           
 void addTable(Table table)
          DOCUMENT ME!
 Connection getConnection()
          Just returns the default connection
 Connection getConnection(String dbConnectionName)
          Get a connection using the connection name specified into the xml configuration file.
 DataSource getDataSource(String dbConnectionName)
          DOCUMENT ME!
 String getDefaultEscaperClass()
          DOCUMENT ME!
 String getDefaultFormatterClass()
          DOCUMENT ME!
 IEscaper getEscaper()
          DOCUMENT ME!
 Vector getInterceptors()
          Get all the global interceptor objects
 String getRealPath()
           
 ServletConfig getServletConfig()
          get access to configuration of config servlet
 ServletContext getServletContext()
          Get access to servlet context in order to interoperate with other components of the web application
 Table getTable(int index)
          DOCUMENT ME!
 Table getTableByName(String name)
          DOCUMENT ME!
 boolean hasInterceptors()
          Check if this table has got interceptors.
 String replaceVariables(String s)
          Replaces the occurens from REALPATH in s with realpath.
 void setDefaultEscaperClass(String string)
          DOCUMENT ME!
 void setDefaultFormatterClass(String string)
          DOCUMENT ME!
 void setDOMFactoryClass(String string)
          DOCUMENT ME!
 void setResolveConfigPropertyClass(String resolveConfigPropertyClass)
           
 void setServletConfig(ServletConfig servletConfig)
          DOCUMENT ME!
 String toString()
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CONFIG

public static final String CONFIG
DOCUMENT ME!

See Also:
Constant Field Values
Constructor Detail

DbFormsConfig

public DbFormsConfig()
Creates a new DbFormsConfig object.

Parameters:
realPath - local path to the application on local server
Method Detail

getConnection

public Connection getConnection()
                         throws IllegalArgumentException,
                                SQLException
Just returns the default connection

Returns:
a JDBC connection object
Throws:
IllegalArgumentException - if any error occurs
SQLException

getConnection

public Connection getConnection(String dbConnectionName)
                         throws IllegalArgumentException,
                                SQLException
Get a connection using the connection name specified into the xml configuration file.

Parameters:
dbConnectionName - the name of the DbConnection element
Returns:
a JDBC connection object
Throws:
IllegalArgumentException - if any error occurs
SQLException

setDOMFactoryClass

public void setDOMFactoryClass(String string)
DOCUMENT ME!

Parameters:
string -

setResolveConfigPropertyClass

public void setResolveConfigPropertyClass(String resolveConfigPropertyClass)

getDataSource

public DataSource getDataSource(String dbConnectionName)
DOCUMENT ME!

Parameters:
dbConnectionName - DOCUMENT ME!
Returns:
DOCUMENT ME!

setDefaultEscaperClass

public void setDefaultEscaperClass(String string)
DOCUMENT ME!

Parameters:
string -

getDefaultEscaperClass

public String getDefaultEscaperClass()
DOCUMENT ME!

Returns:

setDefaultFormatterClass

public void setDefaultFormatterClass(String string)
DOCUMENT ME!

Parameters:
string -

getDefaultFormatterClass

public String getDefaultFormatterClass()
DOCUMENT ME!

Returns:

getEscaper

public IEscaper getEscaper()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getInterceptors

public Vector getInterceptors()
Get all the global interceptor objects

Returns:
a vector containing all the interceptor objects

getRealPath

public String getRealPath()

setServletConfig

public void setServletConfig(ServletConfig servletConfig)
DOCUMENT ME!

Parameters:
servletConfig - DOCUMENT ME!

getServletConfig

public ServletConfig getServletConfig()
get access to configuration of config servlet

Returns:
the store config

getServletContext

public ServletContext getServletContext()
Get access to servlet context in order to interoperate with other components of the web application

Returns:
the stored context

getTable

public Table getTable(int index)
DOCUMENT ME!

Parameters:
index - DOCUMENT ME!
Returns:
DOCUMENT ME!

getTableByName

public Table getTableByName(String name)
DOCUMENT ME!

Parameters:
name - DOCUMENT ME!
Returns:
DOCUMENT ME!

addDbConnection

public void addDbConnection(DbConnection dbConnection)
DOCUMENT ME!

Parameters:
dbConnection - DOCUMENT ME!

addInterceptor

public void addInterceptor(Interceptor interceptor)
Add an global interceptor

Parameters:
interceptor - the interceptor to add

addParam

public void addParam(String name,
                     String value)

addTable

public void addTable(Table table)
DOCUMENT ME!

Parameters:
table - DOCUMENT ME!

hasInterceptors

public boolean hasInterceptors()
Check if this table has got interceptors.

Returns:
true if the table contains interceptors, false otherwise

toString

public String toString()
DOCUMENT ME!

Overrides:
toString in class Object
Returns:
DOCUMENT ME!

replaceVariables

public String replaceVariables(String s)
Replaces the occurens from REALPATH in s with realpath.

Parameters:
s - the string containing the REALPATH token
realpath - the value used to replace the REALPATH token
Returns:
the input string, with the REALPATH token replaced with the realpath value


Copyright © 2002-2006 DbForms. All Rights Reserved.