Ignore:
Timestamp:
1999-08-09T16:25:19+12:00 (25 years ago)
Author:
sjboddie
Message:

moved OID translation stuff from documentaction::define_external_macros
to receptionist

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/documentaction.cpp

    r437 r438  
    1212/*
    1313   $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
    1418   Revision 1.17  1999/08/09 02:13:53  sjboddie
    1519   fixed small bug in ShowSectionTitles
     
    230234// define all the macros which might be used by other actions
    231235// to produce pages.
    232 void documentaction::define_external_macros (const ColInfoResponse_t &collectinfo, displayclass &disp,
     236void documentaction::define_external_macros (const ColInfoResponse_t &/*collectinfo*/, displayclass &disp,
    233237                         cgiargsclass &args, recptproto *collectproto,
    234238                         ostream &logout) {
     
    248252  // _javaimagesnavbar_  this is the javascript code to shove in to make the
    249253  //                     flashy images used by _navigationbar_ work
    250 
    251   // _cgiargd_           these are overridden if they use the tricky ".xx" syntax
    252   // _cgiargcl_
    253254 
     255
    254256  // can't do anything if collectproto is null (i.e. no collection was specified)
    255257  if (collectproto == NULL) return;
     
    259261  InfoFiltersResponse_t filterinfo;
    260262  FilterResponse_t response;
    261   FilterRequest_t request;
    262263  text_tarray metadata;
    263264  text_t navigationbar, javaimagesnavbar, width, topparent;
     
    267268  text_t &arg_cl = args["cl"];
    268269  text_t &collection = args["c"];
    269 
    270   // if the "gp" (go to page) argument is set we need to set
    271   // the "d" argument to the corresponding page
    272   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 required
    297   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" doctype
    315   // (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     else
    325       arg_cl = response.docInfo[0].OID;
    326     disp.setmacro ("cgiargcl", "Global", arg_cl);
    327   }
    328270
    329271  // don't want navigation bar if page is 'detached'
Note: See TracChangeset for help on using the changeset viewer.