/**
* Generates a Context that exactly fits the given NodeData Workspace, Dimensions & Site.
*
* @param NodeData $nodeData
* @return ContentContext
*/
protected function createContextMatchingNodeData(NodeData $nodeData)
{
$nodePath = NodePaths::getRelativePathBetween(SiteService::SITES_ROOT_PATH, $nodeData->getPath());
list($siteNodeName) = explode('/', $nodePath);
$site = $this->siteRepository->findOneByNodeName($siteNodeName);
$contextProperties = ['workspaceName' => $nodeData->getWorkspace()->getName(), 'invisibleContentShown' => true, 'inaccessibleContentShown' => true, 'removedContentShown' => true, 'dimensions' => $nodeData->getDimensionValues(), 'currentSite' => $site];
if ($domain = $site->getFirstActiveDomain()) {
$contextProperties['currentDomain'] = $domain;
}
return $this->_contextFactory->create($contextProperties);
}