NodeCommandControllerPlugin
class NodeCommandControllerPlugin implements EventDispatchingNodeCommandControllerPluginInterface (View source)
Plugin for the ContentRepository NodeCommandController which provides functionality for creating missing child nodes.
Properties
protected ContextFactoryInterface | $contextFactory | ||
protected NodeTypeManager | $nodeTypeManager | ||
protected WorkspaceRepository | $workspaceRepository | ||
protected NodeFactory | $nodeFactory | ||
protected ConsoleOutput deprecated | $output | ||
protected NodeDataRepository | $nodeDataRepository | ||
protected EntityManagerInterface | $entityManager | ||
protected PropertyMapper | $propertyMapper | ||
protected array | $pluginConfigurations | ||
protected ContentDimensionCombinator | $contentDimensionCombinator | ||
protected PersistenceManagerInterface | $persistenceManager | ||
protected Closure[] | $eventCallbacks | Callbacks to be invoked when an event is triggered |
Methods
Returns a short description
Returns a piece of description for the specific task the plugin solves for the specified command
A method which runs the task implemented by the plugin for the given command
Performs checks for missing child nodes according to the node's auto-create configuration and creates them if necessary.
Create missing child nodes for the given node type
Performs checks for unset properties that has default values and sets them if necessary.
Adds missing default values for the given node type
Performs checks for nodes with abstract or undefined node types and removes them if found.
Performs checks for disallowed child nodes according to the node's auto-create configuration and constraints and removes them if found.
Performs checks for orphan nodes removes them if found.
Performs checks for orphan nodes removes them if found.
Remove broken entity references
Creates a content context for given workspace
Retrieves all NodeData objects of a certain node type inside a given workspace.
Removes all nodes with a specific path and their children in the given workspace.
Removes the specified node (exactly that one)
Remove nodes with invalid dimension values
Collects all nodes of the given node type which have dimension values not fitting to the current dimension configuration.
Remove nodes with invalid workspace
Collects all nodes of the given node type which refer to an invalid workspace configuration.
Detect and fix nodes in non-live workspaces whose identifier does not match their corresponding node in the live workspace.
Reorder child nodes according to the current position configuration of child nodes.
Reorder child nodes for the given node type
Repair nodes whose shadow nodes are missing
Collects all nodes with missing shadow nodes
Trigger a custom event
Details
static string
getSubCommandShortDescription(string $controllerCommandName)
Returns a short description
static string
getSubCommandDescription(string $controllerCommandName)
Returns a piece of description for the specific task the plugin solves for the specified command
void
invokeSubCommand(string $controllerCommandName, ConsoleOutput $output, NodeType $nodeType = null, string $workspaceName = 'live', bool $dryRun = false, bool $cleanup = true, string $skip = null, string $only = null)
A method which runs the task implemented by the plugin for the given command
protected void
createMissingChildNodes(string $workspaceName, bool $dryRun, NodeType $nodeType = null)
Performs checks for missing child nodes according to the node's auto-create configuration and creates them if necessary.
protected void
createChildNodesByNodeType(NodeType $nodeType, string $workspaceName, bool $dryRun)
Create missing child nodes for the given node type
void
addMissingDefaultValues(string $workspaceName, bool $dryRun, NodeType $nodeType = null)
Performs checks for unset properties that has default values and sets them if necessary.
void
addMissingDefaultValuesByNodeType(NodeType $nodeType, string $workspaceName, bool $dryRun)
Adds missing default values for the given node type
protected void
removeAbstractAndUndefinedNodes(string $workspaceName)
Performs checks for nodes with abstract or undefined node types and removes them if found.
protected void
removeDisallowedChildNodes(string $workspaceName)
Performs checks for disallowed child nodes according to the node's auto-create configuration and constraints and removes them if found.
protected void
removeOrphanNodes(string $workspaceName, bool $dryRun, NodeType $nodeType = null)
Performs checks for orphan nodes removes them if found.
void
removeUndefinedProperties(string $workspaceName, bool $dryRun, NodeType $nodeType = null)
Performs checks for orphan nodes removes them if found.
void
removeBrokenEntityReferences(string $workspaceName)
Remove broken entity references
This removes references from nodes to entities which don't exist anymore.
protected Context
createContext(string $workspaceName, array $dimensions)
Creates a content context for given workspace
protected NodeData[]
getNodeDataByNodeTypeAndWorkspace(string $nodeType, string $workspaceName)
Retrieves all NodeData objects of a certain node type inside a given workspace.
Shadow nodes are excluded, because they will be published when publishing the moved node.
protected
removeNodeAndChildNodesInWorkspaceByPath(string $nodePath, string $workspaceName)
Removes all nodes with a specific path and their children in the given workspace.
protected
removeNode(string $nodeIdentifier, string $dimensionsHash)
Removes the specified node (exactly that one)
void
removeNodesWithInvalidDimensions(string $workspaceName)
Remove nodes with invalid dimension values
This removes nodes which have dimension values not fitting to the current dimension configuration
protected array
collectNodesWithInvalidDimensions(string $workspaceName, array $allowedDimensionCombinations)
Collects all nodes of the given node type which have dimension values not fitting to the current dimension configuration.
void
removeNodesWithInvalidWorkspace()
Remove nodes with invalid workspace
This removes nodes which refer to a workspace which does not exist.
protected array
collectNodesWithInvalidWorkspace()
Collects all nodes of the given node type which refer to an invalid workspace configuration.
Note: due to the foreign key constraints in the database, there actually never should be any node with n.workspace of a non-existing workspace because if that workspace does not exist anymore, the value would turn NULL. But the query covers this nevertheless. Better safe than sorry.
void
fixNodesWithInconsistentIdentifier()
Detect and fix nodes in non-live workspaces whose identifier does not match their corresponding node in the live workspace.
protected void
reorderChildNodes(string $workspaceName, bool $dryRun, NodeType $nodeType = null)
Reorder child nodes according to the current position configuration of child nodes.
protected void
reorderChildNodesByNodeType(string $workspaceName, bool $dryRun, NodeType $nodeType)
Reorder child nodes for the given node type
protected void
repairShadowNodes(string $workspaceName, bool $dryRun, NodeType $nodeType = null)
Repair nodes whose shadow nodes are missing
This check searches for nodes which have a corresponding node in one of the base workspaces, have different node paths, but don't have a corresponding shadow node with a "movedto" value.
protected array
findMissingShadowNodesInWorkspace(Workspace $workspace, NodeType $nodeType = null)
Collects all nodes with missing shadow nodes
void
on(string $eventIdentifier, Closure $callback)
Attaches a new event handler
protected void
dispatch(string $eventIdentifier, array ...$eventPayload)
Trigger a custom event