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';
63 include_once
'Modules/Group/classes/class.ilECSGroupSettings.php';
67 include_once
'Modules/LearningModule/classes/class.ilECSLearningModuleSettings.php';
71 include_once
'Modules/Wiki/classes/class.ilECSWikiSettings.php';
99 include_once(
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php');
102 #include_once('./Services/WebServices/ECS/classes/class.ilECSImport.php');
103 #if(!ilECSImport::lookupServerId($this->content_obj->getId()))
125 $this->logger->debug(
'Show ecs settings.');
127 $this->logger->debug(
'Object type is not active. => no settings.');
131 $obj_id = $this->content_obj->getId();
134 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
135 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
138 $this->logger->debug(
'Called withot references. => no settings.');
144 $this->logger->debug(
'Object type is not exportable. => no settings.');
151 $this->logger->debug(
'Parent crs/grp in path. => no settings.');
155 $lng->loadLanguageModule(
'ecs');
159 $ecs->setTitle(
$lng->txt(
'ecs_' .
$a_type .
'_export'));
165 $exp->setRequired(
true);
168 $exp->addOption($off);
170 $exp->addOption($on);
180 $receivers = array();
181 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
185 $participants =
null;
188 $exp->getEContentId(),
189 $this->getECSObjectType()
192 $participants = $details->getReceivers();
195 foreach ($participants as $mid) {
196 $receivers[] = $sid .
'_' . $mid;
200 $publish_for->setValue($receivers);
202 foreach ($exportablePart as $pInfo) {
203 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
207 $partSetting->getCommunityName() .
': ' . $partSetting->getTitle(),
210 $com->setValue($pInfo[
'sid'] .
'_' . $pInfo[
'mid']);
211 $publish_for->addOption($com);
213 $on->addSubItem($publish_for);
233 foreach ((array)
$_POST[
'ecs_sid'] as $sid_mid) {
234 $tmp = explode(
'_', $sid_mid);
235 $mids[$tmp[0]][] = $tmp[1];
239 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunitiesCache.php';
240 include_once
'./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php';
241 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
249 if (!
$_POST[
'ecs_export']) {
253 !isset($mids[$server_id]) ||
254 !is_array($mids[$server_id]) ||
255 !count($mids[$server_id])) {
261 isset($mids[$server_id]) ? $mids[$server_id] : []
283 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
287 if ($export_settings->isExported()) {
289 if ((
bool) $a_export) {
290 $this->
doUpdate($a_server, $export_settings, $a_mids);
294 $this->
doDelete($a_server, $export_settings);
301 $this->
doAdd($a_server, $export_settings, $a_mids);
329 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php';
331 foreach ($export_servers as $server_id) {
332 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
336 include_once(
'./Services/WebServices/ECS/classes/class.ilECSExport.php');
337 $export_settings =
new ilECSExport($server_id, $this->content_obj->getId());
340 if ($export_settings->isExported()) {
347 $ilLog->write(__METHOD__ .
': Cannot handle ECS content update. ' . $exc->getMessage());
368 $ilLog->write(__METHOD__ .
': Starting ECS add resource...');
372 include_once
'Services/WebServices/ECS/classes/class.ilECSConnector.php';
375 $econtent_id = $connector->addResource(
383 $a_export_settings->
save();
405 include_once
'Services/WebServices/ECS/classes/class.ilECSConnector.php';
409 $ilLog->write(__METHOD__ .
': Missing eid. Aborting.');
417 $ilLog->write(__METHOD__ .
': Start updating ECS content - ' . print_r($a_mids,
true));
421 $connector->updateResource(
446 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
447 include_once
'./Services/WebServices/ECS/classes/class.ilECSConnector.php';
451 $ilLog->write(__METHOD__ .
': Missing eid. Aborting.');
456 $ilLog->write(__METHOD__ .
': Start deleting ECS content...');
457 $connector->deleteResource(
464 $a_export_settings->
save();
478 include_once
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php';
483 include_once
'./Services/WebServices/ECS/classes/class.ilECSSetting.php';
484 include_once
'./Services/WebServices/ECS/classes/class.ilECSExport.php' ;
486 foreach ($a_subbtree_nodes as $node) {
487 if (in_array($node[
'obj_id'], $exported)) {
495 $settings->doDelete(
$server, $export_settings);
511 $receivers = array();
512 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
513 foreach ((array) $a_server_id as $sid) {
514 $participants =
null;
517 $participants = $details->getReceivers();
520 foreach ($participants as $mid) {
525 return (array) $receivers;
543 include_once(
'./Services/Mail/classes/class.ilMail.php');
544 include_once(
'./Services/Language/classes/class.ilLanguageFactory.php');
547 $lang->loadLanguageModule(
'ecs');
550 $mail =
new ilMail(self::MAIL_SENDER);
552 $message .=
$lang->txt(
'title') .
': ' . $this->content_obj->getTitle() .
"\n";
553 if (strlen($desc = $this->content_obj->getDescription())) {
564 include_once(
'./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
568 $this->getECSObjectType()
571 $receivers = $details->getReceivers();
574 foreach ($receivers as $member) {
577 include_once
'./Services/WebServices/ECS/classes/class.ilECSCommunityReader.php';
580 $message .= (
"\n\n" . $part->getParticipantName() .
"\n");
581 $message .= ($part->getDescription());
587 $message .= (
' ' .
$lang->txt(
'ecs_not_published') .
"\n\n");
590 $ilLog->write(__METHOD__ .
': Cannot read approvements.');
594 include_once(
'./Services/Link/classes/class.ilLink.php');
596 $message .=
$lang->txt(
"perma_link") .
': ' . $href .
"\n\n";
603 $lang->txt(
'ecs_new_approval_subject'),
618 ($this->content_obj->getType() ==
'crs') ||
619 ($this->content_obj->getType() ==
'grp')
621 $GLOBALS[
'DIC'][
'ilLog']->write(__METHOD__ .
': Permission update for courses/groups');
622 $GLOBALS[
'DIC'][
'rbacadmin']->grantPermission(
625 $this->content_obj->getRefId()
638 $json =
new stdClass();
639 $json->lang =
'en_EN';
641 $json->etype = $a_etype;
642 $json->title = $this->content_obj->getTitle();
643 $json->abstract = $this->content_obj->getLongDescription();
645 include_once(
'./Services/Link/classes/class.ilLink.php');
646 $json->url =
ilLink::_getLink($this->content_obj->getRefId(), $this->content_obj->getType());
660 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
661 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
662 include_once(
'./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
665 include_once
"Services/WebServices/ECS/classes/class.ilECSUtils.php";
668 foreach ($a_definition as $id =>
$type) {
669 if (is_array(
$type)) {
677 $value = isset($values[$field]) ? $values[$field] :
'';
681 $a_json->$target = explode(
',', $value);
685 $a_json->$target = (int) $value;
689 $a_json->$target = (string) $value;
693 if (!isset($a_json->$target)) {
694 include_once(
'./Services/WebServices/ECS/classes/class.ilECSTimePlace.php');
697 $a_json->$target->{
'set' . ucfirst($id)}($value);
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
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.
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.