01.06.2013 Views

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

OpenEdge Development: Mobile Applications - Product ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

progress.data.Session class<br />

progress.data.Session class<br />

Constructor<br />

The progress.data.Session is a JavaScript class that can manage user<br />

authentication and session identification information in HTTP/S messages sent<br />

between progress.data.JSDO objects (JSDOs) running in an <strong>OpenEdge</strong> <strong>Mobile</strong> App<br />

and <strong>Mobile</strong> services running on a Web server. The authentication information includes<br />

a user ID and password (user credentials). The session identification information<br />

includes a URI, which identifies the <strong>Mobile</strong> Web application that provides the REST<br />

transport between its defined set of <strong>Mobile</strong> services and the client that accesses them,<br />

and a session ID, which identifies the user login session for the entire set of <strong>Mobile</strong><br />

services supported by the <strong>Mobile</strong> Web application.<br />

To start a user login session, you can either allow the Web browser or hybrid<br />

application wrapper to complete the user login process or invoke the login( ) method<br />

on a Session object that you have instantiated, passing as parameters the <strong>Mobile</strong> Web<br />

application URI, optional user credentials, and an optional specified <strong>Mobile</strong> Web<br />

application resource (such as a static HTML page) to authenticate access. Once<br />

started, a login session for a <strong>Mobile</strong> Web application supports all <strong>Mobile</strong> services that<br />

the application provides, each of which can provide one or more <strong>Mobile</strong> resources.<br />

Each <strong>Mobile</strong> service provided by a <strong>Mobile</strong> Web application relies on a separate JSDO<br />

catalog file to define the communications between its <strong>Mobile</strong> resources and the JSDOs<br />

that access them from the client. Once a user login session is established for a <strong>Mobile</strong><br />

Web application, you can use its Session object to load the catalog for each <strong>Mobile</strong><br />

service provided by the Web application. Once the JSDO catalog is loaded for the<br />

<strong>Mobile</strong> service, you can instantiate a JSDO to access any <strong>Mobile</strong> resource provided by<br />

the service in the catalog. If required, the authentication information for the session is<br />

also used to authorize access to the <strong>Mobile</strong> resource by its JSDO.<br />

All JSDOs can thus rely on a single Session object to manage the user login session<br />

for all <strong>Mobile</strong> services and their resources provided by a single <strong>Mobile</strong> Web application.<br />

This single Session object then manages the session life cycle from startup (login) to<br />

shutdown (logout) for all JSDOs of a <strong>Mobile</strong> App and the <strong>Mobile</strong> services they access<br />

from the same <strong>Mobile</strong> Web application.<br />

progress.data.Session ( )<br />

Instantiates a Session object that you can use to start a user login session for a <strong>Mobile</strong><br />

Web application and load the JSDO catalog for each supported <strong>Mobile</strong> service whose<br />

resources are accessed using JSDOs.<br />

164 <strong>OpenEdge</strong> ® <strong>Development</strong>: <strong>Mobile</strong> <strong>Applications</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!