5 include_once
'./Services/WebServices/ECS/interfaces/interface.ilECSCommandQueueHandler.php';
28 $this->log =
$GLOBALS[
'DIC']->logger()->wsrv();
51 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
52 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
53 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSDirectoryTreeConnector.php';
55 $this->log->debug(
'ECS cms tree create');
61 $res = $dir_reader->getDirectoryTree($a_content_id);
62 $nodes =
$res->getResult();
71 $this->log->error(
'Tree creation failed with mesage ' . $e->getMessage());
78 $data->setMid($this->mid);
79 $data->setCmsId($cms_tree->rootID);
80 $data->setTreeId($a_content_id);
81 $data->setTitle($cms_tree->directoryTreeTitle);
82 $data->setTerm($cms_tree->term);
86 $tree->insertRootNode($a_content_id,
$data->getObjId());
87 $tree->setRootId(
$data->getObjId());
90 foreach((
array) $cms_tree->nodes as $node)
95 $data->setMid($this->mid);
96 $data->setCmsId($node->id);
97 $data->setTreeId($a_content_id);
98 $data->setTitle($node->title);
99 $data->setTerm($node->term);
103 if($node->parent->id)
111 $tree->insertNode(
$data->getObjId(), $parent_id);
124 $this->log->debug(
'ECS cms tree delete');
126 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
129 $data->setMid($this->mid);
130 $data->setTreeId($a_content_id);
133 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
137 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
153 $this->log->debug(
'ECS cms tree update');
165 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSDirectoryTreeConnector.php';
167 $res = $dir_reader->getDirectoryTree($a_content_id);
168 $nodes =
$res->getResult();
177 $GLOBALS[
'ilLog']->write(__METHOD__.
': Tree creation failed with mesage ' . $e->getMessage());
182 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
187 $old_nodes =
array();
188 if($root_node[
'child'])
190 $old_nodes = $tree->getSubTree($root_node,
true);
195 $this->log->debug(
'Old tree data... ');
203 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
223 $data->setMid($this->mid);
224 $data->setCmsId($cms_tree->rootID);
225 $data->setTreeId($a_content_id);
226 $data->setTitle($cms_tree->directoryTreeTitle);
227 $data->setTerm($cms_tree->term);
231 $data->setDeleted(
false);
239 $tree->insertRootNode($a_content_id,
$data->getObjId());
240 $tree->setRootId(
$data->getObjId());
243 foreach((
array) $cms_tree->nodes as $node)
254 $data->setTitle($node->title);
255 $data->setTerm($node->term);
256 $data->setDeleted(
false);
264 $data->setCmsId($node->id);
265 $data->setMid($this->mid);
267 $data->setTreeId($a_content_id);
268 $data->setDeleted(
false);
271 $data_obj_id =
$data->getObjId();
281 $tree->insertNode(
$data->getObjId(), $parent_id);
291 foreach((
array) $deleted as $obj_id)
294 foreach((
array) $old_nodes as $tmp_id => $node)
297 if($node[
'child'] == $obj_id)
299 $parent = $node[
'parent'];
304 if($tree->isInTree($parent)
and $parent)
306 $tree->insertNode($obj_id, $parent);
311 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTreeSynchronizer.php';
327 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
static writeAllDeleted($a_server_id, $a_mid, $a_tree_id, $a_deleted_flag)
Write deleted status.
static lookupObjId($a_server_id, $a_mid, $a_tree_id, $cms_id)
getServerId()
Get current server id.
static lookupRootId($a_tree_id)
lookup root id
handleDelete(ilECSSetting $server, $a_content_id)
Handle delete.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static deleteMappings($a_server_id, $a_mid, $a_tree_id)
Delete mappings $ilDB $ilDB.
handleUpdate(ilECSSetting $server, $a_content_id)
Handle update.
Interface for all command queue handler classes.
handleCreate(ilECSSetting $server, $a_content_id)
Handle create.
Create styles array
The data for the language used.
static loookupCmsMid($a_server_id)
Lookup mid of current cms participant $ilDB.
static findDeletedNodes($a_server_id, $a_mid, $a_tree_id)
Find deleted nodes Uses a left join since this is more robust.
static deleteByTreeId($a_tree_id)
Delete tree by tree_id.
__construct(ilECSSetting $server)
Constructor.