Author: mcantelon
Date: Fri Feb 10 12:54:50 2012
New Revision: 10852

Log:
Added physical object creation.

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

Modified: trunk/lib/task/import/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/import/csvImportTask.class.php       Fri Feb 10 12:28:07 
2012        (r10851)
+++ trunk/lib/task/import/csvImportTask.class.php       Fri Feb 10 12:54:50 
2012        (r10852)
@@ -192,6 +192,8 @@
         'copyrightStatus',
         'copyrightExpires',
         'copyrightHolder',
+        'physicalObjectName',
+        'physicalObjectLocation'
       ),
 
       /* these values get exploded and stored to the rowStatusVars array */
@@ -259,6 +261,28 @@
           $keymap->targetName = 'information_object';
           $keymap->save();
 
+          // add physical objects
+          if (
+            $self->rowStatusVars['physicalObjectName']
+            || $self->rowStatusVars['physicalObjectLocation']
+          )
+          {
+            if (
+              $self->rowStatusVars['physicalObjectName']
+              && $self->rowStatusVars['physicalObjectLocation']
+            )
+            {
+              createOrFetchPhysicalObject(
+                $name,
+                $location
+              );
+            } else {
+              $error = 'Both physicalObjectName and physicalObjectLocation '
+                     + 'required to create a physical object.';
+              print $self->logError($error);
+            }
+          }
+
           // add subject access points
           $accessPointColumns = array(
             'subjectAccessPoints' => QubitTaxonomy::SUBJECT_ID,

-- 
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