protected function createNodeJsop($path, $properties)
{
$body = '+' . $path . ' : {';
$binaries = array();
// first do the main properties, so they are certainly in the beginning
$nodeCreationProperties = array("jcr:primaryType", "jcr:mixinTypes");
foreach ($nodeCreationProperties as $name) {
if (isset($properties[$name])) {
$body .= json_encode($name) . ':' . json_encode($properties[$name]->getValueForStorage()) . ",";
}
}
foreach ($properties as $name => $property) {
if (in_array($name, $nodeCreationProperties)) {
continue;
}
$value = $this->propertyToJsopString($property);
if (!$value) {
$binaries[] = $property;
} else {
$body .= json_encode($name) . ':' . json_encode($value) . ",";
}
}
$body .= "}";
$this->setJsopBody($body);
foreach ($binaries as $binary) {
$this->storeProperty($binary);
}
}