PHP Class Neos\Neos\Routing\FrontendNodeRoutePartHandler

Inheritance: extends Neos\Flow\Mvc\Routing\DynamicRoutePart, implements FrontendNodeRoutePartHandlerInterface
Show file Open project: neos/neos-development-collection

Protected Properties

Property Type Description
$contentDimensionPresetSource Neos\Neos\Domain\Service\ContentDimensionPresetSourceInterface
$contextFactory Neos\Neos\Domain\Service\ContentContextFactory
$domainRepository Neos\Neos\Domain\Repository\DomainRepository
$securityContext Neos\Flow\Security\Context
$siteRepository Neos\Neos\Domain\Repository\SiteRepository
$supportEmptySegmentForDimensions boolean
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Protected Methods

Method Description
buildContextFromPath ( string $path, boolean $convertLiveDimensions ) : ContentContext Creates a content context from the given "context path", i.e. a string used for _resolving_ (not matching) a node.
buildContextFromRequestPath ( &$requestPath ) : ContentContext Creates a content context from the given request path, considering possibly mentioned content dimension values.
buildContextFromWorkspaceName ( string $workspaceName, array $dimensions = null ) : ContentContext
buildContextFromWorkspaceNameAndDimensions ( string $workspaceName, array $dimensionsAndDimensionValues ) : ContentContext Sets context properties like "invisibleContentShown" according to the workspace (live or not) and returns a ContentContext object.
convertRequestPathToNode ( string $requestPath ) : Neos\ContentRepository\Domain\Model\NodeInterface Returns the initialized node that is referenced by $requestPath, based on the node's "uriPathSegment" property.
findValueToMatch ( string $requestPath ) : string Extracts the node path from the request path.
getRelativeNodePathByUriPathSegmentProperties ( Neos\ContentRepository\Domain\Model\NodeInterface $siteNode, string $relativeRequestPath ) : string Builds a node path which matches the given request path.
getRequestPathByNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : string Renders a request path based on the "uriPathSegment" properties of the nodes leading to the given node.
getUriSegmentForDimensions ( array $dimensionsValues, boolean $currentNodeIsSiteNode ) : string Find a URI segment in the content dimension presets for the given "language" dimension values
matchValue ( string $requestPath ) : boolean Matches a frontend URI pointing to a node (for example a page).
onlyMatchSiteNodes ( ) : boolean Whether the current route part should only match/resolve site nodes (e.g. the homepage)
parseDimensionsAndNodePathFromRequestPath ( &$requestPath ) : array Choose between default method for parsing dimensions or the one which allows uriSegment to be empty for default preset.
parseDimensionsAndNodePathFromRequestPathAllowingEmptySegment ( &$requestPath ) : array Parses the given request path and checks if the first path segment is one or a set of content dimension preset identifiers. If that is the case, the return value is an array of dimension names and their preset URI segments.
parseDimensionsAndNodePathFromRequestPathAllowingNonUniqueSegment ( &$requestPath ) : array Parses the given request path and checks if the first path segment is one or a set of content dimension preset identifiers. If that is the case, the return value is an array of dimension names and their preset URI segments.
removeContextFromPath ( string $path ) : string
resolveRoutePathForNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : string Resolves the request path, also known as route path, identifying the given node.
resolveValue ( mixed $node ) : boolean Checks, whether given value is a Node object and if so, sets $this->value to the respective node path.

Method Details

buildContextFromPath() protected method

Creates a content context from the given "context path", i.e. a string used for _resolving_ (not matching) a node.
protected buildContextFromPath ( string $path, boolean $convertLiveDimensions ) : ContentContext
$path string a path containing the context, such as /sites/examplecom/home@user-johndoe or /assets/pictures/my-picture or /assets/pictures/my-picture@user-john;language=de&country=global
$convertLiveDimensions boolean Whether to parse dimensions from the context path in a non-live workspace
return Neos\Neos\Domain\Service\ContentContext based on the specified path; only evaluating the context information (i.e. everything after "@")

buildContextFromRequestPath() protected method

Creates a content context from the given request path, considering possibly mentioned content dimension values.
protected buildContextFromRequestPath ( &$requestPath ) : ContentContext
return Neos\Neos\Domain\Service\ContentContext The built content context

buildContextFromWorkspaceName() protected method

protected buildContextFromWorkspaceName ( string $workspaceName, array $dimensions = null ) : ContentContext
$workspaceName string
$dimensions array
return Neos\Neos\Domain\Service\ContentContext

buildContextFromWorkspaceNameAndDimensions() protected method

Sets context properties like "invisibleContentShown" according to the workspace (live or not) and returns a ContentContext object.
protected buildContextFromWorkspaceNameAndDimensions ( string $workspaceName, array $dimensionsAndDimensionValues ) : ContentContext
$workspaceName string Name of the workspace to use in the context
$dimensionsAndDimensionValues array An array of dimension names (index) and their values (array of strings). See also: ContextFactory
return Neos\Neos\Domain\Service\ContentContext

convertRequestPathToNode() protected method

Note that $requestPath will be modified (passed by reference) by buildContextFromRequestPath().
protected convertRequestPathToNode ( string $requestPath ) : Neos\ContentRepository\Domain\Model\NodeInterface
$requestPath string The request path, for example /the/node/path@some-workspace
return Neos\ContentRepository\Domain\Model\NodeInterface

findValueToMatch() protected method

Extracts the node path from the request path.
protected findValueToMatch ( string $requestPath ) : string
$requestPath string The request path to be matched
return string value to match, or an empty string if $requestPath is empty or split string was not found

getRelativeNodePathByUriPathSegmentProperties() protected method

This method traverses the segments of the given request path and tries to find nodes on the current level which have a matching "uriPathSegment" property. If no node could be found which would match the given request path, false is returned.
protected getRelativeNodePathByUriPathSegmentProperties ( Neos\ContentRepository\Domain\Model\NodeInterface $siteNode, string $relativeRequestPath ) : string
$siteNode Neos\ContentRepository\Domain\Model\NodeInterface The site node, used as a starting point while traversing the tree
$relativeRequestPath string The request path, relative to the site's root path
return string

getRequestPathByNode() protected method

Renders a request path based on the "uriPathSegment" properties of the nodes leading to the given node.
protected getRequestPathByNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : string
$node Neos\ContentRepository\Domain\Model\NodeInterface The node where the generated path should lead to
return string A relative request path

getUriSegmentForDimensions() protected method

This will do a reverse lookup from actual dimension values to a preset and fall back to the default preset if none can be found.
protected getUriSegmentForDimensions ( array $dimensionsValues, boolean $currentNodeIsSiteNode ) : string
$dimensionsValues array An array of dimensions and their values, indexed by dimension name
$currentNodeIsSiteNode boolean If the current node is actually the site node
return string

matchValue() protected method

This function tries to find a matching node by the given request path. If one was found, its absolute context node path is set in $this->value and true is returned. Note that this matcher does not check if access to the resolved workspace or node is allowed because at the point in time the route part handler is invoked, the security framework is not yet fully initialized.
protected matchValue ( string $requestPath ) : boolean
$requestPath string The request path (without leading "/", relative to the current Site Node)
return boolean true if the $requestPath could be matched, otherwise false

onlyMatchSiteNodes() protected method

Whether the current route part should only match/resolve site nodes (e.g. the homepage)
protected onlyMatchSiteNodes ( ) : boolean
return boolean

parseDimensionsAndNodePathFromRequestPath() protected method

Choose between default method for parsing dimensions or the one which allows uriSegment to be empty for default preset.
protected parseDimensionsAndNodePathFromRequestPath ( &$requestPath ) : array
return array An array of dimension name => dimension values (array of string)

parseDimensionsAndNodePathFromRequestPathAllowingEmptySegment() protected method

Allows uriSegment to be empty for default dimension preset. If the first path segment contained content dimension information, it is removed from &$requestPath.
protected parseDimensionsAndNodePathFromRequestPathAllowingEmptySegment ( &$requestPath ) : array
return array An array of dimension name => dimension values (array of string)

parseDimensionsAndNodePathFromRequestPathAllowingNonUniqueSegment() protected method

Doesn't allow empty uriSegment, but allows uriSegment to be not unique across presets. If the first path segment contained content dimension information, it is removed from &$requestPath.
protected parseDimensionsAndNodePathFromRequestPathAllowingNonUniqueSegment ( &$requestPath ) : array
return array An array of dimension name => dimension values (array of string)

removeContextFromPath() protected method

protected removeContextFromPath ( string $path ) : string
$path string an absolute or relative node path which possibly contains context information, for example "/sites/somesite/the/node/path@some-workspace"
return string the same path without context information

resolveRoutePathForNode() protected method

A path is built, based on the uri path segment properties of the parents of and the given node itself. If content dimensions are configured, the first path segment will the identifiers of the dimension values according to the current context.
protected resolveRoutePathForNode ( Neos\ContentRepository\Domain\Model\NodeInterface $node ) : string
$node Neos\ContentRepository\Domain\Model\NodeInterface The node where the generated path should lead to
return string The relative route path, possibly prefixed with a segment for identifying the current content dimension values

resolveValue() protected method

In order to render a suitable frontend URI, this function strips off the path to the site node and only keeps the actual node path relative to that site node. In practice this function would set $this->value as follows: absolute node path: /sites/neostypo3org/homepage/about $this->value: homepage/about absolute node path: /sites/neostypo3org/homepage/about@user-admin $this->value: homepage/about@user-admin
protected resolveValue ( mixed $node ) : boolean
$node mixed Either a Node object or an absolute context node path
return boolean true if value could be resolved successfully, otherwise false.

Property Details

$contentDimensionPresetSource protected property

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

$contextFactory protected property

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

$domainRepository protected property

protected DomainRepository,Neos\Neos\Domain\Repository $domainRepository
return Neos\Neos\Domain\Repository\DomainRepository

$securityContext protected property

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

$siteRepository protected property

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

$supportEmptySegmentForDimensions protected property

protected bool $supportEmptySegmentForDimensions
return boolean

$systemLogger protected property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
return Neos\Flow\Log\SystemLoggerInterface