PHP Class Neos\Neos\Controller\Module\Management\WorkspacesController

Inheritance: extends Neos\Neos\Controller\Module\AbstractModuleController
Mostrar archivo Open project: neos/neos-development-collection

Protected Properties

Property Type Description
$contentDimensionPresetSource Neos\Neos\Domain\Service\ContentDimensionPresetSourceInterface
$contextFactory Neos\Neos\Domain\Service\ContentContextFactory
$propertyMapper Neos\Flow\Property\PropertyMapper
$propertyMappingConfigurationBuilder Neos\Flow\Property\PropertyMappingConfigurationBuilder
$publishingService Neos\Neos\Service\PublishingService
$securityContext Neos\Flow\Security\Context
$siteRepository Neos\Neos\Domain\Repository\SiteRepository
$translator Neos\Flow\I18n\Translator
$userService Neos\Neos\Domain\Service\UserService
$workspaceRepository Neos\ContentRepository\Domain\Repository\WorkspaceRepository

Public Methods

Method Description
createAction ( string $title, Workspace $baseWorkspace, string $visibility, string $description = '' ) : void Create a workspace
deleteAction ( Workspace $workspace ) : void Delete a workspace
discardNodeAction ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $selectedWorkspace ) Discard a a single node
discardWorkspaceAction ( Workspace $workspace ) : void Discards content of the whole workspace
editAction ( Workspace $workspace ) : void Edit a workspace
indexAction ( ) : void Display a list of unpublished content
newAction ( ) : void
publishNodeAction ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $selectedWorkspace ) Publish a single node
publishOrDiscardNodesAction ( array $nodes, string $action, Workspace $selectedWorkspace = null ) Publishes or discards the given nodes
publishWorkspaceAction ( Workspace $workspace ) : void Publishes the whole workspace
rebaseAndRedirectAction ( Neos\ContentRepository\Domain\Model\NodeInterface $targetNode, Workspace $targetWorkspace ) : void Rebase the current users personal workspace onto the given $targetWorkspace and then redirects to the $targetNode in the content module.
showAction ( Workspace $workspace ) : void
updateAction ( Workspace $workspace ) : void Update a workspace

Protected Methods

Method Description
computeChangesCount ( Workspace $selectedWorkspace ) : array Computes the number of added, changed and removed nodes for the given workspace
computeSiteChanges ( Workspace $selectedWorkspace ) : array Builds an array of changes for sites in the given workspace
getOriginalNode ( Neos\ContentRepository\Domain\Model\NodeInterface $modifiedNode ) : Neos\ContentRepository\Domain\Model\NodeInterface Retrieves the given node's corresponding node in the base workspace (that is, which would be overwritten if the given node would be published)
getPropertyLabel ( string $propertyName, Neos\ContentRepository\Domain\Model\NodeInterface $changedNode ) : string Tries to determine a label for the specified property
initializeAction ( ) : void
initializeUpdateAction ( ) : void
postProcessDiffArray ( array &$diffArray ) : void A workaround for some missing functionality in the Diff Renderer:
prepareBaseWorkspaceOptions ( Workspace $excludedWorkspace = null ) : array Creates an array of workspace names and their respective titles which are possible base workspaces for other workspaces.
prepareOwnerOptions ( ) : array Creates an array of user names and their respective labels which are possible owners for a workspace.
renderContentChanges ( Neos\ContentRepository\Domain\Model\NodeInterface $changedNode ) : array Renders the difference between the original and the changed content of the given node and returns it, along with meta information, in an array.
renderSlimmedDownContent ( mixed $propertyValue ) : string 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.

Method Details

computeChangesCount() protected method

Computes the number of added, changed and removed nodes for the given workspace
protected computeChangesCount ( Workspace $selectedWorkspace ) : array
$selectedWorkspace Neos\ContentRepository\Domain\Model\Workspace
return array

computeSiteChanges() protected method

Builds an array of changes for sites in the given workspace
protected computeSiteChanges ( Workspace $selectedWorkspace ) : array
$selectedWorkspace Neos\ContentRepository\Domain\Model\Workspace
return array

createAction() public method

Create a workspace
public createAction ( string $title, Workspace $baseWorkspace, string $visibility, string $description = '' ) : void
$title string Human friendly title of the workspace, for example "Christmas Campaign"
$baseWorkspace Neos\ContentRepository\Domain\Model\Workspace Workspace the new workspace should be based on
$visibility string Visibility of the new workspace, must be either "internal" or "shared"
$description string A description explaining the purpose of the new workspace
return void

deleteAction() public method

Delete a workspace
public deleteAction ( Workspace $workspace ) : void
$workspace Neos\ContentRepository\Domain\Model\Workspace A workspace to delete
return void

discardNodeAction() public method

Discard a a single node
public discardNodeAction ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $selectedWorkspace )
$node Neos\ContentRepository\Domain\Model\NodeInterface
$selectedWorkspace Neos\ContentRepository\Domain\Model\Workspace

discardWorkspaceAction() public method

Discards content of the whole workspace
public discardWorkspaceAction ( Workspace $workspace ) : void
$workspace Neos\ContentRepository\Domain\Model\Workspace
return void

editAction() public method

Edit a workspace
public editAction ( Workspace $workspace ) : void
$workspace Neos\ContentRepository\Domain\Model\Workspace
return void

getOriginalNode() protected method

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 getOriginalNode ( Neos\ContentRepository\Domain\Model\NodeInterface $modifiedNode ) : Neos\ContentRepository\Domain\Model\NodeInterface
$modifiedNode Neos\ContentRepository\Domain\Model\NodeInterface
return Neos\ContentRepository\Domain\Model\NodeInterface

getPropertyLabel() protected method

Tries to determine a label for the specified property
protected getPropertyLabel ( string $propertyName, Neos\ContentRepository\Domain\Model\NodeInterface $changedNode ) : string
$propertyName string
$changedNode Neos\ContentRepository\Domain\Model\NodeInterface
return string

indexAction() public method

Display a list of unpublished content
public indexAction ( ) : void
return void

initializeAction() protected method

protected initializeAction ( ) : void
return void

initializeUpdateAction() protected method

protected initializeUpdateAction ( ) : void
return void

newAction() public method

public newAction ( ) : void
return void

postProcessDiffArray() protected method

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 postProcessDiffArray ( array &$diffArray ) : void
$diffArray array
return void

prepareBaseWorkspaceOptions() protected method

Creates an array of workspace names and their respective titles which are possible base workspaces for other workspaces.
protected prepareBaseWorkspaceOptions ( Workspace $excludedWorkspace = null ) : array
$excludedWorkspace Neos\ContentRepository\Domain\Model\Workspace If set, this workspace will be excluded from the list of returned workspaces
return array

prepareOwnerOptions() protected method

Creates an array of user names and their respective labels which are possible owners for a workspace.
protected prepareOwnerOptions ( ) : array
return array

publishNodeAction() public method

Publish a single node
public publishNodeAction ( Neos\ContentRepository\Domain\Model\NodeInterface $node, Workspace $selectedWorkspace )
$node Neos\ContentRepository\Domain\Model\NodeInterface
$selectedWorkspace Neos\ContentRepository\Domain\Model\Workspace

publishOrDiscardNodesAction() public method

Publishes or discards the given nodes
public publishOrDiscardNodesAction ( array $nodes, string $action, Workspace $selectedWorkspace = null )
$nodes array <\Neos\ContentRepository\Domain\Model\NodeInterface> $nodes
$action string
$selectedWorkspace Neos\ContentRepository\Domain\Model\Workspace

publishWorkspaceAction() public method

Publishes the whole workspace
public publishWorkspaceAction ( Workspace $workspace ) : void
$workspace Neos\ContentRepository\Domain\Model\Workspace
return void

rebaseAndRedirectAction() public method

Rebase the current users personal workspace onto the given $targetWorkspace and then redirects to the $targetNode in the content module.
public rebaseAndRedirectAction ( Neos\ContentRepository\Domain\Model\NodeInterface $targetNode, Workspace $targetWorkspace ) : void
$targetNode Neos\ContentRepository\Domain\Model\NodeInterface
$targetWorkspace Neos\ContentRepository\Domain\Model\Workspace
return void

renderContentChanges() protected method

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 renderContentChanges ( Neos\ContentRepository\Domain\Model\NodeInterface $changedNode ) : array
$changedNode Neos\ContentRepository\Domain\Model\NodeInterface
return array

renderSlimmedDownContent() protected method

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 renderSlimmedDownContent ( mixed $propertyValue ) : string
$propertyValue mixed
return string

showAction() public method

public showAction ( Workspace $workspace ) : void
$workspace Neos\ContentRepository\Domain\Model\Workspace
return void

updateAction() public method

Update a workspace
public updateAction ( Workspace $workspace ) : void
$workspace Neos\ContentRepository\Domain\Model\Workspace A workspace to update
return void

Property Details

$contentDimensionPresetSource protected_oe property

protected ContentDimensionPresetSourceInterface,Neos\Neos\Domain\Service $contentDimensionPresetSource
return Neos\Neos\Domain\Service\ContentDimensionPresetSourceInterface

$contextFactory protected_oe property

protected ContentContextFactory,Neos\Neos\Domain\Service $contextFactory
return Neos\Neos\Domain\Service\ContentContextFactory

$propertyMapper protected_oe property

protected PropertyMapper,Neos\Flow\Property $propertyMapper
return Neos\Flow\Property\PropertyMapper

$propertyMappingConfigurationBuilder protected_oe property

protected PropertyMappingConfigurationBuilder,Neos\Flow\Property $propertyMappingConfigurationBuilder
return Neos\Flow\Property\PropertyMappingConfigurationBuilder

$publishingService protected_oe property

protected PublishingService,Neos\Neos\Service $publishingService
return Neos\Neos\Service\PublishingService

$securityContext protected_oe property

protected Context,Neos\Flow\Security $securityContext
return Neos\Flow\Security\Context

$siteRepository protected_oe property

protected SiteRepository,Neos\Neos\Domain\Repository $siteRepository
return Neos\Neos\Domain\Repository\SiteRepository

$translator protected_oe property

protected Translator,Neos\Flow\I18n $translator
return Neos\Flow\I18n\Translator

$userService protected_oe property

protected UserService,Neos\Neos\Domain\Service $userService
return Neos\Neos\Domain\Service\UserService

$workspaceRepository protected_oe property

protected WorkspaceRepository,Neos\ContentRepository\Domain\Repository $workspaceRepository
return Neos\ContentRepository\Domain\Repository\WorkspaceRepository