org.dspace.content.packager
Class DSpaceMETSIngester

java.lang.Object
  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: 4575 $
Author:
Larry Stone
See Also:
METSManifest

Nested Class Summary
 
Nested classes/interfaces inherited from class org.dspace.content.packager.AbstractMETSIngester
AbstractMETSIngester.MdrefManager
 
Field Summary
 
Fields inherited from class org.dspace.content.packager.AbstractMETSIngester
MANIFEST_FILE
 
Constructor Summary
DSpaceMETSIngester()
           
 
Method Summary
 void addLicense(Context context, Collection collection, Item item, METSManifest manifest, AbstractMETSIngester.MdrefManager callback, String license)
          Policy: For DSpace deposit license, take deposit license supplied by explicit argument first, else use collection's default deposit license.
 void checkPackageFiles(Set packageFiles, Set missingFiles, METSManifest manifest)
          Hook for subclass to modify the test of the package's integrity, and add other tests.
 void chooseItemDmd(Context context, Item item, METSManifest manifest, AbstractMETSIngester.MdrefManager callback, org.jdom.Element[] dmds, PackageParameters params)
          Choose DMD section(s) to crosswalk.
 void finishItem(Context context, Item item)
          Hook for final "finishing" operations on the new Item.
 
Methods inherited from class org.dspace.content.packager.AbstractMETSIngester
ingest, replace
 
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

checkPackageFiles

public void checkPackageFiles(Set packageFiles,
                              Set missingFiles,
                              METSManifest manifest)
                       throws PackageValidationException,
                              CrosswalkException
Description copied from class: AbstractMETSIngester
Hook for subclass to modify the test of the package's integrity, and add other tests. E.g. evaluate a PGP signature of the manifest in a separate file.

The packageFiles contains "extra" files that were in the package but were not referenced by the METS manifest (either as content or metadata (mdRefs)). The implementation of this method should look for any "extra" files uses (e.g. a checksum or cryptographic signature for the manifest itself) and remove them from the Set.

The missingFiles set is for any files referenced by the manifest but not found in the package. The implementation can check it for "false positives", or add other missing files it knows of.

If either of the Sets missingFiles or packageFiles is not empty, the ingest will fail.

Specified by:
checkPackageFiles in class AbstractMETSIngester
Parameters:
packageFiles - files in package but not referenced by METS
missingFiles - files referenced by manifest but not in package
Throws:
PackageValidationException
CrosswalkException

chooseItemDmd

public void chooseItemDmd(Context context,
                          Item item,
                          METSManifest manifest,
                          AbstractMETSIngester.MdrefManager callback,
                          org.jdom.Element[] dmds,
                          PackageParameters params)
                   throws CrosswalkException,
                          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:
chooseItemDmd in class AbstractMETSIngester
Parameters:
context - the DSpace context
item - the DSpace item
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.
params - any user parameters passed to the Packager script
Throws:
CrosswalkException
AuthorizeException
SQLException
IOException

addLicense

public void addLicense(Context context,
                       Collection collection,
                       Item item,
                       METSManifest manifest,
                       AbstractMETSIngester.MdrefManager callback,
                       String license)
                throws PackageValidationException,
                       CrosswalkException,
                       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
collection - DSpace Collection to which the item is being submitted.
license - optional user-supplied Deposit License text (may be null)
Throws:
PackageValidationException
CrosswalkException
AuthorizeException
SQLException
IOException

finishItem

public void finishItem(Context context,
                       Item item)
                throws PackageValidationException,
                       CrosswalkException,
                       AuthorizeException,
                       SQLException,
                       IOException
Description copied from class: AbstractMETSIngester
Hook for final "finishing" operations on the new Item. This method is called when the new Item 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:
finishItem in class AbstractMETSIngester
Parameters:
context - the DSpace context
Throws:
PackageValidationException
CrosswalkException
AuthorizeException
SQLException
IOException


Copyright © 2010 DuraSpace. All Rights Reserved.