Changeset 284
- Timestamp:
- 1999-06-24T17:12:25+12:00 (25 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/browsetools.cpp
r282 r284 12 12 /* 13 13 $Log$ 14 Revision 1.9 1999/06/24 05:12:15 sjboddie 15 lots of small changes 16 14 17 Revision 1.8 1999/06/17 03:06:53 sjboddie 15 18 got detach button working properly - the close book icon is now disabled … … 268 271 } 269 272 273 // ouput_list_toc generates and outputs a List type table of contents 274 // it should only be called for classifications (i.e. when the "d" 275 // argument isn't set) as it doesn't make sense to display document 276 // level stuff in this way (I think !!) 277 void output_list_toc (const text_t &classifytitle, cgiargsclass &args, 278 recptproto *collectproto, displayclass &disp, 279 outconvertclass &outconvert, ostream &textout, 280 ostream &logout) { 281 282 text_tarray metadata; 283 FilterResponse_t response; 284 text_t &arg_cl = args["cl"]; 285 text_t doclink = "<a href=\"_httpdocument_&cl=" + arg_cl + "&d="; 286 287 if (classifytitle != "Title") metadata.push_back (classifytitle); 288 metadata.push_back ("Title"); 289 290 if (get_children (arg_cl, args["c"], metadata, collectproto, response, logout)) { 291 292 textout 293 << "\n<!-- Table of Contents produced by browsetools::output_list_toc " 294 << "-->\n\n<table cellpadding=0 cellspacing=2>\n"; 295 296 ResultDocInfo_tarray::const_iterator sechere = response.docInfo.begin(); 297 ResultDocInfo_tarray::const_iterator secend = response.docInfo.end(); 298 299 while (sechere != secend) { 300 301 const text_t &ctitle = (*sechere).metadata[0].values[0]; 302 const text_t &title = (*sechere).metadata[1].values[0]; 303 304 if (!ctitle.empty()) { 305 textout << outconvert << disp << "<tr><td valign=top>" << doclink << (*sechere).OID 306 << "\">_document:iconclosedbook_</a></td><td>" 307 << ctitle << "</td><td>"; 308 } else if (!title.empty()) { 309 textout << outconvert << disp << "<tr><td valign=top>" << doclink << (*sechere).OID 310 << "\">_document:iconclosedbook_</a></td><td>" << title << "</td><td>"; 311 } 312 313 textout << "</td></tr>\n"; 314 sechere ++; 315 } 316 textout << "</table>\n<!-- end of Table of Contents -->\n"; 317 } 318 } 319 270 320 // ouput_azlist_toc generates and outputs an AZList type table of contents 271 321 // it should only be called for classifications (i.e. when the "d" … … 289 339 290 340 textout 291 << "\n<!-- Table of Contents produced by browsetools::output_ list_toc "341 << "\n<!-- Table of Contents produced by browsetools::output_azlist_toc " 292 342 << "-->\n\n<table cellpadding=0 cellspacing=2>\n"; 293 343 … … 303 353 if (!creator.empty()) { 304 354 textout << outconvert << disp << "<tr><td valign=top>" << doclink << (*sechere).OID 305 << "\">_ iconclosedbook_</a></td><td>"355 << "\">_document:iconclosedbook_</a></td><td>" 306 356 << creator << "</td><td>"; 307 357 … … 312 362 if (!title.empty()) { 313 363 textout << outconvert << disp << "<tr><td valign=top>" << doclink << (*sechere).OID 314 << "\">_ iconclosedbook_</a></td><td>" << title << "</td><td>";364 << "\">_document:iconclosedbook_</a></td><td>" << title << "</td><td>"; 315 365 316 366 if (!creator.empty()) … … 437 487 438 488 // set up icon 439 icon = "_ iconsmalltext_";489 icon = "_document:iconsmalltext_"; 440 490 if (is_top((*thissection).OID)) 441 if (classifytype == "Document") icon = "_ iconopenbook_";491 if (classifytype == "Document") icon = "_document:iconopenbook_"; 442 492 else 443 if (doctype == "classify") icon = "_ iconopenbookshelf_";444 else icon = "_ iconclosedbook_";493 if (doctype == "classify") icon = "_document:iconopenbookshelf_"; 494 else icon = "_document:iconclosedbook_"; 445 495 else if (haschildren) 446 if (classifytype == "Document") icon = "_ iconopenfolder_";447 else icon = "_ iconopenbookshelf_";496 if (classifytype == "Document") icon = "_document:iconopenfolder_"; 497 else icon = "_document:iconopenbookshelf_"; 448 498 449 499 // set up tabbing … … 457 507 458 508 for (int i = 0; i < tabcols; i++) 459 icontabs += "_ icontab_";509 icontabs += "_document:icontab_"; 460 510 461 511 // set up pointer 462 512 if (classifytype == "Document" && !gt) { 463 if ((*thissection).OID == OID) pointer = "_ iconpointer_";464 else pointer = "_ icontab_";513 if ((*thissection).OID == OID) pointer = "_document:iconpointer_"; 514 else pointer = "_document:icontab_"; 465 515 tabcols ++; 466 516 } … … 550 600 551 601 // set up icon for this parent 552 icon = "_ iconopenfolder_";553 if (doctype == "classify") icon = "_ iconopenbookshelf_";554 else if (is_top(*thisparent)) icon = "_ iconopenbook_";602 icon = "_document:iconopenfolder_"; 603 if (doctype == "classify") icon = "_document:iconopenbookshelf_"; 604 else if (is_top(*thisparent)) icon = "_document:iconopenbook_"; 555 605 556 606 for (int j = 0; j < tabcount; j++) 557 icontabs += "_ icontab_";607 icontabs += "_document:icontab_"; 558 608 559 609 if (doctype != "classify") { 560 610 if (*thisparent == args["d"]) { 561 icontabs += "_ iconpointer_";611 icontabs += "_document:iconpointer_"; 562 612 if (is_top (*thisparent)) 563 613 tabcount ++; … … 624 674 625 675 // set up icon for this sibling 626 icon = "_ iconclosedfolder_";627 if (doctype == "classify") icon = "_ iconclosedbookshelf_";628 else if (is_top((*thissibling).OID)) icon = "_ iconclosedbook_";676 icon = "_document:iconclosedfolder_"; 677 if (doctype == "classify") icon = "_document:iconclosedbookshelf_"; 678 else if (is_top((*thissibling).OID)) icon = "_document:iconclosedbook_"; 629 679 630 680 // fit pointer into tabbing if current section 631 681 // note that we don't want pointers at classification levels anymore 632 682 // (unless the classification contains text) 633 pointer = "_ icontab_";683 pointer = "_document:icontab_"; 634 684 if (doctype == "classify") { 635 685 if ((*thissibling).OID == args["cl"] && hastxt) 636 pointer = "_ iconpointer_";637 } else if ((*thissibling).OID == args["d"]) pointer = "_ iconpointer_";686 pointer = "_document:iconpointer_"; 687 } else if ((*thissibling).OID == args["d"]) pointer = "_document:iconpointer_"; 638 688 639 689 text_t thesetabs; 640 690 for (int j = 0; j < (tabcount - 1); j++) 641 thesetabs += "_ icontab_";691 thesetabs += "_document:icontab_"; 642 692 643 693 tab = "<td valign=top"; … … 647 697 if (!haschildren) { 648 698 // sibling is text document 649 icon = "_ iconsmalltext_";699 icon = "_document:iconsmalltext_"; 650 700 text_t link; 651 701 if (doctype == "classify") link = "&cl=" + (*thissibling).OID; -
trunk/gsdl/src/recpt/browsetools.h
r257 r284 38 38 outconvertclass &outconvert, ostream &textout, 39 39 ostream &logout); 40 void output_list_toc (const text_t &classifytitle, cgiargsclass &args, 41 recptproto *collectproto, displayclass &disp, 42 outconvertclass &outconvert, ostream &textout, 43 ostream &logout); 40 44 void output_azlist_toc (const text_t &classifytitle, cgiargsclass &args, 41 45 recptproto *collectproto, displayclass &disp, -
trunk/gsdl/src/recpt/cgiwrapper.cpp
r248 r284 12 12 /* 13 13 $Log$ 14 Revision 1.13 1999/06/24 05:12:18 sjboddie 15 lots of small changes 16 14 17 Revision 1.12 1999/04/30 01:59:40 sjboddie 15 18 lots of stuff - getting documentaction working (documentaction replaces … … 352 355 353 356 pageaction apageaction; 357 apageaction.set_receptionist (&recpt); 354 358 recpt.add_action (&apageaction); 355 359 -
trunk/gsdl/src/recpt/documentaction.cpp
r282 r284 12 12 /* 13 13 $Log$ 14 Revision 1.8 1999/06/24 05:12:20 sjboddie 15 lots of small changes 16 14 17 Revision 1.7 1999/06/17 03:06:58 sjboddie 15 18 got detach button working properly - the close book icon is now disabled … … 148 151 } 149 152 150 bool documentaction::check_cgiargs (cgiargsinfoclass &/*argsinfo*/, cgiargsclass &/*args*/, 151 ostream &/*logout*/) { 152 // don't want to check anything yet. 153 bool documentaction::check_cgiargs (cgiargsinfoclass &argsinfo, cgiargsclass &args, 154 ostream &logout) { 155 156 // note that "gp" argument gets checked in define_external_macros() 157 158 // check gc argument 159 int arg_gc = args.getintarg("gc"); 160 if (arg_gc != 0 && arg_gc != 1) { 161 logout << "Warning: \"gc\" argument out of range (" << arg_gc << ")\n"; 162 cgiarginfo *gcinfo = argsinfo.getarginfo ("gc"); 163 if (gcinfo != NULL) args["gc"] = gcinfo->argdefault; 164 } 165 166 // check gt argument (may be either 0, 1 or 2) 167 int arg_gt = args.getintarg("gt"); 168 if (arg_gt != 0 && arg_gt != 1 && arg_gt != 2) { 169 logout << "Warning: \"gt\" argument out of range (" << arg_gt << ")\n"; 170 cgiarginfo *gtinfo = argsinfo.getarginfo ("gt"); 171 if (gtinfo != NULL) args["gt"] = gtinfo->argdefault; 172 } 173 174 // check hl argument 175 int arg_hl = args.getintarg("hl"); 176 if (arg_hl != 0 && arg_hl != 1) { 177 logout << "Warning: \"hl\" argument out of range (" << arg_hl << ")\n"; 178 cgiarginfo *hlinfo = argsinfo.getarginfo ("hl"); 179 if (hlinfo != NULL) args["hl"] = hlinfo->argdefault; 180 } 181 182 // check x argument 183 int arg_x = args.getintarg("x"); 184 if (arg_x != 0 && arg_x != 1) { 185 logout << "Warning: \"x\" argument out of range (" << arg_x << ")\n"; 186 cgiarginfo *xinfo = argsinfo.getarginfo ("x"); 187 if (xinfo != NULL) args["x"] = xinfo->argdefault; 188 } 189 153 190 return true; 154 191 } … … 380 417 381 418 text_t pagetitle; 382 text_tarray::const_iterator this_title = response.docInfo[0].metadata[0].values.begin(); 383 text_tarray::const_iterator end_title = response.docInfo[0].metadata[0].values.end(); 384 while (this_title != end_title) { 385 if ((this_title + 1) == end_title) pagetitle += *this_title; 386 else pagetitle += *this_title + ": "; 387 this_title ++; 419 if (args.getintarg("gt") == 2) 420 pagetitle = *(response.docInfo[0].metadata[0].values.begin()); 421 else { 422 text_tarray::const_iterator this_title = response.docInfo[0].metadata[0].values.begin(); 423 text_tarray::const_iterator end_title = response.docInfo[0].metadata[0].values.end(); 424 while (this_title != end_title) { 425 if ((this_title + 1) == end_title) pagetitle += *this_title; 426 else pagetitle += *this_title + ": "; 427 this_title ++; 428 } 388 429 } 389 430 disp.setmacro ("pagetitle", "document", pagetitle); … … 423 464 text_t &classifytype = response.docInfo[0].metadata[1].values[0]; 424 465 425 disp.setmacro ("imagethispage", "document", 426 "_icon" + title + "page_"); 466 disp.setmacro ("pagetitle", "document", "_text" + title + "page_"); 467 468 disp.setmacro ("imagethispage", "document", "_icon" + title + "page_"); 427 469 428 470 // now get the metadata for each child of top level … … 495 537 text_tarray metadata; 496 538 FilterResponse_t response; 497 FilterResponse_t queryresponse;498 DocumentRequest_t docrequest;499 DocumentResponse_t docresponse;500 539 text_t topparent, classifytype, classifytitle; 501 comerror_t err;502 bool highlight = false;503 540 504 541 text_t &arg_d = args["d"]; 505 542 text_t &arg_cl = args["cl"]; 506 text_t &collection = args["c"];507 543 508 544 text_t OID = arg_d; … … 515 551 textout << outconvert << disp << "Document contains no data_document:footer_\n"; 516 552 return true; 517 }518 519 // if we have a query string and highlighting is turned on we need520 // to redo the query to get the terms for highlighting521 if (!args["q"].empty() && args.getintarg("hl")) {522 FilterRequest_t request;523 text_t quotedstring; // don't use this here524 request.filterResultOptions = FRmatchTerms;525 if (do_query (request, args, collectproto, quotedstring, queryresponse, logout))526 highlight = true;527 553 } 528 554 … … 531 557 metadata.push_back ("Title"); 532 558 metadata.push_back ("classifytype"); 533 if (get_info (topparent, collection, metadata, false, collectproto, response, logout)) {559 if (get_info (topparent, args["c"], metadata, false, collectproto, response, logout)) { 534 560 classifytitle = response.docInfo[0].metadata[0].values[0]; 535 561 classifytype = response.docInfo[0].metadata[1].values[0]; 536 562 } 537 563 564 // output the table of contents 538 565 if (!arg_d.empty()) { 539 566 … … 542 569 outconvert, textout, logout); 543 570 else 544 // Book is the default for a document level toc - AZList and Datelist don't545 // make sense for document level571 // Book is the default for a document level toc - AZList, List and 572 // Datelist don't make sense for document level 546 573 output_book_toc (classifytitle, args, collectproto, disp, 547 574 outconvert, textout, logout); … … 554 581 output_datelist_toc (classifytitle, args, collectproto, disp, 555 582 outconvert, textout, logout); 583 else if (classifytype == "List") 584 output_list_toc (classifytitle, args, collectproto, disp, 585 outconvert, textout, logout); 556 586 else 557 587 // AZList is the default for a classification level toc - Book doesn't make … … 560 590 outconvert, textout, logout); 561 591 } 562 563 // get info on this document 564 metadata.erase (metadata.begin(), metadata.end()); 565 metadata.push_back("Title"); 566 metadata.push_back("hastxt"); 567 metadata.push_back("haschildren"); 568 569 if (get_info (OID, collection, metadata, false, collectproto, response, logout)) { 570 text_t &title = response.docInfo[0].metadata[0].values[0]; 571 int hastxt = response.docInfo[0].metadata[1].values[0].getint(); 572 int haschildren = response.docInfo[0].metadata[2].values[0].getint(); 592 593 // output the document text 594 output_document (OID, args, collectproto, disp, outconvert, textout, logout); 595 596 textout << outconvert << disp << "_document:footer_\n"; 597 } 598 return true; 599 } 600 601 602 void documentaction::output_document (const text_t &OID, cgiargsclass &args, 603 recptproto *collectproto, displayclass &disp, 604 outconvertclass &outconvert, ostream &textout, 605 ostream &logout) { 606 FilterResponse_t inforesponse; 607 DocumentRequest_t docrequest; 608 DocumentResponse_t docresponse; 609 FilterResponse_t queryresponse; 610 comerror_t err; 611 text_tarray metadata; 612 bool highlight = false; 613 int arg_gt = args.getintarg("gt"); 614 text_t &collection = args["c"]; 615 616 // if we have a query string and highlighting is turned on we need 617 // to redo the query to get the terms for highlighting 618 if (!args["q"].empty() && args.getintarg("hl")) { 619 FilterRequest_t request; 620 request.filterResultOptions = FRmatchTerms; 621 text_t quotedquery; // not used 622 if (do_query (request, args, collectproto, quotedquery, queryresponse, logout)) 623 highlight = true; 624 } 625 626 // get info on this document 627 metadata.push_back("Title"); 628 metadata.push_back("hastxt"); 629 metadata.push_back("haschildren"); 630 631 if (get_info (OID, collection, metadata, false, collectproto, inforesponse, logout)) { 632 text_t title = inforesponse.docInfo[0].metadata[0].values[0]; 633 int hastxt = inforesponse.docInfo[0].metadata[1].values[0].getint(); 634 int haschildren = inforesponse.docInfo[0].metadata[2].values[0].getint(); 573 635 574 int gt = args.getintarg("gt"); 575 if (gt == 0) { 576 if (hastxt == 1) { 577 // get the text 636 if (arg_gt == 0) { 637 if (hastxt == 1) { 638 // get the text 639 docrequest.OID = OID; 640 collectproto->get_document (collection, docrequest, docresponse, err, logout); 641 642 textout << outconvert << disp << "<p>\n<h3>" << title << "</h3>"; 643 if (highlight) 644 highlighttext(docresponse.doc, queryresponse.termInfo, disp, 645 outconvert, textout, logout); 646 else 647 textout << outconvert << disp << docresponse.doc; 648 } 649 } else { 650 651 // text is to be expanded 652 text_t exOID = OID; 653 if (!haschildren) exOID = get_parent (OID); 654 655 // if we're not in a document (i.e. we're in a top level classification) 656 // we need to pass the "classify" string to get_contents so that it 657 // doesn't recurse all the way through each document in the classification 658 text_t classifytype; 659 if (args["d"].empty()) classifytype = "classify"; 660 661 int i; // not used 662 get_contents (exOID, classifytype, i, collection, collectproto, inforesponse, logout); 663 664 ResultDocInfo_tarray::const_iterator sechere = inforesponse.docInfo.begin(); 665 ResultDocInfo_tarray::const_iterator secend = inforesponse.docInfo.end(); 666 667 if (arg_gt == 1) { 668 // check if there are more than 10 sections containing text to be expanded - 669 // if there are output warning message - this isn't a great way to do this 670 // since the sections may be very large or very small - one day I'll fix it 671 // -- Stefan. 672 int seccount = 0; 673 while (sechere != secend) { 674 if ((*sechere).metadata[3].values[0] == "1") seccount ++; 675 if (seccount > 10) break; 676 sechere ++; 677 } 678 if (seccount > 10) { 679 // more than 10 sections so output warning message and text 680 // for current section only 681 textout << outconvert << disp << "_document:textltwarning_"; 578 682 docrequest.OID = OID; 579 683 collectproto->get_document (collection, docrequest, docresponse, err, logout); … … 586 690 textout << outconvert << disp << docresponse.doc; 587 691 } 588 } else { 589 590 // text is to be expanded 591 int tmp; // this doesn't get used here 592 if (!haschildren) 593 OID = get_parent (OID); 594 595 get_contents (OID, classifytype, tmp, collection, collectproto, response, logout); 596 597 ResultDocInfo_tarray::const_iterator sechere = response.docInfo.begin(); 598 ResultDocInfo_tarray::const_iterator secend = response.docInfo.end(); 599 600 if (gt == 1) { 601 // check if there are more than 10 sections containing text to be expanded - 602 // if there are output warning message - this isn't a great way to do this 603 // since the sections may be very large or very small - one day I'll fix it 604 // -- Stefan. 605 int seccount = 0; 606 while (sechere != secend) { 607 if ((*sechere).metadata[3].values[0] == "1") seccount ++; 608 if (seccount > 10) break; 609 sechere ++; 692 else arg_gt = 2; 693 } 694 695 if (arg_gt == 2) { 696 // get the text for each section 697 sechere = inforesponse.docInfo.begin(); 698 int count = 0; 699 while (sechere != secend) { 700 textout << outconvert << disp << "\n<p><a name=" << count << "><h3>" 701 << (*sechere).metadata[0].values[0] << "</h3></a>\n"; 702 if ((*sechere).metadata[3].values[0] == "1") { 703 docrequest.OID = (*sechere).OID; 704 collectproto->get_document (collection, docrequest, docresponse, err, logout); 705 if (highlight) 706 highlighttext(docresponse.doc, queryresponse.termInfo, disp, 707 outconvert, textout, logout); 708 else 709 textout << outconvert << disp << docresponse.doc; 610 710 } 611 if (seccount > 10) textout << outconvert << disp << "_document:textltwarning_";612 else gt = 2;711 count ++; 712 sechere ++; 613 713 } 614 615 if (gt == 2) { 616 // get the text for each section 617 sechere = response.docInfo.begin(); 618 int count = 0; 619 while (sechere != secend) { 620 textout << outconvert << disp << "\n<p><a name=" << count << "><h3>" 621 << (*sechere).metadata[0].values[0] << "</h3></a>\n"; 622 if ((*sechere).metadata[3].values[0] == "1") { 623 docrequest.OID = (*sechere).OID; 624 collectproto->get_document (collection, docrequest, docresponse, err, logout); 625 if (highlight) 626 highlighttext(docresponse.doc, queryresponse.termInfo, disp, 627 outconvert, textout, logout); 628 else 629 textout << outconvert << disp << docresponse.doc; 630 } 631 count ++; 632 sechere ++; 633 } 634 } 635 } 636 } 637 textout << outconvert << disp << "_document:footer_\n"; 638 } 639 return true; 640 } 641 714 } 715 } 716 } 717 } 642 718 643 719 // highlighttext highlights query terms in text string and outputs the resulting text string -
trunk/gsdl/src/recpt/documentaction.h
r267 r284 20 20 21 21 protected: 22 void output_document (const text_t &OID, cgiargsclass &args, 23 recptproto *collectproto, displayclass &disp, 24 outconvertclass &outconvert, ostream &textout, 25 ostream &logout); 26 22 27 void highlighttext(text_t &text, TermInfo_tarray &terms, displayclass &disp, 23 28 outconvertclass &outconvert, ostream &textout, ostream &logout); -
trunk/gsdl/src/recpt/pageaction.cpp
r266 r284 12 12 /* 13 13 $Log$ 14 Revision 1.7 1999/06/24 05:12:24 sjboddie 15 lots of small changes 16 14 17 Revision 1.6 1999/06/10 00:39:16 sjboddie 15 18 navigation bar is no longer written out for every page (it should … … 42 45 #include "pageaction.h" 43 46 #include "receptionist.h" 44 47 #include <time.h> 45 48 46 49 pageaction::pageaction () { 50 51 recpt = NULL; 52 47 53 // this action uses cgi variables "a" and "p" 48 54 cgiarginfo arg_ainfo; … … 79 85 } 80 86 87 88 void pageaction::define_internal_macros (displayclass &disp, cgiargsclass &args, 89 recptproto */*collectproto*/, ostream &logout) { 90 91 // define_internal_macros sets the following macros: 92 93 // _homeextra_ this is the list of available collections and collection info 94 // to be displayed on the home page 95 96 if (args["p"] == "home") { 97 // make sure we know about a receptionist 98 if (recpt == NULL) { 99 logout << "The page action does not contain information\n" 100 << "about any receptionists. The method set_receptionist\n" 101 << "was probably not called from the module which instantiated\n" 102 << "this page action.\n"; 103 return; 104 } 105 106 unsigned long current_time = time(NULL); 107 text_t homeextra; 108 109 recptprotolistclass *rprotolist = recpt->get_recptprotolist_ptr (); 110 if (rprotolist == NULL) return; 111 112 recptprotolistclass::iterator rprotolist_here = rprotolist->begin(); 113 recptprotolistclass::iterator rprotolist_end = rprotolist->end(); 114 while (rprotolist_here != rprotolist_end) { 115 if ((*rprotolist_here).p != NULL) { 116 text_tarray collist; 117 comerror_t err; 118 (*rprotolist_here).p->get_collection_list (collist, err, logout); 119 if (err == noError) { 120 text_tarray::iterator collist_here = collist.begin(); 121 text_tarray::iterator collist_end = collist.end(); 122 123 homeextra += "<dl>\n"; 124 125 while (collist_here != collist_end) { 126 ColInfoResponse_t collectinfo; 127 (*rprotolist_here).p->get_collectinfo (*collist_here, collectinfo, err, logout); 128 if (err == noError) { 129 130 homeextra += "<dt><a href=\"_httppagex_(about)&c=" + *collist_here + "\">" 131 + *collist_here + "</a></dt>\n"; 132 homeextra += "<dd>"; 133 if (collectinfo.numDocs != 0) homeextra += text_t(collectinfo.numDocs) + "_documents_"; 134 if (collectinfo.numWords != 0) homeextra += text_t(collectinfo.numWords) + "_words_"; 135 unsigned long last_update = (current_time - collectinfo.buildDate) / 86400; 136 homeextra += "_lastupdate_ " + text_t(last_update) + " _ago_</dd>\n"; 137 } 138 collist_here ++; 139 } 140 homeextra += "</dl>\n"; 141 disp.setmacro ("homeextra", "home", homeextra); 142 } 143 } 144 rprotolist_here ++; 145 } 146 } 147 } 148 81 149 bool pageaction::do_action (cgiargsclass &args, recptproto */*collectproto*/, 82 150 displayclass &disp, outconvertclass &outconvert, -
trunk/gsdl/src/recpt/pageaction.h
r261 r284 17 17 #include "gsdlconf.h" 18 18 #include "action.h" 19 #include "receptionist.h" 19 20 20 21 21 22 class pageaction : public action { 22 23 24 protected: 25 receptionist *recpt; 26 23 27 public: 24 28 pageaction (); … … 27 31 text_t get_action_name () {return "p";} 28 32 33 void set_receptionist (receptionist *therecpt) {recpt=therecpt;} 29 34 bool check_cgiargs (cgiargsinfoclass &argsinfo, cgiargsclass &args, 30 35 ostream &logout); … … 32 37 void get_cgihead_info (cgiargsclass &args, response_t &response, 33 38 text_t &response_data, ostream &logout); 39 40 void define_internal_macros (displayclass &disp, cgiargsclass &args, 41 recptproto *collectproto, ostream &logout); 34 42 35 43 bool do_action (cgiargsclass &args, recptproto *collectproto, -
trunk/gsdl/src/recpt/queryaction.cpp
r279 r284 12 12 /* 13 13 $Log$ 14 Revision 1.6 1999/06/24 05:12:25 sjboddie 15 lots of small changes 16 14 17 Revision 1.5 1999/06/16 04:03:48 sjboddie 15 18 Now sets "cl" arg to "search" when going to a document from a search … … 90 93 argsinfo.addarginfo (NULL, arg_ainfo); 91 94 92 // "t" 95 // "t" - 1 = ranked 0 = boolean 93 96 arg_ainfo.shortname = "t"; 94 97 arg_ainfo.longname = "search type"; 95 98 arg_ainfo.multiplechar = false; 96 99 arg_ainfo.defaultstatus = cgiarginfo::weak; 97 arg_ainfo.argdefault = " 0";100 arg_ainfo.argdefault = "1"; 98 101 arg_ainfo.savedarginfo = cgiarginfo::must; 99 102 argsinfo.addarginfo (NULL, arg_ainfo); … … 160 163 if (arg_t != 0 && arg_t != 1) { 161 164 logout << "Warning: \"t\" argument out of range (" << arg_t << ")\n"; 162 args["t"] = argsinfo["t"].argdefault; 165 cgiarginfo *tinfo = argsinfo.getarginfo ("t"); 166 if (tinfo != NULL) args["t"] = tinfo->argdefault; 163 167 } 164 168 … … 167 171 if (arg_k != 0 && arg_k != 1) { 168 172 logout << "Warning: \"k\" argument out of range (" << arg_k << ")\n"; 169 args["k"] = argsinfo["k"].argdefault; 173 cgiarginfo *kinfo = argsinfo.getarginfo ("k"); 174 if (kinfo != NULL) args["k"] = kinfo->argdefault; 170 175 } 171 176 … … 174 179 if (arg_s != 0 && arg_s != 1) { 175 180 logout << "Warning: \"s\" argument out of range (" << arg_s << ")\n"; 176 args["s"] = argsinfo["s"].argdefault; 181 cgiarginfo *sinfo = argsinfo.getarginfo ("s"); 182 if (sinfo != NULL) args["s"] = sinfo->argdefault; 177 183 } 178 184 … … 181 187 if (arg_m < 0) { 182 188 logout << "Warning: \"m\" argument less than 0 (" << arg_m << ")\n"; 183 args["m"] = argsinfo["m"].argdefault; 189 cgiarginfo *minfo = argsinfo.getarginfo ("m"); 190 if (minfo != NULL) args["m"] = minfo->argdefault; 184 191 } 185 192 … … 188 195 if (arg_o < 0) { 189 196 logout << "Warning: \"o\" argument less than 0 (" << arg_o << ")\n"; 190 args["o"] = argsinfo["o"].argdefault; 197 cgiarginfo *oinfo = argsinfo.getarginfo ("o"); 198 if (oinfo != NULL) args["o"] = oinfo->argdefault; 191 199 } 192 200 … … 195 203 if (arg_r < 1) { 196 204 logout << "Warning: \"r\" argument less than 1 (" << arg_r << ")\n"; 197 args["r"] = argsinfo["r"].argdefault; 205 cgiarginfo *rinfo = argsinfo.getarginfo ("r"); 206 if (rinfo != NULL) args["r"] = rinfo->argdefault; 198 207 } 199 208 … … 387 396 388 397 // can't use isApprox here as it will be false as long 389 // as numDocs < MAXDOCS (currently 200). If arg_m is less398 // as numDocs < MAXDOCS (currently 500). If arg_m is less 390 399 // than MAXDOCS numDocs can be greater than arg_m while 391 400 // isApprox is false. 392 if (response.numDocs >= numdocs) resline = "_textmorethan_"; 401 if (response.numDocs > numdocs || 402 ((response.numDocs == numdocs) && response.isApprox)) 403 resline = "_textmorethan_"; 393 404 if (numdocs == 0) resline = "_textnodocs_"; 394 405 else if (numdocs == 1) resline += "_text1doc_"; 395 else resline += text_t(numdocs) + " _textlotsdocs_";406 else resline += text_t(numdocs) + " _textlotsdocs_"; 396 407 397 408 disp.setmacro("resultline", "query", resline);
Note:
See TracChangeset
for help on using the changeset viewer.