source: gsdl/trunk/runtime-src/src/corba/corbaclient.mpp@ 18235

Last change on this file since 18235 was 18235, checked in by mdewsnip, 15 years ago

Grrr... another fix for incomplete testing of changes.

  • Property svn:keywords set to Author Date Id Revision
File size: 4.4 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 18235 2008-12-17 02:58:17Z 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 collecthome;
68 text_t httpdomain;
69 text_t httpprefix;
70
71 cproto_array[0] = NULL; // unused
72
73 if (argc == 1)
74 { cout << "Content-type: text/html" << endl << endl;
75 cout << "Usage: " << argv[0] << "site1.objid [site2.objid ....]" << endl;
76 return 0;
77 }
78
79 // Strictly speaking httpdomain and httpprefix are not needed.
80 // Need to modifiy site_cfg_read to eliminate this dependency. // ****
81 site_cfg_read(gsdlhome, collecthome, httpdomain, httpprefix);
82
83 for (int i=1; i<argc; i ++)
84 {
85 // add the protocol to the receptionist
86 cproto_array[i] = new corbaproto(argv[i]);
87 recpt.add_protocol(cproto_array[i]);
88 }
89
90// cout << "GRB 2" << endl;
91
92 // the list of actions. Note: these actions will become invalid
93 // at the end of this function.
94 tipaction atipaction;
95 recpt.add_action(&atipaction);
96
97 statusaction astatusaction;
98 astatusaction.set_receptionist (&recpt);
99 recpt.add_action (&astatusaction);
100
101 pageaction apageaction;
102 apageaction.set_receptionist (&recpt);
103 recpt.add_action (&apageaction);
104
105 pingaction apingaction;
106 recpt.add_action (&apingaction);
107
108 queryaction aqueryaction;
109 aqueryaction.set_receptionist (&recpt);
110 recpt.add_action (&aqueryaction);
111
112 documentaction adocumentaction;
113 adocumentaction.set_receptionist (&recpt);
114 recpt.add_action (&adocumentaction);
115
116 usersaction ausersaction;
117 recpt.add_action (&ausersaction);
118
119 extlinkaction anextlinkaction;
120 recpt.add_action (&anextlinkaction);
121
122 authenaction aauthenaction;
123 aauthenaction.set_receptionist(&recpt);
124 recpt.add_action (&aauthenaction);
125
126 collectoraction acollectoraction;
127 acollectoraction.set_receptionist (&recpt);
128 recpt.add_action(&acollectoraction);
129
130// cout << "GRB 3" << endl;
131
132 // list of browsers
133 vlistbrowserclass avlistbrowserclass;
134 recpt.add_browser (&avlistbrowserclass);
135 recpt.setdefaultbrowser ("VList");
136
137 hlistbrowserclass ahlistbrowserclass;
138 recpt.add_browser (&ahlistbrowserclass);
139
140 datelistbrowserclass adatelistbrowserclass;
141 recpt.add_browser (&adatelistbrowserclass);
142
143 invbrowserclass ainvbrowserclass;
144 recpt.add_browser (&ainvbrowserclass);
145
146 pagedbrowserclass apagedbrowserclass;
147 recpt.add_browser (&apagedbrowserclass);
148
149 htmlbrowserclass ahtmlbrowserclass;
150 recpt.add_browser (&ahtmlbrowserclass);
151
152 cgiwrapper (recpt, "");
153
154 for (int i=1; i< argc; i++)
155 {
156 delete cproto_array[i];
157 }
158
159 return 0;
160}
161
Note: See TracBrowser for help on using the repository browser.