|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | 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" (the
default), "READ_UNCOMMITTED", "REPEATABLE_READ", and "NONE".
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 Map |
addlColumnMap
Deprecated. The map of additional column name to List of property names. |
protected List |
addlColumnNames
Deprecated. The list of additional column names. |
protected Connection |
connection
Deprecated. Our database connection. |
protected DataSource |
dataSource
Deprecated. Our DataSource to use. |
protected String |
dataSourceJndiName
Deprecated. The DataSource JNDI name. |
static String |
DOC_MD_TABLE
Deprecated. The name of the document_metadata table. |
static String |
DOC_TABLE
Deprecated. The name of the document table. |
protected File |
docBase
Deprecated. The docBase of the document. |
protected int |
isolationLevel
Deprecated. Our transaction isolation level. |
protected Driver |
jdbcDriver
Deprecated. Our JDBC driver to use. |
protected boolean |
jdbcIsPooled
Deprecated. Are we using a pooled JDBC driver. |
protected Properties |
jdbcProps
Deprecated. The JDBC connection properties. |
protected String |
jdbcURL
Deprecated. The JDBC url to use. |
protected long |
maxWaitTime
Deprecated. The maximum amount of time in milliseconds this should wait for a connection to come available. |
static String |
metadataSelectSQL
Deprecated. No longer used (see myMetadataSelectSQL ). |
protected String |
myMetadataSelectSQL
Deprecated. The SELECT part of a SQL statement to get a DocumentMetadataDef. |
protected Map |
schemas
Deprecated. Our map of schema name to DefaultDocumentSchema |
protected RefSQLGenerator |
sqlGen
Deprecated. The SQL Generator this uses. |
protected Boolean |
supportsLikeEscapeClause
Deprecated. Does the database support the LIKE ESCAPE clause. |
Fields inherited from interface com.bea.p13n.content.document.spi.DocumentProvider |
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
Constructor Summary | |
RefDocumentProvider()
Deprecated. |
Method Summary | |
void |
close()
Deprecated. Close oursevles. |
static DocumentException |
convert(SQLException ex)
Deprecated. Utility method to turn a SQLException into a DocumentException. |
protected void |
fillInMetadataDefs(Connection con,
List list)
Deprecated. Fill in the remaining document metadata (i.e. the implicit attributes). |
DocumentIterator |
findDocumentIds(Search params)
Deprecated. Return the list of String document ids that match the specified search parameters. |
DocumentIterator |
findDocumentMetadata(Search params)
Deprecated. Return the list of DocumentMetadataDefs which match the given search parameters object. |
DocumentIterator |
findDocuments(Search params)
Deprecated. Return the list of DocumentDefs that match the specified search parameters. |
protected Connection |
getConnection()
Deprecated. Get a/the connection to the database. |
Timestamp |
getDocumentModifiedDate(String id)
Deprecated. Get just the last modified date of a document, without brining back all the metadata. |
static int |
getInt(ResultSet rs,
int index)
Deprecated. |
static long |
getLong(ResultSet rs,
int index)
Deprecated. |
protected RefDocumentMetadata |
getMetadataDef(ResultSet rs)
Deprecated. Get a metadata def from the given result set (which should follow the select in myMetadataSelectSQL ). |
DocumentSchemaDef |
getSchema(String name)
Deprecated. Return the names schema. |
DocumentIterator |
getSchemaNames()
Deprecated. Return the list of schema names. |
Map |
getSchemas()
Deprecated. Return the map of schema name to schema. |
int |
getTransactionIsolation()
Deprecated. Get the transaction isolation level. |
void |
init(Properties p)
Deprecated. Initialize this from the specified properties. |
protected void |
loadIWSchemas(String basePath)
Deprecated. Load schema information from Interwoven datacapture.cfg files. |
protected void |
loadSchemas(Collection col)
Deprecated. Add the DocumentSchemaDefs found in the collection into our schema map. |
protected void |
loadSchemas(String path)
Deprecated. Load schema information from doc-schema xml files. |
void |
reset()
Deprecated. Reset oursevles. |
void |
setTransactionIsolation(int level)
Deprecated. Set the transaction isolation level. |
static List |
split(String str,
String on)
Deprecated. Split a delimited list into a List. |
protected boolean |
supportsLikeEscapeClause(Connection con)
Deprecated. 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 |
protected Map addlColumnMap
protected List addlColumnNames
protected Connection connection
This will be null if we're using a pooled connection.
protected DataSource dataSource
This will get lazily initialized.
protected String dataSourceJndiName
This will be null if we're using the driver/url.
public static final String DOC_MD_TABLE
public static final String DOC_TABLE
protected File docBase
protected int isolationLevel
protected Driver jdbcDriver
protected boolean jdbcIsPooled
protected Properties jdbcProps
protected String jdbcURL
protected long maxWaitTime
Use less than 0 for wait forever.
public static final String metadataSelectSQL
myMetadataSelectSQL
).
protected String myMetadataSelectSQL
This will be passed to our SQL Generator
and 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".
protected Map schemas
protected RefSQLGenerator sqlGen
This will be initialized in init(java.util.Properties)
from the
"jdbc.column.<colName>" properties.
protected Boolean supportsLikeEscapeClause
This will be no null for unknown.
Constructor Detail |
public RefDocumentProvider()
Method Detail |
public void close() throws DocumentException
DocumentException
- thrown on an error.public static DocumentException convert(SQLException ex)
protected void fillInMetadataDefs(Connection con, List list) throws SQLException
SQLException
public DocumentIterator findDocumentIds(Search params) throws DocumentException
findDocumentIds
in interface DocumentProvider
findDocumentIds
in class DefaultDocumentProvider
DocumentException
public DocumentIterator findDocumentMetadata(Search params) throws DocumentException
findDocumentMetadata
in interface DocumentProvider
findDocumentMetadata
in class DefaultDocumentProvider
DocumentException
public DocumentIterator findDocuments(Search params) throws DocumentException
findDocuments
in interface DocumentProvider
findDocuments
in class DefaultDocumentProvider
DocumentException
protected Connection getConnection() throws DocumentException
DocumentException
public Timestamp getDocumentModifiedDate(String id) throws DocumentException
getDocumentModifiedDate
in interface DocumentProvider
getDocumentModifiedDate
in class DefaultDocumentProvider
DocumentException
public static int getInt(ResultSet rs, int index) throws SQLException
SQLException
public static long getLong(ResultSet rs, int index) throws SQLException
SQLException
protected RefDocumentMetadata getMetadataDef(ResultSet rs) throws SQLException
myMetadataSelectSQL
).
SQLException
public DocumentSchemaDef getSchema(String name)
name
- the name of the schema to find.
public DocumentIterator getSchemaNames()
public Map getSchemas()
public int getTransactionIsolation()
getTransactionIsolation
in interface DocumentProvider
getTransactionIsolation
in class DefaultDocumentProvider
public void init(Properties p) throws DocumentException
See the class comments for details on the supported properties.
p
- the configuration properties
DocumentException
- on an initialization error.protected void loadIWSchemas(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.
DocumentException
RefSchemaGenerator
protected void loadSchemas(Collection col) throws DocumentException
DocumentException
protected void loadSchemas(String path) throws DocumentException
DocumentException
RefSchemaGenerator
public void reset() throws DocumentException
DocumentException
- thrown on an error.public void setTransactionIsolation(int level) throws DocumentException
setTransactionIsolation
in interface DocumentProvider
setTransactionIsolation
in class DefaultDocumentProvider
DocumentException
public static List split(String str, String on)
protected boolean supportsLikeEscapeClause(Connection con)
This will first check our supportsLikeEscapeClause
setting,
then defer to the Connection's DatabaseMetaData.
|
© 2005 BEA Systems, Inc. | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |