Interface PackageDisseminator
-
- All Known Implementing Classes:
AbstractMETSDisseminator,AbstractPackageDisseminator,DSpaceAIPDisseminator,DSpaceMETSDisseminator,PDFPackager,RoleDisseminator
public interface PackageDisseminatorPlugin Interface to produce Dissemination Information Package (DIP) of a DSpace object.An implementation translates DSpace objects to some external "package" format. A package is a single data stream (or file) containing enough information to reconstruct the object. 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.
A DIP implementation has two methods:
disseminateto produce the package itself, andgetMIMETypeto identify its Internet format type (needed when transmitting the package over HTTP).Both of these methods are given an attribute-values list of "parameters", which may modify their actions. Since the format output by
disseminatemay be affected by parameters, it is given to thegetMIMETypemethod as well. The parameters list is a generalized mechanism to pass parameters from the package requestor to the packager, since different packagers will understand different sets of parameters.- Version:
- $Revision$
- Author:
- Larry Stone
- See Also:
PackageParameters
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddisseminate(Context context, DSpaceObject object, PackageParameters params, File pkgFile)Export the object (Item, Collection, or Community) as a "package" on the indicated OutputStream.List<File>disseminateAll(Context context, DSpaceObject dso, PackageParameters params, File pkgFile)Recursively export one or more DSpace Objects as a series of packages.StringgetMIMEType(PackageParameters params)Identifies the MIME-type of this package, e.g.StringgetParameterHelp()Returns a user help string which should describe the additional valid command-line options that this packager implementation will accept when using the-oor--optionflags with the Packager script.
-
-
-
Method Detail
-
disseminate
void disseminate(Context context, DSpaceObject object, PackageParameters params, File pkgFile) throws PackageException, CrosswalkException, AuthorizeException, SQLException, IOException
Export the object (Item, Collection, or Community) as a "package" on the indicated OutputStream. Package is any serialized representation of the item, at the discretion of the implementing class. It does not have to include content bitstreams.Use the
paramsparameter list to adjust the way the package is made, e.g. including a "metadataOnly" parameter might make the package a bare manifest in XML instead of a Zip file including manifest and contents.Throws an exception of the chosen object is not acceptable or there is a failure creating the package.
- Parameters:
context- DSpace context.object- DSpace object (item, collection, etc)params- Properties-style list of options specific to this packagerpkgFile- File where export package should be written- Throws:
PackageValidationException- if package cannot be created or there is a fatal error in creating it.CrosswalkException- if crosswalk errorAuthorizeException- if authorization errorSQLException- if database errorIOException- if IO errorPackageException
-
disseminateAll
List<File> disseminateAll(Context context, DSpaceObject dso, PackageParameters params, File pkgFile) throws PackageException, CrosswalkException, AuthorizeException, SQLException, IOException
Recursively export one or more DSpace Objects as a series of packages. This method will export the given DSpace Object as well as all referenced DSpaceObjects (e.g. child objects) into a series of packages. The initial object is exported to the location specified by the pkgFile. All other generated packages are recursively exported to the same directory.Package is any serialized representation of the item, at the discretion of the implementing class. It does not have to include content bitstreams.
Use the
paramsparameter list to adjust the way the package is made, e.g. including a "metadataOnly" parameter might make the package a bare manifest in XML instead of a Zip file including manifest and contents.Throws an exception of the initial object is not acceptable or there is a failure creating the packages.
A packager may choose not to implement
disseminateAll, or simply forward the call todisseminateif it is unable to support recursive dissemination.- Parameters:
context- DSpace context.dso- initial DSpace objectparams- Properties-style list of options specific to this packagerpkgFile- File where initial package should be written. All other packages will be written to the same directory as this File.- Returns:
- List of all package Files which were successfully disseminated
- Throws:
PackageValidationException- if package cannot be created or there is a fatal error in creating it.CrosswalkException- if crosswalk errorAuthorizeException- if authorization errorSQLException- if database errorIOException- if IO errorPackageException
-
getMIMEType
String getMIMEType(PackageParameters params)
Identifies the MIME-type of this package, e.g."application/zip". Required when sending the package via HTTP, to provide the Content-Type header.- Parameters:
params- Package Parameters- Returns:
- the MIME type (content-type header) of the package to be returned
-
getParameterHelp
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-oor--optionflags with the Packager script.- Returns:
- a string describing additional command-line options available with this packager
-
-