source: trunk/cstr/src/recpt/cstrlibrarymain.cpp@ 1964

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

* empty log message *

  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/**********************************************************************
2 *
3 * cstrlibrarymain.cpp --
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#include "receptionist.h"
28#include "collectset.h"
29#include "cgiwrapper.h"
30#include "nullproto.h"
31#include "fileutil.h"
32#include <assert.h>
33
34#include "action.h"
35#include "statusaction.h"
36#include "pageaction.h"
37#include "pingaction.h"
38#include "queryaction.h"
39#include "cstrdocaction.h"
40#include "authenaction.h"
41#include "usersaction.h"
42
43#include "browserclass.h"
44#include "vlistbrowserclass.h"
45#include "hlistbrowserclass.h"
46#include "datelistbrowserclass.h"
47#include "invbrowserclass.h"
48#include "pagedbrowserclass.h"
49#include "htmlbrowserclass.h"
50
51#include "recptconfig.h"
52
53int main () {
54 receptionist recpt;
55 nullproto nproto;
56
57 text_t gsdlhome, httpdomain, httpprefix;
58 // get gsdlhome (if we fail the error will be picked up later -- in
59 // cgiwrapper)
60 site_cfg_read (gsdlhome, httpdomain, httpprefix);
61 collectset *cservers = new collectset();
62 cservers->add_collection ("cstr", &recpt, gsdlhome, gsdlhome);
63
64 nproto.set_collectset(cservers);
65
66 // configure the receptionist server list
67 cservers->setReceptionistServers(recpt, gsdlhome);
68
69 // add the protocol to the receptionist
70 recpt.add_protocol (&nproto);
71
72 // the list of actions. Note: these actions will become invalid
73 // at the end of this function.
74 statusaction astatusaction;
75 astatusaction.set_receptionist (&recpt);
76 recpt.add_action (&astatusaction);
77
78 pageaction apageaction;
79 apageaction.set_receptionist (&recpt);
80 recpt.add_action (&apageaction);
81
82 pingaction apingaction;
83 recpt.add_action (&apingaction);
84
85 queryaction aqueryaction;
86 aqueryaction.set_receptionist (&recpt);
87 recpt.add_action (&aqueryaction);
88
89 cstrdocaction adocumentaction;
90 adocumentaction.set_receptionist (&recpt);
91 recpt.add_action (&adocumentaction);
92
93 usersaction ausersaction;
94 recpt.add_action (&ausersaction);
95
96 authenaction aauthenaction;
97 aauthenaction.set_receptionist(&recpt);
98 recpt.add_action (&aauthenaction);
99
100 // list of browsers
101 vlistbrowserclass avlistbrowserclass;
102 recpt.add_browser (&avlistbrowserclass);
103 recpt.setdefaultbrowser ("VList");
104
105 hlistbrowserclass ahlistbrowserclass;
106 recpt.add_browser (&ahlistbrowserclass);
107
108 datelistbrowserclass adatelistbrowserclass;
109 recpt.add_browser (&adatelistbrowserclass);
110
111 invbrowserclass ainvbrowserclass;
112 recpt.add_browser (&ainvbrowserclass);
113
114 pagedbrowserclass apagedbrowserclass;
115 recpt.add_browser (&apagedbrowserclass);
116
117 htmlbrowserclass ahtmlbrowserclass;
118 recpt.add_browser (&ahtmlbrowserclass);
119
120 cgiwrapper (recpt, "cstr");
121 return 0;
122}
Note: See TracBrowser for help on using the repository browser.