Author: mcantelon
Date: Wed Jan 4 16:43:12 2012
New Revision: 10563
Log:
Documented import specification options.
Modified:
trunk/lib/task/csvImportTask.class.php
Modified: trunk/lib/task/csvImportTask.class.php
==============================================================================
--- trunk/lib/task/csvImportTask.class.php Wed Jan 4 16:27:25 2012
(r10562)
+++ trunk/lib/task/csvImportTask.class.php Wed Jan 4 16:43:12 2012
(r10563)
@@ -104,6 +104,7 @@
'RECORD_ID',
'PRI_REC_NO'
),
+ /* import columns that map directory to QubitInformationObject
properties */
'standardColumns' => array(
'title',
'accruals',
@@ -121,30 +122,27 @@
'sources',
'physicalCharacteristics'
),
- 'columnMap' => array(
-/*
- 'Revision history' => array(
- 'column' => 'revision',
- 'transformationLogic' => function(&$self, $text)
- {
- return $self->appendWithLineBreakIfNeeded(
- $self->informationObject->revision,
- $text
- );
- }
- ),
- 'ARCHIVIST' => array(
- 'column' => 'revision',
- 'transformationLogic' => function(&$self, $text)
- {
- return $self->appendWithLineBreakIfNeeded(
- $self->informationObject->revision,
- 'Created by'. $text
- );
- }
- ),
-*/
- ),
+ /* import columns that should be redirected to QubitInformationObject
+ properties (and optionally transformed)
+
+ Example:
+ 'columnMap' => array(
+ 'Archival History' => 'archivalHistory',
+ 'Revision history' => array(
+ 'column' => 'revision',
+ 'transformationLogic' => function(&$self, $text)
+ {
+ return $self->appendWithLineBreakIfNeeded(
+ $self->informationObject->revision,
+ $text
+ );
+ }
+ )
+ ),
+ */
+ 'columnMap' => array(),
+ /* import columns that can be added using the
+ QubitInformationObject::addProperty method */
'propertyMap' => array(
'titleStatementOfResponsibility' => 'titleStatementOfResponsibility',
'radNoteStatementOfResponsibility' =>
'statementOfResponsibilityRelatingToPublishersSeries',
@@ -153,6 +151,7 @@
'statementOfScaleCartographic' => 'statementOfScaleCartographic',
'radTitleProperOfPublishersSeries' => 'titleProperOfPublishersSeries'
),
+ /* import columns that can be added as QubitNote objects */
'noteMap' => array(
'radNoteConservation' => array(
'typeId' => array_search('Conservation note', $noteTypes)
@@ -224,7 +223,6 @@
$relation->objectId = $actor->id;
$relation->typeId = QubitTerm::NAME_ACCESS_POINT_ID;
$relation->save();
-# "relation" table (relation.subject_id = information_object.id,
relation.object_id = actor.id).
}
}
@@ -294,6 +292,7 @@
}
}
+ // add creators and create events
if (isset($self->rowStatusVars['creators'])
&& count($self->rowStatusVars['creators']))
{
@@ -339,6 +338,8 @@
}
}
}
+
+ // output progress information
if ($options = $self->getStatus('options'))
{
// row count isn't incremented until completion of this closure, so
add one to reflect reality
@@ -445,7 +446,6 @@
}
});
-//print_r($GLOBALS['materialTypes']); exit();
$import->addColumnHandler('radGeneralMaterialDesignation',
function(&$self, $data)
{
if ($data)
--
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.