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');
60 $res = $dir_reader->getDirectoryTree($a_content_id);
61 $nodes =
$res->getResult();
67 $this->log->error(
'Tree creation failed with mesage ' . $e->getMessage());
74 $data->setMid($this->mid);
75 $data->setCmsId($cms_tree->rootID);
76 $data->setTreeId($a_content_id);
77 $data->setTitle($cms_tree->directoryTreeTitle);
78 $data->setTerm($cms_tree->term);
82 $tree->insertRootNode($a_content_id,
$data->getObjId());
83 $tree->setRootId(
$data->getObjId());
86 foreach ((
array) $cms_tree->nodes as $node) {
90 $data->setMid($this->mid);
91 $data->setCmsId($node->id);
92 $data->setTreeId($a_content_id);
93 $data->setTitle($node->title);
94 $data->setTerm($node->term);
98 if ($node->parent->id) {
105 $tree->insertNode(
$data->getObjId(), $parent_id);
118 $this->log->debug(
'ECS cms tree delete');
120 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
123 $data->setMid($this->mid);
124 $data->setTreeId($a_content_id);
127 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
131 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignments.php';
147 $this->log->debug(
'ECS cms tree update');
158 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSDirectoryTreeConnector.php';
160 $res = $dir_reader->getDirectoryTree($a_content_id);
161 $nodes =
$res->getResult();
166 $GLOBALS[
'ilLog']->write(__METHOD__ .
': Tree creation failed with mesage ' . $e->getMessage());
171 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
176 $old_nodes =
array();
177 if ($root_node[
'child']) {
178 $old_nodes = $tree->getSubTree($root_node,
true);
182 $this->log->debug(
'Old tree data... ');
190 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
210 $data->setMid($this->mid);
211 $data->setCmsId($cms_tree->rootID);
212 $data->setTreeId($a_content_id);
213 $data->setTitle($cms_tree->directoryTreeTitle);
214 $data->setTerm($cms_tree->term);
217 $data->setDeleted(
false);
223 $tree->insertRootNode($a_content_id,
$data->getObjId());
224 $tree->setRootId(
$data->getObjId());
227 foreach ((
array) $cms_tree->nodes as $node) {
237 $data->setTitle($node->title);
238 $data->setTerm($node->term);
239 $data->setDeleted(
false);
244 $data->setCmsId($node->id);
245 $data->setMid($this->mid);
247 $data->setTreeId($a_content_id);
248 $data->setDeleted(
false);
251 $data_obj_id =
$data->getObjId();
261 $tree->insertNode(
$data->getObjId(), $parent_id);
271 foreach ((
array) $deleted as $obj_id) {
273 foreach ((
array) $old_nodes as $tmp_id => $node) {
274 if ($node[
'child'] == $obj_id) {
275 $parent = $node[
'parent'];
280 if ($tree->isInTree($parent) and $parent) {
281 $tree->insertNode($obj_id, $parent);
286 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTreeSynchronizer.php';
302 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.
foreach($_POST as $key=> $value) $res
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.