OpenVeo AngularJS back end

API Docs for: 7.0.0
Show:

entityService

Summary

Defines an entity service to create / update or remove an entity.

Methods

addEntities

Syntax

addEntities

(
  • entityType
  • [pluginName="core"]
  • data
)
HttpPromise

Summary

Adds new entities.

Parameters:

  • entityType String

    The type of the entities

  • [pluginName="core"] String optional

    Plugin name the entities belong to

  • data Array

    The list of entities

Returns:

HttpPromise:

The HTTP promise

deleteCache

Syntax

deleteCache

(
  • [entityType]
  • [pluginName]
)

Summary

Deletes cache of the given entity type.

Parameters:

  • [entityType] String optional

    The entity type or null to remove all cache

  • [pluginName] String optional

    Plugin name the entity belongs to, null for core

getAllEntities

Syntax

getAllEntities

(
  • entityType
  • [pluginName="core"]
  • param
  • [canceller]
)
HttpPromise

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 String

    Type of entity

  • [pluginName="core"] String optional

    Plugin name the entity belongs to

  • param Object

    Request parameters

    • [include] String | Array optional

      The list of fields to include from returned entities

    • [exclude] String | Array optional

      The list of fields to exclude from returned entities. Ignored if include is also specified.

    • [query] String optional

      Search query to search on entities searchable fields

    • [sortBy] String optional

      The field to sort by

    • [sortOrder="desc"] String optional

      The sort order (either "asc" or "desc")

  • [canceller] Promise optional

    The HTTP promise to cancel request if needed, resolve the promise to cancel the request

Returns:

HttpPromise:

The HTTP promise

getEntities

Syntax

getEntities

(
  • entityType
  • [pluginName]
  • param
  • [canceller]
)
HttpPromise

Summary

Gets entities.

Parameters:

  • entityType String

    Type of entity

  • [pluginName] String optional

    Plugin name the entity belongs to, null for core

  • param Object

    Request parameters

    • [include] String | Array optional

      The list of fields to include from returned entities

    • [exclude] String | Array optional

      The list of fields to exclude from returned entities. Ignored if include is also specified.

    • [query] String optional

      Search query to search on entities searchable fields

    • [page=0] Number optional

      The expected page in pagination system

    • [limit=10] Number optional

      The maximum number of expected results

    • [sortBy] String optional

      The field to sort by

    • [sortOrder="desc"] String optional

      The sort order (either "asc" or "desc")

  • [canceller] Promise optional

    The HTTP promise to cancel request if needed, resolve the promise to cancel the request

Returns:

HttpPromise:

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);

getEntity

Syntax

getEntity

(
  • entityType
  • [pluginName]
  • id
)
Promise

Summary

Fetch an entity by Id.

Parameters:

  • entityType String

    Type of entity

  • [pluginName] String optional

    Plugin name the entity belongs to, null for core

  • id String

    The Id of the entity to fetch

Returns:

Promise:

The HTTP promise

removeEntities

Syntax

removeEntities

(
  • entityType
  • [pluginName="core"]
  • ids
)
HttpPromise

Summary

Removes entities.

Parameters:

  • entityType String

    Type of the entities

  • [pluginName="core"] String optional

    Plugin name the entity belongs to

  • ids String

    The comma separated list of entity ids to remove

Returns:

HttpPromise:

The HTTP promise

updateEntity

Syntax

updateEntity

(
  • entityType
  • [pluginName]
  • id
  • data
)
Promise

Summary

Updates an entity.

Parameters:

  • entityType String

    Type of entity

  • [pluginName] String optional

    Plugin name the entity belongs to, null for core

  • id String

    The id of the entity to update

  • data String

    Data description object of the entity

Returns:

Promise:

The HTTP promise