Changeset 226 for trunk/gsdl/src/recpt
- Timestamp:
- 1999-04-07T10:20:35+12:00 (25 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/Makefile
r220 r226 42 42 43 43 COLSERVRHEADERS = infodbclass.h mgq.h mgsearch.h querycache.h queryinfo.h \ 44 collectserver.h colservrconfig.h maptools.h filter.h source.h 44 collectserver.h colservrconfig.h maptools.h filter.h \ 45 source.h browsefilter.h queryfilter.h 45 46 46 47 LIBRARYHEADERS = $(COLSERVRHEADERS) \ … … 58 59 59 60 COLSERVRSOURCES = infodbclass.cpp mgq.c mgsearch.cpp querycache.cpp queryinfo.cpp \ 60 collectserver.cpp colservrconfig.cpp maptools.cpp filter.cpp source.cpp 61 collectserver.cpp colservrconfig.cpp maptools.cpp filter.cpp \ 62 source.cpp browsefilter.cpp queryfilter.cpp 61 63 62 64 LIBRARYSOURCES = $(COLSERVRSOURCES) \ … … 74 76 75 77 COLSERVROBJECTS = infodbclass.o mgq.o mgsearch.o querycache.o queryinfo.o \ 76 collectserver.o colservrconfig.o maptools.o filter.o source.o 78 collectserver.o colservrconfig.o maptools.o filter.o \ 79 source.o browsefilter.o queryfilter.o 77 80 78 81 LIBRARYOBJECTS = $(COLSERVROBJECTS) \ … … 212 215 queryinfo.o: ../../lib/text_t.h 213 216 collectserver.o: collectserver.h ../../lib/gsdlconf.h ../../lib/site.h 214 collectserver.o: ../../lib/text_t.h comtypes.h maptools.h217 collectserver.o: ../../lib/text_t.h comtypes.h filter.h source.h 215 218 colservrconfig.o: colservrconfig.h ../../lib/gsdlconf.h ../../lib/site.h 216 colservrconfig.o: ../../lib/text_t.h collectserver.h comtypes.h maptools.h217 colservrconfig.o: ../../lib/fileutil.h ../../lib/cfgread.h219 colservrconfig.o: ../../lib/text_t.h collectserver.h comtypes.h filter.h 220 colservrconfig.o: source.h ../../lib/fileutil.h ../../lib/cfgread.h 218 221 maptools.o: maptools.h ../../lib/gsdlconf.h ../../lib/site.h 219 222 maptools.o: ../../lib/text_t.h 220 223 filter.o: filter.h ../../lib/gsdlconf.h ../../lib/site.h ../../lib/text_t.h 221 filter.o: comtypes.h 224 filter.o: comtypes.h ../../lib/fileutil.h 222 225 source.o: source.h ../../lib/gsdlconf.h ../../lib/site.h ../../lib/text_t.h 223 226 source.o: comtypes.h 227 browsefilter.o: browsefilter.h ../../lib/gsdlconf.h ../../lib/site.h 228 browsefilter.o: ../../lib/text_t.h comtypes.h filter.h infodbclass.h 229 browsefilter.o: ../../lib/fileutil.h 230 queryfilter.o: queryfilter.h ../../lib/gsdlconf.h ../../lib/site.h 231 queryfilter.o: ../../lib/text_t.h comtypes.h filter.h infodbclass.h 232 queryfilter.o: maptools.h ../../lib/fileutil.h 224 233 nullproto.o: nullproto.h ../../lib/gsdlconf.h ../../lib/site.h 225 nullproto.o: collectserver.h ../../lib/text_t.h comtypes.h maptools.h234 nullproto.o: collectserver.h ../../lib/text_t.h comtypes.h filter.h source.h 226 235 nullproto.o: recptproto.h colservrconfig.h 227 236 librarymain.o: receptionist.h ../../lib/gsdlconf.h ../../lib/site.h 228 237 librarymain.o: ../../lib/text_t.h cgiargs.h ../../lib/display.h action.h 229 238 librarymain.o: recptproto.h comtypes.h converter.h ../../lib/gsdlunicode.h 230 librarymain.o: cgiwrapper.h nullproto.h collectserver.h maptools.h 239 librarymain.o: cgiwrapper.h nullproto.h collectserver.h filter.h source.h 240 librarymain.o: browsefilter.h infodbclass.h queryfilter.h maptools.h -
trunk/gsdl/src/recpt/comtypes.cpp
r220 r226 12 12 /* 13 13 $Log$ 14 Revision 1.6 1999/04/06 22:20:34 rjmcnab 15 Got browsefilter working. 16 14 17 Revision 1.5 1999/03/31 23:44:47 rjmcnab 15 18 Altered the protocol so that the metadata is part of the filter. … … 39 42 else if (err == authenticationFailure) return "authentication failure"; 40 43 else if (err == protocolError) return "protocol error"; 44 else if (err == configurationError) return "configuration error"; 41 45 else if (err == systemProblem) return "system problem"; 42 46 … … 94 98 95 99 void FilterOption_t::check_defaultValue () { 96 if (validValues.empty()) { 97 // nothing to check against 98 defaultValue.clear(); 99 return; 100 text_tarray::iterator here, end; 101 102 // how the default is interpreted depends on the option type 103 switch (type) { 104 case booleant: 105 case enumeratedt: // has to be one of the validValues 106 here = validValues.begin (); 107 end = validValues.end (); 108 while (here != end) { 109 if (*here == defaultValue) return; 110 here++; 111 } 112 113 break; 114 115 case integert: // has to be in the validValues range 116 if ((validValues.size() >= 2) && 117 (validValues[0].getint() <= defaultValue.getint()) && 118 (validValues[1].getint() >= defaultValue.getint())) 119 return; 120 break; 121 122 case stringt: // any value is valid 123 return; 100 124 } 101 125 102 text_tarray::iterator here = validValues.begin (); 103 text_tarray::iterator end = validValues.end (); 104 while (here != end) { 105 if (*here == defaultValue) { 106 // found the default value in the list of valid values 107 // now there is nothing more to do 108 return; 109 } 110 111 here++; 112 } 113 114 // did not find the defaultValue, set it to be the 115 // first option in the list 116 defaultValue = validValues[0]; 126 // did not find the defaultValue 127 if (validValues.empty()) defaultValue.clear(); 128 else defaultValue = validValues[0]; 117 129 } 118 130 -
trunk/gsdl/src/recpt/comtypes.h
r220 r226 32 32 33 33 34 enum comerror_t {noError, authenticationFailure, protocolError, systemProblem}; 34 enum comerror_t {noError, authenticationFailure, protocolError, 35 configurationError, systemProblem}; 35 36 text_t get_comerror_string (comerror_t err); 36 37 … … 203 204 text_t filterName; 204 205 OptionValue_tarray filterOptions; 205 text_t array docSet; // contains ""if not used206 text_tset docSet; // empty if not used 206 207 int filterResultOptions; // use the FR* defines above 207 208 -
trunk/gsdl/src/recpt/librarymain.cpp
r189 r226 12 12 /* 13 13 $Log$ 14 Revision 1.3 1999/04/06 22:20:35 rjmcnab 15 Got browsefilter working. 16 14 17 Revision 1.2 1999/03/05 03:53:54 sjboddie 15 18 … … 27 30 #include "nullproto.h" 28 31 #include "collectserver.h" 32 #include "filter.h" 33 #include "browsefilter.h" 34 #include "queryfilter.h" 35 #include "infodbclass.h" 36 #include "mgsearch.h" 29 37 #include <assert.h> 30 38 … … 35 43 // add a collection server for each collection ... (not implemented yet) 36 44 collectserver cserver; 45 gdbmclass gdbmhandler; 46 mgsearchclass mgsearch; 47 48 // add a null filter 49 filterclass filter; 50 cserver.add_filter (&filter); 51 52 // add a browse filter 53 browsefilterclass browsefilter; 54 browsefilter.set_gdbmptr (&gdbmhandler); 55 cserver.add_filter (&browsefilter); 56 57 // add a query filter 58 queryfilterclass queryfilter; 59 queryfilter.set_gdbmptr (&gdbmhandler); 60 queryfilter.set_mgsearchptr (&mgsearch); 61 cserver.add_filter (&queryfilter); 62 63 // inform collection server and everything it contains about its 64 // collection name 37 65 cserver.configure ("collection", "gberg"); 66 38 67 nproto.add_collectserver (&cserver); 39 68 … … 41 70 recpt.add_protocol (&nproto); 42 71 43 cgiwrapper (recpt, " gberg");72 cgiwrapper (recpt, "cnrub"); 44 73 return 0; 45 74 } -
trunk/gsdl/src/recpt/statusaction.cpp
r220 r226 12 12 /* 13 13 $Log$ 14 Revision 1.12 1999/04/06 22:20:35 rjmcnab 15 Got browsefilter working. 16 14 17 Revision 1.11 1999/03/31 23:44:49 rjmcnab 15 18 Altered the protocol so that the metadata is part of the filter. … … 470 473 } 471 474 472 /* textout << outconvert << "<hr>\n" 473 << "<h3>Metadata options</h3>\n";474 475 MetadataInfoResponse_t metainfo;476 rproto->get_ metadataoptions (arg_c, metainfo, err, logout);475 476 InfoFiltersResponse_t filterinfo; 477 InfoFilterOptionsRequest_t filteroptions_request; 478 InfoFilterOptionsResponse_t filteroptions; 479 rproto->get_filterinfo (arg_c, filterinfo, err, logout); 477 480 if (err == noError) { 478 textout << outconvert 479 << "<table>\n" 480 << "<tr><th>supported fields</th><td>"; 481 text_tset::iterator sup_here = metainfo.supportedFields.begin(); 482 text_tset::iterator sup_end = metainfo.supportedFields.end(); 483 bool sup_first = true; 484 while (sup_here != sup_end) { 485 if (!sup_first) textout << outconvert << ", "; 486 sup_first = false; 487 textout << outconvert << "\"" << *sup_here << "\""; 488 sup_here++; 489 } 490 textout << outconvert << "</td></tr>\n" 491 492 << "<tr><th>supported languages</th><td>"; 493 sup_here = metainfo.supportedLanguages.begin(); 494 sup_end = metainfo.supportedLanguages.end(); 495 sup_first = true; 496 while (sup_here != sup_end) { 497 if (!sup_first) textout << outconvert << ", "; 498 sup_first = false; 499 textout << outconvert << "\"" << *sup_here << "\""; 500 sup_here++; 501 } 502 textout << outconvert << "</td></tr>\n" 503 << "</table>\n"; 504 505 } else { 506 textout << outconvert << "Error (" << get_comerror_string (err) 507 << ") while getting metadata information\n"; 508 } 509 */ 510 textout << outconvert << "<hr>\n"; 511 /* // this needs some work 512 InfoFilterOptionsResponse_t filterinfo; 513 rproto->get_filteroptions (arg_c, filterinfo, err, logout); 514 if (err == noError) { 515 FilterDescript_tmap::iterator filter_here = 516 filterinfo.filterOptions.begin(); 517 FilterDescript_tmap::iterator filter_end = 518 filterinfo.filterOptions.end(); 519 while (filter_here != filter_end) { 481 text_tset::iterator filternames_here = filterinfo.filterNames.begin(); 482 text_tset::iterator filternames_end = filterinfo.filterNames.end(); 483 while (filternames_here != filternames_end) { 520 484 textout << outconvert 521 << "<h3>Filter options for \"" << (*filter_here).first << "\"</h3>\n" 485 << "<hr>\n" 486 << "<h3>Filter options for \"" << (*filternames_here) << "\"</h3>\n" 522 487 << "<table>\n" 523 488 << "<tr><th>option name</th><th>type</th><th>repeatable</th>" 524 489 << "<th>default value</th><th>valid values</th></tr>\n"; 525 490 526 FilterOption_tmap::iterator filteropt_here = 527 (*filter_here).second.filterOptions.begin(); 528 FilterOption_tmap::iterator filteropt_end = 529 (*filter_here).second.filterOptions.end(); 530 while (filteropt_here != filteropt_end) { 491 filteroptions_request.clear(); 492 filteroptions_request.filterName = *filternames_here; 493 rproto->get_filteroptions (arg_c, filteroptions_request, 494 filteroptions, err, logout); 495 if (err == noError) { 496 FilterOption_tmap::iterator filteropt_here = 497 filteroptions.filterOptions.begin(); 498 FilterOption_tmap::iterator filteropt_end = 499 filteroptions.filterOptions.end(); 500 while (filteropt_here != filteropt_end) { 501 textout << outconvert 502 << "<tr><td>\"" 503 << (*filteropt_here).second.name 504 << "\"</td>\n" 505 506 << "<td>"; 507 text_t type_string; 508 switch ((*filteropt_here).second.type) { 509 case FilterOption_t::booleant: type_string = "boolean"; break; 510 case FilterOption_t::integert: type_string = "integer"; break; 511 case FilterOption_t::enumeratedt: type_string = "enumerated"; break; 512 case FilterOption_t::stringt: type_string = "string"; break; 513 } 514 textout << outconvert 515 << type_string 516 << "</td>\n" 517 518 << "<td>"; 519 text_t repeat_string; 520 switch ((*filteropt_here).second.repeatable) { 521 case FilterOption_t::onePerQuery: repeat_string = "one per query"; break; 522 case FilterOption_t::onePerTerm: repeat_string = "one per term"; break; 523 case FilterOption_t::nPerTerm: repeat_string = "n per term"; break; 524 } 525 textout << outconvert 526 << repeat_string 527 << "</td>\n" 528 529 << "<td>\"" 530 << (*filteropt_here).second.defaultValue 531 << "\"</td>\n" 532 533 << "<td>"; 534 535 text_tarray::iterator valid_here = 536 (*filteropt_here).second.validValues.begin(); 537 text_tarray::iterator valid_end = 538 (*filteropt_here).second.validValues.end(); 539 bool valid_first = true; 540 while (valid_here != valid_end) { 541 if (!valid_first) textout << outconvert << ", "; 542 valid_first = false; 543 textout << outconvert << "\"" << *valid_here << "\""; 544 valid_here++; 545 } 546 textout << outconvert 547 << "</td></tr>\n"; 548 549 filteropt_here++; 550 } 551 531 552 textout << outconvert 532 << "<tr><td>\"" 533 << (*filteropt_here).second.name 534 << "\"</td>\n" 535 536 << "<td>"; 537 text_t type_string; 538 switch ((*filteropt_here).second.type) { 539 case FilterOption_t::booleant: type_string = "boolean"; break; 540 case FilterOption_t::integert: type_string = "integer"; break; 541 case FilterOption_t::enumeratedt: type_string = "enumerated"; break; 542 case FilterOption_t::stringt: type_string = "string"; break; 543 } 544 textout << outconvert 545 << type_string 546 << "</td>\n" 547 548 << "<td>"; 549 text_t repeat_string; 550 switch ((*filteropt_here).second.repeatable) { 551 case FilterOption_t::onePerQuery: repeat_string = "one per query"; break; 552 case FilterOption_t::onePerTerm: repeat_string = "one per term"; break; 553 case FilterOption_t::nPerTerm: repeat_string = "n per term"; break; 554 } 555 textout << outconvert 556 << repeat_string 557 << "</td>\n" 558 559 << "<td>\"" 560 << (*filteropt_here).second.defaultValue 561 << "\"</td>\n" 562 563 << "<td>"; 564 565 text_tarray::iterator valid_here = 566 (*filteropt_here).second.validValues.begin(); 567 text_tarray::iterator valid_end = 568 (*filteropt_here).second.validValues.end(); 569 bool valid_first = true; 570 while (valid_here != valid_end) { 571 if (!valid_first) textout << outconvert << ", "; 572 valid_first = false; 573 textout << outconvert << "\"" << *valid_here << "\""; 574 valid_here++; 575 } 576 textout << outconvert 577 << "</td></tr>\n"; 578 579 filteropt_here++; 553 << "</table>\n"; 554 555 } else { 556 textout << outconvert << "Error (" << get_comerror_string (err) 557 << ") while getting filter option information\n"; 580 558 } 581 559 582 textout << outconvert 583 << "</table>\n"; 584 585 filter_here++; 560 filternames_here++; 586 561 } 587 562 588 563 } else { 589 564 textout << outconvert << "Error (" << get_comerror_string (err) 590 << ") while getting filter option information\n"; 591 } 592 */ 565 << ") while getting filter information\n"; 566 } 593 567 } 594 568
Note:
See TracChangeset
for help on using the changeset viewer.