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';
92 $GLOBALS[
'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[
'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) {
146 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
150 $cms_data->getCmsId()
152 if (!$import_obj_id) {
153 $GLOBALS[
'ilLog']->write(__METHOD__ .
': cms tree node not imported. tnode_id: ' . $a_tnode_id);
157 $GLOBALS[
'ilLog']->write(__METHOD__ .
' parent ref:' . $a_parent_ref_id .
' tnode:' . $a_tnode_id);
159 $import_ref_id = end($ref_ids);
160 $import_ref_id_parent = $tree->getParentId($import_ref_id);
162 if ($a_parent_ref_id != $import_ref_id_parent) {
164 $GLOBALS[
'ilLog']->write(__METHOD__ .
': Moving node ' . $a_parent_ref_id .
' to ' . $import_ref_id);
165 $tree->moveTree($import_ref_id, $a_parent_ref_id);
169 $childs = $this->
getTree()->getChilds($a_tnode_id);
170 foreach ((
array) $childs as $node) {
181 protected function syncNode($tree_obj_id, $parent_id, $a_mapped =
false)
183 $childs = $this->
getTree()->getChilds($tree_obj_id);
192 if ($assignment->getRefId()) {
193 $parent_id = $assignment->getRefId();
197 if ($assignment->isMapped()) {
202 $parent_id = $this->
syncCategory($assignment, $parent_id);
209 foreach ($childs as $node) {
210 $this->
syncNode($node[
'child'], $parent_id, $a_mapped);
222 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
228 include_once
'./Services/WebServices/ECS/classes/class.ilECSImport.php';
236 $ref_id = end($refs);
240 if (($cat instanceof
ilObject) and $this->default_settings[
'title_update']) {
241 $GLOBALS[
'ilLog']->write(__METHOD__ .
': Updating cms category ');
242 $GLOBALS[
'ilLog']->write(__METHOD__ .
': Title is ' .
$data->getTitle());
243 $cat->deleteTranslation(
$GLOBALS[
'lng']->getDefaultLanguage());
244 $cat->addTranslation(
246 $cat->getLongDescription(),
247 $GLOBALS[
'lng']->getDefaultLanguage(),
250 $cat->setTitle(
$data->getTitle());
253 $GLOBALS[
'ilLog']->write(__METHOD__ .
': Updating cms category -> nothing to do');
257 $GLOBALS[
'ilLog']->write(__METHOD__ .
': Creating new cms category');
260 include_once
'./Modules/Category/classes/class.ilObjCategory.php';
262 $cat->setOwner(SYSTEM_USER_ID);
263 $cat->setTitle(
$data->getTitle());
265 $cat->createReference();
266 $cat->putInTree($parent_id);
267 $cat->setPermissions($parent_id);
268 $cat->deleteTranslation(
$GLOBALS[
'lng']->getDEfaultLanguage());
269 $cat->addTranslation(
271 $cat->getLongDescription(),
272 $GLOBALS[
'lng']->getDefaultLanguage(),
281 $import->
setMID($this->mid);
282 $import->setContentId(
$data->getCmsId());
283 $import->setImported(
true);
286 return $cat->getRefId();
288 $GLOBALS[
'ilLog']->write(__METHOD__ .
': Creation of empty containers is disabled.');
static lookupRootId($a_tree_id)
lookup root id
$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