Session Connection

Lite Client

Starting a Lite Client Session

A Lite Client session connection is created by calling the proiv.startPROIVSession function in the Lite Client library. This function has a single parameter which is an object holding the properties required for the connection. The function returns a unique key for the session.

   var sessionkey = proiv.startPROIVSession({
      sessionNodeID: "SESSION_NODE_ID",
      URI: "CONNECTION_URI",
      connectionData: { service: "CLIENT_SERVICE" }
   });

sessionNodeID - The ID of the browser node that will hold the PROIV session.
URI - The URI of the connection servlet (typically just "/connect").
service - This is the name of a Client Service defined in the Client Connector in the PROIV dashboard ("Default" is the default service name).

The Lite Client uses a single browser node to hold all the components in a session. This means that more than one PROIV session can be in the same browser page. Each session must be given a separate browser node. There is no interaction between the sessions but the developer could write JavaScript in the page that uses OpenAjax (see Lite Client and Open Ajax for details) to pass messages between the sessions.

The Lite Client has the concept of the "Active Session". This is the session that had the most recent user activity (e.g. click on a component or edit an input field) or it can be set by a function call (proiv.setActivePROIVSession(sessionKey)).

Stopping a Lite Client Session

A Lite Client session connection is stopped by calling the proiv.stopPROIVSession function in the Lite Client library. This is a request to PROIV to stop the current session. PROIV may not allow this. This function has the following parameters.

sessionKey - The session key. If null the current active session is ended.
timeout - The number of seconds to wait before calling the failure callback.
successCallback - A function to call when the session has ended (can be null).
failureCallback - A function to call if session has not ended when the timeout expires (can be null).

An alternative way of stopping the Lite Client session connection is by calling the proiv.endPROIVSession function in the Lite Client library. This function does not wait for PROIV to close the session, it just tells PROIV the session is closed and stops communicating. This function has the following parameters.

sessionKey - The session key. If null the current active session is ended.

Comment on this topic

Topic ID: 870029