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 Context $securityContext
protected $contentRepositoryRegistry
protected $siteNodeUtility

Methods

getPluginNodesWithViewDefinitions(WorkspaceName $workspaceName, DimensionSpacePoint $dimensionSpacePoint, ContentRepositoryId $contentRepositoryIdentifier)

Returns an array of all plugin nodes with View Definitions

getNodes(Node $siteNode, NodeTypeNames $nodeTypeNames)

Find all nodes of a specific node type

getPluginViewDefinitionsByPluginNodeType(NodeType $pluginNodeType)

Get all configured PluginView definitions for a specific $pluginNodeType

array<string,mixed>
getPluginViewConfigurationsByPluginNodeType(NodeType $pluginNodeType)

No description

Node|null
getPluginNodeByAction(Node $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

PluginViewDefinition|null
getPluginViewDefinitionByAction(ContentRepositoryId $contentRepositoryIdentifier, string $controllerObjectName, string $actionName)

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

Node|null
getPluginViewNodeByMasterPlugin(Node $node, string $viewName)

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

Details

Nodes getPluginNodesWithViewDefinitions(WorkspaceName $workspaceName, DimensionSpacePoint $dimensionSpacePoint, ContentRepositoryId $contentRepositoryIdentifier)

Returns an array of all plugin nodes with View Definitions

Parameters

WorkspaceName $workspaceName
DimensionSpacePoint $dimensionSpacePoint
ContentRepositoryId $contentRepositoryIdentifier

Return Value

Nodes

all plugin nodes with View Definitions in the current site

protected Nodes getNodes(Node $siteNode, NodeTypeNames $nodeTypeNames)

Find all nodes of a specific node type

Parameters

Node $siteNode

The site node to fetch the nodes beneath

NodeTypeNames $nodeTypeNames

Return Value

Nodes

All nodes matching the node type names in the given site

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<string,mixed> getPluginViewConfigurationsByPluginNodeType(NodeType $pluginNodeType)

No description

Parameters

NodeType $pluginNodeType

Return Value

array<string,mixed>

Node|null getPluginNodeByAction(Node $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

Node $currentNode
string $controllerObjectName
string $actionName

Return Value

Node|null

PluginViewDefinition|null getPluginViewDefinitionByAction(ContentRepositoryId $contentRepositoryIdentifier, string $controllerObjectName, string $actionName)

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

Parameters

ContentRepositoryId $contentRepositoryIdentifier
string $controllerObjectName
string $actionName

Return Value

PluginViewDefinition|null

Exceptions

Exception

if more than one PluginView matches the given controller/action pair

Node|null getPluginViewNodeByMasterPlugin(Node $node, string $viewName)

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

Parameters

Node $node
string $viewName

Return Value

Node|null