public interface AvailableDocumentsInterface
Modifier and Type | Method and Description |
---|---|
ContentHandlerResult |
getAvailableDocumentIds(ContentHandlerInput input)
Returns an array containing the set of document keys available for viewing.
|
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;
}
input
- ContentHandlerInput containing the following values:
Key | Type | Description |
---|---|---|
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(); |
Key | Type | Description |
---|---|---|
KEY_AVAILABLE_DOCUMENT_IDS | java.lang.String[] | Array of keys for available documents |
VirtualViewerAPIException
- if content handler throws exceptionCopyright © 2020 Snowbound Software Corporation. All rights reserved.