private function getTreeForUuid(Request $request, $uuid)
{
$language = $this->getLanguage($request);
$webspace = $this->getWebspace($request, false);
$excludeGhosts = $this->getBooleanRequestParameter($request, 'exclude-ghosts', false, false);
$excludeShadows = $this->getBooleanRequestParameter($request, 'exclude-shadows', false, false);
$appendWebspaceNode = $this->getBooleanRequestParameter($request, 'webspace-node', false, false);
try {
if ($uuid !== null && $uuid !== '') {
$result = $this->getRepository()->getNodesTree($uuid, $webspace, $language, $excludeGhosts, $excludeShadows, $appendWebspaceNode);
} elseif ($webspace !== null) {
$result = $this->getRepository()->getWebspaceNode($webspace, $language);
} else {
$result = $this->getRepository()->getWebspaceNodes($language);
}
} catch (DocumentNotFoundException $ex) {
// TODO return 404 and handle this edge case on client side
return $this->redirect($this->generateUrl('get_nodes', ['tree' => 'false', 'depth' => 1, 'language' => $language, 'webspace' => $webspace, 'exclude-ghosts' => $excludeGhosts]));
}
return $this->handleView($this->view($result));
}