34 $this->logger =
$GLOBALS[
'DIC']->logger()->obj();
35 $this->content_obj = $a_content_object;
46 switch ($a_content_obj->
getType()) {
48 include_once
'Modules/Course/classes/class.ilECSCourseSettings.php';
52 include_once
'Modules/Category/classes/class.ilECSCategorySettings.php';
56 include_once
'Modules/File/classes/class.ilECSFileSettings.php';
60 include_once
'Modules/Glossary/classes/class.ilECSGlossarySettings.php';
64 include_once
'Modules/Group/classes/class.ilECSGroupSettings.php';
68 include_once
'Modules/LearningModule/classes/class.ilECSLearningModuleSettings.php';
72 include_once
'Modules/Wiki/classes/class.ilECSWikiSettings.php';
100 include_once(
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php');
103 #include_once('./Services/WebServices/ECS/classes/class.ilECSImport.php');
104 #if(!ilECSImport::lookupServerId($this->content_obj->getId()))
124 $this->logger->debug(
'Show ecs settings.');
126 $this->logger->debug(
'Object type is not active. => no settings.');
130 $obj_id = $this->content_obj->getId();
133 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
134 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
137 $this->logger->debug(
'Called withot references. => no settings.');
143 $this->logger->debug(
'Object type is not exportable. => no settings.');
150 $this->logger->debug(
'Parent crs/grp in path. => no settings.');
154 $lng->loadLanguageModule(
'ecs');
158 $ecs->setTitle(
$lng->txt(
'ecs_' .
$a_type .
'_export'));
164 $exp->setRequired(
true);
167 $exp->addOption($off);
169 $exp->addOption($on);
179 $receivers = array();
180 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
184 $participants =
null;
187 $exp->getEContentId(),
188 $this->getECSObjectType()
191 $participants = $details->getReceivers();
194 foreach ($participants as $mid) {
195 $receivers[] = $sid .
'_' . $mid;
199 $publish_for->setValue($receivers);
201 foreach ($exportablePart as $pInfo) {
202 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
206 $partSetting->getCommunityName() .
': ' . $partSetting->getTitle(),
209 $com->setValue($pInfo[
'sid'] .
'_' . $pInfo[
'mid']);
210 $publish_for->addOption($com);
212 $on->addSubItem($publish_for);
232 foreach ((array)
$_POST[
'ecs_sid'] as $sid_mid) {
233 $tmp = explode(
'_', $sid_mid);
234 $mids[$tmp[0]][] = $tmp[1];
238 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
239 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
240 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
248 if (!
$_POST[
'ecs_export']) {
251 if (!count($mids[$server_id])) {
279 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
283 if ($export_settings->isExported()) {
285 if ((
bool) $a_export) {
286 $this->
doUpdate($a_server, $export_settings, $a_mids);
290 $this->
doDelete($a_server, $export_settings);
297 $this->
doAdd($a_server, $export_settings, $a_mids);
323 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
325 foreach ($export_servers as $server_id) {
326 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
330 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
331 $export_settings =
new ilECSExport($server_id, $this->content_obj->getId());
334 if ($export_settings->isExported()) {
341 $ilLog->write(__METHOD__ .
': Cannot handle ECS content update. ' . $exc->getMessage());
360 $ilLog->write(__METHOD__ .
': Starting ECS add resource...');
364 include_once
'Services/WebServices/ECS/classes/class.ilECSConnector.php';
367 $econtent_id = $connector->addResource(
375 $a_export_settings->
save();
395 include_once
'Services/WebServices/ECS/classes/class.ilECSConnector.php';
399 $ilLog->write(__METHOD__ .
': Missing eid. Aborting.');
407 $ilLog->write(__METHOD__ .
': Start updating ECS content - ' . print_r($a_mids,
true));
411 $connector->updateResource(
434 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
435 include_once
'./Services/WebServices/ECS/classes/class.ilECSConnector.php';
439 $ilLog->write(__METHOD__ .
': Missing eid. Aborting.');
444 $ilLog->write(__METHOD__ .
': Start deleting ECS content...');
445 $connector->deleteResource(
452 $a_export_settings->
save();
466 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
471 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
472 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php' ;
474 foreach ($a_subbtree_nodes as $node) {
475 if (in_array($node[
'obj_id'], $exported)) {
483 $settings->doDelete(
$server, $export_settings);
499 $receivers = array();
500 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
501 foreach ((array) $a_server_id as $sid) {
502 $participants =
null;
505 $participants = $details->getReceivers();
508 foreach ($participants as $mid) {
513 return (array) $receivers;
529 include_once(
'./Services/Mail/classes/class.ilMail.php');
530 include_once(
'./Services/Language/classes/class.ilLanguageFactory.php');
533 $lang->loadLanguageModule(
'ecs');
536 $mail =
new ilMail(self::MAIL_SENDER);
538 $message .=
$lang->txt(
'title') .
': ' . $this->content_obj->getTitle() .
"\n";
539 if (strlen($desc = $this->content_obj->getDescription())) {
550 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
554 $this->getECSObjectType()
557 $receivers = $details->getReceivers();
560 foreach ($receivers as $member) {
563 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
566 $message .= (
"\n\n" . $part->getParticipantName() .
"\n");
567 $message .= ($part->getDescription());
573 $message .= (
' ' .
$lang->txt(
'ecs_not_published') .
"\n\n");
576 $ilLog->write(__METHOD__ .
': Cannot read approvements.');
580 include_once(
'./Services/Link/classes/class.ilLink.php');
582 $message .=
$lang->txt(
"perma_link") .
': ' . $href .
"\n\n";
589 $lang->txt(
'ecs_new_approval_subject'),
605 ($this->content_obj->getType() ==
'crs') ||
606 ($this->content_obj->getType() ==
'grp')
608 $GLOBALS[
'ilLog']->write(__METHOD__ .
': Permission update for courses/groups');
609 $GLOBALS[
'rbacadmin']->grantPermission(
612 $this->content_obj->getRefId()
625 $json =
new stdClass();
626 $json->lang =
'en_EN';
628 $json->etype = $a_etype;
629 $json->title = $this->content_obj->getTitle();
630 $json->abstract = $this->content_obj->getLongDescription();
632 include_once(
'./Services/Link/classes/class.ilLink.php');
633 $json->url =
ilLink::_getLink($this->content_obj->getRefId(), $this->content_obj->getType());
647 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
648 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
649 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
652 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
655 foreach ($a_definition as
$id =>
$type) {
656 if (is_array(
$type)) {
664 $value = isset($values[$field]) ? $values[$field] :
'';
668 $a_json->$target = explode(
',', $value);
672 $a_json->$target = (int) $value;
676 $a_json->$target = (string) $value;
680 if (!isset($a_json->$target)) {
681 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTimePlace.php');
684 $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 _getAutoGeneratedMessageString(ilLanguage $lang=null)
Get auto generated info string.
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.
if(!array_key_exists('StateId', $_REQUEST)) $id
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
catch(Exception $e) $message