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

Last change on this file since 1945 was 1945, checked in by nzdl, 23 years ago

updated niupepa collection

  • Property svn:keywords set to Author Date Id Revision
File size: 3.8 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
50#include "browserclass.h"
51#include "niupepavlistbrowserclass.h"
52#include "niupepahlistbrowserclass.h"
53#include "datelistbrowserclass.h"
54#include "invbrowserclass.h"
55#include "niupepapagedbrowserclass.h"
56#include "htmlbrowserclass.h"
57
58#include "recptconfig.h"
59
60int main () {
61 receptionist recpt;
62 nullproto nproto;
63
64 text_t gsdlhome, httpdomain, httpprefix;
65 // get gsdlhome (if we fail the error will be picked up later -- in
66 // cgiwrapper)
67 site_cfg_read (gsdlhome, httpdomain, httpprefix);
68 collectset *cservers = new collectset();
69 cservers->add_collection ("niupepa", &recpt, gsdlhome, gsdlhome);
70
71 nproto.set_collectset(cservers);
72
73 // configure the receptionist server list
74 cservers->setReceptionistServers(recpt, gsdlhome);
75
76 // add the protocol to the receptionist
77 recpt.add_protocol (&nproto);
78
79 // the list of actions. Note: these actions will become invalid
80 // at the end of this function.
81 statusaction astatusaction;
82 astatusaction.set_receptionist (&recpt);
83 recpt.add_action (&astatusaction);
84
85 pageaction apageaction;
86 apageaction.set_receptionist (&recpt);
87 recpt.add_action (&apageaction);
88
89 pingaction apingaction;
90 recpt.add_action (&apingaction);
91
92 queryaction aqueryaction;
93 aqueryaction.set_receptionist (&recpt);
94 recpt.add_action (&aqueryaction);
95
96 niupepadocaction adocumentaction;
97 adocumentaction.set_receptionist (&recpt);
98 recpt.add_action (&adocumentaction);
99
100 usersaction ausersaction;
101 recpt.add_action (&ausersaction);
102
103 authenaction aauthenaction;
104 aauthenaction.set_receptionist(&recpt);
105 recpt.add_action (&aauthenaction);
106
107
108 // list of browsers
109 niupepavlistbrowserclass avlistbrowserclass;
110 recpt.add_browser (&avlistbrowserclass);
111 recpt.setdefaultbrowser ("VList");
112
113 niupepahlistbrowserclass ahlistbrowserclass;
114 recpt.add_browser (&ahlistbrowserclass);
115
116 datelistbrowserclass adatelistbrowserclass;
117 recpt.add_browser (&adatelistbrowserclass);
118
119 invbrowserclass ainvbrowserclass;
120 recpt.add_browser (&ainvbrowserclass);
121
122 niupepapagedbrowserclass apagedbrowserclass;
123 recpt.add_browser (&apagedbrowserclass);
124
125 htmlbrowserclass ahtmlbrowserclass;
126 recpt.add_browser (&ahtmlbrowserclass);
127
128 cgiwrapper (recpt, "niupepa");
129 return 0;
130}
Note: See TracBrowser for help on using the repository browser.