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/queryaction.cpp

    r962 r1270  
    2828/*
    2929   $Log$
     30   Revision 1.37  2000/07/05 21:49:34  sjboddie
     31   Receptionist now caches collection information to avoid making multiple
     32   get_collectinfo calls to collection server
     33
    3034   Revision 1.36  2000/02/21 21:57:48  sjboddie
    3135   actions are now configured with gsdlhome
     
    177181queryaction::queryaction () {
    178182
     183  recpt = NULL;
    179184  num_phrases = 0;
    180185
     
    695700                  ostream &textout, ostream &logout) {
    696701
    697   ColInfoResponse_t cinfo;
     702  ColInfoResponse_t *cinfo = NULL;
    698703  comerror_t err;
    699704  InfoFilterOptionsResponse_t fresponse;
     
    737742    while (collist_here != collist_end) {
    738743     
    739       (*rprotolist_here).p->get_collectinfo (*collist_here, cinfo, err, logout);
     744      cinfo = recpt->get_collectinfo_ptr ((*rprotolist_here).p, *collist_here, logout);
    740745      //      if (err == noError && cinfo.isPublic && (cinfo.buildDate > 0)) {
    741       if (err == noError && (cinfo.buildDate > 0)) {
     746      if (cinfo != NULL && (cinfo->buildDate > 0)) {
    742747       
    743748        (*rprotolist_here).p->get_filteroptions (*collist_here, frequest, fresponse, err, logout);
     
    789794              << " name=cc value=\"" << *collist_here << "\">";
    790795         
    791           if (!cinfo.collectionmeta["collectionname"].empty())
    792         textout << outconvert << disp << cinfo.collectionmeta["collectionname"];
     796          if (!cinfo->collectionmeta["collectionname"].empty())
     797        textout << outconvert << disp << cinfo->collectionmeta["collectionname"];
    793798          else
    794799        textout << outconvert << *collist_here;
     
    816821                 ostream &logout) {
    817822 
     823  if (recpt == NULL) {
     824    logout << "ERROR (queryaction::do_action): This action does not contain information\n"
     825       << "      about any receptionists. The method set_receptionist was probably\n"
     826       << "      not called from the module which instantiated this action.\n";
     827    return true;
     828  }
     829
     830
    818831  if (args["ccs"] == "1") {
    819832    if (!args["cc"].empty()) {
     
    866879  map<text_t, colinfo_t, lttext_t> colinfomap;
    867880
    868   ColInfoResponse_t cinfo;
     881  ColInfoResponse_t *cinfo = NULL;
    869882  comerror_t err;
    870883  FilterRequest_t request;
     
    906919      continue;
    907920    }
    908     collectproto->get_collectinfo (*col_here, cinfo, err, logout);
     921    cinfo = recpt->get_collectinfo_ptr (collectproto, *col_here, logout);
     922    if (cinfo == NULL) {
     923      logout << "ERROR (query_action::search_multiple_collections): get_collectinfo_ptr returned NULL\n";
     924      col_here ++;
     925      continue;
     926    }
    909927   
    910928    browserclass *bptr = browsers->getbrowser (browsertype);
     
    913931    text_t formatstring;
    914932    if (!get_formatstring (classification, browsertype,
    915                cinfo.format, formatstring))
     933               cinfo->format, formatstring))
    916934      formatstring = bptr->get_default_formatstring();
    917935
     
    10691087  text_t classification = "Search";
    10701088
    1071   ColInfoResponse_t cinfo;
    10721089  comerror_t err;
    1073   collectproto->get_collectinfo (collection, cinfo, err, logout);
     1090  ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr (collectproto, collection, logout);
     1091
     1092  if (cinfo == NULL) {
     1093    logout << "ERROR (query_action::search_single_collection): get_collectinfo_ptr returned NULL\n";
     1094    return false;
     1095  }
    10741096   
    10751097  browserclass *bptr = browsers->getbrowser (browsertype);
     
    10781100  text_t formatstring;
    10791101  if (!get_formatstring (classification, browsertype,
    1080              cinfo.format, formatstring))
     1102             cinfo->format, formatstring))
    10811103    formatstring = bptr->get_default_formatstring();
    10821104
Note: See TracChangeset for help on using the changeset viewer.