Ignore:
Timestamp:
2000-07-06T09:49:36+12:00 (24 years ago)
Author:
sjboddie
Message:

Receptionist now caches collection information to avoid making multiple
get_collectinfo calls to collection server

File:
1 edited

Legend:

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

    r1148 r1270  
    2828/*
    2929   $Log$
     30   Revision 1.39  2000/07/05 21:49:31  sjboddie
     31   Receptionist now caches collection information to avoid making multiple
     32   get_collectinfo calls to collection server
     33
    3034   Revision 1.38  2000/05/04 05:18:46  sjboddie
    3135   attempting to get end-user collection building to work under windows
     
    183187
    184188documentaction::documentaction () {
     189  recpt = NULL;
     190
    185191
    186192  // this action uses cgi variables "a", "d", "cl",
     
    500506  if (collectproto == NULL) return;
    501507 
     508  if (recpt == NULL) {
     509    logout << "ERROR (documentaction::define_external_macros): This action does not contain\n"
     510       << "      information about any receptionists. The method set_receptionist was\n"
     511       << "      probably not called from the module which instantiated this action.\n";
     512    return;
     513  }
     514
    502515  outconvertclass text_t2ascii;
    503516  comerror_t err;
     
    506519  text_tset metadata;
    507520
    508 
    509   // get info on current collection and load up formatinfo
    510   // I'd prefer not to do this here as we're getting
    511   // collection info every time (and probably also getting
    512   // it in other places some of the time) - One day I'll
    513   // fix it ... maybe - Stefan.
    514   ColInfoResponse_t cinfo;
    515   collectproto->get_collectinfo (collection, cinfo, err, logout);
    516   load_formatinfo (cinfo.format, args.getintarg("gt"));
     521  ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr (collectproto, collection, logout);
     522  if (cinfo == NULL) {
     523    logout << "ERROR (documentaction::define_external_macros): get_collectinfo_ptr returned NULL\n";
     524    return;
     525  }
     526  load_formatinfo (cinfo->format, args.getintarg("gt"));
    517527
    518528  if (formatinfo.DocumentUseHTML) {
     
    526536      disp.setmacro ("gsdltop", "Global", "documenttop");
    527537    }
    528     text_tmap::iterator it = cinfo.format.find ("homepage");
    529     if (it != cinfo.format.end()) {
     538    text_tmap::iterator it = cinfo->format.find ("homepage");
     539    if (it != cinfo->format.end()) {
    530540      text_t httppagehome;
    531541      if (get_link (args, protos, (*it).second, httppagehome, logout))
     
    11011111  textout << outconvert << disp << buffer;
    11021112}
    1103 
    1104 
    1105 
    1106 
    1107 
    1108 
    1109 
    1110 
    1111 
    1112 
    1113 
Note: See TracChangeset for help on using the changeset viewer.