Changeset 1270 for trunk/gsdl/src/recpt/pageaction.cpp
- Timestamp:
- 2000-07-06T09:49:36+12:00 (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/pageaction.cpp
r1247 r1270 28 28 /* 29 29 $Log$ 30 Revision 1.33 2000/07/05 21:49:33 sjboddie 31 Receptionist now caches collection information to avoid making multiple 32 get_collectinfo calls to collection server 33 30 34 Revision 1.32 2000/06/27 23:02:40 sjboddie 31 35 Tidied up the way collections are displayed on 'standard' homepage. … … 220 224 while (collist_here != collist_end) { 221 225 222 ColInfoResponse_t cinfo; 223 (*rprotolist_here).p->get_collectinfo (*collist_here, cinfo, err, logout); 226 ColInfoResponse_t *cinfo = recpt->get_collectinfo_ptr ((*rprotolist_here).p, *collist_here, logout); 224 227 225 if ( err == noError) {226 if (cinfo .isPublic && (cinfo.buildDate > 0)) {228 if (cinfo != NULL) { 229 if (cinfo->isPublic && (cinfo->buildDate > 0)) { 227 230 228 231 FilterResponse_t response; … … 258 261 link = "<a href=\"_gwcgi_?a=p&p=about&l=ar&nw=u&c=" + *collist_here + "\">"; 259 262 260 if (!cinfo .receptionist.empty())261 link = "<a href=\"" + cinfo .receptionist + "\">";263 if (!cinfo->receptionist.empty()) 264 link = "<a href=\"" + cinfo->receptionist + "\">"; 262 265 263 266 homeextra += "<td>" + link + collectionname + "</a></td>\n"; … … 324 327 325 328 329 if (recpt == NULL) { 330 logout << "ERROR (pageaction::define_internal_macros): This action does not contain\n" 331 << " information about any receptionists. The method set_receptionist was\n" 332 << " probably not called from the module which instantiated this action.\n"; 333 return; 334 } 335 326 336 text_t &arg_p = args["p"]; 327 337 text_t &arg_c = args["c"]; 328 ColInfoResponse_t cinfo; 329 comerror_t err; 338 ColInfoResponse_t *cinfo = NULL; 330 339 331 340 recptproto* collectproto = protos->getrecptproto (arg_c, logout); 332 341 if (collectproto != NULL) { 333 c ollectproto->get_collectinfo (arg_c, cinfo, err, logout);334 335 disp.setmacro ("numdocs", "Global", cinfo .numDocs);342 cinfo = recpt->get_collectinfo_ptr (collectproto, arg_c, logout); 343 344 disp.setmacro ("numdocs", "Global", cinfo->numDocs); 336 345 unsigned long current_time = time(NULL); 337 unsigned long builddate = (current_time - cinfo .buildDate) / 86400;346 unsigned long builddate = (current_time - cinfo->buildDate) / 86400; 338 347 disp.setmacro ("builddate", "Global", builddate); 339 348 } … … 345 354 // _collectionoption_ 346 355 347 if (args["ccs"] == "1" && collectproto != NULL && (cinfo .ccsCols.size() > 1)) {356 if (args["ccs"] == "1" && collectproto != NULL && (cinfo->ccsCols.size() > 1)) { 348 357 text_t collectionoption = "_textcollectionoption_"; 349 text_tarray::const_iterator col_here = cinfo .ccsCols.begin();350 text_tarray::const_iterator col_end = cinfo .ccsCols.end();358 text_tarray::const_iterator col_here = cinfo->ccsCols.begin(); 359 text_tarray::const_iterator col_end = cinfo->ccsCols.end(); 351 360 int count = 0; 352 361 while (col_here != col_end) { 353 362 text_t colname; 354 363 if (*col_here == arg_c) { 355 colname = cinfo .collectionmeta["collectionname"];364 colname = cinfo->collectionmeta["collectionname"]; 356 365 } else { 357 ColInfoResponse_t this_cinfo; 358 collectproto->get_collectinfo (*col_here, this_cinfo, err, logout); 359 if (err != noError) {col_here ++; continue;} 360 colname = this_cinfo.collectionmeta["collectionname"]; 366 ColInfoResponse_t *this_cinfo = recpt->get_collectinfo_ptr (collectproto, *col_here, logout); 367 if (this_cinfo == NULL) {col_here ++; continue;} 368 colname = this_cinfo->collectionmeta["collectionname"]; 361 369 } 362 370 … … 374 382 // _htmloptions_ 375 383 376 text_tmap::const_iterator it = cinfo .format.find ("DocumentUseHTML");377 if ((it != cinfo .format.end()) && ((*it).second == "true")) {384 text_tmap::const_iterator it = cinfo->format.find ("DocumentUseHTML"); 385 if ((it != cinfo->format.end()) && ((*it).second == "true")) { 378 386 disp.setmacro ("htmloptions", "preferences", "_htmloptionson_"); 379 387 … … 381 389 // _PreferenceDocsFromWeb_ 382 390 383 it = cinfo .format.find ("PreferenceDocsFromWeb");384 if ((it == cinfo .format.end()) || ((*it).second == "true"))391 it = cinfo->format.find ("PreferenceDocsFromWeb"); 392 if ((it == cinfo->format.end()) || ((*it).second == "true")) 385 393 disp.setmacro ("PreferenceDocsFromWeb", "preferences", "1"); 386 394 } … … 407 415 408 416 text_t languageoption = "_textlanguage_\n<select name=\"l\" onChange=\"updatel();\">\n"; 409 it = cinfo .format.find ("PreferenceLanguages");410 if ((it != cinfo .format.end()) && (!(*it).second.empty())) {417 it = cinfo->format.find ("PreferenceLanguages"); 418 if ((it != cinfo->format.end()) && (!(*it).second.empty())) { 411 419 text_tset pref_langs; 412 420 splitchar ((*it).second.begin(), (*it).second.end(), '|', pref_langs); … … 479 487 480 488 // if HTML collection there's no how to read document text 481 text_tmap::const_iterator it = cinfo .format.find ("HelpNoDocs");482 if ((it != cinfo .format.end()) && ((*it).second == "true")) {489 text_tmap::const_iterator it = cinfo->format.find ("HelpNoDocs"); 490 if ((it != cinfo->format.end()) && ((*it).second == "true")) { 483 491 disp.setmacro ("topicreadingdocs", "help", ""); 484 492 disp.setmacro ("texthelpreadingdocs", "help", ""); 485 493 } 486 it = cinfo .format.find ("HelpBibDocs");487 if ((it != cinfo .format.end()) && ((*it).second == "true")) {494 it = cinfo->format.find ("HelpBibDocs"); 495 if ((it != cinfo->format.end()) && ((*it).second == "true")) { 488 496 disp.setmacro ("texthelpreadingdocs", "help", "_bibtexthelpreadingdocs_"); 489 497 disp.setmacro ("textreadingdocs", "help", "_bibtextreadingdocs_"); 490 498 } 491 it = cinfo .format.find ("HelpBookDocs");492 if ((it != cinfo .format.end()) && ((*it).second == "true")) {499 it = cinfo->format.find ("HelpBookDocs"); 500 if ((it != cinfo->format.end()) && ((*it).second == "true")) { 493 501 disp.setmacro ("texthelpreadingdocs", "help", "_booktexthelpreadingdocs_"); 494 502 disp.setmacro ("textreadingdocs", "help", "_booktextreadingdocs_"); … … 499 507 500 508 // _textsubcollections_ 501 if (args["ccs"] == "1" && (cinfo .ccsCols.size() > 1)) {502 text_t textsubcollections = "_textsubcols1_(" + text_t(cinfo .ccsCols.size()) + ")";503 text_tarray::const_iterator here = cinfo .ccsCols.begin();504 text_tarray::const_iterator end = cinfo .ccsCols.end();509 if (args["ccs"] == "1" && (cinfo->ccsCols.size() > 1)) { 510 text_t textsubcollections = "_textsubcols1_(" + text_t(cinfo->ccsCols.size()) + ")"; 511 text_tarray::const_iterator here = cinfo->ccsCols.begin(); 512 text_tarray::const_iterator end = cinfo->ccsCols.end(); 505 513 bool first = true; 506 514 int count = 0; … … 508 516 if (*here == arg_c) { 509 517 if (!first) textsubcollections += "<br>"; 510 textsubcollections += "\n" + cinfo .collectionmeta["collectionname"] + "\n";518 textsubcollections += "\n" + cinfo->collectionmeta["collectionname"] + "\n"; 511 519 } else { 512 ColInfoResponse_t this_cinfo; 513 collectproto->get_collectinfo (*here, this_cinfo, err, logout); 514 if (err != noError) {here ++; continue;} 520 ColInfoResponse_t *this_cinfo = recpt->get_collectinfo_ptr (collectproto, *here, logout); 521 if (this_cinfo == NULL) {here ++; continue;} 515 522 if (!first) textsubcollections += "<br>"; 516 textsubcollections += "\n" + this_cinfo .collectionmeta["collectionname"] + "\n";523 textsubcollections += "\n" + this_cinfo->collectionmeta["collectionname"] + "\n"; 517 524 } 518 525 count ++;
Note:
See TracChangeset
for help on using the changeset viewer.