Changeset 1510 for branches


Ignore:
Timestamp:
2000-09-07T09:51:08+12:00 (24 years ago)
Author:
davidb
Message:

Improvements to corba implementation so images within a collection
are handled better and images in the remote site that are missing
locally are cached.

Location:
branches/corba/gsdl/src/colservr
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/corba/gsdl/src/colservr/collectserver.cpp

    r830 r1510  
    2929/*
    3030   $Log$
     31   Revision 1.20.2.1  2000/09/06 21:51:06  davidb
     32
     33   Improvements to corba implementation so images within a collection
     34   are handled better and images in the remote site that are missing
     35   locally are cached.
     36
    3137   Revision 1.20  1999/12/13 02:56:22  davidb
    3238   Support for cross-collection searching (CCS)
     
    144150    else if (key == "building" && cfgline.size() == 2)
    145151      collectinfo.building[cfgline[0]] = cfgline[1];
     152    else if (key == "httpdomain") collectinfo.httpdomain = value;
     153    else if (key == "httpprefix") collectinfo.httpprefix = value;
    146154    else if (key == "receptionist") collectinfo.receptionist = value;
    147155  }
     
    204212
    205213
    206 void collectserver::get_collectinfo (ColInfoResponse_t &reponse,
     214void collectserver::get_collectinfo (ColInfoResponse_t &response,
    207215              comerror_t &err, ostream &/*logout*/) {
    208   reponse = collectinfo;
     216  response = collectinfo;
    209217  err = noError;
    210218}
  • branches/corba/gsdl/src/colservr/collectset.cpp

    r1068 r1510  
    4848  // get gsdlhome (if we fail the error will be picked up later -- in
    4949  // cgiwrapper)
    50   if (site_cfg_read (gsdlhome)) {
     50  if (site_cfg_read (gsdlhome,httpdomain,httpprefix)) {
    5151    text_t collectdir = filename_cat (gsdlhome, "collect");
    5252    if (!read_dir (collectdir, collections)) {
     
    5555    }
    5656  }
    57    
     57
    5858  text_tarray::const_iterator thiscol = collections.begin();
    5959  text_tarray::const_iterator endcol = collections.end();
     
    124124      // are available to decode defaultindex, defaultsubcollection, and
    125125      // defaultlanguage
     126
    126127      if (!build_cfg_read (*((*here).second.c), configinfo.gsdlhome,
    127128               configinfo.collection)) {
    128129    outconvertclass text_t2ascii;
    129130    logout << text_t2ascii
    130            << "Warning: couldn't read build.cfg file for collection \"" //****
     131           << "Warning: couldn't read build.cfg file for collection \""
    131132           << configinfo.collection << "\", gsdlhome=\""
    132133           << configinfo.gsdlhome << "\"\n";
    133     //  return false; //****
    134134    here ++;
    135135    continue;
     
    143143           << configinfo.collection << "\", gsdlhome=\""
    144144           << configinfo.gsdlhome << "\"\n";
    145     //  return false; //****
    146145    here ++;
    147146    continue;
     
    149148
    150149      if (!(*here).second.c->init (logout)) return false;
     150
     151      (*here).second.c->configure("httpdomain",httpdomain);
     152      (*here).second.c->configure("httpprefix",httpprefix);
    151153    }
    152154    here++;
     
    176178    }
    177179      } else {
     180    // cout << "*** Passing on key = " << key << " = " << cfgline[0] << endl; // ****
    178181    (*here).second.c->configure (key, cfgline);
    179182      }
  • branches/corba/gsdl/src/colservr/collectset.h

    r1068 r1510  
    1616  collectservermapclass cservers;
    1717  int                   noofservers;
     18  text_t                httpdomain;
     19  text_t                httpprefix;
     20
    1821 public:
    1922  collectset(text_t &gsdlhome);
  • branches/corba/gsdl/src/colservr/colservrconfig.cpp

    r1067 r1510  
    2828/*
    2929   $Log$
     30   Revision 1.2.2.2  2000/09/06 21:51:07  davidb
     31
     32   Improvements to corba implementation so images within a collection
     33   are handled better and images in the remote site that are missing
     34   locally are cached.
     35
    3036   Revision 1.2.2.1  2000/04/04 15:02:31  cs025
    3137   Corba first commit
     
    6066bool collect_cfg_read (collectserver &cserver, const text_t &gsdlhome,
    6167               const text_t &collection) {
     68
    6269  text_t filename = filename_cat (gsdlhome, "collect");
    6370  filename = filename_cat (filename, collection);
     
    100107bool build_cfg_read (collectserver &cserver, const text_t &gsdlhome,
    101108             const text_t &collection) {
     109
    102110  text_t filename = filename_cat (gsdlhome, "collect");
    103111  filename = filename_cat (filename, collection);
  • branches/corba/gsdl/src/colservr/corbaServer.mpp

    r1087 r1510  
    8686    text_t dirname;
    8787    char * cdirname;
     88
     89    cout << "CorbaServer: gsdlhome = " << home << endl;
     90
    8891    this->gsdlhome = home;
    8992    cout << gsdlhome.getcstr() << endl;
     
    97100  }
    98101
    99   CORBA::Boolean init()
     102  CORBA::Boolean initialise()
    100103  {
    101104      ofstream    logout;
     
    116119      corbatext_corbaArrayToArray(corbaCfgline, &cfgline);
    117120
    118       protocol->configure(key, cfgline);
     121      // ****
     122      cout << "Recieved " << key << " = ";
     123      for (int i=0; i<cfgline.size(); i++)
     124    {
     125      cout << cfgline[i] << " ";
     126    }
     127      cout << endl;
     128
     129      // DB // ****
     130      if (key=="gsdlhome")
     131    { 
     132      text_tarray cfgline;
     133      cfgline.push_back (gsdlhome);
     134      cout << "Changing gsdlhome to " << gsdlhome << endl;
     135      protocol->configure(key,cfgline);
     136    }
     137      else if (key=="httpdomain")
     138    {
     139      // Only let gsdlhome through !!!! // ****
     140      cout << "Supressing httpdomain" << endl;
     141    }
     142      else if (key=="httpprefix")
     143    {
     144      cout << "Supressing httpprefix" << endl;
     145    }
     146      else
     147    {
     148      protocol->configure(key, cfgline);
     149    }
    119150    }
    120151
     
    131162    cct = new corbaconv_text_t(corbaCollect);
    132163
    133     cout << "Collection: " << cct->getcstr() << endl;
     164    // cout << "Collection: " << cct->getcstr() << endl; // ****
    134165
    135166    protocol->has_collection(*cct, _has, err, logout); // 'cct' typecast to text_t
     
    143174      }
    144175
    145     cout << "  " << has << endl;
     176    // cout << "  " << has << endl; // ****
    146177
    147178    delete cct;
     
    224255    protocol->get_collectinfo(collection, response, error, logout);
    225256
     257    cout << "IsPublic  = " << ((response.isPublic)?"True":"False") << endl;
     258    cout << "IsBeta    = " << ((response.isBeta)  ?"True":"False") << endl;
     259    cout << "BuildDate = " << response.buildDate << endl;
     260    cout << "NumDocs   = " << response.numDocs << endl;
     261    cout << "NumBytes  = " << response.numBytes << endl;
     262    cout << "NumWords  = " << response.numWords << endl;
     263
    226264    corbaResponse.isPublic = response.isPublic;
    227265    corbaResponse.isBeta   = response.isBeta;
     
    236274    corbatext_mapToCorbaMap(response.format, &corbaResponse.format);
    237275    corbatext_mapToCorbaMap(response.building, &corbaResponse.building);
     276    corbaconv_text_t::getCorbatext(response.httpdomain,corbaResponse.httpdomain);
     277
     278    corbaconv_text_t::getCorbatext(response.httpprefix,corbaResponse.httpprefix);
    238279    corbaconv_text_t::getCorbatext(response.receptionist,corbaResponse.receptionist);
     280
     281    /* text_tmap::iterator f_here = response.format.begin();
     282    text_tmap::iterator f_end = response.format.end();
     283    while (f_here!=f_end)
     284    {
     285      cout << "**** format: " << f_here->first << " = " << f_here->second << endl;
     286      f_here++;
     287    }
     288    */ // ****
    239289
    240290    logout.close();
     
    349399
    350400    protocol->get_collection_list(collist, err, logout);
     401
     402
    351403
    352404    /*    reply = new stringSeq(collections.size());
     
    363415    */
    364416
    365     //    cout << "Replying " << collist.size() << endl;
    366 
    367417    corbatext_arrayToCorbaArray(collist, &corbalist);
    368     cout << "Replying " << collist.size() << endl;
     418    cout << "Replying " << collist.size() << ": " << endl;
     419
     420    for (int i = 0; i < collist.size(); i ++)
     421      {
     422    cout << collist[i];
     423    if (i<collist.size()-1) cout << ", ";
     424      }
     425    cout << endl;
     426
    369427
    370428    logout.close();
Note: See TracChangeset for help on using the changeset viewer.