public class DocumentAnnotationRequest extends VaultRequest
HTTP_HEADER_AUTHORIZATION, HTTP_HEADER_VAULT_CLIENT_ID, vaultClient| Modifier and Type | Method and Description |
|---|---|
DocumentAnnotationResponse |
retrieveAnchorIds(int docId)
Retrieve Anchor IDs
|
VaultResponse |
retrieveDocumentAnnotations(int docId)
Retrieve Document Annotations
|
VaultResponse |
retrieveDocumentVersionAnnotations(int docId,
int majorVersion,
int minorVersion)
Retrieve Document Version Annotations
|
VaultResponse |
retrieveDocumentVersionNotesAsCSV(int docId,
int majorVersion,
int minorVersion)
Retrieve Document Version Notes as CSV
Retrieve notes in CSV format for any document that has a viewable rendition and at least one annotation. |
VaultResponse |
retrieveVideoAnnotations(int docId,
int majorVersion,
int minorVersion)
Retrieve Video Annotations
Retrieve annotations on a video document. |
DocumentAnnotationRequest |
setBinaryFile(String filename,
byte[] binaryContent)
Specify source data in an input file
|
DocumentAnnotationRequest |
setInputPath(String inputPath)
Specify source data in an input file
|
DocumentAnnotationRequest |
setOutputPath(String outputPath)
Specify source data in an output file
|
DocumentAnnotationResponse |
uploadDocumentAnnotations(int docId)
Upload Document Annotations
|
DocumentAnnotationResponse |
uploadDocumentVersionAnnotations(int docId,
int majorVersion,
int minorVersion)
Upload Document Version Annotations
Uploads the file and its annotations for the specified document version. |
getBaseObjectMapper, send, send, sendReturnBinary, sendReturnBinary, sendToFile, sendToFile, setVaultClientpublic VaultResponse retrieveDocumentAnnotations(int docId)
Retrieves the document rendition and its associated annotations.
docId - The document id field value.
GET /api/{version}/objects/documents/{doc_id}/annotations
Example 1 - To File
VaultResponse response = vaultClient.newRequest(DocumentAnnotationRequest.class)
.setOutputPath(outputPath.toString())
.retrieveDocumentAnnotations(docId);,
Example 2 - Get the file and manually download (retrieve the file as bytes in the response)
VaultResponse response = vaultClient.newRequest(DocumentAnnotationRequest.class)
.setOutputPath(outputPath.toString())
.retrieveDocumentAnnotations(docId);
if (response.getResponseStatus().equals(VaultResponse.HTTP_RESPONSE_SUCCESS)) {
try (OutputStream os = new FileOutputStream(outputPath.toString())) {
os.write(response.getBinaryContent());
}
catch (IOException ignored) {}
}public VaultResponse retrieveDocumentVersionAnnotations(int docId, int majorVersion, int minorVersion)
Retrieves the specified version document rendition and its associated annotations.
docId - The Document IdmajorVersion - The document major_version_number__v field valueminorVersion - The document minor_version_number__v field value
GET /api/{version}/objects/documents/{doc_id}/versions/{major_version}/{minor_version}/annotations
VaultResponse response = vaultClient.newRequest(DocumentAnnotationRequest.class)
.setOutputPath(outputPath.toString())
.retrieveDocumentVersionAnnotations(docId, majorVersion, minorVersion);
if (response.getResponseStatus().equals(VaultResponse.HTTP_RESPONSE_SUCCESS)) {
try (OutputStream os = new FileOutputStream(outputPath.toString())) {
os.write(response.getBinaryContent());
}
catch (IOException ignored) {}
}
System.out.println("File was saved to: " + outputPath.toString());
public DocumentAnnotationResponse retrieveAnchorIds(int docId)
Retrieve all anchor IDs from a document.
docId - The document id field value.
GET /api/{version}/objects/documents/{doc_id}/anchors
DocumentAnnotationResponse response = vaultClient.newRequest(DocumentAnnotationRequest.class)
.retrieveAnchorIds(docId);
System.out.println(response.getResponse());
if (response.isSuccessful()) {
for (DocumentAnnotationResponse.AnchorData data : response.wgetAnchorDataList()) {
System.out.println("\n**** Data Item **** ");
System.out.println("anchorId = " + data.getAnchorId());
System.out.println("noteId = " + data.getNoteId());
System.out.println("anchorName = " + data.getAnchorName());
System.out.println("noteAuthor = " + data.getNoteAuthor());
System.out.println("noteTimestamp = " + data.getNoteTimestamp());
System.out.println("pageNumber = " + data.getPageNumber());
}
}public VaultResponse retrieveDocumentVersionNotesAsCSV(int docId, int majorVersion, int minorVersion)
docId - The Document IdmajorVersion - The document major_version_number__v field valueminorVersion - The document minor_version_number__v field value
GET /api/{version}/objects/documents/{doc_id}/versions/{major_version}/{minor_version}/doc-export-annotations-to-csv
Example 1 - To File
VaultResponse response = vaultClient.newRequest(DocumentAnnotationRequest.class)
.setOutputPath(outputPath.toString())
.retrieveDocumentVersionNotesAsCSV(docId, majorVersion, minorVersion);,
Example 2 - Get the file and manually download (retrieve the file as bytes in the response)
VaultResponse response = vaultClient.newRequest(DocumentAnnotationRequest.class)
.setOutputPath(null)
.retrieveDocumentVersionNotesAsCSV(docId, majorVersion, minorVersion);
if (response.getResponseStatus().equals(VaultResponse.HTTP_RESPONSE_SUCCESS)) {
try (OutputStream os = new FileOutputStream(outputPath.toString())) {
os.write(response.getBinaryContent());
}
catch (IOException ignored) {}
}
System.out.println("File was saved to: " + response.getOutputFilePath());public VaultResponse retrieveVideoAnnotations(int docId, int majorVersion, int minorVersion)
docId - The Document IdmajorVersion - The document major_version_number__v field valueminorVersion - The document minor_version_number__v field value
GET /api/{version}/objects/documents/{doc_id}/versions/{major_version}/{minor_version}/export-video-annotations
VaultResponse response = vaultClient.newRequest(DocumentAnnotationRequest.class)
.setOutputPath(outputPath.toString())
.retrieveVideoAnnotations(docId, majorVersion, minorVersion);public DocumentAnnotationResponse uploadDocumentAnnotations(int docId)
Uploads the file and its annotations.
docId - The document id field value.
POST /api/{version}/objects/documents/{doc_id}/annotations
DocumentAnnotationResponse response = vaultClient.newRequest(DocumentAnnotationRequest.class)
.setInputPath(inputPath.toString())
.uploadDocumentAnnotations(docId);public DocumentAnnotationResponse uploadDocumentVersionAnnotations(int docId, int majorVersion, int minorVersion)
docId - The Document IdmajorVersion - The document major_version_number__v field valueminorVersion - The document minor_version_number__v field value
POST /api/{version}/objects/documents/{doc_id}/versions/{major_version}/{minor_version}/annotations
DocumentAnnotationResponse response = vaultClient.newRequest(DocumentAnnotationRequest.class)
.setInputPath(inputPath.toString())
.uploadDocumentVersionAnnotations(docId, majorVersion, minorVersion);public DocumentAnnotationRequest setBinaryFile(String filename, byte[] binaryContent)
filename - file name (no path)binaryContent - byte array of the file contentpublic DocumentAnnotationRequest setInputPath(String inputPath)
inputPath - Absolute path to the file for the requestpublic DocumentAnnotationRequest setOutputPath(String outputPath)
outputPath - Absolute path to the file for the responseCopyright © 2021. All rights reserved.