|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.dspace.content.packager.IMSCPManifest
public abstract class IMSCPManifest
Models the IMSCP Manifest document. The expected lifecycle of this object: create a new instance for each manifest, call parse() to read it, and then make queries about its contents.
For more information about IMSCP, see IMS Global Learning Consortium, http://www.imsglobal.org/content/packaging/
Note that this is an abstract class. The IMSCP manifest is a pretty abstract concept; in use it will be tightly profiled so the interpretation belongs in a subclass customized for that profile.
| Field Summary | |
|---|---|
protected org.jdom.Namespace |
imscp_ns
IMSCP namespace of root, which can vary. |
protected org.jdom.Element |
manifest
root element of parsed manifest. |
static String |
MANIFEST_FILE
Filename of manifest, relative to package toplevel. |
| Constructor Summary | |
|---|---|
IMSCPManifest()
|
|
| Method Summary | |
|---|---|
void |
checkManifest()
Sanity-check a newly-parsed manifest; separate operation so subclasses can override it. |
String |
getBase()
Return value of manifest's xml:base attribute, or "" if there is none so caller can use "+" to assemble pathnames. |
Set |
getContentFiles()
Get local (package) files referenced by manifest as containing content. |
abstract BitstreamFormat |
getManifestBitstreamFormat(Context context)
Return the special bitstream format used to identify this particular (sub)class of IMSCP manifest. |
org.jdom.Element |
getMetadata()
Get the "metadata" element of the manifest, throw exception if it is not available. |
Set |
getMetadataFiles()
Get local (package) files referenced by manifest as containing metadata. |
void |
parse(InputStream docStream,
boolean validate)
Parse the manifest, store the results for later queries. |
| 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
protected org.jdom.Element manifest
protected org.jdom.Namespace imscp_ns
| Constructor Detail |
|---|
public IMSCPManifest()
| Method Detail |
|---|
public void parse(InputStream docStream,
boolean validate)
throws MetadataValidationException,
IOException
docStream - input stream with XML document on it.validate - true to do XML Schema validation.
MetadataValidationException
IOExceptionpublic String getBase()
public org.jdom.Element getMetadata()
throws MetadataValidationException
MetadataValidationException
public void checkManifest()
throws MetadataValidationException
MetadataValidationException
public Set getContentFiles()
throws PackageValidationException
Collect set of files named in "resources" element. They are either (a) resource@href or (b) resource/file@href NOTE: since paths are stored in a Set, it doesn't hurt to make duplicate entries, so just grab all possible paths.
If a subclass overrides this method it should call the "super" version to combine that list of files with the extra files defined by its profile.
PackageValidationException
public Set getMetadataFiles()
throws MetadataValidationException
MetadataValidationException
public abstract BitstreamFormat getManifestBitstreamFormat(Context context)
throws SQLException,
AuthorizeException,
IOException
SQLException
AuthorizeException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||