Index: /gli/trunk/src/org/greenstone/gatherer/cdm/CollectCfgReadWrite.java
===================================================================
--- /gli/trunk/src/org/greenstone/gatherer/cdm/CollectCfgReadWrite.java	(revision 20449)
+++ /gli/trunk/src/org/greenstone/gatherer/cdm/CollectCfgReadWrite.java	(revision 20450)
@@ -132,5 +132,4 @@
 	String value_str = XMLTools.getValue (option_element);
 	
-	//	      value_str = modifyMetadataArgumentValue(value_str);
 	if (value_str.length () > 0) {
 	  text.append (StaticStrings.SPACE_CHARACTER);
@@ -701,34 +700,9 @@
 	// Now we parse out the remaining arguments into a hashmapping from name to value
 	HashMap arguments = parseArguments (tokenizer);
-	// Assign the arguments as Option elements, but watch out for the metadata argument as we treat that differently
+	// Assign the arguments as Option elements
 	Iterator names = arguments.keySet ().iterator ();
 	while(names.hasNext ()) {
 	  String name = (String) names.next ();
 	  String value = (String) arguments.get (name); // Can be null
-	  // The metadata argument gets added as the content attribute
-	  /*                   if (name.equals (StaticStrings.METADATA_ARGUMENT) && value != null) {
-	  // Add the extracted namespace onto un-namespaced metadata names
-	  StringTokenizer string_tokenizer = new StringTokenizer (value, ",");
-	  value = "";
-	  while (string_tokenizer.hasMoreElements ()) {
-	  String token = (String) string_tokenizer.nextElement ();
-                            
-	  if (token.indexOf (StaticStrings.NS_SEP) == -1) {
-	  token = StaticStrings.EXTRACTED_NAMESPACE + token;
-	  }
-	  else {
-	  MetadataElement metadata_element = MetadataTools.getMetadataElementWithName (token);
-	  if (metadata_element != null) {
-	  token = metadata_element.getDisplayName ();
-	  }
-	  }
-                            
-	  if (!value.equals ("")) {
-	  value = value + ",";
-	  }
-	  value = value + token;
-	  }
-	  }*/
-	  // Everything else is an Option Element
 	  Element option_element = document.createElement (StaticStrings.OPTION_ELEMENT);
 	  option_element.setAttribute (StaticStrings.NAME_ATTRIBUTE, name.substring (1));
@@ -808,8 +782,6 @@
 	Element index_element = document.createElement (StaticStrings.INDEX_ELEMENT);
 	String index_str = tokenizer.nextToken ();
-	// There are two types of index we have to consider. Old G2.38 and earlier use level:source tuplets while G2.39+ have just a single, non-comma separated list where order is important.
-	boolean old_index;
+	// There are two types of index we have to consider. MG versions use "level:source,source" while MGPP versions use "source,source source" 
 	if(index_str.indexOf (StaticStrings.COLON_CHARACTER) != -1) {
-	  old_index = true;
 	  index_element.setAttribute (StaticStrings.LEVEL_ATTRIBUTE, index_str.substring (0, index_str.indexOf (StaticStrings.COLON_CHARACTER)));
 	  index_str = index_str.substring (index_str.indexOf (StaticStrings.COLON_CHARACTER) + 1);
@@ -818,5 +790,4 @@
 	else {
 	  command_element.setAttribute (StaticStrings.MGPP_ATTRIBUTE, StaticStrings.TRUE_STR);
-	  old_index = false;
 	}
 	StringTokenizer content_tokenizer = new StringTokenizer (index_str, StaticStrings.COMMA_CHARACTER);
@@ -826,5 +797,5 @@
 	  // Since the contents of indexes have to be certain keywords, or metadata elements, if the content isn't a keyword and doesn't yet have a namespace, append the extracted metadata namespace.
 	  if(content_str.indexOf (StaticStrings.NS_SEP) == -1) {
-	    if(content_str.equals (StaticStrings.TEXT_STR) || (!old_index && content_str.equals (StaticStrings.ALLFIELDS_STR))) {
+	    if(content_str.equals (StaticStrings.TEXT_STR) || content_str.equals (StaticStrings.ALLFIELDS_STR) || content_str.equals(StaticStrings.METADATA_STR)) {
 	      // Our special strings are OK.
 	    }
@@ -1090,5 +1061,4 @@
 	// Now we parse out the remaining arguments into a hashmapping from name to value
 	HashMap arguments = parseArguments (tokenizer);
-	// Assign the arguments as Option elements, but watch out for the metadata argument as we treat that differently
 	// also watch out for the deprecated -use_metadata_files option to RecPlug and remove it
 	Iterator names = arguments.keySet ().iterator ();
@@ -1107,10 +1077,4 @@
 	    if(value.startsWith (StaticStrings.SPEECH_CHARACTER) && value.endsWith (StaticStrings.SPEECH_CHARACTER)) {
 	      value = value.substring (1, value.length () - 1);
-	    }
-	    if(name.equals (StaticStrings.METADATA_ARGUMENT)) {
-	      // The metadata argument must be the fully qualified name of a metadata element, so if it doesn't yet have a namespace, append the extracted metadata namespace.
-	      if(value.indexOf (StaticStrings.NS_SEP) == -1) {
-		value = StaticStrings.EXTRACTED_NAMESPACE + value;
-	      }
 	    }
 	    XMLTools.setValue (option_element, value);
@@ -1303,6 +1267,4 @@
 	  text.append (option_element.getAttribute (StaticStrings.NAME_ATTRIBUTE));
 	  String value_str = XMLTools.getValue (option_element);
-	  // turn display name into proper name
-	  //value_str = modifyMetadataArgumentValue(value_str);
 	  if (value_str.length () > 0) {
 	    text.append (StaticStrings.SPACE_CHARACTER);
@@ -1328,54 +1290,4 @@
   }
 
-  // Convert metadata element names to internal names, and remove extracted metadata namespaces
-  /*  static private String modifyMetadataArgumentValue(String value_str) {
-      if (value_str.length () == 0) {
-      return value_str;
-      }
-    
-      // final true arg to return delims as tokens
-      StringTokenizer string_tokenizer = new StringTokenizer (value_str, ",;", true);
-      StringBuffer value_buffer = new StringBuffer ();
-      while (string_tokenizer.hasMoreElements ()) {
-      String raw_token = (String) string_tokenizer.nextElement ();
-      String token = raw_token.trim ();
-      boolean modified_token = false;
-      // not a delimiter token
-      if (!raw_token.equals(",") && !raw_token.equals(";")) {
-      //MetadataElement metadata_element = MetadataTools.getMetadataElementWithDisplayName (token);
-      //if (metadata_element != null) {
-      //token = metadata_element.getFullName ();
-      //modified_token = true;
-      //}
-	
-      //	if (token.startsWith (StaticStrings.EXTRACTED_NAMESPACE)) {
-      // token = token.substring (StaticStrings.EXTRACTED_NAMESPACE.length ());
-      // modified_token = true;
-      //}
-      }
-      if (modified_token) {
-      value_buffer.append (token);
-      } else {
-      // we may have had whitespace etc that was part of the string
-      value_buffer.append (raw_token);
-      }
-      }
-    
-    
-      if(value_buffer.length () == 0) {
-      return "";
-      }
-      if(value_str.indexOf (StaticStrings.SPACE_CHARACTER) == -1) {
-      return value_buffer.toString();
-      }
-    
-      // it must contain a space, so we surround the value with quotes
-      value_buffer.insert(0, StaticStrings.SPEECH_CHARACTER);
-      value_buffer.append(StaticStrings.SPEECH_CHARACTER);
-      return value_buffer.toString();
-
-      }*/
-   
-
   static public String generateStringVersion(Document document) {
 
@@ -1401,11 +1313,4 @@
       else if (!command_element.getAttribute (StaticStrings.ASSIGNED_ATTRIBUTE).equals (StaticStrings.FALSE_STR) || command_element.getNodeName ().equals (StaticStrings.INDEXES_ELEMENT) || command_element.getNodeName ().equals (StaticStrings.INDEX_DEFAULT_ELEMENT) || command_element.getNodeName ().equals (StaticStrings.INDEXOPTIONS_ELEMENT) || command_element.getNodeName ().equals (StaticStrings.INDEXOPTION_DEFAULT_ELEMENT)) {
 	String command = toString(command_element);
-	//                 if (command_element.getNodeName ().equals (StaticStrings.FORMAT_ELEMENT)) {
-	//                     // Format statements we write out with ex. still present
-	// 		  command = toString (command_element); //, true);
-	//                 }
-	//                 else {
-	// 		  command = toString (command_element);//, false);
-	//                 }
                 
 	if (command != null && command.length ()> 0 ) {
