public class InternalDSpaceAIPIngester extends AbstractInternalMETSIngester
AbstractInternalMETSIngester.MdrefManager| Constructor and Description |
|---|
InternalDSpaceAIPIngester() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addBitstreams(org.dspace.core.Context context,
org.dspace.content.Item item,
org.dspace.content.packager.METSManifest manifest,
File pkgFile,
org.dspace.content.packager.PackageParameters params,
AbstractInternalMETSIngester.MdrefManager mdRefCallback)
Add Bitstreams to an Item, based on the files listed in the METS Manifest
|
void |
addLicense(org.dspace.core.Context context,
org.dspace.content.Item item,
String license,
org.dspace.content.Collection collection,
org.dspace.content.packager.PackageParameters params)
Ignore license when restoring an manifest-only AIP, since it should
be a bitstream in the AIP already.
|
protected static void |
createMissingMetadataFields(org.dspace.core.Context context,
org.dspace.content.Item item)
Verifies that all the unsaved, crosswalked metadata fields that have
been added to an Item actually exist in our Database.
|
void |
crosswalkObjectDmd(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.METSManifest manifest,
AbstractInternalMETSIngester.MdrefManager callback,
org.jdom.Element[] dmds,
org.dspace.content.packager.PackageParameters params)
Choose DMD section(s) to crosswalk.
|
void |
finishBitstream(org.dspace.core.Context context,
org.dspace.content.Bitstream bs,
org.jdom.Element mfile,
org.dspace.content.packager.METSManifest manifest,
org.dspace.content.packager.PackageParameters params)
Nothing extra to do to bitstream after ingestion.
|
void |
finishObject(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params)
Last change to fix up a DSpace Object.
|
String |
getConfigurationName()
Name used to distinguish DSpace Configuration entries for this subclass.
|
int |
getObjectType(org.dspace.content.packager.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. |
org.dspace.content.DSpaceObject |
replace(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dsoToReplace,
File pkgFile,
org.dspace.content.packager.PackageParameters params)
Replace an existing DSpace object with the contents of a METS-based
package.
|
org.dspace.content.Bitstream |
resolveBitstream(org.dspace.core.Context context,
org.jdom.Element mfile,
org.dspace.content.packager.PackageParameters params,
String path)
Interpret a Bitstream URI in the manifest.
|
addContainerLogo, addManifestBitstream, addTemplateItem, decodeHandleURN, getFileInputStream, getManifestBitstreamFormat, getObjectHandle, getParentObject, ingest, ingestObject, parsePackage, preserveManifest, removeObject, replaceObject, useCollectionTemplatepublic void crosswalkObjectDmd(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.METSManifest manifest,
AbstractInternalMETSIngester.MdrefManager callback,
org.jdom.Element[] dmds,
org.dspace.content.packager.PackageParameters params)
throws org.dspace.content.crosswalk.CrosswalkException,
org.dspace.content.packager.PackageValidationException,
org.dspace.authorize.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 AbstractInternalMETSIngestercontext - 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.org.dspace.content.crosswalk.CrosswalkExceptionorg.dspace.content.packager.PackageValidationExceptionorg.dspace.authorize.AuthorizeExceptionSQLExceptionIOExceptionpublic void addLicense(org.dspace.core.Context context,
org.dspace.content.Item item,
String license,
org.dspace.content.Collection collection,
org.dspace.content.packager.PackageParameters params)
throws org.dspace.content.packager.PackageValidationException,
org.dspace.authorize.AuthorizeException,
SQLException,
IOException
addLicense in class AbstractInternalMETSIngestercontext - the DSpace contextlicense - optional user-supplied Deposit License text (may be null)collection - DSpace Collection to which the item is being submitted.org.dspace.content.packager.PackageValidationExceptionorg.dspace.authorize.AuthorizeExceptionSQLExceptionIOExceptionpublic void finishObject(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params)
throws org.dspace.content.packager.PackageValidationException,
org.dspace.content.crosswalk.CrosswalkException,
org.dspace.authorize.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 AbstractInternalMETSIngestercontext - DSpace Contextdso - DSpace objectparams - Packager Parametersorg.dspace.content.packager.PackageValidationExceptionorg.dspace.content.crosswalk.CrosswalkExceptionorg.dspace.authorize.AuthorizeExceptionSQLExceptionIOExceptionpublic void finishBitstream(org.dspace.core.Context context,
org.dspace.content.Bitstream bs,
org.jdom.Element mfile,
org.dspace.content.packager.METSManifest manifest,
org.dspace.content.packager.PackageParameters params)
throws org.dspace.content.crosswalk.MetadataValidationException,
SQLException,
org.dspace.authorize.AuthorizeException,
IOException
finishBitstream in class AbstractInternalMETSIngesterorg.dspace.content.crosswalk.MetadataValidationExceptionSQLExceptionorg.dspace.authorize.AuthorizeExceptionIOExceptionpublic int getObjectType(org.dspace.content.packager.METSManifest manifest)
throws org.dspace.content.packager.PackageValidationException
getObjectType in class AbstractInternalMETSIngesterorg.dspace.content.packager.PackageValidationExceptionpublic String getConfigurationName()
getConfigurationName in class AbstractInternalMETSIngesterprotected static void createMissingMetadataFields(org.dspace.core.Context context,
org.dspace.content.Item item)
throws org.dspace.content.packager.PackageValidationException,
org.dspace.authorize.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 testingorg.dspace.authorize.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 schemaIOExceptionSQLExceptionpublic String getParameterHelp()
-o or
--option flags with the Packager script.getParameterHelp in interface org.dspace.content.packager.PackageIngestergetParameterHelp in class AbstractInternalMETSIngesterprotected void addBitstreams(org.dspace.core.Context context,
org.dspace.content.Item item,
org.dspace.content.packager.METSManifest manifest,
File pkgFile,
org.dspace.content.packager.PackageParameters params,
AbstractInternalMETSIngester.MdrefManager mdRefCallback)
throws SQLException,
IOException,
org.dspace.authorize.AuthorizeException,
org.dspace.content.crosswalk.MetadataValidationException,
org.dspace.content.crosswalk.CrosswalkException,
org.dspace.content.packager.PackageValidationException
addBitstreams in class AbstractInternalMETSIngestercontext - DSpace Contextitem - DSpace Itemmanifest - METS ManifestpkgFile - the full package file (which may include content files if a
zip)params - Ingestion ParametersmdRefCallback - MdrefManager storing info about mdRefs in manifestSQLExceptionIOExceptionorg.dspace.authorize.AuthorizeExceptionorg.dspace.content.crosswalk.MetadataValidationExceptionorg.dspace.content.crosswalk.CrosswalkExceptionPackageValidationExceptionpublic org.dspace.content.Bitstream resolveBitstream(org.dspace.core.Context context,
org.jdom.Element mfile,
org.dspace.content.packager.PackageParameters params,
String path)
throws SQLException,
org.dspace.content.packager.PackageValidationException
SQLExceptionorg.dspace.content.packager.PackageValidationExceptionpublic org.dspace.content.DSpaceObject replace(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dsoToReplace,
File pkgFile,
org.dspace.content.packager.PackageParameters params)
throws org.dspace.content.packager.PackageValidationException,
org.dspace.content.crosswalk.CrosswalkException,
org.dspace.authorize.AuthorizeException,
SQLException,
IOException
This method is similar to ingest(), except that if the object already exists in DSpace, it is emptied of files and metadata. The METS-based package is then used to ingest new values for these.
replace in interface org.dspace.content.packager.PackageIngesterreplace in class AbstractInternalMETSIngestercontext - DSpace ContextdsoToReplace - DSpace Object to be replaced (may be null if it will be
specified in the METS manifest itself)pkgFile - The package file to ingestparams - Parameters passed from the packager scriptPackageValidationException - if package is unacceptable or there is a fatal error turning
it into a DSpace Object.IOExceptionSQLExceptionorg.dspace.authorize.AuthorizeExceptionorg.dspace.content.crosswalk.CrosswalkExceptionCopyright © 2016 DuraSpace. All rights reserved.