Class Simplicite.Ajax
Defined in: appsession.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Simplicite.Ajax(approot, gateway, login, password, async)
Simplicité® application.
|
Field Attributes | Field Name and Description |
---|---|
Application info data.
|
|
Server side session authentication token.
|
|
<constant> |
Action context.
|
<constant> |
Agenda context.
|
<constant> |
Association context.
|
<constant> |
Copy context.
|
<constant> |
Creation context.
|
<constant> |
Cross table context.
|
<constant> |
Data mapping selection context.
|
<constant> |
Delete context.
|
<constant> |
Export context.
|
<constant> |
Chart context.
|
<constant> |
Import context.
|
<constant> |
List context.
|
<constant> |
No context.
|
<constant> |
Panel list context.
|
<constant> |
Place map context.
|
<constant> |
Post validate context.
|
<constant> |
Pre-validate context.
|
<constant> |
Publication template context.
|
<constant> |
Reference selection context.
|
<constant> |
Search context.
|
<constant> |
State transition context.
|
<constant> |
Update context.
|
<constant> |
Bulk update context.
|
<constant> |
Default row ID value (for creation).
|
<constant> |
Error error value
|
<constant> |
Fatal error value
|
<constant> |
Minor error value
|
<constant> |
False value
|
Grant data.
|
|
Menu data.
|
|
News array.
|
|
<constant> |
Default rendering.
|
<constant> |
Rendering horizontal checkbox(es).
|
<constant> |
Rendering horizontal radio button(s).
|
<constant> |
Select box rendering (single or multiple select).
|
<constant> |
Rendering vertical checkbox(es).
|
<constant> |
Rendering vertical radio button(s).
|
<constant> |
Searchable.
|
<constant> |
Searchable using check boxes.
|
<constant> |
Searchable using list box.
|
<constant> |
Not searchable.
|
<constant> |
Searchable using period.
|
Server side session identifier.
|
|
System parameters array.
|
|
Texts array.
|
|
<constant> |
True value
|
<constant> |
Boolean type.
|
<constant> |
Color type.
|
<constant> |
Date type.
|
<constant> |
Date and time type.
|
<constant> |
Document type
|
<constant> |
Email type.
|
<constant> |
Single enumerated (list of values) type.
|
<constant> |
Multiple enumerated (list of values) type.
|
<constant> |
External file reference type.
|
<constant> |
Float type.
|
<constant> |
Float type (same as TYPE_FLOAT).
|
<constant> |
Geo coordinates type.
|
<constant> |
HTML content type.
|
<constant> |
Internal ID (foreign key) type.
|
<constant> |
Image type.
|
<constant> |
Integer type.
|
<constant> |
Long string (unlimited) type.
|
<constant> |
Notepad (incremental long text) type.
|
<constant> |
Object type.
|
<constant> |
Password type.
|
<constant> |
Phone number type.
|
<constant> |
Regular expression type.
|
<constant> |
String type.
|
<constant> |
Time type.
|
<constant> |
URL type.
|
<constant> |
Visible in lists and forms.
|
<constant> |
Visible in forms.
|
<constant> |
Visible in lists.
|
<constant> |
Not visible.
|
Method Attributes | Method Name and Description |
---|---|
base64Decode(s)
Decode a base64 string to string
|
|
base64Encode(s)
Encode a string to base64
|
|
Encode an array buffer (such as got from a local file read) to to base64
|
|
contentURL(file)
Returns content URL.
|
|
dataURL(doc)
Returns local data URL (e.g.
|
|
debug(msg)
|
|
dispositionResourceURL(code, type)
Returns disposition resource URL.
|
|
documentURL(object, field, rowId, docId)
Returns document URL.
|
|
error(err)
|
|
getAppInfo(callback, params)
Loads application info data.
|
|
getAsync()
|
|
getBusinessObject(objName, objInstName, autoRefreshMetaData)
Get a new business object.
|
|
getBusinessProcess(name)
Get a new business process.
|
|
getExternalObject(callback, name, params)
Loads external object.
|
|
getGrant(callback, params)
Loads grant data.
|
|
getMenu(callback, params)
Loads menu data.
|
|
getNews(callback, params)
Loads news.
|
|
getSysInfo(callback, params)
Loads system info data.
|
|
getSysParam(name, params, params)
Get system parameter value.
|
|
getSysParams(callback, params)
Loads system parameters.
|
|
getText(code)
Get text value.
|
|
getTexts(callback, params)
Loads texts.
|
|
info(msg)
|
|
isWebkit()
|
|
isWinIE()
|
|
login(successCallback, failureCallback)
Server side login (same as session()).
|
|
logout(successCallback, failureCallback, params)
Server side logout (does not work on some web browsers).
|
|
Parse a date time value into a Javascript Date
|
|
Parse a date value into a Javascript Date
|
|
resourceURL(id)
Returns resource URL.
|
|
session(successCallback, failureCallback)
Session init (retrieves server side session identifier).
|
|
setAsync(async)
|
|
setDebugHandler(debugHandler)
Change default global debug handler.
|
|
setDebugHandlerActive(active)
Set default global debug handler active or inactive.
|
|
setErrorHandler(errorHandler)
Change default global error handler.
|
|
setErrorHandlerActive(active)
Set default global error handler active or inactive.
|
|
setGateway(gateway, login, password)
|
|
setInfoHandler(infoHandler)
Change default global information handler.
|
|
setInfoHandlerActive(active)
Set default global information handler active or inactive.
|
|
setSysParam(callback, name, value, save, params)
Set a user system parameter.
|
|
setTimeout(timeout)
|
|
setVersionCompatibility(version)
Set default JSON services version compatibility
|
|
setWarningHandler(warningHandler)
Change default global warning handler.
|
|
setWarningHandlerActive(active)
Set default global warning handler active or inactive.
|
|
T()
Alias for getText
|
|
Parse a Javascript Date into a date time value
|
|
toDateValue(d)
Parse a Javascript Date into a date value
|
|
toTimeValue(d)
Parse a Javascript Date into a time value
|
|
warning(msg)
|
|
Class Detail
Simplicite.Ajax(approot, gateway, login, password, async)
Simplicité® application.
Sample usage:
Sample usage:
// Using authenticated user thru UI gateway var app = new Simplicite.Ajax("myapp"); // Using public user thru public UI gateway var app = new Simplicite.Ajax("myapp", "uipublic"); // Using website user thru WS gateway var app = new Simplicite.Ajax("myapp", "ws", "myuser", "mypassword"); // Using website user thru API gateway var app = new Simplicite.Ajax("myapp", "api", "myuser", "mypassword");
- Parameters:
- approot
- Application root (either application name or /<context root> or absolute base URL)
- gateway
- Gateway type to use :
- 1 or "ui": Authenticated UI gateway (default)
- 2 or "uipublic" : Public UI gateway
- 3 or "ws" : Webservices gateway
- 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) ?
Field Detail
appinfo
Application info data.
- name: Application name
- version: Application version
- platformversion: Platform version
- encoding: Encoding
- server: Server vendor
- TO BE COMPLETED...
authToken
Server side session authentication token.
<constant>
CONTEXT_ACTION
Action context.
<constant>
CONTEXT_AGENDA
Agenda context.
<constant>
CONTEXT_ASSOCIATE
Association context.
<constant>
CONTEXT_COPY
Copy context.
<constant>
CONTEXT_CREATE
Creation context.
<constant>
CONTEXT_CROSSTAB
Cross table context.
<constant>
CONTEXT_DATAMAPSELECT
Data mapping selection context.
<constant>
CONTEXT_DELETE
Delete context.
<constant>
CONTEXT_EXPORT
Export context.
<constant>
CONTEXT_GRAPH
Chart context.
<constant>
CONTEXT_IMPORT
Import context.
<constant>
CONTEXT_LIST
List context.
<constant>
CONTEXT_NONE
No context.
<constant>
CONTEXT_PANELLIST
Panel list context.
<constant>
CONTEXT_PLACEMAP
Place map context.
<constant>
CONTEXT_POSTVALIDATE
Post validate context.
<constant>
CONTEXT_PREVALIDATE
Pre-validate context.
<constant>
CONTEXT_PRINTTMPL
Publication template context.
<constant>
CONTEXT_REFSELECT
Reference selection context.
<constant>
CONTEXT_SEARCH
Search context.
<constant>
CONTEXT_STATETRANSITION
State transition context.
<constant>
CONTEXT_UPDATE
Update context.
<constant>
CONTEXT_UPDATEALL
Bulk update context.
<constant>
DEFAULT_ROW_ID
Default row ID value (for creation).
<constant>
ERRLEVEL_ERROR
Error error value
<constant>
ERRLEVEL_FATAL
Fatal error value
<constant>
ERRLEVEL_WARNING
Minor error value
<constant>
FALSE
False value
grant
Grant data.
- login: User login
- firstname: User first name
- lastname: User last name
- responsibilities: User active responsibilites array
- TO BE COMPLETED...
menu
Menu data.
- TO BE COMPLETED...
news
News array. Use news["<code>"] to get a news object), each news object is:
- TO BE COMPLETED...
<constant>
RENDERING_DEFAULT
Default rendering.
<constant>
RENDERING_HORIZCHECKBOX
Rendering horizontal checkbox(es).
<constant>
RENDERING_HORIZRADIOBUTTON
Rendering horizontal radio button(s).
<constant>
RENDERING_SELECTBOX
Select box rendering (single or multiple select).
<constant>
RENDERING_VERTCHECKBOX
Rendering vertical checkbox(es).
<constant>
RENDERING_VERTRADIOBUTTON
Rendering vertical radio button(s).
<constant>
SEARCH_MONO
Searchable.
<constant>
SEARCH_MULTI_CHECK
Searchable using check boxes.
<constant>
SEARCH_MULTI_LIST
Searchable using list box.
<constant>
SEARCH_NONE
Not searchable.
<constant>
SEARCH_PERIOD
Searchable using period.
sessionId
Server side session identifier.
sysparams
System parameters array. Use sysparams["<name>"] to get a system parameter value.
texts
Texts array. Use texts["<code>"] to get a text value.
<constant>
TRUE
True value
<constant>
TYPE_BOOLEAN
Boolean type.
<constant>
TYPE_COLOR
Color type.
<constant>
TYPE_DATE
Date type.
<constant>
TYPE_DATETIME
Date and time type.
<constant>
TYPE_DOC
Document type
<constant>
TYPE_EMAIL
Email type.
<constant>
TYPE_ENUM
Single enumerated (list of values) type.
<constant>
TYPE_ENUM_MULTI
Multiple enumerated (list of values) type.
<constant>
TYPE_EXTFILE
External file reference type.
<constant>
TYPE_FLOAT
Float type.
<constant>
TYPE_FLOAT_EMPTY
Float type (same as TYPE_FLOAT).
<constant>
TYPE_GEOCOORDS
Geo coordinates type.
<constant>
TYPE_HTML
HTML content type.
<constant>
TYPE_ID
Internal ID (foreign key) type.
<constant>
TYPE_IMAGE
Image type.
<constant>
TYPE_INT
Integer type.
<constant>
TYPE_LONG_STRING
Long string (unlimited) type.
<constant>
TYPE_NOTEPAD
Notepad (incremental long text) type.
<constant>
TYPE_OBJECT
Object type.
<constant>
TYPE_PASSWORD
Password type.
<constant>
TYPE_PHONENUM
Phone number type.
<constant>
TYPE_REGEXP
Regular expression type.
<constant>
TYPE_STRING
String type.
<constant>
TYPE_TIME
Time type.
<constant>
TYPE_URL
URL type.
<constant>
VIS_BOTH
Visible in lists and forms.
<constant>
VIS_FORM
Visible in forms.
<constant>
VIS_LIST
Visible in lists.
<constant>
VIS_NOT
Not visible.
Method Detail
base64Decode(s)
Decode a base64 string to string
- Parameters:
- s
- Base64-encoded string
- Returns:
- Decoded string
base64Encode(s)
Encode a string to base64
- Parameters:
- s
- Input string
- Returns:
- Base64-encoded string
base64EncodeArrayBuffer(b)
Encode an array buffer (such as got from a local file read) to to base64
- Parameters:
- b
- Array buffer
- Returns:
- Base64-encoded string
contentURL(file)
Returns content URL.
- Parameters:
- file
- Content file name
dataURL(doc)
Returns local data URL (e.g. suitable for src of img tags).
- Parameters:
- doc
- Document
debug(msg)
- Parameters:
- msg
dispositionResourceURL(code, type)
Returns disposition resource URL.
- Parameters:
- code
- Resource code
- type
- Resource type (IMG=image (default), ICO=Icon, CSS=stylesheet, JS=Javascript, HTML=HTML)
documentURL(object, field, rowId, docId)
Returns document URL.
- Parameters:
- object
- Object name
- field
- Field name
- rowId
- Object record row ID
- docId
- Document ID (can be omitted then a lookup is done on record matching rowId)
error(err)
- Parameters:
- err
getAppInfo(callback, params)
Loads application info data.
- Parameters:
- callback
- Callback function called when loading is completed (loaded application info data is passed to this function)
- params
- Optional parameters:
- async Asynchronous call (use default if absent) ?
- error Custom error handler (use default error handler if absent) ?
getAsync()
getBusinessObject(objName, objInstName, autoRefreshMetaData)
Get a new business object.
Sample usage:
Defined in: businessobject.js.
Sample usage:
// app is a Simplicite.Ajax instance var obj = app.getBusinessObject("MyObject");
Defined in: businessobject.js.
- Parameters:
- objName
- Object name
- objInstName
- Object instance name, optional (defauts to ajax_<object name>)
- autoRefreshMetaData
- Automatic refresh of metadata at each call (defaults to false)
getBusinessProcess(name)
Get a new business process.
Sample usage:
Defined in: businessprocess.js.
Sample usage:
// app is a Simplicite.Ajax instance var pcs = app.getBusinessProcess("MyProcess");
Defined in: businessprocess.js.
- Parameters:
- name
- Business process name
getExternalObject(callback, name, params)
Loads external object.
- Parameters:
- callback
- Callback function called when loading is completed (loaded external object is passed to this function)
- name
- External object name
- params
- Optional parameters:
- async Asynchronous call (use default if absent) ?
- error Custom error handler (use default error handler if absent) ?
getGateway()
getGrant(callback, params)
Loads grant data.
- Parameters:
- callback
- Callback function called when loading is completed (loaded grant data is passed to this function)
- params
- Optional parameters:
- inlinePicture Inline picture (false if absent or undefined)
- async Asynchronous call (use default if absent) ?
- error Custom error handler (use default error handler if absent) ?
getMenu(callback, params)
Loads menu data.
- Parameters:
- callback
- Callback function called when loading is completed (loaded menu data is passed to this function)
- params
- Optional parameters:
- async Asynchronous call (use default if absent) ?
- error Custom error handler (use default error handler if absent) ?
getNews(callback, params)
Loads news.
- Parameters:
- callback
- Callback function called when loading is completed (loaded news array is passed to this function)
- params
- Optional parameters:
- inlineImages Inline news images (false if absent or undefined)
- async Asynchronous call (use default if absent) ?
- error Custom error handler (use default error handler if absent) ?
getSysInfo(callback, params)
Loads system info data.
- Parameters:
- callback
- Callback function called when loading is completed (loaded system info data is passed to this function)
- params
- Optional parameters:
- async Asynchronous call (use default if absent) ?
- error Custom error handler (use default error handler if absent) ?
getSysParam(name, params, params)
Get system parameter value.
- Parameters:
- name
- System parameter name
- params
- Optional parameters:
- async Asynchronous call (use default if absent) ?
- error Custom error handler (use default error handler if absent) ?
- params
getSysParams(callback, params)
Loads system parameters.
- Parameters:
- callback
- Callback function called when loading is completed (loaded system parameters array is passed to this function)
- params
- Optional parameters:
- async Asynchronous call (use default if absent) ?
- error Custom error handler (use default error handler if absent) ?
getText(code)
Get text value.
- Parameters:
- code
- Text code
getTexts(callback, params)
Loads texts.
- Parameters:
- callback
- Callback function called when loading is completed (loaded texts array is passed to this function)
- params
- Optional parameters:
- async Asynchronous call (use default if absent) ?
- error Custom error handler (use default error handler if absent) ?
getTimeout()
info(msg)
- Parameters:
- msg
isFirefox()
isWebkit()
isWinIE()
login(successCallback, failureCallback)
Server side login (same as session()). Note that this call is forced to be a synchronous call.
- Parameters:
- successCallback
- Callback function called when login is sucessful
- failureCallback
- Callback function called when login fails
logout(successCallback, failureCallback, params)
Server side logout (does not work on some web browsers). Note that this call is forced to be a synchronous call.
- Parameters:
- successCallback
- Callback function called when login is sucessful
- failureCallback
- Callback function called when login fails
- params
- Optional parameters:
- async Asynchronous call (use default if absent) ?
- error Custom error handler (use default error handler if absent) ?
parseDateTimeValue(v)
Parse a date time value into a Javascript Date
- Parameters:
- v
- Date time value (YYYY-MM-DD hh:mm:ss)
parseDateValue(v)
Parse a date value into a Javascript Date
- Parameters:
- v
- Date value (YYYY-MM-DD)
resourceURL(id)
Returns resource URL.
- Parameters:
- id
- Resource ID (e.g. taken from business object or external object resources list in metadata)
session(successCallback, failureCallback)
Session init (retrieves server side session identifier). Note that this call is forced to be a synchronous call.
- Parameters:
- successCallback
- Callback function called when session init is sucessful
- failureCallback
- Callback function called when session init fails
setAsync(async)
- Parameters:
- async
setDebugHandler(debugHandler)
Change default global debug handler.
- Parameters:
- debugHandler
- Debug handler function
setDebugHandlerActive(active)
Set default global debug handler active or inactive.
- Parameters:
- active
- Active status
setErrorHandler(errorHandler)
Change default global error handler.
- Parameters:
- errorHandler
- Error handler function
setErrorHandlerActive(active)
Set default global error handler active or inactive.
- Parameters:
- active
- Active status
setGateway(gateway, login, password)
- Parameters:
- gateway
- login
- password
setInfoHandler(infoHandler)
Change default global information handler.
- Parameters:
- infoHandler
- Information handler function
setInfoHandlerActive(active)
Set default global information handler active or inactive.
- Parameters:
- active
- Active status
setSysParam(callback, name, value, save, params)
Set a user system parameter.
- Parameters:
- callback
- Callback function called when loading is completed (parameter is passed to this function)
- name
- Parameter name
- value
- Parameter value (if undefined parameter is unset)
- save
- Save parameter in user parameters (if undefined parameter is not saved)
- params
- Optional parameters :
- async Asynchronous call (use default if absent) ?
- error Custom error handler (use default error handler if absent) ?
setTimeout(timeout)
- Parameters:
- timeout
setVersionCompatibility(version)
Set default JSON services version compatibility
- Parameters:
- version
- Simplicite(R) JSON services version to be compatible with (e.g. 2.7)
setWarningHandler(warningHandler)
Change default global warning handler.
- Parameters:
- warningHandler
- Warning handler function
setWarningHandlerActive(active)
Set default global warning handler active or inactive.
- Parameters:
- active
- Active status
T()
Alias for getText
toDateTimeValue(d)
Parse a Javascript Date into a date time value
- Parameters:
- d
- Javascript date
toDateValue(d)
Parse a Javascript Date into a date value
- Parameters:
- d
- Javascript date
toTimeValue(d)
Parse a Javascript Date into a time value
- Parameters:
- d
- Javascript date
warning(msg)
- Parameters:
- msg
winIEVersion()