class NodesController extends ActionController (View source)

Rudimentary REST service for nodes

Traits

A trait to add backend translation based on the backend users settings

A trait to add create a content context

Properties

protected Service $_localizationService from  BackendUserTranslationTrait
protected UserService $_userService from  BackendUserTranslationTrait
protected ContentContextFactory $_contextFactory from  CreateContentContextTrait
protected SiteRepository $_siteRepository from  CreateContentContextTrait
protected NodeTypeManager $nodeTypeManager
protected NodeSearchServiceInterface $nodeSearchService
protected PropertyMapper $propertyMapper
protected NodePropertyConverterService $nodePropertyConverterService
protected array $viewFormatToObjectNameMap
protected array $supportedMediaTypes

A list of IANA media types which are supported by this controller

Methods

void
initializeObject()

Set the locale according to the user settings

createContentContext(string $workspaceName, array $dimensions = [])

Create a ContentContext based on the given workspace name

createContextMatchingNodeData(NodeData $nodeData)

Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.

string
indexAction(string $searchTerm = '', array $nodeIdentifiers = [], string $workspaceName = 'live', array $dimensions = [], array $nodeTypes = ['Neos.Neos:Document'], NodeInterface $contextNode = null)

Shows a list of nodes

string
showAction(string $identifier, string $workspaceName = 'live', array $dimensions = [])

Shows a specific node

string
createAction(string $mode, string $identifier, string $workspaceName = 'live', array $dimensions = [], array $sourceDimensions = [])

Create a new node from an existing one

void
addExistingNodeVariantInformationToResponse($identifier, ContentContext $context)

If the node is not found, we first want to figure out whether the node exists in other dimensions or is really non-existent

void
adoptNodeAndParents(NodeInterface $node, ContentContext $contentContext, bool $copyContent)

Adopt (translate) the given node and parents that are not yet visible to the given context

Details

protected void initializeObject()

Set the locale according to the user settings

Return Value

void

protected ContentContext createContentContext(string $workspaceName, array $dimensions = [])

Create a ContentContext based on the given workspace name

Parameters

string $workspaceName

Name of the workspace to set for the context

array $dimensions

Optional list of dimensions and their values which should be set

Return Value

ContentContext

protected ContentContext createContextMatchingNodeData(NodeData $nodeData)

Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.

Parameters

NodeData $nodeData

Return Value

ContentContext

string indexAction(string $searchTerm = '', array $nodeIdentifiers = [], string $workspaceName = 'live', array $dimensions = [], array $nodeTypes = ['Neos.Neos:Document'], NodeInterface $contextNode = null)

Shows a list of nodes

Parameters

string $searchTerm

An optional search term used for filtering the list of nodes

array $nodeIdentifiers

An optional list of node identifiers

string $workspaceName

Name of the workspace to search in, "live" by default

array $dimensions

Optional list of dimensions and their values which should be used for querying

array $nodeTypes

A list of node types the list should be filtered by

NodeInterface $contextNode

a node to use as context for the search

Return Value

string

string showAction(string $identifier, string $workspaceName = 'live', array $dimensions = [])

Shows a specific node

Parameters

string $identifier

Specifies the node to look up

string $workspaceName

Name of the workspace to use for querying the node

array $dimensions

Optional list of dimensions and their values which should be used for querying the specified node

Return Value

string

string createAction(string $mode, string $identifier, string $workspaceName = 'live', array $dimensions = [], array $sourceDimensions = [])

Create a new node from an existing one

The "mode" property defines the basic mode of operation. Currently supported modes:

'adoptFromAnotherDimension': Adopts the single node from another dimension

  • $identifier, $workspaceName and $sourceDimensions specify the source node
  • $identifier, $workspaceName and $dimensions specify the target node

Parameters

string $mode
string $identifier

Specifies the identifier of the node to be created; if source

string $workspaceName

Name of the workspace where to create the node in

array $dimensions

Optional list of dimensions and their values in which the node should be created

array $sourceDimensions

Return Value

string

protected void addExistingNodeVariantInformationToResponse($identifier, ContentContext $context)

If the node is not found, we first want to figure out whether the node exists in other dimensions or is really non-existent

Parameters

$identifier
ContentContext $context

Return Value

void

protected void adoptNodeAndParents(NodeInterface $node, ContentContext $contentContext, bool $copyContent)

Adopt (translate) the given node and parents that are not yet visible to the given context

Parameters

NodeInterface $node
ContentContext $contentContext
bool $copyContent

true if the content from the nodes that are translated should be copied

Return Value

void