new RMP_IncludedCollection()
Methods
-
aggregateCallback(pipelines, options, callbackSuccess, callbackFailure)
-
Aggregate a collection.
Parameters:
Name Type Description pipelinesobject an array of pipelines. optionsobject options to be used during the call
Properties
Name Type Argument Description modestring <optional>
execution mode of the collection (TEST or LIVE), defaults to the current execution mode of the application nbnumber <optional>
number of objects to be returned (maximum is 100), used to paginate results firstnumber <optional>
index of the first object to be returned, used to paginate results orderbyarray <optional>
array of fields to be used to order the results, e.g [name, lastname], a $sort pipeline will be appended to given pipelines orderarray <optional>
array of orders to be used to order the results, there must be one order for each orderby, e.g [asc,desc] detailedboolean <optional>
true to get a detailed result (includes count limit and skip values) asynchronousboolean <optional>
false to make a synchronous call, true otherwise (default is true) callbackSuccessRMP_IncludedCollection~callbackSuccess a callback function called in case of a success callbackFailureRMP_IncludedCollection~callbackFailure a callback function called in case of a failure -
aggregateExt(pipelines, options)
-
Aggregate a collection.
Parameters:
Name Type Description pipelinesobject an array of pipelines. optionsobject option to be used during the call
Properties
Name Type Argument Description modestring <optional>
execution mode of the collection (TEST or LIVE), defaults to the current execution mode of the application nbnumber <optional>
number of objects to be returned (maximum is 100), used to paginate results firstnumber <optional>
index of the first object to be returned, used to paginate results orderbyarray <optional>
array of fields to be used to order the results, e.g [name, lastname], a $sort pipeline will be appended to given pipelines orderarray <optional>
array of orders to be used to order the results, there must be one order for each orderby, e.g [asc,desc] detailedboolean <optional>
true to get a detailed result (includes count limit and skip values) asynchronousboolean <optional>
false to make a synchronous call, true otherwise (default is true) onSuccessRMP_IncludedCollection~callbackSuccess a callback function called in case of a success onFailureRMP_IncludedCollection~callbackFailure a callback function called in case of a failure -
getName() → {String}
-
This function returns the id as string of the widget
Returns:
- Type
- String
-
getType() → {String}
-
This function returns the type of the widget(RMP_Image, RMP_Html, RMP_Scripter, RMP_StaticTextwidget, RMP_Button, RMP_TextInput, RMP_ListBox, RMP_MultiSelectionCheckBox, RMP_RadioButton, RMP_Array, RMP_FileUpload... )
Returns:
- Type
- String
-
list(pattern, options, callbackSuccess, messageFailure)
-
List objects matching a given pattern
Parameters:
Name Type Description patternobject pattern to be matched in the collection optionsobject option to be used during the call. Same fields as #listExt options, except for the callbacks. callbackSuccessRMP_IncludedCollection~callbackSuccess a callback function called in case of a success messageFailureString message displayed in case of a failure -
listCallback(pattern, options, callbackSuccess, callbackFailure)
-
List objects matching a given pattern
Parameters:
Name Type Description patternobject pattern to be matched in the collection optionsobject option to be used during the call. Same fields as #listExt options, except for the callbacks. callbackSuccessRMP_IncludedCollection~callbackSuccess a callback function called in case of a success callbackFailureRMP_IncludedCollection~callbackFailure a callback function called in case of a failure -
listExt(pattern, options)
-
List objects matching a given pattern.
Parameters:
Name Type Description patternobject pattern to be matched in the collection optionsobject options to be used during the call Properties
Name Type Description fieldsobject array of fields to be retrieved for each found object, e.g [name, lastname] modestring execution mode of the collection (TEST or LIVE), defaults to the current execution mode of the application nbnumber number of objects to be returned (maximum is 100), used to paginate results firstnumber index of the first object to be returned, used to paginate results orderbyarray array of fields to be used to order the results, e.g [name, lastname] orderarray array of orders to be used to order the results, there must be one order for each orderby, e.g [asc,desc] detailedboolean true to get a detailed result (includes count limit and skip values) asynchronousboolean false to make a synchronous call, true otherwise (default is true) onSuccessRMP_IncludedCollection~callbackSuccess a callback function called in case of a success onFailureRMP_IncludedCollection~callbackFailure a callback function called in case of a failure -
load(pattern, options, callbackSuccess, messageFailure)
-
Load the first object of the collection, matching the given pattern
Parameters:
Name Type Description patternobject object to be retrieved in the collection. optionsobject options to be used during the call. Same fields as #listExt options, except for the callbacks. callbackSuccessRMP_IncludedCollection~loadCallbackSuccess callback to be used in case of a success messageFailureString message displayed in case of a failure -
loadCallback(pattern, options, callbackSuccess, callbackFailure)
-
Load the first object of the collection, matching the given pattern
Parameters:
Name Type Description patternobject object to be retrieved in the collection. optionsobject options to be used during the call. Same fields as #listExt options, except for the callbacks. callbackSuccessRMP_IncludedCollection~loadCallbackSuccess callback to be used in case of a success callbackFailureRMP_IncludedCollection~callbackFailure a callback function called in case of a failure -
loadExt(pattern, options)
-
Load the first object of the collection, matching the given pattern.
Parameters:
Name Type Description patternobject object to be retrieved in the collection. optionsobject options to be used during the call. Same fields as #listExt options. options.nb will be set to 1 and options.first will be set to 0. -
remove(pattern, messageSuccess, messageFailure)
-
Remove objects matching a given pattern
Parameters:
Name Type Description patternobject pattern to be matched in the collection messageSuccessString message displayed in case of a success messageFailureString message displayed in case of a failure -
removeCallback(pattern, callbackSuccess, callbackFailure)
-
Remove objects matching a given pattern
Parameters:
Name Type Description patternobject pattern to be matched in the collection callbackSuccessRMP_IncludedCollection~countCallbackSuccess a callback function called in case of a success callbackFailureRMP_IncludedCollection~callbackFailure a callback function called in case of a failure -
removeExt(pattern, options)
-
Remove objects matching a given pattern
Parameters:
Name Type Description patternobject pattern to be matched in the collection optionsobject option to be used during the call Properties
Name Type Description modestring execution mode of the collection (TEST or LIVE), defaults to the current execution mode of the application asynchronousboolean false to make a synchronous call, true otherwise (default is true) onSuccessRMP_IncludedCollection~countCallbackSuccess a callback function called in case of a success onFailureRMP_IncludedCollection~callbackFailure a callback function called in case of a failure -
save(object, messageSuccess, messageFailure)
-
Save an object to the collection
Parameters:
Name Type Description objectobject the object to be saved messageSuccessString message displayed in case of a success messageFailureString message displayed in case of a failure -
saveCallback(object, callbackSuccess, callbackFailure)
-
Save an object to the collection
Parameters:
Name Type Description objectobject the object to be saved callbackSuccessRMP_IncludedCollection~saveCallbackSuccess callback to be used in case of a success callbackFailureRMP_IncludedCollection~callbackFailure a callback function called in case of a failure -
saveExt(object, options)
-
Save an object to the collection.
Parameters:
Name Type Description objectobject the object to be saved optionsobject options to be used during the call Properties
Name Type Description modestring execution mode of the collection (TEST or LIVE), defaults to the current execution mode of the application asynchronousboolean false to make a synchronous call, true otherwise (default is true) onSuccessRMP_IncludedCollection~saveCallbackSuccess a callback function called in case of a success onFailureRMP_IncludedCollection~callbackFailure a callback function called in case of a failure -
update(pattern, object, messageSuccess, messageFailure)
-
Update one object of the collection
Parameters:
Name Type Description patternobject pattern to be matched in the collection objectobject the value to be used to update the matching object messageSuccessString message displayed in case of a success messageFailureString message displayed in case of a failure -
updateCallback(pattern, object, callbackSuccess, callbackFailure)
-
Update one object of the collection
Parameters:
Name Type Description patternobject pattern to be matched in the collection objectobject the value to be used to update the matching object callbackSuccessRMP_IncludedCollection~countCallbackSuccess a callback function called in case of a success callbackFailureRMP_IncludedCollection~callbackFailure a callback function called in case of a failure -
updateExt(pattern, object, options)
-
Update objects of the collection.
Parameters:
Name Type Description patternobject the pattern used to find the object to be modified objectobject the value to be used to update the matching object optionsobject options to be used for the call Properties
Name Type Description multiboolean true to update all matching objects, false to update only the first matching object. If you set multi to true, you have to use '$' operators in object, otherwise the call will silently fails modestring execution mode of the collection (TEST or LIVE), defaults to the current execution mode of the application asynchronousboolean false to make a synchronous call, true otherwise (default is true) onSuccessRMP_IncludedCollection~countCallbackSuccess a callback function called in case of a success onFailureRMP_IncludedCollection~callbackFailure a callback function called in case of a failure -
updateMulti(pattern, object, messageSuccess, messageFailure)
-
Update multiple objects of the collection
Parameters:
Name Type Description patternobject pattern to be matched in the collection objectobject operations ('$' operators) to be executed on the matching objects messageSuccessString message displayed in case of a success messageFailureString message displayed in case of a failure -
updateMultiCallback(pattern, object, callbackSuccess, callbackFailure)
-
Update multiple objects of the collection
Parameters:
Name Type Description patternobject pattern to be matched in the collection objectobject operations ('$' operators) to be executed on the matching objects callbackSuccessRMP_IncludedCollection~countCallbackSuccess a callback function called in case of a success callbackFailureRMP_IncludedCollection~callbackFailure a callback function called in case of a failure
Type Definitions
-
callbackFailure(response)
-
Collection operation failure callback
Parameters:
Name Type Description responseobject an object with the following properties Properties
Name Type Description responseJSONobject an object responses.responseJSON.errorstring the error message transmitted by the server -
callbackSuccess(response)
-
Collection operation success callback
Parameters:
Name Type Description responseobject If detailed is false response is an array containing the results. if detailed is true, response is an object with properties Properties
Name Type Description valuesarray an array containing the objects result of the aggregation countnumber the length of values array limitnumber the max number of items returned as specified in the pipelines skipnumber the rank of the first item returned as specified in the pipelines -
countCallbackSuccess(response)
-
Collection operation success callback, when a count is expected
Parameters:
Name Type Description responseobject an object with properties Properties
Name Type Description P_countnumber the number of removed/updated objects -
loadCallbackSuccess(response)
-
Collection operation success callback, when an object is expected
Parameters:
Name Type Description responseobject the object loaded -
saveCallbackSuccess(response)
-
Collection operation success callback, when a saved object is expected
Parameters:
Name Type Description responseobject the new version of the saved object