Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2003 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

    java.lang.Object
      |
      +--com.bea.p13n.content.document.ref.DefaultDocumentProvider
            |
            +--com.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.

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

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

### DOC_TABLE

    public static final String DOC_TABLE

  Deprecated.
  The name of the document table.

  See Also:
    Constant Field Values

### DOC_MD_TABLE

    public static final String DOC_MD_TABLE

  Deprecated.
  The name of the document_metadata table.

  See Also:
    Constant Field Values

### isolationLevel

    protected int isolationLevel

  Deprecated.
  Our transaction isolation level.

### schemas

    protected Map schemas

  Deprecated.
  Our map of schema name to DefaultDocumentSchema

### connection

    protected Connection connection

  Deprecated.
  Our database connection.

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

### dataSourceJndiName

    protected String dataSourceJndiName

  Deprecated.
  The DataSource JNDI name.

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

### dataSource

    protected DataSource dataSource

  Deprecated.
  Our DataSource to use.

  This will get lazily initialized.

### jdbcDriver

    protected Driver jdbcDriver

  Deprecated.
  Our JDBC driver to use.

### jdbcURL

    protected String jdbcURL

  Deprecated.
  The JDBC url to use.

### jdbcIsPooled

    protected boolean jdbcIsPooled

  Deprecated.
  Are we using a pooled JDBC driver.

### jdbcProps

    protected Properties jdbcProps

  Deprecated.
  The JDBC connection properties.

### supportsLikeEscapeClause

    protected Boolean supportsLikeEscapeClause

  Deprecated.
  Does the database support the LIKE ESCAPE clause.

  This will be no null for unknown.

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

### docBase

    protected File docBase

  Deprecated.
  The docBase of the document.

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

### addlColumnNames

    protected List addlColumnNames

  Deprecated.
  The list of additional column names.

### addlColumnMap

    protected Map addlColumnMap

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

### myMetadataSelectSQL

    protected String myMetadataSelectSQL

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

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

### 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

Constructor Detail

### RefDocumentProvider

    public RefDocumentProvider()

  Deprecated.

Method Detail

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

    `DocumentException`
  See Also:
    `RefSchemaGenerator`

### loadSchemas

    protected void loadSchemas(String path)
                        throws DocumentException

  Deprecated.
  Load schema information from doc-schema xml files.

    `DocumentException`
  See Also:
    `RefSchemaGenerator`

### loadSchemas

    protected void loadSchemas(Collection col)
                        throws DocumentException

  Deprecated.
  Add the DocumentSchemaDefs found in the collection into our schema map.

    `DocumentException`

### reset

    public void reset()
               throws DocumentException

  Deprecated.
  Reset oursevles.

  Throws:
    `DocumentException` - thrown on an error.

### close

    public void close()
               throws DocumentException

  Deprecated.
  Close oursevles.

  Throws:
    `DocumentException` - thrown on an error.

### 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

### 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`
    `DocumentException`

### getConnection

    protected Connection getConnection()
                                throws DocumentException

  Deprecated.
  Get a/the connection to the database.

  Returns:
    a connection to the database.
    `DocumentException`

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

### 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`
  Parameters:
    `params` - the search parameters.
  Returns:
    the iterator of String document ids that match.
  Throws:
    `DocumentException` - thrown on an error.

### 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`
  Parameters:
    `params` - the search parameters.
  Returns:
    the iterator of DocumentDefs that match the search.
  Throws:
    `DocumentException` - thrown on an error.

### 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`
  Parameters:
    `params` - the search parameters.
  Returns:
    the iterator of DocumentMetadataDefs that match the search.
  Throws:
    `DocumentException` - thrown on an error.

### 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`
  Parameters:
    `id` - the document id.
  Returns:
    the timestamp when the doc was last modified, or null if unknown or doesn't exist.
    `DocumentException`

### 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`).

    `SQLException`

### fillInMetadataDefs

    protected void fillInMetadataDefs(Connection con,
                                      List list)
                               throws SQLException

  Deprecated.
  Fill in the remaining document metadata (i.e. the implicit attributes).

    `SQLException`

### getSchemaNames

    public DocumentIterator getSchemaNames()

  Deprecated.
  Return the list of schema names.

  Returns:
    the iterator the String schema names.

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

### getSchemas

    public Map getSchemas()

  Deprecated.
  Return the map of schema name to schema.

  Returns:
    the map of String schema name of DocumentSchemaDef.

### convert

    public static DocumentException convert(SQLException ex)

  Deprecated.
  Utility method to turn a SQLException into a DocumentException.

### getInt

    public static int getInt(ResultSet rs,
                             int index)
                      throws SQLException

  Deprecated.
    `SQLException`

### getLong

    public static long getLong(ResultSet rs,
                               int index)
                        throws SQLException

  Deprecated.
    `SQLException`

### split

    public static List split(String str,
                             String on)

  Deprecated.
  Split a delimited list into a List.

Overview | Package | Class | Tree | Deprecated | Index | Help
| © 2003 BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003 BEA Systems, Inc. All Rights Reserved