Changeset 4774 for trunk/gsdl/src/recpt
- Timestamp:
- 2003-06-24T12:28:40+12:00 (21 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/documentaction.cpp
r4740 r4774 246 246 // set_widthtspace calculates how wide the spaces in the nav bar should 247 247 // be and sets the appropriate macro 248 void documentaction::set_spacemacro (displayclass &disp, FilterResponse_t &response) { 248 void documentaction::set_spacemacro (displayclass &disp, FilterResponse_t &response, 249 bool has_search_button) { 249 250 250 251 text_t width; … … 258 259 twidth = width.getint(); 259 260 260 disp.expandstring ("query", "_searchwidth_", width); 261 iwidth += width.getint(); 262 263 261 if (has_search_button) { 262 disp.expandstring ("query", "_searchwidth_", width); 263 iwidth += width.getint(); 264 } else { 265 numc -= 1; 266 } 264 267 265 268 while (dochere != docend) { … … 283 286 // reponse contains 1 metadata field (Title) 284 287 void documentaction::set_navbarmacros (displayclass &disp, FilterResponse_t &response, 285 cgiargsclass &args) {288 bool has_search_button, cgiargsclass &args) { 286 289 287 290 text_t topparent; … … 295 298 296 299 navigationbar += "<nobr>\n"; 297 if (args["a"] == "q") { 298 navigationbar += "_icontabsearchgreen_"; 299 } else { 300 navigationbar += "_imagesearch_"; 301 } 302 303 304 if (numc == 0) navigationbar += "_imagespacer_"; 305 300 if (has_search_button) { 301 if (args["a"] == "q") { 302 navigationbar += "_icontabsearchgreen_"; 303 } else { 304 navigationbar += "_imagesearch_"; 305 } 306 } 307 308 if (has_search_button || numc == 0) navigationbar += "_imagespacer_"; 309 310 bool first = true; 306 311 while (dochere != docend) { 312 313 if (!first) navigationbar += "_imagespacer_"; 314 307 315 text_t title = (*dochere).metadata["Title"].values[0]; 308 316 … … 318 326 // if we're inside a document all the classification buttons should be enabled 319 327 if (arg_d.empty() && ((*dochere).OID == topparent)) { 320 if (unknown) navigationbar += " _imagespacer_ " + title + " ";321 else navigationbar += "_i magespacer__icontab" + title + "green_";328 if (unknown) navigationbar += " " + title + " "; 329 else navigationbar += "_icontab" + title + "green_"; 322 330 } else { 323 331 324 332 // set the _httpbrowseXXX_ macro for this classification 325 if (unknown) navigationbar += " _imagespacer_ <a href=\"_httpdocument_&cl=" +333 if (unknown) navigationbar += " <a href=\"_httpdocument_&cl=" + 326 334 (*dochere).OID + "\">" + title + "</a> "; 327 335 else { 328 navigationbar += "_image spacer__image" + title + "_";336 navigationbar += "_image" + title + "_"; 329 337 disp.setmacro ("httpbrowse" + title, "Global", "_httpdocument_&cl=" + (*dochere).OID); 330 338 } 331 339 } 332 340 dochere ++; 341 first = false; 333 342 } 334 343 navigationbar += "\n</nobr>\n"; … … 431 440 get_children ("", collection, metadata, getParents, collectproto, response, logout); 432 441 442 bool has_search_button = true; 443 collectproto->is_searchable(collection, has_search_button, err, logout); 444 if (err != noError) has_search_button = true; 445 433 446 // calculate width of spacers and set _widthtspace_ macro 434 if (args.getintarg("v") == 0) set_spacemacro (disp, response );447 if (args.getintarg("v") == 0) set_spacemacro (disp, response, has_search_button); 435 448 436 449 // set _navigationbar_ macro 437 set_navbarmacros (disp, response, args);450 set_navbarmacros (disp, response, has_search_button, args); 438 451 439 452 } … … 443 456 << get_comerror_string (err); 444 457 } 445 446 447 458 } 448 459 text_tmap::iterator usability = cinfo.format.find("Usability"); -
trunk/gsdl/src/recpt/documentaction.h
r3546 r4774 44 44 void load_formatinfo (const text_tmap &colformat, int gt); 45 45 46 void set_spacemacro (displayclass &disp, FilterResponse_t &response); 46 void set_spacemacro (displayclass &disp, FilterResponse_t &response, 47 bool has_search_button); 47 48 48 49 void set_navbarmacros (displayclass &disp, FilterResponse_t &response, 49 cgiargsclass &args);50 bool has_search_button, cgiargsclass &args); 50 51 51 52 virtual void output_text (ResultDocInfo_t &docinfo, format_t *formatlistptr, -
trunk/gsdl/src/recpt/nullproto.cpp
r2212 r4774 154 154 else err = protocolError; 155 155 } 156 157 void nullproto::is_searchable (const text_t &collection, bool &issearchable, 158 comerror_t &err, ostream &logout) { 159 issearchable = false; 160 collectserver *cserver = cset->getCollectServer (collection); 161 if (cserver != NULL) cserver->is_searchable (issearchable, err, logout); 162 else err = protocolError; 163 } -
trunk/gsdl/src/recpt/nullproto.h
r2113 r4774 90 90 comerror_t &err, ostream &logout); 91 91 92 void is_searchable (const text_t &collection, bool &issearchable, 93 comerror_t &err, ostream &logout); 94 95 92 96 }; 93 97 -
trunk/gsdl/src/recpt/pageaction.cpp
r4770 r4774 526 526 // was pressed 527 527 528 // _aboutqueryform_ will be set to "" if the collection isn't searchable 528 529 529 530 // if page is "help" … … 604 605 disp.setmacro("usabilityscript", "Global", "_usabshowscript_"); 605 606 } 606 607 607 } 608 608 } … … 740 740 } 741 741 textsubcollections += "_textsubcols2_"; 742 if (count > 1) 742 if (count > 1) { 743 743 disp.setmacro ("textsubcollections", "about", textsubcollections); 744 } 745 } 746 747 comerror_t err; 748 bool issearchable = true; 749 collectproto->is_searchable(args["c"], issearchable, err, logout); 750 if (err != noError) issearchable = true; 751 outconvertclass t; 752 if (!issearchable) { 753 disp.setmacro ("aboutqueryform", "about", ""); 744 754 } 745 755 } -
trunk/gsdl/src/recpt/recptproto.cpp
r2113 r4774 126 126 } 127 127 128 // sets issearchable to true if the given colection is searchable 129 void recptproto::is_searchable (const text_t &/*collection*/, bool &issearchable, 130 comerror_t &err, ostream &/*logout*/) { 131 issearchable = false; // no collections are supported by this class 132 err = noError; 133 } 134 128 135 129 136 -
trunk/gsdl/src/recpt/recptproto.h
r2113 r4774 126 126 DocumentResponse_t &response, 127 127 comerror_t &err, ostream &logout); 128 129 virtual void is_searchable (const text_t &collection, bool &issearchable, 130 comerror_t &err, ostream &logout); 131 128 132 }; 129 133
Note:
See TracChangeset
for help on using the changeset viewer.