|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.beasys.commerce.axiom.document.ref.DefaultDocumentProvider | +--com.beasys.commerce.axiom.document.ref.RefDocumentProvider
The reference implementation DocumentProvider.
This document provider utilizes a database to maintain the document metadata attributes, while the documents are kept on the filesystem and the metadata is kept in XML files on the filesystem.
It understands the following initializion properties.
jdbc.url
: Specifies the JDBC URL of the database to
connect to.
jdbc.driver
: Specifies the JDBC driver class to load.
jdbc.isPooled
: If "true" or if jdbc.url starts with
"jdbc:weblogic:pool" or "jdbc:weblogic:jts", then assumes the connection is
pooled and won't cache it. If anything else, assumes the connection is not
pooled and will maintain one connection.
docBase
: Specifies the base directory of where the
documents are stored under. Assumes all paths coming from the database are
relative to this.
iw.schemaBase
: Specifies the base directory of where the
Interwoven datacapture.cfg files live. The provider will, on load, recurse
through the file structure and load all datacapture.cfg files.
schemaXML
: Specifies the path to the directory containing
XML files following the doc-schemas DTD which contain the schema
information. This will recurse through the directory, loading all files
ening in ".xml". This will be processed after iw.schemaBase
(could override things found in iw.schemaBase).
user
and password
can be
specified as well).
StatementParams
Field Summary | |
protected java.sql.Connection |
connection
Our database connection. |
static java.lang.String |
DOC_MD_TABLE
The name of the wlcs_document_metadata table. |
static java.lang.String |
DOC_TABLE
The name of the wlcs_document table. |
protected java.io.File |
docBase
The docBase of the document. |
protected int |
isolationLevel
Our transaction isolation level. |
protected java.sql.Driver |
jdbcDriver
Our JDBC driver to use. |
protected boolean |
jdbcIsPooled
Are we using a pooled JDBC driver. |
protected java.util.Properties |
jdbcProps
The JDBC connection properties. |
protected java.lang.String |
jdbcURL
The JDBC url to use. |
static java.lang.String |
metadataSelectSQL
The SELECT part to get a DocumentMetadataDef. |
protected java.util.Map |
schemas
Our map of schema name to DefaultDocumentSchema |
Constructor Summary | |
RefDocumentProvider()
|
Method Summary | |
void |
close()
Close oursevles. |
static void |
close(java.sql.Connection con)
Safely close a connection, ignoring any exceptions. |
static void |
close(java.sql.ResultSet rs)
Safely close a result set. |
static void |
close(java.sql.Statement stmt)
Safely close a statement. |
static DocumentException |
convert(java.sql.SQLException ex)
Utility method to turn a SQLException into a DocumentException. |
protected void |
fillInMetadataDefs(java.sql.Connection con,
java.util.List list)
Fill in the remaining document metadata (i.e. |
DocumentIterator |
findDocumentIds(Search params)
Return the list of String document ids that match the specified search parameters. |
DocumentIterator |
findDocumentMetadata(Search params)
Return the list of DocumentMetadataDefs which match the given search parameters object. |
DocumentIterator |
findDocuments(Search params)
Return the list of DocumentDefs that match the specified search parameters. |
protected java.sql.Connection |
getConnection()
Get a/the connection to the database. |
java.sql.Timestamp |
getDocumentModifiedDate(java.lang.String id)
Get just the last modified date of a document, without brining back all the metadata. |
protected RefDocumentMetadata |
getMetadataDef(java.sql.ResultSet rs)
Get a metadata def from the given result set (which should follow the select in metadataSelectSQL). |
DocumentSchemaDef |
getSchema(java.lang.String name)
Return the names schema. |
DocumentIterator |
getSchemaNames()
Return the list of schema names. |
java.util.Map |
getSchemas()
Return the map of schema name to schema. |
int |
getTransactionIsolation()
Get the transaction isolation level. |
void |
init(java.util.Properties p)
Initialize yourself. |
protected void |
loadIWSchemas(java.lang.String basePath)
Load schema information from Interwoven datacapture.cfg files. |
protected void |
loadSchemas(java.util.Collection col)
Add the DocumentSchemaDefs found in the collection into our schema map. |
protected void |
loadSchemas(java.lang.String path)
Load schema information from doc-schema xml files. |
void |
reset()
Reset oursevles. |
void |
setTransactionIsolation(int level)
Set the transaction isolation level. |
Methods inherited from class com.beasys.commerce.axiom.document.ref.DefaultDocumentProvider |
getDocument,
getDocumentMetadata |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public static final java.lang.String DOC_TABLE
public static final java.lang.String DOC_MD_TABLE
protected int isolationLevel
protected java.util.Map schemas
protected java.sql.Connection connection
This will be null if we're using a pooled connection.
protected java.sql.Driver jdbcDriver
protected java.lang.String jdbcURL
protected boolean jdbcIsPooled
protected java.util.Properties jdbcProps
protected java.io.File docBase
public static final java.lang.String metadataSelectSQL
Constructor Detail |
public RefDocumentProvider()
Method Detail |
public void init(java.util.Properties p) throws DocumentException
properties
- the configuration propertiesprotected void loadIWSchemas(java.lang.String basePath) throws DocumentException
If basePath points to a directory, this will recurse into the directory, looking for "datacapture.cfg" files. If basePath is a file that exists and can be read, it will be loaded.
RefSchemaGenerator
protected void loadSchemas(java.lang.String path) throws DocumentException
RefSchemaGenerator
protected void loadSchemas(java.util.Collection col) throws DocumentException
public void reset() throws DocumentException
public void close() throws DocumentException
public int getTransactionIsolation()
public void setTransactionIsolation(int level) throws DocumentException
protected java.sql.Connection getConnection() throws DocumentException
public DocumentIterator findDocumentIds(Search params) throws DocumentException
params
- the search parameters.public DocumentIterator findDocuments(Search params) throws DocumentException
params
- the search parameters.public DocumentIterator findDocumentMetadata(Search params) throws DocumentException
params
- the search parameters.public java.sql.Timestamp getDocumentModifiedDate(java.lang.String id) throws DocumentException
id
- the document id.protected RefDocumentMetadata getMetadataDef(java.sql.ResultSet rs) throws java.sql.SQLException
protected void fillInMetadataDefs(java.sql.Connection con, java.util.List list) throws java.sql.SQLException
public DocumentIterator getSchemaNames()
public DocumentSchemaDef getSchema(java.lang.String name)
schemaName
- the name of the schema to find.public java.util.Map getSchemas()
public static DocumentException convert(java.sql.SQLException ex)
public static void close(java.sql.Connection con)
public static void close(java.sql.Statement stmt)
public static void close(java.sql.ResultSet rs)
|
BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |