/********************************************************************** * * librarymain.cpp -- * Copyright (C) 1999 The New Zaland Digital Library Project * * A component of the Greenstone digital library software * from the New Zealand Digital Library Project at the * University of Waikato, New Zealand. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * *********************************************************************/ #include "receptionist.h" #include "cgiwrapper.h" #include "fileutil.h" #include "nullproto.h" // z39.50 stuff - johnmcp #if defined(USE_Z3950) #include "z3950proto.h" #endif #include "collectserver.h" #include "filter.h" #include "browsefilter.h" #include "mgqueryfilter.h" #include "mgppqueryfilter.h" #include "infodbclass.h" #include "mggdbmsource.h" #include "mgsearch.h" #include "mgppsearch.h" #include "collectset.h" #include #include "action.h" #include "statusaction.h" #include "pageaction.h" #include "pingaction.h" #include "queryaction.h" #include "documentaction.h" #include "authenaction.h" #include "usersaction.h" #include "extlinkaction.h" #include "tipaction.h" #include "collectoraction.h" #include "browseaction.h" #include "phindaction.h" #if defined(USE_LANGACTION) #include "langaction.h" #endif #include "browserclass.h" #include "vlistbrowserclass.h" #include "hlistbrowserclass.h" #include "datelistbrowserclass.h" #include "invbrowserclass.h" #include "pagedbrowserclass.h" #include "htmlbrowserclass.h" #include "phindbrowserclass.h" int main () { receptionist recpt; nullproto nproto; collectset *cservers; #if defined(USE_Z3950) z3950proto zproto; #endif text_t gsdlhome; cservers = new collectset(gsdlhome); // set up the null protocol nproto.set_collectset(cservers); // configure the receptionist server list cservers->setReceptionistServers(recpt, gsdlhome); // add the protocol to the receptionist recpt.add_protocol (&nproto); // z39.50 stuff - johnmcp #if defined(USE_Z3950) // add the z39.50 server information. Read in the file // etc/recpt/z3950.cfg for list of servers and their databases. text_t z3950cfg = filename_cat (gsdlhome, "etc"); // z3950cfg = filename_cat (z3950cfg, "recpt"); z3950cfg = filename_cat (z3950cfg, "packages"); z3950cfg = filename_cat (z3950cfg, "z3950.cfg"); #ifdef USE_FASTCGI // currently can't use z39.50 if fastcgi used #warning "Disabling z39.50 support as fastcgi is in use" if (0) { #else if (file_exists(z3950cfg)) { #endif text_t z3950err = filename_cat (gsdlhome, "etc", "z3950log.txt"); zproto.read_config_file(z3950cfg,z3950err); // only add this protocol if we have any servers configured. if (zproto.getServerCount()>0) recpt.add_protocol (&zproto); } #endif // the list of actions. Note: these actions will become invalid // at the end of this function. tipaction atipaction; recpt.add_action (&atipaction); statusaction astatusaction; astatusaction.set_receptionist (&recpt); recpt.add_action (&astatusaction); pageaction apageaction; apageaction.set_receptionist (&recpt); recpt.add_action (&apageaction); pingaction apingaction; recpt.add_action (&apingaction); queryaction aqueryaction; aqueryaction.set_receptionist (&recpt); recpt.add_action (&aqueryaction); documentaction adocumentaction; adocumentaction.set_receptionist (&recpt); recpt.add_action (&adocumentaction); usersaction ausersaction; recpt.add_action (&ausersaction); extlinkaction anextlinkaction; recpt.add_action (&anextlinkaction); authenaction aauthenaction; aauthenaction.set_receptionist(&recpt); recpt.add_action (&aauthenaction); collectoraction acollectoraction; acollectoraction.set_receptionist (&recpt); recpt.add_action(&acollectoraction); browseaction abrowseaction; abrowseaction.set_receptionist (&recpt); recpt.add_action(&abrowseaction); phindaction aphindaction; recpt.add_action(&aphindaction); #if defined(USE_LANGACTION) langaction alangaction; alangaction.set_receptionist(&recpt); recpt.add_action(&alangaction); #endif // list of browsers vlistbrowserclass avlistbrowserclass; recpt.add_browser (&avlistbrowserclass); recpt.setdefaultbrowser ("VList"); hlistbrowserclass ahlistbrowserclass; recpt.add_browser (&ahlistbrowserclass); datelistbrowserclass adatelistbrowserclass; recpt.add_browser (&adatelistbrowserclass); invbrowserclass ainvbrowserclass; recpt.add_browser (&ainvbrowserclass); pagedbrowserclass apagedbrowserclass; recpt.add_browser (&apagedbrowserclass); htmlbrowserclass ahtmlbrowserclass; recpt.add_browser (&ahtmlbrowserclass); phindbrowserclass aphindbrowserclass; recpt.add_browser (&aphindbrowserclass); cgiwrapper (recpt, ""); delete cservers; return 0; }