OpenEdge Development: Mobile Applications - Product ...
OpenEdge Development: Mobile Applications - Product ...
OpenEdge Development: Mobile Applications - Product ...
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
progress.data.JSDO class<br />
progress.data.JSDO class<br />
The progress.data.JSDO is a JavaScript class that provides access to ABL<br />
application services as <strong>OpenEdge</strong> <strong>Mobile</strong> resources. A single progress.data.JSDO<br />
object (JSDO) provides access to one <strong>Mobile</strong> resource in an <strong>OpenEdge</strong> <strong>Mobile</strong> service.<br />
A <strong>Mobile</strong> resource maps to an ABL singleton procedure or class running on an<br />
<strong>OpenEdge</strong> AppServer. The JSDO provides application-oriented, JavaScript methods<br />
to invoke the internal procedures, user-defined functions, or methods (ABL routines) of<br />
the corresponding singleton procedure or class. A <strong>Mobile</strong> resource maps specified ABL<br />
routines as one of several supported <strong>Mobile</strong> operation types, each of which<br />
corresponds to a particular method of the JSDO.<br />
You identify how a JSDO maps JavaScript methods to operations of a given <strong>Mobile</strong><br />
resource by adding annotations to the singleton procedure or class source code. These<br />
annotations define a <strong>Mobile</strong> interface for accessing the procedure or class as a <strong>Mobile</strong><br />
resource. You can define a <strong>Mobile</strong> interface using features of Progress Developer<br />
Studio for <strong>OpenEdge</strong> (Developer Studio) in two ways: 1) when creating an ABL<br />
Business entity class, which supports common business operations on data models,<br />
and 2) for any existing ABL singleton class or procedure, whether or not the singleton<br />
accesses a separate Business entity object.<br />
You can also use Developer Studio to define a <strong>Mobile</strong> resource as part of a <strong>Mobile</strong><br />
service, and to generate the <strong>Mobile</strong> service together with the client-side artifacts<br />
required to create a corresponding JSDO for the resource. These client-side artifacts<br />
include a JSDO catalog file that identifies how a JSDO that you create can access the<br />
corresponding <strong>Mobile</strong> resource using methods of the JSDO.<br />
At run time, the JSDO maintains local storage for managing temp-table data that is<br />
exchanged between the AppServer and JavaScript client, and it provides methods to<br />
read and write the data in JSDO local storage as individual JavaScript record objects.<br />
To support this data exchange, a <strong>Mobile</strong> resource can be organized into basic<br />
operation types that include built-in create, read, update, and delete (CRUD)<br />
operations, and non-built-in invoke operations. The built-in <strong>Mobile</strong> operations can<br />
operate on a single temp-table or on a single ProDataSet containing one or more<br />
temp-tables. Each built-in operation type maps to a corresponding built-in method of<br />
the JSDO. The records of each temp-table are presented as an array of record objects,<br />
which the built-in methods use to exchange the data with the AppServer. The built-in<br />
methods, through their corresponding operation types, support the common business<br />
operations that can be generated directly from an ABL Business entity. Other methods<br />
of the JSDO provide access to individual record objects of JSDO local storage. Based<br />
on the results of its methods, the JSDO also maintains a working record for each<br />
temp-table in its local storage that you can access directly using table and field<br />
references (see the notes). Thus, using the methods of a JSDO and its table<br />
references, you can interact with a corresponding <strong>Mobile</strong> resource in a consistent<br />
manner from one resource (and its corresponding JSDO) to another.<br />
A JSDO also supports non-built-in invoke operations that allow specific ABL routines<br />
to be exposed in a <strong>Mobile</strong> resource and executed as corresponding JavaScript<br />
methods. You can do this in Developer Studio by annotating ABL routines specifically<br />
as invoke operations. You can then call each ABL routine annotated as an invoke<br />
operation using a unique invocation method on the JSDO. Note that data exchanged<br />
between the AppServer and client using invoke operations is not automatically stored<br />
in JSDO local storage. It is initially accessible only through parameters and return<br />
values of the invocation methods provided by the JSDO. You can subsequently use<br />
JSDO methods for accessing JSDO local storage to exchange data between the<br />
invocation methods and local storage, which is maintained and synchronized with the<br />
AppServer using the JSDO built-in methods.<br />
<strong>OpenEdge</strong> ® <strong>Development</strong>: <strong>Mobile</strong> <strong>Applications</strong> 155