source: trunk/gsdl/src/recpt/collectoraction.h@ 3036

Last change on this file since 3036 was 2774, checked in by sjboddie, 23 years ago

Tidied up the collector's error handling. Hopefully the situation where the
status page loops continuously after an error will now be rare (it can
still happen if perl or one of the third party converters hangs though)

  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1/**********************************************************************
2 *
3 * collectoraction.h --
4 * Copyright (C) 2000 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 COLLECTORACTION_H
28#define COLLECTORACTION_H
29
30#include "action.h"
31#include "receptionist.h"
32
33class collectoraction : public action {
34
35protected:
36
37 bool disabled;
38 receptionist *recpt;
39 char *gsdlosc;
40 char *gsdlhomec;
41 char *pathc;
42
43 text_t message;
44 char failcode;
45
46 bool do_mkcol;
47
48 bool badsources;
49 text_tmap failedsources;
50
51 text_t get_button (const text_t &thispage, const text_t &color,
52 const text_t &type, bool enabled);
53
54 void set_fullnamemenu (displayclass &disp, cgiargsclass &args,
55 recptprotolistclass *protos, ostream &logout);
56
57 void set_inputsourceboxes (displayclass &disp, cgiargsclass &args,
58 ostream &logout);
59
60 text_t get_source_box (text_t inputarglist, int numboxes,
61 text_t inputtypelist);
62
63 void set_cfgfile (displayclass &disp, cgiargsclass &args, ostream &logout);
64
65 void set_statusline (displayclass &disp, cgiargsclass &args, ostream &logout);
66
67 void update_cfgfile_clone (cgiargsclass &args, ostream &logout);
68
69 void update_cfgfile_partial (cgiargsclass &args, bool clone, ostream &logout);
70
71 void update_cfgfile_complete (cgiargsclass &args, ostream &logout);
72
73 text_t carriage_replace (const text_t &intext, int sw);
74
75 text_t get_directory_name (const text_t &fullname);
76
77 bool collection_protected (const text_t &collection);
78
79 void assign_tmpname (cgiargsclass &args, ostream &logout);
80
81 void gsdl_mkcol (cgiargsclass &args, ostream &logout);
82
83 void gsdl_build (cgiargsclass &args, ostream &logout);
84
85 void gsdl_cancel_build (cgiargsclass &args, ostream &logout);
86
87 text_t get_collectdir (cgiargsclass &args);
88
89 bool uses_weird_plugin (const text_t &collection);
90
91 void create_colserver (const text_t &collection, ostream &logout);
92
93 void remove_colservr (const text_t &collection, ostream &logout);
94
95 bool create_event_header_file (const text_t &filename, cgiargsclass &args,
96 ostream &logout);
97
98 text_t get_event_header (cgiargsclass &args);
99
100 bool check_sources (cgiargsclass &args, ostream &logout);
101
102 text_t format_url (const text_t &url);
103
104 text_t remove_trailing_slashes (text_t str);
105
106public:
107 collectoraction ();
108 virtual ~collectoraction ();
109
110 void configure (const text_t &key, const text_tarray &cfgline);
111
112 bool init (ostream &logout);
113
114 void set_receptionist (receptionist *therecpt) {recpt=therecpt;}
115
116 text_t get_action_name () {return "collector";}
117
118 bool check_cgiargs (cgiargsinfoclass &argsinfo, cgiargsclass &args,
119 ostream &logout);
120
121 void get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos,
122 response_t &response,text_t &response_data,
123 ostream &logout);
124
125 void define_internal_macros (displayclass &disp, cgiargsclass &args,
126 recptprotolistclass *protos, ostream &logout);
127
128 bool do_action (cgiargsclass &args, recptprotolistclass *protos,
129 browsermapclass *browsers, displayclass &disp,
130 outconvertclass &outconvert, ostream &textout,
131 ostream &logout);
132};
133
134
135#endif
Note: See TracBrowser for help on using the repository browser.