Changeset 10148
- Timestamp:
- 2005-06-17T16:42:25+12:00 (19 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/gtiaction.cpp
r10118 r10148 220 220 // Send a request to gti.pl to get the valid translation files 221 221 text_t gti_arguments = "get-language-status " + target_language_code; 222 GTI_Response gti_response = do_gti_request(gti_arguments, logout);222 GTI_Response gti_response = parse_gti_response(do_gti_request(gti_arguments, logout), logout); 223 223 if (gti_response.error_message != "") { 224 224 // An error has occurred … … 288 288 logout << "Query argument: " << query_string << endl; 289 289 text_t gti_arguments = "search-chunks " + target_language_code + " " + translation_file_key + " " + query_string; 290 GTI_Response gti_response = do_gti_request(gti_arguments, logout);290 GTI_Response gti_response = parse_gti_response(do_gti_request(gti_arguments, logout), logout); 291 291 if (gti_response.error_message != "") { 292 292 // An error has occurred … … 348 348 // Send a request to gti.pl to get the first string to translate 349 349 text_t gti_arguments = "get-first-n-chunks-requiring-work " + target_language_code + " " + translation_file_key + " " + num_chunks_per_page; 350 GTI_Response gti_response = do_gti_request(gti_arguments, logout);350 GTI_Response gti_response = parse_gti_response(do_gti_request(gti_arguments, logout), logout); 351 351 if (gti_response.error_message != "") { 352 352 // An error has occurred … … 577 577 578 578 579 GTI_Response gtiaction::do_gti_request(text_t gti_arguments, ostream& logout) 580 { 581 GTI_Response gti_response; 582 gti_response.is_recording_text = false; 583 579 text_t gtiaction::do_gti_request(text_t gti_arguments, ostream& logout) 580 { 584 581 // Send the request to gti.pl and read the XML output 585 582 text_t gti_command = "perl -S " + filename_cat(gsdlhome, "bin", "script", "gti.pl") + " " + gti_arguments; … … 589 586 if (gti_pipe == NULL) { 590 587 logout << "Error: Could not open pipe for GTI command " << gti_command << endl; 591 return gti_response;588 return ""; 592 589 } 593 590 … … 599 596 } 600 597 pclose(gti_pipe); 598 599 return gti_response_xml_text; 600 } 601 602 603 604 GTI_Response gtiaction::parse_gti_response(text_t gti_response_xml_text, ostream& logout) 605 { 606 GTI_Response gti_response; 607 gti_response.is_recording_text = false; 601 608 602 609 // Parse the gti.pl response (XML) -
trunk/gsdl/src/recpt/gtiaction.h
r10097 r10148 107 107 void process_gti_submissions(displayclass& disp, cgiargsclass& args, ostream& logout, bool force_submission); 108 108 109 GTI_Response do_gti_request(text_t, ostream&);109 text_t do_gti_request(text_t gti_arguments, ostream& logout); 110 110 111 void do_gti_submission(text_t, text_t, ostream&); 111 GTI_Response parse_gti_response(text_t gti_response_xml_text, ostream& logout); 112 113 void do_gti_submission(text_t gti_arguments, text_t gti_submission, ostream& logout); 112 114 }; 113 115
Note:
See TracChangeset
for help on using the changeset viewer.