Smartpoint Cloud Connector Selectors

getTerminalRawText: Retrieve the terminal content.

Payload

Copy
 {
        id = "1234567",
        type = "selector",
        operation = "getTerminalRawText",
        windowNumber = "1"
    }

getTerminalTravelportSessionId: Get Travelport+ Session ID of the connection used for the given window.

Payload

Copy
 {
        id = "1234567",
        type = "selector",
        operation = "getTerminalTravelportSessionId",
        windowNumber = "1"
    }

getAccessGroupId: Get the Access Group identifier of the connection used for the given window.

Payload

Copy
 {
        id = "1234567",
        type = "selector",
        operation = "getAccessGroupId",
        windowNumber = "1"
    }

getWorkAreaAvailable: Get the first available workarea of the connection used for the given window.

Payload

Copy
 {
        id = "1234567",
        type = "selector",
        operation = "getWorkAreaAvailable",
        windowNumber = "1"
    }

getLastTerminalEntry: Gets the last terminal entry sent for the given window.

Payload:

Copy
{
        id = "1234567",
        type = "selector",
        operation = "getLastTerminalEntry",
        windowNumber = "1"
    }

getLastTerminalResponse: Gets the last terminal response received for the given window.

Payload:

Copy
{
        id = "1234567",
        type = "selector",
        operation = "getLastTerminalResponse",
        windowNumber = "1"
    }

getWindowsNumbers: Gets the number of all existing windows.

Payload:

Copy
{
        id = "1234567",
        type = "selector",
        operation = "getWindowsNumbers",
    }

isWindowCreated: Returns true if the specified window already exists or false if it does not.

Payload:

Copy
{
        id = "1234567",
        type = "selector",
        operation = "isWindowCreated",
        windowNumber = "1"
    }

 

 

Example

Copy
/// <summary>
/// Send getTerminalRawText selector message
/// </summary>
private void GetTerminalRawText()
{
    await webView.EnsureCoreWebView2Async(null);

    webView.CoreWebView2.WebMessageReceived += CoreWebView2_WebMessageReceived;

    var message = new MessageRequest
    {
        id = Guid.NewGuid().ToString(),
        type = "selector",
        operation = "getTerminalRawText",
        windowNumber = "1"
    };

    webView.CoreWebView2.PostWebMessageAsJson(JsonConvert.SerializeObject(message));
}

/// <summary>
/// Receive message from webview
/// </summary>
/// <param name="sender">The webview</param>
/// <param name="e">The web message received event</param>
private async void CoreWebView2_WebMessageReceived(object? sender, CoreWebView2WebMessageReceivedEventArgs e)
{
    dynamic message = JsonConvert.DeserializeObject(e.WebMessageAsJson);

    // Message received:
    // {
    //      "id":"52b6f7f8-36c8-4304-a84f-f04ba260e9ad",
    //      "success":true,
    //      "type":"selector",
    //      "operation":"getTerminalRawText","
    //      result":"\nSIGN-ON COMPLETE/ABCDE/26JUN/PR - NOT AUTHORISED - GALILEO \n(C)1989-2023 TRAVELPORT\n>"
    // }

    // Process the message from the JavaScript application
    Console.WriteLine("Received terminal raw text: " + message.result);
}