root/main/trunk/greenstone2/runtime-src/src/recpt/gtiaction.h @ 28979

Revision 28979, 4.0 KB (checked in by ak19, 6 years ago)

GTI on nzdl needs path to java executable. Since a custom javahome property can be set in gsdlsite.cfg, this is now read in if site from gsdlsite.cfg by common-src's gsdlsitecfg.cpp and set as an env var with putenv(), following Dr Bainbridge's idea. This env var is then read back in using getenv in gtiaction.cpp, so that it can run the appropriate java.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
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
36struct GTI_Response
37{
38  text_t translation_file_key;
39  text_tmap translation_files_index_to_key_mapping;
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
62class gtiaction : public action {
63
64protected:
65  receptionist *recpt;
66
67  char* set_gsdlhome_cstr;
68  char* set_gsdlos_cstr;
69
70  text_t path_separator;
71  text_t java; // path to java executable
72
73public:
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
106  void define_gti_offline_page(displayclass& disp, cgiargsclass& args, ostream& logout);
107
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
112  void process_gti_submissions(displayclass& disp, cgiargsclass& args, ostream& logout, bool force_submission);
113
114  text_t do_gti_request(text_t gti_arguments, ostream& logout);
115
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);
119
120  void define_gti_status_page(displayclass& disp, cgiargsclass& args, ostream& logout);
121
122  bool produce_excel_spreadsheet(cgiargsclass& args, ostream& logout);
123
124  bool produce_glihelp_zipfile(displayclass& disp, cgiargsclass& args, ostream& logout);
125};
126
127
128#endif
Note: See TracBrowser for help on using the browser.