/**
  * Sync node to top
  * @param type $tree_id
  * @param type $parent_id
  * @return int obj_id of container
  */
 protected function syncNodeToTop($tree_id, $cms_id)
 {
     $obj_id = $this->getImportId($cms_id);
     if ($obj_id) {
         // node already imported
         return $obj_id;
     }
     $tobj_id = ilECSCmsData::lookupObjId($this->getServer()->getServerId(), $this->getMid(), $tree_id, $cms_id);
     // node is not imported
     $GLOBALS['ilLog']->write(__METHOD__ . ': ecs node with id ' . $cms_id . ' is not imported for mid ' . $this->getMid() . ' tree_id ' . $tree_id);
     // check for mapping: if mapping is available create category
     include_once './Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
     $ass = new ilECSNodeMappingAssignment($this->getServer()->getServerId(), $this->getMid(), $tree_id, $tobj_id);
     if ($ass->isMapped()) {
         $GLOBALS['ilLog']->write(__METHOD__ . ': node is mapped');
         return $this->syncCategory($tobj_id, $ass->getRefId());
     }
     // Start recursion to top
     include_once './Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
     $tree = new ilECSCmsTree($tree_id);
     $parent_tobj_id = $tree->getParentId($tobj_id);
     if ($parent_tobj_id) {
         $cms_ids = ilECSCmsData::lookupCmsIds(array($parent_tobj_id));
         $obj_id = $this->syncNodeToTop($tree_id, $cms_ids[0]);
     }
     if ($obj_id) {
         $refs = ilObject::_getAllReferences($obj_id);
         $ref_id = end($refs);
         return $this->syncCategory($tobj_id, $ref_id);
     }
     return 0;
 }