26 $this->content_obj = $a_content_object;
37 switch($a_content_obj->
getType())
40 include_once
'Modules/Course/classes/class.ilECSCourseSettings.php';
44 include_once
'Modules/Category/classes/class.ilECSCategorySettings.php';
48 include_once
'Modules/File/classes/class.ilECSFileSettings.php';
52 include_once
'Modules/Glossary/classes/class.ilECSGlossarySettings.php';
56 include_once
'Modules/Group/classes/class.ilECSGroupSettings.php';
60 include_once
'Modules/LearningModule/classes/class.ilECSLearningModuleSettings.php';
64 include_once
'Modules/Wiki/classes/class.ilECSWikiSettings.php';
92 include_once(
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php');
96 include_once(
'./Services/WebServices/ECS/classes/class.ilECSImport.php');
122 $obj_id = $this->content_obj->getId();
125 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
126 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
141 $lng->loadLanguageModule(
'ecs');
145 $ecs->setTitle($lng->txt(
'ecs_'.$a_type.
'_export'));
153 $off =
new ilRadioOption($lng->txt(
'ecs_'.$a_type.
'_export_disabled'),0);
154 $exp->addOption($off);
155 $on =
new ilRadioOption($lng->txt(
'ecs_'.$a_type.
'_export_enabled'),1);
156 $exp->addOption($on);
166 $receivers = array();
167 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
172 $participants = null;
177 $participants = $details->getReceivers();
181 foreach($participants as $mid)
183 $receivers[] = $sid.
'_'.$mid;
189 foreach($exportablePart as $pInfo)
191 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
195 $partSetting->getCommunityName().
': '.$partSetting->getTitle(),
198 $com->
setValue($pInfo[
'sid'].
'_'.$pInfo[
'mid']);
199 $publish_for->addOption($com);
201 $on->addSubItem($publish_for);
222 foreach((array)
$_POST[
'ecs_sid'] as $sid_mid)
224 $tmp = explode(
'_',$sid_mid);
225 $mids[$tmp[0]][] = $tmp[1];
230 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
231 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
232 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
246 if(!count($mids[$server_id]))
278 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
282 if($export_settings->isExported())
287 $this->
doUpdate($a_server, $export_settings, $a_mids);
292 $this->
doDelete($a_server, $export_settings);
301 $this->
doAdd($a_server, $export_settings, $a_mids);
332 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
334 foreach($export_servers as $server_id)
336 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
342 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
343 $export_settings =
new ilECSExport($server_id, $this->content_obj->getId());
346 if($export_settings->isExported())
358 $ilLog->write(__METHOD__.
': Cannot handle ECS content update. '.$exc->getMessage());
377 $ilLog->write(__METHOD__.
': Starting ECS add resource...');
381 include_once
'Services/WebServices/ECS/classes/class.ilECSConnector.php';
390 $a_export_settings->
save();
410 include_once
'Services/WebServices/ECS/classes/class.ilECSConnector.php';
415 $ilLog->write(__METHOD__.
': Missing eid. Aborting.');
424 $ilLog->write(__METHOD__.
': Start updating ECS content - '.print_r($a_mids,
true));
429 $econtent_id, json_encode($json));
449 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
450 include_once
'./Services/WebServices/ECS/classes/class.ilECSConnector.php';
455 $ilLog->write(__METHOD__.
': Missing eid. Aborting.');
460 $ilLog->write(__METHOD__.
': Start deleting ECS content...');
466 $a_export_settings->
save();
480 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
486 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
487 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php' ;
489 foreach($a_subbtree_nodes as $node)
491 if(in_array($node[
'obj_id'],$exported))
502 $settings->doDelete(
$server, $export_settings);
518 $receivers = array();
519 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
520 foreach((array) $a_server_id as $sid)
522 $participants = null;
526 $participants = $details->getReceivers();
530 foreach($participants as $mid)
536 return (array) $receivers;
553 include_once(
'./Services/Mail/classes/class.ilMail.php');
554 include_once(
'./Services/Language/classes/class.ilLanguageFactory.php');
557 $lang->loadLanguageModule(
'ecs');
560 $mail =
new ilMail(self::MAIL_SENDER);
561 $message =
$lang->txt(
'ecs_export_created_body_a').
"\n\n";
562 $message .=
$lang->txt(
'title').
': '.$this->content_obj->getTitle().
"\n";
563 if(strlen($desc = $this->content_obj->getDescription()))
565 $message .=
$lang->txt(
'desc').
': '.$desc.
"\n";
569 $message .= (
"\n".$lang->txt(
'ecs_published_for'));
576 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
581 $receivers = $details->getReceivers();
585 foreach($receivers as $member)
589 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
592 $message .= (
"\n\n".$part->getParticipantName().
"\n");
593 $message .= ($part->getDescription());
602 $message .= (
' '.$lang->txt(
'ecs_not_published').
"\n\n");
607 $ilLog->write(__METHOD__.
': Cannot read approvements.');
611 include_once(
'./Services/Link/classes/class.ilLink.php');
613 $message .=
$lang->txt(
"perma_link").
': '.$href.
"\n\n";
618 $lang->txt(
'ecs_new_approval_subject'),
619 $message,array(),array(
'normal'));
626 if($this->content_obj->getType() ==
'crs')
628 $GLOBALS[
'ilLog']->write(__METHOD__.
': Permission update');
629 if($this->content_obj->getType() ==
'crs')
631 $GLOBALS[
'rbacadmin']->grantPermission(
634 $this->content_obj->getRefId()
648 $json =
new stdClass();
649 $json->lang =
'en_EN';
651 $json->etype = $a_etype;
652 $json->title = $this->content_obj->getTitle();
653 $json->abstract = $this->content_obj->getLongDescription();
655 include_once(
'./Services/Link/classes/class.ilLink.php');
656 $json->url =
ilLink::_getLink($this->content_obj->getRefId(),$this->content_obj->getType());
670 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
671 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
672 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
676 foreach($a_definition as $id => $type)
690 $value = isset($values[$field]) ? $values[$field] :
'';
695 $a_json->$target = explode(
',', $value);
699 $a_json->$target = (int)$value;
703 $a_json->$target = (string)$value;
707 if(!isset($a_json->$target))
709 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTimePlace.php');
712 $a_json->$target->{
'set'.ucfirst($id)}($value);
725 abstract protected function buildJson(
ilECSSetting $a_server);