ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilMDLOMConformanceMigration Class Reference
+ Inheritance diagram for ilMDLOMConformanceMigration:
+ Collaboration diagram for ilMDLOMConformanceMigration:

Public Member Functions

 getLabel ()
 
 getDefaultAmountOfStepsPerRun ()
 
 getPreconditions (Environment $environment)
 
 prepare (Environment $environment)
 
 step (Environment $environment)
 
 getRemainingAmountOfSteps ()
 

Protected Member Functions

 areIndicesSet (string $table)
 
 setIndices (string $table)
 
 migrateCoverage ()
 
 migrateSetOfCoverages (int $limit)
 
 countNotMigratedCoverages ()
 
 migrateSchema ()
 
 migrateSetOfSchemas (int $limit)
 
 countNotMigratedSchemas ()
 
 migrateOrComposite ()
 
 migrateSetOfOrComposites (int $limit)
 
 countNotMigratedOrComposites ()
 
 normalizeOrCompositeName (string $name)
 
 migrateFromEducational ()
 
 migrateSetFromEducational (int $limit)
 
 countNotMigratedFromEducational ()
 
 normalizeLearningResourceType (string $name)
 
 normalizeIntendedEndUserRole (string $name)
 
 normalizeContext (string $name)
 
 logDetailed (string $str)
 
 logSuccess (string $str)
 
 startLog ()
 

Protected Attributes

const SELECT_LIMIT = 1000
 
const MAX_LOOPS = 10000
 
ilDBInterface $db
 
IOWrapper $io
 

Detailed Description

Definition at line 27 of file class.ilMDLOMConformanceMigration.php.

Member Function Documentation

◆ areIndicesSet()

ilMDLOMConformanceMigration::areIndicesSet ( string  $table)
protected

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

Referenced by getRemainingAmountOfSteps(), and setIndices().

117  : bool
118  {
119  return $this->db->indexExistsByFields($table, ['rbac_id', 'obj_id']);
120  }
+ Here is the caller graph for this function:

◆ countNotMigratedCoverages()

ilMDLOMConformanceMigration::countNotMigratedCoverages ( )
protected

Definition at line 172 of file class.ilMDLOMConformanceMigration.php.

References $res.

Referenced by getRemainingAmountOfSteps(), and migrateCoverage().

172  : int
173  {
174  $res = $this->db->query(
175  "SELECT COUNT(*) AS count FROM il_meta_general WHERE CHAR_LENGTH(coverage) > 0
176  OR CHAR_LENGTH(coverage_language) > 0"
177  );
178  while ($rec = $this->db->fetchAssoc($res)) {
179  return (int) $rec['count'];
180  }
181  return 0;
182  }
$res
Definition: ltiservices.php:69
+ Here is the caller graph for this function:

◆ countNotMigratedFromEducational()

ilMDLOMConformanceMigration::countNotMigratedFromEducational ( )
protected

Definition at line 451 of file class.ilMDLOMConformanceMigration.php.

References $res.

Referenced by getRemainingAmountOfSteps(), and migrateFromEducational().

451  : int
452  {
453  $res = $this->db->query(
454  "SELECT COUNT(*) AS count FROM il_meta_educational WHERE
455  CHAR_LENGTH(learning_resource_type) > 0 OR CHAR_LENGTH(intended_end_user_role) > 0
456  OR CHAR_LENGTH(context) > 0"
457  );
458  while ($rec = $this->db->fetchAssoc($res)) {
459  return (int) $rec['count'];
460  }
461  return 0;
462  }
$res
Definition: ltiservices.php:69
+ Here is the caller graph for this function:

◆ countNotMigratedOrComposites()

ilMDLOMConformanceMigration::countNotMigratedOrComposites ( )
protected

Definition at line 322 of file class.ilMDLOMConformanceMigration.php.

References $res.

Referenced by getRemainingAmountOfSteps(), and migrateOrComposite().

322  : int
323  {
324  $res = $this->db->query(
325  "SELECT COUNT(*) AS count FROM il_meta_requirement WHERE
326  CHAR_LENGTH(operating_system_name) > 0 OR CHAR_LENGTH(os_min_version) > 0
327  OR CHAR_LENGTH(os_max_version) > 0 OR CHAR_LENGTH(browser_name) > 0
328  OR CHAR_LENGTH(browser_minimum_version) > 0 OR CHAR_LENGTH(browser_maximum_version) > 0"
329  );
330  while ($rec = $this->db->fetchAssoc($res)) {
331  return (int) $rec['count'];
332  }
333  return 0;
334  }
$res
Definition: ltiservices.php:69
+ Here is the caller graph for this function:

◆ countNotMigratedSchemas()

ilMDLOMConformanceMigration::countNotMigratedSchemas ( )
protected

Definition at line 224 of file class.ilMDLOMConformanceMigration.php.

References $res.

Referenced by getRemainingAmountOfSteps(), and migrateSchema().

224  : int
225  {
226  $res = $this->db->query(
227  "SELECT COUNT(*) AS count FROM il_meta_meta_data WHERE CHAR_LENGTH(meta_data_scheme) > 0"
228  );
229  while ($rec = $this->db->fetchAssoc($res)) {
230  return (int) $rec['count'];
231  }
232  return 0;
233  }
$res
Definition: ltiservices.php:69
+ Here is the caller graph for this function:

◆ getDefaultAmountOfStepsPerRun()

ilMDLOMConformanceMigration::getDefaultAmountOfStepsPerRun ( )

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

40  : int
41  {
42  return Migration::INFINITE;
43  }

◆ getLabel()

ilMDLOMConformanceMigration::getLabel ( )

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

35  : string
36  {
37  return "Migration of some LOM elements that should be non-unique to their own tables.";
38  }

◆ getPreconditions()

ilMDLOMConformanceMigration::getPreconditions ( Environment  $environment)

◆ getRemainingAmountOfSteps()

ilMDLOMConformanceMigration::getRemainingAmountOfSteps ( )

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

References areIndicesSet(), countNotMigratedCoverages(), countNotMigratedFromEducational(), countNotMigratedOrComposites(), and countNotMigratedSchemas().

83  : int
84  {
85  if (
86  $this->countNotMigratedCoverages() > 0 ||
87  !$this->areIndicesSet('il_meta_coverage')
88  ) {
89  return 1;
90  }
91 
92  if (
93  $this->countNotMigratedSchemas() > 0 ||
94  !$this->areIndicesSet('il_meta_meta_schema')
95  ) {
96  return 1;
97  }
98 
99  if (
100  $this->countNotMigratedOrComposites() > 0 ||
101  !$this->areIndicesSet('il_meta_or_composite')
102  ) {
103  return 1;
104  }
105 
106  if (
107  $this->countNotMigratedFromEducational() > 0 ||
108  !$this->areIndicesSet('il_meta_lr_type') ||
109  !$this->areIndicesSet('il_meta_end_usr_role') ||
110  !$this->areIndicesSet('il_meta_context')
111  ) {
112  return 1;
113  }
114  return 0;
115  }
+ Here is the call graph for this function:

◆ logDetailed()

ilMDLOMConformanceMigration::logDetailed ( string  $str)
protected

Definition at line 520 of file class.ilMDLOMConformanceMigration.php.

Referenced by migrateSetFromEducational(), migrateSetOfCoverages(), migrateSetOfOrComposites(), migrateSetOfSchemas(), and setIndices().

520  : void
521  {
522  if (!isset($this->io) || !$this->io->isVerbose()) {
523  return;
524  }
525  $this->io->inform($str);
526  }
+ Here is the caller graph for this function:

◆ logSuccess()

ilMDLOMConformanceMigration::logSuccess ( string  $str)
protected

Definition at line 528 of file class.ilMDLOMConformanceMigration.php.

Referenced by migrateCoverage(), migrateFromEducational(), migrateOrComposite(), and migrateSchema().

528  : void
529  {
530  if (!isset($this->io)) {
531  return;
532  }
533  $this->io->success($str);
534  }
+ Here is the caller graph for this function:

◆ migrateCoverage()

ilMDLOMConformanceMigration::migrateCoverage ( )
protected

Definition at line 130 of file class.ilMDLOMConformanceMigration.php.

References countNotMigratedCoverages(), logSuccess(), and migrateSetOfCoverages().

Referenced by step().

130  : void
131  {
132  $count = 0;
133  while ($this->countNotMigratedCoverages() > 0 && $count < self::MAX_LOOPS) {
134  $this->migrateSetOfCoverages(self::SELECT_LIMIT);
135  $count++;
136  }
137  $this->logSuccess('Migrated all coverages.');
138  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ migrateFromEducational()

ilMDLOMConformanceMigration::migrateFromEducational ( )
protected

Definition at line 358 of file class.ilMDLOMConformanceMigration.php.

References countNotMigratedFromEducational(), logSuccess(), and migrateSetFromEducational().

Referenced by step().

358  : void
359  {
360  $count = 0;
361  while ($this->countNotMigratedFromEducational() > 0 && $count < self::MAX_LOOPS) {
362  $this->migrateSetFromEducational(self::SELECT_LIMIT);
363  $count++;
364  }
365  $this->logSuccess('Migrated all learningResourceTypes, intendedEndUserRoles, and contexts.');
366  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ migrateOrComposite()

ilMDLOMConformanceMigration::migrateOrComposite ( )
protected

Definition at line 235 of file class.ilMDLOMConformanceMigration.php.

References countNotMigratedOrComposites(), logSuccess(), and migrateSetOfOrComposites().

Referenced by step().

235  : void
236  {
237  $count = 0;
238  while ($this->countNotMigratedOrComposites() > 0 && $count < self::MAX_LOOPS) {
239  $this->migrateSetOfOrComposites(self::SELECT_LIMIT);
240  $count++;
241  }
242  $this->logSuccess('Migrated all orComposites.');
243  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ migrateSchema()

ilMDLOMConformanceMigration::migrateSchema ( )
protected

Definition at line 184 of file class.ilMDLOMConformanceMigration.php.

References countNotMigratedSchemas(), logSuccess(), and migrateSetOfSchemas().

Referenced by step().

184  : void
185  {
186  $count = 0;
187  while ($this->countNotMigratedSchemas() > 0 && $count < self::MAX_LOOPS) {
188  $this->migrateSetOfSchemas(self::SELECT_LIMIT);
189  $count++;
190  }
191  $this->logSuccess('Migrated all schemas.');
192  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ migrateSetFromEducational()

ilMDLOMConformanceMigration::migrateSetFromEducational ( int  $limit)
protected

Definition at line 368 of file class.ilMDLOMConformanceMigration.php.

References $context, $educational, logDetailed(), normalizeContext(), normalizeIntendedEndUserRole(), normalizeLearningResourceType(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Referenced by migrateFromEducational().

368  : void
369  {
370  $this->db->setLimit($limit);
371  $educationals = $this->db->query(
372  "SELECT meta_educational_id, rbac_id, obj_id, obj_type,
373  learning_resource_type, intended_end_user_role, context FROM il_meta_educational
374  WHERE CHAR_LENGTH(learning_resource_type) > 0 OR CHAR_LENGTH(intended_end_user_role) > 0
375  OR CHAR_LENGTH(context) > 0 ORDER BY meta_educational_id"
376  );
377 
378  while ($educational = $this->db->fetchAssoc($educationals)) {
379  $has_type = ($educational['learning_resource_type'] ?? '') !== '';
380  $has_role = ($educational['intended_end_user_role'] ?? '') !== '';
381  $has_context = ($educational['context'] ?? '') !== '';
382 
383  if ($has_type) {
384  $this->logDetailed('Insert learningResourceType from meta_educational_id ' . $educational['meta_educational_id']);
385  $next_id = $this->db->nextId('il_meta_lr_type');
386  $type = $this->normalizeLearningResourceType($educational['learning_resource_type']);
387  $this->db->manipulate(
388  "INSERT INTO il_meta_lr_type (meta_lr_type_id, rbac_id, obj_id, obj_type,
389  parent_type, parent_id, learning_resource_type) VALUES (" .
390  $this->db->quote($next_id, ilDBConstants::T_INTEGER) . ", " .
391  $this->db->quote($educational['rbac_id'], ilDBConstants::T_INTEGER) . ", " .
392  $this->db->quote($educational['obj_id'], ilDBConstants::T_INTEGER) . ", " .
393  $this->db->quote($educational['obj_type'], ilDBConstants::T_TEXT) . ", " .
394  $this->db->quote('meta_educational', ilDBConstants::T_TEXT) . ", " .
395  $this->db->quote($educational['meta_educational_id'], ilDBConstants::T_INTEGER) . ", " .
396  $this->db->quote($type, ilDBConstants::T_TEXT) . ")"
397  );
398  $this->logDetailed('Success, deleting old entry');
399  $this->db->manipulate(
400  "UPDATE il_meta_educational SET learning_resource_type = '' WHERE meta_educational_id = " .
401  $this->db->quote($educational['meta_educational_id'], ilDBConstants::T_INTEGER)
402  );
403  }
404 
405  if ($has_role) {
406  $this->logDetailed('Insert intendedEndUserRole from meta_educational_id ' . $educational['meta_educational_id']);
407  $next_id = $this->db->nextId('il_meta_end_usr_role');
408  $role = $this->normalizeIntendedEndUserRole($educational['intended_end_user_role']);
409  $this->db->manipulate(
410  "INSERT INTO il_meta_end_usr_role (meta_end_usr_role_id, rbac_id, obj_id, obj_type,
411  parent_type, parent_id, intended_end_user_role) VALUES (" .
412  $this->db->quote($next_id, ilDBConstants::T_INTEGER) . ", " .
413  $this->db->quote($educational['rbac_id'], ilDBConstants::T_INTEGER) . ", " .
414  $this->db->quote($educational['obj_id'], ilDBConstants::T_INTEGER) . ", " .
415  $this->db->quote($educational['obj_type'], ilDBConstants::T_TEXT) . ", " .
416  $this->db->quote('meta_educational', ilDBConstants::T_TEXT) . ", " .
417  $this->db->quote($educational['meta_educational_id'], ilDBConstants::T_INTEGER) . ", " .
418  $this->db->quote($role, ilDBConstants::T_TEXT) . ")"
419  );
420  $this->logDetailed('Success, deleting old entry');
421  $this->db->manipulate(
422  "UPDATE il_meta_educational SET intended_end_user_role = '' WHERE meta_educational_id = " .
423  $this->db->quote($educational['meta_educational_id'], ilDBConstants::T_INTEGER)
424  );
425  }
426 
427  if ($has_context) {
428  $this->logDetailed('Insert context from meta_educational_id ' . $educational['meta_educational_id']);
429  $next_id = $this->db->nextId('il_meta_context');
430  $context = $this->normalizeContext($educational['context']);
431  $this->db->manipulate(
432  "INSERT INTO il_meta_context (meta_context_id, rbac_id, obj_id, obj_type,
433  parent_type, parent_id, context) VALUES (" .
434  $this->db->quote($next_id, ilDBConstants::T_INTEGER) . ", " .
435  $this->db->quote($educational['rbac_id'], ilDBConstants::T_INTEGER) . ", " .
436  $this->db->quote($educational['obj_id'], ilDBConstants::T_INTEGER) . ", " .
437  $this->db->quote($educational['obj_type'], ilDBConstants::T_TEXT) . ", " .
438  $this->db->quote('meta_educational', ilDBConstants::T_TEXT) . ", " .
439  $this->db->quote($educational['meta_educational_id'], ilDBConstants::T_INTEGER) . ", " .
440  $this->db->quote($context, ilDBConstants::T_TEXT) . ")"
441  );
442  $this->logDetailed('Success, deleting old entry');
443  $this->db->manipulate(
444  "UPDATE il_meta_educational SET context = '' WHERE meta_educational_id = " .
445  $this->db->quote($educational['meta_educational_id'], ilDBConstants::T_INTEGER)
446  );
447  }
448  }
449  }
$context
Definition: webdav.php:31
$educational
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ migrateSetOfCoverages()

ilMDLOMConformanceMigration::migrateSetOfCoverages ( int  $limit)
protected

Definition at line 140 of file class.ilMDLOMConformanceMigration.php.

References logDetailed(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Referenced by migrateCoverage().

140  : void
141  {
142  $this->db->setLimit($limit);
143  $coverages = $this->db->query(
144  "SELECT meta_general_id, rbac_id, obj_id, obj_type, coverage,
145  coverage_language FROM il_meta_general WHERE CHAR_LENGTH(coverage) > 0
146  OR CHAR_LENGTH(coverage_language) > 0 ORDER BY meta_general_id"
147  );
148 
149  while ($coverage = $this->db->fetchAssoc($coverages)) {
150  $this->logDetailed('Insert coverage from meta_general_id ' . $coverage['meta_general_id']);
151  $next_id = $this->db->nextId('il_meta_coverage');
152  $this->db->manipulate(
153  "INSERT INTO il_meta_coverage (meta_coverage_id, rbac_id, obj_id,
154  obj_type, parent_type, parent_id, coverage, coverage_language) VALUES (" .
155  $this->db->quote($next_id, ilDBConstants::T_INTEGER) . ", " .
156  $this->db->quote($coverage['rbac_id'], ilDBConstants::T_INTEGER) . ", " .
157  $this->db->quote($coverage['obj_id'], ilDBConstants::T_INTEGER) . ", " .
158  $this->db->quote($coverage['obj_type'], ilDBConstants::T_TEXT) . ", " .
159  $this->db->quote('meta_general', ilDBConstants::T_TEXT) . ", " .
160  $this->db->quote($coverage['meta_general_id'], ilDBConstants::T_INTEGER) . ", " .
161  $this->db->quote($coverage['coverage'], ilDBConstants::T_TEXT) . ", " .
162  $this->db->quote($coverage['coverage_language'], ilDBConstants::T_TEXT) . ")"
163  );
164  $this->logDetailed('Success, deleting old entry');
165  $this->db->manipulate(
166  "UPDATE il_meta_general SET coverage = '', coverage_language = ''
167  WHERE meta_general_id = " . $this->db->quote($coverage['meta_general_id'], ilDBConstants::T_INTEGER)
168  );
169  }
170  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ migrateSetOfOrComposites()

ilMDLOMConformanceMigration::migrateSetOfOrComposites ( int  $limit)
protected

Definition at line 245 of file class.ilMDLOMConformanceMigration.php.

References logDetailed(), normalizeOrCompositeName(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Referenced by migrateOrComposite().

245  : void
246  {
247  $this->db->setLimit($limit);
248  $ors = $this->db->query(
249  "SELECT meta_requirement_id, rbac_id, obj_id, obj_type, operating_system_name,
250  os_min_version, os_max_version, browser_name, browser_minimum_version,
251  browser_maximum_version FROM il_meta_requirement WHERE
252  CHAR_LENGTH(operating_system_name) > 0 OR CHAR_LENGTH(os_min_version) > 0
253  OR CHAR_LENGTH(os_max_version) > 0 OR CHAR_LENGTH(browser_name) > 0
254  OR CHAR_LENGTH(browser_minimum_version) > 0 OR CHAR_LENGTH(browser_maximum_version) > 0
255  ORDER BY meta_requirement_id"
256  );
257 
258  while ($or = $this->db->fetchAssoc($ors)) {
259  $has_os =
260  ($or['operating_system_name'] ?? '') !== '' ||
261  ($or['os_min_version'] ?? '') !== '' ||
262  ($or['os_max_version'] ?? '') !== '';
263  $has_browser =
264  ($or['browser_name'] ?? '') !== '' ||
265  ($or['browser_minimum_version'] ?? '') !== '' ||
266  ($or['browser_maximum_version'] ?? '') !== '';
267 
268  if ($has_os) {
269  $this->logDetailed('Insert orComposite (type os) from meta_requirement_id ' . $or['meta_requirement_id']);
270  $next_id = $this->db->nextId('il_meta_or_composite');
271  $name = $this->normalizeOrCompositeName($or['operating_system_name']);
272  $this->db->manipulate(
273  "INSERT INTO il_meta_or_composite (meta_or_composite_id, rbac_id, obj_id,
274  obj_type, parent_type, parent_id, type, name, min_version, max_version) VALUES (" .
275  $this->db->quote($next_id, ilDBConstants::T_INTEGER) . ", " .
276  $this->db->quote($or['rbac_id'], ilDBConstants::T_INTEGER) . ", " .
277  $this->db->quote($or['obj_id'], ilDBConstants::T_INTEGER) . ", " .
278  $this->db->quote($or['obj_type'], ilDBConstants::T_TEXT) . ", " .
279  $this->db->quote('meta_requirement', ilDBConstants::T_TEXT) . ", " .
280  $this->db->quote($or['meta_requirement_id'], ilDBConstants::T_INTEGER) . ", " .
281  $this->db->quote('operating system', ilDBConstants::T_TEXT) . ", " .
282  $this->db->quote($or['operating_system_name'], ilDBConstants::T_TEXT) . ", " .
283  $this->db->quote($or['os_min_version'], ilDBConstants::T_TEXT) . ", " .
284  $this->db->quote($or['os_max_version'], ilDBConstants::T_TEXT) . ")"
285  );
286  $this->logDetailed('Success, deleting old entry');
287  $this->db->manipulate(
288  "UPDATE il_meta_requirement SET operating_system_name = '', os_min_version = '',
289  os_max_version = '' WHERE meta_requirement_id = " .
290  $this->db->quote($or['meta_requirement_id'], ilDBConstants::T_INTEGER)
291  );
292  }
293 
294  if ($has_browser) {
295  $this->logDetailed('Insert orComposite (type browser) from meta_requirement_id ' . $or['meta_requirement_id']);
296  $next_id = $this->db->nextId('il_meta_or_composite');
297  $name = $this->normalizeOrCompositeName($or['browser_name']);
298  $this->db->manipulate(
299  "INSERT INTO il_meta_or_composite (meta_or_composite_id, rbac_id, obj_id,
300  obj_type, parent_type, parent_id, type, name, min_version, max_version) VALUES (" .
301  $this->db->quote($next_id, ilDBConstants::T_INTEGER) . ", " .
302  $this->db->quote($or['rbac_id'], ilDBConstants::T_INTEGER) . ", " .
303  $this->db->quote($or['obj_id'], ilDBConstants::T_INTEGER) . ", " .
304  $this->db->quote($or['obj_type'], ilDBConstants::T_TEXT) . ", " .
305  $this->db->quote('meta_requirement', ilDBConstants::T_TEXT) . ", " .
306  $this->db->quote($or['meta_requirement_id'], ilDBConstants::T_INTEGER) . ", " .
307  $this->db->quote('browser', ilDBConstants::T_TEXT) . ", " .
308  $this->db->quote($name, ilDBConstants::T_TEXT) . ", " .
309  $this->db->quote($or['browser_minimum_version'], ilDBConstants::T_TEXT) . ", " .
310  $this->db->quote($or['browser_maximum_version'], ilDBConstants::T_TEXT) . ")"
311  );
312  $this->logDetailed('Success, deleting old entry');
313  $this->db->manipulate(
314  "UPDATE il_meta_requirement SET browser_name = '', browser_minimum_version = '',
315  browser_maximum_version = '' WHERE meta_requirement_id = " .
316  $this->db->quote($or['meta_requirement_id'], ilDBConstants::T_INTEGER)
317  );
318  }
319  }
320  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ migrateSetOfSchemas()

ilMDLOMConformanceMigration::migrateSetOfSchemas ( int  $limit)
protected

Definition at line 194 of file class.ilMDLOMConformanceMigration.php.

References logDetailed(), ilDBConstants\T_INTEGER, and ilDBConstants\T_TEXT.

Referenced by migrateSchema().

194  : void
195  {
196  $this->db->setLimit($limit);
197  $schemas = $this->db->query(
198  "SELECT meta_meta_data_id, rbac_id, obj_id, obj_type, meta_data_scheme
199  FROM il_meta_meta_data WHERE CHAR_LENGTH(meta_data_scheme) > 0 ORDER BY meta_meta_data_id"
200  );
201 
202  while ($schema = $this->db->fetchAssoc($schemas)) {
203  $this->logDetailed('Insert schema from meta_meta_data_id ' . $schema['meta_meta_data_id']);
204  $next_id = $this->db->nextId('il_meta_meta_schema');
205  $this->db->manipulate(
206  "INSERT INTO il_meta_meta_schema (meta_meta_schema_id, rbac_id, obj_id,
207  obj_type, parent_type, parent_id, meta_data_schema) VALUES (" .
208  $this->db->quote($next_id, ilDBConstants::T_INTEGER) . ", " .
209  $this->db->quote($schema['rbac_id'], ilDBConstants::T_INTEGER) . ", " .
210  $this->db->quote($schema['obj_id'], ilDBConstants::T_INTEGER) . ", " .
211  $this->db->quote($schema['obj_type'], ilDBConstants::T_TEXT) . ", " .
212  $this->db->quote('meta_meta_data', ilDBConstants::T_TEXT) . ", " .
213  $this->db->quote($schema['meta_meta_data_id'], ilDBConstants::T_INTEGER) . ", " .
214  $this->db->quote('LOMv1.0', ilDBConstants::T_TEXT) . ")"
215  );
216  $this->logDetailed('Success, deleting old entry');
217  $this->db->manipulate(
218  "UPDATE il_meta_meta_data SET meta_data_scheme = '' WHERE meta_meta_data_id = " .
219  $this->db->quote($schema['meta_meta_data_id'], ilDBConstants::T_INTEGER)
220  );
221  }
222  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ normalizeContext()

ilMDLOMConformanceMigration::normalizeContext ( string  $name)
protected

Definition at line 505 of file class.ilMDLOMConformanceMigration.php.

Referenced by migrateSetFromEducational().

505  : string
506  {
507  $dict = [
508  'School' => 'school',
509  'HigherEducation' => 'higher education',
510  'Training' => 'training',
511  'Other' => 'other'
512  ];
513 
514  if (key_exists($name, $dict)) {
515  return $dict[$name];
516  }
517  return $name;
518  }
+ Here is the caller graph for this function:

◆ normalizeIntendedEndUserRole()

ilMDLOMConformanceMigration::normalizeIntendedEndUserRole ( string  $name)
protected

Definition at line 490 of file class.ilMDLOMConformanceMigration.php.

Referenced by migrateSetFromEducational().

490  : string
491  {
492  $dict = [
493  'Teacher' => 'teacher',
494  'Author' => 'author',
495  'Learner' => 'learner',
496  'Manager' => 'manager'
497  ];
498 
499  if (key_exists($name, $dict)) {
500  return $dict[$name];
501  }
502  return $name;
503  }
+ Here is the caller graph for this function:

◆ normalizeLearningResourceType()

ilMDLOMConformanceMigration::normalizeLearningResourceType ( string  $name)
protected

Definition at line 464 of file class.ilMDLOMConformanceMigration.php.

Referenced by migrateSetFromEducational().

464  : string
465  {
466  $dict = [
467  'Exercise' => 'exercise',
468  'Simulation' => 'simulation',
469  'Questionnaire' => 'questionnaire',
470  'Diagram' => 'diagram',
471  'Figure' => 'figure',
472  'Graph' => 'graph',
473  'Index' => 'index',
474  'Slide' => 'slide',
475  'Table' => 'table',
476  'NarrativeText' => 'narrative text',
477  'Exam' => 'exam',
478  'Experiment' => 'experiment',
479  'ProblemStatement' => 'problem statement',
480  'SelfAssessment' => 'self assessment',
481  'Lecture' => 'lecture'
482  ];
483 
484  if (key_exists($name, $dict)) {
485  return $dict[$name];
486  }
487  return $name;
488  }
+ Here is the caller graph for this function:

◆ normalizeOrCompositeName()

ilMDLOMConformanceMigration::normalizeOrCompositeName ( string  $name)
protected

Definition at line 336 of file class.ilMDLOMConformanceMigration.php.

Referenced by migrateSetOfOrComposites().

336  : string
337  {
338  $dict = [
339  'Any' => 'any',
340  'NetscapeCommunicator' => 'netscape communicator',
341  'MS-InternetExplorer' => 'ms-internet explorer',
342  'Opera' => 'opera',
343  'Amaya' => 'amaya',
344  'PC-DOS' => 'pc-dos',
345  'MS-Windows' => 'ms-windows',
346  'MAC-OS' => 'macos',
347  'Unix' => 'unix',
348  'Multi-OS' => 'multi-os',
349  'None' => 'none'
350  ];
351 
352  if (key_exists($name, $dict)) {
353  return $dict[$name];
354  }
355  return $name;
356  }
+ Here is the caller graph for this function:

◆ prepare()

ilMDLOMConformanceMigration::prepare ( Environment  $environment)

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

References $io, and ILIAS\Setup\Environment\getResource().

54  : void
55  {
56  $this->db = $environment->getResource(Environment::RESOURCE_DATABASE);
57 
58  $io = $environment->getResource(Environment::RESOURCE_ADMIN_INTERACTION);
59  if ($io instanceof IOWrapper) {
60  $this->io = $io;
61  }
62  }
Wrapper around symfonies input and output facilities to provide just the functionality required for t...
Definition: IOWrapper.php:32
getResource(string $id)
Consumers of this method should check if the result is what they expect, e.g.
+ Here is the call graph for this function:

◆ setIndices()

ilMDLOMConformanceMigration::setIndices ( string  $table)
protected

Definition at line 122 of file class.ilMDLOMConformanceMigration.php.

References areIndicesSet(), and logDetailed().

Referenced by step().

122  : void
123  {
124  if (!$this->areIndicesSet($table)) {
125  $this->logDetailed('Set index for ' . $table);
126  $this->db->addIndex($table, ['rbac_id', 'obj_id'], 'i1');
127  }
128  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ startLog()

ilMDLOMConformanceMigration::startLog ( )
protected

Definition at line 536 of file class.ilMDLOMConformanceMigration.php.

Referenced by step().

536  : void
537  {
538  if (!isset($this->io)) {
539  return;
540  }
541  $this->io->text('');
542  }
+ Here is the caller graph for this function:

◆ step()

ilMDLOMConformanceMigration::step ( Environment  $environment)

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

References migrateCoverage(), migrateFromEducational(), migrateOrComposite(), migrateSchema(), setIndices(), and startLog().

64  : void
65  {
66  $this->startLog();
67 
68  $this->migrateCoverage(); // general > coverage
69  $this->setIndices('il_meta_coverage');
70 
71  $this->migrateSchema(); // metaMetadata > metadataSchema
72  $this->setIndices('il_meta_meta_schema');
73 
74  $this->migrateOrComposite(); // technical > requirement > orComposite
75  $this->setIndices('il_meta_or_composite');
76 
77  $this->migrateFromEducational();// educational > learningResourceType, intendedEndUserRole, context
78  $this->setIndices('il_meta_lr_type');
79  $this->setIndices('il_meta_end_usr_role');
80  $this->setIndices('il_meta_context');
81  }
+ Here is the call graph for this function:

Field Documentation

◆ $db

ilDBInterface ilMDLOMConformanceMigration::$db
protected

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

◆ $io

IOWrapper ilMDLOMConformanceMigration::$io
protected

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

Referenced by prepare().

◆ MAX_LOOPS

const ilMDLOMConformanceMigration::MAX_LOOPS = 10000
protected

Definition at line 30 of file class.ilMDLOMConformanceMigration.php.

◆ SELECT_LIMIT

const ilMDLOMConformanceMigration::SELECT_LIMIT = 1000
protected

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


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