[1419] | 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 |
|
---|
[7371] | 26 | #include "gsdl_modules_cfg.h"
|
---|
| 27 | #ifdef GSDL_USE_COLLECTOR_ACTION
|
---|
[1419] | 28 |
|
---|
| 29 | #ifndef COLLECTORACTION_H
|
---|
| 30 | #define COLLECTORACTION_H
|
---|
| 31 |
|
---|
| 32 | #include "action.h"
|
---|
| 33 | #include "receptionist.h"
|
---|
| 34 |
|
---|
| 35 | class collectoraction : public action {
|
---|
| 36 |
|
---|
| 37 | protected:
|
---|
| 38 |
|
---|
[1759] | 39 | bool disabled;
|
---|
[1419] | 40 | receptionist *recpt;
|
---|
| 41 | char *gsdlosc;
|
---|
| 42 | char *gsdlhomec;
|
---|
[1679] | 43 | char *pathc;
|
---|
[1419] | 44 |
|
---|
[1457] | 45 | text_t message;
|
---|
[2774] | 46 | char failcode;
|
---|
[1457] | 47 |
|
---|
[1419] | 48 | bool do_mkcol;
|
---|
| 49 |
|
---|
[2401] | 50 | bool badsources;
|
---|
| 51 | text_tmap failedsources;
|
---|
| 52 |
|
---|
[1419] | 53 | text_t get_button (const text_t &thispage, const text_t &color,
|
---|
| 54 | const text_t &type, bool enabled);
|
---|
| 55 |
|
---|
| 56 | void set_fullnamemenu (displayclass &disp, cgiargsclass &args,
|
---|
| 57 | recptprotolistclass *protos, ostream &logout);
|
---|
| 58 |
|
---|
[2401] | 59 | void set_inputsourceboxes (displayclass &disp, cgiargsclass &args,
|
---|
| 60 | ostream &logout);
|
---|
| 61 |
|
---|
[2407] | 62 | text_t get_source_box (text_t inputarglist, int numboxes,
|
---|
| 63 | text_t inputtypelist);
|
---|
[2401] | 64 |
|
---|
[1457] | 65 | void set_cfgfile (displayclass &disp, cgiargsclass &args, ostream &logout);
|
---|
[1419] | 66 |
|
---|
[1457] | 67 | void set_statusline (displayclass &disp, cgiargsclass &args, ostream &logout);
|
---|
[1437] | 68 |
|
---|
[1432] | 69 | void update_cfgfile_clone (cgiargsclass &args, ostream &logout);
|
---|
| 70 |
|
---|
[2518] | 71 | void update_cfgfile_partial (cgiargsclass &args, bool clone, ostream &logout);
|
---|
[1425] | 72 |
|
---|
| 73 | void update_cfgfile_complete (cgiargsclass &args, ostream &logout);
|
---|
| 74 |
|
---|
[1419] | 75 | text_t carriage_replace (const text_t &intext, int sw);
|
---|
| 76 |
|
---|
| 77 | text_t get_directory_name (const text_t &fullname);
|
---|
| 78 |
|
---|
[1432] | 79 | bool collection_protected (const text_t &collection);
|
---|
| 80 |
|
---|
[5599] | 81 | bool assign_tmpname (cgiargsclass &args, ostream &logout);
|
---|
[1457] | 82 |
|
---|
| 83 | void gsdl_mkcol (cgiargsclass &args, ostream &logout);
|
---|
| 84 |
|
---|
| 85 | void gsdl_build (cgiargsclass &args, ostream &logout);
|
---|
| 86 |
|
---|
| 87 | void gsdl_cancel_build (cgiargsclass &args, ostream &logout);
|
---|
| 88 |
|
---|
| 89 | text_t get_collectdir (cgiargsclass &args);
|
---|
| 90 |
|
---|
[1649] | 91 | bool uses_weird_plugin (const text_t &collection);
|
---|
[1485] | 92 |
|
---|
[1649] | 93 | void create_colserver (const text_t &collection, ostream &logout);
|
---|
| 94 |
|
---|
[1679] | 95 | void remove_colservr (const text_t &collection, ostream &logout);
|
---|
| 96 |
|
---|
[1778] | 97 | bool create_event_header_file (const text_t &filename, cgiargsclass &args,
|
---|
| 98 | ostream &logout);
|
---|
| 99 |
|
---|
| 100 | text_t get_event_header (cgiargsclass &args);
|
---|
| 101 |
|
---|
[2401] | 102 | bool check_sources (cgiargsclass &args, ostream &logout);
|
---|
| 103 |
|
---|
| 104 | text_t format_url (const text_t &url);
|
---|
| 105 |
|
---|
[2627] | 106 | text_t remove_trailing_slashes (text_t str);
|
---|
[2558] | 107 |
|
---|
[1419] | 108 | public:
|
---|
| 109 | collectoraction ();
|
---|
| 110 | virtual ~collectoraction ();
|
---|
| 111 |
|
---|
[1759] | 112 | void configure (const text_t &key, const text_tarray &cfgline);
|
---|
| 113 |
|
---|
[1419] | 114 | bool init (ostream &logout);
|
---|
| 115 |
|
---|
| 116 | void set_receptionist (receptionist *therecpt) {recpt=therecpt;}
|
---|
| 117 |
|
---|
| 118 | text_t get_action_name () {return "collector";}
|
---|
| 119 |
|
---|
| 120 | bool check_cgiargs (cgiargsinfoclass &argsinfo, cgiargsclass &args,
|
---|
[3546] | 121 | recptprotolistclass *protos, ostream &logout);
|
---|
[1419] | 122 |
|
---|
| 123 | void get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos,
|
---|
| 124 | response_t &response,text_t &response_data,
|
---|
| 125 | ostream &logout);
|
---|
| 126 |
|
---|
| 127 | void define_internal_macros (displayclass &disp, cgiargsclass &args,
|
---|
| 128 | recptprotolistclass *protos, ostream &logout);
|
---|
| 129 |
|
---|
| 130 | bool do_action (cgiargsclass &args, recptprotolistclass *protos,
|
---|
| 131 | browsermapclass *browsers, displayclass &disp,
|
---|
| 132 | outconvertclass &outconvert, ostream &textout,
|
---|
| 133 | ostream &logout);
|
---|
| 134 | };
|
---|
| 135 |
|
---|
[7371] | 136 | #endif //!COLLECTORACTION_H
|
---|
| 137 | #endif //GSDL_USE_COLLECTOR_ACTION
|
---|