ILIAS  trunk Revision v12.0_alpha-1221-g4e438232683
ilCronOerHarvester Class Reference

Cron job for definition for oer harvesting. More...

+ Inheritance diagram for ilCronOerHarvester:
+ Collaboration diagram for ilCronOerHarvester:

Public Member Functions

 __construct ()
 
 usesLegacyForms ()
 
 getTitle ()
 
 getDescription ()
 
 getId ()
 
 hasAutoActivation ()
 Is to be activated on "installation", does only work for ILIAS core cron jobs. More...
 
 hasFlexibleSchedule ()
 
 getDefaultScheduleType ()
 
 getDefaultScheduleValue ()
 
 run ()
 
 addToExternalSettingsForm (int $a_form_id, array &$a_fields, bool $a_is_active)
 
- 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 ()
 

Data Fields

const string CRON_JOB_IDENTIFIER = 'meta_oer_harvester'
 

Protected Attributes

const int DEFAULT_SCHEDULE_VALUE = 1
 
- Protected Attributes inherited from ILIAS\Cron\CronJob
JobScheduleType $schedule_type = null
 
int $schedule_value = null
 
Closure $date_time_provider = null
 

Private Attributes

ilLogger $logger
 
PresentationUtilities $presentation_utilities
 
PublishingServices $publishing_services
 

Detailed Description

Cron job for definition for oer harvesting.

Author
Stefan Meyer smeye.nosp@m.r.il.nosp@m.ias@g.nosp@m.mx.d.nosp@m.e

Definition at line 33 of file class.ilCronOerHarvester.php.

Constructor & Destructor Documentation

◆ __construct()

ilCronOerHarvester::__construct ( )

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

43 {
44 global $DIC;
45
47
48 $this->logger = $internal_services->dic()->logger()->meta();
49 $this->presentation_utilities = $internal_services->presentation()->utilities();
50 $this->publishing_services = $internal_services->OERHarvester();
51 }
$internal_services
Definition: oai.php:30
global $DIC
Definition: shib_login.php:26

References $DIC, $internal_services, and ILIAS\Repository\logger().

+ Here is the call graph for this function:

Member Function Documentation

◆ addToExternalSettingsForm()

ilCronOerHarvester::addToExternalSettingsForm ( int  $a_form_id,
array &  $a_fields,
bool  $a_is_active 
)
Parameters
array<string,mixed>$a_fields

Reimplemented from ILIAS\Cron\CronJob.

Definition at line 103 of file class.ilCronOerHarvester.php.

103 : void
104 {
105 switch ($a_form_id) {
107
108 $a_fields['meta_oer_harvester'] =
109 (
110 $a_is_active ?
111 $this->presentation_utilities->txt('enabled') :
112 $this->presentation_utilities->txt('disabled')
113 );
114 break;
115 }
116 }

References ilAdministrationSettingsFormHandler\FORM_META_COPYRIGHT.

◆ getDefaultScheduleType()

ilCronOerHarvester::getDefaultScheduleType ( )

Reimplemented from ILIAS\Cron\CronJob.

Definition at line 83 of file class.ilCronOerHarvester.php.

84 {
85 return JobScheduleType::DAILY;
86 }

◆ getDefaultScheduleValue()

ilCronOerHarvester::getDefaultScheduleValue ( )

Reimplemented from ILIAS\Cron\CronJob.

Definition at line 88 of file class.ilCronOerHarvester.php.

88 : ?int
89 {
91 }

References DEFAULT_SCHEDULE_VALUE.

◆ getDescription()

ilCronOerHarvester::getDescription ( )

Reimplemented from ILIAS\Cron\CronJob.

Definition at line 63 of file class.ilCronOerHarvester.php.

63 : string
64 {
65 return $this->presentation_utilities->txt('meta_oer_harvester_desc');
66 }

◆ getId()

ilCronOerHarvester::getId ( )

Reimplemented from ILIAS\Cron\CronJob.

Definition at line 68 of file class.ilCronOerHarvester.php.

68 : string
69 {
71 }

References CRON_JOB_IDENTIFIER.

◆ getTitle()

ilCronOerHarvester::getTitle ( )

Reimplemented from ILIAS\Cron\CronJob.

Definition at line 58 of file class.ilCronOerHarvester.php.

58 : string
59 {
60 return $this->presentation_utilities->txt('meta_oer_harvester');
61 }

◆ hasAutoActivation()

ilCronOerHarvester::hasAutoActivation ( )

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

Reimplemented from ILIAS\Cron\CronJob.

Definition at line 73 of file class.ilCronOerHarvester.php.

73 : bool
74 {
75 return false;
76 }

◆ hasFlexibleSchedule()

ilCronOerHarvester::hasFlexibleSchedule ( )

Reimplemented from ILIAS\Cron\CronJob.

Definition at line 78 of file class.ilCronOerHarvester.php.

78 : bool
79 {
80 return true;
81 }

◆ run()

ilCronOerHarvester::run ( )

Reimplemented from ILIAS\Cron\CronJob.

Definition at line 93 of file class.ilCronOerHarvester.php.

93 : JobResult
94 {
95 $this->logger->info('Started cron oer harvester.');
96 $automatic_publisher = $this->publishing_services->automaticPublisher();
97 $res = $automatic_publisher->run(new ResultWrapper(new JobResult()));
98 $this->logger->info('cron oer harvester finished');
99
100 return $res->get();
101 }
$res
Definition: ltiservices.php:69

References $res, and ILIAS\Repository\logger().

+ Here is the call graph for this function:

◆ usesLegacyForms()

ilCronOerHarvester::usesLegacyForms ( )
Deprecated:

Reimplemented from ILIAS\Cron\CronJob.

Definition at line 53 of file class.ilCronOerHarvester.php.

53 : bool
54 {
55 return false;
56 }

Field Documentation

◆ $logger

ilLogger ilCronOerHarvester::$logger
private

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

◆ $presentation_utilities

PresentationUtilities ilCronOerHarvester::$presentation_utilities
private

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

◆ $publishing_services

PublishingServices ilCronOerHarvester::$publishing_services
private

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

◆ CRON_JOB_IDENTIFIER

const string ilCronOerHarvester::CRON_JOB_IDENTIFIER = 'meta_oer_harvester'

◆ DEFAULT_SCHEDULE_VALUE

const int ilCronOerHarvester::DEFAULT_SCHEDULE_VALUE = 1
protected

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

Referenced by getDefaultScheduleValue().


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