From 6f3be988246c31b06f0af3f1318b523887ecad24 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 19 Apr 2024 10:56:30 +0200 Subject: [PATCH 01/17] WIP: FEATURE: Add `workspaceName` to relevant events Resolves: #4996 --- .../Command/PerformanceMeasurementService.php | 4 +++ .../Classes/EventStore/EventNormalizer.php | 4 +-- .../EmbedsContentStreamAndNodeAggregateId.php | 2 ++ .../Common/NodeAggregateEventPublisher.php | 4 +-- .../Feature/Common/NodeVariationInternals.php | 21 +++++++++++++- ...Interface.php => PublishableInterface.php} | 7 +++-- .../Feature/Common/TetheredNodeInternals.php | 6 ++++ .../DimensionSpaceCommandHandler.php | 2 ++ .../Event/DimensionShineThroughWasAdded.php | 15 ++++++++-- .../Event/DimensionSpacePointWasMoved.php | 15 ++++++++-- .../Event/NodeAggregateWithNodeWasCreated.php | 15 ++++++++-- .../Feature/NodeCreation/NodeCreation.php | 2 ++ .../Event/NodeAggregateWasDisabled.php | 15 ++++++++-- .../Event/NodeAggregateWasEnabled.php | 15 ++++++++-- .../Feature/NodeDisabling/NodeDisabling.php | 2 ++ .../NodeDuplicationCommandHandler.php | 5 ++++ .../Event/NodePropertiesWereSet.php | 16 ++++++++-- .../NodeModification/NodeModification.php | 2 ++ .../NodeMove/Event/NodeAggregateWasMoved.php | 15 ++++++++-- .../Classes/Feature/NodeMove/NodeMove.php | 1 + .../Event/NodeReferencesWereSet.php | 29 ++++++++++++------- .../NodeReferencing/NodeReferencing.php | 1 + .../Event/NodeAggregateWasRemoved.php | 15 ++++++++-- .../Feature/NodeRemoval/NodeRemoval.php | 1 + .../Event/NodeAggregateNameWasChanged.php | 15 ++++++++-- .../Feature/NodeRenaming/NodeRenaming.php | 1 + .../Event/NodeAggregateTypeWasChanged.php | 15 ++++++++-- .../Feature/NodeTypeChange/NodeTypeChange.php | 3 ++ .../NodeGeneralizationVariantWasCreated.php | 18 ++++++++---- .../Event/NodePeerVariantWasCreated.php | 15 ++++++++-- .../NodeSpecializationVariantWasCreated.php | 15 ++++++++-- .../Feature/NodeVariation/NodeVariation.php | 1 + ...RootNodeAggregateDimensionsWereUpdated.php | 15 ++++++++-- .../RootNodeAggregateWithNodeWasCreated.php | 15 ++++++++-- .../RootNodeCreation/RootNodeHandling.php | 9 ++++++ .../SubtreeTagging/Event/SubtreeWasTagged.php | 15 ++++++++-- .../Event/SubtreeWasUntagged.php | 15 ++++++++-- .../Feature/SubtreeTagging/SubtreeTagging.php | 2 ++ .../Feature/WorkspaceCommandHandler.php | 9 ++++-- .../Classes/NodeDataToEventsProcessor.php | 16 ++++++++-- .../DisallowedChildNodeAdjustment.php | 2 ++ .../src/Adjustment/PropertyAdjustment.php | 2 ++ .../Adjustment/RemoveNodeAggregateTrait.php | 2 ++ .../Adjustment/TetheredNodeAdjustments.php | 4 +++ 44 files changed, 326 insertions(+), 77 deletions(-) rename Neos.ContentRepository.Core/Classes/Feature/Common/{PublishableToOtherContentStreamsInterface.php => PublishableInterface.php} (77%) diff --git a/Neos.ContentRepository.BehavioralTests/Classes/Command/PerformanceMeasurementService.php b/Neos.ContentRepository.BehavioralTests/Classes/Command/PerformanceMeasurementService.php index 586c895e700..21c344d2f9d 100644 --- a/Neos.ContentRepository.BehavioralTests/Classes/Command/PerformanceMeasurementService.php +++ b/Neos.ContentRepository.BehavioralTests/Classes/Command/PerformanceMeasurementService.php @@ -45,6 +45,7 @@ class PerformanceMeasurementService implements ContentRepositoryServiceInterface { private ContentStreamId $contentStreamId; + private WorkspaceName $workspaceName; private DimensionSpacePointSet $dimensionSpacePoints; private ContentStreamEventStreamName $contentStreamEventStream; @@ -55,6 +56,7 @@ public function __construct( private readonly ContentRepositoryId $contentRepositoryId ) { $this->contentStreamId = contentStreamId::fromString('cs-identifier'); + $this->workspaceName = WorkspaceName::fromString('some-workspace'); $this->dimensionSpacePoints = new DimensionSpacePointSet([ DimensionSpacePoint::fromArray(['language' => 'mul']), DimensionSpacePoint::fromArray(['language' => 'de']), @@ -86,6 +88,7 @@ public function createNodesForPerformanceTest(int $nodesPerLevel, int $levels): $rootNodeAggregateId = nodeAggregateId::fromString('lady-eleonode-rootford'); $rootNodeAggregateWasCreated = new RootNodeAggregateWithNodeWasCreated( + $this->workspaceName, $this->contentStreamId, $rootNodeAggregateId, NodeTypeName::fromString('Neos.ContentRepository:Root'), @@ -129,6 +132,7 @@ private function createHierarchy( for ($i = 0; $i < $numberOfNodes; $i++) { $nodeAggregateId = nodeAggregateId::create(); $events[] = new NodeAggregateWithNodeWasCreated( + $this->workspaceName, $this->contentStreamId, $nodeAggregateId, NodeTypeName::fromString('Neos.ContentRepository:Testing'), diff --git a/Neos.ContentRepository.Core/Classes/EventStore/EventNormalizer.php b/Neos.ContentRepository.Core/Classes/EventStore/EventNormalizer.php index bd25c64b498..d4977e7543c 100644 --- a/Neos.ContentRepository.Core/Classes/EventStore/EventNormalizer.php +++ b/Neos.ContentRepository.Core/Classes/EventStore/EventNormalizer.php @@ -172,8 +172,8 @@ public function denormalize(Event $event): EventInterface $eventInstance = $eventClassName::fromArray($eventDataAsArray); return match ($eventInstance::class) { // upcast disabled / enabled events to the corresponding SubtreeTag events - NodeAggregateWasDisabled::class => new SubtreeWasTagged($eventInstance->contentStreamId, $eventInstance->nodeAggregateId, $eventInstance->affectedDimensionSpacePoints, SubtreeTag::disabled()), - NodeAggregateWasEnabled::class => new SubtreeWasUntagged($eventInstance->contentStreamId, $eventInstance->nodeAggregateId, $eventInstance->affectedDimensionSpacePoints, SubtreeTag::disabled()), + NodeAggregateWasDisabled::class => new SubtreeWasTagged($eventInstance->workspaceName, $eventInstance->contentStreamId, $eventInstance->nodeAggregateId, $eventInstance->affectedDimensionSpacePoints, SubtreeTag::disabled()), + NodeAggregateWasEnabled::class => new SubtreeWasUntagged($eventInstance->workspaceName, $eventInstance->contentStreamId, $eventInstance->nodeAggregateId, $eventInstance->affectedDimensionSpacePoints, SubtreeTag::disabled()), default => $eventInstance, }; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php b/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php index 7c8ab207d76..e6a807d9336 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php @@ -16,6 +16,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * This interface is implemented by **events** which contain ContentStreamId and NodeAggregateId. @@ -26,6 +27,7 @@ */ interface EmbedsContentStreamAndNodeAggregateId { + public function getWorkspaceName(): WorkspaceName; public function getContentStreamId(): ContentStreamId; public function getNodeAggregateId(): NodeAggregateId; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/NodeAggregateEventPublisher.php b/Neos.ContentRepository.Core/Classes/Feature/Common/NodeAggregateEventPublisher.php index b9e1112c008..8d01935f55e 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/NodeAggregateEventPublisher.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/NodeAggregateEventPublisher.php @@ -38,13 +38,13 @@ public static function enrichWithCommand( foreach ($events as $event) { if ($event instanceof DecoratedEvent) { $undecoratedEvent = $event->innerEvent; - if (!$undecoratedEvent instanceof PublishableToOtherContentStreamsInterface) { + if (!$undecoratedEvent instanceof PublishableInterface) { throw new \RuntimeException(sprintf( 'TODO: Event %s has to implement PublishableToOtherContentStreamsInterface', get_class($event) )); } - } elseif (!$event instanceof PublishableToOtherContentStreamsInterface) { + } elseif (!$event instanceof PublishableInterface) { throw new \RuntimeException(sprintf( 'TODO: Event %s has to implement PublishableToOtherContentStreamsInterface', get_class($event) diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/NodeVariationInternals.php b/Neos.ContentRepository.Core/Classes/Feature/Common/NodeVariationInternals.php index 54b8d0a60e2..8375faa3f55 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/NodeVariationInternals.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/NodeVariationInternals.php @@ -24,11 +24,11 @@ use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodePeerVariantWasCreated; use Neos\ContentRepository\Core\Feature\NodeVariation\Event\NodeSpecializationVariantWasCreated; use Neos\ContentRepository\Core\Projection\ContentGraph\Filter\FindSucceedingSiblingNodesFilter; -use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate; use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * @internal implementation details of command handlers @@ -38,6 +38,7 @@ trait NodeVariationInternals abstract protected function getInterDimensionalVariationGraph(): DimensionSpace\InterDimensionalVariationGraph; protected function createEventsForVariations( + WorkspaceName $workspaceName, ContentStreamId $contentStreamId, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, @@ -51,6 +52,7 @@ protected function createEventsForVariations( ) ) { DimensionSpace\VariantType::TYPE_SPECIALIZATION => $this->handleCreateNodeSpecializationVariant( + $workspaceName, $contentStreamId, $sourceOrigin, $targetOrigin, @@ -58,6 +60,7 @@ protected function createEventsForVariations( $contentRepository ), DimensionSpace\VariantType::TYPE_GENERALIZATION => $this->handleCreateNodeGeneralizationVariant( + $workspaceName, $contentStreamId, $sourceOrigin, $targetOrigin, @@ -65,6 +68,7 @@ protected function createEventsForVariations( $contentRepository ), default => $this->handleCreateNodePeerVariant( + $workspaceName, $contentStreamId, $sourceOrigin, $targetOrigin, @@ -75,6 +79,7 @@ protected function createEventsForVariations( } protected function handleCreateNodeSpecializationVariant( + WorkspaceName $workspaceName, ContentStreamId $contentStreamId, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, @@ -83,6 +88,7 @@ protected function handleCreateNodeSpecializationVariant( ): Events { $specializationVisibility = $this->calculateEffectiveVisibility($targetOrigin, $nodeAggregate); $events = $this->collectNodeSpecializationVariantsThatWillHaveBeenCreated( + $workspaceName, $contentStreamId, $sourceOrigin, $targetOrigin, @@ -100,6 +106,7 @@ protected function handleCreateNodeSpecializationVariant( * @return array */ protected function collectNodeSpecializationVariantsThatWillHaveBeenCreated( + WorkspaceName $workspaceName, ContentStreamId $contentStreamId, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, @@ -109,6 +116,7 @@ protected function collectNodeSpecializationVariantsThatWillHaveBeenCreated( ContentRepository $contentRepository ): array { $events[] = new NodeSpecializationVariantWasCreated( + $workspaceName, $contentStreamId, $nodeAggregate->nodeAggregateId, $sourceOrigin, @@ -129,6 +137,7 @@ protected function collectNodeSpecializationVariantsThatWillHaveBeenCreated( ) as $tetheredChildNodeAggregate ) { $events = $this->collectNodeSpecializationVariantsThatWillHaveBeenCreated( + $workspaceName, $contentStreamId, $sourceOrigin, $targetOrigin, @@ -143,6 +152,7 @@ protected function collectNodeSpecializationVariantsThatWillHaveBeenCreated( } protected function handleCreateNodeGeneralizationVariant( + WorkspaceName $workspaceName, ContentStreamId $contentStreamId, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, @@ -151,6 +161,7 @@ protected function handleCreateNodeGeneralizationVariant( ): Events { $generalizationVisibility = $this->calculateEffectiveVisibility($targetOrigin, $nodeAggregate); $events = $this->collectNodeGeneralizationVariantsThatWillHaveBeenCreated( + $workspaceName, $contentStreamId, $sourceOrigin, $targetOrigin, @@ -168,6 +179,7 @@ protected function handleCreateNodeGeneralizationVariant( * @return array */ protected function collectNodeGeneralizationVariantsThatWillHaveBeenCreated( + WorkspaceName $workspaceName, ContentStreamId $contentStreamId, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, @@ -177,6 +189,7 @@ protected function collectNodeGeneralizationVariantsThatWillHaveBeenCreated( ContentRepository $contentRepository ): array { $events[] = new NodeGeneralizationVariantWasCreated( + $workspaceName, $contentStreamId, $nodeAggregate->nodeAggregateId, $sourceOrigin, @@ -197,6 +210,7 @@ protected function collectNodeGeneralizationVariantsThatWillHaveBeenCreated( ) as $tetheredChildNodeAggregate ) { $events = $this->collectNodeGeneralizationVariantsThatWillHaveBeenCreated( + $workspaceName, $contentStreamId, $sourceOrigin, $targetOrigin, @@ -211,6 +225,7 @@ protected function collectNodeGeneralizationVariantsThatWillHaveBeenCreated( } protected function handleCreateNodePeerVariant( + WorkspaceName $workspaceName, ContentStreamId $contentStreamId, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, @@ -219,6 +234,7 @@ protected function handleCreateNodePeerVariant( ): Events { $peerVisibility = $this->calculateEffectiveVisibility($targetOrigin, $nodeAggregate); $events = $this->collectNodePeerVariantsThatWillHaveBeenCreated( + $workspaceName, $contentStreamId, $sourceOrigin, $targetOrigin, @@ -236,6 +252,7 @@ protected function handleCreateNodePeerVariant( * @return array */ protected function collectNodePeerVariantsThatWillHaveBeenCreated( + WorkspaceName $workspaceName, ContentStreamId $contentStreamId, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, @@ -245,6 +262,7 @@ protected function collectNodePeerVariantsThatWillHaveBeenCreated( ContentRepository $contentRepository ): array { $events[] = new NodePeerVariantWasCreated( + $workspaceName, $contentStreamId, $nodeAggregate->nodeAggregateId, $sourceOrigin, @@ -265,6 +283,7 @@ protected function collectNodePeerVariantsThatWillHaveBeenCreated( ) as $tetheredChildNodeAggregate ) { $events = $this->collectNodePeerVariantsThatWillHaveBeenCreated( + $workspaceName, $contentStreamId, $sourceOrigin, $targetOrigin, diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/PublishableToOtherContentStreamsInterface.php b/Neos.ContentRepository.Core/Classes/Feature/Common/PublishableInterface.php similarity index 77% rename from Neos.ContentRepository.Core/Classes/Feature/Common/PublishableToOtherContentStreamsInterface.php rename to Neos.ContentRepository.Core/Classes/Feature/Common/PublishableInterface.php index 5b90e1f10c5..8ff4eb691bd 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/PublishableToOtherContentStreamsInterface.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/PublishableInterface.php @@ -15,9 +15,10 @@ namespace Neos\ContentRepository\Core\Feature\Common; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** - * This interface is implemented by **events** which can be published to different content streams. + * This interface is implemented by **events** which can be published to different workspaces. * * Reminder: Event Publishing to a target content stream can not fail if the source content stream is based * on the target content stream, and no events have been committed to the target content stream in @@ -25,7 +26,7 @@ * * @internal used internally for the publishing mechanism of content streams */ -interface PublishableToOtherContentStreamsInterface +interface PublishableInterface { - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self; + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php b/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php index 5d2a01fce2d..09308a3439b 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php @@ -29,6 +29,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * @internal implementation details of command handlers @@ -40,6 +41,7 @@ trait TetheredNodeInternals abstract protected function getPropertyConverter(): PropertyConverter; abstract protected function createEventsForVariations( + WorkspaceName $workspaceName, ContentStreamId $contentStreamId, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin, @@ -88,6 +90,7 @@ protected function createEventsForMissingTetheredNode( $rootGeneralizationOrigin = OriginDimensionSpacePoint::fromDimensionSpacePoint($rootGeneralization); if ($creationOriginDimensionSpacePoint) { $events[] = new NodePeerVariantWasCreated( + WorkspaceName::fromString('todo'), // TODO read from $parentNodeAggregate $parentNodeAggregate->contentStreamId, $tetheredNodeAggregateId, $creationOriginDimensionSpacePoint, @@ -98,6 +101,7 @@ protected function createEventsForMissingTetheredNode( ); } else { $events[] = new NodeAggregateWithNodeWasCreated( + WorkspaceName::fromString('todo'), // TODO read from $parentNodeAggregate $parentNodeAggregate->contentStreamId, $tetheredNodeAggregateId, $expectedTetheredNodeType->name, @@ -117,6 +121,7 @@ protected function createEventsForMissingTetheredNode( } else { return Events::with( new NodeAggregateWithNodeWasCreated( + WorkspaceName::fromString('todo'), // TODO read from $parentNodeAggregate $parentNodeAggregate->contentStreamId, $tetheredNodeAggregateId ?: NodeAggregateId::create(), $expectedTetheredNodeType->name, @@ -149,6 +154,7 @@ protected function createEventsForMissingTetheredNode( } /** @var Node $childNodeSource Node aggregates are never empty */ return $this->createEventsForVariations( + WorkspaceName::fromString('todo'), // TODO read from $parentNodeAggregate $parentNodeAggregate->contentStreamId, $childNodeSource->originDimensionSpacePoint, $originDimensionSpacePoint, diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/DimensionSpaceCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/DimensionSpaceCommandHandler.php index ca0b66861b4..0bb2b8020c4 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/DimensionSpaceCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/DimensionSpaceCommandHandler.php @@ -82,6 +82,7 @@ private function handleMoveDimensionSpacePoint( $streamName, Events::with( new DimensionSpacePointWasMoved( + $command->workspaceName, $contentStreamId, $command->source, $command->target @@ -112,6 +113,7 @@ private function handleAddDimensionShineThrough( $streamName, Events::with( new DimensionShineThroughWasAdded( + $command->workspaceName, $contentStreamId, $command->source, $command->target diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php index 15484ec7356..93720a485d1 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php @@ -16,8 +16,9 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; -use Neos\ContentRepository\Core\Feature\Common\PublishableToOtherContentStreamsInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * Add a Dimension Space Point Shine-Through; @@ -32,18 +33,25 @@ * * @api events are the persistence-API of the content repository */ -final readonly class DimensionShineThroughWasAdded implements EventInterface, PublishableToOtherContentStreamsInterface +final readonly class DimensionShineThroughWasAdded implements EventInterface, PublishableInterface { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public DimensionSpacePoint $source, public DimensionSpacePoint $target ) { } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->source, $this->target @@ -53,6 +61,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): self { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), DimensionSpacePoint::fromArray($values['source']), DimensionSpacePoint::fromArray($values['target']) diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php index f2d7a4eb923..b7fa685ca95 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php @@ -16,8 +16,9 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; -use Neos\ContentRepository\Core\Feature\Common\PublishableToOtherContentStreamsInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * Moved a dimension space point to a new location; basically moving all content to the new dimension space point. @@ -28,18 +29,25 @@ * * @api events are the persistence-API of the content repository */ -final readonly class DimensionSpacePointWasMoved implements EventInterface, PublishableToOtherContentStreamsInterface +final readonly class DimensionSpacePointWasMoved implements EventInterface, PublishableInterface { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public DimensionSpacePoint $source, public DimensionSpacePoint $target ) { } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->source, $this->target @@ -49,6 +57,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): self { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), DimensionSpacePoint::fromArray($values['source']), DimensionSpacePoint::fromArray($values['target']) diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php index b9ca1d1993a..edd7a0b33a9 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php @@ -19,13 +19,14 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; -use Neos\ContentRepository\Core\Feature\Common\PublishableToOtherContentStreamsInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * A node aggregate with its initial node was created @@ -34,10 +35,11 @@ */ final readonly class NodeAggregateWithNodeWasCreated implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public NodeTypeName $nodeTypeName, @@ -50,6 +52,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -65,9 +72,10 @@ public function getOriginDimensionSpacePoint(): OriginDimensionSpacePoint return $this->originDimensionSpacePoint; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->nodeTypeName, @@ -83,6 +91,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): self { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), NodeTypeName::fromString($values['nodeTypeName']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php index b1000b3a34e..64b225b729d 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php @@ -238,6 +238,7 @@ private function createRegularWithNode( ContentRepository $contentRepository, ): NodeAggregateWithNodeWasCreated { return new NodeAggregateWithNodeWasCreated( + $command->workspaceName, $contentStreamId, $command->nodeAggregateId, $command->nodeTypeName, @@ -283,6 +284,7 @@ private function handleTetheredChildNodes( $initialPropertyValues = SerializedPropertyValues::defaultFromNodeType($childNodeType, $this->getPropertyConverter()); $events[] = new NodeAggregateWithNodeWasCreated( + $command->workspaceName, $contentStreamId, $childNodeAggregateId, $childNodeType->name, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php index 410ba440eea..41d079112b8 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php @@ -17,10 +17,11 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; 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\Common\PublishableInterface; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasTagged; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * A node aggregate was disabled @@ -30,10 +31,11 @@ */ final readonly class NodeAggregateWasDisabled implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, /** The dimension space points the node aggregate was disabled in */ @@ -41,6 +43,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -51,9 +58,10 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->affectedDimensionSpacePoints, @@ -63,6 +71,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): EventInterface { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), DimensionSpacePointSet::fromArray($values['affectedDimensionSpacePoints']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php index 74f6a961339..e51ee340a39 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php @@ -18,10 +18,11 @@ 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\Common\PublishableInterface; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasUntagged; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * A node aggregate was enabled @@ -31,16 +32,22 @@ */ final readonly class NodeAggregateWasEnabled implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public DimensionSpacePointSet $affectedDimensionSpacePoints, ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -51,9 +58,10 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->affectedDimensionSpacePoints, @@ -63,6 +71,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): EventInterface { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), DimensionSpacePointSet::fromArray($values['affectedDimensionSpacePoints']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/NodeDisabling.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/NodeDisabling.php index eca096a52c7..f5d7b99730b 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/NodeDisabling.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/NodeDisabling.php @@ -74,6 +74,7 @@ private function handleDisableNodeAggregate( $events = Events::with( new SubtreeWasTagged( + $command->workspaceName, $contentStreamId, $command->nodeAggregateId, $affectedDimensionSpacePoints, @@ -129,6 +130,7 @@ public function handleEnableNodeAggregate( $events = Events::with( new SubtreeWasUntagged( + $command->workspaceName, $contentStreamId, $command->nodeAggregateId, $affectedDimensionSpacePoints, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/NodeDuplicationCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/NodeDuplicationCommandHandler.php index d88df293eab..e8298f82126 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/NodeDuplicationCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/NodeDuplicationCommandHandler.php @@ -36,6 +36,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * @internal from userland, you'll use ContentRepository::handle to dispatch commands @@ -151,6 +152,7 @@ private function handleCopyNodesRecursively( // Now, we can start creating the recursive structure. $events = []; $this->createEventsForNodeToInsert( + $command->workspaceName, $contentStreamId, $command->targetDimensionSpacePoint, $coveredDimensionSpacePoints, @@ -193,6 +195,7 @@ private function requireNewNodeAggregateIdsToNotExist( * @param array $events */ private function createEventsForNodeToInsert( + WorkspaceName $workspaceName, ContentStreamId $contentStreamId, OriginDimensionSpacePoint $originDimensionSpacePoint, DimensionSpacePointSet $coveredDimensionSpacePoints, @@ -205,6 +208,7 @@ private function createEventsForNodeToInsert( array &$events, ): void { $events[] = new NodeAggregateWithNodeWasCreated( + $workspaceName, $contentStreamId, $nodeAggregateIdMapping->getNewNodeAggregateId( $nodeToInsert->nodeAggregateId @@ -228,6 +232,7 @@ private function createEventsForNodeToInsert( foreach ($nodeToInsert->childNodes as $childNodeToInsert) { $this->createEventsForNodeToInsert( + $workspaceName, $contentStreamId, $originDimensionSpacePoint, $coveredDimensionSpacePoints, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php index 2b50a230ac9..b8a2e1e0331 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php @@ -18,11 +18,12 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; 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\Common\PublishableInterface; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\PropertyNames; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * When a node property is changed, this event is triggered. @@ -37,10 +38,11 @@ */ final readonly class NodePropertiesWereSet implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public OriginDimensionSpacePoint $originDimensionSpacePoint, @@ -51,6 +53,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -66,9 +73,10 @@ public function getOriginDimensionSpacePoint(): OriginDimensionSpacePoint return $this->originDimensionSpacePoint; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->originDimensionSpacePoint, @@ -81,6 +89,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public function mergeProperties(self $other): self { return new self( + $this->workspaceName, $this->contentStreamId, $this->nodeAggregateId, $this->originDimensionSpacePoint, @@ -93,6 +102,7 @@ public function mergeProperties(self $other): self public static function fromArray(array $values): EventInterface { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), OriginDimensionSpacePoint::fromArray($values['originDimensionSpacePoint']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/NodeModification.php b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/NodeModification.php index 49d71efa330..553f5d112f9 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/NodeModification.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/NodeModification.php @@ -98,6 +98,7 @@ private function handleSetSerializedNodeProperties( ); foreach ($affectedOrigins as $affectedOrigin) { $events[] = new NodePropertiesWereSet( + $command->workspaceName, $contentStreamId, $command->nodeAggregateId, $affectedOrigin, @@ -117,6 +118,7 @@ private function handleSetSerializedNodeProperties( ); foreach ($affectedOrigins as $affectedOrigin) { $events[] = new NodePropertiesWereSet( + $command->workspaceName, $contentStreamId, $command->nodeAggregateId, $affectedOrigin, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php index a25538eef87..48c98ee0cbc 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php @@ -6,12 +6,13 @@ 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\Common\PublishableInterface; use Neos\ContentRepository\Core\Feature\NodeMove\Dto\OriginNodeMoveMappings; use Neos\ContentRepository\Core\Feature\NodeMove\Dto\ParentNodeMoveDestination; use Neos\ContentRepository\Core\Feature\NodeMove\Dto\SucceedingSiblingNodeMoveDestination; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * A node aggregate was moved in a content stream as defined in the node move mappings. @@ -70,16 +71,22 @@ */ final readonly class NodeAggregateWasMoved implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public OriginNodeMoveMappings $nodeMoveMappings, ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -90,9 +97,10 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->nodeMoveMappings, @@ -102,6 +110,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): self { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), OriginNodeMoveMappings::fromArray($values['nodeMoveMappings']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php index 9290dfdb872..071edaff8cd 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php @@ -163,6 +163,7 @@ private function handleMoveNodeAggregate( $events = Events::with( new NodeAggregateWasMoved( + $command->workspaceName, $contentStreamId, $command->nodeAggregateId, OriginNodeMoveMappings::create(...$originNodeMoveMappings) diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php index e42aaaf821a..5ac137cc2a1 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php @@ -7,11 +7,12 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet; 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\Common\PublishableInterface; use Neos\ContentRepository\Core\Feature\NodeReferencing\Dto\SerializedNodeReferences; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * Named references with optional properties were created from source node to destination node(s) @@ -22,10 +23,11 @@ */ final readonly class NodeReferencesWereSet implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $sourceNodeAggregateId, /** @@ -40,15 +42,9 @@ public function __construct( ) { } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function getWorkspaceName(): WorkspaceName { - return new self( - $targetContentStreamId, - $this->sourceNodeAggregateId, - $this->affectedSourceOriginDimensionSpacePoints, - $this->referenceName, - $this->references, - ); + return $this->workspaceName; } public function getContentStreamId(): ContentStreamId @@ -67,9 +63,22 @@ public function getNodeAggregateId(): NodeAggregateId return $this->sourceNodeAggregateId; } + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + { + return new self( + $targetWorkspaceName, + $targetContentStreamId, + $this->sourceNodeAggregateId, + $this->affectedSourceOriginDimensionSpacePoints, + $this->referenceName, + $this->references, + ); + } + public static function fromArray(array $values): self { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['sourceNodeAggregateId']), OriginDimensionSpacePointSet::fromArray($values['affectedSourceOriginDimensionSpacePoints']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/NodeReferencing.php b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/NodeReferencing.php index 507e5c6bb6c..5791318d79d 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/NodeReferencing.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/NodeReferencing.php @@ -152,6 +152,7 @@ private function handleSetSerializedNodeReferences( $events = Events::with( new NodeReferencesWereSet( + $command->workspaceName, $contentStreamId, $command->sourceNodeAggregateId, $affectedOrigins, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php index e469c4630ea..dc705d9e0b2 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php @@ -18,20 +18,22 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet; 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\Common\PublishableInterface; use Neos\ContentRepository\Core\Feature\NodeRemoval\Command\RemoveNodeAggregate; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * @api events are the persistence-API of the content repository */ final readonly class NodeAggregateWasRemoved implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public OriginDimensionSpacePointSet $affectedOccupiedDimensionSpacePoints, @@ -41,6 +43,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -51,9 +58,10 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new NodeAggregateWasRemoved( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->affectedOccupiedDimensionSpacePoints, @@ -65,6 +73,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): self { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), OriginDimensionSpacePointSet::fromArray($values['affectedOccupiedDimensionSpacePoints']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/NodeRemoval.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/NodeRemoval.php index 446f7b58e45..d2ef40d5620 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/NodeRemoval.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/NodeRemoval.php @@ -72,6 +72,7 @@ private function handleRemoveNodeAggregate( $events = Events::with( new NodeAggregateWasRemoved( + $command->workspaceName, $contentStreamId, $command->nodeAggregateId, $command->nodeVariantSelectionStrategy->resolveAffectedOriginDimensionSpacePoints( diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php index 521f35b1a49..b6c18f9fb0c 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php @@ -16,26 +16,33 @@ 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\Common\PublishableInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * @api events are the persistence-API of the content repository */ final readonly class NodeAggregateNameWasChanged implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public NodeName $newNodeName, ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -46,9 +53,10 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->newNodeName, @@ -58,6 +66,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): self { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), NodeName::fromString($values['newNodeName']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php index 40403f523ba..9ef19d5d281 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php @@ -56,6 +56,7 @@ private function handleChangeNodeAggregateName(ChangeNodeAggregateName $command, $events = Events::with( new NodeAggregateNameWasChanged( + $command->workspaceName, $contentStreamId, $command->nodeAggregateId, $command->newNodeName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php index 8f72cfd3336..9568c67fa14 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php @@ -16,26 +16,33 @@ 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\Common\PublishableInterface; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * @api events are the persistence-API of the content repository */ final readonly class NodeAggregateTypeWasChanged implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public NodeTypeName $newNodeTypeName ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -46,9 +53,10 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->newNodeTypeName @@ -58,6 +66,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): self { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), NodeTypeName::fromString($values['newNodeTypeName']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php index 25e60f27449..f9863b98227 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php @@ -39,6 +39,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @codingStandardsIgnoreStart */ /** @codingStandardsIgnoreEnd */ @@ -165,6 +166,7 @@ private function handleChangeNodeAggregateType( **************/ $events = [ new NodeAggregateTypeWasChanged( + $command->workspaceName, $contentStreamId, $command->nodeAggregateId, $command->newNodeTypeName @@ -447,6 +449,7 @@ private function removeNodeInDimensionSpacePointSet( DimensionSpacePointSet $coveredDimensionSpacePointsToBeRemoved, ): NodeAggregateWasRemoved { return new NodeAggregateWasRemoved( + WorkspaceName::fromString('todo'), // TODO read from $nodeAggregate $nodeAggregate->contentStreamId, $nodeAggregate->nodeAggregateId, // TODO: we also use the covered dimension space points as OCCUPIED dimension space points diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php index 134f248b7d8..d744b9baeb9 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php @@ -19,9 +19,10 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; -use Neos\ContentRepository\Core\Feature\Common\PublishableToOtherContentStreamsInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * A node generalization variant was created @@ -30,10 +31,11 @@ */ final readonly class NodeGeneralizationVariantWasCreated implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public OriginDimensionSpacePoint $sourceOrigin, @@ -42,6 +44,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -52,10 +59,10 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream( - ContentStreamId $targetContentStreamId - ): self { + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + { return new NodeGeneralizationVariantWasCreated( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->sourceOrigin, @@ -67,6 +74,7 @@ public function createCopyForContentStream( public static function fromArray(array $values): self { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), OriginDimensionSpacePoint::fromArray($values['sourceOrigin']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php index 5c03b55a2aa..7470ad43f16 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php @@ -19,19 +19,21 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; -use Neos\ContentRepository\Core\Feature\Common\PublishableToOtherContentStreamsInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * @api events are the persistence-API of the content repository */ final readonly class NodePeerVariantWasCreated implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public OriginDimensionSpacePoint $sourceOrigin, @@ -40,6 +42,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -50,9 +57,10 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->sourceOrigin, @@ -64,6 +72,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): self { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), OriginDimensionSpacePoint::fromArray($values['sourceOrigin']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php index 2fac714a1e8..ab921ebdfe7 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php @@ -19,9 +19,10 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; -use Neos\ContentRepository\Core\Feature\Common\PublishableToOtherContentStreamsInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * A node specialization variant was created @@ -30,10 +31,11 @@ */ final readonly class NodeSpecializationVariantWasCreated implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public OriginDimensionSpacePoint $sourceOrigin, @@ -42,6 +44,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -51,9 +58,10 @@ public function getNodeAggregateId(): NodeAggregateId { return $this->nodeAggregateId; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->sourceOrigin, @@ -65,6 +73,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): self { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), OriginDimensionSpacePoint::fromArray($values['sourceOrigin']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/NodeVariation.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/NodeVariation.php index 7df4a3acb5b..b9b71001086 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/NodeVariation.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/NodeVariation.php @@ -77,6 +77,7 @@ private function handleCreateNodeVariant( ); $events = $this->createEventsForVariations( + $command->workspaceName, $contentStreamId, $command->sourceOrigin, $command->targetOrigin, diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php index cfee0dcd88d..6d14405babc 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php @@ -17,9 +17,10 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; 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\Common\PublishableInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * A root node aggregate is now visible in other dimensions. Needed when configured dimensions @@ -29,10 +30,11 @@ */ final readonly class RootNodeAggregateDimensionsWereUpdated implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, /** Root nodes by definition cover *all* dimension space points; so we need to include the full list here. */ @@ -40,6 +42,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -50,9 +57,10 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->coveredDimensionSpacePoints, @@ -62,6 +70,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): self { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), DimensionSpacePointSet::fromArray($values['coveredDimensionSpacePoints']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php index 0e4ec1263d3..d310b1fcee3 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php @@ -17,11 +17,12 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; 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\Common\PublishableInterface; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * A root node aggregate and its initial node were created @@ -30,10 +31,11 @@ */ final readonly class RootNodeAggregateWithNodeWasCreated implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public NodeTypeName $nodeTypeName, @@ -43,6 +45,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -53,9 +60,10 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->nodeTypeName, @@ -67,6 +75,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): self { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), NodeTypeName::fromString($values['nodeTypeName']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php index 0fb102fe6ef..562f2a4cd40 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php @@ -43,6 +43,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * @internal implementation detail of Command Handlers @@ -104,6 +105,7 @@ private function handleCreateRootNodeAggregateWithNode( foreach ($this->getInterDimensionalVariationGraph()->getRootGeneralizations() as $rootGeneralization) { array_push($events, ...iterator_to_array($this->handleTetheredRootChildNodes( + $command->workspaceName, $contentStreamId, $nodeType, OriginDimensionSpacePoint::fromDimensionSpacePoint($rootGeneralization), @@ -132,6 +134,7 @@ private function createRootWithNode( DimensionSpacePointSet $coveredDimensionSpacePoints ): RootNodeAggregateWithNodeWasCreated { return new RootNodeAggregateWithNodeWasCreated( + $command->workspaceName, $contentStreamId, $command->nodeAggregateId, $command->nodeTypeName, @@ -161,6 +164,7 @@ private function handleUpdateRootNodeAggregateDimensions( $events = Events::with( new RootNodeAggregateDimensionsWereUpdated( + $command->workspaceName, $contentStreamId, $command->nodeAggregateId, $this->getAllowedDimensionSubspace() @@ -185,6 +189,7 @@ private function handleUpdateRootNodeAggregateDimensions( * @throws NodeTypeNotFoundException */ private function handleTetheredRootChildNodes( + WorkspaceName $workspaceName, ContentStreamId $contentStreamId, NodeType $nodeType, OriginDimensionSpacePoint $originDimensionSpacePoint, @@ -206,6 +211,7 @@ private function handleTetheredRootChildNodes( $initialPropertyValues = SerializedPropertyValues::defaultFromNodeType($childNodeType, $this->getPropertyConverter()); $events[] = $this->createTetheredWithNodeForRoot( + $workspaceName, $contentStreamId, $childNodeAggregateId, $childNodeType->name, @@ -217,6 +223,7 @@ private function handleTetheredRootChildNodes( ); array_push($events, ...iterator_to_array($this->handleTetheredRootChildNodes( + $workspaceName, $contentStreamId, $childNodeType, $originDimensionSpacePoint, @@ -232,6 +239,7 @@ private function handleTetheredRootChildNodes( } private function createTetheredWithNodeForRoot( + WorkspaceName $workspaceName, ContentStreamId $contentStreamId, NodeAggregateId $nodeAggregateId, NodeTypeName $nodeTypeName, @@ -242,6 +250,7 @@ private function createTetheredWithNodeForRoot( SerializedPropertyValues $initialPropertyValues, ): NodeAggregateWithNodeWasCreated { return new NodeAggregateWithNodeWasCreated( + $workspaceName, $contentStreamId, $nodeAggregateId, $nodeTypeName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php index 27852d5b18c..72ee902a8af 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php @@ -17,10 +17,11 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; 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\Common\PublishableInterface; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTag; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * A {@see SubtreeTag} was added to a node aggregate and effectively to its descendants @@ -29,7 +30,7 @@ */ final readonly class SubtreeWasTagged implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { /** @@ -39,6 +40,7 @@ * @param SubtreeTag $tag The tag that was added */ public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public DimensionSpacePointSet $affectedDimensionSpacePoints, @@ -46,6 +48,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -56,9 +63,10 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->affectedDimensionSpacePoints, @@ -69,6 +77,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): EventInterface { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), DimensionSpacePointSet::fromArray($values['affectedDimensionSpacePoints']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php index 88594144544..c8e06664911 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php @@ -17,10 +17,11 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; 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\Common\PublishableInterface; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTag; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * A {@see SubtreeTag} was removed from a node aggregate and effectively from its descendants @@ -30,7 +31,7 @@ */ final readonly class SubtreeWasUntagged implements EventInterface, - PublishableToOtherContentStreamsInterface, + PublishableInterface, EmbedsContentStreamAndNodeAggregateId { /** @@ -40,6 +41,7 @@ * @param SubtreeTag $tag The tag that was removed */ public function __construct( + public WorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public DimensionSpacePointSet $affectedDimensionSpacePoints, @@ -47,6 +49,11 @@ public function __construct( ) { } + public function getWorkspaceName(): WorkspaceName + { + return $this->workspaceName; + } + public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; @@ -57,9 +64,10 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(ContentStreamId $targetContentStreamId): self + public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( + $targetWorkspaceName, $targetContentStreamId, $this->nodeAggregateId, $this->affectedDimensionSpacePoints, @@ -70,6 +78,7 @@ public function createCopyForContentStream(ContentStreamId $targetContentStreamI public static function fromArray(array $values): EventInterface { return new self( + WorkspaceName::fromString($values['workspaceName']), ContentStreamId::fromString($values['contentStreamId']), NodeAggregateId::fromString($values['nodeAggregateId']), DimensionSpacePointSet::fromArray($values['affectedDimensionSpacePoints']), diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/SubtreeTagging.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/SubtreeTagging.php index 05f3c58248e..e5663bd20ba 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/SubtreeTagging.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/SubtreeTagging.php @@ -60,6 +60,7 @@ private function handleTagSubtree(TagSubtree $command, ContentRepository $conten $events = Events::with( new SubtreeWasTagged( + $command->workspaceName, $contentStreamId, $command->nodeAggregateId, $affectedDimensionSpacePoints, @@ -106,6 +107,7 @@ public function handleUntagSubtree(UntagSubtree $command, ContentRepository $con $events = Events::with( new SubtreeWasUntagged( + $command->workspaceName, $contentStreamId, $command->nodeAggregateId, $affectedDimensionSpacePoints, diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php index f03b3a20633..74ff406f508 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php @@ -26,7 +26,7 @@ use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\Common\ContentStreamIdOverride; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; -use Neos\ContentRepository\Core\Feature\Common\PublishableToOtherContentStreamsInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; use Neos\ContentRepository\Core\Feature\ContentStreamClosing\Command\CloseContentStream; use Neos\ContentRepository\Core\Feature\ContentStreamClosing\Command\ReopenContentStream; @@ -249,6 +249,7 @@ private function handlePublishWorkspace( $this->publishContentStream( $workspace->currentContentStreamId, + $baseWorkspace->workspaceName, $baseWorkspace->currentContentStreamId )?->block(); @@ -283,6 +284,7 @@ private function handlePublishWorkspace( */ private function publishContentStream( ContentStreamId $contentStreamId, + WorkspaceName $baseWorkspaceName, ContentStreamId $baseContentStreamId, ): ?CommandResult { $baseWorkspaceContentStreamName = ContentStreamEventStreamName::fromContentStreamId( @@ -314,9 +316,9 @@ private function publishContentStream( ); } $contentStreamWasForkedEvent = $event; - } elseif ($event instanceof PublishableToOtherContentStreamsInterface) { + } elseif ($event instanceof PublishableInterface) { /** @var EventInterface $copiedEvent */ - $copiedEvent = $event->createCopyForContentStream($baseContentStreamId); + $copiedEvent = $event->createCopyForContentStream($baseWorkspaceName, $baseContentStreamId); // We need to add the event metadata here for rebasing in nested workspace situations // (and for exporting) $events[] = DecoratedEvent::create($copiedEvent, metadata: $eventEnvelope->event->metadata, causationId: $eventEnvelope->event->causationId, correlationId: $eventEnvelope->event->correlationId); @@ -542,6 +544,7 @@ function () use ($matchingCommands, $contentRepository, $baseWorkspace): void { // 5) take EVENTS(MATCHING) and apply them to base WS. $this->publishContentStream( $command->contentStreamIdForMatchingPart, + $baseWorkspace->workspaceName, $baseWorkspace->currentContentStreamId )?->block(); diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php index a621f5309e2..797ff0a7f39 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php @@ -45,6 +45,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\PropertyNames; use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\ContentRepository\Export\Event\ValueObject\ExportedEvent; use Neos\ContentRepository\Export\ProcessorInterface; use Neos\ContentRepository\Export\ProcessorResult; @@ -66,6 +67,7 @@ final class NodeDataToEventsProcessor implements ProcessorInterface */ private array $callbacks = []; private NodeTypeName $sitesNodeTypeName; + private WorkspaceName $workspaceName; private ContentStreamId $contentStreamId; private VisitedNodeAggregates $visitedNodes; @@ -97,6 +99,7 @@ public function __construct( ) { $this->sitesNodeTypeName = NodeTypeNameFactory::forSites(); $this->contentStreamId = ContentStreamId::create(); + $this->workspaceName = WorkspaceName::forLive(); // TODO should this be configurable? $this->visitedNodes = new VisitedNodeAggregates(); } @@ -130,7 +133,7 @@ public function run(): ProcessorResult if ($nodeDataRow['path'] === '/sites') { $sitesNodeAggregateId = NodeAggregateId::fromString($nodeDataRow['identifier']); $this->visitedNodes->addRootNode($sitesNodeAggregateId, $this->sitesNodeTypeName, NodePath::fromString('/sites'), $this->interDimensionalVariationGraph->getDimensionSpacePoints()); - $this->exportEvent(new RootNodeAggregateWithNodeWasCreated($this->contentStreamId, $sitesNodeAggregateId, $this->sitesNodeTypeName, $this->interDimensionalVariationGraph->getDimensionSpacePoints(), NodeAggregateClassification::CLASSIFICATION_ROOT)); + $this->exportEvent(new RootNodeAggregateWithNodeWasCreated($this->workspaceName, $this->contentStreamId, $sitesNodeAggregateId, $this->sitesNodeTypeName, $this->interDimensionalVariationGraph->getDimensionSpacePoints(), NodeAggregateClassification::CLASSIFICATION_ROOT)); continue; } if ($this->metaDataExported === false && $nodeDataRow['parentpath'] === '/sites') { @@ -282,6 +285,7 @@ public function processNodeDataWithoutFallbackToEmptyDimension(NodeAggregateId $ $specializations = $this->interDimensionalVariationGraph->getSpecializationSet($originDimensionSpacePoint->toDimensionSpacePoint(), true, $this->visitedNodes->alreadyVisitedOriginDimensionSpacePoints($nodeAggregateId)->toDimensionSpacePointSet()); $this->exportEvent( new NodeAggregateWithNodeWasCreated( + $this->workspaceName, $this->contentStreamId, $nodeAggregateId, $nodeTypeName, @@ -300,6 +304,7 @@ public function processNodeDataWithoutFallbackToEmptyDimension(NodeAggregateId $ // create node aggregate $this->exportEvent( new NodeAggregateWithNodeWasCreated( + $this->workspaceName, $this->contentStreamId, $nodeAggregateId, $nodeTypeName, @@ -318,10 +323,10 @@ public function processNodeDataWithoutFallbackToEmptyDimension(NodeAggregateId $ } // nodes are hidden via SubtreeWasTagged event if ($this->isNodeHidden($nodeDataRow)) { - $this->exportEvent(new SubtreeWasTagged($this->contentStreamId, $nodeAggregateId, $this->interDimensionalVariationGraph->getSpecializationSet($originDimensionSpacePoint->toDimensionSpacePoint(), true, $this->visitedNodes->alreadyVisitedOriginDimensionSpacePoints($nodeAggregateId)->toDimensionSpacePointSet()), SubtreeTag::disabled())); + $this->exportEvent(new SubtreeWasTagged($this->workspaceName, $this->contentStreamId, $nodeAggregateId, $this->interDimensionalVariationGraph->getSpecializationSet($originDimensionSpacePoint->toDimensionSpacePoint(), true, $this->visitedNodes->alreadyVisitedOriginDimensionSpacePoints($nodeAggregateId)->toDimensionSpacePointSet()), SubtreeTag::disabled())); } foreach ($serializedPropertyValuesAndReferences->references as $referencePropertyName => $destinationNodeAggregateIds) { - $this->nodeReferencesWereSetEvents[] = new NodeReferencesWereSet($this->contentStreamId, $nodeAggregateId, new OriginDimensionSpacePointSet([$originDimensionSpacePoint]), ReferenceName::fromString($referencePropertyName), SerializedNodeReferences::fromNodeAggregateIds($destinationNodeAggregateIds)); + $this->nodeReferencesWereSetEvents[] = new NodeReferencesWereSet($this->workspaceName, $this->contentStreamId, $nodeAggregateId, new OriginDimensionSpacePointSet([$originDimensionSpacePoint]), ReferenceName::fromString($referencePropertyName), SerializedNodeReferences::fromNodeAggregateIds($destinationNodeAggregateIds)); } $this->visitedNodes->add($nodeAggregateId, new DimensionSpacePointSet([$originDimensionSpacePoint->toDimensionSpacePoint()]), $nodeTypeName, $nodePath, $parentNodeAggregate->nodeAggregateId); @@ -416,6 +421,7 @@ private function createNodeVariant(NodeAggregateId $nodeAggregateId, OriginDimen $variantType = $this->interDimensionalVariationGraph->getVariantType($originDimensionSpacePoint->toDimensionSpacePoint(), $alreadyVisitedOriginDimensionSpacePoint->toDimensionSpacePoint()); $variantCreatedEvent = match ($variantType) { VariantType::TYPE_SPECIALIZATION => new NodeSpecializationVariantWasCreated( + $this->workspaceName, $this->contentStreamId, $nodeAggregateId, $alreadyVisitedOriginDimensionSpacePoint, @@ -425,6 +431,7 @@ private function createNodeVariant(NodeAggregateId $nodeAggregateId, OriginDimen ) ), VariantType::TYPE_GENERALIZATION => new NodeGeneralizationVariantWasCreated( + $this->workspaceName, $this->contentStreamId, $nodeAggregateId, $alreadyVisitedOriginDimensionSpacePoint, @@ -434,6 +441,7 @@ private function createNodeVariant(NodeAggregateId $nodeAggregateId, OriginDimen ) ), VariantType::TYPE_PEER => new NodePeerVariantWasCreated( + $this->workspaceName, $this->contentStreamId, $nodeAggregateId, $alreadyVisitedOriginDimensionSpacePoint, @@ -456,6 +464,7 @@ private function createNodeVariant(NodeAggregateId $nodeAggregateId, OriginDimen if ($serializedPropertyValuesAndReferences->serializedPropertyValues->count() > 0) { $this->exportEvent( new NodePropertiesWereSet( + $this->workspaceName, $this->contentStreamId, $nodeAggregateId, $originDimensionSpacePoint, @@ -473,6 +482,7 @@ private function createNodeVariant(NodeAggregateId $nodeAggregateId, OriginDimen !$parentNodeAggregate->nodeAggregateId->equals($nodeAggregate->getVariant($variantSourceOriginDimensionSpacePoint)->parentNodeAggregateId) ) { $this->exportEvent(new NodeAggregateWasMoved( + $this->workspaceName, $this->contentStreamId, $nodeAggregateId, OriginNodeMoveMappings::fromArray([ diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php index c715e22748c..ec961940963 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php @@ -17,6 +17,7 @@ use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate; use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\EventStore\Model\EventStream\ExpectedVersion; class DisallowedChildNodeAdjustment @@ -132,6 +133,7 @@ private function removeNodeInSingleDimensionSpacePoint( $referenceOrigin = OriginDimensionSpacePoint::fromDimensionSpacePoint($dimensionSpacePoint); $events = Events::with( new NodeAggregateWasRemoved( + WorkspaceName::fromString('todo'), // TODO read from $nodeAggregate $nodeAggregate->contentStreamId, $nodeAggregate->nodeAggregateId, $nodeAggregate->occupiesDimensionSpacePoint($referenceOrigin) diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/PropertyAdjustment.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/PropertyAdjustment.php index 1b8c9bb69de..a64537dc0ba 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/PropertyAdjustment.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/PropertyAdjustment.php @@ -15,6 +15,7 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate; use Neos\ContentRepository\Core\SharedModel\Node\PropertyNames; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\EventStore\Model\EventStream\ExpectedVersion; class PropertyAdjustment @@ -114,6 +115,7 @@ private function publishNodePropertiesWereSet( ): EventsToPublish { $events = Events::with( new NodePropertiesWereSet( + WorkspaceName::fromString('todo'), // TODO read from $node $node->subgraphIdentity->contentStreamId, $node->nodeAggregateId, $node->originDimensionSpacePoint, diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/RemoveNodeAggregateTrait.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/RemoveNodeAggregateTrait.php index 50c06b0f01b..3d4ffac404e 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/RemoveNodeAggregateTrait.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/RemoveNodeAggregateTrait.php @@ -9,6 +9,7 @@ use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; use Neos\ContentRepository\Core\Feature\NodeRemoval\Event\NodeAggregateWasRemoved; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\EventStore\Model\EventStream\ExpectedVersion; trait RemoveNodeAggregateTrait @@ -17,6 +18,7 @@ private function removeNodeAggregate(NodeAggregate $tetheredNodeAggregate): Even { $events = Events::with( new NodeAggregateWasRemoved( + WorkspaceName::fromString('todo'), // TODO read from $tetheredNodeAggregate $tetheredNodeAggregate->contentStreamId, $tetheredNodeAggregate->nodeAggregateId, $tetheredNodeAggregate->occupiedDimensionSpacePoints, diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php index fcdc1104af6..b80d3e1f5ff 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php @@ -27,6 +27,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\EventStore\Model\EventStream\ExpectedVersion; class TetheredNodeAdjustments @@ -165,6 +166,7 @@ function () use ($tetheredNodeAggregate) { . ' - actual: ' . implode(', ', array_keys($actualTetheredChildNodes)), fn () => $this->reorderNodes( + WorkspaceName::fromString('todo'), // TODO read from $nodeAggregate $nodeAggregate->contentStreamId, $nodeAggregate->nodeAggregateId, $originDimensionSpacePoint, @@ -223,6 +225,7 @@ protected function getPropertyConverter(): PropertyConverter * @param array $expectedNodeOrdering */ private function reorderNodes( + WorkspaceName $workspaceName, ContentStreamId $contentStreamId, NodeAggregateId $parentNodeAggregateId, DimensionSpace\OriginDimensionSpacePoint $originDimensionSpacePoint, @@ -241,6 +244,7 @@ private function reorderNodes( $succeedingNode = $actualTetheredChildNodes[$succeedingSiblingNodeName]; $events[] = new NodeAggregateWasMoved( + $workspaceName, $contentStreamId, $nodeToMove->nodeAggregateId, OriginNodeMoveMappings::fromArray([ From ce99c0b4746e69c679daf27a8ac77e7503d46687 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 17 May 2024 12:59:36 +0200 Subject: [PATCH 02/17] Fix NodeVariationInternals --- .../Classes/Feature/Common/NodeVariationInternals.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/NodeVariationInternals.php b/Neos.ContentRepository.Core/Classes/Feature/Common/NodeVariationInternals.php index f66066e5eb2..98c265c892b 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/NodeVariationInternals.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/NodeVariationInternals.php @@ -163,6 +163,7 @@ protected function collectNodeGeneralizationVariantsThatWillHaveBeenCreated( array $events ): array { $events[] = new NodeGeneralizationVariantWasCreated( + $contentGraph->getWorkspaceName(), $contentGraph->getContentStreamId(), $nodeAggregate->nodeAggregateId, $sourceOrigin, @@ -225,6 +226,7 @@ protected function collectNodePeerVariantsThatWillHaveBeenCreated( array $events ): array { $events[] = new NodePeerVariantWasCreated( + $contentGraph->getWorkspaceName(), $contentGraph->getContentStreamId(), $nodeAggregate->nodeAggregateId, $sourceOrigin, From 85d29222268bc1ef497976af3637a3942a44a535 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 17 May 2024 13:05:18 +0200 Subject: [PATCH 03/17] Remove unused `getWorkspaceName()` from `EmbedsContentStreamAndNodeAggregateId` interface --- .../Feature/Common/EmbedsContentStreamAndNodeAggregateId.php | 1 - .../Event/DimensionShineThroughWasAdded.php | 5 ----- .../Event/DimensionSpacePointWasMoved.php | 5 ----- .../NodeCreation/Event/NodeAggregateWithNodeWasCreated.php | 5 ----- .../Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php | 5 ----- .../Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php | 5 ----- .../Feature/NodeModification/Event/NodePropertiesWereSet.php | 5 ----- .../Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php | 5 ----- .../Feature/NodeReferencing/Event/NodeReferencesWereSet.php | 5 ----- .../Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php | 5 ----- .../NodeRenaming/Event/NodeAggregateNameWasChanged.php | 5 ----- .../NodeTypeChange/Event/NodeAggregateTypeWasChanged.php | 5 ----- .../Event/NodeGeneralizationVariantWasCreated.php | 5 ----- .../NodeVariation/Event/NodePeerVariantWasCreated.php | 5 ----- .../Event/NodeSpecializationVariantWasCreated.php | 5 ----- .../Event/RootNodeAggregateDimensionsWereUpdated.php | 5 ----- .../Event/RootNodeAggregateWithNodeWasCreated.php | 5 ----- .../Feature/SubtreeTagging/Event/SubtreeWasTagged.php | 5 ----- .../Feature/SubtreeTagging/Event/SubtreeWasUntagged.php | 5 ----- 19 files changed, 91 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php b/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php index e6a807d9336..1427ceb64c3 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php @@ -27,7 +27,6 @@ */ interface EmbedsContentStreamAndNodeAggregateId { - public function getWorkspaceName(): WorkspaceName; public function getContentStreamId(): ContentStreamId; public function getNodeAggregateId(): NodeAggregateId; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php index 93720a485d1..ffffef90134 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php @@ -43,11 +43,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php index b7fa685ca95..e41c74291ed 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php @@ -39,11 +39,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self { return new self( diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php index edd7a0b33a9..5255a7daf87 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php @@ -52,11 +52,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php index 41d079112b8..a324a04e477 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php @@ -43,11 +43,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php index e51ee340a39..f936729de25 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php @@ -43,11 +43,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php index b8a2e1e0331..c7b2d9de883 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php @@ -53,11 +53,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php index 8fcdecd3a38..242bdcd5825 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php @@ -63,11 +63,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php index 5ac137cc2a1..b3300cf0688 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php @@ -42,11 +42,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php index dc705d9e0b2..ea14d54a55d 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php @@ -43,11 +43,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php index b6c18f9fb0c..291c1494286 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php @@ -38,11 +38,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php index 9568c67fa14..dc2cbd6f084 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php @@ -38,11 +38,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php index d744b9baeb9..c77bb593be5 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php @@ -44,11 +44,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php index 7470ad43f16..2b2ed030ce9 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php @@ -42,11 +42,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php index ab921ebdfe7..f0e2a98bd6f 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php @@ -44,11 +44,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php index 6d14405babc..942b6594ff3 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php @@ -42,11 +42,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php index d310b1fcee3..a3dcf549e2f 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php @@ -45,11 +45,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php index 72ee902a8af..241e7bebd8c 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php @@ -48,11 +48,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php index c8e06664911..760ec131f16 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php @@ -49,11 +49,6 @@ public function __construct( ) { } - public function getWorkspaceName(): WorkspaceName - { - return $this->workspaceName; - } - public function getContentStreamId(): ContentStreamId { return $this->contentStreamId; From f4d2f413202bf100b1cf8cf099895ec4d16f4d42 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 17 May 2024 13:07:10 +0200 Subject: [PATCH 04/17] Rename and tweak `PublishableInterface` --- .../Feature/Common/NodeAggregateEventPublisher.php | 4 ++-- ...eInterface.php => PublishableToWorkspaceInterface.php} | 6 +++--- .../Event/DimensionShineThroughWasAdded.php | 8 ++++---- .../Event/DimensionSpacePointWasMoved.php | 8 ++++---- .../Event/NodeAggregateWithNodeWasCreated.php | 8 ++++---- .../NodeDisabling/Event/NodeAggregateWasDisabled.php | 8 ++++---- .../NodeDisabling/Event/NodeAggregateWasEnabled.php | 8 ++++---- .../NodeModification/Event/NodePropertiesWereSet.php | 8 ++++---- .../Feature/NodeMove/Event/NodeAggregateWasMoved.php | 8 ++++---- .../NodeReferencing/Event/NodeReferencesWereSet.php | 8 ++++---- .../Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php | 8 ++++---- .../NodeRenaming/Event/NodeAggregateNameWasChanged.php | 8 ++++---- .../NodeTypeChange/Event/NodeAggregateTypeWasChanged.php | 8 ++++---- .../Event/NodeGeneralizationVariantWasCreated.php | 8 ++++---- .../NodeVariation/Event/NodePeerVariantWasCreated.php | 8 ++++---- .../Event/NodeSpecializationVariantWasCreated.php | 8 ++++---- .../Event/RootNodeAggregateDimensionsWereUpdated.php | 8 ++++---- .../Event/RootNodeAggregateWithNodeWasCreated.php | 8 ++++---- .../Feature/SubtreeTagging/Event/SubtreeWasTagged.php | 8 ++++---- .../Feature/SubtreeTagging/Event/SubtreeWasUntagged.php | 8 ++++---- .../Classes/Feature/WorkspaceCommandHandler.php | 6 +++--- 21 files changed, 80 insertions(+), 80 deletions(-) rename Neos.ContentRepository.Core/Classes/Feature/Common/{PublishableInterface.php => PublishableToWorkspaceInterface.php} (79%) diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/NodeAggregateEventPublisher.php b/Neos.ContentRepository.Core/Classes/Feature/Common/NodeAggregateEventPublisher.php index 8d01935f55e..d92b5f892c0 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/NodeAggregateEventPublisher.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/NodeAggregateEventPublisher.php @@ -38,13 +38,13 @@ public static function enrichWithCommand( foreach ($events as $event) { if ($event instanceof DecoratedEvent) { $undecoratedEvent = $event->innerEvent; - if (!$undecoratedEvent instanceof PublishableInterface) { + if (!$undecoratedEvent instanceof PublishableToWorkspaceInterface) { throw new \RuntimeException(sprintf( 'TODO: Event %s has to implement PublishableToOtherContentStreamsInterface', get_class($event) )); } - } elseif (!$event instanceof PublishableInterface) { + } elseif (!$event instanceof PublishableToWorkspaceInterface) { throw new \RuntimeException(sprintf( 'TODO: Event %s has to implement PublishableToOtherContentStreamsInterface', get_class($event) diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/PublishableInterface.php b/Neos.ContentRepository.Core/Classes/Feature/Common/PublishableToWorkspaceInterface.php similarity index 79% rename from Neos.ContentRepository.Core/Classes/Feature/Common/PublishableInterface.php rename to Neos.ContentRepository.Core/Classes/Feature/Common/PublishableToWorkspaceInterface.php index 8ff4eb691bd..2660b94b623 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/PublishableInterface.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/PublishableToWorkspaceInterface.php @@ -24,9 +24,9 @@ * on the target content stream, and no events have been committed to the target content stream in * the meantime. This is because event's effects have to be fully deterministic. * - * @internal used internally for the publishing mechanism of content streams + * @internal used internally for the publishing mechanism of workspaces */ -interface PublishableInterface +interface PublishableToWorkspaceInterface { - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self; + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php index ffffef90134..3b4a03ef1c3 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php @@ -16,7 +16,7 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -33,7 +33,7 @@ * * @api events are the persistence-API of the content repository */ -final readonly class DimensionShineThroughWasAdded implements EventInterface, PublishableInterface +final readonly class DimensionShineThroughWasAdded implements EventInterface, PublishableToWorkspaceInterface { public function __construct( public WorkspaceName $workspaceName, @@ -43,11 +43,11 @@ public function __construct( ) { } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->source, $this->target ); diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php index e41c74291ed..a65486a3eeb 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php @@ -16,7 +16,7 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -29,7 +29,7 @@ * * @api events are the persistence-API of the content repository */ -final readonly class DimensionSpacePointWasMoved implements EventInterface, PublishableInterface +final readonly class DimensionSpacePointWasMoved implements EventInterface, PublishableToWorkspaceInterface { public function __construct( public WorkspaceName $workspaceName, @@ -39,11 +39,11 @@ public function __construct( ) { } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->source, $this->target ); diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php index 5255a7daf87..0141ffd51e4 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php @@ -19,7 +19,7 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; @@ -35,7 +35,7 @@ */ final readonly class NodeAggregateWithNodeWasCreated implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -67,11 +67,11 @@ public function getOriginDimensionSpacePoint(): OriginDimensionSpacePoint return $this->originDimensionSpacePoint; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->nodeTypeName, $this->originDimensionSpacePoint, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php index a324a04e477..b16de3060ec 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php @@ -17,7 +17,7 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasTagged; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -31,7 +31,7 @@ */ final readonly class NodeAggregateWasDisabled implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -53,11 +53,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->affectedDimensionSpacePoints, ); diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php index f936729de25..6c0ef1aeac6 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php @@ -18,7 +18,7 @@ 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\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasUntagged; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -32,7 +32,7 @@ */ final readonly class NodeAggregateWasEnabled implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -53,11 +53,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->affectedDimensionSpacePoints, ); diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php index c7b2d9de883..6827196656e 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php @@ -18,7 +18,7 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\PropertyNames; @@ -38,7 +38,7 @@ */ final readonly class NodePropertiesWereSet implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -68,11 +68,11 @@ public function getOriginDimensionSpacePoint(): OriginDimensionSpacePoint return $this->originDimensionSpacePoint; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->originDimensionSpacePoint, $this->affectedDimensionSpacePoints, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php index 242bdcd5825..c8e5e0e29c5 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php @@ -9,7 +9,7 @@ use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSibling; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -51,7 +51,7 @@ */ final readonly class NodeAggregateWasMoved implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -73,11 +73,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->newParentNodeAggregateId, $this->succeedingSiblingsForCoverage, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php index b3300cf0688..27f3bd49c11 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php @@ -7,7 +7,7 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\NodeReferencing\Dto\SerializedNodeReferences; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName; @@ -23,7 +23,7 @@ */ final readonly class NodeReferencesWereSet implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -58,11 +58,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->sourceNodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->sourceNodeAggregateId, $this->affectedSourceOriginDimensionSpacePoints, $this->referenceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php index ea14d54a55d..e31b4202e69 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php @@ -18,7 +18,7 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\NodeRemoval\Command\RemoveNodeAggregate; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -29,7 +29,7 @@ */ final readonly class NodeAggregateWasRemoved implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -53,11 +53,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new NodeAggregateWasRemoved( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->affectedOccupiedDimensionSpacePoints, $this->affectedCoveredDimensionSpacePoints, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php index 291c1494286..743d33f3a2c 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php @@ -16,7 +16,7 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -27,7 +27,7 @@ */ final readonly class NodeAggregateNameWasChanged implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -48,11 +48,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->newNodeName, ); diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php index dc2cbd6f084..eb20cb562fd 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php @@ -16,7 +16,7 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -27,7 +27,7 @@ */ final readonly class NodeAggregateTypeWasChanged implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -48,11 +48,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->newNodeTypeName ); diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php index c77bb593be5..1826a1045cf 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php @@ -19,7 +19,7 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -31,7 +31,7 @@ */ final readonly class NodeGeneralizationVariantWasCreated implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -54,11 +54,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new NodeGeneralizationVariantWasCreated( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->sourceOrigin, $this->generalizationOrigin, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php index 2b2ed030ce9..226e0c789a3 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php @@ -19,7 +19,7 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -29,7 +29,7 @@ */ final readonly class NodePeerVariantWasCreated implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -52,11 +52,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->sourceOrigin, $this->peerOrigin, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php index f0e2a98bd6f..0e757c8b88b 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php @@ -19,7 +19,7 @@ use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -31,7 +31,7 @@ */ final readonly class NodeSpecializationVariantWasCreated implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -53,11 +53,11 @@ public function getNodeAggregateId(): NodeAggregateId { return $this->nodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->sourceOrigin, $this->specializationOrigin, diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php index 942b6594ff3..e444a3232e0 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateDimensionsWereUpdated.php @@ -17,7 +17,7 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -30,7 +30,7 @@ */ final readonly class RootNodeAggregateDimensionsWereUpdated implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -52,11 +52,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->coveredDimensionSpacePoints, ); diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php index a3dcf549e2f..0ca33871bfd 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Event/RootNodeAggregateWithNodeWasCreated.php @@ -17,7 +17,7 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -31,7 +31,7 @@ */ final readonly class RootNodeAggregateWithNodeWasCreated implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { public function __construct( @@ -55,11 +55,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->nodeTypeName, $this->coveredDimensionSpacePoints, diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php index 241e7bebd8c..224594af9cb 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php @@ -17,7 +17,7 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTag; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -30,7 +30,7 @@ */ final readonly class SubtreeWasTagged implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { /** @@ -58,11 +58,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->affectedDimensionSpacePoints, $this->tag, diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php index 760ec131f16..ad19ff68107 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php @@ -17,7 +17,7 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\Feature\Common\EmbedsContentStreamAndNodeAggregateId; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTag; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -31,7 +31,7 @@ */ final readonly class SubtreeWasUntagged implements EventInterface, - PublishableInterface, + PublishableToWorkspaceInterface, EmbedsContentStreamAndNodeAggregateId { /** @@ -59,11 +59,11 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function createCopyForContentStream(WorkspaceName $targetWorkspaceName, ContentStreamId $targetContentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, - $targetContentStreamId, + $contentStreamId, $this->nodeAggregateId, $this->affectedDimensionSpacePoints, $this->tag, diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php index fd23fbe94f4..03309425c58 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php @@ -26,7 +26,7 @@ use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; -use Neos\ContentRepository\Core\Feature\Common\PublishableInterface; +use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; use Neos\ContentRepository\Core\Feature\ContentStreamClosing\Command\CloseContentStream; use Neos\ContentRepository\Core\Feature\ContentStreamClosing\Command\ReopenContentStream; @@ -309,9 +309,9 @@ private function publishContentStream( ); } $contentStreamWasForkedEvent = $event; - } elseif ($event instanceof PublishableInterface) { + } elseif ($event instanceof PublishableToWorkspaceInterface) { /** @var EventInterface $copiedEvent */ - $copiedEvent = $event->createCopyForContentStream($baseWorkspaceName, $baseContentStreamId); + $copiedEvent = $event->withWorkspaceNameAndContentStreamId($baseWorkspaceName, $baseContentStreamId); // We need to add the event metadata here for rebasing in nested workspace situations // (and for exporting) $events[] = DecoratedEvent::create($copiedEvent, metadata: $eventEnvelope->event->metadata, causationId: $eventEnvelope->event->causationId, correlationId: $eventEnvelope->event->correlationId); From 02624aa1173d370147e909dd3c4c9be8b06f29ab Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 17 May 2024 13:18:27 +0200 Subject: [PATCH 05/17] Forward contentGraph workspace name to events --- .../Classes/Feature/Common/TetheredNodeInternals.php | 12 ++++++------ .../Feature/NodeTypeChange/NodeTypeChange.php | 8 ++++++-- .../src/Adjustment/DisallowedChildNodeAdjustment.php | 4 ++-- .../src/Adjustment/PropertyAdjustment.php | 2 +- .../src/Adjustment/RemoveNodeAggregateTrait.php | 8 ++++---- .../src/Adjustment/TetheredNodeAdjustments.php | 6 +++--- .../src/Adjustment/UnknownNodeTypeAdjustment.php | 2 +- 7 files changed, 23 insertions(+), 19 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php b/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php index c2dde50e67a..e5251b18094 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php @@ -79,8 +79,8 @@ protected function createEventsForMissingTetheredNode( $rootGeneralizationOrigin = OriginDimensionSpacePoint::fromDimensionSpacePoint($rootGeneralization); if ($creationOriginDimensionSpacePoint) { $events[] = new NodePeerVariantWasCreated( - WorkspaceName::fromString('todo'), // TODO read from $parentNodeAggregate - $parentNodeAggregate->contentStreamId, + $contentGraph->getWorkspaceName(), + $contentGraph->getContentStreamId(), $tetheredNodeAggregateId, $creationOriginDimensionSpacePoint, $rootGeneralizationOrigin, @@ -90,8 +90,8 @@ protected function createEventsForMissingTetheredNode( ); } else { $events[] = new NodeAggregateWithNodeWasCreated( - WorkspaceName::fromString('todo'), // TODO read from $parentNodeAggregate - $parentNodeAggregate->contentStreamId, + $contentGraph->getWorkspaceName(), + $contentGraph->getContentStreamId(), $tetheredNodeAggregateId, $expectedTetheredNodeType->name, $rootGeneralizationOrigin, @@ -110,8 +110,8 @@ protected function createEventsForMissingTetheredNode( } return Events::with( new NodeAggregateWithNodeWasCreated( - WorkspaceName::fromString('todo'), // TODO read from $parentNodeAggregate - $parentNodeAggregate->contentStreamId, + $contentGraph->getWorkspaceName(), + $contentGraph->getContentStreamId(), $tetheredNodeAggregateId ?: NodeAggregateId::create(), $expectedTetheredNodeType->name, $originDimensionSpacePoint, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php index cbf031c3374..9317c8a911c 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php @@ -304,6 +304,7 @@ private function deleteDisallowedNodesWhenChangingNodeType( ); // AND REMOVE THEM $events[] = $this->removeNodeInDimensionSpacePointSet( + $contentGraph, $childNodeAggregate, $dimensionSpacePointsToBeRemoved, ); @@ -336,6 +337,7 @@ private function deleteDisallowedNodesWhenChangingNodeType( ); // AND REMOVE THEM $events[] = $this->removeNodeInDimensionSpacePointSet( + $contentGraph, $grandchildNodeAggregate, $dimensionSpacePointsToBeRemoved, ); @@ -369,6 +371,7 @@ private function deleteObsoleteTetheredNodesWhenChangingNodeType( ); // AND REMOVE THEM $events[] = $this->removeNodeInDimensionSpacePointSet( + $contentGraph, $tetheredNodeAggregate, $dimensionSpacePointsToBeRemoved, ); @@ -423,12 +426,13 @@ private function findDimensionSpacePointsConnectingParentAndChildAggregate( } private function removeNodeInDimensionSpacePointSet( + ContentGraphInterface $contentGraph, NodeAggregate $nodeAggregate, DimensionSpacePointSet $coveredDimensionSpacePointsToBeRemoved, ): NodeAggregateWasRemoved { return new NodeAggregateWasRemoved( - WorkspaceName::fromString('todo'), // TODO read from $nodeAggregate - $nodeAggregate->contentStreamId, + $contentGraph->getWorkspaceName(), + $contentGraph->getContentStreamId(), $nodeAggregate->nodeAggregateId, // TODO: we also use the covered dimension space points as OCCUPIED dimension space points // - however the OCCUPIED dimension space points are not really used by now diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php index ea2a48ea9c2..027747951ee 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php @@ -131,8 +131,8 @@ private function removeNodeInSingleDimensionSpacePoint( $referenceOrigin = OriginDimensionSpacePoint::fromDimensionSpacePoint($dimensionSpacePoint); $events = Events::with( new NodeAggregateWasRemoved( - WorkspaceName::fromString('todo'), // TODO read from $nodeAggregate - $nodeAggregate->contentStreamId, + $this->projectedNodeIterator->contentGraph->getWorkspaceName(), + $this->projectedNodeIterator->contentGraph->getContentStreamId(), $nodeAggregate->nodeAggregateId, $nodeAggregate->occupiesDimensionSpacePoint($referenceOrigin) ? new OriginDimensionSpacePointSet([$referenceOrigin]) diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/PropertyAdjustment.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/PropertyAdjustment.php index a64537dc0ba..5afde4bd653 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/PropertyAdjustment.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/PropertyAdjustment.php @@ -115,7 +115,7 @@ private function publishNodePropertiesWereSet( ): EventsToPublish { $events = Events::with( new NodePropertiesWereSet( - WorkspaceName::fromString('todo'), // TODO read from $node + $node->workspaceName, $node->subgraphIdentity->contentStreamId, $node->nodeAggregateId, $node->originDimensionSpacePoint, diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/RemoveNodeAggregateTrait.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/RemoveNodeAggregateTrait.php index 3d4ffac404e..0a93a3ce02b 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/RemoveNodeAggregateTrait.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/RemoveNodeAggregateTrait.php @@ -8,18 +8,18 @@ use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; use Neos\ContentRepository\Core\Feature\NodeRemoval\Event\NodeAggregateWasRemoved; +use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphInterface; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate; -use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\EventStore\Model\EventStream\ExpectedVersion; trait RemoveNodeAggregateTrait { - private function removeNodeAggregate(NodeAggregate $tetheredNodeAggregate): EventsToPublish + private function removeNodeAggregate(ContentGraphInterface $contentGraph, NodeAggregate $tetheredNodeAggregate): EventsToPublish { $events = Events::with( new NodeAggregateWasRemoved( - WorkspaceName::fromString('todo'), // TODO read from $tetheredNodeAggregate - $tetheredNodeAggregate->contentStreamId, + $contentGraph->getWorkspaceName(), + $contentGraph->getContentStreamId(), $tetheredNodeAggregate->nodeAggregateId, $tetheredNodeAggregate->occupiedDimensionSpacePoints, $tetheredNodeAggregate->coveredDimensionSpacePoints, diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php index 65a3abcb364..34cda7508ca 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php @@ -122,7 +122,7 @@ function () use ($nodeAggregate, $originDimensionSpacePoint, $tetheredNodeName, 'The tethered child node "' . $tetheredNodeAggregate->nodeName->value . '" should be removed.', function () use ($tetheredNodeAggregate) { - return $this->removeNodeAggregate($tetheredNodeAggregate); + return $this->removeNodeAggregate($this->projectedNodeIterator->contentGraph, $tetheredNodeAggregate); } ); } @@ -154,8 +154,8 @@ function () use ($tetheredNodeAggregate) { . ' - actual: ' . implode(', ', array_keys($actualTetheredChildNodes)), fn () => $this->reorderNodes( - WorkspaceName::fromString('todo'), // TODO read from $nodeAggregate - $nodeAggregate->contentStreamId, + $this->projectedNodeIterator->contentGraph->getWorkspaceName(), + $this->projectedNodeIterator->contentGraph->getContentStreamId(), $nodeAggregate->getCoverageByOccupant($originDimensionSpacePoint), $actualTetheredChildNodes, array_keys($expectedTetheredNodes) diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/UnknownNodeTypeAdjustment.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/UnknownNodeTypeAdjustment.php index 0b7d2363cf9..e2ca74e21f2 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/UnknownNodeTypeAdjustment.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/UnknownNodeTypeAdjustment.php @@ -40,7 +40,7 @@ private function removeAllNodesOfType(NodeTypeName $nodeTypeName): \Generator 'The node type "' . $nodeTypeName->value . '" is not found; so the node should be removed (or converted)', function () use ($nodeAggregate) { - return $this->removeNodeAggregate($nodeAggregate); + return $this->removeNodeAggregate($this->projectedNodeIterator->contentGraph, $nodeAggregate); } ); } From 8140490f2b816db25651b5527cf093de6265a6a6 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 17 May 2024 14:10:56 +0200 Subject: [PATCH 06/17] Fix behat tests --- .../Behavior/Features/Export/Export.feature | 5 +++-- .../Behavior/Features/Import/Import.feature | 18 +++++++++++------- .../Bootstrap/Features/NodeCreation.php | 6 ++++++ .../Bootstrap/Features/NodeModification.php | 3 +++ .../Features/Bootstrap/Features/NodeMove.php | 3 +++ .../Bootstrap/Features/NodeReferencing.php | 3 +++ .../Bootstrap/Features/NodeRemoval.php | 3 +++ .../Bootstrap/Features/SubtreeTagging.php | 6 ++++++ .../Classes/ContentRepositoryRegistry.php | 1 + 9 files changed, 39 insertions(+), 9 deletions(-) diff --git a/Neos.ContentRepository.Export/Tests/Behavior/Features/Export/Export.feature b/Neos.ContentRepository.Export/Tests/Behavior/Features/Export/Export.feature index 4ec48a59b49..4397f8ae581 100644 --- a/Neos.ContentRepository.Export/Tests/Behavior/Features/Export/Export.feature +++ b/Neos.ContentRepository.Export/Tests/Behavior/Features/Export/Export.feature @@ -25,6 +25,7 @@ Feature: As a user of the CR I want to export the event stream | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -40,7 +41,7 @@ Feature: As a user of the CR I want to export the event stream When the events are exported Then I expect the following jsonl: """ - {"identifier":"random-event-uuid","type":"RootNodeAggregateWithNodeWasCreated","payload":{"contentStreamId":"cs-identifier","nodeAggregateId":"lady-eleonode-rootford","nodeTypeName":"Neos.ContentRepository:Root","coveredDimensionSpacePoints":[{"language":"de"},{"language":"gsw"},{"language":"fr"}],"nodeAggregateClassification":"root"},"metadata":{"commandClass":"Neos\\ContentRepository\\Core\\Feature\\RootNodeCreation\\Command\\CreateRootNodeAggregateWithNode","commandPayload":{"workspaceName":"live","nodeAggregateId":"lady-eleonode-rootford","nodeTypeName":"Neos.ContentRepository:Root","tetheredDescendantNodeAggregateIds":[]},"initiatingUserId":"system","initiatingTimestamp":"random-time"}} - {"identifier":"random-event-uuid","type":"NodeAggregateWithNodeWasCreated","payload":{"contentStreamId":"cs-identifier","nodeAggregateId":"nody-mc-nodeface","nodeTypeName":"Neos.ContentRepository.Testing:Document","originDimensionSpacePoint":{"language":"de"},"succeedingSiblingsForCoverage":[{"dimensionSpacePoint":{"language":"de"},"nodeAggregateId":null},{"dimensionSpacePoint":{"language":"gsw"},"nodeAggregateId":null},{"dimensionSpacePoint":{"language":"fr"},"nodeAggregateId":null}],"parentNodeAggregateId":"lady-eleonode-rootford","nodeName":"child-document","initialPropertyValues":[],"nodeAggregateClassification":"regular"},"metadata":{"initiatingTimestamp":"random-time"}} + {"identifier":"random-event-uuid","type":"RootNodeAggregateWithNodeWasCreated","payload":{"workspaceName":"live","contentStreamId":"cs-identifier","nodeAggregateId":"lady-eleonode-rootford","nodeTypeName":"Neos.ContentRepository:Root","coveredDimensionSpacePoints":[{"language":"de"},{"language":"gsw"},{"language":"fr"}],"nodeAggregateClassification":"root"},"metadata":{"commandClass":"Neos\\ContentRepository\\Core\\Feature\\RootNodeCreation\\Command\\CreateRootNodeAggregateWithNode","commandPayload":{"workspaceName":"live","nodeAggregateId":"lady-eleonode-rootford","nodeTypeName":"Neos.ContentRepository:Root","tetheredDescendantNodeAggregateIds":[]},"initiatingUserId":"system","initiatingTimestamp":"random-time"}} + {"identifier":"random-event-uuid","type":"NodeAggregateWithNodeWasCreated","payload":{"workspaceName":"live","contentStreamId":"cs-identifier","nodeAggregateId":"nody-mc-nodeface","nodeTypeName":"Neos.ContentRepository.Testing:Document","originDimensionSpacePoint":{"language":"de"},"succeedingSiblingsForCoverage":[{"dimensionSpacePoint":{"language":"de"},"nodeAggregateId":null},{"dimensionSpacePoint":{"language":"gsw"},"nodeAggregateId":null},{"dimensionSpacePoint":{"language":"fr"},"nodeAggregateId":null}],"parentNodeAggregateId":"lady-eleonode-rootford","nodeName":"child-document","initialPropertyValues":[],"nodeAggregateClassification":"regular"},"metadata":{"initiatingTimestamp":"random-time"}} """ diff --git a/Neos.ContentRepository.Export/Tests/Behavior/Features/Import/Import.feature b/Neos.ContentRepository.Export/Tests/Behavior/Features/Import/Import.feature index 1b9e97ed65f..39a535ff64e 100644 --- a/Neos.ContentRepository.Export/Tests/Behavior/Features/Import/Import.feature +++ b/Neos.ContentRepository.Export/Tests/Behavior/Features/Import/Import.feature @@ -16,8 +16,8 @@ Feature: As a user of the CR I want to export the event stream Then I expect exactly 0 events to be published on stream with prefix "ContentStream:cs-identifier" Given using the following events.jsonl: """ - {"identifier":"9f64c281-e5b0-48d9-900b-288a8faf92a9","type":"RootNodeAggregateWithNodeWasCreated","payload":{"contentStreamId":"cs-imported-identifier","nodeAggregateId":"acme-site-sites","nodeTypeName":"Neos.Neos:Sites","coveredDimensionSpacePoints":[[]],"nodeAggregateClassification":"root"},"metadata":[]} - {"identifier":"1640ebbf-7ffe-4526-b0f4-7575cefabfab","type":"NodeAggregateWithNodeWasCreated","payload":{"contentStreamId":"cs-imported-identifier","nodeAggregateId":"acme-site","nodeTypeName":"Vendor.Site:HomePage","originDimensionSpacePoint":[],"succeedingSiblingsForCoverage":[{"dimensionSpacePoint":[],"nodeAggregateId":null}],"parentNodeAggregateId":"acme-site-sites","nodeName":"acme-site","initialPropertyValues":{"title":{"value":"My Site","type":"string"},"uriPathSegment":{"value":"my-site","type":"string"}},"nodeAggregateClassification":"regular"},"metadata":[]} + {"identifier":"9f64c281-e5b0-48d9-900b-288a8faf92a9","type":"RootNodeAggregateWithNodeWasCreated","payload":{"workspaceName":"workspace-name","contentStreamId":"cs-imported-identifier","nodeAggregateId":"acme-site-sites","nodeTypeName":"Neos.Neos:Sites","coveredDimensionSpacePoints":[[]],"nodeAggregateClassification":"root"},"metadata":[]} + {"identifier":"1640ebbf-7ffe-4526-b0f4-7575cefabfab","type":"NodeAggregateWithNodeWasCreated","payload":{"workspaceName":"workspace-name","contentStreamId":"cs-imported-identifier","nodeAggregateId":"acme-site","nodeTypeName":"Vendor.Site:HomePage","originDimensionSpacePoint":[],"succeedingSiblingsForCoverage":[{"dimensionSpacePoint":[],"nodeAggregateId":null}],"parentNodeAggregateId":"acme-site-sites","nodeName":"acme-site","initialPropertyValues":{"title":{"value":"My Site","type":"string"},"uriPathSegment":{"value":"my-site","type":"string"}},"nodeAggregateClassification":"regular"},"metadata":[]} """ And I import the events.jsonl into "cs-identifier" Then I expect exactly 3 events to be published on stream with prefix "ContentStream:cs-identifier" @@ -26,11 +26,13 @@ Feature: As a user of the CR I want to export the event stream | contentStreamId | "cs-identifier" | And event at index 1 is of type "RootNodeAggregateWithNodeWasCreated" with payload: | Key | Expected | + | workspaceName | "workspace-name" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "acme-site-sites" | | nodeTypeName | "Neos.Neos:Sites" | And event at index 2 is of type "NodeAggregateWithNodeWasCreated" with payload: | Key | Expected | + | workspaceName | "workspace-name" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "acme-site" | | nodeTypeName | "Vendor.Site:HomePage" | @@ -39,8 +41,8 @@ Feature: As a user of the CR I want to export the event stream Then I expect exactly 0 events to be published on stream with prefix "ContentStream:cs-imported-identifier" Given using the following events.jsonl: """ - {"identifier":"9f64c281-e5b0-48d9-900b-288a8faf92a9","type":"RootNodeAggregateWithNodeWasCreated","payload":{"contentStreamId":"cs-imported-identifier","nodeAggregateId":"acme-site-sites","nodeTypeName":"Neos.Neos:Sites","coveredDimensionSpacePoints":[[]],"nodeAggregateClassification":"root"},"metadata":[]} - {"identifier":"1640ebbf-7ffe-4526-b0f4-7575cefabfab","type":"NodeAggregateWithNodeWasCreated","payload":{"contentStreamId":"cs-imported-identifier","nodeAggregateId":"acme-site","nodeTypeName":"Vendor.Site:HomePage","originDimensionSpacePoint":[],"succeedingSiblingsForCoverage":[{"dimensionSpacePoint":[],"nodeAggregateId":null}],"parentNodeAggregateId":"acme-site-sites","nodeName":"acme-site","initialPropertyValues":{"title":{"value":"My Site","type":"string"},"uriPathSegment":{"value":"my-site","type":"string"}},"nodeAggregateClassification":"regular"},"metadata":[]} + {"identifier":"9f64c281-e5b0-48d9-900b-288a8faf92a9","type":"RootNodeAggregateWithNodeWasCreated","payload":{"workspaceName":"workspace-name","contentStreamId":"cs-imported-identifier","nodeAggregateId":"acme-site-sites","nodeTypeName":"Neos.Neos:Sites","coveredDimensionSpacePoints":[[]],"nodeAggregateClassification":"root"},"metadata":[]} + {"identifier":"1640ebbf-7ffe-4526-b0f4-7575cefabfab","type":"NodeAggregateWithNodeWasCreated","payload":{"workspaceName":"workspace-name","contentStreamId":"cs-imported-identifier","nodeAggregateId":"acme-site","nodeTypeName":"Vendor.Site:HomePage","originDimensionSpacePoint":[],"succeedingSiblingsForCoverage":[{"dimensionSpacePoint":[],"nodeAggregateId":null}],"parentNodeAggregateId":"acme-site-sites","nodeName":"acme-site","initialPropertyValues":{"title":{"value":"My Site","type":"string"},"uriPathSegment":{"value":"my-site","type":"string"}},"nodeAggregateClassification":"regular"},"metadata":[]} """ And I import the events.jsonl Then I expect exactly 3 events to be published on stream with prefix "ContentStream:cs-imported-identifier" @@ -49,11 +51,13 @@ Feature: As a user of the CR I want to export the event stream | contentStreamId | "cs-imported-identifier" | And event at index 1 is of type "RootNodeAggregateWithNodeWasCreated" with payload: | Key | Expected | + | workspaceName | "workspace-name" | | contentStreamId | "cs-imported-identifier" | | nodeAggregateId | "acme-site-sites" | | nodeTypeName | "Neos.Neos:Sites" | And event at index 2 is of type "NodeAggregateWithNodeWasCreated" with payload: | Key | Expected | + | workspaceName | "workspace-name" | | contentStreamId | "cs-imported-identifier" | | nodeAggregateId | "acme-site" | | nodeTypeName | "Vendor.Site:HomePage" | @@ -63,9 +67,9 @@ Feature: As a user of the CR I want to export the event stream Given using the following events.jsonl: """ - {"identifier":"5f2da12d-7037-4524-acb0-d52037342c77","type":"ContentStreamWasCreated","payload":{"contentStreamId":"cs-imported-identifier"},"metadata":[]} - {"identifier":"9f64c281-e5b0-48d9-900b-288a8faf92a9","type":"RootNodeAggregateWithNodeWasCreated","payload":{"contentStreamId":"cs-imported-identifier","nodeAggregateId":"acme-site-sites","nodeTypeName":"Neos.Neos:Sites","coveredDimensionSpacePoints":[[]],"nodeAggregateClassification":"root"},"metadata":[]} - {"identifier":"1640ebbf-7ffe-4526-b0f4-7575cefabfab","type":"NodeAggregateWithNodeWasCreated","payload":{"contentStreamId":"cs-imported-identifier","nodeAggregateId":"acme-site","nodeTypeName":"Vendor.Site:HomePage","originDimensionSpacePoint":[],"coveredDimensionSpacePoints":[[]],"parentNodeAggregateId":"acme-site-sites","nodeName":"acme-site","initialPropertyValues":{"title":{"value":"My Site","type":"string"},"uriPathSegment":{"value":"my-site","type":"string"}},"nodeAggregateClassification":"regular","succeedingNodeAggregateId":null},"metadata":[]} + {"identifier":"5f2da12d-7037-4524-acb0-d52037342c77","type":"ContentStreamWasCreated","payload":{"workspaceName":"workspace-name","contentStreamId":"cs-imported-identifier"},"metadata":[]} + {"identifier":"9f64c281-e5b0-48d9-900b-288a8faf92a9","type":"RootNodeAggregateWithNodeWasCreated","payload":{"workspaceName":"workspace-name","contentStreamId":"cs-imported-identifier","nodeAggregateId":"acme-site-sites","nodeTypeName":"Neos.Neos:Sites","coveredDimensionSpacePoints":[[]],"nodeAggregateClassification":"root"},"metadata":[]} + {"identifier":"1640ebbf-7ffe-4526-b0f4-7575cefabfab","type":"NodeAggregateWithNodeWasCreated","payload":{"workspaceName":"workspace-name","contentStreamId":"cs-imported-identifier","nodeAggregateId":"acme-site","nodeTypeName":"Vendor.Site:HomePage","originDimensionSpacePoint":[],"coveredDimensionSpacePoints":[[]],"parentNodeAggregateId":"acme-site-sites","nodeName":"acme-site","initialPropertyValues":{"title":{"value":"My Site","type":"string"},"uriPathSegment":{"value":"my-site","type":"string"}},"nodeAggregateClassification":"regular","succeedingNodeAggregateId":null},"metadata":[]} """ And I import the events.jsonl diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php index d9fe8b59c92..490a6f6ccbd 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php @@ -94,6 +94,9 @@ public function theCommandCreateRootNodeAggregateWithNodeIsExecutedWithPayloadAn public function theEventRootNodeAggregateWithNodeWasCreatedWasPublishedToStreamWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); + if (!isset($eventPayload['workspaceName'])) { + $eventPayload['workspaceName'] = 'some-workspace'; + } $contentStreamId = ContentStreamId::fromString($eventPayload['contentStreamId']); $nodeAggregateId = NodeAggregateId::fromString($eventPayload['nodeAggregateId']); $streamName = ContentStreamEventStreamName::fromContentStreamId($contentStreamId); @@ -278,6 +281,9 @@ public function theCommandCreateNodeAggregateWithNodeAndSerializedPropertiesIsEx public function theEventNodeAggregateWithNodeWasCreatedWasPublishedToStreamWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); + if (!isset($eventPayload['workspaceName'])) { + $eventPayload['workspaceName'] = 'some-workspace'; + } if (!isset($eventPayload['initialPropertyValues'])) { $eventPayload['initialPropertyValues'] = []; } diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeModification.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeModification.php index df53480a408..3d08cd7ed50 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeModification.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeModification.php @@ -85,6 +85,9 @@ public function theCommandSetPropertiesIsExecutedWithPayloadAndExceptionsAreCaug public function theEventNodePropertiesWereSetWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); + if (!isset($eventPayload['workspaceName'])) { + $eventPayload['workspaceName'] = 'some-workspace'; + } if (!isset($eventPayload['originDimensionSpacePoint'])) { $eventPayload['originDimensionSpacePoint'] = json_encode($this->currentDimensionSpacePoint); } diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeMove.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeMove.php index fcced8fa130..f8af5efcb5e 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeMove.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeMove.php @@ -97,6 +97,9 @@ public function theCommandMoveNodeIsExecutedWithPayloadAndExceptionsAreCaught(Ta public function theEventNodeAggregateWasMovedWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); + if (!isset($eventPayload['workspaceName'])) { + $eventPayload['workspaceName'] = 'some-workspace'; + } $contentStreamId = ContentStreamId::fromString($eventPayload['contentStreamId']); $streamName = ContentStreamEventStreamName::fromContentStreamId($contentStreamId); diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php index bffc305d9b7..995b9d746bb 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php @@ -100,6 +100,9 @@ public function theCommandSetNodeReferencesIsExecutedWithPayloadAndExceptionsAre public function theEventNodeReferencesWereSetWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); + if (!isset($eventPayload['workspaceName'])) { + $eventPayload['workspaceName'] = 'some-workspace'; + } $contentStreamId = ContentStreamId::fromString($eventPayload['contentStreamId']); $streamName = ContentStreamEventStreamName::fromContentStreamId( $contentStreamId diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRemoval.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRemoval.php index 8a6a0139f71..77ac300f3a1 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRemoval.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRemoval.php @@ -86,6 +86,9 @@ public function theCommandRemoveNodeAggregateIsExecutedWithPayloadAndExceptionsA public function theEventNodeAggregateWasRemovedWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); + if (!isset($eventPayload['workspaceName'])) { + $eventPayload['workspaceName'] = 'some-workspace'; + } $contentStreamId = ContentStreamId::fromString($eventPayload['contentStreamId']); $streamName = ContentStreamEventStreamName::fromContentStreamId($contentStreamId); diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/SubtreeTagging.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/SubtreeTagging.php index 3a4c78dba9b..f2df8e433cc 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/SubtreeTagging.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/SubtreeTagging.php @@ -85,6 +85,9 @@ public function theCommandTagSubtreeIsExecutedWithPayloadAndExceptionsAreCaught( public function theEventSubtreeWasTaggedWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); + if (!isset($eventPayload['workspaceName'])) { + $eventPayload['workspaceName'] = 'some-workspace'; + } $streamName = ContentStreamEventStreamName::fromContentStreamId( ContentStreamId::fromString($eventPayload['contentStreamId']) ); @@ -101,6 +104,9 @@ public function theEventSubtreeWasTaggedWasPublishedWithPayload(TableNode $paylo public function theEventSubtreeWasUntaggedWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); + if (!isset($eventPayload['workspaceName'])) { + $eventPayload['workspaceName'] = 'some-workspace'; + } $streamName = ContentStreamEventStreamName::fromContentStreamId( ContentStreamId::fromString($eventPayload['contentStreamId']) ); diff --git a/Neos.ContentRepositoryRegistry/Classes/ContentRepositoryRegistry.php b/Neos.ContentRepositoryRegistry/Classes/ContentRepositoryRegistry.php index 4900eb13451..1fd7cc04910 100644 --- a/Neos.ContentRepositoryRegistry/Classes/ContentRepositoryRegistry.php +++ b/Neos.ContentRepositoryRegistry/Classes/ContentRepositoryRegistry.php @@ -3,6 +3,7 @@ namespace Neos\ContentRepositoryRegistry; +use Doctrine\DBAL\Connection; use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\Dimension\ContentDimensionSourceInterface; use Neos\ContentRepository\Core\Factory\ContentRepositoryFactory; From 0f463611036bf20ac79995360011a316a9063e32 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 17 May 2024 15:14:14 +0200 Subject: [PATCH 07/17] Provide event migration --- .../MigrateEventsCommandController.php | 16 +++++ .../Classes/Service/EventMigrationService.php | 69 +++++++++++++++++-- 2 files changed, 81 insertions(+), 4 deletions(-) diff --git a/Neos.ContentRepositoryRegistry/Classes/Command/MigrateEventsCommandController.php b/Neos.ContentRepositoryRegistry/Classes/Command/MigrateEventsCommandController.php index 29cfcad991c..d3a5ec19d3d 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Command/MigrateEventsCommandController.php +++ b/Neos.ContentRepositoryRegistry/Classes/Command/MigrateEventsCommandController.php @@ -48,4 +48,20 @@ public function migrateMetaDataToWorkspaceNameCommand(string $contentRepository $eventMigrationService = $this->contentRepositoryRegistry->buildService($contentRepositoryId, $this->eventMigrationServiceFactory); $eventMigrationService->migrateMetaDataToWorkspaceName($this->outputLine(...)); } + + /** + * Adds the "workspaceName" to the data of all content stream related events + * + * Needed for feature "Add workspaceName to relevant events": https://github.com/neos/neos-development-collection/issues/4996 + * + * Included in May 2024 - before final Neos 9.0 release + * + * @param string $contentRepository Identifier of the Content Repository to migrate + */ + public function migratePayloadToWorkspaceNameCommand(string $contentRepository = 'default'): void + { + $contentRepositoryId = ContentRepositoryId::fromString($contentRepository); + $eventMigrationService = $this->contentRepositoryRegistry->buildService($contentRepositoryId, $this->eventMigrationServiceFactory); + $eventMigrationService->migratePayloadToWorkspaceName($this->outputLine(...)); + } } diff --git a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php index a22831bf7bf..e76e7544653 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php +++ b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php @@ -1,4 +1,5 @@ eventsModified = []; $warnings = 0; @@ -101,7 +103,7 @@ public function migratePropertiesToUnset(\Closure $outputFn) // migrate payload if ($eventEnvelope->event->type->value === 'NodePropertiesWereSet') { - $eventData = json_decode($eventEnvelope->event->data->value, true); + $eventData = self::decodeEventPayload($eventEnvelope); if (isset($eventData['propertiesToUnset'])) { // is already new event type with field continue; @@ -155,7 +157,7 @@ public function migratePropertiesToUnset(\Closure $outputFn) } if ($eventEnvelope->event->type->value === 'NodeAggregateWithNodeWasCreated') { - $eventData = json_decode($eventEnvelope->event->data->value, true); + $eventData = self::decodeEventPayload($eventEnvelope); // omit null setters $propertiesWithNullValues = 0; foreach ($eventData['initialPropertyValues'] as $key => $value) { @@ -245,7 +247,7 @@ public function migratePropertiesToUnset(\Closure $outputFn) * @param \Closure $outputFn * @return void */ - public function migrateMetaDataToWorkspaceName(\Closure $outputFn) + public function migrateMetaDataToWorkspaceName(\Closure $outputFn): void { $this->eventsModified = []; @@ -312,6 +314,65 @@ public function migrateMetaDataToWorkspaceName(\Closure $outputFn) $outputFn(sprintf('Migration applied to %s events.', count($this->eventsModified))); } + /** + * Adds the "workspaceName" to the data of all content stream related events + * + * Needed for feature "Add workspaceName to relevant events": https://github.com/neos/neos-development-collection/issues/4996 + * + * Included in May 2024 - before final Neos 9.0 release + * + * @param \Closure $outputFn + * @return void + */ + public function migratePayloadToWorkspaceName(\Closure $outputFn): void + { + + $backupEventTableName = DoctrineEventStoreFactory::databaseTableName($this->contentRepositoryId) . '_bkp_' . date('Y_m_d_H_i_s'); + $outputFn('Backup: copying events table to %s', [$backupEventTableName]); + $this->copyEventTable($backupEventTableName); + + $numberOfMigratedEvents = 0; + $workspaceNamesByContentStreamId = []; + + foreach ($this->eventStore->load(VirtualStreamName::all()) as $eventEnvelope) { + $eventType = $eventEnvelope->event->type->value; + if (in_array($eventType, ['RootWorkspaceWasCreated', 'WorkspaceBaseWorkspaceWasChanged', 'WorkspaceWasCreated', 'WorkspaceWasDiscarded', 'WorkspaceWasRebased'], true)) { + $eventData = self::decodeEventPayload($eventEnvelope); + $workspaceNamesByContentStreamId[$eventData['newContentStreamId']] = $eventData['workspaceName']; + continue; + } + if (in_array($eventType, ['WorkspaceWasPartiallyPublished', 'WorkspaceWasPartiallyPublished', 'WorkspaceWasPublished'], true)) { + $eventData = self::decodeEventPayload($eventEnvelope); + $workspaceNamesByContentStreamId[$eventData['newSourceContentStreamId']] = $eventData['sourceWorkspaceName']; + continue; + } + if (!in_array($eventType, ['DimensionShineThroughWasAdded', 'DimensionSpacePointWasMoved', 'NodeAggregateWithNodeWasCreated', 'NodeAggregateWasDisabled', 'NodeAggregateWasEnabled', 'NodePropertiesWereSet', 'NodeAggregateWasMoved', 'NodeReferencesWereSet', 'NodeAggregateWasRemoved', 'NodeAggregateNameWasChanged', 'NodeAggregateTypeWasChanged', 'NodeGeneralizationVariantWasCreated', 'NodePeerVariantWasCreated', 'NodeSpecializationVariantWasCreated', 'RootNodeAggregateDimensionsWereUpdated', 'RootNodeAggregateWithNodeWasCreated', 'SubtreeWasTagged', 'SubtreeWasUntagged'], true)) { + continue; + } + $eventData = self::decodeEventPayload($eventEnvelope); + $this->updateEventPayload($eventEnvelope->sequenceNumber, [...$eventData, 'workspaceName' => $workspaceNamesByContentStreamId[$eventData['contentStreamId']]]); + $numberOfMigratedEvents++; + } + if ($numberOfMigratedEvents === 0) { + $outputFn('Migration was not necessary.'); + return; + } + + $outputFn(); + $outputFn(sprintf('Migration applied to %s events.', $numberOfMigratedEvents)); + } + + /** ------------------------ */ + + private static function decodeEventPayload(EventEnvelope $eventEnvelope): array + { + try { + return json_decode($eventEnvelope->event->data->value, true, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $e) { + throw new \RuntimeException(sprintf('Failed to JSON-decode event payload of event #%d: %s', $eventEnvelope->sequenceNumber->value, $e->getMessage()), 1715951538, $e); + } + } + /** * @param array $payload */ From ded6c133e9b7cc8759116799e0777be548096124 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 17 May 2024 15:27:27 +0200 Subject: [PATCH 08/17] Remove unused namespace imports and add missing type annotation --- .../Feature/Common/EmbedsContentStreamAndNodeAggregateId.php | 1 - .../Classes/Feature/Common/TetheredNodeInternals.php | 1 - .../Classes/Service/EventMigrationService.php | 3 +++ 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php b/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php index 1427ceb64c3..7c8ab207d76 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsContentStreamAndNodeAggregateId.php @@ -16,7 +16,6 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; -use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * This interface is implemented by **events** which contain ContentStreamId and NodeAggregateId. diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php b/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php index e5251b18094..2b8ffacb6e6 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/TetheredNodeInternals.php @@ -28,7 +28,6 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateClassification; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; -use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * @internal implementation details of command handlers diff --git a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php index e76e7544653..6de78373416 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php +++ b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php @@ -364,6 +364,9 @@ public function migratePayloadToWorkspaceName(\Closure $outputFn): void /** ------------------------ */ + /** + * @return array + */ private static function decodeEventPayload(EventEnvelope $eventEnvelope): array { try { From 4f3dcc558bf00082637c1a9a4de868f31f183069 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 17 May 2024 18:01:59 +0200 Subject: [PATCH 09/17] Remove obsolete todo comment --- .../Classes/NodeDataToEventsProcessor.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php index 04808324330..2a534f37712 100644 --- a/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php +++ b/Neos.ContentRepository.LegacyNodeMigration/Classes/NodeDataToEventsProcessor.php @@ -95,7 +95,7 @@ public function __construct( ) { $this->sitesNodeTypeName = NodeTypeNameFactory::forSites(); $this->contentStreamId = ContentStreamId::create(); - $this->workspaceName = WorkspaceName::forLive(); // TODO should this be configurable? + $this->workspaceName = WorkspaceName::forLive(); $this->visitedNodes = new VisitedNodeAggregates(); } From d4f40e391f2fc75681a470e22b836810653f89b9 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 17 May 2024 18:02:56 +0200 Subject: [PATCH 10/17] Fix event migration --- .../Classes/Service/EventMigrationService.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php index 6de78373416..41583dc5acb 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php +++ b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php @@ -336,12 +336,12 @@ public function migratePayloadToWorkspaceName(\Closure $outputFn): void foreach ($this->eventStore->load(VirtualStreamName::all()) as $eventEnvelope) { $eventType = $eventEnvelope->event->type->value; - if (in_array($eventType, ['RootWorkspaceWasCreated', 'WorkspaceBaseWorkspaceWasChanged', 'WorkspaceWasCreated', 'WorkspaceWasDiscarded', 'WorkspaceWasRebased'], true)) { + if (in_array($eventType, ['RootWorkspaceWasCreated', 'WorkspaceBaseWorkspaceWasChanged', 'WorkspaceWasCreated', 'WorkspaceWasDiscarded', 'WorkspaceWasPartiallyDiscarded', 'WorkspaceWasRebased'], true)) { $eventData = self::decodeEventPayload($eventEnvelope); $workspaceNamesByContentStreamId[$eventData['newContentStreamId']] = $eventData['workspaceName']; continue; } - if (in_array($eventType, ['WorkspaceWasPartiallyPublished', 'WorkspaceWasPartiallyPublished', 'WorkspaceWasPublished'], true)) { + if (in_array($eventType, ['WorkspaceWasPartiallyPublished', 'WorkspaceWasPublished'], true)) { $eventData = self::decodeEventPayload($eventEnvelope); $workspaceNamesByContentStreamId[$eventData['newSourceContentStreamId']] = $eventData['sourceWorkspaceName']; continue; From b4e533de8aa12e41e6a80955ed31035daf2f6307 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Fri, 17 May 2024 19:32:24 +0200 Subject: [PATCH 11/17] Tweak event migration --- .../Classes/Service/EventMigrationService.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php index 41583dc5acb..f865d275860 100644 --- a/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php +++ b/Neos.ContentRepositoryRegistry/Classes/Service/EventMigrationService.php @@ -21,6 +21,7 @@ use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\CreateRootNodeAggregateWithNode; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\UpdateRootNodeAggregateDimensions; use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\ContentRepositoryRegistry\Command\MigrateEventsCommandController; use Neos\ContentRepositoryRegistry\Factory\EventStore\DoctrineEventStoreFactory; use Neos\EventStore\EventStoreInterface; @@ -350,7 +351,11 @@ public function migratePayloadToWorkspaceName(\Closure $outputFn): void continue; } $eventData = self::decodeEventPayload($eventEnvelope); - $this->updateEventPayload($eventEnvelope->sequenceNumber, [...$eventData, 'workspaceName' => $workspaceNamesByContentStreamId[$eventData['contentStreamId']]]); + $workspaceName = $workspaceNamesByContentStreamId[$eventData['contentStreamId']] ?? null; + if ($workspaceName === null) { + $workspaceName = WorkspaceName::fromString('missing'); + } + $this->updateEventPayload($eventEnvelope->sequenceNumber, [...$eventData, 'workspaceName' => $workspaceName]); $numberOfMigratedEvents++; } if ($numberOfMigratedEvents === 0) { From f635c9e821935dc2e806592132afb3c57e0befd9 Mon Sep 17 00:00:00 2001 From: mhsdesign <85400359+mhsdesign@users.noreply.github.com> Date: Fri, 17 May 2024 21:33:07 +0200 Subject: [PATCH 12/17] TASK: Use `$contentGraph->getContentStreamId()` instead of from `$nodeAggregate` --- .../src/Adjustment/DisallowedChildNodeAdjustment.php | 2 +- .../src/Adjustment/RemoveNodeAggregateTrait.php | 2 +- .../src/Adjustment/TetheredNodeAdjustments.php | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php index 866417306df..8e1562ae6cf 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/DisallowedChildNodeAdjustment.php @@ -138,7 +138,7 @@ private function removeNodeInSingleDimensionSpacePoint( ); $streamName = ContentStreamEventStreamName::fromContentStreamId( - $nodeAggregate->contentStreamId + $this->projectedNodeIterator->contentGraph->getContentStreamId() ); return new EventsToPublish( diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/RemoveNodeAggregateTrait.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/RemoveNodeAggregateTrait.php index 0a93a3ce02b..50d39f7e91c 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/RemoveNodeAggregateTrait.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/RemoveNodeAggregateTrait.php @@ -27,7 +27,7 @@ private function removeNodeAggregate(ContentGraphInterface $contentGraph, NodeAg ); $streamName = ContentStreamEventStreamName::fromContentStreamId( - $tetheredNodeAggregate->contentStreamId + $contentGraph->getContentStreamId() ); return new EventsToPublish( $streamName->getEventStreamName(), diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php index f9c143ea276..4cb92da405e 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php @@ -88,7 +88,9 @@ function () use ($nodeAggregate, $originDimensionSpacePoint, $tetheredNodeTypeDe null ); - $streamName = ContentStreamEventStreamName::fromContentStreamId($nodeAggregate->contentStreamId); + $streamName = ContentStreamEventStreamName::fromContentStreamId( + $this->projectedNodeIterator->contentGraph->getContentStreamId() + ); return new EventsToPublish( $streamName->getEventStreamName(), $events, From eabb9903fd4646ac62835cc9520479152647a8be Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Sat, 18 May 2024 15:26:28 +0200 Subject: [PATCH 13/17] Add workspaceName to all relevant events in behat tests --- .../HierarchyIntegrityIsProvided.feature | 1 + .../NodesHaveAtMostOneParentPerSubgraph.feature | 3 +++ .../ReferenceIntegrityIsProvided.feature | 2 ++ .../SubtreeTagsAreInherited.feature | 1 + .../07-MoveNodeAggregateWithoutDimensions.feature | 3 +++ .../01-ForkContentStream_ConstraintChecks.feature | 2 ++ ...kContentStreamWithDisabledNodesWithoutDimensions.feature | 2 ++ .../ForkContentStreamWithoutDimensions.feature | 4 ++++ .../Features/NodeCopying/CopyNode_NoDimensions.feature | 3 +++ .../NodeRemoval/RemoveNodeAggregateAfterDisabling.feature | 1 + .../AllNodesAreConnectedToARootNodePerSubgraph.feature | 6 +++++- .../AllNodesCoverTheirOrigin.feature | 2 ++ .../IntactContentGraph.feature | 5 +++++ .../NodeAggregateIdentifiersAreUniquePerSubgraph.feature | 2 ++ ...regatesAreConsistentlyClassifiedPerContentStream.feature | 2 ++ ...deAggregatesAreConsistentlyTypedPerContentStream.feature | 2 ++ .../ReferenceIntegrityIsProvided.feature | 4 ++++ .../StructureAdjustment/DisallowedChildNode.feature | 4 ++++ .../Features/StructureAdjustment/Properties.feature | 1 + .../Features/StructureAdjustment/TetheredNodes.feature | 3 +++ .../Features/StructureAdjustment/UnknownNodeType.feature | 1 + .../W10-IndividualNodeDiscarding/02-BasicFeatures.feature | 3 +++ .../03-MoreBasicFeatures.feature | 3 +++ .../04-AllFeaturePublication.feature | 3 +++ .../05-PublishMovedNodesWithoutDimensions.feature | 4 ++++ .../Workspaces/NodeOperationsOnMultipleWorkspaces.feature | 2 ++ .../Workspaces/SingleNodeOperationsOnLiveWorkspace.feature | 1 + .../Behavior/Features/Bootstrap/Features/NodeCreation.php | 6 ------ .../Features/Bootstrap/Features/NodeModification.php | 3 --- .../Behavior/Features/Bootstrap/Features/NodeMove.php | 3 --- .../Features/Bootstrap/Features/NodeReferencing.php | 3 --- .../Behavior/Features/Bootstrap/Features/NodeRemoval.php | 3 --- .../Behavior/Features/Bootstrap/Features/SubtreeTagging.php | 6 ------ .../Behavior/Features/FrontendRouting/DisableNodes.feature | 3 +++ .../Features/FrontendRouting/UnknownNodeTypes.feature | 2 ++ 35 files changed, 74 insertions(+), 25 deletions(-) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/HierarchyIntegrityIsProvided.feature b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/HierarchyIntegrityIsProvided.feature index 95d7b7dc43a..61f5f04cc0f 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/HierarchyIntegrityIsProvided.feature +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/HierarchyIntegrityIsProvided.feature @@ -26,6 +26,7 @@ Feature: Run integrity violation detection regarding hierarchy relations and nod | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/NodesHaveAtMostOneParentPerSubgraph.feature b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/NodesHaveAtMostOneParentPerSubgraph.feature index ad41177344f..c5829618048 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/NodesHaveAtMostOneParentPerSubgraph.feature +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/NodesHaveAtMostOneParentPerSubgraph.feature @@ -26,6 +26,7 @@ Feature: Run integrity violation detection regarding parent relations | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -36,6 +37,7 @@ Feature: Run integrity violation detection regarding parent relations | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -46,6 +48,7 @@ Feature: Run integrity violation detection regarding parent relations | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/ReferenceIntegrityIsProvided.feature b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/ReferenceIntegrityIsProvided.feature index edfcaf5a09e..10e10455121 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/ReferenceIntegrityIsProvided.feature +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/ReferenceIntegrityIsProvided.feature @@ -29,6 +29,7 @@ Feature: Run integrity violation detection regarding reference relations | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "source-nodandaise" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -38,6 +39,7 @@ Feature: Run integrity violation detection regarding reference relations | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "anthony-destinode" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/SubtreeTagsAreInherited.feature b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/SubtreeTagsAreInherited.feature index f26a0f4a079..13b5412ec56 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/SubtreeTagsAreInherited.feature +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/SubtreeTagsAreInherited.feature @@ -58,6 +58,7 @@ Feature: Run integrity violation detection regarding subtree tag inheritance | nodeAggregateClassification | "regular" | And the event SubtreeWasTagged was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{"language":"de"},{"language":"gsw"},{"language":"fr"}] | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/07-MoveNodeAggregateWithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/07-MoveNodeAggregateWithoutDimensions.feature index bf8c29792df..4c5a888dc44 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/07-MoveNodeAggregateWithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/07-MoveNodeAggregateWithoutDimensions.feature @@ -40,6 +40,7 @@ Feature: Move a node without content dimensions | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -50,6 +51,7 @@ Feature: Move a node without content dimensions | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -130,6 +132,7 @@ Feature: Move a node without content dimensions Scenario: Move a node to a new parent and the end of its children Given the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "lady-abigail-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/01-ForkContentStream_ConstraintChecks.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/01-ForkContentStream_ConstraintChecks.feature index ab7c62addec..ec9d1f328b5 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/01-ForkContentStream_ConstraintChecks.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/01-ForkContentStream_ConstraintChecks.feature @@ -30,6 +30,7 @@ Feature: ForkContentStream Without Dimensions | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Content" | @@ -40,6 +41,7 @@ Feature: ForkContentStream Without Dimensions | nodeAggregateClassification | "regular" | And the event NodePropertiesWereSet was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | originDimensionSpacePoint | {} | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithDisabledNodesWithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithDisabledNodesWithoutDimensions.feature index 9c75bbad71b..7c1a3d39bfb 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithDisabledNodesWithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithDisabledNodesWithoutDimensions.feature @@ -29,6 +29,7 @@ Feature: On forking a content stream, hidden nodes should be correctly copied as | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "the-great-nodini" | | nodeTypeName | "Neos.ContentRepository.Testing:Content" | @@ -39,6 +40,7 @@ Feature: On forking a content stream, hidden nodes should be correctly copied as | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nodingers-cat" | | nodeTypeName | "Neos.ContentRepository.Testing:Content" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithoutDimensions.feature index 3c813d29cc5..e11b4101278 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ContentStreamForking/ForkContentStreamWithoutDimensions.feature @@ -30,6 +30,7 @@ Feature: ForkContentStream Without Dimensions | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Content" | @@ -40,6 +41,7 @@ Feature: ForkContentStream Without Dimensions | nodeAggregateClassification | "regular" | And the event NodePropertiesWereSet was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | originDimensionSpacePoint | {} | @@ -63,6 +65,7 @@ Feature: ForkContentStream Without Dimensions | sourceContentStreamId | "cs-identifier" | And the event NodePropertiesWereSet was published with payload: | Key | Value | + | workspaceName | "user" | | contentStreamId | "user-cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | originDimensionSpacePoint | {} | @@ -92,6 +95,7 @@ Feature: ForkContentStream Without Dimensions | sourceContentStreamId | "cs-identifier" | And the event NodePropertiesWereSet was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | originDimensionSpacePoint | {} | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeCopying/CopyNode_NoDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeCopying/CopyNode_NoDimensions.feature index 981d0768d1f..26d8c20c84b 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeCopying/CopyNode_NoDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeCopying/CopyNode_NoDimensions.feature @@ -22,6 +22,7 @@ Feature: Copy nodes (without dimensions) | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -32,6 +33,7 @@ Feature: Copy nodes (without dimensions) | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -42,6 +44,7 @@ Feature: Copy nodes (without dimensions) | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateAfterDisabling.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateAfterDisabling.feature index 0af2e5895a5..93755f119ad 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateAfterDisabling.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateAfterDisabling.feature @@ -47,6 +47,7 @@ Feature: Disable a node aggregate | nodeVariantSelectionStrategy | "allVariants" | And the event NodeAggregateWasRemoved was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | affectedOccupiedDimensionSpacePoints | [{}] | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/AllNodesAreConnectedToARootNodePerSubgraph.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/AllNodesAreConnectedToARootNodePerSubgraph.feature index 42117f25546..0e7f7177809 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/AllNodesAreConnectedToARootNodePerSubgraph.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/AllNodesAreConnectedToARootNodePerSubgraph.feature @@ -24,6 +24,7 @@ Feature: Run projection integrity violation detection regarding root connection Scenario: Create a cycle When the event RootNodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "lady-eleonode-rootford" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -31,6 +32,7 @@ Feature: Run projection integrity violation detection regarding root connection | nodeAggregateClassification | "root" | When the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -41,6 +43,7 @@ Feature: Run projection integrity violation detection regarding root connection | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -50,7 +53,8 @@ Feature: Run projection integrity violation detection regarding root connection | nodeName | "child-document" | | nodeAggregateClassification | "regular" | And the event NodeAggregateWasMoved was published with payload: - | Key | Value | + | Key | Value + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | newParentNodeAggregateId | "nody-mc-nodeface" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/AllNodesCoverTheirOrigin.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/AllNodesCoverTheirOrigin.feature index 32ae377655e..994c1eb3ed8 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/AllNodesCoverTheirOrigin.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/AllNodesCoverTheirOrigin.feature @@ -28,6 +28,7 @@ Feature: Run projection integrity violation detection to find nodes that do not Scenario: Create a node not covering its origin When the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -38,6 +39,7 @@ Feature: Run projection integrity violation detection to find nodes that do not | nodeAggregateClassification | "regular" | When the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/IntactContentGraph.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/IntactContentGraph.feature index 88f0b1e18b9..7a479d0ac9d 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/IntactContentGraph.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/IntactContentGraph.feature @@ -23,6 +23,7 @@ Feature: Create an intact content graph and run integrity violation detection Scenario: Create an intact content graph When the event RootNodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "lady-eleonode-rootford" | | nodeTypeName | "Neos.ContentRepository:Root" | @@ -30,6 +31,7 @@ Feature: Create an intact content graph and run integrity violation detection | nodeAggregateClassification | "root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -40,6 +42,7 @@ Feature: Create an intact content graph and run integrity violation detection | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -50,6 +53,7 @@ Feature: Create an intact content graph and run integrity violation detection | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -60,6 +64,7 @@ Feature: Create an intact content graph and run integrity violation detection | nodeAggregateClassification | "tethered" | And the event NodeReferencesWereSet was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | sourceNodeAggregateId | "nody-mc-nodeface" | | affectedSourceOriginDimensionSpacePoints | [{"language":"de"}] | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/NodeAggregateIdentifiersAreUniquePerSubgraph.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/NodeAggregateIdentifiersAreUniquePerSubgraph.feature index 3214306c7a7..39c4193a060 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/NodeAggregateIdentifiersAreUniquePerSubgraph.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/NodeAggregateIdentifiersAreUniquePerSubgraph.feature @@ -28,6 +28,7 @@ Feature: Create two nodes with the same node aggregate identifier in the same su Scenario: Create two node variants in the same subgraph When the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -38,6 +39,7 @@ Feature: Create two nodes with the same node aggregate identifier in the same su | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/NodeAggregatesAreConsistentlyClassifiedPerContentStream.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/NodeAggregatesAreConsistentlyClassifiedPerContentStream.feature index a1dab9bff88..b77d54dc0f4 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/NodeAggregatesAreConsistentlyClassifiedPerContentStream.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/NodeAggregatesAreConsistentlyClassifiedPerContentStream.feature @@ -28,6 +28,7 @@ Feature: Run projection integrity violation detection regarding node aggregate c Scenario: Create node variants of different type When the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -38,6 +39,7 @@ Feature: Run projection integrity violation detection regarding node aggregate c | nodeAggregateClassification | "regular" | When the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/NodeAggregatesAreConsistentlyTypedPerContentStream.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/NodeAggregatesAreConsistentlyTypedPerContentStream.feature index c4ce8794373..c2ec9ff66af 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/NodeAggregatesAreConsistentlyTypedPerContentStream.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/NodeAggregatesAreConsistentlyTypedPerContentStream.feature @@ -30,6 +30,7 @@ Feature: Run projection integrity violation detection regarding node aggregate t Scenario: Create node variants of different type When the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:DocumentA" | @@ -40,6 +41,7 @@ Feature: Run projection integrity violation detection regarding node aggregate t | nodeAggregateClassification | "regular" | When the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:DocumentB" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/ReferenceIntegrityIsProvided.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/ReferenceIntegrityIsProvided.feature index 12401f354cc..ebd9f6528c8 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/ReferenceIntegrityIsProvided.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/ReferenceIntegrityIsProvided.feature @@ -26,6 +26,7 @@ Feature: Run integrity violation detection regarding reference relations | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "source-nodandaise" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -37,6 +38,7 @@ Feature: Run integrity violation detection regarding reference relations Scenario: Reference a non-existing node aggregate When the event NodeReferencesWereSet was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | sourceNodeAggregateId | "source-nodandaise" | | affectedSourceOriginDimensionSpacePoints | [{"language":"de"}] | @@ -49,6 +51,7 @@ Feature: Run integrity violation detection regarding reference relations Scenario: Reference a node aggregate not covering any of the DSPs the source does When the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "anthony-destinode" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -58,6 +61,7 @@ Feature: Run integrity violation detection regarding reference relations | nodeAggregateClassification | "regular" | And the event NodeReferencesWereSet was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | sourceNodeAggregateId | "source-nodandaise" | | affectedSourceOriginDimensionSpacePoints | [{"language":"de"}] | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DisallowedChildNode.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DisallowedChildNode.feature index bc08fc8725f..d11bf4b95e5 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DisallowedChildNode.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DisallowedChildNode.feature @@ -38,6 +38,7 @@ Feature: Remove disallowed Child Nodes and grandchild nodes # Node /document And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -49,6 +50,7 @@ Feature: Remove disallowed Child Nodes and grandchild nodes # Node /document/sub And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "subdoc" | | nodeTypeName | "Neos.ContentRepository.Testing:SubDocument" | @@ -126,6 +128,7 @@ Feature: Remove disallowed Child Nodes and grandchild nodes # Node /document And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -137,6 +140,7 @@ Feature: Remove disallowed Child Nodes and grandchild nodes # Node /document/sub And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "subdoc" | | nodeTypeName | "Neos.ContentRepository.Testing:SubDocument" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/Properties.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/Properties.feature index 9b63194f989..2edc8d07afd 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/Properties.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/Properties.feature @@ -114,6 +114,7 @@ Feature: Properties And the event NodePropertiesWereSet was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | originDimensionSpacePoint | {} | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodes.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodes.feature index 15daa4fe726..750248b3ad8 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodes.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodes.feature @@ -46,6 +46,7 @@ Feature: Tethered Nodes integrity violations # Node /document And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -58,6 +59,7 @@ Feature: Tethered Nodes integrity violations # Node /document/tethered-node And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nodewyn-tetherton" | | nodeTypeName | "Neos.ContentRepository.Testing:Tethered" | @@ -70,6 +72,7 @@ Feature: Tethered Nodes integrity violations # Node /document/tethered-node/tethered-leaf And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nodimer-tetherton" | | nodeTypeName | "Neos.ContentRepository.Testing:TetheredLeaf" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/UnknownNodeType.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/UnknownNodeType.feature index 69bea0d5390..22925ffc20f 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/UnknownNodeType.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/UnknownNodeType.feature @@ -25,6 +25,7 @@ Feature: Unknown node types # Node /document And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W10-IndividualNodeDiscarding/02-BasicFeatures.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W10-IndividualNodeDiscarding/02-BasicFeatures.feature index 89ab495782d..cc223cb9d08 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W10-IndividualNodeDiscarding/02-BasicFeatures.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W10-IndividualNodeDiscarding/02-BasicFeatures.feature @@ -36,6 +36,7 @@ Feature: Discard individual nodes (basics) | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Content" | @@ -46,6 +47,7 @@ Feature: Discard individual nodes (basics) | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Content" | @@ -56,6 +58,7 @@ Feature: Discard individual nodes (basics) | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | nodeTypeName | "Neos.ContentRepository.Testing:Image" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/03-MoreBasicFeatures.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/03-MoreBasicFeatures.feature index 8b261cc14c1..463c01f2043 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/03-MoreBasicFeatures.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/03-MoreBasicFeatures.feature @@ -36,6 +36,7 @@ Feature: Publishing individual nodes (basics) | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Content" | @@ -46,6 +47,7 @@ Feature: Publishing individual nodes (basics) | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Content" | @@ -56,6 +58,7 @@ Feature: Publishing individual nodes (basics) | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | nodeTypeName | "Neos.ContentRepository.Testing:Image" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/04-AllFeaturePublication.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/04-AllFeaturePublication.feature index d0ee08d5e57..fc456d69214 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/04-AllFeaturePublication.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/04-AllFeaturePublication.feature @@ -45,6 +45,7 @@ Feature: Publishing hide/show scenario of nodes | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Content" | @@ -55,6 +56,7 @@ Feature: Publishing hide/show scenario of nodes | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Content" | @@ -65,6 +67,7 @@ Feature: Publishing hide/show scenario of nodes | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | nodeTypeName | "Neos.ContentRepository.Testing:Image" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/05-PublishMovedNodesWithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/05-PublishMovedNodesWithoutDimensions.feature index da170cc530b..d403f26c698 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/05-PublishMovedNodesWithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W8-IndividualNodePublication/05-PublishMovedNodesWithoutDimensions.feature @@ -29,6 +29,7 @@ Feature: Publishing moved nodes without dimensions | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -39,6 +40,7 @@ Feature: Publishing moved nodes without dimensions | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -49,6 +51,7 @@ Feature: Publishing moved nodes without dimensions | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -145,6 +148,7 @@ Feature: Publishing moved nodes without dimensions Scenario: Publish the move of a node to a new parent and the end of its children Given the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "lady-abigail-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/NodeOperationsOnMultipleWorkspaces.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/NodeOperationsOnMultipleWorkspaces.feature index 43943c2e60e..eac6dd5e997 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/NodeOperationsOnMultipleWorkspaces.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/NodeOperationsOnMultipleWorkspaces.feature @@ -23,6 +23,7 @@ Feature: Single Node operations on multiple workspaces/content streams; e.g. cop | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Content" | @@ -33,6 +34,7 @@ Feature: Single Node operations on multiple workspaces/content streams; e.g. cop | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nodingers-cat" | | nodeTypeName | "Neos.ContentRepository.Testing:Content" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/SingleNodeOperationsOnLiveWorkspace.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/SingleNodeOperationsOnLiveWorkspace.feature index 4d6b6a90b55..25513e2d714 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/SingleNodeOperationsOnLiveWorkspace.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/Workspaces/SingleNodeOperationsOnLiveWorkspace.feature @@ -25,6 +25,7 @@ Feature: Single Node operations on live workspace | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Content" | diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php index 2e907cfa8c3..499376eeea2 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeCreation.php @@ -94,9 +94,6 @@ public function theCommandCreateRootNodeAggregateWithNodeIsExecutedWithPayloadAn public function theEventRootNodeAggregateWithNodeWasCreatedWasPublishedToStreamWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); - if (!isset($eventPayload['workspaceName'])) { - $eventPayload['workspaceName'] = 'some-workspace'; - } $contentStreamId = ContentStreamId::fromString($eventPayload['contentStreamId']); $nodeAggregateId = NodeAggregateId::fromString($eventPayload['nodeAggregateId']); $streamName = ContentStreamEventStreamName::fromContentStreamId($contentStreamId); @@ -280,9 +277,6 @@ public function theCommandCreateNodeAggregateWithNodeAndSerializedPropertiesIsEx public function theEventNodeAggregateWithNodeWasCreatedWasPublishedToStreamWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); - if (!isset($eventPayload['workspaceName'])) { - $eventPayload['workspaceName'] = 'some-workspace'; - } if (!isset($eventPayload['initialPropertyValues'])) { $eventPayload['initialPropertyValues'] = []; } diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeModification.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeModification.php index fbfa9be97b6..db983fd4e59 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeModification.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeModification.php @@ -85,9 +85,6 @@ public function theCommandSetPropertiesIsExecutedWithPayloadAndExceptionsAreCaug public function theEventNodePropertiesWereSetWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); - if (!isset($eventPayload['workspaceName'])) { - $eventPayload['workspaceName'] = 'some-workspace'; - } if (!isset($eventPayload['originDimensionSpacePoint'])) { $eventPayload['originDimensionSpacePoint'] = json_encode($this->currentDimensionSpacePoint); } diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeMove.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeMove.php index 9967132c479..73edb77c65c 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeMove.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeMove.php @@ -97,9 +97,6 @@ public function theCommandMoveNodeIsExecutedWithPayloadAndExceptionsAreCaught(Ta public function theEventNodeAggregateWasMovedWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); - if (!isset($eventPayload['workspaceName'])) { - $eventPayload['workspaceName'] = 'some-workspace'; - } $contentStreamId = ContentStreamId::fromString($eventPayload['contentStreamId']); $streamName = ContentStreamEventStreamName::fromContentStreamId($contentStreamId); diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php index bcd840c6227..19fc646c11c 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeReferencing.php @@ -100,9 +100,6 @@ public function theCommandSetNodeReferencesIsExecutedWithPayloadAndExceptionsAre public function theEventNodeReferencesWereSetWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); - if (!isset($eventPayload['workspaceName'])) { - $eventPayload['workspaceName'] = 'some-workspace'; - } $contentStreamId = ContentStreamId::fromString($eventPayload['contentStreamId']); $streamName = ContentStreamEventStreamName::fromContentStreamId( $contentStreamId diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRemoval.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRemoval.php index 890b6614215..9bd92a7caba 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRemoval.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/NodeRemoval.php @@ -86,9 +86,6 @@ public function theCommandRemoveNodeAggregateIsExecutedWithPayloadAndExceptionsA public function theEventNodeAggregateWasRemovedWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); - if (!isset($eventPayload['workspaceName'])) { - $eventPayload['workspaceName'] = 'some-workspace'; - } $contentStreamId = ContentStreamId::fromString($eventPayload['contentStreamId']); $streamName = ContentStreamEventStreamName::fromContentStreamId($contentStreamId); diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/SubtreeTagging.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/SubtreeTagging.php index 208186031ce..f249060dca5 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/SubtreeTagging.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/Features/SubtreeTagging.php @@ -85,9 +85,6 @@ public function theCommandTagSubtreeIsExecutedWithPayloadAndExceptionsAreCaught( public function theEventSubtreeWasTaggedWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); - if (!isset($eventPayload['workspaceName'])) { - $eventPayload['workspaceName'] = 'some-workspace'; - } $streamName = ContentStreamEventStreamName::fromContentStreamId( ContentStreamId::fromString($eventPayload['contentStreamId']) ); @@ -104,9 +101,6 @@ public function theEventSubtreeWasTaggedWasPublishedWithPayload(TableNode $paylo public function theEventSubtreeWasUntaggedWasPublishedWithPayload(TableNode $payloadTable) { $eventPayload = $this->readPayloadTable($payloadTable); - if (!isset($eventPayload['workspaceName'])) { - $eventPayload['workspaceName'] = 'some-workspace'; - } $streamName = ContentStreamEventStreamName::fromContentStreamId( ContentStreamId::fromString($eventPayload['contentStreamId']) ); diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/DisableNodes.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/DisableNodes.feature index c275c47c6e9..b05e38da33d 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/DisableNodes.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/DisableNodes.feature @@ -145,6 +145,7 @@ Feature: Routing behavior of removed, disabled and re-enabled nodes | nodeVariantSelectionStrategy | "allVariants" | And the event SubtreeWasTagged was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{}] | @@ -171,6 +172,7 @@ Feature: Routing behavior of removed, disabled and re-enabled nodes | nodeVariantSelectionStrategy | "allVariants" | And the event SubtreeWasTagged was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "earl-o-documentbourgh" | | affectedDimensionSpacePoints | [{}] | @@ -186,6 +188,7 @@ Feature: Routing behavior of removed, disabled and re-enabled nodes | nodeVariantSelectionStrategy | "allVariants" | And the event SubtreeWasUntagged was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | affectedDimensionSpacePoints | [{}] | diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/UnknownNodeTypes.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/UnknownNodeTypes.feature index a224340993d..562e602aed5 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/UnknownNodeTypes.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/UnknownNodeTypes.feature @@ -33,6 +33,7 @@ Feature: Basic routing functionality (match & resolve nodes with unknown types) Scenario: When the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "shernode-homes" | | nodeTypeName | "Neos.Neos:Test.Routing.Page" | @@ -48,6 +49,7 @@ Feature: Basic routing functionality (match & resolve nodes with unknown types) | initialPropertyValues | {"uriPathSegment": {"type": "string", "value": "david-nodenborough"}} | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "unknown-nodetype" | | nodeTypeName | "Neos.Neos:Test.Routing.NonExisting" | From a545c2183468840abb097862ec6d9929975a3f64 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Sat, 18 May 2024 15:35:44 +0200 Subject: [PATCH 14/17] Fix namespace import in TetheredNodeAdjustments --- .../src/Adjustment/TetheredNodeAdjustments.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php index 5c27bb30597..4e617902c19 100644 --- a/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php +++ b/Neos.ContentRepository.StructureAdjustment/src/Adjustment/TetheredNodeAdjustments.php @@ -20,6 +20,7 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\EventStore\Model\EventStream\ExpectedVersion; class TetheredNodeAdjustments From 7d97ebcdf33d28e3ab65d71a84bcd74e4107a1bd Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Sat, 18 May 2024 15:47:44 +0200 Subject: [PATCH 15/17] Add more workspaceNames to tests.. --- .../SiblingsAreDistinctlySorted.feature | 2 ++ .../SubtreeTagsAreInherited.feature | 3 +++ .../TetheredNodesAreNamed.feature | 2 ++ .../08-NodeMove/07-MoveNodeAggregateWithoutDimensions.feature | 1 + 4 files changed, 8 insertions(+) diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/SiblingsAreDistinctlySorted.feature b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/SiblingsAreDistinctlySorted.feature index 9d32cf24fdc..3b97374aded 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/SiblingsAreDistinctlySorted.feature +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/SiblingsAreDistinctlySorted.feature @@ -28,6 +28,7 @@ Feature: Run integrity violation detection regarding sibling sorting Scenario: Create two siblings and set the sorting to the same value When the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -37,6 +38,7 @@ Feature: Run integrity violation detection regarding sibling sorting | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "noderella-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/SubtreeTagsAreInherited.feature b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/SubtreeTagsAreInherited.feature index 13b5412ec56..2a267ab5a9a 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/SubtreeTagsAreInherited.feature +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/SubtreeTagsAreInherited.feature @@ -28,6 +28,7 @@ Feature: Run integrity violation detection regarding subtree tag inheritance Scenario: Create nodes, disable the topmost and remove some restriction edges manually When the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -38,6 +39,7 @@ Feature: Run integrity violation detection regarding subtree tag inheritance | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-nodeward-nodington-iii" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -48,6 +50,7 @@ Feature: Run integrity violation detection regarding subtree tag inheritance | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/TetheredNodesAreNamed.feature b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/TetheredNodesAreNamed.feature index fa72650db8c..c046fc63614 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/TetheredNodesAreNamed.feature +++ b/Neos.ContentGraph.DoctrineDbalAdapter/Tests/Behavior/Features/Projection/ProjectionIntegrityViolationDetection/TetheredNodesAreNamed.feature @@ -26,6 +26,7 @@ Feature: Run projection integrity violation detection regarding naming of tether | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -38,6 +39,7 @@ Feature: Run projection integrity violation detection regarding naming of tether Scenario: Remove tethered node's name When the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "nodewyn-tetherton" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/07-MoveNodeAggregateWithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/07-MoveNodeAggregateWithoutDimensions.feature index 4c5a888dc44..cf44e1cc245 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/07-MoveNodeAggregateWithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/08-NodeMove/07-MoveNodeAggregateWithoutDimensions.feature @@ -30,6 +30,7 @@ Feature: Move a node without content dimensions | nodeTypeName | "Neos.ContentRepository:Root" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | From e47bac8151d137f1876fffbb1f25c15d46776d3e Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Sat, 18 May 2024 16:05:11 +0200 Subject: [PATCH 16/17] Fix typo in behat test --- .../AllNodesAreConnectedToARootNodePerSubgraph.feature | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/AllNodesAreConnectedToARootNodePerSubgraph.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/AllNodesAreConnectedToARootNodePerSubgraph.feature index 0e7f7177809..cbf6e2c55b3 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/AllNodesAreConnectedToARootNodePerSubgraph.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/ProjectionIntegrityViolationDetection/AllNodesAreConnectedToARootNodePerSubgraph.feature @@ -53,7 +53,7 @@ Feature: Run projection integrity violation detection regarding root connection | nodeName | "child-document" | | nodeAggregateClassification | "regular" | And the event NodeAggregateWasMoved was published with payload: - | Key | Value + | Key | Value | | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | From 7caba3c4cd5018712e367075e5654fa2770fa064 Mon Sep 17 00:00:00 2001 From: Bastian Waidelich Date: Sat, 18 May 2024 16:09:27 +0200 Subject: [PATCH 17/17] one more "workspaceName"... --- .../Behavior/Features/FrontendRouting/UnknownNodeTypes.feature | 1 + 1 file changed, 1 insertion(+) diff --git a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/UnknownNodeTypes.feature b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/UnknownNodeTypes.feature index 562e602aed5..2d2d5495265 100644 --- a/Neos.Neos/Tests/Behavior/Features/FrontendRouting/UnknownNodeTypes.feature +++ b/Neos.Neos/Tests/Behavior/Features/FrontendRouting/UnknownNodeTypes.feature @@ -41,6 +41,7 @@ Feature: Basic routing functionality (match & resolve nodes with unknown types) | nodeAggregateClassification | "regular" | And the event NodeAggregateWithNodeWasCreated was published with payload: | Key | Value | + | workspaceName | "live" | | contentStreamId | "cs-identifier" | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.Neos:Test.Routing.Page" |