Package org.dspace.content.packager
Class DSpaceMETSIngester
- java.lang.Object
-
- org.dspace.content.packager.AbstractPackageIngester
-
- org.dspace.content.packager.AbstractMETSIngester
-
- org.dspace.content.packager.DSpaceMETSIngester
-
- All Implemented Interfaces:
PackageIngester
public class DSpaceMETSIngester extends AbstractMETSIngester
Packager plugin to ingest a METS (Metadata Encoding and 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
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringPROFILE_START-
Fields inherited from class org.dspace.content.packager.AbstractMETSIngester
bitstreamFormatService, bitstreamService, bundleService, collectionService, communityService, configurationService, handleService, itemService, workspaceItemService
-
-
Constructor Summary
Constructors Constructor Description DSpaceMETSIngester()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddLicense(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.voidcrosswalkObjectDmd(Context context, DSpaceObject dso, METSManifest manifest, AbstractMETSIngester.MdrefManager callback, org.jdom.Element[] dmds, PackageParameters params)Choose DMD section(s) to crosswalk.voidfinishBitstream(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.voidfinishObject(Context context, DSpaceObject dso, PackageParameters params)Hook for final "finishing" operations on the new Object.StringgetConfigurationName()Returns keyword that makes the configuration keys of this subclass unique, e.g.intgetObjectType(METSManifest manifest)Determines what type of DSpace object is represented in this METS doc.StringgetParameterHelp()Returns a user help string which should describe the additional valid command-line options that this packager implementation will accept when using the-oor--optionflags with the Packager script.booleanprobe(Context context, InputStream in, PackageParameters params)-
Methods inherited from class org.dspace.content.packager.AbstractMETSIngester
addBitstreams, addContainerLogo, addManifestBitstream, addTemplateItem, decodeHandleURN, getFileInputStream, getManifestBitstreamFormat, getObjectHandle, getObjectID, getParentObject, ingest, ingestObject, parsePackage, preserveManifest, removeObject, replace, replaceObject, useCollectionTemplate
-
Methods inherited from class org.dspace.content.packager.AbstractPackageIngester
addPackageReference, addToIngestedMap, getIngestedList, getIngestedMap, getPackageReferences, ingestAll, replaceAll
-
-
-
-
Field Detail
-
PROFILE_START
protected static final String PROFILE_START
- See Also:
- Constant Field Values
-
-
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 thedmdparameter 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:
crosswalkObjectDmdin classAbstractMETSIngester- Parameters:
context- the DSpace contextdso- DSpace Objectmanifest- the METSManifestcallback- the MdrefManager (manages all external metadata files referenced by METSmdrefelements)dmds- array of Elements, each a METSdmdSecthat applies to the Item as a whole.params- Packager Parameters- Throws:
CrosswalkException- if crosswalk errorPackageValidationException- if validation errorIOException- if IO errorSQLException- if database errorAuthorizeException- if authorization error
-
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:
addLicensein classAbstractMETSIngester- Parameters:
context- the DSpace contextitem- Itemlicense- optional user-supplied Deposit License text (may be null)collection- DSpace Collection to which the item is being submitted.params- Packager Parameters- Throws:
PackageValidationException- if validation errorIOException- if IO errorSQLException- if database errorAuthorizeException- if authorization error
-
finishObject
public void finishObject(Context context, DSpaceObject dso, PackageParameters params) throws PackageValidationException, CrosswalkException, AuthorizeException, SQLException, IOException
Description copied from class:AbstractMETSIngesterHook 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:
finishObjectin classAbstractMETSIngester- Parameters:
context- the DSpace contextdso- the DSpace Objectparams- the Packager Parameters- Throws:
PackageValidationException- if package validation errorCrosswalkException- if crosswalk errorAuthorizeException- if authorization errorSQLException- if database errorIOException- if IO error
-
getObjectType
public int getObjectType(METSManifest manifest) throws PackageValidationException
Description copied from class:AbstractMETSIngesterDetermines what type of DSpace object is represented in this METS doc.- Specified by:
getObjectTypein classAbstractMETSIngester- Parameters:
manifest- METS manifest- Returns:
- one of the object types in Constants.
- Throws:
PackageValidationException- if package validation error
-
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:
finishBitstreamin classAbstractMETSIngester- Parameters:
context- contextbs- bitstreammfile- elementmanifest- METS manifestparams- package params- Throws:
MetadataValidationException- if validation errorIOException- if IO errorSQLException- if database errorAuthorizeException- if authorization error
-
getConfigurationName
public String getConfigurationName()
Description copied from class:AbstractMETSIngesterReturns 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:
getConfigurationNamein classAbstractMETSIngester- Returns:
- name
-
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-oor--optionflags with the Packager script.- Specified by:
getParameterHelpin interfacePackageIngester- Overrides:
getParameterHelpin classAbstractMETSIngester- Returns:
- a string describing additional command-line options available with this packager
-
-