Package org.dspace.disseminate.service
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 Summary
Modifier and TypeMethodDescriptionbooleancanGenerateCitationVersion(Context context, Bitstream bitstream) isCitationEnabledForBitstream(Bitstream bitstream, Context context) Repository policy can specify to have a custom citation cover/tail page to the document, which embeds metadata.org.apache.commons.lang3.tuple.Pair<byte[],Long> makeCitedDocument(Context context, Bitstream bitstream) Creates a cited document from the given bitstream of the given item.
-
Method Details
-
isCitationEnabledForBitstream
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 bitstreamcontext- DSpace context- Returns:
- true or false
- Throws:
SQLException- if error
-
canGenerateCitationVersion
- Parameters:
context- DSpace Contextbitstream- 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:
- Load source file into PdfReader and create a Document to put our cover page into.
- Create cover page and add content to it.
- Concatenate the coverpage and the source document.
- Parameters:
context- DSpace contextbitstream- The source bitstream being cited. This must be a PDF.- Returns:
- The temporary File that is the finished, cited document.
- Throws:
IOException- if IO errorSQLException- if database errorAuthorizeException- if authorization error
-