Changeset 2612
- Timestamp:
- 2001-06-27T17:40:11+12:00 (23 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/browseaction.cpp
r2504 r2612 212 212 }// if (err != noError) 213 213 214 }// if(!args["bft"].empty())214 }// end if(!args["bft"].empty()) 215 215 else { 216 216 text_tset metadata_items; … … 221 221 response,logout)) return false; 222 222 } 223 223 224 //get rid of documents that do not have the metadata element classified on 225 if(!remove_no_meta_results("Title",response, outconvert)) { 226 return false; 227 logout<<"ERROR: browseactiontools::remove_no_meta_results failed"<<endl; 228 } 229 224 230 textout << outconvert << disp << "_browse:header_\n" <<"_browse:content_"; 225 231 -
trunk/gsdl/src/recpt/browseactiontools.cpp
r2490 r2612 56 56 } 57 57 58 // this stuff is all copied from the queryoptions code - don't ask how it all 59 // hangs in with the filters - those things are a mystery 58 60 void set_browsefilter_options(FilterRequest_t &request, text_t &browsestring, 59 61 cgiargsclass &args) … … 94 96 } 95 97 98 bool remove_no_meta_results(text_t metaname, FilterResponse_t &response, 99 outconvertclass outconvert) 100 { 101 ResultDocInfo_tarray::iterator check = response.docInfo.begin(); 102 ResultDocInfo_tarray::iterator done = response.docInfo.end(); 103 104 // look through all the returned documents 105 while(check != done){ 106 //if the document doesn't have the metadata item classified on 107 //remove it. 108 if(*((*check).metadata.find(metaname)->second).values.begin()=="") 109 { 110 check = response.docInfo.erase(check); 111 } 112 else { 113 check ++; 114 } 115 116 } 117 return true; 118 } 119 120 121 122 123 -
trunk/gsdl/src/recpt/browseactiontools.h
r2466 r2612 34 34 void format_browsestring(text_t orig, text_t& formatted, int and_or); 35 35 36 //this thing sets up the search associated with a browse. It's programmed by 37 //witchcraft, so I don't really know how/why it works - I lifted the code from 38 //somewhere else. 36 39 void set_browsefilter_options(FilterRequest_t &request, text_t &browsestring, 37 40 cgiargsclass &args); 38 41 39 void format_browsestring(text_t orig, text_t& formatted, int and_or); 42 //this thing filters out all the results of a request to the collection 43 //(whether it be for all documents or just the ones with specified terms) 44 //that don't have the required "metaname" metadata element. 45 bool remove_no_meta_results(text_t metaname, FilterResponse_t &response, 46 outconvertclass outconvert); 40 47 41 48 #endif
Note:
See TracChangeset
for help on using the changeset viewer.