Changeset 418 for trunk/gsdl/src/recpt
- Timestamp:
- 1999-07-30T14:13:10+12:00 (25 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/receptionist.cpp
r388 r418 12 12 /* 13 13 $Log$ 14 Revision 1.20 1999/07/30 02:13:09 sjboddie 15 -added collectinfo argument to some functions 16 -made some function prototypes virtual 17 14 18 Revision 1.19 1999/07/15 06:02:05 rjmcnab 15 19 Moved the setting of argsinfo into the constructor. Added the configuration … … 264 268 text_t filename = filename_cat (thecollectdir, "etc"); 265 269 filename = filename_cat (filename, "collect.cfg"); 270 266 271 if (!file_exists(filename)) thecollectdir = configinfo.gsdlhome; 267 272 } … … 507 512 if (a != NULL) { 508 513 if (a->uses_display(args)) prepare_page (a, args, collectproto, (*outconverter), logout); 509 if (!a->do_action (args, collectproto, disp, (*outconverter), contentout, logout)) 514 if (!a->do_action (args, collectinfo, collectproto, disp, 515 (*outconverter), contentout, logout)) 510 516 return false; 511 517 … … 643 649 } 644 650 645 // prepare_page sets up page parameters, sets display macros 646 // and opens the page ready for output651 // prepare_page sets up page parameters, sets display macros, 652 // gets format information and opens the page ready for output 647 653 void receptionist::prepare_page (action *a, cgiargsclass &args, recptproto *collectproto, 648 654 outconvertclass &outconvert, ostream &logout) { 649 655 // set up page parameters 650 656 text_t pageparams; 657 text_t &collection = args["c"]; 651 658 652 659 bool first = true; 653 if (! args["c"].empty()) {654 pageparams += "collection=" + args["c"]; first = false;}660 if (!collection.empty()) { 661 pageparams += "collection=" + collection; first = false;} 655 662 if (args.getintarg("u") == 1) 656 663 if (first) {pageparams += "style=htmlonly"; first = false;} … … 666 673 else pageparams += ",language=" + args["l"]; 667 674 675 // get collection information 676 collectinfo.clear(); 677 if (!collection.empty()) { 678 comerror_t err; 679 collectproto->get_collectinfo (collection, collectinfo, err, logout); 680 if (err != noError) collectinfo.clear(); 681 } 682 668 683 // open the page 669 684 disp.openpage(pageparams, MACROPRECEDENCE); … … 681 696 assert ((*actionhere).second.a != NULL); 682 697 if ((*actionhere).second.a != NULL) 683 (*actionhere).second.a->define_external_macros ( disp, args, collectproto, logout);698 (*actionhere).second.a->define_external_macros (collectinfo, disp, args, collectproto, logout); 684 699 actionhere++; 685 700 } 686 701 687 688 702 // define internal macros for the current action 689 a->define_internal_macros ( disp, args, collectproto, logout);703 a->define_internal_macros (collectinfo, disp, args, collectproto, logout); 690 704 } 691 705 -
trunk/gsdl/src/recpt/receptionist.h
r388 r418 48 48 displayclass disp; 49 49 convertinfoclass converters; 50 ColInfoResponse_t collectinfo; 50 51 51 52 // prepare_page sets up page parameters, sets display macros 52 53 // and opens the page ready for output 53 v oid prepare_page (action *a, cgiargsclass &args, recptproto *collectproto,54 outconvertclass &outconvert, ostream &logout);55 v oid define_general_macros (cgiargsclass &args, outconvertclass &outconvert,56 ostream &logout);54 virtual void prepare_page (action *a, cgiargsclass &args, recptproto *collectproto, 55 outconvertclass &outconvert, ostream &logout); 56 virtual void define_general_macros (cgiargsclass &args, outconvertclass &outconvert, 57 ostream &logout); 57 58 58 59 public: … … 86 87 // it contains. The configuration should take place after everything 87 88 // has been added but before the initialisation. 88 v oid configure (const text_t &key, const text_tarray &cfgline);89 v oid configure (const text_t &key, const text_t &value);89 virtual void configure (const text_t &key, const text_tarray &cfgline); 90 virtual void configure (const text_t &key, const text_t &value); 90 91 const recptconf &get_configinfo () {return configinfo;} 91 92 cgiargsinfoclass *get_cgiargsinfo_ptr () {return &argsinfo;} … … 99 100 // meaningless output), instead an error page should be 100 101 // produced by the calling code. 101 bool init (ostream &logout);102 virtual bool init (ostream &logout); 102 103 103 104 // There are two ways to produce a page. You can either call parse_cgi_args, … … 110 111 // This function should be called for each page request. It returns false 111 112 // if there was a major problem with the cgi arguments. 112 bool parse_cgi_args (const text_t &argstr, cgiargsclass &args, ostream &logout);113 virtual bool parse_cgi_args (const text_t &argstr, cgiargsclass &args, ostream &logout); 113 114 114 115 // produce_cgi_page will call get_cgihead_info and … … 116 117 // the page content (if needed). If a page could not be created it 117 118 // will return false 118 bool produce_cgi_page (cgiargsclass &args, ostream &contentout,119 119 virtual bool produce_cgi_page (cgiargsclass &args, ostream &contentout, 120 ostream &logout); 120 121 121 122 // get_cgihead_info determines the cgi header information for … … 124 125 // contains content then reponse_data contains the content-type. 125 126 // Note that images can now be produced by the receptionist. 126 v oid get_cgihead_info (cgiargsclass &args, response_t &response,127 text_t &response_data, ostream &logout);127 virtual void get_cgihead_info (cgiargsclass &args, response_t &response, 128 text_t &response_data, ostream &logout); 128 129 129 130 // produce the page content 130 bool produce_content (cgiargsclass &args, ostream &contentout,131 ostream &logout);131 virtual bool produce_content (cgiargsclass &args, ostream &contentout, 132 ostream &logout); 132 133 133 134 // returns the compressed argument ("e") corresponding to the argument … … 139 140 // error message will be written to logout and the method will 140 141 // return false. 141 bool read_macrofiles (ostream &logout);142 virtual bool read_macrofiles (ostream &logout); 142 143 143 144 // check_mainargs will check all the main arguments. If a major
Note:
See TracChangeset
for help on using the changeset viewer.