Data type mappings for Data Object Services : OpenEdge ABL to JavaScript data type mappings
  

OpenEdge ABL to JavaScript data type mappings

A JSDO communicates with an OpenEdge application server through a Data Object Service to marshal ABL data for parameters (and return values) of ABL routines that pass the following ABL data types: ProDataSets, temp-tables, arrays, and primitive values. The JSDO provides this ABL data to the mobile app programmer as JavaScript data. For more information on ABL data types, see the reference entry on data types in OpenEdge Development: ABL Reference. For more information on the format and use of JavaScript data types, you can review sources on the web, such as http://www.w3schools.com/js/js_datatypes.asp. For more information on JSDOs and how they communicate with an OpenEdge application server through a Data Object Service, see progress.data.JSDO class.
The following table shows the mappings between the supported ABL data types in an OpenEdge Data Object resource and the JavaScript data types of corresponding table fields and invocation method parameter values in a JSDO. These data type conversions happen in the server-side Data Object when the JSDO invokes a resource operation that exchanges data between the JSDO and its OpenEdge resource using the fill( ), saveChanges( ), or any invocation method.
Note: An ABL data item or Invoke routine output parameter that is set to the Unknown value (?) maps to the JavaScript null value when sent from the OpenEdge Data Object resource to the JSDO, and a JSDO data item or invocation method input parameter value that is set to null maps to the ABL Unknown value (?) when sent from the JSDO to the OpenEdge Data Object resource. The ABL BLOB and CLOB are only allowed as fields of temp-table parameters, and their respective equivalents, MEMPTR and LONGCHAR, are only allowed as scalar parameters or as elements of Array parameters.
Table 41. OpenEdge ABL data type mappings
ABL data type
JavaScript data type
BLOB1
string (Base64 encoded)
CHARACTER
string
CLOB2
string
COM-HANDLE
number
DATASET3
An Object that maps to a ProDataSet and contains one or more Object instances, each of which maps to an ABL temp-table in the ProDataSet (see TEMP-TABLE)
DATE4
string (ISO 8601 formatted string of the form "yyyy-mm-dd")
DATETIME5
string (ISO 8601 formatted string of the form "yyyy-mm-ddThh:mm:ss.sss")
DATETIME-TZ6
string (ISO 8601 formatted string of the form "yyyy-mm-ddThh:mm:ss.sss+hh:mm")
DECIMAL
number
primitive EXTENT7
Where primitive is an ABL primitive data type (not a DATASET or TEMP-TABLE), maps to an Array of the JavaScript primitive data type that maps to the corresponding ABL primitive data type
HANDLE
number
INT64
number
INTEGER
number
LOGICAL
boolean (true or false)
LONGCHAR8
string
MEMPTR9
string (Base64 encoded)
RAW
Not supported
RECID
Not supported
ROWID
string (Base64 encoded)
TEMP-TABLE10
An Object that contains a single Array of Object instances, where each Object in the Array maps to a record in the corresponding temp-table

1 In temp-tables only.

2 In temp-tables only.

3 ABL ProDataSets, temp-tables, and arrays map to JavaScript objects and arrays using a structure that is identical to the OpenEdge-supported mapping to JSON objects and arrays. JSON (JavaScript Object Notation) is a character representation of JavaScript data types that is often used as a lightweight alternative to XML. For more information on ABL support for JSON, including the JSON representation of these ABL data types, see OpenEdge Development: Working with JSON.

4 See Date and time conversions.

5 See Date and time conversions.

6 See Date and time conversions.

7 ABL ProDataSets, temp-tables, and arrays map to JavaScript objects and arrays using a structure that is identical to the OpenEdge-supported mapping to JSON objects and arrays. JSON (JavaScript Object Notation) is a character representation of JavaScript data types that is often used as a lightweight alternative to XML. For more information on ABL support for JSON, including the JSON representation of these ABL data types, see OpenEdge Development: Working with JSON.

8 As scalar parameters or elements of Array parameters only.

9 As scalar parameters or elements of Array parameters only.

10 ABL ProDataSets, temp-tables, and arrays map to JavaScript objects and arrays using a structure that is identical to the OpenEdge-supported mapping to JSON objects and arrays. JSON (JavaScript Object Notation) is a character representation of JavaScript data types that is often used as a lightweight alternative to XML. For more information on ABL support for JSON, including the JSON representation of these ABL data types, see OpenEdge Development: Working with JSON.

Date and time conversions

In the JSDO, all ABL DATE, DATETIME, and DATETIME-TZ data types are mapped to a string in the ISO 8601 format shown in the previous table. This format supports all the necessary functionality for these data types (date, time, and time zone data). However, if you read and convert (Output) this string from the JSDO to a JavaScript Date object, or write (Input) the value of a JavaScript Date object to the JSDO as a similarly ISO 8601-formatted string, the JSDO processes the value differently based on the original ABL data type in the OpenEdge resource, as shown in the following table:
Table 42. JavaScript Date object conversions to and from ISO 8601 strings
ABL data type
Process
DATE
Output: Client time zone is used. Time is set to 0 (midnight).
Input: Time and time zone information is ignored.
DATETIME
Output: Client time zone is used.
Input: Time zone information is ignored
DATETIME-TZ
Output and Input: Date, time, and time zone is preserved.
Note: This same processing occurs whether for reading and writing data on the OpenEdge server as part of Data Object Read (Output), Create (Input), and Update (Input) operations, or for reading and writing data on the server through the parameters (Output and Input) and return values (Output) of Invoke operations.
Note: This date and time conversion supports Kendo UI clients that access the JSDO as a remote data service using the JSDO dialect of the Kendo UI DataSource, which works with JSDO date and time data as JavaScript Date objects. For more information, see Using the JSDO dialect of the Kendo UI DataSource .