source: trunk/niupepa/src/recpt/niupepalibrarymain.cpp@ 2786

Last change on this file since 2786 was 2786, checked in by kjm18, 23 years ago

added phind functionality to niupepa library

  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1/**********************************************************************
2 *
3 * niupepalibrarymain.cpp --
4 * A component of the Greenstone digital library software
5 * from the New Zealand Digital Library Project at the
6 * University of Waikato, New Zealand.
7 *
8 * Copyright (C) 1999 The New Zealand Digital Library Project
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#include "receptionist.h"
28#include "collectset.h"
29#include "cgiwrapper.h"
30#include "nullproto.h"
31#include "collectserver.h"
32#include "filter.h"
33#include "browsefilter.h"
34#include "mgqueryfilter.h"
35#include "infodbclass.h"
36#include "mgsearch.h"
37#include "mggdbmsource.h"
38#include "fileutil.h"
39#include <assert.h>
40
41#include "action.h"
42#include "statusaction.h"
43#include "pageaction.h"
44#include "pingaction.h"
45#include "queryaction.h"
46#include "niupepadocaction.h"
47#include "authenaction.h"
48#include "usersaction.h"
49#include "phindaction.h"
50
51#include "browserclass.h"
52#include "niupepavlistbrowserclass.h"
53#include "niupepahlistbrowserclass.h"
54#include "datelistbrowserclass.h"
55#include "invbrowserclass.h"
56#include "niupepapagedbrowserclass.h"
57#include "htmlbrowserclass.h"
58#include "phindbrowserclass.h"
59
60#include "recptconfig.h"
61
62int main () {
63 receptionist recpt;
64 nullproto nproto;
65
66 text_t gsdlhome, httpdomain, httpprefix;
67 // get gsdlhome (if we fail the error will be picked up later -- in
68 // cgiwrapper)
69 site_cfg_read (gsdlhome, httpdomain, httpprefix);
70 collectset *cservers = new collectset();
71 cservers->add_collection ("niupepa", &recpt, gsdlhome, gsdlhome);
72
73 nproto.set_collectset(cservers);
74
75 // configure the receptionist server list
76 cservers->setReceptionistServers(recpt, gsdlhome);
77
78 // add the protocol to the receptionist
79 recpt.add_protocol (&nproto);
80
81 // the list of actions. Note: these actions will become invalid
82 // at the end of this function.
83 statusaction astatusaction;
84 astatusaction.set_receptionist (&recpt);
85 recpt.add_action (&astatusaction);
86
87 pageaction apageaction;
88 apageaction.set_receptionist (&recpt);
89 recpt.add_action (&apageaction);
90
91 pingaction apingaction;
92 recpt.add_action (&apingaction);
93
94 queryaction aqueryaction;
95 aqueryaction.set_receptionist (&recpt);
96 recpt.add_action (&aqueryaction);
97
98 niupepadocaction adocumentaction;
99 adocumentaction.set_receptionist (&recpt);
100 recpt.add_action (&adocumentaction);
101
102 usersaction ausersaction;
103 recpt.add_action (&ausersaction);
104
105 authenaction aauthenaction;
106 aauthenaction.set_receptionist(&recpt);
107 recpt.add_action (&aauthenaction);
108
109 phindaction aphindaction;
110 recpt.add_action(&aphindaction);
111
112 // list of browsers
113 niupepavlistbrowserclass avlistbrowserclass;
114 recpt.add_browser (&avlistbrowserclass);
115 recpt.setdefaultbrowser ("VList");
116
117 niupepahlistbrowserclass ahlistbrowserclass;
118 recpt.add_browser (&ahlistbrowserclass);
119
120 datelistbrowserclass adatelistbrowserclass;
121 recpt.add_browser (&adatelistbrowserclass);
122
123 invbrowserclass ainvbrowserclass;
124 recpt.add_browser (&ainvbrowserclass);
125
126 niupepapagedbrowserclass apagedbrowserclass;
127 recpt.add_browser (&apagedbrowserclass);
128
129 htmlbrowserclass ahtmlbrowserclass;
130 recpt.add_browser (&ahtmlbrowserclass);
131
132 phindbrowserclass aphindbrowserclass;
133 recpt.add_browser (&aphindbrowserclass);
134
135 cgiwrapper (recpt, "niupepa");
136 return 0;
137}
Note: See TracBrowser for help on using the repository browser.