Author: mcantelon
Date: Mon Jan 2 15:23:21 2012
New Revision: 10520
Log:
Added support for subject access points.
Modified:
trunk/lib/task/csvImportTask.class.php
Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php Mon Jan 2 14:39:46 2012
(r10519)
+++ trunk/lib/task/csvImportTask.class.php Mon Jan 2 15:23:21 2012
(r10520)
@@ -182,6 +182,23 @@
$self->informationObject->save();
}
+ // add subject access points
+ if (isset($self->rowStatusVars['subjectAccessPoints']))
+ {
+ foreach($self->rowStatusVars['subjectAccessPoints'] as $subject)
+ {
+ $term = new QubitTerm();
+ $term->taxonomyId = QubitTaxonomy::SUBJECT_ID;
+ $term->name = $subject;
+ $term->save();
+
+ $relation = new QubitObjectTermRelation;
+ $relation->term = $term;
+ $relation->objectId = $self->informationObject->id;
+ $relation->save();
+ }
+ }
+
// add accessions
if (
isset($self->rowStatusVars['accessionNumbers'])
@@ -280,6 +297,14 @@
$self->rowStatusVars['endYear'] = $data;
});
+ $import->addColumnHandler('subjectAccessPoints', function(&$self, $data)
+ {
+ if ($data)
+ {
+ $self->rowStatusVars['subjectAccessPoints'] = explode('|', $data);
+ }
+ });
+
$import->csv($fh);
}
}
--
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.