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

Last change on this file since 3632 was 3632, checked in by sjboddie, 21 years ago

Added langaction

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