Changeset 7414 for trunk/gsdl/src/recpt/OIDtools.cpp
- Timestamp:
- 2004-05-25T11:02:29+12:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/OIDtools.cpp
r2261 r7414 66 66 if (*here == '.') parents.push_back(thisparent); 67 67 thisparent.push_back(*here); 68 here ++;68 ++here; 69 69 } 70 70 } … … 75 75 // metadata fields are to be requested. 76 76 77 bool get_info (const text_t &OID, const text_t &collection, 77 bool get_info (const text_t &OID, const text_t &collection, const text_t &lang, 78 78 const text_tset &metadata, bool getParents, 79 79 recptproto *collectproto, FilterResponse_t &response, … … 87 87 88 88 request.filterName = "NullFilter"; 89 request.filterLang = lang; 89 90 request.filterResultOptions = FRmetadata; 90 91 request.getParents = getParents; … … 107 108 108 109 // overloaded, to allow "custom" filter options. 109 bool get_info (const text_t &OID, const text_t &collection, 110 bool get_info (const text_t &OID, const text_t &collection, const text_t &lang, 110 111 const text_tset &metadata, const OptionValue_tarray &options, 111 112 bool getParents, … … 119 120 120 121 request.filterName = "NullFilter"; 122 request.filterLang = lang; 121 123 request.filterResultOptions = FRmetadata; 122 124 request.getParents = getParents; … … 139 141 } 140 142 141 bool get_info (const text_tarray &OIDs, const text_t &collection, 143 bool get_info (const text_tarray &OIDs, const text_t &collection, const text_t &lang, 142 144 const text_tset &metadata, bool getParents, 143 145 recptproto *collectproto, FilterResponse_t &response, … … 151 153 152 154 request.filterName = "NullFilter"; 155 request.filterLang = lang; 153 156 request.filterResultOptions = FRmetadata; 154 157 request.getParents = getParents; … … 172 175 173 176 // has_children returns true if OID has children 174 bool has_children (const text_t &OID, const text_t &collection, 177 bool has_children (const text_t &OID, const text_t &collection, const text_t &lang, 175 178 recptproto *collectproto, ostream &logout) { 176 179 … … 179 182 metadata.insert ("haschildren"); 180 183 181 if (get_info (OID, collection, metadata, false, collectproto, response, logout)) {184 if (get_info (OID, collection, lang, metadata, false, collectproto, response, logout)) { 182 185 if (response.docInfo[0].metadata["haschildren"].values[0] == "1") 183 186 return true; … … 191 194 // with whatever metadata fields are to be requested. 192 195 193 bool get_children (const text_t &OID, const text_t &collection, 196 bool get_children (const text_t &OID, const text_t &collection, const text_t &lang, 194 197 const text_tset &metadata, bool getParents, 195 198 recptproto *collectproto, FilterResponse_t &response, … … 206 209 request.filterOptions.push_back (option); 207 210 request.filterName = "BrowseFilter"; 211 request.filterLang = lang; 208 212 request.filterResultOptions = FROID | FRmetadata; 209 213 request.fields = metadata; … … 250 254 if (*here == '"') temp += parent; 251 255 else temp.push_back (*here); 252 here ++;256 ++here; 253 257 } 254 258 OID = temp; … … 290 294 291 295 static void recurse_contents (ResultDocInfo_t section, const bool &is_classify, 292 const text_t &collection, const text_tset &metadata, 296 const text_t &collection, const text_t &lang, 297 const text_tset &metadata, 293 298 recptproto *collectproto, FilterResponse_t &response, 294 299 ostream &logout) { … … 300 305 FilterResponse_t tmp; 301 306 bool getParents = false; 302 get_children (section.OID, collection, metadata, getParents, collectproto, tmp, logout);307 get_children (section.OID, collection, lang, metadata, getParents, collectproto, tmp, logout); 303 308 ResultDocInfo_tarray::iterator thisdoc = tmp.docInfo.begin(); 304 309 ResultDocInfo_tarray::iterator lastdoc = tmp.docInfo.end(); 305 310 while (thisdoc != lastdoc) { 306 311 response.docInfo.push_back (*thisdoc); 307 recurse_contents (*thisdoc, is_classify, collection, metadata,312 recurse_contents (*thisdoc, is_classify, collection, lang, metadata, 308 313 collectproto, response, logout); 309 thisdoc ++;314 ++thisdoc; 310 315 } 311 316 } … … 315 320 // below (and including) OID. 316 321 void get_contents (const text_t &topOID, const bool &is_classify, 317 text_tset &metadata, const text_t &collection, 322 text_tset &metadata, const text_t &collection, const text_t &lang, 318 323 recptproto *collectproto, FilterResponse_t &response, 319 324 ostream &logout) { … … 326 331 327 332 // get topOIDs info 328 if (get_info (topOID, collection, metadata, false, collectproto, response, logout)) 329 recurse_contents (response.docInfo[0], is_classify, collection, 330 metadata, collectproto, response, logout); 333 if (get_info (topOID, collection, lang, metadata, false, collectproto, response, logout)) { 334 recurse_contents (response.docInfo[0], is_classify, collection, lang, 335 metadata, collectproto, response, logout); 336 } 331 337 } 332 338
Note:
See TracChangeset
for help on using the changeset viewer.