source: trunk/protemix/src/recpt/ptmxmain.cpp@ 3162

Last change on this file since 3162 was 3162, checked in by sjboddie, 22 years ago

Initial revision

  • Property svn:keywords set to Author Date Id Revision
File size: 3.7 KB
Line 
1/**********************************************************************
2 *
3 * ptmxmain.cpp --
4 * Copyright (C) 2002 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#include "collectserver.h"
31#include "filter.h"
32#include "browsefilter.h"
33#include "mgqueryfilter.h"
34#include "mgppqueryfilter.h"
35#include "infodbclass.h"
36#include "mggdbmsource.h"
37#include "mgsearch.h"
38#include "mgppsearch.h"
39#include "collectset.h"
40#include <assert.h>
41
42#include "action.h"
43#include "pageaction.h"
44#include "ptmxqueryaction.h"
45#include "documentaction.h"
46#include "extlinkaction.h"
47#include "phindaction.h"
48
49#include "browserclass.h"
50#include "vlistbrowserclass.h"
51#include "hlistbrowserclass.h"
52#include "datelistbrowserclass.h"
53#include "invbrowserclass.h"
54#include "pagedbrowserclass.h"
55#include "htmlbrowserclass.h"
56#include "phindbrowserclass.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 ("protemix", &recpt, gsdlhome, gsdlhome);
70
71 // set up the null protocol
72 nproto.set_collectset(cservers);
73
74 // configure the receptionist server list
75 cservers->setReceptionistServers(recpt, gsdlhome);
76
77 // add the protocol to the receptionist
78 recpt.add_protocol (&nproto);
79
80 // the list of actions. Note: these actions will become invalid
81 // at the end of this function.
82 pageaction apageaction;
83 apageaction.set_receptionist (&recpt);
84 recpt.add_action (&apageaction);
85
86 ptmxqueryaction aqueryaction;
87 aqueryaction.set_receptionist (&recpt);
88 recpt.add_action (&aqueryaction);
89
90 documentaction adocumentaction;
91 adocumentaction.set_receptionist (&recpt);
92 recpt.add_action (&adocumentaction);
93
94 extlinkaction anextlinkaction;
95 recpt.add_action (&anextlinkaction);
96
97 phindaction aphindaction;
98 recpt.add_action(&aphindaction);
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 phindbrowserclass aphindbrowserclass;
121 recpt.add_browser (&aphindbrowserclass);
122
123 cgiwrapper (recpt, "protemix");
124 delete cservers;
125 return 0;
126}
Note: See TracBrowser for help on using the repository browser.