Author: david
Date: 2008-12-15 16:52:29 -0800 (Mon, 15 Dec 2008)
New Revision: 1689

Modified:
   trunk/qubit/lib/task/migrate/QubitMigrate103to104.class.php
Log:
Clean up QubitMigrate103to104 code a bit.  Remove section for assigning creator 
to Telelearning fonds - updating sample data is not what the migration task is 
for.

Modified: trunk/qubit/lib/task/migrate/QubitMigrate103to104.class.php
===================================================================
--- trunk/qubit/lib/task/migrate/QubitMigrate103to104.class.php 2008-12-16 
00:13:18 UTC (rev 1688)
+++ trunk/qubit/lib/task/migrate/QubitMigrate103to104.class.php 2008-12-16 
00:52:29 UTC (rev 1689)
@@ -138,25 +138,6 @@
       }
     }
 
-    // Add actor to TeleLearning Network creation event
-    $teleLearningFondsKey = $this->getRowKey('QubitInformationObject', 
'title', array('en' => 'TeleLearning Network fonds'));
-    $teleLearningActorKey = $this->getRowKey('QubitActor', 
'authorized_form_of_name', array('en' => 'TeleLearning Network Inc'));
-    $creationEventTermKey = $this->getRowKey('QubitTerm', 'id', '<?php echo 
QubitTerm::CREATION_ID."\n" ?>');
-
-    if ($teleLearningFondsKey && $teleLearningActorKey && 
$creationEventTermKey)
-    {
-      foreach ($this->data['QubitEvent'] as $key => $columns)
-      {
-        if (isset($columns['information_object_id']) && 
isset($columns['type_id'])
-        && $columns['information_object_id'] == $teleLearningFondsKey
-        && $columns['type_id'] == $creationEventTermKey)
-        {
-          $this->data['QubitEvent'][$key]['actor_id'] = $teleLearningActorKey;
-          break;
-        }
-      }
-    }
-
     // Remove "existence" events and move existence info into actor table
     // dates_of_existence column
     $existenceTermKey = $this->getTermExistenceKey();
@@ -460,13 +441,9 @@
     );
 
     // Update version number
-    foreach ($this->data['QubitSetting'] as $key => $setting)
+    if ($settingVersionKey = $this->getRowKey('QubitSetting', 'value', 
array('en' => '1.0.4')))
     {
-      if ($setting['name'] == 'version')
-      {
-        $this->data['QubitSetting'][$key]['value'] = array('en' => '1.0.4');
-        break;
-      }
+      $this->data['QubitSetting'][$settingVersionKey]['value'] = array('en' => 
'1.0.4');
     }
 
     return $this;
@@ -519,35 +496,26 @@
     if ($existenceKey = $this->getTermExistenceKey())
     {
       $existenceArrayKeyIndex = 
QubitMigrateData::getArrayKeyIndex($this->data['QubitTerm'], $existenceKey);
-      $newTerm = $this->data['QubitTerm'][$existenceKey];
-      $newTerm['id'] = '<?php echo QubitTerm::SUBJECT_ID."\n" ?>';
-      $newTerm['name'] = array(
+      $subjectTerm = $this->data['QubitTerm'][$existenceKey];
+      $subjectTerm['id'] = '<?php echo QubitTerm::SUBJECT_ID."\n" ?>';
+      $subjectTerm['name'] = array(
         'en'=>'Subject', 'fr' => 'Sujet', 'nl' => 'Onderwerp', 'pt' => 
'Assunto');
 
-      // Splice subject_id term into data array where existenceKey lives now
-      QubitMigrateData::array_insert($this->data['QubitTerm'], 
$existenceArrayKeyIndex, array('QubitTerm_subject' => $newTerm));
+      // Splice SUBJECT_ID term into data array where EXISTENCE_ID lives now
+      QubitMigrateData::array_insert($this->data['QubitTerm'], 
$existenceArrayKeyIndex, array('QubitTerm_subject' => $subjectTerm));
 
       // Delete existence term
       unset($this->data['QubitTerm'][$existenceKey]);
     }
 
-    // Event Types
+    // Add new Event Types
     $taxonomyEventTypeKey = $this->getRowKey('QubitTaxonomy', 'id', '<?php 
echo QubitTaxonomy::EVENT_TYPE_ID."\n" ?>');
-
-    // Add QubitTerm:accumulation after QubitTerm:collection
-    $collectionKey = $this->getRowKey('QubitTerm', 'id', '<?php echo 
QubitTerm::COLLECTION_ID."\n" ?>');
-    $collectionIndex = 
QubitMigrateData::getArrayKeyIndex($this->data['QubitTerm'], $collectionKey);
-    if (false !== $collectionIndex)
-    {
-      $newEventTypes['QubitTerm_accumulation'] = array(
-        'taxonomy_id' => $taxonomyEventTypeKey,
-        'id' => '<?php echo QubitTerm::ACCUMULATION_ID."\n" ?>',
-        'source_culture' => 'en',
-        'name' => array('en' => 'Accumulation')
-      );
-      QubitMigrateData::array_insert($this->data['QubitTerm'], 
($collectionIndex+1), $newEventTypes);
-    }
-
+    $this->data['QubitTerm']['QubitTerm_accumulation'] = array(
+      'taxonomy_id' => $taxonomyEventTypeKey,
+      'id' => '<?php echo QubitTerm::ACCUMULATION_ID."\n" ?>',
+      'source_culture' => 'en',
+      'name' => array('en' => 'Accumulation')
+    );
     $this->data['QubitTerm']['QubitTerm_writing'] = array(
       'taxonomy_id' => $taxonomyEventTypeKey,
       'source_culture' => 'en',
@@ -584,25 +552,17 @@
       'name' => array('en' => 'Manufacturing')
     );
 
-    // Note type
+    // Add new Note types
     $taxonomyNoteTypeKey = $this->getRowKey('QubitTaxonomy', 'id', '<?php echo 
QubitTaxonomy::NOTE_TYPE_ID."\n" ?>');
+    $this->data['QubitTerm']['QubitTerm_display_note'] = array(
+      'taxonomy_id' => $taxonomyNoteTypeKey,
+      'id' => '<?php echo QubitTerm::DISPLAY_NOTE_ID."\n" ?>',
+      'class_name' => 'QubitTerm',
+      'source_culture' => 'en',
+      'name' => array('en' => 'Display note')
+    );
 
-    // Add display note after scope note
-    $scopeNoteKey = $this->getRowKey('QubitTerm', 'id', '<?php echo 
QubitTerm::SCOPE_NOTE_ID."\n" ?>');
-    $scopeNoteIndex = 
QubitMigrateData::getArrayKeyIndex($this->data['QubitTerm'], $scopeNoteKey);
-    if (false !== $scopeNoteIndex)
-    {
-      $newNoteTypes['QubitTerm_display_note'] = array(
-        'taxonomy_id' => $taxonomyNoteTypeKey,
-        'id' => '<?php echo QubitTerm::DISPLAY_NOTE_ID."\n" ?>',
-        'class_name' => 'QubitTerm',
-        'source_culture' => 'en',
-        'name' => array('en' => 'Display note')
-      );
-      QubitMigrateData::array_insert($this->data['QubitTerm'], 
($scopeNoteIndex+1), $newNoteTypes);
-    }
-
-    // Material Types
+    // Add new Material Types
     $this->data['QubitTerm']['QubitTerm_material_type_architectural_drawing'] 
= array(
       'taxonomy_id' => 'QubitTaxonomy_MaterialType',
       'class_name' => 'QubitTerm',
@@ -664,7 +624,7 @@
       'name' => array('en' => 'Textual record')
     );
 
-    // RAD Note Types
+    // Add new RAD Note Types
     $this->data['QubitTerm']['QubitTerm_rad_notes_edition'] = array(
       'taxonomy_id' => 'QubitTaxonomy_Rad_Note',
       'class_name' => 'QubitTerm',
@@ -714,7 +674,7 @@
       'name' => array('en' => 'General note')
     );
 
-    // RAD Title Notes
+    // Add new RAD Title Notes
     $this->data['QubitTerm']['QubitTerm_rad_title_variations_in_title'] = 
array(
       'taxonomy_id' => 'QubitTaxonomy_Rad_Title_Note',
       'class_name' => 'QubitTerm',
@@ -824,7 +784,7 @@
       'ARTEFACT_ID',
     //Relation Type taxonomy
       'HAS_PHYSICAL_OBJECT_ID'
-      );
+    );
 
       // Restack array with Constant values at top
       $qubitTermArray = $this->data['QubitTerm'];


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.ca/group/qubit-commits?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to