/** * Publishes the whole workspace * * @param Workspace $workspace * @return void */ public function publishWorkspaceAction(Workspace $workspace) { if (($targetWorkspace = $workspace->getBaseWorkspace()) === null) { $targetWorkspace = $this->workspaceRepository->findOneByName('live'); } $this->publishingService->publishNodes($this->publishingService->getUnpublishedNodes($workspace), $targetWorkspace); $this->addFlashMessage($this->translator->translateById('workspaces.allChangesInWorkspaceHaveBeenPublished', [htmlspecialchars($workspace->getTitle()), htmlspecialchars($targetWorkspace->getTitle())], null, null, 'Modules', 'TYPO3.Neos')); $this->redirect('index'); }
/** * Publish everything in the workspace with the given workspace name * * @param string $sourceWorkspaceName Name of the source workspace containing the content to publish * @param string $targetWorkspaceName Name of the target workspace the content should be published to * @return void */ public function publishAllAction($sourceWorkspaceName, $targetWorkspaceName) { $sourceWorkspace = $this->workspaceRepository->findOneByName($sourceWorkspaceName); $targetWorkspace = $this->workspaceRepository->findOneByName($targetWorkspaceName); if ($sourceWorkspace === null) { $this->throwStatus(400, 'Invalid source workspace'); } if ($targetWorkspace === null) { $this->throwStatus(400, 'Invalid target workspace'); } $this->publishingService->publishNodes($this->publishingService->getUnpublishedNodes($sourceWorkspace), $targetWorkspace); $this->throwStatus(204, sprintf('All changes in workspace %s have been published to %s', $sourceWorkspaceName, $targetWorkspaceName), ''); }