Changeset 1964

Show
Ignore:
Timestamp:
13.02.2001 15:49:48 (19 years ago)
Author:
nzdl
Message:

*** empty log message ***

Location:
trunk/cstr
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • trunk/cstr/etc/collect.cfg

    r1066 r1964  
    77defaultindex  document:text 
    88 
    9 macrofiles    style.dm base.dm query.dm help.dm \ 
    10               pref.dm about.dm document.dm \ 
    11               english.dm chinese.dm maori.dm \ 
    12               cstr.dm 
     9macrofiles      style.dm base.dm query.dm help.dm pref.dm \ 
     10                about.dm document.dm status.dm authen.dm \ 
     11                users.dm html.dm extlink.dm \ 
     12                english.dm chinese.dm french.dm german.dm maori.dm \ 
     13                english2.dm french2.dm arabic.dm spanish.dm dutch.dm \ 
     14        port.dm collect.dm cstr.dm 
     15 
    1316 
    1417plugin        GMLPlug 
     
    3841collectionmeta .document:text "documents" 
    3942 
    40 receptionist   /fast-cgi-bin/cstrlibrary?a=p&p=about 
     43receptionist   /cgi-bin/cstrlibrary?a=p&p=about 
    4144 
    4245 
  • trunk/cstr/macros/cstr.dm

    r1489 r1964  
    11package Global 
    22 
    3 _httppagehome_ [c=cstr] {/fast-cgi-bin/library?a=p&p=home} 
     3_httppagehome_ [c=cstr] {/cgi-bin/library?a=p&p=home} 
    44 
    55package document 
  • trunk/cstr/src/recpt/cstrlibrarymain.cpp

    r1065 r1964  
    2222 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 
    2323 * 
    24  * $Id$ 
    2524 * 
    2625 *********************************************************************/ 
    2726 
    28 /* 
    29    $Log$ 
    30    Revision 1.4  2000/04/04 04:43:07  nzdl 
    31    caught cstr collection up with DocumentColumn stuff 
    32  
    33    Revision 1.3  2000/02/21 21:45:08  sjboddie 
    34    gsdlhome now set from gsdlsite.cfg 
    35  
    36    Revision 1.2  2000/02/06 21:25:22  sjboddie 
    37    updated cstr 
    38  
    39    Revision 1.1  1999/09/07 21:49:43  sjboddie 
    40    new cstr receptionist 
    41  
    42  */ 
    43  
    4427#include "receptionist.h" 
     28#include "collectset.h" 
    4529#include "cgiwrapper.h" 
    4630#include "nullproto.h" 
    47 #include "collectserver.h" 
    48 #include "filter.h" 
    49 #include "browsefilter.h" 
    50 #include "queryfilter.h" 
    51 #include "infodbclass.h" 
    52 #include "mgsearch.h" 
    53 #include "mggdbmsource.h" 
    5431#include "fileutil.h" 
    5532#include <assert.h> 
     
    6340#include "authenaction.h" 
    6441#include "usersaction.h" 
    65 #include "authenaction.h" 
    6642 
    6743#include "browserclass.h" 
     
    7854  receptionist recpt; 
    7955  nullproto nproto; 
    80    
    81   // add a collection server 
    82   text_tarray collections; 
    83   collections.push_back ("cstr"); 
    8456 
     57  text_t gsdlhome, httpdomain, httpprefix; 
    8558  // get gsdlhome (if we fail the error will be picked up later -- in 
    8659  // cgiwrapper) 
    87   text_t gsdlhome; 
    88   site_cfg_read (gsdlhome); 
     60  site_cfg_read (gsdlhome, httpdomain, httpprefix); 
     61  collectset *cservers = new collectset(); 
     62  cservers->add_collection ("cstr", &recpt, gsdlhome, gsdlhome); 
    8963 
    90   text_tarray::const_iterator thiscol = collections.begin(); 
    91   text_tarray::const_iterator endcol = collections.end(); 
     64  nproto.set_collectset(cservers); 
    9265 
    93   while (thiscol != endcol) { 
    94  
    95     // this memory is created but never destroyed 
    96     // we're also not doing any error checking to make sure we didn't 
    97     // run out of memory 
    98     collectserver *cserver = new collectserver(); 
    99     gdbmclass *gdbmhandler = new gdbmclass(); 
    100     mgsearchclass *mgsearch = new mgsearchclass(); 
    101      
    102     // add a null filter 
    103     filterclass *filter = new filterclass (); 
    104     cserver->add_filter (filter); 
    105      
    106     // add a browse filter 
    107     browsefilterclass *browsefilter = new browsefilterclass(); 
    108     browsefilter->set_gdbmptr (gdbmhandler); 
    109     cserver->add_filter (browsefilter); 
    110      
    111     // add a query filter 
    112     queryfilterclass *queryfilter = new queryfilterclass(); 
    113     queryfilter->set_gdbmptr (gdbmhandler); 
    114     queryfilter->set_mgsearchptr (mgsearch); 
    115     cserver->add_filter (queryfilter); 
    116  
    117     // add a mg and gdbm source 
    118     mggdbmsourceclass *mggdbmsource = new mggdbmsourceclass (); 
    119     mggdbmsource->set_gdbmptr (gdbmhandler); 
    120     mggdbmsource->set_mgsearchptr (mgsearch); 
    121     cserver->add_source (mggdbmsource); 
    122      
    123     // inform collection server and everything it contains about its 
    124     // collection name 
    125     cserver->configure ("collection", *thiscol); 
    126      
    127     nproto.add_collectserver (cserver); 
    128     thiscol ++; 
    129   } 
     66  // configure the receptionist server list 
     67  cservers->setReceptionistServers(recpt, gsdlhome);   
    13068   
    13169  // add the protocol to the receptionist 
    13270  recpt.add_protocol (&nproto); 
    133  
    134   // add other converters 
    135   utf8inconvertclass utf8inconvert; 
    136   utf8outconvertclass utf8outconvert; 
    137   recpt.add_converter ("u", &utf8inconvert, &utf8outconvert); 
    138  
    139   if (!gsdlhome.empty()) { 
    140     mapinconvertclass gbinconvert; 
    141     gbinconvert.setmapfile (gsdlhome, "gbku", 0x25a1); 
    142     mapoutconvertclass gboutconvert; 
    143     gboutconvert.setmapfile (gsdlhome, "ugbk", 0xa1f5); 
    144     recpt.add_converter ("g", &gbinconvert, &gboutconvert); 
    145   } 
    14671 
    14772  // the list of actions. Note: these actions will become invalid 
     
    15277 
    15378  pageaction apageaction; 
     79  apageaction.set_receptionist (&recpt); 
    15480  recpt.add_action (&apageaction); 
    15581 
     
    15884 
    15985  queryaction aqueryaction; 
     86  aqueryaction.set_receptionist (&recpt); 
    16087  recpt.add_action (&aqueryaction); 
    16188 
    16289  cstrdocaction adocumentaction; 
     90  adocumentaction.set_receptionist (&recpt); 
    16391  recpt.add_action (&adocumentaction); 
    16492 
     
    193121  return 0; 
    194122} 
    195  
    196  
    197  
    198