Authored by Anonymous
Getting started
This document provides descriptions and usage of the functions that are included in the pzpega_mobile_settings.js script that is used to display the content of the client store.
To use the functions that are described in this document, you must run the mobile client on an emulator. Next, you must run a Chrome/web inspector, in which you can perform the following functions according to the specified example for each function.
This information applies to Pega Platform™ version 7.2.1 and later.
Functions
getItemTypes
Definition
launchbox.PRPC.ClientStore.getItemTypes(successCallback, failureCallback)
Returns array of all type names that are present in offline_store SQL table in offline application. The type names can then be used in functions, such as launchbox.PRPC.ClientStore.getItems(...)
For more information, see Client Store API for Pega Mobile Client.
Parameters
Parameter | Description |
---|---|
successCallback | Runs after getItemTypes(…) runs successfully. The function takes one parameter: an array with type names found by getItemTypes(…) |
failureCallback | Runs in case of failure. The function takes two parameters: errorCode and message |
Example
var successCallback = function(results){ console.table(results); } var failureCallback = function(errorCode, message){ console.error(errorCode + " - " + message); } launchbox.PRPC.ClientStore.getItemTypes(successCallback, failureCallback);
getItems
Definition
launchbox.PRPC.ClientStore.getItems(type, handle, successCallback, failureCallback)
Returns array of all items of the selected type. Valid type names can be found with launchbox.PRPC.ClientStore.getItemTypes(...)
For more information, see Client Store API for Pega Mobile Client.
Parameters
Parameter | Description |
---|---|
type | Name of the type. |
handle | Rule id (class name, exclamation mark and rule name, e.g. “MY-CLASS-NAME!MyRuleName”). You can also use “*” to ignore handle and get all rules matching the specified type. |
successCallback | Runs after getItems(…) runs successfully. The function takes one parameter: an array with item names found by getItems(…) |
failureCallback | Runs in case of failure. The function takes two parameters: errorCode and message |
Example
var type = "PORTALDATA"; var handle = "*"; var successCallback = function(results){ console.table(results); } var failureCallback = function(errorCode, message){ console.error(errorCode + " - " + message); } launchbox.PRPC.ClientStore.getItems(type, handle, successCallback, failureCallback);
getItemsStats
Definition
launchbox.PRPC.ClientStore.getItemsStats(successCallback, failureCallback)
Returns array of all items with type, handle and size attributes that are present in offline_store SQL table in offline application.
For more information, see Client Store API for Pega Mobile Client.
Parameters
Parameter | Description |
---|---|
successCallback | Runs after getItemsStats(…) runs successfully. The function takes one parameter: an array with items found by getItemsStats(…) |
failureCallback | Runs in case of failure. The function takes two parameters: errorCode and message |
Example
var successCallback = function(results){ console.table(results); } var failureCallback = function(errorCode, message){ console.error(errorCode + " - " + message); } launchbox.PRPC.ClientStore.getItemsStats(successCallback, failureCallback);
customTableSizes
Definition
launchbox.PRPC.ClientStore.customTableSizes(tableNames, successCallback, failureCallback)
Returns information for large data pages.
For more information, see Client Store API for Pega Mobile Client.
Parameters
Parameter | Description |
---|---|
largeDataPageNames | An array with large data page names. |
successCallback | Runs after customTableSizes(…) runs successfully. The function takes one parameter: an array with custom table sizes found by customTableSizes(…) |
failureCallback | Runs in case of failure. The function takes two parameters: errorCode and message |
Example
var largeDataPageNames = ["D_EmployeeList", "D_TelephoneList"]; var successCallback = function(results){ console.table(results); } var failureCallback = function(errorCode, message){ console.error(errorCode + " - " + message); } launchbox.PRPC.ClientStore.customTableSizes(largeDataPageNames, successCallback, failureCallback);
listActions
Definition
launchbox.PRPC.ClientStore.listActions(successCallback, failureCallback, getDetails)
Retrieves a list of actions that are queued for synchronization.
For more information, see Client Store API for Pega Mobile Client.
Parameters
Parameter | Description |
---|---|
successCallback | Runs after listActions(…) runs successfully. The function takes one parameter: array of actions found by listActions(…) |
failureCallback | Runs in case of failure. The function takes two parameters: errorCode and message |
getDetails | Boolean value. When true, function get more details about the result. |
options | Options that are used to filter actions:
|
Example
var getDetails = true; var options = {lax:false, silent:false, negligible:false}; var successCallback = function(results){ console.table(results); } var failureCallback = function(errorCode, message){ console.error(errorCode + " - " + message); } launchbox.PRPC.ClientStore.listActions(successCallback, failureCallback, getDetails, options);