public interface EventSubscriberInterface
Implement this interface to subscribe to client events. When specific events happen on the VirtualViewer client, the content handler can be notified through this interface.
Event notifications can be disabled via a client-side setting in config.js or by not implementing this interface.
Types of events:VALUE_EVENT_PAGE_REQUESTED
: Fired when a page is requested by the clientVALUE_EVENT_DOCUMENT_RETRIEVED_FROM_CACHE
: Fired when a document is loaded from the cacheVALUE_EVENT_SAVE_ANNOTATION
: Fired when annotation data is savedKEY_EVENT_ROTATE_PAGE
: Fired when a page is rotated by the userVALUE_EVENT_PRINT
: Fired when a document is printed by the userVALUE_EVENT_EXPORT
: Fired when a document is exported/downloaded by the userModifier and Type | Method and Description |
---|---|
ContentHandlerResult |
eventNotification(ContentHandlerInput input)
This method is called when some events occur in the VirtualViewer client, such as opening a document or viewing a
new page on the document.
|
ContentHandlerResult eventNotification(ContentHandlerInput input) throws VirtualViewerAPIException
input
- ContentHandlerInput containing the following values:
Key | Type | Description |
---|---|---|
KEY_EVENT | java.lang.Object | The type of event, as a constant property of ContentHandlerInput (e.g. ContentHandlerInput.VALUE_EVENT_SAVE_DOCUMENT). |
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(); |
VirtualViewerAPIException
- if content handler throws exceptionCopyright © 2020 Snowbound Software Corporation. All rights reserved.