|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.dspace.core.SelfNamedPlugin
org.dspace.content.packager.PDFPackager
public class PDFPackager
Accept a PDF file by itself as a SIP.
This is mainly a proof-of-concept to demonstrate the flexibility of the packager and crosswalk plugins.
To import, open up the PDF and try to extract sufficient metadata from its InfoDict.
Export is a crude hack: if the item has a bitstream containing PDF, send that, otherwise it fails. Do not attempt to insert metadata.
| Constructor Summary | |
|---|---|
PDFPackager()
|
|
| Method Summary | |
|---|---|
void |
disseminate(Context context,
DSpaceObject dso,
PackageParameters params,
OutputStream out)
VERY crude dissemination: just look for the first bitstream with the PDF package type, and toss it out. |
String |
getMIMEType(PackageParameters params)
Identifies the MIME-type of this package, i.e. |
static String[] |
getPluginNames()
|
WorkspaceItem |
ingest(Context context,
Collection collection,
InputStream pkg,
PackageParameters params,
String license)
Create new Item out of the ingested package, in the indicated collection. |
Item |
replace(Context ctx,
Item item,
InputStream pckage,
PackageParameters params)
Replace is not implemented. |
| Methods inherited from class org.dspace.core.SelfNamedPlugin |
|---|
getPluginInstanceName, setPluginInstanceName |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PDFPackager()
| Method Detail |
|---|
public static String[] getPluginNames()
public WorkspaceItem ingest(Context context,
Collection collection,
InputStream pkg,
PackageParameters params,
String license)
throws PackageValidationException,
CrosswalkException,
AuthorizeException,
SQLException,
IOException
This is a VERY crude import of a single Adobe PDF (Portable Document Format) file, using the document's embedded metadata for package metadata. If the PDF file hasn't got the minimal metadata available, it is rejected.
ingest in interface PackageIngestercontext - DSpace context.collection - collection under which to create new item.pkg - input stream containing package to ingest.params - package parameters (none recognized)license - may be null, which takes default license.
PackageException - if package is unacceptable or there is
a fatal error turning it into an Item.
PackageValidationException - if package is unacceptable or there is
a fatal error turning it into an Item.
CrosswalkException
AuthorizeException
SQLException
IOException
public Item replace(Context ctx,
Item item,
InputStream pckage,
PackageParameters params)
throws PackageValidationException,
CrosswalkException,
AuthorizeException,
SQLException,
IOException,
UnsupportedOperationException
replace in interface PackageIngesterctx - DSpace context.item - existing item to be replacedpckage - input stream containing package to ingest.params - Properties-style list of options specific to this packager
PackageValidationException - if package is unacceptable or there is
a fatal error turning it into an Item.
UnsupportedOperationException - if this packager does not
implement replace.
CrosswalkException
AuthorizeException
SQLException
IOException
public void disseminate(Context context,
DSpaceObject dso,
PackageParameters params,
OutputStream out)
throws PackageValidationException,
CrosswalkException,
AuthorizeException,
SQLException,
IOException
disseminate in interface PackageDisseminatorcontext - DSpace context.dso - DSpace object (item, collection, etc)params - Properties-style list of options specific to this packagerout - output stream on which to write package
PackageValidationException - if package cannot be created or there is
a fatal error in creating it.
CrosswalkException
AuthorizeException
SQLException
IOExceptionpublic String getMIMEType(PackageParameters params)
getMIMEType in interface PackageDisseminator
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||