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'));
172 $off =
new ilRadioOption($lng->txt(
'ecs_'.$a_type.
'_export_disabled'),0);
173 $exp->addOption($off);
174 $on =
new ilRadioOption($lng->txt(
'ecs_'.$a_type.
'_export_enabled'),1);
175 $exp->addOption($on);
185 $receivers =
array();
186 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
191 $participants = null;
196 $participants = $details->getReceivers();
200 foreach($participants as $mid)
202 $receivers[] = $sid.
'_'.$mid;
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);
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');
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'),
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);
This class represents an option in a radio group.
static getInstanceByServerId($a_server_id)
Get singleton instance.
handleContentUpdate()
Update ECS Content.
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
getParticipants($a_server_id, $a_econtent_id)
Get participants for server and ecs resource.
Representation of ECS EContent Time Place.
static _getOperationIdsByName($operations)
get ops_id's by name.
getServerId()
Get current server id.
static getExportableParticipants($a_type)
Get participants which are enabled and export is allowed.
Storage of ECS exported objects.
static _getStaticLink($a_ref_id, $a_type='', $a_fallback_goto=true, $append="")
Get static link.
doUpdate(ilECSSetting $a_server, ilECSExport $a_export_settings, array $a_mids=null)
Update ECS resource.
isActive()
Is ECS (for current object) active?
getApprovalRecipientsAsString()
get approval recipients as string
static _handleDelete(array $a_subbtree_nodes)
handle delete Objects that are moved to the trash call ECS-Remove
setExported($a_status)
Set exported.
static getInstance()
Get singleton instance.
Class ilObject Basic functions for all objects.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Add rich text string
The name of the decorator.
handleSettingsForServer(ilECSSetting $a_server, $a_export, $a_mids)
Save ECS settings (add- update- deleteResource)
Presentation of ecs content details (http://...campusconnect/courselinks/id/details) ...
getECSObjectType()
Get ECS resource identifier, e.g.
__construct(ilObject $a_content_object)
Constructor.
Class ilECSLearningModuleSettings.
getContentObject()
Get content object.
static _getLanguage($a_lang_key='')
Get langauge object.
static getExportedIds()
Get exported ids ilDB $ilDB.
static getExportServerIds($a_obj_id)
lookup server ids of exported materials ilDB $ilDB
static getInstanceByObject(ilObject $a_content_obj)
Get settings handler for repository object.
addMetadataToJson(&$a_json, ilECSSetting $a_server, array $a_definition)
Add advanced metadata to json (export)
sendNewContentNotification(ilECSSetting $a_server, $a_econtent_id)
send notifications about new EContent
isExported()
check if an object is exported or not
getEContentId()
get econtent id
static getAdvancedMDValuesForObjId($a_obj_id)
Get advanced metadata values for object id.
Class ilECSGroupSettings.
This class handles base functions for mail handling.
handlePermissionUpdate(ilECSSetting $server)
Handle permission update.
doAdd(ilECSSetting $a_server, ilECSExport $a_export_settings, array $a_mids)
Add resource to ECS.
static _isExported($a_obj_id)
Check if object is exported.
buildJson(ilECSSetting $a_server)
Build resource-specific json.
getType()
get object type public
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
getGlobalRole()
get global role
handleSettingsUpdate()
Update ECS Export Settings.
getJsonCore($a_etype)
Build core json structure.
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
setEContentId($a_id)
set econtent id
Class ilECSCategorySettings.
getApprovalRecipients()
get approval recipients
Handles object exports to ECS.
addSettingsToForm(ilPropertyFormGUI $a_form, $a_type)
Fill ECS export settings "multiple servers".
static getInstance($a_server_id, $a_econtent_id, $a_resource_type)
Get data from server.
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
doDelete(ilECSSetting $a_server, ilECSExport $a_export_settings)
Delete ECS resource.
Class ilECSGlossarySettings.
static getExportServers()
Get server ids which allow an export <type> $ilDB.
Class ilECSCourseSettings.