PHP Class Neos\Neos\Command\NodeCommandControllerPlugin

- adding missing URI segments - removing dimensions on nodes / and /sites
Inheritance: implements Neos\ContentRepository\Command\NodeCommandControllerPluginInterface
Show file Open project: neos/neos-development-collection

Protected Properties

Property Type Description
$contentDimensionRepository Neos\ContentRepository\Domain\Repository\ContentDimensionRepository
$contextFactory Neos\ContentRepository\Domain\Service\ContextFactoryInterface
$dimensionCombinator Neos\ContentRepository\Domain\Service\ContentDimensionCombinator
$nodeDataRepository Neos\ContentRepository\Domain\Repository\NodeDataRepository
$nodeUriPathSegmentGenerator Neos\Neos\Utility\NodeUriPathSegmentGenerator
$output Neos\Flow\Cli\ConsoleOutput
$persistenceManager Neos\Flow\Persistence\PersistenceManagerInterface
$workspaceRepository Neos\ContentRepository\Domain\Repository\WorkspaceRepository

Public Methods

Method Description
generateUriPathSegments ( string $workspaceName, boolean $dryRun ) : void Generate missing URI path segments
getSubCommandDescription ( string $controllerCommandName ) : string Returns a piece of description for the specific task the plugin solves for the specified command
getSubCommandShortDescription ( string $controllerCommandName ) : string Returns a short description
invokeSubCommand ( string $controllerCommandName, ConsoleOutput $output, NodeType $nodeType = null, string $workspaceName = 'live', boolean $dryRun = false, boolean $cleanup = true, string $skip = null, string $only = null ) : void A method which runs the task implemented by the plugin for the given command
removeContentDimensionsFromRootAndSitesNode ( string $workspaceName, boolean $dryRun ) : void Remove dimensions on nodes "/" and "/sites"

Protected Methods

Method Description
createContext ( string $workspaceName, array $dimensions ) : Context Creates a content context for given workspace and language identifiers
generateUriPathSegmentsForNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, boolean $dryRun ) : void Traverses through the tree starting at the given root node and sets the uriPathSegment property derived from the node label.

Method Details

createContext() protected method

Creates a content context for given workspace and language identifiers
protected createContext ( string $workspaceName, array $dimensions ) : Context
$workspaceName string
$dimensions array
return Neos\ContentRepository\Domain\Service\Context

generateUriPathSegments() public method

This generates URI path segment properties for all document nodes which don't have a path segment set yet.
public generateUriPathSegments ( string $workspaceName, boolean $dryRun ) : void
$workspaceName string
$dryRun boolean
return void

generateUriPathSegmentsForNode() protected method

Traverses through the tree starting at the given root node and sets the uriPathSegment property derived from the node label.
protected generateUriPathSegmentsForNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, boolean $dryRun ) : void
$node Neos\ContentRepository\Domain\Model\NodeInterface The node where the traversal starts
$dryRun boolean
return void

getSubCommandDescription() public static method

Returns a piece of description for the specific task the plugin solves for the specified command
public static getSubCommandDescription ( string $controllerCommandName ) : string
$controllerCommandName string Name of the command in question, for example "repair"
return string A piece of text to be included in the overall description of the node:xy command

getSubCommandShortDescription() public static method

Returns a short description
public static getSubCommandShortDescription ( string $controllerCommandName ) : string
$controllerCommandName string Name of the command in question, for example "repair"
return string A piece of text to be included in the overall description of the node:xy command

invokeSubCommand() public method

A method which runs the task implemented by the plugin for the given command
public invokeSubCommand ( string $controllerCommandName, ConsoleOutput $output, NodeType $nodeType = null, string $workspaceName = 'live', boolean $dryRun = false, boolean $cleanup = true, string $skip = null, string $only = null ) : void
$controllerCommandName string Name of the command in question, for example "repair"
$output Neos\Flow\Cli\ConsoleOutput An instance of ConsoleOutput which can be used for output or dialogues
$nodeType Neos\ContentRepository\Domain\Model\NodeType Only handle this node type (if specified)
$workspaceName string Only handle this workspace (if specified)
$dryRun boolean If TRUE, don't do any changes, just simulate what you would do
$cleanup boolean If FALSE, cleanup tasks are skipped
$skip string Skip the given check or checks (comma separated)
$only string Only execute the given check or checks (comma separated)
return void

removeContentDimensionsFromRootAndSitesNode() public method

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.
public removeContentDimensionsFromRootAndSitesNode ( string $workspaceName, boolean $dryRun ) : void
$workspaceName string
$dryRun boolean
return void

Property Details

$contentDimensionRepository protected property

protected ContentDimensionRepository,Neos\ContentRepository\Domain\Repository $contentDimensionRepository
return Neos\ContentRepository\Domain\Repository\ContentDimensionRepository

$contextFactory protected property

protected ContextFactoryInterface,Neos\ContentRepository\Domain\Service $contextFactory
return Neos\ContentRepository\Domain\Service\ContextFactoryInterface

$dimensionCombinator protected property

protected ContentDimensionCombinator,Neos\ContentRepository\Domain\Service $dimensionCombinator
return Neos\ContentRepository\Domain\Service\ContentDimensionCombinator

$nodeDataRepository protected property

protected NodeDataRepository,Neos\ContentRepository\Domain\Repository $nodeDataRepository
return Neos\ContentRepository\Domain\Repository\NodeDataRepository

$nodeUriPathSegmentGenerator protected property

protected NodeUriPathSegmentGenerator,Neos\Neos\Utility $nodeUriPathSegmentGenerator
return Neos\Neos\Utility\NodeUriPathSegmentGenerator

$output protected property

protected ConsoleOutput,Neos\Flow\Cli $output
return Neos\Flow\Cli\ConsoleOutput

$persistenceManager protected property

protected PersistenceManagerInterface,Neos\Flow\Persistence $persistenceManager
return Neos\Flow\Persistence\PersistenceManagerInterface

$workspaceRepository protected property

protected WorkspaceRepository,Neos\ContentRepository\Domain\Repository $workspaceRepository
return Neos\ContentRepository\Domain\Repository\WorkspaceRepository