org.dspace.content.packager
Class DSpaceMETSIngester

java.lang.Object
  extended by org.dspace.content.packager.AbstractPackageIngester
      extended by org.dspace.content.packager.AbstractMETSIngester
          extended by org.dspace.content.packager.DSpaceMETSIngester
All Implemented Interfaces:
PackageIngester

public class DSpaceMETSIngester
extends AbstractMETSIngester

Packager plugin to ingest a METS (Metadata Encoding & Transmission Standard) package that conforms to the DSpace METS SIP (Submission Information Package) Profile. See http://www.loc.gov/standards/mets/ for more information on METS, and http://www.dspace.org/standards/METS/SIP/profilev0p9p1/metssipv0p9p1.pdf (or a similar file in the /standards/METS/SIP resource hierarchy) for more information about the DSpace METS SIP profile.

Version:
$Revision$
Author:
Larry Stone, Tim Donohue
See Also:
METSManifest, AbstractMETSIngester, AbstractPackageIngester, PackageIngester

Nested Class Summary
 
Nested classes/interfaces inherited from class org.dspace.content.packager.AbstractMETSIngester
AbstractMETSIngester.MdrefManager
 
Constructor Summary
DSpaceMETSIngester()
           
 
Method Summary
 void addLicense(Context context, Item item, String license, Collection collection, PackageParameters params)
          Policy: For DSpace deposit license, take deposit license supplied by explicit argument first, else use collection's default deposit license.
 void crosswalkObjectDmd(Context context, DSpaceObject dso, METSManifest manifest, AbstractMETSIngester.MdrefManager callback, org.jdom.Element[] dmds, PackageParameters params)
          Choose DMD section(s) to crosswalk.
 void finishBitstream(Context context, Bitstream bs, org.jdom.Element mfile, METSManifest manifest, PackageParameters params)
          Take a second pass over files to correct names of derived files (e.g.
 void finishObject(Context context, DSpaceObject dso, PackageParameters params)
          Hook for final "finishing" operations on the new Object.
 String getConfigurationName()
          Returns keyword that makes the configuration keys of this subclass unique, e.g.
 int getObjectType(METSManifest manifest)
          Determines what type of DSpace object is represented in this METS doc.
 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.
 boolean probe(Context context, InputStream in, PackageParameters params)
           
 
Methods inherited from class org.dspace.content.packager.AbstractMETSIngester
addBitstreams, addContainerLogo, addManifestBitstream, addTemplateItem, decodeHandleURN, getFileInputStream, getManifestBitstreamFormat, getObjectHandle, getParentObject, ingest, ingestObject, parsePackage, preserveManifest, removeObject, replace, replaceObject, useCollectionTemplate
 
Methods inherited from class org.dspace.content.packager.AbstractPackageIngester
addPackageReference, addToIngestedList, getIngestedList, getPackageReferences, ingestAll, replaceAll
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DSpaceMETSIngester

public DSpaceMETSIngester()
Method Detail

crosswalkObjectDmd

public void crosswalkObjectDmd(Context context,
                               DSpaceObject dso,
                               METSManifest manifest,
                               AbstractMETSIngester.MdrefManager callback,
                               org.jdom.Element[] dmds,
                               PackageParameters params)
                        throws CrosswalkException,
                               PackageValidationException,
                               AuthorizeException,
                               SQLException,
                               IOException
Choose DMD section(s) to crosswalk.

The algorithm is:
1. Use whatever the dmd parameter specifies as the primary DMD.
2. If (1) is unspecified, find MODS (preferably) or DC as primary DMD.
3. If (1) or (2) succeeds, crosswalk it and ignore all other DMDs with same GROUPID
4. Crosswalk remaining DMDs not eliminated already.

Specified by:
crosswalkObjectDmd in class AbstractMETSIngester
Parameters:
context - the DSpace context
manifest - the METSManifest
callback - the MdrefManager (manages all external metadata files referenced by METS mdref elements)
dmds - array of Elements, each a METS dmdSec that applies to the Item as a whole.
Throws:
CrosswalkException
PackageValidationException
AuthorizeException
SQLException
IOException

addLicense

public void addLicense(Context context,
                       Item item,
                       String license,
                       Collection collection,
                       PackageParameters params)
                throws PackageValidationException,
                       AuthorizeException,
                       SQLException,
                       IOException
Policy: For DSpace deposit license, take deposit license supplied by explicit argument first, else use collection's default deposit license. For Creative Commons, look for a rightsMd containing a CC license.

Specified by:
addLicense in class AbstractMETSIngester
Parameters:
context - the DSpace context
license - optional user-supplied Deposit License text (may be null)
collection - DSpace Collection to which the item is being submitted.
Throws:
PackageValidationException
AuthorizeException
SQLException
IOException

finishObject

public void finishObject(Context context,
                         DSpaceObject dso,
                         PackageParameters params)
                  throws PackageValidationException,
                         CrosswalkException,
                         AuthorizeException,
                         SQLException,
                         IOException
Description copied from class: AbstractMETSIngester
Hook for final "finishing" operations on the new Object. This method is called when the new Object is otherwise complete and ready to be returned. The implementation should use this opportunity to make whatever final checks and modifications are necessary.

Specified by:
finishObject in class AbstractMETSIngester
Parameters:
context - the DSpace context
dso - the DSpace Object
params - the Packager Parameters
Throws:
PackageValidationException
CrosswalkException
AuthorizeException
SQLException
IOException

getObjectType

public int getObjectType(METSManifest manifest)
                  throws PackageValidationException
Description copied from class: AbstractMETSIngester
Determines what type of DSpace object is represented in this METS doc.

Specified by:
getObjectType in class AbstractMETSIngester
Throws:
PackageValidationException

finishBitstream

public void finishBitstream(Context context,
                            Bitstream bs,
                            org.jdom.Element mfile,
                            METSManifest manifest,
                            PackageParameters params)
                     throws MetadataValidationException,
                            SQLException,
                            AuthorizeException,
                            IOException
Take a second pass over files to correct names of derived files (e.g. thumbnails, extracted text) to what DSpace expects:

Specified by:
finishBitstream in class AbstractMETSIngester
Throws:
MetadataValidationException
SQLException
AuthorizeException
IOException

getConfigurationName

public String getConfigurationName()
Description copied from class: AbstractMETSIngester
Returns keyword that makes the configuration keys of this subclass unique, e.g. if it returns NAME, the key would be: "mets.NAME.ingest.preserveManifest = true"

Specified by:
getConfigurationName in class AbstractMETSIngester

probe

public boolean probe(Context context,
                     InputStream in,
                     PackageParameters params)

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 PackageIngester
Overrides:
getParameterHelp in class AbstractMETSIngester
Returns:
a string describing additional command-line options available with this packager


Copyright © 2012 DuraSpace. All Rights Reserved.