Index: trunk/ippToPsps/scripts/ippToPsps_run.pl
===================================================================
--- trunk/ippToPsps/scripts/ippToPsps_run.pl	(revision 27868)
+++ trunk/ippToPsps/scripts/ippToPsps_run.pl	(revision 27869)
@@ -12,5 +12,5 @@
 
 # globals
-my ($verbose, $save_temps, $no_op, $no_update, $camera, $product, $output, $dvodb, $datastoreProduct, $label, $singleExpId, $no_publish);
+my ($verbose, $save_temps, $no_op, $no_update, $camera, $batchType, $output, $dvodb, $datastoreProduct, $label, $singleExpId, $no_publish);
 
 # TODO temporary until we use database to store current jobid
@@ -31,9 +31,9 @@
 GetOptions(
         'output|o=s' => \$output,
-        'product|p=s' => \$product,
+        'batch|b=s' => \$batchType,
         'dvodb|d=s' => \$dvodb,
         'label|l=s' => \$label,
         'expid|e=s' => \$singleExpId,
-        'dsproduct|s=s' => \$datastoreProduct,
+        'product|p=s' => \$datastoreProduct,
         'no_publish' => \$no_publish,
         'verbose|v' => \$verbose,
@@ -53,5 +53,5 @@
         "--dvodb <path>\n".
         "\n   Optional:\n\n".
-        "--dsproduct <datastoreProductName>\n".
+        "--product <datastoreProduct>\n".
         "--no_publish - won't publish to datastore\n".
         "--save_temps - will save temporary files\n".
@@ -60,5 +60,5 @@
         -exitval => 3
         ) unless 
-defined $product and
+defined $batchType and
 defined $output and
 defined $dvodb and
@@ -190,8 +190,8 @@
 
         # run IppToPsps program
-        if (runIppToPsps($db, $expId, $batchOutputPath, $product)) {
+        if (runIppToPsps($db, $expId, $batchOutputPath, $batchType)) {
 
             # write batch manifest and tar and zip up
-            if (writeBatchManifest($batchOutputPath, $batchDir, $product)) {
+            if (writeBatchManifest($batchOutputPath, $batchDir, $batchType)) {
 
                 if (tarAndZipDirectory($jobOutputPath, $batchDir)) {
@@ -225,5 +225,5 @@
         }
 
-        if ($product eq "init" ) {print "* Wrote initialisation batch\n"; last;}
+        if ($batchType eq "init" ) {print "* Wrote initialisation batch\n"; last;}
 
 
@@ -278,16 +278,16 @@
 #######################################################################################
 sub runIppToPsps {
-    my ($db, $expId, $batchOutputPath, $product) = @_;
+    my ($db, $expId, $batchOutputPath, $batchType) = @_;
 
     my $success = 0;
 
     # before anything else, we can publish the init batch
-    if ($product =~ /init/) {
+    if ($batchType =~ /init/) {
         $success = produceInit($batchOutputPath);
     }
-    elsif ($product =~ /det/) {
+    elsif ($batchType =~ /det/) {
         $success = produceDetections($db, $expId, $batchOutputPath);
     }
-    elsif ($product =~ /diff/) {
+    elsif ($batchType =~ /diff/) {
         $success = produceDiffs($db, $expId, $batchOutputPath);
     }
@@ -344,5 +344,5 @@
 sub writeBatchManifest {
 
-    my ($path,$batch,$product) = @_;
+    my ($path,$batch,$batchType) = @_;
 
     use XML::Writer;
@@ -359,8 +359,8 @@
     # determine batch 'type'
     my $type;
-    if($product eq 'init') {$type = "IN";}
-    elsif($product eq 'det') {$type = "P2";}
-    elsif ($product eq 'stack') {$type = "ST";}
-    elsif ($product eq 'diff') {$type = "OB";}
+    if($batchType eq 'init') {$type = "IN";}
+    elsif($batchType eq 'det') {$type = "P2";}
+    elsif ($batchType eq 'stack') {$type = "ST";}
+    elsif ($batchType eq 'diff') {$type = "OB";}
     else {$type = "UNKNOWN";}
 
@@ -373,5 +373,5 @@
     my $maxObjId;
     my $filename;
-    if($product eq 'det') {
+    if($batchType eq 'det') {
 
         while (<MYFILE>) {
@@ -410,5 +410,5 @@
 
             # write manifest element TODO untidy
-            if($product eq 'det' && $filename eq $f) {
+            if($batchType eq 'det' && $filename eq $f) {
 
                 $writer->startTag('manifest',
@@ -437,5 +437,5 @@
             #$writer->startTag('md5'); $writer->characters("$md5sum"); $writer->endTag();
 
-            #if($product eq 'det' && $filename eq $f) {
+            #if($batchType eq 'det' && $filename eq $f) {
 
                 #    $writer->startTag('minObjId'); $writer->characters("$minObjId"); $writer->endTag();
@@ -584,5 +584,5 @@
     my ($outputPath) = @_;
 
-    my $success = runProgram( "NULL", $outputPath, 0, $product);
+    my $success = runProgram( "NULL", $outputPath, 0, $batchType);
     return $success;
 }
@@ -628,5 +628,5 @@
         close $tempFile;
 
-        $success = runProgram($tempName, $outputPath, $expId, $product);
+        $success = runProgram($tempName, $outputPath, $expId, $batchType);
         return $success;
     }
@@ -677,5 +677,5 @@
     }
 
-    my $ret = runProgram($tempName, $outputPath, $expId, $product);
+    my $ret = runProgram($tempName, $outputPath, $expId, $batchType);
 
     close $tempFile;
@@ -690,5 +690,5 @@
 #######################################################################################
 sub runProgram {
-    my ($input, $output, $expid, $product) = @_;
+    my ($input, $output, $expid, $batchType) = @_;
 
     # build command
@@ -699,5 +699,5 @@
     $command .= " -config config"; # TODO
     $command .= " -expid $expid";
-    $command .= " -product $product";
+    $command .= " -product $batchType";
     $command .= " -results $resultsFileName";
 
