ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilWOPICrawler Class Reference
+ Inheritance diagram for ilWOPICrawler:
+ Collaboration diagram for ilWOPICrawler:

Public Member Functions

 __construct ()
 
 getId ()
 
 getTitle ()
 
 getDescription ()
 
 hasAutoActivation ()
 Is to be activated on "installation", does only work for ILIAS core cron jobs. More...
 
 hasFlexibleSchedule ()
 
 getDefaultScheduleType ()
 
 getDefaultScheduleValue ()
 
 run ()
 
- Public Member Functions inherited from ILIAS\Cron\CronJob
 setDateTimeProvider (?\Closure $date_time_provider)
 
 isDue (?\DateTimeImmutable $last_run, ?JobScheduleType $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 (?JobScheduleType $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 ()
 
 usesLegacyForms ()
 
 getCustomConfigurationInput (\ILIAS\UI\Factory $ui_factory, \ILIAS\Refinery\Factory $factory, \ilLanguage $lng)
 
 addCustomSettingsToForm (\ilPropertyFormGUI $a_form)
 
 saveCustomConfiguration (mixed $form_data)
 
 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 ILIAS\Cron\CronJob
JobScheduleType $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 34 of file class.ilWOPICrawler.php.

Constructor & Destructor Documentation

◆ __construct()

ilWOPICrawler::__construct ( )

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

43 {
44 global $DIC;
45 $this->language = $DIC->language();
46 $this->language->loadLanguageModule('wopi');
47 $this->settings = $DIC->settings();
48 $this->crawler = new Crawler();
49
50 $this->app_repository = new AppDBRepository($DIC->database());
51 $this->action_repository = new ActionDBRepository($DIC->database());
52 }
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ getDefaultScheduleType()

ilWOPICrawler::getDefaultScheduleType ( )

Reimplemented from ILIAS\Cron\CronJob.

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

80 {
81 return JobScheduleType::WEEKLY;
82 }

◆ getDefaultScheduleValue()

ilWOPICrawler::getDefaultScheduleValue ( )

Reimplemented from ILIAS\Cron\CronJob.

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

84 : ?int
85 {
86 return 1;
87 }

◆ getDescription()

ilWOPICrawler::getDescription ( )

Reimplemented from ILIAS\Cron\CronJob.

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

64 : string
65 {
66 return $this->language->txt('wopi_crawler_cronjob_description');
67 }

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

+ Here is the call graph for this function:

◆ getId()

ilWOPICrawler::getId ( )

Reimplemented from ILIAS\Cron\CronJob.

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

54 : string
55 {
56 return 'wopi_crawler';
57 }

◆ getTitle()

ilWOPICrawler::getTitle ( )

Reimplemented from ILIAS\Cron\CronJob.

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

59 : string
60 {
61 return $this->language->txt('wopi_crawler_cronjob_title');
62 }

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

+ Here is the call graph for this function:

◆ hasAutoActivation()

ilWOPICrawler::hasAutoActivation ( )

Is to be activated on "installation", does only work for ILIAS core cron jobs.

Reimplemented from ILIAS\Cron\CronJob.

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

69 : bool
70 {
71 return true;
72 }

◆ hasFlexibleSchedule()

ilWOPICrawler::hasFlexibleSchedule ( )

Reimplemented from ILIAS\Cron\CronJob.

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

74 : bool
75 {
76 return true;
77 }

◆ run()

ilWOPICrawler::run ( )

Reimplemented from ILIAS\Cron\CronJob.

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

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

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

+ Here is the call graph for this function:

Field Documentation

◆ $action_repository

ActionRepository ilWOPICrawler::$action_repository
private

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

◆ $app_repository

AppRepository ilWOPICrawler::$app_repository
private

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

◆ $crawler

Crawler ilWOPICrawler::$crawler
private

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

◆ $language

ilLanguage ilWOPICrawler::$language
private

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

◆ $settings

ilSetting ilWOPICrawler::$settings
private

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


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