5 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
6 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
7 include_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';
93 $GLOBALS[
'ilLog']->write(__METHOD__.
': No directory allocation settings. Aborting');
98 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
115 if($this->default_settings[
'tree_update'] ==
false)
117 $GLOBALS[
'ilLog']->write(__METHOD__.
': Tree update disabled for tree with id '. $this->getTree()->getTreeId());
122 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
129 $a_root_ref_id = $mapping->getRefId();
149 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
153 $cms_data->getCmsId());
156 $GLOBALS[
'ilLog']->write(__METHOD__.
': cms tree node not imported. tnode_id: '. $a_tnode_id);
160 $GLOBALS[
'ilLog']->write(__METHOD__.
' parent ref:'.$a_parent_ref_id.
' tnode:'. $a_tnode_id);
162 $import_ref_id = end($ref_ids);
163 $import_ref_id_parent = $tree->getParentId($import_ref_id);
165 if($a_parent_ref_id != $import_ref_id_parent)
168 $GLOBALS[
'ilLog']->write(__METHOD__.
': Moving node '.$a_parent_ref_id.
' to '.$import_ref_id);
169 $tree->moveTree($import_ref_id,$a_parent_ref_id);
173 $childs = $this->
getTree()->getChilds($a_tnode_id);
174 foreach((
array) $childs as $node)
186 protected function syncNode($tree_obj_id,$parent_id,$a_mapped =
false)
188 $childs = $this->
getTree()->getChilds($tree_obj_id);
196 if($assignment->getRefId())
198 $parent_id = $assignment->getRefId();
202 if($assignment->isMapped())
209 $parent_id = $this->
syncCategory($assignment,$parent_id);
216 foreach($childs as $node)
218 $this->
syncNode($node[
'child'],$parent_id,$a_mapped);
230 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
236 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
248 if(($cat instanceof
ilObject)
and $this->default_settings[
'title_update'])
250 $GLOBALS[
'ilLog']->write(__METHOD__.
': Updating cms category ');
251 $GLOBALS[
'ilLog']->write(__METHOD__.
': Title is '.
$data->getTitle());
252 $cat->deleteTranslation(
$GLOBALS[
'lng']->getDefaultLanguage());
253 $cat->addTranslation(
255 $cat->getLongDescription(),
256 $GLOBALS[
'lng']->getDefaultLanguage(),
259 $cat->setTitle(
$data->getTitle());
264 $GLOBALS[
'ilLog']->write(__METHOD__.
': Updating cms category -> nothing to do');
270 $GLOBALS[
'ilLog']->write(__METHOD__.
': Creating new cms category');
273 include_once
'./Modules/Category/classes/class.ilObjCategory.php';
275 $cat->setOwner(SYSTEM_USER_ID);
276 $cat->setTitle(
$data->getTitle());
278 $cat->createReference();
279 $cat->putInTree($parent_id);
280 $cat->setPermissions($parent_id);
281 $cat->deleteTranslation(
$GLOBALS[
'lng']->getDEfaultLanguage());
282 $cat->addTranslation(
284 $cat->getLongDescription(),
285 $GLOBALS[
'lng']->getDefaultLanguage(),
294 $import->
setMID($this->mid);
295 $import->setContentId(
$data->getCmsId());
296 $import->setImported(
true);
299 return $cat->getRefId();
303 $GLOBALS[
'ilLog']->write(__METHOD__.
': Creation of empty containers is disabled.');
static lookupRootId($a_tree_id)
lookup root id
Class ilObject Basic functions for all objects.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
__construct(ilECSSetting $server, $mid, $tree_id)
Constructor.
static getInstanceByServerMid($a_server_id, $a_mid)
Get instance.
checkTreeUpdates($a_root_obj_id)
Start tree update check.
syncCategory(ilECSNodeMappingAssignment $ass, $parent_id)
Sync category.
static lookupObjIdByContentId($a_server_id, $a_mid, $a_content_id, $a_sub_id=null)
Lookup obj_id by content id.
static _getAllReferences($a_id)
get all reference ids of object
getDefaultSettings()
Get default settings.
Storage of ECS imported objects.
Create styles array
The data for the language used.
handleTreeUpdate($a_parent_ref_id, $a_tnode_id)
Handle tree update (recursively)
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
syncNode($tree_obj_id, $parent_id, $a_mapped=false)
Sync node.
static lookupSettings($a_server_id, $a_mid, $a_tree_id, $a_node_id)
Lookup Settings.
getGlobalSettings()
get global settings