5include_once 
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
 
    6include_once 
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
 
    7include_once 
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
 
   36        include_once 
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingSettings.php';
 
   82        include_once 
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
 
   92            $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
': No directory allocation settings. Aborting');
 
   97        include_once 
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
 
  114        if ($this->default_settings[
'tree_update'] == 
false) {
 
  115            $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
': Tree update disabled for tree with id ' . $this->
getTree()->getTreeId());
 
  120        include_once 
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
 
  127        $a_root_ref_id = $mapping->getRefId();
 
  128        if ($a_root_ref_id) {
 
  148        include_once 
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
 
  152            $cms_data->getCmsId()
 
  154        if (!$import_obj_id) {
 
  155            $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
': cms tree node not imported. tnode_id: ' . $a_tnode_id);
 
  159        $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
' parent ref:' . $a_parent_ref_id . 
' tnode:' . $a_tnode_id);
 
  161        $import_ref_id = end($ref_ids);
 
  162        $import_ref_id_parent = 
$tree->getParentId($import_ref_id);
 
  164        if ($a_parent_ref_id != $import_ref_id_parent) {
 
  166            $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
': Moving node ' . $a_parent_ref_id . 
' to ' . $import_ref_id);
 
  167            $tree->moveTree($import_ref_id, $a_parent_ref_id);
 
  171        $childs = $this->
getTree()->getChilds($a_tnode_id);
 
  172        foreach ((array) $childs as $node) {
 
  183    protected function syncNode($tree_obj_id, $parent_id, $a_mapped = 
false)
 
  185        $childs = $this->
getTree()->getChilds($tree_obj_id);
 
  194        if ($assignment->getRefId()) {
 
  195            $parent_id = $assignment->getRefId();
 
  199        if ($assignment->isMapped()) {
 
  204            $parent_id = $this->
syncCategory($assignment, $parent_id);
 
  211            foreach ($childs as $node) {
 
  212                $this->
syncNode($node[
'child'], $parent_id, $a_mapped);
 
  224        include_once 
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
 
  230        include_once 
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
 
  238            $ref_id = end($refs);
 
  242            if (($cat instanceof 
ilObject) and $this->default_settings[
'title_update']) {
 
  243                $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
': Updating cms category ');
 
  244                $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
': Title is ' . 
$data->getTitle());
 
  245                $cat->deleteTranslation(
$GLOBALS[
'DIC'][
'lng']->getDefaultLanguage());
 
  246                $cat->addTranslation(
 
  248                    $cat->getLongDescription(),
 
  249                    $GLOBALS[
'DIC'][
'lng']->getDefaultLanguage(),
 
  252                $cat->setTitle(
$data->getTitle());
 
  255                $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
': Updating cms category -> nothing to do');
 
  259            $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
': Creating new cms category');
 
  262            include_once 
'./Modules/Category/classes/class.ilObjCategory.php';
 
  265            $cat->setTitle(
$data->getTitle());
 
  267            $cat->createReference();
 
  268            $cat->putInTree($parent_id);
 
  269            $cat->setPermissions($parent_id);
 
  270            $cat->deleteTranslation(
$GLOBALS[
'DIC'][
'lng']->getDEfaultLanguage());
 
  271            $cat->addTranslation(
 
  273                $cat->getLongDescription(),
 
  274                $GLOBALS[
'DIC'][
'lng']->getDefaultLanguage(),
 
  283            $import->setMID($this->mid);
 
  284            $import->setContentId(
$data->getCmsId());
 
  285            $import->setImported(
true);
 
  288            return $cat->getRefId();
 
  290            $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ . 
': Creation of empty containers is disabled.');
 
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
getDefaultSettings()
Get default settings.
getGlobalSettings()
get global settings
__construct(ilECSSetting $server, $mid, $tree_id)
Constructor.
syncCategory(ilECSNodeMappingAssignment $ass, $parent_id)
Sync category.
checkTreeUpdates($a_root_obj_id)
Start tree update check.
handleTreeUpdate($a_parent_ref_id, $a_tnode_id)
Handle tree update (recursively)
syncNode($tree_obj_id, $parent_id, $a_mapped=false)
Sync node.
static lookupRootId($a_tree_id)
lookup root id
Storage of ECS imported objects.
static lookupObjIdByContentId($a_server_id, $a_mid, $a_content_id, $a_sub_id=null)
Lookup obj_id by content id.
static lookupSettings($a_server_id, $a_mid, $a_tree_id, $a_node_id)
Lookup Settings.
static getInstanceByServerMid($a_server_id, $a_mid)
Get instance.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObject Basic functions for all objects.
static _getAllReferences($a_id)
get all reference ids of object
const SYSTEM_USER_ID
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...