From 57f20009f01de60ce459720793a6bc45591ed36f Mon Sep 17 00:00:00 2001 From: bwaidelich Date: Mon, 30 Oct 2023 16:10:06 +0100 Subject: [PATCH] FEATURE: Subtree Tags Resolves: #4550 Related: #3732 --- .../RestrictionIntegrityIsProvided.feature | 3 +- ...strictionsArePropagatedRecursively.feature | 3 +- .../DoctrineDbalContentGraphProjection.php | 30 ++----- .../{NodeDisabling.php => Tagging.php} | 31 ++++--- .../{NodeDisabling.php => Tagging.php} | 9 +- .../Projection/HypergraphProjection.php | 20 ++--- ...ableNodeAggregate_ConstraintChecks.feature | 21 +++-- ...bleNodeAggregate_WithoutDimensions.feature | 6 +- ...isableNodeAggregate_WithDimensions.feature | 12 ++- ...ableNodeAggregate_ConstraintChecks.feature | 15 ++-- ...bleNodeAggregate_WithoutDimensions.feature | 33 +++++--- ...EnableNodeAggregate_WithDimensions.feature | 21 +++-- ...DisabledAncestor_WithoutDimensions.feature | 6 +- ...ithDisabledAncestor_WithDimensions.feature | 12 ++- ...09-CreateNodeVariantOfDisabledNode.feature | 30 ++++--- ...oveNodeAggregate_WithoutDimensions.feature | 3 +- ...RemoveNodeAggregate_WithDimensions.feature | 6 +- ...WithDisabledNodesWithoutDimensions.feature | 3 +- .../AddDimensionShineThrough.feature | 3 +- .../Migration/MoveDimensionSpacePoint.feature | 3 +- ...eringDisableStateWithoutDimensions.feature | 51 +++++++---- .../AllCommandsAreImplemented.feature | 18 ++-- .../RemoveNodeAggregateAfterDisabling.feature | 3 +- .../NodeTraversal/AncestorNodes.feature | 6 +- .../Features/NodeTraversal/ChildNodes.feature | 3 +- .../NodeTraversal/ClosestNode.feature | 6 +- .../Features/NodeTraversal/CountNodes.feature | 3 +- .../NodeTraversal/DescendantNodes.feature | 3 +- ...dChildNodeConnectedThroughEdgeName.feature | 3 +- .../NodeTraversal/FindNodeById.feature | 3 +- .../NodeTraversal/FindNodeByPath.feature | 3 +- .../NodeTraversal/FindParentNode.feature | 3 +- .../NodeTraversal/FindSubtree.feature | 3 +- .../Features/NodeTraversal/References.feature | 3 +- .../NodeTraversal/RetrieveNodePath.feature | 3 +- .../NodeTraversal/SiblingNodes.feature | 3 +- .../Features/NodeTraversal/Timestamps.feature | 8 +- .../Classes/EventStore/EventNormalizer.php | 13 ++- .../Feature/Common/ConstraintChecks.php | 2 - .../Feature/NodeAggregateCommandHandler.php | 12 +-- .../Event/NodeAggregateWasDisabled.php | 3 +- .../Event/NodeAggregateWasEnabled.php | 4 +- .../Command/AddSubtreeTag.php} | 32 ++++--- .../Command/RemoveSubtreeTag.php} | 33 +++++--- .../Feature/Tagging/Dto/SubtreeTag.php | 42 ++++++++++ .../Feature/Tagging/Dto/SubtreeTags.php | 69 +++++++++++++++ .../Tagging/Event/SubtreeTagWasAdded.php | 83 ++++++++++++++++++ .../Tagging/Event/SubtreeTagWasRemoved.php | 84 +++++++++++++++++++ .../NodeTagging.php} | 78 +++++++---------- .../Projection/ContentGraph/NodeAggregate.php | 4 + .../NodeHiddenStateProjection.php | 16 ++-- .../Classes/NodeDataToEventsProcessor.php | 47 ++++++----- .../Features/Bootstrap/CRTestSuiteTrait.php | 4 +- .../{NodeDisabling.php => Tagging.php} | 47 ++++++----- ...ricCommandExecutionAndEventPublication.php | 8 +- .../CatchUpHook/RouterCacheHook.php | 8 +- .../Projection/DocumentUriPathProjection.php | 16 ++-- .../ChangeProjection.php | 16 ++-- .../FrontendRouting/DisableNodes.feature | 56 ++++++++----- .../FrontendRouting/RouteCache.feature | 3 +- 60 files changed, 740 insertions(+), 335 deletions(-) rename Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/{NodeDisabling.php => Tagging.php} (80%) rename Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/{NodeDisabling.php => Tagging.php} (87%) rename Neos.ContentRepository.Core/Classes/Feature/{NodeDisabling/Command/DisableNodeAggregate.php => Tagging/Command/AddSubtreeTag.php} (81%) rename Neos.ContentRepository.Core/Classes/Feature/{NodeDisabling/Command/EnableNodeAggregate.php => Tagging/Command/RemoveSubtreeTag.php} (77%) create mode 100644 Neos.ContentRepository.Core/Classes/Feature/Tagging/Dto/SubtreeTag.php create mode 100644 Neos.ContentRepository.Core/Classes/Feature/Tagging/Dto/SubtreeTags.php create mode 100644 Neos.ContentRepository.Core/Classes/Feature/Tagging/Event/SubtreeTagWasAdded.php create mode 100644 Neos.ContentRepository.Core/Classes/Feature/Tagging/Event/SubtreeTagWasRemoved.php rename Neos.ContentRepository.Core/Classes/Feature/{NodeDisabling/NodeDisabling.php => Tagging/NodeTagging.php} (59%) rename Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/{NodeDisabling.php => Tagging.php} (69%) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/RestrictionIntegrityIsProvided.feature b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/RestrictionIntegrityIsProvided.feature index 7412e9ee0cb..f36f216aacb 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/RestrictionIntegrityIsProvided.feature +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/RestrictionIntegrityIsProvided.feature @@ -45,11 +45,12 @@ Feature: Run integrity violation detection regarding restriction relations | parentNodeAggregateId | "sir-david-nodenborough" | | nodeName | "child-document" | | nodeAggregateClassification | "regular" | - And the event NodeAggregateWasDisabled was published with payload: + And the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{"language":"de"},{"language":"gsw"},{"language":"fr"}] | + | tag | "disabled" | And the graph projection is fully up to date Scenario: Detach a restriction relation from its origin diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/RestrictionsArePropagatedRecursively.feature b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/RestrictionsArePropagatedRecursively.feature index 9253b7ac73a..a2ce768626a 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/RestrictionsArePropagatedRecursively.feature +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/RestrictionsArePropagatedRecursively.feature @@ -58,11 +58,12 @@ Feature: Run integrity violation detection regarding restriction relations | parentNodeAggregateId | "sir-nodeward-nodington-iii" | | nodeName | "child-document" | | nodeAggregateClassification | "regular" | - And the event NodeAggregateWasDisabled was published with payload: + And the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{"language":"de"},{"language":"gsw"},{"language":"fr"}] | + | tag | "disabled" | And the graph projection is fully up to date And I remove the following restriction relation: | Key | Value | diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php index 807679337c5..dbee4cdd964 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/DoctrineDbalContentGraphProjection.php @@ -8,7 +8,7 @@ use Doctrine\DBAL\Schema\AbstractSchemaManager; use Doctrine\DBAL\Schema\Comparator; use Doctrine\DBAL\Types\Types; -use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature\NodeDisabling; +use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature\Tagging; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature\NodeMove; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature\NodeRemoval; use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature\NodeVariation; @@ -28,8 +28,6 @@ use Neos\ContentRepository\Core\Feature\DimensionSpaceAdjustment\Event\DimensionShineThroughWasAdded; use Neos\ContentRepository\Core\Feature\DimensionSpaceAdjustment\Event\DimensionSpacePointWasMoved; use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasDisabled; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasEnabled; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; use Neos\ContentRepository\Core\Feature\NodeModification\Event\NodePropertiesWereSet; use Neos\ContentRepository\Core\Feature\NodeMove\Event\NodeAggregateWasMoved; @@ -43,6 +41,8 @@ use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodeSpecializationVariantWasCreated; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateDimensionsWereUpdated; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateWithNodeWasCreated; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasAdded; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasRemoved; use Neos\ContentRepository\Core\Infrastructure\DbalClientInterface; use Neos\ContentRepository\Core\NodeType\NodeTypeManager; use Neos\ContentRepository\Core\NodeType\NodeTypeName; @@ -67,7 +67,7 @@ final class DoctrineDbalContentGraphProjection implements ProjectionInterface, WithMarkStaleInterface { use NodeVariation; - use NodeDisabling; + use Tagging; use RestrictionRelations; use NodeRemoval; use NodeMove; @@ -163,7 +163,6 @@ public function canHandle(EventInterface $event): bool ContentStreamWasRemoved::class, NodePropertiesWereSet::class, NodeReferencesWereSet::class, - NodeAggregateWasEnabled::class, NodeAggregateTypeWasChanged::class, DimensionSpacePointWasMoved::class, DimensionShineThroughWasAdded::class, @@ -172,7 +171,8 @@ public function canHandle(EventInterface $event): bool NodeSpecializationVariantWasCreated::class, NodeGeneralizationVariantWasCreated::class, NodePeerVariantWasCreated::class, - NodeAggregateWasDisabled::class + SubtreeTagWasAdded::class, + SubtreeTagWasRemoved::class, ]); } @@ -187,7 +187,6 @@ public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void ContentStreamWasRemoved::class => $this->whenContentStreamWasRemoved($event), NodePropertiesWereSet::class => $this->whenNodePropertiesWereSet($event, $eventEnvelope), NodeReferencesWereSet::class => $this->whenNodeReferencesWereSet($event, $eventEnvelope), - NodeAggregateWasEnabled::class => $this->whenNodeAggregateWasEnabled($event), NodeAggregateTypeWasChanged::class => $this->whenNodeAggregateTypeWasChanged($event, $eventEnvelope), DimensionSpacePointWasMoved::class => $this->whenDimensionSpacePointWasMoved($event), DimensionShineThroughWasAdded::class => $this->whenDimensionShineThroughWasAdded($event), @@ -196,7 +195,8 @@ public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void NodeSpecializationVariantWasCreated::class => $this->whenNodeSpecializationVariantWasCreated($event, $eventEnvelope), NodeGeneralizationVariantWasCreated::class => $this->whenNodeGeneralizationVariantWasCreated($event, $eventEnvelope), NodePeerVariantWasCreated::class => $this->whenNodePeerVariantWasCreated($event, $eventEnvelope), - NodeAggregateWasDisabled::class => $this->whenNodeAggregateWasDisabled($event), + SubtreeTagWasAdded::class => $this->whenSubtreeTagWasAdded($event), + SubtreeTagWasRemoved::class => $this->whenSubtreeTagWasRemoved($event), default => throw new \InvalidArgumentException(sprintf('Unsupported event %s', get_debug_type($event))), }; } @@ -900,20 +900,6 @@ private function cascadeRestrictionRelations( ); } - /** - * @throws \Throwable - */ - private function whenNodeAggregateWasEnabled(NodeAggregateWasEnabled $event): void - { - $this->transactional(function () use ($event) { - $this->removeOutgoingRestrictionRelationsOfNodeAggregateInDimensionSpacePoints( - $event->contentStreamId, - $event->nodeAggregateId, - $event->affectedDimensionSpacePoints - ); - }); - } - /** * @param HierarchyRelation $sourceHierarchyRelation * @param ContentStreamId $contentStreamId diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeDisabling.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/Tagging.php similarity index 80% rename from Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeDisabling.php rename to Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/Tagging.php index e3ade9c7eb2..c7a1ede7f58 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/NodeDisabling.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Projection/Feature/Tagging.php @@ -5,27 +5,22 @@ namespace Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\Feature; use Doctrine\DBAL\Connection; -use Doctrine\DBAL\Types\Types; -use Neos\ContentGraph\DoctrineDbalAdapter\Domain\Projection\NodeRecord; -use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasDisabled; -use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; -use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; -use Neos\EventStore\Model\EventEnvelope; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasAdded; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasRemoved; /** - * The NodeDisabling projection feature trait + * The Tagging projection feature trait * * @internal */ -trait NodeDisabling +trait Tagging { abstract protected function getTableNamePrefix(): string; /** * @throws \Throwable */ - private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): void + private function whenSubtreeTagWasAdded(SubtreeTagWasAdded $event): void { $this->transactional(function () use ($event) { @@ -34,7 +29,7 @@ private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): // normal "INSERT" can trigger a duplicate key constraint exception $this->getDatabaseConnection()->executeStatement( ' --- GraphProjector::whenNodeAggregateWasDisabled +-- GraphProjector::whenSubtreeTagWasAdded insert ignore into ' . $this->getTableNamePrefix() . '_restrictionrelation (contentstreamid, dimensionspacepointhash, originnodeaggregateid, affectednodeaggregateid) @@ -94,6 +89,20 @@ private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): }); } + /** + * @throws \Throwable + */ + private function whenSubtreeTagWasRemoved(SubtreeTagWasRemoved $event): void + { + $this->transactional(function () use ($event) { + $this->removeOutgoingRestrictionRelationsOfNodeAggregateInDimensionSpacePoints( + $event->contentStreamId, + $event->nodeAggregateId, + $event->affectedDimensionSpacePoints + ); + }); + } + abstract protected function getDatabaseConnection(): Connection; abstract protected function transactional(\Closure $operations): void; diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeDisabling.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/Tagging.php similarity index 87% rename from Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeDisabling.php rename to Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/Tagging.php index f96b2535b29..cf170ef5aea 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/NodeDisabling.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/Feature/Tagging.php @@ -17,20 +17,19 @@ use Doctrine\DBAL\Connection; use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\ProjectionHypergraph; use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\RestrictionHyperrelationRecord; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasDisabled; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasEnabled; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasAdded; /** * The node disabling feature set for the hypergraph projector * * @internal */ -trait NodeDisabling +trait Tagging { /** * @throws \Throwable */ - private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): void + private function whenSubtreeTagWasAdded(SubtreeTagWasAdded $event): void { $this->transactional(function () use ($event) { $descendantNodeAggregateIdsByAffectedDimensionSpacePoint @@ -58,7 +57,7 @@ private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): /** * @throws \Throwable */ - private function whenNodeAggregateWasEnabled(NodeAggregateWasEnabled $event): void + private function whenSubtreeTagWasRemoved(SubtreeTagWasRemoved $event): void { $this->transactional(function () use ($event) { $restrictionRelations = $this->getProjectionHypergraph()->findOutgoingRestrictionRelations( diff --git a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php index f9037c9453a..d677068f647 100644 --- a/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php +++ b/Neos.ContentGraph.PostgreSQLAdapter/src/Domain/Projection/HypergraphProjection.php @@ -19,7 +19,7 @@ use Doctrine\DBAL\Schema\Comparator; use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Feature\ContentStreamForking; use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Feature\NodeCreation; -use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Feature\NodeDisabling; +use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Feature\Tagging; use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Feature\NodeModification; use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Feature\NodeReferencing; use Neos\ContentGraph\PostgreSQLAdapter\Domain\Projection\Feature\NodeRemoval; @@ -33,8 +33,6 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\ContentStreamForking\Event\ContentStreamWasForked; use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasDisabled; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasEnabled; use Neos\ContentRepository\Core\Feature\NodeModification\Event\NodePropertiesWereSet; use Neos\ContentRepository\Core\Feature\NodeReferencing\Event\NodeReferencesWereSet; use Neos\ContentRepository\Core\Feature\NodeRemoval\Event\NodeAggregateWasRemoved; @@ -44,6 +42,8 @@ use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodePeerVariantWasCreated; use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodeSpecializationVariantWasCreated; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateWithNodeWasCreated; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasAdded; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasRemoved; use Neos\ContentRepository\Core\NodeType\NodeTypeManager; use Neos\ContentRepository\Core\Projection\ProjectionInterface; use Neos\EventStore\CatchUp\CheckpointStorageInterface; @@ -62,7 +62,7 @@ final class HypergraphProjection implements ProjectionInterface { use ContentStreamForking; use NodeCreation; - use NodeDisabling; + use Tagging; use NodeModification; use NodeReferencing; use NodeRemoval; @@ -156,9 +156,9 @@ public function canHandle(EventInterface $event): bool // NodeCreation RootNodeAggregateWithNodeWasCreated::class, NodeAggregateWithNodeWasCreated::class, - // NodeDisabling - NodeAggregateWasDisabled::class, - NodeAggregateWasEnabled::class, + // Tagging + SubtreeTagWasAdded::class, + SubtreeTagWasRemoved::class, // NodeModification NodePropertiesWereSet::class, // NodeReferencing @@ -189,9 +189,9 @@ public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void // NodeCreation RootNodeAggregateWithNodeWasCreated::class => $this->whenRootNodeAggregateWithNodeWasCreated($event), NodeAggregateWithNodeWasCreated::class => $this->whenNodeAggregateWithNodeWasCreated($event), - // NodeDisabling - NodeAggregateWasDisabled::class => $this->whenNodeAggregateWasDisabled($event), - NodeAggregateWasEnabled::class => $this->whenNodeAggregateWasEnabled($event), + // Tagging + SubtreeTagWasAdded::class => $this->whenSubtreeTagWasAdded($event), + SubtreeTagWasRemoved::class => $this->whenSubtreeTagWasRemoved($event), // NodeModification NodePropertiesWereSet::class => $this->whenNodePropertiesWereSet($event), // NodeReferencing diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/01-DisableNodeAggregate_ConstraintChecks.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/01-DisableNodeAggregate_ConstraintChecks.feature index c1362e74535..69f51ef5b41 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/01-DisableNodeAggregate_ConstraintChecks.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/01-DisableNodeAggregate_ConstraintChecks.feature @@ -34,54 +34,61 @@ Feature: Constraint checks on node aggregate disabling | sir-david-nodenborough | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | document | Scenario: Try to disable a node aggregate in a non-existing content stream - When the command DisableNodeAggregate is executed with payload and exceptions are caught: + When the command AddSubtreeTag is executed with payload and exceptions are caught: | Key | Value | | contentStreamId | "i-do-not-exist" | | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | Then the last command should have thrown an exception of type "ContentStreamDoesNotExistYet" Scenario: Try to disable a non-existing node aggregate - When the command DisableNodeAggregate is executed with payload and exceptions are caught: + When the command AddSubtreeTag is executed with payload and exceptions are caught: | Key | Value | | nodeAggregateId | "i-do-not-exist" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | Then the last command should have thrown an exception of type "NodeAggregateCurrentlyDoesNotExist" Scenario: Try to disable an already disabled node aggregate - Given the command DisableNodeAggregate is executed with payload: + Given the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {"language": "de"} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date # Note: The behavior has been changed with https://github.com/neos/neos-development-collection/pull/4284 and the test was adjusted accordingly - When the command DisableNodeAggregate is executed with payload: + When the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {"language": "de"} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | Then I expect exactly 4 events to be published on stream with prefix "ContentStream:cs-identifier" - And event at index 3 is of type "NodeAggregateWasDisabled" with payload: + And event at index 3 is of type "SubtreeTagWasAdded" with payload: | Key | Expected | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{"language":"de"},{"language":"gsw"}] | + | tag | "disabled" | Scenario: Try to disable a node aggregate in a non-existing dimension space point - When the command DisableNodeAggregate is executed with payload and exceptions are caught: + When the command AddSubtreeTag is executed with payload and exceptions are caught: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {"undeclared": "undefined"} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | Then the last command should have thrown an exception of type "DimensionSpacePointNotFound" Scenario: Try to disable a node aggregate in a dimension space point it does not cover - When the command DisableNodeAggregate is executed with payload and exceptions are caught: + When the command AddSubtreeTag is executed with payload and exceptions are caught: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {"language": "en"} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | Then the last command should have thrown an exception of type "NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint" diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/02-DisableNodeAggregate_WithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/02-DisableNodeAggregate_WithoutDimensions.feature index 9f8d73c1cf0..7a33d011828 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/02-DisableNodeAggregate_WithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/02-DisableNodeAggregate_WithoutDimensions.feature @@ -44,17 +44,19 @@ Feature: Disable a node aggregate And the graph projection is fully up to date Scenario: Disable node with arbitrary strategy since dimensions are not involved - When the command DisableNodeAggregate is executed with payload: + When the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | Then I expect exactly 8 events to be published on stream with prefix "ContentStream:cs-identifier" - And event at index 7 is of type "NodeAggregateWasDisabled" with payload: + And event at index 7 is of type "SubtreeTagWasAdded" with payload: | Key | Expected | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [[]] | + | tag | "disabled" | When the graph projection is fully up to date And I am in content stream "cs-identifier" diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/03-DisableNodeAggregate_WithDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/03-DisableNodeAggregate_WithDimensions.feature index 9ab8ece1340..d1ba4ef89d5 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/03-DisableNodeAggregate_WithDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/03-DisableNodeAggregate_WithDimensions.feature @@ -54,17 +54,19 @@ Feature: Disable a node aggregate And I am in dimension space point {"language":"de"} Scenario: Disable node aggregate with strategy allSpecializations - When the command DisableNodeAggregate is executed with payload: + When the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | Then I expect exactly 9 events to be published on stream with prefix "ContentStream:cs-identifier" - And event at index 8 is of type "NodeAggregateWasDisabled" with payload: + And event at index 8 is of type "SubtreeTagWasAdded" with payload: | Key | Expected | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{"language":"de"}, {"language":"ltz"}, {"language":"gsw"}] | + | tag | "disabled" | When the graph projection is fully up to date And I am in content stream "cs-identifier" @@ -305,17 +307,19 @@ Feature: Disable a node aggregate And I expect this node to be a child of node cs-identifier;sir-david-nodenborough;{"language":"mul"} Scenario: Disable node aggregate with strategy allVariants - When the command DisableNodeAggregate is executed with payload: + When the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | Then I expect exactly 9 events to be published on stream with prefix "ContentStream:cs-identifier" - And event at index 8 is of type "NodeAggregateWasDisabled" with payload: + And event at index 8 is of type "SubtreeTagWasAdded" with payload: | Key | Expected | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{"language":"ltz"}, {"language":"mul"}, {"language":"de"}, {"language":"en"}, {"language":"gsw"}] | + | tag | "disabled" | When the graph projection is fully up to date And I am in content stream "cs-identifier" diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/04-EnableNodeAggregate_ConstraintChecks.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/04-EnableNodeAggregate_ConstraintChecks.feature index 124c1de977b..224c684bb63 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/04-EnableNodeAggregate_ConstraintChecks.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/04-EnableNodeAggregate_ConstraintChecks.feature @@ -34,40 +34,45 @@ Feature: Enable a node aggregate | sir-david-nodenborough | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | document | Scenario: Try to enable a node aggregate in a non-existing content stream - When the command EnableNodeAggregate is executed with payload and exceptions are caught: + When the command RemoveSubtreeTag is executed with payload and exceptions are caught: | Key | Value | | contentStreamId | "i-do-not-exist" | | nodeAggregateId | "sir-david-nodenborough" | + | tag | "disabled" | | nodeVariantSelectionStrategy | "allVariants" | Then the last command should have thrown an exception of type "ContentStreamDoesNotExistYet" Scenario: Try to enable a non-existing node aggregate - When the command EnableNodeAggregate is executed with payload and exceptions are caught: + When the command RemoveSubtreeTag is executed with payload and exceptions are caught: | Key | Value | | nodeAggregateId | "i-do-not-exist" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | Then the last command should have thrown an exception of type "NodeAggregateCurrentlyDoesNotExist" # Note: The behavior has been changed with https://github.com/neos/neos-development-collection/pull/4284 and the test was adjusted accordingly Scenario: Try to enable an already enabled node aggregate - When the command EnableNodeAggregate is executed with payload: + When the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | Then I expect exactly 3 events to be published on stream with prefix "ContentStream:cs-identifier" Scenario: Try to enable a node aggregate in a non-existing dimension space point - When the command EnableNodeAggregate is executed with payload and exceptions are caught: + When the command RemoveSubtreeTag is executed with payload and exceptions are caught: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {"undeclared": "undefined"} | + | tag | "disabled" | | nodeVariantSelectionStrategy | "allVariants" | Then the last command should have thrown an exception of type "DimensionSpacePointNotFound" Scenario: Try to disable a node aggregate in a dimension space point it does not cover - When the command EnableNodeAggregate is executed with payload and exceptions are caught: + When the command RemoveSubtreeTag is executed with payload and exceptions are caught: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {"language": "en"} | + | tag | "disabled" | | nodeVariantSelectionStrategy | "allVariants" | Then the last command should have thrown an exception of type "NodeAggregateDoesCurrentlyNotCoverDimensionSpacePoint" diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/05-EnableNodeAggregate_WithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/05-EnableNodeAggregate_WithoutDimensions.feature index 1a53bc1d35b..219b5732bed 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/05-EnableNodeAggregate_WithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/05-EnableNodeAggregate_WithoutDimensions.feature @@ -44,23 +44,26 @@ Feature: Enable a node aggregate And the graph projection is fully up to date Scenario: Enable a previously disabled node with arbitrary strategy since dimensions are not involved - Given the command DisableNodeAggregate is executed with payload: + Given the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date - When the command EnableNodeAggregate is executed with payload: + When the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | Then I expect exactly 9 events to be published on stream with prefix "ContentStream:cs-identifier" - And event at index 8 is of type "NodeAggregateWasEnabled" with payload: + And event at index 8 is of type "SubtreeTagWasRemoved" with payload: | Key | Expected | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [[]] | + | tag | "disabled" | When the graph projection is fully up to date And I am in content stream "cs-identifier" @@ -121,27 +124,31 @@ Feature: Enable a node aggregate And I expect this node to be a child of node cs-identifier;sir-david-nodenborough;{} Scenario: Enable a previously disabled node with explicitly disabled child nodes with arbitrary strategy since dimensions are not involved - Given the command DisableNodeAggregate is executed with payload: + Given the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "nody-mc-nodeface" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date - When the command EnableNodeAggregate is executed with payload: + When the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | Then I expect exactly 10 events to be published on stream with prefix "ContentStream:cs-identifier" - And event at index 9 is of type "NodeAggregateWasEnabled" with payload: + And event at index 9 is of type "SubtreeTagWasRemoved" with payload: | Key | Expected | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [[]] | + | tag | "disabled" | When the graph projection is fully up to date And I am in content stream "cs-identifier" @@ -198,27 +205,31 @@ Feature: Enable a node aggregate And I expect node aggregate identifier "nody-mc-nodeface" and node path "document/child-document" to lead to no node Scenario: Enable a previously disabled node with explicitly disabled parent node with arbitrary strategy since dimensions are not involved - Given the command DisableNodeAggregate is executed with payload: + Given the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "nody-mc-nodeface" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date - When the command EnableNodeAggregate is executed with payload: + When the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "nody-mc-nodeface" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | Then I expect exactly 10 events to be published on stream with prefix "ContentStream:cs-identifier" - And event at index 9 is of type "NodeAggregateWasEnabled" with payload: + And event at index 9 is of type "SubtreeTagWasRemoved" with payload: | Key | Expected | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | affectedDimensionSpacePoints | [[]] | + | tag | "disabled" | When the graph projection is fully up to date And I am in content stream "cs-identifier" diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/06-EnableNodeAggregate_WithDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/06-EnableNodeAggregate_WithDimensions.feature index eef0ffed0ed..e756ad5b8f2 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/06-EnableNodeAggregate_WithDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/06-EnableNodeAggregate_WithDimensions.feature @@ -52,33 +52,37 @@ Feature: Enable a node aggregate | targetOrigin | {"language":"ltz"} | And the graph projection is fully up to date # Disable our reference node aggregate in all variants - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date # Explicitly disable a child node aggregate in all variants - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date # Set the DSP to the "central" variant having variants of all kind And I am in dimension space point {"language":"de"} Scenario: Enable node aggregate with strategy allSpecializations When I am in dimension space point {"language":"de"} - And the command EnableNodeAggregate is executed with payload: + And the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | Then I expect exactly 12 events to be published on stream with prefix "ContentStream:cs-identifier" - And event at index 11 is of type "NodeAggregateWasEnabled" with payload: + And event at index 11 is of type "SubtreeTagWasRemoved" with payload: | Key | Expected | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{"language":"de"},{"language":"ltz"},{"language":"gsw"}] | + | tag | "disabled" | When the graph projection is fully up to date And I am in content stream "cs-identifier" @@ -363,17 +367,19 @@ Feature: Enable a node aggregate Scenario: Enable node aggregate with strategy allVariants When I am in dimension space point {"language":"de"} - And the command EnableNodeAggregate is executed with payload: + And the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | Then I expect exactly 12 events to be published on stream with prefix "ContentStream:cs-identifier" - And event at index 11 is of type "NodeAggregateWasEnabled" with payload: + And event at index 11 is of type "SubtreeTagWasRemoved" with payload: | Key | Expected | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{"language":"mul"},{"language":"de"},{"language":"en"},{"language":"gsw"},{"language":"ltz"}] | + | tag | "disabled" | When the graph projection is fully up to date And I am in content stream "cs-identifier" @@ -698,10 +704,11 @@ Feature: Enable a node aggregate Scenario: Enable node aggregate with hidden ancestors When I am in dimension space point {"language":"de"} - And the command EnableNodeAggregate is executed with payload: + And the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | When the graph projection is fully up to date And I am in content stream "cs-identifier" diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/07-CreateNodeAggregateWithNodeWithDisabledAncestor_WithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/07-CreateNodeAggregateWithNodeWithDisabledAncestor_WithoutDimensions.feature index 5a897f510bc..6dad8671b04 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/07-CreateNodeAggregateWithNodeWithDisabledAncestor_WithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/07-CreateNodeAggregateWithNodeWithDisabledAncestor_WithoutDimensions.feature @@ -31,10 +31,11 @@ Feature: Creation of nodes underneath disabled nodes And the following CreateNodeAggregateWithNode commands are executed: | nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName | | the-great-nodini | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | document | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: When a new node is created underneath a hidden node, this one should be hidden as well @@ -45,10 +46,11 @@ Feature: Creation of nodes underneath disabled nodes And I expect this node aggregate to disable dimension space points [] And I expect node aggregate identifier "nodingers-cat" and node path "document/pet-document" to lead to no node - When the command EnableNodeAggregate is executed with payload: + When the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Then I expect node aggregate identifier "nodingers-cat" and node path "document/pet-document" to lead to node cs-identifier;nodingers-cat;{} And I expect this node to be a child of node cs-identifier;the-great-nodini;{} diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/08-CreateNodeAggregateWithNodeWithDisabledAncestor_WithDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/08-CreateNodeAggregateWithNodeWithDisabledAncestor_WithDimensions.feature index 2db08431ae7..33949027f22 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/08-CreateNodeAggregateWithNodeWithDisabledAncestor_WithDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/08-CreateNodeAggregateWithNodeWithDisabledAncestor_WithDimensions.feature @@ -43,11 +43,12 @@ Feature: Creation of nodes underneath disabled nodes And VisibilityConstraints are set to "frontend" Scenario: Create a new node with parent disabled with strategy allSpecializations - Given the command DisableNodeAggregate is executed with payload: + Given the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"de"} | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | When the following CreateNodeAggregateWithNode commands are executed: | nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName | | nodingers-cat | Neos.ContentRepository.Testing:Document | the-great-nodini | pet-document | @@ -72,11 +73,12 @@ Feature: Creation of nodes underneath disabled nodes And I expect node aggregate identifier "nodingers-cat" and node path "document/pet-document" to lead to node cs-identifier;nodingers-cat;{"language":"mul"} And I expect this node to be a child of node cs-identifier;the-great-nodini;{"language":"mul"} - And the command EnableNodeAggregate is executed with payload: + And the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"de"} | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | And the graph projection is fully up to date When I am in dimension space point {"language":"de"} @@ -92,11 +94,12 @@ Feature: Creation of nodes underneath disabled nodes And I expect this node to be a child of node cs-identifier;the-great-nodini;{"language":"ltz"} Scenario: Create a new node with parent disabled with strategy allVariants - Given the command DisableNodeAggregate is executed with payload: + Given the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"de"} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | When the following CreateNodeAggregateWithNode commands are executed: | nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName | | nodingers-cat | Neos.ContentRepository.Testing:Document | the-great-nodini | pet-document | @@ -119,11 +122,12 @@ Feature: Creation of nodes underneath disabled nodes When I am in dimension space point {"language":"en"} And I expect node aggregate identifier "nodingers-cat" and node path "document/pet-document" to lead to no node - And the command EnableNodeAggregate is executed with payload: + And the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"de"} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date When I am in dimension space point {"language":"mul"} diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/09-CreateNodeVariantOfDisabledNode.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/09-CreateNodeVariantOfDisabledNode.feature index e419bb7d363..eb45e7ba7c0 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/09-CreateNodeVariantOfDisabledNode.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/06-NodeDisabling/09-CreateNodeVariantOfDisabledNode.feature @@ -35,17 +35,19 @@ Feature: Variation of hidden nodes And the following CreateNodeAggregateWithNode commands are executed: | nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName | | the-great-nodini | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | court-magician | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"de"} | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | And the graph projection is fully up to date - And the command EnableNodeAggregate is executed with payload: + And the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"gsw"} | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | And the graph projection is fully up to date When the command CreateNodeVariant is executed with payload: @@ -65,11 +67,12 @@ Feature: Variation of hidden nodes And the following CreateNodeAggregateWithNode commands are executed: | nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName | | the-great-nodini | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | court-magician | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"de"} | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | And the graph projection is fully up to date When the command CreateNodeVariant is executed with payload: @@ -85,11 +88,12 @@ Feature: Variation of hidden nodes When I am in dimension space point {"language":"gsw"} Then I expect node aggregate identifier "the-great-nodini" and node path "court-magician" to lead to no node - When the command EnableNodeAggregate is executed with payload: + When the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"gsw"} | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | And the graph projection is fully up to date When I am in dimension space point {"language":"gsw"} @@ -100,11 +104,12 @@ Feature: Variation of hidden nodes And the following CreateNodeAggregateWithNode commands are executed: | nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName | | the-great-nodini | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | court-magician | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"de"} | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | And the graph projection is fully up to date When the command CreateNodeVariant is executed with payload: @@ -132,11 +137,12 @@ Feature: Variation of hidden nodes | sourceOrigin | {"language":"ltz"} | | targetOrigin | {"language":"mul"} | And the graph projection is fully up to date - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"mul"} | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | And the graph projection is fully up to date When the command CreateNodeVariant is executed with payload: @@ -152,11 +158,12 @@ Feature: Variation of hidden nodes When I am in dimension space point {"language":"de"} Then I expect node aggregate identifier "the-great-nodini" and node path "court-magician" to lead to no node - When the command EnableNodeAggregate is executed with payload: + When the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"de"} | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | And the graph projection is fully up to date When I am in dimension space point {"language":"de"} @@ -167,11 +174,12 @@ Feature: Variation of hidden nodes And the following CreateNodeAggregateWithNode commands are executed: | nodeAggregateId | nodeTypeName | parentNodeAggregateId | nodeName | | the-great-nodini | Neos.ContentRepository.Testing:Document | lady-eleonode-rootford | court-magician | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"de"} | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | And the graph projection is fully up to date When the command CreateNodeVariant is executed with payload: @@ -198,11 +206,12 @@ Feature: Variation of hidden nodes | sourceOrigin | {"language":"de"} | | targetOrigin | {"language":"mul"} | And the graph projection is fully up to date - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"mul"} | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | And the graph projection is fully up to date When the command CreateNodeVariant is executed with payload: @@ -218,11 +227,12 @@ Feature: Variation of hidden nodes When I am in dimension space point {"language":"en"} Then I expect node aggregate identifier "the-great-nodini" and node path "court-magician" to lead to no node - When the command EnableNodeAggregate is executed with payload: + When the command RemoveSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {"language":"en"} | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | And the graph projection is fully up to date When I am in dimension space point {"language":"en"} diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/02-RemoveNodeAggregate_WithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/02-RemoveNodeAggregate_WithoutDimensions.feature index 093aa669a7a..8c01bd40467 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/02-RemoveNodeAggregate_WithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/02-RemoveNodeAggregate_WithoutDimensions.feature @@ -73,10 +73,11 @@ Feature: Remove NodeAggregate And I expect node aggregate identifier "nodingers-kitten" and node path "pet/kitten" to lead to no node Scenario: Disable a node aggregate, remove it, recreate it and expect it to be enabled - When the command DisableNodeAggregate is executed with payload: + When the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "nodingers-cat" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date And the command RemoveNodeAggregate is executed with payload: | Key | Value | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/03-RemoveNodeAggregate_WithDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/03-RemoveNodeAggregate_WithDimensions.feature index 1186753cc69..92facdf754b 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/03-RemoveNodeAggregate_WithDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/07-NodeRemoval/03-RemoveNodeAggregate_WithDimensions.feature @@ -292,10 +292,11 @@ Feature: Remove NodeAggregate And I expect node aggregate identifier "nodingers-kitten" and node path "pet/kitten" to lead to no node Scenario: Disable a node aggregate, completely remove it, recreate it and expect it to be enabled but have no references - When the command DisableNodeAggregate is executed with payload: + When the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "nodingers-cat" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date And the command RemoveNodeAggregate is executed with payload: | Key | Value | @@ -347,10 +348,11 @@ Feature: Remove NodeAggregate And I expect this node to not be referenced Scenario: Disable a node aggregate, partially remove it, recreate it and expect the recreated nodes to be enabled and have their source's references - When the command DisableNodeAggregate is executed with payload: + When the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "nodingers-cat" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date And the command RemoveNodeAggregate is executed with payload: | Key | Value | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithDisabledNodesWithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithDisabledNodesWithoutDimensions.feature index 568fa934935..c9906638af1 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithDisabledNodesWithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithDisabledNodesWithoutDimensions.feature @@ -49,12 +49,13 @@ Feature: On forking a content stream, hidden nodes should be correctly copied as | nodeName | "pet" | | nodeAggregateClassification | "regular" | And the graph projection is fully up to date - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "the-great-nodini" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: on ForkContentStream, the disabled nodes in the target content stream should still be invisible. diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddDimensionShineThrough.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddDimensionShineThrough.feature index 2c1b41dcd60..871d9d618fe 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddDimensionShineThrough.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddDimensionShineThrough.feature @@ -136,12 +136,13 @@ Feature: Add Dimension Specialization Scenario: Success Case - disabled nodes stay disabled - When the command DisableNodeAggregate is executed with payload: + When the command AddSubtreeTag is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {"language": "de"} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date # ensure the node is disabled diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/MoveDimensionSpacePoint.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/MoveDimensionSpacePoint.feature index 73512873b28..efc00c25729 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/MoveDimensionSpacePoint.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/MoveDimensionSpacePoint.feature @@ -89,12 +89,13 @@ Feature: Move dimension space point Scenario: Success Case - disabled nodes stay disabled - When the command DisableNodeAggregate is executed with payload: + When the command AddSubtreeTag is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {"language": "de"} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date # ensure the node is disabled diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregateConsideringDisableStateWithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregateConsideringDisableStateWithoutDimensions.feature index aa8c3df065b..f3faf26a003 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregateConsideringDisableStateWithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeMove/MoveNodeAggregateConsideringDisableStateWithoutDimensions.feature @@ -77,11 +77,12 @@ Feature: Move a node aggregate considering disable state but without content dim And the graph projection is fully up to date Scenario: Move a node disabled by one of its ancestors to a new parent that is enabled - Given the event NodeAggregateWasDisabled was published with payload: + Given the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{}] | + | tag | "disabled" | And the graph projection is fully up to date When the command MoveNodeAggregate is executed with payload: @@ -101,11 +102,12 @@ Feature: Move a node aggregate considering disable state but without content dim And I expect this node to be a child of node cs-identifier;sir-nodeward-nodington-iii;{} Scenario: Move a node disabled by itself to a new parent that is enabled - Given the event NodeAggregateWasDisabled was published with payload: + Given the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | affectedDimensionSpacePoints | [{}] | + | tag | "disabled" | And the graph projection is fully up to date When the command MoveNodeAggregate is executed with payload: @@ -122,11 +124,12 @@ Feature: Move a node aggregate considering disable state but without content dim Then I expect node aggregate identifier "nody-mc-nodeface" and node path "esquire/child-document" to lead to no node Scenario: Move a node that disables one of its descendants to a new parent that is enabled - Given the event NodeAggregateWasDisabled was published with payload: + Given the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{}] | + | tag | "disabled" | And the graph projection is fully up to date When the command MoveNodeAggregate is executed with payload: @@ -144,16 +147,18 @@ Feature: Move a node aggregate considering disable state but without content dim Then I expect node aggregate identifier "nody-mc-nodeface" and node path "esquire/document/child-document" to lead to no node Scenario: Move a node that is disabled by one of its ancestors to a new parent that disables itself - Given the event NodeAggregateWasDisabled was published with payload: + Given the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{}] | - And the event NodeAggregateWasDisabled was published with payload: + | tag | "disabled" | + And the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | affectedDimensionSpacePoints | [{}] | + | tag | "disabled" | And the graph projection is fully up to date When the command MoveNodeAggregate is executed with payload: @@ -170,16 +175,18 @@ Feature: Move a node aggregate considering disable state but without content dim Then I expect node aggregate identifier "nody-mc-nodeface" and node path "esquire/child-document" to lead to no node Scenario: Move a node that is disabled by itself to a new parent that disables itself - Given the event NodeAggregateWasDisabled was published with payload: + Given the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{}] | - And the event NodeAggregateWasDisabled was published with payload: + | tag | "disabled" | + And the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | affectedDimensionSpacePoints | [{}] | + | tag | "disabled" | When the command MoveNodeAggregate is executed with payload: | Key | Value | @@ -195,11 +202,12 @@ Feature: Move a node aggregate considering disable state but without content dim Then I expect node aggregate identifier "sir-david-nodenborough" and node path "esquire/document" to lead to no node Scenario: Move a node that is enabled to a new parent that disables itself - Given the event NodeAggregateWasDisabled was published with payload: + Given the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | affectedDimensionSpacePoints | [{}] | + | tag | "disabled" | When the command MoveNodeAggregate is executed with payload: | Key | Value | @@ -215,16 +223,18 @@ Feature: Move a node aggregate considering disable state but without content dim Then I expect node aggregate identifier "sir-david-nodenborough" and node path "esquire/document" to lead to no node Scenario: Move a node that disables any of its descendants to a new parent that disables itself - Given the event NodeAggregateWasDisabled was published with payload: + Given the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{}] | - And the event NodeAggregateWasDisabled was published with payload: + | tag | "disabled" | + And the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | affectedDimensionSpacePoints | [{}] | + | tag | "disabled" | When the command MoveNodeAggregate is executed with payload: | Key | Value | @@ -241,16 +251,18 @@ Feature: Move a node aggregate considering disable state but without content dim Then I expect node aggregate identifier "nody-mc-nodeface" and node path "esquire/document/child-document" to lead to no node Scenario: Move a node that is disabled by one of its ancestors to a new parent that is disabled by one of its ancestors - Given the event NodeAggregateWasDisabled was published with payload: + Given the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{}] | - And the event NodeAggregateWasDisabled was published with payload: + | tag | "disabled" | + And the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | affectedDimensionSpacePoints | [{}] | + | tag | "disabled" | When the command MoveNodeAggregate is executed with payload: | Key | Value | @@ -266,16 +278,18 @@ Feature: Move a node aggregate considering disable state but without content dim Then I expect node aggregate identifier "nody-mc-nodeface" and node path "esquire/esquire-child/child-document" to lead to no node Scenario: Move a node that is disabled by itself to a new parent that is disabled by one of its ancestors - Given the event NodeAggregateWasDisabled was published with payload: + Given the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{}] | - And the event NodeAggregateWasDisabled was published with payload: + | tag | "disabled" | + And the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | affectedDimensionSpacePoints | [{}] | + | tag | "disabled" | When the command MoveNodeAggregate is executed with payload: | Key | Value | @@ -291,16 +305,18 @@ Feature: Move a node aggregate considering disable state but without content dim Then I expect node aggregate identifier "sir-david-nodenborough" and node path "esquire/esquire-child/document" to lead to no node Scenario: Move a node that disables any of its descendants to a new parent that is disabled by one of its ancestors - Given the event NodeAggregateWasDisabled was published with payload: + Given the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{}] | - And the event NodeAggregateWasDisabled was published with payload: + | tag | "disabled" | + And the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | affectedDimensionSpacePoints | [{}] | + | tag | "disabled" | When the command MoveNodeAggregate is executed with payload: | Key | Value | @@ -317,11 +333,12 @@ Feature: Move a node aggregate considering disable state but without content dim Then I expect node aggregate identifier "nody-mc-nodeface" and node path "esquire/esquire-child/document/child-document" to lead to no node Scenario: Move a node that is enabled to a new parent that is disabled by one of its ancestors - Given the event NodeAggregateWasDisabled was published with payload: + Given the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | affectedDimensionSpacePoints | [{}] | + | tag | "disabled" | When the command MoveNodeAggregate is executed with payload: | Key | Value | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodePublishing/AllCommandsAreImplemented.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodePublishing/AllCommandsAreImplemented.feature index 6cab17a2920..a1eee2bb807 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodePublishing/AllCommandsAreImplemented.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodePublishing/AllCommandsAreImplemented.feature @@ -85,18 +85,20 @@ Feature: Publishing hide/show scenario of nodes And the graph projection is fully up to date # SETUP: hide two nodes in USER workspace - Given the command DisableNodeAggregate is executed with payload: + Given the command AddSubtreeTag is executed with payload: | Key | Value | | contentStreamId | "user-cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | - And the command DisableNodeAggregate is executed with payload: + | tag | "disabled" | + And the command AddSubtreeTag is executed with payload: | Key | Value | | contentStreamId | "user-cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date When the command PublishIndividualNodesFromWorkspace is executed with payload: @@ -117,18 +119,20 @@ Feature: Publishing hide/show scenario of nodes Scenario: (ShowNode) It is possible to publish showing of a node. # BEFORE: ensure two nodes are hidden in live (and user WS) - Given the command DisableNodeAggregate is executed with payload: + Given the command AddSubtreeTag is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | - Given the command DisableNodeAggregate is executed with payload: + | tag | "disabled" | + Given the command AddSubtreeTag is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | # we need to ensure that the projections are up to date now; otherwise a content stream is forked with an out- # of-date base version. This means the content stream can never be merged back, but must always be rebased. And the graph projection is fully up to date @@ -140,18 +144,20 @@ Feature: Publishing hide/show scenario of nodes And the graph projection is fully up to date # SETUP: show two nodes in USER workspace - Given the command EnableNodeAggregate is executed with payload: + Given the command RemoveSubtreeTag is executed with payload: | Key | Value | | contentStreamId | "user-cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | - Given the command EnableNodeAggregate is executed with payload: + | tag | "disabled" | + Given the command RemoveSubtreeTag is executed with payload: | Key | Value | | contentStreamId | "user-cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date When the command PublishIndividualNodesFromWorkspace is executed with payload: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateAfterDisabling.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateAfterDisabling.feature index 16d55fe52d5..5afdf5bd4b2 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateAfterDisabling.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateAfterDisabling.feature @@ -44,10 +44,11 @@ Feature: Disable a node aggregate And the graph projection is fully up to date Scenario: Restore a hidden node by removing and recreating it - Given the command DisableNodeAggregate is executed with payload: + Given the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "nody-mc-nodeface" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the event NodeAggregateWasRemoved was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/AncestorNodes.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/AncestorNodes.feature index d3ad4c3eda5..9a888eb2049 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/AncestorNodes.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/AncestorNodes.feature @@ -71,15 +71,17 @@ Feature: Find and count nodes using the findAncestorNodes and countAncestorNodes | a2b | a2b | Neos.ContentRepository.Testing:Page | a2 | {} | {} | | a2b1 | a2b1 | Neos.ContentRepository.Testing:Page | a2b | {} | {} | | b | b | Neos.ContentRepository.Testing:Page | home | {} | {} | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2a2a" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2b" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/ChildNodes.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/ChildNodes.feature index 9424f93a7dd..c601ce8fcbf 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/ChildNodes.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/ChildNodes.feature @@ -91,10 +91,11 @@ Feature: Find and count nodes using the findChildNodes and countChildNodes queri | contentStreamId | "cs-identifier" | | nodeAggregateId | "a2a5" | | propertyValues | {"integerProperty": 20} | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2a3" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/ClosestNode.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/ClosestNode.feature index 58743520d52..8c4e2606330 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/ClosestNode.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/ClosestNode.feature @@ -71,15 +71,17 @@ Feature: Find nodes using the findClosestNode query | a2b | a2b | Neos.ContentRepository.Testing:Page | a2 | {} | {} | | a2b1 | a2b1 | Neos.ContentRepository.Testing:Page | a2b | {} | {} | | b | b | Neos.ContentRepository.Testing:Page | home | {} | {} | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2a2a" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2b" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/CountNodes.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/CountNodes.feature index 9bf7a88015f..b22925f87bd 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/CountNodes.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/CountNodes.feature @@ -76,10 +76,11 @@ Feature: Find nodes using the countNodes query When I execute the countNodes query I expect the result to be 12 # count all nodes with disabled nodes - When the command DisableNodeAggregate is executed with payload: + When the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2a1" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date # NOTE: countNodes() counts _all_ nodes, even disabled ones And I execute the countNodes query I expect the result to be 12 diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/DescendantNodes.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/DescendantNodes.feature index f6777b70dbe..38555dcd3d0 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/DescendantNodes.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/DescendantNodes.feature @@ -91,10 +91,11 @@ Feature: Find and count nodes using the findDescendantNodes and countDescendantN | contentStreamId | "cs-identifier" | | nodeAggregateId | "a2a2b" | | propertyValues | {"integerProperty": 20} | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2a2a" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindChildNodeConnectedThroughEdgeName.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindChildNodeConnectedThroughEdgeName.feature index 67898ef2130..f0b196ef8fa 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindChildNodeConnectedThroughEdgeName.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindChildNodeConnectedThroughEdgeName.feature @@ -81,10 +81,11 @@ Feature: Find nodes using the findChildNodeConnectedThroughEdgeName query | a2a2a | a2a2a | Neos.ContentRepository.Testing:Page | a2a2 | {"text": "a2a2a"} | {} | | b | b | Neos.ContentRepository.Testing:Page | home | {"text": "b"} | {} | | b1 | b1 | Neos.ContentRepository.Testing:Page | b | {"text": "b1"} | {} | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2a2" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindNodeById.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindNodeById.feature index 86070abf48c..c63e6593ce8 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindNodeById.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindNodeById.feature @@ -80,10 +80,11 @@ Feature: Find nodes using the findNodeById query | a2a2 | a2a2 | Neos.ContentRepository.Testing:Page | a2a | {"text": "a2a2"} | {} | | b | b | Neos.ContentRepository.Testing:Page | home | {"text": "b"} | {} | | b1 | b1 | Neos.ContentRepository.Testing:Page | b | {"text": "b1"} | {} | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2a1" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindNodeByPath.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindNodeByPath.feature index 22ca151cffa..09bae47d089 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindNodeByPath.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindNodeByPath.feature @@ -84,10 +84,11 @@ Feature: Find nodes using the findNodeByPath query | a2a2a | a2a2a | Neos.ContentRepository.Testing:Page | a2a2 | {"text": "a2a2a"} | {} | | b | b | Neos.ContentRepository.Testing:Page | home | {"text": "b"} | {} | | b1 | b1 | Neos.ContentRepository.Testing:Page | b | {"text": "b1"} | {} | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2a2" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindParentNode.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindParentNode.feature index bcae519c37d..4614f341037 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindParentNode.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindParentNode.feature @@ -80,10 +80,11 @@ Feature: Find nodes using the findParentNodes query | a2a2 | a2a2 | Neos.ContentRepository.Testing:Page | a2a | {"text": "a2a2"} | {} | | b | b | Neos.ContentRepository.Testing:Page | home | {"text": "b"} | {} | | b1 | b1 | Neos.ContentRepository.Testing:Page | b | {"text": "b1"} | {} | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2a" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindSubtree.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindSubtree.feature index 89239ef7bb4..644893260bb 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindSubtree.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/FindSubtree.feature @@ -72,10 +72,11 @@ Feature: Find nodes using the findSubtree query | a3 | a3 | Neos.ContentRepository.Testing:Page | a | {"text": "a3"} | {} | | b | b | Neos.ContentRepository.Testing:Page | home | {"text": "b"} | {} | | b1 | b1 | Neos.ContentRepository.Testing:Page | b | {"text": "b1"} | {} | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2a2a" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/References.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/References.feature index a3a6bd5f958..0422573f094 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/References.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/References.feature @@ -138,10 +138,11 @@ Feature: Find and count references and their target nodes using the findReferenc | sourceNodeAggregateId | "c" | | referenceName | "ref" | | references | [{"target":"b"}] | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2a3" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/RetrieveNodePath.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/RetrieveNodePath.feature index 8fd2e37cf40..96188f4eb1f 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/RetrieveNodePath.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/RetrieveNodePath.feature @@ -81,10 +81,11 @@ Feature: Find nodes using the retrieveNodePath query | unnamed | Neos.ContentRepository.Testing:Homepage | lady-eleonode-rootford | And the following CreateNodeAggregateWithNode commands are executed: | child-of-unnamed | child | Neos.ContentRepository.Testing:Page | unnamed | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "b1" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/SiblingNodes.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/SiblingNodes.feature index 1f37538870b..9310d7eae27 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/SiblingNodes.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/SiblingNodes.feature @@ -85,10 +85,11 @@ Feature: Find sibling nodes using the findPrecedingSiblingNodes and findSucceedi | a6 | a6 | Neos.ContentRepository.Testing:Page | a | {"text": "a6"} | {} | | b | b | Neos.ContentRepository.Testing:Page | home | {"text": "b"} | {} | | b1 | b1 | Neos.ContentRepository.Testing:Page | b | {"text": "b1"} | {} | - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | nodeAggregateId | "a2a2" | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date Scenario: diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/Timestamps.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/Timestamps.feature index ddb1b31533e..03a8a77c4c6 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/Timestamps.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeTraversal/Timestamps.feature @@ -249,14 +249,15 @@ Feature: Behavior of Node timestamp properties "created", "originalCreated", "la | created | originalCreated | lastModified | originalLastModified | | 2023-03-16 12:30:00 | 2023-03-16 12:30:00 | | | - Scenario: NodeAggregateWasEnabled and NodeAggregateWasDisabled events don't update last modified timestamps + Scenario: SubtreeTagWasAdded and SubtreeTagWasRemoved events don't update last modified timestamps When the current date and time is "2023-03-16T13:00:00+01:00" - And the command DisableNodeAggregate is executed with payload: + And the command AddSubtreeTag is executed with payload: | Key | Value | | contentStreamId | "cs-user" | | coveredDimensionSpacePoint | {"language": "ch"} | | nodeAggregateId | "a" | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | And the graph projection is fully up to date And I am in content stream "cs-user" and dimension space point {"language":"de"} And VisibilityConstraints are set to "withoutRestrictions" @@ -270,12 +271,13 @@ Feature: Behavior of Node timestamp properties "created", "originalCreated", "la | 2023-03-16 12:30:00 | 2023-03-16 12:30:00 | | | When the current date and time is "2023-03-16T14:00:00+01:00" - And the command EnableNodeAggregate is executed with payload: + And the command RemoveSubtreeTag is executed with payload: | Key | Value | | contentStreamId | "cs-user" | | coveredDimensionSpacePoint | {"language": "ch"} | | nodeAggregateId | "a" | | nodeVariantSelectionStrategy | "allSpecializations" | + | tag | "disabled" | And the graph projection is fully up to date And I am in content stream "cs-user" and dimension space point {"language":"de"} Then I expect the node "a" to have the following timestamps: diff --git a/Neos.ContentRepository.Core/Classes/EventStore/EventNormalizer.php b/Neos.ContentRepository.Core/Classes/EventStore/EventNormalizer.php index 020e0f23b80..a68c5ecfec5 100644 --- a/Neos.ContentRepository.Core/Classes/EventStore/EventNormalizer.php +++ b/Neos.ContentRepository.Core/Classes/EventStore/EventNormalizer.php @@ -24,6 +24,9 @@ use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodeSpecializationVariantWasCreated; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateDimensionsWereUpdated; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateWithNodeWasCreated; +use Neos\ContentRepository\Core\Feature\Tagging\Dto\SubtreeTag; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasAdded; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasRemoved; use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Event\RootWorkspaceWasCreated; use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Event\WorkspaceWasCreated; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Event\WorkspaceWasDiscarded; @@ -87,6 +90,8 @@ public function __construct() RootNodeAggregateWithNodeWasCreated::class, RootWorkspaceWasCreated::class, RootNodeAggregateDimensionsWereUpdated::class, + SubtreeTagWasAdded::class, + SubtreeTagWasRemoved::class, WorkspaceRebaseFailed::class, WorkspaceWasCreated::class, WorkspaceWasRenamed::class, @@ -157,6 +162,12 @@ public function denormalize(Event $event): EventInterface ); } assert(is_array($eventDataAsArray)); - return $eventClassName::fromArray($eventDataAsArray); + $eventInstance = $eventClassName::fromArray($eventDataAsArray); + return match ($eventInstance::class) { + // upcast disabled / enabled events to the corresponding SubtreeTag events + NodeAggregateWasDisabled::class => new SubtreeTagWasAdded($eventInstance->contentStreamId, $eventInstance->nodeAggregateId, $eventInstance->affectedDimensionSpacePoints, SubtreeTag::fromString('disabled')), + NodeAggregateWasEnabled::class => new SubtreeTagWasRemoved($eventInstance->contentStreamId, $eventInstance->nodeAggregateId, $eventInstance->affectedDimensionSpacePoints, SubtreeTag::fromString('disabled')), + default => $eventInstance, + }; } } diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php b/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php index 7397fbf44f4..2a6e2026129 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php @@ -38,8 +38,6 @@ use Neos\ContentRepository\Core\SharedModel\Exception\NodeTypeNotFound; use Neos\ContentRepository\Core\SharedModel\Exception\NodeTypeNotFoundException; use Neos\ContentRepository\Core\SharedModel\Exception\ReferenceCannotBeSet; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Exception\NodeAggregateCurrentlyDisablesDimensionSpacePoint; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Exception\NodeAggregateCurrentlyDoesNotDisableDimensionSpacePoint; use Neos\ContentRepository\Core\Feature\NodeVariation\Exception\DimensionSpacePointIsAlreadyOccupied; use Neos\ContentRepository\Core\Infrastructure\Property\PropertyType; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeAggregateCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/NodeAggregateCommandHandler.php index fb8e7de7aa0..886648252fd 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeAggregateCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeAggregateCommandHandler.php @@ -25,9 +25,6 @@ use Neos\ContentRepository\Core\Feature\NodeCreation\Command\CreateNodeAggregateWithNode; use Neos\ContentRepository\Core\Feature\NodeCreation\Command\CreateNodeAggregateWithNodeAndSerializedProperties; use Neos\ContentRepository\Core\Feature\NodeCreation\NodeCreation; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Command\DisableNodeAggregate; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Command\EnableNodeAggregate; -use Neos\ContentRepository\Core\Feature\NodeDisabling\NodeDisabling; use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetNodeProperties; use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetSerializedNodeProperties; use Neos\ContentRepository\Core\Feature\NodeModification\NodeModification; @@ -47,6 +44,9 @@ use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\CreateRootNodeAggregateWithNode; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\UpdateRootNodeAggregateDimensions; use Neos\ContentRepository\Core\Feature\RootNodeCreation\RootNodeHandling; +use Neos\ContentRepository\Core\Feature\Tagging\Command\AddSubtreeTag; +use Neos\ContentRepository\Core\Feature\Tagging\Command\RemoveSubtreeTag; +use Neos\ContentRepository\Core\Feature\Tagging\NodeTagging; use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; use Neos\ContentRepository\Core\NodeType\NodeTypeManager; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate; @@ -60,7 +60,7 @@ final class NodeAggregateCommandHandler implements CommandHandlerInterface use ConstraintChecks; use RootNodeHandling; use NodeCreation; - use NodeDisabling; + use NodeTagging; use NodeModification; use NodeMove; use NodeReferencing; @@ -132,8 +132,8 @@ public function handle(CommandInterface $command, ContentRepository $contentRepo => $this->handleCreateRootNodeAggregateWithNode($command, $contentRepository), UpdateRootNodeAggregateDimensions::class => $this->handleUpdateRootNodeAggregateDimensions($command, $contentRepository), - DisableNodeAggregate::class => $this->handleDisableNodeAggregate($command, $contentRepository), - EnableNodeAggregate::class => $this->handleEnableNodeAggregate($command, $contentRepository), + AddSubtreeTag::class => $this->handleAddSubtreeTag($command, $contentRepository), + RemoveSubtreeTag::class => $this->handleRemoveSubtreeTag($command, $contentRepository), ChangeNodeAggregateName::class => $this->handleChangeNodeAggregateName($command, $contentRepository), }; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php index 60639d39f69..1414f58d7b6 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php @@ -18,13 +18,14 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; use Neos\ContentRepository\Core\Feature\Common\PublishableToOtherContentStreamsInterface; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasAdded; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; /** * A node aggregate was disabled * - * @api events are the persistence-API of the content repository + * @deprecated This event will never be emitted, it is up-casted to a corresponding {@see SubtreeTagWasAdded} event instead in the {@see EventNormalizer}. This implementation is just kept for backwards-compatibility */ final class NodeAggregateWasDisabled implements EventInterface, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php index 2fe7344543b..04a8fed352e 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php @@ -16,15 +16,17 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; +use Neos\ContentRepository\Core\EventStore\EventNormalizer; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; use Neos\ContentRepository\Core\Feature\Common\PublishableToOtherContentStreamsInterface; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasRemoved; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; /** * A node aggregate was enabled * - * @api events are the persistence-API of the content repository + * @deprecated This event will never be emitted, it is up-casted to a corresponding {@see SubtreeTagWasRemoved} event instead in the {@see EventNormalizer}. This implementation is just kept for backwards-compatibility */ final class NodeAggregateWasEnabled implements EventInterface, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/DisableNodeAggregate.php b/Neos.ContentRepository.Core/Classes/Feature/Tagging/Command/AddSubtreeTag.php similarity index 81% rename from Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/DisableNodeAggregate.php rename to Neos.ContentRepository.Core/Classes/Feature/Tagging/Command/AddSubtreeTag.php index 1d65963c489..54ef338387d 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/DisableNodeAggregate.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Tagging/Command/AddSubtreeTag.php @@ -12,51 +12,55 @@ declare(strict_types=1); -namespace Neos\ContentRepository\Core\Feature\NodeDisabling\Command; +namespace Neos\ContentRepository\Core\Feature\Tagging\Command; use Neos\ContentRepository\Core\CommandHandler\CommandInterface; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherContentStreamsInterface; +use Neos\ContentRepository\Core\Feature\Tagging\Dto\SubtreeTag; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeVariantSelectionStrategy; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; /** - * Disable the given node aggregate in the given content stream in a dimension space point using a given strategy + * Add a {@see SubtreeTag} to a node aggregate and its descendants * * @api commands are the write-API of the ContentRepository */ -final class DisableNodeAggregate implements +final class AddSubtreeTag implements CommandInterface, \JsonSerializable, RebasableToOtherContentStreamsInterface, MatchableWithNodeIdToPublishOrDiscardInterface { /** - * @param ContentStreamId $contentStreamId The content stream in which the disable operation is to be performed - * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to disable - * @param DimensionSpacePoint $coveredDimensionSpacePoint The covered dimension space point of the node aggregate in which the user intends to disable it - * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be disabled + * @param ContentStreamId $contentStreamId The content stream in which the tagging operation is to be performed + * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to tag + * @param DimensionSpacePoint $coveredDimensionSpacePoint The covered dimension space point of the node aggregate in which the user intends to tag it + * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be tagged + * @param SubtreeTag $tag The tag to add to the Subtree */ private function __construct( public readonly ContentStreamId $contentStreamId, public readonly NodeAggregateId $nodeAggregateId, public readonly DimensionSpacePoint $coveredDimensionSpacePoint, public readonly NodeVariantSelectionStrategy $nodeVariantSelectionStrategy, + public readonly SubtreeTag $tag, ) { } /** - * @param ContentStreamId $contentStreamId The content stream in which the disable operation is to be performed - * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to disable - * @param DimensionSpacePoint $coveredDimensionSpacePoint The covered dimension space point of the node aggregate in which the user intends to disable it - * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be disabled + * @param ContentStreamId $contentStreamId The content stream in which the tagging operation is to be performed + * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to tag + * @param DimensionSpacePoint $coveredDimensionSpacePoint The covered dimension space point of the node aggregate in which the user intends to tag it + * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be tagged + * @param SubtreeTag $tag The tag to add to the Subtree */ - public static function create(ContentStreamId $contentStreamId, NodeAggregateId $nodeAggregateId, DimensionSpacePoint $coveredDimensionSpacePoint, NodeVariantSelectionStrategy $nodeVariantSelectionStrategy): self + public static function create(ContentStreamId $contentStreamId, NodeAggregateId $nodeAggregateId, DimensionSpacePoint $coveredDimensionSpacePoint, NodeVariantSelectionStrategy $nodeVariantSelectionStrategy, SubtreeTag $tag): self { - return new self($contentStreamId, $nodeAggregateId, $coveredDimensionSpacePoint, $nodeVariantSelectionStrategy); + return new self($contentStreamId, $nodeAggregateId, $coveredDimensionSpacePoint, $nodeVariantSelectionStrategy, $tag); } /** @@ -69,6 +73,7 @@ public static function fromArray(array $array): self NodeAggregateId::fromString($array['nodeAggregateId']), DimensionSpacePoint::fromArray($array['coveredDimensionSpacePoint']), NodeVariantSelectionStrategy::from($array['nodeVariantSelectionStrategy']), + SubtreeTag::fromString($array['tag']), ); } @@ -87,6 +92,7 @@ public function createCopyForContentStream(ContentStreamId $target): self $this->nodeAggregateId, $this->coveredDimensionSpacePoint, $this->nodeVariantSelectionStrategy, + $this->tag, ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/EnableNodeAggregate.php b/Neos.ContentRepository.Core/Classes/Feature/Tagging/Command/RemoveSubtreeTag.php similarity index 77% rename from Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/EnableNodeAggregate.php rename to Neos.ContentRepository.Core/Classes/Feature/Tagging/Command/RemoveSubtreeTag.php index 5bce9711699..2793532735a 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/EnableNodeAggregate.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Tagging/Command/RemoveSubtreeTag.php @@ -12,51 +12,56 @@ declare(strict_types=1); -namespace Neos\ContentRepository\Core\Feature\NodeDisabling\Command; +namespace Neos\ContentRepository\Core\Feature\Tagging\Command; use Neos\ContentRepository\Core\CommandHandler\CommandInterface; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherContentStreamsInterface; +use Neos\ContentRepository\Core\Feature\Tagging\Dto\SubtreeTag; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeVariantSelectionStrategy; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; /** - * Enable the given node aggregate in the given content stream in a dimension space point using a given strategy + * Remove a {@see SubtreeTag} from a node aggregate and its descendants. + * Note: This will remove the tag from the node aggregate and all inherited instances. If the same tag is added for another Subtree below this aggregate, this will still be set! * * @api commands are the write-API of the ContentRepository */ -final class EnableNodeAggregate implements +final class RemoveSubtreeTag implements CommandInterface, \JsonSerializable, RebasableToOtherContentStreamsInterface, MatchableWithNodeIdToPublishOrDiscardInterface { /** - * @param ContentStreamId $contentStreamId The content stream in which the enable operation is to be performed - * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to enable - * @param DimensionSpacePoint $coveredDimensionSpacePoint The covered dimension space point of the node aggregate in which the user intends to enable it - * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be enabled + * @param ContentStreamId $contentStreamId The content stream in which the remove tag operation is to be performed + * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to remove the tag from + * @param DimensionSpacePoint $coveredDimensionSpacePoint The covered dimension space point of the node aggregate in which the user intends to remove the tag + * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be untagged + * @param SubtreeTag $tag The tag to remove from the node aggregate */ private function __construct( public readonly ContentStreamId $contentStreamId, public readonly NodeAggregateId $nodeAggregateId, public readonly DimensionSpacePoint $coveredDimensionSpacePoint, public readonly NodeVariantSelectionStrategy $nodeVariantSelectionStrategy, + public readonly SubtreeTag $tag, ) { } /** - * @param ContentStreamId $contentStreamId The content stream in which the enable operation is to be performed - * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to enable - * @param DimensionSpacePoint $coveredDimensionSpacePoint The covered dimension space point of the node aggregate in which the user intends to enable it - * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be enabled + * @param ContentStreamId $contentStreamId The content stream in which the remove tag operation is to be performed + * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to remove the tag from + * @param DimensionSpacePoint $coveredDimensionSpacePoint The covered dimension space point of the node aggregate in which the user intends to remove the tag + * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be untagged + * @param SubtreeTag $tag The tag to remove from the node aggregate */ - public static function create(ContentStreamId $contentStreamId, NodeAggregateId $nodeAggregateId, DimensionSpacePoint $coveredDimensionSpacePoint, NodeVariantSelectionStrategy $nodeVariantSelectionStrategy): self + public static function create(ContentStreamId $contentStreamId, NodeAggregateId $nodeAggregateId, DimensionSpacePoint $coveredDimensionSpacePoint, NodeVariantSelectionStrategy $nodeVariantSelectionStrategy, SubtreeTag $tag): self { - return new self($contentStreamId, $nodeAggregateId, $coveredDimensionSpacePoint, $nodeVariantSelectionStrategy); + return new self($contentStreamId, $nodeAggregateId, $coveredDimensionSpacePoint, $nodeVariantSelectionStrategy, $tag); } /** @@ -69,6 +74,7 @@ public static function fromArray(array $array): self NodeAggregateId::fromString($array['nodeAggregateId']), DimensionSpacePoint::fromArray($array['coveredDimensionSpacePoint']), NodeVariantSelectionStrategy::from($array['nodeVariantSelectionStrategy']), + SubtreeTag::fromString($array['tag']), ); } @@ -87,6 +93,7 @@ public function createCopyForContentStream(ContentStreamId $target): self $this->nodeAggregateId, $this->coveredDimensionSpacePoint, $this->nodeVariantSelectionStrategy, + $this->tag, ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/Tagging/Dto/SubtreeTag.php b/Neos.ContentRepository.Core/Classes/Feature/Tagging/Dto/SubtreeTag.php new file mode 100644 index 00000000000..648d83b0843 --- /dev/null +++ b/Neos.ContentRepository.Core/Classes/Feature/Tagging/Dto/SubtreeTag.php @@ -0,0 +1,42 @@ +value; + } +} diff --git a/Neos.ContentRepository.Core/Classes/Feature/Tagging/Dto/SubtreeTags.php b/Neos.ContentRepository.Core/Classes/Feature/Tagging/Dto/SubtreeTags.php new file mode 100644 index 00000000000..0fb5c4f29e8 --- /dev/null +++ b/Neos.ContentRepository.Core/Classes/Feature/Tagging/Dto/SubtreeTags.php @@ -0,0 +1,69 @@ + + */ +final readonly class SubtreeTags implements \IteratorAggregate, \JsonSerializable +{ + + /** + * @var array + */ + private array $tags; + + + private function __construct(SubtreeTag ...$tags) + { + $this->tags = $tags; + } + + public static function createEmpty(): self + { + return new self(); + } + + public static function fromStringArray(array $array): self + { + return new self(...array_map(SubtreeTag::fromString(...), $array)); + } + + public function isEmpty(): bool + { + return $this->tags === []; + } + + /** + * @return array + */ + public function toStringArray(): array + { + return array_map(static fn (SubtreeTag $tag) => $tag->value, $this->tags); + } + + public function jsonSerialize(): array + { + return $this->tags; + } + + public function getIterator(): \Traversable + { + return new \ArrayIterator($this->tags); + } +} diff --git a/Neos.ContentRepository.Core/Classes/Feature/Tagging/Event/SubtreeTagWasAdded.php b/Neos.ContentRepository.Core/Classes/Feature/Tagging/Event/SubtreeTagWasAdded.php new file mode 100644 index 00000000000..8e79e142983 --- /dev/null +++ b/Neos.ContentRepository.Core/Classes/Feature/Tagging/Event/SubtreeTagWasAdded.php @@ -0,0 +1,83 @@ +contentStreamId; + } + + public function getNodeAggregateId(): NodeAggregateId + { + return $this->nodeAggregateId; + } + + public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + { + return new self( + $targetContentStreamId, + $this->nodeAggregateId, + $this->affectedDimensionSpacePoints, + $this->tag, + ); + } + + public static function fromArray(array $values): EventInterface + { + return new self( + ContentStreamId::fromString($values['contentStreamId']), + NodeAggregateId::fromString($values['nodeAggregateId']), + DimensionSpacePointSet::fromArray($values['affectedDimensionSpacePoints']), + SubtreeTag::fromString($values['tag']), + ); + } + + public function jsonSerialize(): array + { + return get_object_vars($this); + } +} diff --git a/Neos.ContentRepository.Core/Classes/Feature/Tagging/Event/SubtreeTagWasRemoved.php b/Neos.ContentRepository.Core/Classes/Feature/Tagging/Event/SubtreeTagWasRemoved.php new file mode 100644 index 00000000000..4f07eb99351 --- /dev/null +++ b/Neos.ContentRepository.Core/Classes/Feature/Tagging/Event/SubtreeTagWasRemoved.php @@ -0,0 +1,84 @@ +contentStreamId; + } + + public function getNodeAggregateId(): NodeAggregateId + { + return $this->nodeAggregateId; + } + + public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + { + return new self( + $targetContentStreamId, + $this->nodeAggregateId, + $this->affectedDimensionSpacePoints, + $this->tag, + ); + } + + public static function fromArray(array $values): EventInterface + { + return new self( + ContentStreamId::fromString($values['contentStreamId']), + NodeAggregateId::fromString($values['nodeAggregateId']), + DimensionSpacePointSet::fromArray($values['affectedDimensionSpacePoints']), + SubtreeTag::fromString($values['tag']), + ); + } + + public function jsonSerialize(): array + { + return get_object_vars($this); + } +} diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/NodeDisabling.php b/Neos.ContentRepository.Core/Classes/Feature/Tagging/NodeTagging.php similarity index 59% rename from Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/NodeDisabling.php rename to Neos.ContentRepository.Core/Classes/Feature/Tagging/NodeTagging.php index ea4f647c33b..54a502b429b 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/NodeDisabling.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Tagging/NodeTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Neos\ContentRepository\Core\Feature\NodeDisabling; +namespace Neos\ContentRepository\Core\Feature\Tagging; /* * This file is part of the Neos.ContentRepository package. @@ -15,56 +15,42 @@ */ use Neos\ContentRepository\Core\ContentRepository; -use Neos\ContentRepository\Core\DimensionSpace\Exception\DimensionSpacePointNotFound; use Neos\ContentRepository\Core\DimensionSpace; use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; -use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; -use Neos\ContentRepository\Core\SharedModel\Exception\ContentStreamDoesNotExistYet; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Command\DisableNodeAggregate; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Command\EnableNodeAggregate; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasDisabled; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasEnabled; -use Neos\ContentRepository\Core\SharedModel\Exception\NodeAggregatesTypeIsAmbiguous; -use Neos\ContentRepository\Core\SharedModel\Exception\NodeAggregateCurrentlyDoesNotExist; +use Neos\ContentRepository\Core\Feature\Common\ConstraintChecks; use Neos\ContentRepository\Core\Feature\Common\NodeAggregateEventPublisher; +use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; +use Neos\ContentRepository\Core\Feature\Tagging\Command\AddSubtreeTag; +use Neos\ContentRepository\Core\Feature\Tagging\Command\RemoveSubtreeTag; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasAdded; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasRemoved; use Neos\EventStore\Model\EventStream\ExpectedVersion; /** * @internal implementation detail of Command Handlers */ -trait NodeDisabling +trait NodeTagging { + use ConstraintChecks; + abstract protected function getInterDimensionalVariationGraph(): DimensionSpace\InterDimensionalVariationGraph; - /** - * @param DisableNodeAggregate $command - * @return EventsToPublish - * @throws ContentStreamDoesNotExistYet - * @throws DimensionSpacePointNotFound - * @throws NodeAggregateCurrentlyDoesNotExist - * @throws NodeAggregatesTypeIsAmbiguous - */ - private function handleDisableNodeAggregate( - DisableNodeAggregate $command, - ContentRepository $contentRepository - ): EventsToPublish { + private function handleAddSubtreeTag(AddSubtreeTag $command, ContentRepository $contentRepository): EventsToPublish + { $this->requireContentStreamToExist($command->contentStreamId, $contentRepository); $this->requireDimensionSpacePointToExist($command->coveredDimensionSpacePoint); - $nodeAggregate = $this->requireProjectedNodeAggregate( - $command->contentStreamId, - $command->nodeAggregateId, - $contentRepository - ); + $nodeAggregate = $this->requireProjectedNodeAggregate($command->contentStreamId, $command->nodeAggregateId, $contentRepository); $this->requireNodeAggregateToCoverDimensionSpacePoint( $nodeAggregate, $command->coveredDimensionSpacePoint ); - if ($nodeAggregate->disablesDimensionSpacePoint($command->coveredDimensionSpacePoint)) { - // already disabled, so we can return a no-operation. - return EventsToPublish::empty(); - } +// TODO Adjust to SubtreeTags (is already tagged with same tag => throw exception) +// if ($nodeAggregate->disablesDimensionSpacePoint($command->coveredDimensionSpacePoint)) { +// // already disabled, so we can return a no-operation. +// return EventsToPublish::empty(); +// } $affectedDimensionSpacePoints = $command->nodeVariantSelectionStrategy ->resolveAffectedDimensionSpacePoints( @@ -74,10 +60,11 @@ private function handleDisableNodeAggregate( ); $events = Events::with( - new NodeAggregateWasDisabled( + new SubtreeTagWasAdded( $command->contentStreamId, $command->nodeAggregateId, $affectedDimensionSpacePoints, + $command->tag, ), ); @@ -92,17 +79,8 @@ private function handleDisableNodeAggregate( ); } - /** - * @param EnableNodeAggregate $command - * @return EventsToPublish - * @throws ContentStreamDoesNotExistYet - * @throws DimensionSpacePointNotFound - * @throws NodeAggregatesTypeIsAmbiguous - */ - public function handleEnableNodeAggregate( - EnableNodeAggregate $command, - ContentRepository $contentRepository - ): EventsToPublish { + public function handleRemoveSubtreeTag(RemoveSubtreeTag $command, ContentRepository $contentRepository): EventsToPublish + { $this->requireContentStreamToExist($command->contentStreamId, $contentRepository); $this->requireDimensionSpacePointToExist($command->coveredDimensionSpacePoint); $nodeAggregate = $this->requireProjectedNodeAggregate( @@ -115,10 +93,11 @@ public function handleEnableNodeAggregate( $command->coveredDimensionSpacePoint ); - if (!$nodeAggregate->disablesDimensionSpacePoint($command->coveredDimensionSpacePoint)) { - // already enabled, so we can return a no-operation. - return EventsToPublish::empty(); - } +// TODO Adjust to SubtreeTags (is not tagged with same tag => throw exception) +// if ($nodeAggregate->disablesDimensionSpacePoint($command->coveredDimensionSpacePoint)) { +// // already disabled, so we can return a no-operation. +// return EventsToPublish::empty(); +// } $affectedDimensionSpacePoints = $command->nodeVariantSelectionStrategy ->resolveAffectedDimensionSpacePoints( @@ -128,10 +107,11 @@ public function handleEnableNodeAggregate( ); $events = Events::with( - new NodeAggregateWasEnabled( + new SubtreeTagWasRemoved( $command->contentStreamId, $command->nodeAggregateId, $affectedDimensionSpacePoints, + $command->tag, ) ); diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeAggregate.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeAggregate.php index e17410810c6..3761a74115c 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeAggregate.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeAggregate.php @@ -65,6 +65,7 @@ public function __construct( private readonly array $nodesByCoveredDimensionSpacePoint, private readonly OriginByCoverage $occupationByCovered, /** + * TODO Adjust to SubtreeTags * The dimension space point set this node aggregate disables. * This is *not* necessarily the set it is disabled in, since that is determined by its ancestors */ @@ -144,6 +145,9 @@ public function getOccupationByCovered(DimensionSpacePoint $coveredDimensionSpac return $occupation; } + /** + * TODO adjust to SubtreeTags + */ public function disablesDimensionSpacePoint(DimensionSpacePoint $dimensionSpacePoint): bool { return $this->disabledDimensionSpacePoints->contains($dimensionSpacePoint); diff --git a/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateProjection.php b/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateProjection.php index 3b83ff11b60..c46c88bcba9 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateProjection.php +++ b/Neos.ContentRepository.Core/Classes/Projection/NodeHiddenState/NodeHiddenStateProjection.php @@ -22,8 +22,8 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\ContentStreamForking\Event\ContentStreamWasForked; use Neos\ContentRepository\Core\Feature\DimensionSpaceAdjustment\Event\DimensionSpacePointWasMoved; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasDisabled; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasEnabled; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasAdded; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasRemoved; use Neos\ContentRepository\Core\Infrastructure\DbalClientInterface; use Neos\ContentRepository\Core\Projection\ProjectionInterface; use Neos\EventStore\CatchUp\CheckpointStorageInterface; @@ -102,8 +102,8 @@ public function reset(): void public function canHandle(EventInterface $event): bool { return in_array($event::class, [ - NodeAggregateWasDisabled::class, - NodeAggregateWasEnabled::class, + SubtreeTagWasAdded::class, + SubtreeTagWasRemoved::class, ContentStreamWasForked::class, DimensionSpacePointWasMoved::class ]); @@ -112,8 +112,8 @@ public function canHandle(EventInterface $event): bool public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void { match ($event::class) { - NodeAggregateWasDisabled::class => $this->whenNodeAggregateWasDisabled($event), - NodeAggregateWasEnabled::class => $this->whenNodeAggregateWasEnabled($event), + SubtreeTagWasAdded::class => $this->whenSubtreeTagWasAdded($event), + SubtreeTagWasRemoved::class => $this->whenSubtreeTagWasRemoved($event), ContentStreamWasForked::class => $this->whenContentStreamWasForked($event), DimensionSpacePointWasMoved::class => $this->whenDimensionSpacePointWasMoved($event), default => throw new \InvalidArgumentException(sprintf('Unsupported event %s', get_debug_type($event))), @@ -137,7 +137,7 @@ public function getState(): NodeHiddenStateFinder } - private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): void + private function whenSubtreeTagWasAdded(SubtreeTagWasAdded $event): void { $this->transactional(function () use ($event) { foreach ($event->affectedDimensionSpacePoints as $dimensionSpacePoint) { @@ -160,7 +160,7 @@ private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): }); } - private function whenNodeAggregateWasEnabled(NodeAggregateWasEnabled $event): void + private function whenSubtreeTagWasRemoved(SubtreeTagWasRemoved $event): void { $this->getDatabaseConnection()->executeQuery( ' diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php index 4f8bb63a3e9..4185a494d33 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php @@ -10,46 +10,47 @@ use League\Flysystem\FilesystemException; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\DimensionSpace\InterDimensionalVariationGraph; +use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; +use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet; use Neos\ContentRepository\Core\DimensionSpace\VariantType; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\EventStore\EventNormalizer; -use Neos\ContentRepository\Core\Feature\NodeMove\Dto\CoverageNodeMoveMapping; -use Neos\ContentRepository\Core\Feature\NodeMove\Dto\CoverageNodeMoveMappings; -use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName; -use Neos\ContentRepository\Export\Event\ValueObject\ExportedEvent; -use Neos\ContentRepository\Export\ProcessorInterface; -use Neos\ContentRepository\Export\ProcessorResult; -use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite; -use Neos\ContentRepository\Core\Feature\NodeReferencing\Dto\SerializedNodeReferences; use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasDisabled; +use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite; use Neos\ContentRepository\Core\Feature\NodeModification\Event\NodePropertiesWereSet; -use Neos\ContentRepository\Core\Feature\NodeMove\Event\NodeAggregateWasMoved; +use Neos\ContentRepository\Core\Feature\NodeMove\Dto\CoverageNodeMoveMapping; +use Neos\ContentRepository\Core\Feature\NodeMove\Dto\CoverageNodeMoveMappings; use Neos\ContentRepository\Core\Feature\NodeMove\Dto\OriginNodeMoveMapping; use Neos\ContentRepository\Core\Feature\NodeMove\Dto\OriginNodeMoveMappings; use Neos\ContentRepository\Core\Feature\NodeMove\Dto\SucceedingSiblingNodeMoveDestination; +use Neos\ContentRepository\Core\Feature\NodeMove\Event\NodeAggregateWasMoved; +use Neos\ContentRepository\Core\Feature\NodeReferencing\Dto\SerializedNodeReferences; use Neos\ContentRepository\Core\Feature\NodeReferencing\Event\NodeReferencesWereSet; use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodeGeneralizationVariantWasCreated; use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodePeerVariantWasCreated; use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodeSpecializationVariantWasCreated; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateWithNodeWasCreated; +use Neos\ContentRepository\Core\Feature\Tagging\Dto\SubtreeTag; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasAdded; use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; -use Neos\ContentRepository\Export\Severity; -use Neos\ContentRepository\LegacyNodeMigration\Exception\MigrationException; -use Neos\ContentRepository\LegacyNodeMigration\Helpers\SerializedPropertyValuesAndReferences; -use Neos\ContentRepository\LegacyNodeMigration\Helpers\VisitedNodeAggregate; -use Neos\ContentRepository\LegacyNodeMigration\Helpers\VisitedNodeAggregates; +use Neos\ContentRepository\Core\NodeType\NodeType; +use Neos\ContentRepository\Core\NodeType\NodeTypeManager; +use Neos\ContentRepository\Core\NodeType\NodeTypeName; +use Neos\ContentRepository\Core\Projection\ContentGraph\NodePath; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; -use Neos\ContentRepository\Core\Projection\ContentGraph\NodePath; -use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; -use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet; -use Neos\ContentRepository\Core\NodeType\NodeType; -use Neos\ContentRepository\Core\NodeType\NodeTypeManager; -use Neos\ContentRepository\Core\NodeType\NodeTypeName; +use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Export\Event\ValueObject\ExportedEvent; +use Neos\ContentRepository\Export\ProcessorInterface; +use Neos\ContentRepository\Export\ProcessorResult; +use Neos\ContentRepository\Export\Severity; +use Neos\ContentRepository\LegacyNodeMigration\Exception\MigrationException; +use Neos\ContentRepository\LegacyNodeMigration\Helpers\SerializedPropertyValuesAndReferences; +use Neos\ContentRepository\LegacyNodeMigration\Helpers\VisitedNodeAggregate; +use Neos\ContentRepository\LegacyNodeMigration\Helpers\VisitedNodeAggregates; use Neos\Flow\Persistence\Doctrine\DataTypes\JsonArrayType; use Neos\Flow\Property\PropertyMapper; use Neos\Neos\Domain\Service\NodeTypeNameFactory; @@ -278,9 +279,9 @@ public function processNodeDataWithoutFallbackToEmptyDimension(NodeAggregateId $ // create node aggregate $this->exportEvent(new NodeAggregateWithNodeWasCreated($this->contentStreamId, $nodeAggregateId, $nodeTypeName, $originDimensionSpacePoint, $this->interDimensionalVariationGraph->getSpecializationSet($originDimensionSpacePoint->toDimensionSpacePoint()), $parentNodeAggregate->nodeAggregateId, $nodeName, $serializedPropertyValuesAndReferences->serializedPropertyValues, NodeAggregateClassification::CLASSIFICATION_REGULAR, null)); } - // nodes are hidden via NodeAggregateWasDisabled event + // nodes are hidden via SubtreeTagWasAdded event if ($nodeDataRow['hidden']) { - $this->exportEvent(new NodeAggregateWasDisabled($this->contentStreamId, $nodeAggregateId, $this->interDimensionalVariationGraph->getSpecializationSet($originDimensionSpacePoint->toDimensionSpacePoint(), true, $this->visitedNodes->alreadyVisitedOriginDimensionSpacePoints($nodeAggregateId)->toDimensionSpacePointSet()))); + $this->exportEvent(new SubtreeTagWasAdded($this->contentStreamId, $nodeAggregateId, $this->interDimensionalVariationGraph->getSpecializationSet($originDimensionSpacePoint->toDimensionSpacePoint(), true, $this->visitedNodes->alreadyVisitedOriginDimensionSpacePoints($nodeAggregateId)->toDimensionSpacePointSet()), SubtreeTag::fromString('disabled'))); } foreach ($serializedPropertyValuesAndReferences->references as $referencePropertyName => $destinationNodeAggregateIds) { $this->nodeReferencesWereSetEvents[] = new NodeReferencesWereSet($this->contentStreamId, $nodeAggregateId, new OriginDimensionSpacePointSet([$originDimensionSpacePoint]), ReferenceName::fromString($referencePropertyName), SerializedNodeReferences::fromNodeAggregateIds($destinationNodeAggregateIds)); diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteTrait.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteTrait.php index 8ba9feb22f7..4c1c6927135 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteTrait.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/CRTestSuiteTrait.php @@ -35,7 +35,7 @@ use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\Features\ContentStreamForking; use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\Features\NodeCopying; use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\Features\NodeCreation; -use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\Features\NodeDisabling; +use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\Features\Tagging; use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\Features\NodeModification; use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\Features\NodeMove; use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\Features\NodeReferencing; @@ -67,7 +67,7 @@ trait CRTestSuiteTrait use NodeCreation; use NodeCopying; - use NodeDisabling; + use Tagging; use NodeModification; use NodeMove; use NodeReferencing; diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeDisabling.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/Tagging.php similarity index 69% rename from Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeDisabling.php rename to Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/Tagging.php index a794a506c34..0b306f5627f 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeDisabling.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/Tagging.php @@ -16,19 +16,20 @@ use Behat\Gherkin\Node\TableNode; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; +use Neos\ContentRepository\Core\Feature\Tagging\Command\AddSubtreeTag; +use Neos\ContentRepository\Core\Feature\Tagging\Command\RemoveSubtreeTag; +use Neos\ContentRepository\Core\Feature\Tagging\Dto\SubtreeTag; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Command\DisableNodeAggregate; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Command\EnableNodeAggregate; use Neos\ContentRepository\Core\SharedModel\Node\NodeVariantSelectionStrategy; use Neos\ContentRepository\TestSuite\Behavior\Features\Bootstrap\CRTestSuiteRuntimeVariables; use Neos\EventStore\Model\Event\StreamName; /** - * The node disabling trait for behavioral tests + * The tagging trait for behavioral tests */ -trait NodeDisabling +trait Tagging { use CRTestSuiteRuntimeVariables; @@ -37,11 +38,11 @@ abstract protected function readPayloadTable(TableNode $payloadTable): array; abstract protected function publishEvent(string $eventType, StreamName $streamName, array $eventPayload): void; /** - * @Given /^the command DisableNodeAggregate is executed with payload:$/ + * @Given /^the command AddSubtreeTag is executed with payload:$/ * @param TableNode $payloadTable * @throws \Exception */ - public function theCommandDisableNodeAggregateIsExecutedWithPayload(TableNode $payloadTable): void + public function theCommandAddSubtreeTagIsExecutedWithPayload(TableNode $payloadTable): void { $commandArguments = $this->readPayloadTable($payloadTable); $contentStreamId = isset($commandArguments['contentStreamId']) @@ -51,35 +52,36 @@ public function theCommandDisableNodeAggregateIsExecutedWithPayload(TableNode $p ? DimensionSpacePoint::fromArray($commandArguments['coveredDimensionSpacePoint']) : $this->currentDimensionSpacePoint; - $command = DisableNodeAggregate::create( + $command = AddSubtreeTag::create( $contentStreamId, NodeAggregateId::fromString($commandArguments['nodeAggregateId']), $coveredDimensionSpacePoint, NodeVariantSelectionStrategy::from($commandArguments['nodeVariantSelectionStrategy']), + SubtreeTag::fromString($commandArguments['tag']), ); $this->lastCommandOrEventResult = $this->currentContentRepository->handle($command); } /** - * @Given /^the command DisableNodeAggregate is executed with payload and exceptions are caught:$/ + * @Given /^the command AddSubtreeTag is executed with payload and exceptions are caught:$/ * @param TableNode $payloadTable */ - public function theCommandDisableNodeAggregateIsExecutedWithPayloadAndExceptionsAreCaught(TableNode $payloadTable): void + public function theCommandAddSubtreeTagIsExecutedWithPayloadAndExceptionsAreCaught(TableNode $payloadTable): void { try { - $this->theCommandDisableNodeAggregateIsExecutedWithPayload($payloadTable); + $this->theCommandAddSubtreeTagIsExecutedWithPayload($payloadTable); } catch (\Exception $exception) { $this->lastCommandException = $exception; } } /** - * @Given /^the event NodeAggregateWasDisabled was published with payload:$/ + * @Given /^the event SubtreeTagWasAdded was published with payload:$/ * @param TableNode $payloadTable * @throws \Exception */ - public function theEventNodeAggregateWasDisabledWasPublishedWithPayload(TableNode $payloadTable) + public function theEventSubtreeTagWasAddedWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); $streamName = ContentStreamEventStreamName::fromContentStreamId( @@ -88,16 +90,16 @@ public function theEventNodeAggregateWasDisabledWasPublishedWithPayload(TableNod : $this->currentContentStreamId ); - $this->publishEvent('NodeAggregateWasDisabled', $streamName->getEventStreamName(), $eventPayload); + $this->publishEvent('SubtreeTagWasAdded', $streamName->getEventStreamName(), $eventPayload); } /** - * @Given /^the event NodeAggregateWasEnabled was published with payload:$/ + * @Given /^the event SubtreeTagWasRemoved was published with payload:$/ * @param TableNode $payloadTable * @throws \Exception */ - public function theEventNodeAggregateWasEnabledWasPublishedWithPayload(TableNode $payloadTable) + public function theEventSubtreeTagWasRemovedWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); $streamName = ContentStreamEventStreamName::fromContentStreamId( @@ -106,16 +108,16 @@ public function theEventNodeAggregateWasEnabledWasPublishedWithPayload(TableNode : $this->currentContentStreamId ); - $this->publishEvent('NodeAggregateWasEnabled', $streamName->getEventStreamName(), $eventPayload); + $this->publishEvent('SubtreeTagWasRemoved', $streamName->getEventStreamName(), $eventPayload); } /** - * @Given /^the command EnableNodeAggregate is executed with payload:$/ + * @Given /^the command RemoveSubtreeTag is executed with payload:$/ * @param TableNode $payloadTable * @throws \Exception */ - public function theCommandEnableNodeAggregateIsExecutedWithPayload(TableNode $payloadTable): void + public function theCommandRemoveSubtreeTagIsExecutedWithPayload(TableNode $payloadTable): void { $commandArguments = $this->readPayloadTable($payloadTable); $contentStreamId = isset($commandArguments['contentStreamId']) @@ -125,24 +127,25 @@ public function theCommandEnableNodeAggregateIsExecutedWithPayload(TableNode $pa ? DimensionSpacePoint::fromArray($commandArguments['coveredDimensionSpacePoint']) : $this->currentDimensionSpacePoint; - $command = EnableNodeAggregate::create( + $command = RemoveSubtreeTag::create( $contentStreamId, NodeAggregateId::fromString($commandArguments['nodeAggregateId']), $coveredDimensionSpacePoint, NodeVariantSelectionStrategy::from($commandArguments['nodeVariantSelectionStrategy']), + SubtreeTag::fromString($commandArguments['tag']), ); $this->lastCommandOrEventResult = $this->currentContentRepository->handle($command); } /** - * @Given /^the command EnableNodeAggregate is executed with payload and exceptions are caught:$/ + * @Given /^the command RemoveSubtreeTag is executed with payload and exceptions are caught:$/ * @param TableNode $payloadTable */ - public function theCommandEnableNodeAggregateIsExecutedWithPayloadAndExceptionsAreCaught(TableNode $payloadTable): void + public function theCommandRemoveSubtreeTagIsExecutedWithPayloadAndExceptionsAreCaught(TableNode $payloadTable): void { try { - $this->theCommandEnableNodeAggregateIsExecutedWithPayload($payloadTable); + $this->theCommandRemoveSubtreeTagIsExecutedWithPayload($payloadTable); } catch (\Exception $exception) { $this->lastCommandException = $exception; } diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/GenericCommandExecutionAndEventPublication.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/GenericCommandExecutionAndEventPublication.php index 8f9680a2736..9d54708bd73 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/GenericCommandExecutionAndEventPublication.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/GenericCommandExecutionAndEventPublication.php @@ -21,11 +21,11 @@ use Neos\ContentRepository\Core\Feature\ContentStreamForking\Command\ForkContentStream; use Neos\ContentRepository\Core\Feature\NodeRenaming\Command\ChangeNodeAggregateName; use Neos\ContentRepository\Core\Feature\NodeCreation\Command\CreateNodeAggregateWithNodeAndSerializedProperties; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Command\DisableNodeAggregate; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Command\EnableNodeAggregate; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\Feature\NodeReferencing\Command\SetNodeReferences; use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetSerializedNodeProperties; +use Neos\ContentRepository\Core\Feature\Tagging\Command\AddSubtreeTag; +use Neos\ContentRepository\Core\Feature\Tagging\Command\RemoveSubtreeTag; use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Command\CreateRootWorkspace; use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Command\CreateWorkspace; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Command\PublishIndividualNodesFromWorkspace; @@ -104,8 +104,8 @@ protected static function resolveShortCommandName(string $shortCommandName): str 'ForkContentStream' => ForkContentStream::class, 'ChangeNodeAggregateName' => ChangeNodeAggregateName::class, 'SetSerializedNodeProperties' => SetSerializedNodeProperties::class, - 'DisableNodeAggregate' => DisableNodeAggregate::class, - 'EnableNodeAggregate' => EnableNodeAggregate::class, + 'AddSubtreeTag' => AddSubtreeTag::class, + 'RemoveSubtreeTag' => RemoveSubtreeTag::class, 'MoveNodeAggregate' => MoveNodeAggregate::class, 'SetNodeReferences' => SetNodeReferences::class, default => throw new \Exception( diff --git a/Neos.Neos/Classes/FrontendRouting/CatchUpHook/RouterCacheHook.php b/Neos.Neos/Classes/FrontendRouting/CatchUpHook/RouterCacheHook.php index 8477bb071e7..1306f75411c 100644 --- a/Neos.Neos/Classes/FrontendRouting/CatchUpHook/RouterCacheHook.php +++ b/Neos.Neos/Classes/FrontendRouting/CatchUpHook/RouterCacheHook.php @@ -2,6 +2,7 @@ namespace Neos\Neos\FrontendRouting\CatchUpHook; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasAdded; use Neos\ContentRepository\Core\Projection\CatchUpHookInterface; use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\EventStore\EventInterface; @@ -13,7 +14,6 @@ use Neos\ContentRepository\Core\Feature\NodeMove\Dto\CoverageNodeMoveMapping; use Neos\Neos\FrontendRouting\Projection\DocumentNodeInfo; use Neos\Neos\FrontendRouting\Exception\NodeNotFoundException; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasDisabled; use Neos\Flow\Mvc\Routing\RouterCachingService; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; @@ -43,7 +43,7 @@ public function onBeforeEvent(EventInterface $eventInstance, EventEnvelope $even NodeAggregateWasRemoved::class => $this->onBeforeNodeAggregateWasRemoved($eventInstance), NodePropertiesWereSet::class => $this->onBeforeNodePropertiesWereSet($eventInstance), NodeAggregateWasMoved::class => $this->onBeforeNodeAggregateWasMoved($eventInstance), - NodeAggregateWasDisabled::class => $this->onBeforeNodeAggregateWasDisabled($eventInstance), + SubtreeTagWasAdded::class => $this->onBeforeSubtreeTagWasAdded($eventInstance), default => null }; } @@ -54,7 +54,7 @@ public function onAfterEvent(EventInterface $eventInstance, EventEnvelope $event NodeAggregateWasRemoved::class => $this->flushAllCollectedTags(), NodePropertiesWereSet::class => $this->flushAllCollectedTags(), NodeAggregateWasMoved::class => $this->flushAllCollectedTags(), - NodeAggregateWasDisabled::class => $this->flushAllCollectedTags(), + SubtreeTagWasAdded::class => $this->flushAllCollectedTags(), default => null }; } @@ -69,7 +69,7 @@ public function onAfterCatchUp(): void // Nothing to do here } - private function onBeforeNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): void + private function onBeforeSubtreeTagWasAdded(SubtreeTagWasAdded $event): void { if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; diff --git a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php index cb4a3d2cf40..26c34ef8214 100644 --- a/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php +++ b/Neos.Neos/Classes/FrontendRouting/Projection/DocumentUriPathProjection.php @@ -15,8 +15,6 @@ use Neos\ContentRepository\Core\Feature\DimensionSpaceAdjustment\Event\DimensionShineThroughWasAdded; use Neos\ContentRepository\Core\Feature\DimensionSpaceAdjustment\Event\DimensionSpacePointWasMoved; use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasDisabled; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasEnabled; use Neos\ContentRepository\Core\Feature\NodeModification\Event\NodePropertiesWereSet; use Neos\ContentRepository\Core\Feature\NodeMove\Dto\CoverageNodeMoveMapping; use Neos\ContentRepository\Core\Feature\NodeMove\Dto\ParentNodeMoveDestination; @@ -29,6 +27,8 @@ use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodeSpecializationVariantWasCreated; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateDimensionsWereUpdated; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Event\RootNodeAggregateWithNodeWasCreated; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasAdded; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasRemoved; use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Event\RootWorkspaceWasCreated; use Neos\ContentRepository\Core\NodeType\NodeTypeManager; use Neos\ContentRepository\Core\NodeType\NodeTypeName; @@ -122,8 +122,8 @@ public function canHandle(EventInterface $event): bool NodePeerVariantWasCreated::class, NodeGeneralizationVariantWasCreated::class, NodeSpecializationVariantWasCreated::class, - NodeAggregateWasDisabled::class, - NodeAggregateWasEnabled::class, + SubtreeTagWasAdded::class, + SubtreeTagWasRemoved::class, NodeAggregateWasRemoved::class, NodePropertiesWereSet::class, NodeAggregateWasMoved::class, @@ -143,8 +143,8 @@ public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void NodePeerVariantWasCreated::class => $this->whenNodePeerVariantWasCreated($event), NodeGeneralizationVariantWasCreated::class => $this->whenNodeGeneralizationVariantWasCreated($event), NodeSpecializationVariantWasCreated::class => $this->whenNodeSpecializationVariantWasCreated($event), - NodeAggregateWasDisabled::class => $this->whenNodeAggregateWasDisabled($event), - NodeAggregateWasEnabled::class => $this->whenNodeAggregateWasEnabled($event), + SubtreeTagWasAdded::class => $this->whenSubtreeTagWasAdded($event), + SubtreeTagWasRemoved::class => $this->whenSubtreeTagWasRemoved($event), NodeAggregateWasRemoved::class => $this->whenNodeAggregateWasRemoved($event), NodePropertiesWereSet::class => $this->whenNodePropertiesWereSet($event, $eventEnvelope), NodeAggregateWasMoved::class => $this->whenNodeAggregateWasMoved($event), @@ -423,7 +423,7 @@ private function copyVariants( } } - private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): void + private function whenSubtreeTagWasAdded(SubtreeTagWasAdded $event): void { if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; @@ -454,7 +454,7 @@ private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): } } - private function whenNodeAggregateWasEnabled(NodeAggregateWasEnabled $event): void + private function whenSubtreeTagWasRemoved(SubtreeTagWasRemoved $event): void { if (!$this->getState()->isLiveContentStream($event->contentStreamId)) { return; diff --git a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php index 4f4a640b9b3..00579386e90 100644 --- a/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php +++ b/Neos.Neos/Classes/PendingChangesProjection/ChangeProjection.php @@ -24,8 +24,6 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\DimensionSpaceAdjustment\Event\DimensionSpacePointWasMoved; use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasDisabled; -use Neos\ContentRepository\Core\Feature\NodeDisabling\Event\NodeAggregateWasEnabled; use Neos\ContentRepository\Core\Feature\NodeModification\Event\NodePropertiesWereSet; use Neos\ContentRepository\Core\Feature\NodeMove\Event\NodeAggregateWasMoved; use Neos\ContentRepository\Core\Feature\NodeReferencing\Event\NodeReferencesWereSet; @@ -33,6 +31,8 @@ use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodeGeneralizationVariantWasCreated; use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodePeerVariantWasCreated; use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodeSpecializationVariantWasCreated; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasAdded; +use Neos\ContentRepository\Core\Feature\Tagging\Event\SubtreeTagWasRemoved; use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Event\RootWorkspaceWasCreated; use Neos\ContentRepository\Core\Infrastructure\DbalClientInterface; use Neos\ContentRepository\Core\Projection\ProjectionInterface; @@ -168,8 +168,8 @@ public function canHandle(EventInterface $event): bool NodePropertiesWereSet::class, NodeReferencesWereSet::class, NodeAggregateWithNodeWasCreated::class, - NodeAggregateWasDisabled::class, - NodeAggregateWasEnabled::class, + SubtreeTagWasAdded::class, + SubtreeTagWasRemoved::class, NodeAggregateWasRemoved::class, DimensionSpacePointWasMoved::class, NodeGeneralizationVariantWasCreated::class, @@ -186,8 +186,8 @@ public function apply(EventInterface $event, EventEnvelope $eventEnvelope): void NodePropertiesWereSet::class => $this->whenNodePropertiesWereSet($event), NodeReferencesWereSet::class => $this->whenNodeReferencesWereSet($event), NodeAggregateWithNodeWasCreated::class => $this->whenNodeAggregateWithNodeWasCreated($event), - NodeAggregateWasDisabled::class => $this->whenNodeAggregateWasDisabled($event), - NodeAggregateWasEnabled::class => $this->whenNodeAggregateWasEnabled($event), + SubtreeTagWasAdded::class => $this->whenSubtreeTagWasAdded($event), + SubtreeTagWasRemoved::class => $this->whenSubtreeTagWasRemoved($event), NodeAggregateWasRemoved::class => $this->whenNodeAggregateWasRemoved($event), DimensionSpacePointWasMoved::class => $this->whenDimensionSpacePointWasMoved($event), NodeSpecializationVariantWasCreated::class => $this->whenNodeSpecializationVariantWasCreated($event), @@ -272,7 +272,7 @@ private function whenNodeAggregateWithNodeWasCreated(NodeAggregateWithNodeWasCre ); } - private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): void + private function whenSubtreeTagWasAdded(SubtreeTagWasAdded $event): void { foreach ($event->affectedDimensionSpacePoints as $dimensionSpacePoint) { $this->markAsChanged( @@ -283,7 +283,7 @@ private function whenNodeAggregateWasDisabled(NodeAggregateWasDisabled $event): } } - private function whenNodeAggregateWasEnabled(NodeAggregateWasEnabled $event): void + private function whenSubtreeTagWasRemoved(SubtreeTagWasRemoved $event): void { foreach ($event->affectedDimensionSpacePoints as $dimensionSpacePoint) { $this->markAsChanged( diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/DisableNodes.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/DisableNodes.feature index bd6b2db93ed..04ad8433077 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/DisableNodes.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/DisableNodes.feature @@ -70,23 +70,25 @@ Feature: Routing behavior of removed, disabled and re-enabled nodes And The documenturipath projection is up to date Scenario: Disable leaf node - When the command "DisableNodeAggregate" is executed with payload: + When the command "AddSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "leaf-mc-node" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And The documenturipath projection is up to date Then No node should match URL "/david-nodenborough/earl-document/leaf" And The node "leaf-mc-node" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough/earl-document/leaf" Scenario: Disable node with child nodes - When the command "DisableNodeAggregate" is executed with payload: + When the command "AddSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And The documenturipath projection is up to date Then No node should match URL "/david-nodenborough" And No node should match URL "/david-nodenborough/earl-document" @@ -94,30 +96,33 @@ Feature: Routing behavior of removed, disabled and re-enabled nodes And The node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough/earl-document" Scenario: Disable two nodes, re-enable the higher one - When the command "DisableNodeAggregate" is executed with payload: + When the command "AddSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | - And the command "DisableNodeAggregate" is executed with payload: + | tag | "disabled" | + And the command "AddSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "earl-o-documentbourgh" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date And The documenturipath projection is up to date Then No node should match URL "/david-nodenborough" And No node should match URL "/david-nodenborough/earl-document" And The node "sir-david-nodenborough" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough" And The node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough/earl-document" - When the command "EnableNodeAggregate" is executed with payload: + When the command "RemoveSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date And The documenturipath projection is up to date When I am on URL "/david-nodenborough" @@ -127,30 +132,33 @@ Feature: Routing behavior of removed, disabled and re-enabled nodes And The node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough/earl-document" Scenario: Disable two nodes, re-enable the lower one - When the command "DisableNodeAggregate" is executed with payload: + When the command "AddSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | - And the command "DisableNodeAggregate" is executed with payload: + | tag | "disabled" | + And the command "AddSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "earl-o-documentbourgh" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date And The documenturipath projection is up to date Then No node should match URL "/david-nodenborough" And No node should match URL "/david-nodenborough/earl-document" And The node "sir-david-nodenborough" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough" And The node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough/earl-document" - When the command "EnableNodeAggregate" is executed with payload: + When the command "RemoveSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "earl-o-documentbourgh" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date And The documenturipath projection is up to date Then No node should match URL "/david-nodenborough" @@ -159,29 +167,32 @@ Feature: Routing behavior of removed, disabled and re-enabled nodes And The node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough/earl-document" Scenario: Disable the same node twice - When the command "DisableNodeAggregate" is executed with payload: + When the command "AddSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | - And the event NodeAggregateWasDisabled was published with payload: + | tag | "disabled" | + And the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{}] | + | tag | "disabled" | And the graph projection is fully up to date And The documenturipath projection is up to date Then No node should match URL "/david-nodenborough" And No node should match URL "/david-nodenborough/earl-document" And The node "sir-david-nodenborough" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough" And The node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough/earl-document" - When the command "EnableNodeAggregate" is executed with payload: + When the command "RemoveSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date And The documenturipath projection is up to date When I am on URL "/david-nodenborough" @@ -190,13 +201,14 @@ Feature: Routing behavior of removed, disabled and re-enabled nodes And The node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough/earl-document" Scenario: Re-enable the same node twice - When the command "DisableNodeAggregate" is executed with payload: + When the command "AddSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | - And the event NodeAggregateWasDisabled was published with payload: + | tag | "disabled" | + And the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "earl-o-documentbourgh" | @@ -207,17 +219,19 @@ Feature: Routing behavior of removed, disabled and re-enabled nodes And No node should match URL "/david-nodenborough/earl-document" And The node "sir-david-nodenborough" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough" And The node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough/earl-document" - When the command "EnableNodeAggregate" is executed with payload: + When the command "RemoveSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | - And the event NodeAggregateWasEnabled was published with payload: + | tag | "disabled" | + And the event SubtreeTagWasAdded was published with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{}] | + | tag | "disabled" | And the graph projection is fully up to date And The documenturipath projection is up to date When I am on URL "/david-nodenborough" @@ -226,12 +240,13 @@ Feature: Routing behavior of removed, disabled and re-enabled nodes And The node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/david-nodenborough/earl-document" Scenario: Move implicit disabled node - When the command "DisableNodeAggregate" is executed with payload: + When the command "AddSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date When the command MoveNodeAggregate is executed with payload: | Key | Value | @@ -245,12 +260,13 @@ Feature: Routing behavior of removed, disabled and re-enabled nodes Then the matched node should be "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}" Scenario: Move explicit disabled node - When the command "DisableNodeAggregate" is executed with payload: + When the command "AddSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "earl-o-documentbourgh" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date When the command MoveNodeAggregate is executed with payload: | Key | Value | @@ -264,22 +280,24 @@ Feature: Routing behavior of removed, disabled and re-enabled nodes And The node "leaf-mc-node" in content stream "cs-identifier" and dimension "{}" should resolve to URL "/nody/earl-document/leaf" Scenario: Add child node underneath disabled node and re-enable parent (see https://github.com/neos/neos-development-collection/issues/4639) - When the command "DisableNodeAggregate" is executed with payload: + When the command "AddSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And the graph projection is fully up to date When the following CreateNodeAggregateWithNode commands are executed: | nodeAggregateId | parentNodeAggregateId | nodeTypeName | initialPropertyValues | | nody-mc-nodeface-child | nody-mc-nodeface | Neos.Neos:Test.Routing.Page | {"uriPathSegment": "nody-child"} | And The documenturipath projection is up to date - When the command "EnableNodeAggregate" is executed with payload: + When the command "RemoveSubtreeTag" is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | When I am on URL "/nody/nody-child" Then the matched node should be "nody-mc-nodeface-child" in content stream "cs-identifier" and dimension "{}" diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/RouteCache.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/RouteCache.feature index 0831200f2fd..b04ae0db12f 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/RouteCache.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/RouteCache.feature @@ -142,12 +142,13 @@ Feature: Route cache invalidation And The URL "/david-nodenborough" should match the node "sir-david-nodenborough" in content stream "cs-identifier" and dimension "{}" And The URL "/david-nodenborough/earl-document" should match the node "earl-o-documentbourgh" in content stream "cs-identifier" and dimension "{}" - When the command DisableNodeAggregate is executed with payload: + When the command AddSubtreeTag is executed with payload: | Key | Value | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | coveredDimensionSpacePoint | {} | | nodeVariantSelectionStrategy | "allVariants" | + | tag | "disabled" | And The documenturipath projection is up to date Then No node should match URL "/david-nodenborough"