Constructor
new Ajax(approot, gateway, login, password, async)
Example
// Using authenticated user thru UI gateway
const app = new Simplicite.Ajax("myapp");
// Using public user thru public UI gateway
const app = new Simplicite.Ajax("myapp", "uipublic");
// Using website user thru WS gateway
const app = new Simplicite.Ajax("myapp", "ws", "myuser", "mypassword");
// Using website user thru API gateway
const app = new Simplicite.Ajax("myapp", "api", "myuser", "mypassword");
Parameters:
Name | Type | Description |
---|---|---|
approot |
Application root (either application name or /<context root> or absolute base URL) |
|
gateway |
Gateway type to use :
|
|
login |
User's login (not required for UI gateways) |
|
password |
User's password (not required for UI gateways) |
|
async |
Asynchronous calls by default (true if absent) ? |
Classes
Members
(constant) CONTEXT_ACTION :number
- Description:
Action context.
Action context.
Type:
- number
(constant) CONTEXT_AGENDA :number
- Description:
Agenda context.
Agenda context.
Type:
- number
(constant) CONTEXT_ASSOCIATE :number
- Description:
Association context.
Association context.
Type:
- number
(constant) CONTEXT_COPY :number
- Description:
Copy context.
Copy context.
Type:
- number
(constant) CONTEXT_CREATE :number
- Description:
Creation context.
Creation context.
Type:
- number
(constant) CONTEXT_CROSSTAB :number
- Description:
Cross table context.
Cross table context.
Type:
- number
(constant) CONTEXT_DATAMAPSELECT :number
- Description:
Data mapping selection context.
Data mapping selection context.
Type:
- number
(constant) CONTEXT_DELETE :number
- Description:
Delete context.
Delete context.
Type:
- number
(constant) CONTEXT_EXPORT :number
- Description:
Export context.
Export context.
Type:
- number
(constant) CONTEXT_IMPORT :number
- Description:
Import context.
Import context.
Type:
- number
(constant) CONTEXT_LIST :number
- Description:
List context.
List context.
Type:
- number
(constant) CONTEXT_NONE :number
- Description:
No context.
No context.
Type:
- number
(constant) CONTEXT_PANELLIST :number
- Description:
Panel list context.
Panel list context.
Type:
- number
(constant) CONTEXT_PLACEMAP :number
- Description:
Place map context.
Place map context.
Type:
- number
(constant) CONTEXT_POSTVALIDATE :number
- Description:
Post validate context.
Post validate context.
Type:
- number
(constant) CONTEXT_PREVALIDATE :number
- Description:
Pre-validate context.
Pre-validate context.
Type:
- number
(constant) CONTEXT_PRINTTMPL :number
- Description:
Publication template context.
Publication template context.
Type:
- number
(constant) CONTEXT_REFSELECT :number
- Description:
Reference selection context.
Reference selection context.
Type:
- number
(constant) CONTEXT_SEARCH :number
- Description:
Search context.
Search context.
Type:
- number
(constant) CONTEXT_STATETRANSITION :number
- Description:
State transition context.
State transition context.
Type:
- number
(constant) CONTEXT_UPDATE :number
- Description:
Update context.
Update context.
Type:
- number
(constant) CONTEXT_UPDATEALL :number
- Description:
Bulk update context.
Bulk update context.
Type:
- number
(constant) DEFAULT_ROW_ID :string
- Description:
Default row ID value (for creation).
Default row ID value (for creation).
Type:
- string
(constant) ERRLEVEL_ERROR :number
- Description:
Error error value
Error error value
Type:
- number
(constant) ERRLEVEL_FATAL :number
- Description:
Fatal error value
Fatal error value
Type:
- number
(constant) ERRLEVEL_WARNING :number
- Description:
Minor error value
Minor error value
Type:
- number
(constant) FALSE :string
- Description:
False value
False value
Type:
- string
(constant) GATEWAY_API :string
- Description:
API gateway
API gateway
Type:
- string
(constant) GATEWAY_UI :string
- Description:
UI gateway
UI gateway
Type:
- string
(constant) GATEWAY_UI_PUBLIC :string
- Description:
Public UI gateway
Public UI gateway
Type:
- string
(constant) RENDERING_DEFAULT :string
- Description:
Default rendering.
Default rendering.
Type:
- string
(constant) RENDERING_HORIZCHECKBOX :string
- Description:
Rendering horizontal checkbox(es).
Rendering horizontal checkbox(es).
Type:
- string
(constant) RENDERING_HORIZRADIOBUTTON :string
- Description:
Rendering horizontal radio button(s).
Rendering horizontal radio button(s).
Type:
- string
(constant) RENDERING_SELECTBOX :string
- Description:
Select box rendering (single or multiple select).
Select box rendering (single or multiple select).
Type:
- string
(constant) RENDERING_VERTCHECKBOX :string
- Description:
Rendering vertical checkbox(es).
Rendering vertical checkbox(es).
Type:
- string
(constant) RENDERING_VERTRADIOBUTTON :string
- Description:
Rendering vertical radio button(s).
Rendering vertical radio button(s).
Type:
- string
(constant) SEARCH_MONO :number
- Description:
Searchable.
Searchable.
Type:
- number
(constant) SEARCH_MULTI_CHECK :number
- Description:
Searchable using check boxes.
Searchable using check boxes.
Type:
- number
(constant) SEARCH_MULTI_LIST :number
- Description:
Searchable using list box.
Searchable using list box.
Type:
- number
(constant) SEARCH_NONE :number
- Description:
Not searchable.
Not searchable.
Type:
- number
(constant) SEARCH_PERIOD :number
- Description:
Searchable using period.
Searchable using period.
Type:
- number
(constant) TRUE :string
- Description:
True value
True value
Type:
- string
(constant) TYPE_BIGDECIMAL :number
- Description:
Big decimal type.
Big decimal type.
Type:
- number
(constant) TYPE_BOOLEAN :number
- Description:
Boolean type.
Boolean type.
Type:
- number
(constant) TYPE_COLOR :number
- Description:
Color type.
Color type.
Type:
- number
(constant) TYPE_DATE :number
- Description:
Date type.
Date type.
Type:
- number
(constant) TYPE_DATETIME :number
- Description:
Date and time type.
Date and time type.
Type:
- number
(constant) TYPE_DOC :number
- Description:
Document type
Document type
Type:
- number
(constant) TYPE_EMAIL :number
- Description:
Email type.
Email type.
Type:
- number
(constant) TYPE_ENUM :number
- Description:
Single enumerated (list of values) type.
Single enumerated (list of values) type.
Type:
- number
(constant) TYPE_ENUM_MULTI :number
- Description:
Multiple enumerated (list of values) type.
Multiple enumerated (list of values) type.
Type:
- number
(constant) TYPE_EXTFILE :number
- Description:
External file reference type.
External file reference type.
Type:
- number
(constant) TYPE_FLOAT :number
- Description:
Float type.
Float type.
Type:
- number
(constant) TYPE_GEOCOORDS :number
- Description:
Geo coordinates type.
Geo coordinates type.
Type:
- number
(constant) TYPE_HTML :number
- Description:
HTML content type.
HTML content type.
Type:
- number
(constant) TYPE_ID :number
- Description:
Internal ID (foreign key) type.
Internal ID (foreign key) type.
Type:
- number
(constant) TYPE_IMAGE :number
- Description:
Image type.
Image type.
Type:
- number
(constant) TYPE_INT :number
- Description:
Integer type.
Integer type.
Type:
- number
(constant) TYPE_LONG_STRING :number
- Description:
Long string (unlimited) type.
Long string (unlimited) type.
Type:
- number
(constant) TYPE_NOTEPAD :number
- Description:
Notepad (incremental long text) type.
Notepad (incremental long text) type.
Type:
- number
(constant) TYPE_OBJECT :number
- Description:
Object type.
Object type.
Type:
- number
(constant) TYPE_PASSWORD :number
- Description:
Password type.
Password type.
Type:
- number
(constant) TYPE_PHONENUM :number
- Description:
Phone number type.
Phone number type.
Type:
- number
(constant) TYPE_REGEXP :number
- Description:
Regular expression type.
Regular expression type.
Type:
- number
(constant) TYPE_STRING :number
- Description:
String type.
String type.
Type:
- number
(constant) TYPE_TIME :number
- Description:
Time type.
Time type.
Type:
- number
(constant) TYPE_URL :number
- Description:
URL type.
URL type.
Type:
- number
(constant) UPD_ALWAYS :number
- Description:
Updatable in lists and forms.
Updatable in lists and forms.
Type:
- number
(constant) UPD_FORM_ONLY :number
- Description:
Updatable in forms only.
Updatable in forms only.
Type:
- number
(constant) UPD_LIST_ONLY :number
- Description:
Updatable in lists only.
Updatable in lists only.
Type:
- number
(constant) UPD_READ_ONLY :number
- Description:
Not updatable.
Not updatable.
Type:
- number
(constant) VIEW_TYPE :Object
- Description:
View item types
View item types
Type:
- Object
(constant) VIS_BOTH :number
- Description:
Visible in lists and forms.
Visible in lists and forms.
Type:
- number
(constant) VIS_FORBIDDEN :number
- Description:
Forbidden on UI
Forbidden on UI
Type:
- number
(constant) VIS_FORM :number
- Description:
Visible in forms.
Visible in forms.
Type:
- number
(constant) VIS_HIDDEN :number
- Description:
Not visible.
Not visible.
Type:
- number
(constant) VIS_LIST :number
- Description:
Visible in lists.
Visible in lists.
Type:
- number
(constant) VIS_NOT :number
- Description:
Not visible (alias to VIS_HIDDEN).
Not visible (alias to VIS_HIDDEN).
Type:
- number
appinfo
- Description:
Application info data.
- name: Application name
- version: Application version
- platformversion: Platform version
- encoding: Encoding
- server: Server vendor
- Etc.
Application info data.
- name: Application name
- version: Application version
- platformversion: Platform version
- encoding: Encoding
- server: Server vendor
- Etc.
authToken
- Description:
Server side session authentication token.
Server side session authentication token.
authTokenExpiryDate
- Description:
Server side session authentication token expiry date
Server side session authentication token expiry date
grant
- Description:
Grant data.
- login: User login
- firstname: User first name
- lastname: User last name
- responsibilities: User active responsibilites array
- Etc.
Grant data.
- login: User login
- firstname: User first name
- lastname: User last name
- responsibilities: User active responsibilites array
- Etc.
menu
- Description:
Menu data.
Menu data.
news
- Description:
News array. Use news["<code>"] to get a news object)
News array. Use news["<code>"] to get a news object)
sessionId
- Description:
Server side session identifier.
Server side session identifier.
sysparams
- Description:
System parameters array. Use sysparams["<name>"] to get a system parameter value.
System parameters array. Use sysparams["<name>"] to get a system parameter value.
texts
- Description:
Texts. Use texts["<code>"] to get a text value.
Texts. Use texts["<code>"] to get a text value.
views
- Description:
View definitions
View definitions
Methods
T(code, plural) → {string}
- Description:
Get text value (alias to
getText
).
Parameters:
Name | Type | Description |
---|---|---|
code |
string | Text code |
plural |
boolean | True to get the plural value if known |
Returns:
Text value
- Type
- string
base64Decode(s) → {string}
- Description:
Decode a base64 string to string
Parameters:
Name | Type | Description |
---|---|---|
s |
string | Base64-encoded string |
Returns:
Decoded string
- Type
- string
base64Encode(s) → {string}
- Description:
Encode a string to base64
Parameters:
Name | Type | Description |
---|---|---|
s |
string | Input string |
Returns:
Base64-encoded string
- Type
- string
base64EncodeArrayBuffer(b) → {string}
- Description:
Encode an array buffer (such as got from a local file read) to to base64
Parameters:
Name | Type | Description |
---|---|---|
b |
Array | Array buffer |
Returns:
Base64-encoded string
- Type
- string
bookmark(cbk, method, params)
- Description:
Bookmark service
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
method |
string | show, add, delete, toggle |
params |
Object | method parameters data or show |
changeLang(cbk, lang, params)
- Description:
Change user's language
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
|||||||||
lang |
string | language code (FRA, ENU...) |
|||||||||
params |
Object | Optional parameters Properties
|
clearCache(obj)
- Description:
Remove objects from cache
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object name or business object |
clientTabId(id)
- Description:
Identifiy the client tab in sessionStorage
Parameters:
Name | Type | Description |
---|---|---|
id |
string | optinal Id to force the value (null to remove) |
Returns:
tab unique Id
contentURL(file)
- Description:
Returns content URL.
Parameters:
Name | Type | Description |
---|---|---|
file |
string | Content file name |
dataURL(doc, thumb)
- Description:
Returns local data URL (e.g. suitable for src of img tags).
Parameters:
Name | Type | Description |
---|---|---|
doc |
Document with mime type and base64 image or thumbnail |
|
thumb |
Return document thumbnail? |
debug(msg)
- Description:
Debug handler
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | Message |
dispositionResourceURL(code, type)
- Description:
Returns disposition resource URL.
Parameters:
Name | Type | Description |
---|---|---|
code |
string | Resource code |
type |
string | Resource type (IMG=image (default), ICO=Icon, CSS=stylesheet, JS=Javascript, HTML=HTML) |
documentURL(object, field, rowId, docId, cdisp)
- Description:
Returns document URL.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
object |
Object | string | Object name or object Properties
|
|||||||||||||||
field |
string | Field name |
|||||||||||||||
rowId |
string | Object record row ID |
|||||||||||||||
docId |
string | Document ID (can be omitted then a lookup is done on record matching rowId) |
|||||||||||||||
cdisp |
string | Disposition: attachment or inline (defaults to inline) |
editor(cbk, service, params, post)
- Description:
Editor services
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
service |
string |
|
params |
params | Optional parameters |
post |
Object | Optional post data with document |
error(msg)
- Description:
Error handler
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | Message |
firebase(cbk, data, params)
- Description:
Firebase service to send mobile notification
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
||||||||||||||||||
data |
Object | Parameters Properties
|
||||||||||||||||||
params |
Object | parameters Properties
|
follow(cbk, params)
- Description:
Social follow service.
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
|||||||||||||||||||||
params |
Object | parameters Properties
|
getAppInfo(cbk, params)
- Description:
Loads application info data.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
|||||||||
params |
Object | Optional parameters Properties
|
getAsync() → {boolean}
- Description:
Is globally asynchronous?
Returns:
True if is globally asynchronous
- Type
- boolean
getBusinessObject(obj, objInstName)
- Description:
Get a new business object.
Example
// app is a Simplicite.Ajax instance
const obj = app.getBusinessObject("MyObject");
// other instance of obj
const tmp = app.getBusinessObject("MyObject", "tmpObj");
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object name or business object |
|
objInstName |
Optional instance name (default the_ajax_<object name>) |
getBusinessProcess(name)
- Description:
Get a new business process.
Example
// app is a Simplicite.Ajax instance
const pcs = app.getBusinessProcess("MyProcess");
Parameters:
Name | Type | Description |
---|---|---|
name |
Business process name |
getErrorMessage(err)
- Description:
Get the message in error
Parameters:
Name | Type | Description |
---|---|---|
err |
Object | with message, messages or description |
getExternalObject(cbk, name, params)
- Description:
Loads external object definition.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
|||||||||
name |
string | External object name |
|||||||||
params |
Object | Optional parameters Properties
|
getExternalObjectURL(name, params, embedded)
- Description:
External object URL.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Object name |
params |
Object | Optional parameters (object or string) |
embedded |
boolean | True to get a relative URL, false to get the full http URL (loadURL will create an iframe) |
getGateway() → {string}
- Description:
Get gateway
Returns:
Gateway (one of GATEWAY_*
constants)
- Type
- string
getGrant(cbk, params)
- Description:
Loads grant data.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
|||||||||||||||
params |
Object | Optional parameters Properties
|
getIconURL(name)
- Description:
Icon URL
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Resource icon name |
getMenu(cbk, params)
- Description:
Loads menu data.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
|||||||||
params |
Object | Optional parameters Properties
|
getNews(cbk, params)
- Description:
Loads news.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
|||||||||||||||
params |
Object | Optional parameters Properties
|
getResourceURL(code, type, object, objId)
- Description:
Returns Object resource URL.
Parameters:
Name | Type | Description |
---|---|---|
code |
string | Resource code |
type |
string | Resource type (IMG=image (default), ICO=Icon, CSS=stylesheet, JS=Javascript, HTML=HTML) |
object |
string | Object name: ObjectInternal or ObjectExternal (for Disposition use dispositionResourceURL) |
objId |
string | Object row ID (not the resource row ID) |
getStandardError(level, message, details)
- Description:
JSON message
Parameters:
Name | Type | Description |
---|---|---|
level |
string | |
message |
string | |
details |
Object |
getSysInfo(cbk, params)
- Description:
Loads system info data.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
|||||||||
params |
Object | Optional parameters Properties
|
getSysParam(cbk, name, params)
- Description:
Get system parameter value.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
||||||||||||
name |
string | System parameter name |
||||||||||||
params |
Object | Optional parameters Properties
|
getSysParams(cbk, params)
- Description:
Loads system parameters.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
|||||||||
params |
Object | Optional parameters Properties
|
getText(code, plural) → {string}
- Description:
Get text value.
Parameters:
Name | Type | Description |
---|---|---|
code |
string | Text code |
plural |
boolean | True to get the plural value if known |
Returns:
Text value
- Type
- string
getTexts(cbk, params)
- Description:
Loads texts.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
|||||||||
params |
Object | Optional parameters Properties
|
getTimeout() → {string}
- Description:
Get timeout
Returns:
Timeout
- Type
- string
getUserInfo(cbk, login, Object})
- Description:
Loads basic user data (login, name, email, picture).
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
login |
string | User login |
Object} |
params Optional parameters |
|
params.inlinePicture |
boolean | Inline picture (false if absent or undefined) |
params.async |
boolean | Asynchronous call (use default if absent)? |
params.error |
function | Custom error handler (unused by Promise with catch) |
getView(cbk, name, params)
- Description:
Loads view definition.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
||||||||||||
name |
string | View name |
||||||||||||
params |
Object | Optional parameters Properties
|
imageURL(object, field, rowId, docId, thumb)
- Description:
Returns image URL.
Parameters:
Name | Type | Description |
---|---|---|
object |
string | Object name |
field |
string | Field name |
rowId |
string | Object record row ID |
docId |
string | Document ID |
thumb |
boolean | Return thumbnail image |
indexsearch(cbk, request, params)
- Description:
Search from index.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
||||||||||||||||||||||||
request |
string | Index search request string
|
||||||||||||||||||||||||
params |
Object | Optional parameters Properties
|
info(msg)
- Description:
Info handler
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | Message |
isFalse(value) → {boolean}
- Description:
Returns true if value is
0|false|no|n
Parameters:
Name | Type | Description |
---|---|---|
value |
string | parameter value |
Returns:
Is value false?
- Type
- boolean
isFirefox()
- Description:
Is Firefox?
Returns:
True if is Firefox
isTrue(value) → {boolean}
- Description:
Returns true if value is
1|true|yes|y
Parameters:
Name | Type | Description |
---|---|---|
value |
string | parameter value |
Returns:
Is value true?
- Type
- boolean
isWebkit()
- Description:
Is WebKit?
Returns:
True if is WebKit
isWinIE()
- Description:
Is Windows Internet Explorer?
Returns:
True if is Windows Internet Explorer
login(success, failure, authToken, params)
- Description:
Login (same as session()).
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
success |
function | Optional function called when session init is successful (Promise.then if absent) |
|||||||||
failure |
function | Optional function called when session init fails (Promise.catch if absent) |
|||||||||
authToken |
string | Auth token to (re)use (in case of persistent tokens) |
|||||||||
params |
Object | Optional parameters Properties
|
logout(success, failure, params)
- Description:
Logout (in case of a persistent token it is deleted)
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
success |
function | Optional function called when logout is successful (Promise.then if absent) |
||||||
failure |
function | Optional function called when logout fails (Promise.catch if absent) |
||||||
params |
Object | Optional parameters Properties
|
messageToJson(msg)
- Description:
Convert a textual backend message to json { code, text, level, field, label, error } or technical statement { redirect } or { javascript }
- code: message code
- text: optional contextual details
- level: 'I'nfo, 'W'arning, 'E'rror, 'F'atal
- field: optional field name of message
- label: default text to display in user language
- error: true when level is fatal or error
- params: optional parameter key/value (suggest)
- actions: optional call to actions
Parameters:
Name | Type | Description |
---|---|---|
msg |
formatted backend message 'code:text#level#field#param:value' or 'redirect:url' or 'javascript:code' |
module(cbk, params)
- Description:
Module services
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
||||||||||||||||||
params |
Object | parameters Properties
|
monitor(m, params, cbk)
- Description:
Monitoring service
Parameters:
Name | Type | Description |
---|---|---|
m |
string | Object | Monitoring service or plain JSON object to store |
params |
Object | Optional parameters |
cbk |
function | Optional callback for response |
onExpiredSession(reason, callbackopt)
- Description:
Handler when session has expired on server side, by default throws HTTP 401 in console. It can be overridden to return on the logon form in a UI context.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
reason |
Object | Expired reason |
|
callback |
function |
<optional> |
Callback to call if session can be restored silently |
parseDateTimeValue(v) → {Date}
- Description:
Parse a date time value into a Javascript Date
Parameters:
Name | Type | Description |
---|---|---|
v |
string | Date time value ( |
Returns:
Javascript date
- Type
- Date
parseDateValue(v) → {Date}
- Description:
Parse a date value into a Javascript Date
Parameters:
Name | Type | Description |
---|---|---|
v |
string | Date value ( |
Returns:
Javascript date
- Type
- Date
randomString(len)
- Description:
Random string
Parameters:
Name | Type | Description |
---|---|---|
len |
Length |
Returns:
Random string of specified length
resourceURL(resId)
- Description:
Returns resource URL.
Parameters:
Name | Type | Description |
---|---|---|
resId |
string | Resource ID (e.g. taken from business object or external object resources list in metadata) |
session(success, failure, authToken, params)
- Description:
Session init (retrieves server side session identifier and auth token).
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
success |
function | Optional function called when session init is successful (Promise.then if absent) |
||||||||||||
failure |
function | Optional function called when session init fails (Promise.catch if absent) |
||||||||||||
authToken |
string | Auth token to (re)use (in case of persistent tokens) |
||||||||||||
params |
Object | Optional parameters Properties
|
setAsync(async)
- Description:
Set globally asynchronous (the UI needs to be asynchronous)
Parameters:
Name | Type | Description |
---|---|---|
async |
boolean | Asynchronous? |
setDebugHandler(debugHandler)
- Description:
Change default global debug handler.
Parameters:
Name | Type | Description |
---|---|---|
debugHandler |
Debug handler function |
setDebugHandlerActive(active)
- Description:
Set default global debug handler active or inactive.
Parameters:
Name | Type | Description |
---|---|---|
active |
Active status |
setErrorHandler(errorHandler)
- Description:
Change default global error handler.
Parameters:
Name | Type | Description |
---|---|---|
errorHandler |
Error handler function |
setErrorHandlerActive(active)
- Description:
Set default global error handler active or inactive.
Parameters:
Name | Type | Description |
---|---|---|
active |
Active status |
setGateway(gateway, loginopt, passwordopt)
- Description:
Set gateway and credentials
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
gateway |
string | Gateway (one of |
|
login |
string |
<optional> |
Login |
password |
string |
<optional> |
Password |
setInfoHandler(infoHandler)
- Description:
Change default global information handler.
Parameters:
Name | Type | Description |
---|---|---|
infoHandler |
Information handler function |
setInfoHandlerActive(active)
- Description:
Set default global information handler active or inactive.
Parameters:
Name | Type | Description |
---|---|---|
active |
Active status |
setPassword(cbk, password, Object})
- Description:
Set password.
Parameters:
Name | Type | Description |
---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
password |
string | Password |
Object} |
params Optional parameters |
|
params.async |
boolean | Asynchronous call (use default if absent)? |
params.error |
function | Custom error handler (unused by Promise with catch) |
setSysParam(cbk, name, value, save, params)
- Description:
Set a user system parameter.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
|||||||||
name |
string | Parameter name |
|||||||||
value |
string | Parameter value (if undefined parameter is unset) |
|||||||||
save |
boolean | Save parameter in user parameters (if undefined parameter is not saved) |
|||||||||
params |
Object | Optional parameters Properties
|
setTimeout(timeout)
- Description:
Set timeout
Parameters:
Name | Type | Description |
---|---|---|
timeout |
number | Timeout (seconds) |
setView(name, view)
- Description:
Set a view in cache
Parameters:
Name | Type | Description |
---|---|---|
name |
string | View name |
view |
Object | View definition |
setWarningHandler(warningHandler)
- Description:
Change default global warning handler.
Parameters:
Name | Type | Description |
---|---|---|
warningHandler |
Warning handler function |
setWarningHandlerActive(active)
- Description:
Set default global warning handler active or inactive.
Parameters:
Name | Type | Description |
---|---|---|
active |
Active status |
social(cbk, params, post)
- Description:
Social post service.
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
||||||||||||||||||||||||||||||||||||||||||
params |
Object | Optional parameters Properties
|
||||||||||||||||||||||||||||||||||||||||||
post |
Object | optional post to save or delete |
syntax(cbk, data, params)
- Description:
Syntax service: will return an object with the results
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
||||||||||||
data |
Object | parameters Properties
|
||||||||||||
params |
Object | parameters Properties
|
toDateTimeValue(d) → {string}
- Description:
Parse a Javascript Date into a date time value
Parameters:
Name | Type | Description |
---|---|---|
d |
Date | Javascript date |
Returns:
Date time value (YYYY-MM-DD HH-mm-ss
)
- Type
- string
toDateValue(d) → {string}
- Description:
Parse a Javascript Date into a date value
Parameters:
Name | Type | Description |
---|---|---|
d |
Date | Javascript date |
Returns:
Date value (YYYY-MM-DD
)
- Type
- string
toTimeValue(d) → {string}
- Description:
Parse a Javascript Date into a time value
Parameters:
Name | Type | Description |
---|---|---|
d |
Date | Javascript date |
Returns:
Time value (HH:mm:ss
)
- Type
- string
treeview(cbk, name, params)
- Description:
Treeview services
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cbk |
function | Optional function called when loading is completed (returns a Promise if absent) |
||||||||||||||||||||||||
name |
string | Treeview name |
||||||||||||||||||||||||
params |
Object | Optional parameters Properties
|
warning(msg)
- Description:
Warning handler
Parameters:
Name | Type | Description |
---|---|---|
msg |
string | Message |
winIEVersion() → {number}
- Description:
Get Windows Internet Explorer version
Returns:
Version
- Type
- number