Class 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 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
    • Constructor Detail

      • CitationPage

        public CitationPage()
    • Method Detail

      • performItem

        protected void performItem​(Item item)
                            throws SQLException
        Performs task upon a single DSpace Item. Used in conjunction with the distribute method to run a single task across multiple Items.

        You should override this method if you want to use distribute to run your task across multiple DSpace Items.

        Either this method or performObject should be overridden if distribute method is used.

        Overrides:
        performItem in class AbstractCurationTask
        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 for performItem(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 error
        AuthorizeException - if authorization error
        IOException - if IO error