ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
ilWOPICrawler Class Reference
+ Inheritance diagram for ilWOPICrawler:
+ Collaboration diagram for ilWOPICrawler:

Public Member Functions

 __construct ()
 
 getId ()
 
 getTitle ()
 
 getDescription ()
 
 hasAutoActivation ()
 
 hasFlexibleSchedule ()
 
 getDefaultScheduleType ()
 
 getDefaultScheduleValue ()
 
 run ()
 
- Public Member Functions inherited from ilCronJob
 setDateTimeProvider (?Closure $date_time_provider)
 
 isDue (?DateTimeImmutable $last_run, ?CronJobScheduleType $schedule_type, ?int $schedule_value, bool $is_manually_executed=false)
 
 getScheduleType ()
 Get current schedule type (if flexible) More...
 
 getScheduleValue ()
 Get current schedule value (if flexible) More...
 
 setSchedule (?CronJobScheduleType $a_type, ?int $a_value)
 Update current schedule (if flexible) More...
 
 getAllScheduleTypes ()
 Get all available schedule types. More...
 
 getScheduleTypesWithValues ()
 
 getValidScheduleTypes ()
 Returns a collection of all valid schedule types for a specific job. More...
 
 isManuallyExecutable ()
 
 hasCustomSettings ()
 
 addCustomSettingsToForm (ilPropertyFormGUI $a_form)
 
 saveCustomSettings (ilPropertyFormGUI $a_form)
 
 addToExternalSettingsForm (int $a_form_id, array &$a_fields, bool $a_is_active)
 
 activationWasToggled (ilDBInterface $db, ilSetting $setting, bool $a_currently_active)
 Important: This method is (also) called from the setup process, where the constructor of an ilCronJob ist NOT executed. More...
 
 getId ()
 
 getTitle ()
 
 getDescription ()
 
 hasAutoActivation ()
 Is to be activated on "installation", does only work for ILIAS core cron jobs. More...
 
 hasFlexibleSchedule ()
 
 getDefaultScheduleType ()
 
 getDefaultScheduleValue ()
 
 run ()
 

Private Attributes

ilLanguage $language
 
ilSetting $settings
 
Crawler $crawler
 
AppRepository $app_repository
 
ActionRepository $action_repository
 

Additional Inherited Members

- Protected Attributes inherited from ilCronJob
CronJobScheduleType $schedule_type = null
 
int $schedule_value = null
 
Closure $date_time_provider = null
 

Detailed Description

Author
Fabian Schmid fabia.nosp@m.n@sr.nosp@m..solu.nosp@m.tion.nosp@m.s

Definition at line 32 of file class.ilWOPICrawler.php.

Constructor & Destructor Documentation

◆ __construct()

ilWOPICrawler::__construct ( )

Definition at line 40 of file class.ilWOPICrawler.php.

References $DIC, ILIAS\UI\examples\Symbol\Glyph\Language\language(), and ILIAS\Repository\settings().

41  {
42  global $DIC;
43  $this->language = $DIC->language();
44  $this->language->loadLanguageModule('wopi');
45  $this->settings = $DIC->settings();
46  $this->crawler = new Crawler();
47 
48  $this->app_repository = new AppDBRepository($DIC->database());
49  $this->action_repository = new ActionDBRepository($DIC->database());
50  }
global $DIC
Definition: shib_login.php:25
language()
description: > Example for rendring a language glyph.
Definition: language.php:25
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: Crawler.php:21
+ Here is the call graph for this function:

Member Function Documentation

◆ getDefaultScheduleType()

ilWOPICrawler::getDefaultScheduleType ( )

Definition at line 77 of file class.ilWOPICrawler.php.

78  {
79  return CronJobScheduleType::SCHEDULE_TYPE_WEEKLY;
80  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ getDefaultScheduleValue()

ilWOPICrawler::getDefaultScheduleValue ( )

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

82  : ?int
83  {
84  return 1;
85  }

◆ getDescription()

ilWOPICrawler::getDescription ( )

Definition at line 62 of file class.ilWOPICrawler.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

62  : string
63  {
64  return $this->language->txt('wopi_crawler_cronjob_description');
65  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:25
+ Here is the call graph for this function:

◆ getId()

ilWOPICrawler::getId ( )

Definition at line 52 of file class.ilWOPICrawler.php.

52  : string
53  {
54  return 'wopi_crawler';
55  }

◆ getTitle()

ilWOPICrawler::getTitle ( )

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

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

57  : string
58  {
59  return $this->language->txt('wopi_crawler_cronjob_title');
60  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:25
+ Here is the call graph for this function:

◆ hasAutoActivation()

ilWOPICrawler::hasAutoActivation ( )

Definition at line 67 of file class.ilWOPICrawler.php.

67  : bool
68  {
69  return true;
70  }

◆ hasFlexibleSchedule()

ilWOPICrawler::hasFlexibleSchedule ( )

Definition at line 72 of file class.ilWOPICrawler.php.

72  : bool
73  {
74  return true;
75  }

◆ run()

ilWOPICrawler::run ( )

Definition at line 87 of file class.ilWOPICrawler.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language(), ILIAS\Repository\settings(), and ilCronJobResult\STATUS_FAIL.

88  {
89  $result = new ilCronJobResult();
90  if (!(bool) $this->settings->get('wopi_activated', '0')) {
91  $result->setMessage($this->language->txt('wopi_crawler_cronjob_not_activated'));
92  return $result;
93  }
94  $discovery_url = $this->settings->get('wopi_discovery_url');
95 
96  if (!$this->crawler->validate(new URI($discovery_url))) {
97  $result->setStatus(ilCronJobResult::STATUS_FAIL);
98  $result->setMessage($this->language->txt('msg_error_wopi_invalid_discorvery_url'));
99  return $result;
100  }
101 
102  $apps = $this->crawler->crawl(new URI($discovery_url));
103  if ($apps === null) {
104  $result->setStatus(ilCronJobResult::STATUS_FAIL);
105  $result->setMessage($this->language->txt('wopi_crawler_cronjob_no_apps'));
106  return $result;
107  }
108  $result->setMessage($this->language->txt('wopi_crawler_cronjob_success'));
109  $this->app_repository->storeCollection($apps, $this->action_repository);
110 
111  return $result;
112  }
The scope of this class is split ilias-conform URI's into components.
Definition: URI.php:34
language()
description: > Example for rendring a language glyph.
Definition: language.php:25
+ Here is the call graph for this function:

Field Documentation

◆ $action_repository

ActionRepository ilWOPICrawler::$action_repository
private

Definition at line 38 of file class.ilWOPICrawler.php.

◆ $app_repository

AppRepository ilWOPICrawler::$app_repository
private

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

◆ $crawler

Crawler ilWOPICrawler::$crawler
private

Definition at line 36 of file class.ilWOPICrawler.php.

◆ $language

ilLanguage ilWOPICrawler::$language
private

Definition at line 34 of file class.ilWOPICrawler.php.

◆ $settings

ilSetting ilWOPICrawler::$settings
private

Definition at line 35 of file class.ilWOPICrawler.php.


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