The CSObjectMultiple class handles the querying of several iCM objects.
The CSObjectMultiple class includes methods for the retrieval, update and removal of several objects. All such methods require that certain database and key information (ObjectList for example) be specified via the properties provided, prior to their invocation.
iCM Objects are identified either by their unique ID or their Type and Label used in combination.
The ability to search object data for specific information is also handled by this class. Values of all elements that have been flagged as searchable within the Object Types section of iCM Management can be searched using this class.
All database access/connectivity is handled internally by the CSObjectMultiple class.
For a general overview of iCM objects, see Object Types.
Methods
Parameters must use the get-set structure described in the introduction - Java API (CSObjects).
get a string (comma separated) that lists the properties whose values should be returned, an asterisk to indicate that all properties should be returned, or an empty string to return nothingset the properties which should be set before the specified method is performed
CSObjectMultiple_delete
Deletes the set objects from the database.
Request Parameters
Name | Type | Description |
---|---|---|
get | String | Set as an empty string |
set.ObjectList | String | Optional. A comma separated list of Object IDs to delete |
set.LabelList | String | Optional. A comma separated list of Object Labels. Set LabelList and Type to delete these objects |
set.Type | String | Set Type on its own to delete all objects of that type from the database. Can be used in combination with LabelList or on its own |
{
"get": "",
"set": {
"ObjectList": "1,2,3",
"LabelList": "label1,label2,label3",
"Type": "MYOBJECT"
}
}
Response
Name | Type | Description |
---|---|---|
data.multipleItemData | Array | The empty object structures. Will include the deleted ID if requested |
data.itemData | Object | The properties of the request, if present |
{
"id": 13,
"result": {
"data": {
"multipleItemData": [{}, {}],
"itemData": {}
},
"success": true
},
"jsonrpc": "2.0"
}
Example
Request:
function(params, credentials) {
var object = this.callWorkerMethod("icmapi", "CSObjectMultiple_delete", {
"get": "",
"set": {
"ObjectList": "20079,20080,20081"
}
});
return object;
}
CSObjectMultiple_exist
Checks to see whether iCM objects exist in the database.
Request Parameters
Name | Type | Description |
---|---|---|
get | String | Set as an empty string |
set.ObjectList | String | Optional. A comma separated list of Object IDs |
set.LabelList | String | Optional. Required if Type is used |
set.Type | String | Optional. Required if LabelList is used |
{
"get": "",
"set": {
"ObjectList": "1,2,3",
"LabelList": "label1,label2,label3",
"Type": "MYOBJECT"
}
}
Response
Name | Type | Description |
---|---|---|
data.MultipleItemData | Array | The properties of the request, if present |
data.returnValue | Boolean | True if all of the objects exist. False if any one of the listed objects does not exist |
{
"id": 33,
"result": {
"data": {
"multipleItemData": [{}, {}, {}],
"returnValue": true,
"itemData": {}
},
"success": true
},
"jsonrpc": "2.0"
}
Example
Request:
Note the use of
function(params, credentials) {
var object = this.callWorkerMethod("icmapi", "CSObjectMultiple_exist", {
"get": "",
"set": {
"ObjectList": "20087,20088,20089"
}
}, {
"rawMode": true
});
return object;
}
Response:
{
"id": 33,
"result": {
"data": {
"multipleItemData": [{}, {}, {}],
"returnValue": false,
"itemData": {}
},
"success": true
},
"jsonrpc": "2.0"
}
CSObjectMultiple_get
Retrieves the details of several iCM objects from the database. The amount of information returned is set by the DetailLevel property.
Request Parameters
Name | Type | Description |
---|---|---|
get | String | A comma separated list of properties to return |
set.DateAction | Integer | Optional. Both StartDate and EndDate must be set. 1- CREATED. Objects created between the two dates 2 - LAST_UPDATED. Objects last updated between the two dates 1|2 - Objects created or updated between the two dates |
set.DetailLevel | Integer | Optional. The detail level, default: 4 |
set.EndDate | DateTime | Optional. Used with DateAction |
set.ObjectList | String | Optional. A comma separated list of Object IDs. The retrieved objects will be returned in the order that their IDs appear within the list |
set.LabelList | String | Optional, used with Type. A comma separated list of Object Labels |
set.MaxRows | Integer | Optional. The maximum number to return |
set.SortOrder | String | Optional. Used with Type when returning all objects of a type, see below |
setStartDate | DateTime | Optional. Used with DateAction |
set.StartRow | Integer | Optional. The row to start from |
set.Type | String | Optional. Set Type on its own to return the details of all objects of the specified type. By default, the objects will be retrieved in descending creation date. This can be overridden using the SortOrder property. The StartRow and MaxRows properties can be used to restrict the number of objects that are retrieved |
set.UseSearchables | Boolean | Optional. Rather than specifiying Types, Labels or Object IDs you can search for objects. See below |
{
"get":"",
"set":{
"DetailLevel": 2,
"ObjectList": "1,2,3",
"LabelList": "label1,label2,label3",
"MaxRows": 3,
"SortOrder": "DATETIMECREATED ASC",
"StartRow": 5,
"Type": "MYOBJECT"
"UseSearchables": false,
"DateAction": 1,
"StartDate": "2022-10-28T09:30:00Z",
"EndDate": "2022-10-28T10:30:00Z"
}
}
Response
Name | Type | Description |
---|---|---|
data.MultipleItemData | Array | An array of CSObjects containing the properties of the get request |
"result": {
"data": {
"multipleItemData": [{},{},{}],
"itemData": {
"_ItemClass": "CSObjectMultiple"
}
},
"success": true
}
Example
Request:
function(params, credentials) {
var object = this.callWorkerMethod("icmapi", "CSObjectMultiple_get", {
"get": "ObjectData,ObjectID",
"set": {
"Type": "EXAMPLEHOUSE",
"DateAction": 1,
"StartDate": "2022-10-28T09:30:00Z",
"EndDate": "2022-10-28T10:30:00Z"
}
});
return object;
}
Response:
{
"id": 82,
"result": [{
"_ItemClass": "CSObject",
"ObjectID": 20092,
"ObjectData": {
"NUMBER": 1,
"ROAD": "Darklake View"
}
}, {
"_ItemClass": "CSObject",
"ObjectID": 20091,
"ObjectData": {
"NUMBER": 2,
"ROAD": "Darklake View"
}
}, {
"_ItemClass": "CSObject",
"ObjectID": 20090,
"ObjectData": {
"NUMBER": 3,
"ROAD": "Darklake View"
}
}, {
"_ItemClass": "CSObject",
"ObjectID": 20083,
"ObjectData": {
"NUMBER": 4,
"ROAD": "Darklake View"
}
}, {
"_ItemClass": "CSObject",
"ObjectID": 20082,
"ObjectData": {
"NUMBER": 5,
"ROAD": "Darklake View"
}
}],
"jsonrpc": "2.0"
}
CSObjectMultiple_update
Update is used to update existing, or create new, objects of a defined type. To update existing objects either the ObjectID or Type and Label must be supplied.
To create new objects the Type must already exist and a new unique Label should be supplied for each.
Request Parameters
Name | Type | Description |
---|---|---|
get | String | A comma separated list of properties to return |
set.itemData | Object, required | Holds the properties of the CSObjectMultiple class itself, can be left empty |
set.multipleItemData | Array of objects | An array of objects each of which contains the details of the objects to update or create. See update in CSObject |
{
"get": "",
"set": {
"itemData": {},
"multipleItemData": [{
"Label": generateUUID(),
"Type": "ANOTHERTYPE",
"ObjectData": {
"ANOTHERPROPERTY": "Tim"
}
}, {
"Label": generateUUID(),
"Type": "ANOTHERTYPE",
"ObjectData": {
"ANOTHERPROPERTY": "Tim"
}
}]
}
}
Properties
Property | Type | Description |
---|---|---|
DateAction | Integer | The type of objects that are of interest when the StartDate and EndDate properties are used. Both StartDate and EndDate must be set. 1- CREATED. Objects created between the two dates 2 - LAST_UPDATED. Objects last updated between the two dates 1|2 - Objects created or updated between the two dates |
DetailLevel | Integer | The level of detail returned. Either: 1 - ID. Just the Object ID 2 - SUMMARY. The ID, Type and Label 3 - DETAIL. The ID, Type, Label, DateCreated, DateLastUpdated, CreatedBy and LastUpdatedBy 4 - ALL. Everything, including the object's data Default: 4. We recommend setting the detail level to something other than 4 if the data is not needed to improve performance |
EndDate | DateTime | Used with DateAction. Objects changed/updated/created before this date (inclusive) will be retrieved, for example "2018-01-12T10:29:59Z" |
LabelGreaterThan | String | A string which the label should be greater than. Used with Type or UseSearchables |
LabelGreaterThanOrEquals | String | A string which the label should be greater than or equal to. Used with Type or UseSearchables |
LabelLessThan | String | A string which the label should be less than. Used with Type or UseSearchables |
LabelLessThanOrEquals | String | A string which the label should be less than or equal to. Used with Type or UseSearchables |
LabelLike | String | A pattern which the label should match according to the SQL LIKE operator. Used with Type or UseSearchables |
LabelList | String | A comma separated list of object labels. Used with Type |
Logic | String | Only relevant when UseSearchables is true. Compares the contents of the element specified via Var with the value specified via Value. See below |
ObjectList | String | A comma separated list of object IDs. |
SolrURL | String | The Solr URL. Must be supplied when UseSearchables is set to true |
SortOrder | String | A comma separated list of sort orders. Available sort orders when not in search mode (UseSearchables set to false) are: OBJECTID - Order by ObjectID IDTYPE - Order by Object Type name LABEL - Order by Label DATETIMECREATED - Order by time created DATETIMELASTUPDATED - Order by last updated time Use ASC or DESC to indicate the direction of ordering, eg "OBJECTID DESC" Available sort orders when in search mode (UseSearchables set to true) are: ASC DESC Where the ordering is the value that's being searched on |
StartDate | DateTime | Used with DateAction. Objects changed/updated/created after this date (inclusive) will be retrieved, for example "2018-01-12T10:29:59Z" |
TolerateNotFound | Boolean | By default, if a requested object is not found a CSNotFoundException will be raised. Set the TolerateNotFound property to true to prevent these exceptions from being generated |
Type | String | The type of this object |
UpdateData | Boolean | Default: false. If true, any new properties that have been added to the type definition since this object was created will be added to the ObjectData when it is retrieved. ObjectData saved in the database will be unaffected until an update call is performed following the retrieval of the UpdateData |
User | Integer | The UserID that the CreatedBy/LastUpdatedBy property of retrieved objects should match |
UserAction | Integer | The type of changes that are of interest when either of the User or Username properties are used. Either: 1- CREATED 2 - LAST_UPDATED 1|2 - Objects created or updated |
Username | String | The Username that the CreatedBy/LastUpdatedBy property of retrieved objects should match |
UserProfileType | String | Default: USERPROFILE. Gets/sets the object type that is used to store user profile information. The type is used to identify insert/update/delete of user profile objects so that, for example, the appropriate gateway messages can be triggered to ensure the site user search index is kept up to date |
UseSearchables | Boolean | Set UseSearchables to true in order to retrieve the details of all objects whose searchable elements matches the criteria specified via the Var, Value and Logic properties. Note that this property can only be used with |
Value | String | The value that is to be used as the only or lower range setting in a search operation. See below |
Value2 | String | The value that is to be used as the second (upper) filter value in a LOGIC_BETWEEN search operation. See below |
Var | String | The fully qualified name of the object property you would like to search, for example BILLTO.ELECTRONICINFO.EMAIL. See below |
VarSubtype | String | The VarSubtype property (together with the VarType property) may be used in place of or in addition to the Type property. See below |
VarType | String | The VarType property may be used in place of or in addition to the Type property. When used in addition to Type property it removes the need to load the data type definition in order to ascertain the data type from the original object type definition. See below |
Comparing Labels
Object labels are strings. When comparing labels using the LableGreaterThan and LabelLessThan properties, they are compared lexicographically (ie using alphabetical ordering).
Assume objects exist with the labels "MyNewerLabel", "MyNewLabel" and "MyNewLabels".
"MyNewLabels" is greater than "MyNewLabel" because it comes after it alphabetically. "MyNewerLabel" is less than "MyNewLabel" because it comes before it alphabetically.
UseSearchables
The properties within an Object Type Definition can be set as searchable. If true the values of those properties are indexed by the iCM search provider and can be queried using the UseSearchables property. UseSearchables can only be used with
When using UseSearchables, SolrURL, Logic, Var and Value are required. Either Type (the object type within which to search) or VarType are also required.
VarType is one of CHAR, LONGCHAR, INTEGER, NUMERIC or DATETIME.
Logic
The logic operators when using UseSearchables are:
Operator | Description |
---|---|
= | Equals. Will find matches if the contents of the Var property is equal to the value of the Value property |
< | Less than. Will find matches if the contents of the Var property is deemed to be less than the value of the Value property |
<= | Less than or equal. Will find matches if the contents of the Var property is deemed to be less than or equal to the value of the Value property |
> | Greater than. Will find matches if the contents of the Var property is deemed to be greater than the value of the Value property |
>= | Greater than or equal. Will find matches if the contents of the Var property is deemed to be greater than or equal to the value of the Value property |
LIKE | Compares the contents of the Var property to the value of the Value property. Wildcards can be inserted using % |
BETWEEN | Will find a match of all items between the Value and Value2 properties |
CONTAINS | Will find a match if the contents of the element specified via the Var property contains the value specified via the Value and Value2 properties |
FUZZY | Will find a match if the contents of the element specified via the Var property are deemed to be approximately equal to the value specified via the Value property |
Example
In this example, the search is restricted to objects of the EXAMPLEHOUSE type. We are looking for all objects that have a value of "Darklake View" in their ROAD property.
function(params, credentials) {
var object = this.callWorkerMethod("icmapi", "CSObjectMultiple_get", {
"get": "ObjectData,ObjectID",
"set": {
"UseSearchables": true,
"SolrURL": "http://localhost:5506/solricm",
"Logic": "=",
"Type": "EXAMPLEHOUSE",
"Var": "ROAD",
"Value": "Darklake View"
}
});
return object;
}