Changeset 172 for trunk/gsdl
- Timestamp:
- 1999-02-26T10:59:02+13:00 (25 years ago)
- Location:
- trunk/gsdl
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/macros/base.dm
r156 r172 22 22 ####################################################################### 23 23 24 _gwcgi_ {http://nowhere.nzdl.org/cgi-bin/gw}25 _httpprefix_ {http://nowhere.nzdl.org}24 #_gwcgi_ {http://nowhere.nzdl.org/cgi-bin/gw} 25 #_httpprefix_ {http://nowhere.nzdl.org} 26 26 27 27 _cookie_ {} … … 460 460 _httpicontsrchof_ [language=mi] {_httpimg_/mtsrchof.gif} 461 461 _httpicontsrchon_ {_httpimg_/tsrchon.gif} 462 _httpicontsrchon_ [language=mi] {_httpimg_/ tsrchon.gif}462 _httpicontsrchon_ [language=mi] {_httpimg_/mtsrchon.gif} 463 463 _widthtsrchx_ {87} 464 464 _heighttsrchx_ {17} -
trunk/gsdl/src/library/browse.cpp
r124 r172 12 12 /* 13 13 $Log$ 14 Revision 1.9 1999/02/25 21:58:55 rjmcnab 15 16 Merged sources. 17 14 18 Revision 1.8 1999/01/21 21:20:10 sjboddie 15 19 removed unused collection parameter from several functions … … 429 433 // get_alphabet_links adds the html for the letter selection links to return_text 430 434 void browseclass::get_alphabet_links (const text_t &classification, 431 const text_t & booksection, gdbmclass &gdbm,435 const text_t &/*booksection*/, gdbmclass &gdbm, 432 436 text_t &return_text) { 433 437 -
trunk/gsdl/src/library/libinterface.cpp
r162 r172 12 12 /* 13 13 $Log$ 14 Revision 1.22 1999/02/25 21:58:55 rjmcnab 15 16 Merged sources. 17 14 18 Revision 1.21 1999/02/21 22:29:57 rjmcnab 15 19 … … 662 666 663 667 void libinterface::define_general_macros (cgiargsclass &args, outconvertclass &outconvert, 664 ostream & logout) {668 ostream &/*logout*/) { 665 669 disp.setmacro("httpprefix", "Global", httpprefix); 666 670 disp.setmacro("gwcgi", "Global", gwcgi); … … 897 901 void libinterface::docLinks (cgiargsclass &args, 898 902 queryresultsclass &queryresults, 899 ostream & logout)903 ostream &/*logout*/) 900 904 { 901 905 text_t links; … … 1262 1266 // highlighttext highlights query terms in text string and outputs the resulting text string 1263 1267 void libinterface::highlighttext(text_tarray &termvars, outconvertclass &outconvert, 1264 ostream &textout, ostream & logout, text_t &text) {1268 ostream &textout, ostream &/*logout*/, text_t &text) { 1265 1269 map<text_t, int, lttext_t> terms; 1266 1270 map<text_t, int, lttext_t>::const_iterator it; … … 1319 1323 } 1320 1324 1321 void libinterface::define_pref_macros (cgiargsclass &args, ostream & logout)1325 void libinterface::define_pref_macros (cgiargsclass &args, ostream &/*logout*/) 1322 1326 { 1323 1327 // the caseoption macro -
trunk/gsdl/src/library/libinterface.h
r138 r172 198 198 199 199 virtual void define_collection_macros (cgiargsclass &/*args*/, ostream &/*logout*/) {} 200 virtual bool collection_init(const text_t & collection) {return true;}200 virtual bool collection_init(const text_t &/*collection*/) {return true;} 201 201 virtual void displaydocsummary (cgiargsclass &/*args*/, outconvertclass &/*outconvert*/, 202 202 ostream &/*textout*/, ostream &/*logout*/, -
trunk/gsdl/src/recpt/Makefile
r165 r172 11 11 AR = ar 12 12 CC = gcc 13 CCFLAGS = -g -Wall -Wunused -pedantic -W 13 CCFLAGS = -g -Wall -Wunused -pedantic -W -Woverloaded-virtual 14 14 DEFS = -DNZDL -DQUIET -DSHORT_SUFFIX -DPARADOCNUM -DUSE_FASTCGI -DGSDLSERVER 15 15 INCLUDES = -I../../lib -I../../packages/mg-1.3d -I../../packages/mg-1.3d/lib \ -
trunk/gsdl/src/recpt/action.cpp
r165 r172 12 12 /* 13 13 $Log$ 14 Revision 1.7 1999/02/25 21:58:58 rjmcnab 15 16 Merged sources. 17 14 18 Revision 1.6 1999/02/21 22:33:52 rjmcnab 15 19 … … 115 119 // returns false if there was an error which prevented the action 116 120 // from outputing anything. 117 bool action::do_action (cgiargsclass &/*args*/, outconvertclass &/*outconvert*/,118 recptproto */*collectproto*/, ostream &/*textout*/,119 ostream &/* logout*/) {121 bool action::do_action (cgiargsclass &/*args*/, recptproto */*collectproto*/, 122 displayclass &/*disp*/, outconvertclass &/*outconvert*/, 123 ostream &/*textout*/, ostream &/*logout*/) { 120 124 return true; 121 125 } 126 122 127 123 128 -
trunk/gsdl/src/recpt/action.h
r165 r172 76 76 // returns false if there was an error which prevented the action 77 77 // from outputing anything. 78 virtual bool do_action (cgiargsclass &args, outconvertclass &outconvert,79 recptproto *collectproto, ostream &textout,80 ostream & logout);78 virtual bool do_action (cgiargsclass &args, recptproto *collectproto, 79 displayclass &disp, outconvertclass &outconvert, 80 ostream &textout, ostream &logout); 81 81 82 82 // getargsinfo should be called after all configuration files -
trunk/gsdl/src/recpt/nullproto.cpp
r166 r172 12 12 /* 13 13 $Log$ 14 Revision 1.2 1999/02/25 21:58:58 rjmcnab 15 16 Merged sources. 17 14 18 Revision 1.1 1999/02/21 22:35:22 rjmcnab 15 19 … … 90 94 void nullproto::get_collection_list (text_tarray &collist, comerror_t &err, 91 95 ostream &/*logout*/) { 92 collist. clear();96 collist.erase(collist.begin(),collist.end()); 93 97 err = noError; 94 98 -
trunk/gsdl/src/recpt/pageaction.cpp
r165 r172 12 12 /* 13 13 $Log$ 14 Revision 1.3 1999/02/25 21:58:58 rjmcnab 15 16 Merged sources. 17 14 18 Revision 1.2 1999/02/21 22:33:54 rjmcnab 15 19 … … 24 28 25 29 #include "pageaction.h" 30 #include "receptionist.h" 26 31 27 32 … … 44 49 arg_ainfo.savedarginfo = cgiarginfo::can; 45 50 argsinfo.addarginfo (NULL, arg_ainfo); 46 47 51 } 48 52 … … 61 65 } 62 66 63 bool pageaction::do_action (cgiargsclass &args, outconvertclass &outconvert, 64 recptproto */*collectproto*/, ostream &textout, 65 ostream &/*logout*/) { 66 67 textout << outconvert << "<html>\n"; 68 textout << outconvert << "<head><title>Page action</title></head>\n"; 69 textout << outconvert << "<body><h2>Page action</h2>\n"; 70 textout << outconvert << "a: " << args["a"] << " p: " << args["p"] << "\n"; 71 textout << outconvert << "</body>\n"; 72 textout << outconvert << "</html>\n"; 67 bool pageaction::do_action (cgiargsclass &args, recptproto */*collectproto*/, 68 displayclass &disp, outconvertclass &outconvert, 69 ostream &textout, ostream &logout) { 70 text_t pageparams; 71 text_t &arg_p = args["p"]; 72 73 bool first = true; 74 if (!args["c"].empty()) { 75 pageparams += "collection=" + args["c"]; first = false;} 76 if (args.getintarg("u") == 1) 77 if (first) {pageparams += "style=htmlonly"; first = false;} 78 else pageparams += ",style=htmlonly"; 79 if (args.getintarg("v") == 1) 80 if (first) {pageparams += "version=text"; first = false;} 81 else pageparams += ",version=text"; 82 if (args.getintarg("f") == 1) 83 if (first) {pageparams += ",queryversion=big"; first = false;} 84 else pageparams += ",queryversion=big"; 85 if (args["l"] != "en") 86 if (first) pageparams += ",language=" + args["l"]; 87 else pageparams += ",language=" + args["l"]; 88 89 disp.openpage(pageparams, MACROPRECEDENCE); 90 define_internal_macros (disp, args, logout); 91 92 textout << outconvert << disp << ("_" + arg_p + ":header_\n") 93 << ("_" + arg_p + ":imagestandardbar_\n") << ("_" + arg_p + ":content_\n") 94 << ("_" + arg_p + ":footer_\n"); 73 95 74 96 return true; 75 97 } 98 99 100 // define all the macros which are related to pages generated 101 // by this action 102 void pageaction::define_internal_macros (displayclass &disp, cgiargsclass &args, 103 ostream &logout) { 104 105 // not sure which macros should be defined where - what is difference between 106 // define_internal_macros and define_external_macros 107 // urlsafequerystring and querystring macros need some kind of cgisafe and 108 // htmlsafe functions (maybe to be defined in htmlutils.cpp?) 109 110 // the following macros are also defined in libinterface, some of them I'm not 111 // sure how to define from here and some I don't think are required anymore 112 // httpprefix 113 // numdocs 114 // collection 115 // istitle and pagedest -- these don't occur anywhere in the macro files 116 117 // I don't know what structure has replaced what used to be cfg_info 118 // so haven't defined the selection macros _hselection_, _jselection_ 119 // and _nselection_ (these should be set in define_query_macros) 120 121 // _imagethispage_ needs to be set for any browse pages but I guess 122 // browse pages will be generated by a different action 123 124 // not sure what to do with any collection specific macros - these 125 // used to be defined in define_collection_macros although there 126 // wasn't much collection specific stuff left I don't think 127 128 // disp.setmacro ("gwcgi", "Global", recpt->get_gwcgi()); 129 // disp.setmacro ("httpimg", "Global", recpt->get_httpimg()); 130 // disp.setmacro("compressedoptions", "Global", recpt->get_compressed_arg(args)); 131 132 // disp.setmacro("urlsafequerystring", "Global", cgisafe(outconvert.convert(args["q"]))); 133 // disp.setmacro("querystring", "Global", htmlsafe(outconvert.convert(args["q"])))); 134 135 // define the macro for the "g" argument 136 disp.setmacro("g", "Global", args["g"]); 137 138 // this gets set unless page has been detached by the 'detach' button. 139 if (args.getintarg("x") == 0) disp.setmacro("notdetached", "Global", "1"); 140 141 // not sure if home and about pages will both need query macros defined 142 if ((args["p"] == "query") || (args["p"] == "home") || (args["p"] == "about")) 143 define_query_macros (disp, args, logout); 144 145 if (args["p"] == "preferences") 146 define_pref_macros (disp, args, logout); 147 148 } 149 150 void pageaction::define_query_macros (displayclass &disp, cgiargsclass &args, 151 ostream &/*logout*/) { 152 153 // some/all query type selection 154 text_t qtselect = "<select name=\"t\">\n"; 155 qtselect += "<option value=\"1\""; 156 if (args.getintarg("t") == 1) qtselect += " selected"; 157 qtselect += ">_query:textsome_\n"; 158 qtselect += "<option value=\"0\""; 159 if (args.getintarg("t") == 0) qtselect += " selected"; 160 qtselect += ">_query:textall_\n"; 161 qtselect += "</select>\n"; 162 disp.setmacro("querytypeselection", "query", qtselect); 163 164 165 } 166 167 void pageaction::define_pref_macros (displayclass &disp, cgiargsclass &args, 168 ostream &/*logout*/) { 169 170 // the caseoption macro 171 text_t caseoption; 172 int arg_k = args.getintarg("k"); 173 174 caseoption += "\n<input type=radio name=k value=1"; 175 if (arg_k) caseoption += " checked"; 176 caseoption += ">_textignorecase_<br>\n"; 177 caseoption += "<input type=radio name=k value=0"; 178 if (!arg_k) caseoption += " checked"; 179 caseoption += ">_textmatchcase_\n"; 180 181 disp.setmacro ("caseoption", "preferences", caseoption); 182 183 // the stemoption macro 184 text_t stemoption; 185 int arg_s = args.getintarg("s"); 186 187 stemoption += "\n<input type=radio name=s value=1"; 188 if (arg_s) stemoption += " checked"; 189 stemoption += ">_textstem_<br>\n"; 190 stemoption += "<input type=radio name=s value=0"; 191 if (!arg_s) stemoption += " checked"; 192 stemoption += ">_textnostem_\n"; 193 194 disp.setmacro ("stemoption", "preferences", stemoption); 195 196 197 // the encodingoption 198 text_t encodingoption; 199 const text_t &arg_w = args["w"]; 200 201 encodingoption += "\n<select name=\"nw\">\n"; 202 encodingoption += " <option value=\"w\""; 203 if (arg_w == "w") encodingoption += " selected"; 204 encodingoption += ">Western (ISO-8859-1)\n"; 205 encodingoption += " <option value=\"g\""; 206 if (arg_w == "g") encodingoption += " selected"; 207 encodingoption += ">Simplified Chinese (GB2312)\n"; 208 encodingoption += " <option value=\"8\""; 209 if (arg_w == "8") encodingoption += " selected"; 210 encodingoption += ">Unicode (UTF-8)\n"; 211 encodingoption += "</select>\n"; 212 213 disp.setmacro ("encodingoption", "preferences", encodingoption); 214 215 // the maxdocoption 216 text_t maxdocoption; 217 int arg_m = args.getintarg("m"); 218 219 maxdocoption += "\n<select name=m>\n"; 220 maxdocoption += " <option value=\"50\""; 221 if (arg_m < 100) maxdocoption += " selected"; 222 maxdocoption += ">50\n"; 223 maxdocoption += " <option value=\"100\""; 224 if (arg_m >= 100 && arg_m < 200) maxdocoption += " selected"; 225 maxdocoption += ">100\n"; 226 maxdocoption += " <option value=\"200\""; 227 if (arg_m >= 200 && arg_m < 500) maxdocoption += " selected"; 228 maxdocoption += ">200\n"; 229 maxdocoption += " <option value=\"500\""; 230 if (arg_m >= 500) maxdocoption += " selected"; 231 maxdocoption += ">500\n"; 232 maxdocoption += "</select>\n"; 233 234 disp.setmacro ("maxdocoption", "preferences", maxdocoption); 235 236 // the hitsperpageoption 237 text_t hitsoption; 238 int arg_o = args.getintarg("o"); 239 240 hitsoption += "\n<select name=o>\n"; 241 hitsoption += " <option value=\"10\""; 242 if (arg_o < 20) hitsoption += " selected"; 243 hitsoption += ">10\n"; 244 hitsoption += " <option value=\"20\""; 245 if (arg_o >= 20 && arg_o < 50) hitsoption += " selected"; 246 hitsoption += ">20\n"; 247 hitsoption += " <option value=\"50\""; 248 if (arg_o >= 50 && arg_o < 100) hitsoption += " selected"; 249 hitsoption += ">50\n"; 250 hitsoption += " <option value=\"100\""; 251 if (arg_o >= 100 && arg_o < 500) hitsoption += " selected"; 252 hitsoption += ">100\n"; 253 hitsoption += " <option value=\"500\""; 254 if (arg_o >= 500) hitsoption += " selected"; 255 hitsoption += ">all\n"; 256 hitsoption += " </select>\n"; 257 258 disp.setmacro ("hitsperpageoption", "preferences", hitsoption); 259 } 260 -
trunk/gsdl/src/recpt/pageaction.h
r165 r172 20 20 21 21 class pageaction : public action { 22 protected: 23 void define_internal_macros (displayclass &disp, cgiargsclass &args, 24 ostream &logout); 25 void define_query_macros (displayclass &disp, cgiargsclass &args, 26 ostream &logout); 27 void define_pref_macros (displayclass &disp, cgiargsclass &args, 28 ostream &logout); 29 22 30 public: 23 31 pageaction (); … … 28 36 void get_cgihead_info (cgiargsclass &args, response_t &response, 29 37 text_t &response_data, ostream &logout); 30 bool do_action (cgiargsclass &args, outconvertclass &outconvert,31 recptproto *collectproto, ostream &textout,32 ostream & logout);38 bool do_action (cgiargsclass &args, recptproto *collectproto, 39 displayclass &disp, outconvertclass &outconvert, 40 ostream &textout, ostream &logout); 33 41 }; 34 42 -
trunk/gsdl/src/recpt/pingaction.cpp
r166 r172 12 12 /* 13 13 $Log$ 14 Revision 1.2 1999/02/25 21:58:59 rjmcnab 15 16 Merged sources. 17 14 18 Revision 1.1 1999/02/21 22:35:20 rjmcnab 15 19 … … 42 46 43 47 44 bool pingaction::do_action (cgiargsclass &args, outconvertclass &outconvert,45 recptproto *collectproto, ostream &textout,46 ostream & logout) {48 bool pingaction::do_action (cgiargsclass &args, recptproto *collectproto, 49 displayclass &/*disp*/, outconvertclass &outconvert, 50 ostream &textout, ostream &logout) { 47 51 bool wassuccess = false; 48 52 comerror_t err; 49 53 50 54 if (!args["c"].empty() && (collectproto != NULL)) { 51 55 collectproto->ping (args["c"], wassuccess, err, logout); -
trunk/gsdl/src/recpt/pingaction.h
r166 r172 26 26 void get_cgihead_info (cgiargsclass &args, response_t &response, 27 27 text_t &response_data, ostream &logout); 28 bool do_action (cgiargsclass &args, outconvertclass &outconvert,29 recptproto *collectproto, ostream &textout,30 ostream & logout);28 bool do_action (cgiargsclass &args, recptproto *collectproto, 29 displayclass &disp, outconvertclass &outconvert, 30 ostream &textout, ostream &logout); 31 31 }; 32 32 -
trunk/gsdl/src/recpt/receptionist.cpp
r165 r172 12 12 /* 13 13 $Log$ 14 Revision 1.8 1999/02/25 21:58:59 rjmcnab 15 16 Merged sources. 17 14 18 Revision 1.7 1999/02/21 22:33:55 rjmcnab 15 19 … … 330 334 action *a = actions.getaction (args["a"]); 331 335 if (a != NULL) { 332 if (!a->do_action (args, (*outconverter), collectproto, contentout, logout))336 if (!a->do_action (args, collectproto, disp, (*outconverter), contentout, logout)) 333 337 return false; 334 338 -
trunk/gsdl/src/recpt/recptproto.cpp
r166 r172 12 12 /* 13 13 $Log$ 14 Revision 1.2 1999/02/25 21:59:01 rjmcnab 15 16 Merged sources. 17 14 18 Revision 1.1 1999/02/21 22:35:24 rjmcnab 15 19 … … 45 49 void recptproto::get_collection_list (text_tarray &collist, comerror_t &err, 46 50 ostream &/*logout*/) { 47 collist. clear();51 collist.erase(collist.begin(),collist.end()); 48 52 err = noError; 49 53 } -
trunk/gsdl/src/recpt/statusaction.cpp
r165 r172 12 12 /* 13 13 $Log$ 14 Revision 1.6 1999/02/25 21:59:02 rjmcnab 15 16 Merged sources. 17 14 18 Revision 1.5 1999/02/21 22:33:58 rjmcnab 15 19 … … 68 72 } 69 73 70 bool statusaction::do_action (cgiargsclass &args, outconvertclass &outconvert, 71 recptproto */*collectproto*/, ostream &textout, 72 ostream &/*logout*/) { 73 74 bool statusaction::do_action (cgiargsclass &args, recptproto */*collectproto*/, 75 displayclass &/*disp*/, outconvertclass &outconvert, 76 ostream &textout, ostream &/*logout*/) { 74 77 textout << outconvert << "<html>\n"; 75 78 textout << outconvert << "<head>\n"; -
trunk/gsdl/src/recpt/statusaction.h
r165 r172 34 34 void get_cgihead_info (cgiargsclass &args, response_t &response, 35 35 text_t &response_data, ostream &logout); 36 bool do_action (cgiargsclass &args, outconvertclass &outconvert, 37 recptproto *collectproto, ostream &textout, 38 ostream &logout); 36 bool do_action (cgiargsclass &args, recptproto *collectproto, 37 displayclass &disp, outconvertclass &outconvert, 38 ostream &textout, ostream &logout); 39 39 40 void configure (const text_t &key, const text_tarray &cfgline); 40 41 };
Note:
See TracChangeset
for help on using the changeset viewer.