|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.bea.p13n.content.document.ref.DefaultDocumentProvider | +--com.bea.p13n.content.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.dataSource
: Specifies the JNDI name of the datasource
to use to get database connections.
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.
jdbc.supportsLikeEscapeClause
: Specifies whether the
underlying database supports the SQL LIKE ESCAPE clause. If this is not
specified, the connection will be queried.
jdbc.isolationLevel
: Specifies the isolation level this
initialize with. Valid values are "READ_COMMITTED", "SERIALIZABLE",
"READ_UNCOMMITTED", "REPEATABLE_READ", and "NONE". Note: This option
is only valid if your are specifying a JDBC driver. You cannot specify this
option if you are connecting to a data source.
jdbc.column.<colName>
: Specifies an additional
column to the DOCUMENT table. The value is the comma-separated list of
property names that map onto that column. This can be specified multiple
times. This should be used in conjunction with the the correct settings to
the BulkLoader.
If the same property is mapped to more than one column, the result is
indeterminate (it might work, it might not, so you probably shouldn't do
this).
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 directories of where the
Interwoven datacapture.cfg files live. The provider will, on load, recurse
through the file structure and load all datacapture.cfg files. This can be
listed multiple times; each property starting with
iw.schemaBase
will be loaded.
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. This can be
listed multiple times; each property starting with schemaXML
will be loaded.
user
and password
can be
specified as well).
RefSQLGenerator
Field Summary | |
protected java.util.Map |
addlColumnMap
The map of additional column name to List of property names. |
protected java.util.List |
addlColumnNames
The list of additional column names. |
protected java.sql.Connection |
connection
Our database connection. |
protected javax.sql.DataSource |
dataSource
Our DataSource to use. |
protected java.lang.String |
dataSourceJndiName
The DataSource JNDI name. |
static java.lang.String |
DOC_MD_TABLE
The name of the document_metadata table. |
static java.lang.String |
DOC_TABLE
The name of the document table. |
protected java.io.File |
docBase
The docBase of the document. |
static int |
ISOLATION_LEVEL_UNKNOWN
A non-standard value for the transaction isolation level when it's state is unknown. |
protected int |
isolationLevel
Our transaction isolation level. |
protected boolean |
isolationLevelSpecified
Was a transaction isolation level specified during initalization? A transaction isolation level can only be specified if you are connecting directly to a JDBC driver. |
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
Deprecated. No longer used (see myMetadataSelectSQL ). |
protected java.lang.String |
myMetadataSelectSQL
The SELECT part of a SQL statement to get a DocumentMetadataDef. |
protected java.util.Map |
schemas
Our map of schema name to DefaultDocumentSchema |
protected RefSQLGenerator |
sqlGen
The SQL Generator this uses. |
protected java.lang.Boolean |
supportsLikeEscapeClause
Does the database support the LIKE ESCAPE clause. |
Constructor Summary | |
RefDocumentProvider()
|
Method Summary | |
void |
close()
Close oursevles. |
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. |
static int |
getInt(java.sql.ResultSet rs,
int index)
|
static long |
getLong(java.sql.ResultSet rs,
int index)
|
protected RefDocumentMetadata |
getMetadataDef(java.sql.ResultSet rs)
Get a metadata def from the given result set (which should follow the select in myMetadataSelectSQL ). |
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 this from the specified properties. |
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. |
static java.util.List |
split(java.lang.String str,
java.lang.String on)
Split a delimited list into a List. |
protected boolean |
supportsLikeEscapeClause(java.sql.Connection con)
Determine whether the specified connection supports the SQL LIKE ESCAPE clause. |
Methods inherited from class com.bea.p13n.content.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
public static final int ISOLATION_LEVEL_UNKNOWN
protected int isolationLevel
protected boolean isolationLevelSpecified
protected java.util.Map schemas
protected java.sql.Connection connection
This will be null if we're using a pooled connection.
protected java.lang.String dataSourceJndiName
This will be null if we're using the driver/url.
protected javax.sql.DataSource dataSource
This will get lazily initialized.
protected java.sql.Driver jdbcDriver
protected java.lang.String jdbcURL
protected boolean jdbcIsPooled
protected java.util.Properties jdbcProps
protected java.lang.Boolean supportsLikeEscapeClause
This will be no null for unknown.
protected java.io.File docBase
protected RefSQLGenerator sqlGen
This will be initialized in init(java.util.Properties)
from the
"jdbc.column.<colName>" properties.
protected java.util.List addlColumnNames
protected java.util.Map addlColumnMap
protected java.lang.String myMetadataSelectSQL
This will be passed to our SQL Generatorand is
initialized in init(java.util.Properties)
from the "jdbc.column.<colName>"
properties.
This will always start with "SELECT ID, DOCUMENT_SIZE, VERSION, AUTHOR, CREATION_DATE, LOCKED_BY, MODIFIED_DATE, MODIFIED_BY, DESCRIPTION, COMMENTS, MIME_TYPE".
public static final java.lang.String metadataSelectSQL
myMetadataSelectSQL
).Constructor Detail |
public RefDocumentProvider()
Method Detail |
public void init(java.util.Properties p) throws DocumentException
See the class comments for details on the supported properties.
protected 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()
RefDocumentProvider.ISOLATION_LEVEL_UNKOWN
will be returned.
public void setTransactionIsolation(int level) throws DocumentException
protected java.sql.Connection getConnection() throws DocumentException
protected boolean supportsLikeEscapeClause(java.sql.Connection con)
This will first check our supportsLikeEscapeClause
setting,
then defer to the Connection's DatabaseMetaData.
public DocumentIterator findDocumentIds(Search params) throws DocumentException
public DocumentIterator findDocuments(Search params) throws DocumentException
public DocumentIterator findDocumentMetadata(Search params) throws DocumentException
public java.sql.Timestamp getDocumentModifiedDate(java.lang.String id) throws DocumentException
protected RefDocumentMetadata getMetadataDef(java.sql.ResultSet rs) throws java.sql.SQLException
myMetadataSelectSQL
).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)
public java.util.Map getSchemas()
public static DocumentException convert(java.sql.SQLException ex)
public static int getInt(java.sql.ResultSet rs, int index) throws java.sql.SQLException
public static long getLong(java.sql.ResultSet rs, int index) throws java.sql.SQLException
public static java.util.List split(java.lang.String str, java.lang.String on)
|
© 2002 BEA Systems, Inc. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |