You can set the multipleDocMode parameter in the config.js file to configure which documents will be shown within the Documents pane of VirtualViewer HTML5 for Java. It can also be used to limit what documents are available to the user.

Please see config.js Parameters for more information on setting the multipleDocMode configuration parameter.

The multipleDocMode configuration parameter supports the following three values as options:

  • availableDocuments
  • viewedDocuments
  • specifiedDocuments

availableDocuments

The availableDocuments option displays the documents that are available to the current user.

The connector to your document storage, the content handler, determines what documents are listed by returning them from its getAvailableDocumentIds call. Please see the getAvailableDocumentIds() method description in the Content Handler Methods.

The sample content handler is the File Content Handler. It should return all of the documents in the document directory once getAvailableDocumentIds is implemented in the sample file content handler.

Example: Setting multipleDocMode to availableDocuments

This example shows how to set the multipleDocMode parameter in the config.js file to use availableDocuments.var multipleDocMode = multipleDocModes.availableDocuments;.

Documents handling when configured to use availableDocuments:

The getAvailableDocumentIds() method is called in the content handler to populate the list of documents. Please see the getAvailableDocumentIds() method description in the Javascript API.

viewedDocuments

The viewedDocuments option adds documents to the set of documents as the user views them during the current session.

Example: Setting multipleDocMode to viewedDocuments

This example shows how to set the multipleDocMode parameter in the config.js file to use viewedDocuments.

var multipleDocMode = multipleDocModes.viewedDocuments;

Documents handling when configured to use viewedDocuments:

Documents are passed to the viewer via the URL documentId parameter:

index.html?documentId=filename

Documents are loaded into the viewer with the onload event:

<body onload="VirtualViewer.initViaURL()">

specifiedDocuments

The specifiedDocuments option limits the documents available for viewing to those specified in an array.

Example: Changing multipleDocMode from availableDocuments to specifiedDocument

This example shows how to change multipleDocMode from availableDocuments to specifiedDocuments with the set of specified documents limited to: help.doc, info.tif, image.jpg.

In the config.js file, change the value multipleDocMode to specifiedDocuments and add a new line defining the array of specified documents:

var multipleDocMode = multipleDocModes.specifiedDocuments;
var SD = new Array("help.doc","info.tif","image.jpg);