OpenVeo Core server

API Docs for: 7.0.0
Show:

CorePluginApi

Extends PluginApi
Module: core-plugin

Summary

Defines the Core Plugin API exposed to other plugins.

Constructor

CorePluginApi

Syntax

CorePluginApi

()

Summary

Methods

clearImageCache

Syntax

clearImageCache

(
  • string
  • string
  • callback
)

Summary

Clear image cache

Parameters:

  • string Object

    imagePath Relative image path

  • string Object

    pluginName Plugin name

  • callback Function

    Function to call when its done

getAnonymousUserId

Syntax

getAnonymousUserId

() String

Summary

Gets the id of the anonymous user.

Returns:

String:

The anonymous user id

getCdnUrl

Syntax

getCdnUrl

() String

Summary

Gets OpenVeo CDN url ending with a slash.

Returns:

String:

The CDN url

getDatabase

Syntax

getDatabase

() Database

Summary

Gets the current database instance.

Returns:

Database:

The application's database

getEntities

Syntax

getEntities

() Object

Summary

Gets the list of entities defined by plugins.

Returns:

Object:

The list of entities by entity name

getHooks

Syntax

getHooks

() Object

Summary

Gets core hooks.

Returns:

Object:

The core hooks

getPermissions

Syntax

getPermissions

() Object

Summary

Gets the list of permissions defined by plugins.

Returns:

Object:

The list of permissions

getServerConfiguration

Syntax

getServerConfiguration

() Object

Summary

Gets information about the application server.

Returns:

Object:

The server configuration

getSuperAdminId

Syntax

getSuperAdminId

() String

Summary

Gets the id of the super administrator.

Returns:

String:

The super administrator id

getTranslations

Syntax

getTranslations

(
  • dictionary
  • code
  • callback
)
async

Summary

Gets a dictionary of translations by its name and language.

Search is made on i18n directory and all plugin's i18n directories. If the same dictionary name is found twice (same file name in different i18n directories), dictionaries are merged.

Parameters:

  • dictionary String

    The name of the dictionary, this is the name of the dictionary file without extension

  • code String

    The language country code (e.g. en-US)

  • callback Function

    Function to call when its done

    • Error An error if something went wrong
    • Object A JavaScript object containing all translations

Example:

process.api.getCoreApi().getTranslations('login', 'fr-FR', function(error, translations) {
  console.log(translations);
});
process.api.getCoreApi().getTranslations('back-office', 'en', function(error, translations) {
  console.log(translations);
});

getWebServiceScopes

Syntax

getWebServiceScopes

() Object

Summary

Gets the list of Web Service scopes defined by plugins.

Returns:

Object:

The list of Web Service scopes

Properties

clientProvider

Syntax

clientProvider

ClientProvider

Summary

An instance of ClientProvider.

groupProvider

Syntax

groupProvider

GroupProvider

Summary

An instance of GroupProvider.

roleProvider

Syntax

roleProvider

RoleProvider

Summary

An instance of RoleProvider.

settingProvider

Syntax

settingProvider

SettingProvider

Summary

An instance of SettingProvider.

taxonomyProvider

Syntax

taxonomyProvider

TaxonomyProvider

Summary

An instance of TaxonomyProvider.

userProvider

Syntax

userProvider

UserProvider

Summary

An instance of UserProvider.