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.

Chapter 4: Creating <strong>Mobile</strong> Apps using JSDOs<br />

• Request object — Contains data both sent in HTTP requests for <strong>Mobile</strong><br />

operations when they are executed and returned in HTTP responses when the<br />

<strong>Mobile</strong> operation execution completes, as described in this “JSDO overview”<br />

section. For more information, see the “Accessing built-in CRUD operations”<br />

section on page 106 and the “Accessing non-built-in invoke operations” section on<br />

page 115.<br />

• A set of JSDO services built into the <strong>Mobile</strong> App Builder — For mapping<br />

JSDO data to any HTML page elements you can create, and supporting the<br />

marshalling of that data between the Web page and <strong>Mobile</strong> operations. For more<br />

information, see the “Getting started with the <strong>Mobile</strong> App Builder” section on<br />

page 90.<br />

• progress.ui.UIHelper class — Provides basic features for mapping JSDO data<br />

to Web page elements in <strong>Mobile</strong> Apps built with HTML tools other than the <strong>Mobile</strong><br />

App Builder. For more information, see the “Getting started with other HTML<br />

coding tools” section on page 122.<br />

How a JSDO maps to a <strong>Mobile</strong> resource<br />

A JSDO is an instance of the progress.data.JSDO JavaScript class that you create to<br />

access exactly one <strong>Mobile</strong> resource provided by a <strong>Mobile</strong> service. As described in<br />

Chapter 3, “Creating <strong>Mobile</strong> Services,” a <strong>Mobile</strong> resource provides access to either a<br />

single temp-table or a single ProDataSet with one or more temp-tables on an<br />

<strong>OpenEdge</strong> AppServer. The exact type of data that a <strong>Mobile</strong> resource provides depends<br />

on the data model selected to create the resource. A <strong>Mobile</strong> resource is also created<br />

with a set of built-in operations to access its data model. These can include a complete<br />

set of create, read, update, and delete operations (CRUD), or only a single read<br />

operation, depending on the options chosen to create the <strong>Mobile</strong> resource. In any case,<br />

the same basic set of <strong>Mobile</strong> operations access the data for every <strong>Mobile</strong> resource<br />

regardless of the data model it supports. The ABL routines that implement these<br />

operations have prescribed signatures that depend on the type of data model selected<br />

for the <strong>Mobile</strong> resource.<br />

The prescribed relationship between the built-in operations and the data model of a<br />

<strong>Mobile</strong> resource allows the JSDO class to provide a corresponding set of built-in<br />

JavaScript methods that implicitly map to the built-in operations of a <strong>Mobile</strong> resource,<br />

no matter what data model it supports. In addition, for every JSDO, the internal<br />

structure of the JSDO local storage reflects the schema of the particular data model<br />

supported by the <strong>Mobile</strong> resource. Therefore, the built-in methods of a JSDO work on<br />

the data in its local storage according to the schema defined for the supported data<br />

model.<br />

The basic unit of data for a <strong>Mobile</strong> resource is the temp-table record, which is<br />

represented in JSDO local storage as a JavaScript record object. The built-in create,<br />

update, and delete operations of a <strong>Mobile</strong> resource operate on one AppServer<br />

temp-table record at a time, according to the implementation of the corresponding ABL<br />

routines. The read operation returns a set of records from the AppServer for one or<br />

more temp-tables, depending on the data model. The set of records that the <strong>Mobile</strong><br />

read operation returns depends on the implementing ABL routine and an optional filter<br />

parameter that you pass to it from the <strong>Mobile</strong> App. The corresponding built-in JSDO<br />

methods call these operations accordingly, loading temp-table records into JSDO local<br />

storage from the AppServer, or creating, updating, and deleting records on the<br />

AppServer from posted changes to the record objects in JSDO local storage.<br />

92 <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!