Ignore:
Timestamp:
2004-05-25T16:31:41+12:00 (20 years ago)
Author:
mdewsnip
Message:

(Human Info) Added language parameter to all calls of get_info, get_children, has_children, and get_contents. Also, removed some of the modifications so it compiles again.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/librarymain.cpp

    r4122 r7432  
    2424 *********************************************************************/
    2525
     26#include "gsdl_modules_cfg.h"
    2627#include "receptionist.h"
    2728#include "cgiwrapper.h"
     29#include "recptconfig.h"
    2830#include "fileutil.h"
    2931#include "nullproto.h"
     
    5355#include "usersaction.h"
    5456#include "extlinkaction.h"
     57
     58#ifdef GSDL_USE_EXPORT_ACTION
     59#include "exportaction.h"
     60#endif
     61
     62#ifdef GSDL_USE_CL_DISPLAY_ACTION
     63#include "cldisplayaction.h"
     64#endif
     65
     66#ifdef GSDL_USE_COURSES_ACTION
     67#include "coursesaction.h"
     68#endif
     69
     70#ifdef GSDL_USE_COMPOSITION_ACTION
     71#include "compositionaction.h"
     72#endif
     73
     74#ifdef GSDL_USE_INDEX_BROWSE_ACTION
     75#include "indexbrowseaction.h"
     76#endif
     77
     78#ifdef GSDL_USE_DIR_BROWSE_ACTION
     79#include "dirbrowseaction.h"
     80#endif
     81
     82#ifdef GSDL_USE_GENERATOR_ACTION
     83#include "generatoraction.h"
     84#endif
     85
    5586#include "tipaction.h"
    5687#include "collectoraction.h"
    5788#include "browseaction.h"
    5889#include "phindaction.h"
    59 #if defined(USE_LANGACTION)
     90#if defined(GSDL_USE_LANG_ACTION)
    6091#include "langaction.h"
    6192#endif
     
    69100#include "htmlbrowserclass.h"
    70101#include "phindbrowserclass.h"
     102
     103#ifdef GSDL_USE_CLASSIFIER_BROWSER
     104//classifier browsers
     105
     106#include "treeclassifierbrowserclass.h"
     107#ifdef GSDL_USE_TREE_EX_CLASSIFIER_BROWSER
     108#include "treeexclassifierbrowserclass.h"
     109#endif
     110
     111#endif //GSDL_USE_CLASSIFIER_BROWSER
    71112
    72113int main () {
     
    113154#endif
    114155
     156#ifdef GSDL_USE_TIP_ACTION
    115157  // the list of actions. Note: these actions will become invalid
    116   // at the end of this function.
    117   tipaction atipaction;
    118   recpt.add_action (&atipaction);
    119 
    120   statusaction astatusaction;
    121   astatusaction.set_receptionist (&recpt);
    122   recpt.add_action (&astatusaction);
    123 
    124   pageaction apageaction;
    125   apageaction.set_receptionist (&recpt);
    126   recpt.add_action (&apageaction);
    127 
    128   pingaction apingaction;
    129   recpt.add_action (&apingaction);
    130 
    131   queryaction aqueryaction;
    132   aqueryaction.set_receptionist (&recpt);
    133   recpt.add_action (&aqueryaction);
    134 
    135   documentaction adocumentaction;
    136   adocumentaction.set_receptionist (&recpt);
    137   recpt.add_action (&adocumentaction);
    138 
    139   usersaction ausersaction;
    140   recpt.add_action (&ausersaction);
    141 
    142   extlinkaction anextlinkaction;
    143   recpt.add_action (&anextlinkaction);
    144 
    145   authenaction aauthenaction;
    146   aauthenaction.set_receptionist(&recpt);
    147   recpt.add_action (&aauthenaction);
    148 
    149   collectoraction acollectoraction;
    150   acollectoraction.set_receptionist (&recpt);
    151   recpt.add_action(&acollectoraction);
    152 
    153   browseaction abrowseaction;
    154   abrowseaction.set_receptionist (&recpt);
    155   recpt.add_action(&abrowseaction);
    156 
    157   phindaction aphindaction;
    158   recpt.add_action(&aphindaction);
    159 
    160 #if defined(USE_LANGACTION)
    161   langaction alangaction;
    162   alangaction.set_receptionist(&recpt);
    163   recpt.add_action(&alangaction);
     158  // at the end of this function. We will clean them.
     159  recpt.add_action (new tipaction());
     160#endif
     161
     162#ifdef GSDL_USE_STATUS_ACTION
     163  statusaction *astatusaction = new statusaction();
     164  astatusaction->set_receptionist (&recpt);
     165  recpt.add_action (astatusaction);
     166#endif
     167
     168  pageaction *apageaction = new pageaction();
     169  apageaction->set_receptionist (&recpt);
     170  recpt.add_action (apageaction);
     171
     172#ifdef GSDL_USE_PING_ACTION
     173  recpt.add_action (new pingaction());
     174#endif
     175
     176  queryaction *aqueryaction = new queryaction();
     177  aqueryaction->set_receptionist (&recpt);
     178  recpt.add_action (aqueryaction);
     179       
     180  documentaction *adocumentaction = new documentaction();
     181  adocumentaction->set_receptionist (&recpt);
     182  recpt.add_action (adocumentaction);
     183
     184#ifdef GSDL_USE_USERS_ACTION
     185  recpt.add_action (new usersaction());
     186#endif
     187
     188#ifdef GSDL_USE_EXTLINK_ACTION
     189  recpt.add_action (new extlinkaction());
     190#endif
     191       
     192#ifdef GSDL_USE_AUTHEN_ACTION
     193  authenaction *aauthenaction = new authenaction();
     194  aauthenaction->set_receptionist(&recpt);
     195  recpt.add_action (aauthenaction);
     196#endif
     197
     198#ifdef GSDL_USE_COLLECTOR_ACTION
     199  collectoraction *acollectoraction = new collectoraction();
     200  acollectoraction->set_receptionist (&recpt);
     201  recpt.add_action(acollectoraction);
     202#endif
     203
     204#ifdef GSDL_USE_BROWSE_ACTION
     205  browseaction *abrowseaction = new browseaction();
     206  abrowseaction->set_receptionist (&recpt);
     207  recpt.add_action(abrowseaction);
     208#endif
     209
     210#ifdef GSDL_USE_PHIND_ACTION
     211  recpt.add_action(new phindaction());
     212#endif
     213
     214#ifdef GSDL_USE_LANG_ACTION
     215  langaction *alangaction = new langaction();
     216  alangaction->set_receptionist(&recpt);
     217  recpt.add_action(alangaction);
    164218#endif
    165219
    166220  // list of browsers
    167221  vlistbrowserclass avlistbrowserclass;
     222  avlistbrowserclass.set_receptionist(&recpt);
    168223  recpt.add_browser (&avlistbrowserclass);
    169224  recpt.setdefaultbrowser ("VList");
    170225
    171226  hlistbrowserclass ahlistbrowserclass;
     227  ahlistbrowserclass.set_receptionist(&recpt);
    172228  recpt.add_browser (&ahlistbrowserclass);
    173229
     230#ifdef GSDL_USE_DATELIST_BROWSER
    174231  datelistbrowserclass adatelistbrowserclass;
    175232  recpt.add_browser (&adatelistbrowserclass);
     233#endif
    176234
    177235  invbrowserclass ainvbrowserclass;
    178236  recpt.add_browser (&ainvbrowserclass);
    179237
     238#ifdef GSDL_USE_PAGED_BROWSER
    180239  pagedbrowserclass apagedbrowserclass;
    181240  recpt.add_browser (&apagedbrowserclass);
    182 
     241#endif
     242
     243#ifdef GSDL_USE_HTML_BROWSER
    183244  htmlbrowserclass ahtmlbrowserclass;
    184245  recpt.add_browser (&ahtmlbrowserclass);
    185 
     246#endif
     247
     248#ifdef GSDL_USE_PHIND_BROWSER
    186249  phindbrowserclass aphindbrowserclass;
    187250  recpt.add_browser (&aphindbrowserclass);
     251#endif
     252
     253#ifdef GSDL_USE_CLASSIFIER_BROWSER
     254  //list of classifier browsers
     255  CTreeClassifierBrowserClass *pTreeClassifierBrowser = new CTreeClassifierBrowserClass();
     256  if (pTreeClassifierBrowser != NULL) {
     257    recpt.GetClassifierBrowsers().AddBrowser(pTreeClassifierBrowser);
     258    recpt.GetClassifierBrowsers().SetDefaultBrowser(pTreeClassifierBrowser->GetBrowserName());
     259  }
     260#ifdef GSDL_USE_TREE_EX_CLASSIFIER_BROWSER
     261  CTreeExClassifierBrowserClass *pTreeExClassifierBrowser = new CTreeExClassifierBrowserClass();
     262  if (pTreeExClassifierBrowser != NULL) {
     263    recpt.GetClassifierBrowsers().AddBrowser(pTreeExClassifierBrowser);
     264  }
     265#endif //GSDL_USE_TREE_EX_CLASSIFIER_BROWSER
     266#endif //GSDL_USE_CLASSIFIER_BROWSER
    188267
    189268  cgiwrapper (recpt, "");
    190269  delete cservers;
     270
     271  // clean up the actions
     272  actionmapclass::iterator thisAction = recpt.get_actionmap_ptr()->begin();
     273  actionmapclass::iterator endAction = recpt.get_actionmap_ptr()->begin();
     274  while (thisAction != endAction) {
     275    delete thisAction->second.a; thisAction->second.a = NULL;
     276    ++thisAction;
     277  }
     278  thisAction = recpt.get_actionmap_ptr()->begin();
     279  recpt.get_actionmap_ptr()->erase(thisAction, endAction);
    191280  return 0;
    192281}
Note: See TracChangeset for help on using the changeset viewer.