PrizmDoc Viewer v13.6 - Updated
Class: RevisionsRequest
API Reference > Viewer API > Class: RevisionsRequest

Class: RevisionsRequest

PCCViewer. RevisionsRequest

(protected) new RevisionsRequest()

The RevisionsRequest object is created when requesting revisions for a document comparison. It triggers events to indicate revision retrieval progress and has properties to get the retrieved revisions and status.

This constructor should not be used directly. Instead, a revisions request is created by PCCViewer.ViewerControl#requestRevisions.

Example
// A RevisionsRequest object is created by and returned from the call to the requestRevisions method
var revisionsRequest = viewerControl.requestRevisions();

Members

(readonly) errorCode :number

Gets the error code if there was an error. If there was no error, null will be returned.

An ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8.

Type:
  • number
See:

(readonly) errorMessage :string

Returns a plain text, human-readable, fixed-local message that explains the error condition. If there was no error, null will be returned.

An ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8.

Type:
  • string
See:

(readonly) revisions :Array.<PCCViewer.Revision>

Gets an array of all revisions produced by this RevisionsRequest up until this point.

An ECMA 5 accessor property that is defined only in browsers supporting ECMA 5. This property is not available in the older browsers like IE8.

Type:
See:

Methods

getErrorCode() → {number}

Returns the error code if there was an error. If there was no error, null will be returned.

Returns:

An error code indicating the type of error, or null.

Type
number
Example
var errorCode = revisionsRequest.getErrorCode();

getErrorMessage() → {string}

Returns a plain text, human-readable, fixed-local message that explains the error condition. If there was no error, null will be returned.

Returns:

A plain text error message that explains the error condition, or null.

Type
string
Example
var errorMessage = revisionsRequest.getErrorMessage();

getRevisions() → {Array.<PCCViewer.Revision>}

Returns an array of all revisions produced by this RevisionsRequest up until this point.

Returns:

An array of Revision objects. If no results are found, this will be an empty array.

Type
Array.<PCCViewer.Revision>
Example
var revisions = revisionsRequest.getRevisions();

off(eventType, handler) → {PCCViewer.RevisionsRequest}

Unsubscribe a handler from an event of the RevisionsRequest.

Typically, event is unsubscribed when you no longer want further notification of the event.

Parameters:
Name Type Description
eventType string

A string specifying the event type. See PCCViewer.RevisionsRequest#on for possible values.

handler function

The function that was previously subscribed to the event type.

Returns:

The RevisionsRequest object on which this method was called.

Type
PCCViewer.RevisionsRequest
Example
// subscribe
revisionsRequest.on(PCCViewer.EventType.RevisionsRetrievalCompleted, onRevisionsRetrievalCompleted);

// unsubscribe
revisionsRequest.off(PCCViewer.EventType.RevisionsRetrievalCompleted, onRevisionsRetrievalCompleted);

// handler declaration
function onRevisionsRetrievalCompleted(ev) {
    alert("Revisions retrieval completed! Number of revisions: " + revisionsRequest.getRevisions().length);
}

on(eventType, handler) → {PCCViewer.RevisionsRequest}

Subscribe a handler to an event of the RevisionsRequest.

Parameters:
Name Type Description
eventType string

A string that specifies the event type.

handler function

The function that will be called whenever the event is triggered.

Returns:

The RevisionsRequest object on which this method was called.

Type
PCCViewer.RevisionsRequest
Example
// subscribe
revisionsRequest.on(PCCViewer.EventType.RevisionsRetrievalCompleted, onRevisionsRetrievalCompleted);

// handler declaration
function onRevisionsRetrievalCompleted(ev) {
    alert("Revisions retrieval completed! Number of revisions: " + revisionsRequest.getRevisions().length);
}