Author: david
Date: Thu Dec  8 15:17:49 2011
New Revision: 10383

Log:
Make path required

Modified:
   trunk/lib/task/archivematicaDipImportTask.class.php

Modified: trunk/lib/task/archivematicaDipImportTask.class.php
==============================================================================
--- trunk/lib/task/archivematicaDipImportTask.class.php Thu Dec  8 15:06:53 
2011        (r10382)
+++ trunk/lib/task/archivematicaDipImportTask.class.php Thu Dec  8 15:17:49 
2011        (r10383)
@@ -37,14 +37,14 @@
   protected function configure()
   {
     $this->addArguments(array(
-      new sfCommandArgument('filename', sfCommandArgument::REQUIRED, 'The 
input file (csv format).')
+      new sfCommandArgument('filename', sfCommandArgument::REQUIRED, 'The 
input file (csv format).'),
+      new sfCommandArgument('path', sfCommandArgument::REQUIRED, 'Path to 
digital objects.')
     ));
 
     $this->addOptions(array(
       new sfCommandOption('application', null, 
sfCommandOption::PARAMETER_OPTIONAL, 'The application name', true),
       new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 
'The environment', 'cli'),
       new sfCommandOption('connection', null, 
sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'propel'),
-      new sfCommandOption('path', 'p', sfCommandOption::PARAMETER_OPTIONAL, 
'Path to digital objects. If a path is not specified then csv filenames are 
assumed to include an absolute path', null),
     ));
 
     $this->namespace = 'archivematica';
@@ -59,7 +59,7 @@
 2) The filename (TIFF) of the original digital object
 
 The import script expects that Archivematica will have modified the file name 
so:
-a) The file has been converted to a JPEG and uses the ".jpg" extension
+a) The original TIFF image has been converted to a JPEG and now has a ".jpg" 
extension
 b) A UUID has been pre-pended to the filename
 
 Note: Filenames must be unique (without UUID) within "path" to avoid colliding 
on import.
@@ -87,11 +87,7 @@
     // object has multiple digital objects attached 
     while ($row = fgetcsv($fh, 1000))
     {
-      $filepath = $row[1];
-      if (isset($options['path']))
-      {
-        $filepath = rtrim($options['path'], '/').'/'.$filepath;
-      }
+      $filepath = rtrim($arguments['path'], '/').'/'.$row[1];
 
       if (!isset($digitalObjects[$row[0]]))
       {

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