OpenVeo AngularJS back end

API Docs for: 3.0.0
Show:

entityService

Summary

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

Methods

addEntity

Syntax

addEntity

(
  • entityType
  • [pluginName]
  • data
)
Promise

Summary

Adds a new Entity.

Parameters:

  • entityType String

    Type of entity

  • [pluginName] String optional

    Plugin name the entity belongs to, null for core

  • data String

    Data description object of the entity

Returns:

Promise:

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]
)
Promise

Summary

Gets all entities of a specific type.

Parameters:

  • entityType String

    Type of entity

  • [pluginName] String optional

    Plugin name the entity belongs to, null for core

Returns:

Promise:

The HTTP promise

getEntities

Syntax

getEntities

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

Summary

Get all entities filtered by param.

Parameters:

  • entityType String

    Type of entity

  • [pluginName] String optional

    Plugin name the entity belongs to, null for core

  • param Object

    Request parameters with a property "filter" with a MongoDB criteria as value, a property "count" with a MongoDB count as value, a property "page" with the expected page as value and a property "sort" with a MongoDB sort object as value

  • [canceller] Promise optional

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

Returns:

Promise:

The HTTP promise

Example:

// Get the first page of Web Service applications sorted by name with 10 applications per page
var params = {
  count: 10,
  page: 1,
  sort: {
    name: 1
  }
};
getEntities('applications', 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

removeEntity

Syntax

removeEntity

(
  • entityType
  • [pluginName]
  • id
)
Promise

Summary

Removes 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 remove

Returns:

Promise:

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