FrontendNodeRoutePartHandler
class FrontendNodeRoutePartHandler extends DynamicRoutePart implements FrontendNodeRoutePartHandlerInterface (View source)
A route part handler for finding nodes specifically in the website's frontend.
Constants
DIMENSION_REQUEST_PATH_MATCHER |
|
Properties
protected LoggerInterface | $systemLogger | ||
protected ContentContextFactory | $contextFactory | ||
protected Context | $securityContext | ||
protected DomainRepository | $domainRepository | ||
protected SiteRepository | $siteRepository | ||
protected bool | $supportEmptySegmentForDimensions | ||
protected ContentDimensionPresetSourceInterface | $contentDimensionPresetSource | ||
protected NodeShortcutResolver | $nodeShortcutResolver | ||
protected Site[] | $siteByHostRuntimeCache |
Methods
Extracts the node path from the request path.
Matches a frontend URI pointing to a node (for example a page).
Returns the initialized node that is referenced by $requestPath, based on the node's "uriPathSegment" property.
Checks, whether given value is a Node object and if so, sets $this->value to the respective node path.
Removes the configured suffix from the given $uriPath If the "uriPathSuffix" option is not set (or set to an empty string) the unaltered $uriPath is returned
Builds UriConstraints for the given $node with:
- domain specific constraints for nodes in a different Neos site
- a path suffix corresponding to the configured "uriPathSuffix"
No description
Creates a content context from the given request path, considering possibly mentioned content dimension values.
Creates a content context from the given "context path", i.e. a string used for resolving (not matching) a node.
No description
No description
Whether the current route part should only match/resolve site nodes (e.g. the homepage)
Whether the given $node is allowed according to the "nodeType" option
Resolves the request path, also known as route path, identifying the given node.
Builds a node path which matches the given request path.
Renders a request path based on the "uriPathSegment" properties of the nodes leading to the given node.
Choose between default method for parsing dimensions or the one which allows uriSegment to be empty for default preset.
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.
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.
Sets context properties like "invisibleContentShown" according to the workspace (live or not) and returns a ContentContext object.
Determines the currently active site based on the "requestUriHost" parameter (that has to be set via HTTP middleware)
Returns a site matching the given $hostName
Find a URI segment in the content dimension presets for the given "language" dimension values
Details
protected string
findValueToMatch(string $requestPath)
Extracts the node path from the request path.
protected bool|MatchResult
matchValue(string $requestPath)
Matches a frontend URI pointing to a node (for example a page).
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 NodeInterface
convertRequestPathToNode(string $requestPath)
Returns the initialized node that is referenced by $requestPath, based on the node's "uriPathSegment" property.
Note that $requestPath will be modified (passed by reference) by buildContextFromRequestPath().
protected bool|ResolveResult
resolveValue(NodeInterface|string|string[] $node)
Checks, whether given value is a Node object and if so, sets $this->value to the respective node path.
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 false|string|null
truncateUriPathSuffix(string $uriPath)
Removes the configured suffix from the given $uriPath If the "uriPathSuffix" option is not set (or set to an empty string) the unaltered $uriPath is returned
protected NodeInterface|Uri
resolveShortcutNode(NodeInterface $node)
No description
protected UriConstraints
buildUriConstraintsForResolvedNode(NodeInterface $node)
Builds UriConstraints for the given $node with:
- domain specific constraints for nodes in a different Neos site
- a path suffix corresponding to the configured "uriPathSuffix"
protected UriConstraints
applyDomainToUriConstraints(UriConstraints $uriConstraints, Domain|null $domain)
No description
protected ContentContext
buildContextFromRequestPath(string $requestPath)
Creates a content context from the given request path, considering possibly mentioned content dimension values.
protected ContentContext
buildContextFromPath(string $path, bool $convertLiveDimensions)
Creates a content context from the given "context path", i.e. a string used for resolving (not matching) a node.
protected ContentContext
buildContextFromWorkspaceName(string $workspaceName, array $dimensions = null)
No description
protected string
removeContextFromPath(string $path)
No description
protected bool
onlyMatchSiteNodes()
Whether the current route part should only match/resolve site nodes (e.g. the homepage)
protected bool
nodeTypeIsAllowed(NodeInterface $node)
Whether the given $node is allowed according to the "nodeType" option
protected string
resolveRoutePathForNode(NodeInterface $node)
Resolves the request path, also known as route path, identifying the given node.
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 string
getRelativeNodePathByUriPathSegmentProperties(NodeInterface $siteNode, string $relativeRequestPath)
Builds a node path which matches the given request path.
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 string
getRequestPathByNode(NodeInterface $node)
Renders a request path based on the "uriPathSegment" properties of the nodes leading to the given node.
protected array
parseDimensionsAndNodePathFromRequestPath(string $requestPath)
Choose between default method for parsing dimensions or the one which allows uriSegment to be empty for default preset.
protected array
parseDimensionsAndNodePathFromRequestPathAllowingEmptySegment(string $requestPath)
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.
Allows uriSegment to be empty for default dimension preset.
If the first path segment contained content dimension information, it is removed from &$requestPath.
protected array
parseDimensionsAndNodePathFromRequestPathAllowingNonUniqueSegment(string $requestPath)
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.
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 ContentContext
buildContextFromWorkspaceNameAndDimensions(string $workspaceName, array $dimensionsAndDimensionValues)
Sets context properties like "invisibleContentShown" according to the workspace (live or not) and returns a ContentContext object.
protected Site
getCurrentSite()
Determines the currently active site based on the "requestUriHost" parameter (that has to be set via HTTP middleware)
protected Site
getSiteByHostName(string $hostName)
Returns a site matching the given $hostName
protected string
getUriSegmentForDimensions(array $dimensionsValues, bool $currentNodeIsSiteNode)
Find a URI segment in the content dimension presets for the given "language" dimension values
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.