public class DSpaceAIPIngester extends AbstractMETSIngester
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
AbstractMETSIngester,
AbstractPackageIngester,
PackageIngester,
METSManifestAbstractMETSIngester.MdrefManager| Constructor and Description |
|---|
DSpaceAIPIngester() |
| Modifier and Type | Method and Description |
|---|---|
void |
addLicense(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.
|
protected static void |
createMissingMetadataFields(Context context,
Item item)
Verifies that all the unsaved, crosswalked metadata fields that have
been added to an Item actually exist in our Database.
|
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)
Nothing extra to do to bitstream after ingestion.
|
void |
finishObject(Context context,
DSpaceObject dso,
PackageParameters params)
Last change to fix up a DSpace Object.
|
String |
getConfigurationName()
Name used to distinguish DSpace Configuration entries for this subclass.
|
int |
getObjectType(METSManifest manifest)
Return the type of DSpaceObject in this package; it is
in the TYPE attribute of the mets:mets element.
|
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. |
addBitstreams, addContainerLogo, addManifestBitstream, addTemplateItem, decodeHandleURN, getFileInputStream, getManifestBitstreamFormat, getObjectHandle, getParentObject, ingest, ingestObject, parsePackage, preserveManifest, removeObject, replace, replaceObject, useCollectionTemplateaddPackageReference, addToIngestedList, getIngestedList, getPackageReferences, ingestAll, replaceAllpublic void crosswalkObjectDmd(Context context, DSpaceObject dso, METSManifest manifest, AbstractMETSIngester.MdrefManager callback, org.jdom.Element[] dmds, PackageParameters params) throws CrosswalkException, PackageValidationException, AuthorizeException, SQLException, IOException
The algorithm is:
1. Use whatever the dmd parameter 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.
crosswalkObjectDmd in class AbstractMETSIngestercontext - the DSpace contextmanifest - the METSManifestcallback - 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.CrosswalkExceptionPackageValidationExceptionAuthorizeExceptionSQLExceptionIOExceptionpublic void addLicense(Context context, Item item, String license, Collection collection, PackageParameters params) throws PackageValidationException, AuthorizeException, SQLException, IOException
addLicense in class AbstractMETSIngestercontext - the DSpace contextlicense - optional user-supplied Deposit License text (may be null)collection - DSpace Collection to which the item is being submitted.PackageValidationExceptionAuthorizeExceptionSQLExceptionIOExceptionpublic void finishObject(Context context, DSpaceObject dso, PackageParameters params) throws PackageValidationException, CrosswalkException, AuthorizeException, SQLException, IOException
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)
finishObject in class AbstractMETSIngestercontext - DSpace Contextdso - DSpace objectparams - Packager ParametersPackageValidationExceptionCrosswalkExceptionAuthorizeExceptionSQLExceptionIOExceptionpublic void finishBitstream(Context context, Bitstream bs, org.jdom.Element mfile, METSManifest manifest, PackageParameters params) throws MetadataValidationException, SQLException, AuthorizeException, IOException
finishBitstream in class AbstractMETSIngesterMetadataValidationExceptionSQLExceptionAuthorizeExceptionIOExceptionpublic int getObjectType(METSManifest manifest) throws PackageValidationException
getObjectType in class AbstractMETSIngesterPackageValidationExceptionpublic String getConfigurationName()
getConfigurationName in class AbstractMETSIngesterprotected static void createMissingMetadataFields(Context context, Item item) throws PackageValidationException, AuthorizeException, IOException, SQLException
This method must be called *before* item.update(), as the call to update() will throw a SQLException when attempting to save any fields which don't already exist in the database.
NOTE: This will NOT create a missing Metadata Schema (e.g. "dc" schema), as we do not have enough info to create schemas on the fly.
context - - DSpace Contextitem - - Item whose unsaved metadata fields we are testingAuthorizeException - if a metadata field doesn't exist and current user is not authorized to create it (i.e. not an Admin)PackageValidationException - if a metadata schema doesn't exist, as we cannot autocreate a schemaIOExceptionSQLExceptionpublic String getParameterHelp()
-o or
--option flags with the Packager script.getParameterHelp in interface PackageIngestergetParameterHelp in class AbstractMETSIngesterCopyright © 2013 DuraSpace. All Rights Reserved.