Ignore:
Timestamp:
2009-02-04T15:02:01+13:00 (15 years ago)
Author:
anna
Message:

Added several functions in GTI.\n 1. Create spreadsheet for all the strings in current module (gtiaction.cpp, english2.dm).\n 2. Create operational files for GLI Help (HTML files etc) as requested, zip them and provide for download (gtiaction.h|cpp, gti.dm, gti.pl).\n 3. Functions for processing GS3 interfaces (gti.pl).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gsdl/trunk/runtime-src/src/recpt/gtiaction.cpp

    r17545 r18460  
    192192 
    193193  // Define the page content for the GTI view status page
    194     if (args["p"] == "status") {
    195         define_gti_status_page(disp, args, logout);
    196         return;
    197     }
     194  if (args["p"] == "status") {
     195    define_gti_status_page(disp, args, logout);
     196    return;
     197  }
    198198
    199199  // Process user translations
    200200  if (args["p"] == "submit") {
    201201    process_gti_submissions(disp, args, logout, true);
     202  }
     203
     204  if (args["p"] == "glihelp") {
     205    produce_glihelp_zipfile(disp, args, logout);   
    202206  }
    203207   
     
    335339       
    336340       
    337         //lang_status_temp += "<td valign=\"top\" nowrap>_gtitranslationfilestatus2_(" + num_chunks_translated + "," + num_chunks_requiring_translation + "," + num_chunks_requiring_updating + ")</td>";           
     341    //lang_status_temp += "<td valign=\"top\" nowrap>_gtitranslationfilestatus2_(" + num_chunks_translated + "," + num_chunks_requiring_translation + "," + num_chunks_requiring_updating + ")</td>";           
    338342       
    339         // List the file names as the first row of the status table
    340         // Add up number of strings need to be translate in each file, as the second line of the status table
     343    // List the file names as the first row of the status table
     344    // Add up number of strings need to be translate in each file, as the second line of the status table
    341345      if (first_lang) {
    342346        files_temp += "<th class=\"status\">_textgti" + translation_file_key + "_</th>\n";
     
    484488  languageinfo_tmap loaded_languages = recpt->get_configinfo().languages;
    485489  disp.setmacro("gtitargetlanguagename", "gti", loaded_languages[target_language_code].longname);
    486   disp.setmacro("gtitargetfilepath", "gti", gti_response.translation_files_key_to_target_file_path_mapping[translation_file_key]);
     490  if (translation_file_key == "glihelp") {
     491    disp.setmacro("gtitargetfilepath", "gti", "_gtidownloadglihelp_");
     492  } else {
     493    disp.setmacro("gtitargetfilepath", "gti", gti_response.translation_files_key_to_target_file_path_mapping[translation_file_key]);
     494  }
    487495  disp.setmacro("gtitranslationfiledesc", "gti", "_gti:textgti" + translation_file_key + "_");
    488496  disp.setmacro("gtiviewtranslationfileinaction", "gti", "_gti:gtiview" + translation_file_key + "inaction_");
     
    618626  text_t target_language_code = args["tlc"];
    619627  text_t translation_file_key = args["tfk"];
     628  text_t target_chunk_type = args["tct"];
    620629
    621630  // Send a request to gti.pl to get the Excel spreadsheet data
    622   text_t gti_arguments = "get-first-n-chunks-requiring-work " + target_language_code + " " + translation_file_key + " " + "10000" + " | java -cp /home/nzdl/gti ApplyXSLT /home/nzdl/gti/gti-generate-excel-xml.xsl -";
    623   text_t gti_response_xml_text = do_gti_request(gti_arguments, logout);
     631  text_t gti_arguments = "";
     632  if (target_chunk_type == "work") {
     633    gti_arguments = "get-first-n-chunks-requiring-work " + target_language_code + " " + translation_file_key + " " + "10000" + " | /opt/jdk1.6.0/bin/java -cp /home/nzdl/gti:/home/nzdl/gti/xalan.jar ApplyXSLT /home/nzdl/gti/gti-generate-excel-xml.xsl -";
     634  } else {
     635    gti_arguments = "get-all-chunks " + target_language_code + " " + translation_file_key + " | /opt/jdk1.6.0/bin/java -cp /home/nzdl/gti:/home/nzdl/gti/xalan.jar ApplyXSLT /home/nzdl/gti/gti-generate-excel-xml.xsl -";
     636  }
     637 
     638  text_t gti_response_xml_text = do_gti_request(gti_arguments, logout); 
    624639  if (gti_response_xml_text == "") {
    625640    // An error has occurred
     
    635650}
    636651
     652bool gtiaction::produce_glihelp_zipfile(displayclass& disp, cgiargsclass& args, ostream& logout)
     653{
     654 text_t target_language_code = args["tlc"];
     655 text_t gti_arguments = "create-glihelp-zip-file " + target_language_code;
     656
     657 do_gti_request(gti_arguments, logout);
     658
     659 disp.setmacro("gtiglihelpzipfilepath", "gti", target_language_code + "_GLIHelp.zip");
     660
     661 return true;
     662}
    637663
    638664
Note: See TracChangeset for help on using the changeset viewer.