Interface AvailableDocumentsInterface

    • Method Detail

      • getAvailableDocumentIds

        ContentHandlerResult getAvailableDocumentIds​(ContentHandlerInput input)
                                              throws VirtualViewerAPIException

        Returns an array containing the set of document keys available for viewing. This is used to populate the list of available documents in the thumbnail display in VirtualViewer. It is not required for retrieving documents - documents can still be retrieved by specifying the document key from the client instead of choosing an available document from this list.

        Example:

         
         // This example retrieves all of the filenames in a specific directory as available documents
         public ContentHandlerResult getAvailableDocumentIds(ContentHandlerInput input)
          throws VirtualViewerAPIException
         {
             String clientInstanceId = input.getClientInstanceId();
             File imgDirectory = new File(gFilePath);
             String[] myArray = imgDirectory.list(this);
             ContentHandlerResult result = new ContentHandlerResult();
             result.put(ContentHandlerResult.KEY_AVAILABLE_DOCUMENT_IDS, myArray);
             return result;
         }
         
         
        Parameters:
        input - ContentHandlerInput containing the following values:
        Every row is an expected value in the ContentHandlerInput. The first column is the string key for the value. The second column is the type of the value. The third column is the detailed description of the value.
        KeyTypeDescription
        KEY_CLIENT_INSTANCE_ID java.lang.String Custom configurable value used to pass data from client to content handler. If not set then will be the session ID. Can be retrieved with String clientInstanceId = input.getClientInstanceId();
        KEY_HTTP_SERVLET_REQUEST javax.servlet.http.HttpServletRequest Request that called this method. Can be retrieved with HttpServletRequest request = input.getHttpServletRequest();
        Returns:
        ContentHandlerResult with the following values:
        Every row is an expected value in the ContentHandlerResult. The first column is the string key for the value. The second column is the type of the value. The third column is the detailed description of the value.
        KeyTypeDescription
        KEY_AVAILABLE_DOCUMENT_IDS java.lang.String[] Array of keys for available documents
        Throws:
        VirtualViewerAPIException - if content handler throws exception