ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 60 of file class.ilCloudConnector.php.

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

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

61  {
62  if (!$name)
63  {
65  }
66 
67  if (array_key_exists($name, ilCloudConnector::getActiveServices()))
68  {
69  return true;
70  } else
71  {
73  }
74  }
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 153 of file class.ilCloudConnector.php.

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

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

154  {
155  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "ActionListGUI");
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:

◆ getActiveServices()

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

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

References $DIC, array, 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)
44  {
46  }
47  $services_names = array();
48  foreach ($cloud_services as $service)
49  {
50  $services_names[$service] = $service;
51  }
52  return $services_names;
53  }
Create styles array
The data for the language used.
global $DIC
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 198 of file class.ilCloudConnector.php.

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

Referenced by ilObjCloudGUI\executeCommand().

199  {
200  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "CreateFolderGUI");
201  return new $class_name($plugin_service_class);
202  }
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 239 of file class.ilCloudConnector.php.

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

Referenced by ilObjCloudGUI\initCreateForm().

240  {
241  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "CreationGUI");
242  return new $class_name($plugin_service_class);
243  }
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 219 of file class.ilCloudConnector.php.

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

Referenced by ilObjCloudGUI\executeCommand().

220  {
221  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "DeleteGUI");
222  return new $class_name($plugin_service_class);
223  }
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 187 of file class.ilCloudConnector.php.

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

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

188  {
189  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "FileTreeGUI");
190  return new $class_name($plugin_service_class, $file_tree);
191  }
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  {
85  include_once("./Customizing/global/plugins/Modules/Cloud/CloudHook/" . $service_name . "/classes/class.il" .$service_name . $class_name.".php");
86  $class_full_name = "il" . $service_name . $class_name;
87  return $class_full_name;
88  }
89  return "ilCloudPlugin" .$class_name;
90  }
+ 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 229 of file class.ilCloudConnector.php.

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

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

230  {
231  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "HeaderActionGUI");
232  return new $class_name($plugin_service_class);
233  }
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 249 of file class.ilCloudConnector.php.

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

Referenced by ilObjCloudGUI\infoScreenForward().

250  {
251  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "InfoScreenGUI");
252  return new $class_name($plugin_service_class);
253  }
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 175 of file class.ilCloudConnector.php.

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

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

176  {
177  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "InitGUI");
178  return new $class_name($plugin_service_class);
179  }
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 164 of file class.ilCloudConnector.php.

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

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

165  {
166  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "ItemCreationListGUI");
167  return new $class_name($plugin_service_class);
168  }
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 120 of file class.ilCloudConnector.php.

References getFullClassName().

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

121  {
122  $class_name = ilCloudConnector::getFullClassName($service_name, "");
123  return new $class_name($service_name, $obj_id);
124  }
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 131 of file class.ilCloudConnector.php.

References getFullClassName().

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

132  {
133  $class_name = ilCloudConnector::getFullClassName($service_name, "Plugin");
134  return new $class_name($service_name);
135  }
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 98 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(), ilObjCloudGUI\initCreateForm(), ilObjCloudGUI\serviceAuth(), and ilCloudFileTree\uploadFileToService().

99  {
100  if (!$service_name)
101  {
103  }
104 
105  if (array_key_exists($service_name, ilCloudConnector::getActiveServices()))
106  {
107  $class_name = ilCloudConnector::getFullClassName($service_name, "Service");
108  return new $class_name($service_name, $obj_id);
109  } else
110  {
111  throw new ilCloudException(ilCloudException::SERVICE_NOT_ACTIVE, $service_name);
112  }
113  }
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 142 of file class.ilCloudConnector.php.

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

Referenced by ilObjCloudGUI\executeCommand().

143  {
144  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "SettingsGUI");
145  return new $class_name($plugin_service_class);
146  }
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 209 of file class.ilCloudConnector.php.

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

Referenced by ilObjCloudGUI\executeCommand().

210  {
211  $class_name = ilCloudConnector::getFullClassName($plugin_service_class->getPluginHookObject()->getPluginName(), "UploadGUI");
212  return new $class_name($plugin_service_class);
213  }
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: