org.dspace.content.packager
Class DSpaceMETSDisseminator

java.lang.Object
  extended by org.dspace.content.packager.AbstractPackageDisseminator
      extended by org.dspace.content.packager.AbstractMETSDisseminator
          extended by org.dspace.content.packager.DSpaceMETSDisseminator
All Implemented Interfaces:
PackageDisseminator

public class DSpaceMETSDisseminator
extends AbstractMETSDisseminator

Packager plugin to produce a METS (Metadata Encoding & Transmission Standard) package that is accepted as a DSpace METS SIP (Submission Information Package). See http://www.loc.gov/standards/mets/ for more information on METS.

This class does not produce a true DSpace DIP, because there was no DIP standard when it was implemented. It does contain some features beyond the requirements of a SIP (e.g. deposit licenses), anticipating the DIP specification.

DSpaceMETSDisseminator was intended to be an useful example of a packager plugin, and a way to create packages acceptable to the METS SIP importer.

Version:
$Revision: 5844 $
Author:
Larry Stone

Nested Class Summary
 
Nested classes/interfaces inherited from class org.dspace.content.packager.AbstractMETSDisseminator
AbstractMETSDisseminator.MdStreamCache
 
Field Summary
 
Fields inherited from class org.dspace.content.packager.AbstractMETSDisseminator
TEMPLATE_TYPE_SUFFIX
 
Constructor Summary
DSpaceMETSDisseminator()
           
 
Method Summary
 void addStructMap(Context context, DSpaceObject dso, PackageParameters params, edu.harvard.hul.ois.mets.Mets mets)
          Add any additional structMap elements to the METS document, as required by this subclass.
 String bundleToFileGrp(String bname)
          Returns name of METS fileGrp corresponding to a DSpace bundle name.
 String[] getDigiprovMdTypes(Context context, DSpaceObject dso, PackageParameters params)
          Get the type string of the "digiprov" (digital provenance) metadata to create for each object and each Bitstream in an Item.
 String[] getDmdTypes(Context context, DSpaceObject dso, PackageParameters params)
          Get DMD choice for Item.
 String getParameterHelp()
          Returns a user help string which should describe the additional valid command-line options that this packager implementation will accept when using the -o or --option flags with the Packager script.
 String getProfile()
          Return identifier string for the profile this produces.
 String[] getRightsMdTypes(Context context, DSpaceObject dso, PackageParameters params)
          Add rights MD (licenses) for DSpace item.
 String[] getSourceMdTypes(Context context, DSpaceObject dso, PackageParameters params)
          Get the type string of the source metadata to create for each object and each Bitstream in an Item.
 String[] getTechMdTypes(Context context, DSpaceObject dso, PackageParameters params)
          Get name of technical metadata crosswalk for Bitstreams.
 boolean includeBundle(Bundle bundle)
           
 String makeBitstreamURL(Bitstream bitstream, PackageParameters params)
          Return identifier for bitstream in an Item; when making a package, this is the archive member name (e.g.
 edu.harvard.hul.ois.mets.MetsHdr makeMetsHdr(Context context, DSpaceObject dso, PackageParameters params)
          Create metsHdr element - separate so subclasses can override.
 
Methods inherited from class org.dspace.content.packager.AbstractMETSDisseminator
addAmdSec, addBitstreamsToZip, addLogoBitstream, addToAmdSec, disseminate, findOriginalBitstream, gensym, getHandleURN, getMIMEType, getObjectTypeString, linkLicenseRefsToBitstreams, makeChildDiv, makeFileDiv, makeManifest, makeMdSec, makePersistentID, setMdType, setMdType, writeZipPackage
 
Methods inherited from class org.dspace.content.packager.AbstractPackageDisseminator
addToPackageList, disseminateAll, getPackageList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSpaceMETSDisseminator

public DSpaceMETSDisseminator()
Method Detail

getProfile

public String getProfile()
Return identifier string for the profile this produces.

Specified by:
getProfile in class AbstractMETSDisseminator
Returns:
string name of profile.

bundleToFileGrp

public String bundleToFileGrp(String bname)
Returns name of METS fileGrp corresponding to a DSpace bundle name. They are mostly the same except for bundle "ORIGINAL" maps to "CONTENT". Don't worry about the metadata bundles since they are not packaged as fileGrps, but in *mdSecs.

Specified by:
bundleToFileGrp in class AbstractMETSDisseminator
Parameters:
bname - name of DSpace bundle.
Returns:
string name of fileGrp

makeMetsHdr

public edu.harvard.hul.ois.mets.MetsHdr makeMetsHdr(Context context,
                                                    DSpaceObject dso,
                                                    PackageParameters params)
Create metsHdr element - separate so subclasses can override.

Specified by:
makeMetsHdr in class AbstractMETSDisseminator

getDmdTypes

public String[] getDmdTypes(Context context,
                            DSpaceObject dso,
                            PackageParameters params)
                     throws SQLException,
                            IOException,
                            AuthorizeException
Get DMD choice for Item. It defaults to MODS, but is overridden by the package parameters if they contain any "dmd" keys. The params may contain one or more values for "dmd"; each of those is the name of a crosswalk plugin, optionally followed by colon and its METS MDTYPE name.

Specified by:
getDmdTypes in class AbstractMETSDisseminator
params - the PackageParameters passed to the disseminator.
Returns:
array of metadata type strings, never null.
Throws:
SQLException
IOException
AuthorizeException

getTechMdTypes

public String[] getTechMdTypes(Context context,
                               DSpaceObject dso,
                               PackageParameters params)
                        throws SQLException,
                               IOException,
                               AuthorizeException
Get name of technical metadata crosswalk for Bitstreams. Default is PREMIS. This is both the name of the crosswalk plugin and the METS MDTYPE.

Specified by:
getTechMdTypes in class AbstractMETSDisseminator
params - the PackageParameters passed to the disseminator.
Returns:
array of metadata type strings, never null.
Throws:
SQLException
IOException
AuthorizeException

getSourceMdTypes

public String[] getSourceMdTypes(Context context,
                                 DSpaceObject dso,
                                 PackageParameters params)
                          throws SQLException,
                                 IOException,
                                 AuthorizeException
Description copied from class: AbstractMETSDisseminator
Get the type string of the source metadata to create for each object and each Bitstream in an Item. The type string may be a simple name or colon-separated compound as specified for getDmdTypes() above.

Specified by:
getSourceMdTypes in class AbstractMETSDisseminator
params - the PackageParameters passed to the disseminator.
Returns:
array of metadata type strings, never null.
Throws:
SQLException
IOException
AuthorizeException

getDigiprovMdTypes

public String[] getDigiprovMdTypes(Context context,
                                   DSpaceObject dso,
                                   PackageParameters params)
                            throws SQLException,
                                   IOException,
                                   AuthorizeException
Description copied from class: AbstractMETSDisseminator
Get the type string of the "digiprov" (digital provenance) metadata to create for each object and each Bitstream in an Item. The type string may be a simple name or colon-separated compound as specified for getDmdTypes() above.

Specified by:
getDigiprovMdTypes in class AbstractMETSDisseminator
params - the PackageParameters passed to the disseminator.
Returns:
array of metadata type strings, never null.
Throws:
SQLException
IOException
AuthorizeException

makeBitstreamURL

public String makeBitstreamURL(Bitstream bitstream,
                               PackageParameters params)
Description copied from class: AbstractMETSDisseminator
Return identifier for bitstream in an Item; when making a package, this is the archive member name (e.g. in Zip file). In a bare manifest, it might be an external URL. The name should be in URL format ("file:" may be elided for in-archive filenames). It should be deterministic, since this gets called twice for each bitstream when building archive.

Specified by:
makeBitstreamURL in class AbstractMETSDisseminator

getRightsMdTypes

public String[] getRightsMdTypes(Context context,
                                 DSpaceObject dso,
                                 PackageParameters params)
                          throws SQLException,
                                 IOException,
                                 AuthorizeException
Add rights MD (licenses) for DSpace item. These may include a deposit license, and Creative Commons.

Specified by:
getRightsMdTypes in class AbstractMETSDisseminator
params - the PackageParameters passed to the disseminator.
Returns:
array of metadata type strings, never null.
Throws:
SQLException
IOException
AuthorizeException

addStructMap

public void addStructMap(Context context,
                         DSpaceObject dso,
                         PackageParameters params,
                         edu.harvard.hul.ois.mets.Mets mets)
                  throws SQLException,
                         IOException,
                         AuthorizeException,
                         edu.harvard.hul.ois.mets.helper.MetsException
Description copied from class: AbstractMETSDisseminator
Add any additional structMap elements to the METS document, as required by this subclass. A simple default structure map which fulfills the minimal DSpace METS DIP/SIP requirements is already present, so this does not need to do anything.

Specified by:
addStructMap in class AbstractMETSDisseminator
mets - the METS document to which to add structMaps
Throws:
SQLException
IOException
AuthorizeException
edu.harvard.hul.ois.mets.helper.MetsException

includeBundle

public boolean includeBundle(Bundle bundle)
Specified by:
includeBundle in class AbstractMETSDisseminator
Returns:
true when this bundle should be included as "content" in the package.. e.g. DSpace SIP does not include metadata bundles.

getParameterHelp

public String getParameterHelp()
Returns a user help string which should describe the additional valid command-line options that this packager implementation will accept when using the -o or --option flags with the Packager script.

Specified by:
getParameterHelp in interface PackageDisseminator
Overrides:
getParameterHelp in class AbstractMETSDisseminator
Returns:
a string describing additional command-line options available with this packager


Copyright © 2010 DuraSpace. All Rights Reserved.