PHP Class Neos\Neos\Service\Controller\NodeController

Note: This controller should be, step-by-step, transformed into a clean REST controller (see NEOS-190 and NEOS-199). Since this is a rather big endeavor, we slice the elephant and move methods in a clean way from here to the new NodesController (\Neos\Neos\Controller\Service\NodesController)
Inheritance: extends AbstractServiceController
Mostra file Open project: neos/neos-development-collection

Protected Properties

Property Type Description
$contextFactory Neos\ContentRepository\Domain\Service\ContextFactoryInterface
$domainRepository Neos\Neos\Domain\Repository\DomainRepository
$nodeDataRepository Neos\ContentRepository\Domain\Repository\NodeDataRepository
$nodeFactory Neos\ContentRepository\Domain\Factory\NodeFactory
$nodeOperations Neos\Neos\Service\NodeOperations
$nodeSearchService Neos\Neos\Domain\Service\NodeSearchService
$nodeTypeManager Neos\ContentRepository\Domain\Service\NodeTypeManager
$supportedMediaTypes array
$view Neos\Neos\Service\View\NodeView
$viewFormatToObjectNameMap array

Public Methods

Method Description
copyAction ( Node $node, Node $targetNode, string $position, string $nodeName = null ) : void Copy $node before, into or after $targetNode
copyAndRenderAction ( Node $node, Node $targetNode, string $position, string $typoScriptPath, string $nodeName = null ) : void Copies the given node before, into or after the target node depending on the given position and renders it's content collection.
createAction ( Node $referenceNode, array $nodeData, string $position ) : void Creates a new node
createAndRenderAction ( Node $referenceNode, string $typoScriptPath, array $nodeData, string $position ) : string Creates a new node and renders the node inside the containing content collection.
createNodeForTheTreeAction ( Node $referenceNode, array $nodeData, string $position, string $nodeTypeFilter = '' ) : void Creates a new node and returns tree structure
deleteAction ( Node $node ) : void Deletes the specified node and all of its sub nodes
filterChildNodesForTreeAction ( Node $node, string $term, string $nodeType ) : void Return child nodes of specified node for usage in a TreeLoader based on filter
getChildNodesForTreeAction ( Node $node, string $nodeTypeFilter, integer $depth, Node $untilNode ) : void Return child nodes of specified node for usage in a TreeLoader
moveAction ( Node $node, Node $targetNode, string $position ) : void Move $node before, into or after $targetNode
moveAndRenderAction ( Node $node, Node $targetNode, string $position, string $typoScriptPath ) : void Move the given node before, into or after the target node depending on the given position and renders it's content collection.
searchPageAction ( string $query ) : void Search a page, needed for internal links.
updateAction ( Node $node ) : void Updates the specified node.
updateAndRenderAction ( Node $node, string $typoScriptPath ) : void Updates the specified node and renders it's content collection.

Protected Methods

Method Description
createContext ( string $workspaceName ) : Context Create a Context for a workspace given by name to be used in this controller.
initializeAction ( ) : void Select special error action
processNodeForEditorPlugins ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : array Returns an array with the data needed by for example the Hallo and Aloha link plugins to represent the passed Node instance.
redirectToRenderNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, string $typoScriptPath ) : string Takes care of creating a redirect to properly render the collection the given node is in.

Method Details

copyAction() public method

We need to call persistAll() in order to return the nextUri. We can't persist only the nodes in NodeDataRepository because they might be connected to images / resources which need to be updated at the same time.
public copyAction ( Node $node, Node $targetNode, string $position, string $nodeName = null ) : void
$node Neos\ContentRepository\Domain\Model\Node The node to be copied
$targetNode Neos\ContentRepository\Domain\Model\Node The target node to be copied "to", see $position
$position string Where the node should be added in relation to $targetNode (allowed: before, into, after)
$nodeName string Optional node name (if empty random node name will be generated)
return void

copyAndRenderAction() public method

Copies the given node before, into or after the target node depending on the given position and renders it's content collection.
public copyAndRenderAction ( Node $node, Node $targetNode, string $position, string $typoScriptPath, string $nodeName = null ) : void
$node Neos\ContentRepository\Domain\Model\Node The node to be copied
$targetNode Neos\ContentRepository\Domain\Model\Node The target node to be copied "to", see $position
$position string Where the node should be added in relation to $targetNode (allowed: before, into, after)
$typoScriptPath string The TypoScript path of the collection
$nodeName string Optional node name (if empty random node name will be generated)
return void

createAction() public method

We need to call persistAll() in order to return the nextUri. We can't persist only the nodes in NodeDataRepository because they might be connected to images / resources which need to be updated at the same time.
public createAction ( Node $referenceNode, array $nodeData, string $position ) : void
$referenceNode Neos\ContentRepository\Domain\Model\Node
$nodeData array
$position string where the node should be added (allowed: before, into, after)
return void

createAndRenderAction() public method

Creates a new node and renders the node inside the containing content collection.
public createAndRenderAction ( Node $referenceNode, string $typoScriptPath, array $nodeData, string $position ) : string
$referenceNode Neos\ContentRepository\Domain\Model\Node
$typoScriptPath string The TypoScript path of the collection
$nodeData array
$position string where the node should be added (allowed: before, into, after)
return string

createContext() protected method

Create a Context for a workspace given by name to be used in this controller.
protected createContext ( string $workspaceName ) : Context
$workspaceName string Name of the current workspace
return Neos\ContentRepository\Domain\Service\Context

createNodeForTheTreeAction() public method

Creates a new node and returns tree structure
public createNodeForTheTreeAction ( Node $referenceNode, array $nodeData, string $position, string $nodeTypeFilter = '' ) : void
$referenceNode Neos\ContentRepository\Domain\Model\Node
$nodeData array
$position string where the node should be added, -1 is before, 0 is in, 1 is after
$nodeTypeFilter string
return void

deleteAction() public method

We need to call persistAll() in order to return the nextUri. We can't persist only the nodes in NodeDataRepository because they might be connected to images / resources which need to be removed at the same time.
public deleteAction ( Node $node ) : void
$node Neos\ContentRepository\Domain\Model\Node
return void

filterChildNodesForTreeAction() public method

Return child nodes of specified node for usage in a TreeLoader based on filter
public filterChildNodesForTreeAction ( Node $node, string $term, string $nodeType ) : void
$node Neos\ContentRepository\Domain\Model\Node The node to find child nodes for
$term string
$nodeType string
return void

getChildNodesForTreeAction() public method

Return child nodes of specified node for usage in a TreeLoader
public getChildNodesForTreeAction ( Node $node, string $nodeTypeFilter, integer $depth, Node $untilNode ) : void
$node Neos\ContentRepository\Domain\Model\Node The node to find child nodes for
$nodeTypeFilter string A node type filter
$depth integer levels of childNodes (0 = unlimited)
$untilNode Neos\ContentRepository\Domain\Model\Node expand the child nodes until $untilNode is reached, independent of $depth
return void

initializeAction() protected method

Select special error action
protected initializeAction ( ) : void
return void

moveAction() public method

We need to call persistAll() in order to return the nextUri. We can't persist only the nodes in NodeDataRepository because they might be connected to images / resources which need to be updated at the same time.
public moveAction ( Node $node, Node $targetNode, string $position ) : void
$node Neos\ContentRepository\Domain\Model\Node The node to be moved
$targetNode Neos\ContentRepository\Domain\Model\Node The target node to be moved "to", see $position
$position string where the node should be added (allowed: before, into, after)
return void

moveAndRenderAction() public method

Move the given node before, into or after the target node depending on the given position and renders it's content collection.
public moveAndRenderAction ( Node $node, Node $targetNode, string $position, string $typoScriptPath ) : void
$node Neos\ContentRepository\Domain\Model\Node The node to be moved
$targetNode Neos\ContentRepository\Domain\Model\Node The target node to be moved "to", see $position
$position string Where the node should be added in relation to $targetNode (allowed: before, into, after)
$typoScriptPath string The TypoScript path of the collection
return void

processNodeForEditorPlugins() protected method

Returns an array with the data needed by for example the Hallo and Aloha link plugins to represent the passed Node instance.
protected processNodeForEditorPlugins ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : array
$node Neos\ContentRepository\Domain\Model\NodeInterface
return array

redirectToRenderNode() protected method

Takes care of creating a redirect to properly render the collection the given node is in.
protected redirectToRenderNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node, string $typoScriptPath ) : string
$node Neos\ContentRepository\Domain\Model\NodeInterface
$typoScriptPath string
return string

searchPageAction() public method

Search a page, needed for internal links.
Deprecation: will be removed with 3.0, use Service/NodesController->indexAction() instead
public searchPageAction ( string $query ) : void
$query string
return void

updateAction() public method

Returns the following data: - the (possibly changed) workspace name of the node - the URI of the closest document node. If $node is a document node (f.e. a Page), the own URI is returned. This is important to handle renames of nodes correctly. Note: We do not call $nodeDataRepository->update() here, as ContentRepository has a stateful API for now. We need to call persistAll() in order to return the nextUri. We can't persist only the nodes in NodeDataRepository because they might be connected to images / resources which need to be updated at the same time.
public updateAction ( Node $node ) : void
$node Neos\ContentRepository\Domain\Model\Node The node to be updated
return void

updateAndRenderAction() public method

Updates the specified node and renders it's content collection.
public updateAndRenderAction ( Node $node, string $typoScriptPath ) : void
$node Neos\ContentRepository\Domain\Model\Node The node to be updated
$typoScriptPath string The TypoScript path of the collection
return void

Property Details

$contextFactory protected_oe property

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

$domainRepository protected_oe property

protected DomainRepository,Neos\Neos\Domain\Repository $domainRepository
return Neos\Neos\Domain\Repository\DomainRepository

$nodeDataRepository protected_oe property

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

$nodeFactory protected_oe property

protected NodeFactory,Neos\ContentRepository\Domain\Factory $nodeFactory
return Neos\ContentRepository\Domain\Factory\NodeFactory

$nodeOperations protected_oe property

protected NodeOperations,Neos\Neos\Service $nodeOperations
return Neos\Neos\Service\NodeOperations

$nodeSearchService protected_oe property

protected NodeSearchService,Neos\Neos\Domain\Service $nodeSearchService
return Neos\Neos\Domain\Service\NodeSearchService

$nodeTypeManager protected_oe property

protected NodeTypeManager,Neos\ContentRepository\Domain\Service $nodeTypeManager
return Neos\ContentRepository\Domain\Service\NodeTypeManager

$supportedMediaTypes protected_oe property

protected array $supportedMediaTypes
return array

$view protected_oe property

protected NodeView,Neos\Neos\Service\View $view
return Neos\Neos\Service\View\NodeView

$viewFormatToObjectNameMap protected_oe property

protected array $viewFormatToObjectNameMap
return array