org.dspace.content.packager
Interface PackageIngester

All Known Implementing Classes:
AbstractMETSIngester, DSpaceMETSIngester, PDFPackager

public interface PackageIngester

Plugin Interface to interpret a Submission Information Package (SIP) and create (or replace) a DSpace item from its contents.

A package is a single data stream containing enough information to construct an Item. It can be anything from an archive like a Zip file with a manifest and metadata, to a simple manifest containing external references to the content, to a self-contained file such as a PDF. The interpretation of the package is entirely at the discretion of the implementing class.

The ingest methods are also given an attribute-value list of "parameters" which may modify their actions. The parameters list is a generalized mechanism to pass parameters from the requestor to the packager, since different packagers will understand different sets of parameters.

Version:
$Revision: 3761 $
Author:
Larry Stone
See Also:
PackageParameters

Method Summary
 WorkspaceItem ingest(Context context, Collection collection, InputStream in, PackageParameters params, String license)
          Create new Item out of the ingested package.
 Item replace(Context context, Item item, InputStream in, PackageParameters params)
          Replace an existing Item with contents of the ingested package.
 

Method Detail

ingest

WorkspaceItem ingest(Context context,
                     Collection collection,
                     InputStream in,
                     PackageParameters params,
                     String license)
                     throws PackageException,
                            CrosswalkException,
                            AuthorizeException,
                            SQLException,
                            IOException
Create new Item out of the ingested package. The item will belong to the indicated collection. This creates a WorkspaceItem, so it is up to the caller to decide whether to install it or submit it to normal DSpace Workflow.

The deposit license is passed explicitly as a string since there is no place for it in many package formats. It is optional and may be given as null.

Parameters:
context - DSpace context.
collection - collection under which to create new item.
in - input stream containing package to ingest.
params - Properties-style list of options (interpreted by each packager).
license - may be null, which takes default license.
Returns:
workspace item created by ingest.
Throws:
PackageValidationException - if package is unacceptable or there is a fatal error turning it into an Item.
PackageException
CrosswalkException
AuthorizeException
SQLException
IOException

replace

Item replace(Context context,
             Item item,
             InputStream in,
             PackageParameters params)
             throws PackageException,
                    UnsupportedOperationException,
                    CrosswalkException,
                    AuthorizeException,
                    SQLException,
                    IOException
Replace an existing Item with contents of the ingested package. The packager may choose not to implement replace, since it somewhat contradicts the archival nature of DSpace. The exact function of this method is highly implementation-dependent.

Parameters:
context - DSpace context.
item - existing item to be replaced
in - input stream containing package to ingest.
params - Properties-style list of options specific to this packager
Returns:
item re-created by ingest.
Throws:
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


Copyright © 2010 DuraSpace. All Rights Reserved.