ILIAS  release_8 Revision v8.23
ilOerHarvesterSettings Class Reference

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

+ Collaboration diagram for ilOerHarvesterSettings:

Public Member Functions

 supportsHarvesting (string $a_type)
 
 getHarvestingTypes ()
 
 setTarget (int $a_target)
 
 getTarget ()
 
 setCopyrightTemplates (array $a_template_ids)
 
 getCopyrightTemplates ()
 
 isActiveCopyrightTemplate (int $a_id)
 
 getCopyRightTemplatesInLomFormat ()
 Get copyright entries in LOM format: "il_copyright_entry_INST_ID_ID". More...
 
 save ()
 
 read ()
 

Static Public Member Functions

static getInstance ()
 

Data Fields

const CRON_JOB_IDENTIFIER = 'meta_oer_harvester'
 
const STORAGE_IDENTIFIER = 'meta_oer'
 
const COLLECTED_TYPES
 

Protected Member Functions

 __construct ()
 

Protected Attributes

ilSetting $storage
 
ilSetting $settings
 

Private Attributes

int $target = 0
 
array $copyright_templates = []
 
ilCronOerHarvester $cronjob = null
 

Static Private Attributes

static ilOerHarvesterSettings $instance = null
 

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 13 of file class.ilOerHarvesterSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilOerHarvesterSettings::__construct ( )
protected

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

References $DIC, read(), and ILIAS\Repository\settings().

36  {
37  global $DIC;
38 
39  $this->storage = new ilSetting(self::STORAGE_IDENTIFIER);
40  $this->settings = $DIC->settings();
41 
42  $this->read();
43  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ getCopyrightTemplates()

ilOerHarvesterSettings::getCopyrightTemplates ( )
Returns
string[]

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

References $copyright_templates.

Referenced by getCopyRightTemplatesInLomFormat(), and isActiveCopyrightTemplate().

87  : array
88  {
90  }
+ Here is the caller graph for this function:

◆ getCopyRightTemplatesInLomFormat()

ilOerHarvesterSettings::getCopyRightTemplatesInLomFormat ( )

Get copyright entries in LOM format: "il_copyright_entry_INST_ID_ID".

Returns
string[]

Definition at line 101 of file class.ilOerHarvesterSettings.php.

References getCopyrightTemplates(), and ILIAS\Repository\settings().

101  : array
102  {
103  $lom_entries = [];
104  foreach ($this->getCopyrightTemplates() as $copyright_id) {
105  $lom_entries[] = 'il_copyright_entry__' . $this->settings->get('inst_id', '0') . '__' . $copyright_id;
106  }
107  return $lom_entries;
108  }
+ Here is the call graph for this function:

◆ getHarvestingTypes()

ilOerHarvesterSettings::getHarvestingTypes ( )
Returns
string[]

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

61  : array
62  {
63  return self::COLLECTED_TYPES;
64  }

◆ getInstance()

static ilOerHarvesterSettings::getInstance ( )
static

Definition at line 45 of file class.ilOerHarvesterSettings.php.

Referenced by ilCronOerHarvester\__construct(), ilOerHarvester\__construct(), ilMDEditorGUI\listQuickEditCopyright(), and ilMDEditorGUI\updateQuickEdit().

45  : self
46  {
47  if (!self::$instance instanceof self) {
48  self::$instance = new self();
49  }
50  return self::$instance;
51  }
+ Here is the caller graph for this function:

◆ getTarget()

ilOerHarvesterSettings::getTarget ( )

Definition at line 71 of file class.ilOerHarvesterSettings.php.

References $target.

Referenced by save().

71  : int
72  {
73  return $this->target;
74  }
+ Here is the caller graph for this function:

◆ isActiveCopyrightTemplate()

ilOerHarvesterSettings::isActiveCopyrightTemplate ( int  $a_id)

Definition at line 92 of file class.ilOerHarvesterSettings.php.

References getCopyrightTemplates().

92  : bool
93  {
94  return in_array($a_id, $this->getCopyrightTemplates());
95  }
+ Here is the call graph for this function:

◆ read()

ilOerHarvesterSettings::read ( )

Definition at line 116 of file class.ilOerHarvesterSettings.php.

References setCopyrightTemplates(), and setTarget().

Referenced by __construct().

116  : void
117  {
118  $this->setTarget((int) $this->storage->get('target', '0'));
119  $this->setCopyrightTemplates(unserialize($this->storage->get('templates', serialize([])), ['allowed_classes' => false]));
120  }
setCopyrightTemplates(array $a_template_ids)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilOerHarvesterSettings::save ( )

Definition at line 110 of file class.ilOerHarvesterSettings.php.

References getTarget().

110  : void
111  {
112  $this->storage->set('target', (string) $this->getTarget());
113  $this->storage->set('templates', serialize($this->copyright_templates));
114  }
+ Here is the call graph for this function:

◆ setCopyrightTemplates()

ilOerHarvesterSettings::setCopyrightTemplates ( array  $a_template_ids)
Parameters
string[]$a_template_ids

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

Referenced by read().

79  : void
80  {
81  $this->copyright_templates = $a_template_ids;
82  }
+ Here is the caller graph for this function:

◆ setTarget()

ilOerHarvesterSettings::setTarget ( int  $a_target)

Definition at line 66 of file class.ilOerHarvesterSettings.php.

Referenced by read().

66  : void
67  {
68  $this->target = $a_target;
69  }
+ Here is the caller graph for this function:

◆ supportsHarvesting()

ilOerHarvesterSettings::supportsHarvesting ( string  $a_type)

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

53  : bool
54  {
55  return in_array($a_type, self::COLLECTED_TYPES);
56  }

Field Documentation

◆ $copyright_templates

array ilOerHarvesterSettings::$copyright_templates = []
private

Definition at line 31 of file class.ilOerHarvesterSettings.php.

Referenced by getCopyrightTemplates().

◆ $cronjob

ilCronOerHarvester ilOerHarvesterSettings::$cronjob = null
private

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

◆ $instance

ilOerHarvesterSettings ilOerHarvesterSettings::$instance = null
staticprivate

Definition at line 21 of file class.ilOerHarvesterSettings.php.

◆ $settings

ilSetting ilOerHarvesterSettings::$settings
protected

Definition at line 24 of file class.ilOerHarvesterSettings.php.

◆ $storage

ilSetting ilOerHarvesterSettings::$storage
protected

Definition at line 23 of file class.ilOerHarvesterSettings.php.

◆ $target

int ilOerHarvesterSettings::$target = 0
private

Definition at line 26 of file class.ilOerHarvesterSettings.php.

Referenced by getTarget().

◆ COLLECTED_TYPES

const ilOerHarvesterSettings::COLLECTED_TYPES
Initial value:
= [
'file'
]

Definition at line 17 of file class.ilOerHarvesterSettings.php.

◆ CRON_JOB_IDENTIFIER

const ilOerHarvesterSettings::CRON_JOB_IDENTIFIER = 'meta_oer_harvester'

Definition at line 15 of file class.ilOerHarvesterSettings.php.

◆ STORAGE_IDENTIFIER

const ilOerHarvesterSettings::STORAGE_IDENTIFIER = 'meta_oer'

Definition at line 16 of file class.ilOerHarvesterSettings.php.


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