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.
 
Determines if the viewer contains unsaved changes that need user interaction.
 
Closes the item.
 
Return true if the caller should initate the download action instead of showing the item in this viewer.
 
Disable editing annotations
 
Disable the Merge and Split mode.
 
Enable editing annotations
 
Enable the Merge and Split mode.
 
getItem(callback, refresh, refreshItem, version)
Gets 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.
 
ignoreDirty(onWindowClose)
Determines if the user should be prompted to save changes when isDirty is true.
 
Determines if the viewer is active.
 
Determines if the viewer is Applet-based.
 
Determines if bookmarks are supported for the document.
 
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.
 
Determines if the Merge and Split is supported for the document.
 
Indicates whether the viewer uses a browser plugin.
 
Determines if the viewer is printing the document.
 
Returns true if the viewer supports split view layouts
 
onAnnotationsSaved(item, resetEditItem, savedFromConfirm)
Called when annotations are saved and properties require refresh to current version.
 
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.
 
onItemAdd(item)
Called when the contained viewer adds a new item.
 
onItemUpdate(item, resetOriginalItem, keepPageNumber)
Called when the contained viewer updates the item.
 
If this is an iframe-based viewer, this event fires for the iframe onload event
 
Called when the Merge and Split mode failed.
 
Called when the original item used to open the viewer is changed.
 
onViewerFocusOut(movingup)
Called when the contained viewer programmatically gives up focus.
 
reloadItem(item, viewerReused)
Reloads the item of this viewer.
 
resetItem(item, viewerReused, keepPageNumber)
Resets the item of this viewer.
 
saveAnnotations(callback, errorback, savedFromConfirm)
Saves all annotation changes, if annotation editing is supported.
 
setIsLoading(loading)
Sets the loading status for this widget.
 
setItem(item, pageNumber, viewerReused, version)
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.

{Boolean} changesNeedInteraction()

Determines if the viewer contains unsaved changes that need user interaction.
Returns:
{Boolean} True or false, if there are unsaved changes that need user interaction.

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

disableAnnotationEdit()

Disable editing annotations

disableMergeSplitMode()

Disable the Merge and Split mode.
Since:
3.0.1

enableAnnotationEdit()

Enable editing annotations

enableMergeSplitMode()

Enable the Merge and Split mode.
Since:
3.0.1

getItem(callback, refresh, refreshItem, version)

Gets an instance of the item assigned to this viewer.
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.
refreshItem
Specify the fresh item to be used.
version
The version of the document to retrieve. Defaults to "specific". (optional)
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(onWindowClose)

Determines if the user should be prompted to save changes when isDirty is true.
Parameters:
onWindowClose
The flag to indicate if this method is called while the window is being closed by the user.
Returns:
{Boolean} True or false, if the isDirty value sould be ignored.

{Boolean} isActive()

Determines if the viewer is active.
Returns:
{Boolean} True or false, if the viewer is active.

{Boolean} isAppletViewer()

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

{Boolean} isBookmarkSupported()

Determines if bookmarks are supported for the document.
Since:
3.0.1
Returns:
{Boolean} True or false, if bookmarks are supported.

{Boolean} isDirty()

Determines if the viewer contains unsaved changes.
Returns:
{Boolean} True or false, if there are unsaved changes.

{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} isMergeSplitSupported()

Determines if the Merge and Split is supported for the document.
Since:
3.0.1
Returns:
{Boolean} True or false, if the Merge and Split is supported.

{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.

isSplitViewSupported()

Returns true if the viewer supports split view layouts
Since:
3.0.7.2

onAnnotationsSaved(item, resetEditItem, savedFromConfirm)

Called when annotations are saved and properties require refresh to current version.
Parameters:
item
The item containing the annotations saved.
resetEditItem
The flag to reset the item in the properties pane.
savedFromConfirm
Indicates the save was from the user confirming when moving to a new document.
Since:
3.0.7

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.

onItemAdd(item)

Called when the contained viewer adds a new item.
Parameters:
item
Since:
3.0.1

onItemUpdate(item, resetOriginalItem, keepPageNumber)

Called when the contained viewer updates the item. Refreshes the original item of the updated item.
Parameters:
item
The updated item.
resetOriginalItem
The flag to reset the viewer with the original item once refreshed.
keepPageNumber
Since:
3.0.1

onLoad()

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

onMergeSplitModeFailed()

Called when the Merge and Split mode failed.
Since:
3.0.1

onOriginalItemChange()

Called when the original item used to open the viewer is changed.
Since:
3.0.7

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.

reloadItem(item, viewerReused)

Reloads the item of this viewer.
Parameters:
item
The item being assigned to this viewer.
viewerReused
The flag to indicate the viewer should be reused. (optional)
Since:
3.0.10

resetItem(item, viewerReused, keepPageNumber)

Resets the item of this viewer.
Parameters:
item
The item being assigned to this viewer.
viewerReused
The flag to indicate the viewer should be reused. (optional)
keepPageNumber
Since:
3.0.7

saveAnnotations(callback, errorback, savedFromConfirm)

Saves all annotation changes, if annotation editing is supported.
Parameters:
callback
If specified, call the callback upon completion of the save.
errorback
If specified, call the callback upon failure of the save.
savedFromConfirm
Indicates the save is due to the user confirming to save when when closing the current document.

setIsLoading(loading)

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

setItem(item, pageNumber, viewerReused, version)

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)
viewerReused
The flag to indicate the viewer should be reused. (optional)
version
The version of the document to be retrieved, i.e., "current", "released", or "specific". (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".