ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilRemoteObjectBase Class Reference

Remote object app base class. More...

+ Inheritance diagram for ilRemoteObjectBase:
+ Collaboration diagram for ilRemoteObjectBase:

Public Member Functions

 __construct ($a_id=0, $a_call_by_reference=true)
 Constructor. More...
 
 beforeCreate ()
 
 getRealmPlain ()
 Get realm plain. More...
 
 setOrganization ($a_organization)
 set organization More...
 
 getOrganization ()
 get organization More...
 
 getLocalInformation ()
 get local information More...
 
 setLocalInformation ($a_info)
 set local information More...
 
 getMID ()
 get mid More...
 
 setMID ($a_mid)
 set mid More...
 
 setRemoteLink ($a_link)
 set remote link More...
 
 getRemoteLink ()
 get remote link More...
 
 getFullRemoteLink ()
 get full remote link Including ecs generated hash and auth mode More...
 
 createAuthResource ($a_plain_realm)
 create authentication resource on ecs server More...
 
 doCreate ()
 Create remote object. More...
 
 doUpdate ()
 Update remote object. More...
 
 doDelete ()
 Delete remote object. More...
 
 doRead ()
 read settings More...
 
 createFromECSEContent (ilECSSetting $a_server, $a_ecs_content, $a_owner)
 create remote object from ECSContent object More...
 
 updateFromECSContent (ilECSSetting $a_server, $a_ecs_content, $a_owner)
 update remote object settings from ecs content More...
 
 isLocalObject ()
 Is remote object from same installation? More...
 
 handleCreate (ilECSSetting $a_server, $a_econtent_id, array $a_mids)
 Handle creation. More...
 
 handleUpdate (ilECSSetting $a_server, $a_econtent_id, array $a_mids)
 Handle update event. More...
 
 handleDelete (ilECSSetting $a_server, $a_econtent_id, $a_mid=0)
 Handle delete event. More...
 
 getAllResourceIds (ilECSSetting $a_server, $a_sender_only=false)
 Get all available resources. More...
 
- Public Member Functions inherited from ilObject2
 __construct ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 
 read ($a_force_db=false)
 Read data from db. More...
 
 getId ()
 
 setId ($a_id)
 
 setRefId ($a_id)
 
 getRefId ()
 
 getType ()
 
 setType ($a_type)
 
 getPresentationTitle ()
 
 getTitle ()
 
 getUntranslatedTitle ()
 
 setTitle ($a_title)
 
 getDescription ()
 
 setDescription ($a_desc)
 
 getLongDescription ()
 
 getImportId ()
 
 setImportId ($a_import_id)
 
 getOwner ()
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 
 setOwner ($a_owner)
 
 getCreateDate ()
 
 getLastUpdateDate ()
 
 setObjDataRecord ($a_record)
 
 create ($a_clone_mode=false)
 
 update ()
 
 MDUpdateListener ($a_element)
 
 createMetaData ()
 
 updateMetaData ()
 
 deleteMetaData ()
 
 updateOwner ()
 
 _getIdForImportId ($a_import_id)
 
 _lookupOwner ($a_id)
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 
 _getLastUpdateOfObjects ($a_objs)
 
 _setDeletedDate ($a_ref_id)
 
 _resetDeletedDate ($a_ref_id)
 
 _lookupDeletedDate ($a_ref_id)
 
 _writeTitle ($a_obj_id, $a_title)
 
 _writeDescription ($a_obj_id, $a_desc)
 
 _writeImportId ($a_obj_id, $a_import_id)
 
 _isInTrash ($a_ref_id)
 
 _hasUntrashedReference ($a_obj_id)
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 
 putInTree ($a_parent_ref)
 
 setPermissions ($a_parent_ref)
 
 createReference ()
 
 countReferences ()
 
 delete ()
 
 initDefaultRoles ()
 
 createRoleFolder ()
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 
 cloneMetaData ($target_obj)
 
 cloneObject ($a_target_id, $a_copy_id=null, $a_omit_tree=false)
 
 cloneDependencies ($a_target_id, $a_copy_id)
 
- Public Member Functions inherited from ilObject
 ilObject ($a_id=0, $a_reference=true)
 Constructor public. More...
 
 withReferences ()
 determines wehter objects are referenced or not (got ref ids or not) More...
 
 read ($a_force_db=false)
 read object data from db into object More...
 
 getId ()
 get object id public More...
 
 setId ($a_id)
 set object id public More...
 
 setRefId ($a_id)
 set reference id public More...
 
 getRefId ()
 get reference id public More...
 
 getType ()
 get object type public More...
 
 setType ($a_type)
 set object type public More...
 
 getPresentationTitle ()
 get presentation title Normally same as title Overwritten for sessions More...
 
 getTitle ()
 get object title public More...
 
 getUntranslatedTitle ()
 get untranslated object title public More...
 
 setTitle ($a_title)
 set object title More...
 
 getDescription ()
 get object description More...
 
 setDescription ($a_desc)
 set object description More...
 
 getLongDescription ()
 get object long description (stored in object_description) More...
 
 getImportId ()
 get import id More...
 
 setImportId ($a_import_id)
 set import id More...
 
 getOwner ()
 get object owner More...
 
 getOwnerName ()
 
 _lookupOwnerName ($a_owner_id)
 lookup owner name for owner id More...
 
 setOwner ($a_owner)
 set object owner More...
 
 getCreateDate ()
 get create date public More...
 
 getLastUpdateDate ()
 get last update date public More...
 
 getDiskUsage ()
 Gets the disk usage of the object in bytes. More...
 
 setObjDataRecord ($a_record)
 set object_data record (note: this method should only be called from the ilObjectFactory class) More...
 
 create ()
 create More...
 
 update ()
 update object in db More...
 
 MDUpdateListener ($a_element)
 Meta data update listener. More...
 
 createMetaData ()
 create meta data entry More...
 
 updateMetaData ()
 update meta data entry More...
 
 deleteMetaData ()
 delete meta data entry More...
 
 updateOwner ()
 update owner of object in db More...
 
 _getIdForImportId ($a_import_id)
 get current object id for import id (static) More...
 
 _lookupOwner ($a_id)
 lookup object owner More...
 
 _lookupLastUpdate ($a_id, $a_as_string=false)
 lookup last update More...
 
 _getLastUpdateOfObjects ($a_objs)
 Get last update for a set of media objects. More...
 
 _setDeletedDate ($a_ref_id)
 only called in ilTree::saveSubTree More...
 
 _resetDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _lookupDeletedDate ($a_ref_id)
 only called in ilObjectGUI::insertSavedNodes More...
 
 _writeTitle ($a_obj_id, $a_title)
 write title to db (static) More...
 
 _writeDescription ($a_obj_id, $a_desc)
 write description to db (static) More...
 
 _writeImportId ($a_obj_id, $a_import_id)
 write import id to db (static) More...
 
 _isInTrash ($a_ref_id)
 checks wether object is in trash More...
 
 _hasUntrashedReference ($a_obj_id)
 checks wether an object has at least one reference that is not in trash More...
 
 _getObjectsDataForType ($a_type, $a_omit_trash=false)
 get all objects of a certain type More...
 
 putInTree ($a_parent_ref)
 maybe this method should be in tree object!? More...
 
 setPermissions ($a_parent_ref)
 set permissions of object More...
 
 createReference ()
 creates reference for object More...
 
 countReferences ()
 count references of object More...
 
 delete ()
 delete object or referenced object (in the case of a referenced object, object data is only deleted if last reference is deleted) This function removes an object entirely from system!! More...
 
 initDefaultRoles ()
 init default roles settings Purpose of this function is to create a local role folder and local roles, that are needed depending on the object type If you want to setup default local roles you MUST overwrite this method in derived object classes (see ilObjForum for an example) public More...
 
 createRoleFolder ()
 creates a local role folder More...
 
 applyDidacticTemplate ($a_tpl_id)
 Apply template. More...
 
 notify ($a_event, $a_ref_id, $a_parent_non_rbac_id, $a_node_id, $a_params=0)
 notifys an object about an event occured Based on the event passed, each object may decide how it reacts. More...
 
 setRegisterMode ($a_bool)
 
 isUserRegistered ($a_user_id=0)
 
 requireRegistration ()
 
 getXMLZip ()
 
 getHTMLDirectory ()
 
 cloneObject ($a_target_id, $a_copy_id=0, $a_omit_tree=false)
 Clone object permissions, put in tree ... More...
 
 appendCopyInfo ($a_target_id, $a_copy_id)
 Prepend Copy info if object with same name exists in that container. More...
 
 cloneDependencies ($a_target_id, $a_copy_id)
 Clone object dependencies. More...
 
 cloneMetaData ($target_obj)
 Copy meta data. More...
 
 _lookupCreationDate ($a_id)
 Lookup creation date. More...
 

Static Public Member Functions

static getInstanceByEventType ($a_type)
 Get instance by ilECSEvent(QueueReader) type. More...
 
static _lookupOrganization ($a_obj_id, $a_table)
 lookup organization More...
 
static _lookupMID ($a_obj_id, $a_table)
 lookup owner mid More...
 
- Static Public Member Functions inherited from ilObject2
static _lookupObjIdByImportId ($a_import_id)
 
static _getAllReferences ($a_id)
 
static _lookupTitle ($a_id)
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 
static _lookupObjId ($a_id)
 
static _lookupType ($a_id, $a_reference=false)
 
static _lookupObjectId ($a_ref_id)
 
static _exists ($a_id, $a_reference=false)
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 
static _prepareCloneSelection ($a_ref_ids, $new_type)
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 
- Static Public Member Functions inherited from ilObject
static _lookupObjIdByImportId ($a_import_id)
 
static _getAllReferences ($a_id)
 get all reference ids of object More...
 
static _lookupTitle ($a_id)
 lookup object title More...
 
static _getIdsForTitle ($title, $type='', $partialmatch=false)
 
static _lookupDescription ($a_id)
 lookup object description More...
 
static _lookupObjId ($a_id)
 
static setDeletedDates ($a_ref_ids)
 Set deleted date type $ilDB. More...
 
static _lookupType ($a_id, $a_reference=false)
 lookup object type More...
 
static _lookupObjectId ($a_ref_id)
 lookup object id More...
 
static _exists ($a_id, $a_reference=false, $a_type=null)
 checks if an object exists in object_data More...
 
static _getObjectsByType ($a_obj_type="", $a_owner="")
 Get objects by type. More...
 
static _prepareCloneSelection ($a_ref_ids, $new_type, $show_path=true)
 Prepare copy wizard object selection. More...
 
static _getIcon ($a_obj_id="", $a_size="big", $a_type="", $a_offline=false)
 Get icon for repository item. More...
 
static collectDeletionDependencies (&$deps, $a_ref_id, $a_obj_id, $a_type, $a_depth=0)
 Collect deletion dependencies. More...
 
static getDeletionDependencies ($a_obj_id)
 Get deletion dependencies. More...
 
static getLongDescriptions (array $a_obj_ids)
 Get long description data. More...
 
static getAllOwnedRepositoryObjects ($a_user_id)
 Get all ids of objects user owns. More...
 
static hasAutoRating ($a_type, $a_ref_id)
 Check if auto rating is active for parent group/course. More...
 

Data Fields

const MAIL_SENDER = 6
 
const OBJECT_OWNER = 6
 
- Data Fields inherited from ilObject
const TITLE_LENGTH = 255
 max length of object title More...
 
const DESC_LENGTH = 128
 
 $ilias
 
 $lng
 
 $id
 
 $ref_id
 
 $type
 
 $title
 
 $untranslatedTitle
 
 $desc
 
 $long_desc
 
 $owner
 
 $create_date
 
 $last_update
 
 $import_id
 
 $register = false
 
 $referenced
 
 $objectList
 
 $max_title
 
 $max_desc
 
 $add_dots
 
 $obj_data_record
 object_data record More...
 

Protected Member Functions

 getTableName ()
 Get db table name. More...
 
 getECSObjectType ()
 Get ECS resource identifier, e.g. More...
 
 doCreateCustomFields (array &$a_fields)
 Add custom fields to db insert. More...
 
 doUpdateCustomFields (array &$a_fields)
 Add custom fields to db update. More...
 
 doReadCustomFields ($a_row)
 Read custom fields from db row. More...
 
 importMetadataFromJson ($a_json, ilECSSetting $a_server, array $a_definition, $a_mapping_mode)
 Add advanced metadata to json (export) More...
 
 updateCustomFromECSContent (ilECSSetting $a_server, $ecs_content)
 update remote object settings from ecs content More...
 
 sendNewContentNotification ($a_server_id)
 send notifications about new EContent More...
 
- Protected Member Functions inherited from ilObject2
 initType ()
 
 doRead ()
 
 doCreate ()
 
 beforeCreate ()
 
 doUpdate ()
 
 beforeUpdate ()
 
 doMDUpdateListener ($a_element)
 
 beforeMDUpdateListener ($a_element)
 
 doCreateMetaData ()
 
 beforeCreateMetaData ()
 
 doUpdateMetaData ()
 
 beforeUpdateMetaData ()
 
 doDelete ()
 
 beforeDelete ()
 
 doCloneObject ($new_obj, $a_target_id, $a_copy_id=null)
 
 beforeCloneObject ()
 

Protected Attributes

 $local_information
 
 $remote_link
 
 $organization
 
 $mid
 
 $auth_hash = ''
 
 $realm_plain = ''
 

Detailed Description

Remote object app base class.

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 15 of file class.ilRemoteObjectBase.php.

Constructor & Destructor Documentation

◆ __construct()

ilRemoteObjectBase::__construct (   $a_id = 0,
  $a_call_by_reference = true 
)

Constructor.

Parameters
int$a_id
bool$a_call_by_reference
Returns
ilObject

Definition at line 35 of file class.ilRemoteObjectBase.php.

36  {
37  global $ilDB;
38 
39  parent::__construct($a_id,$a_call_by_reference);
40  $this->db = $ilDB;
41  }

Member Function Documentation

◆ _lookupMID()

static ilRemoteObjectBase::_lookupMID (   $a_obj_id,
  $a_table 
)
static

lookup owner mid

Parameters
int$a_obj_idobj_id
string$a_table
Returns
int

Definition at line 204 of file class.ilRemoteObjectBase.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjRemoteCategory\_lookupMID(), ilObjRemoteGlossary\_lookupMID(), ilObjRemoteWiki\_lookupMID(), ilObjRemoteLearningModule\_lookupMID(), ilObjRemoteFile\_lookupMID(), ilObjRemoteTest\_lookupMID(), ilObjRemoteGroup\_lookupMID(), and ilObjRemoteCourse\_lookupMID().

205  {
206  global $ilDB;
207 
208  $query = "SELECT mid FROM ".$a_table.
209  " WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ";
210  $res = $ilDB->query($query);
211  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
212  {
213  return $row->mid;
214  }
215  return 0;
216  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the caller graph for this function:

◆ _lookupOrganization()

static ilRemoteObjectBase::_lookupOrganization (   $a_obj_id,
  $a_table 
)
static

lookup organization

Parameters
int$a_obj_id
string$a_table
Returns
string

Definition at line 114 of file class.ilRemoteObjectBase.php.

References $query, $res, $row, and DB_FETCHMODE_OBJECT.

Referenced by ilObjRemoteCategory\_lookupOrganization(), ilObjRemoteGlossary\_lookupOrganization(), ilObjRemoteWiki\_lookupOrganization(), ilObjRemoteLearningModule\_lookupOrganization(), ilObjRemoteFile\_lookupOrganization(), ilObjRemoteTest\_lookupOrganization(), ilObjRemoteGroup\_lookupOrganization(), and ilObjRemoteCourse\_lookupOrganization().

115  {
116  global $ilDB;
117 
118  $query = "SELECT organization FROM ".$a_table.
119  " WHERE obj_id = ".$ilDB->quote($a_obj_id ,'integer')." ";
120  $res = $ilDB->query($query);
121  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
122  {
123  return $row->organization;
124  }
125  return '';
126  }
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
+ Here is the caller graph for this function:

◆ beforeCreate()

ilRemoteObjectBase::beforeCreate ( )

Definition at line 87 of file class.ilRemoteObjectBase.php.

References getECSObjectType(), getTableName(), and ilObject2\setOwner().

88  {
89  $this->setOwner(self::OBJECT_OWNER);
90  return parent::beforeCreate();
91  }
setOwner($a_owner)
+ Here is the call graph for this function:

◆ createAuthResource()

ilRemoteObjectBase::createAuthResource (   $a_plain_realm)

create authentication resource on ecs server

Returns
bool
Exceptions
ilECSConnectorException

Definition at line 281 of file class.ilRemoteObjectBase.php.

References $auth, $auth_hash, $GLOBALS, $ilLog, ilObject2\getId(), ilECSSetting\getInstanceByServerId(), getMID(), getRemoteLink(), and ilECSImport\lookupServerId().

Referenced by getFullRemoteLink().

282  {
283  global $ilLog;
284 
285  include_once './Services/WebServices/ECS/classes/class.ilECSAuth.php';
286  include_once './Services/WebServices/ECS/classes/class.ilECSConnector.php';
287  include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
288  include_once './Services/WebServices/ECS/classes/class.ilECSSetting.php';
289 
290  try
291  {
292  $server_id = ilECSImport::lookupServerId($this->getId());
293 
294  $connector = new ilECSConnector(ilECSSetting::getInstanceByServerId($server_id));
295  $auth = new ilECSAuth();
296  // URL is deprecated
297  $auth->setUrl($this->getRemoteLink());
298  $realm = sha1($a_plain_realm);
299  $GLOBALS['ilLog']->write(__METHOD__.': Using realm '.$a_plain_realm);
300  $auth->setRealm($realm);
301  $GLOBALS['ilLog']->write(__METHOD__.' Mid is '.$this->getMID());
302  $this->auth_hash = $connector->addAuth(@json_encode($auth),$this->getMID());
303  return $this->auth_hash;
304  }
305  catch(ilECSConnectorException $exc)
306  {
307  $ilLog->write(__METHOD__.': Caught error from ECS Auth resource: '.$exc->getMessage());
308  return false;
309  }
310  }
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
getRemoteLink()
get remote link
$GLOBALS['ct_recipient']
static lookupServerId($a_obj_id)
Lookup server id of imported content <type> $ilDB.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ createFromECSEContent()

ilRemoteObjectBase::createFromECSEContent ( ilECSSetting  $a_server,
  $a_ecs_content,
  $a_owner 
)

create remote object from ECSContent object

Parameters
ilECSSetting$a_server
object$a_ecs_contentobject with object settings
int$a_owner

Definition at line 422 of file class.ilRemoteObjectBase.php.

References ilObject\create(), ilObject2\createReference(), getECSObjectType(), ilECSSetting\getImportId(), ilECSUtils\getMatchableContent(), ilECSCategoryMapping\getMatchingCategory(), ilECSSetting\getServerId(), ilObject2\putInTree(), ilObject2\setPermissions(), and updateFromECSContent().

Referenced by handleUpdate().

423  {
424  $this->create();
425 
426  // won't work for personal workspace
427  $this->createReference();
428  $this->setPermissions($a_server->getImportId());
429 
430  include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
431  $matchable_content = ilECSUtils::getMatchableContent($this->getECSObjectType(),
432  $a_server->getServerId(), $a_ecs_content, $a_owner);
433 
434  include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
436  $matchable_content));
437 
438  $this->updateFromECSContent($a_server, $a_ecs_content, $a_owner);
439  }
putInTree($a_parent_ref)
getServerId()
Get current server id.
getImportId()
get import id
setPermissions($a_parent_ref)
getECSObjectType()
Get ECS resource identifier, e.g.
static getMatchableContent($a_resource_id, $a_server_id, $a_ecs_content, $a_owner)
Convert ECS content to rule matchable values.
create()
create
static getMatchingCategory($a_server_id, $a_matchable_content)
get matching category
updateFromECSContent(ilECSSetting $a_server, $a_ecs_content, $a_owner)
update remote object settings from ecs content
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ doCreate()

ilRemoteObjectBase::doCreate ( )

Create remote object.

Definition at line 315 of file class.ilRemoteObjectBase.php.

References doCreateCustomFields(), ilObject2\getId(), and getTableName().

316  {
317  global $ilDB;
318 
319  $fields = array(
320  "obj_id" => array("integer", $this->getId()),
321  "local_information" => array("text", ""),
322  "remote_link" => array("text", ""),
323  "mid" => array("integer", 0),
324  "organization" => array("text", "")
325  );
326 
327  $this->doCreateCustomFields($fields);
328 
329  $ilDB->insert($this->getTableName(), $fields);
330  }
getTableName()
Get db table name.
doCreateCustomFields(array &$a_fields)
Add custom fields to db insert.
+ Here is the call graph for this function:

◆ doCreateCustomFields()

ilRemoteObjectBase::doCreateCustomFields ( array &  $a_fields)
protected

Add custom fields to db insert.

Parameters
array$a_fields

Definition at line 336 of file class.ilRemoteObjectBase.php.

Referenced by doCreate().

337  {
338 
339  }
+ Here is the caller graph for this function:

◆ doDelete()

ilRemoteObjectBase::doDelete ( )

Delete remote object.

Definition at line 374 of file class.ilRemoteObjectBase.php.

References $query, ilECSImport\_deleteByObjId(), and ilObject2\getId().

375  {
376  global $ilDB;
377 
378  //put here your module specific stuff
379  include_once('./Services/WebServices/ECS/classes/class.ilECSImport.php');
381 
382  $query = "DELETE FROM ".$this->getTableName().
383  " WHERE obj_id = ".$this->db->quote($this->getId() ,'integer')." ";
384  $ilDB->manipulate($query);
385  }
static _deleteByObjId($a_obj_id)
Delete by obj_id.
+ Here is the call graph for this function:

◆ doRead()

ilRemoteObjectBase::doRead ( )

read settings

Definition at line 390 of file class.ilRemoteObjectBase.php.

References $query, $res, $row, DB_FETCHMODE_OBJECT, doReadCustomFields(), ilObject2\getId(), setLocalInformation(), setMID(), setOrganization(), and setRemoteLink().

391  {
392  $query = "SELECT * FROM ".$this->getTableName().
393  " WHERE obj_id = ".$this->db->quote($this->getId() ,'integer')." ";
394  $res = $this->db->query($query);
395  while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
396  {
397  $this->setLocalInformation($row->local_information);
398  $this->setRemoteLink($row->remote_link);
399  $this->setMID($row->mid);
400  $this->setOrganization($row->organization);
401 
402  $this->doReadCustomFields($row);
403  }
404  }
setRemoteLink($a_link)
set remote link
doReadCustomFields($a_row)
Read custom fields from db row.
const DB_FETCHMODE_OBJECT
Definition: class.ilDB.php:11
setOrganization($a_organization)
set organization
setLocalInformation($a_info)
set local information
+ Here is the call graph for this function:

◆ doReadCustomFields()

ilRemoteObjectBase::doReadCustomFields (   $a_row)
protected

Read custom fields from db row.

Parameters
object$a_row

Definition at line 410 of file class.ilRemoteObjectBase.php.

Referenced by doRead().

411  {
412 
413  }
+ Here is the caller graph for this function:

◆ doUpdate()

ilRemoteObjectBase::doUpdate ( )

Update remote object.

Definition at line 344 of file class.ilRemoteObjectBase.php.

References doUpdateCustomFields(), ilObject2\getId(), getLocalInformation(), getMID(), getOrganization(), getRemoteLink(), and getTableName().

345  {
346  global $ilDB;
347 
348  $fields = array(
349  "local_information" => array("text", $this->getLocalInformation()),
350  "remote_link" => array("text", $this->getRemoteLink()),
351  "mid" => array("integer", $this->getMID()),
352  "organization" => array("text", $this->getOrganization())
353  );
354 
355  $this->doUpdateCustomFields($fields);
356 
357  $where = array("obj_id" => array("integer", $this->getId()));
358 
359  $ilDB->update($this->getTableName(), $fields, $where);
360  }
getTableName()
Get db table name.
getOrganization()
get organization
getRemoteLink()
get remote link
doUpdateCustomFields(array &$a_fields)
Add custom fields to db update.
getLocalInformation()
get local information
+ Here is the call graph for this function:

◆ doUpdateCustomFields()

ilRemoteObjectBase::doUpdateCustomFields ( array &  $a_fields)
protected

Add custom fields to db update.

Parameters
array$a_fields

Definition at line 366 of file class.ilRemoteObjectBase.php.

Referenced by doUpdate().

367  {
368 
369  }
+ Here is the caller graph for this function:

◆ getAllResourceIds()

ilRemoteObjectBase::getAllResourceIds ( ilECSSetting  $a_server,
  $a_sender_only = false 
)

Get all available resources.

Parameters
ilECSSetting$a_server
bool$a_sender_only
Returns
array

Definition at line 809 of file class.ilRemoteObjectBase.php.

References $ilLog, and getECSObjectType().

810  {
811  global $ilLog;
812 
813  try
814  {
815  include_once './Services/WebServices/ECS/classes/class.ilECSConnector.php';
816  $connector = new ilECSConnector($a_server);
817  $connector->addHeader('X-EcsQueryStrings', $a_sender_only ? 'sender=true' : 'all=true'); // #11301
818  $list = $connector->getResourceList($this->getECSObjectType());
819  if($list instanceof ilECSResult)
820  {
821  return $list->getResult()->getLinkIds();
822  }
823  }
824  catch(ilECSConnectorException $exc)
825  {
826  $ilLog->write(__METHOD__ . ': Error getting resource list. '.$exc->getMessage());
827  }
828  }
getECSObjectType()
Get ECS resource identifier, e.g.
+ Here is the call graph for this function:

◆ getECSObjectType()

ilRemoteObjectBase::getECSObjectType ( )
abstractprotected

Get ECS resource identifier, e.g.

"/campusconnect/courselinks"

Returns
string

Referenced by beforeCreate(), createFromECSEContent(), getAllResourceIds(), handleUpdate(), and updateFromECSContent().

+ Here is the caller graph for this function:

◆ getFullRemoteLink()

ilRemoteObjectBase::getFullRemoteLink ( )

get full remote link Including ecs generated hash and auth mode

Returns
string
Exceptions
ilECSConnectorException

Definition at line 245 of file class.ilRemoteObjectBase.php.

References $auth_hash, $GLOBALS, $ilUser, $server, createAuthResource(), ilObject2\getId(), ilECSSetting\getInstanceByServerId(), getRemoteLink(), and ilECSImport\lookupServerId().

246  {
247  global $ilUser;
248 
249  include_once('./Services/WebServices/ECS/classes/class.ilECSUser.php');
250  $user = new ilECSUser($ilUser);
251  $ecs_user_data = $user->toGET();
252  $GLOBALS['ilLog']->write(__METHOD__.': Using ecs user data '.$ecs_user_data);
253 
254  include_once './Services/WebServices/ECS/classes/class.ilECSImport.php';
255  $server_id = ilECSImport::lookupServerId($this->getId());
257 
258 
259  $auth_hash = $this->createAuthResource($this->getRemoteLink().$user->toREALM());
260  $ecs_url_hash = 'ecs_hash_url='.urlencode($server->getServerURI().'/sys/auths/'.$auth_hash);
261 
262  if(strpos($this->getRemoteLink(), '?'))
263  {
264 
265  $link = $this->getRemoteLink().'&ecs_hash='.$auth_hash.$ecs_user_data.'&'.$ecs_url_hash;
266  }
267  else
268  {
269  $link = $this->getRemoteLink().'?ecs_hash='.$auth_hash.$ecs_user_data.'&'.$ecs_url_hash;
270  }
271  $GLOBALS['ilLog']->write(__METHOD__.': ECS full link: '. $link);
272  return $link;
273  }
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
getRemoteLink()
get remote link
$GLOBALS['ct_recipient']
static lookupServerId($a_obj_id)
Lookup server id of imported content <type> $ilDB.
createAuthResource($a_plain_realm)
create authentication resource on ecs server
$server
global $ilUser
Definition: imgupload.php:15
Stores relevant user data.
+ Here is the call graph for this function:

◆ getInstanceByEventType()

static ilRemoteObjectBase::getInstanceByEventType (   $a_type)
static

Get instance by ilECSEvent(QueueReader) type.

Parameters
int$a_type
Returns
ilRemoteObjectBase

Definition at line 49 of file class.ilRemoteObjectBase.php.

References ilECSEventQueueReader\TYPE_REMOTE_CATEGORY, ilECSEventQueueReader\TYPE_REMOTE_COURSE, ilECSEventQueueReader\TYPE_REMOTE_FILE, ilECSEventQueueReader\TYPE_REMOTE_GLOSSARY, ilECSEventQueueReader\TYPE_REMOTE_GROUP, ilECSEventQueueReader\TYPE_REMOTE_LEARNING_MODULE, ilECSEventQueueReader\TYPE_REMOTE_TEST, and ilECSEventQueueReader\TYPE_REMOTE_WIKI.

Referenced by ilECSEventQueueReader\getAllResourceIds(), and ilECSTaskScheduler\handleEvents().

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  }
Remote test app class.
Remote file app class.
Remote glossary app class.
Remote learning module app class.
Remote wiki app class.
Remote course app class.
Remote group app class.
Remote category app class.
+ Here is the caller graph for this function:

◆ getLocalInformation()

ilRemoteObjectBase::getLocalInformation ( )

get local information

Returns
string

Definition at line 162 of file class.ilRemoteObjectBase.php.

References $local_information.

Referenced by doUpdate().

163  {
165  }
+ Here is the caller graph for this function:

◆ getMID()

ilRemoteObjectBase::getMID ( )

get mid

Returns
int

Definition at line 182 of file class.ilRemoteObjectBase.php.

References $mid.

Referenced by createAuthResource(), and doUpdate().

183  {
184  return $this->mid;
185  }
+ Here is the caller graph for this function:

◆ getOrganization()

ilRemoteObjectBase::getOrganization ( )

get organization

Returns
string

Definition at line 152 of file class.ilRemoteObjectBase.php.

References $organization.

Referenced by doUpdate().

153  {
154  return $this->organization;
155  }
+ Here is the caller graph for this function:

◆ getRealmPlain()

ilRemoteObjectBase::getRealmPlain ( )

Get realm plain.

Returns
type

Definition at line 132 of file class.ilRemoteObjectBase.php.

References $realm_plain.

133  {
134  return $this->realm_plain;
135  }

◆ getRemoteLink()

ilRemoteObjectBase::getRemoteLink ( )

get remote link

Returns
string

Definition at line 233 of file class.ilRemoteObjectBase.php.

References $remote_link.

Referenced by createAuthResource(), doUpdate(), and getFullRemoteLink().

234  {
235  return $this->remote_link;
236  }
+ Here is the caller graph for this function:

◆ getTableName()

ilRemoteObjectBase::getTableName ( )
abstractprotected

Get db table name.

Returns
string

Referenced by beforeCreate(), doCreate(), and doUpdate().

+ Here is the caller graph for this function:

◆ handleCreate()

ilRemoteObjectBase::handleCreate ( ilECSSetting  $a_server,
  $a_econtent_id,
array  $a_mids 
)

Handle creation.

called by ilTaskScheduler

Parameters
ilECSSetting$a_server
type$a_econtent_id
array$a_mids

Definition at line 614 of file class.ilRemoteObjectBase.php.

References handleUpdate().

615  {
616  return $this->handleUpdate($a_server, $a_econtent_id, $a_mids);
617  }
handleUpdate(ilECSSetting $a_server, $a_econtent_id, array $a_mids)
Handle update event.
+ Here is the call graph for this function:

◆ handleDelete()

ilRemoteObjectBase::handleDelete ( ilECSSetting  $a_server,
  $a_econtent_id,
  $a_mid = 0 
)

Handle delete event.

called by ilTaskScheduler

Parameters
ilECSSetting$a_server
int$a_econtent_id
int$a_mid
Returns
boolean

Definition at line 773 of file class.ilRemoteObjectBase.php.

References $ilLog, ilObject\$ref_id, ilObject\_getAllReferences(), ilECSImport\_lookupObjIds(), ilObjectFactory\getInstanceByRefId(), and ilECSSetting\getServerId().

Referenced by handleUpdate().

774  {
775  global $tree, $ilLog;
776 
777 
778  include_once('./Services/WebServices/ECS/classes/class.ilECSImport.php');
779 
780  // there is no information about the original mid anymore.
781  // Therefor delete any remote objects with given econtent id
782  $obj_ids = ilECSImport::_lookupObjIds($a_server->getServerId(),$a_econtent_id);
783  $ilLog->write(__METHOD__.': Received obj_ids '.print_r($obj_ids,true));
784 
785  foreach($obj_ids as $obj_id)
786  {
787  $references = ilObject::_getAllReferences($obj_id);
788  foreach($references as $ref_id)
789  {
790  if($tmp_obj = ilObjectFactory::getInstanceByRefId($ref_id,false))
791  {
792  $ilLog->write(__METHOD__.': Deleting obsolete remote course: '.$tmp_obj->getTitle());
793  $tmp_obj->delete();
794  $tree->deleteTree($tree->getNodeData($ref_id));
795  }
796  unset($tmp_obj);
797  }
798  }
799  return true;
800  }
getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
getServerId()
Get current server id.
static _getAllReferences($a_id)
get all reference ids of object
_lookupObjIds($a_server_id, $a_econtent_id)
Lookup obj_id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleUpdate()

ilRemoteObjectBase::handleUpdate ( ilECSSetting  $a_server,
  $a_econtent_id,
array  $a_mids 
)

Handle update event.

called by ilTaskScheduler

Parameters
ilECSSetting$a_server
int$a_econtent_id
array$a_mids
Returns
boolean

Definition at line 629 of file class.ilRemoteObjectBase.php.

References $GLOBALS, $ilLog, $mid, $res, ilECSImport\_isImported(), createFromECSEContent(), getECSObjectType(), ilObject2\getId(), ilECSEContentDetails\getInstance(), ilObjectFactory\getInstanceByObjId(), ilECSParticipantSettings\getInstanceByServerId(), ilECSSetting\getServerId(), handleDelete(), ilECSConnector\HTTP_CODE_NOT_FOUND, sendNewContentNotification(), and ilECSImport\setEContentId().

Referenced by handleCreate().

630  {
631  global $ilLog;
632 
633  // get content details
634  include_once('./Services/WebServices/ECS/classes/class.ilECSEContentDetails.php');
635  $details = ilECSEContentDetails::getInstance($a_server->getServerId(),
636  $a_econtent_id, $this->getECSObjectType());
637  if(!$details instanceof ilECSEContentDetails)
638  {
639  $this->handleDelete($a_server, $a_econtent_id);
640  $ilLog->write(__METHOD__.': Handling delete of deprecated remote object. DONE');
641  return;
642  }
643 
644  $ilLog->write(__METHOD__.': Receivers are '. print_r($details->getReceivers(),true));
645  $ilLog->write(__METHOD__.': Senders are '. print_r($details->getSenders(),true));
646 
647  // check owner (sender mid)
648  include_once('./Services/WebServices/ECS/classes/class.ilECSParticipantSettings.php');
649  if(!ilECSParticipantSettings::getInstanceByServerId($a_server->getServerId())->isImportAllowed($details->getSenders()))
650  {
651  $ilLog->write('Ignoring disabled participant. MID: '.$details->getOwner());
652  return true;
653  }
654 
655  // new mids
656  include_once 'Services/WebServices/ECS/classes/class.ilECSImport.php';
657  include_once 'Services/WebServices/ECS/classes/class.ilECSConnector.php';
658  foreach(array_intersect($a_mids,$details->getReceivers()) as $mid)
659  {
660  try
661  {
662  $connector = new ilECSConnector($a_server);
663  $res = $connector->getResource($this->getECSObjectType(), $a_econtent_id);
664  if($res->getHTTPCode() == ilECSConnector::HTTP_CODE_NOT_FOUND)
665  {
666  continue;
667  }
668  $json = $res->getResult();
669  $GLOBALS['ilLog']->write(__METHOD__.': Received json: '.print_r($json,true));
670  if(!is_object($json))
671  {
672  // try as array (workaround for invalid content)
673  $json = $json[0];
674  if(!is_object($json))
675  {
676  throw new ilECSConnectorException('invalid json');
677  }
678  }
679  }
680  catch(ilECSConnectorException $exc)
681  {
682  $ilLog->write(__METHOD__ . ': Error parsing result. '.$exc->getMessage());
683  $ilLog->logStack();
684  return false;
685  }
686 
687  // Update existing
688 
689  // Check receiver mid
690  if($obj_id = ilECSImport::_isImported($a_server->getServerId(),$a_econtent_id,$mid))
691  {
692  $ilLog->write(__METHOD__.': Handling update for existing object');
693  $remote = ilObjectFactory::getInstanceByObjId($obj_id,false);
694  if(!$remote instanceof ilRemoteObjectBase)
695  {
696  $ilLog->write(__METHOD__.': Cannot instantiate remote object. Got object type '.$remote->getType());
697  continue;
698  }
699  $remote->updateFromECSContent($a_server,$json,$details->getMySender());
700  }
701  else
702  {
703  $GLOBALS['ilLog']->write(__METHOD__.': my sender '. $details->getMySender().'vs mid'. $mid);
704 
705  $ilLog->write(__METHOD__.': Handling create for non existing object');
706  $this->createFromECSEContent($a_server,$json,$details->getMySender());
707 
708  // update import status
709  $ilLog->write(__METHOD__.': Updating import status');
710  include_once('./Services/WebServices/ECS/classes/class.ilECSImport.php');
711  $import = new ilECSImport($a_server->getServerId(),$this->getId());
712  $import->setEContentId($a_econtent_id);
713  // Store receiver mid
714  $import->setMID($mid);
715  $import->save();
716 
717  $ilLog->write(__METHOD__.': Sending notification');
718  $this->sendNewContentNotification($a_server->getServerId());
719  }
720  }
721 
722  $ilLog->write(__METHOD__.': done');
723  return true;
724  }
sendNewContentNotification($a_server_id)
send notifications about new EContent
getServerId()
Get current server id.
handleDelete(ilECSSetting $a_server, $a_econtent_id, $a_mid=0)
Handle delete event.
Presentation of ecs content details (http://...campusconnect/courselinks/id/details) ...
static _isImported($a_server_id, $a_econtent_id, $a_mid, $a_sub_id=0)
check if econtent is imported for a specific mid
getECSObjectType()
Get ECS resource identifier, e.g.
static getInstanceByServerId($a_server_id)
Get instance by server id.
$GLOBALS['ct_recipient']
Storage of ECS imported objects.
getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Remote object app base class.
setEContentId($a_id)
set econtent id
createFromECSEContent(ilECSSetting $a_server, $a_ecs_content, $a_owner)
create remote object from ECSContent object
static getInstance($a_server_id, $a_econtent_id, $a_resource_type)
Get data from server.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ importMetadataFromJson()

ilRemoteObjectBase::importMetadataFromJson (   $a_json,
ilECSSetting  $a_server,
array  $a_definition,
  $a_mapping_mode 
)
protected

Add advanced metadata to json (export)

Parameters
object$a_json
ilECSSetting$a_server
array$a_definition
int$a_mapping_mode

Definition at line 495 of file class.ilRemoteObjectBase.php.

References ilObject\$id, $ilLog, ilObject\$type, ilAdvancedMDValue\_getInstance(), ilAdvancedMDFieldDefinition\_lookupFieldType(), ilObject2\getId(), ilECSDataMappingSettings\getInstanceByServerId(), ilECSSetting\getServerId(), ilECSUtils\TYPE_ARRAY, ilAdvancedMDFieldDefinition\TYPE_DATE, ilAdvancedMDFieldDefinition\TYPE_DATETIME, ilECSUtils\TYPE_INT, ilECSUtils\TYPE_STRING, and ilECSUtils\TYPE_TIMEPLACE.

Referenced by ilObjRemoteCourse\updateCustomFromECSContent().

496  {
497  global $ilLog;
498 
499  $ilLog->write("importing metadata from json: ".print_r($a_definition, true));
500 
501  include_once('./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
502  include_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
503  include_once('./Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
505 
506  foreach($a_definition as $id => $type)
507  {
508  if(is_array($type))
509  {
510  $target = $type[1];
511  $type = $type[0];
512  }
513  else
514  {
515  $target = $id;
516  }
517 
518  $timePlace = null;
519  if($field = $mappings->getMappingByECSName($a_mapping_mode, $id))
520  {
521  switch($type)
522  {
524  $value = implode(',', (array) $a_json->$target);
525  break;
526 
528  $value = (int) $a_json->$target;
529  break;
530 
532  $value = (string) $a_json->$target;
533  break;
534 
536  if(!is_object($timePlace))
537  {
538  include_once('./Services/WebServices/ECS/classes/class.ilECSTimePlace.php');
539  if(is_object($a_json->$target))
540  {
541  $timePlace = new ilECSTimePlace();
542  $timePlace->loadFromJSON($a_json->$target);
543  }
544  else
545  {
546  $timePlace = new ilECSTimePlace();
547  }
548  }
549  switch($id)
550  {
551  case 'begin':
552  case 'end':
553  $field_type = ilAdvancedMDFieldDefinition::_lookupFieldType($field);
554  if($field_type == ilAdvancedMDFieldDefinition::TYPE_DATE ||
556  {
557  $value = $timePlace->{'getUT'.ucfirst($id)}();
558  break;
559  }
560  // fallthrough
561  case 'room':
562  case 'cycle':
563  $value = $timePlace->{'get'.ucfirst($id)}();
564  break;
565  }
566  break;
567  }
568  include_once './Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php';
569  $mdv = ilAdvancedMDValue::_getInstance($this->getId(),$field);
570  $mdv->toggleDisabledStatus(true);
571  $mdv->setValue($value);
572  $mdv->save();
573  }
574  }
575  }
static getInstanceByServerId($a_server_id)
Get singleton instance.
Representation of ECS EContent Time Place.
getServerId()
Get current server id.
const TYPE_TIMEPLACE
static _getInstance($a_obj_id, $a_field_id, $a_sub_type="", $a_sub_id=0)
Get instance.
static _lookupFieldType($a_field_id)
Lookup field type.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isLocalObject()

ilRemoteObjectBase::isLocalObject ( )

Is remote object from same installation?

Returns
boolean

Definition at line 593 of file class.ilRemoteObjectBase.php.

References ilECSExport\_isRemote(), ilECSImport\_lookupEContentId(), ilObject2\getId(), and ilECSImport\lookupServerId().

594  {
595  include_once('./Services/WebServices/ECS/classes/class.ilECSExport.php');
596  include_once('./Services/WebServices/ECS/classes/class.ilECSImport.php');
599  {
600  return false;
601  }
602  return true;
603  }
static _lookupEContentId($a_obj_id)
get econent_id
static _isRemote($a_server_id, $a_econtent_id)
is remote object
static lookupServerId($a_obj_id)
Lookup server id of imported content <type> $ilDB.
+ Here is the call graph for this function:

◆ sendNewContentNotification()

ilRemoteObjectBase::sendNewContentNotification (   $a_server_id)
protected

send notifications about new EContent

Definition at line 729 of file class.ilRemoteObjectBase.php.

References ilObject\$desc, $lang, ilMail\_getAutoGeneratedMessageString(), ilLanguageFactory\_getLanguage(), ilLink\_getStaticLink(), ilObject2\getDescription(), ilECSSetting\getInstanceByServerId(), ilObject2\getRefId(), ilObject2\getTitle(), and ilObject2\getType().

Referenced by handleUpdate().

730  {
731  include_once('Services/WebServices/ECS/classes/class.ilECSSetting.php');
732  $settings = ilECSSetting::getInstanceByServerId($a_server_id);
733  if(!count($rcps = $settings->getEContentRecipients()))
734  {
735  return;
736  }
737 
738  include_once('./Services/Mail/classes/class.ilMail.php');
739  include_once('./Services/Language/classes/class.ilLanguageFactory.php');
740 
742  $lang->loadLanguageModule('ecs');
743 
744  $mail = new ilMail(self::MAIL_SENDER);
745  $message = $lang->txt('ecs_'.$this->getType().'_created_body_a')."\n\n";
746  $message .= $lang->txt('title').': '.$this->getTitle()."\n";
747  if(strlen($desc = $this->getDescription()))
748  {
749  $message .= $lang->txt('desc').': '.$desc."\n";
750  }
751 
752  include_once('./Services/Link/classes/class.ilLink.php');
753  $href = ilLink::_getStaticLink($this->getRefId(),$this->getType(),true);
754  $message .= $lang->txt("perma_link").': '.$href."\n\n";
756 
757  $mail->sendMail($settings->getEContentRecipientsAsString(),
758  '','',
759  $lang->txt('ecs_new_econtent_subject'),
760  $message,array(),array('normal'));
761  }
static getInstanceByServerId($a_server_id)
Get singleton instance per server.
static _getLanguage($a_lang_key='')
Get langauge object.
Class Mail this class handles base functions for mail handling.
static _getAutoGeneratedMessageString($lang=null)
get auto generated info string
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setLocalInformation()

ilRemoteObjectBase::setLocalInformation (   $a_info)

set local information

Parameters
string$a_info

Definition at line 172 of file class.ilRemoteObjectBase.php.

Referenced by doRead().

173  {
174  $this->local_information = $a_info;
175  }
+ Here is the caller graph for this function:

◆ setMID()

ilRemoteObjectBase::setMID (   $a_mid)

set mid

Parameters
int$a_midmid

Definition at line 192 of file class.ilRemoteObjectBase.php.

Referenced by doRead(), and updateFromECSContent().

193  {
194  $this->mid = $a_mid;
195  }
+ Here is the caller graph for this function:

◆ setOrganization()

ilRemoteObjectBase::setOrganization (   $a_organization)

set organization

Parameters
string$a_organization

Definition at line 142 of file class.ilRemoteObjectBase.php.

Referenced by doRead(), and updateFromECSContent().

143  {
144  $this->organization = $a_organization;
145  }
+ Here is the caller graph for this function:

◆ setRemoteLink()

ilRemoteObjectBase::setRemoteLink (   $a_link)

set remote link

Parameters
string$a_linklink to original object

Definition at line 223 of file class.ilRemoteObjectBase.php.

Referenced by doRead(), and updateFromECSContent().

224  {
225  $this->remote_link = $a_link;
226  }
+ Here is the caller graph for this function:

◆ updateCustomFromECSContent()

ilRemoteObjectBase::updateCustomFromECSContent ( ilECSSetting  $a_server,
  $ecs_content 
)
protected

update remote object settings from ecs content

Parameters
ilECSSetting$a_server
object$a_ecs_contentobject with object settings

Definition at line 583 of file class.ilRemoteObjectBase.php.

Referenced by updateFromECSContent().

584  {
585 
586  }
+ Here is the caller graph for this function:

◆ updateFromECSContent()

ilRemoteObjectBase::updateFromECSContent ( ilECSSetting  $a_server,
  $a_ecs_content,
  $a_owner 
)

update remote object settings from ecs content

Parameters
ilECSSetting$a_server
object$a_ecs_contentobject with object settings
int$a_owner

Definition at line 448 of file class.ilRemoteObjectBase.php.

References $ilLog, getECSObjectType(), ilObject2\getId(), ilECSUtils\getMatchableContent(), ilECSSetting\getServerId(), ilECSCategoryMapping\handleUpdate(), ilECSUtils\lookupParticipantName(), ilObject2\setDescription(), setMID(), setOrganization(), setRemoteLink(), ilObject2\setTitle(), ilObject2\update(), and updateCustomFromECSContent().

Referenced by createFromECSEContent().

449  {
450  global $ilLog;
451 
452  $ilLog->write('updateFromECSContent: '.print_r($a_ecs_content, true));
453 
454  // Get organisation for owner (ObjectListGUI performance)
455  $organisation = null;
456  if($a_owner)
457  {
458  include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
459  $organisation = ilECSUtils::lookupParticipantName($a_owner, $a_server->getServerId());
460  $ilLog->write('found organisation: '.$organisation);
461  }
462 
463  $this->setMID($a_owner); // obsolete?
464  $this->setOrganization($organisation);
465  $this->setTitle($a_ecs_content->title);
466  $this->setDescription($a_ecs_content->abstract);
467  $this->setRemoteLink($a_ecs_content->url);
468 
469  $ilLog->write('updateCustomFromECSContent');
470  $this->updateCustomFromECSContent($a_server, $a_ecs_content);
471 
472  // we are updating late so custom values can be set
473 
474  $ilLog->write('ilObject->update()');
475  $this->update();
476 
477  include_once './Services/WebServices/ECS/classes/class.ilECSUtils.php';
478  $matchable_content = ilECSUtils::getMatchableContent($this->getECSObjectType(),
479  $a_server->getServerId(), $a_ecs_content, $a_owner);
480 
481  // rule-based category mapping
482  include_once './Services/WebServices/ECS/classes/class.ilECSCategoryMapping.php';
483  ilECSCategoryMapping::handleUpdate($this->getId(), $a_server->getServerId(),
484  $matchable_content);
485  }
static lookupParticipantName($a_owner, $a_server_id)
Lookup participant name.
setDescription($a_desc)
getServerId()
Get current server id.
static handleUpdate($a_obj_id, $a_server_id, $a_matchable_content)
Handle update of ecs content and create references.
setRemoteLink($a_link)
set remote link
updateCustomFromECSContent(ilECSSetting $a_server, $ecs_content)
update remote object settings from ecs content
getECSObjectType()
Get ECS resource identifier, e.g.
static getMatchableContent($a_resource_id, $a_server_id, $a_ecs_content, $a_owner)
Convert ECS content to rule matchable values.
setOrganization($a_organization)
set organization
setTitle($a_title)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $auth_hash

ilRemoteObjectBase::$auth_hash = ''
protected

Definition at line 21 of file class.ilRemoteObjectBase.php.

Referenced by createAuthResource(), and getFullRemoteLink().

◆ $local_information

ilRemoteObjectBase::$local_information
protected

Definition at line 17 of file class.ilRemoteObjectBase.php.

Referenced by getLocalInformation().

◆ $mid

ilRemoteObjectBase::$mid
protected

Definition at line 20 of file class.ilRemoteObjectBase.php.

Referenced by getMID(), and handleUpdate().

◆ $organization

ilRemoteObjectBase::$organization
protected

Definition at line 19 of file class.ilRemoteObjectBase.php.

Referenced by getOrganization().

◆ $realm_plain

ilRemoteObjectBase::$realm_plain = ''
protected

Definition at line 23 of file class.ilRemoteObjectBase.php.

Referenced by getRealmPlain().

◆ $remote_link

ilRemoteObjectBase::$remote_link
protected

Definition at line 18 of file class.ilRemoteObjectBase.php.

Referenced by getRemoteLink().

◆ MAIL_SENDER

const ilRemoteObjectBase::MAIL_SENDER = 6

Definition at line 25 of file class.ilRemoteObjectBase.php.

◆ OBJECT_OWNER

const ilRemoteObjectBase::OBJECT_OWNER = 6

Definition at line 26 of file class.ilRemoteObjectBase.php.


The documentation for this class was generated from the following file: