Interface CitationDocumentService

All Known Implementing Classes:
CitationDocumentServiceImpl

public interface CitationDocumentService
The Citation Document produces a dissemination package (DIP) that is different that the archival package (AIP). In this case we append the descriptive metadata to the end (configurable) of the document. i.e. last page of PDF. So instead of getting the original PDF, you get a cPDF (with citation information added).
Author:
Peter Dietz (peter@longsight.com)
  • Method Details

    • isCitationEnabledForBitstream

      Boolean isCitationEnabledForBitstream(Bitstream bitstream, Context context) throws SQLException
      Repository policy can specify to have a custom citation cover/tail page to the document, which embeds metadata. We need to determine if we will intercept this bitstream download, and give out a citation dissemination rendition. What will trigger a redirect/intercept? Citation enabled globally (all citable bitstreams will get "watermarked") modules/disseminate-citation: enable_globally OR The container is this object is "allow list" enabled. - community: modules/disseminate-citation: enabled_communities - collection: modules/disseminate-citation: enabled_collections AND This User is not an admin. (Admins need to be able to view the "raw" original instead.) AND This object is citation-able (presently, just PDF) The module must be enabled, before the permission level checks happen.
      Parameters:
      bitstream - DSpace bitstream
      context - DSpace context
      Returns:
      true or false
      Throws:
      SQLException - if error
    • canGenerateCitationVersion

      boolean canGenerateCitationVersion(Context context, Bitstream bitstream) throws SQLException
      Parameters:
      context - DSpace Context
      bitstream - DSpace Bitstream
      Returns:
      true or false
      Throws:
      SQLException - if error
    • makeCitedDocument

      org.apache.commons.lang3.tuple.Pair<byte[],Long> makeCitedDocument(Context context, Bitstream bitstream) throws IOException, SQLException, AuthorizeException
      Creates a cited document from the given bitstream of the given item. This requires that bitstream is contained in item.

      The Process for adding a cover page is as follows:

      1. Load source file into PdfReader and create a Document to put our cover page into.
      2. Create cover page and add content to it.
      3. Concatenate the coverpage and the source document.
      Parameters:
      context - DSpace context
      bitstream - The source bitstream being cited. This must be a PDF.
      Returns:
      The temporary File that is the finished, cited document.
      Throws:
      IOException - if IO error
      SQLException - if database error
      AuthorizeException - if authorization error