Class ContentHandlerInput

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map

    public class ContentHandlerInput
    extends java.util.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.

    See Also:
    Serialized Form
    • Field Detail

      • KEY_CLIENT_INSTANCE_ID

        public static final java.lang.Object KEY_CLIENT_INSTANCE_ID
        Key for a custom, configurable, value used to pass data from client to content handler. If not set then will be the session ID. Value type is a String. Can use getClientInstanceId() instead of this key.
      • KEY_CLIENT_PREFERENCES_XML

        @Deprecated
        public static final java.lang.Object KEY_CLIENT_PREFERENCES_XML
        Deprecated.
        No longer used.
        Key for client-side preferences. No longer used; see config.js settings and User Preferences instead.
      • KEY_DOCUMENT_ID

        public static final java.lang.Object KEY_DOCUMENT_ID
        Key for a document key, used to identify a specific document. Value type is a String. Can use getDocumentId() instead of this key.
      • KEY_DOCUMENT_DISPLAY_NAME

        public static final java.lang.Object KEY_DOCUMENT_DISPLAY_NAME
        Key for the user-friendly display name for a document. Value type is a String. Can use getDocumentDisplayName() instead of this key.
      • KEY_ANNOTATION_ID

        public static final java.lang.Object KEY_ANNOTATION_ID
        Key for an annotation layer key, used to identify a specific annotation layer on a document. Value type is a String. Can use getAnnotationId() instead of this key.
      • KEY_HTTP_SERVLET_REQUEST

        public static final java.lang.Object KEY_HTTP_SERVLET_REQUEST
        Key for the request object, used to retrieve information about the request that spawned the current content handler method. Value type is a javax.servlet.http.HttpServletRequest. Can use getHttpServletRequest() instead of this key.
      • KEY_MERGE_ANNOTATIONS

        public static final java.lang.Object KEY_MERGE_ANNOTATIONS
        Key for whether annotations were merged into the document being sent. Value type is a Boolean. Can use mergeAnnotations() instead of this key.
        See Also:
        SendDocumentInterface
      • KEY_DOCUMENT_CONTENT

        public static final java.lang.Object KEY_DOCUMENT_CONTENT
        Key for the document file content. Value type is a byte[]. Can use getDocumentContent() instead of this key.
      • KEY_PAGE_COUNT

        public static final java.lang.Object KEY_PAGE_COUNT
        Key for the number of pages in the document. Value type is an Integer. Can use getDocumentPageCount() instead of this key.
      • KEY_IS_EMAIL_ATTACHMENT

        public static final java.lang.Object KEY_IS_EMAIL_ATTACHMENT
        Key sent to the CreateDocumentInterface function, marking if a new document is an email attachment.
      • KEY_PARENT_DOCUMENT_ID

        public static final java.lang.Object KEY_PARENT_DOCUMENT_ID
        Key sent to the CreateDocumentInterface function. If the new document is an email attachment, this will store the ID of its parent email document.
      • KEY_DOCUMENT_FORMAT

        public static final java.lang.Object KEY_DOCUMENT_FORMAT
        Key for a format code used to identify a file format like PDF or TIF by VirtualViewer and Rastermaster. Can use VirtualViewerFormatHash to retrieve detailed information about the format, such as name and extension. Value type is an int. Can use getDocumentFormat() instead of this key.
        See Also:
        VirtualViewerFormatHash.getFormat(int)
      • KEY_DOCUMENT_FILE

        @Deprecated
        public static final java.lang.Object KEY_DOCUMENT_FILE
        Deprecated.
        no longer used.
        Key for the document file object. Value type is a java.io.File.
      • KEY_BOOKMARK_CONTENT

        public static final java.lang.Object KEY_BOOKMARK_CONTENT
        Key for the contents of a bookmarks XML file, used when saving. Value type is a byte[].
      • KEY_NOTES_CONTENT

        public static final java.lang.Object KEY_NOTES_CONTENT
        Key for the contents of a document notes XML file, used when saving. Value type is a byte[].
      • KEY_WATERMARK_CONTENT

        public static final java.lang.Object KEY_WATERMARK_CONTENT
        Key for the contents of a watermarks json file, used when saving. Value type is a byte[].
      • KEY_ANNOTATION_LAYERS

        public static final java.lang.Object KEY_ANNOTATION_LAYERS
        Key for an array of annotation layer objects. Used when saving changes to all annotation layers. Value type is a com.snowbound.common.transport.AnnotationLayer[]. Can use getAnnotationLayers() instead of this key.
      • KEY_DELETED_ANNOTATION_LAYERS

        public static final java.lang.Object KEY_DELETED_ANNOTATION_LAYERS
        Key for an array of Strings, representing the layer names of any annotation layers deleted by the user in the current session being saved. Value type is a String[]. Can use getDeletedAnnotationLayers() instead of this key.
      • KEY_STAMP_STATUS

        @Deprecated
        public static final java.lang.Object KEY_STAMP_STATUS
        Deprecated.
        No longer used.
      • KEY_ANNOTATION_PROPERTIES

        public static final java.lang.Object KEY_ANNOTATION_PROPERTIES
        Key for the map of annotation properties, which maps String keys to custom properties. Value type is a java.util.Hashtable. Can use getAnnotationProperties() instead of this key
      • KEY_EVENT

        public static final java.lang.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.

        See Also:
        EventSubscriberInterface, Constant Field Values
      • VALUE_EVENT_DOCUMENT_RETRIEVED_FROM_CACHE

        public static final java.lang.String VALUE_EVENT_DOCUMENT_RETRIEVED_FROM_CACHE
        Event fired when a document has been retrieved from the VirtualViewer cache. Use KEY_DOCUMENT_ID to get the document's key.
        See Also:
        EventSubscriberInterface, Constant Field Values
      • KEY_EVENT_PAGE_REQUESTED_NUMBER

        public static final java.lang.String KEY_EVENT_PAGE_REQUESTED_NUMBER
        Key for the zero-based page index of a specific page. Used for the page requested and annotation saved events. Value type is int.
        See Also:
        Constant Field Values
      • VALUE_EVENT_SAVE_DOCUMENT

        public static final java.lang.String VALUE_EVENT_SAVE_DOCUMENT
        Deprecated.
        Not used.
        See Also:
        Constant Field Values
      • VALUE_EVENT_CLOSE_DOCUMENT

        public static final java.lang.String VALUE_EVENT_CLOSE_DOCUMENT
        Deprecated.
        Not used.
        See Also:
        Constant Field Values
      • KEY_EVENT_SAVE_ANNOTATION_LAYER_NAME_BASE

        public static final java.lang.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);
        See Also:
        Constant Field Values
      • KEY_EVENT_ROTATE_PAGE

        public static final java.lang.String KEY_EVENT_ROTATE_PAGE
        Key for a list of zero-based page indexes affected by a rotate action. Used for the VALUE_EVENT_ROTATE_PAGE event. Value type is int[].
        See Also:
        Constant Field Values
      • KEY_EVENT_ROTATE_DEGREES

        public static final java.lang.String KEY_EVENT_ROTATE_DEGREES
        Key for the degrees pages were rotated by in a rotate action. Used for the rotate page(s) event.
        See Also:
        Constant Field Values
      • KEY_EVENT_PRINT_PAGE_NUMBERS

        public static final java.lang.String KEY_EVENT_PRINT_PAGE_NUMBERS
        Key for which pages were printed in a print event. Value will be an int[] of zero-based page indexes.
        See Also:
        Constant Field Values
      • KEY_EVENT_EXPORT_FORMAT_NAME

        public static final java.lang.String KEY_EVENT_EXPORT_FORMAT_NAME
        Key for which format a document was exported as in an export event. Value type is String and will be either "PDF", "TIFF" or "Original".
        See Also:
        Constant Field Values
      • KEY_EVENT_EMAIL_FORMAT_NAME

        public static final java.lang.String KEY_EVENT_EMAIL_FORMAT_NAME
        Key for which format a document was emailed as in an export event. Value type is String and will be either "PDF", "TIFF" or "Original".
        See Also:
        Constant Field Values
      • KEY_EVENT_EMAIL_FROM_ADDRESS

        public static final java.lang.String KEY_EVENT_EMAIL_FROM_ADDRESS
        Key for the address a document email was marked as from in an export event. Value type is String.
        See Also:
        Constant Field Values
      • KEY_EVENT_EMAIL_TO_ADDRESSES

        public static final java.lang.String KEY_EVENT_EMAIL_TO_ADDRESSES
        Key for a comma-separated list of the "To:" addresses a document email was sent to in an export event. Value type is String.
        See Also:
        Constant Field Values
      • KEY_EVENT_EMAIL_CC_ADDRESSES

        public static final java.lang.String KEY_EVENT_EMAIL_CC_ADDRESSES
        Key for a comma-separated list of the "CC:" addresses a document email was sent to in an export event. Value type is String.
        See Also:
        Constant Field Values
      • KEY_EVENT_EMAIL_BCC_ADDRESSES

        public static final java.lang.String KEY_EVENT_EMAIL_BCC_ADDRESSES
        Key for a comma-separated list of the "BCC:" addresses a document email was sent to in an export event. Value type is String.
        See Also:
        Constant Field Values
      • KEY_EVENT_EMAIL_SUBJECT

        public static final java.lang.String KEY_EVENT_EMAIL_SUBJECT
        Key for the subject line of a sent document email in an export event. Value type is String.
        See Also:
        Constant Field Values
      • KEY_EVENT_EMAIL_BODY

        public static final java.lang.String KEY_EVENT_EMAIL_BODY
        Key for the body of a sent document email in an export event. Value type is String.
        See Also:
        Constant Field Values
      • KEY_DOCUMENT_OCR_LANGUAGE

        public static final java.lang.String KEY_DOCUMENT_OCR_LANGUAGE
        See Also:
        Constant Field Values
    • Constructor Detail

      • ContentHandlerInput

        public ContentHandlerInput()
        Default constructor.
      • ContentHandlerInput

        public ContentHandlerInput​(java.lang.String documentId,
                                   java.lang.String clientInstanceId)
        Parameters:
        documentId - key for document
        clientInstanceId - a custom, configurable, value used to pass data from the client to the content handler
      • ContentHandlerInput

        public ContentHandlerInput​(java.lang.String documentId,
                                   java.lang.String clientInstanceId,
                                   java.lang.Object request)
        Parameters:
        documentId - key for document
        clientInstanceId - a custom, configurable, value used to pass data from the client to the content handler
        request - object containing HTTP request details
    • Method Detail

      • getClientInstanceId

        public java.lang.String getClientInstanceId()
        Shortcut to get KEY_CLIENT_INSTANCE_ID's value.
        Returns:
        the clientInstanceId, a custom, configurable, value used to pass data from the client to the content handler
      • getDocumentId

        public java.lang.String getDocumentId()
        Shortcut to get KEY_DOCUMENT_ID's value.
        Returns:
        document key
      • getAnnotationId

        public java.lang.String getAnnotationId()
        Shortcut to get KEY_ANNOTATION_ID's value.
        Returns:
        annotation layer key
      • setDocumentDisplayName

        public void setDocumentDisplayName​(java.lang.String displayName)
        Shortcut to set KEY_DOCUMENT_DISPLAY_NAME's value.
        Parameters:
        displayName - A name displayed on the client in place of the document's ID
      • getDocumentDisplayName

        public java.lang.String getDocumentDisplayName()
        Shortcut to get KEY_DOCUMENT_DISPLAY_NAME's value.
        Returns:
        the name displayed on the client in place of the document's ID
      • mergeAnnotations

        public boolean mergeAnnotations()
        Shortcut to get KEY_MERGE_ANNOTATIONS's value.
        Returns:
        whether annotations have been merged
      • getDocumentContent

        public byte[] getDocumentContent()
        Shortcut to get KEY_DOCUMENT_CONTENT's value.
        Returns:
        a byte array containing document content
      • getDocumentFile

        public java.io.File getDocumentFile()
        Deprecated.
        No longer used.
        Shortcut to get KEY_DOCUMENT_FILE's value.
        Returns:
        a File reference to a document file
      • getIsEmailAttachment

        public boolean getIsEmailAttachment()
        Shortcut to get KEY_IS_EMAIL_ATTACHMENT's value.
        Returns:
        a boolean sent when creating a document, indicating if the new document is an email attachment.
      • getParentDocumentId

        public java.lang.String getParentDocumentId()
        Shortcut to get KEY_PARENT_DOCUMENT_ID's value.
        Returns:
        a string naming the ID of a new document's parent, if the new document is an email attachment.
      • getAnnotationContent

        public byte[] getAnnotationContent()
        Shortcut to get KEY_ANNOTATION_CONTENT's value.
        Returns:
        a byte array containing annotation content
      • getBookmarkContent

        public byte[] getBookmarkContent()
        Shortcut to get KEY_BOOKMARK_CONTENT's value.
        Returns:
        a byte array containing bookmark content
      • getWatermarkContent

        public byte[] getWatermarkContent()
        Shortcut to get KEY_WATERMARK_CONTENT's value.
        Returns:
        a byte array containing watermark content
      • getNotesContent

        public byte[] getNotesContent()
        Shortcut to get KEY_NOTES_CONTENT's value.
        Returns:
        a byte array containing notes content
      • setClientInstanceId

        public void setClientInstanceId​(java.lang.String clientInstanceId)
        Shortcut to set KEY_CLIENT_INSTANCE_ID's value.
        Parameters:
        clientInstanceId - custom, configurable, value used to pass data from client to content handler
      • setClientPreferencesXML

        @Deprecated
        public void setClientPreferencesXML​(java.lang.String xml)
        Deprecated.
        No longer used. See client-side config.js and User Preferences settings instead.
        Shortcut to set KEY_CLIENT_PREFERENCES_XML's value.
        Parameters:
        xml - client preference XML
      • getClientPreferencesXML

        @Deprecated
        public java.lang.String getClientPreferencesXML()
        Deprecated.
        No longer used. See client-side config.js and User Preferences settings instead.
        Shortcut to get KEY_CLIENT_PREFERENCES_XML's value.
        Returns:
        client preference XML
      • setDocumentId

        public void setDocumentId​(java.lang.String documentId)
        Shortcut to set KEY_DOCUMENT_ID's value.
        Parameters:
        documentId - key for document
      • setAnnotationId

        public void setAnnotationId​(java.lang.String annotationId)
        Shortcut to set KEY_ANNOTATION_ID's value.
        Parameters:
        annotationId - an annotation layer key
      • setHttpServletRequest

        public void setHttpServletRequest​(java.lang.Object httpServletRequest)
        Shortcut to set KEY_HTTP_SERVLET_REQUEST's value.
        Parameters:
        httpServletRequest - object containing HTTP request details
      • setMergeAnnotations

        public void setMergeAnnotations​(boolean mergeAnnotations)
        Shortcut to set KEY_MERGE_ANNOTATIONS's value.
        Parameters:
        mergeAnnotations - whether annotations have been merged
      • setDocumentContent

        public void setDocumentContent​(byte[] content)
        Shortcut to set KEY_DOCUMENT_CONTENT's value.
        Parameters:
        content - a byte array containing document content
      • setDocumentPageCount

        public void setDocumentPageCount​(int pageCount)
        Shortcut to set KEY_PAGE_COUNT's value.
        Parameters:
        pageCount - number of pages in document
      • getDocumentPageCount

        public int getDocumentPageCount()
        Shortcut to get KEY_PAGE_COUNT's value.
        Returns:
        number of pages in the document
      • setDocumentFormat

        public void setDocumentFormat​(int format)
        Shortcut to set KEY_DOCUMENT_FORMAT's value.
        Parameters:
        format - file format code
      • setDocumentFile

        public void setDocumentFile​(java.io.File contentFile)
        Deprecated.
        No longer used.
        Shortcut to set KEY_DOCUMENT_FILE's value.
        Parameters:
        contentFile - reference to document file
      • setAnnotationContent

        public void setAnnotationContent​(byte[] annContent)
        Shortcut to set KEY_ANNOTATION_CONTENT's value.
        Parameters:
        annContent - byte array containing annotation content
      • setBookmarkContent

        public void setBookmarkContent​(byte[] bookmarkContent)
        Shortcut to set KEY_BOOKMARK_CONTENT's value.
        Parameters:
        bookmarkContent - byte array containing bookmark content
      • setWatermarkContent

        public void setWatermarkContent​(byte[] watermarkContent)
        Shortcut to set KEY_WATERMARK_CONTENT's value.
        Parameters:
        watermarkContent - byte array containing watermark content
      • setNotesContent

        public void setNotesContent​(byte[] notesContent)
        Shortcut to set KEY_NOTES_CONTENT's value.
        Parameters:
        notesContent - byte array containing notes content
      • setAnnotationLayers

        public void setAnnotationLayers​(AnnotationLayer[] layers)
        Shortcut to set KEY_ANNOTATION_LAYERS's value.
        Parameters:
        layers - array of annotation layers
      • setAnnotationProperties

        public void setAnnotationProperties​(java.util.Hashtable props)
        Shortcut to set KEY_ANNOTATION_PROPERTIES's value.
        Parameters:
        props - map of String keys to custom annotation property values
      • getAnnotationProperties

        public java.util.Hashtable getAnnotationProperties()
        Shortcut to get KEY_ANNOTATION_PROPERTIES's value.
        Returns:
        a map of String keys to custom annotation property values
      • setDeletedAnnotationLayers

        public void setDeletedAnnotationLayers​(java.lang.String[] layers)
        Shortcut to set KEY_DELETED_ANNOTATION_LAYERS's value.
        Parameters:
        layers - array of String annotation layer names that were deleted by the user
      • getDeletedAnnotationLayers

        public java.lang.String[] getDeletedAnnotationLayers()
        Shortcut to get KEY_DELETED_ANNOTATION_LAYERS's value.
        Returns:
        an array of String annotation layer names that were deleted by the user
      • setSparseRequestedPageIndex

        public void setSparseRequestedPageIndex​(java.lang.Integer index)
        Shortcut to set KEY_SPARSE_PAGE_INDEX's value.
        Parameters:
        index - zero-based page index
      • getSparseRequestedPageIndex

        public java.lang.Integer getSparseRequestedPageIndex()
        Shortcut to get KEY_SPARSE_PAGE_INDEX's value.
        Returns:
        zero-based index of requested page; null if all pages are required
      • getSparseRequestedPageNumber

        @Deprecated
        public 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.
        Shortcut to get KEY_SPARSE_PAGE_INDEX's value.
        Returns:
        requested sparse page index
      • setSparseRequestedPageCount

        public void setSparseRequestedPageCount​(int pageCount)
        Shortcut to set KEY_SPARSE_PAGE_COUNT's value.
        Parameters:
        pageCount - suggested number of pages to return
      • getSparseRequestedPageCount

        public int getSparseRequestedPageCount()
        Shortcut to get KEY_SPARSE_PAGE_COUNT's value.
        Returns:
        suggested number of pages to return
      • setStampStatus

        @Deprecated
        public void setStampStatus​(java.lang.String stampStatus)
        Deprecated.
        No longer used.
        Shortcut to set KEY_STAMP_STATUS's value.
        Parameters:
        stampStatus - stamp status description
      • getStampStatus

        @Deprecated
        public java.lang.String getStampStatus()
        Deprecated.
        No longer used.
        Shortcut to get KEY_STAMP_STATUS's value.
        Returns:
        stamp status
      • getHttpServletRequest

        public javax.servlet.http.HttpServletRequest getHttpServletRequest()
        Shortcut to get KEY_HTTP_SERVLET_REQUEST's value.
        Returns:
        An object that can be used to retrieve request information, such as URL parameters and cookies.