|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.content.packager.AbstractPackageIngester
org.dspace.content.packager.AbstractMETSIngester
org.dspace.content.packager.DSpaceAIPIngester
public class DSpaceAIPIngester
Subclass of the METS packager framework to ingest a DSpace Archival Information Package (AIP). The AIP is intended to be, foremost, a _complete_ and _accurate_ representation of one object in the DSpace object model. An AIP contains all of the information needed to restore the object precisely in another DSpace archive instance.
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,
METSManifest| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.dspace.content.packager.AbstractMETSIngester |
|---|
AbstractMETSIngester.MdrefManager |
| Constructor Summary | |
|---|---|
DSpaceAIPIngester()
|
|
| Method Summary | |
|---|---|
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. |
| 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 |
|---|
public DSpaceAIPIngester()
| Method Detail |
|---|
public 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.
CrosswalkException
PackageValidationException
AuthorizeException
SQLException
IOException
public 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.
PackageValidationException
AuthorizeException
SQLException
IOException
public 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 Parameters
PackageValidationException
CrosswalkException
AuthorizeException
SQLException
IOException
public void finishBitstream(Context context,
Bitstream bs,
org.jdom.Element mfile,
METSManifest manifest,
PackageParameters params)
throws MetadataValidationException,
SQLException,
AuthorizeException,
IOException
finishBitstream in class AbstractMETSIngesterMetadataValidationException
SQLException
AuthorizeException
IOException
public int getObjectType(METSManifest manifest)
throws PackageValidationException
getObjectType in class AbstractMETSIngesterPackageValidationExceptionpublic String getConfigurationName()
getConfigurationName in class AbstractMETSIngester
protected 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 testing
AuthorizeException - 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 schema
IOException
SQLExceptionpublic String getParameterHelp()
-o or
--option flags with the Packager script.
getParameterHelp in interface PackageIngestergetParameterHelp in class AbstractMETSIngester
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||