action.skip

FlotiqPluginsRegistry

class FlotiqPluginsRegistry

Properties

Name Type Description
add add Register new plugin. If plugin with given ID already exists, it will be unregistered first.
run run Execute all handlers for an event. Event name and parameters must be paired correctly.
runScoped runScoped Execute all handlers for an event for the given plugin. Event name and parameters must be paired correctly.
unregister unregister Unregister plugin event handlers by id
unregisterAllPlugins unregisterAllPlugins Unregister plugin event handlers by id

function add

Register new plugin. If plugin with given ID already exists, it will be unregistered first.

Parameters

Name Type Description
pluginInfo PluginInfo
callback PluginRegistrationCallback

function PluginRegistrationCallback

A callback function that will be called when plugin is registered and started. This callback should register all event handlers for the plugin.

Parameters

Name Type Description
eventHandler PluginEventHandler event handler for the plugin
client FlotiqPlugins.Core.FlotiqApiClient api client for the plugin
globals FlotiqGlobals global variables available for the plugin

function run

Execute all handlers for an event. Event name and parameters must be paired correctly.

Returns - Array
Array of results from all handlers

Parameters

Name Type Description
event string An event name to run. All registered handlers of this event will be executed.
params any Parameters to pass to the handlers.

function runScoped

Execute all handlers for an event for the given plugin. Event name and parameters must be paired correctly.

Returns - Array
Array of results from all handlers of given plugin

Parameters

Name Type Description
event string An event name to run. Only specified plugin handlers of this event will be executed.
pluginId string Plugin id to run the event for
params any Parameters to pass to the handlers.

function unregister

Unregister plugin event handlers by id

Parameters

Name Type Description
pluginId string The id of the plugin that should be unregistered from the plugin list

function unregisterAllPlugins

Unregister plugin event handlers by id

Parameters

Name Type Description
pluginId string The id of the plugin that should be unregistered from the plugin list