entityService
Summary
Defines an entity service to create / update or remove an entity.
Item Index
Methods
addEntities
Syntax
addEntities
-
entityType
-
[pluginName="core"]
-
data
Summary
Adds new entities.
Parameters:
Returns:
The HTTP promise
deleteCache
Syntax
deleteCache
-
[entityType]
-
[pluginName]
Summary
Deletes cache of the given entity type.
getAllEntities
Syntax
getAllEntities
-
entityType
-
[pluginName="core"]
-
param
-
[canceller]
Summary
Gets all entities of a specific type.
This should be used wisely as it may launch several requests to get all entities which could lead to real performance issues. Use it when you are sure about the total number of entities.
Parameters:
-
entityType
StringType of entity
-
[pluginName="core"]
String optionalPlugin name the entity belongs to
-
param
ObjectRequest parameters
-
[include]
String | Array optionalThe list of fields to include from returned entities
-
[exclude]
String | Array optionalThe list of fields to exclude from returned entities. Ignored if include is also specified.
-
[query]
String optionalSearch query to search on entities searchable fields
-
[sortBy]
String optionalThe field to sort by
-
[sortOrder="desc"]
String optionalThe sort order (either "asc" or "desc")
-
-
[canceller]
Promise optionalThe HTTP promise to cancel request if needed, resolve the promise to cancel the request
Returns:
The HTTP promise
getEntities
Syntax
getEntities
-
entityType
-
[pluginName]
-
param
-
[canceller]
Summary
Gets entities.
Parameters:
-
entityType
StringType of entity
-
[pluginName]
String optionalPlugin name the entity belongs to, null for core
-
param
ObjectRequest parameters
-
[include]
String | Array optionalThe list of fields to include from returned entities
-
[exclude]
String | Array optionalThe list of fields to exclude from returned entities. Ignored if include is also specified.
-
[query]
String optionalSearch query to search on entities searchable fields
-
[page=0]
Number optionalThe expected page in pagination system
-
[limit=10]
Number optionalThe maximum number of expected results
-
[sortBy]
String optionalThe field to sort by
-
[sortOrder="desc"]
String optionalThe sort order (either "asc" or "desc")
-
-
[canceller]
Promise optionalThe HTTP promise to cancel request if needed, resolve the promise to cancel the request
Returns:
The HTTP promise
Example:
// Get the first page of Web Service applications containing string "Search string" sorted by name with 10
// applications per page. Field "name" won't be returned.
var params = {
query: 'Search string',
limit: 10,
page: 0,
sortBy: 'name',
sortOrder: 'desc',
exclude: ['name']
};
getEntities('applications', 'core', params);
removeEntities
Syntax
removeEntities
-
entityType
-
[pluginName="core"]
-
ids
Summary
Removes entities.
Parameters:
Returns:
The HTTP promise