PrizmDoc® v14.2 Release - Updated
PrizmDoc / API Reference / Viewer Control / Namespace: PCCViewer / Class: DocumentSummarizationRequest
In This Topic
    Class: DocumentSummarizationRequest
    In This Topic

    PCCViewer. DocumentSummarizationRequest

    (protected) new DocumentSummarizationRequest()

    The DocumentSummarizationRequest object is created when summarizing a document. It triggers events to indicate document summarization progress and it has properties to get the document summarization and status.

    This constructor should not be used directly. Instead, a document summarization request is created by PCCViewer.ViewerControl#summarizeDocument.

    Example

    // A DocumentSummarizationRequest object is created by and returned from the call to the summarizeDocument method
    var documentSummarizationRequest = viewerControl.summarizeDocument();
    
    

    Members

    (readonly) documentSummarization :string

    Returns a string of the document summarization produced by this DocumentSummarizationRequest.

    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) 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:

    Methods

    getDocumentSummarization() → {string}

    Returns a string of the document summarization produced by this DocumentSummarizationRequest.

    Example

    var documentSummarization = documentSummarizationRequest.getDocumentSummarization();
    
    

    Returns:

    A plain text summarization of the document.

    Type
    string

    getErrorCode() → {number}

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

    Example

    var errorCode = documentSummarizationRequest.getErrorCode();
    
    

    Returns:

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

    The possible error codes are:

    • 1010 - An unexpected exception occurred.
    • 1011 - There was a failure retrieving data from the server.
    • ServerSearchUnavailable - Server-side search is not available.
    Type
    number

    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.

    Example

    var errorMessage = documentSummarizationRequest.getErrorMessage();
    
    

    Returns:

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

    Type
    string

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

    Unsubscribe a handler from an event of the DocumentSummarizationRequest.

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

    Example

    // subscribe
    documentSummarizationRequest.on(PCCViewer.EventType.DocumentSummarizationCompleted, onDocumentSummarizationCompleted);
    
    // unsubscribe
    documentSummarizationRequest.off(PCCViewer.EventType.DocumentSummarizationCompleted, onDocumentSummarizationCompleted);
    
    // handler declaration
    function onDocumentSummarizationCompleted(ev) {
        alert("Document summarization completed!");
    }
    
    

    Parameters:

    Name Type Description
    eventType string

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

    handler function

    The function that was previously subscribed to the event type.

    Returns:

    The DocumentSummarizationRequest object on which this method was called.

    Type
    PCCViewer.DocumentSummarizationRequest

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

    Subscribe a handler to an event of the DocumentSummarizationRequest.

    Example

    // subscribe
    documentSummarizationRequest.on(PCCViewer.EventType.DocumentSummarizationCompleted, onDocumentSummarizationCompleted);
    
    // handler declaration
    function onDocumentSummarizationCompleted(ev) {
        alert("Document summarization complete!");
    }
    
    

    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 DocumentSummarizationRequest object on which this method was called.

    Type
    PCCViewer.DocumentSummarizationRequest

    Documentation generated by JSDoc 3.6.10 on Wed Sep 18 2024 14:23:38 GMT+0000 (Coordinated Universal Time)