WorkspaceController
class WorkspaceController extends AbstractModuleController (View source)
| internal | for communication within the Workspace UI only |
The Neos Workspace module controller
Traits
Utility trait for retrieving node types for nodes with a built-in fallback mechanism
A trait to add backend translation based on the backend users settings
Properties
| protected Service | $_localizationService | from BackendUserTranslationTrait | |
| protected UserService | $_userService | from BackendUserTranslationTrait | |
| protected array<string, mixed> | $moduleConfiguration | from AbstractModuleController | |
| protected ContentRepositoryRegistry | $contentRepositoryRegistry | ||
| protected | $defaultViewObjectName | ||
| protected NodeUriBuilderFactory | $nodeUriBuilderFactory | ||
| protected SiteRepository | $siteRepository | ||
| protected PropertyMapper | $propertyMapper | ||
| protected Context | $securityContext | ||
| protected UserService | $userService | ||
| protected PackageManager | $packageManager | ||
| protected WorkspacePublishingService | $workspacePublishingService | ||
| protected WorkspaceService | $workspaceService | ||
| protected NodeLabelGeneratorInterface | $nodeLabelGenerator | ||
| protected Translator | $translator | ||
| protected PolicyService | $policyService | ||
| protected ContentRepositoryAuthorizationService | $authorizationService |
Methods
Set the locale according to the user settings
Use this method to set an alternative title than the module label
No description
No description
Update a workspace
Publish a single document node
Discard a single document node
Confirm force rebase a workspace
Computes the number of added, changed and removed nodes for the given workspace
Builds an array of changes for sites in the given workspace
Retrieves the given node's corresponding node in the base content stream (that is, which would be overwritten if the given node would be published)
Renders the difference between the original and the changed content of the given node and returns it, along with meta information
Renders a slimmed down representation of a property of the given node. The output will be HTML, but does not contain any markup from the original content.
Tries to determine a label for the specified property
A workaround for some missing functionality in the Diff Renderer:
Creates an array of workspace names and their respective titles which are possible base workspaces
No description
No description
Details
protected void
initializeObject()
Set the locale according to the user settings
protected void
initializeAction()
No description
protected void
initializeView(ViewInterface $view)
No description
void
setTitle(string $title)
Use this method to set an alternative title than the module label
void
indexAction(Sorting|null $sorting = null)
Display a list of unpublished content
protected
getErrorFlashMessage()
Display no flash message at all on errors.
protected NodeType
getNodeType(Node $node)
deprecated
deprecated
No description
void
reviewAction(WorkspaceName $workspace)
No description
void
newAction()
No description
void
createAction(WorkspaceTitle $title, WorkspaceName $baseWorkspace, WorkspaceDescription $description, string $visibility = 'shared')
No description
void
editAction(WorkspaceName $workspaceName)
Edit a workspace
void
updateAction(WorkspaceName $workspaceName, WorkspaceTitle $title, WorkspaceDescription $description, string $visibility, WorkspaceName|null $baseWorkspace = null)
Update a workspace
void
deleteAction(WorkspaceName $workspaceName)
Delete a workspace
void
publishDocumentAction(string $nodeAddress, WorkspaceName $selectedWorkspace)
Publish a single document node
void
discardDocumentAction(string $nodeAddress, WorkspaceName $selectedWorkspace)
Discard a single document node
void
publishOrDiscardNodesAction(array $nodes, string $action, WorkspaceName $workspace)
No description
void
publishWorkspaceAction(WorkspaceName $workspace)
Publishes the whole workspace
void
confirmPublishAllChangesAction(WorkspaceName $workspaceName)
No description
void
confirmDiscardAllChangesAction(WorkspaceName $workspaceName)
No description
void
confirmPublishSelectedChangesAction(WorkspaceName $workspaceName)
No description
void
confirmDiscardSelectedChangesAction(WorkspaceName $workspaceName)
No description
void
discardWorkspaceAction(WorkspaceName $workspace)
Discards content of the whole workspace
void
rebaseAction(WorkspaceName $workspaceName, bool $force)
Rebase a workspace
void
rebaseConfirmAction(WorkspaceName $workspaceName, int $conflictCount)
Confirm force rebase a workspace
protected PendingChanges
computePendingChanges(Workspace $selectedWorkspace, ContentRepository $contentRepository)
Computes the number of added, changed and removed nodes for the given workspace
protected array
computeSiteChanges(Workspace $selectedWorkspace, ContentRepository $contentRepository)
Builds an array of changes for sites in the given workspace
protected Node|null
getOriginalNode(Node $modifiedNode, WorkspaceName $baseWorkspaceName, ContentRepository $contentRepository)
Retrieves the given node's corresponding node in the base content stream (that is, which would be overwritten if the given node would be published)
protected ContentChangeItems
renderContentChanges(Node $changedNode, ContentStreamId $contentStreamIdOfOriginalNode, ContentRepository $contentRepository)
Renders the difference between the original and the changed content of the given node and returns it, along with meta information
protected string
renderSlimmedDownContent(mixed $propertyValue)
Renders a slimmed down representation of a property of the given node. The output will be HTML, but does not contain any markup from the original content.
Note: It's clear that this method needs to be extracted and moved to a more universal service at some point. However, since we only implemented diff-view support for this particular controller at the moment, it stays here for the time being. Once we start displaying diffs elsewhere, we should refactor the diff rendering part.
protected string
getPropertyLabel(string $propertyName, Node $changedNode)
Tries to determine a label for the specified property
protected void
postProcessDiffArray(array $diffArray)
A workaround for some missing functionality in the Diff Renderer:
This method will check if content in the given diff array is either completely new or has been completely
removed and wraps the respective part in or tags, because the Diff Renderer currently does not
do that in these cases.
protected array
prepareBaseWorkspaceOptions(ContentRepository $contentRepository, WorkspaceName|null $editedWorkspaceName)
Creates an array of workspace names and their respective titles which are possible base workspaces
If $editedWorkspace is set, this workspace and all its nested workspaces will be excluded from the list of returned workspaces
string
getModuleLabel(string $id, array $arguments = [], mixed $quantity = null)
No description
protected WorkspaceListItems
getWorkspaceListItems(ContentRepository $contentRepository)
No description
protected Changes
getChangesFromWorkspace(Workspace $selectedWorkspace, ContentRepository $contentRepository)
No description