<html class="ws-fullscreen" lang="en"> <head> <link rel="stylesheet" href="http://<webclient-host-and-port>/<application_path>/css/style.css"/> </head> ... <div class="webswing-element" data-webswing-instance="webclientInstance"> <div id="loading" class="ws-modal-container"> <div class="ws-login"> <div class="ws-login-content"> <div class="ws-spinner"><div class="ws-spinner-dot-1"></div> <div class="ws-spinner-dot-2"></div></div> </div> </div> </div> </div> ... <script data-webswing-global-var="webclientControl"> var webclientInstance= { options: { autoStart: true, syncClipboard: true, args: '', connectionUrl:'http://<webclient-host-and-port>/<application_path>' } } (function (window, document) { var loader = function () { var baseUrl = 'http://<webclient-host-and-port>/<application_path>'; baseUrl = baseUrl.indexOf("/", baseUrl.length - 1) !== -1 ? baseUrl : (baseUrl + "/"); var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == XMLHttpRequest.DONE) { var version = xmlhttp.status == 200 ? xmlhttp.responseText : "undefined"; var script = document.createElement("script"), tag = document.getElementsByTagName("script")[0]; script.src = baseUrl + "javascript/webswing-embed.js?version=" + version; tag.parentNode.insertBefore(script, tag); } }; xmlhttp.open("GET", baseUrl + "rest/version", true); xmlhttp.send(); }; window.addEventListener ? window.addEventListener("load", loader, false) : window.attachEvent("onload", loader); })(window, document); </script> |
configure(options) | configures this WebClient instance. This function reads the options from <data-webswing-instance_value>.config (ie. webclientInstance.options) global variable if exists. Argument options is object with following properties: • autoStart - tells WebClient to execute configure() and start() right after the instance is initialized. If it is false, start() function has to be triggered manually. • syncClipboard - tells WebClient to interact with the system clipboard in order to enable the Paste option in the context menu of input fields (not supported by all browsers). • autoReconnect - number of milliseconds to wait until connection auto-retry when disconnected • disableLogout - removes Logout button from all dialogs • args - additional Java application arguments. Appended to those defined in configuration • recording - record this application session (default: false) • clientId - set the clientId, used with mirror session or to continue running session • mirror - for starting a mirror session. Only admin role is allowed to use this (default: false) • connectionUrl - base URL for connecting to websocket service (default: current location url) • recordingPlayback - file for session recording playback. Only the admin role is allowed to use this |
disconnect() | disconnects the current WebClient session, but leaving the swing application running |
logout() | disconnects the current WebClient session and logs user out |
kill() | disconnects the current WebClient session with stopping the COBOL application |
setControl(boolean) | enables/disables the control of application. If set to false, no user events are sent to the COBOL application |
start() | this will initiate the connection to Webclient server and start the COBOL application. If the autoStart is set to false or not defined in config object, the start function has to be called manually, otherwise the WebClient will call start function automatically |
repaint() | notify the WebClient server that the application needs repaint |
instanceId() | get the instanceId of the currently running instance |
getConnectionInfo() | get information about current connection |