Changeset 1342 for branches/z3950-branch/gsdl/src/recpt/statusaction.cpp
- Timestamp:
- 2000-08-03T14:49:41+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/z3950-branch/gsdl/src/recpt/statusaction.cpp
r1129 r1342 22 22 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 23 23 * 24 * $Id$25 *26 24 *********************************************************************/ 27 28 /*29 $Log$30 Revision 1.26 2000/04/19 22:30:23 sjboddie31 tidied up status pages and end-user collection building32 33 Revision 1.25 2000/02/29 21:00:31 sjboddie34 fixed some compiler warnings35 36 Revision 1.24 1999/12/06 01:13:02 sjboddie37 macrofiles is now a set to allow for multiple gsdlhomes38 39 Revision 1.23 1999/11/09 02:26:20 sjboddie40 added some new(ish) options41 42 Revision 1.22 1999/11/01 21:55:27 sjboddie43 changes to arguments of many functions44 45 Revision 1.21 1999/10/19 03:23:46 davidb46 Collection building support through web pages47 and internal and external link handling for collection documents48 49 Revision 1.20 1999/10/18 20:10:41 sjboddie50 don't want to use authentication to reach status page (usersaction still51 uses authentication)52 53 Revision 1.19 1999/09/07 23:09:40 rjmcnab54 removed some compiler warnings55 56 Revision 1.18 1999/09/07 04:57:00 sjboddie57 added GPL notice58 59 Revision 1.17 1999/09/03 09:53:46 rjmcnab60 Output more configuration options for the receptionist.61 62 Revision 1.16 1999/09/02 00:28:42 rjmcnab63 removed dependancy on GSDL_GSDLHOME64 65 Revision 1.15 1999/07/30 02:24:42 sjboddie66 added collectinfo argument to some functions67 68 Revision 1.14 1999/07/13 23:26:07 rjmcnab69 Added support for authenaction and usersaction70 71 Revision 1.13 1999/06/08 04:29:39 sjboddie72 added argsinfo to the call to check_cgiargs to make it easy to set73 args to their default if they're found to be screwed up74 75 Revision 1.12 1999/04/06 22:20:35 rjmcnab76 Got browsefilter working.77 78 Revision 1.11 1999/03/31 23:44:49 rjmcnab79 Altered the protocol so that the metadata is part of the filter.80 81 Revision 1.10 1999/03/16 04:47:03 rjmcnab82 Changed the list of arguments on the argument page to be the info list83 not the current args list (there are some arguments which don't have84 a default so they never make it onto the args list).85 86 Revision 1.9 1999/03/11 01:26:02 rjmcnab87 Fixed a few small formatting things.88 89 Revision 1.8 1999/03/11 00:12:30 rjmcnab90 Started using status.dm to handle the bulky text. Made the status91 action use frames and added some more information.92 93 Revision 1.7 1999/03/09 21:00:47 rjmcnab94 Reorganised the statusaction, added more functions to comtypes.95 96 Revision 1.6 1999/02/25 21:59:02 rjmcnab97 98 Merged sources.99 100 Revision 1.5 1999/02/21 22:33:58 rjmcnab101 102 Lots of stuff :-)103 104 Revision 1.4 1999/02/12 02:40:18 sjboddie105 106 Added page action107 108 Revision 1.3 1999/02/11 23:07:00 sjboddie109 110 extended the status action111 112 Revision 1.2 1999/02/11 01:24:06 rjmcnab113 114 Fixed a few compiler warnings.115 116 Revision 1.1 1999/02/11 01:01:27 rjmcnab117 118 Initial revision.119 120 */121 122 25 123 26 #include "statusaction.h" … … 144 47 displayclass &disp, outconvertclass &outconvert, 145 48 ostream &textout, ostream &logout) { 49 50 if (recpt == NULL) return; 146 51 147 52 textout << outconvert << disp … … 175 80 << "</a></td>"; 176 81 177 ColInfoResponse_t cinfo; 178 (*rprotolist_here).p->get_collectinfo (*collist_here, cinfo, err, logout); 179 if (err == noError) { 82 ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr ((*rprotolist_here).p, *collist_here, logout); 83 if (cinfo != NULL) { 180 84 text_t collname = *collist_here; 181 text_tmap::iterator it = cinfo .collectionmeta.find("collectionname");182 if (it != cinfo .collectionmeta.end()) collname = (*it).second;85 text_tmap::iterator it = cinfo->collectionmeta.find("collectionname"); 86 if (it != cinfo->collectionmeta.end()) collname = (*it).second; 183 87 184 88 textout << "<td>"; 185 if (cinfo .buildDate > 0)89 if (cinfo->buildDate > 0) 186 90 textout << outconvert << disp 187 91 << "<a href=\"_httppagex_(about)&c=" << *collist_here 188 << "\" target= _top>";92 << "\" target=\\_top>"; 189 93 190 94 textout << outconvert << disp << collname; 191 95 192 if (cinfo .buildDate > 0) textout << "</a>";96 if (cinfo->buildDate > 0) textout << "</a>"; 193 97 194 98 textout << "</td>"; 195 99 196 if (cinfo .isPublic) textout << "<td>yes</td>";100 if (cinfo->isPublic) textout << "<td>yes</td>"; 197 101 else textout << "<td>no</td>"; 198 102 199 if (cinfo .buildDate > 0)103 if (cinfo->buildDate > 0) 200 104 textout << outconvert << "<td>yes</td>"; 201 105 else … … 328 232 } 329 233 234 // browsers 235 browsermapclass *browsers = recpt->get_browsermap_ptr(); 236 if (browsers != NULL) { 237 textout << outconvert << "<tr valign=top><th>browsers</th><td>"; 238 239 browserptrmap::iterator browsershere = browsers->begin (); 240 browserptrmap::iterator browsersend = browsers->end (); 241 bool browsersfirst = true; 242 while (browsershere != browsersend) { 243 if (!browsersfirst) textout << outconvert << ", "; 244 browsersfirst = false; 245 assert ((*browsershere).second.b != NULL); 246 if ((*browsershere).second.b != NULL) { 247 textout << outconvert << "\"" << (*browsershere).second.b->get_browser_name() << "\""; 248 } 249 browsershere++; 250 } 251 252 textout << outconvert << "</td></tr>\n"; 253 } 254 330 255 // protocols 331 256 recptprotolistclass *protocols = recpt->get_recptprotolist_ptr (); … … 471 396 } 472 397 398 void statusaction::output_browserinfo (cgiargsclass &/*args*/, displayclass &disp, 399 outconvertclass &outconvert, 400 ostream &textout, ostream &/*logout*/) { 401 if (recpt == NULL) return; 402 browsermapclass *browsers = recpt->get_browsermap_ptr(); 403 404 textout << outconvert << disp << "_status:infoheader_(Browser Information)\n"; 405 textout << outconvert 406 << "<h2>Browser information</h2>\n" 407 << "<table>"; 408 409 // browser information 410 if (browsers != NULL) { 411 textout << outconvert 412 << "<tr><th>browser name</th><th>default formatstring</th></tr>\n"; 413 414 browserptrmap::iterator browsershere = browsers->begin (); 415 browserptrmap::iterator browsersend = browsers->end (); 416 while (browsershere != browsersend) { 417 assert ((*browsershere).second.b != NULL); 418 if ((*browsershere).second.b != NULL) { 419 textout << outconvert 420 << "<tr><td>" << (*browsershere).second.b->get_browser_name() 421 << "</td><td>" << html_safe ((*browsershere).second.b->get_default_formatstring()) 422 << "</td></tr>\n"; 423 } 424 browsershere++; 425 } 426 } 427 428 textout << outconvert << disp << "</table>\n_status:infofooter_\n"; 429 } 430 473 431 void statusaction::output_protocolinfo (cgiargsclass &/*args*/, displayclass &disp, 474 432 outconvertclass &outconvert, … … 584 542 } else { 585 543 // rproto can't be NULL to get here 586 ColInfoResponse_t collectinfo; 587 comerror_t err; 588 589 rproto->get_collectinfo (arg_c, collectinfo, err, logout); 590 if (err == noError) { 544 ColInfoResponse_t *collectinfo = recpt->get_collectinfo_ptr (rproto, arg_c, logout); 545 if (collectinfo != NULL) { 591 546 textout << outconvert << "<table>\n" 592 547 << "<tr><th>collection name</th><td>\"" 593 << collectinfo .shortInfo.name548 << collectinfo->shortInfo.name 594 549 << "\"</td></tr>\n" 595 550 596 551 << "<tr><th>host</th><td>\"" 597 << collectinfo .shortInfo.host552 << collectinfo->shortInfo.host 598 553 << "\"</td></tr>\n" 599 554 600 555 << "<tr><th>port</th><td>\"" 601 << collectinfo .shortInfo.port556 << collectinfo->shortInfo.port 602 557 << "\"</td></tr>\n" 603 558 604 559 << "<tr><th>is public?</th><td>"; 605 if (collectinfo .isPublic) textout << outconvert << "true";560 if (collectinfo->isPublic) textout << outconvert << "true"; 606 561 else textout << outconvert << "false"; 607 562 textout << outconvert … … 609 564 610 565 << "<tr><th>is beta?</th><td>"; 611 if (collectinfo .isBeta) textout << outconvert << "true";566 if (collectinfo->isBeta) textout << outconvert << "true"; 612 567 else textout << outconvert << "false"; 613 568 textout << outconvert … … 615 570 616 571 << "<tr><th>build date</th><td>\"" 617 << collectinfo .buildDate572 << collectinfo->buildDate 618 573 << "\"</td></tr>\n" 619 574 620 575 << "<tr><th>interface languages</th><td>"; 621 text_tarray::iterator languages_here = collectinfo .languages.begin();622 text_tarray::iterator languages_end = collectinfo .languages.end();576 text_tarray::iterator languages_here = collectinfo->languages.begin(); 577 text_tarray::iterator languages_end = collectinfo->languages.end(); 623 578 bool languages_first = true; 624 579 while (languages_here != languages_end) { … … 630 585 631 586 textout << "<tr><th valign=top>collection metadata</th><td><table>\n"; 632 text_tmap::iterator meta_here = collectinfo .collectionmeta.begin();633 text_tmap::iterator meta_end = collectinfo .collectionmeta.end();587 text_tmap::iterator meta_here = collectinfo->collectionmeta.begin(); 588 text_tmap::iterator meta_end = collectinfo->collectionmeta.end(); 634 589 while (meta_here != meta_end) { 635 590 textout << outconvert << "<tr><td>" << (*meta_here).first … … 640 595 641 596 textout << "<tr><th valign=top>format info</th><td><table>\n"; 642 text_tmap::iterator format_here = collectinfo .format.begin();643 text_tmap::iterator format_end = collectinfo .format.end();597 text_tmap::iterator format_here = collectinfo->format.begin(); 598 text_tmap::iterator format_end = collectinfo->format.end(); 644 599 while (format_here != format_end) { 645 600 textout << outconvert << "<tr><td>" << (*format_here).first … … 650 605 651 606 textout << "<tr><th valign=top>building info</th><td><table>\n"; 652 text_tmap::iterator building_here = collectinfo .building.begin();653 text_tmap::iterator building_end = collectinfo .building.end();607 text_tmap::iterator building_here = collectinfo->building.begin(); 608 text_tmap::iterator building_end = collectinfo->building.end(); 654 609 while (building_here != building_end) { 655 610 textout << outconvert << "<tr><td>" << (*building_here).first … … 663 618 664 619 << "<tr><th>number of documents</th><td>\"" 665 << collectinfo .numDocs620 << collectinfo->numDocs 666 621 << "\"</td></tr>\n" 667 622 623 << "<tr><th>number of sections</th><td>\"" 624 << collectinfo->numSections 625 << "\"</td></tr>\n" 626 668 627 << "<tr><th>number of words</th><td>\"" 669 << collectinfo .numWords628 << collectinfo->numWords 670 629 << "\"</td></tr>\n" 671 630 672 631 << "<tr><th>number of bytes</th><td>\"" 673 << collectinfo .numBytes632 << collectinfo->numBytes 674 633 << "\"</td></tr>\n" 675 634 676 635 << "<tr><th>preferred receptionist</th><td>\"" 677 << collectinfo .receptionist636 << collectinfo->receptionist 678 637 << "\"</td></tr>\n" 679 638 … … 681 640 682 641 } else { 683 textout << outconvert << "Error (" << get_comerror_string (err) 684 << ") while getting collect information\n"; 642 textout << "ERROR (statusaction::output_collectioninfo): while getting collect information\n"; 685 643 } 686 644 … … 689 647 InfoFilterOptionsRequest_t filteroptions_request; 690 648 InfoFilterOptionsResponse_t filteroptions; 649 comerror_t err; 691 650 rproto->get_filterinfo (arg_c, filterinfo, err, logout); 692 651 if (err == noError) { … … 794 753 textout << outconvert << "<h2>Init log</h2>\n"; 795 754 755 #ifdef GSDL_USE_IOS_H 796 756 ifstream initin (cinitfilename, ios::in | ios::nocreate); 757 #else 758 ifstream initin (cinitfilename, ios::in); 759 #endif 760 797 761 delete cinitfilename; 798 762 if (initin) { … … 834 798 logout << flush; 835 799 800 #ifdef GSDL_USE_IOS_H 836 801 ifstream errin (cerrfilename, ios::in | ios::nocreate); 802 #else 803 ifstream errin (cerrfilename, ios::in); 804 #endif 805 837 806 delete cerrfilename; 838 807 if (errin) { … … 974 943 else if (arg_sp == "argumentinfo") output_argumentinfo (args, disp, outconvert, textout, logout); 975 944 else if (arg_sp == "actioninfo") output_actioninfo (args, disp, outconvert, textout, logout); 945 else if (arg_sp == "browserinfo") output_browserinfo (args, disp, outconvert, textout, logout); 976 946 else if (arg_sp == "protocolinfo") output_protocolinfo (args, disp, outconvert, textout, logout); 977 947 else if (arg_sp == "collectioninfo") output_collectioninfo (args, disp, outconvert, textout, logout); … … 996 966 } 997 967 } 998
Note:
See TracChangeset
for help on using the changeset viewer.