34 $this->logger =
$GLOBALS[
'DIC']->logger()->obj();
35 $this->content_obj = $a_content_object;
46 switch($a_content_obj->
getType())
49 include_once
'Modules/Course/classes/class.ilECSCourseSettings.php';
53 include_once
'Modules/Category/classes/class.ilECSCategorySettings.php';
57 include_once
'Modules/File/classes/class.ilECSFileSettings.php';
61 include_once
'Modules/Glossary/classes/class.ilECSGlossarySettings.php';
65 include_once
'Modules/Group/classes/class.ilECSGroupSettings.php';
69 include_once
'Modules/LearningModule/classes/class.ilECSLearningModuleSettings.php';
73 include_once
'Modules/Wiki/classes/class.ilECSWikiSettings.php';
101 include_once(
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php');
105 #include_once('./Services/WebServices/ECS/classes/class.ilECSImport.php');
106 #if(!ilECSImport::lookupServerId($this->content_obj->getId()))
126 $this->logger->debug(
'Show ecs settings.');
129 $this->logger->debug(
'Object type is not active. => no settings.');
133 $obj_id = $this->content_obj->getId();
136 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
137 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
141 $this->logger->debug(
'Called withot references. => no settings.');
148 $this->logger->debug(
'Object type is not exportable. => no settings.');
156 $this->logger->debug(
'Parent crs/grp in path. => no settings.');
160 $lng->loadLanguageModule(
'ecs');
164 $ecs->setTitle(
$lng->txt(
'ecs_'.$a_type.
'_export'));
170 $exp->setRequired(
true);
173 $exp->addOption($off);
175 $exp->addOption($on);
185 $receivers = array();
186 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
191 $participants =
null;
193 $this->getECSObjectType());
196 $participants = $details->getReceivers();
200 foreach($participants as $mid)
202 $receivers[] = $sid.
'_'.$mid;
206 $publish_for->setValue($receivers);
208 foreach($exportablePart as $pInfo)
210 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
214 $partSetting->getCommunityName().
': '.$partSetting->getTitle(),
217 $com->setValue($pInfo[
'sid'].
'_'.$pInfo[
'mid']);
218 $publish_for->addOption($com);
220 $on->addSubItem($publish_for);
241 foreach((array)
$_POST[
'ecs_sid'] as $sid_mid)
243 $tmp = explode(
'_',$sid_mid);
244 $mids[$tmp[0]][] = $tmp[1];
249 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
250 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
251 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
265 if(!count($mids[$server_id]))
297 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
301 if($export_settings->isExported())
306 $this->
doUpdate($a_server, $export_settings, $a_mids);
311 $this->
doDelete($a_server, $export_settings);
320 $this->
doAdd($a_server, $export_settings, $a_mids);
351 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
353 foreach($export_servers as $server_id)
355 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
361 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
362 $export_settings =
new ilECSExport($server_id, $this->content_obj->getId());
365 if($export_settings->isExported())
377 $ilLog->write(__METHOD__.
': Cannot handle ECS content update. '.$exc->getMessage());
396 $ilLog->write(__METHOD__.
': Starting ECS add resource...');
400 include_once
'Services/WebServices/ECS/classes/class.ilECSConnector.php';
409 $a_export_settings->
save();
429 include_once
'Services/WebServices/ECS/classes/class.ilECSConnector.php';
434 $ilLog->write(__METHOD__.
': Missing eid. Aborting.');
443 $ilLog->write(__METHOD__.
': Start updating ECS content - '.print_r($a_mids,
true));
448 $econtent_id, json_encode($json));
468 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
469 include_once
'./Services/WebServices/ECS/classes/class.ilECSConnector.php';
474 $ilLog->write(__METHOD__.
': Missing eid. Aborting.');
479 $ilLog->write(__METHOD__.
': Start deleting ECS content...');
485 $a_export_settings->
save();
499 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
505 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
506 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php' ;
508 foreach($a_subbtree_nodes as $node)
510 if(in_array($node[
'obj_id'],$exported))
521 $settings->doDelete(
$server, $export_settings);
537 $receivers = array();
538 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
539 foreach((array) $a_server_id as $sid)
541 $participants =
null;
545 $participants = $details->getReceivers();
549 foreach($participants as $mid)
555 return (array) $receivers;
572 include_once(
'./Services/Mail/classes/class.ilMail.php');
573 include_once(
'./Services/Language/classes/class.ilLanguageFactory.php');
576 $lang->loadLanguageModule(
'ecs');
579 $mail =
new ilMail(self::MAIL_SENDER);
580 $message =
$lang->txt(
'ecs_export_created_body_a').
"\n\n";
581 $message .=
$lang->txt(
'title').
': '.$this->content_obj->getTitle().
"\n";
582 if(strlen($desc = $this->content_obj->getDescription()))
584 $message .=
$lang->txt(
'desc').
': '.$desc.
"\n";
588 $message .= (
"\n".$lang->txt(
'ecs_published_for'));
595 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
597 $a_econtent_id, $this->getECSObjectType());
600 $receivers = $details->getReceivers();
604 foreach($receivers as $member)
608 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
611 $message .= (
"\n\n".$part->getParticipantName().
"\n");
612 $message .= ($part->getDescription());
621 $message .= (
' '.$lang->txt(
'ecs_not_published').
"\n\n");
626 $ilLog->write(__METHOD__.
': Cannot read approvements.');
630 include_once(
'./Services/Link/classes/class.ilLink.php');
632 $message .=
$lang->txt(
"perma_link").
': '.$href.
"\n\n";
633 $message .= ilMail::_getAutoGeneratedMessageString();
637 $lang->txt(
'ecs_new_approval_subject'),
638 $message,array(),array(
'normal'));
650 ($this->content_obj->getType() ==
'crs') ||
651 ($this->content_obj->getType() ==
'grp')
654 $GLOBALS[
'ilLog']->write(__METHOD__.
': Permission update for courses/groups');
655 $GLOBALS[
'rbacadmin']->grantPermission(
658 $this->content_obj->getRefId()
671 $json =
new stdClass();
672 $json->lang =
'en_EN';
674 $json->etype = $a_etype;
675 $json->title = $this->content_obj->getTitle();
676 $json->abstract = $this->content_obj->getLongDescription();
678 include_once(
'./Services/Link/classes/class.ilLink.php');
679 $json->url =
ilLink::_getLink($this->content_obj->getRefId(),$this->content_obj->getType());
693 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
694 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
695 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
698 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
701 foreach($a_definition as $id => $type)
715 $value = isset($values[$field]) ? $values[$field] :
'';
720 $a_json->$target = explode(
',', $value);
724 $a_json->$target = (int)$value;
728 $a_json->$target = (string)$value;
732 if(!isset($a_json->$target))
734 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTimePlace.php');
737 $a_json->$target->{
'set'.ucfirst($id)}($value);
An exception for terminatinating execution or to throw for unit testing.
Class ilECSCategorySettings.
Class ilECSCourseSettings.
static getInstanceByServerId($a_server_id)
Get singleton instance.
Presentation of ecs content details (http://...campusconnect/courselinks/id/details)
static getInstance($a_server_id, $a_econtent_id, $a_resource_type)
Get data from server.
Storage of ECS exported objects.
getEContentId()
get econtent id
static getExportedIds()
Get exported ids @global ilDB $ilDB.
setExported($a_status)
Set exported.
isExported()
check if an object is exported or not
static _isExported($a_obj_id)
Check if object is exported.
static getExportServerIds($a_obj_id)
lookup server ids of exported materials @global ilDB $ilDB
setEContentId($a_id)
set econtent id
Class ilECSGlossarySettings.
Class ilECSGroupSettings.
Class ilECSLearningModuleSettings.
Handles object exports to ECS.
getContentObject()
Get content object.
doUpdate(ilECSSetting $a_server, ilECSExport $a_export_settings, array $a_mids=null)
Update ECS resource.
static getInstanceByObject(ilObject $a_content_obj)
Get settings handler for repository object.
getJsonCore($a_etype)
Build core json structure.
sendNewContentNotification(ilECSSetting $a_server, $a_econtent_id)
send notifications about new EContent
isActive()
Is ECS (for current object) active?
static _handleDelete(array $a_subbtree_nodes)
addMetadataToJson(&$a_json, ilECSSetting $a_server, array $a_definition)
Add advanced metadata to json (export)
handlePermissionUpdate(ilECSSetting $server)
Handle permission update.
doAdd(ilECSSetting $a_server, ilECSExport $a_export_settings, array $a_mids)
Add resource to ECS.
addSettingsToForm(ilPropertyFormGUI $a_form, $a_type)
Fill ECS export settings "multiple servers".
handleSettingsUpdate()
Update ECS Export Settings.
getECSObjectType()
Get ECS resource identifier, e.g.
doDelete(ilECSSetting $a_server, ilECSExport $a_export_settings)
Delete ECS resource.
handleSettingsForServer(ilECSSetting $a_server, $a_export, $a_mids)
Save ECS settings (add- update- deleteResource)
getParticipants($a_server_id, $a_econtent_id)
Get participants for server and ecs resource.
buildJson(ilECSSetting $a_server)
Build resource-specific json.
handleContentUpdate()
Update ECS Content.
__construct(ilObject $a_content_object)
Constructor.
static getExportServers()
Get server ids which allow an export @global <type> $ilDB.
static getExportableParticipants($a_type)
Get participants which are enabled and export is allowed.
static getInstance()
Get singleton instance.
getServerId()
Get current server id.
getApprovalRecipientsAsString()
get approval recipients as string
getApprovalRecipients()
get approval recipients
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
Representation of ECS EContent Time Place.
static getAdvancedMDValuesForObjId($a_obj_id)
Get advanced metadata values for object id.
static _getLanguage($a_lang_key='')
Get langauge object.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
This class handles base functions for mail handling.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Class ilObject Basic functions for all objects.
getType()
get object type @access public
This class represents an option in a radio group.
static _getOperationIdsByName($operations)
get ops_id's by name.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang