ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilLTITool Class Reference

LTI provider for LTI launch. More...

+ Inheritance diagram for ilLTITool:
+ Collaboration diagram for ilLTITool:

Public Member Functions

 __construct (ilLTIDataConnector $dataConnector)
 ilLTITool constructor. More...
 
- Public Member Functions inherited from ILIAS\LTI\ToolProvider\Tool
 __construct (DataConnector $dataConnector=null)
 Class constructor. More...
 
 initialize ()
 Initialise the tool. More...
 
 save ()
 Save the tool to the database. More...
 
 delete ()
 Delete the tool from the database. More...
 
 getMessageParameters ()
 Get the message parameters. More...
 
 handleRequest (bool $strictMode=false)
 Process an incoming request. More...
 
 setParameterConstraint (string $name, bool $required=true, int $maxLength=null, array $messageTypes=null)
 Add a parameter constraint to be checked on launch. More...
 
 getPlatforms ()
 Get an array of defined tool consumers. More...
 
 findService (string $format, array $methods)
 Find an offered service based on a media type and HTTP action(s) More...
 

Protected Member Functions

 onLaunch ()
 Process a valid launch request. More...
 
- Protected Member Functions inherited from ILIAS\LTI\ToolProvider\Tool
 onLaunch ()
 Send the tool proxy to the platform. More...
 
 onConfigure ()
 Process a valid configure request. More...
 
 onDashboard ()
 Process a valid dashboard request. More...
 
 onContentItem ()
 Process a valid content-item request. More...
 
 onContentItemUpdate ()
 Process a valid content-item update request. More...
 
 onRegister ()
 Process a valid tool proxy registration request. More...
 
 onRegistration ()
 Process a dynamic registration request. More...
 
 onLtiStartProctoring ()
 Process a valid start proctoring request. More...
 
 onLtiEndAssessment ()
 Process a valid end assessment request. More...
 
 onInitiateLogin (array $requestParameters, array &$authParameters)
 Process a login initiation request. More...
 
 onError ()
 Process a response to an invalid request. More...
 
 getPlatformConfiguration ()
 Fetch a platform's configuration data. More...
 
 getConfiguration (array $platformConfig)
 Prepare the tool's configuration data. More...
 
 sendRegistration (array $platformConfig, array $toolConfig)
 Send the tool registration to the platform. More...
 
 getPlatformToRegister (array $platformConfig, array $registrationConfig, bool $doSave=true)
 Initialise the platform to be registered. More...
 
 getRegistrationResponsePage (array $toolConfig)
 Prepare the page to complete a registration request. More...
 

Protected Attributes

ilLogger $logger = null
 
- Protected Attributes inherited from ILIAS\LTI\ToolProvider\Tool
string $redirectUrl = null
 URL to redirect user to on successful completion of the request. More...
 
array $mediaTypes = null
 Media types accepted by the platform. More...
 
array $contentTypes = null
 Content item types accepted by the platform. More...
 
array $fileTypes = null
 File types accepted by the platform. More...
 
array $documentTargets = null
 Document targets accepted by the platform. More...
 
string $output = null
 Default HTML to be displayed on a successful completion of the request. More...
 
string $errorOutput = null
 HTML to be displayed on an unsuccessful completion of the request and no return URL is available. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ILIAS\LTI\ToolProvider\Tool
static fromConsumerKey (string $key=null, DataConnector $dataConnector=null, bool $autoEnable=false)
 Load the tool from the database by its consumer key. More...
 
static fromInitiateLoginUrl (string $initiateLoginUrl, DataConnector $dataConnector=null, bool $autoEnable=false)
 Load the tool from the database by its initiate login URL. More...
 
static fromRecordId (string $id, DataConnector $dataConnector)
 Load the tool from the database by its record ID. More...
 
- Data Fields inherited from ILIAS\LTI\ToolProvider\Tool
const CONNECTION_ERROR_MESSAGE = 'Sorry, there was an error connecting you to the application.'
 Default connection error message. More...
 
const ID_SCOPE_ID_ONLY = 0
 Use ID value only. More...
 
const ID_SCOPE_GLOBAL = 1
 Prefix an ID with the consumer key. More...
 
const ID_SCOPE_CONTEXT = 2
 Prefix the ID with the consumer key and context ID. More...
 
const ID_SCOPE_RESOURCE = 3
 Prefix the ID with the consumer key and resource ID. More...
 
const ID_SCOPE_SEPARATOR = ':'
 Character used to separate each element of an ID. More...
 
ilLTIPlatform $platform
 Platform object. More...
 
string $returnUrl = null
 Return URL provided by platform. More...
 
UserResult $userResult = null
 UserResult object. More...
 
ResourceLink $resourceLink = null
 Resource link object. More...
 
Context $context = null
 Context object. More...
 
string $defaultEmail = ''
 Default email domain. More...
 
int $idScope = self::ID_SCOPE_ID_ONLY
 Scope to use for user IDs. More...
 
bool $allowSharing = false
 Whether shared resource link arrangements are permitted. More...
 
string $message = null
 Message for last request processed. More...
 
string $baseUrl = null
 Base URL for tool service. More...
 
Item $vendor = null
 Vendor details. More...
 
Item $product = null
 Product details. More...
 
array $requiredServices = null
 Services required by Tool. More...
 
array $optionalServices = null
 Optional services used by Tool. More...
 
array $resourceHandlers = null
 Resource handlers for Tool. More...
 
string $messageUrl = null
 Message URL for Tool. More...
 
string $initiateLoginUrl = null
 Initiate Login request URL for Tool. More...
 
array $redirectionUris = null
 Redirection URIs for Tool. More...
 
- Static Public Attributes inherited from ILIAS\LTI\ToolProvider\Tool
static array $MESSAGE_TYPES
 List of supported incoming message types. More...
 
static Tool $defaultTool = null
 Default tool for use with service requests. More...
 
static bool $authenticateUsingGet = false
 Use GET method for authentication request messages when true. More...
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilLTITool::__construct ( ilLTIDataConnector  $dataConnector)

ilLTITool constructor.

Parameters
ilLTIDataConnector$dataConnector

Definition at line 63 of file class.ilLTITool.php.

References ILIAS\LTI\ToolProvider\$dataConnector, $DIC, ilLTIDataConnector\getDataConnector(), ilLoggerFactory\getLogger(), ILIAS\Repository\logger(), and ILIAS\LTI\ToolProvider\Tool\setParameterConstraint().

64  {
65  global $DIC;
66  $this->logger = ilLoggerFactory::getLogger('ltis');
67  // $this->initialize();
68  if (empty($dataConnector)) {
69  $dataConnector = ilLTIDataConnector::getDataConnector();
70  }
71  $this->dataConnector = $dataConnector;
72  // parent::__construct($dataConnector);
73  $this->setParameterConstraint('resource_link_id', true, 50, array('basic-lti-launch-request'));
74  $this->setParameterConstraint('user_id', true, 128, array('basic-lti-launch-request'));
75  $this->setParameterConstraint('roles', true, null, array('basic-lti-launch-request'));
76  $this->setParameterConstraint('lis_person_contact_email_primary', true, 80, array('basic-lti-launch-request'));
77  }
setParameterConstraint(string $name, bool $required=true, int $maxLength=null, array $messageTypes=null)
Add a parameter constraint to be checked on launch.
Definition: Tool.php:521
static getLogger(string $a_component_id)
Get component logger.
static getDataConnector(object $db=null, string $dbTableNamePrefix='', string $type='')
global $DIC
Definition: feed.php:28
ilLTIDataConnector $dataConnector
Data connector object.
Definition: System.php:64
+ Here is the call graph for this function:

Member Function Documentation

◆ onLaunch()

ilLTITool::onLaunch ( )
protected

Process a valid launch request.

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

References ILIAS\Repository\logger().

82  : void
83  {
84  // save/update current user
85  if ($this->userResult instanceof \ILIAS\LTI\ToolProvider\User) {
86  $this->logger->debug("onLaunch - user");
87  $this->userResult->save();
88  }
89 
90  if ($this->context instanceof \ILIAS\LTI\ToolProvider\Context) {
91  $this->logger->debug("onLaunch - context");
92  $this->context->save();
93  }
94 
95  if ($this->resourceLink instanceof \ILIAS\LTI\ToolProvider\ResourceLink) {
96  $this->logger->debug("onLaunch - resource");
97  $this->resourceLink->save();
98  }
99  }
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class to represent a platform context.
Definition: Context.php:33
+ Here is the call graph for this function:

Field Documentation

◆ $logger

ilLogger ilLTITool::$logger = null
protected

Definition at line 57 of file class.ilLTITool.php.


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