Class AbstractPackageDisseminator
- java.lang.Object
-
- org.dspace.content.packager.AbstractPackageDisseminator
-
- All Implemented Interfaces:
PackageDisseminator
- Direct Known Subclasses:
AbstractMETSDisseminator
public abstract class AbstractPackageDisseminator extends Object implements PackageDisseminator
An abstract implementation of a DSpace Package Disseminator, which implements a few helper/utility methods that most (all?) PackageDisseminators may find useful.First, implements recursive functionality in the disseminateAll() method of the PackageIngester interface. This method is setup to recursively call disseminate() method.
All Package disseminators should either extend this abstract class or implement
PackageDisseminatorto better suit their needs.- Author:
- Tim Donohue
- See Also:
PackageDisseminator,PluginService
-
-
Field Summary
Fields Modifier and Type Field Description protected CommunityServicecommunityServiceprotected ItemServiceitemService
-
Constructor Summary
Constructors Constructor Description AbstractPackageDisseminator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddToPackageList(File f)Add File to list of successfully disseminated package filesList<File>disseminateAll(Context context, DSpaceObject dso, PackageParameters params, File pkgFile)Recursively export one or more DSpace Objects as a series of packages.protected List<File>getPackageList()Return List of all package Files which have been disseminated this instance of the Disseminator.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.dspace.content.packager.PackageDisseminator
disseminate, getMIMEType, getParameterHelp
-
-
-
-
Field Detail
-
communityService
protected final CommunityService communityService
-
itemService
protected final ItemService itemService
-
-
Method Detail
-
disseminateAll
public 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 OutputStream. All other packages are exported to the same directory location.Package is any serialized representation of the item, at the discretion of the implementing class. It does not have to include content bitstreams.
Use theparamsparameter 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 package.- Specified by:
disseminateAllin interfacePackageDisseminator- 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 errorIOException- if IO errorSQLException- if database errorAuthorizeException- if authorization errorPackageException
-
addToPackageList
protected void addToPackageList(File f)
Add File to list of successfully disseminated package files- Parameters:
f- added File.
-
getPackageList
protected List<File> getPackageList()
Return List of all package Files which have been disseminated this instance of the Disseminator.This list can be useful in reporting back to the user what content has been disseminated as packages. It's used by disseminateAll() to report what packages were created.
- Returns:
- List of Files which correspond to the disseminated packages
-
-