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

Last change on this file since 2105 was 1982, checked in by mjd12, 23 years ago

Removed old converter stuff (mjd12, Jan 2001)

  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 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 1982 2001-02-15 02:43:05Z mjd12 $
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// cout << "GRB 2" << endl;
93
94 // the list of actions. Note: these actions will become invalid
95 // at the end of this function.
96 tipaction atipaction;
97 recpt.add_action(&atipaction);
98
99 statusaction astatusaction;
100 astatusaction.set_receptionist (&recpt);
101 recpt.add_action (&astatusaction);
102
103 pageaction apageaction;
104 apageaction.set_receptionist (&recpt);
105 recpt.add_action (&apageaction);
106
107 pingaction apingaction;
108 recpt.add_action (&apingaction);
109
110 queryaction aqueryaction;
111 aqueryaction.set_receptionist (&recpt);
112 recpt.add_action (&aqueryaction);
113
114 documentaction adocumentaction;
115 adocumentaction.set_receptionist (&recpt);
116 recpt.add_action (&adocumentaction);
117
118 usersaction ausersaction;
119 recpt.add_action (&ausersaction);
120
121 extlinkaction anextlinkaction;
122 recpt.add_action (&anextlinkaction);
123
124 authenaction aauthenaction;
125 aauthenaction.set_receptionist(&recpt);
126 recpt.add_action (&aauthenaction);
127
128 delhistoryaction adelhistoryaction;
129 recpt.add_action(&adelhistoryaction);
130
131 collectoraction acollectoraction;
132 acollectoraction.set_receptionist (&recpt);
133 recpt.add_action(&acollectoraction);
134
135// cout << "GRB 3" << endl;
136
137 // list of browsers
138 vlistbrowserclass avlistbrowserclass;
139 recpt.add_browser (&avlistbrowserclass);
140 recpt.setdefaultbrowser ("VList");
141
142 hlistbrowserclass ahlistbrowserclass;
143 recpt.add_browser (&ahlistbrowserclass);
144
145 datelistbrowserclass adatelistbrowserclass;
146 recpt.add_browser (&adatelistbrowserclass);
147
148 invbrowserclass ainvbrowserclass;
149 recpt.add_browser (&ainvbrowserclass);
150
151 pagedbrowserclass apagedbrowserclass;
152 recpt.add_browser (&apagedbrowserclass);
153
154 htmlbrowserclass ahtmlbrowserclass;
155 recpt.add_browser (&ahtmlbrowserclass);
156
157 cgiwrapper (recpt, "");
158
159 for (int i=1; i< argc; i++)
160 {
161 delete cproto_array[i];
162 }
163
164 return 0;
165}
166
Note: See TracBrowser for help on using the repository browser.