public function registerNodeTypesCnd($cnd, $allowUpdate)
{
if ($this->transport instanceof NodeTypeCndManagementInterface) {
return $this->transport->registerNodeTypesCnd($cnd, $allowUpdate);
}
if ($this->transport instanceof NodeTypeManagementInterface) {
$workspace = $this->session->getWorkspace();
$nsRegistry = $workspace->getNamespaceRegistry();
$parser = new CndParser($workspace->getNodeTypeManager());
$res = $parser->parseString($cnd);
$ns = $res['namespaces'];
$types = $res['nodeTypes'];
foreach ($ns as $prefix => $uri) {
$nsRegistry->registerNamespace($prefix, $uri);
}
return $workspace->getNodeTypeManager()->registerNodeTypes($types, $allowUpdate);
}
throw new UnsupportedRepositoryOperationException('Transport does not support registering node types');
}