source: trunk/gsdl/src/recpt/librarymain.cpp@ 2487

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

Changes to get phind working under windows

  • Property svn:keywords set to Author Date Id Revision
File size: 5.1 KB
Line 
1/**********************************************************************
2 *
3 * librarymain.cpp --
4 * Copyright (C) 1999 The New Zaland 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#include "receptionist.h"
27#include "cgiwrapper.h"
28#include "fileutil.h"
29#include "nullproto.h"
30// z39.50 stuff - johnmcp
31#if defined(USE_Z3950)
32#include "z3950proto.h"
33#endif
34#include "collectserver.h"
35#include "filter.h"
36#include "browsefilter.h"
37#include "mgqueryfilter.h"
38#include "mgppqueryfilter.h"
39#include "infodbclass.h"
40#include "mggdbmsource.h"
41#include "mgsearch.h"
42#include "mgppsearch.h"
43#include "collectset.h"
44#include <assert.h>
45
46#include "action.h"
47#include "statusaction.h"
48#include "pageaction.h"
49#include "pingaction.h"
50#include "queryaction.h"
51#include "documentaction.h"
52#include "authenaction.h"
53#include "usersaction.h"
54#include "extlinkaction.h"
55#include "tipaction.h"
56#include "collectoraction.h"
57#include "browseaction.h"
58#include "phindaction.h"
59
60#include "browserclass.h"
61#include "vlistbrowserclass.h"
62#include "hlistbrowserclass.h"
63#include "datelistbrowserclass.h"
64#include "invbrowserclass.h"
65#include "pagedbrowserclass.h"
66#include "htmlbrowserclass.h"
67#include "phindbrowserclass.h"
68
69int main () {
70 receptionist recpt;
71 nullproto nproto;
72 collectset *cservers;
73#if defined(USE_Z3950)
74 z3950proto zproto;
75#endif
76 text_t gsdlhome;
77
78 cservers = new collectset(gsdlhome);
79
80 // set up the null protocol
81 nproto.set_collectset(cservers);
82
83 // configure the receptionist server list
84 cservers->setReceptionistServers(recpt, gsdlhome);
85
86 // add the protocol to the receptionist
87 recpt.add_protocol (&nproto);
88
89 // z39.50 stuff - johnmcp
90#if defined(USE_Z3950)
91 // add the z39.50 server information. Read in the file
92 // etc/recpt/z3950.cfg for list of servers and their databases.
93 text_t z3950cfg = filename_cat (gsdlhome, "etc");
94 z3950cfg = filename_cat (z3950cfg, "recpt");
95 z3950cfg = filename_cat (z3950cfg, "z3950.cfg");
96#ifdef USE_FASTCGI
97 // currently can't use z39.50 if fastcgi used
98#warning "Disabling z39.50 support as fastcgi is in use"
99 if (0) {
100#else
101 if (file_exists(z3950cfg)) {
102#endif
103 text_t z3950err = filename_cat (gsdlhome, "etc", "z3950log.txt");
104 zproto.read_config_file(z3950cfg,z3950err);
105 // only add this protocol if we have any servers configured.
106 if (zproto.getServerCount()>0)
107 recpt.add_protocol (&zproto);
108 }
109#endif
110
111 // the list of actions. Note: these actions will become invalid
112 // at the end of this function.
113 tipaction atipaction;
114 recpt.add_action (&atipaction);
115
116 statusaction astatusaction;
117 astatusaction.set_receptionist (&recpt);
118 recpt.add_action (&astatusaction);
119
120 pageaction apageaction;
121 apageaction.set_receptionist (&recpt);
122 recpt.add_action (&apageaction);
123
124 pingaction apingaction;
125 recpt.add_action (&apingaction);
126
127 queryaction aqueryaction;
128 aqueryaction.set_receptionist (&recpt);
129 recpt.add_action (&aqueryaction);
130
131 documentaction adocumentaction;
132 adocumentaction.set_receptionist (&recpt);
133 recpt.add_action (&adocumentaction);
134
135 usersaction ausersaction;
136 recpt.add_action (&ausersaction);
137
138 extlinkaction anextlinkaction;
139 recpt.add_action (&anextlinkaction);
140
141 authenaction aauthenaction;
142 aauthenaction.set_receptionist(&recpt);
143 recpt.add_action (&aauthenaction);
144
145 collectoraction acollectoraction;
146 acollectoraction.set_receptionist (&recpt);
147 recpt.add_action(&acollectoraction);
148
149 browseaction abrowseaction;
150 abrowseaction.set_receptionist (&recpt);
151 recpt.add_action(&abrowseaction);
152
153 phindaction aphindaction;
154 recpt.add_action(&aphindaction);
155
156 // list of browsers
157 vlistbrowserclass avlistbrowserclass;
158 recpt.add_browser (&avlistbrowserclass);
159 recpt.setdefaultbrowser ("VList");
160
161 hlistbrowserclass ahlistbrowserclass;
162 recpt.add_browser (&ahlistbrowserclass);
163
164 datelistbrowserclass adatelistbrowserclass;
165 recpt.add_browser (&adatelistbrowserclass);
166
167 invbrowserclass ainvbrowserclass;
168 recpt.add_browser (&ainvbrowserclass);
169
170 pagedbrowserclass apagedbrowserclass;
171 recpt.add_browser (&apagedbrowserclass);
172
173 htmlbrowserclass ahtmlbrowserclass;
174 recpt.add_browser (&ahtmlbrowserclass);
175
176 phindbrowserclass aphindbrowserclass;
177 recpt.add_browser (&aphindbrowserclass);
178
179 cgiwrapper (recpt, "");
180 delete cservers;
181 return 0;
182}
183
184
185
186
187
188
189
Note: See TracBrowser for help on using the repository browser.