[10018] | 1 | /**********************************************************************
|
---|
| 2 | *
|
---|
| 3 | * gtiaction.h --
|
---|
| 4 | * Copyright (C) 1999 The New Zealand Digital Library Project
|
---|
| 5 | *
|
---|
| 6 | * A component of the Greenstone digital library software
|
---|
| 7 | * from the New Zealand Digital Library Project at the
|
---|
| 8 | * University of Waikato, New Zealand.
|
---|
| 9 | *
|
---|
| 10 | * This program is free software; you can redistribute it and/or modify
|
---|
| 11 | * it under the terms of the GNU General Public License as published by
|
---|
| 12 | * the Free Software Foundation; either version 2 of the License, or
|
---|
| 13 | * (at your option) any later version.
|
---|
| 14 | *
|
---|
| 15 | * This program is distributed in the hope that it will be useful,
|
---|
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 18 | * GNU General Public License for more details.
|
---|
| 19 | *
|
---|
| 20 | * You should have received a copy of the GNU General Public License
|
---|
| 21 | * along with this program; if not, write to the Free Software
|
---|
| 22 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
| 23 | *
|
---|
| 24 | *********************************************************************/
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 | #ifndef GTIACTION_H
|
---|
| 28 | #define GTIACTION_H
|
---|
| 29 |
|
---|
| 30 |
|
---|
| 31 | #include "action.h"
|
---|
| 32 | #include "receptionist.h"
|
---|
| 33 |
|
---|
| 34 |
|
---|
| 35 |
|
---|
| 36 | struct GTI_Response
|
---|
| 37 | {
|
---|
| 38 | text_t translation_file_key;
|
---|
[10097] | 39 | text_tmap translation_files_index_to_key_mapping;
|
---|
[10018] | 40 | text_tmap translation_files_key_to_num_chunks_translated_mapping;
|
---|
| 41 | text_tmap translation_files_key_to_num_chunks_requiring_translation_mapping;
|
---|
| 42 | text_tmap translation_files_key_to_num_chunks_requiring_updating_mapping;
|
---|
| 43 | text_tmap translation_files_key_to_target_file_path_mapping;
|
---|
| 44 |
|
---|
| 45 | text_t chunk_key;
|
---|
| 46 | text_tmap source_file_chunks_key_to_text_mapping;
|
---|
| 47 | text_tmap source_file_chunks_key_to_date_mapping;
|
---|
| 48 |
|
---|
| 49 | // For chunks requiring updating
|
---|
| 50 | text_tmap target_file_chunks_key_to_text_mapping;
|
---|
| 51 | text_tmap target_file_chunks_key_to_date_mapping;
|
---|
| 52 |
|
---|
| 53 | text_t num_chunks_matching_query;
|
---|
| 54 |
|
---|
| 55 | bool is_recording_text;
|
---|
| 56 | text_t recorded_text;
|
---|
| 57 |
|
---|
| 58 | text_t error_message;
|
---|
| 59 | };
|
---|
| 60 |
|
---|
| 61 |
|
---|
| 62 | class gtiaction : public action {
|
---|
| 63 |
|
---|
| 64 | protected:
|
---|
| 65 | receptionist *recpt;
|
---|
| 66 |
|
---|
[10035] | 67 | char* set_gsdlhome_cstr;
|
---|
| 68 | char* set_gsdlos_cstr;
|
---|
[10018] | 69 |
|
---|
[28973] | 70 | text_t path_separator;
|
---|
[28979] | 71 | text_t java; // path to java executable
|
---|
[28973] | 72 |
|
---|
[10018] | 73 | public:
|
---|
| 74 | gtiaction ();
|
---|
| 75 | virtual ~gtiaction ();
|
---|
| 76 |
|
---|
| 77 | void set_receptionist (receptionist *therecpt) {recpt=therecpt;}
|
---|
| 78 |
|
---|
| 79 | text_t get_action_name () {return "gti";}
|
---|
| 80 |
|
---|
| 81 | bool check_cgiargs (cgiargsinfoclass &argsinfo, cgiargsclass &args,
|
---|
| 82 | recptprotolistclass *protos, ostream &logout);
|
---|
| 83 |
|
---|
| 84 | void define_internal_macros (displayclass &disp, cgiargsclass &args,
|
---|
| 85 | recptprotolistclass *protos, ostream &logout);
|
---|
| 86 |
|
---|
| 87 | void get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos,
|
---|
| 88 | response_t &response,text_t &response_data,
|
---|
| 89 | ostream &logout);
|
---|
| 90 |
|
---|
| 91 | bool do_action (cgiargsclass &args, recptprotolistclass *protos,
|
---|
| 92 | browsermapclass *browsers, displayclass &disp,
|
---|
| 93 | outconvertclass &outconvert, ostream &textout,
|
---|
| 94 | ostream &logout);
|
---|
| 95 |
|
---|
| 96 | bool init (ostream & /*logout*/);
|
---|
| 97 |
|
---|
| 98 |
|
---|
| 99 | // The interesting functions
|
---|
| 100 | void define_gti_home_page(displayclass& disp, cgiargsclass& args, ostream& logout);
|
---|
| 101 |
|
---|
| 102 | void define_gti_lang_page(displayclass& disp, cgiargsclass& args, ostream& logout);
|
---|
| 103 |
|
---|
| 104 | void define_gti_find_page(displayclass& disp, cgiargsclass& args, ostream& logout);
|
---|
| 105 |
|
---|
[13692] | 106 | void define_gti_offline_page(displayclass& disp, cgiargsclass& args, ostream& logout);
|
---|
[11460] | 107 |
|
---|
[10018] | 108 | void define_gti_core_page(displayclass& disp, cgiargsclass& args, ostream& logout);
|
---|
| 109 |
|
---|
| 110 | text_t escape_all(text_t source_string, char character_to_escape);
|
---|
| 111 |
|
---|
[10027] | 112 | void process_gti_submissions(displayclass& disp, cgiargsclass& args, ostream& logout, bool force_submission);
|
---|
[10018] | 113 |
|
---|
[10148] | 114 | text_t do_gti_request(text_t gti_arguments, ostream& logout);
|
---|
[10018] | 115 |
|
---|
[10148] | 116 | GTI_Response parse_gti_response(text_t gti_response_xml_text, ostream& logout);
|
---|
| 117 |
|
---|
| 118 | void do_gti_submission(text_t gti_arguments, text_t gti_submission, ostream& logout);
|
---|
[13672] | 119 |
|
---|
| 120 | void define_gti_status_page(displayclass& disp, cgiargsclass& args, ostream& logout);
|
---|
[13692] | 121 |
|
---|
| 122 | bool produce_excel_spreadsheet(cgiargsclass& args, ostream& logout);
|
---|
[18460] | 123 |
|
---|
| 124 | bool produce_glihelp_zipfile(displayclass& disp, cgiargsclass& args, ostream& logout);
|
---|
[10018] | 125 | };
|
---|
| 126 |
|
---|
| 127 |
|
---|
| 128 | #endif
|
---|