Author: mcantelon
Date: Thu Dec 29 15:35:07 2011
New Revision: 10476
Log:
Added support to specific transformation logic for standard column text.
Modified:
trunk/lib/task/csvImportTask.class.php
Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php Thu Dec 29 15:04:16 2011
(r10475)
+++ trunk/lib/task/csvImportTask.class.php Thu Dec 29 15:35:07 2011
(r10476)
@@ -86,7 +86,12 @@
'Archival history' => 'archivalHistory',
'Arrangement' => 'arrangement',
'FINDING AIDS' => 'findingAids',
- 'Revision history' => 'revision',
+ 'Revision history' => array(
+ 'column' => 'revision',
+ 'transformationLogic' => function(&$self, $text) {
+ return $self->informationObject->revision . $text ."\n";
+ }
+ ),
'???' => 'physicalCharacteristics'
),
'propertyMap' => array(
@@ -287,7 +292,20 @@
// if column maps to an attribute, set the attribute
if (isset($self->columnMap) && isset($self->columnMap[$columnName]))
{
- $self->informationObject->{$self->columnMap[$columnName]} = $value;
+ if (is_array($self->columnMap[$columnName]))
+ {
+ // tranform value is logic provided to do so
+ if
(is_callable($self->columnMap[$columnName]['transformationLogic']))
+ {
+ $self->informationObject->{$self->columnMap[$columnName]['column']}
+ = $self->columnMap[$columnName]['transformationLogic'](&$self,
$value);
+print "Did ONE\n";
+ } else {
+
$self->informationObject->{$self->columnMap[$columnName]['column']} = $value;
+ }
+ } else {
+ $self->informationObject->{$self->columnMap[$columnName]} = $value;
+ }
}
else if (
isset($self->columns[$index])
--
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.