class PluginService (View source)

Central authority for interactions with plugins.

Whenever details about Plugins or PluginViews are needed this service should be used.

For some methods the ContentContext has to be specified. This is required in order for the ContentRepository to fetch nodes of the current workspace. The context can be retrieved from any node of the correct workspace & tree. If no node is available (e.g. for CLI requests) the ContentContextFactory can be used to create a context instance.

Properties

protected NodeTypeManager $nodeTypeManager
protected NodeDataRepository $nodeDataRepository
protected Context $securityContext
protected ContentContextFactory $contentContextFactory
protected NodeFactory $nodeFactory

Methods

getPluginNodes(ContentContext $context)

Returns an array of all available plugin nodes

getPluginNodesWithViewDefinitions(ContentContext $context)

Returns an array of all plugin nodes with View Definitions

getNodes(array $nodeTypes, ContentContext $context)

Find all nodes of a specific node type

getPluginViewDefinitionsByPluginNodeType(NodeType $pluginNodeType)

Get all configured PluginView definitions for a specific $pluginNodeType

array
getPluginViewConfigurationsByPluginNodeType(NodeType $pluginNodeType)

No description

getPluginNodeByAction(NodeInterface $currentNode, string $controllerObjectName, string $actionName)

returns a plugin node or one of it's view nodes if an view has been configured for that specific controller and action combination

getPluginViewDefinitionByAction(string $controllerObjectName, string $actionName)

Fetch a PluginView definition that matches the specified controller and action combination

getPluginViewNodeByMasterPlugin(NodeInterface $node, string $viewName)

returns a specific view node of an master plugin or NULL if it does not exist

Details

NodeInterface[] getPluginNodes(ContentContext $context)

Returns an array of all available plugin nodes

Parameters

ContentContext $context

current content context, see class doc comment for details

Return Value

NodeInterface[]

all plugin nodes in the current $context

NodeInterface[] getPluginNodesWithViewDefinitions(ContentContext $context)

Returns an array of all plugin nodes with View Definitions

Parameters

ContentContext $context

Return Value

NodeInterface[]

all plugin nodes with View Definitions in the current $context

protected NodeInterface[] getNodes(array $nodeTypes, ContentContext $context)

Find all nodes of a specific node type

Parameters

array $nodeTypes
ContentContext $context

current content context, see class doc comment for details

Return Value

NodeInterface[]

all nodes of type $nodeType in the current $context

PluginViewDefinition[] getPluginViewDefinitionsByPluginNodeType(NodeType $pluginNodeType)

Get all configured PluginView definitions for a specific $pluginNodeType

Parameters

NodeType $pluginNodeType

node type name of the master plugin

Return Value

PluginViewDefinition[]

list of PluginViewDefinition instances for the given $pluginNodeName

protected array getPluginViewConfigurationsByPluginNodeType(NodeType $pluginNodeType)

No description

Parameters

NodeType $pluginNodeType

Return Value

array

NodeInterface getPluginNodeByAction(NodeInterface $currentNode, string $controllerObjectName, string $actionName)

returns a plugin node or one of it's view nodes if an view has been configured for that specific controller and action combination

Parameters

NodeInterface $currentNode
string $controllerObjectName
string $actionName

Return Value

NodeInterface

PluginViewDefinition getPluginViewDefinitionByAction(string $controllerObjectName, string $actionName)

Fetch a PluginView definition that matches the specified controller and action combination

Parameters

string $controllerObjectName
string $actionName

Return Value

PluginViewDefinition

Exceptions

Exception

NodeInterface getPluginViewNodeByMasterPlugin(NodeInterface $node, string $viewName)

returns a specific view node of an master plugin or NULL if it does not exist

Parameters

NodeInterface $node
string $viewName

Return Value

NodeInterface