ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\LTI\ToolProvider\ApiHook Namespace Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

Data Structures

class  ApiContext
 Class to implement context services for a platform via its proprietary API. More...
 
class  ApiPlatform
 Class to implement services for a platform via its proprietary API. More...
 
class  ApiResourceLink
 Class to implement resource link services for a platform via its proprietary API. More...
 
class  ApiTool
 Class to implement tool specific functions for LTI messages. More...
 

Functions

static registerApiHook (string $hookName, string $familyCode, string $className)
 Register the availability of an API hook. More...
 
static getApiHook (string $hookName, string $familyCode)
 Get the class name for an API hook. More...
 
static hasApiHook (string $hookName, string $familyCode)
 Check if an API hook is registered. More...
 
static hasConfiguredApiHook (string $hookName, string $familyCode, $sourceObject)
 Check if an API hook is registered and configured. More...
 

Variables

trait ApiHook
 Trait to handle API hook registrations. More...
 
static string $CONTEXT_ID_HOOK = "ContextId"
 Context Id hook name. More...
 
static string $GROUPS_SERVICE_HOOK = "Groups"
 Course Groups service hook name. More...
 
static string $MEMBERSHIPS_SERVICE_HOOK = "Memberships"
 Memberships service hook name. More...
 
static string $OUTCOMES_SERVICE_HOOK = "Outcomes"
 Outcomes service hook name. More...
 
static string $TOOL_SETTINGS_SERVICE_HOOK = "ToolSettings"
 Tool Settings service hook name. More...
 
static string $ACCESS_TOKEN_SERVICE_HOOK = "AccessToken"
 Access Token service hook name. More...
 
static array $API_HOOKS = array()
 API hook class names. More...
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning

Function Documentation

◆ getApiHook()

static ILIAS\LTI\ToolProvider\ApiHook\getApiHook ( string  $hookName,
string  $familyCode 
)
staticprivate

◆ hasApiHook()

static ILIAS\LTI\ToolProvider\ApiHook\hasApiHook ( string  $hookName,
string  $familyCode 
)
staticprivate

Check if an API hook is registered.

Parameters
string$hookNameName of hook
string$familyCodeFamily code for current platform
Returns
bool True if the API hook is registered

Definition at line 100 of file ApiHook.php.

References ILIAS\LTI\ToolProvider\ApiHook\$API_HOOKS.

100  : bool
101  {
102  $class = self::class;
103  return isset(self::$API_HOOKS["{$class}-{$hookName}-{$familyCode}"]);
104  }
static array $API_HOOKS
API hook class names.
Definition: ApiHook.php:68

◆ hasConfiguredApiHook()

static ILIAS\LTI\ToolProvider\ApiHook\hasConfiguredApiHook ( string  $hookName,
string  $familyCode,
  $sourceObject 
)
staticprivate

Check if an API hook is registered and configured.

Parameters
string$hookNameName of hook
string$familyCode
Platform | Context | ResourceLink$sourceObjectSource object for which hook is to be used //UK: added: |
\ILIAS\LTI\ToolProvider\Platform | \ILIAS\LTI\ToolProvider\Context | \ILIAS\LTI\ToolProvider\ResourceLink | \ILIAS\LTI\ToolProvider\Tool$sourceObjectSource object for which hook is to be used
Returns
bool True if the API hook is registered and configured

Definition at line 115 of file ApiHook.php.

References ILIAS\LTI\ToolProvider\ApiHook\$API_HOOKS.

Referenced by ILIAS\LTI\ToolProvider\Tool\authenticate(), ILIAS\LTI\ToolProvider\ResourceLink\doOutcomesService(), ILIAS\LTI\ToolProvider\Context\getGroups(), ILIAS\LTI\ToolProvider\Context\getMemberships(), ILIAS\LTI\ToolProvider\ResourceLink\getMemberships(), ILIAS\LTI\ToolProvider\Platform\getToolSettings(), ILIAS\LTI\ToolProvider\Context\getToolSettings(), ILIAS\LTI\ToolProvider\ResourceLink\getToolSettings(), ILIAS\LTI\ToolProvider\Platform\hasAccessTokenService(), ILIAS\LTI\ToolProvider\Context\hasGroupService(), ILIAS\LTI\ToolProvider\Context\hasMembershipsService(), ILIAS\LTI\ToolProvider\ResourceLink\hasMembershipsService(), ILIAS\LTI\ToolProvider\ResourceLink\hasOutcomesService(), ILIAS\LTI\ToolProvider\Platform\hasToolSettingsService(), ILIAS\LTI\ToolProvider\Context\hasToolSettingsService(), ILIAS\LTI\ToolProvider\ResourceLink\hasToolSettingsService(), ILIAS\LTI\ToolProvider\Platform\setToolSettings(), ILIAS\LTI\ToolProvider\Context\setToolSettings(), and ILIAS\LTI\ToolProvider\ResourceLink\setToolSettings().

115  : bool
116  {
117  $ok = false;
118  $class = self::class;
119  if (isset(self::$API_HOOKS["{$class}-{$hookName}-{$familyCode}"])) {
120  $className = self::$API_HOOKS["{$class}-{$hookName}-{$familyCode}"];
121  $hook = new $className($sourceObject);
122  $ok = $hook->isConfigured();
123  }
124 
125  return $ok;
126  }
static array $API_HOOKS
API hook class names.
Definition: ApiHook.php:68
+ Here is the caller graph for this function:

◆ registerApiHook()

static ILIAS\LTI\ToolProvider\ApiHook\registerApiHook ( string  $hookName,
string  $familyCode,
string  $className 
)
static

Register the availability of an API hook.

Parameters
string$hookNameName of hook
string$familyCodeFamily code for current platform
string$classNameName of implementing class
Returns
void

Definition at line 77 of file ApiHook.php.

References ILIAS\LTI\ToolProvider\ApiHook\$API_HOOKS.

78  {
79  $objectClass = get_class();
80  self::$API_HOOKS["{$objectClass}-{$hookName}-{$familyCode}"] = $className;
81  }
static array $API_HOOKS
API hook class names.
Definition: ApiHook.php:68

Variable Documentation

◆ $ACCESS_TOKEN_SERVICE_HOOK

string ILIAS::LTI::ToolProvider::ApiHook\$ACCESS_TOKEN_SERVICE_HOOK = "AccessToken"
static

Access Token service hook name.

Definition at line 63 of file ApiHook.php.

Referenced by ILIAS\LTI\ToolProvider\Platform\hasAccessTokenService().

◆ $API_HOOKS

array ILIAS::LTI::ToolProvider::ApiHook\$API_HOOKS = array()
staticprivate

◆ $CONTEXT_ID_HOOK

string ILIAS::LTI::ToolProvider::ApiHook\$CONTEXT_ID_HOOK = "ContextId"
static

Context Id hook name.

Definition at line 38 of file ApiHook.php.

Referenced by ILIAS\LTI\ToolProvider\Tool\authenticate().

◆ $GROUPS_SERVICE_HOOK

string ILIAS::LTI::ToolProvider::ApiHook\$GROUPS_SERVICE_HOOK = "Groups"
static

Course Groups service hook name.

Definition at line 43 of file ApiHook.php.

Referenced by ILIAS\LTI\ToolProvider\Context\getGroups(), and ILIAS\LTI\ToolProvider\Context\getMemberships().

◆ $MEMBERSHIPS_SERVICE_HOOK

◆ $OUTCOMES_SERVICE_HOOK

string ILIAS::LTI::ToolProvider::ApiHook\$OUTCOMES_SERVICE_HOOK = "Outcomes"
static

◆ $TOOL_SETTINGS_SERVICE_HOOK

◆ ApiHook

trait ILIAS::LTI::ToolProvider::ApiHook\ApiHook
Initial value:
{
public static string $USER_ID_HOOK = "UserId"

Trait to handle API hook registrations.

Author
Stephen P Vickers steph.nosp@m.en@s.nosp@m.pvsof.nosp@m.twar.nosp@m.eprod.nosp@m.ucts.nosp@m..com

Definition at line 29 of file ApiHook.php.