- Timestamp:
- 2000-07-13T10:21:53+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/New_Config_Format-branch/gsdl/src/recpt/statusaction.cpp
r995 r1279 28 28 /* 29 29 $Log$ 30 Revision 1.25.4.1 2000/07/12 22:21:46 sjboddie 31 merged changes to trunk into New_Config_Format branch 32 33 Revision 1.31 2000/07/05 21:49:36 sjboddie 34 Receptionist now caches collection information to avoid making multiple 35 get_collectinfo calls to collection server 36 37 Revision 1.30 2000/07/03 22:26:27 nzdl 38 fixed a few errors in the macro files (and one in some text printed out 39 by the statusaction) 40 41 Revision 1.29 2000/06/29 02:47:21 sjboddie 42 added browser info (i.e VList, HList etc.) to status pages 43 44 Revision 1.28 2000/06/29 00:22:59 sjboddie 45 added new numsections field to collection info and made the statusaction 46 recognize it 47 48 Revision 1.27 2000/05/12 03:09:24 sjboddie 49 minor modifications to get web library compiling under VC++ 6.0 50 51 Revision 1.26 2000/04/19 22:30:23 sjboddie 52 tidied up status pages and end-user collection building 53 30 54 Revision 1.25 2000/02/29 21:00:31 sjboddie 31 55 fixed some compiler warnings … … 116 140 117 141 */ 118 119 142 120 143 #include "statusaction.h" … … 138 161 } 139 162 140 void statusaction::output_welcome (cgiargsclass &/*args*/, displayclass &disp, 141 outconvertclass &outconvert, 142 ostream &textout, ostream &/*logout*/) { 143 textout << outconvert << disp << "_status:infoheader_(_titlewelcome_)\n" 144 "_status:welcome_\n" 145 "_status:infofooter_\n"; 163 void statusaction::output_welcome (cgiargsclass &/*args*/, recptprotolistclass *protos, 164 displayclass &disp, outconvertclass &outconvert, 165 ostream &textout, ostream &logout) { 166 167 if (recpt == NULL) return; 168 169 textout << outconvert << disp 170 << "_status:infoheader_(_titlewelcome_)\n" 171 << "_status:welcome_" 172 << "<center><table width=_pagewidth_>\n" 173 << "<th align=left>abbrev.</th><th align=left>collection</th>" 174 << "<th align=left>public?</th><th align=left>running?</th></tr>\n"; 175 176 recptprotolistclass::iterator rprotolist_here = protos->begin(); 177 recptprotolistclass::iterator rprotolist_end = protos->end(); 178 while (rprotolist_here != rprotolist_end) { 179 if ((*rprotolist_here).p != NULL) { 180 text_t protoname = (*rprotolist_here).p->get_protocol_name(); 181 text_tarray collist; 182 comerror_t err; 183 (*rprotolist_here).p->get_collection_list (collist, err, logout); 184 if (err == noError) { 185 text_tarray::iterator collist_here = collist.begin(); 186 text_tarray::iterator collist_end = collist.end(); 187 188 while (collist_here != collist_end) { 189 190 textout << outconvert << disp 191 << "<tr><td><a href=\"_gwcgi_?e=_compressedoptions_&a=status&sp=collectioninfo&pr=" 192 << protoname 193 << "&c=" 194 << *collist_here 195 << "\">" 196 << *collist_here 197 << "</a></td>"; 198 199 ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr ((*rprotolist_here).p, *collist_here, logout); 200 if (cinfo != NULL) { 201 text_t collname = *collist_here; 202 text_tmap::iterator it = cinfo->collectionmeta.find("collectionname"); 203 if (it != cinfo->collectionmeta.end()) collname = (*it).second; 204 205 textout << "<td>"; 206 if (cinfo->buildDate > 0) 207 textout << outconvert << disp 208 << "<a href=\"_httppagex_(about)&c=" << *collist_here 209 << "\" target=\\_top>"; 210 211 textout << outconvert << disp << collname; 212 213 if (cinfo->buildDate > 0) textout << "</a>"; 214 215 textout << "</td>"; 216 217 if (cinfo->isPublic) textout << "<td>yes</td>"; 218 else textout << "<td>no</td>"; 219 220 if (cinfo->buildDate > 0) 221 textout << outconvert << "<td>yes</td>"; 222 else 223 textout << "<td>no</td>"; 224 225 } else { 226 textout << "<td></td><td></td><td></td>"; 227 } 228 229 textout << "</tr>\n"; 230 collist_here ++; 231 } 232 } 233 } 234 rprotolist_here ++; 235 } 236 237 textout << "</table></center>\n"; 238 textout << outconvert << disp << "_status:infofooter_\n"; 146 239 } 147 240 … … 256 349 } 257 350 351 // browsers 352 browsermapclass *browsers = recpt->get_browsermap_ptr(); 353 if (browsers != NULL) { 354 textout << outconvert << "<tr valign=top><th>browsers</th><td>"; 355 356 browserptrmap::iterator browsershere = browsers->begin (); 357 browserptrmap::iterator browsersend = browsers->end (); 358 bool browsersfirst = true; 359 while (browsershere != browsersend) { 360 if (!browsersfirst) textout << outconvert << ", "; 361 browsersfirst = false; 362 assert ((*browsershere).second.b != NULL); 363 if ((*browsershere).second.b != NULL) { 364 textout << outconvert << "\"" << (*browsershere).second.b->get_browser_name() << "\""; 365 } 366 browsershere++; 367 } 368 369 textout << outconvert << "</td></tr>\n"; 370 } 371 258 372 // protocols 259 373 recptprotolistclass *protocols = recpt->get_recptprotolist_ptr (); … … 399 513 } 400 514 515 void statusaction::output_browserinfo (cgiargsclass &/*args*/, displayclass &disp, 516 outconvertclass &outconvert, 517 ostream &textout, ostream &/*logout*/) { 518 if (recpt == NULL) return; 519 browsermapclass *browsers = recpt->get_browsermap_ptr(); 520 521 textout << outconvert << disp << "_status:infoheader_(Browser Information)\n"; 522 textout << outconvert 523 << "<h2>Browser information</h2>\n" 524 << "<table>"; 525 526 // browser information 527 if (browsers != NULL) { 528 textout << outconvert 529 << "<tr><th>browser name</th><th>default formatstring</th></tr>\n"; 530 531 browserptrmap::iterator browsershere = browsers->begin (); 532 browserptrmap::iterator browsersend = browsers->end (); 533 while (browsershere != browsersend) { 534 assert ((*browsershere).second.b != NULL); 535 if ((*browsershere).second.b != NULL) { 536 textout << outconvert 537 << "<tr><td>" << (*browsershere).second.b->get_browser_name() 538 << "</td><td>" << html_safe ((*browsershere).second.b->get_default_formatstring()) 539 << "</td></tr>\n"; 540 } 541 browsershere++; 542 } 543 } 544 545 textout << outconvert << disp << "</table>\n_status:infofooter_\n"; 546 } 547 401 548 void statusaction::output_protocolinfo (cgiargsclass &/*args*/, displayclass &disp, 402 549 outconvertclass &outconvert, … … 512 659 } else { 513 660 // rproto can't be NULL to get here 514 ColInfoResponse_t collectinfo; 515 comerror_t err; 516 517 rproto->get_collectinfo (arg_c, collectinfo, err, logout); 518 if (err == noError) { 661 ColInfoResponse_t *collectinfo = recpt->get_collectinfo_ptr (rproto, arg_c, logout); 662 if (collectinfo != NULL) { 519 663 textout << outconvert << "<table>\n" 520 664 << "<tr><th>collection name</th><td>\"" 521 << collectinfo .shortInfo.name665 << collectinfo->shortInfo.name 522 666 << "\"</td></tr>\n" 523 667 524 668 << "<tr><th>host</th><td>\"" 525 << collectinfo .shortInfo.host669 << collectinfo->shortInfo.host 526 670 << "\"</td></tr>\n" 527 671 528 672 << "<tr><th>port</th><td>\"" 529 << collectinfo .shortInfo.port673 << collectinfo->shortInfo.port 530 674 << "\"</td></tr>\n" 531 675 532 676 << "<tr><th>is public?</th><td>"; 533 if (collectinfo .isPublic) textout << outconvert << "true";677 if (collectinfo->isPublic) textout << outconvert << "true"; 534 678 else textout << outconvert << "false"; 535 679 textout << outconvert … … 537 681 538 682 << "<tr><th>is beta?</th><td>"; 539 if (collectinfo .isBeta) textout << outconvert << "true";683 if (collectinfo->isBeta) textout << outconvert << "true"; 540 684 else textout << outconvert << "false"; 541 685 textout << outconvert … … 543 687 544 688 << "<tr><th>build date</th><td>\"" 545 << collectinfo .buildDate689 << collectinfo->buildDate 546 690 << "\"</td></tr>\n" 547 691 548 692 << "<tr><th>interface languages</th><td>"; 549 text_tarray::iterator languages_here = collectinfo .languages.begin();550 text_tarray::iterator languages_end = collectinfo .languages.end();693 text_tarray::iterator languages_here = collectinfo->languages.begin(); 694 text_tarray::iterator languages_end = collectinfo->languages.end(); 551 695 bool languages_first = true; 552 696 while (languages_here != languages_end) { … … 558 702 559 703 textout << "<tr><th valign=top>collection metadata</th><td><table>\n"; 560 text_tmap::iterator meta_here = collectinfo .collectionmeta.begin();561 text_tmap::iterator meta_end = collectinfo .collectionmeta.end();704 text_tmap::iterator meta_here = collectinfo->collectionmeta.begin(); 705 text_tmap::iterator meta_end = collectinfo->collectionmeta.end(); 562 706 while (meta_here != meta_end) { 563 707 textout << outconvert << "<tr><td>" << (*meta_here).first … … 568 712 569 713 textout << "<tr><th valign=top>format info</th><td><table>\n"; 570 text_tmap::iterator format_here = collectinfo .format.begin();571 text_tmap::iterator format_end = collectinfo .format.end();714 text_tmap::iterator format_here = collectinfo->format.begin(); 715 text_tmap::iterator format_end = collectinfo->format.end(); 572 716 while (format_here != format_end) { 573 717 textout << outconvert << "<tr><td>" << (*format_here).first … … 578 722 579 723 textout << "<tr><th valign=top>building info</th><td><table>\n"; 580 text_tmap::iterator building_here = collectinfo .building.begin();581 text_tmap::iterator building_end = collectinfo .building.end();724 text_tmap::iterator building_here = collectinfo->building.begin(); 725 text_tmap::iterator building_end = collectinfo->building.end(); 582 726 while (building_here != building_end) { 583 727 textout << outconvert << "<tr><td>" << (*building_here).first … … 591 735 592 736 << "<tr><th>number of documents</th><td>\"" 593 << collectinfo .numDocs737 << collectinfo->numDocs 594 738 << "\"</td></tr>\n" 595 739 740 << "<tr><th>number of sections</th><td>\"" 741 << collectinfo->numSections 742 << "\"</td></tr>\n" 743 596 744 << "<tr><th>number of words</th><td>\"" 597 << collectinfo .numWords745 << collectinfo->numWords 598 746 << "\"</td></tr>\n" 599 747 600 748 << "<tr><th>number of bytes</th><td>\"" 601 << collectinfo .numBytes749 << collectinfo->numBytes 602 750 << "\"</td></tr>\n" 603 751 604 752 << "<tr><th>preferred receptionist</th><td>\"" 605 << collectinfo .receptionist753 << collectinfo->receptionist 606 754 << "\"</td></tr>\n" 607 755 … … 609 757 610 758 } else { 611 textout << outconvert << "Error (" << get_comerror_string (err) 612 << ") while getting collect information\n"; 759 textout << "ERROR (statusaction::output_collectioninfo): while getting collect information\n"; 613 760 } 614 761 … … 617 764 InfoFilterOptionsRequest_t filteroptions_request; 618 765 InfoFilterOptionsResponse_t filteroptions; 766 comerror_t err; 619 767 rproto->get_filterinfo (arg_c, filterinfo, err, logout); 620 768 if (err == noError) { … … 722 870 textout << outconvert << "<h2>Init log</h2>\n"; 723 871 872 #ifdef GSDL_USE_IOS_H 724 873 ifstream initin (cinitfilename, ios::in | ios::nocreate); 874 #else 875 ifstream initin (cinitfilename, ios::in); 876 #endif 877 725 878 delete cinitfilename; 726 879 if (initin) { … … 762 915 logout << flush; 763 916 917 #ifdef GSDL_USE_IOS_H 764 918 ifstream errin (cerrfilename, ios::in | ios::nocreate); 919 #else 920 ifstream errin (cerrfilename, ios::in); 921 #endif 922 765 923 delete cerrfilename; 766 924 if (errin) { … … 856 1014 } 857 1015 858 bool statusaction::do_action (cgiargsclass &args, recptprotolistclass * /*protos*/,1016 bool statusaction::do_action (cgiargsclass &args, recptprotolistclass *protos, 859 1017 browsermapclass * /*browsers*/, displayclass &disp, 860 1018 outconvertclass &outconvert, ostream &textout, … … 898 1056 if (arg_sp == "frameset") output_frameset (args, disp, outconvert, textout, logout); 899 1057 else if (arg_sp == "select") output_select (args, disp, outconvert, textout, logout); 900 else if (arg_sp == "welcome") output_welcome (args, disp, outconvert, textout, logout);1058 else if (arg_sp == "welcome") output_welcome (args, protos, disp, outconvert, textout, logout); 901 1059 else if (arg_sp == "generalinfo") output_generalinfo (args, disp, outconvert, textout, logout); 902 1060 else if (arg_sp == "argumentinfo") output_argumentinfo (args, disp, outconvert, textout, logout); 903 1061 else if (arg_sp == "actioninfo") output_actioninfo (args, disp, outconvert, textout, logout); 1062 else if (arg_sp == "browserinfo") output_browserinfo (args, disp, outconvert, textout, logout); 904 1063 else if (arg_sp == "protocolinfo") output_protocolinfo (args, disp, outconvert, textout, logout); 905 1064 else if (arg_sp == "collectioninfo") output_collectioninfo (args, disp, outconvert, textout, logout);
Note:
See TracChangeset
for help on using the changeset viewer.