Author: mcantelon
Date: Thu Dec 29 16:51:47 2011
New Revision: 10482
Log:
Working on mapping columns to Qubit and added rough logic to create actors.
Modified:
trunk/lib/task/csvImportTask.class.php
Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php Thu Dec 29 16:17:57 2011
(r10481)
+++ trunk/lib/task/csvImportTask.class.php Thu Dec 29 16:51:47 2011
(r10482)
@@ -61,6 +61,11 @@
throw new sfException('You must specify a valid filename');
}
+$actor = new QubitActor;
+$actor->parentId = QubitActor::ROOT_ID;
+$actor->save();
+
+
$defaultStatusId = sfConfig::get(
'app_defaultPubStatus',
QubitTerm::PUBLICATION_STATUS_DRAFT_ID
@@ -75,12 +80,19 @@
'ignoreColumns' => array(
'THUMBNAIL',
'TIFF and JPEG Number',
- 'TIFFIMAGE'
+ 'TIFFIMAGE',
+ 'Type'
),
'columnMap' => array(
'TITLE' => 'title',
'Accruals' => 'accruals',
- 'RECORD ID' => 'identifier',
+ 'RECORD ID' => array(
+ 'column' => 'sources',
+ 'transformationLogic' => function(&$self, $text)
+ {
+ return 'CS-Records ID: '. $text;
+ }
+ ),
'SCOPE AND CONTENT' => 'scopeAndContent',
'Extent and medium' => 'extentAndMedium',
'Acquisition' => 'acquisition',
@@ -91,6 +103,7 @@
'Archival history' => 'archivalHistory',
'Arrangement' => 'arrangement',
'FINDING AIDS' => 'findingAids',
+/*
'Revision history' => array(
'column' => 'revision',
'transformationLogic' => function(&$self, $text)
@@ -111,11 +124,13 @@
);
}
),
- '???' => 'physicalCharacteristics'
+*/
+ 'Physical characteristics' => 'physicalCharacteristics'
),
'propertyMap' => array(
'titleStatementOfResponsibility' => 'titleStatementOfResponsibility',
- 'RAD note - statements of responsibility' =>
'statementOfResponsibilityRelatingToPublishersSeries'
+ 'RAD note - statements of responsibility' =>
'statementOfResponsibilityRelatingToPublishersSeries',
+ 'titleProperOfPublishersSeries' => 'titleProperOfPublishersSeries'
),
'noteMap' => array(
'Rad note – conservation' => array('typeId' => 231),
@@ -410,6 +425,13 @@
}
}
+ public function createActor()
+ {
+ $actor = new QubitActor;
+ $actor->parentId = QubitActor::ROOT_ID;
+ $actor->save();
+ }
+
public function appendWithLineBreakIfNeeded($oldContent, $newContent)
{
return ($oldContent) ? $oldContent ."\n". $newContent : $newContent;
--
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.