Package org.dspace.ctask.general
Class CitationPage
java.lang.Object
org.dspace.curate.AbstractCurationTask
org.dspace.ctask.general.CitationPage
- All Implemented Interfaces:
CurationTask
CitationPage
This task is used to generate a cover page with citation information for text
documents and then to add that cover page to a PDF version of the document
replacing the originally uploaded document form the user's perspective.
- Author:
- Ryan McGowan
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected BitstreamServiceprotected BundleServiceprotected static final StringThe name to give the bundle we add the cited pages to.protected static final StringThe name of the bundle to move source documents into after they have been cited.protected StringBuilderA StringBuilder to handle result string building process.protected ResourcePolicyServiceprotected Stringprotected intFields inherited from class org.dspace.curate.AbstractCurationTask
communityService, configurationService, curator, handleService, itemService, taskId -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddCitedPageToItem(InputStream citedDoc, Bundle bundle, Bundle pBundle, Bundle dBundle, Item item, Bitstream bitstream) A helper function forperformItem(Item).intperform(DSpaceObject dso) Perform the curation task upon passed DSOprotected voidperformItem(Item item) Performs task upon a single DSpace Item.Methods inherited from class org.dspace.curate.AbstractCurationTask
dereference, distribute, init, perform, performObject, report, setResult, taskArrayProperty, taskBooleanProperty, taskIntProperty, taskLongProperty, taskProperty
-
Field Details
-
status
protected int status -
result
-
resBuilder
A StringBuilder to handle result string building process. -
DISPLAY_BUNDLE_NAME
The name to give the bundle we add the cited pages to.- See Also:
-
PRESERVATION_BUNDLE_NAME
The name of the bundle to move source documents into after they have been cited.- See Also:
-
bitstreamService
-
bundleService
-
resourcePolicyService
-
-
Constructor Details
-
CitationPage
public CitationPage()
-
-
Method Details
-
perform
Perform the curation task upon passed DSO- Specified by:
performin interfaceCurationTask- Specified by:
performin classAbstractCurationTask- Parameters:
dso- the DSpace object- Returns:
- status code
- Throws:
IOException- if error- See Also:
-
CurationTask#perform(DSpaceObject)
-
performItem
Performs task upon a single DSpace Item. Used in conjunction with thedistributemethod to run a single task across multiple Items.You should override this method if you want to use
distributeto run your task across multiple DSpace Items.Either this method or
performObjectshould be overridden ifdistributemethod is used.- Overrides:
performItemin classAbstractCurationTask- Parameters:
item- the DSpace Item- Throws:
SQLException- if database error- See Also:
-
addCitedPageToItem
protected void addCitedPageToItem(InputStream citedDoc, Bundle bundle, Bundle pBundle, Bundle dBundle, Item item, Bitstream bitstream) throws SQLException, AuthorizeException, IOException A helper function forperformItem(Item). This function takes in the cited document as a File and adds it to DSpace properly.- Parameters:
citedDoc- The inputstream that is the cited document.bundle- The bundle the cited file is from.pBundle- The preservation bundle. The original document should be put in here if it is not already.dBundle- The display bundle. The cited document gets put in here.item- The item containing the bundles being used.bitstream- The original source bitstream.- Throws:
SQLException- if database errorAuthorizeException- if authorization errorIOException- if IO error
-