Changeset 438 for trunk/gsdl/src/recpt/documentaction.cpp
- Timestamp:
- 1999-08-09T16:25:19+12:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/documentaction.cpp
r437 r438 12 12 /* 13 13 $Log$ 14 Revision 1.18 1999/08/09 04:25:18 sjboddie 15 moved OID translation stuff from documentaction::define_external_macros 16 to receptionist 17 14 18 Revision 1.17 1999/08/09 02:13:53 sjboddie 15 19 fixed small bug in ShowSectionTitles … … 230 234 // define all the macros which might be used by other actions 231 235 // to produce pages. 232 void documentaction::define_external_macros (const ColInfoResponse_t & collectinfo, displayclass &disp,236 void documentaction::define_external_macros (const ColInfoResponse_t &/*collectinfo*/, displayclass &disp, 233 237 cgiargsclass &args, recptproto *collectproto, 234 238 ostream &logout) { … … 248 252 // _javaimagesnavbar_ this is the javascript code to shove in to make the 249 253 // flashy images used by _navigationbar_ work 250 251 // _cgiargd_ these are overridden if they use the tricky ".xx" syntax252 // _cgiargcl_253 254 255 254 256 // can't do anything if collectproto is null (i.e. no collection was specified) 255 257 if (collectproto == NULL) return; … … 259 261 InfoFiltersResponse_t filterinfo; 260 262 FilterResponse_t response; 261 FilterRequest_t request;262 263 text_tarray metadata; 263 264 text_t navigationbar, javaimagesnavbar, width, topparent; … … 267 268 text_t &arg_cl = args["cl"]; 268 269 text_t &collection = args["c"]; 269 270 // if the "gp" (go to page) argument is set we need to set271 // the "d" argument to the corresponding page272 if ((!arg_d.empty()) && (!args["gp"].empty()) &&273 (is_number (args["gp"]))) {274 text_t top;275 get_top (arg_d, top);276 metadata.push_back ("Title");277 bool getParents = false;278 get_children (top, collection, metadata, getParents, collectproto, response, logout);279 ResultDocInfo_tarray::const_iterator dochere = response.docInfo.begin();280 ResultDocInfo_tarray::const_iterator docend = response.docInfo.end();281 while (dochere != docend) {282 if ((*dochere).metadata[0].values[0] == args["gp"]) {283 arg_d = (*dochere).OID;284 disp.setmacro ("cgiargd", "Global", arg_d);285 break;286 }287 dochere ++;288 }289 metadata.erase (metadata.begin(), metadata.end());290 }291 292 bool ShowTopPages = true;293 text_tmap::const_iterator it = collectinfo.format.find("ShowTopPages");294 if ((it != collectinfo.format.end()) && ((*it).second == "false")) ShowTopPages = false;295 296 // do a call to translate OIDs if required297 request.filterName = "NullFilter";298 request.filterResultOptions = FROID;299 if ((!arg_d.empty()) && (needs_translating (arg_d) || !ShowTopPages)) {300 request.docSet.insert (arg_d);301 request.fields.push_back ("classifytype");302 request.filterResultOptions = FRmetadata;303 request.getParents = true;304 collectproto->filter (collection, request, response, err, logout);305 arg_d = response.docInfo[0].OID;306 307 text_t &classifytype = response.docInfo[0].metadata[0].values[0];308 if (classifytype.empty() || classifytype == "book")309 if (!ShowTopPages && is_top (arg_d)) arg_d += ".fc";310 311 request.clear();312 disp.setmacro ("cgiargd", "Global", arg_d);313 }314 // we'll also check here that the "cl" argument has a "classify" doctype315 // (in case ".fc" or ".lc" have screwed up)316 if (needs_translating (arg_cl)) {317 request.fields.push_back("doctype");318 request.docSet.insert (arg_cl);319 request.filterResultOptions = FRmetadata;320 collectproto->filter (collection, request, response, err, logout);321 // set to original value (without .xx stuff) if doctype isn't "classify"322 if (response.docInfo[0].metadata[0].values[0] != "classify")323 strip_suffix (arg_cl);324 else325 arg_cl = response.docInfo[0].OID;326 disp.setmacro ("cgiargcl", "Global", arg_cl);327 }328 270 329 271 // don't want navigation bar if page is 'detached'
Note:
See TracChangeset
for help on using the changeset viewer.