Class ContentHandlerInput

  • All Implemented Interfaces:
    Serializable, Cloneable, Map

    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.

    See Also:
    Serialized Form
    • Constructor Detail

      • ContentHandlerInput

        public ContentHandlerInput()
        Default constructor.
      • ContentHandlerInput

        public ContentHandlerInput​(String documentId,
                                   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​(String documentId,
                                   String clientInstanceId,
                                   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 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 String getDocumentId()
        Shortcut to get KEY_DOCUMENT_ID's value.
        Returns:
        document key
      • getAnnotationId

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

        public void setDocumentDisplayName​(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 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 File getDocumentFile()
        Deprecated.
        No longer used.
        Shortcut to get KEY_DOCUMENT_FILE's value.
        Returns:
        a File reference to a document file
      • 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​(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​(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 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​(String documentId)
        Shortcut to set KEY_DOCUMENT_ID's value.
        Parameters:
        documentId - key for document
      • setAnnotationId

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

        public void setHttpServletRequest​(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​(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​(Hashtable props)
        Shortcut to set KEY_ANNOTATION_PROPERTIES's value.
        Parameters:
        props - map of String keys to custom annotation property values
      • getAnnotationProperties

        public 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​(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 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​(Integer index)
        Shortcut to set KEY_SPARSE_PAGE_INDEX's value.
        Parameters:
        index - zero-based page index
      • getSparseRequestedPageIndex

        public 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​(String stampStatus)
        Deprecated.
        No longer used.
        Shortcut to set KEY_STAMP_STATUS's value.
        Parameters:
        stampStatus - stamp status description
      • 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.