Ignore:
Timestamp:
1999-11-02T10:56:32+13:00 (25 years ago)
Author:
sjboddie
Message:

changes to arguments of many functions

File:
1 edited

Legend:

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

    r731 r760  
    2828/*
    2929   $Log$
     30   Revision 1.38  1999/11/01 21:49:34  sjboddie
     31   changes to arguments of many functions
     32
    3033   Revision 1.37  1999/10/20 03:55:03  sjboddie
    3134   yet another problem with calling browserclass
     
    807810  action *a = actions.getaction (args["a"]);
    808811  if (a != NULL) {
    809     a->get_cgihead_info (args, response, response_data, logout);
     812    a->get_cgihead_info (args, &protocols, response, response_data, logout);
    810813
    811814  } else {
     
    845848  outconverter->reset();
    846849
    847   text_t &collection = args["c"];
    848   recptproto *collectproto = NULL;
    849   if (!collection.empty()) {
    850     // decide on the protocol used for communicating with
    851     // the collection server
    852     collectproto = protocols.getrecptproto (collection, logout);
    853 
    854     // get collection information
    855     collectinfo.clear();
    856     if (!collection.empty()) {
    857       comerror_t err;
    858       collectproto->get_collectinfo (collection, collectinfo, err, logout);
    859       if (err != noError) collectinfo.clear();
    860     }
    861 
     850  recptproto *collectproto = protocols.getrecptproto (args["c"], logout);
     851  if (collectproto != NULL) {
    862852    // get browsers to process OID
    863853    text_t OID = args["d"];
     
    882872      }
    883873    }
    884 
     874 
    885875    // translate "d" and "cl" arguments if required
    886876    translate_OIDs (args, collectproto, logout);
    887877  }
    888 
     878 
    889879  // produce the page using the desired action
    890880  action *a = actions.getaction (args["a"]);
    891881  if (a != NULL) {
    892     if (a->uses_display(args)) prepare_page (a, args, collectproto, (*outconverter), logout);
    893     if (!a->do_action (args, collectinfo, collectproto, disp,
    894                (*outconverter), contentout, logout))
     882    if (a->uses_display(args)) prepare_page (a, args, (*outconverter), logout);
     883    if (!a->do_action (args, &protocols, &browsers, disp, (*outconverter), contentout, logout))
    895884      return false;
    896885
     
    10661055// prepare_page sets up page parameters, sets display macros
    10671056// and opens the page ready for output
    1068 void receptionist::prepare_page (action *a, cgiargsclass &args, recptproto *collectproto,
    1069                  outconvertclass &outconvert, ostream &logout) {
     1057void receptionist::prepare_page (action *a, cgiargsclass &args,
     1058                 outconvertclass &outconvert,
     1059                 ostream &logout) {
    10701060  // set up page parameters
    10711061  text_t pageparams;
     
    10981088    assert ((*actionhere).second.a != NULL);
    10991089    if ((*actionhere).second.a != NULL)
    1100       (*actionhere).second.a->define_external_macros (collectinfo, disp, args, collectproto, logout);
     1090      (*actionhere).second.a->define_external_macros (disp, args, &protocols, logout);
    11011091    actionhere++;
    11021092  }
    11031093
    11041094  // define internal macros for the current action
    1105   a->define_internal_macros (collectinfo, disp, args, collectproto, logout);
     1095  a->define_internal_macros (disp, args, &protocols, logout);
    11061096 
    11071097  // define general macros. the defining of general macros is done here so that
    11081098  // the last possible version of the cgi arguments are used
    1109   define_general_macros (args, collectproto, outconvert, logout);
    1110 }
    1111 
    1112 void receptionist::define_general_macros (cgiargsclass &args, recptproto *collectproto,
    1113                       outconvertclass &/*outconvert*/, ostream &logout) {
     1099  define_general_macros (args, outconvert, logout);
     1100}
     1101
     1102void receptionist::define_general_macros (cgiargsclass &args, outconvertclass &/*outconvert*/,
     1103                      ostream &logout) {
    11141104
    11151105  text_t &collection = args["c"];
     
    11421132
    11431133  // set collection specific macros
    1144   if ((!collection.empty()) && (collectproto != NULL)) {
    1145     FilterResponse_t response;
    1146     text_tset metadata;
    1147     get_info ("collection", collection, metadata, false,
    1148           collectproto, response, logout);
    1149 
    1150     if (!response.docInfo[0].metadata.empty()) {
    1151       MetadataInfo_tmap::const_iterator here = response.docInfo[0].metadata.begin();
    1152       MetadataInfo_tmap::const_iterator end = response.docInfo[0].metadata.end();
    1153       while (here != end) {
    1154     if (((*here).first != "haschildren") && ((*here).first != "hasnext") &&
    1155         ((*here).first != "hasprevious")) {
    1156       disp.setmacro ((*here).first, "Global", (*here).second.values[0]);
     1134  if (!collection.empty()) {
     1135    recptproto *collectproto = protocols.getrecptproto (collection, logout);
     1136    if (collectproto != NULL) {
     1137      FilterResponse_t response;
     1138      text_tset metadata;
     1139      get_info ("collection", collection, metadata, false,
     1140        collectproto, response, logout);
     1141     
     1142      if (!response.docInfo[0].metadata.empty()) {
     1143    MetadataInfo_tmap::const_iterator here = response.docInfo[0].metadata.begin();
     1144    MetadataInfo_tmap::const_iterator end = response.docInfo[0].metadata.end();
     1145    while (here != end) {
     1146      if (((*here).first != "haschildren") && ((*here).first != "hasnext") &&
     1147          ((*here).first != "hasprevious")) {
     1148        disp.setmacro ((*here).first, "Global", (*here).second.values[0]);
     1149      }
     1150      here ++;
    11571151    }
    1158     here ++;
    11591152      }
    11601153    }
Note: See TracChangeset for help on using the changeset viewer.