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 client
VALUE_EVENT_DOCUMENT_RETRIEVED_FROM_CACHE: Fired when a document is loaded from the cache
VALUE_EVENT_SAVE_ANNOTATION: Fired when annotation data is saved
KEY_EVENT_ROTATE_PAGE: Fired when a page is rotated by the user
VALUE_EVENT_PRINT: Fired when a document is printed by the user
VALUE_EVENT_EXPORT: Fired when a document is exported/downloaded by the user
ContentHandlerInput.VALUE_EVENT_EMAIL: Fired when a document is emailed by the user
All Methods Instance Methods Abstract Methods Modifier and Type Method Description
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:
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. 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();
- ContentHandlerResult with no values currently expected.
VirtualViewerAPIException- if content handler throws exception