Changeset 277 for trunk/gsdl/src/recpt/documentaction.cpp
- Timestamp:
- 1999-06-16T15:10:49+12:00 (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/documentaction.cpp
r267 r277 12 12 /* 13 13 $Log$ 14 Revision 1.5 1999/06/16 03:10:49 sjboddie 15 define_internal_macros() now sets _pagetitle_ macro to document's title 16 (including parents of current document) 17 14 18 Revision 1.4 1999/06/15 01:55:29 sjboddie 15 19 - got text highlighting working … … 182 186 int twidth, swidth, iwidth = 0; 183 187 188 text_t &arg_d = args["d"]; 189 text_t &arg_cl = args["cl"]; 190 text_t &collection = args["c"]; 191 184 192 // if the "gp" (go to page) argument is set we need to set 185 193 // the "d" argument to the corresponding page 186 if ((!arg s["d"].empty()) && (!args["gp"].empty()) &&194 if ((!arg_d.empty()) && (!args["gp"].empty()) && 187 195 (is_number (args["gp"]))) { 188 196 text_t top; 189 get_top (arg s["d"], top);197 get_top (arg_d, top); 190 198 metadata.push_back ("Title"); 191 get_children (top, args["c"], metadata, collectproto, response, logout);199 get_children (top, collection, metadata, collectproto, response, logout); 192 200 ResultDocInfo_tarray::const_iterator dochere = response.docInfo.begin(); 193 201 ResultDocInfo_tarray::const_iterator docend = response.docInfo.end(); 194 202 while (dochere != docend) { 195 203 if ((*dochere).metadata[0].values[0] == args["gp"]) { 196 arg s["d"]= (*dochere).OID;197 disp.setmacro ("cgiargd", "Global", arg s["d"]);204 arg_d = (*dochere).OID; 205 disp.setmacro ("cgiargd", "Global", arg_d); 198 206 break; 199 207 } … … 206 214 request.filterName = "NullFilter"; 207 215 request.filterResultOptions = FROID; 208 if (needs_translating (arg s["d"])) {209 request.docSet.insert (arg s["d"]);210 collectproto->filter ( args["c"], request, response, err, logout);211 arg s["d"]= response.docInfo[0].OID;216 if (needs_translating (arg_d)) { 217 request.docSet.insert (arg_d); 218 collectproto->filter (collection, request, response, err, logout); 219 arg_d = response.docInfo[0].OID; 212 220 request.docSet.erase (request.docSet.begin(), request.docSet.end()); 213 disp.setmacro ("cgiargd", "Global", arg s["d"]);214 } 215 if (needs_translating (arg s["cl"])) {216 request.docSet.insert (arg s["cl"]);217 collectproto->filter ( args["c"], request, response, err, logout);218 arg s["cl"]= response.docInfo[0].OID;219 disp.setmacro ("cgiargcl", "Global", arg s["cl"]);220 } 221 222 get_top (arg s["cl"], topparent);223 224 collectproto->get_filterinfo ( args["c"], filterinfo, err, logout);221 disp.setmacro ("cgiargd", "Global", arg_d); 222 } 223 if (needs_translating (arg_cl)) { 224 request.docSet.insert (arg_cl); 225 collectproto->filter (collection, request, response, err, logout); 226 arg_cl = response.docInfo[0].OID; 227 disp.setmacro ("cgiargcl", "Global", arg_cl); 228 } 229 230 get_top (arg_cl, topparent); 231 232 collectproto->get_filterinfo (collection, filterinfo, err, logout); 225 233 if (err == noError) { 226 234 // check that there's a browse filter … … 229 237 metadata.push_back ("Title"); 230 238 metadata.push_back ("classifytype"); 231 get_children ("", args["c"], metadata, collectproto, response, logout);239 get_children ("", collection, metadata, collectproto, response, logout); 232 240 233 241 // don't do anything unless there are classifications … … 270 278 271 279 // if we're inside a document all the classification buttons should be enabled 272 if (arg s["d"].empty() && ((*dochere).OID == topparent))280 if (arg_d.empty() && ((*dochere).OID == topparent)) 273 281 navigationbar += "_imagespacer__icontab" + title + "green_"; 274 282 else { … … 306 314 // define_internal_macros sets the following macros: 307 315 316 // _pagetitle_ the title to be displayed at the top of the browser window 317 308 318 // _imagethispage_ the title image to be displayed at top right of page 309 319 … … 322 332 // flashy buttons work 323 333 324 325 334 // can't do anything if collectproto is null (i.e. no collection was specified) 326 335 if (collectproto == NULL) return; … … 329 338 text_tarray metadata; 330 339 FilterResponse_t response; 331 340 text_t &arg_d = args["d"]; 341 text_t &arg_cl = args["cl"]; 342 text_t &collection = args["c"]; 343 332 344 metadata.push_back ("Title"); 333 345 metadata.push_back ("classifytype"); 334 346 335 if (!arg s["d"].empty()) {347 if (!arg_d.empty()) { 336 348 // we're at document level 337 349 text_t javaimagescontent; 338 350 339 // get metadata for top level of document 340 text_t doctop; 341 get_top (args["d"], doctop); 342 if (get_info (doctop, args["c"], metadata, collectproto, response, logout)) { 351 // get metadata for this document and it's parents 352 if (get_info (arg_d, collection, metadata, true, collectproto, response, logout)) { 343 353 disp.setmacro ("header", "document", "_textheader_"); 354 355 text_t pagetitle; 356 text_tarray::const_iterator this_title = response.docInfo[0].metadata[0].values.begin(); 357 text_tarray::const_iterator end_title = response.docInfo[0].metadata[0].values.end(); 358 while (this_title != end_title) { 359 if ((this_title + 1) == end_title) pagetitle += *this_title; 360 else pagetitle += *this_title + ": "; 361 this_title ++; 362 } 363 disp.setmacro ("pagetitle", "document", pagetitle); 364 344 365 text_t &classifytype = response.docInfo[0].metadata[1].values[0]; 345 366 if (classifytype.empty()) classifytype = "Book"; // defaults to Book 346 367 if ((classifytype == "Book") || (classifytype == "Hierarchy")) 347 set_arrow_macros (arg s["d"], classifytype, disp, collectproto, args["c"], logout);368 set_arrow_macros (arg_d, classifytype, disp, collectproto, collection, logout); 348 369 349 370 if (args["u"] != "1") { … … 366 387 } 367 388 } else { 368 if (!arg s["cl"].empty()) {389 if (!arg_cl.empty()) { 369 390 370 391 // get metadata for top level classification 371 392 text_t classtop; 372 get_top (arg s["cl"], classtop);373 if (get_info (classtop, args["c"], metadata, collectproto, response, logout)) {393 get_top (arg_cl, classtop); 394 if (get_info (classtop, collection, metadata, false, collectproto, response, logout)) { 374 395 375 396 text_t &title = response.docInfo[0].metadata[0].values[0]; … … 391 412 metadata.push_back ("Title"); 392 413 metadata.push_back ("doctype"); 393 if (get_children (classtop, args["c"], metadata, collectproto, response, logout)) {414 if (get_children (classtop, collection, metadata, collectproto, response, logout)) { 394 415 395 416 // don't want links unless there are 2 or more sections … … 405 426 while (sechere != secend) { 406 427 if ((*sechere).metadata[1].values[0] == "classify") { 407 if ((*sechere).OID == arg s["cl"]) {428 if ((*sechere).OID == arg_cl) { 408 429 409 430 // set the _httpprevarrow_, _httpnextarrow_ macros while we're here … … 484 505 metadata.push_back ("Title"); 485 506 metadata.push_back ("classifytype"); 486 if (get_info (topparent, collection, metadata, collectproto, response, logout)) {507 if (get_info (topparent, collection, metadata, false, collectproto, response, logout)) { 487 508 classifytitle = response.docInfo[0].metadata[0].values[0]; 488 509 classifytype = response.docInfo[0].metadata[1].values[0]; … … 520 541 metadata.push_back("haschildren"); 521 542 522 if (get_info (OID, collection, metadata, collectproto, response, logout)) {543 if (get_info (OID, collection, metadata, false, collectproto, response, logout)) { 523 544 text_t &title = response.docInfo[0].metadata[0].values[0]; 524 545 int hastxt = response.docInfo[0].metadata[1].values[0].getint();
Note:
See TracChangeset
for help on using the changeset viewer.