Changeset 758 for trunk/gsdl/src/recpt/documentaction.cpp
- Timestamp:
- 1999-11-02T10:54:27+13:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/documentaction.cpp
r738 r758 28 28 /* 29 29 $Log$ 30 Revision 1.30 1999/11/01 21:54:27 sjboddie 31 changes for cross-collection searching - changes to arguments 32 of many functions 33 30 34 Revision 1.29 1999/10/24 07:23:40 sjboddie 31 35 added FullTOC option … … 288 292 } 289 293 290 void documentaction::get_cgihead_info (cgiargsclass &args, response_t &response, 291 text_t &response_data, ostream &logout) { 292 293 if ((!args["d"].empty()) && (args["il"] == "w")) 294 { 295 text_t &oid = args["d"]; 296 text_t &collection = args["c"]; 297 298 recptprotolistclass* protocols = recpt->get_recptprotolist_ptr(); 299 recptproto* collectproto = protocols->getrecptproto (collection, logout); 300 294 void documentaction::get_cgihead_info (cgiargsclass &args, recptprotolistclass *protos, 295 response_t &response,text_t &response_data, 296 ostream &logout) { 297 298 if ((args["il"] == "w") && (!args["d"].empty())) { 299 300 recptproto* collectproto = protos->getrecptproto (args["c"], logout); 301 if (collectproto != NULL) { 302 301 303 text_tset metadata; 302 304 FilterResponse_t filt_response; 305 text_t top; 303 306 304 307 metadata.insert ("URL"); 305 306 // get metadata for this document and it's parents 307 if (get_info (oid, collection, metadata, true, collectproto, filt_response, logout)) 308 { 309 text_t url = *(filt_response.docInfo[0].metadata[0].values.begin()); 310 311 response = location; 312 response_data = url; 313 } 314 else 315 { 316 // error, no URL 317 logout << "Error: documentaction::get_cgihead_info failed on get_info" << endl; 318 } 319 } 320 else 321 { 322 response = content; 323 response_data = "text/html"; 324 } 308 309 // get metadata for parent document 310 get_top (args["d"], top); 311 if (get_info (top, args["c"], metadata, false, collectproto, filt_response, logout)) { 312 text_t url = filt_response.docInfo[0].metadata[0].values[0]; 313 314 response = location; 315 response_data = url; 316 return; 317 } else { 318 // error, no URL 319 logout << "Error: documentaction::get_cgihead_info failed on get_info" << endl; 320 } 321 } 322 } 323 response = content; 324 response_data = "text/html"; 325 325 } 326 326 … … 420 420 // define all the macros which might be used by other actions 421 421 // to produce pages. 422 void documentaction::define_external_macros (const ColInfoResponse_t &/*collectinfo*/, 423 displayclass &disp, cgiargsclass &args, 424 recptproto *collectproto, ostream &logout) { 422 void documentaction::define_external_macros (displayclass &disp, cgiargsclass &args, 423 recptprotolistclass *protos, ostream &logout) { 425 424 426 425 // define_external_macros sets the following macros: … … 443 442 444 443 445 // can't do anything if collectproto is null (i.e. no collection was specified) 444 // must have a valid collection server to continue 445 text_t &collection = args["c"]; 446 if (collection.empty()) return; 447 recptproto *collectproto = protos->getrecptproto (collection, logout); 446 448 if (collectproto == NULL) return; 447 449 448 450 outconvertclass text_t2ascii; 449 451 comerror_t err; … … 451 453 FilterResponse_t response; 452 454 text_tset metadata; 453 text_t &collection = args["c"];454 455 455 456 // don't want navigation bar if page is 'detached' … … 557 558 // by this action. we also load up the formatinfo structure 558 559 // here (it's used in do_action as well as here) 559 void documentaction::define_internal_macros (const ColInfoResponse_t &collectinfo, 560 displayclass &disp, cgiargsclass &args, 561 recptproto *collectproto, ostream &logout) { 560 void documentaction::define_internal_macros (displayclass &disp, cgiargsclass &args, 561 recptprotolistclass *protos, ostream &logout) { 562 562 563 563 // define_internal_macros sets the following macros: … … 579 579 // to the archivedir metadata element 580 580 581 // can't do anything if collectproto is null (i.e. no collection was specified) 581 582 // must have a valid collection server to continue 583 text_t &collection = args["c"]; 584 if (collection.empty()) return; 585 recptproto *collectproto = protos->getrecptproto (collection, logout); 582 586 if (collectproto == NULL) return; 583 587 584 588 text_tset metadata; 585 589 FilterResponse_t response; 586 590 text_t &arg_d = args["d"]; 587 591 text_t &arg_cl = args["cl"]; 588 text_t &collection = args["c"];589 592 int gt = args.getintarg("gt"); 590 load_formatinfo (collectinfo.format, gt); 593 594 // get info on current collection and load up formatinfo 595 ColInfoResponse_t cinfo; 596 comerror_t err; 597 collectproto->get_collectinfo (collection, cinfo, err, logout); 598 load_formatinfo (cinfo.format, gt); 591 599 592 600 if (!formatinfo.DocumentArrowsBottom) … … 677 685 678 686 679 bool documentaction::do_action (cgiargsclass &args, const ColInfoResponse_t &/*collectinfo*/,680 recptproto *collectproto, displayclass &disp,687 bool documentaction::do_action (cgiargsclass &args, recptprotolistclass *protos, 688 browsermapclass *browsers, displayclass &disp, 681 689 outconvertclass &outconvert, ostream &textout, 682 690 ostream &logout) { 683 691 692 693 // must have a valid collection server 694 recptproto *collectproto = protos->getrecptproto (args["c"], logout); 684 695 if (collectproto == NULL) { 685 696 logout << "documentaction::do_action called with NULL collectproto\n"; … … 688 699 << "_document:footer_\n"; 689 700 } else { 690 701 691 702 text_t OID = args["d"]; 692 703 if (OID.empty()) OID = args["cl"]; … … 700 711 701 712 // output the table of contents 702 output_toc (args, recpt->get_browsermap_ptr(), formatinfo,703 collectproto,disp, outconvert, textout, logout);713 output_toc (args, browsers, formatinfo, collectproto, 714 disp, outconvert, textout, logout); 704 715 705 716 // output the document text … … 768 779 if (!args["q"].empty() && args.getintarg("hl")) { 769 780 FilterRequest_t request; 781 comerror_t err; 770 782 request.filterResultOptions = FRmatchTerms; 771 if (do_query (request, args, collectproto, queryresponse, logout)) 783 text_t formattedstring = args["q"]; 784 format_querystring (formattedstring, args.getintarg("b")); 785 set_queryfilter_options (request, formattedstring, args); 786 collectproto->filter (args["c"], request, queryresponse, err, logout); 787 if (err != noError) { 788 outconvertclass text_t2ascii; 789 logout << text_t2ascii 790 << "documentaction::output_document: call to QueryFilter failed " 791 << "for " << args["c"] << " collection (" << get_comerror_string (err) << ")\n"; 792 highlight = false; 793 } else { 772 794 highlight = true; 795 } 773 796 } 774 797
Note:
See TracChangeset
for help on using the changeset viewer.