The plug-in should provide this interface in window.acrolinxPlugin. These functions are called by the AcrolinxSidebar.

interface AcrolinxPlugin {
    log?(logEntry: LogEntry): void;
    onCheckResult(checkResult: CheckResult): void;
    onInitFinished(finishResult: InitResult): void;
    onLiveSearchFailed?(query: string): void;
    onLiveSearchResults?(liveSearchResult: LiveSearchResult): void;
    onTargetChanged?(supportsLive: boolean): void;
    onUILanguageChanged?(UILanguage: string): void;
    openDocumentInEditor?(documentIdentifier: string): void | Promise<void>;
    openLivePanel?(): void;
    openLogFile?(): void;
    openWindow(openWindowParameters: OpenWindowParameters): void;
    replaceRanges(checkId: string, matchesWithReplacements: MatchWithReplacement[]): void;
    requestCheckForDocumentInBatch?(documentIdentifier: string): void;
    requestGlobalCheck(options?: RequestGlobalCheckOptions): void;
    requestInit(): void;
    selectRanges(checkId: string, matches: Match[]): void;
    showServerSelector?(): void;
}

Methods

  • Notifies the AcrolinxPlugin that a check has finished. If a global check has been performed, that's a good time to clean up states belonging to previous checks.

    Parameters

    Returns void

  • The sidebar has finished initialization. Now the sidebar is ready for checking.

    Parameters

    • finishResult: InitResult

      Can contain an error if the initialization failed.

    Returns void

  • Notifies the AcrolinxPlugin that live search for an input query has failed.

    Parameters

    • query: string

      The query on which the search has failed.

    Returns void

  • Notifies the AcrolinxPlugin that a live search has finished.

    Parameters

    Returns void

  • Notifies the AcrolinxPlugin that the user has selected a target that supports live.

    Parameters

    • supportsLive: boolean

      True if the selected target supports live, false otherwise.

    Returns void

  • Notifies the AcrolinxPlugin that the user has changed the UI langauge in the sidebar.

    Parameters

    • UILanguage: string

      The selected UI language

    Returns void

  • A batch check has started and the user has clicked on a card. The AcrolinxPlugin is requested to open the corresponding document.

    Parameters

    • documentIdentifier: string

      Identifier of the document to open.

    Returns void | Promise<void>

  • the user has clicked on the button to open live panel. The AcrolinxPlugin is requested to open the live panel.

    Returns void

  • This method should open the log file.

    Returns void

  • The integration should replace the matches belonging to the check of the checkId by its replacements.

    Note that in most cases you are able to reuse much of the implementation for selectRanges.

    Parameters

    • checkId: string

      The id of the check. You get the id as result of checkGlobal.

    • matchesWithReplacements: MatchWithReplacement[]

      The parts of the document, which should be replaced and its replacements.

    Returns void

  • A batch check has started and the AcrolinxPlugin is requested to call AcrolinxSidebar.checkDocumentInBatch() for the document under check.

    Parameters

    • documentIdentifier: string

      Identifier of the document to be checked.

    Returns void

  • The check button has been pushed and the AcrolinxPlugin is requested to call AcrolinxSidebar.checkGlobal(). If the plugin supports checkSelection (InitParameters.supported.checkSelection), option "selection" will be set and contains a hint if the plugin should send the current selection when calling AcrolinxSidebar.checkGlobal(). Similarly if the plugin supports batchCheck (InitParameters.supported.supportsBatchChecks), option "batchCheck" will be set and the plugin should call AcrolinxSidebar.initBatchCheck().

    Parameters

    Returns void

  • The sidebar has loaded and requests the AcrolinxPlugin to call acrolinxSidebar.init().

    Returns void

  • The integration should highlight and focus the matches belonging to the check of the checkId. For selecting ranges, different strategies can be applied. A short overview:

    1. Search: You just search for the content-attributes of the matches. The search can be improved by some fuzzy matching and adding some characters from before and after the match to the search string. pro: easy in a simple version, more or less stateless - con: fuzzy

    2. Mapping: At the time you call check, you keep the document content and create a one to one mapping between the document you checked and the document in your editor. This mapping needs to be kept up to date. Some editors provide interfaces to easily implement that. pro: up to 100% exact - con: can be difficult or impossible to implement, can be slow, requires a lot of memory

    3. Indexing: Before calling check, you scatter indices in the document, which can be kept in source as well as in the requested document. These indices reduce the search space later on, so that your search will be faster and more precise. pro: fast, up to 100% precise - con: invasive, changes the source document

    4. Combinations: You can combine all these methods to improve the positive aspects and reduce the negative aspects of each strategy.

    Note: Implementing this function will be one of your core tasks while developing an Acrolinx integration.

    Parameters

    • checkId: string

      The id of the check. You get the id as result of checkGlobal.

    • matches: Match[]

      The parts of the document which should be highlighted.

    Returns void

  • Returns void