|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.content.packager.AbstractMETSIngester
public abstract class AbstractMETSIngester
Base class for package ingester of
METS (Metadata Encoding & Transmission Standard) Package.
See http://www.loc.gov/standards/mets/
This is a generic packager framework intended to be subclassed to create ingesters for more specific METS "profiles". METS is an abstract and flexible framework that can encompass many different kinds of metadata and inner package structures.
Configuration:
If the property mets.submission.preserveManifest is true,
the METS manifest itself is preserved in a bitstream named
mets.xml in the METADATA bundle. If it is
false (the default), the manifest is discarded after ingestion.
METSManifest| Nested Class Summary | |
|---|---|
protected class |
AbstractMETSIngester.MdrefManager
An instance of MdrefManager holds the state needed to retrieve the contents (or bitstream corresponding to) an external metadata stream referenced by an mdRef
element in the METS manifest. |
| Field Summary | |
|---|---|
static String |
MANIFEST_FILE
Filename of manifest, relative to package toplevel. |
| Constructor Summary | |
|---|---|
AbstractMETSIngester()
|
|
| Method Summary | |
|---|---|
abstract void |
addLicense(Context context,
Collection collection,
Item item,
METSManifest manifest,
AbstractMETSIngester.MdrefManager callback,
String license)
Add license(s) to Item based on contents of METS and other policies. |
abstract void |
checkPackageFiles(Set packageFiles,
Set missingFiles,
METSManifest manifest)
Hook for subclass to modify the test of the package's integrity, and add other tests. |
abstract void |
chooseItemDmd(Context context,
Item item,
METSManifest manifest,
AbstractMETSIngester.MdrefManager cb,
org.jdom.Element[] dmds)
Select the dmdSec element(s) to apply to the
Item. |
abstract void |
finishItem(Context context,
Item item)
Hook for final "finishing" operations on the new Item. |
WorkspaceItem |
ingest(Context context,
Collection collection,
InputStream pkg,
PackageParameters params,
String license)
Create a new DSpace item out of a METS content package. |
Item |
replace(Context ctx,
Item item,
InputStream pckage,
PackageParameters params)
XXX FIXME Replace is not implemented yet. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String MANIFEST_FILE
| Constructor Detail |
|---|
public AbstractMETSIngester()
| Method Detail |
|---|
public WorkspaceItem ingest(Context context,
Collection collection,
InputStream pkg,
PackageParameters params,
String license)
throws PackageValidationException,
CrosswalkException,
AuthorizeException,
SQLException,
IOException
ingest in interface PackageIngestercontext - - DSpace context.collection - - collection under which to create new item.pkg - - input stream containing package to ingest.license - - may be null, which takes default license.params - Properties-style list of options (interpreted by each packager).
PackageValidationException - if package is unacceptable or there is
a fatal error turning it into an Item.
CrosswalkException
AuthorizeException
SQLException
IOException
public Item replace(Context ctx,
Item item,
InputStream pckage,
PackageParameters params)
throws PackageException,
UnsupportedOperationException,
CrosswalkException,
AuthorizeException,
SQLException,
IOException
replace in interface PackageIngesterctx - DSpace context.item - existing item to be replacedpckage - input stream containing package to ingest.params - Properties-style list of options specific to this packager
PackageValidationException - if package is unacceptable or there is
a fatal error turning it into an Item.
UnsupportedOperationException - if this packager does not
implement replace.
PackageException
CrosswalkException
AuthorizeException
SQLException
IOException
public abstract void checkPackageFiles(Set packageFiles,
Set missingFiles,
METSManifest manifest)
throws PackageValidationException,
CrosswalkException
The packageFiles contains "extra" files that were in
the package but were not referenced by the METS manifest (either as
content or metadata (mdRefs)).
The implementation of this method should look for any "extra" files
uses (e.g. a checksum or cryptographic signature for the manifest
itself) and remove them from the Set.
The missingFiles set is for
any files
referenced by the manifest but not found in the package.
The implementation can check it for "false positives", or add
other missing files it knows of.
If either of the Sets missingFiles
or packageFiles
is not empty, the ingest will fail.
packageFiles - files in package but not referenced by METSmissingFiles - files referenced by manifest but not in package
PackageValidationException
CrosswalkException
public abstract void chooseItemDmd(Context context,
Item item,
METSManifest manifest,
AbstractMETSIngester.MdrefManager cb,
org.jdom.Element[] dmds)
throws CrosswalkException,
AuthorizeException,
SQLException,
IOException
dmdSec element(s) to apply to the
Item. The implementation is responsible for choosing which
(if any) of the metadata sections to crosswalk to get the
descriptive metadata for the item being ingested. It is
responsible for calling the crosswalk, using the manifest's helper
i.e. manifest.crosswalkItem(context,item,dmdElement,callback);
(The final argument is a reference to itself since the
class also implements the METSManifest.MdRef interface
to fetch package files referenced by mdRef elements.)
Note that item and manifest are available
as protected fields from the superclass.
context - the DSpace contextdmds - array of Elements, each a METS dmdSec that applies to the Item as a whole.
CrosswalkException
AuthorizeException
SQLException
IOException
public abstract void addLicense(Context context,
Collection collection,
Item item,
METSManifest manifest,
AbstractMETSIngester.MdrefManager callback,
String license)
throws PackageValidationException,
CrosswalkException,
AuthorizeException,
SQLException,
IOException
manifest.getItemRightsMD() to get an array of
rightsMd elements which might contain other license
information of interest, e.g. a Creative Commons license.
This framework does not add any licenses by default.
context - the DSpace contextcollection - DSpace Collection to which the item is being submitted.license - optional user-supplied Deposit License text (may be null)
PackageValidationException
CrosswalkException
AuthorizeException
SQLException
IOException
public abstract void finishItem(Context context,
Item item)
throws PackageValidationException,
CrosswalkException,
AuthorizeException,
SQLException,
IOException
context - the DSpace context
PackageValidationException
CrosswalkException
AuthorizeException
SQLException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||