Changeset 197


Ignore:
Timestamp:
1999-03-10T10:00:48+13:00 (25 years ago)
Author:
rjmcnab
Message:

Reorganised the statusaction, added more functions to comtypes.

Location:
trunk/gsdl/src/recpt
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/Makefile

    r189 r197  
    4242
    4343COLSERVRHEADERS = gdbmclass.h mgq.h mgsearch.h querycache.h queryinfo.h \
    44                   collectserver.h colservrconfig.h
     44                  collectserver.h colservrconfig.h maptools.h
    4545
    4646LIBRARYHEADERS = $(COLSERVRHEADERS) \
     
    5858
    5959COLSERVRSOURCES = gdbmclass.cpp mgq.c mgsearch.cpp querycache.cpp queryinfo.cpp \
    60                   collectserver.cpp colservrconfig.cpp
     60                  collectserver.cpp colservrconfig.cpp maptools.cpp
    6161
    6262LIBRARYSOURCES = $(COLSERVRSOURCES) \
     
    7474
    7575COLSERVROBJECTS = gdbmclass.o mgq.o mgsearch.o querycache.o queryinfo.o \
    76                   collectserver.o colservrconfig.o
     76                  collectserver.o colservrconfig.o maptools.o
    7777
    7878LIBRARYOBJECTS = $(COLSERVROBJECTS) \
     
    9494install:
    9595    cp $(EXEC) /home/nzdl/nzdl-1.2/cgi-bin
     96#   cp recpt /home/nzdl/nzdl-1.2/cgi-bin/rrecpt; \
     97#   cp library /home/nzdl/nzdl-1.2/cgi-bin/rlibrary
    9698
    9799depend:
  • trunk/gsdl/src/recpt/comtypes.cpp

    r187 r197  
    1212/*
    1313   $Log$
     14   Revision 1.3  1999/03/09 21:00:47  rjmcnab
     15   Reorganised the statusaction, added more functions to comtypes.
     16
    1417   Revision 1.2  1999/03/04 21:19:15  rjmcnab
    1518
     
    5053}
    5154
     55void FilterOption_t::check_defaultValue () {
     56  if (validValues.empty()) {
     57    // nothing to check against
     58    defaultValue.clear();
     59    return;
     60  }
     61
     62  text_tarray::iterator here = validValues.begin ();
     63  text_tarray::iterator end = validValues.end ();
     64  while (here != end) {
     65    if (*here == defaultValue) {
     66      // found the default value in the list of valid values
     67      // now there is nothing more to do
     68      return;
     69    }
     70
     71    here++;
     72  }
     73
     74  // did not find the defaultValue, set it to be the
     75  // first option in the list
     76  defaultValue = validValues[0];
     77}
     78
    5279void FilterDescript_t::clear () {
    5380  filterName.clear();
     
    77104}
    78105
     106
    79107void ResultDocInfo_t::clear () {
    80108  OID.clear ();
     
    83111  docFreq.erase(docFreq.begin(), docFreq.end());
    84112}
     113
     114ResultDocInfo_t &ResultDocInfo_t::operator=(const ResultDocInfo_t &x) {
     115  OID=x.OID;
     116  subCol=x.subCol;
     117  ranking=x.ranking;
     118  docFreq=x.docFreq;
     119  return *this;
     120}
     121
    85122
    86123void FilterResponse_t::clear () {
  • trunk/gsdl/src/recpt/comtypes.h

    r190 r197  
    9090struct FilterOption_t {
    9191  void clear ();
     92  void check_defaultValue ();
    9293  FilterOption_t () {clear();}
    9394
     
    205206  vector<int> docFreq; // empty if not requested
    206207
    207   ResultDocInfo_t &operator=(const ResultDocInfo_t &x)
    208   {OID=x.OID; subCol=x.subCol; ranking=x.ranking;
    209   docFreq=x.docFreq; return *this;}
     208  ResultDocInfo_t &operator=(const ResultDocInfo_t &x);
    210209};
    211210
  • trunk/gsdl/src/recpt/statusaction.cpp

    r172 r197  
    1212/*
    1313   $Log$
     14   Revision 1.7  1999/03/09 21:00:47  rjmcnab
     15   Reorganised the statusaction, added more functions to comtypes.
     16
    1417   Revision 1.6  1999/02/25 21:59:02  rjmcnab
    1518
     
    4144#include "statusaction.h"
    4245#include <assert.h>
     46
     47
     48void statusaction::output_generalinfo (cgiargsclass &/*args*/, displayclass &/*disp*/,
     49                       outconvertclass &outconvert,
     50                       ostream &textout, ostream &/*logout*/) {
     51  const recptconf &rcinfo = recpt->get_configinfo ();
     52 
     53  textout << outconvert << "<table>\n";
     54  textout << outconvert << "<tr valign=top><th>gsdlhome</th><td>\"" << rcinfo.gsdlhome
     55      << "\"</td></tr>\n";
     56  textout << outconvert << "<tr valign=top><th>collection</th><td>\"" << rcinfo.collection
     57      << "\"</td></tr>\n";
     58  textout << outconvert << "<tr valign=top><th>collectdir</th><td>\"" << rcinfo.collectdir
     59      << "\"</td></tr>\n";
     60  textout << outconvert << "<tr valign=top><th>httpimg</th><td>\"" << rcinfo.httpimg
     61      << "\"</td></tr>\n";
     62  textout << outconvert << "<tr valign=top><th>gwcgi</th><td>\"" << rcinfo.gwcgi
     63      << "\"</td></tr>\n";
     64 
     65 
     66  // macrofiles
     67  textout << outconvert << "<tr valign=top><th>macrofiles</th><td>";
     68  text_tarray::const_iterator macrohere = rcinfo.macrofiles.begin ();
     69  text_tarray::const_iterator macroend = rcinfo.macrofiles.end ();
     70  bool macrofirst = true;
     71  while (macrohere != macroend) {
     72    if (!macrofirst) textout << outconvert << ", ";
     73    macrofirst = false;
     74    textout << outconvert << "\"" << *macrohere << "\"";
     75    macrohere++;
     76  }
     77  textout << outconvert << "</td></tr>\n";
     78 
     79  // saveconf
     80  textout << outconvert << "<tr valign=top><th>saveconf</th><td>\"" << rcinfo.saveconf
     81      << "\"</td></tr>\n";
     82 
     83  // arguments
     84  cgiargsinfoclass *rcargsinfo = recpt->get_cgiargsinfo_ptr ();
     85  if (rcargsinfo != NULL) {
     86    textout << outconvert << "<tr valign=top><th>arguments</th><td>";
     87   
     88    cgiargsinfoclass::const_iterator argsinfohere = rcargsinfo->begin ();
     89    cgiargsinfoclass::const_iterator argsinfoend = rcargsinfo->end ();
     90    bool argsinfofirst = true;
     91    while (argsinfohere != argsinfoend) {
     92      if (!argsinfofirst) textout << outconvert << ", ";
     93      argsinfofirst = false;
     94      textout << outconvert << "\"" << (*argsinfohere).second.shortname << "\"";
     95      argsinfohere++;
     96    }
     97   
     98    textout << outconvert << "</td></tr>\n";
     99  }     
     100 
     101  // actions
     102  actionmapclass *actions = recpt->get_actionmap_ptr();
     103  if (actions != NULL) {
     104    textout << outconvert << "<tr valign=top><th>actions</th><td>";
     105   
     106    actionptrmap::iterator actionshere = actions->begin ();
     107    actionptrmap::iterator actionsend = actions->end ();
     108    bool actionsfirst = true;
     109    while (actionshere != actionsend) {
     110      if (!actionsfirst) textout << outconvert << ", ";
     111      actionsfirst = false;
     112      assert ((*actionshere).second.a != NULL);
     113      if ((*actionshere).second.a != NULL) {
     114    textout << outconvert << "\"" << (*actionshere).second.a->get_action_name() << "\"";
     115      }
     116      actionshere++;
     117    }
     118   
     119    textout << outconvert << "</td></tr>\n";
     120  }
     121 
     122  // protocols
     123  recptprotolistclass *protocols = recpt->get_recptprotolist_ptr ();
     124  if (protocols != NULL) {
     125    textout << outconvert << "<tr valign=top><th>protocols</th><td>";
     126   
     127    recptprotolistclass::iterator protohere = protocols->begin ();
     128    recptprotolistclass::iterator protoend = protocols->end ();
     129    bool protofirst = true;
     130    while (protohere != protoend) {
     131      if (!protofirst) textout << outconvert << ", ";
     132      protofirst = false;
     133      if ((*protohere).p != NULL) {
     134    textout << outconvert << "\"" << (*protohere).p->get_protocol_name() << "\"";
     135      }
     136      protohere++;
     137    }
     138   
     139    textout << outconvert << "</td></tr>\n";
     140  }
     141 
     142  // converters
     143  convertinfoclass *converters = recpt->get_convertinfo_ptr ();
     144  if (converters != NULL) {
     145    textout << outconvert << "<tr valign=top><th>converters</th><td>";
     146   
     147    convertinfoclass::iterator converthere = converters->begin ();
     148    convertinfoclass::iterator convertend = converters->end ();
     149    bool convertfirst = true;
     150    while (converthere != convertend) {
     151      if (!convertfirst) textout << outconvert << ", ";
     152      convertfirst = false;
     153      textout << outconvert << "\"" << (*converthere).second.name << "\"";
     154      converthere++;
     155    }
     156   
     157    textout << outconvert << "</td></tr>\n";
     158  }
     159 
     160 
     161  textout << outconvert
     162      << "</table>\n";
     163}
     164
     165void statusaction::output_argumentinfo (cgiargsclass &args, displayclass &/*disp*/,
     166                    outconvertclass &outconvert,
     167                    ostream &textout, ostream &/*logout*/) {
     168  cgiargsinfoclass *rcargsinfo = recpt->get_cgiargsinfo_ptr ();
     169
     170  textout << outconvert
     171      << "<h2>Argument information</h2>\n"
     172      << "<table>";
     173
     174  // argument information
     175  textout << outconvert << "<tr valign=top><th>short name</th><th>long name</th>"
     176      << "<th>multiple char?</th>"
     177      << "<th>default</th><th>default status</th><th>saved args</th>"
     178      << "<th>current value</th></tr>\n";
     179 
     180  cgiargsclass::const_iterator argshere = args.begin();
     181  cgiargsclass::const_iterator argsend = args.end();
     182  cgiarginfo *ainfo;
     183 
     184  while (argshere != argsend) {
     185    const text_t &aname = (*argshere).first;
     186    textout << outconvert
     187        << "<tr valign=top><td>" << aname << "</td>\n";
     188   
     189    if ((rcargsinfo != NULL) &&
     190    ((ainfo=rcargsinfo->getarginfo(aname)) != NULL)) {
     191      textout << outconvert << "<td>" << ainfo->longname << "</td>\n";
     192      if (ainfo->multiplechar) textout << outconvert << "<td>yes</td>\n";
     193      else textout << outconvert << "<td>no</td>\n";
     194      textout << outconvert << "<td>" << ainfo->argdefault << "</td>\n";
     195      switch (ainfo->defaultstatus) {
     196      case cgiarginfo::none: textout << outconvert << "<td>none</td>\n"; break;
     197      case cgiarginfo::weak: textout << outconvert << "<td>weak</td>\n"; break;
     198      case cgiarginfo::good: textout << outconvert << "<td>good</td>\n"; break;
     199      case cgiarginfo::config: textout << outconvert << "<td>config</td>\n"; break;
     200      case cgiarginfo::imperative: textout << outconvert << "<td>imperative</td>\n"; break;
     201      }
     202      switch (ainfo->savedarginfo) {
     203      case cgiarginfo::mustnot: textout << outconvert << "<td>mustnot</td>\n"; break;
     204      case cgiarginfo::can: textout << outconvert << "<td>can</td>\n"; break;
     205      case cgiarginfo::must: textout << outconvert << "<td>must</td>\n"; break;
     206      }
     207    } else {
     208      textout << outconvert << "<td colspan=5></td>\n";
     209    }
     210   
     211    textout << outconvert << "<td>\"" << (*argshere).second << "\"</td></tr>\n";
     212   
     213    argshere ++;
     214  }
     215 
     216  textout << outconvert
     217      << "</table>\n";
     218}
     219
     220void statusaction::output_actioninfo (cgiargsclass &/*args*/, displayclass &/*disp*/,
     221                      outconvertclass &outconvert,
     222                      ostream &textout, ostream &/*logout*/) {
     223  actionmapclass *actions = recpt->get_actionmap_ptr();
     224
     225  textout << outconvert
     226      << "<h2>Action information</h2>\n"
     227      << "<table>";
     228
     229  // action information
     230  if (actions != NULL) {
     231    textout << outconvert
     232        << "<tr><th>action name</th><th>cgi arguments</th></tr>\n";
     233   
     234    actionptrmap::iterator actionshere = actions->begin ();
     235    actionptrmap::iterator actionsend = actions->end ();
     236    while (actionshere != actionsend) {
     237      assert ((*actionshere).second.a != NULL);
     238      if ((*actionshere).second.a != NULL) {
     239    textout << outconvert
     240        << "<tr><td>" << (*actionshere).second.a->get_action_name()
     241        << "</td><td>";
     242   
     243    cgiargsinfoclass argsinfo = (*actionshere).second.a->getargsinfo();
     244    cgiargsinfoclass::const_iterator argsinfohere = argsinfo.begin ();
     245    cgiargsinfoclass::const_iterator argsinfoend = argsinfo.end ();
     246    bool aifirst = true;
     247    while (argsinfohere != argsinfoend) {
     248      if (!aifirst) textout << outconvert << ", ";
     249      aifirst = false;
     250      textout << outconvert << (*argsinfohere).second.shortname;
     251      argsinfohere++;
     252    }
     253   
     254    textout << outconvert << "</td></tr>\n";
     255      }
     256      actionshere++;
     257    }
     258  }
     259 
     260  textout << outconvert << "</table>\n";
     261}
     262
     263void statusaction::output_protocolinfo (cgiargsclass &/*args*/, displayclass &/*disp*/,
     264                    outconvertclass &/*outconvert*/,
     265                    ostream &/*textout*/, ostream &/*logout*/) {
     266}
     267
     268void statusaction::output_collectioninfo (cgiargsclass &/*args*/, displayclass &/*disp*/,
     269                      outconvertclass &/*outconvert*/,
     270                      ostream &/*textout*/, ostream &/*logout*/) {
     271}
     272
     273void statusaction::output_initlog (cgiargsclass &/*args*/, displayclass &/*disp*/,
     274                   outconvertclass &outconvert,
     275                   ostream &textout, ostream &/*logout*/) {
     276  ifstream initin (GSDL_GSDLHOME "/etc/initout.txt");
     277  if (initin) {
     278    textout << outconvert << "<p>The initialisation error log, " GSDL_GSDLHOME "/etc/initout.txt, contains the\n";
     279    textout << outconvert << "following information:\n\n";
     280    text_t errorpage = "<p><pre>\n";
     281   
     282    char c;
     283    initin.get(c);
     284    while (!initin.eof ()) {
     285      errorpage.push_back(c);
     286      initin.get(c);
     287    }
     288   
     289    errorpage += "</pre>\n";
     290    initin.close();
     291    textout << outconvert << errorpage;
     292   
     293  } else {
     294    textout << outconvert << "Couldn't read initialisation error log, " GSDL_GSDLHOME "/etc/initout.txt.\n";
     295  }
     296}
     297
     298void statusaction::output_errorlog (cgiargsclass &/*args*/, displayclass &/*disp*/,
     299                    outconvertclass &outconvert,
     300                    ostream &textout, ostream &/*logout*/) {
     301  ifstream errin (GSDL_GSDLHOME "/etc/errout.txt");
     302  if (errin) {
     303    textout << outconvert << "<p>The error log, " GSDL_GSDLHOME "/etc/errout.txt, contains the\n";
     304    textout << outconvert << "following information:\n\n";
     305    text_t errorpage = "<p><pre>\n";
     306
     307    char c;
     308    errin.get(c);
     309    while (!errin.eof ()) {
     310      errorpage.push_back(c);
     311      errin.get(c);
     312    }
     313   
     314    errorpage += "</pre>\n";
     315    errin.close();
     316    textout << outconvert << errorpage;
     317
     318  } else {
     319    textout << outconvert << "Couldn't read error log, " GSDL_GSDLHOME "/etc/errout.txt.\n";
     320  }
     321}
     322
    43323
    44324statusaction::statusaction () {
     
    73353
    74354bool statusaction::do_action (cgiargsclass &args, recptproto */*collectproto*/,
    75                   displayclass &/*disp*/, outconvertclass &outconvert,
    76                   ostream &textout, ostream &/*logout*/) {
     355                  displayclass &disp, outconvertclass &outconvert,
     356                  ostream &textout, ostream &logout) {
    77357  textout << outconvert << "<html>\n";
    78358  textout << outconvert << "<head>\n";
    79   textout << outconvert << "<title>Status information</title>\n";
     359  textout << outconvert << "<title>Status</title>\n";
    80360  textout << outconvert << "</head>\n";
    81   textout << outconvert << "<body>\n";
     361  textout << outconvert << "<body bgcolor=\"#ffffff\" text=\"#000000\" link=\"#006666\" "
     362      << "alink=\"#cc9900\" vlink=\"#666633\">\n";
     363
     364  textout << outconvert << disp << "<img src=\"_httpimg_/gsdl.gif\"><br>\n";
     365
    82366  if (disabled) textout << outconvert << "<h2>Status disabled</h2>\n";
    83367  else {
    84     textout << outconvert << "<h2>Receptionist configuration information</h2>\n";
     368    textout << outconvert << "<h2>General information</h2>\n";
    85369   
    86370    if (recpt == NULL) {
     
    91375
    92376    } else {
    93       const recptconf &rcinfo = recpt->get_configinfo ();
    94 
    95       textout << outconvert << "<table>\n";
    96       textout << outconvert << "<tr valign=top><th>gsdlhome</th><td>\"" << rcinfo.gsdlhome
    97           << "\"</td></tr>\n";
    98       textout << outconvert << "<tr valign=top><th>collection</th><td>\"" << rcinfo.collection
    99           << "\"</td></tr>\n";
    100       textout << outconvert << "<tr valign=top><th>collectdir</th><td>\"" << rcinfo.collectdir
    101           << "\"</td></tr>\n";
    102       textout << outconvert << "<tr valign=top><th>httpimg</th><td>\"" << rcinfo.httpimg
    103           << "\"</td></tr>\n";
    104       textout << outconvert << "<tr valign=top><th>gwcgi</th><td>\"" << rcinfo.gwcgi
    105           << "\"</td></tr>\n";
    106 
    107 
    108       // macrofiles
    109       textout << outconvert << "<tr valign=top><th>macrofiles</th><td>";
    110       text_tarray::const_iterator macrohere = rcinfo.macrofiles.begin ();
    111       text_tarray::const_iterator macroend = rcinfo.macrofiles.end ();
    112       bool macrofirst = true;
    113       while (macrohere != macroend) {
    114     if (!macrofirst) textout << outconvert << ", ";
    115     macrofirst = false;
    116     textout << outconvert << "\"" << *macrohere << "\"";
    117     macrohere++;
    118       }
    119       textout << outconvert << "</td></tr>\n";
    120 
    121       // saveconf
    122       textout << outconvert << "<tr valign=top><th>saveconf</th><td>\"" << rcinfo.saveconf
    123           << "\"</td></tr>\n";
    124 
    125       // arguments
    126       cgiargsinfoclass *rcargsinfo = recpt->get_cgiargsinfo_ptr ();
    127       if (rcargsinfo != NULL) {
    128     textout << outconvert << "<tr valign=top><th>arguments</th><td>";
    129 
    130     cgiargsinfoclass::const_iterator argsinfohere = rcargsinfo->begin ();
    131     cgiargsinfoclass::const_iterator argsinfoend = rcargsinfo->end ();
    132     bool argsinfofirst = true;
    133     while (argsinfohere != argsinfoend) {
    134       if (!argsinfofirst) textout << outconvert << ", ";
    135       argsinfofirst = false;
    136       textout << outconvert << "\"" << (*argsinfohere).second.shortname << "\"";
    137       argsinfohere++;
    138     }
    139 
    140     textout << outconvert << "</td></tr>\n";
    141       }     
    142 
    143       // actions
    144       actionmapclass *actions = recpt->get_actionmap_ptr();
    145       if (actions != NULL) {
    146     textout << outconvert << "<tr valign=top><th>actions</th><td>";
    147 
    148     actionptrmap::iterator actionshere = actions->begin ();
    149     actionptrmap::iterator actionsend = actions->end ();
    150     bool actionsfirst = true;
    151     while (actionshere != actionsend) {
    152       if (!actionsfirst) textout << outconvert << ", ";
    153       actionsfirst = false;
    154       assert ((*actionshere).second.a != NULL);
    155       if ((*actionshere).second.a != NULL) {
    156         textout << outconvert << "\"" << (*actionshere).second.a->get_action_name() << "\"";
    157       }
    158       actionshere++;
    159     }
    160    
    161     textout << outconvert << "</td></tr>\n";
    162       }
    163      
    164       // protocols
    165       recptprotolistclass *protocols = recpt->get_recptprotolist_ptr ();
    166       if (protocols != NULL) {
    167     textout << outconvert << "<tr valign=top><th>protocols</th><td>";
    168 
    169     recptprotolistclass::iterator protohere = protocols->begin ();
    170     recptprotolistclass::iterator protoend = protocols->end ();
    171     bool protofirst = true;
    172     while (protohere != protoend) {
    173       if (!protofirst) textout << outconvert << ", ";
    174       protofirst = false;
    175       if ((*protohere).p != NULL) {
    176         textout << outconvert << "\"" << (*protohere).p->get_protocol_name() << "\"";
    177       }
    178       protohere++;
    179     }
    180    
    181     textout << outconvert << "</td></tr>\n";
    182       }
    183 
    184       // converters
    185       convertinfoclass *converters = recpt->get_convertinfo_ptr ();
    186       if (converters != NULL) {
    187     textout << outconvert << "<tr valign=top><th>converters</th><td>";
    188 
    189     convertinfoclass::iterator converthere = converters->begin ();
    190     convertinfoclass::iterator convertend = converters->end ();
    191     bool convertfirst = true;
    192     while (converthere != convertend) {
    193       if (!convertfirst) textout << outconvert << ", ";
    194       convertfirst = false;
    195       textout << outconvert << "\"" << (*converthere).second.name << "\"";
    196       converthere++;
    197     }
    198    
    199     textout << outconvert << "</td></tr>\n";
    200       }
    201 
    202 
    203       textout << outconvert
    204           << "</table>\n"
    205           << "<hr>\n"
    206           << "<h2>Argument information</h2>\n"
    207           << "<table>";
    208 
    209       // argument information
    210       textout << outconvert << "<tr valign=top><th>short name</th><th>long name</th>"
    211           << "<th>multiple char?</th>"
    212           << "<th>default</th><th>default status</th><th>saved args</th>"
    213           << "<th>current value</th></tr>\n";
    214 
    215       cgiargsclass::const_iterator argshere = args.begin();
    216       cgiargsclass::const_iterator argsend = args.end();
    217       cgiarginfo *ainfo;
    218      
    219       while (argshere != argsend) {
    220     const text_t &aname = (*argshere).first;
    221     textout << outconvert
    222         << "<tr valign=top><td>" << aname << "</td>\n";
    223      
    224       if ((rcargsinfo != NULL) &&
    225           ((ainfo=rcargsinfo->getarginfo(aname)) != NULL)) {
    226         textout << outconvert << "<td>" << ainfo->longname << "</td>\n";
    227         if (ainfo->multiplechar) textout << outconvert << "<td>yes</td>\n";
    228         else textout << outconvert << "<td>no</td>\n";
    229         textout << outconvert << "<td>" << ainfo->argdefault << "</td>\n";
    230         switch (ainfo->defaultstatus) {
    231         case cgiarginfo::none: textout << outconvert << "<td>none</td>\n"; break;
    232         case cgiarginfo::weak: textout << outconvert << "<td>weak</td>\n"; break;
    233         case cgiarginfo::good: textout << outconvert << "<td>good</td>\n"; break;
    234         case cgiarginfo::config: textout << outconvert << "<td>config</td>\n"; break;
    235         case cgiarginfo::imperative: textout << outconvert << "<td>imperative</td>\n"; break;
    236         }
    237         switch (ainfo->savedarginfo) {
    238         case cgiarginfo::mustnot: textout << outconvert << "<td>mustnot</td>\n"; break;
    239         case cgiarginfo::can: textout << outconvert << "<td>can</td>\n"; break;
    240         case cgiarginfo::must: textout << outconvert << "<td>must</td>\n"; break;
    241         }
    242       } else {
    243         textout << outconvert << "<td colspan=5></td>\n";
    244       }
    245    
    246     textout << outconvert << "<td>\"" << (*argshere).second << "\"</td></tr>\n";
    247 
    248     argshere ++;
    249       }
    250      
    251       textout << outconvert
    252           << "</table>\n"
    253           << "<hr>\n"
    254           << "<h2>Action information</h2>\n"
    255           << "<table>";
    256 
    257       // action information
    258       if (actions != NULL) {
    259     textout << outconvert
    260         << "<tr><th>action name</th><th>cgi arguments</th></tr>\n";
    261    
    262     actionptrmap::iterator actionshere = actions->begin ();
    263     actionptrmap::iterator actionsend = actions->end ();
    264     while (actionshere != actionsend) {
    265       assert ((*actionshere).second.a != NULL);
    266       if ((*actionshere).second.a != NULL) {
    267         textout << outconvert
    268             << "<tr><td>" << (*actionshere).second.a->get_action_name()
    269             << "</td><td>";
    270 
    271         cgiargsinfoclass argsinfo = (*actionshere).second.a->getargsinfo();
    272         cgiargsinfoclass::const_iterator argsinfohere = argsinfo.begin ();
    273         cgiargsinfoclass::const_iterator argsinfoend = argsinfo.end ();
    274         bool aifirst = true;
    275         while (argsinfohere != argsinfoend) {
    276           if (!aifirst) textout << outconvert << ", ";
    277           aifirst = false;
    278           textout << outconvert << (*argsinfohere).second.shortname;
    279           argsinfohere++;
    280         }
    281 
    282         textout << outconvert << "</td></tr>\n";
    283       }
    284       actionshere++;
    285     }
    286       }
    287    
    288       textout << outconvert << "</table><hr>\n";
    289     }
    290   }
    291  
    292   ifstream initin (GSDL_GSDLHOME "/etc/initout.txt");
    293   if (initin) {
    294     textout << outconvert << "<p>The initialisation error log, " GSDL_GSDLHOME "/etc/initout.txt, contains the\n";
    295     textout << outconvert << "following information:\n\n";
    296     text_t errorpage = "<p><pre>\n";
    297 
    298     char c;
    299     initin.get(c);
    300     while (!initin.eof ()) {
    301       errorpage.push_back(c);
    302       initin.get(c);
    303     }
    304    
    305     errorpage += "</pre>\n";
    306     initin.close();
    307     textout << outconvert << errorpage;
    308 
    309   } else {
    310     textout << outconvert << "Couldn't read initialisation error log, " GSDL_GSDLHOME "/etc/initout.txt.\n";
    311   }
    312 
    313   ifstream errin (GSDL_GSDLHOME "/etc/errout.txt");
    314   if (initin) {
    315     textout << outconvert << "<p>The error log, " GSDL_GSDLHOME "/etc/errout.txt, contains the\n";
    316     textout << outconvert << "following information:\n\n";
    317     text_t errorpage = "<p><pre>\n";
    318 
    319     char c;
    320     errin.get(c);
    321     while (!errin.eof ()) {
    322       errorpage.push_back(c);
    323       errin.get(c);
    324     }
    325    
    326     errorpage += "</pre>\n";
    327     errin.close();
    328     textout << outconvert << errorpage;
    329 
    330   } else {
    331     textout << outconvert << "Couldn't read error log, " GSDL_GSDLHOME "/etc/errout.txt.\n";
    332   }
     377      output_generalinfo (args, disp, outconvert, textout, logout);
     378      textout << outconvert << "<hr>\n";
     379
     380      output_argumentinfo (args, disp, outconvert, textout, logout);
     381      textout << outconvert << "<hr>\n";
     382
     383      output_actioninfo (args, disp, outconvert, textout, logout);
     384      textout << outconvert << "<hr>\n";
     385
     386      output_initlog (args, disp, outconvert, textout, logout);
     387      textout << outconvert << "<hr>\n";
     388
     389      output_errorlog (args, disp, outconvert, textout, logout);
     390      textout << outconvert << "<hr>\n";
     391    }
     392  }
     393 
    333394
    334395  textout << outconvert << "</body>\n";
  • trunk/gsdl/src/recpt/statusaction.h

    r172 r197  
    2525  receptionist *recpt;
    2626
     27  void output_generalinfo (cgiargsclass &args, displayclass &disp,
     28               outconvertclass &outconvert,
     29               ostream &textout, ostream &logout);
     30  void output_argumentinfo (cgiargsclass &args, displayclass &disp,
     31                outconvertclass &outconvert,
     32                ostream &textout, ostream &logout);
     33  void output_actioninfo (cgiargsclass &args, displayclass &disp,
     34              outconvertclass &outconvert,
     35              ostream &textout, ostream &logout);
     36  void output_protocolinfo (cgiargsclass &args, displayclass &disp,
     37                outconvertclass &outconvert,
     38                ostream &textout, ostream &logout);
     39  void output_collectioninfo (cgiargsclass &args, displayclass &disp,
     40                  outconvertclass &outconvert,
     41                  ostream &textout, ostream &logout);
     42  void output_initlog (cgiargsclass &args, displayclass &disp,
     43               outconvertclass &outconvert,
     44               ostream &textout, ostream &logout);
     45  void output_errorlog (cgiargsclass &args, displayclass &disp,
     46            outconvertclass &outconvert,
     47            ostream &textout, ostream &logout);
     48
    2749public:
    2850  statusaction ();
Note: See TracChangeset for help on using the changeset viewer.