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.
Chapter 1: <strong>OpenEdge</strong> <strong>Mobile</strong> Overview<br />
In Figure 3, a singleton Customers class object provides ABL methods to implement<br />
the operations of the Customers <strong>Mobile</strong> resource. The figure shows all the operations<br />
that are available for a <strong>Mobile</strong> resource. The standard, built-in <strong>Mobile</strong> operations are<br />
create, read, update, and delete (the familiar CRUD operations) and you can use<br />
Developer Studio to annotate ABL routines of the corresponding <strong>Mobile</strong> interface that<br />
implement them. For each built-in <strong>Mobile</strong> CRUD operation, you annotate only one ABL<br />
routine as the implementation, in this case an ABL method. All the ABL routines that<br />
implement the built-in <strong>Mobile</strong> operations must support exactly the same schema in the<br />
form of a single temp-table or ProDataSet parameter. In addition, the read operation<br />
implementation must provide an initial CHARACTER input parameter named filter (see<br />
Table 1). For non-built-in invoke operations, you can annotate any number of ABL<br />
routines using any supported ABL signature. (For more information on the supported<br />
ABL data types, see Appendix A, “ABL to JavaScript Data Type Mapping.”) However,<br />
the ABL routines you annotate as invoke operations cannot already be annotated to<br />
implement built-in CRUD operations.<br />
Table 1 shows the required parameter lists for ABL routines (class methods, internal<br />
procedures, or user-defined functions) that implement the built-in <strong>Mobile</strong> CRUD<br />
operations.<br />
Table 1: Required ABL parameters for built-in <strong>Mobile</strong> operations<br />
Built-in<br />
operation Required parameter list for the implementing ABL routine 1<br />
create INPUT-OUTPUT { TABLE table-name | DATASET dataset-name<br />
| TABLE-HANDLE table-hdl | DATASET-HANDLE dataset-hdl } 2<br />
read INPUT filter3 AS CHARACTER ,<br />
OUTPUT { TABLE table-name | DATASET dataset-name<br />
| TABLE-HANDLE table-hdl | DATASET-HANDLE dataset-hdl } 2<br />
update INPUT-OUTPUT { TABLE table-name | DATASET dataset-name<br />
| TABLE-HANDLE table-hdl | DATASET-HANDLE dataset-hdl } 2<br />
delete INPUT-OUTPUT { TABLE table-name | DATASET dataset-name<br />
| TABLE-HANDLE table-hdl | DATASET-HANDLE dataset-hdl } 2<br />
1. If the implementing ABL routine is a class method, its return type must be VOID. The return value of any<br />
ABL routine is ignored.<br />
2. Because all the built-in operations of a <strong>Mobile</strong> resource must support the same schema, their<br />
implementations all must share either a TABLE, TABLE-HANDLE, DATASET, or DATASET-HANDLE<br />
parameter with exactly the same temp-table or ProDataSet schema. NOTE: The schema for any<br />
ProDataSet (DATASET or DATASET-HANDLE) parameter can have no data-relations defined with the<br />
NESTED option.<br />
3. The filter parameter is passed as a query string that is intended to filter the records returned for the<br />
temp-table or ProDataSet parameter of a read operation. Your ABL routine can use this value for any<br />
purpose, or ignore the parameter entirely. Note that to allow the prescribed mapping to work between the<br />
ABL routine for the built-in read operation and the JavaScript method that calls it, you must name this<br />
parameter filter in the signature of the ABL routine.<br />
For information on coding and annotating these ABL routines, see Chapter 3, “Creating<br />
<strong>Mobile</strong> Services.”<br />
38 <strong>OpenEdge</strong> ® <strong>Development</strong>: <strong>Mobile</strong> <strong>Applications</strong>