The PrizmDoc® for Java Content Handler is a Java class that the servlet will call on to perform various actions concerning the retrieval and storage of content.

PrizmDoc® for Java comes with a sample file content handler that connects PrizmDoc® for Java to your file system. The sample content handler that connects to the server’s File System is provided as a starting point to integrate PrizmDoc® for Java with your document storage.

By default, the PrizmDoc® for Java servlet will use the sample content handler that PrizmDoc® for Java Software provides. FileContentHandler.java reads and writes to a file system location. You can find this sample content handler at virtualviewer\Sample-Code\Java Content Handler. It displays files from the /sample-documents directory.

The sample content handler is not intended for production use. We encourage you to use this as a starting point for writing your own custom content handler to integrate PrizmDoc® for Java into back-end systems. You should create your own content handler to serve up documents from locations that work for your company as well as to add error handling and more robustness for handling requests from multiple users.

How the Content Handler Works

Whenever PrizmDoc® for Java requests a document, the servlet will first check the cache to see if the document is present. If it is not, it then calls into the content handler for the document. The order of action is as follows:

  1. getDocumentContent
  2. getAnnotationNames
  3. getAnnotationContent (once for each layer name returned by getAnnotationNames)
  4. getBookmarkContent

Whenever the user chooses to save the document by choosing Save Document, PrizmDoc® for Java passes the appropriate data to the servlet, which calls the content handler method saveDocumentComponents.

Inside saveDocumentComponents the following methods should be called separately when the appropriate data has changed:

  • saveDocumentContent
  • saveAnnotationContent
  • saveBookmarkContent

Other methods within the content handler are called by various functions in PrizmDoc® for Java.

For more information about ready-made and custom content handlers, please contact info@accusoft.com.

Content Handler method documentation

For information regarding specific method APIs, please see the Content Handler API documentation.

Additional topics