WorkspacesController
class WorkspacesController extends AbstractModuleController (View source)
The Neos Workspaces module controller
Traits
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 | $moduleConfiguration | from AbstractModuleController | |
protected PublishingService | $publishingService | ||
protected WorkspaceRepository | $workspaceRepository | ||
protected SiteRepository | $siteRepository | ||
protected PropertyMapper | $propertyMapper | ||
protected Context | $securityContext | ||
protected ContentContextFactory | $contextFactory | ||
protected UserService | $userService | ||
protected Translator | $translator | ||
protected PackageManager | $packageManager | ||
protected ContentDimensionPresetSourceInterface | $contentDimensionPresetSource |
Methods
Set the locale according to the user settings
No description
Use this method to set an alternative title than the module label
Display a list of unpublished content
Display no flash message at all on errors.
No description
Create a workspace
No description
Rebase the current users personal workspace onto the given $targetWorkspace and then redirects to the $targetNode in the content module.
Publishes or discards the given nodes
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 workspace (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, in an array.
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 for other workspaces.
Creates an array of user names and their respective labels which are possible owners for a workspace.
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()
Display a list of unpublished content
protected Message
getErrorFlashMessage()
Display no flash message at all on errors.
void
showAction(Workspace $workspace)
No description
void
newAction()
No description
void
createAction(string $title, Workspace $baseWorkspace, string $visibility, string $description = '')
Create a workspace
void
editAction(Workspace $workspace)
Edit a workspace
protected void
initializeUpdateAction()
No description
void
updateAction(Workspace $workspace)
Update a workspace
void
deleteAction(Workspace $workspace)
Delete a workspace
void
rebaseAndRedirectAction(NodeInterface $targetNode, Workspace $targetWorkspace)
Rebase the current users personal workspace onto the given $targetWorkspace and then redirects to the $targetNode in the content module.
publishNodeAction(NodeInterface $node, Workspace $selectedWorkspace)
Publish a single node
discardNodeAction(NodeInterface $node, Workspace $selectedWorkspace)
Discard a a single node
publishOrDiscardNodesAction(array $nodes, string $action, Workspace $selectedWorkspace = null)
Publishes or discards the given nodes
void
publishWorkspaceAction(Workspace $workspace)
Publishes the whole workspace
void
discardWorkspaceAction(Workspace $workspace)
Discards content of the whole workspace
protected array
computeChangesCount(Workspace $selectedWorkspace)
Computes the number of added, changed and removed nodes for the given workspace
protected array
computeSiteChanges(Workspace $selectedWorkspace)
Builds an array of changes for sites in the given workspace
protected NodeInterface
getOriginalNode(NodeInterface $modifiedNode)
Retrieves the given node's corresponding node in the base workspace (that is, which would be overwritten if the given node would be published)
protected array
renderContentChanges(NodeInterface $changedNode)
Renders the difference between the original and the changed content of the given node and returns it, along with meta information, in an array.
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, NodeInterface $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(Workspace $excludedWorkspace = null)
Creates an array of workspace names and their respective titles which are possible base workspaces for other workspaces.
protected array
prepareOwnerOptions()
Creates an array of user names and their respective labels which are possible owners for a workspace.