Class to represent a platform. More...
Public Member Functions | |
| __construct ($dataConnector=null) | |
| Class constructor. | |
| initialize () | |
| Initialise the platform. | |
| initialise () | |
| Initialise the platform. | |
| bool | save () |
| Save the platform to the database. | |
| bool | delete () |
| Delete the platform from the database. | |
| string | getId () |
| Get the platform ID. | |
| string | getFamilyCode () |
| Get platform family code (as reported by last platform connection). | |
| DataConnector null | getDataConnector () |
| Get the data connector. | |
| AccessToken | getAccessToken () |
| Get the authorization access token. | |
| setAccessToken ($accessToken) | |
| Set the authorization access token. | |
| bool | getIsAvailable () |
| Is the platform available to accept launch requests? | |
| bool | hasToolSettingsService () |
| Check if the Tool Settings service is supported. | |
| mixed | getToolSettings ($simple=true) |
| Get Tool Settings. | |
| bool | setToolSettings ($settings=array()) |
| Set Tool Settings. | |
| array | getTools () |
| Get an array of defined tools. | |
| bool | hasAccessTokenService () |
| Check if the Access Token service is supported. | |
| array | getMessageParameters () |
| Get the message parameters. | |
| handleRequest () | |
| Process an incoming request. | |
Public Member Functions inherited from System | |
| int null | getRecordId () |
| Get the system record ID. | |
| setRecordId ($id) | |
| Sets the system record ID. | |
| string | getKey () |
| Get the consumer key. | |
| setKey ($key) | |
| Set the consumer key. | |
| string | getSetting ($name, $default='') |
| Get a setting value. | |
| setSetting ($name, $value=null) | |
| Set a setting value. | |
| array | getSettings () |
| Get an array of all setting values. | |
| setSettings ($settings) | |
| Set an array of all setting values. | |
| bool | saveSettings () |
| Save setting values. | |
| bool | hasJwt () |
| Check whether a JWT exists. | |
| ClientInterface | getJwt () |
| Get the JWT. | |
| array | getRawParameters () |
| Get the raw POST parameters. | |
| array | getMessageClaims ($fullyQualified=false) |
| Get the message claims. | |
| array string | signParameters ($url, $type, $version, $params) |
| Add the signature to an LTI message. | |
| array string | signMessage (&$url, $type, $version, $params, $loginHint=null, $ltiMessageHint=null) |
| Add the signature to an LTI message. | |
| string | sendMessage ($url, $type, $messageParams, $target='', $userId=null, $hint=null) |
| Generate a web page containing an auto-submitted form of LTI message parameters. | |
| string | signServiceRequest ($url, $method, $type, $data=null) |
| Generates the headers for an LTI service request. | |
| HttpMessage | doServiceRequest ($service, $method, $format, $data) |
| Perform a service request. | |
| bool | useOAuth1 () |
| Determine whether this consumer is using the OAuth 1 security model. | |
| mixed | addSignature ($endpoint, $data, $method='POST', $type=null, $nonce='', $hash=null, $timestamp=null) |
| Add the signature to an array of message parameters or to a header string. | |
| bool | checkMessage () |
| Verify the required properties of an LTI message. | |
| bool | verifySignature () |
| Verify the signature of a message. | |
Static Public Member Functions | |
| static Platform | fromConsumerKey ($key=null, $dataConnector=null, $autoEnable=false) |
| Load the platform from the database by its consumer key. | |
| static Platform | fromPlatformId ($platformId, $clientId, $deploymentId, $dataConnector=null, $autoEnable=false) |
| Load the platform from the database by its platform, client and deployment IDs. | |
| static Platform | fromRecordId ($id, $dataConnector) |
| Load the platform from the database by its record ID. | |
| static string | getStorageJS () |
| Get the JavaScript for handling storage postMessages from a tool. | |
Static Public Member Functions inherited from System | |
| static array | parseRoles ($roles, $ltiVersion=Util::LTI_VERSION1, $addPrincipalRole=false) |
| Parse a set of roles to comply with a specified version of LTI. | |
Public Attributes | |
| string null | $name = null |
| Local name of platform. | |
| string | $platformId = null |
| Platform ID. | |
| string | $clientId = null |
| Client ID. | |
| string | $deploymentId = null |
| Deployment ID. | |
| string | $authorizationServerId = null |
| Authorization server ID. | |
| string | $authenticationUrl = null |
| Login authentication URL. | |
| string | $accessTokenUrl = null |
| Access Token service URL. | |
| string null | $ltiVersion = null |
| LTI version (as reported by last platform connection). | |
| string null | $consumerName = null |
| Name of platform (as reported by last platform connection). | |
| string null | $consumerVersion = null |
| Platform version (as reported by last platform connection). | |
| object null | $profile = null |
| The platform profile data. | |
| object null | $toolProxy = null |
| The tool proxy. | |
| string null | $consumerGuid = null |
| Platform GUID (as reported by first platform connection). | |
| string null | $cssPath = null |
| Optional CSS path (as reported by last platform connection). | |
| bool | $protected = false |
| Whether the platform instance is protected by matching the consumer_guid value in incoming requests. | |
| int | $idScope = Tool::ID_SCOPE_ID_ONLY |
| Default scope to use when generating an Id value for a user. | |
| string | $defaultEmail = '' |
| Default email address (or email domain) to use when no email address is provided for a user. | |
| HttpMessage null | $lastServiceRequest = null |
| HttpMessage object for last service request. | |
Public Attributes inherited from System | |
| bool | $ok = true |
| True if the last request was successful. | |
| string null | $secret = null |
| Shared secret. | |
| string | $signatureMethod = 'HMAC-SHA1' |
| Method used for signing messages. | |
| string | $encryptionMethod = '' |
| Algorithm used for encrypting messages. | |
| DataConnector null | $dataConnector = null |
| Data connector object. | |
| string null | $rsaKey = null |
| RSA key in PEM or JSON format. | |
| array | $requiredScopes = array() |
| Scopes to request when obtaining an access token. | |
| string null | $kid = null |
| Key ID. | |
| string null | $jku = null |
| Endpoint for public key. | |
| string null | $reason = null |
| Error message for last request processed. | |
| array | $details = array() |
| Details for error message relating to last request processed. | |
| bool | $debugMode = false |
| Whether debug level messages are to be reported. | |
| bool | $enabled = false |
| Whether the system instance is enabled to accept connection requests. | |
| int null | $enableFrom = null |
| Timestamp from which the the system instance is enabled to accept connection requests. | |
| int null | $enableUntil = null |
| Timestamp until which the system instance is enabled to accept connection requests. | |
| int null | $lastAccess = null |
| Timestamp for date of last connection to this system. | |
| int null | $created = null |
| Timestamp for when the object was created. | |
| int null | $updated = null |
| Timestamp for when the object was last updated. | |
Static Public Attributes | |
| static | $MESSAGE_TYPES |
| List of supported incoming message types. | |
| static string null | $browserStorageFrame = null |
| Name of browser storage frame. | |
Protected Member Functions | |
| onInitiateLogin (&$url, &$loginHint, &$ltiMessageHint, $params) | |
| Save the hint and message parameters when sending an initiate login request. | |
| onAuthenticate () | |
| Check the hint and recover the message parameters for an authentication request. | |
| onContentItem () | |
| Process a valid content-item message. | |
| onLtiStartAssessment () | |
| Process a valid start assessment message. | |
| onError () | |
| Process a response to an invalid message. | |
Additional Inherited Members | |
Protected Attributes inherited from System | |
| JWS null | $jwt = null |
| JWT object, if any. | |
| array | $rawParameters = null |
| Raw message parameters. | |
| array null | $messageParameters = null |
| LTI message parameters. | |
Class to represent a platform.
| __construct | ( | $dataConnector = null | ) |
Class constructor.
| DataConnector | $dataConnector | A data connector object |
References System\$dataConnector, Context\getDataConnector(), and Platform\initialize().
| bool delete | ( | ) |
Delete the platform from the database.
|
static |
Load the platform from the database by its consumer key.
| string | $key | Consumer key |
| DataConnector | $dataConnector | A data connector object |
| bool | $autoEnable | true if the platform is to be enabled automatically (optional, default is false) |
References Util\logError().
Referenced by ToolConsumer\__construct(), and DataConnector_pdo\getPlatforms().
|
static |
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 | $dataConnector | A data connector object |
| bool | $autoEnable | True if the platform is to be enabled automatically (optional, default is false) |
References System\$dataConnector, System\$ok, and DataConnector\loadPlatform().
|
static |
Load the platform from the database by its record ID.
| string | $id | The platform record ID |
| DataConnector | $dataConnector | A data connector object |
| AccessToken getAccessToken | ( | ) |
Get the authorization access token.
| DataConnector null getDataConnector | ( | ) |
Get the data connector.
| string getFamilyCode | ( | ) |
Get platform family code (as reported by last platform connection).
| string getId | ( | ) |
Get the platform ID.
The ID will be the consumer key if one exists, otherwise a concatenation of the platform/client/deployment IDs
| bool getIsAvailable | ( | ) |
Is the platform available to accept launch requests?
| array getMessageParameters | ( | ) |
Get the message parameters.
|
static |
Get the JavaScript for handling storage postMessages from a tool.
| array getTools | ( | ) |
Get an array of defined tools.
References System\$ok, and System\getSetting().
| mixed getToolSettings | ( | $simple = true | ) |
Get Tool Settings.
| bool | $simple | True if all the simple media type is to be used (optional, default is true) |
| bool hasAccessTokenService | ( | ) |
Check if the Access Token service is supported.
| bool hasToolSettingsService | ( | ) |
Check if the Tool Settings service is supported.
| initialise | ( | ) |
Initialise the platform.
Synonym for initialize().
|
protected |
Check the hint and recover the message parameters for an authentication request.
Override this method if the data has been saved elsewhere.
|
protected |
Save the hint and message parameters when sending an initiate login request.
Override this method to save the data elsewhere.
| 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 |
| bool save | ( | ) |
Save the platform to the database.
| setAccessToken | ( | $accessToken | ) |
Set the authorization access token.
| AccessToken | $accessToken | Access token |
| bool setToolSettings | ( | $settings = array() | ) |
Set Tool Settings.
| array | $settings | An associative array of settings (optional, default is none) |
| string $accessTokenUrl = null |
Access Token service URL.
$accessTokenUrl
| string $authenticationUrl = null |
Login authentication URL.
$authenticationUrl
| string $authorizationServerId = null |
Authorization server ID.
$authorizationServerId
|
static |
Name of browser storage frame.
$browserStorageFrame
| string $clientId = null |
Client ID.
$clientId
| string null $consumerGuid = null |
Platform GUID (as reported by first platform connection).
$consumerGuid
| string null $consumerName = null |
Name of platform (as reported by last platform connection).
$consumerName
| string null $consumerVersion = null |
Platform version (as reported by last platform connection).
$consumerVersion
| string null $cssPath = null |
Optional CSS path (as reported by last platform connection).
$cssPath
| string $defaultEmail = '' |
Default email address (or email domain) to use when no email address is provided for a user.
$defaultEmail
| string $deploymentId = null |
Deployment ID.
$deploymentId
| int $idScope = Tool::ID_SCOPE_ID_ONLY |
Default scope to use when generating an Id value for a user.
$idScope
| HttpMessage null $lastServiceRequest = null |
HttpMessage object for last service request.
$lastServiceRequest
| string null $ltiVersion = null |
LTI version (as reported by last platform connection).
$ltiVersion
|
static |
List of supported incoming message types.
| string null $name = null |
Local name of platform.
$name
| string $platformId = null |
Platform ID.
$platformId
| object null $profile = null |
The platform profile data.
$profile
| bool $protected = false |
Whether the platform instance is protected by matching the consumer_guid value in incoming requests.
$protected
| object null $toolProxy = null |
The tool proxy.
$toolProxy