ILIAS  release_8 Revision v8.24
ilLTIPlatform Class Reference

LTI provider for LTI launch. More...

+ Inheritance diagram for ilLTIPlatform:
+ Collaboration diagram for ilLTIPlatform:

Public Member Functions

 __construct (ilLTIDataConnector $dataConnector=null)
 Class constructor. More...
 
 initialize ()
 Initialise the platform. More...
 
 setExtConsumerId (int $a_id)
 
 getExtConsumerId ()
 
 setRefId (int $a_ref_id)
 
 getRefId ()
 
 setTitle (string $title)
 
 getTitle ()
 
 setDescription (string $description)
 
 getDescription ()
 
 setPrefix (string $prefix)
 
 getPrefix ()
 
 setSecret (string $secret)
 
 getSecret ()
 
 createSecret ()
 Create a secret. More...
 
 setLanguage (string $lang)
 
 getLanguage ()
 
 setActive (bool $value)
 
 getActive ()
 
 setRole (int $role_id)
 
 getRole ()
 
 setEnabled (bool $a_status)
 
 getEnabled ()
 
 saveGlobalToolConsumerSettings (ilLTIDataConnector $dataConnector)
 Save global consumer settings. More...
 
 deleteGlobalToolConsumerSettings (ilLTIDataConnector $dataConnector)
 Delete global tool consumer settings. More...
 
 saveLTI (ilLTIDataConnector $dataConnector)
 Save the tool consumer to the database with ILIAS extension. More...
 

Static Public Member Functions

static fromPlatformId (string $platformId, string $clientId, string $deploymentId, ilLTIDataConnector $dataConnector=null, bool $autoEnable=false)
 Load the platform from the database by its platform, client and deployment IDs. More...
 
static fromConsumerKey (?string $key=null, $dataConnector=null, bool $autoEnable=false)
 Load the platform from the database by its consumer key. More...
 
static fromRecordId (int $id, ilLTIDataConnector $dataConnector)
 Load the platform from the database by its record ID. More...
 
static fromExternalConsumerId (int $id, ilLTIDataConnector $dataConnector)
 
static fromGlobalSettingsAndRefId (int $a_ext_consumer_id, int $a_ref_id, ilLTIDataConnector $a_data_connector)
 Load consumer from global settings and ref_id. More...
 

Protected Attributes

int $ref_id = 0
 
int $ext_consumer_id = 0
 
string $title = ''
 
string $description = ''
 
string $prefix = ''
 
string $user_language = ''
 
int $role = 0
 
bool $active = false
 

Private Attributes

array $settings = null
 Setting values (LTI parameters, custom parameters and local parameters). More...
 
int $id = null
 System ID value. More...
 
string $key = null
 Consumer key/client ID value. More...
 

Detailed Description

LTI provider for LTI launch.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

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

Constructor & Destructor Documentation

◆ __construct()

ilLTIPlatform::__construct ( ilLTIDataConnector  $dataConnector = null)

Class constructor.

Parameters
ilLTIDataConnector | null$dataConnectorA data connector object

Definition at line 102 of file class.ilLTIPlatform.php.

103 {
104 $this->initialize();
105 if (empty($dataConnector)) {
107 }
108 $this->dataConnector = $dataConnector;
109 }
static getDataConnector(object $db=null, string $dbTableNamePrefix='', string $type='')
initialize()
Initialise the platform.
ilLTIDataConnector $dataConnector
Data connector object.
Definition: System.php:64

References ILIAS\LTI\ToolProvider\$dataConnector, ilLTIDataConnector\getDataConnector(), and initialize().

+ Here is the call graph for this function:

Member Function Documentation

◆ createSecret()

ilLTIPlatform::createSecret ( )

Create a secret.

Definition at line 221 of file class.ilLTIPlatform.php.

221 : void
222 {
223 $this->setSecret(\ILIAS\LTI\ToolProvider\Util::getRandomString(12));
224 }
setSecret(string $secret)
Class ChatMainBarProvider \MainMenu\Provider.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References setSecret().

+ Here is the call graph for this function:

◆ deleteGlobalToolConsumerSettings()

ilLTIPlatform::deleteGlobalToolConsumerSettings ( ilLTIDataConnector  $dataConnector)

Delete global tool consumer settings.

Parameters
ilLTIDataConnector$dataConnector

Definition at line 382 of file class.ilLTIPlatform.php.

382 : void
383 {
385 }
deleteGlobalToolConsumerSettings(ilLTIPlatform $platform)
Delete global tool consumer settings.

References ILIAS\LTI\ToolProvider\$dataConnector, and ilLTIDataConnector\deleteGlobalToolConsumerSettings().

+ Here is the call graph for this function:

◆ fromConsumerKey()

static ilLTIPlatform::fromConsumerKey ( ?string  $key = null,
  $dataConnector = null,
bool  $autoEnable = false 
)
static

Load the platform from the database by its consumer key.

Parameters
string$keyConsumer key
ilLTIDataConnector$dataConnectorA data connector object
bool$autoEnabletrue if the platform is to be enabled automatically (optional, default is false)
Returns
\ilLTIPlatform Platform The platform object

Definition at line 300 of file class.ilLTIPlatform.php.

301 {
302 $platform = new ilLTIPlatform($dataConnector);
303 $platform->initialize();
304 $platform->setKey($key);
305 ilLoggerFactory::getLogger('ltis')->debug('Loading with key: ' . $platform->getKey());
306 $dataConnector->loadPlatform($platform);
308 return $platform;
309 }
loadGlobalToolConsumerSettings(ilLTIPlatform $platform)
Load global tool consumer settings in consumer.
loadPlatform(\ILIAS\LTI\ToolProvider\Platform $platform)
Load platform object.
LTI provider for LTI launch.
string $key
Consumer key/client ID value.
static getLogger(string $a_component_id)
Get component logger.

References ILIAS\LTI\ToolProvider\$dataConnector, $key, ilLoggerFactory\getLogger(), ilLTIDataConnector\loadGlobalToolConsumerSettings(), and ilLTIDataConnector\loadPlatform().

Referenced by ILIAS\LTI\ToolProvider\parseMessage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromExternalConsumerId()

static ilLTIPlatform::fromExternalConsumerId ( int  $id,
ilLTIDataConnector  $dataConnector 
)
static
Parameters
int$id
ilLTIDataConnector$dataConnector
Returns
ilLTIPlatform

Definition at line 334 of file class.ilLTIPlatform.php.

335 {
336 $platform = new ilLTIPlatform($dataConnector);
337 //$platform->setRecordId((int) $id);
338 //$dataConnector->loadPlatform($platform);
339 $platform->initialize();
340 $platform->setExtConsumerId($id);
342 $platform->initialize();
343 }
344 return $platform;
345 }
int $id
System ID value.

References ILIAS\LTI\ToolProvider\$dataConnector, $id, and ilLTIDataConnector\loadGlobalToolConsumerSettings().

Referenced by ilObjLTIAdministrationGUI\changeStatusLTIConsumer(), ilObjLTIAdministrationGUI\deleteLTIConsumer(), ilObjLTIAdministrationGUI\editConsumer(), and ilObjLTIAdministrationGUI\updateLTIConsumer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromGlobalSettingsAndRefId()

static ilLTIPlatform::fromGlobalSettingsAndRefId ( int  $a_ext_consumer_id,
int  $a_ref_id,
ilLTIDataConnector  $a_data_connector 
)
static

Load consumer from global settings and ref_id.

Parameters
int$a_ext_consumer_id
int$a_ref_id
ilLTIDataConnector$a_data_connector
Returns
ilLTIPlatform

Definition at line 354 of file class.ilLTIPlatform.php.

355 {
356 $toolConsumer = new ilLTIPlatform(null, $a_data_connector);
357 $toolConsumer->initialize();
358 $toolConsumer->setExtConsumerId($a_ext_consumer_id);
359 $toolConsumer->setRefId($a_ref_id);
360
361 $consumer_pk = $a_data_connector->lookupRecordIdByGlobalSettingsAndRefId($toolConsumer);
362 if ($consumer_pk != null) {
363 $toolConsumer = self::fromRecordId($consumer_pk, $a_data_connector);
364 }
365 return $toolConsumer;
366 }
lookupRecordIdByGlobalSettingsAndRefId(ilLTIPlatform $platform)
Lookup record id for global settings and ref_id.
static fromRecordId(int $id, ilLTIDataConnector $dataConnector)
Load the platform from the database by its record ID.

References fromRecordId(), and ilLTIDataConnector\lookupRecordIdByGlobalSettingsAndRefId().

Referenced by ilLTIProviderObjectSettingGUI\initObjectSettingsForm(), and ilLTIProviderObjectSettingGUI\updateSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromPlatformId()

static ilLTIPlatform::fromPlatformId ( string  $platformId,
string  $clientId,
string  $deploymentId,
ilLTIDataConnector  $dataConnector = null,
bool  $autoEnable = false 
)
static

Load the platform from the database by its platform, client and deployment IDs.

Parameters
string$platformIdThe platform ID
string$clientIdThe client ID
string$deploymentIdThe deployment ID
ilLTIDataConnector$dataConnectorA data connector object
bool$autoEnableTrue if the platform is to be enabled automatically (optional, default is false)
Returns
Platform The platform object

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

282 {
283 $platform = new ilLTIPlatform($dataConnector);
284 $platform->initialize();
285 $platform->platformId = $platformId;
286 $platform->clientId = $clientId;
287 $platform->deploymentId = $deploymentId;
288 $dataConnector->loadPlatform($platform);
290 return $platform;
291 }
$clientId
Definition: ltiregend.php:27

References $clientId, ILIAS\LTI\ToolProvider\$dataConnector, ilLTIDataConnector\loadGlobalToolConsumerSettings(), and ilLTIDataConnector\loadPlatform().

Referenced by ILIAS\LTI\ToolProvider\parseMessage(), and ILIAS\LTI\ToolProvider\Tool\sendAuthenticationRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromRecordId()

static ilLTIPlatform::fromRecordId ( int  $id,
ilLTIDataConnector  $dataConnector 
)
static

Load the platform from the database by its record ID.

Parameters
int$idThe platform record ID
ilLTIDataConnector$dataConnectorDatabase connection object
Returns
\ilLTIPlatform Platform The platform object

Definition at line 317 of file class.ilLTIPlatform.php.

318 {
319// $platform = new static($dataConnector);
320 $platform = new ilLTIPlatform($dataConnector);
321 $platform->initialize();
322 $platform->setRecordId((int) $id);
323 ilLoggerFactory::getLogger('ltis')->info('Loading with record id: ' . $platform->getRecordId());
324 $dataConnector->loadPlatform($platform);
326 return $platform;
327 }

References ILIAS\LTI\ToolProvider\$dataConnector, $id, ilLoggerFactory\getLogger(), ilLTIDataConnector\loadGlobalToolConsumerSettings(), and ilLTIDataConnector\loadPlatform().

Referenced by fromGlobalSettingsAndRefId(), ILIAS\LTI\ToolProvider\Context\getPlatform(), and ilAuthProviderLTI\lookupConsumer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActive()

ilLTIPlatform::getActive ( )

Definition at line 244 of file class.ilLTIPlatform.php.

244 : bool
245 {
246 return $this->active;
247 }

References $active.

Referenced by ilLTIDataConnector\saveGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ getDescription()

ilLTIPlatform::getDescription ( )

Definition at line 193 of file class.ilLTIPlatform.php.

193 : string
194 {
195 return $this->description;
196 }

References $description.

Referenced by ilLTIDataConnector\saveGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ getEnabled()

ilLTIPlatform::getEnabled ( )

Definition at line 265 of file class.ilLTIPlatform.php.

265 : bool
266 {
267 return $this->enabled;
268 }
bool $enabled
Whether the system instance is enabled to accept connection requests.
Definition: System.php:123

References ILIAS\LTI\ToolProvider\$enabled.

◆ getExtConsumerId()

◆ getLanguage()

ilLTIPlatform::getLanguage ( )

Definition at line 234 of file class.ilLTIPlatform.php.

234 : string
235 {
237 }

References $user_language.

Referenced by ilAuthProviderLTI\createUser(), and ilLTIDataConnector\saveGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ getPrefix()

ilLTIPlatform::getPrefix ( )

Definition at line 203 of file class.ilLTIPlatform.php.

203 : string
204 {
205 return $this->prefix;
206 }

References $prefix.

Referenced by ilAuthProviderLTI\createUser(), and ilLTIDataConnector\saveGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ getRefId()

ilLTIPlatform::getRefId ( )

Definition at line 167 of file class.ilLTIPlatform.php.

167 : int
168 {
169 return $this->ref_id;
170 }

References $ref_id.

Referenced by ilLTIDataConnector\lookupRecordIdByGlobalSettingsAndRefId(), and ilLTIDataConnector\saveToolConsumerILIAS().

+ Here is the caller graph for this function:

◆ getRole()

ilLTIPlatform::getRole ( )

Definition at line 254 of file class.ilLTIPlatform.php.

254 : int
255 {
256 return $this->role;
257 }

References $role.

Referenced by ilAuthProviderLTI\createUser(), ilLTIDataConnector\saveGlobalToolConsumerSettings(), and ilAuthProviderLTI\updateUser().

+ Here is the caller graph for this function:

◆ getSecret()

ilLTIPlatform::getSecret ( )

Definition at line 213 of file class.ilLTIPlatform.php.

213 : ?string
214 {
215 return $this->secret;
216 }
string $secret
Shared secret.
Definition: System.php:43

References ILIAS\LTI\ToolProvider\$secret.

◆ getTitle()

ilLTIPlatform::getTitle ( )

Definition at line 183 of file class.ilLTIPlatform.php.

183 : string
184 {
185 return $this->title;
186 }

References $title.

Referenced by ilLTIDataConnector\saveGlobalToolConsumerSettings(), and ilLTIDataConnector\saveToolConsumerILIAS().

+ Here is the caller graph for this function:

◆ initialize()

ilLTIPlatform::initialize ( )

Initialise the platform.

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

114 : void
115 {
116 $this->id = null;
117 $this->key = null;
118 $this->name = null;
119 $this->secret = null;
120 $this->signatureMethod = 'HMAC-SHA1';
121 $this->encryptionMethod = '';
122 $this->rsaKey = null;
123 $this->kid = null;
124 $this->jku = '';
125 $this->platformId = null;
126 $this->clientId = null;
127 $this->deploymentId = null;
128 $this->ltiVersion = null;
129 $this->consumerName = null;
130 $this->consumerVersion = null;
131 $this->consumerGuid = null;
132 $this->profile = null;
133 $this->toolProxy = null;
134 $this->settings = array();
135 $this->protected = false;
136 $this->enabled = false;
137 $this->enableFrom = null;
138 $this->enableUntil = null;
139 $this->lastAccess = null;
141 $this->defaultEmail = '';
142 $this->created = null;
143 $this->updated = null;
144 //added
145 $this->authorizationServerId = '';
146 $this->authenticationUrl = '';
147 $this->accessTokenUrl = '';
148 $this->debugMode = false;
149 }
const ID_SCOPE_ID_ONLY
Use ID value only.
Definition: Tool.php:51

References ILIAS\LTI\ToolProvider\Tool\ID_SCOPE_ID_ONLY, and ILIAS\Repository\settings().

Referenced by __construct(), and ilLTIDataConnector\deleteGlobalToolConsumerSettings().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveGlobalToolConsumerSettings()

ilLTIPlatform::saveGlobalToolConsumerSettings ( ilLTIDataConnector  $dataConnector)

Save global consumer settings.

Parameters
ilLTIDataConnector$dataConnector

Definition at line 373 of file class.ilLTIPlatform.php.

373 : void
374 {
376 }
saveGlobalToolConsumerSettings(ilLTIPlatform $platform)
Save lti_ext_consumer.

References ILIAS\LTI\ToolProvider\$dataConnector, and ilLTIDataConnector\saveGlobalToolConsumerSettings().

+ Here is the call graph for this function:

◆ saveLTI()

ilLTIPlatform::saveLTI ( ilLTIDataConnector  $dataConnector)

Save the tool consumer to the database with ILIAS extension.

Parameters
ilLTIDataConnector$dataConnector
Returns
boolean True if the object was successfully saved

Definition at line 392 of file class.ilLTIPlatform.php.

392 : bool
393 {
395 return $ok;
396 }
saveToolConsumerILIAS(ilLTIPlatform $platform)
Save extended tool consumer object with ILIAS extensions.

References ILIAS\LTI\ToolProvider\$dataConnector, and ilLTIDataConnector\saveToolConsumerILIAS().

+ Here is the call graph for this function:

◆ setActive()

ilLTIPlatform::setActive ( bool  $value)

Definition at line 239 of file class.ilLTIPlatform.php.

239 : void
240 {
241 $this->active = $value;
242 }

Referenced by ilLTIDataConnector\loadGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ setDescription()

ilLTIPlatform::setDescription ( string  $description)

Definition at line 188 of file class.ilLTIPlatform.php.

188 : void
189 {
190 $this->description = $description;
191 }

References $description.

Referenced by ilLTIDataConnector\loadGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ setEnabled()

ilLTIPlatform::setEnabled ( bool  $a_status)

Definition at line 260 of file class.ilLTIPlatform.php.

260 : void
261 {
262 $this->enabled = $a_status;
263 }

◆ setExtConsumerId()

ilLTIPlatform::setExtConsumerId ( int  $a_id)

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

152 : void
153 {
154 $this->ext_consumer_id = $a_id;
155 }

Referenced by ilLTIDataConnector\saveGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ setLanguage()

ilLTIPlatform::setLanguage ( string  $lang)
Parameters
string$lang

Definition at line 229 of file class.ilLTIPlatform.php.

229 : void
230 {
231 $this->user_language = $lang;
232 }
$lang
Definition: xapiexit.php:26

References $lang.

Referenced by ilLTIDataConnector\loadGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ setPrefix()

ilLTIPlatform::setPrefix ( string  $prefix)

Definition at line 198 of file class.ilLTIPlatform.php.

198 : void
199 {
200 $this->prefix = $prefix;
201 }

References $prefix.

Referenced by ilLTIDataConnector\loadGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ setRefId()

ilLTIPlatform::setRefId ( int  $a_ref_id)

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

162 : void
163 {
164 $this->ref_id = $a_ref_id;
165 }

◆ setRole()

ilLTIPlatform::setRole ( int  $role_id)

Definition at line 249 of file class.ilLTIPlatform.php.

249 : void
250 {
251 $this->role = $role_id;
252 }

Referenced by ilLTIDataConnector\loadGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

◆ setSecret()

ilLTIPlatform::setSecret ( string  $secret)

Definition at line 208 of file class.ilLTIPlatform.php.

208 : void
209 {
210 $this->secret = $secret;
211 }

References ILIAS\LTI\ToolProvider\$secret.

Referenced by createSecret().

+ Here is the caller graph for this function:

◆ setTitle()

ilLTIPlatform::setTitle ( string  $title)

Definition at line 177 of file class.ilLTIPlatform.php.

177 : void
178 {
179 $this->title = $title;
180 // $this->consumerName = $title;
181 }

References $title.

Referenced by ilLTIDataConnector\loadGlobalToolConsumerSettings().

+ Here is the caller graph for this function:

Field Documentation

◆ $active

bool ilLTIPlatform::$active = false
protected

Definition at line 75 of file class.ilLTIPlatform.php.

Referenced by getActive().

◆ $description

string ilLTIPlatform::$description = ''
protected

Definition at line 55 of file class.ilLTIPlatform.php.

Referenced by getDescription(), and setDescription().

◆ $ext_consumer_id

int ilLTIPlatform::$ext_consumer_id = 0
protected

Definition at line 45 of file class.ilLTIPlatform.php.

Referenced by getExtConsumerId().

◆ $id

int null ilLTIPlatform::$id = null
private

System ID value.

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

Referenced by fromExternalConsumerId(), and fromRecordId().

◆ $key

string null ilLTIPlatform::$key = null
private

Consumer key/client ID value.

Definition at line 96 of file class.ilLTIPlatform.php.

Referenced by fromConsumerKey().

◆ $prefix

string ilLTIPlatform::$prefix = ''
protected

Definition at line 60 of file class.ilLTIPlatform.php.

Referenced by getPrefix(), and setPrefix().

◆ $ref_id

int ilLTIPlatform::$ref_id = 0
protected

Definition at line 40 of file class.ilLTIPlatform.php.

Referenced by getRefId().

◆ $role

int ilLTIPlatform::$role = 0
protected

Definition at line 70 of file class.ilLTIPlatform.php.

Referenced by getRole().

◆ $settings

array ilLTIPlatform::$settings = null
private

Setting values (LTI parameters, custom parameters and local parameters).

Definition at line 82 of file class.ilLTIPlatform.php.

◆ $title

string ilLTIPlatform::$title = ''
protected

Definition at line 50 of file class.ilLTIPlatform.php.

Referenced by getTitle(), and setTitle().

◆ $user_language

string ilLTIPlatform::$user_language = ''
protected

Definition at line 65 of file class.ilLTIPlatform.php.

Referenced by getLanguage().


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