ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
class.ilRemoteObjectBase.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2010 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4include_once "Services/Object/classes/class.ilObject2.php";
5
15abstract class ilRemoteObjectBase extends ilObject2
16{
18 protected $remote_link;
19 protected $organization;
20 protected $mid;
21 protected $auth_hash = '';
22
23 protected $realm_plain = '';
24
25 const MAIL_SENDER = 6;
26 const OBJECT_OWNER = 6;
27
35 public function __construct($a_id = 0,$a_call_by_reference = true)
36 {
37 global $ilDB;
38
39 parent::__construct($a_id,$a_call_by_reference);
40 $this->db = $ilDB;
41 }
42
49 public static function getInstanceByEventType($a_type)
50 {
51 switch($a_type)
52 {
54 include_once 'Modules/RemoteCourse/classes/class.ilObjRemoteCourse.php';
55 return new ilObjRemoteCourse();
56
58 include_once 'Modules/RemoteCategory/classes/class.ilObjRemoteCategory.php';
59 return new ilObjRemoteCategory();
60
62 include_once 'Modules/RemoteFile/classes/class.ilObjRemoteFile.php';
63 return new ilObjRemoteFile();
64
66 include_once 'Modules/RemoteGlossary/classes/class.ilObjRemoteGlossary.php';
67 return new ilObjRemoteGlossary();
68
70 include_once 'Modules/RemoteGroup/classes/class.ilObjRemoteGroup.php';
71 return new ilObjRemoteGroup();
72
74 include_once 'Modules/RemoteLearningModule/classes/class.ilObjRemoteLearningModule.php';
75 return new ilObjRemoteLearningModule();
76
78 include_once 'Modules/RemoteWiki/classes/class.ilObjRemoteWiki.php';
79 return new ilObjRemoteWiki();
80
82 include_once 'Modules/RemoteTest/classes/class.ilObjRemoteTest.php';
83 return new ilObjRemoteTest();
84 }
85 }
86
87 public function beforeCreate()
88 {
89 $this->setOwner(self::OBJECT_OWNER);
90 return parent::beforeCreate();
91 }
92
98 abstract protected function getTableName();
99
105 abstract protected function getECSObjectType();
106
113 public static function _lookupOrganization($a_obj_id)
114 {
115 global $ilDB;
116
117 $query = "SELECT organization FROM ".static::DB_TABLE_NAME.
118 " WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ";
119 $res = $ilDB->query($query);
120 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
121 {
122 return $row->organization;
123 }
124 return '';
125 }
126
131 public function getRealmPlain()
132 {
133 return $this->realm_plain;
134 }
135
141 public function setOrganization($a_organization)
142 {
143 $this->organization = $a_organization;
144 }
145
151 public function getOrganization()
152 {
153 return $this->organization;
154 }
155
161 public function getLocalInformation()
162 {
164 }
165
171 public function setLocalInformation($a_info)
172 {
173 $this->local_information = $a_info;
174 }
175
181 public function getMID()
182 {
183 return $this->mid;
184 }
185
191 public function setMID($a_mid)
192 {
193 $this->mid = $a_mid;
194 }
195
202 public static function _lookupMID($a_obj_id)
203 {
204 global $ilDB;
205
206 $query = "SELECT mid FROM ".static::DB_TABLE_NAME.
207 " WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ";
208 $res = $ilDB->query($query);
209 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
210 {
211 return $row->mid;
212 }
213 return 0;
214 }
215
221 public function setRemoteLink($a_link)
222 {
223 $this->remote_link = $a_link;
224 }
225
231 public function getRemoteLink()
232 {
233 return $this->remote_link;
234 }
235
243 public function getFullRemoteLink()
244 {
245 global $ilUser;
246
247
248 include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
249 $server_id = ilECSImport::lookupServerId($this->getId());
251
252 include_once('./Services/WebServices/ECS/classes/class.ilECSUser.php');
253 $user = new ilECSUser($ilUser);
254 $ecs_user_data = $user->toGET();
255 $GLOBALS['ilLog']->write(__METHOD__.': Using ecs user data '.$ecs_user_data);
256
257 // check token mechanism enabled
258 include_once './Services/WebServices/ECS/classes/class.ilECSParticipantSetting.php';
259 $part = new ilECSParticipantSetting($server_id,$this->getMID());
260 if(!$part->isTokenEnabled())
261 {
262 return $this->getRemoteLink();
263 }
264
265 $auth_hash = $this->createAuthResource($this->getRemoteLink().$user->toREALM());
266 $ecs_url_hash = 'ecs_hash_url='.urlencode($server->getServerURI().'/sys/auths/'.$auth_hash);
267
268 if(strpos($this->getRemoteLink(), '?'))
269 {
270
271 $link = $this->getRemoteLink().'&ecs_hash='.$auth_hash.$ecs_user_data.'&'.$ecs_url_hash;
272 }
273 else
274 {
275 $link = $this->getRemoteLink().'?ecs_hash='.$auth_hash.$ecs_user_data.'&'.$ecs_url_hash;
276 }
277 $GLOBALS['ilLog']->write(__METHOD__.': ECS full link: '. $link);
278 return $link;
279 }
280
287 public function createAuthResource($a_plain_realm)
288 {
289 global $ilLog;
290
291 include_once './Services/WebServices/ECS/classes/class.ilECSAuth.php';
292 include_once './Services/WebServices/ECS/classes/class.ilECSConnector.php';
293 include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
294 include_once './Services/WebServices/ECS/classes/class.ilECSSetting.php';
295
296 try
297 {
298 $server_id = ilECSImport::lookupServerId($this->getId());
299 $import_info = new ilECSImport($server_id, $this->getId());
300
301 $connector = new ilECSConnector(ilECSSetting::getInstanceByServerId($server_id));
302 $auth = new ilECSAuth();
303 $auth->setPid($import_info->getMID());
304 // URL is deprecated
305 $auth->setUrl($this->getRemoteLink());
306 $realm = sha1($a_plain_realm);
307 $GLOBALS['ilLog']->write(__METHOD__.': Using realm '.$a_plain_realm);
308 $auth->setRealm($realm);
309 $GLOBALS['ilLog']->write(__METHOD__.' Mid is '.$this->getMID());
310 $this->auth_hash = $connector->addAuth(@json_encode($auth),$this->getMID());
311 return $this->auth_hash;
312 }
313 catch(ilECSConnectorException $exc)
314 {
315 $ilLog->write(__METHOD__.': Caught error from ECS Auth resource: '.$exc->getMessage());
316 return false;
317 }
318 }
319
323 public function doCreate()
324 {
325 global $ilDB;
326
327 $fields = array(
328 "obj_id" => array("integer", $this->getId()),
329 "local_information" => array("text", ""),
330 "remote_link" => array("text", ""),
331 "mid" => array("integer", 0),
332 "organization" => array("text", "")
333 );
334
335 $this->doCreateCustomFields($fields);
336
337 $ilDB->insert($this->getTableName(), $fields);
338 }
339
344 protected function doCreateCustomFields(array &$a_fields)
345 {
346
347 }
348
352 public function doUpdate()
353 {
354 global $ilDB;
355
356 $fields = array(
357 "local_information" => array("text", $this->getLocalInformation()),
358 "remote_link" => array("text", $this->getRemoteLink()),
359 "mid" => array("integer", $this->getMID()),
360 "organization" => array("text", $this->getOrganization())
361 );
362
363 $this->doUpdateCustomFields($fields);
364
365 $where = array("obj_id" => array("integer", $this->getId()));
366
367 $ilDB->update($this->getTableName(), $fields, $where);
368 }
369
374 protected function doUpdateCustomFields(array &$a_fields)
375 {
376
377 }
378
382 public function doDelete()
383 {
384 global $ilDB;
385
386 //put here your module specific stuff
387 include_once('./Services/WebServices/ECS/classes/class.ilECSImport.php');
389
390 $query = "DELETE FROM ".$this->getTableName().
391 " WHERE obj_id = ".$this->db->quote($this->getId() ,'integer')." ";
392 $ilDB->manipulate($query);
393 }
394
398 public function doRead()
399 {
400 $query = "SELECT * FROM ".$this->getTableName().
401 " WHERE obj_id = ".$this->db->quote($this->getId() ,'integer')." ";
402 $res = $this->db->query($query);
403 while($row = $res->fetchRow(ilDBConstants::FETCHMODE_OBJECT))
404 {
405 $this->setLocalInformation($row->local_information);
406 $this->setRemoteLink($row->remote_link);
407 $this->setMID($row->mid);
408 $this->setOrganization($row->organization);
409
410 $this->doReadCustomFields($row);
411 }
412 }
413
418 protected function doReadCustomFields($a_row)
419 {
420
421 }
422
430 public function createFromECSEContent(ilECSSetting $a_server, $a_ecs_content, $a_owner)
431 {
432 $this->create();
433
434 // won't work for personal workspace
435 $this->createReference();
436 $this->setPermissions($a_server->getImportId());
437
438 include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
439 $matchable_content = ilECSUtils::getMatchableContent($this->getECSObjectType(),
440 $a_server->getServerId(), $a_ecs_content, $a_owner);
441
442 include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
444 $matchable_content));
445
446 $this->updateFromECSContent($a_server, $a_ecs_content, $a_owner);
447 }
448
456 public function updateFromECSContent(ilECSSetting $a_server, $a_ecs_content, $a_owner)
457 {
458 global $ilLog;
459
460 $ilLog->write('updateFromECSContent: '.print_r($a_ecs_content, true));
461
462 // Get organisation for owner (ObjectListGUI performance)
463 $organisation = null;
464 if($a_owner)
465 {
466 include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
467 $organisation = ilECSUtils::lookupParticipantName($a_owner, $a_server->getServerId());
468 $ilLog->write('found organisation: '.$organisation);
469 }
470
471 $this->setMID($a_owner); // obsolete?
472 $this->setOrganization($organisation);
473 $this->setTitle($a_ecs_content->title);
474 $this->setDescription($a_ecs_content->abstract);
475 $this->setRemoteLink($a_ecs_content->url);
476
477 $ilLog->write('updateCustomFromECSContent');
478 $this->updateCustomFromECSContent($a_server, $a_ecs_content);
479
480 // we are updating late so custom values can be set
481
482 $ilLog->write('ilObject->update()');
483 $this->update();
484
485 include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
486 $matchable_content = ilECSUtils::getMatchableContent($this->getECSObjectType(),
487 $a_server->getServerId(), $a_ecs_content, $a_owner);
488
489 // rule-based category mapping
490 include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
492 $matchable_content);
493 }
494
503 protected function importMetadataFromJson($a_json, ilECSSetting $a_server, array $a_definition, $a_mapping_mode)
504 {
505 global $ilLog;
506
507 $ilLog->write("importing metadata from json: ".print_r($a_json, true));
508
509 include_once('./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
510 include_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
511 include_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
512
514 $values_records = ilAdvancedMDValues::getInstancesForObjectId($this->getId(), $this->getType());
515 foreach($values_records as $values_record)
516 {
517 // this correctly binds group and definitions
518 $values_record->read();
519 }
520
521 $do_save = false;
522
523 foreach($a_definition as $id => $type)
524 {
525 if(is_array($type))
526 {
527 $target = $type[1];
528 $type = $type[0];
529 }
530 else
531 {
532 $target = $id;
533 }
534
535 $timePlace = null;
536 if($field = $mappings->getMappingByECSName($a_mapping_mode, $id))
537 {
538 // find element in records
539 $adv_md_def = null;
540 foreach($values_records as $values_record)
541 {
542 $adv_md_defs = $values_record->getDefinitions();
543 if(isset($adv_md_defs[$field]))
544 {
545 $adv_md_def = $adv_md_defs[$field];
546 break;
547 }
548 }
549 if(!$adv_md_def)
550 {
551 continue;
552 }
553
554 $raw_value = $a_json->$target;
555
557 {
558 if(!is_object($timePlace))
559 {
560 include_once('./Services/WebServices/ECS/classes/class.ilECSTimePlace.php');
561 if(is_object($raw_value))
562 {
563 $timePlace = new ilECSTimePlace();
564 $timePlace->loadFromJSON($raw_value);
565 }
566 else
567 {
568 $timePlace = new ilECSTimePlace();
569 }
570 }
571 $raw_value = $timePlace;
572 }
573
574 if($adv_md_def->importFromECS($type, $raw_value, $id))
575 {
576 $do_save = true;
577 }
578 }
579 }
580
581 if($do_save)
582 {
583 foreach($values_records as $values_record)
584 {
585 $additional = array();
586 foreach($values_record->getADTGroup()->getElements() as $element_id => $element)
587 {
588 if(!$element->isNull())
589 {
590 $additional[$element_id] = array("disabled"=>array("integer", 1));
591 }
592 }
593 $values_record->write($additional);
594 }
595 }
596 }
597
604 protected function updateCustomFromECSContent(ilECSSetting $a_server, $ecs_content)
605 {
606
607 }
608
614 public function isLocalObject()
615 {
616 include_once('./Services/WebServices/ECS/classes/class.ilECSExport.php');
617 include_once('./Services/WebServices/ECS/classes/class.ilECSImport.php');
620 {
621 return false;
622 }
623 return true;
624 }
625
635 public function handleCreate(ilECSSetting $a_server, $a_econtent_id, array $a_mids)
636 {
637 return $this->handleUpdate($a_server, $a_econtent_id, $a_mids);
638 }
639
650 public function handleUpdate(ilECSSetting $a_server, $a_econtent_id, array $a_mids)
651 {
652 global $ilLog;
653
654 // get content details
655 include_once('./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
656 $details = ilECSEContentDetails::getInstance($a_server->getServerId(),
657 $a_econtent_id, $this->getECSObjectType());
658 if(!$details instanceof ilECSEContentDetails)
659 {
660 $this->handleDelete($a_server, $a_econtent_id);
661 $ilLog->write(__METHOD__.': Handling delete of deprecated remote object. DONE');
662 return;
663 }
664
665 $ilLog->write(__METHOD__.': Receivers are '. print_r($details->getReceivers(),true));
666 $ilLog->write(__METHOD__.': Senders are '. print_r($details->getSenders(),true));
667
668 // check owner (sender mid)
669 include_once('./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php');
670 if(!ilECSParticipantSettings::getInstanceByServerId($a_server->getServerId())->isImportAllowed($details->getSenders()))
671 {
672 $ilLog->write('Ignoring disabled participant. MID: '.$details->getOwner());
673 return true;
674 }
675
676 // new mids
677 include_once 'Services/WebServices/ECS/classes/class.ilECSImport.php';
678 include_once 'Services/WebServices/ECS/classes/class.ilECSConnector.php';
679 foreach(array_intersect($a_mids,$details->getReceivers()) as $mid)
680 {
681 try
682 {
683 $connector = new ilECSConnector($a_server);
684 $res = $connector->getResource($this->getECSObjectType(), $a_econtent_id);
685 if($res->getHTTPCode() == ilECSConnector::HTTP_CODE_NOT_FOUND)
686 {
687 continue;
688 }
689 $json = $res->getResult();
690 $GLOBALS['ilLog']->write(__METHOD__.': Received json: '.print_r($json,true));
691 if(!is_object($json))
692 {
693 // try as array (workaround for invalid content)
694 $json = $json[0];
695 if(!is_object($json))
696 {
697 throw new ilECSConnectorException('invalid json');
698 }
699 }
700 }
701 catch(ilECSConnectorException $exc)
702 {
703 $ilLog->write(__METHOD__ . ': Error parsing result. '.$exc->getMessage());
704 $ilLog->logStack();
705 return false;
706 }
707
708 // Update existing
709
710 // Check receiver mid
711 if($obj_id = ilECSImport::_isImported($a_server->getServerId(),$a_econtent_id,$mid))
712 {
713 $ilLog->write(__METHOD__.': Handling update for existing object');
714 $remote = ilObjectFactory::getInstanceByObjId($obj_id,false);
715 if(!$remote instanceof ilRemoteObjectBase)
716 {
717 $ilLog->write(__METHOD__.': Cannot instantiate remote object. Got object type '.$remote->getType());
718 continue;
719 }
720 $remote->updateFromECSContent($a_server,$json,$details->getMySender());
721 }
722 else
723 {
724 $GLOBALS['ilLog']->write(__METHOD__.': my sender '. $details->getMySender().'vs mid'. $mid);
725
726 $ilLog->write(__METHOD__.': Handling create for non existing object');
727 $this->createFromECSEContent($a_server,$json,$details->getMySender());
728
729 // update import status
730 $ilLog->write(__METHOD__.': Updating import status');
731 include_once('./Services/WebServices/ECS/classes/class.ilECSImport.php');
732 $import = new ilECSImport($a_server->getServerId(),$this->getId());
733 $import->setEContentId($a_econtent_id);
734 // Store receiver mid
735 $import->setMID($mid);
736 $import->save();
737
738 $ilLog->write(__METHOD__.': Sending notification');
739 $this->sendNewContentNotification($a_server->getServerId());
740 }
741 }
742
743 $ilLog->write(__METHOD__.': done');
744 return true;
745 }
746
750 protected function sendNewContentNotification($a_server_id)
751 {
752 include_once('Services/WebServices/ECS/classes/class.ilECSSetting.php');
753 $settings = ilECSSetting::getInstanceByServerId($a_server_id);
754 if(!count($rcps = $settings->getEContentRecipients()))
755 {
756 return;
757 }
758
759 include_once('./Services/Mail/classes/class.ilMail.php');
760 include_once('./Services/Language/classes/class.ilLanguageFactory.php');
761
763 $lang->loadLanguageModule('ecs');
764
765 $mail = new ilMail(self::MAIL_SENDER);
766 $message = $lang->txt('ecs_'.$this->getType().'_created_body_a')."\n\n";
767 $message .= $lang->txt('title').': '.$this->getTitle()."\n";
768 if(strlen($desc = $this->getDescription()))
769 {
770 $message .= $lang->txt('desc').': '.$desc."\n";
771 }
772
773 include_once('./Services/Link/classes/class.ilLink.php');
774 $href = ilLink::_getStaticLink($this->getRefId(),$this->getType(),true);
775 $message .= $lang->txt("perma_link").': '.$href."\n\n";
776 $message .= ilMail::_getAutoGeneratedMessageString();
777
778 $mail->sendMail($settings->getEContentRecipientsAsString(),
779 '','',
780 $lang->txt('ecs_new_econtent_subject'),
781 $message,array(),array('normal'));
782 }
783
794 public function handleDelete(ilECSSetting $a_server, $a_econtent_id, $a_mid = 0)
795 {
796 global $tree, $ilLog;
797
798
799 include_once('./Services/WebServices/ECS/classes/class.ilECSImport.php');
800
801 // there is no information about the original mid anymore.
802 // Therefor delete any remote objects with given econtent id
803 $obj_ids = ilECSImport::_lookupObjIds($a_server->getServerId(),$a_econtent_id);
804 $ilLog->write(__METHOD__.': Received obj_ids '.print_r($obj_ids,true));
805
806 foreach($obj_ids as $obj_id)
807 {
808 $references = ilObject::_getAllReferences($obj_id);
809 foreach($references as $ref_id)
810 {
811 if($tmp_obj = ilObjectFactory::getInstanceByRefId($ref_id,false))
812 {
813 $ilLog->write(__METHOD__.': Deleting obsolete remote course: '.$tmp_obj->getTitle());
814 $tmp_obj->delete();
815 $tree->deleteTree($tree->getNodeData($ref_id));
816 }
817 unset($tmp_obj);
818 }
819 }
820 return true;
821 }
822
830 public function getAllResourceIds(ilECSSetting $a_server, $a_sender_only = false)
831 {
832 global $ilLog;
833
834 try
835 {
836 include_once './Services/WebServices/ECS/classes/class.ilECSConnector.php';
837 $connector = new ilECSConnector($a_server);
838 $connector->addHeader('X-EcsQueryStrings', $a_sender_only ? 'sender=true' : 'all=true'); // #11301
839 $list = $connector->getResourceList($this->getECSObjectType());
840 if($list instanceof ilECSResult)
841 {
842 return $list->getResult()->getLinkIds();
843 }
844 }
845 catch(ilECSConnectorException $exc)
846 {
847 $ilLog->write(__METHOD__ . ': Error getting resource list. '.$exc->getMessage());
848 }
849 }
850}
851?>
An exception for terminatinating execution or to throw for unit testing.
static getInstancesForObjectId($a_obj_id, $a_obj_type=null, $a_sub_type="-", $a_sub_id=0)
Get instances for given object id.
static handleUpdate($a_obj_id, $a_server_id, $a_matchable_content)
Handle update of ecs content and create references.
static getMatchingCategory($a_server_id, $a_matchable_content)
get matching category
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.
static _isRemote($a_server_id, $a_econtent_id)
is remote object
Storage of ECS imported objects.
static _lookupEContentId($a_obj_id)
get econent_id
static _deleteByObjId($a_obj_id)
Delete by obj_id.
static _lookupObjIds($a_server_id, $a_econtent_id)
Lookup obj_id.
static _isImported($a_server_id, $a_econtent_id, $a_mid, $a_sub_id=null)
check if econtent is imported for a specific mid
static lookupServerId($a_obj_id)
Lookup server id of imported content @global <type> $ilDB.
static getInstanceByServerId($a_server_id)
Get instance by server id.
getServerId()
Get current server id.
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
getImportId()
get import id
Representation of ECS EContent Time Place.
Stores relevant user data.
static getMatchableContent($a_resource_id, $a_server_id, $a_ecs_content, $a_owner)
Convert ECS content to rule matchable values.
static lookupParticipantName($a_owner, $a_server_id)
Lookup participant name.
const TYPE_TIMEPLACE
static _getLanguage($a_lang_key='')
Get langauge object.
This class handles base functions for mail handling.
Remote category app class.
Remote course app class.
Remote file app class.
Remote glossary app class.
Remote group app class.
Remote learning module app class.
Remote test app class.
Remote wiki app class.
Class ilObject2 This is an intermediate progress of ilObject class.
getRefId()
get reference id @access public
setTitle($a_title)
set object title
putInTree($a_parent_ref)
maybe this method should be in tree object!?
setPermissions($a_parent_ref)
set permissions of object
getType()
get object type @access public
getDescription()
get object description
setOwner($a_owner)
set object owner
update()
update object in db
setDescription($a_desc)
set object description
createReference()
creates reference for object
getId()
get object id @access public
getTitle()
get object title @access public
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static _getAllReferences($a_id)
get all reference ids of object
create()
create
Remote object app base class.
getAllResourceIds(ilECSSetting $a_server, $a_sender_only=false)
Get all available resources.
updateCustomFromECSContent(ilECSSetting $a_server, $ecs_content)
update remote object settings from ecs content
doUpdateCustomFields(array &$a_fields)
Add custom fields to db update.
getOrganization()
get organization
handleCreate(ilECSSetting $a_server, $a_econtent_id, array $a_mids)
Handle creation.
createFromECSEContent(ilECSSetting $a_server, $a_ecs_content, $a_owner)
create remote object from ECSContent object
setRemoteLink($a_link)
set remote link
getTableName()
Get db table name.
doReadCustomFields($a_row)
Read custom fields from db row.
getLocalInformation()
get local information
doCreate()
Create remote object.
__construct($a_id=0, $a_call_by_reference=true)
Constructor.
doUpdate()
Update remote object.
isLocalObject()
Is remote object from same installation?
static _lookupMID($a_obj_id)
lookup owner mid
getFullRemoteLink()
get full remote link Including ecs generated hash and auth mode
doDelete()
Delete remote object.
setOrganization($a_organization)
set organization
getRealmPlain()
Get realm plain.
handleDelete(ilECSSetting $a_server, $a_econtent_id, $a_mid=0)
Handle delete event.
static _lookupOrganization($a_obj_id)
lookup organization
getECSObjectType()
Get ECS resource identifier, e.g.
createAuthResource($a_plain_realm)
create authentication resource on ecs server
handleUpdate(ilECSSetting $a_server, $a_econtent_id, array $a_mids)
Handle update event.
importMetadataFromJson($a_json, ilECSSetting $a_server, array $a_definition, $a_mapping_mode)
Add advanced metadata to json (export)
setLocalInformation($a_info)
set local information
updateFromECSContent(ilECSSetting $a_server, $a_ecs_content, $a_owner)
update remote object settings from ecs content
sendNewContentNotification($a_server_id)
send notifications about new EContent
doCreateCustomFields(array &$a_fields)
Add custom fields to db insert.
static getInstanceByEventType($a_type)
Get instance by ilECSEvent(QueueReader) type.
$server
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
$additional
Definition: goto.php:52
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
global $ilDB
$ilUser
Definition: imgupload.php:18
$a_type
Definition: workflow.php:93