diff --git a/Classes/Controller/BackendServiceController.php b/Classes/Controller/BackendServiceController.php index 1f941184eb..f77a2ecec1 100644 --- a/Classes/Controller/BackendServiceController.php +++ b/Classes/Controller/BackendServiceController.php @@ -47,7 +47,6 @@ use Neos\Neos\Ui\Domain\Model\Feedback\Operations\ReloadDocument; use Neos\Neos\Ui\Domain\Model\Feedback\Operations\UpdateWorkspaceInfo; use Neos\Neos\Ui\Domain\Model\FeedbackCollection; -use Neos\Neos\Ui\Domain\Service\NodeTreeBuilder; use Neos\Neos\Ui\Fusion\Helper\NodeInfoHelper; use Neos\Neos\Ui\Fusion\Helper\WorkspaceHelper; use Neos\Neos\Ui\Service\NodeClipboard; @@ -479,22 +478,6 @@ public function getWorkspaceInfoAction(): void $this->view->assign('value', $personalWorkspaceInfo); } - public function initializeLoadTreeAction(): void - { - $this->arguments['nodeTreeArguments']->getPropertyMappingConfiguration()->allowAllProperties(); - } - - /** - * Load the nodetree - */ - public function loadTreeAction(NodeTreeBuilder $nodeTreeArguments, bool $includeRoot = false): void - { - $contentRepositoryId = SiteDetectionResult::fromRequest($this->request->getHttpRequest())->contentRepositoryId; - - $nodeTreeArguments->setControllerContext($this->controllerContext); - $this->view->assign('value', $nodeTreeArguments->build($contentRepositoryId, $includeRoot)); - } - /** * @throws \Neos\Flow\Mvc\Exception\NoSuchArgumentException */ diff --git a/Classes/Domain/Service/NodeTreeBuilder.php b/Classes/Domain/Service/NodeTreeBuilder.php deleted file mode 100644 index 3fb6cc5dc5..0000000000 --- a/Classes/Domain/Service/NodeTreeBuilder.php +++ /dev/null @@ -1,225 +0,0 @@ -rootContextPath = $rootContextPath; - } - - /** - * Get the root node - * - * @return Node - */ - private function getRoot() - { - if (!$this->root) { - $this->root = $this->active->getContext()->getCurrentSiteNode(); - } - - return $this->root; - } - - /** - * Set the active node - * - * @param string $activeContextPath - * @return void - */ - public function setActive($activeContextPath) - { - $this->activeContextPath = $activeContextPath; - } - - /** - * Set the node type filter - * - * @param string $nodeTypeFilter - * @return void - */ - public function setNodeTypeFilter($nodeTypeFilter) - { - $this->nodeTypeFilter = $nodeTypeFilter; - } - - /** - * Set the search term filter - * - * @param string $searchTermFilter - * @return void - */ - public function setSearchTermFilter($searchTermFilter) - { - $this->searchTermFilter = $searchTermFilter; - } - - /** - * Set the depth - * - * @param integer $depth - */ - public function setDepth($depth) - { - $this->depth = $depth; - } - - /** - * Set the controller context - * - * @param ControllerContext $controllerContext - * @return void - */ - public function setControllerContext(ControllerContext $controllerContext) - { - $this->controllerContext = $controllerContext; - } - - /** - * Build a json serializable tree structure containing node information - * - * @param bool $includeRoot - * @param null $root - * @param null $depth - * @return array - */ - public function build(ContentRepositoryId $contentRepositoryId, $includeRoot = false, $root = null, $depth = null) - { - $root = $root === null ? $this->getRoot() : $root; - $depth = $depth === null ? $this->depth : $depth; - - $result = []; - - /** @var Node $childNode */ - foreach ($root->getChildNodes($this->nodeTypeFilter) as $childNode) { - $hasChildNodes = $childNode->hasChildNodes($this->nodeTypeFilter); - $shouldLoadChildNodes = $hasChildNodes && ($depth > 1 || $this->isInRootLine($this->active, $childNode)); - - $result[$childNode->getName()] = [ - 'label' => $childNode->getNodeType()->isOfType('Neos.Neos:Document') ? - $childNode->getProperty('title') : $childNode->getLabel(), - 'contextPath' => $childNode->getContextPath(), - 'nodeType' => $childNode->getNodeType()->getName(), - 'hasChildren' => $hasChildNodes, - 'isActive' => $this->active && ($childNode->getPath() === $this->active->getPath()), - 'isFocused' => $this->active && ($childNode->getPath() === $this->active->getPath()), - 'isCollapsed' => !$shouldLoadChildNodes, - 'isCollapsable' => $hasChildNodes - ]; - - if ($shouldLoadChildNodes) { - $result[$childNode->getName()]['children'] = - $this->build(false, $childNode, $depth - 1); - } - - if ($childNode->getNodeType()->isOfType('Neos.Neos:Document')) { - $result[$childNode->getName()]['href'] = $this->linkingService->createNodeUri( - /* $controllerContext */ - $this->controllerContext, - /* $node */ - $childNode, - /* $baseNode */ - null, - /* $format */ - null, - /* $absolute */ - true - ); - } - } - - if ($includeRoot) { - return [ - $root->getName() => [ - 'label' => $root->getNodeType()->isOfType('Neos.Neos:Document') ? - $root->getProperty('title') : $root->getLabel(), - 'icon' => 'globe', - 'contextPath' => $root->getContextPath(), - 'nodeType' => $root->getNodeType()->getName(), - 'hasChildren' => count($result), - 'isCollapsed' => false, - 'isActive' => $this->active && ($root->getPath() === $this->active->getPath()), - 'isFocused' => $this->active && ($root->getPath() === $this->active->getPath()), - 'children' => $result - ] - ]; - } - - return $result; - } - - protected function isInRootLine(Node $haystack = null, Node $needle) - { - if ($haystack === null) { - return false; - } - - return mb_strrpos($haystack->getPath(), $needle->getPath(), null, 'UTF-8') === 0; - } -} diff --git a/Configuration/Routes.Service.yaml b/Configuration/Routes.Service.yaml index e69d3f0ef9..a4ad58b2e8 100644 --- a/Configuration/Routes.Service.yaml +++ b/Configuration/Routes.Service.yaml @@ -54,14 +54,6 @@ '@action': 'clearClipboard' httpMethods: ['POST'] -- - name: 'Load Tree' - uriPattern: 'load-tree' - defaults: - '@controller': 'BackendService' - '@action': 'loadTree' - httpMethods: ['POST'] - - name: 'FlowQuery' uriPattern: 'flow-query' diff --git a/Resources/Private/Fusion/Backend/Root.fusion b/Resources/Private/Fusion/Backend/Root.fusion index 9018674065..af6e00a74b 100644 --- a/Resources/Private/Fusion/Backend/Root.fusion +++ b/Resources/Private/Fusion/Backend/Root.fusion @@ -125,9 +125,6 @@ backend = Neos.Fusion:Template { clearClipboard = Neos.Fusion:UriBuilder { action = 'clearClipboard' } - loadTree = Neos.Fusion:UriBuilder { - action = 'loadTree' - } flowQuery = Neos.Fusion:UriBuilder { action = 'flowQuery' } diff --git a/packages/neos-ui-backend-connector/src/Endpoints/index.ts b/packages/neos-ui-backend-connector/src/Endpoints/index.ts index 042bb7d60c..56f9075e0c 100644 --- a/packages/neos-ui-backend-connector/src/Endpoints/index.ts +++ b/packages/neos-ui-backend-connector/src/Endpoints/index.ts @@ -15,7 +15,6 @@ export interface Routes { copyNodes: string; cutNodes: string; clearClipboard: string; - loadTree: string; flowQuery: string; generateUriPathSegment: string; getWorkspaceInfo: string;