Class ecm.widget.viewer.DocViewer


Extends dijit._Widget.
Provides a base class for all document viewer widgets. All document viewers in ICN have this widget/class as their base.
Defined in: <ecm\widget\viewer\DocViewer.js>.

Constructor Summary

Constructor Attributes Constructor Name and Description
 

Field Summary

Field Attributes Field Name and Description
 
Sets the document viewer's CSS class for the DocViewer container.
 
item 
The item assigned to this doc viewer.
 
Indicates whether this instance of DocViewer is being used for preview.
 
Indicates whether or not to show an error dialog, stating that no viewers are available to view a document, when the onFallback handler does not find a backup viewer.
 
The page to start on when initially opening the item to view.
 
The instance of ecm.model.Viewer associated with this DocViewer instance.

Method Summary

Method Attributes Method Name and Description
 
Determines if the viewer can open the item on the current client and mid-tier platforms.
 
Closes the item.
 
Return true if the caller should initate the download action instead of showing the item in this viewer.
 
getItem(callback, refresh)
Get an instance of the item assigned to this viewer.
 
Returns an instance of the object representing the native viewer implementation of this DocViewer, if available.
 
Returns the page number of the current page being viewed, if the viewer supports paging.
 
Determines if the user should be prompted to save changes when isDirty is true.
 
Determines if the viewer is Applet-based.
 
Determines if the viewer contains unsaved changes.
 
Determines if the viewer is iframe-based.
 
Determines if the document has completed loading.
 
Determines if the current document is in the process of being loaded.
 
Determines if the item being shown in the viewer is locked.
 
Indicates whether the viewer uses a browser plugin.
 
Determines if the viewer is printing the document.
 
onDirty(dirty)
Called when the contained viewer dirty state changes, either by acquiring unsaved changes, and when changes are saved.
 
This event fires when the document has loaded.
 
onFallback(notFoundCallback)
Called when the viewer is unable to successfully open the document.
 
If this is an iframe-based viewer, this event fires for the iframe onload event
 
onViewerFocusOut(movingup)
Called when the contained viewer programmatically gives up focus.
 
saveAnnotations(callback)
Saves all annotation changes, if annotation editing is supported.
 
setIsLoading(loading)
Sets the loading status for this widget.
 
setItem(item, pageNumber)
Assigns an item to this viewer.
 
showItem(callback)
Displays the item, if an item has been set on this viewer.
 
If the viewer is an iframe viewer, this call sets its src to "about:blank".

Constructor Detail

ecm.widget.viewer.DocViewer()

Field Detail

docViewerClass

Sets the document viewer's CSS class for the DocViewer container. By default, this is initialized to ECMDocViewer.

item

The item assigned to this doc viewer.
Deprecated:
This item property is not guaranteed to be in the correct window context, so it can only be used to obtain the document id/properties required for the viewer to obtain the document content and annotations. Use getItem instead.

preview

Indicates whether this instance of DocViewer is being used for preview.
Since:
2.0.2

showErrorOnFallback

Indicates whether or not to show an error dialog, stating that no viewers are available to view a document, when the onFallback handler does not find a backup viewer.
Since:
2.0.3

startingPage

The page to start on when initially opening the item to view.
Since:
2.0.2

viewerDef

The instance of ecm.model.Viewer associated with this DocViewer instance. Set this property on construction of the DocViewer instance.
Since:
2.0.2

Method Detail

{Boolean} canOpenItem(item)

Determines if the viewer can open the item on the current client and mid-tier platforms.
Parameters:
item
The item to test.
Returns:
{Boolean} True or false, indicating whether this viewer can open the specified item.

closeItem()

Closes the item. Terminate display of the document in the viewer, and clear any states related to the item assigned to this viewer.

delegateToDownload(item)

Return true if the caller should initate the download action instead of showing the item in this viewer.
Parameters:
item
Since:
2.0.2

getItem(callback, refresh)

Get an instance of the item assigned to this viewer. Specify "true" to refresh the properties of the item, to be current.
Parameters:
callback
The callback to call upon completion, the item instance will be passed as the sole parameter to this callback.
refresh
Specify true or false, to refresh the item properties.
Since:
2.0.3

getNativeViewer()

Returns an instance of the object representing the native viewer implementation of this DocViewer, if available. If not available, null is returned.
Since:
2.0.3.3

{number} getPageNumber()

Returns the page number of the current page being viewed, if the viewer supports paging.
Returns:
{number}

{Boolean} ignoreDirty()

Determines if the user should be prompted to save changes when isDirty is true.
Returns:
{Boolean} True or false, if the isDirty value sould be ignored.

{Boolean} isAppletViewer()

Determines if the viewer is Applet-based.
Returns:
{Boolean} True or false, if the viewer is Applet-based.

{Boolean} isDirty()

Determines if the viewer contains unsaved changes.
Returns:
{Boolean} True or false, if annotations have been added, modified, or deleted.

{Boolean} isIframeViewer()

Determines if the viewer is iframe-based.
Returns:
{Boolean} True or false, if the viewer is presented within an internal iframe

{Boolean} isLoaded()

Determines if the document has completed loading.
Returns:
{Boolean} True or false, if loading and display of the document has completed.

{Boolean} isLoading()

Determines if the current document is in the process of being loaded.
Returns:
{Boolean} True or false, if the document is in the process of loading into the viewer.

{Boolean} isLocked()

Determines if the item being shown in the viewer is locked.
Returns:
{Boolean} True or false, if the viewer has locked the item or sees the item as locked.

{Boolean} isPluginViewer()

Indicates whether the viewer uses a browser plugin.
Since:
2.0.3
Returns:
{Boolean} True or false, if the viewer is Plugin-based.

{Boolean} isPrinting()

Determines if the viewer is printing the document.
Returns:
{Boolean} True or false, if the viewer is in the process of printing a document.

onDirty(dirty)

Called when the contained viewer dirty state changes, either by acquiring unsaved changes, and when changes are saved.
Parameters:
dirty
boolean indicating whether the new viewer state is dirty or not.
Since:
2.0.2

onDocumentLoaded()

This event fires when the document has loaded.

onFallback(notFoundCallback)

Called when the viewer is unable to successfully open the document.
Parameters:
notFoundCallback
If specified, this method will be called by the ContentViewer framework, when there is no fallback viewer available for the item being viewed.

onLoad()

If this is an iframe-based viewer, this event fires for the iframe onload event

onViewerFocusOut(movingup)

Called when the contained viewer programmatically gives up focus.
Parameters:
movingup
Boolean, to set to true if the focus out is the result of a shift-tab, otherwise false.

saveAnnotations(callback)

Saves all annotation changes, if annotation editing is supported.
Parameters:
callback
If specified, call the callback upon completion of the save.

setIsLoading(loading)

Sets the loading status for this widget.
Parameters:
loading
Since:
2.0.2

setItem(item, pageNumber)

Assigns an item to this viewer. This call is not required to actually display the document (item) in the user interface. The parameters are the viewerItem to view, and the page number to start on. If unspecified, the page number to start on is assumed to be page 1.
Parameters:
item
The item being assigned to this viewer.
pageNumber
For document viewers that support page control, the page number to start on. If not specified, page 1 is assumed. (optional)

showItem(callback)

Displays the item, if an item has been set on this viewer. The callback will be called on successful completion of showing the item.
Parameters:
callback
The callback to call on successful completion of this call. (optional)

unloadIframe()

If the viewer is an iframe viewer, this call sets its src to "about:blank".