public class InternalDSpaceAIPDisseminator
extends org.dspace.content.packager.AbstractMETSDisseminator
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
AbstractMETSDisseminator,
AbstractPackageDisseminator| Modifier and Type | Field and Description |
|---|---|
static String |
PARENT_DIV_TYPE
TYPE of the div containing AIP's parent handle in its mptr.
|
static String |
PROFILE_1_0
Unique identifier for the profile of the METS document.
|
| Constructor and Description |
|---|
InternalDSpaceAIPDisseminator() |
| Modifier and Type | Method and Description |
|---|---|
void |
addStructMap(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params,
edu.harvard.hul.ois.mets.Mets mets)
Adds another structMap element to contain the "parent link" that
is an essential part of every AIP.
|
String |
bundleToFileGrp(String bname)
Returns name of METS fileGrp corresponding to a DSpace bundle name.
|
void |
disseminate(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params,
File pkgFile) |
void |
disseminate(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params,
OutputStream outStream)
Export the object (Item, Collection, or Community) as a
"package" on the indicated OutputStream.
|
protected List<String> |
getBundleList()
Get our list of bundles to include/exclude in this AIP,
based on the passed in parameters
|
String[] |
getDigiprovMdTypes(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params)
Return the name of all crosswalks to run for the digiprovMD section of
the METS Manifest.
|
String[] |
getDmdTypes(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params)
Return the name of all crosswalks to run for the dmdSec section of
the METS Manifest.
|
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. |
String |
getProfile()
Return identifier string for the METS profile this produces.
|
String[] |
getRightsMdTypes(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params)
Return the name of all crosswalks to run for the rightsMD section of
the METS Manifest.
|
String[] |
getSourceMdTypes(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params)
Return the name of all crosswalks to run for the sourceMD section of
the METS Manifest.
|
String[] |
getTechMdTypes(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params)
Return the name of all crosswalks to run for the techMD section of
the METS Manifest.
|
boolean |
includeBundle(org.dspace.content.Bundle bundle)
By default, include all bundles in AIP as content.
|
String |
makeBitstreamURL(org.dspace.content.Bitstream bitstream,
org.dspace.content.packager.PackageParameters params)
Get the URL by which the METS manifest refers to a Bitstream
member of an Item the "package".
|
protected edu.harvard.hul.ois.mets.helper.MdSec |
makeMdSec(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
Class mdSecClass,
String typeSpec,
org.dspace.content.packager.PackageParameters params,
org.dspace.content.packager.AbstractMETSDisseminator.MdStreamCache extraStreams)
Create an element wrapped around a metadata reference (either mdWrap
or mdRef); i.e.
|
edu.harvard.hul.ois.mets.MetsHdr |
makeMetsHdr(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params)
Create the metsHdr element for the AIP METS Manifest.
|
addAmdSec, addBitstreamsToZip, addLogoBitstream, addToAmdSec, findOriginalBitstream, gensym, getHandleURN, getMIMEType, getObjectTypeString, linkLicenseRefsToBitstreams, makeChildDiv, makeFileDiv, makeManifest, makePersistentID, resetCounter, setMdType, setMdType, writeZipPackagepublic static final String PROFILE_1_0
public static final String PARENT_DIV_TYPE
public String makeBitstreamURL(org.dspace.content.Bitstream bitstream, org.dspace.content.packager.PackageParameters params)
For an internal AIP, this is a reference to a file in the asset store. An external AIP names a file in the package with a relative URL, that is, relative pathname.
makeBitstreamURL in class org.dspace.content.packager.AbstractMETSDisseminatorpublic void disseminate(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params,
OutputStream outStream)
throws org.dspace.content.packager.PackageValidationException,
org.dspace.content.crosswalk.CrosswalkException,
org.dspace.authorize.AuthorizeException,
SQLException,
IOException
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.
context - DSpace context.dso - DSpace object (item, collection, etc)params - Properties-style list of options specific to this packageroutStream - File where export package should be writtenPackageValidationException - if package cannot be created or there
is a fatal error in creating it.org.dspace.content.crosswalk.CrosswalkExceptionorg.dspace.authorize.AuthorizeExceptionSQLExceptionIOExceptionpublic void disseminate(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params,
File pkgFile)
throws org.dspace.content.packager.PackageValidationException,
org.dspace.content.crosswalk.CrosswalkException,
org.dspace.authorize.AuthorizeException,
SQLException,
IOException
disseminate in interface org.dspace.content.packager.PackageDisseminatordisseminate in class org.dspace.content.packager.AbstractMETSDisseminatororg.dspace.content.packager.PackageValidationExceptionorg.dspace.content.crosswalk.CrosswalkExceptionorg.dspace.authorize.AuthorizeExceptionSQLExceptionIOExceptionpublic String getProfile()
getProfile in class org.dspace.content.packager.AbstractMETSDisseminatorpublic String bundleToFileGrp(String bname)
bundleToFileGrp in class org.dspace.content.packager.AbstractMETSDisseminatorbname - name of DSpace bundle.public edu.harvard.hul.ois.mets.MetsHdr makeMetsHdr(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params)
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.
makeMetsHdr in class org.dspace.content.packager.AbstractMETSDisseminatorcontext - DSpace Contextdso - current DSpace Objectparams - Packager ParametersSQLExceptionIOExceptionorg.dspace.authorize.AuthorizeExceptionpublic String[] getDmdTypes(org.dspace.core.Context context, org.dspace.content.DSpaceObject dso, org.dspace.content.packager.PackageParameters params) throws SQLException, IOException, org.dspace.authorize.AuthorizeException
Default is DIM (DSpace Internal Metadata) and MODS.
getDmdTypes in class org.dspace.content.packager.AbstractMETSDisseminatorcontext - DSpace Contextdso - current DSpace Objectparams - Packager ParametersSQLExceptionIOExceptionorg.dspace.authorize.AuthorizeExceptionpublic String[] getTechMdTypes(org.dspace.core.Context context, org.dspace.content.DSpaceObject dso, org.dspace.content.packager.PackageParameters params) throws SQLException, IOException, org.dspace.authorize.AuthorizeException
Default is PREMIS.
getTechMdTypes in class org.dspace.content.packager.AbstractMETSDisseminatorcontext - DSpace Contextdso - current DSpace Objectparams - Packager ParametersSQLExceptionIOExceptionorg.dspace.authorize.AuthorizeExceptionpublic String[] getSourceMdTypes(org.dspace.core.Context context, org.dspace.content.DSpaceObject dso, org.dspace.content.packager.PackageParameters params) throws SQLException, IOException, org.dspace.authorize.AuthorizeException
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.
getSourceMdTypes in class org.dspace.content.packager.AbstractMETSDisseminatorcontext - DSpace Contextdso - current DSpace Objectparams - Packager ParametersSQLExceptionIOExceptionorg.dspace.authorize.AuthorizeExceptionpublic String[] getDigiprovMdTypes(org.dspace.core.Context context, org.dspace.content.DSpaceObject dso, org.dspace.content.packager.PackageParameters params) throws SQLException, IOException, org.dspace.authorize.AuthorizeException
By default, none are returned
getDigiprovMdTypes in class org.dspace.content.packager.AbstractMETSDisseminatorcontext - DSpace Contextdso - current DSpace Objectparams - Packager ParametersSQLExceptionIOExceptionorg.dspace.authorize.AuthorizeExceptionpublic String[] getRightsMdTypes(org.dspace.core.Context context, org.dspace.content.DSpaceObject dso, org.dspace.content.packager.PackageParameters params) throws SQLException, IOException, org.dspace.authorize.AuthorizeException
By default, Deposit Licenses and CC Licenses will be added for Items. Also, by default METSRights info will be added for all objects.
getRightsMdTypes in class org.dspace.content.packager.AbstractMETSDisseminatorcontext - DSpace Contextdso - current DSpace Objectparams - Packager ParametersSQLExceptionIOExceptionorg.dspace.authorize.AuthorizeExceptionpublic void addStructMap(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
org.dspace.content.packager.PackageParameters params,
edu.harvard.hul.ois.mets.Mets mets)
throws SQLException,
IOException,
org.dspace.authorize.AuthorizeException,
edu.harvard.hul.ois.mets.helper.MetsException
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.
addStructMap in class org.dspace.content.packager.AbstractMETSDisseminatorcontext - DSpace contextdso - Current DSpace objectparams - Packager Parametersmets - METS manifestSQLExceptionIOExceptionorg.dspace.authorize.AuthorizeExceptionedu.harvard.hul.ois.mets.helper.MetsExceptionpublic boolean includeBundle(org.dspace.content.Bundle bundle)
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.
includeBundle in class org.dspace.content.packager.AbstractMETSDisseminatorbundle - Bundle to check forprotected List<String> getBundleList()
public String getParameterHelp()
-o or
--option flags with the Packager script.getParameterHelp in interface org.dspace.content.packager.PackageDisseminatorgetParameterHelp in class org.dspace.content.packager.AbstractMETSDisseminatorprotected edu.harvard.hul.ois.mets.helper.MdSec makeMdSec(org.dspace.core.Context context,
org.dspace.content.DSpaceObject dso,
Class mdSecClass,
String typeSpec,
org.dspace.content.packager.PackageParameters params,
org.dspace.content.packager.AbstractMETSDisseminator.MdStreamCache extraStreams)
throws SQLException,
org.dspace.content.packager.PackageValidationException,
org.dspace.content.crosswalk.CrosswalkException,
IOException,
org.dspace.authorize.AuthorizeException
makeMdSec in class org.dspace.content.packager.AbstractMETSDisseminatorcontext - DSpace Contextdso - DSpace Object we are generating METS manifest formdSecClass - class of mdSec (TechMD, RightsMD, DigiProvMD, etc)typeSpec - Type of metadata going into this mdSec (e.g. MODS, DC, PREMIS, etc)params - the PackageParametersextraStreams - list of extra files which need to be added to final dissemination packageSQLExceptionPackageValidationExceptionorg.dspace.content.crosswalk.CrosswalkExceptionIOExceptionorg.dspace.authorize.AuthorizeExceptionCopyright © 2016 DuraSpace. All rights reserved.