The sidebar will provide this interface in window.acrolinxSidebar.

interface AcrolinxSidebar {
    checkDocumentInBatch?(documentIdentifier: string, documentContent: string, options: CheckOptions): void;
    checkGlobal(documentContent: string, options: CheckOptions): Check;
    configure(configuration: SidebarConfiguration): void;
    init(initParameters: InitParameters): void;
    initBatchCheck?(documentIdentifiers: BatchCheckRequestOptions[]): void;
    invalidateRanges(invalidCheckedDocumentRanges: CheckedDocumentPart[]): void;
    liveSearch?(query: string): void;
    onGlobalCheckRejected(): void;
    onVisibleRangesChanged(checkedDocumentRanges: CheckedDocumentPart[]): void;
    showMessage(message: Message): void;
}

Methods

  • Initiates a check for the document with the given document identifier.

    Parameters

    • documentIdentifier: string

      Identifier for the document to be checked.

    • documentContent: string

      The document to be checked.

    • options: CheckOptions

      Check options.

    Returns void

  • Perform a check of the whole document. Once the check is done, AcrolinxPlugin.onCheckResult will be notified.

    acrolinxSidebar.checkGlobal('<sample>my text</sample>', {
    inputFormat: 'XML',
    requestDescription: {
    documentReference: 'myfile.xml'
    }
    });

    Parameters

    • documentContent: string

      The document you want to check.

    • options: CheckOptions

    Returns Check

    Object containing the ID of the check.

  • Configures the sidebar with the specified parameters. This method can be called repeatedly after init was called.

     acrolinxSidebar.configure({
    readOnlySuggestions: true
    });

    Parameters

    Returns void

  • Initializes the sidebar with the specified initParameters. After calling this method, the sidebar will become ready for checking and call onInitFinished.

     acrolinxSidebar.init({
    clientSignature: 'sdfasdfiIOJEIEJIOR',
    clientComponents: [{
    id: 'com.acrolinx.myEditor'
    name:'Acrolinx for myEditor',
    version:'1.0.0.42'
    }]
    });

    Parameters

    Returns void

  • Perform a batch check of the document components.

    Parameters

    Returns void

  • This function can be used to invalidate check result cards that link to invalid parts of the document. That can happen due to changes or deletions in the document.

    Parameters

    • invalidCheckedDocumentRanges: CheckedDocumentPart[]

      checkIds and offsets belonging to a previous performed check.

    Returns void

  • Perform a search for suggestions with the given query .

    Parameters

    • query: string

      The query on which to perform a search for suggestions.

    Returns void

  • Returns void

  • Notify the sidebar of the currently displayed part of the document.

    Parameters

    Returns void

  • Show a message in the Sidebar. Supported since Acrolinx Platform 2021.2 (Sidebar version 14.28).

    Parameters

    • message: Message

      The message to show.

    Returns void