Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
{div:style=}
Wiki Markup
Div
styledisplay:none

DO

NOT

EDIT

THE

CONTENT

OF

THIS

PAGE

DIRECTLY

(EXCEPT

INSIDE

THE

DIV

BELOW

WITH

ID=DESCRIPTION),

UNLESS

YOU

KNOW

WHAT

YOU'RE

DOING.


THE

STRUCTURE

OF

THE

CONTENT

IS

VITAL

IN

BEING

ABLE

TO

AUTO

UPDATE

THE

CONTENT

THROUGH

THE

DOC

GENERATOR.

\\ \\ Enter additional information related to this



Enter additional information related to this 'class'

inside

the

\

{div}

macro

with

'id=description'

{div} {div:id=description}{div}\\ {table:id=|class=servoy sReturnTypes}{tr:style=height: 30px;}{th}Return Types{th}{tr}{tr}{td}{span:class=sWordList}[OfflineDataDescription]{span}{td}{tr}{table}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[OfflineDataDescription]{td}{td}[#createOfflineDataDescription]\() Create a descriptive model for offline data.{td}{tr}{tbody}{tbody}{tr}{td}[OfflineDataDescription]{td}{td}[#createOfflineDataDescription]\(prefix) Create a descriptive model for offline data.{td}{tr}{tbody}{tbody}{tr}{td}[Array]{td}{td}[#getRowDescriptions]\(fs, pks) This method returns the description of rows as a json array object.{td}{tr}{tbody}{tbody}{tr}{td}void{td}{td}[#performSync]\(data, version, authenticateResult) If all the changes for a mobile client needs to come as once so that they can be in 1 transaction.{td}{tr}{tbody}{table}\\ {table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=createOfflineDataDescription}{tr:id=name}{td}h6.createOfflineDataDescription{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[OfflineDataDescription]{span}{span:style=font-weight: bold;}createOfflineDataDescription{span}{span}\(){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Create a descriptive model for offline data.{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[OfflineDataDescription]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}

Div
iddescription


HTML Table
id
classservoy sReturnTypes
Table Row (tr)
styleheight: 30px;
Table Head (th)
Return Types
Table Row (tr)
Table Cell (td)
Span
classsWordList
OfflineDataDescription

HTML Table
id
classservoy sSummary
Colgroup Tag
Column
padding0px
width80px

Column

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Body (tbody)
Table Row (tr)
Table Cell (td)
OfflineDataDescription
Table Cell (td)
#createOfflineDataDescription()
Create a descriptive model for offline data.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
OfflineDataDescription
Table Cell (td)
#createOfflineDataDescription(prefix)
Create a descriptive model for offline data.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
Array
Table Cell (td)
#getRowDescriptions(fs, pks)
This method returns the description of rows as a json array object.
Table Body (tbody)
Table Row (tr)
Table Cell (td)
void
Table Cell (td)
#performSync(data, version, authenticateResult)
If all the changes for a mobile client needs to come as once so that they can be in 1 transaction.

HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Column
padding0px
width100%

Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan1
Method Details
Table Body (tbody)
idcreateOfflineDataDescription
Table Row (tr)
idname
Table Cell (td)
createOfflineDataDescription
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
OfflineDataDescription
Span
stylefont-weight: bold;
createOfflineDataDescription
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create a descriptive model for offline data.
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
OfflineDataDescription
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

//plugins.mobile.getOfflineFoundSetData(foundset,null);
var data = plugins.mobileservice.createOfflineDataDescription('data_');
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=createOfflineDataDescription-String}{tr:id=name}{td}h6.createOfflineDataDescription{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[OfflineDataDescription]{span}{span:style=font-weight: bold;}createOfflineDataDescription{span}{span}\(prefix){span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}Create a descriptive model for offline data.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} prefix -- specified formname prefix used to retrieve row data from REST wise {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[OfflineDataDescription]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idcreateOfflineDataDescription-String
Table Row (tr)
idname
Table Cell (td)
createOfflineDataDescription
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
OfflineDataDescription
Span
stylefont-weight: bold;
createOfflineDataDescription
Span
(prefix)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Create a descriptive model for offline data.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{String} prefix – specified formname prefix used to retrieve row data from REST wise
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
OfflineDataDescription
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

//plugins.mobile.getOfflineFoundSetData(foundset,null);
var data = plugins.mobileservice.createOfflineDataDescription('data_');
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idgetRowDescriptions-JSFoundSet_ObjectArray
}{
Table Row (tr)
:
id
=
name
}{td}h6.getRowDescriptions{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
getRowDescriptions
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}[
Array
]{span}{span:style=
Span
stylefont-weight:
bold;
}
getRowDescriptions
{span}{span}\
Span
(fs,
pks)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}This method returns the description of rows as a json array object.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[JSFoundSet]} fs -- the foundset \{[Object]\[]} pks -- the array of pks {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Array]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
This method returns the description of rows as a json array object.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{JSFoundSet} fs – the foundset
{Object[]} pks – the array of pks
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
Array
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

/** @type {Array<Object>} */
var idsArray = new Array(100,200,300);
foundset.loadAllRecords();
var json = plugins.mobileservice.getRowDescriptions(foundset, idsArray)
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=
Table Row (tr)
classlastDetailRow
Table Cell (td)

Table Body (tbody)
idperformSync-Object_Number_Object
}{
Table Row (tr)
:
id
=
name
}{td}h6.performSync{td}{tr}{tr:id=sig}{td}{span:style=
Table Cell (td)
performSync
Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right:
5px;
}
void
{span}{span:style=
Span
stylefont-weight:
bold;
}
performSync
{span}{span}\
Span
(data,
version,
authenticateResult)
{span}{td}{tr}{tr:id=des}{td}{div:class=sIndent}If all the changes for a mobile client needs to come as once so that they can be in 1 transaction. Then the offline\_data form should define a ws\_update method. This method will then get the complete data package which should be give to this function. This will redispatch all the inserts,updates or deletes to the various data forms that has the real rest methods to handle the actual insert. If something fails then an Exception will be thrown and you can do a rollback so that everything of this sync is reverted.{div}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[Object]} data -- The data package that is given to the offline\_data form ws\_update method. \{[Number]} version -- The version number that is given to the offline\_data form ws\_update method. \{[Object]} authenticateResult -- The authenticateResult object that is given to the offline\_data form ws\_update method. (generated by the offline\_data.ws\_authenticate) {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}void{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
If all the changes for a mobile client needs to come as once so that they can be in 1 transaction. Then the offline_data form should define a ws_update method.
This method will then get the complete data package which should be give to this function.
This will redispatch all the inserts,updates or deletes to the various data forms that has the real rest methods to handle the actual insert.
If something fails then an Exception will be thrown and you can do a rollback so that everything of this sync is reverted.
Table Row (tr)
idprs
Table Cell (td)
Parameters
Div
classsIndent
{Object} data – The data package that is given to the offline_data form ws_update method.
{Number} version – The version number that is given to the offline_data form ws_update method.
{Object} authenticateResult – The authenticateResult object that is given to the offline_data form ws_update method. (generated by the offline_data.ws_authenticate)
Table Row (tr)
idret
Table Cell (td)
Returns
Div
classsIndent
void
Table Row (tr)
idsam
Table Cell (td)
Sample
Div
classsIndent
Code Block
languagejavascript

try {
   databaseManager.startTransaction();
   plugins.mobileservice.performSync(data,version,authenticateResult);
   databaseManager.commitTransaction();
} catch (e) {
   databaseManager.rollbackTransaction();
   // log the error and return false to that the mobile client will know the sync did fail.
   application.output(e,LOGGINGLEVEL.ERROR);
   return false;
}
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)