The functions in omada.wsproxy are for making it easy to work with the OIS UI web services.
Methods
(static) ConvertId(options) → {string|number}
Converts the (Guid) UId of an object to its (integer) Id or vice versa.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
id | string
|
number | UId or integer id of a configuration object. | async | bool | (optional) Set to false to run synchronously. Default: true. | success | function | (optional) Callback receiving the converted id. | objectType | string | (optional) Configuration object type. Default: DataObject. |
|
Returns:
Converted id when executed synchronously.
-
Type
- string
|
number
(static) getActiveUserFilterPermissions(options)
Retrieves the permissions of the active user for a specific Data Object filter.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
filterId | number | Identifier of the Data Object filter. | success | function | (optional) Callback: function(result)
Properties| Name | Type | Description |
|---|
result | object | Result object
Properties| Name | Type | Description |
|---|
permissions | array | Array of permission names granted to the active user. Possible values: Create, Read, Update, Delete. |
|
|
|
Example
omada.wsproxy.getActiveUserFilterPermissions({
filterId: 123,
success: function (result) {
console.log(result.permissions);
}
});
(static) getChartDataSet(options)
Retrieves a chart data set from a named data source.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
dataSource | string | Name of the data source. | dataSourceParams | object | (optional) Dictionary of data source parameters. Each property name must
correspond to a parameter supported by the data source and
should not begin with '@'. | success | function | (optional) Callback invoked with the chart data set. | error | function | (optional) Callback invoked when the request fails.
Receives an object containing the AJAX error information. |
|
Example
omada.wsproxy.getChartDataSet({
dataSource: "UserStatistics",
dataSourceParams: {
Department: "IT"
},
success: function (result) {
console.log(result.data);
},
error: function (err) {
console.error(err.textStatus);
}
});
(static) getDataObjectDisplayName(options)
Retrieves the display name of a Data Object.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
id | number | Id of the Data Object. | success | function | (optional) Callback invoked with the result object. |
|
Example
omada.wsproxy.getDataObjectDisplayName({
id: 123,
success: function (result) {
console.log(result.id);
console.log(result.displayName);
}
});
(static) getDataObjectGroupedCount(options) → {number}
Retrieves a grouped count of Data Objects matching the given filter expressions.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
viewuid | string | (optional) UId of a Data Object View. If supplied, an AccessModifier
defined on the Data Object View is applied to the load options. | groupProperty1 | string | System name of the Property or Fixed Field to group by
(first level). | groupProperty2 | string | (optional) System name of the Property or Fixed Field to group by
(second level). | expressions | array | (optional) Array of expression objects used to filter the Data Objects
being counted.
Properties| Name | Type | Description |
|---|
path | string | (optional) Reference path from the Data Objects being retrieved to the
Data Objects the expression is for. | property | string | (optional) System name of a Property or Fixed Field to filter on. | operator | string | (optional) Operator. One of:
Equals, LessThan, GtThan, LessThanEq, GtThanEq,
NotEquals, Like, In, NotIn. | value | string
|
bool
|
array | (optional) Filter value. Can be a string, boolean, or array of strings. |
| success | function | (optional) Callback invoked with the resulting count. | async | bool | (optional) Set to false to execute the request synchronously. Default: true. | error | function | (optional) Error callback. |
|
Returns:
The resulting count when executed synchronously.
When executed asynchronously, the result is provided through
the success callback.
-
Type
- number
Example
omada.wsproxy.getDataObjectGroupedCount({
groupProperty1: "TYPE",
expressions: [
{
property: "STATE",
operator: "Equals",
value: "Active"
}
],
success: function (count) {
console.log(count);
}
});
(static) getDataObjectTypeId(options)
Retrieves the Data Object Type Id of a Data Object.
Parameters:
| Name |
Type |
Description |
options |
object
|
Options object
Properties
| Name |
Type |
Description |
id |
number
|
Id of the Data Object (Required). |
success |
function
|
function (result)
Properties
| Name |
Type |
Description |
result |
object
|
Result object
Properties
| Name |
Type |
Description |
id |
number
|
Id of the Data Object |
typeId |
number
|
Id of the Data Object's Data Object Type |
|
|
|
(static) getDataObjectTypeViewInfo(options)
Retrieves view information for a specific Data Object Type.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
dataObjectTypeId | string
|
number | Id or UId of the Data Object Type used to filter views. | viewOwnerFlags | number | (optional) View owner flags. Refer to the ViewOwnerFlags_ constant. Default: ViewOwnerFlags_Default. | async | bool | (optional) Set to false to execute the request synchronously. Default: true. | success | function | Callback invoked with an array of ViewInfo objects. |
|
Throws:
Thrown when the required dataObjectTypeId parameter is not provided.
-
Type
- Error
(static) getDataObjects(options) → {object}
Retrieves a number of Data Objects.
If a Data Object is not accessible or doesn't exist it is omitted from the result.
Only the following Value Property Data Types are supported: Boolean, Integer, Decimal and Text.
Parameters:
| Name |
Type |
Description |
options |
object
|
Options object
Properties
| Name |
Type |
Description |
ids |
array
|
Array of ids of the Data Objects to be loaded. Can be either integer Ids or guid UIds. Tip: instead of specifying one or more ids it is (as an alternative) possible to just specify one or more expressions. |
path |
string
|
Specifies an optional reference path that will be applied to the specified ids. If omitted the Data Objects corresponding to the specified ids are returned. |
expressions |
array
|
Array of "expression" objects
Properties
| Name |
Type |
Description |
path |
string
|
Reference path from the Data Objects being retrieved to the Data Objects the expression is for. |
property |
string
|
System name of Property or Fixed Field to filter on |
operator |
string
|
Operator [Equals, LessThan, GtThan, LessThanEq, GtThanEq, NotEquals, Like, In, NotIn] |
value |
string
|
bool
|
array
|
Filter value. Can be either a: string, boolean or array of string.
An array of string is valid if the property is a Set- or Reference Property. It can then specify Ids or UIds. |
|
properties |
array
|
Array of system names of Properties to be loaded. If omitted (null) all Properties are loaded. |
sorting |
array
|
Array of FixField names or system names of Properties to be sorted on. If omitted (null) sorting is not performed.
If a name is postfixed with " desc" then the sorting is descending - else is it ascending.
Currently it is only possible to specify one sorting property. |
viewuid |
string
|
Optional UId of a Data Object View. If applied, an AccessModifer defined on the Data Object View will be applied to the load options.
Access to the Data Object View is respected.
If omitted the DOSM security model applies. |
keepPleaseWaitSplashOpen |
bool
|
(optional) default is false. Keeps waiting splash open after success call |
skipNonExisting |
bool
|
(optional) default is false. If set to true and uids provided, not found objects will be skipped. In other case error is thrown. |
success |
function
|
Callback: function(objects)
Properties
| Name |
Type |
Description |
objects |
array
|
An array of the objects.
Properties
| Name |
Type |
Description |
$Id |
number
|
Id of the Data Object. |
$DisplayName |
string
|
Display name of the Data Object. |
$UId |
string
|
UId of the Data Object. |
$TypeId |
number
|
Id of the Data Object's Data Object Type. |
$CreatedBy |
number
|
Id of User who created the Data Object. |
[property_system_name |
string
|
bool
|
number
|
array
|
For Set- and Reference Properties the value is an array of the value Ids. |
[property_system_name]_Names |
string
|
Present for Set- and Reference Properties: holds an array of the value names. |
|
|
success2 |
function
|
Callback: function(result)
Properties
| Name |
Type |
Description |
result |
object
|
Result object.
Properties
| Name |
Type |
Description |
objects |
array
|
An array of Data Objects. Each Data Object has fields as described above. |
inputOptions |
object
|
The options object provided as input for the function. |
|
|
async |
bool
|
default true |
error |
function
|
Callback: function(jqXHR, textStatus, errorThrown) |
|
Returns:
Returns an object:
.getObjectById: function (id, objects)
-
Type
-
object
Example
// Load and display all "Folder" Data Objects
omada.wsproxy.getDataObjects({
expressions: [{ property: 'Type', operator: 'Equals', value: 'FOLDER' }],
properties: [], // we're only interested in the DisplayName so we skip loading any properties
success2: function (result) {
var dispNames = [];
for (var i = 0; i < result.objects.length; i++)
dispNames.push(result.objects[i].$DisplayName);
showMessageDlg(S_COMMON_Text_DlgTitle_Message, result.objects.length + ' "Folder" Data Objects loaded: ' + dispNames.join(','));
}
});
(static) getFirstActivityForProcess(options)
Retrieves the first activity for a given process.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
processId | number
|
string | Id or UId of the process. | async | bool | (optional) Set to false to execute the request synchronously. Default: true. | success | function | (optional) Callback invoked with the first activity of the process. |
|
Throws:
Thrown when the required processId parameter is not provided.
-
Type
- Error
Example
omada.wsproxy.getFirstActivityForProcess({
processId: 123,
success: function (activity) {
console.log(activity);
}
});
(static) getProcessTemplates(options)
Retrieves a number of Process template Objects.
If a Process template Object is not accessible or doesn't exist it is omitted from the result.
Parameters:
| Name |
Type |
Description |
options |
object
|
Options object
Properties
| Name |
Type |
Description |
ids |
array
|
Array of ids of the Process template to be loaded. Can be either integer Ids or guid UIds. Tip: instead of specifying one or more ids it is (as an alternative) possible to just specify one or more expressions. |
expressions |
array
|
Array of "expression" objects
Properties
| Name |
Type |
Description |
path |
string
|
Reference path from the Data Objects being retrieved to the Data Objects the expression is for. |
property |
string
|
System name of Property or Fixed Field to filter on |
operator |
string
|
Operator [Equals, LessThan, GtThan, LessThanEq, GtThanEq, NotEquals, Like, In, NotIn] |
value |
string
|
bool
|
array
|
Filter value. Can be either a: string, boolean or array of string.
An array of string is valid if the property is a Set- or Reference Property. It can then specify Ids or UIds. |
|
success |
function
|
Callback: function(objects)
Properties
| Name |
Type |
Description |
objects |
array
|
An array of the objects.
Properties
| Name |
Type |
Description |
$Id |
number
|
Id of the Process template. |
$UId |
string
|
UId of the Process template. |
$DisplayName |
string
|
Display name of the Process template. |
$CreatedBy |
number
|
Id of User who created the Process template. |
$OwnerId |
number
|
Id of User set as Owner of the Process template. |
$CreatedTime |
number
|
Time of Process template creation. |
$TargetId |
number
|
Id of Target |
$TargetTypeId |
number
|
Id of target DataObject type. |
$TemplateId |
number
|
Template Id of the Process |
$State |
number
|
- |
|
|
|
Example
// Load and display all Process template created by System administrator
omada.wsproxy.getProcessTemplates({
expressions: [{ property: 'CREATEDBY', operator: 'Equals', value: 3502 }],
success: function (result) {
var dispNames = [];
for (var i = 0; i < result.length; i++)
dispNames.push(result[i].$DisplayName);
showMessageDlg(S_COMMON_Text_DlgTitle_Message, result.length + ' "Process Template" objects loaded: ' + dispNames.join(','));
}
});
(static) getProcessTemplatesPanelHtml(options)
Retrieves the HTML for a Process Templates panel.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
id | string | Id of the panel. | mode | string | Panel mode. One of: "Default", "Explicit", or "Menu". | columns | number | (optional) Number of columns with icons to display. Default: 2. | skipTabSet | bool | (optional) If true, skips rendering the tab set. Default: false. | explicitItems | array | (optional) Array of explicit items used when mode is "Explicit".
Properties| Name | Type | Description |
|---|
Id | string | (optional) UId of a process template, menu item, or view. | SubItems | array | (optional) Child items.
Properties| Name | Type | Description |
|---|
Id | string | (optional) UId of a process template, menu item, or view. |
|
| rootMenuItemId | string | (optional) UId of the root menu item. Navigation cannot move above this
menu item. | menuItemId | string | (optional) UId of the menu item whose child menu items and views should
be displayed. | folderMenuItemClick | string | (optional) Name of a function that accepts an object containing a
menuItemId property. | sortProperty | string | (optional) System name of the property used for sorting. | success | function | (optional) Callback invoked with the rendered panel. |
|
Example
omada.wsproxy.getProcessTemplatesPanelHtml({
id: "processTemplates",
mode: "Default",
success: function (result) {
$("#container").html(result.html);
}
});
(static) getProperties(options) → {array|undefined}
Retrieves property objects for the specified property identifiers.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
ids | array | Array of property Ids or UIds. | async | bool | (optional) Set to false to execute the request synchronously. Default: true. | success | function | (optional) Callback invoked with an array of property objects. |
|
Returns:
Returns the property objects when executed synchronously.
When executed asynchronously, the result is provided through
the success callback.
-
Type
- array
|
undefined
Example
omada.wsproxy.getProperties({
ids: [1, 2, 3],
success: function (properties) {
console.log(properties);
}
});
(static) getReferencePropertyControlValues(options)
Resolves reference property display values for Data Objects.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
ids | array | Array of Data Object Ids or UIds. | lookupViewId | number | Lookup view Id of the Reference Property whose values should
be resolved. | success | function | Callback invoked with an array of resolved objects. |
|
Example
omada.wsproxy.getReferencePropertyControlValues({
ids: [1, 2, 3],
lookupViewId: 100,
success: function (result) {
result.forEach(function (item) {
console.log(item.DisplayValue);
});
}
});
(static) getUIActions(options)
Retrieves the UI actions available for a specific page.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
page | string | Identifier or name of the page for which UI actions should be retrieved. | success | function | (optional) Callback invoked with an array of UI action objects.
Before the callback is executed, the properties
displayEvaluator and clickEvent are converted
from their serialized string representations into executable
functions when possible. |
|
Example
omada.wsproxy.getUIActions({
page: "Applications",
success: function (actions) {
actions.forEach(function (action) {
console.log(action.caption);
});
}
});
(static) getViewInfo(options)
Retrieves information about a view.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
viewId | string
|
number | Id or UId of the view. | async | bool | (optional) Set to false to execute the request synchronously. Default: true. | success | function | Callback invoked with the retrieved ViewInfo object. |
|
Throws:
Thrown when the required viewId parameter is not provided.
-
Type
- Error
(static) getWorkItemsPanelHtml(options)
Retrieves the HTML for a Work Items panel.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
id | string | Identifier of the panel. | columns | number | (optional) Number of columns with icons to display. Default: 3. | maxItems | number | (optional) Maximum number of work items to display. Default: 0. | success | function | (optional) Callback: function(result)
Properties| Name | Type | Description |
|---|
result | object | Result object
Properties| Name | Type | Description |
|---|
html | string | HTML of the rendered Work Items panel. |
|
|
|
(static) importDataObjects(options)
Imports (creates, updates, deletes) a number of Data Objects.
The function has two modes:
- "xml" mode where the input data is a string with DataObjectExchangeML xml data
- "objects" mode where the input data is an array of Data Object operations.
Depending on the mode the function executes two different web services.
Parameters:
| Name |
Type |
Description |
options |
object
|
Options object.
Properties
| Name |
Type |
Description |
xml |
string
|
String with DataObjectExchangeML xml data (using this puts the function in "xml" mode). |
objects |
array
|
Array of Data Object operations (using this puts the function in "objects" mode).
Properties
| Name |
Type |
Description |
id |
string
|
Data Object UId - required unless the operation is "create". |
type |
string
|
System name of a Data Object Type - whether required or not depends on the operation. |
operation |
string
|
["create", "update", "updateIfExists", "updateOrCreate", "delete", "deleteIfExists", "none"] |
[property_system_name]_v |
array
|
Array of values for a Property where each value is an object. |
[property_system_name]_v.value |
number
|
string
|
Set- or Reference Property: value must be an Id of a Set Property Value or a Data Object.
Value property w. datatype 'DateTime' or 'TimeSpan': value must be an xml encoded string value. |
[property_system_name]_v.isKeyReference |
bool
|
Bool indicating if "value" is a string that references a key-value (only relevant if the property is a Reference Property). |
|
settings |
object
|
Object (only used in "xml" mode).
Properties
| Name |
Type |
Description |
SkipImport |
bool
|
Set to true to only deserialize the xml data - don't perform the actual import. |
AllowedErrors |
number
|
Threshold for no. of allowed errors before the import terminates. |
|
success |
function
|
Callback: function(result)
Properties
| Name |
Type |
Description |
result |
object
|
Result object.
Properties
| Name |
Type |
Description |
CreatedObjectIds |
array
|
Array of Data Object Ids that has been created in the import. |
UpdatedObjectIds |
array
|
Array of Data Object Ids that has been updated in the import. |
DeletedObjectIds |
array
|
Array of Data Object Ids that has been deleted in the import. |
UnchangedObjectIds |
array
|
Array of Data Object Ids that are unchanged. |
Errors |
array
|
Array of error messages |
|
|
error |
function
|
Callback: function (jqXHR, textStatus, errorThrown)
If not specified a default error handler is used that alerts the error message.
Properties
| Name |
Type |
Description |
jqXHR |
|
|
textStatus |
|
|
errorThrown |
|
|
|
async |
bool
|
Default true |
|
Example
omada.wsproxy.importDataObjects({
objects: [{ type: 'FOLDER', operation: 'create', NAME_v: [{ value: 'My new folder' }] }],
success: function (result) {
showMessageDlg(S_COMMON_Text_Warning, 'Import completed - created ' + result.CreatedObjectIds.length + ' Data Objects');
},
error: function (jqXHR, textStatus, errorThrown) {
omada.ajaxHelper.alertAjaxError(this, jqXHR, textStatus);
}
});
(static) isModuleLicensed(options)
Runs a module license check.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
moduleKey | string | License module key to check. | handler | function | Callback: function(result)
Properties| Name | Type | Description |
|---|
result | object | Result object
Properties| Name | Type | Description |
|---|
result | bool | True if the module is licensed; otherwise false. |
|
|
|
Example
omada.wsproxy.isModuleLicensed({
moduleKey: "IdentityManagement",
handler: function (result) {
if (result.result) {
console.log("Module is licensed");
}
}
});
(static) propertyExists(options)
Determines whether a property exists.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
propertySystemName | string | System name of the property. | dataObjectTypeSystemName | string | (optional) System name of the Data Object Type that owns the property. | async | bool | (optional) Set to false to execute the request synchronously. Default: true. | success | function | (optional) Callback invoked with the result. Receives true if the property
exists; otherwise false. |
|
Example
omada.wsproxy.propertyExists({
propertySystemName: "Email",
dataObjectTypeSystemName: "Person",
success: function (exists) {
console.log(exists);
}
});
(static) resolvePropertyValues(options)
Resolves a textual value for a Property into a number of property values.
The function is used when typing in and resolving a value for a Set- or Reference Property.
Parameters:
| Name |
Type |
Description |
options |
object
|
Options object.
Properties
| Name |
Type |
Description |
property |
string
|
System name of the Property we are resolving values for. Must be either a Reference- or a Set Property. |
searchStr |
string
|
Search string we want to resolve to a number of values based on. |
maxResults |
number
|
Maximum number of results to return. |
pageContextResolver |
function
|
function which will be called to create a page context string. The function must return a string |
viewId |
number
|
Integer ID of the view to use when auto completing / drop down options. |
success |
function
|
function (result)
Properties
| Name |
Type |
Description |
result |
object
|
The result object is a dictionary where the fields are value Ids and the values are value names.
Properties
| Name |
Type |
Description |
[id |
number
|
Id of the property value. Is either a Data Object Id or a Set Property Value Id. |
[name |
string
|
Name of the property value. Is either a Data Object Display Name or a Set Property Value Name. |
|
|
async |
bool
|
Default true. |
|
Example
omada.wsproxy.resolvePropertyValues({
property: 'IDENTITYREF',
searchStr: 'some value',
maxResults: 10,
success: function (result) {
for (var id in result)
showMessageDlg(S_COMMON_Text_DlgTitle_Message, 'Id:' + id + ', Name:' + result[id]);
}
});
(static) runControlPolicy(options)
Evaluates a control policy and launches or updates a survey for managing new policy exceptions.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
policyId | string | Id or UId of the Control Policy (required). | success | function | (optional) Callback: function(result)
Properties| Name | Type | Description |
|---|
result | object | Result object
Properties| Name | Type | Description |
|---|
exceptionCount | number | Number of exceptions created. | maxViolationsReached | bool | True if the max violations threshold of the control policy has been reached. |
|
|
|
Example
omada.wsproxy.runControlPolicy({
policyId: '2E03DE34-75C4-4C61-8F84-0156F094677D',
success: function (result) {
showMessageDlg(S_COMMON_Text_DlgTitle_Message, result.exceptionCount + ' exception(s) created');
}
});
Sets the dimensions of a form.
Parameters:
| Name | Type | Description |
|---|
options | object | Options object
Properties| Name | Type | Description |
|---|
formId | string | Id of the form. | width | number | Width to set on the form. | height | number | Height to set on the form. | async | bool | (optional) Set to false to execute the request synchronously. Default: true. | success | function | (optional) Callback invoked when the form dimensions have been updated. |
|
Example
omada.wsproxy.setFormDimensions({
formId: "MyForm",
width: 1200,
height: 800,
success: function (result) {
console.log("Dimensions updated.");
}
});
(static) startSignalRHub(options, connection)
Start the SignalR hub and invoke functions on specific hubs
Parameters:
| Name |
Type |
Description |
options |
object
|
Options object
Properties
| Name |
Type |
Description |
success |
function
|
Callback: function() This function is called when the SignalR hub is ready. In here you can invoke functions in all hubs |
reconnecting |
function
|
Callback: function() This function is called when SignalR is aware of a disconnection and is going into reconnecting mode |
disconnected |
function
|
Callback: function() This function is called when SignalR is aware of a disconnection and is trying to reconnect |
fail |
function
|
Callback: function(exception) This function is called when an exception is thrown in a hub. |
enableLogging |
bool
|
Enable log output in the browser console (default is true) |
|
connection |
|
optional connection object, if you don't want to use the connection generated by the proxy |
Example
// Delete data objects
omada.wsProxy.startSignalRHub({
success: function () {
omada.dataObjLst.dataObjectsHub.server.deleteDataObjects(idsToDelete).done(function (result) {
progBar.hide();
omada.appList.reloadGrid();
})
},
fail: function (exception) {
//Do something
}
});