public abstract class AbstractXFDFAnnotationImpl extends java.lang.Object implements IAnnotation
Modifier and Type | Class and Description |
---|---|
static class |
AbstractXFDFAnnotationImpl.supportedAnnotationNameParams |
Modifier and Type | Field and Description |
---|---|
int |
ASPOSE_ROTATION_0 |
int |
ASPOSE_ROTATION_180 |
int |
ASPOSE_ROTATION_270 |
int |
ASPOSE_ROTATION_90 |
java.lang.String |
ENCODING_PREFIX |
int |
SIGNATURE_HEIGHT_OFFSET |
java.lang.String |
TEXT_LINK_KEY |
static java.util.List<java.lang.String> |
TILED_COMPATIBLE_EXTENSIONS
A static list of extensions that are compatible with the tiled mode of the slide viewer.
|
java.lang.String |
WORD_MAP_KEY |
PDF_MIMETYPE
Modifier | Constructor and Description |
---|---|
protected |
AbstractXFDFAnnotationImpl() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
buildWordMapAndTextLinks(org.apache.pdfbox.pdmodel.PDDocument document,
int startPage,
int numPages,
java.util.List<java.util.Map<java.lang.String,java.util.List<TSGIndexEntry>>> wordMaps,
java.util.List<java.util.List<TSGInternalLink>> textLinks,
java.util.List<org.apache.pdfbox.pdmodel.PDPage> allPages)
Method to generate word maps and text links for the numPages pages in the given pdf starting at startPage.
|
java.util.Map<java.lang.String,java.lang.Object> |
checkinAnnotations(java.lang.String ticket,
java.lang.String userDisplayName,
java.lang.String objectId,
byte[] content,
long lastModified)
Checks in and saves the non-readonly annotations from an offline PDF under the given logged in user
|
VideoScreenshot |
createVideoScreenshot(java.lang.String ticket,
java.lang.String videoObjectId,
int screenshotTimeMillis)
Creates a screenshot from a video given a time
Note that taking screenshots past 25 days is not supported
|
void |
deleteAnnotations(java.lang.String ticket,
java.lang.String objectId,
java.lang.String creatorDisplayName,
java.lang.String differentUser)
Deletes the annotation object related to the provided objectId for the provided user.
|
void |
getAnnotatedPDF(java.lang.String ticket,
java.lang.String objectId,
java.util.List<java.lang.String> annotators,
java.lang.String username,
boolean forOfflineAnnotation,
boolean forPrint,
long lastModified,
boolean isCollection,
java.io.OutputStream annotatedPdfOutputStream)
Streams a PDF object with all annotations embedded inside to the given output stream.
|
java.util.List<Annotation> |
getAnnotations(java.lang.String ticket,
java.lang.String objectId,
java.util.List<java.lang.String> annotators,
long lastModified,
boolean excludeEmbeddedAnnotations)
Pulls all of the annotations for the given id, does not modify the annotation contents in any way.
|
java.util.Map<java.lang.String,java.lang.Object> |
getAnnotations(java.lang.String ticket,
java.lang.String objectId,
long lastModified,
boolean excludeEmbeddedAnnotations)
Pulls all of the annotations for the given id, does not modify the annotation contents in any way.
|
abstract byte[] |
getAttachedDocContent(java.lang.String ticket,
java.lang.String objectId,
long lastModified,
java.lang.String attachedDocName)
Returns content of an attached document for an object.
|
protected abstract java.util.List<PDFAttachedDoc> |
getAttachedDocs(org.apache.pdfbox.pdmodel.PDDocument document) |
java.util.List<PDFAttachedDoc> |
getAttachedDocs(java.lang.String ticket,
java.lang.String objectId,
long lastModified)
Retrieves a list of all attached documents contained in an object having a pdf rendition.
|
java.util.List<PDFBookmark> |
getBookmarks(java.lang.String ticket,
java.lang.String objectId,
long lastModified)
Parses the bookmarks contained in an object having a pdf rendition.
|
DocumentInfo |
getDocumentInfo(java.lang.String ticket,
java.lang.String objectId,
long lastModified,
java.lang.String forceViewer,
java.lang.Integer numOfPageDimensionsToFetch,
java.lang.Integer docSizeLoadLimitBytes)
Populates the document information for the passed in document objectId.
|
java.util.Map<java.lang.String,java.lang.Object> |
getEmbeddedAnnotations(java.lang.String ticket,
java.lang.String objectId,
long lastModified,
boolean parseFileData)
Gets only the embedded annotations off of the document.
|
java.io.ByteArrayOutputStream |
getExcelAnnotationSummary(java.lang.String ticket,
java.lang.String objectId,
java.lang.String dateFormat,
Annotation[] annotations)
Returns a summary of the annotation on a given object in a printable (.xls) format.
|
java.lang.String |
getExternalAnnotationUrl(java.lang.String ticket,
java.lang.String legacyId)
A method for use with OA as a Service that will attempt to return an annotation URL based on a legacy ID.
|
byte[] |
getFileAttachmentAnnotationContent(java.lang.String ticket,
java.lang.String objectId,
long lastModified,
boolean isEmbedded,
java.lang.String annotationName)
Returns content of a file attachment annotation document for an object.
|
java.util.List<java.util.List<TSGInternalLink>> |
getInternalLinks(java.lang.String ticket,
java.lang.String objectId,
int startPage,
int numPages,
long lastModified)
Returns the internal links that are on a PDF document.
|
Page[] |
getPageDimensions(java.lang.String ticket,
Page[] pages,
boolean isCollection)
Determines the height and width of an array of Pages
|
Page |
getPageDimensions(java.lang.String ticket,
java.lang.String objectId,
Page page,
java.lang.String fileExtension,
long lastModified)
Determines the height and width of Page
|
protected abstract java.util.List<org.apache.pdfbox.pdmodel.PDPage> |
getPagesFromDocument(org.apache.pdfbox.pdmodel.PDDocument document)
Get a List of PDPages from the PDDocument object.
|
java.io.ByteArrayOutputStream |
getPDFAnnotationSummary(java.lang.String ticket,
java.lang.String objectId,
java.lang.String dateFormat,
java.util.List<Annotation> annotations)
Returns a summary of the annotation on a given object in a printable (.pdf) format.
|
java.util.Map<java.lang.String,java.lang.Object> |
getPdfMetadata(java.lang.String ticket,
java.lang.String objectId,
int startPage,
int numPages,
long lastModified)
Returns the internal links that are on a PDF document.
|
PostSectionedPage[] |
getProcessedPages(java.lang.String ticket,
java.lang.String objectId,
int startPage,
int numPages,
long lastModified)
Parses an object's PDF rendition and returns a page object that contains data representations of rectangles
surrounding sections, rows and words.
|
java.util.List<RedactionSuggestion> |
getRedactionSuggestions(java.lang.String ticket,
java.lang.String objectId,
long lastModified,
int numPages)
A method which calls a helper method to generate suggested redactions
|
Annotation |
getSingleAnnotation(java.lang.String ticket,
java.lang.String objectId,
long lastModified,
boolean isEmbedded,
java.lang.String annotationName)
Pulls the specific annotation from the annotations on the document based on the annotationName.
|
java.util.Map<java.lang.Integer,VideoScreenshot> |
getVideoScreenshots(java.lang.String ticket,
java.lang.String videoObjId)
Gets all video screenshots for a video
|
java.util.Map<java.lang.String,java.lang.Object> |
getWordMapsAndTextLinks(java.lang.String ticket,
java.lang.String objectId,
int startPage,
int numPages,
long lastModified)
Parses an object's PDF rendition and returns an array of indexes (word maps) that can be used to search on
the given range of pages.
|
java.util.List<Annotation> |
getXFDFAndFDFAnnotations(java.lang.String ticket,
java.lang.String objectId,
long lastModified,
boolean parseFileData)
Gets only the annotations from the xfdf and/or fdf
|
java.lang.String |
ingestDocForExternalReview(java.lang.String ticket,
java.lang.String legacyId,
java.lang.String type,
java.lang.String parentId,
java.util.Map<java.lang.String,java.lang.Object> properties,
org.springframework.web.multipart.MultipartFile mpFile)
A method for use with OA as a Service that will query the legacyId of a document to see if it already exists in the repository, and return the docId for the match.
|
boolean |
isAnnotated(java.lang.String ticket,
java.lang.String objectId)
Returns true if the document contains annotations, false otherwise.
|
void |
saveAnnotations(java.lang.String ticket,
java.lang.String objectId,
java.util.List<Annotation> annotations,
java.lang.String differentUser,
long lastModified)
Saves the provided annotations, processing them differenly dependent on whether or not the process must be runAsAdmin
|
void |
saveSignatures(java.lang.String ticket,
java.lang.String objectId,
Signature[] signatures)
Saves the provided signatures, permanently modifying the provided document.
|
public static final java.util.List<java.lang.String> TILED_COMPATIBLE_EXTENSIONS
public final java.lang.String ENCODING_PREFIX
public final int SIGNATURE_HEIGHT_OFFSET
public final java.lang.String WORD_MAP_KEY
public final java.lang.String TEXT_LINK_KEY
public final int ASPOSE_ROTATION_0
public final int ASPOSE_ROTATION_90
public final int ASPOSE_ROTATION_180
public final int ASPOSE_ROTATION_270
public void deleteAnnotations(java.lang.String ticket, java.lang.String objectId, java.lang.String creatorDisplayName, java.lang.String differentUser)
IAnnotation
deleteAnnotations
in interface IAnnotation
ticket
- a valid OC ticket.objectId
- the objectId of the document to delete the user's annotation object.creatorDisplayName
- the display name of the user to delete the annotation object.differentUser
- "true" if this action is being performed by a user other than the one specified by ownerNamepublic void saveSignatures(java.lang.String ticket, java.lang.String objectId, Signature[] signatures)
IAnnotation
saveSignatures
in interface IAnnotation
ticket
- A valid OC ticket.objectId
- The objectId of the document to save signatures for.signatures
- An array of signatures to save on the document.public void saveAnnotations(java.lang.String ticket, java.lang.String objectId, java.util.List<Annotation> annotations, java.lang.String differentUser, long lastModified)
IAnnotation
saveAnnotations
in interface IAnnotation
ticket
- a valid OC ticket.objectId
- the objectId of the document to save annotations for.annotations
- a list of annotations to save on the document.differentUser
- "true" if this action is being performed by a user other than the one who's associated with the annotation array.lastModified
- The timestamp this object was last modified (used for caching purposes).public VideoScreenshot createVideoScreenshot(java.lang.String ticket, java.lang.String videoObjectId, int screenshotTimeMillis)
IAnnotation
createVideoScreenshot
in interface IAnnotation
ticket
- a valid OC ticket.videoObjectId
- the objectId of the video.screenshotTimeMillis
- the start time of the video in millisecondspublic java.util.Map<java.lang.Integer,VideoScreenshot> getVideoScreenshots(java.lang.String ticket, java.lang.String videoObjId)
IAnnotation
getVideoScreenshots
in interface IAnnotation
ticket
- a valid OC ticket.videoObjId
- of the video.public boolean isAnnotated(java.lang.String ticket, java.lang.String objectId)
IAnnotation
isAnnotated
in interface IAnnotation
ticket
- a valid OC ticket.objectId
- the objectId of the document to check if it has annotations or not.public java.util.Map<java.lang.String,java.lang.Object> getAnnotations(java.lang.String ticket, java.lang.String objectId, long lastModified, boolean excludeEmbeddedAnnotations)
IAnnotation
getAnnotations
in interface IAnnotation
ticket
- a valid OC ticket.objectId
- the objectId of the document to get annotations for.lastModified
- the last modified timestamp of the document.excludeEmbeddedAnnotations
- a boolean to determine whether or not PDF content needs to be retrieved.public java.util.List<Annotation> getAnnotations(java.lang.String ticket, java.lang.String objectId, java.util.List<java.lang.String> annotators, long lastModified, boolean excludeEmbeddedAnnotations)
IAnnotation
getAnnotations
in interface IAnnotation
ticket
- a valid OC ticket.objectId
- the objectId of the document to get annotations for.annotators
- a list of the annotators that you want to get the annotations oflastModified
- the last modified timestamp of the document.excludeEmbeddedAnnotations
- a boolean to determine whether or not PDF content needs to be retrieved.public Annotation getSingleAnnotation(java.lang.String ticket, java.lang.String objectId, long lastModified, boolean isEmbedded, java.lang.String annotationName)
IAnnotation
getSingleAnnotation
in interface IAnnotation
ticket
- a valid OC ticket.objectId
- the objectId of the document to get annotations for.lastModified
- the last modified timestamp of the document.isEmbedded
- the attribute on the annotation that says if it embedded or notpublic java.util.Map<java.lang.String,java.lang.Object> getEmbeddedAnnotations(java.lang.String ticket, java.lang.String objectId, long lastModified, boolean parseFileData)
IAnnotation
getEmbeddedAnnotations
in interface IAnnotation
ticket
- a valid OC ticket.objectId
- the objectId of the document to get annotations for.lastModified
- the last modified timestamp of the document.parseFileData
- a boolean determining if file data should be parsed.public java.util.List<Annotation> getXFDFAndFDFAnnotations(java.lang.String ticket, java.lang.String objectId, long lastModified, boolean parseFileData)
IAnnotation
getXFDFAndFDFAnnotations
in interface IAnnotation
ticket
- a valid OC ticket.objectId
- the objectId of the document to get annotations for.lastModified
- the last modified timestamp of the document.parseFileData
- a boolean determining if file data should be parsed.public DocumentInfo getDocumentInfo(java.lang.String ticket, java.lang.String objectId, long lastModified, java.lang.String forceViewer, java.lang.Integer numOfPageDimensionsToFetch, java.lang.Integer docSizeLoadLimitBytes)
IAnnotation
getDocumentInfo
in interface IAnnotation
ticket
- a valid OC ticket.objectId
- the objectId of the document to fetch the info for.lastModified
- the last modified timestamp of the document.forceViewer
- which viewer the requested document must use, or blank if viewer is to be fetched normally.numOfPageDimensionsToFetch
- how many pages to get height and width values for in a collection. If not passed in then will get all page dimensionsdocSizeLoadLimitBytes
- if document size is larger than this number don't return document info. Saves excessive load times/calls.public void getAnnotatedPDF(java.lang.String ticket, java.lang.String objectId, java.util.List<java.lang.String> annotators, java.lang.String username, boolean forOfflineAnnotation, boolean forPrint, long lastModified, boolean isCollection, java.io.OutputStream annotatedPdfOutputStream)
IAnnotation
getAnnotatedPDF
in interface IAnnotation
ticket
- a valid OC ticket.objectId
- the objectId of the document to get the annotated PDF for.annotators
- a list of the annotators that you want to get the annotations ofusername
- the username of the user that is downloading the annotated PDF. This is used to color the annotations appropriately if
enhancedColorMode is not turned on.forOfflineAnnotation
- True will result in the annotations being read-only in the downloaded PDF, annotations will be burned-in normally otherwise.forPrint
- True if the document is meant to immediately print when displayed in a browser. False otherwise.lastModified
- the last modified timestamp of the document.isCollection
- whether or not we're fetching a concatenated pdf for a collection NOTE - Annotations are not supported for collectionsannotatedPdfOutputStream
- the OutputStream
to stream the PDF contents topublic java.util.Map<java.lang.String,java.lang.Object> checkinAnnotations(java.lang.String ticket, java.lang.String userDisplayName, java.lang.String objectId, byte[] content, long lastModified)
IAnnotation
checkinAnnotations
in interface IAnnotation
ticket
- a valid OC ticket.userDisplayName
- the current user's display nameobjectId
- the objectId of the document to get the annotated PDF for.content
- the byte[] containing the uploaded file's contentlastModified
- The timestamp this object was last modified (used for caching purposes).
NOTE: Remove userDisplayName param when the functionality is put in place that allows for the
userDisplayName to be retrieved from the passed in ticket@Cacheable(value="oc-page-section-word-data", key="{#objectId, #startPage, #numPages, #lastModified}") public PostSectionedPage[] getProcessedPages(java.lang.String ticket, java.lang.String objectId, int startPage, int numPages, long lastModified)
IAnnotation
getProcessedPages
in interface IAnnotation
ticket
- a valid OC ticketobjectId
- the id of the PDF object to create section, row and word boxes for.startPage
- the first page number to generate the section, row and word boxes for.numPages
- the number of pages to fetch in a batchlastModified
- the timestamp this object was last modified (used for caching key generator).@Cacheable(value="oa-search-word-maps", key="{#objectId, #startPage, #numPages, #lastModified}") public java.util.Map<java.lang.String,java.lang.Object> getWordMapsAndTextLinks(java.lang.String ticket, java.lang.String objectId, int startPage, int numPages, long lastModified)
IAnnotation
getWordMapsAndTextLinks
in interface IAnnotation
ticket
- A valid OC ticket.objectId
- The id of the PDF object to create word maps for.startPage
- The first page to create word maps for.numPages
- The number of pages to generate maps for.lastModified
- The timestamp this object was last modified (used for caching key generator).protected abstract java.util.List<org.apache.pdfbox.pdmodel.PDPage> getPagesFromDocument(org.apache.pdfbox.pdmodel.PDDocument document)
document
- a PDDocument representing the pdf documentprotected abstract void buildWordMapAndTextLinks(org.apache.pdfbox.pdmodel.PDDocument document, int startPage, int numPages, java.util.List<java.util.Map<java.lang.String,java.util.List<TSGIndexEntry>>> wordMaps, java.util.List<java.util.List<TSGInternalLink>> textLinks, java.util.List<org.apache.pdfbox.pdmodel.PDPage> allPages) throws java.io.IOException
document
- a PDDocument representing the pdf documentstartPage
- number of the first page to be generatednumPages
- total number of pages to be generatedwordMaps
- List of word maps for the pdf page rangetextLinks
- List of text links for the pdf page rangeallPages
- all the PDPage objects for the pdf page rangejava.io.IOException
public java.io.ByteArrayOutputStream getExcelAnnotationSummary(java.lang.String ticket, java.lang.String objectId, java.lang.String dateFormat, Annotation[] annotations)
IAnnotation
getExcelAnnotationSummary
in interface IAnnotation
ticket
- A valid OC ticket.objectId
- The id of the PDF object that we're getting a summary for.dateFormat
- A string representing how the dates in the summary should be formatted.annotations
- A list of annotation objects describing the annotations on our pdf.public java.io.ByteArrayOutputStream getPDFAnnotationSummary(java.lang.String ticket, java.lang.String objectId, java.lang.String dateFormat, java.util.List<Annotation> annotations)
IAnnotation
getPDFAnnotationSummary
in interface IAnnotation
ticket
- A valid OC ticket.objectId
- The id of the PDF object that we're getting a summary for.dateFormat
- A string representing how the dates in the summary should be formatted.annotations
- A list of annotation objects describing the annotations on our pdf.public java.util.List<PDFBookmark> getBookmarks(java.lang.String ticket, java.lang.String objectId, long lastModified)
IAnnotation
getBookmarks
in interface IAnnotation
ticket
- A valid OC ticket.objectId
- The id of the PDF object to get bookmarks for.lastModified
- The timestamp this object was last modified (used for caching purposes).public java.util.List<PDFAttachedDoc> getAttachedDocs(java.lang.String ticket, java.lang.String objectId, long lastModified)
IAnnotation
getAttachedDocs
in interface IAnnotation
ticket
- A valid OC ticket.objectId
- The id of the PDF object to get attached documents for.lastModified
- The timestamp this object was last modified (used for caching purposes).protected abstract java.util.List<PDFAttachedDoc> getAttachedDocs(org.apache.pdfbox.pdmodel.PDDocument document) throws java.io.IOException
java.io.IOException
public abstract byte[] getAttachedDocContent(java.lang.String ticket, java.lang.String objectId, long lastModified, java.lang.String attachedDocName)
IAnnotation
getAttachedDocContent
in interface IAnnotation
objectId
- The objectId of the PDF object to get attached document info for.lastModified
- The timestamp this object was last modified (used for caching purposes).attachedDocName
- The name of the attached document.public byte[] getFileAttachmentAnnotationContent(java.lang.String ticket, java.lang.String objectId, long lastModified, boolean isEmbedded, java.lang.String annotationName)
IAnnotation
getFileAttachmentAnnotationContent
in interface IAnnotation
ticket
- A valid OC ticket.objectId
- The objectId of the PDF object to get attached document info for.lastModified
- The timestamp this object was last modified (used for caching purposes).isEmbedded
- The attribute on the annotation that says if it embedded or notannotationName
- The name of the annotation that acts as a unique identifier.public java.util.List<java.util.List<TSGInternalLink>> getInternalLinks(java.lang.String ticket, java.lang.String objectId, int startPage, int numPages, long lastModified)
IAnnotation
getInternalLinks
in interface IAnnotation
ticket
- A valid OC ticket.objectId
- The id of the PDF object to retrieve the internal links for.startPage
- The first page to retrieve internal links for.numPages
- The number of pages to retrieve internal linsk for for.lastModified
- The timestamp this object was last modified (used for caching key generator).public java.util.Map<java.lang.String,java.lang.Object> getPdfMetadata(java.lang.String ticket, java.lang.String objectId, int startPage, int numPages, long lastModified)
IAnnotation
getPdfMetadata
in interface IAnnotation
ticket
- A valid OC ticket.objectId
- The id of the PDF object to retrieve the internal links for.startPage
- The first page to retrieve internal links for.numPages
- The number of pages to retrieve internal linsk for for.lastModified
- The timestamp this object was last modified (used for caching key generator).public Page getPageDimensions(java.lang.String ticket, java.lang.String objectId, Page page, java.lang.String fileExtension, long lastModified) throws java.lang.Exception
getPageDimensions
in interface IAnnotation
ticket
- a valid OC ticket.objectId
- the objectId of the document to get the information for.page
- The page object that should be completed. Other info might already be present.fileExtension
- The pages file extensionlastModified
- the last modified timestamp of the document we're getting the information for.java.lang.Exception
public Page[] getPageDimensions(java.lang.String ticket, Page[] pages, boolean isCollection) throws java.io.IOException
getPageDimensions
in interface IAnnotation
ticket
- a valid OC ticket.pages
- The array of pages to find dimensions forisCollection
- Indicates if the Page array is from a collection or a pdfjava.io.IOException
public java.util.List<RedactionSuggestion> getRedactionSuggestions(java.lang.String ticket, java.lang.String objectId, long lastModified, int numPages)
getRedactionSuggestions
in interface IAnnotation
ticket
- - ticket of the Open Annotate sessionobjectId
- - ID of the documentlastModified
- - time of the last modification of the objectpublic java.lang.String ingestDocForExternalReview(java.lang.String ticket, java.lang.String legacyId, java.lang.String type, java.lang.String parentId, java.util.Map<java.lang.String,java.lang.Object> properties, org.springframework.web.multipart.MultipartFile mpFile) throws java.io.IOException
IAnnotation
ingestDocForExternalReview
in interface IAnnotation
ticket
- - A valid OC ticket.legacyId
- - The legacy id of the object we want to upload to or access from the repository.type
- - The Document type to use for the newly created external review document.parentId
- - The objectId for the parent folder or object that the external review document will be placed in.properties
- - A map of additional properties to be placed on the newly uploaded external review document.mpFile
- - The a file object with content and file properties of the newly uploaded document.java.io.IOException
public java.lang.String getExternalAnnotationUrl(java.lang.String ticket, java.lang.String legacyId) throws OCRuntimeException
IAnnotation
getExternalAnnotationUrl
in interface IAnnotation
ticket
- A valid OC ticket.legacyId
- - The legacy id of the object we want to access from the repository.OCRuntimeException