NodeCommandControllerPlugin
class NodeCommandControllerPlugin implements EventDispatchingNodeCommandControllerPluginInterface (View source)
A plugin for the ContentRepository NodeCommandController which adds some tasks to the node:repair command:
- adding missing URI segments
- removing dimensions on nodes / and /sites
Properties
protected ContextFactoryInterface | $contextFactory | ||
protected WorkspaceRepository | $workspaceRepository | ||
protected ContentDimensionRepository | $contentDimensionRepository | ||
protected NodeDataRepository | $nodeDataRepository | ||
protected ContentDimensionCombinator | $dimensionCombinator | ||
protected NodeUriPathSegmentGenerator | $nodeUriPathSegmentGenerator | ||
protected ConsoleOutput deprecated | $output | ||
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
Creates the /sites node if it is missing.
Generate missing URI path segments
Traverses through the tree starting at the given root node and sets the uriPathSegment property derived from the node label.
Remove dimensions on nodes "/" and "/sites"
Creates a content context for given workspace and language identifiers
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
createMissingSitesNode()
Creates the /sites node if it is missing.
void
generateUriPathSegments(string $workspaceName, bool $dryRun)
Generate missing URI path segments
This generates URI path segment properties for all document nodes which don't have a path segment set yet.
protected void
generateUriPathSegmentsForNode(NodeInterface $node, bool $dryRun)
Traverses through the tree starting at the given root node and sets the uriPathSegment property derived from the node label.
void
removeContentDimensionsFromRootAndSitesNode(string $workspaceName)
Remove dimensions on nodes "/" and "/sites"
This empties the content dimensions on those nodes, so when traversing via the Node API from the root node, the nodes below "/sites" are always reachable.
protected Context
createContext(string $workspaceName, array $dimensions)
Creates a content context for given workspace and language identifiers
void
on(string $eventIdentifier, Closure $callback)
Attaches a new event handler
protected void
dispatch(string $eventIdentifier, array ...$eventPayload)
Trigger a custom event