protected function generatePath(TreeNodeInterface $node, $parameters)
    {
        if ($this->requestContext->getParameter('_preview') || isset($parameters['_preview'])) {
            return $this->generatePreviewPath($node, $parameters);
        }

        $pathGenerator = new PathGenerator();
        $path = $pathGenerator->generatePath($node, $parameters);

        if ($path === '') {
            return $path;
        }

        $path = $this->generatePathPrefix($path, $node, $parameters);
        $path = $this->generatePathSuffix($path, $node, $parameters);
        $path = $this->generateQuery($path, $node, $parameters);

        return $path;
    }