ILIAS
release_8 Revision v8.23
|
Class to represent a platform. More...
Public Member Functions | |
getAccessToken () | |
Get the authorization access token. More... | |
setAccessToken (AccessToken $accessToken) | |
Set the authorization access token. More... | |
__construct (DataConnector $dataConnector=null) | |
Class constructor. More... | |
initialize () | |
Initialise the platform. More... | |
initialise () | |
Initialise the platform. More... | |
save () | |
Save the platform to the database. More... | |
delete () | |
Delete the platform from the database. More... | |
getId () | |
Get the platform ID. More... | |
getFamilyCode () | |
Get platform family code (as reported by last platform connection). More... | |
getDataConnector () | |
Get the data connector. More... | |
getIsAvailable () | |
Is the platform available to accept launch requests? More... | |
hasToolSettingsService () | |
Check if the Tool Settings service is supported. More... | |
getToolSettings (bool $simple=true) | |
Get Tool Settings. More... | |
setToolSettings (array $settings=array()) | |
Set Tool Settings. More... | |
getTools () | |
Get an array of defined tools. More... | |
hasAccessTokenService () | |
Check if the Access Token service is supported. More... | |
getMessageParameters () | |
Get the message parameters. More... | |
handleRequest () | |
Process an incoming request. More... | |
Static Public Member Functions | |
static | fromConsumerKey (string $key=null, DataConnector $dataConnector=null, bool $autoEnable=false) |
Load the platform from the database by its consumer key. More... | |
Data Fields | |
string | $name = null |
Local name of platform. More... | |
string | $platformId = null |
Platform ID. More... | |
string | $clientId = null |
Client ID. More... | |
string | $deploymentId = null |
Deployment ID. More... | |
string | $authorizationServerId = null |
Authorization server ID. More... | |
string | $authenticationUrl = null |
Login authentication URL. More... | |
string | $accessTokenUrl = null |
Access Token service URL. More... | |
string | $ltiVersion = null |
LTI version (as reported by last platform connection). More... | |
string | $consumerName = null |
Name of tool consumer (as reported by last tool consumer connection). More... | |
string | $consumerVersion = null |
Tool consumer version (as reported by last tool consumer connection). More... | |
object | $profile = null |
The platform profile data. More... | |
object | $toolProxy = null |
The tool proxy. More... | |
string | $consumerGuid = null |
Tool consumer GUID (as reported by first tool consumer connection). More... | |
string | $cssPath = null |
Optional CSS path (as reported by last tool consumer connection). More... | |
bool | $protected = false |
Whether the platform instance is protected by matching the consumer_guid value in incoming requests. More... | |
int | $idScope = Tool::ID_SCOPE_ID_ONLY |
Default scope to use when generating an Id value for a user. More... | |
string | $defaultEmail = '' |
Default email address (or email domain) to use when no email address is provided for a user. More... | |
HTTPMessage | $lastServiceRequest = null |
HttpMessage object for last service request. More... | |
Static Public Attributes | |
static array | $MESSAGE_TYPES |
List of supported incoming message types. More... | |
Protected Member Functions | |
onInitiateLogin (string &$url, string &$loginHint, string &$ltiMessageHint, array $params) | |
Load the platform from the database by its platform, client and deployment IDs. More... | |
onAuthenticate () | |
Check the hint and recover the message parameters for an authentication request. More... | |
onContentItem () | |
Process a valid content-item message. More... | |
onLtiStartAssessment () | |
Process a valid start assessment message. More... | |
onError () | |
Process a response to an invalid message. More... | |
Private Member Functions | |
authenticate () | |
Check the authenticity of the LTI message. More... | |
handleAuthenticationRequest () | |
Process an authentication request. More... | |
Private Attributes | |
AccessToken | $accessToken = null |
Access token to authorize service requests. More... | |
Class to represent a platform.
Definition at line 35 of file Platform.php.
ILIAS\LTI\ToolProvider\Platform::__construct | ( | DataConnector | $dataConnector = null | ) |
Class constructor.
DataConnector | null | $dataConnector | A data connector object |
Definition at line 204 of file Platform.php.
References ILIAS\LTI\ToolProvider\$dataConnector, ILIAS\LTI\ToolProvider\DataConnector\DataConnector\getDataConnector(), and ILIAS\LTI\ToolProvider\Platform\initialize().
|
private |
Check the authenticity of the LTI message.
The platform, resource link and user objects will be initialised if the request is valid.
Definition at line 646 of file Platform.php.
References ILIAS\LTI\ToolProvider\checkMessage(), and ILIAS\LTI\ToolProvider\verifySignature().
Referenced by ILIAS\LTI\ToolProvider\Platform\handleRequest().
ILIAS\LTI\ToolProvider\Platform::delete | ( | ) |
Delete the platform from the database.
Definition at line 273 of file Platform.php.
|
static |
Load the platform from the database by its consumer key.
string | null | $key | Consumer key |
DataConnector | null | $dataConnector | A data connector object |
bool | $autoEnable | true if the platform is to be enabled automatically (optional, default is false) |
Definition at line 496 of file Platform.php.
References ILIAS\LTI\ToolProvider\$dataConnector, ILIAS\LTI\ToolProvider\$key, and ilLTIDataConnector\loadPlatform().
Referenced by ILIAS\LTI\ToolProvider\Tool\authenticate().
ILIAS\LTI\ToolProvider\Platform::getAccessToken | ( | ) |
Get the authorization access token.
Definition at line 158 of file Platform.php.
References ILIAS\LTI\ToolProvider\Platform\$accessToken.
ILIAS\LTI\ToolProvider\Platform::getDataConnector | ( | ) |
Get the data connector.
Definition at line 328 of file Platform.php.
References ILIAS\LTI\ToolProvider\$dataConnector.
Referenced by ILIAS\LTI\ToolProvider\Context\fromPlatform(), and ILIAS\LTI\ToolProvider\ResourceLink\fromPlatform().
ILIAS\LTI\ToolProvider\Platform::getFamilyCode | ( | ) |
Get platform family code (as reported by last platform connection).
Definition at line 309 of file Platform.php.
References ILIAS\LTI\ToolProvider\Platform\$consumerVersion.
Referenced by ILIAS\LTI\ToolProvider\Platform\getToolSettings(), ILIAS\LTI\ToolProvider\Platform\hasAccessTokenService(), ILIAS\LTI\ToolProvider\Platform\hasToolSettingsService(), and ILIAS\LTI\ToolProvider\Platform\setToolSettings().
ILIAS\LTI\ToolProvider\Platform::getId | ( | ) |
Get the platform ID.
The ID will be the consumer key if one exists, otherwise a concatenation of the platform/client/deployment IDs
Definition at line 285 of file Platform.php.
References ILIAS\LTI\ToolProvider\Platform\$clientId, ILIAS\LTI\ToolProvider\Platform\$deploymentId, ILIAS\LTI\ToolProvider\$id, ILIAS\LTI\ToolProvider\$key, and ILIAS\LTI\ToolProvider\Platform\$platformId.
ILIAS\LTI\ToolProvider\Platform::getIsAvailable | ( | ) |
Is the platform available to accept launch requests?
Definition at line 338 of file Platform.php.
References ILIAS\LTI\ToolProvider\$enabled.
ILIAS\LTI\ToolProvider\Platform::getMessageParameters | ( | ) |
Get the message parameters.
Definition at line 444 of file Platform.php.
References ILIAS\LTI\ToolProvider\$messageParameters, and ILIAS\LTI\ToolProvider\parseMessage().
Referenced by ILIAS\LTI\ToolProvider\Platform\handleRequest().
ILIAS\LTI\ToolProvider\Platform::getTools | ( | ) |
Get an array of defined tools.
Definition at line 420 of file Platform.php.
ILIAS\LTI\ToolProvider\Platform::getToolSettings | ( | bool | $simple = true | ) |
Get Tool Settings.
bool | $simple | True if all the simple media type is to be used (optional, default is true) |
Definition at line 372 of file Platform.php.
References $service, ILIAS\LTI\ToolProvider\$settings, ILIAS\LTI\ToolProvider\ApiHook\$TOOL_SETTINGS_SERVICE_HOOK, $url, ILIAS\LTI\ToolProvider\ApiHook\getApiHook(), ILIAS\LTI\ToolProvider\Platform\getFamilyCode(), ILIAS\getSetting(), and ILIAS\LTI\ToolProvider\ApiHook\hasConfiguredApiHook().
|
private |
Process an authentication request.
Generates an auto-submit form to respond to the request.
Definition at line 661 of file Platform.php.
References ILIAS\LTI\ToolProvider\Tool\$defaultTool, $scopes, ILIAS\LTI\ToolProvider\addSignature(), exit, ILIAS\LTI\ToolProvider\Util\getRequestParameters(), ILIAS\LTI\ToolProvider\Platform\onAuthenticate(), and ILIAS\LTI\ToolProvider\Util\sendForm().
Referenced by ILIAS\LTI\ToolProvider\Platform\handleRequest().
ILIAS\LTI\ToolProvider\Platform::handleRequest | ( | ) |
Process an incoming request.
Definition at line 456 of file Platform.php.
References ILIAS\LTI\ToolProvider\Util\$logLevel, ILIAS\LTI\ToolProvider\Platform\authenticate(), ILIAS\LTI\ToolProvider\doCallback(), ILIAS\LTI\ToolProvider\Platform\getMessageParameters(), ILIAS\LTI\ToolProvider\Util\getRequestParameters(), ILIAS\LTI\ToolProvider\Platform\handleAuthenticationRequest(), ILIAS\LTI\ToolProvider\Util\logError(), ILIAS\LTI\ToolProvider\Util\LOGLEVEL_DEBUG, ILIAS\LTI\ToolProvider\Util\logRequest(), and ILIAS\LTI\ToolProvider\Platform\onError().
ILIAS\LTI\ToolProvider\Platform::hasAccessTokenService | ( | ) |
Check if the Access Token service is supported.
Definition at line 430 of file Platform.php.
References ILIAS\LTI\ToolProvider\ApiHook\$ACCESS_TOKEN_SERVICE_HOOK, ILIAS\LTI\ToolProvider\Platform\getFamilyCode(), ILIAS\getSetting(), and ILIAS\LTI\ToolProvider\ApiHook\hasConfiguredApiHook().
ILIAS\LTI\ToolProvider\Platform::hasToolSettingsService | ( | ) |
Check if the Tool Settings service is supported.
Definition at line 358 of file Platform.php.
References ILIAS\LTI\ToolProvider\ApiHook\$TOOL_SETTINGS_SERVICE_HOOK, ILIAS\LTI\ToolProvider\Platform\getFamilyCode(), ILIAS\getSetting(), and ILIAS\LTI\ToolProvider\ApiHook\hasConfiguredApiHook().
ILIAS\LTI\ToolProvider\Platform::initialise | ( | ) |
Initialise the platform.
Synonym for initialize().
Definition at line 253 of file Platform.php.
References ILIAS\LTI\ToolProvider\Platform\initialize().
ILIAS\LTI\ToolProvider\Platform::initialize | ( | ) |
Initialise the platform.
Definition at line 216 of file Platform.php.
References ILIAS\LTI\ToolProvider\Tool\ID_SCOPE_ID_ONLY, and ILIAS\Repository\settings().
Referenced by ILIAS\LTI\ToolProvider\Platform\__construct(), ILIAS\LTI\ToolProvider\DataConnector\DataConnector\deletePlatform(), and ILIAS\LTI\ToolProvider\Platform\initialise().
|
protected |
Check the hint and recover the message parameters for an authentication request.
Override this method if the data has been saved elsewhere.
Definition at line 585 of file Platform.php.
References ILIAS\LTI\ToolProvider\Tool\$defaultTool, and ILIAS\LTI\ToolProvider\Util\getRequestParameters().
Referenced by ILIAS\LTI\ToolProvider\Platform\handleAuthenticationRequest().
|
protected |
Process a valid content-item message.
Definition at line 612 of file Platform.php.
References ILIAS\LTI\ToolProvider\Platform\onError().
|
protected |
Process a response to an invalid message.
Definition at line 630 of file Platform.php.
Referenced by ILIAS\LTI\ToolProvider\Platform\handleRequest(), ILIAS\LTI\ToolProvider\Platform\onContentItem(), and ILIAS\LTI\ToolProvider\Platform\onLtiStartAssessment().
|
protected |
Load the platform from the database by its platform, client and deployment IDs.
string | $platformId | The platform ID |
string | $clientId | The client ID |
string | $deploymentId | The deployment ID |
DataConnector | null | $dataConnector | A data connector object |
bool | $autoEnable | True if the platform is to be enabled automatically (optional, default is false) |
int | $id | The platform record ID //UK: changed to int |
DataConnector | $dataConnector | A data connector object |
string | $url | The message URL |
string | $loginHint | The ID of the user |
string | $ltiMessageHint | The message hint being sent to the tool |
array | $params | An associative array of message parameters |
Definition at line 563 of file Platform.php.
|
protected |
Process a valid start assessment message.
Definition at line 621 of file Platform.php.
References ILIAS\LTI\ToolProvider\Platform\onError().
ILIAS\LTI\ToolProvider\Platform::save | ( | ) |
Save the platform to the database.
Definition at line 263 of file Platform.php.
ILIAS\LTI\ToolProvider\Platform::setAccessToken | ( | AccessToken | $accessToken | ) |
Set the authorization access token.
AccessToken | $accessToken | Access token |
Definition at line 167 of file Platform.php.
References ILIAS\LTI\ToolProvider\Platform\$accessToken.
ILIAS\LTI\ToolProvider\Platform::setToolSettings | ( | array | $settings = array() | ) |
Set Tool Settings.
array | $settings | An associative array of settings (optional, default is none) |
Definition at line 397 of file Platform.php.
References $service, ILIAS\LTI\ToolProvider\$settings, ILIAS\LTI\ToolProvider\ApiHook\$TOOL_SETTINGS_SERVICE_HOOK, $url, ILIAS\LTI\ToolProvider\ApiHook\getApiHook(), ILIAS\LTI\ToolProvider\Platform\getFamilyCode(), ILIAS\getSetting(), and ILIAS\LTI\ToolProvider\ApiHook\hasConfiguredApiHook().
|
private |
Access token to authorize service requests.
Definition at line 151 of file Platform.php.
Referenced by ILIAS\LTI\ToolProvider\Platform\getAccessToken(), and ILIAS\LTI\ToolProvider\Platform\setAccessToken().
string null ILIAS\LTI\ToolProvider\Platform::$accessTokenUrl = null |
Access Token service URL.
Definition at line 95 of file Platform.php.
string null ILIAS\LTI\ToolProvider\Platform::$authenticationUrl = null |
Login authentication URL.
Definition at line 88 of file Platform.php.
string null ILIAS\LTI\ToolProvider\Platform::$authorizationServerId = null |
Authorization server ID.
Definition at line 81 of file Platform.php.
string null ILIAS\LTI\ToolProvider\Platform::$clientId = null |
Client ID.
Definition at line 67 of file Platform.php.
Referenced by ILIAS\LTI\ToolProvider\Platform\getId().
string null ILIAS\LTI\ToolProvider\Platform::$consumerGuid = null |
Tool consumer GUID (as reported by first tool consumer connection).
Definition at line 137 of file Platform.php.
string null ILIAS\LTI\ToolProvider\Platform::$consumerName = null |
Name of tool consumer (as reported by last tool consumer connection).
Definition at line 109 of file Platform.php.
string null ILIAS\LTI\ToolProvider\Platform::$consumerVersion = null |
Tool consumer version (as reported by last tool consumer connection).
Definition at line 116 of file Platform.php.
Referenced by ILIAS\LTI\ToolProvider\Platform\getFamilyCode().
string ILIAS\LTI\ToolProvider\Platform::$cssPath = null |
Optional CSS path (as reported by last tool consumer connection).
Definition at line 144 of file Platform.php.
string ILIAS\LTI\ToolProvider\Platform::$defaultEmail = '' |
Default email address (or email domain) to use when no email address is provided for a user.
Definition at line 191 of file Platform.php.
string null ILIAS\LTI\ToolProvider\Platform::$deploymentId = null |
Deployment ID.
Definition at line 74 of file Platform.php.
Referenced by ILIAS\LTI\ToolProvider\Platform\getId().
int ILIAS\LTI\ToolProvider\Platform::$idScope = Tool::ID_SCOPE_ID_ONLY |
Default scope to use when generating an Id value for a user.
Definition at line 184 of file Platform.php.
HttpMessage null ILIAS\LTI\ToolProvider\Platform::$lastServiceRequest = null |
HttpMessage object for last service request.
Definition at line 198 of file Platform.php.
string null ILIAS\LTI\ToolProvider\Platform::$ltiVersion = null |
LTI version (as reported by last platform connection).
Definition at line 102 of file Platform.php.
|
static |
List of supported incoming message types.
Definition at line 43 of file Platform.php.
string null ILIAS\LTI\ToolProvider\Platform::$name = null |
Local name of platform.
Definition at line 53 of file Platform.php.
string null ILIAS\LTI\ToolProvider\Platform::$platformId = null |
Platform ID.
Definition at line 60 of file Platform.php.
Referenced by ILIAS\LTI\ToolProvider\Platform\getId().
object null ILIAS\LTI\ToolProvider\Platform::$profile = null |
The platform profile data.
Definition at line 123 of file Platform.php.
bool ILIAS\LTI\ToolProvider\Platform::$protected = false |
Whether the platform instance is protected by matching the consumer_guid value in incoming requests.
Definition at line 177 of file Platform.php.
object null ILIAS\LTI\ToolProvider\Platform::$toolProxy = null |
The tool proxy.
Definition at line 130 of file Platform.php.