org.dspace.app.oai
Class PluginCrosswalk

java.lang.Object
  extended by ORG.oclc.oai.server.crosswalk.Crosswalk
      extended by org.dspace.app.oai.PluginCrosswalk

public class PluginCrosswalk
extends ORG.oclc.oai.server.crosswalk.Crosswalk

An OAICat Crosswalk implementation that calls, in turn, on DisseminationCrosswalk plugins. It is configured so its "OAI schema label" matches the name of a DisseminationCrosswalk plugin. This class will then recognize its name and invoke the correct crosswalk to produce the results it sends out.

Configuration: In the OAICat configuration file (e.g. oaicat.properties add a line like this for each plugin crosswalk you wish to provide:

   Crosswalks.Plugin-Name=org.dspace.app.oai.PluginCrosswalk

    e.g.

   Crosswalks.DC=org.dspace.app.oai.PluginCrosswalk
 
This creates an OAI metadata prefix "DC" which is implemented by the dissemination crosswalk plugin that answers to the name "DC". It, in turn, could be found in the DSpace configuration in a line like:
  plugin.named.org.dspace.content.crosswalk.DisseminationCrosswalk = \
    org.dspace.content.crosswalk.SimpleDCDisseminationCrosswalk = DC
 

Note that all OAI crosswalks are instances of this same class, since the instance gets bound to a specific DisseminationCrosswalk when it is created.

WARNING: This requires at the OAICAT java library version 1.5.38. It does NOT work with some older versions.

Version:
$Revision$
Author:
Larry Stone

Constructor Summary
PluginCrosswalk(String schemaLabel, Properties properties)
          Constructor; called by ORG.oclc.oai.server.crosswalk.Crosswalks, which tries first with args (String schemaLabel, Properties properties).
 
Method Summary
 String createMetadata(Object nativeItem)
          Do the crosswalk.
 boolean isAvailableFor(Object nativeItem)
           
 
Methods inherited from class ORG.oclc.oai.server.crosswalk.Crosswalk
getContentType, getDocType, getEncoding, getNamespaceURL, getSchemaLocation, getSchemaURL, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PluginCrosswalk

public PluginCrosswalk(String schemaLabel,
                       Properties properties)
Constructor; called by ORG.oclc.oai.server.crosswalk.Crosswalks, which tries first with args (String schemaLabel, Properties properties). This is convenient since it lets us use that label to initialize this instance of the plugin with the DisseminationCrosswalk crosswalk corresponding to that schemaLabel, instead of creating a subclass for each one.

WARNING: This requires at the OAICAT java library version 1.5.37. It does NOT work with some older versions.

Method Detail

isAvailableFor

public boolean isAvailableFor(Object nativeItem)
Specified by:
isAvailableFor in class ORG.oclc.oai.server.crosswalk.Crosswalk
Returns:
true if this dissemination is available for the item.

createMetadata

public String createMetadata(Object nativeItem)
                      throws ORG.oclc.oai.server.verb.CannotDisseminateFormatException
Do the crosswalk. Returns serialized XML in a string.

Specified by:
createMetadata in class ORG.oclc.oai.server.crosswalk.Crosswalk
Throws:
ORG.oclc.oai.server.verb.CannotDisseminateFormatException


Copyright © 2013 DuraSpace. All Rights Reserved.