ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ilCloudConnector Class Reference

ilCloudConnector class Needed to check if a a plugin making a conncection to a service like GoogleDrive (simply named "service" is active or not. More...

+ Collaboration diagram for ilCloudConnector:

Static Public Member Functions

static getActiveServices ()
 
static checkServiceActive ($name)
 
static getServiceClass ($service_name, $obj_id, $connect=true)
 
static getPluginClass ($service_name, $obj_id)
 
static getPluginHookClass ($service_name)
 
static getSettingsGUIClass (ilCloudPluginService $plugin_service_class)
 
static getActionListGUIClass (ilCloudPluginService $plugin_service_class)
 
static getItemCreationListGUIClass (ilCloudPluginService $plugin_service_class)
 
static getInitGUIClass (ilCloudPluginService $plugin_service_class)
 
static getFileTreeGUIClass (ilCloudPluginService $plugin_service_class, ilCloudFileTree $file_tree)
 
static getCreateFolderGUIClass (ilCloudPluginService $plugin_service_class)
 
static getUploadGUIClass (ilCloudPluginService $plugin_service_class)
 
static getDeleteGUIClass (ilCloudPluginService $plugin_service_class)
 
static getHeaderActionGUIClass (ilCloudPluginService $plugin_service_class)
 
static getCreationGUIClass (ilCloudPluginService $plugin_service_class)
 
static getInfoScreenGUIClass (ilCloudPluginService $plugin_service_class)
 

Static Protected Member Functions

static getFullClassName ($service_name, $class_name)
 

Detailed Description

ilCloudConnector class Needed to check if a a plugin making a conncection to a service like GoogleDrive (simply named "service" is active or not.

Further the getXXXClass functions of this class are used to check if a given class is extended and if so returning the extended version and if not returning the core version.

Author
Timon Amstutz timon.nosp@m..ams.nosp@m.tutz@.nosp@m.ilub.nosp@m..unib.nosp@m.e.ch
Version
$Id$

Definition at line 30 of file class.ilCloudConnector.php.

Member Function Documentation

◆ checkServiceActive()

static ilCloudConnector::checkServiceActive (   $name)
static
Parameters
string$name
Returns
bool
Exceptions
ilCloudException

Definition at line 61 of file class.ilCloudConnector.php.

References $name, getActiveServices(), ilCloudException\NO_SERVICE_SELECTED, and ilCloudException\SERVICE_NOT_ACTIVE.

Referenced by ilObjCloudAccess\_checkAccess(), ilObjCloudGUI\executeCommand(), and ilCloudPluginInitGUI\initGUI().

62  {
63  if (!$name) {
65  }
66 
67  if (array_key_exists($name, ilCloudConnector::getActiveServices())) {
68  return true;
69  } else {
71  }
72  }
if($format !==null) $name
Definition: metadata.php:230
Class ilCloudException.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActionListGUIClass()

static ilCloudConnector::getActionListGUIClass ( ilCloudPluginService  $plugin_service_class)
static
Parameters
$service_name
$obj_id
Returns
ilCloudPluginActionListGUI

Definition at line 166 of file class.ilCloudConnector.php.

References getFullClassName(), and ilCloudPluginService\getPluginHookObject().

Referenced by ilObjCloudGUI\asyncGetActionListContent(), ilObjCloudGUI\executeCommand(), and ilCloudPluginFileTreeGUI\getItemHtml().

167  {
168  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "ActionListGUI");
169 
170  return new $class_name($plugin_service_class);
171  }
getPluginHookObject()
For shorter access.
static getFullClassName($service_name, $class_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActiveServices()

static ilCloudConnector::getActiveServices ( )
static
Returns
array
Exceptions
ilCloudException

Definition at line 37 of file class.ilCloudConnector.php.

References $DIC, $service, and ilCloudException\NO_SERVICE_ACTIVE.

Referenced by checkServiceActive(), ilObjCloudGUI\executeCommand(), getServiceClass(), and ilObjCloudGUI\initCreateForm().

38  {
39  global $DIC;
40  $ilPluginAdmin = $DIC['ilPluginAdmin'];
41 
42  $cloud_services = $ilPluginAdmin->getActivePluginsForSlot("Modules", "Cloud", "cldh");
43  if (!$cloud_services) {
45  }
46  $services_names = array();
47  foreach ($cloud_services as $service) {
48  $services_names[$service] = $service;
49  }
50 
51  return $services_names;
52  }
$service
Definition: result.php:17
$DIC
Definition: xapitoken.php:46
Class ilCloudException.
+ Here is the caller graph for this function:

◆ getCreateFolderGUIClass()

static ilCloudConnector::getCreateFolderGUIClass ( ilCloudPluginService  $plugin_service_class)
static
Parameters
string$name
int$obj_id
Returns
ilCloudPluginCreateFolderGUI

Definition at line 223 of file class.ilCloudConnector.php.

References getFullClassName(), and ilCloudPluginService\getPluginHookObject().

Referenced by ilObjCloudGUI\executeCommand().

224  {
225  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "CreateFolderGUI");
226 
227  return new $class_name($plugin_service_class);
228  }
getPluginHookObject()
For shorter access.
static getFullClassName($service_name, $class_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getCreationGUIClass()

static ilCloudConnector::getCreationGUIClass ( ilCloudPluginService  $plugin_service_class)
static
Parameters
ilCloudPluginService$plugin_service_class
Returns
ilCloudPluginCreationGUI

Definition at line 276 of file class.ilCloudConnector.php.

References getFullClassName(), and ilCloudPluginService\getPluginHookObject().

Referenced by ilObjCloudGUI\initCreateForm().

277  {
278  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "CreationGUI");
279 
280  return new $class_name($plugin_service_class);
281  }
getPluginHookObject()
For shorter access.
static getFullClassName($service_name, $class_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getDeleteGUIClass()

static ilCloudConnector::getDeleteGUIClass ( ilCloudPluginService  $plugin_service_class)
static
Parameters
ilCloudPluginService$plugin_service_class
Returns
ilCloudPluginDeleteGUI

Definition at line 250 of file class.ilCloudConnector.php.

References getFullClassName(), and ilCloudPluginService\getPluginHookObject().

Referenced by ilObjCloudGUI\executeCommand().

251  {
252  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "DeleteGUI");
253 
254  return new $class_name($plugin_service_class);
255  }
getPluginHookObject()
For shorter access.
static getFullClassName($service_name, $class_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFileTreeGUIClass()

static ilCloudConnector::getFileTreeGUIClass ( ilCloudPluginService  $plugin_service_class,
ilCloudFileTree  $file_tree 
)
static
Parameters
$service_name
$obj_id
ilCloudPluginFileTree
Returns
ilCloudPluginFileTreeGUI

Definition at line 209 of file class.ilCloudConnector.php.

References getFullClassName(), and ilCloudPluginService\getPluginHookObject().

Referenced by ilObjCloudGUI\asyncGetBlock(), and ilObjCloudGUI\executeCommand().

210  {
211  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "FileTreeGUI");
212 
213  return new $class_name($plugin_service_class, $file_tree);
214  }
getPluginHookObject()
For shorter access.
static getFullClassName($service_name, $class_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getFullClassName()

static ilCloudConnector::getFullClassName (   $service_name,
  $class_name 
)
staticprotected
Parameters
string$service_name
string$class_name
Returns
string

Definition at line 81 of file class.ilCloudConnector.php.

Referenced by getActionListGUIClass(), getCreateFolderGUIClass(), getCreationGUIClass(), getDeleteGUIClass(), getFileTreeGUIClass(), getHeaderActionGUIClass(), getInfoScreenGUIClass(), getInitGUIClass(), getItemCreationListGUIClass(), getPluginClass(), getPluginHookClass(), getServiceClass(), getSettingsGUIClass(), and getUploadGUIClass().

82  {
83  if (file_exists("./Customizing/global/plugins/Modules/Cloud/CloudHook/" . $service_name . "/classes/class.il" . $service_name . $class_name . ".php")) {
84  include_once("./Customizing/global/plugins/Modules/Cloud/CloudHook/" . $service_name . "/classes/class.il" . $service_name . $class_name . ".php");
85  $class_full_name = "il" . $service_name . $class_name;
86 
87  return $class_full_name;
88  }
89 
90  return "ilCloudPlugin" . $class_name;
91  }
+ Here is the caller graph for this function:

◆ getHeaderActionGUIClass()

static ilCloudConnector::getHeaderActionGUIClass ( ilCloudPluginService  $plugin_service_class)
static
Parameters
ilCloudPluginService$plugin_service_class
Returns
ilCloudPluginHeaderActionGUI

Definition at line 263 of file class.ilCloudConnector.php.

References getFullClassName(), and ilCloudPluginService\getPluginHookObject().

Referenced by ilObjCloudGUI\addHeaderAction(), ilObjCloudGUI\executeCommand(), and ilObjCloudListGUI\getCommands().

264  {
265  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "HeaderActionGUI");
266 
267  return new $class_name($plugin_service_class);
268  }
getPluginHookObject()
For shorter access.
static getFullClassName($service_name, $class_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInfoScreenGUIClass()

static ilCloudConnector::getInfoScreenGUIClass ( ilCloudPluginService  $plugin_service_class)
static
Parameters
ilCloudPluginService$plugin_service_class
Returns
ilCloudPluginInfoScreenGUI

Definition at line 289 of file class.ilCloudConnector.php.

References getFullClassName(), and ilCloudPluginService\getPluginHookObject().

Referenced by ilObjCloudGUI\infoScreenForward().

290  {
291  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "InfoScreenGUI");
292 
293  return new $class_name($plugin_service_class);
294  }
getPluginHookObject()
For shorter access.
static getFullClassName($service_name, $class_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getInitGUIClass()

static ilCloudConnector::getInitGUIClass ( ilCloudPluginService  $plugin_service_class)
static
Parameters
string$name
int$obj_id
Returns
ilCloudPluginInitGUI

Definition at line 194 of file class.ilCloudConnector.php.

References getFullClassName(), and ilCloudPluginService\getPluginHookObject().

Referenced by ilObjCloudGUI\executeCommand(), and ilObjCloudGUI\render().

195  {
196  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "InitGUI");
197 
198  return new $class_name($plugin_service_class);
199  }
getPluginHookObject()
For shorter access.
static getFullClassName($service_name, $class_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getItemCreationListGUIClass()

static ilCloudConnector::getItemCreationListGUIClass ( ilCloudPluginService  $plugin_service_class)
static
Parameters
string$name
int$obj_id
Returns
ilCloudPluginItemCreationListGUI

Definition at line 180 of file class.ilCloudConnector.php.

References getFullClassName(), and ilCloudPluginService\getPluginHookObject().

Referenced by ilCloudPluginInitGUI\addToolbar(), and ilObjCloudGUI\executeCommand().

181  {
182  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "ItemCreationListGUI");
183 
184  return new $class_name($plugin_service_class);
185  }
getPluginHookObject()
For shorter access.
static getFullClassName($service_name, $class_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPluginClass()

static ilCloudConnector::getPluginClass (   $service_name,
  $obj_id 
)
static
Parameters
string$name
int$obj_id
Returns
ilCloudPlugin

Definition at line 124 of file class.ilCloudConnector.php.

References getFullClassName().

Referenced by ilCloudPluginService\__construct(), ilObjCloud\doDelete(), ilCloudPluginInitGUI\initGUI(), and ilCloudFileTree\uploadFileToService().

125  {
126  $class_name = ilCloudConnector::getFullClassName($service_name, "");
127 
128  return new $class_name($service_name, $obj_id);
129  }
static getFullClassName($service_name, $class_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPluginHookClass()

static ilCloudConnector::getPluginHookClass (   $service_name)
static
Parameters
string$name
int$obj_id
Returns
ilCloudHookPlugin

Definition at line 138 of file class.ilCloudConnector.php.

References getFullClassName().

Referenced by ilCloudPlugin\__construct(), and ilObjCloudGUI\initCreateForm().

139  {
140  $class_name = ilCloudConnector::getFullClassName($service_name, "Plugin");
141 
142  return new $class_name($service_name);
143  }
static getFullClassName($service_name, $class_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getServiceClass()

static ilCloudConnector::getServiceClass (   $service_name,
  $obj_id,
  $connect = true 
)
static
Parameters
string$name
int$obj_id
bool$connect
Returns
ilCloudPluginService
Exceptions
ilCloudException

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

References getActiveServices(), getFullClassName(), ilCloudException\NO_SERVICE_SELECTED, and ilCloudException\SERVICE_NOT_ACTIVE.

Referenced by ilCloudFileTree\__construct(), ilCloudFileTree\addFolderToService(), ilCloudFileTree\addItemsFromService(), ilCloudFileTree\deleteFromService(), ilCloudFileTree\downloadFromService(), ilObjCloudGUI\executeCommand(), ilObjCloudListGUI\getCommands(), ilObjCloudGUI\initCreateForm(), ilObjCloudGUI\serviceAuth(), and ilCloudFileTree\uploadFileToService().

103  {
104  if (!$service_name) {
106  }
107 
108  if (array_key_exists($service_name, ilCloudConnector::getActiveServices())) {
109  $class_name = ilCloudConnector::getFullClassName($service_name, "Service");
110 
111  return new $class_name($service_name, $obj_id);
112  } else {
113  throw new ilCloudException(ilCloudException::SERVICE_NOT_ACTIVE, $service_name);
114  }
115  }
static getFullClassName($service_name, $class_name)
Class ilCloudException.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSettingsGUIClass()

static ilCloudConnector::getSettingsGUIClass ( ilCloudPluginService  $plugin_service_class)
static
Parameters
string$name
int$obj_id
Returns
ilCloudPluginSettingsGUI

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

References getFullClassName(), and ilCloudPluginService\getPluginHookObject().

Referenced by ilObjCloudGUI\executeCommand().

153  {
154  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "SettingsGUI");
155 
156  return new $class_name($plugin_service_class);
157  }
getPluginHookObject()
For shorter access.
static getFullClassName($service_name, $class_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getUploadGUIClass()

static ilCloudConnector::getUploadGUIClass ( ilCloudPluginService  $plugin_service_class)
static
Parameters
string$name
int$obj_id
Returns
ilCloudPluginUploadGUI

Definition at line 237 of file class.ilCloudConnector.php.

References getFullClassName(), and ilCloudPluginService\getPluginHookObject().

Referenced by ilObjCloudGUI\executeCommand().

238  {
239  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "UploadGUI");
240 
241  return new $class_name($plugin_service_class);
242  }
getPluginHookObject()
For shorter access.
static getFullClassName($service_name, $class_name)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

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