|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.gouv.culture.sdx.utils.SdxObjectImpl
fr.gouv.culture.sdx.utils.rdbms.JDBC
fr.gouv.culture.sdx.utils.rdbms.DataSourceComponentBacked
fr.gouv.culture.sdx.repository.AbstractDataSourceComponentBackedRepository
Created by IntelliJ IDEA. User: rpandey Date: Feb 27, 2003 Time: 3:24:27 PM To change this template use Options | File Templates.
Nested Class Summary |
Nested classes inherited from class fr.gouv.culture.sdx.utils.rdbms.JDBC |
JDBC.QueryExecutor, JDBC.Template |
Field Summary | |
protected static java.lang.String |
FIELD_ID
Constant for a field name in a table |
protected boolean |
isDefault
True if this is a default repository for an application. |
protected int |
PARAM_INDEX_FIELD_ID
|
protected java.util.Hashtable |
props
The application's properties. |
Fields inherited from class fr.gouv.culture.sdx.utils.rdbms.DataSourceComponentBacked |
ATTRIBUTE_DSI, dbSelector, dsi, manager |
Fields inherited from class fr.gouv.culture.sdx.utils.rdbms.JDBC |
id, tableName |
Fields inherited from class fr.gouv.culture.sdx.utils.SdxObjectImpl |
encoding, logger |
Fields inherited from interface fr.gouv.culture.sdx.repository.Repository |
ATTRIBUTE_DEFAULT, ATTRIBUTE_ID, ATTRIBUTE_REF, ATTRIBUTE_TYPE, CLASS_NAME_SUFFIX, ELEMENT_NAME_REPOSITORIES, ELEMENT_NAME_REPOSITORY, PACKAGE_QUALNAME |
Constructor Summary | |
AbstractDataSourceComponentBackedRepository()
|
Method Summary | |
void |
add(Document doc,
RepositoryConnection c)
Does param checks for subclasses |
void |
checkConnection(RepositoryConnection c)
|
protected java.lang.String |
checkEncoding(java.lang.String encoding)
Verifies an encoding string, if not supported by JVM default is used, UTF-8. |
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
|
void |
delete(Document doc,
RepositoryConnection c)
Does param checks for subclasses |
boolean |
exists(java.lang.String id,
RepositoryConnection conn)
|
void |
get(Document doc,
java.io.OutputStream os,
RepositoryConnection c)
Does param checks for subclasses |
protected java.lang.String |
getDocumentGetQuery()
Returns an SQL query that could select a document using its id. |
java.lang.String |
getId()
Returns the identifier for this repository within an application. |
boolean |
isDefault()
Returns whether it is a default repository for an application. |
protected void |
loadBaseConfiguration(org.apache.avalon.framework.configuration.Configuration configuration)
Loads base configuration common to all repositories. |
java.io.InputStream |
openStream(Document doc,
java.lang.String encoding,
RepositoryConnection c)
Does param checks for subclasses |
void |
optimize()
Utility method for repository maintenance, normally used to optimize indices of Lucene based repositories It is the responsibility of the Repository to ensure that unnecessary optimizations are not performed when this method is called. |
void |
setIsDefault(boolean b)
Sets the isDefault flag for the repository |
void |
setProperties(java.util.Hashtable props)
Sets Properties for the subclasses. |
void |
toSAX(ParsableDocument doc,
org.apache.cocoon.xml.XMLConsumer consumer,
RepositoryConnection c)
Does param checks for subclasses |
Methods inherited from class fr.gouv.culture.sdx.utils.rdbms.DataSourceComponentBacked |
compose, getDataSourceComponent, releaseDataSourceComponent |
Methods inherited from class fr.gouv.culture.sdx.utils.rdbms.JDBC |
createTable, getTableCreationQuery, getTableName, handleUnsupportedTokens |
Methods inherited from class fr.gouv.culture.sdx.utils.SdxObjectImpl |
enableLogging, getChildLogger, setEncoding |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface fr.gouv.culture.sdx.repository.Repository |
empty, getConnection, init, lists, releaseConnection, size |
Methods inherited from interface org.apache.avalon.framework.component.Composable |
compose |
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled |
enableLogging |
Field Detail |
protected java.util.Hashtable props
protected boolean isDefault
protected static final java.lang.String FIELD_ID
protected final int PARAM_INDEX_FIELD_ID
Constructor Detail |
public AbstractDataSourceComponentBackedRepository()
Method Detail |
public java.lang.String getId()
getId
in interface Repository
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
configure
in class DataSourceComponentBacked
org.apache.avalon.framework.configuration.ConfigurationException
protected void loadBaseConfiguration(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configuration
- The configuration object
The parameter required are an id for the repository, an optional attribute
indicating if the repository is the default within a document base is also handled
but the default if not specified will be false.
org.apache.avalon.framework.configuration.ConfigurationException
we should link to this in the future when we have better documentation capabilities
public boolean isDefault()
Repository
isDefault
in interface Repository
public void setProperties(java.util.Hashtable props)
setProperties
in interface Repository
props
- A Properties object containing path information for an instance of an application.public void delete(Document doc, RepositoryConnection c) throws SDXException
delete
in interface Repository
doc
- The document to delete.
SDXException
public void add(Document doc, RepositoryConnection c) throws SDXException
add
in interface Repository
doc
- The document to add.c
- A connection to the repository.
SDXException
public java.io.InputStream openStream(Document doc, java.lang.String encoding, RepositoryConnection c) throws SDXException
openStream
in interface Repository
doc
- The document to read.encoding
- Should be null
as not verified here, but in subClasses with checkEncoding() method.c
- A connection to the repository.
SDXException
public void get(Document doc, java.io.OutputStream os, RepositoryConnection c) throws SDXException
get
in interface Repository
doc
- The document to read.os
- The output stream where to write.c
- A connection to the repository.
SDXException
public void toSAX(ParsableDocument doc, org.apache.cocoon.xml.XMLConsumer consumer, RepositoryConnection c) throws SDXException
toSAX
in interface Repository
doc
- The document.consumer
- A SAX content handler to feed with events.
The wrapped contentHandler for including events within an XSP page contentHandler should be created using IncludeXMLConsumer stripper = new IncludeXMLConsumer(xspContentHandler);
c
- A connection to the repository.
SDXException
public void setIsDefault(boolean b)
setIsDefault
in interface Repository
protected java.lang.String checkEncoding(java.lang.String encoding) throws SDXException
encoding
-
SDXException
public void checkConnection(RepositoryConnection c) throws SDXException
SDXException
public void optimize() throws SDXException
Repository
optimize
in interface Repository
SDXException
protected java.lang.String getDocumentGetQuery()
This query should have one parameter for the id.
public boolean exists(java.lang.String id, RepositoryConnection conn)
exists
in interface Repository
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |