edu.ucsb.adl.bucket99
Class TemplateURLMetadataSubdriver

java.lang.Object
  |
  +--edu.ucsb.adl.bucket99.TemplateURLMetadataSubdriver
All Implemented Interfaces:
MetadataSubdriver

public final class TemplateURLMetadataSubdriver
extends java.lang.Object
implements MetadataSubdriver

Metadata subdriver that generates ADL metadata reports by loading them from URLs. The URLs are constructed from holding identifiers and a URL template.

This class reads the following property from Bucket99 configuration files when creating a subdriver for property prefix V. Property values may be indirectly specified using the notation @P where P is the name of another property (see ExtendedProperties for more information).

V.url
A template URL. The URL should contain a single dollar sign ('$') that will be replaced by the holding identifier.

Version:
$Header: /export/home/gjanee/bucket99/edu/ucsb/adl/bucket99/RCS/TemplateURLMetadataSubdriver.java,v 1.4 2004/09/23 17:03:10 gjanee Exp $

$Log: TemplateURLMetadataSubdriver.java,v $ Revision 1.4 2004/09/23 17:03:10 gjanee
Rewrite to use class edu.ucsb.adl.middleware.ExtendedProperties.

Revision 1.3 2003/06/12 15:13:00 gjanee
Minor recoding to avoid using a deprecated method.

Revision 1.2 2003/06/12 05:31:16 gjanee
Added support for arbitrary, per-collection and per-holding metadata views. Specifically, the createSubdriver method is now passed a property name prefix.

Revision 1.1 2000/05/17 19:11:32 gjanee
Initial revision

Author:
Greg Janée
Alexandria Digital Library

Method Summary
static edu.ucsb.adl.bucket99.TemplateURLMetadataSubdriver createSubdriver(edu.ucsb.adl.middleware.ExtendedProperties propertyList, java.lang.String prefix)
          Creates a TemplateURLMetadataSubdriver.
 void destroy()
          Frees all resources held by the subdriver.
 void disuseConnection()
          For use by MetadataDriver only.
 java.lang.String generateReport(java.lang.String view, java.lang.String collection, java.lang.String holding)
          Generates an ADL metadata report.
 void useConnection(java.sql.Connection connection)
          For use by MetadataDriver only.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

createSubdriver

public static edu.ucsb.adl.bucket99.TemplateURLMetadataSubdriver createSubdriver(edu.ucsb.adl.middleware.ExtendedProperties propertyList,
                                                                                 java.lang.String prefix)
                                                                          throws InternalErrorException
Creates a TemplateURLMetadataSubdriver.

Parameters:
propertyList - The source for the above-mentioned property.
prefix - The property name prefix corresponding to the metadata view the subdriver is to support, e.g., "ACCESS".
Returns:
A TemplateURLMetadataSubdriver.
Throws:
InternalErrorException - If any error occurs.

useConnection

public void useConnection(java.sql.Connection connection)
For use by MetadataDriver only.

Specified by:
useConnection in interface MetadataSubdriver
Parameters:
connection - The connection.

disuseConnection

public void disuseConnection()
For use by MetadataDriver only.

Specified by:
disuseConnection in interface MetadataSubdriver

generateReport

public java.lang.String generateReport(java.lang.String view,
                                       java.lang.String collection,
                                       java.lang.String holding)
                                throws InternalErrorException
Generates an ADL metadata report.

Specified by:
generateReport in interface MetadataSubdriver
Parameters:
view - Unused.
collection - Unused.
holding - The holding identifier.
Returns:
An XML document that is well-formed and valid according to the appropriate DTD.
Throws:
InternalErrorException - If any error occurs.

destroy

public void destroy()
Frees all resources held by the subdriver.

Specified by:
destroy in interface MetadataSubdriver