ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilOerHarvesterSettings Class Reference

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

+ Collaboration diagram for ilOerHarvesterSettings:

Public Member Functions

 supportsHarvesting ($a_type)
 
 getHarvestingTypes ()
 Get obj types that support harvesing. More...
 
 setTarget ($a_target)
 
 getTarget ()
 Get target. More...
 
 setCopyrightTemplates (array $a_template_ids)
 
 getCopyrightTemplates ()
 
 isActiveCopyrightTemplate ($a_id)
 
 getCopyRightTemplatesInLomFormat ()
 Get copyright entries in LOM format: "il_copyright_entry_INST_ID_ID" return string[]. More...
 
 save ()
 Save settings. More...
 
 read ()
 Read settings. More...
 

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 ()
 ilOerHarvesterSettings constructor. More...
 

Private Attributes

 $storage = null
 
 $target = 0
 
 $copyright_templates = []
 
 $cronjob = null
 

Static Private Attributes

static $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 11 of file class.ilOerHarvesterSettings.php.

Constructor & Destructor Documentation

◆ __construct()

ilOerHarvesterSettings::__construct ( )
protected

ilOerHarvesterSettings constructor.

Exceptions

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

References read().

54  {
55  $this->storage = new ilSetting(self::STORAGE_IDENTIFIER);
56  /*
57  $this->cronjob = ilCronManager::getJobInstanceById(self::CRON_JOB_IDENTIFIER);
58  if(!$this->cronjob instanceof ilCronJob) {
59 
60  throw new \LogicException(
61  'Cannot create cron job instance'
62  );
63  }
64  */
65  $this->read();
66  }
+ Here is the call graph for this function:

Member Function Documentation

◆ getCopyrightTemplates()

ilOerHarvesterSettings::getCopyrightTemplates ( )
Returns
string[]

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

References $copyright_templates.

Referenced by getCopyRightTemplatesInLomFormat(), and isActiveCopyrightTemplate().

+ Here is the caller graph for this function:

◆ getCopyRightTemplatesInLomFormat()

ilOerHarvesterSettings::getCopyRightTemplatesInLomFormat ( )

Get copyright entries in LOM format: "il_copyright_entry_INST_ID_ID" return string[].

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

References $DIC, and getCopyrightTemplates().

144  {
145  global $DIC;
146 
147  $settings = $DIC->settings();
148 
149  $lom_entries = [];
150  foreach ($this->getCopyrightTemplates() as $copyright_id) {
151  $lom_entries[] = 'il_copyright_entry__' . $settings->get('inst_id', 0) . '__' . $copyright_id;
152  }
153  return $lom_entries;
154  }
global $DIC
Definition: saml.php:7
+ Here is the call graph for this function:

◆ getHarvestingTypes()

ilOerHarvesterSettings::getHarvestingTypes ( )

Get obj types that support harvesing.

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

94  {
95  return self::COLLECTED_TYPES;
96  }

◆ getInstance()

static ilOerHarvesterSettings::getInstance ( )
static
Returns

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

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

74  {
75  if (!self::$instance instanceof ilOerHarvesterSettings) {
76  self::$instance = new self();
77  }
78  return self::$instance;
79  }
Cron job for definition for oer harvesting.
+ Here is the caller graph for this function:

◆ getTarget()

ilOerHarvesterSettings::getTarget ( )

Get target.

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

References $target.

Referenced by save().

+ Here is the caller graph for this function:

◆ isActiveCopyrightTemplate()

ilOerHarvesterSettings::isActiveCopyrightTemplate (   $a_id)
Parameters
$a_id
Returns
bool

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

References getCopyrightTemplates().

135  {
136  return in_array($a_id, $this->getCopyrightTemplates());
137  }
+ Here is the call graph for this function:

◆ read()

ilOerHarvesterSettings::read ( )

Read settings.

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

References setCopyrightTemplates(), and setTarget().

Referenced by __construct().

170  {
171  $this->setTarget($this->storage->get('target', 0));
172  $this->setCopyrightTemplates(unserialize($this->storage->get('templates', serialize([]))));
173  }
setCopyrightTemplates(array $a_template_ids)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilOerHarvesterSettings::save ( )

Save settings.

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

References getTarget().

161  {
162  $this->storage->set('target', $this->getTarget());
163  $this->storage->set('templates', serialize($this->copyright_templates));
164  }
+ Here is the call graph for this function:

◆ setCopyrightTemplates()

ilOerHarvesterSettings::setCopyrightTemplates ( array  $a_template_ids)
Parameters
array$a_template_ids

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

Referenced by read().

118  {
119  $this->copyright_templates = $a_template_ids;
120  }
+ Here is the caller graph for this function:

◆ setTarget()

ilOerHarvesterSettings::setTarget (   $a_target)
Parameters
int$a_target

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

Referenced by read().

102  {
103  $this->target = $a_target;
104  }
+ Here is the caller graph for this function:

◆ supportsHarvesting()

ilOerHarvesterSettings::supportsHarvesting (   $a_type)
Parameters
string$a_type
Returns
bool

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

References $a_type.

86  {
87  return in_array($a_type, self::COLLECTED_TYPES);
88  }
$a_type
Definition: workflow.php:92

Field Documentation

◆ $copyright_templates

ilOerHarvesterSettings::$copyright_templates = []
private

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

Referenced by getCopyrightTemplates().

◆ $cronjob

ilOerHarvesterSettings::$cronjob = null
private

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

◆ $instance

ilOerHarvesterSettings::$instance = null
staticprivate

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

◆ $storage

ilOerHarvesterSettings::$storage = null
private

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

◆ $target

ilOerHarvesterSettings::$target = 0
private

Definition at line 34 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 13 of file class.ilOerHarvesterSettings.php.

◆ STORAGE_IDENTIFIER

const ilOerHarvesterSettings::STORAGE_IDENTIFIER = 'meta_oer'

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


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