Changeset 28702 for main/trunk/gli


Ignore:
Timestamp:
2013-11-28T14:45:34+13:00 (10 years ago)
Author:
kjdon
Message:

folder for export is now exported_colname_saveastype, eg exported_demo_MARCXML instead of exported_MARCXML. plugout options are all passed as one option: saveas_options, instead of individual options to export.pl

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/gli/src/org/greenstone/gatherer/gui/ExportAsPrompt.java

    r26573 r28702  
    466466    String export_dir = LocalGreenstone.getTmpDirectoryPath();
    467467        if (cd_title.equals("")) {
    468             export_dir += "exported_" + export_type;
     468            export_dir += "exported_" + selected_collection.getShortName()+ "_" +export_type;
    469469    }
    470470    else {
    471471        File cd_file = new File(cd_title);
    472472            if (cd_file.isAbsolute())
    473         export_dir = cd_title + File.separator + "exported_" + export_type;
     473        export_dir = cd_title + File.separator + "exported_"  + selected_collection.getShortName()+ "_"+ export_type;
    474474        else{
    475475                cd_title = cd_title.replaceAll("\\s+","");
     
    482482        command_parts_list.add(export_dir);
    483483
    484         if (!export_type.endsWith("METS") && xsl_file1 !=null){
    485              command_parts_list.add("-xsltfile");
    486              command_parts_list.add(xsl_file1.getPath());
    487     }
    488 
    489     //add command specific to MARCXML
     484    // check the xslt/mapping file values.
     485   
     486    // now we build up the saveas options
     487    StringBuffer saveas_options = new StringBuffer();
     488   
    490489    if (export_type.equals("MARCXML")){
    491         //add default transformation file
    492         if (xsl_file1 == null){
    493         command_parts_list.add("-xsltfile");   
    494         command_parts_list.add(Configuration.gsdl_path+"etc"+File.separator+"dc2marc.xsl");
    495         } 
    496 
    497         command_parts_list.add("-mapping_file");
    498         //default mapping file
    499         if (mapping_file == null){
    500         command_parts_list.add(Configuration.gsdl_path+"etc"+File.separator+"dc2marc-mapping.xml");
    501         }
    502         else{
    503         command_parts_list.add(mapping_file.getPath());
    504         }
    505 
     490      if (!convert_xml_field1.getText().equals("")) {
     491        saveas_options.append("-xslt_file ");
     492        saveas_options.append(convert_xml_field1.getText()+" ");
     493      }
     494      if (!mapping_xml_field.getText().equals("")) {
     495          saveas_options.append("-mapping_file ");
     496          saveas_options.append(mapping_xml_field.getText()+" ");
     497      }
    506498        if (output_single_checkbox.isSelected()){
    507         command_parts_list.add("-group_marc");
    508         }
    509 
    510     }
    511 
    512            
    513         if (export_type.endsWith("METS") && xsl_file1 !=null){
    514              command_parts_list.add("-xslt_txt");
    515              command_parts_list.add(xsl_file1.getPath());
    516     }
    517 
    518          if (export_type.endsWith("METS") && xsl_file2 !=null){
    519              command_parts_list.add("-xslt_mets");
    520              command_parts_list.add(xsl_file2.getPath());
     499          saveas_options.append("-group ");
     500        }
     501    }
     502    else if (export_type.endsWith("METS")) {
     503      if (!convert_xml_field1.getText().equals("")) {
     504        saveas_options.append("-xslt_txt ");
     505        saveas_options.append(convert_xml_field1.getText()+" ");
     506      }
     507      if (!convert_xml_field2.getText().equals("")) {
     508        saveas_options.append("-xslt_mets ");
     509        saveas_options.append(convert_xml_field2.getText()+" ");
     510      }
     511    }
     512    else if (export_type.equals("DSpace")) {
     513      if (!convert_xml_field1.getText().equals("")) {
     514        saveas_options.append("-xslt_file ");
     515        saveas_options.append(convert_xml_field1.getText()+" ");
     516      }
    521517    }
    522518       
     519     if (saveas_options.length()>0) {
     520         command_parts_list.add("-saveas_options");
     521         command_parts_list.add(saveas_options.toString());
     522     }
     523     
    523524     command_parts_list.add( selected_collection.getShortName());
    524525     
     
    527528    for (int i = 0; i < command_parts_list.size(); i++) {
    528529        DebugStream.print(command_parts_list.get(i) + " ");
    529         //System.err.print(command_parts_list.get(i) + " ");         
     530        //System.err.print("'"+command_parts_list.get(i)+"'" + " ");         
    530531    }
    531532    DebugStream.println("");
     
    562563        args[1] = LocalGreenstone.getTmpDirectoryPath();
    563564        if (cd_title.equals("")) {
    564            args[1] += "exported_" + export_type;
     565           args[1] += "exported_" + selected_collection.getShortName()+"_"+export_type;
    565566    }
    566567    else {
    567568        File cd_file = new File(cd_title);
    568569            if (cd_file.isAbsolute())
    569         args[1] = cd_title + File.separator + "exported_" + export_type;
     570        args[1] = cd_title + File.separator + "exported_" + selected_collection.getShortName()+"_"+export_type;
    570571        else{
    571572                cd_title = cd_title.replaceAll("\\s+","");
Note: See TracChangeset for help on using the changeset viewer.