diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/02-NodeCreation/03-CreateNodeAggregateWithNode_WithoutDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/02-NodeCreation/03-CreateNodeAggregateWithNode_WithoutDimensions.feature index 076f8d72e2e..d71d45460a1 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/02-NodeCreation/03-CreateNodeAggregateWithNode_WithoutDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/02-NodeCreation/03-CreateNodeAggregateWithNode_WithoutDimensions.feature @@ -202,14 +202,14 @@ Feature: Create node aggregate with node | nodeAggregateId | "lady-eleonode-rootford" | | nodeTypeName | "Neos.ContentRepository:Root" | - Given the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + Given the command CreateNodeAggregateWithNode is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:NodeWithoutTetheredChildNodes" | | originDimensionSpacePoint | {} | | parentNodeAggregateId | "lady-eleonode-rootford" | | nodeName | "node" | - And the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + And the command CreateNodeAggregateWithNode is executed with payload: | Key | Value | | nodeAggregateId | "sir-nodeward-nodington-iii" | | nodeTypeName | "Neos.ContentRepository.Testing:NodeWithoutTetheredChildNodes" | @@ -280,7 +280,7 @@ Feature: Create node aggregate with node | nodeAggregateId | "lady-eleonode-rootford" | | nodeTypeName | "Neos.ContentRepository:Root" | - When the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + When the command CreateNodeAggregateWithNode is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:NodeWithTetheredChildNodes" | @@ -459,7 +459,7 @@ Feature: Create node aggregate with node | nodeAggregateId | "lady-eleonode-rootford" | | nodeTypeName | "Neos.ContentRepository:Root" | - When the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + When the command CreateNodeAggregateWithNode is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:NodeWithTetheredChildNodes" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddNewProperty_NoDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddNewProperty_NoDimensions.feature index 08f35b9c556..0f6d9270e71 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddNewProperty_NoDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/EventSourced/Migration/AddNewProperty_NoDimensions.feature @@ -13,6 +13,8 @@ Feature: Add New Property properties: text: type: string + dateTime: + type: DateTime """ And using identifier "default", I define a content repository And I am in content repository "default" @@ -64,7 +66,7 @@ Feature: Add New Property - type: 'AddNewProperty' settings: - newPropertyName: 'aDateOutsideSchema' + newPropertyName: 'dateTime' serializedValue: '2013-09-09T12:04:12+00:00' type: 'DateTime' """ @@ -82,6 +84,46 @@ Feature: Add New Property | text | "Original text" | Then I expect a node identified by migration-cs;other;{} to exist in the content graph And I expect this node to have the following properties: - | Key | Value | - | text | "fixed value" | - | aDateOutsideSchema | Date:2013-09-09T12:04:12+00:00 | + | Key | Value | + | text | "fixed value" | + | dateTime | Date:2013-09-09T12:04:12+00:00 | + + Scenario: Adding a property that is not defined in the node type schema + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs" and exceptions are caught: + """yaml + migration: + - + filters: + - + type: 'NodeType' + settings: + nodeType: 'Neos.ContentRepository.Testing:Document' + transformations: + - + type: 'AddNewProperty' + settings: + newPropertyName: 'aDateOutsideSchema' + serializedValue: '2013-09-09T12:04:12+00:00' + type: 'DateTime' + """ + Then the last command should have thrown an exception of type "PropertyCannotBeSet" + + Scenario: Adding a property with a different type than defined by the node type schema + When I run the following node migration for workspace "live", creating target workspace "migration-workspace" on contentStreamId "migration-cs" and exceptions are caught: + """yaml + migration: + - + filters: + - + type: 'NodeType' + settings: + nodeType: 'Neos.ContentRepository.Testing:Document' + transformations: + - + type: 'AddNewProperty' + settings: + newPropertyName: 'dateTime' + serializedValue: '2013-09-09T12:04:12+00:00' + type: 'string' + """ + Then the last command should have thrown an exception of type "PropertyCannotBeSet" diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateAfterDisabling.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateAfterDisabling.feature index 8652a6a8252..156576e5069 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateAfterDisabling.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateAfterDisabling.feature @@ -50,7 +50,7 @@ Feature: Disable a node aggregate | affectedOccupiedDimensionSpacePoints | [{}] | | affectedCoveredDimensionSpacePoints | [{}] | - When the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + When the command CreateNodeAggregateWithNode is executed with payload: | Key | Value | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateWithDimensions.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateWithDimensions.feature index 96e0ecaafb7..742b38d69b6 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateWithDimensions.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/NodeRemoval/RemoveNodeAggregateWithDimensions.feature @@ -24,7 +24,7 @@ Feature: Remove NodeAggregate | nodeTypeName | "Neos.ContentRepository:Root" | # We have to add another node since root nodes are in all dimension space points and thus cannot be varied # Node /document - And the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + And the command CreateNodeAggregateWithNode is executed with payload: | Key | Value | | nodeAggregateId | "nody-mc-nodeface" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | @@ -32,7 +32,7 @@ Feature: Remove NodeAggregate | nodeName | "document" | # We also want to add a child node to make sure it is correctly removed when the parent is removed # Node /document/child-document - And the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + And the command CreateNodeAggregateWithNode is executed with payload: | Key | Value | | nodeAggregateId | "nodimus-prime" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DimensionMismatch.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DimensionMismatch.feature index 6f10381a3cb..23347f92229 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DimensionMismatch.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/DimensionMismatch.feature @@ -30,7 +30,7 @@ Feature: Dimension mismatch Scenario: Generalization detection # Node /document - When the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + When the command CreateNodeAggregateWithNode is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/Properties.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/Properties.feature index bd29ba2e76e..aaf81876ec4 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/Properties.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/Properties.feature @@ -28,7 +28,7 @@ Feature: Properties | nodeAggregateId | "lady-eleonode-rootford" | | nodeTypeName | "Neos.ContentRepository:Root" | # Node /document - When the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + When the command CreateNodeAggregateWithNode is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodesReordering.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodesReordering.feature index bb4974d7175..197a15e4989 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodesReordering.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/StructureAdjustment/TetheredNodesReordering.feature @@ -28,7 +28,7 @@ Feature: Tethered Nodes Reordering Structure changes | Key | Value | | nodeAggregateId | "lady-eleonode-rootford" | | nodeTypeName | "Neos.ContentRepository:Root" | - And the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + And the command CreateNodeAggregateWithNode is executed with payload: | Key | Value | | nodeAggregateId | "sir-david-nodenborough" | | nodeTypeName | "Neos.ContentRepository.Testing:Document" | diff --git a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W6-WorkspaceRebasing/02-RebasingWithAutoCreatedNodes.feature b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W6-WorkspaceRebasing/02-RebasingWithAutoCreatedNodes.feature index 39eca525c82..bbf470d1c17 100644 --- a/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W6-WorkspaceRebasing/02-RebasingWithAutoCreatedNodes.feature +++ b/Neos.ContentRepository.BehavioralTests/Tests/Behavior/Features/W6-WorkspaceRebasing/02-RebasingWithAutoCreatedNodes.feature @@ -61,13 +61,13 @@ Feature: Rebasing auto-created nodes works And I expect this node to be a child of node user-cs-identifier;nody-mc-nodeface;{} # - then, for the auto-created child node, set a property. - When the command "SetSerializedNodeProperties" is executed with payload: - | Key | Value | - | workspaceName | "user-test" | - | nodeAggregateId | $this->currentNodeAggregateId | - | originDimensionSpacePoint | {} | - | propertyValues | {"text": {"value":"Modified","type":"string"}} | - | propertiesToUnset | {} | + When the command "SetNodeProperties" is executed with payload: + | Key | Value | + | workspaceName | "user-test" | + | nodeAggregateId | $this->currentNodeAggregateId | + | originDimensionSpacePoint | {} | + | propertyValues | {"text": "Modified"} | + | propertiesToUnset | {} | # ensure that live is outdated so the rebase is required: When the command CreateNodeAggregateWithNode is executed with payload: @@ -80,8 +80,8 @@ Feature: Rebasing auto-created nodes works # rebase of SetSerializedNodeProperties When the command RebaseWorkspace is executed with payload: - | Key | Value | - | workspaceName | "user-test" | + | Key | Value | + | workspaceName | "user-test" | | rebasedContentStreamId | "user-cs-rebased" | # This should properly work; no error. 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 a5e32169667..37de2e73450 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 @@ -346,7 +346,7 @@ Feature: Publishing hide/show scenario of nodes | newContentStreamId | "user-cs-identifier" | # SETUP: set two new nodes in USER workspace - When the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + When the command CreateNodeAggregateWithNode is executed with payload: | Key | Value | | workspaceName | "user-test" | | nodeAggregateId | "new1-agg" | @@ -354,7 +354,7 @@ Feature: Publishing hide/show scenario of nodes | originDimensionSpacePoint | {} | | parentNodeAggregateId | "lady-eleonode-rootford" | | nodeName | "foo" | - When the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + When the command CreateNodeAggregateWithNode is executed with payload: | Key | Value | | workspaceName | "user-test" | | nodeAggregateId | "new2-agg" | diff --git a/Neos.ContentRepository.Core/Classes/CommandHandler/CommandBus.php b/Neos.ContentRepository.Core/Classes/CommandHandler/CommandBus.php index 92673a00c82..1ffb229fa57 100644 --- a/Neos.ContentRepository.Core/Classes/CommandHandler/CommandBus.php +++ b/Neos.ContentRepository.Core/Classes/CommandHandler/CommandBus.php @@ -6,6 +6,8 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\EventStore\EventsToPublish; +use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; +use Neos\ContentRepository\Core\Feature\RebaseableCommand; /** * Implementation Detail of {@see ContentRepository::handle}, which does the command dispatching to the different @@ -20,26 +22,66 @@ */ private array $handlers; + /** + * @var CommandSerializerInterface[] + */ + private array $serializers; + public function __construct( // todo pass $commandHandlingDependencies in each command handler instead of into the commandBus private CommandHandlingDependencies $commandHandlingDependencies, CommandHandlerInterface ...$handlers ) { $this->handlers = $handlers; + $serializers = []; + foreach ($handlers as $handler) { + if ($handler instanceof CommandSerializerInterface) { + $serializers[] = $handler; + } + } + $this->serializers = $serializers; } /** * @return EventsToPublish|\Generator */ - public function handle(CommandInterface $command): EventsToPublish|\Generator + public function handle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command): EventsToPublish|\Generator { + $possiblySerializedCommand = $command; + if (!$command instanceof RebasableToOtherWorkspaceInterface) { + foreach ($this->serializers as $serializer) { + if ($serializer->canSerialize($command)) { + $possiblySerializedCommand = $serializer->serialize($command, $this->commandHandlingDependencies); + break; + } + } + } + // multiple handlers must not handle the same command foreach ($this->handlers as $handler) { - if ($handler->canHandle($command)) { - return $handler->handle($command, $this->commandHandlingDependencies); + if ($handler->canHandle($possiblySerializedCommand)) { + $eventsToPublish = $handler->handle($possiblySerializedCommand, $this->commandHandlingDependencies); + + if (!$eventsToPublish instanceof EventsToPublish) { + // generator todo? + return $eventsToPublish; + } + + if ($possiblySerializedCommand instanceof RebasableToOtherWorkspaceInterface) { + return new EventsToPublish( + $eventsToPublish->streamName, + RebaseableCommand::enrichWithCommand( + $possiblySerializedCommand, + $eventsToPublish->events + ), + $eventsToPublish->expectedVersion + ); + } + + return $eventsToPublish; } } - throw new \RuntimeException(sprintf('No handler found for Command "%s"', get_debug_type($command)), 1649582778); + throw new \RuntimeException(sprintf('No handler found for Command "%s"', get_debug_type($possiblySerializedCommand)), 1649582778); } public function withAdditionalHandlers(CommandHandlerInterface ...$handlers): self diff --git a/Neos.ContentRepository.Core/Classes/CommandHandler/CommandHandlerInterface.php b/Neos.ContentRepository.Core/Classes/CommandHandler/CommandHandlerInterface.php index b36d5d3ab75..033ddfb485e 100644 --- a/Neos.ContentRepository.Core/Classes/CommandHandler/CommandHandlerInterface.php +++ b/Neos.ContentRepository.Core/Classes/CommandHandler/CommandHandlerInterface.php @@ -5,6 +5,7 @@ namespace Neos\ContentRepository\Core\CommandHandler; use Neos\ContentRepository\Core\EventStore\EventsToPublish; +use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; /** * Common interface for all Content Repository command handlers @@ -15,7 +16,7 @@ */ interface CommandHandlerInterface { - public function canHandle(CommandInterface $command): bool; + public function canHandle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command): bool; /** * "simple" command handlers return EventsToPublish directly @@ -25,5 +26,5 @@ public function canHandle(CommandInterface $command): bool; * * @return EventsToPublish|\Generator */ - public function handle(CommandInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish|\Generator; + public function handle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish|\Generator; } diff --git a/Neos.ContentRepository.Core/Classes/CommandHandler/CommandInterface.php b/Neos.ContentRepository.Core/Classes/CommandHandler/CommandInterface.php deleted file mode 100644 index 8264248a6f9..00000000000 --- a/Neos.ContentRepository.Core/Classes/CommandHandler/CommandInterface.php +++ /dev/null @@ -1,14 +0,0 @@ -getShortName()); } - public function handle(CommandInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish + public function handle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish { /** @phpstan-ignore-next-line */ return match ($command::class) { @@ -78,16 +78,13 @@ private function handleMoveDimensionSpacePoint( return new EventsToPublish( $streamName, - RebaseableCommand::enrichWithCommand( - $command, - Events::with( - new DimensionSpacePointWasMoved( - $contentGraph->getWorkspaceName(), - $contentGraph->getContentStreamId(), - $command->source, - $command->target - ), - ) + Events::with( + new DimensionSpacePointWasMoved( + $contentGraph->getWorkspaceName(), + $contentGraph->getContentStreamId(), + $command->source, + $command->target + ), ), ExpectedVersion::ANY() ); @@ -111,15 +108,12 @@ private function handleAddDimensionShineThrough( return new EventsToPublish( $streamName, - RebaseableCommand::enrichWithCommand( - $command, - Events::with( - new DimensionShineThroughWasAdded( - $contentGraph->getWorkspaceName(), - $contentGraph->getContentStreamId(), - $command->source, - $command->target - ) + Events::with( + new DimensionShineThroughWasAdded( + $contentGraph->getWorkspaceName(), + $contentGraph->getContentStreamId(), + $command->source, + $command->target ) ), ExpectedVersion::ANY() diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeAggregateCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/NodeAggregateCommandHandler.php index eea2319dd3a..01cc2e28042 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeAggregateCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeAggregateCommandHandler.php @@ -15,13 +15,15 @@ namespace Neos\ContentRepository\Core\Feature; use Neos\ContentRepository\Core\CommandHandler\CommandHandlerInterface; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; use Neos\ContentRepository\Core\CommandHandler\CommandHandlingDependencies; +use Neos\ContentRepository\Core\CommandHandler\CommandSerializerInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\DimensionSpace; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\Common\ConstraintChecks; +use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; use Neos\ContentRepository\Core\Feature\Common\TetheredNodeInternals; use Neos\ContentRepository\Core\Feature\NodeCreation\Command\CreateNodeAggregateWithNode; use Neos\ContentRepository\Core\Feature\NodeCreation\Command\CreateNodeAggregateWithNodeAndSerializedProperties; @@ -57,7 +59,7 @@ /** * @internal from userland, you'll use ContentRepository::handle to dispatch commands */ -final class NodeAggregateCommandHandler implements CommandHandlerInterface +final class NodeAggregateCommandHandler implements CommandHandlerInterface, CommandSerializerInterface { use ConstraintChecks; use RootNodeHandling; @@ -86,25 +88,21 @@ public function __construct( ) { } - public function canHandle(CommandInterface $command): bool + public function canHandle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command): bool { return method_exists($this, 'handle' . (new \ReflectionClass($command))->getShortName()); } - public function handle(CommandInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish + public function handle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish { /** @phpstan-ignore-next-line */ return match ($command::class) { - SetNodeProperties::class => $this->handleSetNodeProperties($command, $commandHandlingDependencies), SetSerializedNodeProperties::class => $this->handleSetSerializedNodeProperties($command, $commandHandlingDependencies), - SetNodeReferences::class => $this->handleSetNodeReferences($command, $commandHandlingDependencies), SetSerializedNodeReferences::class => $this->handleSetSerializedNodeReferences($command, $commandHandlingDependencies), ChangeNodeAggregateType::class => $this->handleChangeNodeAggregateType($command, $commandHandlingDependencies), RemoveNodeAggregate::class => $this->handleRemoveNodeAggregate($command, $commandHandlingDependencies), - CreateNodeAggregateWithNode::class - => $this->handleCreateNodeAggregateWithNode($command, $commandHandlingDependencies), CreateNodeAggregateWithNodeAndSerializedProperties::class => $this->handleCreateNodeAggregateWithNodeAndSerializedProperties($command, $commandHandlingDependencies), MoveNodeAggregate::class => $this->handleMoveNodeAggregate($command, $commandHandlingDependencies), @@ -121,6 +119,21 @@ public function handle(CommandInterface $command, CommandHandlingDependencies $c }; } + public function canSerialize(PublicCommandInterface $command): bool + { + return method_exists($this, 'serialize' . (new \ReflectionClass($command))->getShortName()); + } + + public function serialize(PublicCommandInterface $command, CommandHandlingDependencies $commandHandlingDependencies): RebasableToOtherWorkspaceInterface + { + /** @phpstan-ignore-next-line */ + return match ($command::class) { + SetNodeProperties::class => $this->serializeSetNodeProperties($command, $commandHandlingDependencies), + SetNodeReferences::class => $this->serializeSetNodeReferences($command, $commandHandlingDependencies), + CreateNodeAggregateWithNode::class => $this->serializeCreateNodeAggregateWithNode($command, $commandHandlingDependencies), + }; + } + protected function getNodeTypeManager(): NodeTypeManager { return $this->nodeTypeManager; diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Command/CreateNodeAggregateWithNode.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Command/CreateNodeAggregateWithNode.php index 4aac2bb8761..8d0ae541552 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Command/CreateNodeAggregateWithNode.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Command/CreateNodeAggregateWithNode.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\NodeCreation\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite; @@ -33,7 +33,7 @@ * * @api commands are the write-API of the ContentRepository */ -final readonly class CreateNodeAggregateWithNode implements CommandInterface +final readonly class CreateNodeAggregateWithNode implements PublicCommandInterface { /** * @param WorkspaceName $workspaceName The workspace in which the create operation is to be performed diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Command/CreateNodeAggregateWithNodeAndSerializedProperties.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Command/CreateNodeAggregateWithNodeAndSerializedProperties.php index 958b1a30590..3aa8d471d0e 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Command/CreateNodeAggregateWithNodeAndSerializedProperties.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Command/CreateNodeAggregateWithNodeAndSerializedProperties.php @@ -14,7 +14,6 @@ namespace Neos\ContentRepository\Core\Feature\NodeCreation\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; @@ -34,7 +33,6 @@ * @internal implementation detail, use {@see CreateNodeAggregateWithNode} instead. */ final readonly class CreateNodeAggregateWithNodeAndSerializedProperties implements - CommandInterface, \JsonSerializable, MatchableWithNodeIdToPublishOrDiscardInterface, RebasableToOtherWorkspaceInterface diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php index b73ba4750f6..da84f848708 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/NodeCreation.php @@ -20,7 +20,6 @@ use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; -use Neos\ContentRepository\Core\Feature\RebaseableCommand; use Neos\ContentRepository\Core\Feature\Common\NodeCreationInternals; use Neos\ContentRepository\Core\Feature\Common\NodeReferencingInternals; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; @@ -72,10 +71,10 @@ abstract protected function getPropertyConverter(): PropertyConverter; abstract protected function getNodeTypeManager(): NodeTypeManager; - private function handleCreateNodeAggregateWithNode( + private function serializeCreateNodeAggregateWithNode( CreateNodeAggregateWithNode $command, CommandHandlingDependencies $commandHandlingDependencies - ): EventsToPublish { + ): CreateNodeAggregateWithNodeAndSerializedProperties { $this->requireNodeType($command->nodeTypeName); $this->validateProperties($command->initialPropertyValues, $command->nodeTypeName); @@ -92,14 +91,21 @@ private function handleCreateNodeAggregateWithNode( ), $this->mapNodeReferencesToSerializedNodeReferences($command->references, $command->nodeTypeName) ); - if (!$command->tetheredDescendantNodeAggregateIds->isEmpty()) { - $lowLevelCommand = $lowLevelCommand->withTetheredDescendantNodeAggregateIds($command->tetheredDescendantNodeAggregateIds); - } + + $descendantNodeAggregateIds = $command->tetheredDescendantNodeAggregateIds->completeForNodeOfType( + $command->nodeTypeName, + $this->nodeTypeManager + ); + + // Write the auto-created descendant node aggregate ids back to the command; + // so that when rebasing the command, it stays fully deterministic. + $lowLevelCommand = $lowLevelCommand->withTetheredDescendantNodeAggregateIds($descendantNodeAggregateIds); + if ($command->nodeName) { $lowLevelCommand = $lowLevelCommand->withNodeName($command->nodeName); } - return $this->handleCreateNodeAggregateWithNodeAndSerializedProperties($lowLevelCommand, $commandHandlingDependencies); + return $lowLevelCommand; } private function validateProperties(?PropertyValuesToWrite $propertyValues, NodeTypeName $nodeTypeName): void @@ -183,16 +189,8 @@ private function handleCreateNodeAggregateWithNodeAndSerializedProperties( $this->requireNodeTypeNotToDeclareTetheredChildNodeName($parentNodeAggregate->nodeTypeName, $command->nodeName); } - $descendantNodeAggregateIds = $command->tetheredDescendantNodeAggregateIds->completeForNodeOfType( - $command->nodeTypeName, - $this->nodeTypeManager - ); - // Write the auto-created descendant node aggregate ids back to the command; - // so that when rebasing the command, it stays fully deterministic. - $command = $command->withTetheredDescendantNodeAggregateIds($descendantNodeAggregateIds); - foreach ( - $descendantNodeAggregateIds->getNodeAggregateIds() as $descendantNodeAggregateId + $command->tetheredDescendantNodeAggregateIds->getNodeAggregateIds() as $descendantNodeAggregateId ) { $this->requireProjectedNodeAggregateToNotExist( $contentGraph, @@ -218,14 +216,14 @@ private function handleCreateNodeAggregateWithNodeAndSerializedProperties( $nodeType, $coveredDimensionSpacePoints, $command->nodeAggregateId, - $descendantNodeAggregateIds, + $command->tetheredDescendantNodeAggregateIds, null ))); return new EventsToPublish( ContentStreamEventStreamName::fromContentStreamId($contentGraph->getContentStreamId()) ->getEventStreamName(), - RebaseableCommand::enrichWithCommand($command, Events::fromArray($events)), + Events::fromArray($events), $expectedVersion ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/DisableNodeAggregate.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/DisableNodeAggregate.php index f92f938df9c..0928b2a6bfd 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/DisableNodeAggregate.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/DisableNodeAggregate.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\NodeDisabling\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; @@ -30,7 +30,7 @@ * @api commands are the write-API of the ContentRepository */ final readonly class DisableNodeAggregate implements - CommandInterface, + PublicCommandInterface, \JsonSerializable, MatchableWithNodeIdToPublishOrDiscardInterface, RebasableToOtherWorkspaceInterface diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/EnableNodeAggregate.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/EnableNodeAggregate.php index de0ad11d57d..c545a46fc90 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/EnableNodeAggregate.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/EnableNodeAggregate.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\NodeDisabling\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; @@ -30,7 +30,7 @@ * @api commands are the write-API of the ContentRepository */ final readonly class EnableNodeAggregate implements - CommandInterface, + PublicCommandInterface, \JsonSerializable, MatchableWithNodeIdToPublishOrDiscardInterface, RebasableToOtherWorkspaceInterface diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/NodeDisabling.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/NodeDisabling.php index c6e3820eb6e..f3ef2c4700c 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/NodeDisabling.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/NodeDisabling.php @@ -19,7 +19,6 @@ use Neos\ContentRepository\Core\DimensionSpace\Exception\DimensionSpacePointNotFound; use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; -use Neos\ContentRepository\Core\Feature\RebaseableCommand; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; use Neos\ContentRepository\Core\Feature\NodeDisabling\Command\DisableNodeAggregate; use Neos\ContentRepository\Core\Feature\NodeDisabling\Command\EnableNodeAggregate; @@ -82,10 +81,7 @@ private function handleDisableNodeAggregate( return new EventsToPublish( ContentStreamEventStreamName::fromContentStreamId($contentGraph->getContentStreamId()) ->getEventStreamName(), - RebaseableCommand::enrichWithCommand( - $command, - $events - ), + $events, $expectedVersion ); } @@ -137,7 +133,7 @@ public function handleEnableNodeAggregate( return new EventsToPublish( ContentStreamEventStreamName::fromContentStreamId($contentGraph->getContentStreamId())->getEventStreamName(), - RebaseableCommand::enrichWithCommand($command, $events), + $events, $expectedVersion ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Command/CopyNodesRecursively.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Command/CopyNodesRecursively.php index ba31a07c601..801150f7627 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Command/CopyNodesRecursively.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Command/CopyNodesRecursively.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\NodeDuplication\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; @@ -38,7 +38,7 @@ * @api commands are the write-API of the ContentRepository */ final readonly class CopyNodesRecursively implements - CommandInterface, + PublicCommandInterface, \JsonSerializable, MatchableWithNodeIdToPublishOrDiscardInterface, RebasableToOtherWorkspaceInterface diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/NodeDuplicationCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/NodeDuplicationCommandHandler.php index edffe38ad5c..b92fa7eb049 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/NodeDuplicationCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/NodeDuplicationCommandHandler.php @@ -14,10 +14,9 @@ namespace Neos\ContentRepository\Core\Feature\NodeDuplication; -use Neos\ContentRepository\Core\CommandHandler\CommandHandlingDependencies; -use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphInterface; use Neos\ContentRepository\Core\CommandHandler\CommandHandlerInterface; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\CommandHandlingDependencies; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\DimensionSpace\ContentDimensionZookeeper; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; @@ -27,17 +26,17 @@ use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\Common\ConstraintChecks; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; -use Neos\ContentRepository\Core\Feature\RebaseableCommand; use Neos\ContentRepository\Core\Feature\Common\NodeCreationInternals; +use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated; use Neos\ContentRepository\Core\Feature\NodeDuplication\Command\CopyNodesRecursively; use Neos\ContentRepository\Core\Feature\NodeDuplication\Dto\NodeSubtreeSnapshot; use Neos\ContentRepository\Core\NodeType\NodeTypeManager; +use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphInterface; use Neos\ContentRepository\Core\SharedModel\Exception\NodeConstraintException; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; -use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** * @internal from userland, you'll use ContentRepository::handle to dispatch commands @@ -64,12 +63,12 @@ protected function getAllowedDimensionSubspace(): DimensionSpacePointSet return $this->contentDimensionZookeeper->getAllowedDimensionSubspace(); } - public function canHandle(CommandInterface $command): bool + public function canHandle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command): bool { return method_exists($this, 'handle' . (new \ReflectionClass($command))->getShortName()); } - public function handle(CommandInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish + public function handle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies): EventsToPublish { /** @phpstan-ignore-next-line */ return match ($command::class) { @@ -160,10 +159,7 @@ private function handleCopyNodesRecursively( ContentStreamEventStreamName::fromContentStreamId( $contentGraph->getContentStreamId() )->getEventStreamName(), - RebaseableCommand::enrichWithCommand( - $command, - Events::fromArray($events) - ), + Events::fromArray($events), $expectedVersion ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetNodeProperties.php b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetNodeProperties.php index e2a3d63f587..ec09cde4e34 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetNodeProperties.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetNodeProperties.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\NodeModification\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -34,7 +34,7 @@ * * @api commands are the write-API of the ContentRepository */ -final readonly class SetNodeProperties implements CommandInterface +final readonly class SetNodeProperties implements PublicCommandInterface { /** * @param WorkspaceName $workspaceName The workspace in which the set properties operation is to be performed @@ -60,4 +60,17 @@ public static function create(WorkspaceName $workspaceName, NodeAggregateId $nod { return new self($workspaceName, $nodeAggregateId, $originDimensionSpacePoint, $propertyValues); } + + /** + * @param array $array + */ + public static function fromArray(array $array): self + { + return new self( + WorkspaceName::fromString($array['workspaceName']), + NodeAggregateId::fromString($array['nodeAggregateId']), + OriginDimensionSpacePoint::fromArray($array['originDimensionSpacePoint']), + PropertyValuesToWrite::fromArray($array['propertyValues']), + ); + } } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetSerializedNodeProperties.php b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetSerializedNodeProperties.php index a2d684f6035..b3d38bf88dc 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetSerializedNodeProperties.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetSerializedNodeProperties.php @@ -14,7 +14,6 @@ namespace Neos\ContentRepository\Core\Feature\NodeModification\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; @@ -22,7 +21,6 @@ use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard; 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; /** @@ -33,7 +31,6 @@ * @internal implementation detail, use {@see SetNodeProperties} instead. */ final readonly class SetSerializedNodeProperties implements - CommandInterface, \JsonSerializable, MatchableWithNodeIdToPublishOrDiscardInterface, RebasableToOtherWorkspaceInterface diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/NodeModification.php b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/NodeModification.php index 7608fef3c50..d6ac93354fb 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/NodeModification.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/NodeModification.php @@ -17,7 +17,6 @@ use Neos\ContentRepository\Core\CommandHandler\CommandHandlingDependencies; use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; -use Neos\ContentRepository\Core\Feature\RebaseableCommand; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetNodeProperties; use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetSerializedNodeProperties; @@ -43,10 +42,10 @@ abstract protected function requireProjectedNodeAggregate( NodeAggregateId $nodeAggregateId ): NodeAggregate; - private function handleSetNodeProperties( + private function serializeSetNodeProperties( SetNodeProperties $command, CommandHandlingDependencies $commandHandlingDependencies - ): EventsToPublish { + ): SetSerializedNodeProperties { $this->requireContentStream($command->workspaceName, $commandHandlingDependencies); $contentGraph = $commandHandlingDependencies->getContentGraph($command->workspaceName); $this->requireDimensionSpacePointToExist($command->originDimensionSpacePoint->toDimensionSpacePoint()); @@ -70,7 +69,7 @@ private function handleSetNodeProperties( $command->propertyValues->getPropertiesToUnset() ); - return $this->handleSetSerializedNodeProperties($lowLevelCommand, $commandHandlingDependencies); + return $lowLevelCommand; } private function handleSetSerializedNodeProperties( @@ -132,10 +131,7 @@ private function handleSetSerializedNodeProperties( return new EventsToPublish( ContentStreamEventStreamName::fromContentStreamId($contentGraph->getContentStreamId()) ->getEventStreamName(), - RebaseableCommand::enrichWithCommand( - $command, - Events::fromArray($events) - ), + Events::fromArray($events), $expectedVersion ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Command/MoveNodeAggregate.php b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Command/MoveNodeAggregate.php index 3a756163488..f44e4217b7d 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Command/MoveNodeAggregate.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Command/MoveNodeAggregate.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\NodeMove\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; @@ -43,7 +43,7 @@ * @api commands are the write-API of the ContentRepository */ final readonly class MoveNodeAggregate implements - CommandInterface, + PublicCommandInterface, \JsonSerializable, MatchableWithNodeIdToPublishOrDiscardInterface, RebasableToOtherWorkspaceInterface diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php index 5dfae05275c..e1fa743e9bc 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/NodeMove.php @@ -23,7 +23,6 @@ use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSibling; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; -use Neos\ContentRepository\Core\Feature\RebaseableCommand; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; use Neos\ContentRepository\Core\Feature\NodeMove\Command\MoveNodeAggregate; use Neos\ContentRepository\Core\Feature\NodeMove\Dto\RelationDistributionStrategy; @@ -207,10 +206,7 @@ private function handleMoveNodeAggregate( return new EventsToPublish( $contentStreamEventStreamName->getEventStreamName(), - RebaseableCommand::enrichWithCommand( - $command, - $events - ), + $events, $expectedVersion ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetNodeReferences.php b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetNodeReferences.php index 70da56b2c2d..99a12d9d43a 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetNodeReferences.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetNodeReferences.php @@ -4,7 +4,7 @@ namespace Neos\ContentRepository\Core\Feature\NodeReferencing\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\Feature\NodeReferencing\Dto\NodeReferencesToWrite; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; @@ -21,7 +21,7 @@ * * @api commands are the write-API of the ContentRepository */ -final readonly class SetNodeReferences implements CommandInterface +final readonly class SetNodeReferences implements PublicCommandInterface { /** * @param WorkspaceName $workspaceName The workspace in which the create operation is to be performed diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetSerializedNodeReferences.php b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetSerializedNodeReferences.php index ae96cc5af13..5e95099f806 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetSerializedNodeReferences.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetSerializedNodeReferences.php @@ -14,7 +14,6 @@ namespace Neos\ContentRepository\Core\Feature\NodeReferencing\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; @@ -31,7 +30,6 @@ * @internal implementation detail, use {@see SetNodeReferences} instead. */ final readonly class SetSerializedNodeReferences implements - CommandInterface, \JsonSerializable, MatchableWithNodeIdToPublishOrDiscardInterface, RebasableToOtherWorkspaceInterface diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/NodeReferencing.php b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/NodeReferencing.php index cbfb71679d5..ae7b6556f97 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/NodeReferencing.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/NodeReferencing.php @@ -25,7 +25,6 @@ use Neos\ContentRepository\Core\Feature\NodeReferencing\Command\SetSerializedNodeReferences; use Neos\ContentRepository\Core\Feature\NodeReferencing\Dto\SerializedNodeReferences; use Neos\ContentRepository\Core\Feature\NodeReferencing\Event\NodeReferencesWereSet; -use Neos\ContentRepository\Core\Feature\RebaseableCommand; use Neos\ContentRepository\Core\NodeType\NodeType; use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphInterface; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate; @@ -46,10 +45,10 @@ abstract protected function requireProjectedNodeAggregate( ): NodeAggregate; - private function handleSetNodeReferences( + private function serializeSetNodeReferences( SetNodeReferences $command, CommandHandlingDependencies $commandHandlingDependencies - ): EventsToPublish { + ): SetSerializedNodeReferences { $this->requireContentStream($command->workspaceName, $commandHandlingDependencies); $contentGraph = $commandHandlingDependencies->getContentGraph($command->workspaceName); $this->requireDimensionSpacePointToExist($command->sourceOriginDimensionSpacePoint->toDimensionSpacePoint()); @@ -79,7 +78,7 @@ private function handleSetNodeReferences( $this->mapNodeReferencesToSerializedNodeReferences($command->references, $nodeTypeName), ); - return $this->handleSetSerializedNodeReferences($lowLevelCommand, $commandHandlingDependencies); + return $lowLevelCommand; } /** @@ -153,10 +152,7 @@ private function handleSetSerializedNodeReferences( return new EventsToPublish( ContentStreamEventStreamName::fromContentStreamId($contentGraph->getContentStreamId()) ->getEventStreamName(), - RebaseableCommand::enrichWithCommand( - $command, - $events - ), + $events, $expectedVersion ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php index 085af255b8c..6ae89afc615 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\NodeRemoval\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; @@ -27,7 +27,7 @@ * @api commands are the write-API of the ContentRepository */ final readonly class RemoveNodeAggregate implements - CommandInterface, + PublicCommandInterface, \JsonSerializable, MatchableWithNodeIdToPublishOrDiscardInterface, RebasableToOtherWorkspaceInterface diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/NodeRemoval.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/NodeRemoval.php index 92dee4b597d..d8de3039445 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/NodeRemoval.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/NodeRemoval.php @@ -19,7 +19,6 @@ use Neos\ContentRepository\Core\DimensionSpace\Exception\DimensionSpacePointNotFound; use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; -use Neos\ContentRepository\Core\Feature\RebaseableCommand; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; use Neos\ContentRepository\Core\Feature\NodeRemoval\Command\RemoveNodeAggregate; use Neos\ContentRepository\Core\Feature\NodeRemoval\Event\NodeAggregateWasRemoved; @@ -91,10 +90,7 @@ private function handleRemoveNodeAggregate( return new EventsToPublish( ContentStreamEventStreamName::fromContentStreamId($contentGraph->getContentStreamId()) ->getEventStreamName(), - RebaseableCommand::enrichWithCommand( - $command, - $events - ), + $events, $expectedVersion ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Command/ChangeNodeAggregateName.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Command/ChangeNodeAggregateName.php index 38d1f195ed6..e1bbd66b88d 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Command/ChangeNodeAggregateName.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Command/ChangeNodeAggregateName.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\NodeRenaming\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard; @@ -32,7 +32,7 @@ * @api commands are the write-API of the ContentRepository */ final readonly class ChangeNodeAggregateName implements - CommandInterface, + PublicCommandInterface, \JsonSerializable, MatchableWithNodeIdToPublishOrDiscardInterface, RebasableToOtherWorkspaceInterface diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php index f3531340345..24df04b2c90 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/NodeRenaming.php @@ -18,7 +18,6 @@ use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\Common\ConstraintChecks; -use Neos\ContentRepository\Core\Feature\RebaseableCommand; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; use Neos\ContentRepository\Core\Feature\NodeRenaming\Command\ChangeNodeAggregateName; use Neos\ContentRepository\Core\Feature\NodeRenaming\Event\NodeAggregateNameWasChanged; @@ -61,10 +60,7 @@ private function handleChangeNodeAggregateName(ChangeNodeAggregateName $command, return new EventsToPublish( ContentStreamEventStreamName::fromContentStreamId($contentGraph->getContentStreamId())->getEventStreamName(), - RebaseableCommand::enrichWithCommand( - $command, - $events - ), + $events, $expectedVersion ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Command/ChangeNodeAggregateType.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Command/ChangeNodeAggregateType.php index e979e4d25c1..2a6f1fe8f72 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Command/ChangeNodeAggregateType.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Command/ChangeNodeAggregateType.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\NodeTypeChange\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; use Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths; @@ -29,7 +29,7 @@ * @api commands are the write-API of the ContentRepository */ final readonly class ChangeNodeAggregateType implements - CommandInterface, + PublicCommandInterface, \JsonSerializable, MatchableWithNodeIdToPublishOrDiscardInterface, RebasableToOtherWorkspaceInterface diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php index 5436b048236..363f1a58774 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/NodeTypeChange.php @@ -19,7 +19,6 @@ use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePointSet; use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; -use Neos\ContentRepository\Core\Feature\RebaseableCommand; use Neos\ContentRepository\Core\Feature\Common\NodeTypeChangeInternals; use Neos\ContentRepository\Core\Feature\Common\TetheredNodeInternals; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; @@ -182,6 +181,7 @@ private function handleChangeNodeAggregateType( $command->newNodeTypeName, $this->nodeTypeManager ); + // todo // Write the auto-created descendant node aggregate ids back to the command; // so that when rebasing the command, it stays fully deterministic. $command = $command->withTetheredDescendantNodeAggregateIds($descendantNodeAggregateIds); @@ -279,10 +279,7 @@ private function handleChangeNodeAggregateType( return new EventsToPublish( ContentStreamEventStreamName::fromContentStreamId($contentGraph->getContentStreamId())->getEventStreamName(), - RebaseableCommand::enrichWithCommand( - $command, - Events::fromArray($events), - ), + Events::fromArray($events), $expectedVersion ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Command/CreateNodeVariant.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Command/CreateNodeVariant.php index 54873f489dc..a89edff5cde 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Command/CreateNodeVariant.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Command/CreateNodeVariant.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\NodeVariation\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\DimensionSpace\OriginDimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; @@ -30,7 +30,7 @@ * @api commands are the write-API of the ContentRepository */ final readonly class CreateNodeVariant implements - CommandInterface, + PublicCommandInterface, \JsonSerializable, MatchableWithNodeIdToPublishOrDiscardInterface, RebasableToOtherWorkspaceInterface diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/NodeVariation.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/NodeVariation.php index 1e01e281265..3b91cc9ca16 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/NodeVariation.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/NodeVariation.php @@ -18,7 +18,6 @@ use Neos\ContentRepository\Core\DimensionSpace\Exception\DimensionSpacePointNotFound; use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\Common\ConstraintChecks; -use Neos\ContentRepository\Core\Feature\RebaseableCommand; use Neos\ContentRepository\Core\Feature\Common\NodeVariationInternals; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; use Neos\ContentRepository\Core\Feature\NodeVariation\Command\CreateNodeVariant; @@ -84,10 +83,7 @@ private function handleCreateNodeVariant( return new EventsToPublish( ContentStreamEventStreamName::fromContentStreamId($contentGraph->getContentStreamId())->getEventStreamName(), - RebaseableCommand::enrichWithCommand( - $command, - $events - ), + $events, $expectedVersion ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/RebaseableCommand.php b/Neos.ContentRepository.Core/Classes/Feature/RebaseableCommand.php index 210f91b8b8a..0e4fefe1e6d 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RebaseableCommand.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RebaseableCommand.php @@ -51,6 +51,7 @@ public static function extractFromEventMetaData(EventMetadata $eventMetadata, Se ); } + /** * Stores the command in the event's metadata for events on a content stream. This is an important prerequisite * for the rebase functionality- diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php index 9bbb1f320cc..bd1cbce0ddf 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\RootNodeCreation\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; use Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths; use Neos\ContentRepository\Core\NodeType\NodeTypeName; @@ -31,7 +31,7 @@ * @api commands are the write-API of the ContentRepository */ final readonly class CreateRootNodeAggregateWithNode implements - CommandInterface, + PublicCommandInterface, \JsonSerializable, RebasableToOtherWorkspaceInterface { diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/UpdateRootNodeAggregateDimensions.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/UpdateRootNodeAggregateDimensions.php index 302c05ed895..b41ba3759d7 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/UpdateRootNodeAggregateDimensions.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/UpdateRootNodeAggregateDimensions.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\RootNodeCreation\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -28,7 +28,7 @@ * @api commands are the write-API of the ContentRepository */ final readonly class UpdateRootNodeAggregateDimensions implements - CommandInterface, + PublicCommandInterface, \JsonSerializable, RebasableToOtherWorkspaceInterface { diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php index 1ed9b90f862..59e5b19943d 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/RootNodeHandling.php @@ -20,7 +20,6 @@ use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\Common\InterdimensionalSiblings; -use Neos\ContentRepository\Core\Feature\RebaseableCommand; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; use Neos\ContentRepository\Core\Feature\NodeCreation\Dto\NodeAggregateIdsByNodePaths; use Neos\ContentRepository\Core\Feature\NodeCreation\Event\NodeAggregateWithNodeWasCreated; @@ -91,6 +90,7 @@ private function handleCreateRootNodeAggregateWithNode( $command->nodeTypeName, $this->nodeTypeManager ); + // todo (and find other $command = $command things. .. // Write the auto-created descendant node aggregate ids back to the command; // so that when rebasing the command, it stays fully deterministic. $command = $command->withTetheredDescendantNodeAggregateIds($descendantNodeAggregateIds); @@ -119,10 +119,7 @@ private function handleCreateRootNodeAggregateWithNode( $contentStreamEventStream = ContentStreamEventStreamName::fromContentStreamId($contentGraph->getContentStreamId()); return new EventsToPublish( $contentStreamEventStream->getEventStreamName(), - RebaseableCommand::enrichWithCommand( - $command, - Events::fromArray($events) - ), + Events::fromArray($events), $expectedVersion ); } @@ -174,10 +171,7 @@ private function handleUpdateRootNodeAggregateDimensions( ); return new EventsToPublish( $contentStreamEventStream->getEventStreamName(), - RebaseableCommand::enrichWithCommand( - $command, - $events - ), + $events, $expectedVersion ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/TagSubtree.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/TagSubtree.php index d4d37c8b8cb..2a535c4256f 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/TagSubtree.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/TagSubtree.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\SubtreeTagging\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; @@ -31,7 +31,7 @@ * @api commands are the write-API of the ContentRepository */ final readonly class TagSubtree implements - CommandInterface, + PublicCommandInterface, \JsonSerializable, RebasableToOtherWorkspaceInterface, MatchableWithNodeIdToPublishOrDiscardInterface diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/UntagSubtree.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/UntagSubtree.php index 1ae9b4624a2..bd9bacbca5a 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/UntagSubtree.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/UntagSubtree.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\SubtreeTagging\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\MatchableWithNodeIdToPublishOrDiscardInterface; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; @@ -32,7 +32,7 @@ * @api commands are the write-API of the ContentRepository */ final readonly class UntagSubtree implements - CommandInterface, + PublicCommandInterface, \JsonSerializable, RebasableToOtherWorkspaceInterface, MatchableWithNodeIdToPublishOrDiscardInterface diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/SubtreeTagging.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/SubtreeTagging.php index b134d44cfdc..9db4742fd2c 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/SubtreeTagging.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/SubtreeTagging.php @@ -19,7 +19,6 @@ use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\Common\ConstraintChecks; -use Neos\ContentRepository\Core\Feature\RebaseableCommand; use Neos\ContentRepository\Core\Feature\ContentStreamEventStreamName; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Command\TagSubtree; use Neos\ContentRepository\Core\Feature\SubtreeTagging\Command\UntagSubtree; @@ -71,10 +70,7 @@ private function handleTagSubtree(TagSubtree $command, CommandHandlingDependenci return new EventsToPublish( ContentStreamEventStreamName::fromContentStreamId($contentGraph->getContentStreamId()) ->getEventStreamName(), - RebaseableCommand::enrichWithCommand( - $command, - $events - ), + $events, ExpectedVersion::ANY() ); } @@ -116,7 +112,7 @@ public function handleUntagSubtree(UntagSubtree $command, CommandHandlingDepende return new EventsToPublish( ContentStreamEventStreamName::fromContentStreamId($contentGraph->getContentStreamId())->getEventStreamName(), - RebaseableCommand::enrichWithCommand($command, $events), + $events, ExpectedVersion::ANY() ); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php index 20143536272..a81c0cbca4b 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php @@ -16,18 +16,17 @@ use Neos\ContentRepository\Core\CommandHandler\CommandHandlerInterface; use Neos\ContentRepository\Core\CommandHandler\CommandHandlingDependencies; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\CommandHandler\CommandSimulatorFactory; use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\EventStore\DecoratedEvent; -use Neos\ContentRepository\Core\EventStore\EventInterface; use Neos\ContentRepository\Core\EventStore\EventNormalizer; use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; +use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; use Neos\ContentRepository\Core\Feature\ContentStreamClosing\Event\ContentStreamWasClosed; use Neos\ContentRepository\Core\Feature\ContentStreamClosing\Event\ContentStreamWasReopened; -use Neos\ContentRepository\Core\Feature\ContentStreamForking\Event\ContentStreamWasForked; use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Command\CreateRootWorkspace; use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Command\CreateWorkspace; use Neos\ContentRepository\Core\Feature\WorkspaceCreation\Event\RootWorkspaceWasCreated; @@ -62,7 +61,6 @@ use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceStatus; use Neos\EventStore\EventStoreInterface; -use Neos\EventStore\Model\Event\EventType; use Neos\EventStore\Model\Event\SequenceNumber; use Neos\EventStore\Model\Event\Version; use Neos\EventStore\Model\EventStream\EventStreamInterface; @@ -82,12 +80,12 @@ public function __construct( ) { } - public function canHandle(CommandInterface $command): bool + public function canHandle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command): bool { return method_exists($this, 'handle' . (new \ReflectionClass($command))->getShortName()); } - public function handle(CommandInterface $command, CommandHandlingDependencies $commandHandlingDependencies): \Generator + public function handle(PublicCommandInterface|RebasableToOtherWorkspaceInterface $command, CommandHandlingDependencies $commandHandlingDependencies): \Generator { /** @phpstan-ignore-next-line */ return match ($command::class) { diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Command/CreateRootWorkspace.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Command/CreateRootWorkspace.php index 2a36c7655cb..6fb498dc767 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Command/CreateRootWorkspace.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Command/CreateRootWorkspace.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceCreation\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -25,7 +25,7 @@ * * @api commands are the write-API of the ContentRepository */ -final readonly class CreateRootWorkspace implements CommandInterface +final readonly class CreateRootWorkspace implements PublicCommandInterface { /** * @param WorkspaceName $workspaceName Unique name of the workspace to create diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Command/CreateWorkspace.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Command/CreateWorkspace.php index 4add3ccf28f..3627f7dede6 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Command/CreateWorkspace.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCreation/Command/CreateWorkspace.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceCreation\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -23,7 +23,7 @@ * * @api commands are the write-API of the ContentRepository */ -final readonly class CreateWorkspace implements CommandInterface +final readonly class CreateWorkspace implements PublicCommandInterface { /** * @param WorkspaceName $workspaceName Unique name of the workspace to create diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Command/ChangeBaseWorkspace.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Command/ChangeBaseWorkspace.php index dd833312b5f..79c780b5bbd 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Command/ChangeBaseWorkspace.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Command/ChangeBaseWorkspace.php @@ -4,7 +4,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceModification\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -13,7 +13,7 @@ * * @api commands are the write-API of the ContentRepository */ -final readonly class ChangeBaseWorkspace implements CommandInterface +final readonly class ChangeBaseWorkspace implements PublicCommandInterface { /** * @param WorkspaceName $workspaceName Name of the affected workspace diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Command/DeleteWorkspace.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Command/DeleteWorkspace.php index ab182194ba0..08ccd73c754 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Command/DeleteWorkspace.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceModification/Command/DeleteWorkspace.php @@ -4,7 +4,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceModification\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -12,7 +12,7 @@ * * @api commands are the write-API of the ContentRepository */ -final readonly class DeleteWorkspace implements CommandInterface +final readonly class DeleteWorkspace implements PublicCommandInterface { /** * @param WorkspaceName $workspaceName Name of the workspace to delete diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/DiscardIndividualNodesFromWorkspace.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/DiscardIndividualNodesFromWorkspace.php index fec436be434..3c3616206a9 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/DiscardIndividualNodesFromWorkspace.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/DiscardIndividualNodesFromWorkspace.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspacePublication\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdsToPublishOrDiscard; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -24,7 +24,7 @@ * * @api commands are the write-API of the ContentRepository */ -final readonly class DiscardIndividualNodesFromWorkspace implements CommandInterface +final readonly class DiscardIndividualNodesFromWorkspace implements PublicCommandInterface { /** * @param WorkspaceName $workspaceName Name of the affected workspace diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/DiscardWorkspace.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/DiscardWorkspace.php index 5a5b0355945..2aa3d7b46df 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/DiscardWorkspace.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/DiscardWorkspace.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspacePublication\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -23,7 +23,7 @@ * * @api commands are the write-API of the ContentRepository */ -final readonly class DiscardWorkspace implements CommandInterface +final readonly class DiscardWorkspace implements PublicCommandInterface { /** * @param WorkspaceName $workspaceName Name of the affected workspace diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishIndividualNodesFromWorkspace.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishIndividualNodesFromWorkspace.php index 2394c80ab99..1d87c4cc96a 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishIndividualNodesFromWorkspace.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishIndividualNodesFromWorkspace.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspacePublication\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdsToPublishOrDiscard; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -24,7 +24,7 @@ * * @api commands are the write-API of the ContentRepository */ -final readonly class PublishIndividualNodesFromWorkspace implements CommandInterface +final readonly class PublishIndividualNodesFromWorkspace implements PublicCommandInterface { /** * @param WorkspaceName $workspaceName Name of the affected workspace diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishWorkspace.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishWorkspace.php index 5364d13054d..84c16af7f11 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishWorkspace.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspacePublication/Command/PublishWorkspace.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspacePublication\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -23,7 +23,7 @@ * * @api commands are the write-API of the ContentRepository */ -final readonly class PublishWorkspace implements CommandInterface +final readonly class PublishWorkspace implements PublicCommandInterface { /** * @param WorkspaceName $workspaceName Name of the workspace to publish diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/Command/RebaseWorkspace.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/Command/RebaseWorkspace.php index 5e9aa2cbc91..4dbefb282c4 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/Command/RebaseWorkspace.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/Command/RebaseWorkspace.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceRebase\Command; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\CommandHandler\PublicCommandInterface; use Neos\ContentRepository\Core\Feature\WorkspaceRebase\Dto\RebaseErrorHandlingStrategy; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -24,7 +24,7 @@ * * @api commands are the write-API of the ContentRepository */ -final readonly class RebaseWorkspace implements CommandInterface +final readonly class RebaseWorkspace implements PublicCommandInterface { /** * @param WorkspaceName $workspaceName Name of the workspace that should be rebased diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/CommandThatFailedDuringRebase.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/CommandThatFailedDuringRebase.php index bcfd9627256..96b6a433b11 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/CommandThatFailedDuringRebase.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceRebase/CommandThatFailedDuringRebase.php @@ -14,7 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\WorkspaceRebase; -use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; use Neos\EventStore\Model\Event\SequenceNumber; /** @@ -23,12 +23,12 @@ final readonly class CommandThatFailedDuringRebase { /** - * @param CommandInterface $command the command that failed + * @param RebasableToOtherWorkspaceInterface $command the command that failed * @param \Throwable $exception how the command failed * @param SequenceNumber $sequenceNumber the event store sequence number of the event containing the command to be rebased */ public function __construct( - public CommandInterface $command, + public RebasableToOtherWorkspaceInterface $command, public \Throwable $exception, private SequenceNumber $sequenceNumber, ) { diff --git a/Neos.ContentRepository.NodeMigration/src/NodeMigrationServiceFactory.php b/Neos.ContentRepository.NodeMigration/src/NodeMigrationServiceFactory.php index f6c3f5fee33..7a293ea5ae0 100644 --- a/Neos.ContentRepository.NodeMigration/src/NodeMigrationServiceFactory.php +++ b/Neos.ContentRepository.NodeMigration/src/NodeMigrationServiceFactory.php @@ -39,7 +39,7 @@ public function build(ContentRepositoryServiceFactoryDependencies $serviceFactor $filtersFactory->registerFilter('PropertyNotEmpty', new PropertyNotEmptyFilterFactory()); $filtersFactory->registerFilter('PropertyValue', new PropertyValueFilterFactory()); - $transformationsFactory = new TransformationsFactory($serviceFactoryDependencies->contentRepository); + $transformationsFactory = new TransformationsFactory($serviceFactoryDependencies->contentRepository, $serviceFactoryDependencies->propertyConverter); $transformationsFactory->registerTransformation('AddDimensionShineThrough', new AddDimensionShineThroughTransformationFactory()); $transformationsFactory->registerTransformation('AddNewProperty', new AddNewPropertyTransformationFactory()); $transformationsFactory->registerTransformation('ChangeNodeType', new ChangeNodeTypeTransformationFactory()); diff --git a/Neos.ContentRepository.NodeMigration/src/Transformation/AddDimensionShineThroughTransformationFactory.php b/Neos.ContentRepository.NodeMigration/src/Transformation/AddDimensionShineThroughTransformationFactory.php index f8decab4901..ea774b966c1 100644 --- a/Neos.ContentRepository.NodeMigration/src/Transformation/AddDimensionShineThroughTransformationFactory.php +++ b/Neos.ContentRepository.NodeMigration/src/Transformation/AddDimensionShineThroughTransformationFactory.php @@ -17,6 +17,7 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\Feature\DimensionSpaceAdjustment\Command\AddDimensionShineThrough; +use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -33,7 +34,8 @@ class AddDimensionShineThroughTransformationFactory implements TransformationFac */ public function build( array $settings, - ContentRepository $contentRepository + ContentRepository $contentRepository, + PropertyConverter $propertyConverter, ): GlobalTransformationInterface|NodeAggregateBasedTransformationInterface|NodeBasedTransformationInterface { return new class ( DimensionSpacePoint::fromArray($settings['from']), diff --git a/Neos.ContentRepository.NodeMigration/src/Transformation/AddNewPropertyTransformationFactory.php b/Neos.ContentRepository.NodeMigration/src/Transformation/AddNewPropertyTransformationFactory.php index b6ad21e946a..1a3dd9cdbc7 100644 --- a/Neos.ContentRepository.NodeMigration/src/Transformation/AddNewPropertyTransformationFactory.php +++ b/Neos.ContentRepository.NodeMigration/src/Transformation/AddNewPropertyTransformationFactory.php @@ -16,9 +16,11 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; -use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetSerializedNodeProperties; +use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetNodeProperties; +use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValue; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; +use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\SharedModel\Node\PropertyNames; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -31,13 +33,15 @@ class AddNewPropertyTransformationFactory implements TransformationFactoryInterf */ public function build( array $settings, - ContentRepository $contentRepository + ContentRepository $contentRepository, + PropertyConverter $propertyConverter, ): GlobalTransformationInterface|NodeAggregateBasedTransformationInterface|NodeBasedTransformationInterface { return new class ( $settings['newPropertyName'], $settings['type'], $settings['serializedValue'], - $contentRepository + $contentRepository, + $propertyConverter, ) implements NodeBasedTransformationInterface { public function __construct( /** @@ -50,6 +54,7 @@ public function __construct( */ private readonly mixed $serializedValue, private readonly ContentRepository $contentRepository, + private readonly PropertyConverter $propertyConverter, ) { } @@ -63,20 +68,17 @@ public function execute( // we don't need to unset a non-existing property return; } + $deserializedPropertyValue = $this->propertyConverter->deserializePropertyValue(SerializedPropertyValue::create($this->serializedValue, $this->type)); // @phpstan-ignore neos.cr.internal if (!$node->hasProperty($this->newPropertyName)) { $this->contentRepository->handle( - SetSerializedNodeProperties::create( + SetNodeProperties::create( $workspaceNameForWriting, $node->aggregateId, $node->originDimensionSpacePoint, - SerializedPropertyValues::fromArray([ - $this->newPropertyName => SerializedPropertyValue::create( - $this->serializedValue, - $this->type - ) - ]), - PropertyNames::createEmpty() + PropertyValuesToWrite::fromArray([ + $this->newPropertyName => $deserializedPropertyValue, + ]) ) ); } diff --git a/Neos.ContentRepository.NodeMigration/src/Transformation/ChangeNodeTypeTransformationFactory.php b/Neos.ContentRepository.NodeMigration/src/Transformation/ChangeNodeTypeTransformationFactory.php index 42ec7df2b4c..d6f8a0bb328 100644 --- a/Neos.ContentRepository.NodeMigration/src/Transformation/ChangeNodeTypeTransformationFactory.php +++ b/Neos.ContentRepository.NodeMigration/src/Transformation/ChangeNodeTypeTransformationFactory.php @@ -17,6 +17,7 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\Feature\NodeTypeChange\Command\ChangeNodeAggregateType; use Neos\ContentRepository\Core\Feature\NodeTypeChange\Dto\NodeAggregateTypeChangeChildConstraintConflictResolutionStrategy; +use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -35,7 +36,8 @@ class ChangeNodeTypeTransformationFactory implements TransformationFactoryInterf */ public function build( array $settings, - ContentRepository $contentRepository + ContentRepository $contentRepository, + PropertyConverter $propertyConverter, ): GlobalTransformationInterface|NodeAggregateBasedTransformationInterface|NodeBasedTransformationInterface { // by default, we won't delete anything. $nodeAggregateTypeChangeChildConstraintConflictResolutionStrategy diff --git a/Neos.ContentRepository.NodeMigration/src/Transformation/ChangePropertyValueTransformationFactory.php b/Neos.ContentRepository.NodeMigration/src/Transformation/ChangePropertyValueTransformationFactory.php index c0b51852b6b..bd3d31c915b 100644 --- a/Neos.ContentRepository.NodeMigration/src/Transformation/ChangePropertyValueTransformationFactory.php +++ b/Neos.ContentRepository.NodeMigration/src/Transformation/ChangePropertyValueTransformationFactory.php @@ -16,9 +16,12 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; +use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetNodeProperties; use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetSerializedNodeProperties; +use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValue; use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; +use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\SharedModel\Node\PropertyNames; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -41,7 +44,8 @@ class ChangePropertyValueTransformationFactory implements TransformationFactoryI */ public function build( array $settings, - ContentRepository $contentRepository + ContentRepository $contentRepository, + PropertyConverter $propertyConverter, ): GlobalTransformationInterface|NodeAggregateBasedTransformationInterface|NodeBasedTransformationInterface { $newSerializedValue = '{current}'; if (isset($settings['newSerializedValue'])) { @@ -69,7 +73,8 @@ public function build( $search, $replace, $currentValuePlaceholder, - $contentRepository + $contentRepository, + $propertyConverter, ) implements NodeBasedTransformationInterface { public function __construct( /** @@ -96,7 +101,8 @@ public function __construct( * current property value into the new value. */ private readonly string $currentValuePlaceholder, - private readonly ContentRepository $contentRepository + private readonly ContentRepository $contentRepository, + private readonly PropertyConverter $propertyConverter, ) { } @@ -126,19 +132,16 @@ public function execute( $this->replace, $newValueWithReplacedCurrentValue ); + $deserializedPropertyValue = $this->propertyConverter->deserializePropertyValue(SerializedPropertyValue::create($newValueWithReplacedSearch, $currentProperty->type)); // @phpstan-ignore neos.cr.internal $this->contentRepository->handle( - SetSerializedNodeProperties::create( + SetNodeProperties::create( $workspaceNameForWriting, $node->aggregateId, $node->originDimensionSpacePoint, - SerializedPropertyValues::fromArray([ - $this->propertyName => SerializedPropertyValue::create( - $newValueWithReplacedSearch, - $currentProperty->type - ) - ]), - PropertyNames::createEmpty() + PropertyValuesToWrite::fromArray([ + $this->propertyName => $deserializedPropertyValue, + ]) ) ); } diff --git a/Neos.ContentRepository.NodeMigration/src/Transformation/MoveDimensionSpacePointTransformationFactory.php b/Neos.ContentRepository.NodeMigration/src/Transformation/MoveDimensionSpacePointTransformationFactory.php index 0b7cc1b7679..47699871c57 100644 --- a/Neos.ContentRepository.NodeMigration/src/Transformation/MoveDimensionSpacePointTransformationFactory.php +++ b/Neos.ContentRepository.NodeMigration/src/Transformation/MoveDimensionSpacePointTransformationFactory.php @@ -17,6 +17,7 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\Feature\DimensionSpaceAdjustment\Command\MoveDimensionSpacePoint; +use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -29,7 +30,8 @@ class MoveDimensionSpacePointTransformationFactory implements TransformationFact */ public function build( array $settings, - ContentRepository $contentRepository + ContentRepository $contentRepository, + PropertyConverter $propertyConverter, ): GlobalTransformationInterface|NodeAggregateBasedTransformationInterface|NodeBasedTransformationInterface { $from = DimensionSpacePoint::fromArray($settings['from']); $to = DimensionSpacePoint::fromArray($settings['to']); diff --git a/Neos.ContentRepository.NodeMigration/src/Transformation/RemoveNodeTransformationFactory.php b/Neos.ContentRepository.NodeMigration/src/Transformation/RemoveNodeTransformationFactory.php index fbd0a2b46fa..0dfca855a8e 100644 --- a/Neos.ContentRepository.NodeMigration/src/Transformation/RemoveNodeTransformationFactory.php +++ b/Neos.ContentRepository.NodeMigration/src/Transformation/RemoveNodeTransformationFactory.php @@ -18,6 +18,7 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; use Neos\ContentRepository\Core\Feature\NodeRemoval\Command\RemoveNodeAggregate; +use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; use Neos\ContentRepository\Core\SharedModel\Node\NodeVariantSelectionStrategy; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -33,7 +34,8 @@ class RemoveNodeTransformationFactory implements TransformationFactoryInterface */ public function build( array $settings, - ContentRepository $contentRepository + ContentRepository $contentRepository, + PropertyConverter $propertyConverter, ): GlobalTransformationInterface|NodeAggregateBasedTransformationInterface|NodeBasedTransformationInterface { $strategy = null; if (isset($settings['strategy'])) { diff --git a/Neos.ContentRepository.NodeMigration/src/Transformation/RemovePropertyTransformationFactory.php b/Neos.ContentRepository.NodeMigration/src/Transformation/RemovePropertyTransformationFactory.php index c0990547e2d..30e182e42bc 100644 --- a/Neos.ContentRepository.NodeMigration/src/Transformation/RemovePropertyTransformationFactory.php +++ b/Neos.ContentRepository.NodeMigration/src/Transformation/RemovePropertyTransformationFactory.php @@ -16,10 +16,10 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; -use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetSerializedNodeProperties; -use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; +use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetNodeProperties; +use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite; +use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; -use Neos\ContentRepository\Core\SharedModel\Node\PropertyNames; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -33,7 +33,8 @@ class RemovePropertyTransformationFactory implements TransformationFactoryInterf */ public function build( array $settings, - ContentRepository $contentRepository + ContentRepository $contentRepository, + PropertyConverter $propertyConverter, ): GlobalTransformationInterface|NodeAggregateBasedTransformationInterface|NodeBasedTransformationInterface { $propertyName = $settings['property']; return new class ( @@ -56,12 +57,13 @@ public function execute( ): void { if ($node->hasProperty($this->propertyName)) { $this->contentRepository->handle( - SetSerializedNodeProperties::create( + SetNodeProperties::create( $workspaceNameForWriting, $node->aggregateId, $node->originDimensionSpacePoint, - SerializedPropertyValues::createEmpty(), - PropertyNames::fromArray([$this->propertyName]) + PropertyValuesToWrite::fromArray([ + $this->propertyName => null, + ]), ) ); } diff --git a/Neos.ContentRepository.NodeMigration/src/Transformation/RenameNodeAggregateTransformationFactory.php b/Neos.ContentRepository.NodeMigration/src/Transformation/RenameNodeAggregateTransformationFactory.php index 3e05d002d1b..cd277a27641 100644 --- a/Neos.ContentRepository.NodeMigration/src/Transformation/RenameNodeAggregateTransformationFactory.php +++ b/Neos.ContentRepository.NodeMigration/src/Transformation/RenameNodeAggregateTransformationFactory.php @@ -16,6 +16,7 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\Feature\NodeRenaming\Command\ChangeNodeAggregateName; +use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; use Neos\ContentRepository\Core\Projection\ContentGraph\NodeAggregate; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; @@ -28,7 +29,8 @@ class RenameNodeAggregateTransformationFactory implements TransformationFactoryI */ public function build( array $settings, - ContentRepository $contentRepository + ContentRepository $contentRepository, + PropertyConverter $propertyConverter, ): GlobalTransformationInterface|NodeAggregateBasedTransformationInterface|NodeBasedTransformationInterface { $newNodeName = $settings['newNodeName']; diff --git a/Neos.ContentRepository.NodeMigration/src/Transformation/RenamePropertyTransformationFactory.php b/Neos.ContentRepository.NodeMigration/src/Transformation/RenamePropertyTransformationFactory.php index ff70a13bd7f..3d76ca3ba37 100644 --- a/Neos.ContentRepository.NodeMigration/src/Transformation/RenamePropertyTransformationFactory.php +++ b/Neos.ContentRepository.NodeMigration/src/Transformation/RenamePropertyTransformationFactory.php @@ -16,10 +16,10 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; -use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetSerializedNodeProperties; -use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; +use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetNodeProperties; +use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite; +use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; -use Neos\ContentRepository\Core\SharedModel\Node\PropertyNames; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -33,7 +33,8 @@ class RenamePropertyTransformationFactory implements TransformationFactoryInterf */ public function build( array $settings, - ContentRepository $contentRepository + ContentRepository $contentRepository, + PropertyConverter $propertyConverter, ): GlobalTransformationInterface|NodeAggregateBasedTransformationInterface|NodeBasedTransformationInterface { return new class ( @@ -62,20 +63,21 @@ public function execute( ContentStreamId $contentStreamForWriting ): void { - $serializedPropertyValue = $node->properties->serialized()->getProperty($this->from); - if ($serializedPropertyValue !== null) { - $this->contentRepository->handle( - SetSerializedNodeProperties::create( - $workspaceNameForWriting, - $node->aggregateId, - $node->originDimensionSpacePoint, - SerializedPropertyValues::fromArray([ - $this->to => $serializedPropertyValue - ]), - PropertyNames::fromArray([$this->from]) - ) - ); + $propertyValue = $node->properties[$this->from]; + if ($propertyValue === null) { + return; } + $this->contentRepository->handle( + SetNodeProperties::create( + $workspaceNameForWriting, + $node->aggregateId, + $node->originDimensionSpacePoint, + PropertyValuesToWrite::fromArray([ + $this->to => $propertyValue, + $this->from => null, + ]), + ) + ); } }; } diff --git a/Neos.ContentRepository.NodeMigration/src/Transformation/StripTagsOnPropertyTransformationFactory.php b/Neos.ContentRepository.NodeMigration/src/Transformation/StripTagsOnPropertyTransformationFactory.php index 9803c9509b2..6c372de3c3c 100644 --- a/Neos.ContentRepository.NodeMigration/src/Transformation/StripTagsOnPropertyTransformationFactory.php +++ b/Neos.ContentRepository.NodeMigration/src/Transformation/StripTagsOnPropertyTransformationFactory.php @@ -16,11 +16,10 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePointSet; -use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetSerializedNodeProperties; -use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValue; -use Neos\ContentRepository\Core\Feature\NodeModification\Dto\SerializedPropertyValues; +use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetNodeProperties; +use Neos\ContentRepository\Core\Feature\NodeModification\Dto\PropertyValuesToWrite; +use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; use Neos\ContentRepository\Core\Projection\ContentGraph\Node; -use Neos\ContentRepository\Core\SharedModel\Node\PropertyNames; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; @@ -34,7 +33,8 @@ class StripTagsOnPropertyTransformationFactory implements TransformationFactoryI */ public function build( array $settings, - ContentRepository $contentRepository + ContentRepository $contentRepository, + PropertyConverter $propertyConverter, ): GlobalTransformationInterface|NodeAggregateBasedTransformationInterface|NodeBasedTransformationInterface { return new class ( $settings['property'], @@ -55,31 +55,27 @@ public function execute( WorkspaceName $workspaceNameForWriting, ContentStreamId $contentStreamForWriting ): void { - $serializedPropertyValue = $node->properties->serialized()->getProperty($this->propertyName); - if ($serializedPropertyValue !== null) { - $propertyValue = $serializedPropertyValue->value; - if (!is_string($propertyValue)) { - throw new \Exception( - 'StripTagsOnProperty can only be applied to properties of type string.', - 1645391885 - ); - } - $newValue = strip_tags($propertyValue); - $this->contentRepository->handle( - SetSerializedNodeProperties::create( - $workspaceNameForWriting, - $node->aggregateId, - $node->originDimensionSpacePoint, - SerializedPropertyValues::fromArray([ - $this->propertyName => SerializedPropertyValue::create( - $newValue, - $serializedPropertyValue->type - ) - ]), - PropertyNames::createEmpty() - ) + $propertyValue = $node->properties[$this->propertyName]; + if ($propertyValue === null) { + return; + } + if (!is_string($propertyValue)) { + throw new \Exception( + sprintf('StripTagsOnProperty can only be applied to properties of type string. Property "%s" is of type %s', $this->propertyName, get_debug_type($propertyValue)), + 1645391885 ); } + $newValue = strip_tags($propertyValue); + $this->contentRepository->handle( + SetNodeProperties::create( + $workspaceNameForWriting, + $node->aggregateId, + $node->originDimensionSpacePoint, + PropertyValuesToWrite::fromArray([ + $this->propertyName => $newValue, + ]), + ) + ); } }; } diff --git a/Neos.ContentRepository.NodeMigration/src/Transformation/TransformationFactoryInterface.php b/Neos.ContentRepository.NodeMigration/src/Transformation/TransformationFactoryInterface.php index df0c2193ed7..ecaa105d733 100644 --- a/Neos.ContentRepository.NodeMigration/src/Transformation/TransformationFactoryInterface.php +++ b/Neos.ContentRepository.NodeMigration/src/Transformation/TransformationFactoryInterface.php @@ -5,6 +5,7 @@ namespace Neos\ContentRepository\NodeMigration\Transformation; use Neos\ContentRepository\Core\ContentRepository; +use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; interface TransformationFactoryInterface { @@ -13,6 +14,7 @@ interface TransformationFactoryInterface */ public function build( array $settings, - ContentRepository $contentRepository + ContentRepository $contentRepository, + PropertyConverter $propertyConverter, ): GlobalTransformationInterface|NodeAggregateBasedTransformationInterface|NodeBasedTransformationInterface; } diff --git a/Neos.ContentRepository.NodeMigration/src/Transformation/TransformationsFactory.php b/Neos.ContentRepository.NodeMigration/src/Transformation/TransformationsFactory.php index 915c05cc3fe..56d8d0eaa02 100644 --- a/Neos.ContentRepository.NodeMigration/src/Transformation/TransformationsFactory.php +++ b/Neos.ContentRepository.NodeMigration/src/Transformation/TransformationsFactory.php @@ -5,6 +5,7 @@ namespace Neos\ContentRepository\NodeMigration\Transformation; use Neos\ContentRepository\Core\ContentRepository; +use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; use Neos\ContentRepository\NodeMigration\MigrationException; use Neos\ContentRepository\NodeMigration\NodeMigrationService; @@ -19,7 +20,8 @@ class TransformationsFactory private array $transformationFactories = []; public function __construct( - private readonly ContentRepository $contentRepository + private readonly ContentRepository $contentRepository, + private readonly PropertyConverter $propertyConverter, ) { } @@ -58,7 +60,7 @@ protected function buildTransformationObject( ): GlobalTransformationInterface|NodeAggregateBasedTransformationInterface|NodeBasedTransformationInterface { $transformationFactory = $this->resolveTransformationFactory($transformationConfiguration['type']); - return $transformationFactory->build($transformationConfiguration['settings'] ?? [], $this->contentRepository); + return $transformationFactory->build($transformationConfiguration['settings'] ?? [], $this->contentRepository, $this->propertyConverter); } /** diff --git a/Neos.ContentRepository.NodeMigration/src/Transformation/UpdateRootNodeAggregateDimensionsTransformationFactory.php b/Neos.ContentRepository.NodeMigration/src/Transformation/UpdateRootNodeAggregateDimensionsTransformationFactory.php index 3b4b47867bb..4e735ae7ad3 100644 --- a/Neos.ContentRepository.NodeMigration/src/Transformation/UpdateRootNodeAggregateDimensionsTransformationFactory.php +++ b/Neos.ContentRepository.NodeMigration/src/Transformation/UpdateRootNodeAggregateDimensionsTransformationFactory.php @@ -6,6 +6,7 @@ use Neos\ContentRepository\Core\ContentRepository; use Neos\ContentRepository\Core\Feature\RootNodeCreation\Command\UpdateRootNodeAggregateDimensions; +use Neos\ContentRepository\Core\Infrastructure\Property\PropertyConverter; use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\ContentRepository\NodeMigration\MigrationException; @@ -17,7 +18,8 @@ class UpdateRootNodeAggregateDimensionsTransformationFactory implements Transfor */ public function build( array $settings, - ContentRepository $contentRepository + ContentRepository $contentRepository, + PropertyConverter $propertyConverter, ): GlobalTransformationInterface|NodeAggregateBasedTransformationInterface|NodeBasedTransformationInterface { if (!isset($settings['nodeType'])) { throw new MigrationException( diff --git a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/GenericCommandExecutionAndEventPublication.php b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/GenericCommandExecutionAndEventPublication.php index dd899ee4e24..d9d7f66def5 100644 --- a/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/GenericCommandExecutionAndEventPublication.php +++ b/Neos.ContentRepository.TestSuite/Classes/Behavior/Features/Bootstrap/GenericCommandExecutionAndEventPublication.php @@ -20,10 +20,9 @@ use Neos\ContentRepository\Core\EventStore\EventPersister; use Neos\ContentRepository\Core\EventStore\Events; use Neos\ContentRepository\Core\EventStore\EventsToPublish; -use Neos\ContentRepository\Core\Feature\NodeCreation\Command\CreateNodeAggregateWithNodeAndSerializedProperties; use Neos\ContentRepository\Core\Feature\NodeDisabling\Command\DisableNodeAggregate; use Neos\ContentRepository\Core\Feature\NodeDisabling\Command\EnableNodeAggregate; -use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetSerializedNodeProperties; +use Neos\ContentRepository\Core\Feature\NodeModification\Command\SetNodeProperties; use Neos\ContentRepository\Core\Feature\NodeMove\Command\MoveNodeAggregate; use Neos\ContentRepository\Core\Feature\NodeReferencing\Command\SetNodeReferences; use Neos\ContentRepository\Core\Feature\NodeRenaming\Command\ChangeNodeAggregateName; @@ -104,9 +103,8 @@ protected static function resolveShortCommandName(string $shortCommandName): str 'PublishWorkspace' => PublishWorkspace::class, 'PublishIndividualNodesFromWorkspace' => PublishIndividualNodesFromWorkspace::class, 'RebaseWorkspace' => RebaseWorkspace::class, - 'CreateNodeAggregateWithNodeAndSerializedProperties' => CreateNodeAggregateWithNodeAndSerializedProperties::class, 'ChangeNodeAggregateName' => ChangeNodeAggregateName::class, - 'SetSerializedNodeProperties' => SetSerializedNodeProperties::class, + 'SetNodeProperties' => SetNodeProperties::class, 'DisableNodeAggregate' => DisableNodeAggregate::class, 'EnableNodeAggregate' => EnableNodeAggregate::class, 'TagSubtree' => TagSubtree::class, diff --git a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature index b1edf071af4..ab8a61b3e2b 100644 --- a/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature +++ b/Neos.Neos/Tests/Behavior/Features/Fusion/ContentCollection.feature @@ -109,7 +109,7 @@ Feature: Tests for the "Neos.Neos:ContentCollection" Fusion prototype """ Scenario: - When the command CreateNodeAggregateWithNodeAndSerializedProperties is executed with payload: + When the command CreateNodeAggregateWithNode is executed with payload: | Key | Value | | nodeAggregateId | "a1" | | nodeTypeName | "Neos.Neos:Test.DocumentType" |