Index: main/trunk/greenstone2/perllib/collConfigxml.pm
===================================================================
--- main/trunk/greenstone2/perllib/collConfigxml.pm	(revision 26450)
+++ main/trunk/greenstone2/perllib/collConfigxml.pm	(revision 26451)
@@ -59,4 +59,5 @@
 	       "orthogonalBuildTypes" => "orthogonalbuildtypes",
 	       "buildOption" => "buildOption"
+	       #"buildOptions" => "buildOptions", "importOptions" => "importOptions", no actual equivalents for importOptions and buildOptions in GS2
 	       };
 # A hash structure which is returned by sub read_cfg_file.
@@ -75,7 +76,4 @@
 my $currentAttrRef = undef; 
 
-# for storing plugin options if of type importOptions or buildOptions
-my $currentPluginOptionsType = undef; # can be import or build
-
 my $currentLevel = "";
 
@@ -83,8 +81,10 @@
 # ("plugin", "option")
 my $currentIndex = 0;
-my $arrayexp = q/^(index|level|indexOption|indexSubcollection|indexLanguage|orthogonalBuildTypes)$/;
-my $arrayarrayexp= q/^(plugin|classifier)$/; #|buildOption)$/;
+my $arrayexp = q/^(index|level|indexSubcollection|indexLanguage|orthogonalBuildTypes)$/; # |indexOption
+my $arrayarrayexp = q/^(plugin|classifier)$/; #|buildOption)$/;
 my $hashexp = q/^(subcollection)$/; # add other element names that should be represented by hash expressions here
 my $hashhashexp = q/^(displayItem)$/; # add other (collectionmeta) element names that should be represented by hashes of hashes here.
+
+my $generalOptions = q/^(importOptions|buildOptions)$/; # becomes GS2 toplevel map of (name, value) pairs
 
 my $defaults = q/^(defaultIndex|defaultLevel|defaultIndexLanguage|languageMetadata)$/;
@@ -196,5 +196,5 @@
     #}
  
-    #@ Handle index|level|indexOption|indexSubcollection|indexLanguage
+    #@ Handle index|level|indexSubcollection|indexLanguage #|indexOption
     elsif ($element =~ /$arrayexp/) {
       my $key = $nameMap->{$element};	
@@ -214,14 +214,21 @@
 
     #@ indexoptions: accentfold/casefold/stem; arrayexp
- #   elsif ($element eq "indexOption") {
-  #    $currentLevel = "indexOption";
-   # }
-   # if ($currentLevel eq "indexOption" and $element eq "option") {
-    #  my $key = $nameMap->{$currentLevel};	
-     # if (!defined $data->{$key}) {
-#	$data->{$key} = [];
- #     }
-  #    push (@{$data->{$key}},$name);
-   # }
+    # needs a separate section, since unlike other $arrayexp, indexOption has <option>s as child elements 
+    # but should be stored in-memory different from $generalOptions (<buildOptions> and <importOptions>)
+    elsif ($element eq "indexOption") {
+      $currentLevel = "indexOption";
+      # find the gs2 mapping name
+      my $key = $nameMap->{$currentLevel};	
+      if (!defined $data->{$key}) {
+	$data->{$key} = [];
+      }
+    }
+    elsif ($currentLevel eq "indexOption" and $element eq "option") {
+      my $key = $nameMap->{$currentLevel};	
+      if (defined $name and $name =~ /\w/) {
+	  push (@{$data->{$key}},$name);
+      }
+    }
+
     #@ plugout options
     elsif ($element eq "plugout") {
@@ -265,28 +272,18 @@
 	# find the gs2 mapping name
         $currentLevel = $element;
-        my $key = $nameMap->{$element};	
-
+        my $key = $nameMap->{$element};
+	
 	# define an array of array of strings	foreach $k (@{$data->{$key}}) {
 	if (!defined $data->{$key}) {
-	  $data->{$key} = [];
-	}
+	    $data->{$key} = [];
+	}
+	
 	# Push classifier/plugin name (e.g. AZList) into $data as the first string
- 	push (@{$data->{$key}->[$currentIndex]},$name);
-    if (defined $value and $value =~ /\w/) {
-        push (@{$data->{$key}->[$currentIndex]}, $value);
-        print "$value\n";
-    }
+	push (@{$data->{$key}->[$currentIndex]},$name);
+	if (defined $value and $value =~ /\w/) {
+	    push (@{$data->{$key}->[$currentIndex]}, $value);
+	    print "$value\n";
+	}	
 	#print $currentIndex."indexup\n";
-      }
-    
-    # need to process the options of any build- and importOptions lists inside a plugin
-    # <pluginList><plugin><option.../><option.../><importOptions><option .../></importOptions></plugin></pluginList>
-    elsif ($currentLevel eq "plugin" and $element =~ m/^(importOptions|buildOptions)$/) {
-	if($element eq "importOptions") {
-	    $currentPluginOptionsType="import";
-	}
-	else {
-	    $currentPluginOptionsType="build";
-	}
     }
 
@@ -302,23 +299,36 @@
             push (@{$data->{$key}->[$currentIndex]}, $value);
 	}
-	# besides regular options, plugins can have buildOptions and importOptions
-	#if (defined $currentPluginOptionsType and $currentPluginOptionsType =~ /\w/) {
-            #push (@{$data->{$key}->[$currentIndex]}, $currentPluginOptionsType);
-	    ##print "@@@@ Found $currentPluginOptionsType option with name: $name and value: $value\n";
-	#}
-
-    }
-    
+
+    }
+
+    #@ Handling each importOptions/buildOptions element
+    elsif ($element =~ /$generalOptions/) {
+        $currentLevel = $element;
+        #my $key = $nameMap->{$element}; # importOptions and buildOptions map to themselves, no equivalents in GS2
+
+	# define a map of string pairs
+	if (!defined $data->{$element}) {
+	    $data->{$element} = {};
+	}
+    }
+    #@ Handling the option elements in an importOptions/buildOptions element, which are of the form:
+    # <importOptions><option name="n" value="v"/><option .../></importOptions>
+    # these get stored in memory at the top level as (n, v) pairs, as in GS2
+    elsif ($currentLevel =~ /$generalOptions/ and $element eq "option") {
+	if (defined $name and $name =~ /\w/ and defined $value and $value =~ /\w/) {
+	    #$data->{$currentLevel}->{$name} = $value;
+	    $data->{$name} = $value;
+	    print "@@@@ Added $currentLevel option: $name=$value\n";
+	}
+    }
+
 }
 
 sub EndTag {
     my ($expat, $element) = @_;
-    my $endTags = q/^(browse|pluginList|displayItemList)$/; #|buildOptionList)$/;   
+    my $endTags = q/^(browse|pluginList|displayItemList|indexOption|importOptions|buildOptions)$/; #|buildOptionList)$/;   
     if ($element =~ /$endTags/) {
 		$currentIndex = 0;
 		$currentLevel = "";
-    }
-    elsif ($element =~ m/^(importOptions|buildOptions)$/) { # can be nested inside a plugin of pluginList
-	$currentPluginOptionsType = undef;
     }
 
Index: main/trunk/greenstone2/perllib/inexport.pm
===================================================================
--- main/trunk/greenstone2/perllib/inexport.pm	(revision 26450)
+++ main/trunk/greenstone2/perllib/inexport.pm	(revision 26451)
@@ -228,15 +228,4 @@
     }
 
-    # if OIDtype and/or OIDmetadata args are specified on the commandline, they override what's
-    # in collectcfg but may not overwrite it (by writing it into the collectcfg file)
-    if (defined $self->{'OIDtype'} && $self->{'OIDtype'} =~ /\w/)
-    {
-	$collectcfg->{'OIDtype'} = $self->{'OIDtype'}; # store in the in-memory collectcfg hash
-    }
-    if (defined $self->{'OIDmetadata'} && $self->{'OIDmetadata'} =~ /\w/)
-    {
-	$collectcfg->{'OIDmetadata'} = $self->{'OIDmetadata'}; # store in the in-memory collectcfg hash
-    }    
-
     if (defined $collectcfg->{'importdir'} && $importdir eq "") {
 	$importdir = $collectcfg->{'importdir'};
