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

Last change on this file since 1861 was 1860, checked in by cs025, 23 years ago

Included CORBA branch for first time

  • Property svn:keywords set to Author Date Id Revision
File size: 4.9 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 1860 2001-01-25 18:26:45Z cs025 $
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 "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 "documentaction.h"
47#include "authenaction.h"
48#include "usersaction.h"
49#include "authenaction.h"
50#include "extlinkaction.h"
51#include "delhistoryaction.h"
52#include "tipaction.h"
53#include "collectoraction.h"
54
55#include "browserclass.h"
56#include "vlistbrowserclass.h"
57#include "hlistbrowserclass.h"
58#include "datelistbrowserclass.h"
59#include "invbrowserclass.h"
60#include "pagedbrowserclass.h"
61#include "htmlbrowserclass.h"
62
63// #include "gsdlhome.h"
64#include "recptconfig.h"
65
66int main (int argc, char *argv[]) {
67 receptionist recpt;
68 corbaproto* cproto_array[argc];
69 text_t gsdlhome;
70 text_t httpdomain;
71 text_t httpprefix;
72
73 cproto_array[0] = NULL; // unused
74
75 if (argc == 1)
76 { cout << "Content-type: text/html" << endl << endl;
77 cout << "Usage: " << argv[0] << "site1.objid [site2.objid ....]" << endl;
78 return 0;
79 }
80
81 // Strictly speaking httpdomain and httpprefix are not needed.
82 // Need to modifiy site_cfg_read to eliminate this dependency. // ****
83 site_cfg_read(gsdlhome, httpdomain, httpprefix);
84
85 for (int i=1; i<argc; i ++)
86 {
87 // add the protocol to the receptionist
88 cproto_array[i] = new corbaproto(argv[i]);
89 recpt.add_protocol(cproto_array[i]);
90 }
91
92 // add other converters
93 utf8inconvertclass utf8inconvert;
94 utf8outconvertclass utf8outconvert;
95 recpt.add_converter ("u", &utf8inconvert, &utf8outconvert);
96
97 mapinconvertclass gbinconvert;
98 gbinconvert.setmapfile (gsdlhome, "gbku", 0x25a1);
99 mapoutconvertclass gboutconvert;
100 gboutconvert.setmapfile (gsdlhome, "ugbk", 0xa1f5);
101 recpt.add_converter ("g", &gbinconvert, &gboutconvert);
102
103// cout << "GRB 2" << endl;
104
105 // the list of actions. Note: these actions will become invalid
106 // at the end of this function.
107 tipaction atipaction;
108 recpt.add_action(&atipaction);
109
110 statusaction astatusaction;
111 astatusaction.set_receptionist (&recpt);
112 recpt.add_action (&astatusaction);
113
114 pageaction apageaction;
115 apageaction.set_receptionist (&recpt);
116 recpt.add_action (&apageaction);
117
118 pingaction apingaction;
119 recpt.add_action (&apingaction);
120
121 queryaction aqueryaction;
122 aqueryaction.set_receptionist (&recpt);
123 recpt.add_action (&aqueryaction);
124
125 documentaction adocumentaction;
126 adocumentaction.set_receptionist (&recpt);
127 recpt.add_action (&adocumentaction);
128
129 usersaction ausersaction;
130 recpt.add_action (&ausersaction);
131
132 extlinkaction anextlinkaction;
133 recpt.add_action (&anextlinkaction);
134
135 authenaction aauthenaction;
136 aauthenaction.set_receptionist(&recpt);
137 recpt.add_action (&aauthenaction);
138
139 delhistoryaction adelhistoryaction;
140 recpt.add_action(&adelhistoryaction);
141
142 collectoraction acollectoraction;
143 acollectoraction.set_receptionist (&recpt);
144 recpt.add_action(&acollectoraction);
145
146// cout << "GRB 3" << endl;
147
148 // list of browsers
149 vlistbrowserclass avlistbrowserclass;
150 recpt.add_browser (&avlistbrowserclass);
151 recpt.setdefaultbrowser ("VList");
152
153 hlistbrowserclass ahlistbrowserclass;
154 recpt.add_browser (&ahlistbrowserclass);
155
156 datelistbrowserclass adatelistbrowserclass;
157 recpt.add_browser (&adatelistbrowserclass);
158
159 invbrowserclass ainvbrowserclass;
160 recpt.add_browser (&ainvbrowserclass);
161
162 pagedbrowserclass apagedbrowserclass;
163 recpt.add_browser (&apagedbrowserclass);
164
165 htmlbrowserclass ahtmlbrowserclass;
166 recpt.add_browser (&ahtmlbrowserclass);
167
168 cgiwrapper (recpt, "");
169
170 for (int i=1; i< argc; i++)
171 {
172 delete cproto_array[i];
173 }
174
175 return 0;
176}
177
Note: See TracBrowser for help on using the repository browser.