Class ecm.model.Viewer


Extends ecm.model._ModelObject.
Represents a viewer that is used to display content. This class maintains the name and launching information that is configured for the viewer. This information is used by the ContentViewer widget to invoke the viewer. Private functions should not be used to access public members of the class. Access member variables directly. For example:

var viewer = new Viewer({ id: "myviewer", name: "myviewer"});
console.debug("Viewer ID=" + viewer.id);

Note: Private getter methods, such as getUrlLaunchPattern, will be removed in a future release.
Defined in: <ecm\model\Viewer.js>.

Constructor Summary

Constructor Attributes Constructor Name and Description
 
ecm.model.Viewer(properties)
Constructs the viewer model object.

Field Summary

Field Attributes Field Name and Description
 
Boolean indicating if the viewer should be include the security token in the url.
 
The viewer is suitable for use in document Preview.
 
Boolean indicating if the viewer should be launched in a separate browser window.
 
A URL template that will launch the viewer.
 
An object containing fields for the content types supported by this viewer.
 
The name of the Dojo class implementing the viewer.
Fields borrowed from class ecm.model._ModelObject:
categorization, id, isRecurring, name, nameFilter, pane, status, type, userId

Method Summary

Method Attributes Method Name and Description
 
addViewerMapping(viewerMapping)
Add an associated mapping to the viewer's mapping list.
 
getDocUrl(item)
Generates the generic doc retrieval URL that typically gets encoded into the viewer launch URL.
 
Generates a URL that can be used to launch this viewer within a browser window or iframe, for the given item.
Methods borrowed from class ecm.model._ModelObject:
destroy, onChange, own, refresh, toString

Constructor Detail

ecm.model.Viewer(properties)

Constructs the viewer model object.
Parameters:
properties
The properties for the viewer model object. These properties can be any of the fields as defined below and on ecm.model._ModelObject.

Field Detail

includeSecurityToken

Boolean indicating if the viewer should be include the security token in the url.

isPreviewViewer

The viewer is suitable for use in document Preview.
Since:
2.0.3

launchInSeparateWindow

Boolean indicating if the viewer should be launched in a separate browser window.

launchUrl

A URL template that will launch the viewer. The template can have the following variables:

supportedContentTypes

An object containing fields for the content types supported by this viewer.

viewerClass

The name of the Dojo class implementing the viewer. This class is extension of ecm.widget.viewer.DocViewer.

Method Detail

addViewerMapping(viewerMapping)

Add an associated mapping to the viewer's mapping list.
Parameters:
viewerMapping

getDocUrl(item)

Generates the generic doc retrieval URL that typically gets encoded into the viewer launch URL.
Parameters:
item

getLaunchUrl(item)

Generates a URL that can be used to launch this viewer within a browser window or iframe, for the given item.
Parameters:
item
An instance of ecm.model.ContentItem for the document.