Class DSpaceAIPDisseminator

All Implemented Interfaces:
PackageDisseminator

public class DSpaceAIPDisseminator extends AbstractMETSDisseminator
Subclass of the METS packager framework to disseminate a DSpace Archival Information Package (AIP). The AIP is intended to be, foremost, a _complete_ and _accurate_ representation of one object in the DSpace object model. An AIP contains all of the information needed to restore the object precisely in another DSpace archive instance.

Configuration keys:

The following take as values a space-and-or-comma-separated list of plugin names that name *either* a DisseminationCrosswalk or StreamDisseminationCrosswalk plugin. Shown are the default values. The value may be a simple crosswalk name, or a METS MDsec-name followed by a colon and the crosswalk name e.g. "DSpaceDepositLicense:DSPACE_DEPLICENSE" # MD types to put in the sourceMD section of the object. aip.disseminate.sourceMD = AIP-TECHMD # MD types to put in the techMD section of the object (and member Bitstreams if an Item) aip.disseminate.techMD = PREMIS # MD types to put in digiprovMD section of the object. #aip.disseminate.digiprovMD = # MD types to put in the rightsMD section of the object. aip.disseminate.rightsMD = DSpaceDepositLicense:DSPACE_DEPLICENSE, \ CreativeCommonsRDF:DSPACE_CCRDF, CreativeCommonsText:DSPACE_CCTXT, METSRights # MD types to put in dmdSec's corresponding the object. aip.disseminate.dmd = MODS, DIM

Version:
$Revision: 1.1 $
Author:
Larry Stone, Tim Donohue
See Also:
  • Field Details

    • PROFILE_1_0

      public static final String PROFILE_1_0
      Unique identifier for the profile of the METS document. To ensure uniqueness, it is the URL that the XML schema document would have _if_ there were to be one. There is no schema at this time.
      See Also:
    • PARENT_DIV_TYPE

      public static final String PARENT_DIV_TYPE
      TYPE of the div containing AIP's parent handle in its mptr.
      See Also:
    • DSPACE_DEPOSIT_LICENSE_MDTYPE

      protected static final String DSPACE_DEPOSIT_LICENSE_MDTYPE
      See Also:
    • CREATIVE_COMMONS_RDF_MDTYPE

      protected static final String CREATIVE_COMMONS_RDF_MDTYPE
      See Also:
    • CREATIVE_COMMONS_TEXT_MDTYPE

      protected static final String CREATIVE_COMMONS_TEXT_MDTYPE
      See Also:
    • disseminateParams

      protected PackageParameters disseminateParams
    • filterBundles

      protected List<String> filterBundles
    • excludeBundles

      protected boolean excludeBundles
    • configurationService

      protected ConfigurationService configurationService
  • Constructor Details

    • DSpaceAIPDisseminator

      public DSpaceAIPDisseminator()
  • Method Details

    • disseminate

      Description copied from class: AbstractMETSDisseminator
      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 params parameter 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.

      Specified by:
      disseminate in interface PackageDisseminator
      Overrides:
      disseminate in class AbstractMETSDisseminator
      Parameters:
      context - DSpace context.
      dso - DSpace object (item, collection, etc)
      params - Properties-style list of options specific to this packager
      pkgFile - 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 error
      AuthorizeException - if authorization error
      SQLException - if database error
      IOException - if IO error
    • getProfile

      public String getProfile()
      Return identifier string for the METS profile this produces.
      Specified by:
      getProfile in class AbstractMETSDisseminator
      Returns:
      string name of profile.
    • bundleToFileGrp

      public String bundleToFileGrp(String bname)
      Returns name of METS fileGrp corresponding to a DSpace bundle name. For AIP the mapping is direct.
      Specified by:
      bundleToFileGrp in class AbstractMETSDisseminator
      Parameters:
      bname - name of DSpace bundle.
      Returns:
      string name of fileGrp
    • makeMetsHdr

      public edu.harvard.hul.ois.mets.MetsHdr makeMetsHdr(Context context, DSpaceObject dso, PackageParameters params) throws SQLException
      Create the metsHdr element for the AIP METS Manifest.

      CREATEDATE is time at which the package (i.e. this manifest) was created. LASTMODDATE is last-modified time of the target object, if available. Agent describes the archive this belongs to.

      Specified by:
      makeMetsHdr in class AbstractMETSDisseminator
      Parameters:
      context - DSpace Context
      dso - current DSpace Object
      params - Packager Parameters
      Returns:
      List of crosswalk names to run
      Throws:
      SQLException - if error
    • getDmdTypes

      public String[] getDmdTypes(Context context, DSpaceObject dso, PackageParameters params) throws SQLException, IOException, AuthorizeException
      Return the name of all crosswalks to run for the dmdSec section of the METS Manifest.

      Default is DIM (DSpace Internal Metadata) and MODS.

      Specified by:
      getDmdTypes in class AbstractMETSDisseminator
      Parameters:
      context - DSpace Context
      dso - current DSpace Object
      params - Packager Parameters
      Returns:
      List of crosswalk names to run
      Throws:
      SQLException - if database error
      IOException - if IO error
      AuthorizeException - if authorization error
    • getTechMdTypes

      public String[] getTechMdTypes(Context context, DSpaceObject dso, PackageParameters params) throws SQLException, IOException, AuthorizeException
      Return the name of all crosswalks to run for the techMD section of the METS Manifest.

      Default is PREMIS.

      Specified by:
      getTechMdTypes in class AbstractMETSDisseminator
      Parameters:
      context - DSpace Context
      dso - current DSpace Object
      params - Packager Parameters
      Returns:
      List of crosswalk names to run
      Throws:
      SQLException - if database error
      IOException - if IO error
      AuthorizeException - if authorization error
    • getSourceMdTypes

      public String[] getSourceMdTypes(Context context, DSpaceObject dso, PackageParameters params) throws SQLException, IOException, AuthorizeException
      Return the name of all crosswalks to run for the sourceMD section of the METS Manifest.

      Default is AIP-TECHMD.

      In an AIP, the sourceMD element MUST include the original persistent identifier (Handle) of the object, and the original persistent ID (Handle) of its parent in the archive, so that it can be restored.

      Specified by:
      getSourceMdTypes in class AbstractMETSDisseminator
      Parameters:
      context - DSpace Context
      dso - current DSpace Object
      params - Packager Parameters
      Returns:
      List of crosswalk names to run
      Throws:
      SQLException - if database error
      IOException - if IO error
      AuthorizeException - if authorization error
    • getDigiprovMdTypes

      public String[] getDigiprovMdTypes(Context context, DSpaceObject dso, PackageParameters params) throws SQLException, IOException, AuthorizeException
      Return the name of all crosswalks to run for the digiprovMD section of the METS Manifest.

      By default, none are returned

      Specified by:
      getDigiprovMdTypes in class AbstractMETSDisseminator
      Parameters:
      context - DSpace Context
      dso - current DSpace Object
      params - Packager Parameters
      Returns:
      List of crosswalk names to run
      Throws:
      SQLException - if database error
      IOException - if IO error
      AuthorizeException - if authorization error
    • getRightsMdTypes

      public String[] getRightsMdTypes(Context context, DSpaceObject dso, PackageParameters params) throws SQLException, IOException, AuthorizeException
      Return the name of all crosswalks to run for the rightsMD section of the METS Manifest.

      By default, Deposit Licenses and CC Licenses will be added for Items. Also, by default METSRights info will be added for all objects.

      Specified by:
      getRightsMdTypes in class AbstractMETSDisseminator
      Parameters:
      context - DSpace Context
      dso - current DSpace Object
      params - Packager Parameters
      Returns:
      List of crosswalk names to run
      Throws:
      SQLException - if database error
      IOException - if IO error
      AuthorizeException - if authorization error
    • addStructMap

      public void addStructMap(Context context, DSpaceObject dso, PackageParameters params, edu.harvard.hul.ois.mets.Mets mets) throws SQLException, IOException, AuthorizeException, edu.harvard.hul.ois.mets.helper.MetsException
      Adds another structMap element to contain the "parent link" that is an essential part of every AIP. This is a structmap of one div, which contains an mptr indicating the Handle of the parent of this object in the archive. The div has a unique TYPE attribute value, "AIP Parent Link", and the mptr has a LOCTYPE of "HANDLE" and an xlink:href containing the raw Handle value.

      Note that the parent Handle has to be stored here because the parent is needed to create a DSpace Object when restoring the AIP; it cannot be determined later once the ingester parses it out of the metadata when the crosswalks are run. So, since the crosswalks require an object to operate on, and creating the object requires a parent, we cannot depend on metadata processed by crosswalks (e.g. AIP techMd) for the parent, it has to be at a higher level in the AIP manifest. The structMap is an obvious and standards-compliant location for it.

      Specified by:
      addStructMap in class AbstractMETSDisseminator
      Parameters:
      context - DSpace context
      dso - Current DSpace object
      params - Packager Parameters
      mets - METS manifest
      Throws:
      SQLException - if database error
      IOException - if IO error
      AuthorizeException - if authorization error
      edu.harvard.hul.ois.mets.helper.MetsException - METS Java toolkit exception class.
    • includeBundle

      public boolean includeBundle(Bundle bundle)
      By default, include all bundles in AIP as content.

      However, if the user specified a comma separated list of bundle names via the "filterBundles" (or "includeBundles") option, then check if this bundle is in that list. If it is, return true. If it is not, return false.

      Specified by:
      includeBundle in class AbstractMETSDisseminator
      Parameters:
      bundle - Bundle to check for
      Returns:
      true if bundle should be disseminated when disseminating Item AIPs
    • getBundleList

      protected List<String> getBundleList()
      Get our list of bundles to include/exclude in this AIP, based on the passed in parameters
      Returns:
      List of bundles to filter on
    • getParameterHelp

      public 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 -o or --option flags with the Packager script.
      Specified by:
      getParameterHelp in interface PackageDisseminator
      Overrides:
      getParameterHelp in class AbstractMETSDisseminator
      Returns:
      a string describing additional command-line options available with this packager