Class DSpaceAIPIngester
- All Implemented Interfaces:
PackageIngester
This ingester recognizes two distinct types of AIPs: "Manifest-Only" and "External". The Manifest-Only AIP, which is selected by specifying a PackageParameters key "manifestOnly" with the value "true", refers to all its contents by reference only. For Community or Collection AIPs this means all references to their child objects are just via Handles. For Item AIPs all Bitreams are just referenced by their asset store location instead of finding them in the "package". The Manifest-Only AIP package format is simply a METS XML document serialized into a file.
An "external" AIP (the default), is a conventional Zip-file based package that includes copies of all bitstreams referenced by the object as well as a serialized METS XML document in the path "mets.xml". Configuration keys: # instructs which xwalk plugin to use for a given type of metadata mets.dspaceAIP.ingest.crosswalk.{mdSecName} = {pluginName} mets.dspaceAIP.ingest.crosswalk.DC = QDC mets.dspaceAIP.ingest.crosswalk.DSpaceDepositLicense = NULLSTREAM # Option to save METS manifest in the item: (default is false) mets.default.ingest.preserveManifest = false
- Version:
- $Revision: 1.1 $
- Author:
- Larry Stone, Tim Donohue
- See Also:
-
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
bitstreamFormatService, bitstreamService, bundleService, collectionService, communityService, configurationService, handleService, itemService, workspaceItemService -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddLicense(Context context, Item item, String license, Collection collection, PackageParameters params) Ignore license when restoring an manifest-only AIP, since it should be a bitstream in the AIP already.voidcrosswalkObjectDmd(Context context, DSpaceObject dso, METSManifest manifest, AbstractMETSIngester.MdrefManager callback, org.jdom2.Element[] dmds, PackageParameters params) Choose DMD section(s) to crosswalk.voidfinishBitstream(Context context, Bitstream bs, org.jdom2.Element mfile, METSManifest manifest, PackageParameters params) Nothing extra to do to bitstream after ingestion.voidfinishObject(Context context, DSpaceObject dso, PackageParameters params) Last change to fix up a DSpace Object.Name used to distinguish DSpace Configuration entries for this subclass.intgetObjectType(METSManifest manifest) Return the type of DSpaceObject in this package; it is in the TYPE attribute of the mets:mets element.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.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, useCollectionTemplateMethods inherited from class org.dspace.content.packager.AbstractPackageIngester
addPackageReference, addToIngestedMap, getIngestedList, getIngestedMap, getPackageReferences, ingestAll, replaceAll
-
Constructor Details
-
DSpaceAIPIngester
public DSpaceAIPIngester()
-
-
Method Details
-
crosswalkObjectDmd
public void crosswalkObjectDmd(Context context, DSpaceObject dso, METSManifest manifest, AbstractMETSIngester.MdrefManager callback, org.jdom2.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 DIM (preferably) or MODS 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 relevant DSpace Context.dso- 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:
PackageValidationException- validation errorCrosswalkException- if crosswalk 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 Ignore license when restoring an manifest-only AIP, since it should be a bitstream in the AIP already. Otherwise: Check item for license first; then, take deposit license supplied by explicit argument next, else use collection's default deposit license. Normally the rightsMD crosswalks should provide a license.- Specified by:
addLicensein classAbstractMETSIngester- Parameters:
context- The relevant DSpace Context.item- item to add license tocollection- collection to get the default license fromparams- Packager Parameterslicense- optional user-supplied Deposit License text (may be null)- Throws:
PackageValidationException- 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 Last change to fix up a DSpace Object.For AIPs, if the object is an Item, we may want to make sure all of its metadata fields already exist in the database (otherwise, the database will throw errors when we attempt to save/update the Item)
- Specified by:
finishObjectin classAbstractMETSIngester- Parameters:
context- The relevant DSpace Context.dso- DSpace objectparams- Packager Parameters- Throws:
PackageValidationException- Failure when importing or exporting a package caused by invalid unacceptable package format or contentsCrosswalkException- Superclass for more-specific crosswalk exceptions.IOException- A general class of exceptions produced by failed or interrupted I/O operations.SQLException- An exception that provides information on a database access error or other errors.AuthorizeException- Exception indicating the current user of the context does not have permission to perform a particular action.
-
finishBitstream
public void finishBitstream(Context context, Bitstream bs, org.jdom2.Element mfile, METSManifest manifest, PackageParameters params) throws MetadataValidationException, SQLException, AuthorizeException, IOException Nothing extra to do to bitstream after ingestion.- 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
-
getObjectType
Return the type of DSpaceObject in this package; it is in the TYPE attribute of the mets:mets element.- Specified by:
getObjectTypein classAbstractMETSIngester- Parameters:
manifest- METS manifest- Returns:
- type
- Throws:
PackageValidationException- if package validation error
-
getConfigurationName
Name used to distinguish DSpace Configuration entries for this subclass.- Specified by:
getConfigurationNamein classAbstractMETSIngester- Returns:
- config name
-
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
-