Package org.dspace.ctask.general
Class CitationPage
- java.lang.Object
-
- org.dspace.curate.AbstractCurationTask
-
- org.dspace.ctask.general.CitationPage
-
- All Implemented Interfaces:
CurationTask
@Distributive @Mutative public class CitationPage extends AbstractCurationTask
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
Fields Modifier and Type Field Description protected BitstreamServicebitstreamServiceprotected BundleServicebundleServiceprotected static StringDISPLAY_BUNDLE_NAMEThe name to give the bundle we add the cited pages to.protected static StringPRESERVATION_BUNDLE_NAMEThe name of the bundle to move source documents into after they have been cited.protected StringBuilderresBuilderA StringBuilder to handle result string building process.protected ResourcePolicyServiceresourcePolicyServiceprotected Stringresultprotected intstatus-
Fields inherited from class org.dspace.curate.AbstractCurationTask
communityService, configurationService, curator, handleService, itemService, taskId
-
-
Constructor Summary
Constructors Constructor Description CitationPage()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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 Detail
-
status
protected int status
-
result
protected String result
-
resBuilder
protected StringBuilder resBuilder
A StringBuilder to handle result string building process.
-
DISPLAY_BUNDLE_NAME
protected static final String DISPLAY_BUNDLE_NAME
The name to give the bundle we add the cited pages to.- See Also:
- Constant Field Values
-
PRESERVATION_BUNDLE_NAME
protected static final String PRESERVATION_BUNDLE_NAME
The name of the bundle to move source documents into after they have been cited.- See Also:
- Constant Field Values
-
bitstreamService
protected BitstreamService bitstreamService
-
bundleService
protected BundleService bundleService
-
resourcePolicyService
protected ResourcePolicyService resourcePolicyService
-
-
Method Detail
-
perform
public int perform(DSpaceObject dso) throws IOException
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
protected void performItem(Item item) throws SQLException
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:
AbstractCurationTask.performItem(Item)
-
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
-
-