NodeController
class NodeController extends AbstractServiceController (View source)
Service Controller for managing Nodes
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)
Traits
A trait to add backend translation based on the backend users settings
Properties
protected Service | $_localizationService | from BackendUserTranslationTrait | |
protected UserService | $_userService | from BackendUserTranslationTrait | |
protected array | $supportedMediaTypes | ||
protected ThrowableStorageInterface | $throwableStorage2 | Cant be named here $throwableStorage see https://github.com/neos/neos-development-collection/issues/3858 |
from AbstractServiceController |
protected NodeView | $view | ||
protected array | $viewFormatToObjectNameMap | ||
protected NodeTypeManager | $nodeTypeManager | ||
protected NodeSearchServiceInterface | $nodeSearchService | ||
protected NodeFactory | $nodeFactory | ||
protected ContextFactoryInterface | $contextFactory | ||
protected NodeDataRepository | $nodeDataRepository | ||
protected NodeOperations | $nodeOperations | ||
protected DomainRepository | $domainRepository |
Methods
Set the locale according to the user settings
A preliminary error action for handling validation errors
Catch exceptions while processing an exception and respond to JSON format TODO: This is an explicit exception handling that will be replaced by format-enabled exception handlers.
Select special error action
Return child nodes of specified node for usage in a TreeLoader
Return child nodes of specified node for usage in a TreeLoader based on filter
Creates a new node and renders the node inside the containing content collection.
Creates a new node and returns tree structure
Move $node before, into or after $targetNode
Move the given node before, into or after the target node depending on the given position and renders it's content collection.
Copy $node before, into or after $targetNode
Copies the given node before, into or after the target node depending on the given position and renders it's content collection.
Updates the specified node and renders it's content collection.
Takes care of creating a redirect to properly render the collection the given node is in.
Returns an array with the data needed by for example the frontend editing link plugins to represent the passed Node instance.
Create a Context for a workspace given by name to be used in this controller.
Details
protected void
initializeObject()
Set the locale according to the user settings
void
errorAction()
A preliminary error action for handling validation errors
void
processRequest(ActionRequest $request, ActionResponse $response)
Catch exceptions while processing an exception and respond to JSON format TODO: This is an explicit exception handling that will be replaced by format-enabled exception handlers.
protected array
convertException(Exception $exception)
No description
protected void
initializeAction()
Select special error action
void
getChildNodesForTreeAction(Node $node, string $nodeTypeFilter, int $depth, Node $untilNode)
Return child nodes of specified node for usage in a TreeLoader
void
filterChildNodesForTreeAction(Node $node, string $term, string $nodeType)
Return child nodes of specified node for usage in a TreeLoader based on filter
void
createAction(Node $referenceNode, array $nodeData, string $position)
Creates a new node
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.
void
createAndRenderAction(Node $referenceNode, string $fusionPath, array $nodeData, string $position)
Creates a new node and renders the node inside the containing content collection.
void
createNodeForTheTreeAction(Node $referenceNode, array $nodeData, string $position, string $nodeTypeFilter = '')
Creates a new node and returns tree structure
void
moveAction(Node $node, Node $targetNode, string $position)
Move $node before, into or after $targetNode
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.
void
moveAndRenderAction(Node $node, Node $targetNode, string $position, string $fusionPath)
Move the given node before, into or after the target node depending on the given position and renders it's content collection.
void
copyAction(Node $node, Node $targetNode, string $position, string $nodeName = null)
Copy $node before, into or after $targetNode
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.
void
copyAndRenderAction(Node $node, Node $targetNode, string $position, string $fusionPath, string $nodeName = null)
Copies the given node before, into or after the target node depending on the given position and renders it's content collection.
void
updateAction(Node $node)
Updates the specified node.
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.
void
updateAndRenderAction(Node $node, string $fusionPath)
Updates the specified node and renders it's content collection.
void
deleteAction(Node $node)
Deletes the specified node and all of its sub nodes
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.
protected void
redirectToRenderNode(NodeInterface $node, string $fusionPath)
Takes care of creating a redirect to properly render the collection the given node is in.
protected array
processNodeForEditorPlugins(NodeInterface $node)
Returns an array with the data needed by for example the frontend editing link plugins to represent the passed Node instance.
protected Context
createContext(string $workspaceName)
Create a Context for a workspace given by name to be used in this controller.