ILIAS  trunk Revision v11.0_alpha-1749-g1a06bdef097
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilECSEnrolmentStatusCommandQueueHandler Class Reference
+ Inheritance diagram for ilECSEnrolmentStatusCommandQueueHandler:
+ Collaboration diagram for ilECSEnrolmentStatusCommandQueueHandler:

Public Member Functions

 __construct (ilECSSetting $server)
 Constructor. More...
 
 getServer ()
 Get server. More...
 
 getMid ()
 Get mid. More...
 
 handleCreate (ilECSSetting $server, $a_content_id)
 Handle create. More...
 
 handleDelete (ilECSSetting $server, $a_content_id)
 Handle delete. More...
 
 handleUpdate (ilECSSetting $server, $a_content_id)
 Handle update. More...
 
- Public Member Functions inherited from ilECSCommandQueueHandler
 handleCreate (ilECSSetting $server, int $a_content_id)
 Handle create event. More...
 
 handleUpdate (ilECSSetting $server, int $a_content_id)
 Handle update. More...
 
 handleDelete (ilECSSetting $server, int $a_content_id)
 Handle delete action. More...
 

Protected Member Functions

 doUpdate ($a_usr_id, ilECSEnrolmentStatus $status)
 Perform update. More...
 

Protected Attributes

ilRecommendedContentManager $recommended_content_manager
 

Private Attributes

ilECSSetting $server
 
int $mid = 0
 
ilLogger $logger
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilECSEnrolmentStatusCommandQueueHandler::__construct ( ilECSSetting  $server)

Constructor.

Definition at line 36 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

References $DIC, $server, ILIAS\Repository\logger(), and ILIAS\UI\examples\Progress\Bar\server().

37  {
38  global $DIC;
39 
40  $this->logger = $DIC->logger()->wsrv();
41  $this->server = $server;
42  $this->recommended_content_manager = new ilRecommendedContentManager();
43  }
server()
description: > This example shows how a Progress Bar can be rendered and updated by the server...
Definition: server.php:43
global $DIC
Definition: shib_login.php:22
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
+ Here is the call graph for this function:

Member Function Documentation

◆ doUpdate()

ilECSEnrolmentStatusCommandQueueHandler::doUpdate (   $a_usr_id,
ilECSEnrolmentStatus  $status 
)
protected

Perform update.

Definition at line 109 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

References $ref_id, ilObject\_getAllReferences(), ilECSEnrolmentStatus\getId(), ilECSImportManager\getInstance(), ilECSEnrolmentStatus\getStatus(), ILIAS\Repository\logger(), ilECSEnrolmentStatus\STATUS_ACCOUNT_DEACTIVATED, ilECSEnrolmentStatus\STATUS_ACTIVE, ilECSEnrolmentStatus\STATUS_DENIED, ilECSEnrolmentStatus\STATUS_PENDING, ilECSEnrolmentStatus\STATUS_REJECTED, and ilECSEnrolmentStatus\STATUS_UNSUBSCRIBED.

Referenced by handleCreate().

109  : bool
110  {
111  $obj_ids = ilECSImportManager::getInstance()->lookupObjIdsByContentId($status->getId());
112  $obj_id = end($obj_ids);
113  $ref_ids = ilObject::_getAllReferences($obj_id);
114  $ref_id = end($ref_ids);
115 
116 
117  if (!$ref_id) {
118  // Remote object not found
119  return true;
120  }
121 
122  switch ($status->getStatus()) {
124  // nothing todo in the moment: maybe send mail
125  break;
126 
128  $this->logger->info(': Add recommended content: ' . $a_usr_id . ' ' . $ref_id . ' ' . $obj_id);
129  // deactivated for now, see discussion at
130  // https://docu.ilias.de/goto_docu_wiki_wpage_5620_1357.html
131  //$this->recommended_content_manager->addObjectRecommendation($a_usr_id, $ref_id);
132  break;
133 
138  $this->logger->info(': Remove recommended content: ' . $a_usr_id . ' ' . $ref_id . ' ' . $obj_id);
139  $this->recommended_content_manager->removeObjectRecommendation($a_usr_id, $ref_id);
140  break;
141  }
142  return true;
143  }
static _getAllReferences(int $id)
get all reference ids for object ID
static getInstance()
Get the singleton instance of this ilECSImportManager.
$ref_id
Definition: ltiauth.php:65
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getMid()

ilECSEnrolmentStatusCommandQueueHandler::getMid ( )

Get mid.

Definition at line 56 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

References $mid.

◆ getServer()

ilECSEnrolmentStatusCommandQueueHandler::getServer ( )

◆ handleCreate()

ilECSEnrolmentStatusCommandQueueHandler::handleCreate ( ilECSSetting  $server,
  $a_content_id 
)

Handle create.

Definition at line 64 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

References Vendor\Package\$e, doUpdate(), ilECSEnrolmentStatus\ID_UID, ILIAS\Repository\logger(), and ilUtil\parseImportId().

64  : bool
65  {
66  try {
67  $enrolment_con = new ilECSEnrolmentStatusConnector($server);
68  $status = $enrolment_con->getEnrolmentStatus($a_content_id);
69  $this->logger->debug(print_r($status, true));
70  $this->logger->debug($status->getPersonIdType());
71  $this->logger->debug($status->getPersonId());
72  $i = $status->getPersonIdType();
73  if ($i === ilECSEnrolmentStatus::ID_UID) {
74  $id_arr = ilUtil::parseImportId($status->getPersonId());
75  $this->logger->debug('Handling status change to ' . $status->getStatus() . ' for user ' . $id_arr['id']);
76  $this->doUpdate($id_arr['id'], $status);
77  } else {
78  $this->logger->debug('Not implemented yes: person id type: ' . $status->getPersonIdType());
79  }
80  } catch (ilECSConnectorException $e) {
81  $this->logger->error('Enrollment status change failed with message: ' . $e->getMessage());
82  }
83  return true;
84  }
doUpdate($a_usr_id, ilECSEnrolmentStatus $status)
Perform update.
static parseImportId(string $a_import_id)
Parse an ilias import id Typically of type il_[IL_INST_ID]_[OBJ_TYPE]_[OBJ_ID] returns array( 'orig' ...
Connector for course member ressource.
+ Here is the call graph for this function:

◆ handleDelete()

ilECSEnrolmentStatusCommandQueueHandler::handleDelete ( ilECSSetting  $server,
  $a_content_id 
)

Handle delete.

Definition at line 89 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

89  : bool
90  {
91  // nothing todo
92  return true;
93  }

◆ handleUpdate()

ilECSEnrolmentStatusCommandQueueHandler::handleUpdate ( ilECSSetting  $server,
  $a_content_id 
)

Handle update.

Definition at line 99 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

99  : bool
100  {
101  // Shouldn't happen
102  return true;
103  }

Field Documentation

◆ $logger

ilLogger ilECSEnrolmentStatusCommandQueueHandler::$logger
private

◆ $mid

int ilECSEnrolmentStatusCommandQueueHandler::$mid = 0
private

Definition at line 27 of file class.ilECSEnrolmentStatusCommandQueueHandler.php.

Referenced by getMid().

◆ $recommended_content_manager

ilRecommendedContentManager ilECSEnrolmentStatusCommandQueueHandler::$recommended_content_manager
protected

◆ $server

ilECSSetting ilECSEnrolmentStatusCommandQueueHandler::$server
private

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

Referenced by __construct(), and getServer().


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