public class ContentHandlerInput extends HashMap
All of VirtualViewer's content handler API's methods have an input parameter of ContentHandlerInput.
This class is designed to be a flexible class that allows multiple types of data to be provided to the content handler. Its public methods are identical to a java.util.HashMap. This allows future features to be added, and current code fixed, without changes to the existing content handler API.
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
static Object |
KEY_ANNOTATION_CONTENT
Key for the contents of an annotation file, used when saving a single annotation layer.
|
static Object |
KEY_ANNOTATION_ID
Key for an annotation layer key, used to identify a specific annotation layer on a document.
|
static Object |
KEY_ANNOTATION_LAYERS
Key for an array of annotation layer objects.
|
static Object |
KEY_ANNOTATION_PROPERTIES
Key for the map of annotation properties, which maps String keys to custom properties.
|
static Object |
KEY_BOOKMARK_CONTENT
Key for the contents of a bookmarks XML file, used when saving.
|
static Object |
KEY_CACHE_ACTION
Key for action to be confirmed by validateCache.
|
static Object |
KEY_CLIENT_INSTANCE_ID
Key for a custom, configurable, value used to pass data from client to content handler.
|
static Object |
KEY_CLIENT_PREFERENCES_XML
Deprecated.
No longer used.
|
static Object |
KEY_DOCUMENT_CONTENT
Key for the document file content.
|
static Object |
KEY_DOCUMENT_DISPLAY_NAME
Key for the user-friendly display name for a document.
|
static Object |
KEY_DOCUMENT_FILE
Deprecated.
no longer used.
|
static Object |
KEY_DOCUMENT_FORMAT
Key for a format code used to identify a file format like PDF or TIF by VirtualViewer and Rastermaster.
|
static Object |
KEY_DOCUMENT_ID
Key for a document key, used to identify a specific document.
|
static String |
KEY_EVENT
Key for the type of event in an event notification.
|
static String |
KEY_EVENT_EXPORT_FORMAT_NAME
Key for which format a document was exported as in an
export event . |
static String |
KEY_EVENT_PAGE_REQUESTED_NUMBER
Key for the zero-based page index of a specific page.
|
static String |
KEY_EVENT_PRINT_PAGE_NUMBERS
Key for which pages were printed in a
print event . |
static String |
KEY_EVENT_ROTATE_DEGREES
Key for the degrees pages were rotated by in a rotate action.
|
static String |
KEY_EVENT_ROTATE_PAGE
Key for a list of zero-based page indexes affected by a rotate action.
|
static String |
KEY_EVENT_SAVE_ANNOTATION_LAYER_NAME_BASE
Used for the
annotations saved event. |
static Object |
KEY_HTTP_SERVLET_REQUEST
Key for the request object, used to retrieve information about the request that spawned the current content
handler method.
|
static Object |
KEY_MERGE_ANNOTATIONS
Key for whether annotations were merged into the document being sent.
|
static Object |
KEY_NOTES_CONTENT
Key for the contents of a document notes XML file, used when saving.
|
static Object |
KEY_PAGE_COUNT
Key for the number of pages in the document.
|
static Object |
KEY_SPARSE_PAGE_COUNT
Key for the suggested number of pages to return for a sparse document.
|
static Object |
KEY_SPARSE_PAGE_INDEX
Key for the requested page index, used if the content handler's getDocumentContent supports sparse documents for
the requested document.
|
static Object |
KEY_STAMP_STATUS
Deprecated.
No longer used.
|
static Object |
KEY_WATERMARK_CONTENT
Key for the contents of a watermarks json file, used when saving.
|
static Object |
VALUE_CACHE_ACTION_GET
Value indicating retrieving from the cache.
|
static Object |
VALUE_CACHE_ACTION_PUT
Value indicating storing to the cache.
|
static String |
VALUE_EVENT_CLOSE_DOCUMENT
Deprecated.
Not used.
|
static String |
VALUE_EVENT_DOCUMENT_RETRIEVED_FROM_CACHE
Event fired when a document has been retrieved from the VirtualViewer cache.
|
static String |
VALUE_EVENT_EXPORT
Event fired when a document is exported.
|
static String |
VALUE_EVENT_PAGE_REQUESTED
Event fired when a user is viewing a specific page.
|
static String |
VALUE_EVENT_PRINT
Event fired when a document is printed.
|
static String |
VALUE_EVENT_ROTATE_PAGE
Event fired when a page is rotated on the client.
|
static String |
VALUE_EVENT_SAVE_ANNOTATION
Event fired when annotation data is saved.
|
static String |
VALUE_EVENT_SAVE_DOCUMENT
Deprecated.
Not used.
|
Constructor and Description |
---|
ContentHandlerInput()
Default constructor.
|
ContentHandlerInput(String documentId,
String clientInstanceId) |
ContentHandlerInput(String documentId,
String clientInstanceId,
Object request) |
Modifier and Type | Method and Description |
---|---|
byte[] |
getAnnotationContent()
Shortcut to get
KEY_ANNOTATION_CONTENT 's value. |
String |
getAnnotationId()
Shortcut to get
KEY_ANNOTATION_ID 's value. |
AnnotationLayer[] |
getAnnotationLayers()
Shortcut to get
KEY_ANNOTATION_LAYERS 's value. |
Hashtable |
getAnnotationProperties()
Shortcut to get
KEY_ANNOTATION_PROPERTIES 's value. |
byte[] |
getBookmarkContent()
Shortcut to get
KEY_BOOKMARK_CONTENT 's value. |
String |
getClientInstanceId()
Shortcut to get
KEY_CLIENT_INSTANCE_ID 's value. |
String |
getClientPreferencesXML()
Deprecated.
No longer used. See client-side config.js and User Preferences settings instead.
|
byte[] |
getDocumentContent()
Shortcut to get
KEY_DOCUMENT_CONTENT 's value. |
String |
getDocumentDisplayName()
Shortcut to get
KEY_DOCUMENT_DISPLAY_NAME 's value. |
File |
getDocumentFile()
Deprecated.
No longer used.
|
int |
getDocumentFormat()
Shortcut to get
KEY_DOCUMENT_FORMAT 's value. |
String |
getDocumentId()
Shortcut to get
KEY_DOCUMENT_ID 's value. |
int |
getDocumentPageCount()
Shortcut to get
KEY_PAGE_COUNT 's value. |
javax.servlet.http.HttpServletRequest |
getHttpServletRequest()
Shortcut to get
KEY_HTTP_SERVLET_REQUEST 's value. |
byte[] |
getNotesContent()
Shortcut to get
KEY_NOTES_CONTENT 's value. |
int |
getSparseRequestedPageCount()
Shortcut to get
KEY_SPARSE_PAGE_COUNT 's value. |
Integer |
getSparseRequestedPageIndex()
Shortcut to get
KEY_SPARSE_PAGE_INDEX 's value. |
int |
getSparseRequestedPageNumber()
Deprecated.
getSparseRequestedPageIndex() should be used instead. This method returns a non-nullable int
value, but that is misleading as the null value is important and means all pages should be returned. |
String |
getStampStatus()
Deprecated.
No longer used.
|
byte[] |
getWatermarkContent()
Shortcut to get
KEY_WATERMARK_CONTENT 's value. |
boolean |
mergeAnnotations()
Shortcut to get
KEY_MERGE_ANNOTATIONS 's value. |
void |
setAnnotationContent(byte[] annContent)
Shortcut to set
KEY_ANNOTATION_CONTENT 's value. |
void |
setAnnotationId(String annotationId)
Shortcut to set
KEY_ANNOTATION_ID 's value. |
void |
setAnnotationLayers(AnnotationLayer[] layers)
Shortcut to set
KEY_ANNOTATION_LAYERS 's value. |
void |
setAnnotationProperties(Hashtable props)
Shortcut to set
KEY_ANNOTATION_PROPERTIES 's value. |
void |
setBookmarkContent(byte[] bookmarkContent)
Shortcut to set
KEY_BOOKMARK_CONTENT 's value. |
void |
setClientInstanceId(String clientInstanceId)
Shortcut to set
KEY_CLIENT_INSTANCE_ID 's value. |
void |
setClientPreferencesXML(String xml)
Deprecated.
No longer used. See client-side config.js and User Preferences settings instead.
|
void |
setDocumentContent(byte[] content)
Shortcut to set
KEY_DOCUMENT_CONTENT 's value. |
void |
setDocumentDisplayName(String displayName)
Shortcut to set
KEY_DOCUMENT_DISPLAY_NAME 's value. |
void |
setDocumentFile(File contentFile)
Deprecated.
No longer used.
|
void |
setDocumentFormat(int format)
Shortcut to set
KEY_DOCUMENT_FORMAT 's value. |
void |
setDocumentId(String documentId)
Shortcut to set
KEY_DOCUMENT_ID 's value. |
void |
setDocumentPageCount(int pageCount)
Shortcut to set
KEY_PAGE_COUNT 's value. |
void |
setHttpServletRequest(Object httpServletRequest)
Shortcut to set
KEY_HTTP_SERVLET_REQUEST 's value. |
void |
setMergeAnnotations(boolean mergeAnnotations)
Shortcut to set
KEY_MERGE_ANNOTATIONS 's value. |
void |
setNotesContent(byte[] notesContent)
Shortcut to set
KEY_NOTES_CONTENT 's value. |
void |
setSparseRequestedPageCount(int pageCount)
Shortcut to set
KEY_SPARSE_PAGE_COUNT 's value. |
void |
setSparseRequestedPageIndex(Integer index)
Shortcut to set
KEY_SPARSE_PAGE_INDEX 's value. |
void |
setSparseRequestedPageNumber(int pageNumber)
Deprecated.
setSparseRequestedPageIndex(java.lang.Integer) should be used instead. |
void |
setStampStatus(String stampStatus)
Deprecated.
No longer used.
|
void |
setWatermarkContent(byte[] watermarkContent)
Shortcut to set
KEY_WATERMARK_CONTENT 's value. |
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, get, getOrDefault, isEmpty, keySet, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, values
equals, hashCode, toString
public static final Object KEY_CACHE_ACTION
VALUE_CACHE_ACTION_GET
or
VALUE_CACHE_ACTION_PUT
.public static final Object VALUE_CACHE_ACTION_GET
public static final Object VALUE_CACHE_ACTION_PUT
public static final Object KEY_CLIENT_INSTANCE_ID
getClientInstanceId()
instead of this key.@Deprecated public static final Object KEY_CLIENT_PREFERENCES_XML
public static final Object KEY_DOCUMENT_ID
getDocumentId()
instead of this key.public static final Object KEY_DOCUMENT_DISPLAY_NAME
getDocumentDisplayName()
instead of this key.public static final Object KEY_ANNOTATION_ID
getAnnotationId()
instead of this key.public static final Object KEY_HTTP_SERVLET_REQUEST
getHttpServletRequest()
instead of this key.public static final Object KEY_MERGE_ANNOTATIONS
mergeAnnotations()
instead of this key.SendDocumentInterface
public static final Object KEY_DOCUMENT_CONTENT
getDocumentContent()
instead of this key.public static final Object KEY_PAGE_COUNT
getDocumentPageCount()
instead of this key.public static final Object KEY_DOCUMENT_FORMAT
getDocumentFormat()
instead of this key.VirtualViewerFormatHash.getFormat(int)
@Deprecated public static final Object KEY_DOCUMENT_FILE
public static final Object KEY_BOOKMARK_CONTENT
public static final Object KEY_NOTES_CONTENT
public static final Object KEY_WATERMARK_CONTENT
public static final Object KEY_ANNOTATION_CONTENT
getAnnotationContent()
instead of this key.public static final Object KEY_ANNOTATION_LAYERS
getAnnotationLayers()
instead of this key.@Deprecated public static final Object KEY_STAMP_STATUS
public static final Object KEY_ANNOTATION_PROPERTIES
getAnnotationProperties()
instead of this keypublic static final Object KEY_SPARSE_PAGE_INDEX
getSparseRequestedPageNumber()
instead of this key.public static final Object KEY_SPARSE_PAGE_COUNT
getSparseRequestedPageCount()
instead of this key.public static final String KEY_EVENT
Key for the type of event in an event notification. There may be additional parameters
that depend on the type of event, but every event input will contain at least the
client instance key
and the request object
.
Value type is one of the VALUE_EVENT String properties of ContentHandlerInput.
EventSubscriberInterface
,
Constant Field Valuespublic static final String VALUE_EVENT_PAGE_REQUESTED
KEY_EVENT_PAGE_REQUESTED_NUMBER
to retrieve
the zero-based page index of that page.EventSubscriberInterface
,
Constant Field Valuespublic static final String VALUE_EVENT_DOCUMENT_RETRIEVED_FROM_CACHE
KEY_DOCUMENT_ID
to
get the document's key.EventSubscriberInterface
,
Constant Field Valuespublic static final String KEY_EVENT_PAGE_REQUESTED_NUMBER
page requested
and annotation saved
events. Value type is int.public static final String VALUE_EVENT_SAVE_ANNOTATION
KEY_EVENT_PAGE_REQUESTED_NUMBER
to retrieve the current
page index the user was viewing (although not necessarily the page annotations were saved on!) and see KEY_EVENT_SAVE_ANNOTATION_LAYER_NAME_BASE
for the prefix to obtain the annotation layer names.EventSubscriberInterface
,
Constant Field Valuespublic static final String VALUE_EVENT_SAVE_DOCUMENT
public static final String VALUE_EVENT_CLOSE_DOCUMENT
public static final String KEY_EVENT_SAVE_ANNOTATION_LAYER_NAME_BASE
Used for the annotations saved
event. All annotation layer names will be
provided as separate parameters of ContentHandlerInput with the keys "KEY_EVENT_ANNOTATION_LAYER_NAME" + i, where
i is the index of the annotation layer name. If i is known, the specific key can be generated with this code:
String specificAnnotationLayerKey = ContentHandlerInput.KEY_EVENT_SAVE_ANNOTATION_LAYER_NAME_BASE.replace("_BASE", "" + i);
public static final String VALUE_EVENT_ROTATE_PAGE
KEY_EVENT_ROTATE_PAGE
for a list of rotated page indexes and
KEY_EVENT_ROTATE_DEGREES
for how many degrees they were rotated by.EventSubscriberInterface
,
Constant Field Valuespublic static final String KEY_EVENT_ROTATE_PAGE
VALUE_EVENT_ROTATE_PAGE
event. Value type is int[].public static final String KEY_EVENT_ROTATE_DEGREES
rotate
page(s)
event.public static final String VALUE_EVENT_PRINT
getDocumentId()
to get the document key and
KEY_EVENT_PRINT_PAGE_NUMBERS
to get the list of printed pages.EventSubscriberInterface
,
Constant Field Valuespublic static final String KEY_EVENT_PRINT_PAGE_NUMBERS
print event
. Value will be an int[] of
zero-based page indexes.public static final String VALUE_EVENT_EXPORT
getDocumentId()
to get the document key and
KEY_EVENT_EXPORT_FORMAT_NAME
to get the format it was exported as.EventSubscriberInterface
,
Constant Field Valuespublic static final String KEY_EVENT_EXPORT_FORMAT_NAME
export event
. Value type is
String and will be either "PDF", "TIFF" or "Original".public ContentHandlerInput()
public ContentHandlerInput(String documentId, String clientInstanceId)
documentId
- key for documentclientInstanceId
- a custom, configurable, value used to pass data from the client to the content handlerpublic ContentHandlerInput(String documentId, String clientInstanceId, Object request)
documentId
- key for documentclientInstanceId
- a custom, configurable, value used to pass data from the client to the content handlerrequest
- object containing HTTP request detailspublic String getClientInstanceId()
KEY_CLIENT_INSTANCE_ID
's value.public String getDocumentId()
KEY_DOCUMENT_ID
's value.public String getAnnotationId()
KEY_ANNOTATION_ID
's value.public int getDocumentFormat()
KEY_DOCUMENT_FORMAT
's value.VirtualViewerFormatHash.getFormat(int)
public void setDocumentDisplayName(String displayName)
KEY_DOCUMENT_DISPLAY_NAME
's value.displayName
- A name displayed on the client in place of the document's IDpublic String getDocumentDisplayName()
KEY_DOCUMENT_DISPLAY_NAME
's value.public boolean mergeAnnotations()
KEY_MERGE_ANNOTATIONS
's value.public byte[] getDocumentContent()
KEY_DOCUMENT_CONTENT
's value.public File getDocumentFile()
KEY_DOCUMENT_FILE
's value.public byte[] getAnnotationContent()
KEY_ANNOTATION_CONTENT
's value.public byte[] getBookmarkContent()
KEY_BOOKMARK_CONTENT
's value.public byte[] getWatermarkContent()
KEY_WATERMARK_CONTENT
's value.public byte[] getNotesContent()
KEY_NOTES_CONTENT
's value.public void setClientInstanceId(String clientInstanceId)
KEY_CLIENT_INSTANCE_ID
's value.clientInstanceId
- custom, configurable, value used to pass data from client to content handler@Deprecated public void setClientPreferencesXML(String xml)
KEY_CLIENT_PREFERENCES_XML
's value.xml
- client preference XML@Deprecated public String getClientPreferencesXML()
KEY_CLIENT_PREFERENCES_XML
's value.public void setDocumentId(String documentId)
KEY_DOCUMENT_ID
's value.documentId
- key for documentpublic void setAnnotationId(String annotationId)
KEY_ANNOTATION_ID
's value.annotationId
- an annotation layer keypublic void setHttpServletRequest(Object httpServletRequest)
KEY_HTTP_SERVLET_REQUEST
's value.httpServletRequest
- object containing HTTP request detailspublic void setMergeAnnotations(boolean mergeAnnotations)
KEY_MERGE_ANNOTATIONS
's value.mergeAnnotations
- whether annotations have been mergedpublic void setDocumentContent(byte[] content)
KEY_DOCUMENT_CONTENT
's value.content
- a byte array containing document contentpublic void setDocumentPageCount(int pageCount)
KEY_PAGE_COUNT
's value.pageCount
- number of pages in documentpublic int getDocumentPageCount()
KEY_PAGE_COUNT
's value.public void setDocumentFormat(int format)
KEY_DOCUMENT_FORMAT
's value.format
- file format codepublic void setDocumentFile(File contentFile)
KEY_DOCUMENT_FILE
's value.contentFile
- reference to document filepublic void setAnnotationContent(byte[] annContent)
KEY_ANNOTATION_CONTENT
's value.annContent
- byte array containing annotation contentpublic void setBookmarkContent(byte[] bookmarkContent)
KEY_BOOKMARK_CONTENT
's value.bookmarkContent
- byte array containing bookmark contentpublic void setWatermarkContent(byte[] watermarkContent)
KEY_WATERMARK_CONTENT
's value.watermarkContent
- byte array containing watermark contentpublic void setNotesContent(byte[] notesContent)
KEY_NOTES_CONTENT
's value.notesContent
- byte array containing notes contentpublic void setAnnotationLayers(AnnotationLayer[] layers)
KEY_ANNOTATION_LAYERS
's value.layers
- array of annotation layerspublic AnnotationLayer[] getAnnotationLayers()
KEY_ANNOTATION_LAYERS
's value.public void setAnnotationProperties(Hashtable props)
KEY_ANNOTATION_PROPERTIES
's value.props
- map of String keys to custom annotation property valuespublic Hashtable getAnnotationProperties()
KEY_ANNOTATION_PROPERTIES
's value.public void setSparseRequestedPageIndex(Integer index)
KEY_SPARSE_PAGE_INDEX
's value.index
- zero-based page indexpublic Integer getSparseRequestedPageIndex()
KEY_SPARSE_PAGE_INDEX
's value.@Deprecated public void setSparseRequestedPageNumber(int pageNumber)
setSparseRequestedPageIndex(java.lang.Integer)
should be used instead.pageNumber
- value to set for KEY_SPARSE_PAGE_INDEX
@Deprecated public int getSparseRequestedPageNumber()
getSparseRequestedPageIndex()
should be used instead. This method returns a non-nullable int
value, but that is misleading as the null value is important and means all pages should be returned.KEY_SPARSE_PAGE_INDEX
's value.public void setSparseRequestedPageCount(int pageCount)
KEY_SPARSE_PAGE_COUNT
's value.pageCount
- suggested number of pages to returnpublic int getSparseRequestedPageCount()
KEY_SPARSE_PAGE_COUNT
's value.@Deprecated public void setStampStatus(String stampStatus)
KEY_STAMP_STATUS
's value.stampStatus
- stamp status description@Deprecated public String getStampStatus()
KEY_STAMP_STATUS
's value.public javax.servlet.http.HttpServletRequest getHttpServletRequest()
KEY_HTTP_SERVLET_REQUEST
's value.Copyright © 2020 Snowbound Software Corporation. All rights reserved.