From a13da1f70fe0f42abb9990fbb536e5d872507d45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Mu=CC=88ller?= Date: Sat, 19 Oct 2024 19:09:16 +0200 Subject: [PATCH] WIP: VirtualWorkspaceName --- .../src/ContentGraphFactory.php | 3 +- .../src/Domain/Repository/ContentGraph.php | 5 +- .../src/Domain/Repository/ContentSubgraph.php | 5 +- .../src/Domain/Repository/NodeFactory.php | 11 +-- .../Classes/CommandHandlingDependencies.php | 7 +- .../Classes/ContentGraphFactoryInterface.php | 3 +- .../Classes/ContentGraphFinder.php | 10 ++- .../Classes/ContentRepository.php | 3 +- .../Feature/Common/ConstraintChecks.php | 9 ++- .../Feature/Common/EmbedsWorkspaceName.php | 3 +- .../RebasableToOtherWorkspaceInterface.php | 3 +- .../Command/AddDimensionShineThrough.php | 11 +-- .../Command/MoveDimensionSpacePoint.php | 11 +-- .../Event/DimensionShineThroughWasAdded.php | 7 +- .../Event/DimensionSpacePointWasMoved.php | 5 +- ...gregateWithNodeAndSerializedProperties.php | 11 +-- .../Event/NodeAggregateWithNodeWasCreated.php | 5 +- .../Command/DisableNodeAggregate.php | 11 +-- .../Command/EnableNodeAggregate.php | 11 +-- .../Event/NodeAggregateWasDisabled.php | 7 +- .../Event/NodeAggregateWasEnabled.php | 7 +- .../Command/CopyNodesRecursively.php | 13 +-- .../Command/SetSerializedNodeProperties.php | 11 +-- .../Event/NodePropertiesWereSet.php | 7 +- .../NodeMove/Command/MoveNodeAggregate.php | 11 +-- .../NodeMove/Event/NodeAggregateWasMoved.php | 7 +- .../Command/SetSerializedNodeReferences.php | 11 +-- .../Event/NodeReferencesWereSet.php | 5 +- .../Command/RemoveNodeAggregate.php | 11 +-- .../Event/NodeAggregateWasRemoved.php | 5 +- .../Command/ChangeNodeAggregateName.php | 11 +-- .../Event/NodeAggregateNameWasChanged.php | 5 +- .../Command/ChangeNodeAggregateType.php | 11 +-- .../Event/NodeAggregateTypeWasChanged.php | 5 +- .../Command/CreateNodeVariant.php | 11 +-- .../NodeGeneralizationVariantWasCreated.php | 5 +- .../Event/NodePeerVariantWasCreated.php | 5 +- .../NodeSpecializationVariantWasCreated.php | 5 +- .../CreateRootNodeAggregateWithNode.php | 11 +-- .../UpdateRootNodeAggregateDimensions.php | 3 +- .../SubtreeTagging/Command/TagSubtree.php | 3 +- .../SubtreeTagging/Command/UntagSubtree.php | 3 +- .../SubtreeTagging/Event/SubtreeWasTagged.php | 5 +- .../Event/SubtreeWasUntagged.php | 5 +- .../Feature/WorkspaceCommandHandler.php | 79 ++++++++++--------- .../ContentGraph/ContentGraphInterface.php | 3 +- .../ContentGraph/ContentSubgraphInterface.php | 3 +- .../Classes/Projection/ContentGraph/Node.php | 7 +- .../Projection/ContentGraph/NodeAggregate.php | 7 +- .../Exception/WorkspaceDoesNotExist.php | 1 + .../Workspace/VirtualWorkspaceName.php | 51 ++++++++++++ .../SharedModel/Workspace/WorkspaceName.php | 11 ++- .../CatchUpHook/AssetUsageCatchUpHook.php | 7 ++ .../Service/AssetUsageIndexingService.php | 5 ++ ...phProjectorCatchUpHookForCacheFlushing.php | 7 +- 55 files changed, 320 insertions(+), 178 deletions(-) create mode 100644 Neos.ContentRepository.Core/Classes/SharedModel/Workspace/VirtualWorkspaceName.php diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/ContentGraphFactory.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/ContentGraphFactory.php index 5f1b45b09a5..9a769bded92 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/ContentGraphFactory.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/ContentGraphFactory.php @@ -23,6 +23,7 @@ use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId; use Neos\ContentRepository\Core\SharedModel\Exception\WorkspaceDoesNotExist; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -73,7 +74,7 @@ public function buildForWorkspace(WorkspaceName $workspaceName): ContentGraph return $this->buildForWorkspaceAndContentStream($workspaceName, ContentStreamId::fromString($currentContentStreamId)); } - public function buildForWorkspaceAndContentStream(WorkspaceName $workspaceName, ContentStreamId $contentStreamId): ContentGraph + public function buildForWorkspaceAndContentStream(WorkspaceName|VirtualWorkspaceName $workspaceName, ContentStreamId $contentStreamId): ContentGraph { return new ContentGraph($this->dbal, $this->nodeFactory, $this->contentRepositoryId, $this->nodeTypeManager, $this->tableNames, $workspaceName, $contentStreamId); } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php index 68b0fd85fc0..8b2633891f2 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentGraph.php @@ -37,6 +37,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -70,7 +71,7 @@ public function __construct( private readonly ContentRepositoryId $contentRepositoryId, private readonly NodeTypeManager $nodeTypeManager, private readonly ContentGraphTableNames $tableNames, - public readonly WorkspaceName $workspaceName, + public readonly WorkspaceName|VirtualWorkspaceName $workspaceName, public readonly ContentStreamId $contentStreamId ) { $this->nodeQueryBuilder = new NodeQueryBuilder($this->dbal, $this->tableNames); @@ -81,7 +82,7 @@ public function getContentRepositoryId(): ContentRepositoryId return $this->contentRepositoryId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php index 810a095069f..2851a047799 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/ContentSubgraph.php @@ -56,6 +56,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Node\PropertyName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -90,7 +91,7 @@ final class ContentSubgraph implements ContentSubgraphInterface public function __construct( private readonly ContentRepositoryId $contentRepositoryId, - private readonly WorkspaceName $workspaceName, + private readonly WorkspaceName|VirtualWorkspaceName $workspaceName, private readonly ContentStreamId $contentStreamId, private readonly DimensionSpacePoint $dimensionSpacePoint, private readonly VisibilityConstraints $visibilityConstraints, @@ -107,7 +108,7 @@ public function getContentRepositoryId(): ContentRepositoryId return $this->contentRepositoryId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } diff --git a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php index d16d803f788..af5c2871995 100644 --- a/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php +++ b/Neos.ContentGraph.DoctrineDbalAdapter/src/Domain/Repository/NodeFactory.php @@ -41,6 +41,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Traversable; @@ -63,7 +64,7 @@ public function __construct( */ public function mapNodeRowToNode( array $nodeRow, - WorkspaceName $workspaceName, + WorkspaceName|VirtualWorkspaceName $workspaceName, DimensionSpacePoint $dimensionSpacePoint, VisibilityConstraints $visibilityConstraints ): Node { @@ -93,7 +94,7 @@ public function mapNodeRowToNode( */ public function mapNodeRowsToNodes( array $nodeRows, - WorkspaceName $workspaceName, + WorkspaceName|VirtualWorkspaceName $workspaceName, DimensionSpacePoint $dimensionSpacePoint, VisibilityConstraints $visibilityConstraints ): Nodes { @@ -120,7 +121,7 @@ public function createPropertyCollectionFromJsonString(string $jsonString): Prop */ public function mapReferenceRowsToReferences( array $nodeRows, - WorkspaceName $workspaceName, + WorkspaceName|VirtualWorkspaceName $workspaceName, DimensionSpacePoint $dimensionSpacePoint, VisibilityConstraints $visibilityConstraints ): References { @@ -150,7 +151,7 @@ public function mapReferenceRowsToReferences( */ public function mapNodeRowsToNodeAggregate( array $nodeRows, - WorkspaceName $workspaceName, + WorkspaceName|VirtualWorkspaceName $workspaceName, VisibilityConstraints $visibilityConstraints ): ?NodeAggregate { if (empty($nodeRows)) { @@ -231,7 +232,7 @@ public function mapNodeRowsToNodeAggregate( */ public function mapNodeRowsToNodeAggregates( array $nodeRows, - WorkspaceName $workspaceName, + WorkspaceName|VirtualWorkspaceName $workspaceName, VisibilityConstraints $visibilityConstraints ): NodeAggregates { if (empty($nodeRows)) { diff --git a/Neos.ContentRepository.Core/Classes/CommandHandlingDependencies.php b/Neos.ContentRepository.Core/Classes/CommandHandlingDependencies.php index c0b5270cc37..7b517295981 100644 --- a/Neos.ContentRepository.Core/Classes/CommandHandlingDependencies.php +++ b/Neos.ContentRepository.Core/Classes/CommandHandlingDependencies.php @@ -21,6 +21,7 @@ use Neos\ContentRepository\Core\Projection\Workspace\WorkspaceFinder; use Neos\ContentRepository\Core\SharedModel\Exception\WorkspaceDoesNotExist; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -59,8 +60,12 @@ public function getContentStreamFinder(): ContentStreamFinder /** * @throws WorkspaceDoesNotExist if the workspace does not exist */ - public function getContentGraph(WorkspaceName $workspaceName): ContentGraphInterface + public function getContentGraph(WorkspaceName|VirtualWorkspaceName $workspaceName): ContentGraphInterface { + if ($workspaceName instanceof VirtualWorkspaceName) { + return $this->contentRepository->projectionState(ContentGraphFinder::class)->getByWorkspaceNameAndContentStreamId($workspaceName, $workspaceName->contentStreamId); + } + if (isset($this->overridenContentGraphInstances[$workspaceName->value])) { return $this->overridenContentGraphInstances[$workspaceName->value]; } diff --git a/Neos.ContentRepository.Core/Classes/ContentGraphFactoryInterface.php b/Neos.ContentRepository.Core/Classes/ContentGraphFactoryInterface.php index 2a766579751..5208184c2cc 100644 --- a/Neos.ContentRepository.Core/Classes/ContentGraphFactoryInterface.php +++ b/Neos.ContentRepository.Core/Classes/ContentGraphFactoryInterface.php @@ -17,6 +17,7 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\ContentGraphInterface; use Neos\ContentRepository\Core\SharedModel\Exception\WorkspaceDoesNotExist; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -31,5 +32,5 @@ interface ContentGraphFactoryInterface */ public function buildForWorkspace(WorkspaceName $workspaceName): ContentGraphInterface; - public function buildForWorkspaceAndContentStream(WorkspaceName $workspaceName, ContentStreamId $contentStreamId): ContentGraphInterface; + public function buildForWorkspaceAndContentStream(WorkspaceName|VirtualWorkspaceName $workspaceName, ContentStreamId $contentStreamId): ContentGraphInterface; } diff --git a/Neos.ContentRepository.Core/Classes/ContentGraphFinder.php b/Neos.ContentRepository.Core/Classes/ContentGraphFinder.php index 36a7da4fea1..21de0d30601 100644 --- a/Neos.ContentRepository.Core/Classes/ContentGraphFinder.php +++ b/Neos.ContentRepository.Core/Classes/ContentGraphFinder.php @@ -18,6 +18,7 @@ use Neos\ContentRepository\Core\Projection\ProjectionStateInterface; use Neos\ContentRepository\Core\SharedModel\Exception\WorkspaceDoesNotExist; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -42,19 +43,22 @@ public function __construct( * @throws WorkspaceDoesNotExist if the provided workspace does not resolve to an existing content stream * @see ContentRepository::getContentGraph() */ - public function getByWorkspaceName(WorkspaceName $workspaceName): ContentGraphInterface + public function getByWorkspaceName(WorkspaceName|VirtualWorkspaceName $workspaceName): ContentGraphInterface { + if ($workspaceName instanceof VirtualWorkspaceName) { + return $this->getByWorkspaceNameAndContentStreamId($workspaceName, $workspaceName->contentStreamId); + } return $this->contentGraphFactory->buildForWorkspace($workspaceName); } /** * For testing we allow getting an instance set by both parameters, effectively overriding the relationship at will * - * @param WorkspaceName $workspaceName + * @param WorkspaceName|VirtualWorkspaceName $workspaceName * @param ContentStreamId $contentStreamId * @internal Only for the write side during publishing {@see \Neos\ContentRepository\Core\CommandHandlingDependencies::overrideContentStreamId} */ - public function getByWorkspaceNameAndContentStreamId(WorkspaceName $workspaceName, ContentStreamId $contentStreamId): ContentGraphInterface + public function getByWorkspaceNameAndContentStreamId(WorkspaceName|VirtualWorkspaceName $workspaceName, ContentStreamId $contentStreamId): ContentGraphInterface { return $this->contentGraphFactory->buildForWorkspaceAndContentStream($workspaceName, $contentStreamId); } diff --git a/Neos.ContentRepository.Core/Classes/ContentRepository.php b/Neos.ContentRepository.Core/Classes/ContentRepository.php index d1262979d40..d9b21e6bdd6 100644 --- a/Neos.ContentRepository.Core/Classes/ContentRepository.php +++ b/Neos.ContentRepository.Core/Classes/ContentRepository.php @@ -43,6 +43,7 @@ use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryStatus; use Neos\ContentRepository\Core\SharedModel\Exception\WorkspaceDoesNotExist; use Neos\ContentRepository\Core\SharedModel\User\UserIdProviderInterface; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\EventStore\EventStoreInterface; use Neos\EventStore\Model\Event\EventMetadata; @@ -239,7 +240,7 @@ public function resetProjectionState(string $projectionClassName): void /** * @throws WorkspaceDoesNotExist if the workspace does not exist */ - public function getContentGraph(WorkspaceName $workspaceName): ContentGraphInterface + public function getContentGraph(WorkspaceName|VirtualWorkspaceName $workspaceName): ContentGraphInterface { return $this->projectionState(ContentGraphFinder::class)->getByWorkspaceName($workspaceName); } diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php b/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php index 9cb894f5d76..17c44e957d9 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/ConstraintChecks.php @@ -61,6 +61,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamState; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\EventStore\Model\EventStream\ExpectedVersion; @@ -77,9 +78,15 @@ abstract protected function getAllowedDimensionSubspace(): DimensionSpacePointSe * @throws ContentStreamDoesNotExistYet */ protected function requireContentStream( - WorkspaceName $workspaceName, + WorkspaceName|VirtualWorkspaceName $workspaceName, CommandHandlingDependencies $commandHandlingDependencies ): ContentStreamId { + if ($workspaceName instanceof VirtualWorkspaceName) { + $state = $commandHandlingDependencies->getContentStreamFinder()->findStateForContentStream($workspaceName->contentStreamId); + if ($state !== null) { + return $workspaceName->contentStreamId; + } + } $contentStreamId = $commandHandlingDependencies->getContentGraph($workspaceName)->getContentStreamId(); $state = $commandHandlingDependencies->getContentStreamFinder()->findStateForContentStream($contentStreamId); if ($state === null) { diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsWorkspaceName.php b/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsWorkspaceName.php index a9b9f5f85ba..c4c71502287 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsWorkspaceName.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/EmbedsWorkspaceName.php @@ -14,6 +14,7 @@ namespace Neos\ContentRepository\Core\Feature\Common; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -25,5 +26,5 @@ */ interface EmbedsWorkspaceName { - public function getWorkspaceName(): WorkspaceName; + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/Common/RebasableToOtherWorkspaceInterface.php b/Neos.ContentRepository.Core/Classes/Feature/Common/RebasableToOtherWorkspaceInterface.php index 4d2d5094818..28eb22363f3 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/Common/RebasableToOtherWorkspaceInterface.php +++ b/Neos.ContentRepository.Core/Classes/Feature/Common/RebasableToOtherWorkspaceInterface.php @@ -15,6 +15,7 @@ namespace Neos\ContentRepository\Core\Feature\Common; use Neos\ContentRepository\Core\CommandHandler\CommandInterface; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -28,7 +29,7 @@ interface RebasableToOtherWorkspaceInterface { public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): CommandInterface; /** diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Command/AddDimensionShineThrough.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Command/AddDimensionShineThrough.php index 936505d278d..c608751b2ad 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Command/AddDimensionShineThrough.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Command/AddDimensionShineThrough.php @@ -18,6 +18,7 @@ use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -39,24 +40,24 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The name of the workspace to perform the operation in. + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The name of the workspace to perform the operation in. * @param DimensionSpacePoint $source source dimension space point * @param DimensionSpacePoint $target target dimension space point */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public DimensionSpacePoint $source, public DimensionSpacePoint $target ) { } /** - * @param WorkspaceName $workspaceName The name of the workspace to perform the operation in + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The name of the workspace to perform the operation in * @param DimensionSpacePoint $source source dimension space point * @param DimensionSpacePoint $target target dimension space point */ public static function create( - WorkspaceName $workspaceName, + WorkspaceName|VirtualWorkspaceName $workspaceName, DimensionSpacePoint $source, DimensionSpacePoint $target ): self { @@ -75,7 +76,7 @@ public static function fromArray(array $array): self ); } - public function createCopyForWorkspace(WorkspaceName $targetWorkspaceName): self + public function createCopyForWorkspace(WorkspaceName|VirtualWorkspaceName $targetWorkspaceName): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Command/MoveDimensionSpacePoint.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Command/MoveDimensionSpacePoint.php index 498ba261e49..fff9da43622 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Command/MoveDimensionSpacePoint.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Command/MoveDimensionSpacePoint.php @@ -17,6 +17,7 @@ use Neos\ContentRepository\Core\CommandHandler\CommandInterface; use Neos\ContentRepository\Core\DimensionSpace\DimensionSpacePoint; use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -34,24 +35,24 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The name of the workspace to perform the operation in. + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The name of the workspace to perform the operation in. * @param DimensionSpacePoint $source source dimension space point * @param DimensionSpacePoint $target target dimension space point */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public DimensionSpacePoint $source, public DimensionSpacePoint $target, ) { } /** - * @param WorkspaceName $workspaceName The name of the workspace to perform the operation in + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The name of the workspace to perform the operation in * @param DimensionSpacePoint $source source dimension space point * @param DimensionSpacePoint $target target dimension space point */ public static function create( - WorkspaceName $workspaceName, + WorkspaceName|VirtualWorkspaceName $workspaceName, DimensionSpacePoint $source, DimensionSpacePoint $target ): self { @@ -71,7 +72,7 @@ public static function fromArray(array $array): self } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php index e6806c40b84..3d5d4a73c72 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionShineThroughWasAdded.php @@ -20,6 +20,7 @@ use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -38,7 +39,7 @@ final readonly class DimensionShineThroughWasAdded implements EventInterface, PublishableToWorkspaceInterface, EmbedsContentStreamId, EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public DimensionSpacePoint $source, public DimensionSpacePoint $target @@ -50,12 +51,12 @@ public function getContentStreamId(): ContentStreamId return $this->contentStreamId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } - public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php index 2e9c014c672..362225bcc8f 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/DimensionSpaceAdjustment/Event/DimensionSpacePointWasMoved.php @@ -20,6 +20,7 @@ use Neos\ContentRepository\Core\Feature\Common\EmbedsWorkspaceName; use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -34,7 +35,7 @@ final readonly class DimensionSpacePointWasMoved implements EventInterface, PublishableToWorkspaceInterface, EmbedsContentStreamId, EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public DimensionSpacePoint $source, public DimensionSpacePoint $target @@ -46,7 +47,7 @@ public function getContentStreamId(): ContentStreamId return $this->contentStreamId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Command/CreateNodeAggregateWithNodeAndSerializedProperties.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Command/CreateNodeAggregateWithNodeAndSerializedProperties.php index f295cd6dabe..9b6f0454a3e 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Command/CreateNodeAggregateWithNodeAndSerializedProperties.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Command/CreateNodeAggregateWithNodeAndSerializedProperties.php @@ -24,6 +24,7 @@ use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -39,7 +40,7 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The workspace in which the create operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the create operation is to be performed * @param NodeAggregateId $nodeAggregateId The unique identifier of the node aggregate to create * @param NodeTypeName $nodeTypeName Name of the node type of the new node * @param OriginDimensionSpacePoint $originDimensionSpacePoint Origin of the new node in the dimension space. Will also be used to calculate a set of dimension points where the new node will cover from the configured specializations. @@ -50,7 +51,7 @@ * @param NodeAggregateIdsByNodePaths $tetheredDescendantNodeAggregateIds Predefined aggregate ids of tethered child nodes per path. For any tethered node that has no matching entry in this set, the node aggregate id is generated randomly. Since tethered nodes may have tethered child nodes themselves, this works for multiple levels ({@see self::withTetheredDescendantNodeAggregateIds()}) */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public NodeAggregateId $nodeAggregateId, public NodeTypeName $nodeTypeName, public OriginDimensionSpacePoint $originDimensionSpacePoint, @@ -63,7 +64,7 @@ private function __construct( } /** - * @param WorkspaceName $workspaceName The workspace in which the create operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the create operation is to be performed * @param NodeAggregateId $nodeAggregateId The unique identifier of the node aggregate to create * @param NodeTypeName $nodeTypeName Name of the node type of the new node * @param OriginDimensionSpacePoint $originDimensionSpacePoint Origin of the new node in the dimension space. Will also be used to calculate a set of dimension points where the new node will cover from the configured specializations. @@ -71,7 +72,7 @@ private function __construct( * @param NodeAggregateId|null $succeedingSiblingNodeAggregateId Node aggregate id of the node's succeeding sibling (optional). If not given, the node will be added as the parent's first child * @param SerializedPropertyValues|null $initialPropertyValues The node's initial property values (serialized). Will be merged over the node type's default property values */ - public static function create(WorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, NodeTypeName $nodeTypeName, OriginDimensionSpacePoint $originDimensionSpacePoint, NodeAggregateId $parentNodeAggregateId, NodeAggregateId $succeedingSiblingNodeAggregateId = null, SerializedPropertyValues $initialPropertyValues = null): self + public static function create(WorkspaceName|VirtualWorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, NodeTypeName $nodeTypeName, OriginDimensionSpacePoint $originDimensionSpacePoint, NodeAggregateId $parentNodeAggregateId, NodeAggregateId $succeedingSiblingNodeAggregateId = null, SerializedPropertyValues $initialPropertyValues = null): self { return new self($workspaceName, $nodeAggregateId, $nodeTypeName, $originDimensionSpacePoint, $parentNodeAggregateId, $initialPropertyValues ?? SerializedPropertyValues::createEmpty(), $succeedingSiblingNodeAggregateId, null, NodeAggregateIdsByNodePaths::createEmpty()); } @@ -162,7 +163,7 @@ public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php index 9b1d63975b8..836e31b8631 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeCreation/Event/NodeAggregateWithNodeWasCreated.php @@ -28,6 +28,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -43,7 +44,7 @@ EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public NodeTypeName $nodeTypeName, @@ -66,7 +67,7 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/DisableNodeAggregate.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/DisableNodeAggregate.php index 454b7c2ccb2..fbbb230a383 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/DisableNodeAggregate.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/DisableNodeAggregate.php @@ -22,6 +22,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeVariantSelectionStrategy; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -36,13 +37,13 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The workspace in which the disable operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the disable operation is to be performed * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to disable * @param DimensionSpacePoint $coveredDimensionSpacePoint The covered dimension space point of the node aggregate in which the user intends to disable it * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be disabled */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public NodeAggregateId $nodeAggregateId, public DimensionSpacePoint $coveredDimensionSpacePoint, public NodeVariantSelectionStrategy $nodeVariantSelectionStrategy, @@ -50,12 +51,12 @@ private function __construct( } /** - * @param WorkspaceName $workspaceName The workspace in which the disable operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the disable operation is to be performed * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to disable * @param DimensionSpacePoint $coveredDimensionSpacePoint The covered dimension space point of the node aggregate in which the user intends to disable it * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be disabled */ - public static function create(WorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, DimensionSpacePoint $coveredDimensionSpacePoint, NodeVariantSelectionStrategy $nodeVariantSelectionStrategy): self + public static function create(WorkspaceName|VirtualWorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, DimensionSpacePoint $coveredDimensionSpacePoint, NodeVariantSelectionStrategy $nodeVariantSelectionStrategy): self { return new self($workspaceName, $nodeAggregateId, $coveredDimensionSpacePoint, $nodeVariantSelectionStrategy); } @@ -90,7 +91,7 @@ public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/EnableNodeAggregate.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/EnableNodeAggregate.php index de0ad11d57d..d5893fb08dd 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/EnableNodeAggregate.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Command/EnableNodeAggregate.php @@ -22,6 +22,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeVariantSelectionStrategy; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -36,13 +37,13 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The workspace in which the enable operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the enable operation is to be performed * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to enable * @param DimensionSpacePoint $coveredDimensionSpacePoint The covered dimension space point of the node aggregate in which the user intends to enable it * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be enabled */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public NodeAggregateId $nodeAggregateId, public DimensionSpacePoint $coveredDimensionSpacePoint, public NodeVariantSelectionStrategy $nodeVariantSelectionStrategy, @@ -50,12 +51,12 @@ private function __construct( } /** - * @param WorkspaceName $workspaceName The content stream in which the enable operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The content stream in which the enable operation is to be performed * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to enable * @param DimensionSpacePoint $coveredDimensionSpacePoint The covered dimension space point of the node aggregate in which the user intends to enable it * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be enabled */ - public static function create(WorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, DimensionSpacePoint $coveredDimensionSpacePoint, NodeVariantSelectionStrategy $nodeVariantSelectionStrategy): self + public static function create(WorkspaceName|VirtualWorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, DimensionSpacePoint $coveredDimensionSpacePoint, NodeVariantSelectionStrategy $nodeVariantSelectionStrategy): self { return new self($workspaceName, $nodeAggregateId, $coveredDimensionSpacePoint, $nodeVariantSelectionStrategy); } @@ -90,7 +91,7 @@ public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php index e65d6ce7055..c7f9a07d76c 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasDisabled.php @@ -23,6 +23,7 @@ use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasTagged; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -39,7 +40,7 @@ EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, /** The dimension space points the node aggregate was disabled in */ @@ -57,12 +58,12 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } - public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php index f863fd97a8a..87697a0b68a 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDisabling/Event/NodeAggregateWasEnabled.php @@ -24,6 +24,7 @@ use Neos\ContentRepository\Core\Feature\SubtreeTagging\Event\SubtreeWasUntagged; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -40,7 +41,7 @@ EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public DimensionSpacePointSet $affectedDimensionSpacePoints, @@ -57,12 +58,12 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } - public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Command/CopyNodesRecursively.php b/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Command/CopyNodesRecursively.php index 52355fd5e4a..7b620b8a9cd 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Command/CopyNodesRecursively.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeDuplication/Command/CopyNodesRecursively.php @@ -26,6 +26,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -44,7 +45,7 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The name of the workspace this command is to be handled in + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The name of the workspace this command is to be handled in * @param NodeSubtreeSnapshot $nodeTreeToInsert The snapshot of nodes to copy {@see CopyNodesRecursively::createFromSubgraphAndStartNode()} * @param OriginDimensionSpacePoint $targetDimensionSpacePoint the dimension space point which is the target of the copy * @param NodeAggregateId $targetParentNodeAggregateId Node aggregate id of the target node's parent. If not given, the node will be added as the parent's first child @@ -53,7 +54,7 @@ * @param NodeAggregateIdMapping $nodeAggregateIdMapping An assignment of "old" to "new" NodeAggregateIds ({@see NodeAggregateIdMapping}) */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public NodeSubtreeSnapshot $nodeTreeToInsert, public OriginDimensionSpacePoint $targetDimensionSpacePoint, public NodeAggregateId $targetParentNodeAggregateId, @@ -64,14 +65,14 @@ private function __construct( } /** - * @param WorkspaceName $workspaceName The name of the workspace this command is to be handled in + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The name of the workspace this command is to be handled in * @param NodeSubtreeSnapshot $nodeTreeToInsert The snapshot of nodes to copy {@see CopyNodesRecursively::createFromSubgraphAndStartNode()} * @param OriginDimensionSpacePoint $targetDimensionSpacePoint the dimension space point which is the target of the copy * @param NodeAggregateId $targetParentNodeAggregateId Node aggregate id of the target node's parent. If not given, the node will be added as the parent's first child * @param NodeAggregateId|null $targetSucceedingSiblingNodeAggregateId Node aggregate id of the target node's succeeding sibling (optional) * @param NodeAggregateIdMapping $nodeAggregateIdMapping An assignment of "old" to "new" NodeAggregateIds ({@see NodeAggregateIdMapping}) */ - public static function create(WorkspaceName $workspaceName, NodeSubtreeSnapshot $nodeTreeToInsert, OriginDimensionSpacePoint $targetDimensionSpacePoint, NodeAggregateId $targetParentNodeAggregateId, ?NodeAggregateId $targetSucceedingSiblingNodeAggregateId, NodeAggregateIdMapping $nodeAggregateIdMapping): self + public static function create(WorkspaceName|VirtualWorkspaceName $workspaceName, NodeSubtreeSnapshot $nodeTreeToInsert, OriginDimensionSpacePoint $targetDimensionSpacePoint, NodeAggregateId $targetParentNodeAggregateId, ?NodeAggregateId $targetSucceedingSiblingNodeAggregateId, NodeAggregateIdMapping $nodeAggregateIdMapping): self { return new self($workspaceName, $nodeTreeToInsert, $targetDimensionSpacePoint, $targetParentNodeAggregateId, $targetSucceedingSiblingNodeAggregateId, null, $nodeAggregateIdMapping); } @@ -81,7 +82,7 @@ public static function create(WorkspaceName $workspaceName, NodeSubtreeSnapshot */ public static function createFromSubgraphAndStartNode( ContentSubgraphInterface $subgraph, - WorkspaceName $workspaceName, + WorkspaceName|VirtualWorkspaceName $workspaceName, Node $startNode, OriginDimensionSpacePoint $dimensionSpacePoint, NodeAggregateId $targetParentNodeAggregateId, @@ -171,7 +172,7 @@ public function withTargetNodeName(NodeName $targetNodeName): self } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetSerializedNodeProperties.php b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetSerializedNodeProperties.php index ca589337e85..bc68413ec5d 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetSerializedNodeProperties.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Command/SetSerializedNodeProperties.php @@ -23,6 +23,7 @@ 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\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -39,14 +40,14 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The workspace in which the set properties operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the set properties operation is to be performed * @param NodeAggregateId $nodeAggregateId The id of the node aggregate to set the properties for * @param OriginDimensionSpacePoint $originDimensionSpacePoint The dimension space point the properties should be changed in * @param SerializedPropertyValues $propertyValues Names and (serialized) values of properties to set * @param PropertyNames $propertiesToUnset Names of properties to unset */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public NodeAggregateId $nodeAggregateId, public OriginDimensionSpacePoint $originDimensionSpacePoint, public SerializedPropertyValues $propertyValues, @@ -55,14 +56,14 @@ private function __construct( } /** - * @param WorkspaceName $workspaceName The workspace in which the set properties operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the set properties operation is to be performed * @param NodeAggregateId $nodeAggregateId The id of the node aggregate to set the properties for * @param OriginDimensionSpacePoint $originDimensionSpacePoint The dimension space point the properties should be changed in * @param SerializedPropertyValues $propertyValues Names and (serialized) values of properties to set * @param PropertyNames $propertiesToUnset Names of properties to unset */ public static function create( - WorkspaceName $workspaceName, + WorkspaceName|VirtualWorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, OriginDimensionSpacePoint $originDimensionSpacePoint, SerializedPropertyValues $propertyValues, @@ -109,7 +110,7 @@ public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php index 69b3e4c2c96..4e3120522e2 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeModification/Event/NodePropertiesWereSet.php @@ -25,6 +25,7 @@ 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\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -46,7 +47,7 @@ EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public OriginDimensionSpacePoint $originDimensionSpacePoint, @@ -67,7 +68,7 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } @@ -77,7 +78,7 @@ public function getOriginDimensionSpacePoint(): OriginDimensionSpacePoint return $this->originDimensionSpacePoint; } - public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Command/MoveNodeAggregate.php b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Command/MoveNodeAggregate.php index 3a756163488..60c00b8b9da 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Command/MoveNodeAggregate.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Command/MoveNodeAggregate.php @@ -22,6 +22,7 @@ use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -49,7 +50,7 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The workspace in which the move operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the move operation is to be performed * @param DimensionSpacePoint $dimensionSpacePoint This is one of the *covered* dimension space points of the node aggregate and not necessarily one of the occupied ones. This allows us to move virtual specializations only when using the scatter strategy * @param NodeAggregateId $nodeAggregateId The id of the node aggregate to move * @param RelationDistributionStrategy $relationDistributionStrategy The relation distribution strategy to be used ({@see RelationDistributionStrategy}) @@ -58,7 +59,7 @@ * @param NodeAggregateId|null $newSucceedingSiblingNodeAggregateId The id of the new succeeding sibling node aggregate. If given, it is attempted to insert the moved nodes right before nodes of this aggregate. In dimension space points this aggregate does not cover, the preceding sibling is tried to be used instead */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public DimensionSpacePoint $dimensionSpacePoint, public NodeAggregateId $nodeAggregateId, public RelationDistributionStrategy $relationDistributionStrategy, @@ -69,7 +70,7 @@ private function __construct( } /** - * @param WorkspaceName $workspaceName The workspace in which the move operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the move operation is to be performed * @param DimensionSpacePoint $dimensionSpacePoint This is one of the *covered* dimension space points of the node aggregate and not necessarily one of the occupied ones. This allows us to move virtual specializations only when using the scatter strategy * @param NodeAggregateId $nodeAggregateId The id of the node aggregate to move * @param RelationDistributionStrategy $relationDistributionStrategy The relation distribution strategy to be used ({@see RelationDistributionStrategy}) @@ -77,7 +78,7 @@ private function __construct( * @param NodeAggregateId|null $newPrecedingSiblingNodeAggregateId The id of the new preceding sibling node aggregate. If given and no successor found, it is attempted to insert the moved nodes right after nodes of this aggregate. In dimension space points this aggregate does not cover, other siblings, in order of proximity, are tried to be used instead * @param NodeAggregateId|null $newSucceedingSiblingNodeAggregateId The id of the new succeeding sibling node aggregate. If given, it is attempted to insert the moved nodes right before nodes of this aggregate. In dimension space points this aggregate does not cover, the preceding sibling is tried to be used instead */ - public static function create(WorkspaceName $workspaceName, DimensionSpacePoint $dimensionSpacePoint, NodeAggregateId $nodeAggregateId, RelationDistributionStrategy $relationDistributionStrategy, ?NodeAggregateId $newParentNodeAggregateId = null, ?NodeAggregateId $newPrecedingSiblingNodeAggregateId = null, ?NodeAggregateId $newSucceedingSiblingNodeAggregateId = null): self + public static function create(WorkspaceName|VirtualWorkspaceName $workspaceName, DimensionSpacePoint $dimensionSpacePoint, NodeAggregateId $nodeAggregateId, RelationDistributionStrategy $relationDistributionStrategy, ?NodeAggregateId $newParentNodeAggregateId = null, ?NodeAggregateId $newPrecedingSiblingNodeAggregateId = null, ?NodeAggregateId $newSucceedingSiblingNodeAggregateId = null): self { return new self($workspaceName, $dimensionSpacePoint, $nodeAggregateId, $relationDistributionStrategy, $newParentNodeAggregateId, $newPrecedingSiblingNodeAggregateId, $newSucceedingSiblingNodeAggregateId); } @@ -119,7 +120,7 @@ public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php index c9c50fa03f2..7cd40a8a46e 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeMove/Event/NodeAggregateWasMoved.php @@ -14,6 +14,7 @@ use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -59,7 +60,7 @@ EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public ?NodeAggregateId $newParentNodeAggregateId, @@ -77,12 +78,12 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } - public function withWorkspaceNameAndContentStreamId(WorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self + public function withWorkspaceNameAndContentStreamId(WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ContentStreamId $contentStreamId): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetSerializedNodeReferences.php b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetSerializedNodeReferences.php index 3f635af08e0..b4169f301ea 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetSerializedNodeReferences.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Command/SetSerializedNodeReferences.php @@ -23,6 +23,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -39,14 +40,14 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The workspace in which the create operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the create operation is to be performed * @param NodeAggregateId $sourceNodeAggregateId The identifier of the node aggregate to set references * @param OriginDimensionSpacePoint $sourceOriginDimensionSpacePoint The dimension space for which the references should be set * @param ReferenceName $referenceName Name of the reference to set * @param SerializedNodeReferences $references Serialized reference(s) to set */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public NodeAggregateId $sourceNodeAggregateId, public OriginDimensionSpacePoint $sourceOriginDimensionSpacePoint, public ReferenceName $referenceName, @@ -55,13 +56,13 @@ private function __construct( } /** - * @param WorkspaceName $workspaceName The workspace in which the create operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the create operation is to be performed * @param NodeAggregateId $sourceNodeAggregateId The identifier of the node aggregate to set references * @param OriginDimensionSpacePoint $sourceOriginDimensionSpacePoint The dimension space for which the references should be set * @param ReferenceName $referenceName Name of the reference to set * @param SerializedNodeReferences $references Serialized reference(s) to set */ - public static function create(WorkspaceName $workspaceName, NodeAggregateId $sourceNodeAggregateId, OriginDimensionSpacePoint $sourceOriginDimensionSpacePoint, ReferenceName $referenceName, SerializedNodeReferences $references): self + public static function create(WorkspaceName|VirtualWorkspaceName $workspaceName, NodeAggregateId $sourceNodeAggregateId, OriginDimensionSpacePoint $sourceOriginDimensionSpacePoint, ReferenceName $referenceName, SerializedNodeReferences $references): self { return new self($workspaceName, $sourceNodeAggregateId, $sourceOriginDimensionSpacePoint, $referenceName, $references); } @@ -97,7 +98,7 @@ public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php index 21440d1a659..4e9d3df627d 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeReferencing/Event/NodeReferencesWereSet.php @@ -14,6 +14,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\ReferenceName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -31,7 +32,7 @@ EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, /** @@ -56,7 +57,7 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php index 085af255b8c..3f66638591e 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Command/RemoveNodeAggregate.php @@ -21,6 +21,7 @@ use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeVariantSelectionStrategy; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -33,14 +34,14 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The workspace in which the remove operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the remove operation is to be performed * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to remove * @param DimensionSpacePoint $coveredDimensionSpacePoint One of the dimension space points covered by the node aggregate in which the user intends to remove it * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be removed * @param NodeAggregateId|null $removalAttachmentPoint Internal. It stores the document node id of the removed node, as that is what the UI needs later on for the change display. {@see self::withRemovalAttachmentPoint()} */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public NodeAggregateId $nodeAggregateId, public DimensionSpacePoint $coveredDimensionSpacePoint, public NodeVariantSelectionStrategy $nodeVariantSelectionStrategy, @@ -49,12 +50,12 @@ private function __construct( } /** - * @param WorkspaceName $workspaceName The workspace in which the remove operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the remove operation is to be performed * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to remove * @param DimensionSpacePoint $coveredDimensionSpacePoint One of the dimension space points covered by the node aggregate in which the user intends to remove it * @param NodeVariantSelectionStrategy $nodeVariantSelectionStrategy The strategy the user chose to determine which specialization variants will also be removed */ - public static function create(WorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, DimensionSpacePoint $coveredDimensionSpacePoint, NodeVariantSelectionStrategy $nodeVariantSelectionStrategy): self + public static function create(WorkspaceName|VirtualWorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, DimensionSpacePoint $coveredDimensionSpacePoint, NodeVariantSelectionStrategy $nodeVariantSelectionStrategy): self { return new self($workspaceName, $nodeAggregateId, $coveredDimensionSpacePoint, $nodeVariantSelectionStrategy, null); } @@ -109,7 +110,7 @@ public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php index b3a82f88b2d..b8f7a82d36d 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRemoval/Event/NodeAggregateWasRemoved.php @@ -24,6 +24,7 @@ use Neos\ContentRepository\Core\Feature\NodeRemoval\Command\RemoveNodeAggregate; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -37,7 +38,7 @@ EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public OriginDimensionSpacePointSet $affectedOccupiedDimensionSpacePoints, @@ -57,7 +58,7 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Command/ChangeNodeAggregateName.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Command/ChangeNodeAggregateName.php index 38d1f195ed6..54e18f46cfc 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Command/ChangeNodeAggregateName.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Command/ChangeNodeAggregateName.php @@ -20,6 +20,7 @@ use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -38,23 +39,23 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The workspace in which the operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the operation is to be performed * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to rename * @param NodeName $newNodeName The new name of the node aggregate */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public NodeAggregateId $nodeAggregateId, public NodeName $newNodeName, ) { } /** - * @param WorkspaceName $workspaceName The workspace in which the operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the operation is to be performed * @param NodeAggregateId $nodeAggregateId The identifier of the node aggregate to rename * @param NodeName $newNodeName The new name of the node aggregate */ - public static function create(WorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, NodeName $newNodeName): self + public static function create(WorkspaceName|VirtualWorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, NodeName $newNodeName): self { return new self($workspaceName, $nodeAggregateId, $newNodeName); } @@ -85,7 +86,7 @@ public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php index 73956b43f54..dc08c07388d 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeRenaming/Event/NodeAggregateNameWasChanged.php @@ -22,6 +22,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -35,7 +36,7 @@ EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public NodeName $newNodeName, @@ -52,7 +53,7 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Command/ChangeNodeAggregateType.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Command/ChangeNodeAggregateType.php index e979e4d25c1..ab50c4a9444 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Command/ChangeNodeAggregateType.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Command/ChangeNodeAggregateType.php @@ -23,6 +23,7 @@ use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -35,14 +36,14 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The workspace in which the operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the operation is to be performed * @param NodeAggregateId $nodeAggregateId The unique identifier of the node aggregate to change * @param NodeTypeName $newNodeTypeName Name of the new node type * @param NodeAggregateTypeChangeChildConstraintConflictResolutionStrategy $strategy Strategy for conflicts on affected child nodes ({@see NodeAggregateTypeChangeChildConstraintConflictResolutionStrategy}) * @param NodeAggregateIdsByNodePaths $tetheredDescendantNodeAggregateIds Predefined aggregate ids of any tethered child nodes for the new node type per path. For any tethered node that has no matching entry in this set, the node aggregate id is generated randomly. Since tethered nodes may have tethered child nodes themselves, this works for multiple levels ({@see self::withTetheredDescendantNodeAggregateIds()}) */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public NodeAggregateId $nodeAggregateId, public NodeTypeName $newNodeTypeName, public NodeAggregateTypeChangeChildConstraintConflictResolutionStrategy $strategy, @@ -51,12 +52,12 @@ private function __construct( } /** - * @param WorkspaceName $workspaceName The workspace in which the operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the operation is to be performed * @param NodeAggregateId $nodeAggregateId The unique identifier of the node aggregate to change * @param NodeTypeName $newNodeTypeName Name of the new node type * @param NodeAggregateTypeChangeChildConstraintConflictResolutionStrategy $strategy Strategy for conflicts on affected child nodes ({@see NodeAggregateTypeChangeChildConstraintConflictResolutionStrategy}) */ - public static function create(WorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, NodeTypeName $newNodeTypeName, NodeAggregateTypeChangeChildConstraintConflictResolutionStrategy $strategy): self + public static function create(WorkspaceName|VirtualWorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, NodeTypeName $newNodeTypeName, NodeAggregateTypeChangeChildConstraintConflictResolutionStrategy $strategy): self { return new self($workspaceName, $nodeAggregateId, $newNodeTypeName, $strategy, NodeAggregateIdsByNodePaths::createEmpty()); } @@ -108,7 +109,7 @@ public function withTetheredDescendantNodeAggregateIds(NodeAggregateIdsByNodePat } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php index 0b09e68fc2d..f951862674d 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeTypeChange/Event/NodeAggregateTypeWasChanged.php @@ -22,6 +22,7 @@ use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -35,7 +36,7 @@ EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public NodeTypeName $newNodeTypeName @@ -52,7 +53,7 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Command/CreateNodeVariant.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Command/CreateNodeVariant.php index 001f9bd66e9..48194c01824 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Command/CreateNodeVariant.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Command/CreateNodeVariant.php @@ -20,6 +20,7 @@ use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -36,13 +37,13 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The workspace in which the create operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the create operation is to be performed * @param NodeAggregateId $nodeAggregateId The identifier of the affected node aggregate * @param OriginDimensionSpacePoint $sourceOrigin Dimension Space Point from which the node is to be copied from * @param OriginDimensionSpacePoint $targetOrigin Dimension Space Point to which the node is to be copied to */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public NodeAggregateId $nodeAggregateId, public OriginDimensionSpacePoint $sourceOrigin, public OriginDimensionSpacePoint $targetOrigin, @@ -50,12 +51,12 @@ private function __construct( } /** - * @param WorkspaceName $workspaceName The workspace in which the create operation is to be performed + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the create operation is to be performed * @param NodeAggregateId $nodeAggregateId The identifier of the affected node aggregate * @param OriginDimensionSpacePoint $sourceOrigin Dimension Space Point from which the node is to be copied from * @param OriginDimensionSpacePoint $targetOrigin Dimension Space Point to which the node is to be copied to */ - public static function create(WorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin): self + public static function create(WorkspaceName|VirtualWorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, OriginDimensionSpacePoint $sourceOrigin, OriginDimensionSpacePoint $targetOrigin): self { return new self($workspaceName, $nodeAggregateId, $sourceOrigin, $targetOrigin); } @@ -88,7 +89,7 @@ public function matchesNodeId(NodeIdToPublishOrDiscard $nodeIdToPublish): bool } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php index dbbea290d28..765b4813523 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeGeneralizationVariantWasCreated.php @@ -24,6 +24,7 @@ use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -39,7 +40,7 @@ EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public OriginDimensionSpacePoint $sourceOrigin, @@ -58,7 +59,7 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php index 10408317c5f..b956050b657 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodePeerVariantWasCreated.php @@ -24,6 +24,7 @@ use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -37,7 +38,7 @@ EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public OriginDimensionSpacePoint $sourceOrigin, @@ -56,7 +57,7 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php index 709bef915d5..36c46b1e6d4 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php +++ b/Neos.ContentRepository.Core/Classes/Feature/NodeVariation/Event/NodeSpecializationVariantWasCreated.php @@ -24,6 +24,7 @@ use Neos\ContentRepository\Core\Feature\Common\PublishableToWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -39,7 +40,7 @@ EmbedsWorkspaceName { public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public OriginDimensionSpacePoint $sourceOrigin, @@ -58,7 +59,7 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php index 9bbb1f320cc..7eb01f2827c 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/CreateRootNodeAggregateWithNode.php @@ -20,6 +20,7 @@ use Neos\ContentRepository\Core\NodeType\NodeTypeName; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -36,13 +37,13 @@ RebasableToOtherWorkspaceInterface { /** - * @param WorkspaceName $workspaceName The workspace in which the root node should be created in + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the root node should be created in * @param NodeAggregateId $nodeAggregateId The id of the root node aggregate to create * @param NodeTypeName $nodeTypeName Name of type of the new node to create * @param NodeAggregateIdsByNodePaths $tetheredDescendantNodeAggregateIds Predefined aggregate ids of tethered child nodes per path. For any tethered node that has no matching entry in this set, the node aggregate id is generated randomly. Since tethered nodes may have tethered child nodes themselves, this works for multiple levels ({@see self::withTetheredDescendantNodeAggregateIds()}) */ private function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public NodeAggregateId $nodeAggregateId, public NodeTypeName $nodeTypeName, public NodeAggregateIdsByNodePaths $tetheredDescendantNodeAggregateIds, @@ -50,11 +51,11 @@ private function __construct( } /** - * @param WorkspaceName $workspaceName The workspace in which the root node should be created in + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace in which the root node should be created in * @param NodeAggregateId $nodeAggregateId The id of the root node aggregate to create * @param NodeTypeName $nodeTypeName Name of type of the new node to create */ - public static function create(WorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, NodeTypeName $nodeTypeName): self + public static function create(WorkspaceName|VirtualWorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, NodeTypeName $nodeTypeName): self { return new self( $workspaceName, @@ -126,7 +127,7 @@ public function jsonSerialize(): array } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/UpdateRootNodeAggregateDimensions.php b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/UpdateRootNodeAggregateDimensions.php index 302c05ed895..176637b2d98 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/UpdateRootNodeAggregateDimensions.php +++ b/Neos.ContentRepository.Core/Classes/Feature/RootNodeCreation/Command/UpdateRootNodeAggregateDimensions.php @@ -18,6 +18,7 @@ use Neos\ContentRepository\Core\Feature\Common\RebasableToOtherWorkspaceInterface; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -71,7 +72,7 @@ public function jsonSerialize(): array } public function createCopyForWorkspace( - WorkspaceName $targetWorkspaceName, + WorkspaceName|VirtualWorkspaceName $targetWorkspaceName, ): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/TagSubtree.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/TagSubtree.php index 71fb012b0cc..c451323b4d7 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/TagSubtree.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/TagSubtree.php @@ -23,6 +23,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeVariantSelectionStrategy; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -78,7 +79,7 @@ public static function fromArray(array $array): self ); } - public function createCopyForWorkspace(WorkspaceName $targetWorkspaceName): self + public function createCopyForWorkspace(WorkspaceName|VirtualWorkspaceName $targetWorkspaceName): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/UntagSubtree.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/UntagSubtree.php index cca49333c95..257b8a1c584 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/UntagSubtree.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Command/UntagSubtree.php @@ -23,6 +23,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeVariantSelectionStrategy; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -79,7 +80,7 @@ public static function fromArray(array $array): self ); } - public function createCopyForWorkspace(WorkspaceName $targetWorkspaceName): self + public function createCopyForWorkspace(WorkspaceName|VirtualWorkspaceName $targetWorkspaceName): self { return new self( $targetWorkspaceName, diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php index 78e9891a8d7..6de4fa92de1 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasTagged.php @@ -23,6 +23,7 @@ use Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTag; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -44,7 +45,7 @@ * @param SubtreeTag $tag The tag that was added */ public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public DimensionSpacePointSet $affectedDimensionSpacePoints, @@ -62,7 +63,7 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php index 7e0b777b9f1..1958d39058e 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php +++ b/Neos.ContentRepository.Core/Classes/Feature/SubtreeTagging/Event/SubtreeWasUntagged.php @@ -23,6 +23,7 @@ use Neos\ContentRepository\Core\Feature\SubtreeTagging\Dto\SubtreeTag; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -45,7 +46,7 @@ * @param SubtreeTag $tag The tag that was removed */ public function __construct( - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public ContentStreamId $contentStreamId, public NodeAggregateId $nodeAggregateId, public DimensionSpacePointSet $affectedDimensionSpacePoints, @@ -63,7 +64,7 @@ public function getNodeAggregateId(): NodeAggregateId return $this->nodeAggregateId; } - public function getWorkspaceName(): WorkspaceName + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName { return $this->workspaceName; } diff --git a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php index b898cd1c1bf..b1110b92316 100644 --- a/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php +++ b/Neos.ContentRepository.Core/Classes/Feature/WorkspaceCommandHandler.php @@ -76,6 +76,7 @@ use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceDescription; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceTitle; use Neos\EventStore\EventStoreInterface; use Neos\EventStore\Exception\ConcurrencyException; @@ -512,14 +513,11 @@ private function handlePublishIndividualNodesFromWorkspace( /** @var array $remainingCommands */ // 3) fork a temporary workspace, based on the base WS, and apply MATCHING - $matchingWorkspaceName = WorkspaceName::transliterateFromString('tmp' . str_replace('-', '', $command->contentStreamIdForMatchingPart->value)); + $matchingWorkspaceName = VirtualWorkspaceName::fromContentStreamId($command->contentStreamIdForMatchingPart); $commandHandlingDependencies->handle( - CreateWorkspace::create( - $matchingWorkspaceName, - $baseWorkspace->workspaceName, - WorkspaceTitle::fromString('tmp'), - WorkspaceDescription::fromString(''), - $command->contentStreamIdForMatchingPart + ForkContentStream::create( + $command->contentStreamIdForMatchingPart, + $baseWorkspace->currentContentStreamId ) ); @@ -543,24 +541,34 @@ private function handlePublishIndividualNodesFromWorkspace( $baseWorkspace->currentContentStreamId ); - // 6) fork a new content stream, based on the base WS, and apply REST + // 6) fork a new content stream, based on the base WS to become attached to the published workspace + $commandHandlingDependencies->handle( + DiscardWorkspace::create($command->workspaceName) + ->withNewContentStreamId($command->contentStreamIdForRemainingPart) + ); + + // 7) fork a new (temporary) content stream, based on the clean WS above, and apply REST + $virtualWorkspaceContentStreamId = ContentStreamId::create(); + $virtualWorkspaceForRemaining = VirtualWorkspaceName::fromContentStreamId($virtualWorkspaceContentStreamId); $commandHandlingDependencies->handle( ForkContentStream::create( - $command->contentStreamIdForRemainingPart, - $baseWorkspace->currentContentStreamId + $virtualWorkspaceContentStreamId, + $command->contentStreamIdForRemainingPart ) ); - // 7) apply REMAINING commands to the workspace's new content stream - $commandHandlingDependencies->overrideContentStreamId( + // 8) apply REMAINING commands to the workspace's new content stream + foreach ($remainingCommands as $remainingCommand) { + $commandHandlingDependencies->handle($remainingCommand->createCopyForWorkspace($virtualWorkspaceForRemaining)); + } + + // 9) publish virtual workspace into clean REMAINING workspace + $this->publishContentStream( + $virtualWorkspaceContentStreamId, $command->workspaceName, - $command->contentStreamIdForRemainingPart, - function () use ($commandHandlingDependencies, $remainingCommands) { - foreach ($remainingCommands as $remainingCommand) { - $commandHandlingDependencies->handle($remainingCommand); - } - } + $command->contentStreamIdForRemainingPart ); + } catch (\Exception $exception) { // 4.E) In case of an exception, reopen the old content stream and remove the newly created $commandHandlingDependencies->handle( @@ -587,28 +595,27 @@ function () use ($commandHandlingDependencies, $remainingCommands) { // 8) to avoid dangling content streams, we need to remove our temporary workspace (whose events // have already been published) as well as the old content stream - $commandHandlingDependencies->handle(DeleteWorkspace::create( - $matchingWorkspaceName - )); $commandHandlingDependencies->handle(RemoveContentStream::create( - $oldWorkspaceContentStreamId + $command->contentStreamIdForMatchingPart )); $streamName = WorkspaceEventStreamName::fromWorkspaceName($command->workspaceName)->getEventStreamName(); - - return new EventsToPublish( - $streamName, - Events::fromArray([ - new WorkspaceWasPartiallyPublished( - $command->workspaceName, - $baseWorkspace->workspaceName, - $command->contentStreamIdForRemainingPart, - $oldWorkspaceContentStreamId, - $command->nodesToPublish - ) - ]), - ExpectedVersion::ANY() - ); +// +// return new EventsToPublish( +// $streamName, +// Events::fromArray([ +// new WorkspaceWasPartiallyPublished( +// $command->workspaceName, +// $baseWorkspace->workspaceName, +// $command->contentStreamIdForRemainingPart, +// $oldWorkspaceContentStreamId, +// $command->nodesToPublish +// ) +// ]), +// ExpectedVersion::ANY() +// ); + + return new EventsToPublish($streamName, Events::fromArray([]), ExpectedVersion::ANY()); } /** diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphInterface.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphInterface.php index 67af3f6d5ff..46504803057 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphInterface.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentGraphInterface.php @@ -25,6 +25,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -47,7 +48,7 @@ public function getContentRepositoryId(): ContentRepositoryId; * The workspace this content graph is operating on * @api */ - public function getWorkspaceName(): WorkspaceName; + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName; /** * @api main API method of ContentGraph diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php index c47c0771932..c370eadded2 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/ContentSubgraphInterface.php @@ -20,6 +20,7 @@ use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -51,7 +52,7 @@ interface ContentSubgraphInterface { public function getContentRepositoryId(): ContentRepositoryId; - public function getWorkspaceName(): WorkspaceName; + public function getWorkspaceName(): WorkspaceName|VirtualWorkspaceName; public function getDimensionSpacePoint(): DimensionSpacePoint; diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php index e22058fda92..0dba7b652fa 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/Node.php @@ -23,6 +23,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Node\PropertyName; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -69,7 +70,7 @@ { /** * @param ContentRepositoryId $contentRepositoryId The content-repository this Node belongs to - * @param WorkspaceName $workspaceName The workspace of this Node + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace of this Node * @param DimensionSpacePoint $dimensionSpacePoint DimensionSpacePoint a node has been accessed in * @param NodeAggregateId $aggregateId NodeAggregateId (identifier) of this node. This is part of the node's "Read Model" identity, which is defined in {@see NodeAddress} * @param OriginDimensionSpacePoint $originDimensionSpacePoint The DimensionSpacePoint the node originates in. Usually needed to address a Node in a NodeAggregate in order to update it. @@ -83,7 +84,7 @@ */ private function __construct( public ContentRepositoryId $contentRepositoryId, - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public DimensionSpacePoint $dimensionSpacePoint, public NodeAggregateId $aggregateId, public OriginDimensionSpacePoint $originDimensionSpacePoint, @@ -103,7 +104,7 @@ private function __construct( /** * @internal The signature of this method can change in the future! */ - public static function create(ContentRepositoryId $contentRepositoryId, WorkspaceName $workspaceName, DimensionSpacePoint $dimensionSpacePoint, NodeAggregateId $aggregateId, OriginDimensionSpacePoint $originDimensionSpacePoint, NodeAggregateClassification $classification, NodeTypeName $nodeTypeName, PropertyCollection $properties, ?NodeName $name, NodeTags $tags, Timestamps $timestamps, VisibilityConstraints $visibilityConstraints): self + public static function create(ContentRepositoryId $contentRepositoryId, WorkspaceName|VirtualWorkspaceName $workspaceName, DimensionSpacePoint $dimensionSpacePoint, NodeAggregateId $aggregateId, OriginDimensionSpacePoint $originDimensionSpacePoint, NodeAggregateClassification $classification, NodeTypeName $nodeTypeName, PropertyCollection $properties, ?NodeName $name, NodeTags $tags, Timestamps $timestamps, VisibilityConstraints $visibilityConstraints): self { return new self($contentRepositoryId, $workspaceName, $dimensionSpacePoint, $aggregateId, $originDimensionSpacePoint, $classification, $nodeTypeName, $properties, $name, $tags, $timestamps, $visibilityConstraints); } diff --git a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeAggregate.php b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeAggregate.php index c949bac0f57..f60db61ed5e 100644 --- a/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeAggregate.php +++ b/Neos.ContentRepository.Core/Classes/Projection/ContentGraph/NodeAggregate.php @@ -27,6 +27,7 @@ use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeName; use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; /** @@ -55,7 +56,7 @@ { /** * @param ContentRepositoryId $contentRepositoryId The content-repository this node aggregate belongs to - * @param WorkspaceName $workspaceName The workspace of this node aggregate + * @param WorkspaceName|VirtualWorkspaceName $workspaceName The workspace of this node aggregate * @param NodeAggregateId $nodeAggregateId ID of this node aggregate * @param NodeAggregateClassification $classification whether this node aggregate represents a root, regular or tethered node * @param NodeTypeName $nodeTypeName name of the node type of this node aggregate @@ -70,7 +71,7 @@ */ private function __construct( public ContentRepositoryId $contentRepositoryId, - public WorkspaceName $workspaceName, + public WorkspaceName|VirtualWorkspaceName $workspaceName, public NodeAggregateId $nodeAggregateId, public NodeAggregateClassification $classification, public NodeTypeName $nodeTypeName, @@ -92,7 +93,7 @@ private function __construct( */ public static function create( ContentRepositoryId $contentRepositoryId, - WorkspaceName $workspaceName, + WorkspaceName|VirtualWorkspaceName $workspaceName, NodeAggregateId $nodeAggregateId, NodeAggregateClassification $classification, NodeTypeName $nodeTypeName, diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceDoesNotExist.php b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceDoesNotExist.php index 3def569da87..370b63616eb 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceDoesNotExist.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Exception/WorkspaceDoesNotExist.php @@ -23,6 +23,7 @@ final class WorkspaceDoesNotExist extends \DomainException { public static function butWasSupposedTo(WorkspaceName $name): self { + debug_print_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, 10); return new self(sprintf( 'The source workspace %s does not exist', $name->value diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Workspace/VirtualWorkspaceName.php b/Neos.ContentRepository.Core/Classes/SharedModel/Workspace/VirtualWorkspaceName.php new file mode 100644 index 00000000000..305b949e622 --- /dev/null +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Workspace/VirtualWorkspaceName.php @@ -0,0 +1,51 @@ +contentStreamId->value); + $this->value = self::VIRTUAL_PREFIX . $identifierBase64; + } + + public static function fromString(string $value): self + { + if (!self::isVirtual($value)) { + throw new \InvalidArgumentException('This is not a virtual workspace name: ' . $value, 1729286719); + } + $identifier = base64_decode(substr($value, strlen(self::VIRTUAL_PREFIX))); + return new self(ContentStreamId::fromString($identifier)); + } + + public static function fromContentStreamId(ContentStreamId $contentStreamId): self + { + return new self($contentStreamId); + } + + public function jsonSerialize(): string + { + return $this->value; + } + + public static function isVirtual(string $value): bool + { + return str_starts_with($value, self::VIRTUAL_PREFIX); + } + + public function isLive(): bool + { + return false; + } +} diff --git a/Neos.ContentRepository.Core/Classes/SharedModel/Workspace/WorkspaceName.php b/Neos.ContentRepository.Core/Classes/SharedModel/Workspace/WorkspaceName.php index 85752a9ee63..d8667a7f1a7 100644 --- a/Neos.ContentRepository.Core/Classes/SharedModel/Workspace/WorkspaceName.php +++ b/Neos.ContentRepository.Core/Classes/SharedModel/Workspace/WorkspaceName.php @@ -15,6 +15,9 @@ namespace Neos\ContentRepository\Core\SharedModel\Workspace; use Behat\Transliterator\Transliterator; +use http\Exception\RuntimeException; +use Ramsey\Uuid\Uuid; +use Ramsey\Uuid\UuidFactory; /** * Name of a workspace. @@ -37,6 +40,9 @@ final class WorkspaceName implements \JsonSerializable private function __construct( public readonly string $value ) { + if (VirtualWorkspaceName::isVirtual($value)) { + throw new \InvalidArgumentException(sprintf('Invalid workspace name "%s" given. This is a virtual workspace name', $value), 1729289746); + } if (!self::hasValidFormat($value)) { throw new \InvalidArgumentException(sprintf('Invalid workspace name "%s" given. A workspace name has to consist of at most %d lower case characters', $value, self::MAX_LENGTH), 1505826610); } @@ -47,8 +53,11 @@ private static function instance(string $name): self return self::$instances[$name] ??= new self($name); } - public static function fromString(string $value): self + public static function fromString(string $value): self|VirtualWorkspaceName { + if (VirtualWorkspaceName::isVirtual($value)) { + return VirtualWorkspaceName::fromString($value); + } return self::instance($value); } diff --git a/Neos.Neos/Classes/AssetUsage/CatchUpHook/AssetUsageCatchUpHook.php b/Neos.Neos/Classes/AssetUsage/CatchUpHook/AssetUsageCatchUpHook.php index e240adb41bc..279bbacc511 100644 --- a/Neos.Neos/Classes/AssetUsage/CatchUpHook/AssetUsageCatchUpHook.php +++ b/Neos.Neos/Classes/AssetUsage/CatchUpHook/AssetUsageCatchUpHook.php @@ -26,6 +26,7 @@ use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints; use Neos\ContentRepository\Core\SharedModel\Exception\WorkspaceDoesNotExist; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\EventStore\Model\EventEnvelope; use Neos\Neos\AssetUsage\Service\AssetUsageIndexingService; @@ -47,6 +48,9 @@ public function onBeforeCatchUp(): void public function onBeforeEvent(EventInterface $eventInstance, EventEnvelope $eventEnvelope): void { + if ($eventInstance instanceof EmbedsWorkspaceName && $eventInstance->workspaceName instanceof VirtualWorkspaceName) { + return; + } if ($eventInstance instanceof EmbedsWorkspaceName && $eventInstance instanceof EmbedsContentStreamId) { // Safeguard for temporary content streams created during partial publish -> We want to skip these events, because their workspace doesn't match current content stream. try { @@ -68,6 +72,9 @@ public function onBeforeEvent(EventInterface $eventInstance, EventEnvelope $even public function onAfterEvent(EventInterface $eventInstance, EventEnvelope $eventEnvelope): void { + if ($eventInstance instanceof EmbedsWorkspaceName && $eventInstance->workspaceName instanceof VirtualWorkspaceName) { + return; + } if ($eventInstance instanceof EmbedsWorkspaceName && $eventInstance instanceof EmbedsContentStreamId) { // Safeguard for temporary content streams created during partial publish -> We want to skip these events, because their workspace doesn't match current content stream. try { diff --git a/Neos.Neos/Classes/AssetUsage/Service/AssetUsageIndexingService.php b/Neos.Neos/Classes/AssetUsage/Service/AssetUsageIndexingService.php index 56c8aa7bff4..a11ed4bf95a 100644 --- a/Neos.Neos/Classes/AssetUsage/Service/AssetUsageIndexingService.php +++ b/Neos.Neos/Classes/AssetUsage/Service/AssetUsageIndexingService.php @@ -13,6 +13,7 @@ use Neos\ContentRepository\Core\SharedModel\ContentRepository\ContentRepositoryId; use Neos\ContentRepository\Core\SharedModel\Exception\WorkspaceDoesNotExist; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Flow\Persistence\Doctrine\PersistenceManager; @@ -55,6 +56,10 @@ public function __construct( public function updateIndex(ContentRepositoryId $contentRepositoryId, Node $node): void { + if ($node->workspaceName instanceof VirtualWorkspaceName) { + return; + } + $workspaceBases = $this->getWorkspaceBasesAndWorkspace($contentRepositoryId, $node->workspaceName); $workspaceDependents = $this->getWorkspaceDependents($contentRepositoryId, $node->workspaceName); $nodeType = $this->contentRepositoryRegistry->get($contentRepositoryId)->getNodeTypeManager()->getNodeType($node->nodeTypeName); diff --git a/Neos.Neos/Classes/Fusion/Cache/GraphProjectorCatchUpHookForCacheFlushing.php b/Neos.Neos/Classes/Fusion/Cache/GraphProjectorCatchUpHookForCacheFlushing.php index e3e8bcfe461..d2069338217 100644 --- a/Neos.Neos/Classes/Fusion/Cache/GraphProjectorCatchUpHookForCacheFlushing.php +++ b/Neos.Neos/Classes/Fusion/Cache/GraphProjectorCatchUpHookForCacheFlushing.php @@ -41,6 +41,7 @@ use Neos\ContentRepository\Core\SharedModel\Exception\WorkspaceDoesNotExist; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateId; use Neos\ContentRepository\Core\SharedModel\Node\NodeAggregateIds; +use Neos\ContentRepository\Core\SharedModel\Workspace\VirtualWorkspaceName; use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\EventStore\Model\EventEnvelope; @@ -169,7 +170,7 @@ public function onBeforeEvent(EventInterface $eventInstance, EventEnvelope $even $nodeAggregate = $contentGraph->findNodeAggregateById( $eventInstance->getNodeAggregateId() ); - if ($nodeAggregate) { + if ($nodeAggregate && !($eventInstance->workspaceName instanceof VirtualWorkspaceName)) { $this->scheduleCacheFlushJobForNodeAggregate( $this->contentRepository, $eventInstance->workspaceName, @@ -211,7 +212,7 @@ public function onAfterEvent(EventInterface $eventInstance, EventEnvelope $event return; } - if ($nodeAggregate) { + if ($nodeAggregate && !($eventInstance->workspaceName instanceof VirtualWorkspaceName)) { $this->scheduleCacheFlushJobForNodeAggregate( $this->contentRepository, $eventInstance->getWorkspaceName(), @@ -223,7 +224,7 @@ public function onAfterEvent(EventInterface $eventInstance, EventEnvelope $event private function scheduleCacheFlushJobForNodeAggregate( ContentRepository $contentRepository, - WorkspaceName $workspaceName, + WorkspaceName|VirtualWorkspaceName $workspaceName, NodeAggregate $nodeAggregate ): void { // we store this in an associative array deduplicate.