diff --git a/Classes/Application/ReloadNodes/NodeMap.php b/Classes/Application/ReloadNodes/NodeMap.php index 60285ffed8..38b08093ce 100644 --- a/Classes/Application/ReloadNodes/NodeMap.php +++ b/Classes/Application/ReloadNodes/NodeMap.php @@ -14,10 +14,8 @@ namespace Neos\Neos\Ui\Application\ReloadNodes; -use Neos\ContentRepository\Core\ContentRepository; use Neos\Flow\Annotations as Flow; use Neos\Flow\Mvc\ActionRequest; -use Neos\Neos\FrontendRouting\NodeAddress; use Neos\Neos\Ui\Fusion\Helper\NodeInfoHelper; /** diff --git a/Classes/Application/ReloadNodes/ReloadNodesQueryHandler.php b/Classes/Application/ReloadNodes/ReloadNodesQueryHandler.php index b53287e2d5..2b05c6903d 100644 --- a/Classes/Application/ReloadNodes/ReloadNodesQueryHandler.php +++ b/Classes/Application/ReloadNodes/ReloadNodesQueryHandler.php @@ -19,11 +19,11 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\NodeType\NodeTypeCriteria; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Annotations as Flow; use Neos\Flow\Mvc\ActionRequest; use Neos\Neos\Domain\Service\NodeTypeNameFactory; -use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\Neos\Ui\Fusion\Helper\NodeInfoHelper; /** @@ -148,10 +148,8 @@ public function handle(ReloadNodesQuery $query, ActionRequest $actionRequest): R - but the logic above mirrors the old behavior better. https://github.com/neos/neos-ui/issues/3517#issuecomment-2070274053 */ - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); - return new ReloadNodesQueryResult( - documentId: $nodeAddressFactory->createFromNode($documentNode), + documentId: NodeAddress::fromNode($documentNode), nodes: $nodeMapBuilder->build() ); } diff --git a/Classes/Application/ReloadNodes/ReloadNodesQueryResult.php b/Classes/Application/ReloadNodes/ReloadNodesQueryResult.php index 0775bb03f9..69fa39cc3f 100644 --- a/Classes/Application/ReloadNodes/ReloadNodesQueryResult.php +++ b/Classes/Application/ReloadNodes/ReloadNodesQueryResult.php @@ -14,8 +14,8 @@ namespace Neos\Neos\Ui\Application\ReloadNodes; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; use Neos\Flow\Annotations as Flow; -use Neos\Neos\FrontendRouting\NodeAddress; /** * The application layer level query result containing all nodes the UI needs @@ -38,7 +38,7 @@ public function __construct( public function jsonSerialize(): array { return [ - 'documentId' => $this->documentId->serializeForUri(), + 'documentId' => $this->documentId->toJson(), 'nodes' => $this->nodes ]; } diff --git a/Classes/ContentRepository/Service/WorkspaceService.php b/Classes/ContentRepository/Service/WorkspaceService.php index 479d2f077f..43cb89155f 100644 --- a/Classes/ContentRepository/Service/WorkspaceService.php +++ b/Classes/ContentRepository/Service/WorkspaceService.php @@ -14,14 +14,13 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindClosestNodeFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Annotations as Flow; use Neos\Neos\Domain\Service\NodeTypeNameFactory; use Neos\Neos\Domain\Service\WorkspacePublishingService; -use Neos\Neos\FrontendRouting\NodeAddress; -use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\Neos\PendingChangesProjection\Change; use Neos\Neos\Utility\NodeTypeWithFallbackProvider; @@ -57,26 +56,26 @@ public function getPublishableNodeInfo(WorkspaceName $workspaceName, ContentRepo $unpublishedNodes = []; foreach ($pendingChanges as $change) { if ($change->removalAttachmentPoint) { - $nodeAddress = new NodeAddress( - $change->contentStreamId, + $nodeAddress = NodeAddress::create( + $contentRepositoryId, + $workspaceName, $change->originDimensionSpacePoint->toDimensionSpacePoint(), - $change->nodeAggregateId, - $workspaceName + $change->nodeAggregateId ); /** * See {@see Remove::apply} -> Removal Attachment Point == closest document node. */ - $documentNodeAddress = new NodeAddress( - $change->contentStreamId, + $documentNodeAddress = NodeAddress::create( + $contentRepositoryId, + $workspaceName, $change->originDimensionSpacePoint->toDimensionSpacePoint(), - $change->removalAttachmentPoint, - $workspaceName + $change->removalAttachmentPoint ); $unpublishedNodes[] = [ - 'contextPath' => $nodeAddress->serializeForUri(), - 'documentContextPath' => $documentNodeAddress->serializeForUri(), + 'contextPath' => $nodeAddress->toJson(), + 'documentContextPath' => $documentNodeAddress->toJson(), 'typeOfChange' => $this->getTypeOfChange($change) ]; } else { @@ -89,11 +88,9 @@ public function getPublishableNodeInfo(WorkspaceName $workspaceName, ContentRepo if ($node instanceof Node) { $documentNode = $subgraph->findClosestNode($node->aggregateId, FindClosestNodeFilter::create(nodeTypes: NodeTypeNameFactory::NAME_DOCUMENT)); if ($documentNode instanceof Node) { - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); $unpublishedNodes[] = [ - 'contextPath' => $nodeAddressFactory->createFromNode($node)->serializeForUri(), - 'documentContextPath' => $nodeAddressFactory->createFromNode($documentNode) - ->serializeForUri(), + 'contextPath' => NodeAddress::fromNode($node)->toJson(), + 'documentContextPath' => NodeAddress::fromNode($documentNode)->toJson(), 'typeOfChange' => $this->getTypeOfChange($change) ]; } diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php index 60dfb5b8dc..0be2b353f2 100644 --- a/Classes/Controller/BackendController.php +++ b/Classes/Controller/BackendController.php @@ -23,7 +23,6 @@ use Neos\Neos\Domain\Repository\SiteRepository; use Neos\Neos\Domain\Service\NodeTypeNameFactory; use Neos\Neos\Domain\Service\WorkspaceService; -use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\Neos\FrontendRouting\NodeUriBuilderFactory; use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionResult; use Neos\Neos\Service\UserService; @@ -136,7 +135,7 @@ public function indexAction(string $node = null) $siteDetectionResult = SiteDetectionResult::fromRequest($this->request->getHttpRequest()); $contentRepository = $this->contentRepositoryRegistry->get($siteDetectionResult->contentRepositoryId); - $nodeAddress = $node !== null ? NodeAddressFactory::create($contentRepository)->createFromUriString($node) : null; + $nodeAddress = $node !== null ? NodeAddress::fromJsonString($node) : null; $user = $this->userService->getBackendUser(); if ($user === null) { @@ -180,7 +179,7 @@ public function indexAction(string $node = null) if (!$nodeAddress) { $node = $siteNode; } else { - $node = $subgraph->findNodeById($nodeAddress->nodeAggregateId); + $node = $subgraph->findNodeById($nodeAddress->aggregateId); } $this->view->setOption('title', 'Neos CMS'); diff --git a/Classes/Domain/Model/Changes/AbstractStructuralChange.php b/Classes/Domain/Model/Changes/AbstractStructuralChange.php index 020c85fd66..1293f58c3e 100644 --- a/Classes/Domain/Model/Changes/AbstractStructuralChange.php +++ b/Classes/Domain/Model/Changes/AbstractStructuralChange.php @@ -16,9 +16,9 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindChildNodesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\Nodes; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; use Neos\Flow\Annotations as Flow; -use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\Neos\Ui\ContentRepository\Service\NeosUiNodeService; use Neos\Neos\Ui\Domain\Model\AbstractChange; use Neos\Neos\Ui\Domain\Model\Feedback\Operations\ReloadDocument; @@ -147,14 +147,13 @@ protected function finish(Node $node) // 1) the parent of our new (or copied or moved) node is a ContentCollection; // so we can directly update an element of this content collection - $contentRepository = $this->contentRepositoryRegistry->get($node->contentRepositoryId); if ($parentNode && $this->getNodeType($parentNode)?->isOfType('Neos.Neos:ContentCollection') && // 2) the parent DOM address (i.e. the closest RENDERED node in DOM is actually the ContentCollection; // and no other node in between $this->getParentDomAddress() && $this->getParentDomAddress()->getFusionPath() && $this->getParentDomAddress()->getContextPath() === - NodeAddressFactory::create($contentRepository)->createFromNode($parentNode)->serializeForUri() + NodeAddress::fromNode($parentNode)->toJson() ) { $renderContentOutOfBand = new RenderContentOutOfBand(); $renderContentOutOfBand->setNode($node); diff --git a/Classes/Domain/Model/Feedback/Operations/NodeCreated.php b/Classes/Domain/Model/Feedback/Operations/NodeCreated.php index d5a13fe77c..f79d75b208 100644 --- a/Classes/Domain/Model/Feedback/Operations/NodeCreated.php +++ b/Classes/Domain/Model/Feedback/Operations/NodeCreated.php @@ -11,10 +11,10 @@ * source code. */ +use Neos\ContentRepository\Core\Projection\ContentGraph\Node; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Annotations as Flow; -use Neos\Neos\FrontendRouting\NodeAddressFactory; -use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\Flow\Mvc\Controller\ControllerContext; use Neos\Neos\Domain\Service\NodeTypeNameFactory; use Neos\Neos\Ui\Domain\Model\AbstractFeedback; @@ -91,9 +91,9 @@ public function serializePayload(ControllerContext $controllerContext) $node = $this->getNode(); $contentRepository = $this->contentRepositoryRegistry->get($node->contentRepositoryId); $nodeType = $contentRepository->getNodeTypeManager()->getNodeType($node->nodeTypeName); - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); + return [ - 'contextPath' => $nodeAddressFactory->createFromNode($node)->serializeForUri(), + 'contextPath' => NodeAddress::fromNode($node)->toJson(), 'identifier' => $node->aggregateId->value, 'isDocument' => $nodeType?->isOfType(NodeTypeNameFactory::NAME_DOCUMENT) ]; diff --git a/Classes/Domain/Model/Feedback/Operations/Redirect.php b/Classes/Domain/Model/Feedback/Operations/Redirect.php index 43e25d3f3c..3e3b303630 100644 --- a/Classes/Domain/Model/Feedback/Operations/Redirect.php +++ b/Classes/Domain/Model/Feedback/Operations/Redirect.php @@ -7,7 +7,6 @@ use Neos\Flow\Annotations as Flow; use Neos\Flow\Mvc\Controller\ControllerContext; use Neos\Neos\Domain\NodeLabel\NodeLabelGeneratorInterface; -use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\Neos\FrontendRouting\NodeUriBuilderFactory; use Neos\Neos\FrontendRouting\Options; use Neos\Neos\Ui\Domain\Model\AbstractFeedback; @@ -114,11 +113,10 @@ public function serializePayload(ControllerContext $controllerContext): array ); $contentRepository = $this->contentRepositoryRegistry->get($node->contentRepositoryId); - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); return [ 'redirectUri' => (string)$redirectUri, - 'redirectContextPath' => $nodeAddressFactory->createFromNode($node)->serializeForUri(), + 'redirectContextPath' => NodeAddress::fromNode($node)->toJson(), ]; } } diff --git a/Classes/Domain/Model/Feedback/Operations/ReloadContentOutOfBand.php b/Classes/Domain/Model/Feedback/Operations/ReloadContentOutOfBand.php index ac9ba7e918..084d5726bf 100644 --- a/Classes/Domain/Model/Feedback/Operations/ReloadContentOutOfBand.php +++ b/Classes/Domain/Model/Feedback/Operations/ReloadContentOutOfBand.php @@ -11,14 +11,14 @@ * source code. */ -use Neos\Neos\Domain\Service\RenderingModeService; -use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Annotations as Flow; use Neos\Flow\Mvc\Controller\ControllerContext; use Neos\Fusion\Core\Cache\ContentCache; use Neos\Fusion\Exception as FusionException; +use Neos\Neos\Domain\Service\RenderingModeService; use Neos\Neos\Fusion\Helper\CachingHelper; use Neos\Neos\Ui\Domain\Model\AbstractFeedback; use Neos\Neos\Ui\Domain\Model\FeedbackInterface; @@ -110,10 +110,8 @@ public function isSimilarTo(FeedbackInterface $feedback): bool public function serializePayload(ControllerContext $controllerContext): array { if (!is_null($this->nodeDomAddress)) { - $contentRepository = $this->contentRepositoryRegistry->get($this->node->contentRepositoryId); - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); return [ - 'contextPath' => $nodeAddressFactory->createFromNode($this->node)->serializeForUri(), + 'contextPath' => NodeAddress::fromNode($this->node)->toJson(), 'nodeDomAddress' => $this->nodeDomAddress, 'renderedContent' => $this->renderContent($controllerContext) ]; diff --git a/Classes/Domain/Model/Feedback/Operations/RemoveNode.php b/Classes/Domain/Model/Feedback/Operations/RemoveNode.php index 437e349b2a..826da07d67 100644 --- a/Classes/Domain/Model/Feedback/Operations/RemoveNode.php +++ b/Classes/Domain/Model/Feedback/Operations/RemoveNode.php @@ -11,13 +11,12 @@ * source code. */ +use Neos\ContentRepository\Core\Projection\ContentGraph\Node; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Annotations as Flow; -use Neos\Neos\Domain\NodeLabel\NodeLabelGeneratorInterface; -use Neos\Neos\FrontendRouting\NodeAddressFactory; -use Neos\Neos\FrontendRouting\NodeAddress; -use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\Flow\Mvc\Controller\ControllerContext; +use Neos\Neos\Domain\NodeLabel\NodeLabelGeneratorInterface; use Neos\Neos\Ui\Domain\Model\AbstractFeedback; use Neos\Neos\Ui\Domain\Model\FeedbackInterface; @@ -54,11 +53,8 @@ public function __construct(Node $node, Node $parentNode) protected function initializeObject(): void { - $contentRepository = $this->contentRepositoryRegistry->get($this->node->contentRepositoryId); - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); - - $this->nodeAddress = $nodeAddressFactory->createFromNode($this->node); - $this->parentNodeAddress = $nodeAddressFactory->createFromNode($this->parentNode); + $this->nodeAddress = NodeAddress::fromNode($this->node); + $this->parentNodeAddress = NodeAddress::fromNode($this->parentNode); } public function getNode(): Node @@ -110,8 +106,8 @@ public function isSimilarTo(FeedbackInterface $feedback) public function serializePayload(ControllerContext $controllerContext) { return [ - 'contextPath' => $this->nodeAddress->serializeForUri(), - 'parentContextPath' => $this->parentNodeAddress->serializeForUri() + 'contextPath' => $this->nodeAddress->toJson(), + 'parentContextPath' => $this->parentNodeAddress->toJson() ]; } } diff --git a/Classes/Domain/Model/Feedback/Operations/RenderContentOutOfBand.php b/Classes/Domain/Model/Feedback/Operations/RenderContentOutOfBand.php index d270fb33c6..ec58a6c417 100644 --- a/Classes/Domain/Model/Feedback/Operations/RenderContentOutOfBand.php +++ b/Classes/Domain/Model/Feedback/Operations/RenderContentOutOfBand.php @@ -15,13 +15,13 @@ namespace Neos\Neos\Ui\Domain\Model\Feedback\Operations; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; -use Neos\Neos\Domain\Service\RenderingModeService; -use Neos\Neos\FrontendRouting\NodeAddressFactory; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Annotations as Flow; use Neos\Flow\Mvc\Controller\ControllerContext; use Neos\Fusion\Core\Cache\ContentCache; use Neos\Fusion\Exception as FusionException; +use Neos\Neos\Domain\Service\RenderingModeService; use Neos\Neos\Fusion\Helper\CachingHelper; use Neos\Neos\Ui\Domain\Model\AbstractFeedback; use Neos\Neos\Ui\Domain\Model\FeedbackInterface; @@ -156,10 +156,8 @@ public function isSimilarTo(FeedbackInterface $feedback): bool public function serializePayload(ControllerContext $controllerContext): array { if (!is_null($this->node)) { - $contentRepository = $this->contentRepositoryRegistry->get($this->node->contentRepositoryId); - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); return [ - 'contextPath' => $nodeAddressFactory->createFromNode($this->node)->serializeForUri(), + 'contextPath' => NodeAddress::fromNode($this->node)->toJson(), 'parentDomAddress' => $this->getParentDomAddress(), 'siblingDomAddress' => $this->getSiblingDomAddress(), 'mode' => $this->getMode(), diff --git a/Classes/Domain/Model/Feedback/Operations/UpdateNodeInfo.php b/Classes/Domain/Model/Feedback/Operations/UpdateNodeInfo.php index 46b80d8b48..5d1dbd9ae4 100644 --- a/Classes/Domain/Model/Feedback/Operations/UpdateNodeInfo.php +++ b/Classes/Domain/Model/Feedback/Operations/UpdateNodeInfo.php @@ -13,10 +13,10 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindChildNodesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; -use Neos\Flow\Mvc\ActionRequest; -use Neos\Neos\FrontendRouting\NodeAddressFactory; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Annotations as Flow; +use Neos\Flow\Mvc\ActionRequest; use Neos\Flow\Mvc\Controller\ControllerContext; use Neos\Neos\Ui\Domain\Model\AbstractFeedback; use Neos\Neos\Ui\Domain\Model\FeedbackInterface; @@ -115,10 +115,9 @@ public function serializePayload(ControllerContext $controllerContext): array private function serializeNodeRecursively(Node $node, ActionRequest $actionRequest): array { $contentRepository = $this->contentRepositoryRegistry->get($node->contentRepositoryId); - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); $result = [ - $nodeAddressFactory->createFromNode($node)->serializeForUri() + NodeAddress::fromNode($node)->toJson() => $this->nodeInfoHelper->renderNodeWithPropertiesAndChildrenInformation( $node, $actionRequest diff --git a/Classes/Domain/Model/Feedback/Operations/UpdateNodePreviewUrl.php b/Classes/Domain/Model/Feedback/Operations/UpdateNodePreviewUrl.php index 4322d130b3..5e136e3ec4 100644 --- a/Classes/Domain/Model/Feedback/Operations/UpdateNodePreviewUrl.php +++ b/Classes/Domain/Model/Feedback/Operations/UpdateNodePreviewUrl.php @@ -12,11 +12,11 @@ */ use Neos\ContentRepository\Core\Projection\ContentGraph\Node; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Annotations as Flow; use Neos\Flow\Mvc\Controller\ControllerContext; use Neos\Neos\Domain\NodeLabel\NodeLabelGeneratorInterface; -use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\Neos\Ui\Domain\Model\AbstractFeedback; use Neos\Neos\Ui\Domain\Model\FeedbackInterface; use Neos\Neos\Ui\Fusion\Helper\NodeInfoHelper; @@ -111,10 +111,8 @@ public function serializePayload(ControllerContext $controllerContext): array $contextPath = ''; } else { $nodeInfoHelper = new NodeInfoHelper(); - $contentRepository = $this->contentRepositoryRegistry->get($this->node->contentRepositoryId); - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); $newPreviewUrl = $nodeInfoHelper->createRedirectToNode($this->node, $controllerContext->getRequest()); - $contextPath = $nodeAddressFactory->createFromNode($this->node)->serializeForUri(); + $contextPath = NodeAddress::fromNode($this->node)->toJson(); } return [ 'newPreviewUrl' => $newPreviewUrl, diff --git a/Classes/FlowQueryOperations/NeosUiDefaultNodesOperation.php b/Classes/FlowQueryOperations/NeosUiDefaultNodesOperation.php index c941c8bef9..5123e8f616 100644 --- a/Classes/FlowQueryOperations/NeosUiDefaultNodesOperation.php +++ b/Classes/FlowQueryOperations/NeosUiDefaultNodesOperation.php @@ -14,12 +14,12 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindAncestorNodesFilter; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindChildNodesFilter; -use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\NodeType\NodeTypeCriteria; +use Neos\ContentRepository\Core\Projection\ContentGraph\Node; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Eel\FlowQuery\FlowQuery; use Neos\Eel\FlowQuery\Operations\AbstractOperation; -use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\Flow\Annotations as Flow; /** @@ -78,7 +78,6 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) list($baseNodeType, $loadingDepth, $toggledNodes, $clipboardNodesContextPaths) = $arguments; $contentRepository = $this->contentRepositoryRegistry->get($documentNode->contentRepositoryId); - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); $baseNodeTypeConstraints = NodeTypeCriteria::fromFilterString($baseNodeType); @@ -105,15 +104,14 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) $loadingDepth, $toggledNodes, $ancestors, - $subgraph, - $nodeAddressFactory + $subgraph ) { - $baseNodeAddress = $nodeAddressFactory->createFromNode($baseNode); + $baseNodeAddress = NodeAddress::fromNode($baseNode); if ($level < $loadingDepth || // load all nodes within loadingDepth $loadingDepth === 0 || // unlimited loadingDepth // load toggled nodes - in_array($baseNodeAddress->serializeForUri(), $toggledNodes) || + in_array($baseNodeAddress->toJson(), $toggledNodes) || // load children of all parents of documentNode in_array($baseNode->aggregateId->value, array_map( fn (Node $node): string => $node->aggregateId->value, @@ -136,9 +134,9 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) } foreach ($clipboardNodesContextPaths as $clipboardNodeContextPath) { - // TODO: does not work across multiple CRs yet. - $clipboardNodeAddress = $nodeAddressFactory->createFromUriString($clipboardNodeContextPath); - $clipboardNode = $subgraph->findNodeById($clipboardNodeAddress->nodeAggregateId); + // TODO: might not work across multiple CRs yet. + $clipboardNodeAddress = NodeAddress::fromJsonString($clipboardNodeContextPath); + $clipboardNode = $subgraph->findNodeById($clipboardNodeAddress->aggregateId); if ($clipboardNode && !array_key_exists($clipboardNode->aggregateId->value, $nodes)) { $nodes[$clipboardNode->aggregateId->value] = $clipboardNode; } diff --git a/Classes/Fusion/Helper/NodeInfoHelper.php b/Classes/Fusion/Helper/NodeInfoHelper.php index 225a968604..f6278c25e4 100644 --- a/Classes/Fusion/Helper/NodeInfoHelper.php +++ b/Classes/Fusion/Helper/NodeInfoHelper.php @@ -25,7 +25,6 @@ use Neos\Flow\Mvc\Routing\UriBuilder; use Neos\Flow\Persistence\PersistenceManagerInterface; use Neos\Neos\Domain\NodeLabel\NodeLabelGeneratorInterface; -use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\Neos\FrontendRouting\NodeUriBuilderFactory; use Neos\Neos\Ui\Domain\Service\NodePropertyConverterService; use Neos\Neos\Ui\Domain\Service\UserLocaleService; @@ -186,13 +185,11 @@ protected function getBasicNodeInformation(Node $node): array $subgraph = $this->contentRepositoryRegistry->subgraphForNode($node); $parentNode = $subgraph->findParentNode($node->aggregateId); - $contentRepository = $this->contentRepositoryRegistry->get($node->contentRepositoryId); - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); - $nodeAddress = $nodeAddressFactory->createFromNode($node); + $nodeAddress = NodeAddress::fromNode($node); return [ - 'contextPath' => $nodeAddress->serializeForUri(), - 'nodeAddress' => $nodeAddress->serializeForUri(), + 'contextPath' => $nodeAddress->toJson(), + 'nodeAddress' => $nodeAddress->toJson(), 'name' => $node->name?->value ?? '', 'identifier' => $node->aggregateId->jsonSerialize(), 'nodeType' => $node->nodeTypeName->value, @@ -204,7 +201,7 @@ protected function getBasicNodeInformation(Node $node): array CountAncestorNodesFilter::create() ), 'children' => [], - 'parent' => $parentNode ? $nodeAddressFactory->createFromNode($parentNode)->serializeForUri() : null, + 'parent' => $parentNode ? NodeAddress::fromNode($parentNode)->toJson() : null, 'matchesCurrentDimensions' => $node->dimensionSpacePoint->equals($node->originDimensionSpacePoint), 'lastModificationDateTime' => $node->timestamps->lastModified?->format(\DateTime::ATOM), 'creationDateTime' => $node->timestamps->created->format(\DateTime::ATOM), @@ -240,9 +237,8 @@ protected function renderChildrenInformation(Node $node, string $nodeTypeFilterS $infos = []; foreach ($childNodes as $childNode) { $contentRepository = $this->contentRepositoryRegistry->get($childNode->contentRepositoryId); - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); $infos[] = [ - 'contextPath' => $nodeAddressFactory->createFromNode($childNode)->serializeForUri(), + 'contextPath' => NodeAddress::fromNode($childNode)->toJson(), 'nodeType' => $childNode->nodeTypeName->value ]; }; @@ -336,12 +332,11 @@ public function defaultNodesForBackend( ): array { // does not support multiple CRs here yet $contentRepository = $this->contentRepositoryRegistry->get($site->contentRepositoryId); - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); return [ - ($nodeAddressFactory->createFromNode($site)->serializeForUri()) + (NodeAddress::fromNode($site)->toJson()) => $this->renderNodeWithPropertiesAndChildrenInformation($site, $actionRequest), - ($nodeAddressFactory->createFromNode($documentNode)->serializeForUri()) + (NodeAddress::fromNode($documentNode)->toJson()) => $this->renderNodeWithPropertiesAndChildrenInformation($documentNode, $actionRequest) ]; } @@ -420,8 +415,7 @@ protected function buildContentChildNodeFilterString(): string public function serializedNodeAddress(Node $node): string { $contentRepository = $this->contentRepositoryRegistry->get($node->contentRepositoryId); - $nodeAddressFactory = NodeAddressFactory::create($contentRepository); - return $nodeAddressFactory->createFromNode($node)->serializeForUri(); + return NodeAddress::fromNode($node)->toJson(); } /**