Ignore:
Timestamp:
2000-07-13T10:21:53+12:00 (24 years ago)
Author:
sjboddie
Message:

merged changes to trunk into New_Config_Format branch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/New_Config_Format-branch/gsdl/src/recpt/librarymain.cpp

    r994 r1279  
    2828/*
    2929   $Log$
     30   Revision 1.24.4.1  2000/07/12 22:21:41  sjboddie
     31   merged changes to trunk into New_Config_Format branch
     32
     33   Revision 1.28  2000/07/05 21:49:32  sjboddie
     34   Receptionist now caches collection information to avoid making multiple
     35   get_collectinfo calls to collection server
     36
     37   Revision 1.27  2000/06/23 03:21:39  sjboddie
     38   Created converter classes for simple 8 bit encodings that use a
     39   simple textual map file. Instances of these classes are used to handle
     40   the Windows 1256 (Arabic) encoding.
     41
     42   Revision 1.26  2000/05/29 03:30:03  sjboddie
     43   fixed a bug preventing GB encoded text from being displayed correctly
     44   (bug showed up in Chinese collection)
     45
     46   Revision 1.25  2000/04/14 02:52:05  sjboddie
     47   tidied up error messaging and set up some debugging info to be output
     48   when running library from command line
     49
    3050   Revision 1.24  2000/02/29 20:59:02  sjboddie
    3151   added error message when unable to read from collect directory - should
     
    132152#include "authenaction.h"
    133153#include "usersaction.h"
    134 #include "authenaction.h"
    135154#include "extlinkaction.h"
    136155#include "buildaction.h"
     
    152171  text_tarray collections;
    153172
    154   // get gsdlhome (if we fail the error will be picked up later -- in
    155   // cgiwrapper)
     173  // get gsdlhome
    156174  text_t gsdlhome;
    157   if (site_cfg_read (gsdlhome)) {
    158     text_t collectdir = filename_cat (gsdlhome, "collect");
    159     if (!read_dir (collectdir, collections)) {
    160       cerr << "couldn't read collect directory - make sure gsdlhome field is correct in gsdlsite.cfg\n";
    161       exit (1);
    162     }
    163   }
     175  site_cfg_read (gsdlhome);
     176  text_t collectdir = filename_cat (gsdlhome, "collect");
     177  read_dir (collectdir, collections);
    164178
    165179  text_tarray::const_iterator thiscol = collections.begin();
     
    202216    // collection name
    203217    cserver->configure ("collection", *thiscol);
    204    
     218 
     219    // configure receptionist's collectinfo structure
     220    text_tarray colinfo;
     221    colinfo.push_back (*thiscol);
     222    colinfo.push_back (gsdlhome);
     223    colinfo.push_back (gsdlhome);
     224    recpt.configure ("collectinfo", colinfo);
     225 
    205226    nproto.add_collectserver (cserver);
    206227    thiscol ++;
     
    215236  recpt.add_converter ("u", &utf8inconvert, &utf8outconvert);
    216237
    217   if (!gsdlhome.empty()) {
    218     mapinconvertclass gbinconvert;
    219     gbinconvert.setmapfile (gsdlhome, "gbku", 0x25a1);
    220     mapoutconvertclass gboutconvert;
    221     gboutconvert.setmapfile (gsdlhome, "ugbk", 0xa1f5);
    222     recpt.add_converter ("g", &gbinconvert, &gboutconvert);
    223   }
     238  mapinconvertclass gbinconvert;
     239  gbinconvert.setmapfile (gsdlhome, "gbku", 0x25a1);
     240  mapoutconvertclass gboutconvert;
     241  gboutconvert.setmapfile (gsdlhome, "ugbk", 0xa1f5);
     242  recpt.add_converter ("g", &gbinconvert, &gboutconvert);
     243
     244  text_t armapfile = filename_cat (gsdlhome, "unicode", "MAPPINGS");
     245  armapfile = filename_cat (armapfile, "WINDOWS", "1256.TXT");
     246  simplemapinconvertclass arinconvert;
     247  arinconvert.setmapfile (armapfile);
     248  simplemapoutconvertclass aroutconvert;
     249  aroutconvert.setmapfile (armapfile);
     250  recpt.add_converter ("a", &arinconvert, &aroutconvert); 
     251
    224252
    225253  // the list of actions. Note: these actions will become invalid
     
    230258
    231259  pageaction apageaction;
     260  apageaction.set_receptionist (&recpt);
    232261  recpt.add_action (&apageaction);
    233262
     
    236265
    237266  queryaction aqueryaction;
     267  aqueryaction.set_receptionist (&recpt);
    238268  recpt.add_action (&aqueryaction);
    239269
    240270  documentaction adocumentaction;
     271  adocumentaction.set_receptionist (&recpt);
    241272  recpt.add_action (&adocumentaction);
    242273
Note: See TracChangeset for help on using the changeset viewer.