source: gsdl/trunk/src/recpt/corbaclient.mpp@ 15445

Last change on this file since 15445 was 15445, checked in by mdewsnip, 16 years ago

Removed a couple of unnecessary inclusions of "mggdbmsource.h".

  • Property svn:keywords set to Author Date Id Revision
File size: 4.3 KB
Line 
1/**********************************************************************
2 *
3 * corbaclient.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 * $Id: corbaclient.mpp 15445 2008-05-14 02:53:28Z mdewsnip $
25 *
26 *********************************************************************/
27
28#include "receptionist.h"
29#include "cgiwrapper.h"
30#include "corbaproto.h"
31#include "collectserver.h"
32#include "filter.h"
33#include "browsefilter.h"
34#include "queryfilter.h"
35#include "mgsearch.h"
36#include "fileutil.h"
37#include <assert.h>
38
39#include "action.h"
40#include "statusaction.h"
41#include "pageaction.h"
42#include "pingaction.h"
43#include "queryaction.h"
44#include "documentaction.h"
45#include "authenaction.h"
46#include "usersaction.h"
47#include "authenaction.h"
48#include "extlinkaction.h"
49#include "tipaction.h"
50#include "collectoraction.h"
51
52#include "browserclass.h"
53#include "vlistbrowserclass.h"
54#include "hlistbrowserclass.h"
55#include "datelistbrowserclass.h"
56#include "invbrowserclass.h"
57#include "pagedbrowserclass.h"
58#include "htmlbrowserclass.h"
59
60// #include "gsdlhome.h"
61#include "gsdlsitecfg.h"
62
63int main (int argc, char *argv[]) {
64 receptionist recpt;
65 corbaproto* cproto_array[argc];
66 text_t gsdlhome;
67 text_t httpdomain;
68 text_t httpprefix;
69
70 cproto_array[0] = NULL; // unused
71
72 if (argc == 1)
73 { cout << "Content-type: text/html" << endl << endl;
74 cout << "Usage: " << argv[0] << "site1.objid [site2.objid ....]" << endl;
75 return 0;
76 }
77
78 // Strictly speaking httpdomain and httpprefix are not needed.
79 // Need to modifiy site_cfg_read to eliminate this dependency. // ****
80 site_cfg_read(gsdlhome, httpdomain, httpprefix);
81
82 for (int i=1; i<argc; i ++)
83 {
84 // add the protocol to the receptionist
85 cproto_array[i] = new corbaproto(argv[i]);
86 recpt.add_protocol(cproto_array[i]);
87 }
88
89// cout << "GRB 2" << endl;
90
91 // the list of actions. Note: these actions will become invalid
92 // at the end of this function.
93 tipaction atipaction;
94 recpt.add_action(&atipaction);
95
96 statusaction astatusaction;
97 astatusaction.set_receptionist (&recpt);
98 recpt.add_action (&astatusaction);
99
100 pageaction apageaction;
101 apageaction.set_receptionist (&recpt);
102 recpt.add_action (&apageaction);
103
104 pingaction apingaction;
105 recpt.add_action (&apingaction);
106
107 queryaction aqueryaction;
108 aqueryaction.set_receptionist (&recpt);
109 recpt.add_action (&aqueryaction);
110
111 documentaction adocumentaction;
112 adocumentaction.set_receptionist (&recpt);
113 recpt.add_action (&adocumentaction);
114
115 usersaction ausersaction;
116 recpt.add_action (&ausersaction);
117
118 extlinkaction anextlinkaction;
119 recpt.add_action (&anextlinkaction);
120
121 authenaction aauthenaction;
122 aauthenaction.set_receptionist(&recpt);
123 recpt.add_action (&aauthenaction);
124
125 collectoraction acollectoraction;
126 acollectoraction.set_receptionist (&recpt);
127 recpt.add_action(&acollectoraction);
128
129// cout << "GRB 3" << endl;
130
131 // list of browsers
132 vlistbrowserclass avlistbrowserclass;
133 recpt.add_browser (&avlistbrowserclass);
134 recpt.setdefaultbrowser ("VList");
135
136 hlistbrowserclass ahlistbrowserclass;
137 recpt.add_browser (&ahlistbrowserclass);
138
139 datelistbrowserclass adatelistbrowserclass;
140 recpt.add_browser (&adatelistbrowserclass);
141
142 invbrowserclass ainvbrowserclass;
143 recpt.add_browser (&ainvbrowserclass);
144
145 pagedbrowserclass apagedbrowserclass;
146 recpt.add_browser (&apagedbrowserclass);
147
148 htmlbrowserclass ahtmlbrowserclass;
149 recpt.add_browser (&ahtmlbrowserclass);
150
151 cgiwrapper (recpt, "");
152
153 for (int i=1; i< argc; i++)
154 {
155 delete cproto_array[i];
156 }
157
158 return 0;
159}
160
Note: See TracBrowser for help on using the repository browser.