Global

Type definitions

connectionParams

Configuration options to create the session.

Type

  • Object

Properties

Name Type Attributes Description
launchType String Takes “message” or “embed” as a value. Defaults to “message”. “message” - launches the session in a new window (similar to session launch using Workspace app for Chrome). “embed” - Embeds the session inside the third party Chrome app.
container Object Appview element created inside the third party Chrome app. Applicable only when launchType is “embed”.
bounds Object Sets a fixed width and height to the session. See bounds for the properties associated with this property.
preferredLang String Specifies the preferred language code to be used inside the session. If the language code specified is either invalid or unsupported then it falls back to en. Supported language codes: en, de, es, fr, ja, ko, ru, zh, zh-cn, zh-tw. If the value is unspecified then the browser’s language code is used.
preferences Object JSON to hide/show toolbar or individual toolbar items, suppressing the FTU, URLRedirection and error dialog.Refer to the example below.

bounds

Name Type Description
autoresize Boolean Should be set to false to give a fixed width and height to the session. By default, this value is set to true in which case the session is resized to match the size of the appview element inside the third party Chrome app or the new window.
width Number Width of the session specified in pixels. This value is set only when auto resize is set to false.
height Number Height of the session specified in pixels. This value is set only when auto resize is set to false.

Example


    var connectionParams = {
        "launchType" : "embed",
        "container": appView,
        "bounds" :{
            "autoresize":false,
            "width": "800",
            "height":"600"
        },
        "preferredLang" : "ja", //Setting to Japanese
        "preferences" : {
            "ui" : {
                'toolbar' : {
                    "menubar":true, //false - hides the toolbar
                    "clipboard":true, //false - hides the clipboard button from toolbar            
                    "fileTransfer":true, //false - hides the file upload and download buttons from toolbar
                    "about":true, //false - hides the about button from toolbar
                    "lock":true, //false - hides the ctrl+alt+del button from toolbar
                    "disconnect":true, //false - hides the disconnect button from toolbar
                    "logoff":true, // false - hides the logoff button from toolbar
                    "fullscreen":true, //false - hides the fullscreen button from toolbar
                    "keyboard":true, //false - hides the keyboard button from toolbar, this button appears only in touch devices
                    "multitouch":true, //false - hides the multitouch button from toolbar, this button appears only in touch devices
                    "switchApp":true, //false - hides the switchApp button from toolbar, this button appears only for apps session
                    "preferences":true, //false - hides the preferences button from toolbar
                    "gestureGuide":true //false - hides the gestureGuide button from toolbar, this button appears only in touch devices
                },
                "hide":{
                    "urlredirection" : false, //true - hides the urlredirection dialog shown by HTML5 Engine
                    "error" : false, //true - hides the error dialog shown by HTML5 Engine
                    "ftu" : false //true - hides the FTU(first time user dialog) shown by HTML5 Engine
                },
                "appSwitcher": {
                    "showTaskbar": true, //false - disables the desktop appSwitcher/taskbar seen at the bottom 
                    "autoHide": false, //true - selects the Auto Hide checkbox present in the context menu of desktop appSwitcher/taskbar at the bottom  
                    "showIconsOnly": false //true - selects the Show Icons only checkbox present in the context menu of desktop appSwitcher/taskbar at the bottom  
                }
            }
        }
    }
<!--NeedCopy-->

eventListener(event)

Listener to handle the events.

Parameters

Name Type Description
event Object Object as appropriate to the eventType registered.

Properties

Name Type Description
event.id String ID of the session object
evebt.type String Event type triggered
event.data Object Data as appropriate to the event triggered. Includes onConnection, onConnectionClosed, onURLRedirection, and onError.

onSessionCreated(sessionObject)

Callback having the session object created.

Parameters

Name Type Description
sessionObject Session Session object to interact with the session like start the session, register and handle events, and to disconnect the session.

Example

function sessionCreated(sessionObject) {
//Handle session interactions like events, start, disconnect here.
//ICADATA has been constructed for example. Recommending to use StoreFront/WebInterface SDK to get ICA.
//Refer session.start() for more details.
    var icaData = {
        "Domain":"abcd",
        "ClearPassword":"xxxxxxxxx",
        "InitialProgram":"#Desktop",
        "Title":"Desktop",
        "Address":"xx.xx.xx.xx",
        "Username":"xyz"
    };
    var launchData = {"type" :"json",value :icaData};

    function sessionResponseCallback(response) {
        console.log("start", response);
    }

    sessionObject.start(launchData,sessionResponseCallback);
}
<!--NeedCopy-->

responseCallback(response)

Callback that handles the response.

Parameters

Name Type Description
response Object Response object

Properties

Name Type Description
response.success Boolean Status of the method call. Holds the value true if successful and false if unsuccessful. If there is a failure, the details of the error are set in the response object.
response.sessionId String Id of the session.
response.error String Reason for the failure of the method call.
Global