[174] | 1 | /**********************************************************************
|
---|
| 2 | *
|
---|
| 3 | * queryaction.h --
|
---|
| 4 | * Copyright (C) 1999 The New Zealand Digital Library Project
|
---|
| 5 | *
|
---|
[533] | 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.
|
---|
[174] | 9 | *
|
---|
[533] | 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 | *
|
---|
[174] | 24 | *********************************************************************/
|
---|
| 25 |
|
---|
| 26 |
|
---|
| 27 | #ifndef QUERYACTION_H
|
---|
| 28 | #define QUERYACTION_H
|
---|
| 29 |
|
---|
| 30 | #include "gsdlconf.h"
|
---|
[22046] | 31 | #include "basequeryaction.h"
|
---|
[27172] | 32 | #include "userdb.h"
|
---|
[1270] | 33 | #include "receptionist.h"
|
---|
[174] | 34 |
|
---|
| 35 |
|
---|
[22046] | 36 | class queryaction : public basequeryaction {
|
---|
[757] | 37 |
|
---|
[275] | 38 | protected:
|
---|
[7385] | 39 | text_t m_strUseInterfaceLanguageForQuery;
|
---|
[337] | 40 | text_t formatstring;
|
---|
[7385] | 41 | text_tmap reqfields; // required fields
|
---|
[403] | 42 | int num_phrases;
|
---|
[337] | 43 |
|
---|
[27172] | 44 | userdbclass *user_database; // for checking user groups in ccs
|
---|
[22046] | 45 | virtual text_t query_filter_name () {return "QueryFilter";}
|
---|
| 46 |
|
---|
[928] | 47 | virtual void define_query_macros (cgiargsclass &args, displayclass &disp,
|
---|
[22046] | 48 | int numDocs, isapprox isApprox);
|
---|
[397] | 49 |
|
---|
[22046] | 50 | virtual void get_formatted_query_string (text_t &formattedstring,
|
---|
| 51 | bool segment,
|
---|
| 52 | cgiargsclass &args,
|
---|
| 53 | displayclass &disp,
|
---|
| 54 | ostream &logout);
|
---|
| 55 |
|
---|
[2769] | 56 | void define_query_interface(displayclass &disp, cgiargsclass &args,
|
---|
[4200] | 57 | recptprotolistclass *protos, ostream &logout);
|
---|
| 58 |
|
---|
[22046] | 59 | virtual void define_form_macros (displayclass &disp, cgiargsclass &args,
|
---|
| 60 | recptprotolistclass *protos,
|
---|
| 61 | ostream &logout);
|
---|
[1915] | 62 |
|
---|
[4780] | 63 | void set_gformselection_macro (text_t current_value,
|
---|
| 64 | const FilterOption_t &option,
|
---|
| 65 | displayclass &disp);
|
---|
[12785] | 66 | void set_sfselection_macro (text_t current_value,
|
---|
| 67 | const FilterOption_t &option,
|
---|
| 68 | displayclass &disp);
|
---|
[4780] | 69 |
|
---|
[928] | 70 | void output_ccp (cgiargsclass &args, recptprotolistclass *protos,
|
---|
| 71 | displayclass &disp, outconvertclass &outconvert,
|
---|
| 72 | ostream &textout, ostream &logout);
|
---|
[22046] | 73 |
|
---|
| 74 | virtual void set_queryfilter_options (FilterRequest_t &request,
|
---|
| 75 | const text_t &querystring,
|
---|
| 76 | cgiargsclass &args);
|
---|
| 77 |
|
---|
| 78 | virtual void set_queryfilter_options (FilterRequest_t &request,
|
---|
| 79 | const text_t &querystring1,
|
---|
| 80 | const text_t &querystring2,
|
---|
| 81 | cgiargsclass &args);
|
---|
| 82 |
|
---|
| 83 |
|
---|
[928] | 84 |
|
---|
[1915] | 85 | bool search_multiple_collections (cgiargsclass &args,
|
---|
| 86 | recptprotolistclass *protos,
|
---|
| 87 | browsermapclass *browsers,
|
---|
| 88 | displayclass &disp,
|
---|
| 89 | outconvertclass &outconvert,
|
---|
| 90 | ostream &textout,
|
---|
[757] | 91 | ostream &logout);
|
---|
[1915] | 92 |
|
---|
[22046] | 93 | virtual bool save_search_history(cgiargsclass &args, int numdocs,
|
---|
| 94 | isapprox isApprox);
|
---|
[27172] | 95 | bool user_groups_match(const text_t &collection_groups, const text_t &user_groups);
|
---|
| 96 | void validate_ccs_collection_list(cgiargsclass &args, recptprotolistclass *protos, ostream &logout);
|
---|
[174] | 97 | public:
|
---|
| 98 | queryaction ();
|
---|
[22046] | 99 | virtual ~queryaction ();
|
---|
[1270] | 100 |
|
---|
[174] | 101 | void configure (const text_t &key, const text_tarray &cfgline);
|
---|
| 102 | bool init (ostream &logout);
|
---|
| 103 |
|
---|
[27172] | 104 | void set_userdb(userdbclass *udb) {user_database = udb;}
|
---|
[928] | 105 | virtual text_t get_action_name () {return "q";}
|
---|
[174] | 106 |
|
---|
[928] | 107 | virtual bool check_cgiargs (cgiargsinfoclass &argsinfo, cgiargsclass &args,
|
---|
[3546] | 108 | recptprotolistclass *protos, ostream &logout);
|
---|
[928] | 109 | virtual void define_internal_macros (displayclass &disp, cgiargsclass &args,
|
---|
[757] | 110 | recptprotolistclass *protos, ostream &logout);
|
---|
| 111 |
|
---|
[928] | 112 | virtual void define_external_macros (displayclass &disp, cgiargsclass &args,
|
---|
[757] | 113 | recptprotolistclass *protos, ostream &logout);
|
---|
[174] | 114 |
|
---|
[928] | 115 | virtual bool do_action (cgiargsclass &args, recptprotolistclass *protos,
|
---|
[757] | 116 | browsermapclass *browsers, displayclass &disp,
|
---|
[421] | 117 | outconvertclass &outconvert, ostream &textout,
|
---|
| 118 | ostream &logout);
|
---|
[3546] | 119 |
|
---|
[174] | 120 | };
|
---|
| 121 |
|
---|
| 122 | #endif
|
---|