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

    PCCViewer. DocumentQueryRequest

    (protected) new DocumentQueryRequest()

    The DocumentQueryRequest object is created when querying a document. It triggers events to indicate document query progress and it has properties to get the response and status.

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

    Example

    // A DocumentQueryRequest object is created by and returned from the call to the queryDocument method
    var documentQueryRequest = viewerControl.queryDocument('What is the main theme?');
    
    

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

    Returns a string of the query response produced by this DocumentQueryRequest.

    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

    getErrorCode() → {number}

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

    Example

    var errorCode = documentQueryRequest.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 = documentQueryRequest.getErrorMessage();
    
    

    Returns:

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

    Type
    string

    getResponse() → {string}

    Returns a string of the query response produced by this DocumentQueryRequest.

    Example

    var response = documentQueryRequest.getResponse();
    
    

    Returns:

    A plain text response for the document query.

    Type
    string

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

    Unsubscribe a handler from an event of the DocumentQueryRequest.

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

    Example

    // subscribe
    DocumentQueryRequest.on(PCCViewer.EventType.DocumentQueryCompleted, onDocumentQueryCompleted);
    
    // unsubscribe
    DocumentQueryRequest.off(PCCViewer.EventType.DocumentQueryCompleted, onDocumentQueryCompleted);
    
    // handler declaration
    function onDocumentQueryCompleted(ev) {
        alert("Document query completed!");
    }
    
    

    Parameters:

    Name Type Description
    eventType string

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

    handler function

    The function that was previously subscribed to the event type.

    Returns:

    The DocumentQueryRequest object on which this method was called.

    Type
    PCCViewer.DocumentQueryRequest

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

    Subscribe a handler to an event of the DocumentQueryRequest.

    Example

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

    Type
    PCCViewer.DocumentQueryRequest

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