source: main/trunk/greenstone2/runtime-src/src/recpt/gtiaction.h@ 28973

Last change on this file since 28973 was 28973, checked in by ak19, 10 years ago

All the changes required to get the GTI installed on a local greenstone using the latest gs2 src code from svn, since this has the security updates. 1. ApplyXSLT in build-src needed a lot of code additions since runtime-src's gtiaction.cpp needs to send the xml file from stdin using a pipe command. ApplyXSLT used to read stdin from a piped cmd differently, expecting DocStart and DocEnd embedding tags to mark the start and stop of each stream. This is still used by code in BasePlugout, so ApplyXSLT has been modified to take a minus-c parameter when requested to read from stdin without special embedding tag markers, such as when gtiaction calls it. ApplyXSLT uses an internal StreamGobbler class to read the stdin since it takes a while for xml generated by the gti.pl (which is piped in) to come in to ApplyXSLT. 2. The inner StreamGobbler class needed to be added into the ApplyXSLT jar file, so the Makefile.in has been updated. 3. In runtime-src, added in missing header files and updated the code that generated the spreadsheets on GTI, since it was firstly hardcoded to use paths on /home/nzdl, and the code that generated the spreadsheets when running ApplyXSLT/xalan.jar no longer worked as it had been coded.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 4.1 KB
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; // java bin path to preferrably 1.6. Set this here or in init() if the path to java is very specific (such as on nzdl)
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 repository browser.