Author: mcantelon
Date: Tue Sep  4 13:44:21 2012
New Revision: 12257

Log:
Added support for status and level of detail columns to authority record import.

Modified:
   trunk/lib/task/import/csvAuthorityRecordImportTask.class.php

Modified: trunk/lib/task/import/csvAuthorityRecordImportTask.class.php
==============================================================================
--- trunk/lib/task/import/csvAuthorityRecordImportTask.class.php        Tue Sep 
 4 11:40:27 2012        (r12256)
+++ trunk/lib/task/import/csvAuthorityRecordImportTask.class.php        Tue Sep 
 4 13:44:21 2012        (r12257)
@@ -129,9 +129,11 @@
 
     // Load taxonomies into variables to avoid use of magic numbers
     $termData = QubitFlatfileImport::loadTermsFromTaxonomies(array(
-      QubitTaxonomy::NOTE_TYPE_ID => 'noteTypes',
-      QubitTaxonomy::ACTOR_ENTITY_TYPE_ID => 'actorTypes',
-      QubitTaxonomy::ACTOR_RELATION_TYPE_ID => 'actorRelationTypes'
+      QubitTaxonomy::NOTE_TYPE_ID                => 'noteTypes',
+      QubitTaxonomy::ACTOR_ENTITY_TYPE_ID        => 'actorTypes',
+      QubitTaxonomy::ACTOR_RELATION_TYPE_ID      => 'actorRelationTypes',
+      QubitTaxonomy::DESCRIPTION_STATUS_ID       => 'descriptionStatusTypes',
+      QubitTaxonomy::DESCRIPTION_DETAIL_LEVEL_ID => 'detailLevelTypes'
     ));
 
     // Define import
@@ -148,10 +150,12 @@
       /* the status array is a place to put data that should be accessible
          from closure logic using the getStatus method */
       'status' => array(
-        'sourceName' => $sourceName,
-        'actorTypes' => $termData['actorTypes'],
-        'aliases'    => $aliases,
-        'actorNames' => array()
+        'sourceName'             => $sourceName,
+        'actorTypes'             => $termData['actorTypes'],
+        'descriptionStatusTypes' => $termData['descriptionStatusTypes'],
+        'detailLevelTypes'       => $termData['detailLevelTypes'],
+        'aliases'                => $aliases,
+        'actorNames'             => array()
       ),
 
       /* import columns that map directory to QubitInformationObject 
properties */
@@ -204,6 +208,8 @@
       /* these values get stored to the rowStatusVars array */
       'variableColumns' => array(
         'typeOfEntity',
+        'status',
+        'levelOfDetail',
         'email',
         'notes',
         'countryCode',
@@ -235,6 +241,32 @@
               throw new sfException($entityType .' is not a valid entity 
type.');
             }
           }
+
+          if (
+            isset($self->rowStatusVars['status'])
+            && $self->rowStatusVars['status']
+          )
+          {
+            $self->object->descriptionStatusId = $self->translateNameToTermId(
+              'status',
+              $self->rowStatusVars['status'],
+              array(),
+              $self->getStatus('descriptionStatusTypes')
+            );
+          }
+
+          if (
+            isset($self->rowStatusVars['levelOfDetail'])
+            && $self->rowStatusVars['levelOfDetail']
+          )
+          {
+            $self->object->descriptionDetailId = $self->translateNameToTermId(
+              'level of detail',
+              $self->rowStatusVars['levelOfDetail'],
+              array(),
+              $self->getStatus('detailLevelTypes')
+            );
+          }
         }
       },
 

-- 
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.com/group/qubit-commits?hl=en.

Reply via email to