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

    PCCViewer. DocumentClassificationRequest

    (protected) new DocumentClassificationRequest()

    The DocumentClassificationRequest object is created when classifying a document. It triggers events to indicate document classification progress and it has properties to get the document classification and status.

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

    Example

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

    Members

    (readonly) documentClassification :string

    Returns a string of the document classification produced by this DocumentClassificationRequest.

    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

    getDocumentClassification() → {string}

    Returns a string of the document classification produced by this DocumentClassificationRequest.

    Example

    var documentClassification = DocumentClassificationRequest.getDocumentClassification();
    
    

    Returns:

    A plain text classification 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 = DocumentClassificationRequest.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 = DocumentClassificationRequest.getErrorMessage();
    
    

    Returns:

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

    Type
    string

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

    Unsubscribe a handler from an event of the DocumentClassificationRequest.

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

    Example

    // subscribe
    DocumentClassificationRequest.on(PCCViewer.EventType.DocumentClassificationCompleted, onDocumentClassificationCompleted);
    
    // unsubscribe
    DocumentClassificationRequest.off(PCCViewer.EventType.DocumentClassificationCompleted, onDocumentClassificationCompleted);
    
    // handler declaration
    function onDocumentClassificationCompleted(ev) {
        alert("Document classification completed!");
    }
    
    

    Parameters:

    Name Type Description
    eventType string

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

    handler function

    The function that was previously subscribed to the event type.

    Returns:

    The DocumentClassificationRequest object on which this method was called.

    Type
    PCCViewer.DocumentClassificationRequest

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

    Subscribe a handler to an event of the DocumentClassificationRequest.

    Example

    // subscribe
    DocumentClassificationRequest.on(PCCViewer.EventType.DocumentClassificationCompleted, onDocumentClassificationCompleted);
    
    // handler declaration
    function onDocumentClassificationCompleted(ev) {
        alert("Document classification 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 DocumentClassificationRequest object on which this method was called.

    Type
    PCCViewer.DocumentClassificationRequest

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