diff --git a/Classes/Command/TaxonomyCommandController.php b/Classes/Command/TaxonomyCommandController.php index cfd197c..7d0594b 100644 --- a/Classes/Command/TaxonomyCommandController.php +++ b/Classes/Command/TaxonomyCommandController.php @@ -45,7 +45,7 @@ public function vocabulariesCommand(): void $this->output->outputTable( array_map( fn(Node $node) => [ - $node->nodeName?->value ?? $node->nodeAggregateId->value, + $node->name?->value ?? $node->aggregateId, $node->getProperty('title'), $node->getProperty('description') ], @@ -93,7 +93,7 @@ private function subtreeToTableRowsRecursively(Subtree $subtree): array { $rows = array_map(fn(Subtree $subtree)=>$this->subtreeToTableRowsRecursively($subtree), $subtree->children); $row = [ - str_repeat(' ', $subtree->level) . ($subtree->node->nodeName?->value ?? $subtree->node->nodeAggregateId->value), + str_repeat(' ', $subtree->level) . ($subtree->node->name?->value ?? $subtree->node->aggregateId), (string) $subtree->node->getProperty('title'), (string) $subtree->node->getProperty('description') ]; diff --git a/Classes/Controller/ModuleController.php b/Classes/Controller/ModuleController.php index cbbf311..1ddfd94 100644 --- a/Classes/Controller/ModuleController.php +++ b/Classes/Controller/ModuleController.php @@ -35,10 +35,12 @@ use Neos\Flow\Security\Context as SecurityContext; use Neos\Fusion\View\FusionView; use Neos\Neos\Domain\Service\WorkspaceNameBuilder; -use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\Neos\Fusion\Helper\DimensionHelper; use Neos\Neos\Fusion\Helper\NodeHelper; +use Neos\Neos\Domain\NodeLabel\NodeLabelGeneratorInterface; use Sitegeist\Taxonomy\Service\TaxonomyService; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; +use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId; use Neos\Utility\Arrays; /** @@ -72,14 +74,15 @@ class ModuleController extends ActionController #[Flow\Inject(lazy: false)] protected SecurityContext $securityContext; + #[Flow\Inject] + protected NodeLabelGeneratorInterface $nodeLabelGenerator; + protected ContentRepository $contentRepository; - protected NodeAddressFactory $nodeAddressFactory; public function initializeObject(): void { $this->contentRepository = $this->taxonomyService->getContentRepository(); - $this->nodeAddressFactory = NodeAddressFactory::create($this->contentRepository); } public function initializeView(ViewInterface $view): void @@ -106,8 +109,9 @@ public function indexAction(string $rootNodeAddress = null): void $vocabularies = $this->taxonomyService->findAllVocabularies($subgraph); + $this->view->assign('contentRepositoryId', ContentRepositoryId::fromString('default')); $this->view->assign('rootNode', $rootNode); - $this->view->assign('rootNodeAddress', $this->nodeAddressFactory->createFromNode($rootNode)->serializeForUri()); + $this->view->assign('rootNodeAddress', NodeAddress::fromNode($rootNode)->toJson()); $this->view->assign('vocabularies', $vocabularies); } @@ -143,6 +147,7 @@ public function vocabularyAction(string $vocabularyNodeAddress): void $rootNode = $this->taxonomyService->findOrCreateRoot($subgraph); $vocabularySubtree = $this->taxonomyService->findSubtree($vocabularyNode); + $this->view->assign('contentRepositoryId', ContentRepositoryId::fromString('default')); $this->view->assign('rootNode', $rootNode); $this->view->assign('vocabularyNode', $vocabularyNode); $this->view->assign('vocabularySubtree', $vocabularySubtree); @@ -170,7 +175,8 @@ public function createVocabularyAction(string $rootNodeAddress, string $name, ar $subgraph = $this->taxonomyService->getSubgraphForNode($rootNode); $liveWorkspace = $this->taxonomyService->getLiveWorkspace(); $generalizations = $contentRepository->getVariationGraph()->getRootGeneralizations(); - $nodeAddress = $this->nodeAddressFactory->createFromUriString($rootNodeAddress); + $nodeAddress = NodeAddress::fromJsonString($rootNodeAddress); + $originDimensionSpacePoint = OriginDimensionSpacePoint::fromDimensionSpacePoint($nodeAddress->dimensionSpacePoint); // create node @@ -178,17 +184,16 @@ public function createVocabularyAction(string $rootNodeAddress, string $name, ar $nodeTypeName = $this->taxonomyService->getVocabularyNodeTypeName(); $commandResult = $contentRepository->handle( CreateNodeAggregateWithNode::create( - $liveWorkspace->currentContentStreamId, + $liveWorkspace->workspaceName, $nodeAggregateId, $nodeTypeName, $originDimensionSpacePoint, - $rootNode->nodeAggregateId, + $rootNode->aggregateId, null, - NodeName::transliterateFromString($name), PropertyValuesToWrite::fromArray($properties) ) ); - $commandResult->block(); + $commandResult; // create required generalizations foreach ($generalizations as $dimensionSpacePoint) { @@ -199,7 +204,7 @@ public function createVocabularyAction(string $rootNodeAddress, string $name, ar $contentRepository->handle( CreateNodeVariant::create( - $liveWorkspace->currentContentStreamId, + $liveWorkspace->workspaceName, $nodeAggregateId, $originDimensionSpacePoint, $originDimensionSpacePoint2 @@ -213,7 +218,7 @@ public function createVocabularyAction(string $rootNodeAddress, string $name, ar if ($newVocabularyNode) { $this->addFlashMessage( - sprintf('Created vocabulary %s', $newVocabularyNode->getLabel()), + sprintf('Created vocabulary %s', $this->nodeLabelGenerator->getLabel($newVocabularyNode)), 'Create Vocabulary' ); } @@ -227,12 +232,12 @@ public function createVocabularyAction(string $rootNodeAddress, string $name, ar public function editVocabularyAction(string $vocabularyNodeAddress): void { $contentRepository = $this->taxonomyService->getContentRepository(); + $liveWorkspace = $this->taxonomyService->getLiveWorkspace(); $vocabularyNode = $this->taxonomyService->getNodeByNodeAddress($vocabularyNodeAddress); - $subgraph = $contentRepository->getContentGraph()->getSubgraph( - $vocabularyNode->subgraphIdentity->contentStreamId, - $vocabularyNode->subgraphIdentity->dimensionSpacePoint, - $vocabularyNode->subgraphIdentity->visibilityConstraints, + $subgraph = $contentRepository->getContentGraph($liveWorkspace->workspaceName)->getSubgraph( + $vocabularyNode->dimensionSpacePoint, + $vocabularyNode->visibilityConstraints ); $rootNode = $this->taxonomyService->findOrCreateRoot($subgraph); @@ -250,39 +255,40 @@ public function updateVocabularyAction(string $vocabularyNodeAddress, string $na { $vocabularyNode = $this->taxonomyService->getNodeByNodeAddress($vocabularyNodeAddress); $subgraph = $this->taxonomyService->getSubgraphForNode($vocabularyNode); + $liveWorkspace = $this->taxonomyService->getLiveWorkspace(); $rootNode = $this->taxonomyService->findOrCreateRoot($subgraph); $commandResult = $this->contentRepository->handle( SetNodeProperties::create( - $vocabularyNode->subgraphIdentity->contentStreamId, - $vocabularyNode->nodeAggregateId, + $liveWorkspace->workspaceName, + $vocabularyNode->aggregateId, $vocabularyNode->originDimensionSpacePoint, PropertyValuesToWrite::fromArray($properties) ) ); - if ($name != $vocabularyNode->nodeName?->value) { + if ($name != $vocabularyNode->name?->value) { $commandResult = $this->contentRepository->handle( ChangeNodeAggregateName::create( - $vocabularyNode->subgraphIdentity->contentStreamId, - $vocabularyNode->nodeAggregateId, + $liveWorkspace->workspaceName, + $vocabularyNode->aggregateId, NodeName::transliterateFromString($name) ) ); } - $commandResult->block(); + $commandResult; $this->rebaseCurrentUserWorkspace(); - $updatedVocabularyNode = $subgraph->findNodeById($vocabularyNode->nodeAggregateId); + $updatedVocabularyNode = $subgraph->findNodeById($vocabularyNode->aggregateId); if ($updatedVocabularyNode) { $this->addFlashMessage( - sprintf('Updated vocabulary %s', $updatedVocabularyNode->getLabel()) + sprintf('Updated vocabulary %s', $this->nodeLabelGenerator->getLabel($updatedVocabularyNode)) ); } - $this->redirect('index', null, null, ['rootNodeAddress' => $this->nodeAddressFactory->createFromNode($rootNode)]); + $this->redirect('index', null, null, ['rootNodeAddress' => NodeAddress::fromNode($rootNode)]); } /** @@ -297,20 +303,20 @@ public function deleteVocabularyAction(string $vocabularyNodeAddress): void $commandResult = $this->contentRepository->handle( RemoveNodeAggregate::create( - $liveWorkspace->currentContentStreamId, - $vocabularyNode->nodeAggregateId, + $liveWorkspace->workspaceName, + $vocabularyNode->aggregateId, $vocabularyNode->originDimensionSpacePoint->toDimensionSpacePoint(), NodeVariantSelectionStrategy::STRATEGY_ALL_VARIANTS ) ); - $commandResult->block(); + $commandResult; $this->rebaseCurrentUserWorkspace(); $this->addFlashMessage( - sprintf('Deleted vocabulary %s', $vocabularyNode->getLabel()) + sprintf('Deleted vocabulary %s', $this->nodeLabelGenerator->getLabel($vocabularyNode)) ); - $this->redirect('index', null, null, ['rootNodeAddress' => $this->nodeAddressFactory->createFromNode($rootNode)]); + $this->redirect('index', null, null, ['rootNodeAddress' => NodeAddress::fromNode($rootNode)]); } /** @@ -351,7 +357,7 @@ public function createTaxonomyAction(string $parentNodeAddress, string $name, ar $liveWorkspace = $this->taxonomyService->getLiveWorkspace(); $generalizations = $this->contentRepository->getVariationGraph()->getRootGeneralizations(); - $nodeAddress = $this->nodeAddressFactory->createFromUriString($parentNodeAddress); + $nodeAddress = NodeAddress::fromJsonString($parentNodeAddress); $originDimensionSpacePoint = OriginDimensionSpacePoint::fromDimensionSpacePoint($nodeAddress->dimensionSpacePoint); // create node @@ -359,17 +365,16 @@ public function createTaxonomyAction(string $parentNodeAddress, string $name, ar $nodeTypeName = $this->taxonomyService->getTaxonomyNodeTypeName(); $commandResult = $this->contentRepository->handle( CreateNodeAggregateWithNode::create( - $liveWorkspace->currentContentStreamId, + $liveWorkspace->workspaceName, $nodeAggregateId, $nodeTypeName, $originDimensionSpacePoint, - $parentNode->nodeAggregateId, + $parentNode->aggregateId, null, - NodeName::transliterateFromString($name), PropertyValuesToWrite::fromArray($properties) ) ); - $commandResult->block(); + $commandResult; // create required generalizations foreach ($generalizations as $dimensionSpacePoint) { @@ -378,9 +383,9 @@ public function createTaxonomyAction(string $parentNodeAddress, string $name, ar continue; } - $commandResult = $this->contentRepository->handle( + $this->contentRepository->handle( CreateNodeVariant::create( - $liveWorkspace->currentContentStreamId, + $liveWorkspace->workspaceName, $nodeAggregateId, $originDimensionSpacePoint, $originDimensionSpacePoint2 @@ -393,7 +398,7 @@ public function createTaxonomyAction(string $parentNodeAddress, string $name, ar if ($newTaxonomyNode) { $this->addFlashMessage( - sprintf('Created taxonomy %s', $newTaxonomyNode->getLabel()), + sprintf('Created taxonomy %s', $this->nodeLabelGenerator->getLabel($newTaxonomyNode)), 'Create taxomony' ); } @@ -402,7 +407,7 @@ public function createTaxonomyAction(string $parentNodeAddress, string $name, ar 'vocabulary', null, null, - ['vocabularyNodeAddress' => $this->nodeAddressFactory->createFromNode($vocabularyNode)] + ['vocabularyNodeAddress' => NodeAddress::fromNode($vocabularyNode)] ); } @@ -428,36 +433,37 @@ public function updateTaxonomyAction(string $taxonomyNodeAddress, string $name, $taxonomyNode = $this->taxonomyService->getNodeByNodeAddress($taxonomyNodeAddress); $vocabularyNode = $this->taxonomyService->findVocabularyForNode($taxonomyNode); $subgraph = $this->taxonomyService->getSubgraphForNode($taxonomyNode); + $liveWorkspace = $this->taxonomyService->getLiveWorkspace(); $commandResult = $this->contentRepository->handle( SetNodeProperties::create( - $taxonomyNode->subgraphIdentity->contentStreamId, - $taxonomyNode->nodeAggregateId, + $liveWorkspace->workspaceName, + $taxonomyNode->aggregateId, $taxonomyNode->originDimensionSpacePoint, PropertyValuesToWrite::fromArray($properties) ) ); - if ($name != $taxonomyNode->nodeName?->value) { + if ($name != $taxonomyNode->name?->value) { $commandResult = $this->contentRepository->handle( ChangeNodeAggregateName::create( - $taxonomyNode->subgraphIdentity->contentStreamId, - $taxonomyNode->nodeAggregateId, + $liveWorkspace->workspaceName, + $taxonomyNode->aggregateId, NodeName::transliterateFromString($name) ) ); } - $commandResult->block(); + $commandResult; $this->rebaseCurrentUserWorkspace(); - $updatedTaxonomyNode = $subgraph->findNodeById($vocabularyNode->nodeAggregateId); + $updatedTaxonomyNode = $subgraph->findNodeById($vocabularyNode->aggregateId); if ($updatedTaxonomyNode) { $this->addFlashMessage( - sprintf('Updated taxonomy %s', $updatedTaxonomyNode->getLabel()) + sprintf('Updated taxonomy %s', $this->nodeLabelGenerator->getLabel($updatedTaxonomyNode)) ); } - $this->redirect('vocabulary', null, null, ['vocabularyNodeAddress' => $this->nodeAddressFactory->createFromNode($vocabularyNode)]); + $this->redirect('vocabulary', null, null, ['vocabularyNodeAddress' => NodeAddress::fromNode($vocabularyNode)]); } /** @@ -471,20 +477,20 @@ public function deleteTaxonomyAction(string $taxonomyNodeAddress): void $commandResult = $this->contentRepository->handle( RemoveNodeAggregate::create( - $liveWorkspace->currentContentStreamId, - $taxonomyNode->nodeAggregateId, + $liveWorkspace->workspaceName, + $taxonomyNode->aggregateId, $taxonomyNode->originDimensionSpacePoint->toDimensionSpacePoint(), NodeVariantSelectionStrategy::STRATEGY_ALL_VARIANTS ) ); - $commandResult->block(); + $commandResult; $this->rebaseCurrentUserWorkspace(); $this->addFlashMessage( - sprintf('Deleted taxonomy %s', $taxonomyNode->getLabel()) + sprintf('Deleted taxonomy %s', $this->nodeLabelGenerator->getLabel($taxonomyNode)) ); - $this->redirect('vocabulary', null, null, ['vocabularyNodeAddress' => $this->nodeAddressFactory->createFromNode($vocabularyNode)]); + $this->redirect('vocabulary', null, null, ['vocabularyNodeAddress' => NodeAddress::fromNode($vocabularyNode)]); } protected function rebaseCurrentUserWorkspace(): void diff --git a/Classes/Controller/SecondaryInspectorController.php b/Classes/Controller/SecondaryInspectorController.php index d92b13b..812fc38 100644 --- a/Classes/Controller/SecondaryInspectorController.php +++ b/Classes/Controller/SecondaryInspectorController.php @@ -17,10 +17,13 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\AbsoluteNodePath; use Neos\ContentRepository\Core\Projection\ContentGraph\Subtree; +use Neos\Neos\Domain\NodeLabel\NodeLabelGeneratorInterface; use Neos\Flow\Annotations as Flow; use Neos\Flow\Mvc\Controller\ActionController; use Neos\Flow\Mvc\View\JsonView; use Sitegeist\Taxonomy\Service\TaxonomyService; +use Neos\Neos\Ui\ContentRepository\Service\NeosUiNodeService; +use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionResult; /** * Class SecondaryInspectorController @@ -34,6 +37,12 @@ class SecondaryInspectorController extends ActionController */ protected $taxonomyService; + #[Flow\Inject] + protected NodeLabelGeneratorInterface $nodeLabelGenerator; + + #[Flow\Inject] + protected NeosUiNodeService $nodeService; + /** * @var string[] */ @@ -46,7 +55,8 @@ class SecondaryInspectorController extends ActionController public function treeAction(string $contextNode, string $startingPoint): void { - $node = $this->taxonomyService->getNodeByNodeAddress($contextNode); + $contentRepositoryId = SiteDetectionResult::fromRequest($this->request->getHttpRequest())->contentRepositoryId; + $node = $this->nodeService->findNodeBySerializedNodeAddress($contextNode, $contentRepositoryId); $subgraph = $this->taxonomyService->getSubgraphForNode($node); $path = AbsoluteNodePath::fromString($startingPoint); @@ -66,10 +76,10 @@ public function treeAction(string $contextNode, string $startingPoint): void */ protected function toJson(Subtree $subtree, string $pathSoFar = null): array { - $label = $subtree->node->getLabel(); - $pathSegment = $subtree->node->nodeName?->value ?? $label; + $label = $this->nodeLabelGenerator->getLabel($subtree->node); + $pathSegment = $subtree->node->name?->value ?? $label; $path = $pathSoFar ? $pathSoFar . ' - ' . $pathSegment : $pathSegment; - $identifier = $subtree->node->nodeAggregateId->value; + $identifier = $subtree->node->aggregateId; $nodeType = $subtree->node->nodeTypeName->value; $title = $subtree->node->getProperty('title'); $description = $subtree->node->getProperty('description'); diff --git a/Classes/FlowQuery/CreateNodeHashTrait.php b/Classes/FlowQuery/CreateNodeHashTrait.php index 89b0b55..ad8ef85 100644 --- a/Classes/FlowQuery/CreateNodeHashTrait.php +++ b/Classes/FlowQuery/CreateNodeHashTrait.php @@ -9,7 +9,7 @@ trait CreateNodeHashTrait { /** - * Create a string hash containing the nodeAggregateId, cr-id, contentStream->id, dimensionSpacePoint->hash + * Create a string hash containing the aggregateId, cr-id, contentStream->id, dimensionSpacePoint->hash * and visibilityConstraints->hash. To be used for ensuring uniqueness or removing nodes. * * @see Node::equals() for comparison @@ -20,7 +20,7 @@ protected function createNodeHash(Node $node): string implode( ':', [ - $node->nodeAggregateId->value, + $node->aggregateId, $node->subgraphIdentity->contentRepositoryId->value, $node->subgraphIdentity->contentStreamId->value, $node->subgraphIdentity->dimensionSpacePoint->hash, diff --git a/Classes/FlowQuery/ReferencedTaxonomiesOperation.php b/Classes/FlowQuery/ReferencedTaxonomiesOperation.php index 61445fb..b750a9d 100644 --- a/Classes/FlowQuery/ReferencedTaxonomiesOperation.php +++ b/Classes/FlowQuery/ReferencedTaxonomiesOperation.php @@ -69,7 +69,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) */ foreach ($flowQuery->getContext() as $node) { $subgraph = $this->contentRepositoryRegistry->subgraphForNode($node); - $references = $subgraph->findReferences($node->nodeAggregateId, $findReferencesFilter); + $references = $subgraph->findReferences($node->aggregateId, $findReferencesFilter); foreach ($references as $reference) { $nodes[] = $reference->node; } diff --git a/Classes/FlowQuery/ReferencingTaxonomiesOperation.php b/Classes/FlowQuery/ReferencingTaxonomiesOperation.php index b8b36c4..1adc530 100644 --- a/Classes/FlowQuery/ReferencingTaxonomiesOperation.php +++ b/Classes/FlowQuery/ReferencingTaxonomiesOperation.php @@ -61,7 +61,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) */ foreach ($flowQuery->getContext() as $node) { $subgraph = $this->contentRepositoryRegistry->subgraphForNode($node); - $references = $subgraph->findBackReferences($node->nodeAggregateId, $findBackReferencesFilter); + $references = $subgraph->findBackReferences($node->aggregateId, $findBackReferencesFilter); foreach ($references as $reference) { $nodes[] = $reference->node; } diff --git a/Classes/FlowQuery/SubTaxonomiesOperation.php b/Classes/FlowQuery/SubTaxonomiesOperation.php index d1a4c7b..013ea95 100644 --- a/Classes/FlowQuery/SubTaxonomiesOperation.php +++ b/Classes/FlowQuery/SubTaxonomiesOperation.php @@ -67,7 +67,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) foreach ($flowQuery->getContext() as $node) { $subgraph = $this->contentRepositoryRegistry->subgraphForNode($node); - $subtree = $subgraph->findSubtree($node->nodeAggregateId, $filter); + $subtree = $subgraph->findSubtree($node->aggregateId, $filter); if ($subtree) { foreach ($subtree->children as $child) { $nodes = $nodes->merge($this->flattenSubtree($child)); diff --git a/Classes/FlowQuery/WithSubTaxonomiesOperation.php b/Classes/FlowQuery/WithSubTaxonomiesOperation.php index 25c8a02..7a68af7 100644 --- a/Classes/FlowQuery/WithSubTaxonomiesOperation.php +++ b/Classes/FlowQuery/WithSubTaxonomiesOperation.php @@ -70,7 +70,7 @@ public function evaluate(FlowQuery $flowQuery, array $arguments) $nodes = Nodes::createEmpty(); foreach ($flowQuery->getContext() as $node) { $subgraph = $this->contentRepositoryRegistry->subgraphForNode($node); - $subtree = $subgraph->findSubtree($node->nodeAggregateId, $filter); + $subtree = $subgraph->findSubtree($node->aggregateId, $filter); if ($subtree) { $nodes = $nodes->merge($this->flattenSubtree($subtree)); } diff --git a/Classes/Service/TaxonomyService.php b/Classes/Service/TaxonomyService.php index bc42328..a0965e9 100644 --- a/Classes/Service/TaxonomyService.php +++ b/Classes/Service/TaxonomyService.php @@ -16,7 +16,7 @@ namespace Sitegeist\Taxonomy\Service; use Neos\ContentRepository\Core\ContentRepository; -use Neos\ContentRepository\Core\Factory\ContentRepositoryId; +use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\CreateRootNodeAggregateWithNode; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\NodeType\NodeTypeNames; @@ -31,11 +31,11 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\Subtree; use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints; use Neos\ContentRepository\Core\Projection\Workspace\Workspace; +use Neos\ContentRepository\Core\SharedModel\Node\NodeAddress; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Annotations as Flow; -use Neos\Neos\FrontendRouting\NodeAddressFactory; class TaxonomyService { @@ -82,7 +82,7 @@ public function findVocabularyForNode(Node $node): Node $subgraph = $this->crRegistry->subgraphForNode($node); $vocabularyNode = $subgraph->findClosestNode( - $node->nodeAggregateId, + $node->aggregateId, FindClosestNodeFilter::create( nodeTypes: NodeTypeCriteria::create( NodeTypeNames::fromArray([ $this->getVocabularyNodeTypeName()]), @@ -110,12 +110,12 @@ public function findOrCreateRoot(ContentSubgraphInterface $subgraph): Node $commandResult = $contentRepository->handle( CreateRootNodeAggregateWithNode::create( - $liveWorkspace->currentContentStreamId, + $liveWorkspace->workspaceName, NodeAggregateId::create(), $this->getRootNodeTypeName() ) ); - $commandResult->block(); + $commandResult; $rootNode = $subgraph->findRootNodeByType($this->getRootNodeTypeName()); if ($rootNode instanceof Node) { @@ -129,7 +129,7 @@ public function findAllVocabularies(ContentSubgraphInterface $subgraph): Nodes { $root = $this->findOrCreateRoot($subgraph); return $subgraph->findChildNodes( - $root->nodeAggregateId, + $root->aggregateId, FindChildNodesFilter::create( nodeTypes: NodeTypeCriteria::create( NodeTypeNames::fromArray([$this->getVocabularyNodeTypeName()]), @@ -159,7 +159,7 @@ public function findTaxonomyByVocabularyNameAndPath(ContentSubgraphInterface $su } $taxonomy = $subgraph->findNodeByPath( NodePath::fromString($taxonomyPath), - $vocabulary->nodeAggregateId + $vocabulary->aggregateId ); return $taxonomy; } @@ -169,7 +169,7 @@ public function findSubtree(Node $StartNode): ?Subtree $subgraph = $this->crRegistry->subgraphForNode($StartNode); $vocabularySubtree = $subgraph->findSubtree( - $StartNode->nodeAggregateId, + $StartNode->aggregateId, FindSubtreeFilter::create( nodeTypes: NodeTypeCriteria::create( NodeTypeNames::fromArray([$this->getTaxonomyNodeTypeName(), $this->getVocabularyNodeTypeName()]), @@ -190,7 +190,7 @@ private function orderSubtreeByNameRecursive(Subtree $subtree): Subtree ); usort( $children, - fn(Subtree $a, Subtree $b) => $a->node->nodeName?->value <=> $b->node->nodeName?->value + fn(Subtree $a, Subtree $b) => $a->node->name?->value <=> $b->node->name?->value ); return new Subtree( $subtree->level, @@ -202,13 +202,12 @@ private function orderSubtreeByNameRecursive(Subtree $subtree): Subtree public function getNodeByNodeAddress(string $serializedNodeAddress): Node { $contentRepository = $this->getContentRepository(); - $nodeAddress = NodeAddressFactory::create($contentRepository)->createFromUriString($serializedNodeAddress); - $subgraph = $contentRepository->getContentGraph()->getSubgraph( - $nodeAddress->contentStreamId, + $nodeAddress = NodeAddress::fromJsonString($serializedNodeAddress); + $subgraph = $contentRepository->getContentGraph(WorkspaceName::forLive())->getSubgraph( $nodeAddress->dimensionSpacePoint, VisibilityConstraints::withoutRestrictions() ); - $node = $subgraph->findNodeById($nodeAddress->nodeAggregateId); + $node = $subgraph->findNodeById($nodeAddress->aggregateId); if (is_null($node)) { throw new \InvalidArgumentException('nodeAddress does not resolve to a node'); } @@ -218,15 +217,13 @@ public function getNodeByNodeAddress(string $serializedNodeAddress): Node public function getDefaultSubgraph(): ContentSubgraphInterface { $contentRepository = $this->getContentRepository(); - $liveWorkspace = $this->getLiveWorkspace(); $generalizations = $contentRepository->getVariationGraph()->getRootGeneralizations(); $dimensionSpacePoint = reset($generalizations); if (!$dimensionSpacePoint) { throw new \Exception('default dimensionSpacePoint could not be found'); } - $contentGraph = $contentRepository->getContentGraph(); + $contentGraph = $contentRepository->getContentGraph(WorkspaceName::forLive()); $subgraph = $contentGraph->getSubgraph( - $liveWorkspace->currentContentStreamId, $dimensionSpacePoint, VisibilityConstraints::withoutRestrictions() ); diff --git a/Resources/Private/Fusion/Backend/Form/Taxonomy.fusion b/Resources/Private/Fusion/Backend/Form/Taxonomy.fusion index 5b9f3de..ed5cc55 100644 --- a/Resources/Private/Fusion/Backend/Form/Taxonomy.fusion +++ b/Resources/Private/Fusion/Backend/Form/Taxonomy.fusion @@ -13,7 +13,7 @@ prototype(Sitegeist.Taxonomy:Form.Taxonomy) < prototype(Neos.Fusion:Component) { renderer = afx` diff --git a/Resources/Private/Fusion/Backend/Form/Vocabulary.fusion b/Resources/Private/Fusion/Backend/Form/Vocabulary.fusion index 8cee6ed..04598ba 100644 --- a/Resources/Private/Fusion/Backend/Form/Vocabulary.fusion +++ b/Resources/Private/Fusion/Backend/Form/Vocabulary.fusion @@ -13,7 +13,7 @@ prototype(Sitegeist.Taxonomy:Form.Vocabulary) < prototype(Neos.Fusion:Component) renderer = afx` diff --git a/Resources/Private/Fusion/Backend/Fragments/DimensionSelector.fusion b/Resources/Private/Fusion/Backend/Fragments/DimensionSelector.fusion index b8f2741..8c403e5 100644 --- a/Resources/Private/Fusion/Backend/Fragments/DimensionSelector.fusion +++ b/Resources/Private/Fusion/Backend/Fragments/DimensionSelector.fusion @@ -3,6 +3,7 @@ prototype(Sitegeist.Taxonomy:Views.Fragments.DimensionSelector) < prototype(Neos targetAction = null targetProperty = null contextNode = null + contentRepositoryId = null renderer = afx` - + {iterator.isFirst ? '' : ' '} - {String.firstLetterToUpperCase(dimensionKey)}: {Neos.Dimension.currentValue(props.contextNode, dimensionKey).value} - - {String.firstLetterToUpperCase(dimensionKey)}: {dimensionValue.value} - + + {String.firstLetterToUpperCase(dimensionKey)}: {dimensionValue.value} + diff --git a/Resources/Private/Fusion/Backend/Views/Taxonomy.Edit.fusion b/Resources/Private/Fusion/Backend/Views/Taxonomy.Edit.fusion index 18e1d05..c06a4dc 100644 --- a/Resources/Private/Fusion/Backend/Views/Taxonomy.Edit.fusion +++ b/Resources/Private/Fusion/Backend/Views/Taxonomy.Edit.fusion @@ -5,7 +5,7 @@ prototype(Sitegeist.Taxonomy:Views.Module.Taxonomy.Edit) < prototype(Neos.Fusion i18nTaxonomy = ${Translation.value('').package("Sitegeist.Taxonomy").source('NodeTypes/Taxonomy')} renderer = afx` - {props.i18nMain.id('taxon')}: {taxonomyNode.properties.title} [{taxonomyNode.nodeName.value}] + {props.i18nMain.id('taxon')}: {taxonomyNode.properties.title} [{taxonomyNode.name.value}] - {props.i18n.id('vocabulary')} "{vocabularyNode.properties.title}" [{vocabularyNode.nodeName.value}] + {props.i18n.id('vocabulary')} "{vocabularyNode.properties.title}" [{vocabularyNode.name.value}]
@@ -77,9 +78,9 @@ prototype(Sitegeist.Taxonomy:Views.Module.Taxonomy.List.Item) < prototype(Neos.F 1}>       - +     - {props.taxonomySubtree.node.properties.title} [{props.taxonomySubtree.node.nodeName.value}] + {props.taxonomySubtree.node.properties.title} [{props.taxonomySubtree.node.name.value}] {props.taxonomySubtree.node.properties.description} @@ -112,12 +113,12 @@ prototype(Sitegeist.Taxonomy:Views.Module.Taxonomy.List.Item) < prototype(Neos.F -
+
diff --git a/Resources/Private/Fusion/Backend/Views/Taxonomy.New.fusion b/Resources/Private/Fusion/Backend/Views/Taxonomy.New.fusion index 67ca02c..4e9a7b5 100644 --- a/Resources/Private/Fusion/Backend/Views/Taxonomy.New.fusion +++ b/Resources/Private/Fusion/Backend/Views/Taxonomy.New.fusion @@ -4,7 +4,7 @@ prototype(Sitegeist.Taxonomy:Views.Module.Taxonomy.New) < prototype(Neos.Fusion: i18nTaxonomy = ${Translation.value('').package("Sitegeist.Taxonomy").source('NodeTypes/Taxonomy')} renderer = afx` - {props.i18nMain.id('taxon.createBelow')}: "{parentNode.properties.title}" [{parentNode.nodeName.value}] + {props.i18nMain.id('taxon.createBelow')}: "{parentNode.properties.title}" [{parentNode.name.value}] - {props.i18nMain.id('vocabulary')}: "{vocabularyNode.properties.title}" [{vocabularyNode.nodeName.value}] + {props.i18nMain.id('vocabulary')}: "{vocabularyNode.properties.title}" [{vocabularyNode.name.value}] {props.i18nMain.id('generic.default')}: {defaultVocabulary.properties.title}
@@ -36,7 +37,7 @@ prototype(Sitegeist.Taxonomy:Views.Module.Vocabulary.List) < prototype(Neos.Fusi

- {vocabulary.properties.title} [{vocabulary.nodeName.value}] + {vocabulary.properties.title} [{vocabulary.name.value}]

@@ -59,7 +60,7 @@ prototype(Sitegeist.Taxonomy:Views.Module.Vocabulary.List) < prototype(Neos.Fusi   - @@ -69,7 +70,7 @@ prototype(Sitegeist.Taxonomy:Views.Module.Vocabulary.List) < prototype(Neos.Fusi
-
+