Package org.dspace.content.packager
Class DSpaceMETSDisseminator
- java.lang.Object
-
- org.dspace.content.packager.AbstractPackageDisseminator
-
- org.dspace.content.packager.AbstractMETSDisseminator
-
- org.dspace.content.packager.DSpaceMETSDisseminator
-
- All Implemented Interfaces:
PackageDisseminator
public class DSpaceMETSDisseminator extends AbstractMETSDisseminator
Packager plugin to produce a METS (Metadata Encoding and Transmission Standard) package that is accepted as a DSpace METS SIP (Submission Information Package). See http://www.loc.gov/standards/mets/ for more information on METS.This class does not produce a true DSpace DIP, because there was no DIP standard when it was implemented. It does contain some features beyond the requirements of a SIP (e.g. deposit licenses), anticipating the DIP specification.
DSpaceMETSDisseminator was intended to be an useful example of a packager plugin, and a way to create packages acceptable to the METS SIP importer.
- Author:
- Larry Stone
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.dspace.content.packager.AbstractMETSDisseminator
AbstractMETSDisseminator.MdStreamCache
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringCREATIVE_COMMONS_RDF_MDTYPEprotected static StringCREATIVE_COMMONS_TEXT_MDTYPEprotected static StringDSPACE_DEPOSIT_LICENSE_MDTYPEprotected static StringPROFILE_LABELIdentifier for the package we produce, i.e.-
Fields inherited from class org.dspace.content.packager.AbstractMETSDisseminator
authorizeService, bitstreamService, configurationService, creativeCommonsService, DEFAULT_MODIFIED_DATE, idCounter, outputter, siteService, TEMPLATE_TYPE_SUFFIX
-
Fields inherited from class org.dspace.content.packager.AbstractPackageDisseminator
communityService, itemService
-
-
Constructor Summary
Constructors Constructor Description DSpaceMETSDisseminator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddStructMap(Context context, DSpaceObject dso, PackageParameters params, edu.harvard.hul.ois.mets.Mets mets)Add any additionalstructMapelements to the METS document, as required by this subclass.StringbundleToFileGrp(String bname)Returns name of METS fileGrp corresponding to a DSpace bundle name.String[]getDigiprovMdTypes(Context context, DSpaceObject dso, PackageParameters params)Get the type string of the "digiprov" (digital provenance) metadata to create for each object and each Bitstream in an Item.String[]getDmdTypes(Context context, DSpaceObject dso, PackageParameters params)Get DMD choice for Item.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.StringgetProfile()Return identifier string for the profile this produces.String[]getRightsMdTypes(Context context, DSpaceObject dso, PackageParameters params)Add rights MD (licenses) for DSpace item.String[]getSourceMdTypes(Context context, DSpaceObject dso, PackageParameters params)Get the type string of the source metadata to create for each object and each Bitstream in an Item.String[]getTechMdTypes(Context context, DSpaceObject dso, PackageParameters params)Get name of technical metadata crosswalk for Bitstreams.booleanincludeBundle(Bundle bundle)edu.harvard.hul.ois.mets.MetsHdrmakeMetsHdr(Context context, DSpaceObject dso, PackageParameters params)Create metsHdr element - separate so subclasses can override.-
Methods inherited from class org.dspace.content.packager.AbstractMETSDisseminator
addAmdSec, addBitstreamsToZip, addLogoBitstream, addToAmdSec, crosswalkToMetsElement, disseminate, findOriginalBitstream, gensym, getHandleURN, getMIMEType, getObjectTypeString, linkLicenseRefsToBitstreams, makeBitstreamURL, makeChildDiv, makeFileDiv, makeManifest, makeMdSec, makePersistentID, resetCounter, setMdType, setMdType, writeZipPackage
-
Methods inherited from class org.dspace.content.packager.AbstractPackageDisseminator
addToPackageList, disseminateAll, getPackageList
-
-
-
-
Field Detail
-
PROFILE_LABEL
protected static final String PROFILE_LABEL
Identifier for the package we produce, i.e. DSpace METS SIP Profile. Though not strictly true, there is no DIP standard yet so it's the most meaningful label we can apply.- See Also:
- Constant Field Values
-
DSPACE_DEPOSIT_LICENSE_MDTYPE
protected static final String DSPACE_DEPOSIT_LICENSE_MDTYPE
- See Also:
- Constant Field Values
-
CREATIVE_COMMONS_RDF_MDTYPE
protected static final String CREATIVE_COMMONS_RDF_MDTYPE
- See Also:
- Constant Field Values
-
CREATIVE_COMMONS_TEXT_MDTYPE
protected static final String CREATIVE_COMMONS_TEXT_MDTYPE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProfile
public String getProfile()
Return identifier string for the profile this produces.- Specified by:
getProfilein classAbstractMETSDisseminator- Returns:
- string name of profile.
-
bundleToFileGrp
public String bundleToFileGrp(String bname)
Returns name of METS fileGrp corresponding to a DSpace bundle name. They are mostly the same except for bundle "ORIGINAL" maps to "CONTENT". Don't worry about the metadata bundles since they are not packaged as fileGrps, but in *mdSecs.- Specified by:
bundleToFileGrpin classAbstractMETSDisseminator- 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)
Create metsHdr element - separate so subclasses can override.- Specified by:
makeMetsHdrin classAbstractMETSDisseminator- Parameters:
context- contextdso- DSpaceObjectparams- packaging params- Returns:
- mets header
-
getDmdTypes
public String[] getDmdTypes(Context context, DSpaceObject dso, PackageParameters params) throws SQLException, IOException, AuthorizeException
Get DMD choice for Item. It defaults to MODS, but is overridden by the package parameters if they contain any "dmd" keys. The params may contain one or more values for "dmd"; each of those is the name of a crosswalk plugin, optionally followed by colon and its METS MDTYPE name.- Specified by:
getDmdTypesin classAbstractMETSDisseminator- Parameters:
context- contextdso- DSpaceObjectparams- the PackageParameters passed to the disseminator.- Returns:
- array of DMD types
- Throws:
IOException- if IO errorSQLException- if database errorAuthorizeException- if authorization error
-
getTechMdTypes
public String[] getTechMdTypes(Context context, DSpaceObject dso, PackageParameters params) throws SQLException, IOException, AuthorizeException
Get name of technical metadata crosswalk for Bitstreams. Default is PREMIS. This is both the name of the crosswalk plugin and the METS MDTYPE.- Specified by:
getTechMdTypesin classAbstractMETSDisseminator- Parameters:
context- contextdso- DSpaceObjectparams- the PackageParameters passed to the disseminator.- Returns:
- array of TechMD types
- Throws:
IOException- if IO errorSQLException- if database errorAuthorizeException- if authorization error
-
getSourceMdTypes
public String[] getSourceMdTypes(Context context, DSpaceObject dso, PackageParameters params) throws SQLException, IOException, AuthorizeException
Description copied from class:AbstractMETSDisseminatorGet the type string of the source metadata to create for each object and each Bitstream in an Item. The type string may be a simple name or colon-separated compound as specified forgetDmdTypes()above.- Specified by:
getSourceMdTypesin classAbstractMETSDisseminator- Parameters:
context- contextdso- DSpaceObjectparams- the PackageParameters passed to the disseminator.- Returns:
- array of metadata type strings, never null.
- Throws:
SQLException- if database errorIOException- if IO errorAuthorizeException- if authorization error
-
getDigiprovMdTypes
public String[] getDigiprovMdTypes(Context context, DSpaceObject dso, PackageParameters params) throws SQLException, IOException, AuthorizeException
Description copied from class:AbstractMETSDisseminatorGet the type string of the "digiprov" (digital provenance) metadata to create for each object and each Bitstream in an Item. The type string may be a simple name or colon-separated compound as specified forgetDmdTypes()above.- Specified by:
getDigiprovMdTypesin classAbstractMETSDisseminator- Parameters:
context- contextdso- DSpaceObjectparams- the PackageParameters passed to the disseminator.- Returns:
- array of metadata type strings, never null.
- Throws:
SQLException- if database errorIOException- if IO errorAuthorizeException- if authorization error
-
getRightsMdTypes
public String[] getRightsMdTypes(Context context, DSpaceObject dso, PackageParameters params) throws SQLException, IOException, AuthorizeException
Add rights MD (licenses) for DSpace item. These may include a deposit license, and Creative Commons.- Specified by:
getRightsMdTypesin classAbstractMETSDisseminator- Parameters:
context- contextdso- DSpaceObjectparams- the PackageParameters passed to the disseminator.- Returns:
- array of RightsMD types
- Throws:
IOException- if IO errorSQLException- if database errorAuthorizeException- 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
Description copied from class:AbstractMETSDisseminatorAdd any additionalstructMapelements to the METS document, as required by this subclass. A simple default structure map which fulfills the minimal DSpace METS DIP/SIP requirements is already present, so this does not need to do anything.- Specified by:
addStructMapin classAbstractMETSDisseminator- Parameters:
context- contextdso- DSpaceObjectparams- the PackageParameters passed to the disseminator.mets- the METS document to which to add structMaps- Throws:
SQLException- if database errorIOException- if IO errorAuthorizeException- if authorization erroredu.harvard.hul.ois.mets.helper.MetsException- if METS error
-
includeBundle
public boolean includeBundle(Bundle bundle)
- Specified by:
includeBundlein classAbstractMETSDisseminator- Parameters:
bundle- bundle- Returns:
- true when this bundle should be included as "content" in the package.. e.g. DSpace SIP does not include metadata bundles.
-
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-oor--optionflags with the Packager script.- Specified by:
getParameterHelpin interfacePackageDisseminator- Overrides:
getParameterHelpin classAbstractMETSDisseminator- Returns:
- a string describing additional command-line options available with this packager
-
-