|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.content.packager.METSManifest
public class METSManifest
Manage the METS manifest document for METS importer classes,
such as the package importer org.dspace.content.packager.MetsSubmission
and the federated importer org.dspace.app.mets.FederatedMETSImport
It can parse the METS document, build an internal model, and give the importers access to that model. It also crosswalks all of the descriptive and administrative metadata in the METS manifest into the target DSpace Item, under control of the importer.
It reads the following DSpace Configuration entries:
mets.xsd.identifier = namespace xsd-URL
mets.xsd.dc = http://purl.org/dc/elements/1.1/ dc.xsd
MDTYPE (or OTHERMDTYPE)
By default, the crosswalk mechanism will look for a plugin with the
same name as the metadata type (e.g. "MODS",
"DC"). This example line invokes the QDC
plugin when MDTYPE="DC"
mets.submission.crosswalk.DC = QDC
mets.submission.crosswalk.mdType = pluginName
MetsSubmission,
FederatedMETSImport| Nested Class Summary | |
|---|---|
static interface |
METSManifest.Mdref
Callback interface to retrieve data streams in mdRef elements. |
| Field Summary | |
|---|---|
static String |
MANIFEST_FILE
Canonical filename of METS manifest within a package or as a bitstream. |
static org.jdom.Namespace |
metsNS
METS namespace -- includes "mets" prefix for use in XPaths |
| Method Summary | |
|---|---|
static METSManifest |
create(InputStream is,
boolean validate)
Create a new manifest object from a serialized METS XML document. |
void |
crosswalkBitstream(Context context,
Bitstream bitstream,
String fileId,
METSManifest.Mdref callback)
Crosswalk the metadata associated with a particular file
element into the bitstream it corresponds to. |
void |
crosswalkItem(Context context,
Item item,
org.jdom.Element dmd,
METSManifest.Mdref callback)
Invokes appropriate crosswalks on Item-wide descriptive metadata. |
static String |
getBundleName(org.jdom.Element file)
Get the DSpace bundle name corresponding to the USE attribute of the file group enclosing this file element. |
List |
getContentFiles()
Gets all file elements which make up
the item's content. |
static String |
getFileName(org.jdom.Element file)
Get the "local" file name of this file or mdRef element. |
String |
getHandle()
Find Handle (if any) identifier labelling this manifest. |
org.jdom.Element[] |
getItemDmds()
Gets all dmdSec elements containing metadata for the DSpace Item. |
org.jdom.Element[] |
getItemRightsMD()
Return rights metadata section(s) relevant to item as a whole. |
InputStream |
getMdContentAsStream(org.jdom.Element mdSec,
METSManifest.Mdref callback)
Return contents of *md element as stream. |
List |
getMdContentAsXml(org.jdom.Element mdSec,
METSManifest.Mdref callback)
Return contents of *md element as List of XML Element objects. |
String |
getMdContentMimeType(org.jdom.Element mdSec)
Returns MIME type of metadata content, if available. |
List |
getMdFiles()
Gets list of all mdRef elements in the METS
document. |
String |
getMdType(org.jdom.Element mdSec)
Get the metadata type from within a *mdSec element. |
org.jdom.Element |
getOriginalFile(org.jdom.Element file)
Get the "original" file element for a derived file. |
org.jdom.Element |
getPrimaryBitstream()
Returns file element corresponding to primary bitstream. |
String |
getProfile()
Gets name of the profile to which this METS document conforms. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String MANIFEST_FILE
public static org.jdom.Namespace metsNS
| Method Detail |
|---|
public static METSManifest create(InputStream is,
boolean validate)
throws IOException,
MetadataValidationException
is - input stream containing serialized XMLvalidate - if true, enable XML validation using schemas
in document. Also validates any sub-documents.
MetadataValidationException - if there is any error parsing
or validating the METS.
IOExceptionpublic String getProfile()
public List getContentFiles()
throws MetadataValidationException
file elements which make up
the item's content.
Elements.
MetadataValidationException
public List getMdFiles()
throws MetadataValidationException
mdRef elements in the METS
document. Used by ingester to e.g. check that all
required files are present.
Elements.
MetadataValidationExceptionpublic org.jdom.Element getOriginalFile(org.jdom.Element file)
NOTE: This pattern of relating derived files through the GROUPID attribute is peculiar to the DSpace METS SIP profile, and may not be generally useful with other sorts of METS documents.
file - METS file element of derived file
public static String getBundleName(org.jdom.Element file)
throws MetadataValidationException
USE attribute of the file group enclosing this file element.
MetadataValidationException - when there is no USE attribute on the enclosing fileGrp.
public static String getFileName(org.jdom.Element file)
throws MetadataValidationException
file or mdRef element.
By "local" we mean the reference to the actual resource containing
the data for this file, e.g. a relative path within a Zip or tar archive
if the METS is serving as a manifest for that sort of package.
file or mdRef element.
MetadataValidationException - when there is not enough information to find a resource identifier.
public org.jdom.Element getPrimaryBitstream()
throws MetadataValidationException
div under
first structMap has an fptr.
MetadataValidationException
public String getMdType(org.jdom.Element mdSec)
throws MetadataValidationException
MetadataValidationException
public String getMdContentMimeType(org.jdom.Element mdSec)
throws MetadataValidationException
MetadataValidationException
public List getMdContentAsXml(org.jdom.Element mdSec,
METSManifest.Mdref callback)
throws MetadataValidationException,
IOException,
SQLException,
AuthorizeException
MetadataValidationException - if METS is invalid, or there is an error parsing the XML.
IOException
SQLException
AuthorizeException
public InputStream getMdContentAsStream(org.jdom.Element mdSec,
METSManifest.Mdref callback)
throws MetadataValidationException,
IOException,
SQLException,
AuthorizeException
MetadataValidationException - if METS format does not contain any metadata.
IOException
SQLException
AuthorizeException
public org.jdom.Element[] getItemDmds()
throws MetadataValidationException
MetadataValidationException - if the METS is missing a reference to item-wide
DMDs in the correct place.
public org.jdom.Element[] getItemRightsMD()
throws MetadataValidationException
MetadataValidationException - if METS is invalid, e.g. referenced amdSec is missing.
public void crosswalkItem(Context context,
Item item,
org.jdom.Element dmd,
METSManifest.Mdref callback)
throws MetadataValidationException,
CrosswalkException,
IOException,
SQLException,
AuthorizeException
MetadataValidationException
CrosswalkException
IOException
SQLException
AuthorizeException
public void crosswalkBitstream(Context context,
Bitstream bitstream,
String fileId,
METSManifest.Mdref callback)
throws MetadataValidationException,
CrosswalkException,
IOException,
SQLException,
AuthorizeException
file
element into the bitstream it corresponds to.
context - a dspace context.bs - bitstream target of the crosswalkfileId - value of ID attribute in the file element responsible
for the contents of that bitstream.
MetadataValidationException
CrosswalkException
IOException
SQLException
AuthorizeException
public String getHandle()
throws MetadataValidationException
MetadataValidationException - if no handle available.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||