Index: /main/trunk/gli/src/org/greenstone/gatherer/gui/ExportAsPrompt.java
===================================================================
--- /main/trunk/gli/src/org/greenstone/gatherer/gui/ExportAsPrompt.java	(revision 28701)
+++ /main/trunk/gli/src/org/greenstone/gatherer/gui/ExportAsPrompt.java	(revision 28702)
@@ -466,10 +466,10 @@
 	String export_dir = LocalGreenstone.getTmpDirectoryPath();
        	if (cd_title.equals("")) {
-            export_dir += "exported_" + export_type;
+            export_dir += "exported_" + selected_collection.getShortName()+ "_" +export_type;
 	}
 	else {
 	    File cd_file = new File(cd_title);
             if (cd_file.isAbsolute())
-		export_dir = cd_title + File.separator + "exported_" + export_type;
+		export_dir = cd_title + File.separator + "exported_"  + selected_collection.getShortName()+ "_"+ export_type;
 	    else{
                 cd_title = cd_title.replaceAll("\\s+","");
@@ -482,43 +482,44 @@
         command_parts_list.add(export_dir);
 
-        if (!export_type.endsWith("METS") && xsl_file1 !=null){
-             command_parts_list.add("-xsltfile");
-             command_parts_list.add(xsl_file1.getPath()); 
-	}
-
-	//add command specific to MARCXML 
+	// check the xslt/mapping file values.
+	
+	// now we build up the saveas options
+	StringBuffer saveas_options = new StringBuffer();
+	
 	if (export_type.equals("MARCXML")){
-	    //add default transformation file
-	    if (xsl_file1 == null){
-		command_parts_list.add("-xsltfile");	
-		command_parts_list.add(Configuration.gsdl_path+"etc"+File.separator+"dc2marc.xsl");
-	    }  
-
-	    command_parts_list.add("-mapping_file");
-	    //default mapping file
-	    if (mapping_file == null){
-		command_parts_list.add(Configuration.gsdl_path+"etc"+File.separator+"dc2marc-mapping.xml");
-	    }
-	    else{
-		command_parts_list.add(mapping_file.getPath());	
-	    }
-
+	  if (!convert_xml_field1.getText().equals("")) {
+	    saveas_options.append("-xslt_file ");
+	    saveas_options.append(convert_xml_field1.getText()+" "); 
+	  }
+	  if (!mapping_xml_field.getText().equals("")) {
+	      saveas_options.append("-mapping_file ");
+	      saveas_options.append(mapping_xml_field.getText()+" ");
+	  }
 	    if (output_single_checkbox.isSelected()){
-		command_parts_list.add("-group_marc");
-	    }
-
-	}
-
-            
-        if (export_type.endsWith("METS") && xsl_file1 !=null){
-             command_parts_list.add("-xslt_txt");
-             command_parts_list.add(xsl_file1.getPath()); 
-	}
-
-         if (export_type.endsWith("METS") && xsl_file2 !=null){
-             command_parts_list.add("-xslt_mets");
-             command_parts_list.add(xsl_file2.getPath()); 
+	      saveas_options.append("-group ");
+	    }
+	}
+	else if (export_type.endsWith("METS")) {
+	  if (!convert_xml_field1.getText().equals("")) {
+	    saveas_options.append("-xslt_txt ");
+	    saveas_options.append(convert_xml_field1.getText()+" "); 
+	  }
+	  if (!convert_xml_field2.getText().equals("")) {
+	    saveas_options.append("-xslt_mets ");
+	    saveas_options.append(convert_xml_field2.getText()+" "); 
+	  }
+	}
+	else if (export_type.equals("DSpace")) {
+	  if (!convert_xml_field1.getText().equals("")) {
+	    saveas_options.append("-xslt_file ");
+	    saveas_options.append(convert_xml_field1.getText()+" "); 
+	  }
 	}
        
+	 if (saveas_options.length()>0) {
+	     command_parts_list.add("-saveas_options");
+	     command_parts_list.add(saveas_options.toString());
+	 }
+	 
 	 command_parts_list.add( selected_collection.getShortName());
 	 
@@ -527,5 +528,5 @@
 	for (int i = 0; i < command_parts_list.size(); i++) {
 	    DebugStream.print(command_parts_list.get(i) + " ");
-	    //System.err.print(command_parts_list.get(i) + " ");          
+	    //System.err.print("'"+command_parts_list.get(i)+"'" + " ");          
 	}
 	DebugStream.println("");
@@ -562,10 +563,10 @@
        	args[1] = LocalGreenstone.getTmpDirectoryPath();
        	if (cd_title.equals("")) {
-           args[1] += "exported_" + export_type;
+           args[1] += "exported_" + selected_collection.getShortName()+"_"+export_type;
 	}
 	else {
 	    File cd_file = new File(cd_title);
             if (cd_file.isAbsolute())
-		args[1] = cd_title + File.separator + "exported_" + export_type;
+		args[1] = cd_title + File.separator + "exported_" + selected_collection.getShortName()+"_"+export_type;
 	    else{
                 cd_title = cd_title.replaceAll("\\s+","");
