© 2004 BEA Systems, Inc.

com.bea.p13n.content.document.ref
Class RefDocumentProvider

java.lang.Object
  extended bycom.bea.p13n.content.document.ref.DefaultDocumentProvider
      extended bycom.bea.p13n.content.document.ref.RefDocumentProvider
All Implemented Interfaces:
DocumentProvider

public class RefDocumentProvider
extends DefaultDocumentProvider

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.

All other configuration properties will be sent when a database connection is opened (e.g. user and password can be specified as well).

See Also:
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

addlColumnMap

protected Map addlColumnMap
Deprecated. 
The map of additional column name to List of property names.


addlColumnNames

protected List addlColumnNames
Deprecated. 
The list of additional column names.


connection

protected Connection connection
Deprecated. 
Our database connection.

This will be null if we're using a pooled connection.


dataSource

protected DataSource dataSource
Deprecated. 
Our DataSource to use.

This will get lazily initialized.


dataSourceJndiName

protected String dataSourceJndiName
Deprecated. 
The DataSource JNDI name.

This will be null if we're using the driver/url.


DOC_MD_TABLE

public static final String DOC_MD_TABLE
Deprecated. 
The name of the document_metadata table.

See Also:
Constant Field Values

DOC_TABLE

public static final String DOC_TABLE
Deprecated. 
The name of the document table.

See Also:
Constant Field Values

docBase

protected File docBase
Deprecated. 
The docBase of the document.


isolationLevel

protected int isolationLevel
Deprecated. 
Our transaction isolation level.


jdbcDriver

protected Driver jdbcDriver
Deprecated. 
Our JDBC driver to use.


jdbcIsPooled

protected boolean jdbcIsPooled
Deprecated. 
Are we using a pooled JDBC driver.


jdbcProps

protected Properties jdbcProps
Deprecated. 
The JDBC connection properties.


jdbcURL

protected String jdbcURL
Deprecated. 
The JDBC url to use.


maxWaitTime

protected long maxWaitTime
Deprecated. 
The maximum amount of time in milliseconds this should wait for a connection to come available.

Use less than 0 for wait forever.


metadataSelectSQL

public static final String metadataSelectSQL
Deprecated. No longer used (see myMetadataSelectSQL).

The default SELECT part to get a DocumentMetadataDef.

See Also:
Constant Field Values

myMetadataSelectSQL

protected String myMetadataSelectSQL
Deprecated. 
The SELECT part of a SQL statement to get a DocumentMetadataDef.

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".


schemas

protected Map schemas
Deprecated. 
Our map of schema name to DefaultDocumentSchema


sqlGen

protected RefSQLGenerator sqlGen
Deprecated. 
The SQL Generator this uses.

This will be initialized in init(java.util.Properties) from the "jdbc.column.<colName>" properties.


supportsLikeEscapeClause

protected Boolean supportsLikeEscapeClause
Deprecated. 
Does the database support the LIKE ESCAPE clause.

This will be no null for unknown.

Constructor Detail

RefDocumentProvider

public RefDocumentProvider()
Deprecated. 
Method Detail

close

public void close()
           throws DocumentException
Deprecated. 
Close oursevles.

Throws:
DocumentException - thrown on an error.

convert

public static DocumentException convert(SQLException ex)
Deprecated. 
Utility method to turn a SQLException into a DocumentException.


fillInMetadataDefs

protected void fillInMetadataDefs(Connection con,
                                  List list)
                           throws SQLException
Deprecated. 
Fill in the remaining document metadata (i.e. the implicit attributes).

Throws:
SQLException

findDocumentIds

public DocumentIterator findDocumentIds(Search params)
                                 throws DocumentException
Deprecated. 
Return the list of String document ids that match the specified search parameters.

Specified by:
findDocumentIds in interface DocumentProvider
Overrides:
findDocumentIds in class DefaultDocumentProvider
Throws:
DocumentException

findDocumentMetadata

public DocumentIterator findDocumentMetadata(Search params)
                                      throws DocumentException
Deprecated. 
Return the list of DocumentMetadataDefs which match the given search parameters object.

Specified by:
findDocumentMetadata in interface DocumentProvider
Overrides:
findDocumentMetadata in class DefaultDocumentProvider
Throws:
DocumentException

findDocuments

public DocumentIterator findDocuments(Search params)
                               throws DocumentException
Deprecated. 
Return the list of DocumentDefs that match the specified search parameters.

Specified by:
findDocuments in interface DocumentProvider
Overrides:
findDocuments in class DefaultDocumentProvider
Throws:
DocumentException

getConnection

protected Connection getConnection()
                            throws DocumentException
Deprecated. 
Get a/the connection to the database.

Returns:
a connection to the database.
Throws:
DocumentException

getDocumentModifiedDate

public Timestamp getDocumentModifiedDate(String id)
                                  throws DocumentException
Deprecated. 
Get just the last modified date of a document, without brining back all the metadata.

Specified by:
getDocumentModifiedDate in interface DocumentProvider
Overrides:
getDocumentModifiedDate in class DefaultDocumentProvider
Throws:
DocumentException

getInt

public static int getInt(ResultSet rs,
                         int index)
                  throws SQLException
Deprecated. 
Throws:
SQLException

getLong

public static long getLong(ResultSet rs,
                           int index)
                    throws SQLException
Deprecated. 
Throws:
SQLException

getMetadataDef

protected RefDocumentMetadata getMetadataDef(ResultSet rs)
                                      throws SQLException
Deprecated. 
Get a metadata def from the given result set (which should follow the select in myMetadataSelectSQL).

Throws:
SQLException

getSchema

public DocumentSchemaDef getSchema(String name)
Deprecated. 
Return the names schema.

Parameters:
name - the name of the schema to find.
Returns:
the DocumentSchemaDef or null if not found.

getSchemaNames

public DocumentIterator getSchemaNames()
Deprecated. 
Return the list of schema names.

Returns:
the iterator the String schema names.

getSchemas

public Map getSchemas()
Deprecated. 
Return the map of schema name to schema.

Returns:
the map of String schema name of DocumentSchemaDef.

getTransactionIsolation

public int getTransactionIsolation()
Deprecated. 
Get the transaction isolation level.

Specified by:
getTransactionIsolation in interface DocumentProvider
Overrides:
getTransactionIsolation in class DefaultDocumentProvider
Returns:
the transaction isolation level

init

public void init(Properties p)
          throws DocumentException
Deprecated. 
Initialize this from the specified properties.

See the class comments for details on the supported properties.

Parameters:
p - the configuration properties
Throws:
DocumentException - on an initialization error.

loadIWSchemas

protected void loadIWSchemas(String basePath)
                      throws DocumentException
Deprecated. 
Load schema information from Interwoven datacapture.cfg files.

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.

Throws:
DocumentException
See Also:
RefSchemaGenerator

loadSchemas

protected void loadSchemas(Collection col)
                    throws DocumentException
Deprecated. 
Add the DocumentSchemaDefs found in the collection into our schema map.

Throws:
DocumentException

loadSchemas

protected void loadSchemas(String path)
                    throws DocumentException
Deprecated. 
Load schema information from doc-schema xml files.

Throws:
DocumentException
See Also:
RefSchemaGenerator

reset

public void reset()
           throws DocumentException
Deprecated. 
Reset oursevles.

Throws:
DocumentException - thrown on an error.

setTransactionIsolation

public void setTransactionIsolation(int level)
                             throws DocumentException
Deprecated. 
Set the transaction isolation level.

Specified by:
setTransactionIsolation in interface DocumentProvider
Overrides:
setTransactionIsolation in class DefaultDocumentProvider
Throws:
DocumentException

split

public static List split(String str,
                         String on)
Deprecated. 
Split a delimited list into a List.


supportsLikeEscapeClause

protected boolean supportsLikeEscapeClause(Connection con)
Deprecated. 
Determine whether the specified connection supports the SQL LIKE ESCAPE clause.

This will first check our supportsLikeEscapeClause setting, then defer to the Connection's DatabaseMetaData.


© 2004 BEA Systems, Inc.

Copyright © 2004 BEA Systems, Inc. All Rights Reserved