Neos.Neos/Classes/Command/NodeCommandControllerPlugin.php
public function generateUriPathSegments($workspaceName, $dryRun)
    {
        $baseContext = $this->createContext($workspaceName, []);
        $baseContextSitesNode = $baseContext->getNode(SiteService::SITES_ROOT_PATH);
        if (!$baseContextSitesNode) {
            $this->dispatch(self::EVENT_WARNING, sprintf('Could not find "%s" root node', SiteService::SITES_ROOT_PATH));
            return;
        }
        $baseContextSiteNodes = $baseContextSitesNode->getChildNodes();
        if ($baseContextSiteNodes === []) {
            $this->dispatch(self::EVENT_WARNING, sprintf('Could not find any site nodes in "%s" root node', SiteService::SITES_ROOT_PATH));
            return;
        }

        foreach ($this->dimensionCombinator->getAllAllowedCombinations() as $dimensionCombination) {
            $flowQuery = new FlowQuery($baseContextSiteNodes);
            /** @noinspection PhpUndefinedMethodInspection */
            $siteNodes = $flowQuery->context(['dimensions' => $dimensionCombination, 'targetDimensions' => []])->get();
            if (count($siteNodes) > 0) {
                $this->dispatch(self::EVENT_NOTICE, sprintf('Checking for nodes with missing URI path segment in dimension "%s"', trim(NodePaths::generateContextPath('', '', $dimensionCombination), '@;')));
                foreach ($siteNodes as $siteNode) {
                    $this->generateUriPathSegmentsForNode($siteNode, $dryRun);
                }
            }
        }

        $this->persistenceManager->persistAll();
    }
public function generateUriPathSegments($workspaceName, $dryRun)
    {
        $baseContext = $this->createContext($workspaceName, []);
        $baseContextSitesNode = $baseContext->getNode(SiteService::SITES_ROOT_PATH);
        if (!$baseContextSitesNode) {
            $this->dispatch(self::EVENT_WARNING, sprintf('Could not find "%s" root node', SiteService::SITES_ROOT_PATH));
            return;
        }
        $baseContextSiteNodes = $baseContextSitesNode->getChildNodes();
        if ($baseContextSiteNodes === []) {
            $this->dispatch(self::EVENT_WARNING, sprintf('Could not find any site nodes in "%s" root node', SiteService::SITES_ROOT_PATH));
            return;
        }

        foreach ($this->dimensionCombinator->getAllAllowedCombinations() as $dimensionCombination) {
            $flowQuery = new FlowQuery($baseContextSiteNodes);
            /** @noinspection PhpUndefinedMethodInspection */
            $siteNodes = $flowQuery->context(['dimensions' => $dimensionCombination, 'targetDimensions' => []])->get();
            if (count($siteNodes) > 0) {
                $this->dispatch(self::EVENT_NOTICE, sprintf('Checking for nodes with missing URI path segment in dimension "%s"', trim(NodePaths::generateContextPath('', '', $dimensionCombination), '@;')));
                foreach ($siteNodes as $siteNode) {
                    $this->generateUriPathSegmentsForNode($siteNode, $dryRun);
                }
            }
        }

        $this->persistenceManager->persistAll();
    }
public function generateUriPathSegments ( $ workspaceName , $ dryRun ) { $ baseContext = $ this -> createContext ( $ workspaceName , [ ] ) ; $ baseContextSitesNode = $ baseContext -> getNode ( SiteService :: SITES_ROOT_PATH ) ; if ( ! $ baseContextSitesNode ) { $ this -> dispatch ( self :: EVENT_WARNING , sprintf ( 'Could not find "%s" root node' , SiteService :: SITES_ROOT_PATH ) ) ; return ; } $ baseContextSiteNodes = $ baseContextSitesNode -> getChildNodes ( ) ; if ( $ baseContextSiteNodes === [ ] ) { $ this -> dispatch ( self :: EVENT_WARNING , sprintf ( 'Could not find any site nodes in "%s" root node' , SiteService :: SITES_ROOT_PATH ) ) ; return ; } foreach ( $ this -> dimensionCombinator -> getAllAllowedCombinations ( ) as $ dimensionCombination ) { $ flowQuery = new FlowQuery ( $ baseContextSiteNodes ) ; /** @noinspection PhpUndefinedMethodInspection */ $ siteNodes = $ flowQuery -> context ( [ 'dimensions' => $ dimensionCombination , 'targetDimensions' => [ ] ] ) -> get ( ) ; if ( count ( $ siteNodes ) > 0 ) { $ this -> dispatch ( self :: EVENT_NOTICE , sprintf ( 'Checking for nodes with missing URI path segment in dimension "%s"' , trim ( NodePaths :: generateContextPath ( '' , '' , $ dimensionCombination ) , '@;' ) ) ) ; foreach ( $ siteNodes as $ siteNode ) { $ this -> generateUriPathSegmentsForNode ( $ siteNode , $ dryRun ) ; } } } $ this -> persistenceManager -> persistAll ( ) ; }
Generate missing URI path segments

This generates URI path segment properties for all document nodes which don't have
a path segment set yet.

@param string $workspaceName
@param boolean $dryRun
@return void
@throws EelException
@throws NodeException
@throws NeosException
Generate missing URI path segments