org.dspace.content.packager
Class AbstractIMSCPDisseminator

java.lang.Object
  extended by org.dspace.content.packager.AbstractIMSCPDisseminator
All Implemented Interfaces:
PackageDisseminator
Direct Known Subclasses:
OCWIMSCPDisseminator

public abstract class AbstractIMSCPDisseminator
extends Object
implements PackageDisseminator

Base class for package disseminator of the IMS Content Package spec, or IMSCP.

For more information about IMSCP, see IMS Global Learning Consortium, http://www.imsglobal.org/content/packaging/

This is a generic packager framework intended to be subclassed to create disseminators for more specific IMSCP "profiles". IMSCP is an abstract and flexible framework that can encompass many different kinds of metadata and inner package structures each with its own expectations and restrictions.

Version:
$Revision$
Author:
Larry Stone
See Also:
IMSCPManifest

Constructor Summary
AbstractIMSCPDisseminator()
           
 
Method Summary
 void disseminate(Context context, DSpaceObject dso, PackageParameters params, OutputStream pkg)
          Export the object (Item, Collection, or Community) to a package file on the indicated OutputStream.
abstract  Class getManifestClass()
          Get flavor of manifest used by this disseminator.
 String getMIMEType(PackageParameters params)
          Return the MIME type.
abstract  org.jdom.Document makeManifest(Context context, Item item, PackageParameters params)
          Create a manifest for this item as an XML document.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractIMSCPDisseminator

public AbstractIMSCPDisseminator()
Method Detail

disseminate

public void disseminate(Context context,
                        DSpaceObject dso,
                        PackageParameters params,
                        OutputStream pkg)
                 throws PackageException,
                        CrosswalkException,
                        AuthorizeException,
                        SQLException,
                        IOException
Export the object (Item, Collection, or Community) to a package file on the indicated OutputStream. Gets an exception of the object cannot be packaged or there is a failure creating the package.

Get the manifest by either: 1. Finding the manifest bitstream saved from the ingested package by the ingester that is a companion to the subclass doing the dissemination (preferred). 2. Synthesizing a manifest for this item. This may not be implemented in all subclasses, in which case the dissemination fails with an exception.

After that, all the content and metadata bitstreams are simply added to the Zip file.

Specified by:
disseminate in interface PackageDisseminator
Parameters:
context - - DSpace context.
dso - - DSpace object (item, collection, etc)
pkg - - output stream on which to write package
Throws:
PackageValidationException - if package cannot be created or there is a fatal error in creating it.
PackageException
CrosswalkException
AuthorizeException
SQLException
IOException

getMIMEType

public String getMIMEType(PackageParameters params)
Return the MIME type. If we implement the metadataOnly option, it'll be an XML document; otherwise IMSCP packages are Zip files.

Specified by:
getMIMEType in interface PackageDisseminator

makeManifest

public abstract org.jdom.Document makeManifest(Context context,
                                               Item item,
                                               PackageParameters params)
                                        throws PackageException
Create a manifest for this item as an XML document. Subclass can thrown an exception if it does not implement this method.

Throws:
PackageException

getManifestClass

public abstract Class getManifestClass()
Get flavor of manifest used by this disseminator.



Copyright © 2010 The DSpace Foundation. All Rights Reserved.