diff --git a/Classes/Controller/BackendController.php b/Classes/Controller/BackendController.php index fdfbe4b711..72b1c2a3ea 100644 --- a/Classes/Controller/BackendController.php +++ b/Classes/Controller/BackendController.php @@ -13,24 +13,24 @@ */ use Neos\ContentRepository\Core\NodeType\NodeTypeName; -use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; -use Neos\Neos\Domain\Model\WorkspaceName as NeosWorkspaceName; use Neos\Flow\Annotations as Flow; use Neos\Flow\Mvc\Controller\ActionController; +use Neos\Flow\Mvc\View\ViewInterface; +use Neos\Flow\Persistence\PersistenceManagerInterface; use Neos\Flow\ResourceManagement\ResourceManager; use Neos\Flow\Security\Context; use Neos\Flow\Session\SessionInterface; +use Neos\Fusion\View\FusionView; use Neos\Neos\Controller\Backend\MenuHelper; use Neos\Neos\Domain\Repository\DomainRepository; use Neos\Neos\Domain\Repository\SiteRepository; +use Neos\Neos\Domain\Service\WorkspaceNameBuilder; +use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionResult; use Neos\Neos\Service\BackendRedirectionService; use Neos\Neos\Service\UserService; -use Neos\Flow\Persistence\PersistenceManagerInterface; -use Neos\Fusion\View\FusionView; -use Neos\Flow\Mvc\View\ViewInterface; use Neos\Neos\Ui\Domain\Service\StyleAndJavascriptInclusionService; use Neos\Neos\Ui\Service\NodeClipboard; @@ -148,8 +148,7 @@ public function indexAction(string $node = null) $currentAccount = $this->securityContext->getAccount(); $workspace = $contentRepository->getWorkspaceFinder()->findOneByName( - NeosWorkspaceName::fromAccountIdentifier($currentAccount->getAccountIdentifier()) - ->toContentRepositoryWorkspaceName() + WorkspaceNameBuilder::fromAccountIdentifier($currentAccount->getAccountIdentifier()) ); if (is_null($workspace)) { $this->redirectToUri($this->uriBuilder->uriFor('index', [], 'Login', 'Neos.Neos')); diff --git a/Classes/Controller/BackendServiceController.php b/Classes/Controller/BackendServiceController.php index aa129095a9..7c923fbcec 100644 --- a/Classes/Controller/BackendServiceController.php +++ b/Classes/Controller/BackendServiceController.php @@ -13,12 +13,15 @@ * source code. */ +use Neos\ContentRepository\Core\Feature\WorkspaceModification\Command\ChangeBaseWorkspace; +use Neos\ContentRepository\Core\Feature\WorkspaceModification\Exception\WorkspaceIsNotEmptyException; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Command\DiscardIndividualNodesFromWorkspace; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Command\PublishIndividualNodesFromWorkspace; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdsToPublishOrDiscard; use Neos\ContentRepository\Core\Feature\WorkspacePublication\Dto\NodeIdToPublishOrDiscard; use Neos\ContentRepository\Core\Projection\ContentGraph\VisibilityConstraints; use Neos\ContentRepository\Core\SharedModel\Exception\NodeAggregateCurrentlyDoesNotExist; +use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Eel\FlowQuery\FlowQuery; use Neos\Flow\Annotations as Flow; @@ -29,7 +32,7 @@ use Neos\Flow\Persistence\PersistenceManagerInterface; use Neos\Flow\Property\PropertyMapper; use Neos\Flow\Security\Context; -use Neos\Neos\Domain\Model\WorkspaceName as NeosWorkspaceName; +use Neos\Neos\Domain\Service\WorkspaceNameBuilder; use Neos\Neos\FrontendRouting\NodeAddress; use Neos\Neos\FrontendRouting\NodeAddressFactory; use Neos\Neos\FrontendRouting\SiteDetection\SiteDetectionResult; @@ -40,6 +43,8 @@ use Neos\Neos\Ui\Domain\Model\Feedback\Messages\Error; use Neos\Neos\Ui\Domain\Model\Feedback\Messages\Info; use Neos\Neos\Ui\Domain\Model\Feedback\Messages\Success; +use Neos\Neos\Ui\Domain\Model\Feedback\Operations\Redirect; +use Neos\Neos\Ui\Domain\Model\Feedback\Operations\ReloadDocument; use Neos\Neos\Ui\Domain\Model\Feedback\Operations\UpdateWorkspaceInfo; use Neos\Neos\Ui\Domain\Model\FeedbackCollection; use Neos\Neos\Ui\Domain\Service\NodeTreeBuilder; @@ -50,12 +55,6 @@ use Neos\Neos\Ui\Service\PublishingService; use Neos\Neos\Ui\TypeConverter\ChangeCollectionConverter; use Neos\Neos\Utility\NodeUriPathSegmentGenerator; -use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; -use Neos\ContentRepository\Core\Feature\WorkspaceModification\Command\ChangeBaseWorkspace; -use Neos\ContentRepository\Core\SharedModel\Workspace\ContentStreamId; -use Neos\Neos\Ui\Domain\Model\Feedback\Operations\ReloadDocument; -use Neos\Neos\Ui\Domain\Model\Feedback\Operations\Redirect; -use Neos\ContentRepository\Core\Feature\WorkspaceModification\Exception\WorkspaceIsNotEmptyException; class BackendServiceController extends ActionController { @@ -195,8 +194,7 @@ public function publishAllAction(): void $contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId); $currentAccount = $this->securityContext->getAccount(); - $workspaceName = NeosWorkspaceName::fromAccountIdentifier($currentAccount->getAccountIdentifier()) - ->toContentRepositoryWorkspaceName(); + $workspaceName = WorkspaceNameBuilder::fromAccountIdentifier($currentAccount->getAccountIdentifier()); $this->publishingService->publishWorkspace($contentRepository, $workspaceName); $success = new Success(); @@ -222,8 +220,7 @@ public function publishAction(array $nodeContextPaths, string $targetWorkspaceNa try { $currentAccount = $this->securityContext->getAccount(); - $workspaceName = NeosWorkspaceName::fromAccountIdentifier($currentAccount->getAccountIdentifier()) - ->toContentRepositoryWorkspaceName(); + $workspaceName = WorkspaceNameBuilder::fromAccountIdentifier($currentAccount->getAccountIdentifier()); $nodeIdentifiersToPublish = []; foreach ($nodeContextPaths as $contextPath) { @@ -282,8 +279,7 @@ public function discardAction(array $nodeContextPaths): void try { $currentAccount = $this->securityContext->getAccount(); - $workspaceName = NeosWorkspaceName::fromAccountIdentifier($currentAccount->getAccountIdentifier()) - ->toContentRepositoryWorkspaceName(); + $workspaceName = WorkspaceNameBuilder::fromAccountIdentifier($currentAccount->getAccountIdentifier()); $nodeIdentifiersToDiscard = []; foreach ($nodeContextPaths as $contextPath) { @@ -343,9 +339,9 @@ public function changeBaseWorkspaceAction(string $targetWorkspaceName, string $d $nodeAddress = $nodeAddressFactory->createFromUriString($documentNode); $currentAccount = $this->securityContext->getAccount(); - $userWorkspaceName = NeosWorkspaceName::fromAccountIdentifier( + $userWorkspaceName = WorkspaceNameBuilder::fromAccountIdentifier( $currentAccount->getAccountIdentifier() - )->toContentRepositoryWorkspaceName(); + ); $command = ChangeBaseWorkspace::create($userWorkspaceName, WorkspaceName::fromString($targetWorkspaceName)); try { diff --git a/Classes/Fusion/Helper/WorkspaceHelper.php b/Classes/Fusion/Helper/WorkspaceHelper.php index dece54de2b..79903349ac 100644 --- a/Classes/Fusion/Helper/WorkspaceHelper.php +++ b/Classes/Fusion/Helper/WorkspaceHelper.php @@ -11,14 +11,13 @@ * source code. */ -use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\ContentRepository\Core\Factory\ContentRepositoryId; +use Neos\ContentRepositoryRegistry\ContentRepositoryRegistry; use Neos\Eel\ProtectedContextAwareInterface; -use Neos\ContentRepository\Core\SharedModel\Workspace\WorkspaceName; -use Neos\Neos\Domain\Model\WorkspaceName as NeosWorkspaceName; +use Neos\Flow\Annotations as Flow; use Neos\Flow\Security\Context; use Neos\Neos\Domain\Service\UserService as DomainUserService; -use Neos\Flow\Annotations as Flow; +use Neos\Neos\Domain\Service\WorkspaceNameBuilder; use Neos\Neos\Ui\ContentRepository\Service\WorkspaceService; /** @@ -63,9 +62,7 @@ public function getPersonalWorkspace(ContentRepositoryId $contentRepositoryId): { $contentRepository = $this->contentRepositoryRegistry->get($contentRepositoryId); $currentAccount = $this->securityContext->getAccount(); - $personalWorkspaceName = NeosWorkspaceName::fromAccountIdentifier( - $currentAccount->getAccountIdentifier() - )->toContentRepositoryWorkspaceName(); + $personalWorkspaceName = WorkspaceNameBuilder::fromAccountIdentifier($currentAccount->getAccountIdentifier()); $personalWorkspace = $contentRepository->getWorkspaceFinder()->findOneByName($personalWorkspaceName); return !is_null($personalWorkspace)