19 declare(strict_types=1);
26 protected \ilDBInterface
$db;
38 if (!$this->db->tableExists(
'il_md_vocab_inactive')) {
39 $this->db->createTable(
40 'il_md_vocab_inactive',
49 $this->db->addPrimaryKey(
'il_md_vocab_inactive', [
'slot']);
58 if (!$this->db->tableExists(
'il_md_vocab_contr')) {
59 $this->db->createTable(
91 $this->db->addPrimaryKey(
'il_md_vocab_contr', [
'id']);
92 $this->db->createSequence(
'il_md_vocab_contr');
101 if (!$this->db->tableExists(
'il_md_vocab_contr_vals')) {
102 $this->db->createTable(
103 'il_md_vocab_contr_vals',
122 $this->db->addPrimaryKey(
'il_md_vocab_contr_vals', [
'vocab_id',
'value']);
135 if ($this->db->tableColumnExists($table, $src_column)) {
138 $this->db->addTableColumn(
159 if (!$this->db->tableColumnExists($table, $value_column)) {
162 $this->db->modifyTableColumn(
183 if ($new_value === $old_value) {
206 $this->db->manipulate(
207 'UPDATE ' . $this->db->quoteIdentifier($table) .
' SET ' .
208 $this->db->quoteIdentifier($src_column) .
' = ' .
220 if (!$this->db->tableColumnExists($table, $src_column)) {
223 $this->db->modifyTableColumn(
240 SlotIdentifier::GENERAL_STRUCTURE,
241 SlotIdentifier::GENERAL_AGGREGATION_LEVEL,
242 SlotIdentifier::LIFECYCLE_STATUS,
243 SlotIdentifier::LIFECYCLE_CONTRIBUTE_ROLE,
245 SlotIdentifier::TECHNICAL_REQUIREMENT_TYPE,
246 SlotIdentifier::TECHNICAL_REQUIREMENT_BROWSER,
248 SlotIdentifier::EDUCATIONAL_INTERACTIVITY_TYPE,
249 SlotIdentifier::EDUCATIONAL_INTERACTIVITY_LEVEL,
250 SlotIdentifier::EDUCATIONAL_SEMANTIC_DENSITY,
251 SlotIdentifier::EDUCATIONAL_DIFFICULTY,
252 SlotIdentifier::EDUCATIONAL_LEARNING_RESOURCE_TYPE,
253 SlotIdentifier::EDCUCATIONAL_INTENDED_END_USER_ROLE,
254 SlotIdentifier::EDUCATIONAL_CONTEXT,
255 SlotIdentifier::RIGHTS_COST,
256 SlotIdentifier::RIGHTS_CP_AND_OTHER_RESTRICTIONS,
257 SlotIdentifier::RELATION_KIND,
258 SlotIdentifier::CLASSIFICATION_PURPOSE
264 return match ($slot) {
265 SlotIdentifier::GENERAL_STRUCTURE,
266 SlotIdentifier::GENERAL_AGGREGATION_LEVEL =>
'il_meta_general',
267 SlotIdentifier::LIFECYCLE_STATUS =>
'il_meta_lifecycle',
268 SlotIdentifier::LIFECYCLE_CONTRIBUTE_ROLE,
269 SlotIdentifier::METAMETADATA_CONTRIBUTE_ROLE =>
'il_meta_contribute',
270 SlotIdentifier::TECHNICAL_REQUIREMENT_TYPE,
271 SlotIdentifier::TECHNICAL_REQUIREMENT_BROWSER,
272 SlotIdentifier::TECHNICAL_REQUIREMENT_OS =>
'il_meta_or_composite',
273 SlotIdentifier::EDUCATIONAL_INTERACTIVITY_TYPE,
274 SlotIdentifier::EDUCATIONAL_INTERACTIVITY_LEVEL,
275 SlotIdentifier::EDUCATIONAL_SEMANTIC_DENSITY,
276 SlotIdentifier::EDUCATIONAL_DIFFICULTY =>
'il_meta_educational',
277 SlotIdentifier::EDUCATIONAL_LEARNING_RESOURCE_TYPE =>
'il_meta_lr_type',
278 SlotIdentifier::EDCUCATIONAL_INTENDED_END_USER_ROLE =>
'il_meta_end_usr_role',
279 SlotIdentifier::EDUCATIONAL_CONTEXT =>
'il_meta_context',
280 SlotIdentifier::RIGHTS_COST,
281 SlotIdentifier::RIGHTS_CP_AND_OTHER_RESTRICTIONS =>
'il_meta_rights',
282 SlotIdentifier::RELATION_KIND =>
'il_meta_relation',
283 SlotIdentifier::CLASSIFICATION_PURPOSE =>
'il_meta_classification',
290 return match ($slot) {
291 SlotIdentifier::GENERAL_STRUCTURE =>
'general_structure',
292 SlotIdentifier::GENERAL_AGGREGATION_LEVEL =>
'general_aggl',
293 SlotIdentifier::LIFECYCLE_STATUS =>
'lifecycle_status',
294 SlotIdentifier::LIFECYCLE_CONTRIBUTE_ROLE,
295 SlotIdentifier::METAMETADATA_CONTRIBUTE_ROLE =>
'role',
296 SlotIdentifier::TECHNICAL_REQUIREMENT_TYPE =>
'type',
297 SlotIdentifier::TECHNICAL_REQUIREMENT_BROWSER,
298 SlotIdentifier::TECHNICAL_REQUIREMENT_OS =>
'name',
299 SlotIdentifier::EDUCATIONAL_INTERACTIVITY_TYPE =>
'interactivity_type',
300 SlotIdentifier::EDUCATIONAL_LEARNING_RESOURCE_TYPE =>
'learning_resource_type',
301 SlotIdentifier::EDUCATIONAL_INTERACTIVITY_LEVEL =>
'interactivity_level',
302 SlotIdentifier::EDUCATIONAL_SEMANTIC_DENSITY =>
'semantic_density',
303 SlotIdentifier::EDCUCATIONAL_INTENDED_END_USER_ROLE =>
'intended_end_user_role',
304 SlotIdentifier::EDUCATIONAL_CONTEXT =>
'context',
305 SlotIdentifier::EDUCATIONAL_DIFFICULTY =>
'difficulty',
306 SlotIdentifier::RIGHTS_COST =>
'costs',
307 SlotIdentifier::RIGHTS_CP_AND_OTHER_RESTRICTIONS =>
'cpr_and_or',
308 SlotIdentifier::RELATION_KIND =>
'kind',
309 SlotIdentifier::CLASSIFICATION_PURPOSE =>
'purpose',
316 return match ($slot) {
317 SlotIdentifier::GENERAL_STRUCTURE =>
'general_structure_src',
318 SlotIdentifier::GENERAL_AGGREGATION_LEVEL =>
'general_aggl_src',
319 SlotIdentifier::LIFECYCLE_STATUS =>
'lifecycle_status_src',
320 SlotIdentifier::LIFECYCLE_CONTRIBUTE_ROLE,
321 SlotIdentifier::METAMETADATA_CONTRIBUTE_ROLE =>
'role_src',
322 SlotIdentifier::TECHNICAL_REQUIREMENT_TYPE =>
'type_src',
323 SlotIdentifier::TECHNICAL_REQUIREMENT_BROWSER,
324 SlotIdentifier::TECHNICAL_REQUIREMENT_OS =>
'name_src',
325 SlotIdentifier::EDUCATIONAL_INTERACTIVITY_TYPE =>
'interactivity_type_src',
326 SlotIdentifier::EDUCATIONAL_LEARNING_RESOURCE_TYPE =>
'learning_resource_type_src',
327 SlotIdentifier::EDUCATIONAL_INTERACTIVITY_LEVEL =>
'interactivity_level_src',
328 SlotIdentifier::EDUCATIONAL_SEMANTIC_DENSITY =>
'semantic_density_src',
329 SlotIdentifier::EDCUCATIONAL_INTENDED_END_USER_ROLE =>
'intended_end_user_role_src',
330 SlotIdentifier::EDUCATIONAL_CONTEXT =>
'context_src',
331 SlotIdentifier::EDUCATIONAL_DIFFICULTY =>
'difficulty_src',
332 SlotIdentifier::RIGHTS_COST =>
'costs_src',
333 SlotIdentifier::RIGHTS_CP_AND_OTHER_RESTRICTIONS =>
'cpr_and_or_src',
334 SlotIdentifier::RELATION_KIND =>
'kind_src',
335 SlotIdentifier::CLASSIFICATION_PURPOSE =>
'purpose_src',
342 return match ($slot) {
343 SlotIdentifier::GENERAL_AGGREGATION_LEVEL => [
349 SlotIdentifier::TECHNICAL_REQUIREMENT_TYPE => [
350 'browser' =>
'browser',
351 'operating system' =>
'operating system' 353 SlotIdentifier::GENERAL_STRUCTURE => [
354 'atomic' =>
'Atomic',
355 'collection' =>
'Collection',
356 'networked' =>
'Networked',
357 'hierarchical' =>
'Hierarchical',
360 SlotIdentifier::LIFECYCLE_STATUS => [
363 'revised' =>
'Revised',
364 'unavailable' =>
'Unavailable' 366 SlotIdentifier::LIFECYCLE_CONTRIBUTE_ROLE,
367 SlotIdentifier::METAMETADATA_CONTRIBUTE_ROLE => [
368 'author' =>
'Author',
369 'publisher' =>
'Publisher',
370 'unknown' =>
'Unknown',
371 'initiator' =>
'Initiator',
372 'terminator' =>
'Terminator',
373 'editor' =>
'Editor',
374 'graphical designer' =>
'GraphicalDesigner',
375 'technical implementer' =>
'TechnicalImplementer',
376 'content provider' =>
'ContentProvider',
377 'technical validator' =>
'TechnicalValidator',
378 'educational validator' =>
'EducationalValidator',
379 'script writer' =>
'ScriptWriter',
380 'instructional designer' =>
'InstructionalDesigner',
381 'subject matter expert' =>
'SubjectMatterExpert',
382 'creator' =>
'Creator',
383 'validator' =>
'Validator' 385 SlotIdentifier::TECHNICAL_REQUIREMENT_BROWSER,
386 SlotIdentifier::TECHNICAL_REQUIREMENT_OS => [
387 'pc-dos' =>
'PC-DOS',
388 'ms-windows' =>
'MS-Windows',
391 'multi-os' =>
'Multi-OS',
394 'netscape communicator' =>
'NetscapeCommunicator',
395 'ms-internet explorer' =>
'MS-InternetExplorer',
399 SlotIdentifier::EDUCATIONAL_INTERACTIVITY_TYPE => [
400 'active' =>
'Active',
401 'expositive' =>
'Expositive',
404 SlotIdentifier::EDUCATIONAL_LEARNING_RESOURCE_TYPE => [
405 'exercise' =>
'Exercise',
406 'simulation' =>
'Simulation',
407 'questionnaire' =>
'Questionnaire',
408 'diagram' =>
'Diagram',
409 'figure' =>
'Figure',
414 'narrative text' =>
'NarrativeText',
416 'experiment' =>
'Experiment',
417 'problem statement' =>
'ProblemStatement',
418 'self assessment' =>
'SelfAssessment',
419 'lecture' =>
'Lecture' 421 SlotIdentifier::EDUCATIONAL_INTERACTIVITY_LEVEL,
422 SlotIdentifier::EDUCATIONAL_SEMANTIC_DENSITY => [
423 'very low' =>
'VeryLow',
425 'medium' =>
'Medium',
427 'very high' =>
'VeryHigh' 429 SlotIdentifier::EDCUCATIONAL_INTENDED_END_USER_ROLE => [
430 'teacher' =>
'Teacher',
431 'author' =>
'Author',
432 'learner' =>
'Learner',
433 'manager' =>
'Manager' 435 SlotIdentifier::EDUCATIONAL_CONTEXT => [
436 'school' =>
'School',
437 'higher education' =>
'HigherEducation',
438 'training' =>
'Training',
441 SlotIdentifier::EDUCATIONAL_DIFFICULTY => [
442 'very easy' =>
'VeryEasy',
444 'medium' =>
'Medium',
445 'difficult' =>
'Difficult',
446 'very difficult' =>
'VeryDifficult' 448 SlotIdentifier::RIGHTS_COST,
449 SlotIdentifier::RIGHTS_CP_AND_OTHER_RESTRICTIONS => [
453 SlotIdentifier::RELATION_KIND => [
454 'ispartof' =>
'IsPartOf',
455 'haspart' =>
'HasPart',
456 'isversionof' =>
'IsVersionOf',
457 'hasversion' =>
'HasVersion',
458 'isformatof' =>
'IsFormatOf',
459 'hasformat' =>
'HasFormat',
460 'references' =>
'References',
461 'isreferencedby' =>
'IsReferencedBy',
462 'isbasedon' =>
'IsBasedOn',
463 'isbasisfor' =>
'IsBasisFor',
464 'requires' =>
'Requires',
465 'isrequiredby' =>
'IsRequiredBy' 467 SlotIdentifier::CLASSIFICATION_PURPOSE => [
468 'discipline' =>
'Discipline',
470 'prerequisite' =>
'Prerequisite',
471 'educational objective' =>
'EducationalObjective',
472 'accessibility restrictions' =>
'AccessibilityRestrictions',
473 'educational level' =>
'EducationalLevel',
474 'skill level' =>
'SkillLevel',
475 'security level' =>
'SecurityLevel',
476 'competency' =>
'Competency' step_3()
Add a new table to store values and labels of controlled vocabularies.
getTranslationsForVocabSlot(SlotIdentifier $slot)
step_4()
Add columns for the sources of all vocab values.
step_2()
Add a new table to store controlled vocabularies.
step_5()
Make more space in the columns of vocab values to hold controlled values.
getSourceColumnNameForVocabSlot(SlotIdentifier $slot)
getValueColumnNameForVocabSlot(SlotIdentifier $slot)
step_1()
Add a new table to store deactivated standard vocabularies.
prepare(\ilDBInterface $db)
Prepare the execution of the steps.
step_6()
Normalize existing vocab values.
getTableForVocabSlot(SlotIdentifier $slot)
step_7()
Fill source columns with the default value.