1 | /**********************************************************************
|
---|
2 | *
|
---|
3 | * queryaction.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 QUERYACTION_H
|
---|
28 | #define QUERYACTION_H
|
---|
29 |
|
---|
30 | #include "gsdlconf.h"
|
---|
31 | #include "basequeryaction.h"
|
---|
32 | #include "userdb.h"
|
---|
33 | #include "receptionist.h"
|
---|
34 |
|
---|
35 |
|
---|
36 | class queryaction : public basequeryaction {
|
---|
37 |
|
---|
38 | protected:
|
---|
39 | text_t m_strUseInterfaceLanguageForQuery;
|
---|
40 | text_t formatstring;
|
---|
41 | text_tmap reqfields; // required fields
|
---|
42 | int num_phrases;
|
---|
43 |
|
---|
44 | userdbclass *user_database; // for checking user groups in ccs
|
---|
45 | virtual text_t query_filter_name () {return "QueryFilter";}
|
---|
46 |
|
---|
47 | virtual void define_query_macros (cgiargsclass &args, displayclass &disp,
|
---|
48 | int numDocs, isapprox isApprox);
|
---|
49 |
|
---|
50 | virtual void get_formatted_query_string (text_t &formattedstring,
|
---|
51 | bool segment,
|
---|
52 | cgiargsclass &args,
|
---|
53 | displayclass &disp,
|
---|
54 | ostream &logout);
|
---|
55 |
|
---|
56 | void define_query_interface(displayclass &disp, cgiargsclass &args,
|
---|
57 | recptprotolistclass *protos, ostream &logout);
|
---|
58 |
|
---|
59 | virtual void define_form_macros (displayclass &disp, cgiargsclass &args,
|
---|
60 | recptprotolistclass *protos,
|
---|
61 | ostream &logout);
|
---|
62 |
|
---|
63 | void set_gformselection_macro (text_t current_value,
|
---|
64 | const FilterOption_t &option,
|
---|
65 | displayclass &disp);
|
---|
66 | void set_sfselection_macro (text_t current_value,
|
---|
67 | const FilterOption_t &option,
|
---|
68 | displayclass &disp);
|
---|
69 |
|
---|
70 | void output_ccp (cgiargsclass &args, recptprotolistclass *protos,
|
---|
71 | displayclass &disp, outconvertclass &outconvert,
|
---|
72 | ostream &textout, ostream &logout);
|
---|
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 |
|
---|
84 |
|
---|
85 | bool search_multiple_collections (cgiargsclass &args,
|
---|
86 | recptprotolistclass *protos,
|
---|
87 | browsermapclass *browsers,
|
---|
88 | displayclass &disp,
|
---|
89 | outconvertclass &outconvert,
|
---|
90 | ostream &textout,
|
---|
91 | ostream &logout);
|
---|
92 |
|
---|
93 | virtual bool save_search_history(cgiargsclass &args, int numdocs,
|
---|
94 | isapprox isApprox);
|
---|
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);
|
---|
97 | public:
|
---|
98 | queryaction ();
|
---|
99 | virtual ~queryaction ();
|
---|
100 |
|
---|
101 | void configure (const text_t &key, const text_tarray &cfgline);
|
---|
102 | bool init (ostream &logout);
|
---|
103 |
|
---|
104 | void set_userdb(userdbclass *udb) {user_database = udb;}
|
---|
105 | virtual text_t get_action_name () {return "q";}
|
---|
106 |
|
---|
107 | virtual bool check_cgiargs (cgiargsinfoclass &argsinfo, cgiargsclass &args,
|
---|
108 | recptprotolistclass *protos, ostream &logout);
|
---|
109 | virtual void define_internal_macros (displayclass &disp, cgiargsclass &args,
|
---|
110 | recptprotolistclass *protos, ostream &logout);
|
---|
111 |
|
---|
112 | virtual void define_external_macros (displayclass &disp, cgiargsclass &args,
|
---|
113 | recptprotolistclass *protos, ostream &logout);
|
---|
114 |
|
---|
115 | virtual bool do_action (cgiargsclass &args, recptprotolistclass *protos,
|
---|
116 | browsermapclass *browsers, displayclass &disp,
|
---|
117 | outconvertclass &outconvert, ostream &textout,
|
---|
118 | ostream &logout);
|
---|
119 |
|
---|
120 | };
|
---|
121 |
|
---|
122 | #endif
|
---|