Changeset 346


Ignore:
Timestamp:
1999-07-07T17:47:41+12:00 (25 years ago)
Author:
sjboddie
Message:

changed around the way browsetools works

Location:
trunk/gsdl/src/recpt
Files:
3 edited

Legend:

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

    r280 r346  
    1212/*
    1313   $Log$
     14   Revision 1.10  1999/07/07 05:47:41  sjboddie
     15   changed around the way browsetools works
     16
    1417   Revision 1.9  1999/06/16 23:51:53  sjboddie
    1518   added a strip_suffix function
     
    302305            metadata, collectproto, response, logout);
    303306}
     307
     308// is_child_of returns true if OID2 is a child of OID1
     309bool is_child_of(const text_t &OID1, const text_t &OID2) {
     310
     311  text_t parent = get_parent(OID2);
     312
     313  while (!parent.empty()) {
     314    if (parent == OID1) return true;
     315    parent = get_parent(parent);
     316  }
     317  return false;
     318}
  • trunk/gsdl/src/recpt/OIDtools.h

    r280 r346  
    7474           FilterResponse_t &response, ostream &logout);
    7575
     76// is_child_of returns true if OID2 is a child of OID1
     77bool is_child_of(const text_t &OID1, const text_t &OID2);
     78
     79
    7680#endif
  • trunk/gsdl/src/recpt/documentaction.cpp

    r309 r346  
    1212/*
    1313   $Log$
     14   Revision 1.11  1999/07/07 05:47:41  sjboddie
     15   changed around the way browsetools works
     16
    1417   Revision 1.10  1999/06/29 01:46:44  sjboddie
    1518   now sets a _navigationbar_ macro even if there aren't any
     
    509512          while (sechere != secend) {
    510513        if ((*sechere).metadata[1].values[0] == "classify") {
    511           if ((*sechere).OID == arg_cl) {
     514          if (((*sechere).OID == arg_cl) || is_child_of((*sechere).OID, arg_cl)) {
    512515           
    513516            // set the _httpprevarrow_, _httpnextarrow_ macros while we're here
     
    552555    text_tarray metadata;
    553556    FilterResponse_t response;
    554     text_t topparent, classifytype, classifytitle;
     557    text_t toptitle, toptype, thistype;
    555558   
    556559    text_t &arg_d = args["d"];
     
    568571    }
    569572   
    570     // get the classifytitle and classifytype
    571     get_top (OID, topparent);
     573    // get the classifytitle and classifytype for both the top level
     574    // and the current level (using getParent=true)
    572575    metadata.push_back ("Title");
    573576    metadata.push_back ("classifytype");
    574     if (get_info (topparent, args["c"], metadata, false, collectproto, response, logout)) {
    575       classifytitle = response.docInfo[0].metadata[0].values[0];
    576       classifytype = response.docInfo[0].metadata[1].values[0];
     577    if (get_info (OID, args["c"], metadata, true, collectproto, response, logout)) {
     578      toptitle = response.docInfo[0].metadata[0].values[0];
     579      toptype = response.docInfo[0].metadata[1].values[0];
     580      thistype = response.docInfo[0].metadata[1].values.back();
    577581    }
    578582   
     
    580584    if (!arg_d.empty()) {
    581585     
    582       if (classifytype == "Hierarchy")
    583     output_hierarchy_toc (classifytitle, args, collectproto, disp,
    584                   outconvert, textout, logout);
     586      if (toptype == "Hierarchy")
     587    hierarchy_toc (thistype, toptitle, args, collectproto,
     588               disp, outconvert, textout, logout);
    585589      else
    586590    // Book is the default for a document level toc - AZList, List and
    587591    // Datelist don't make sense for document level
    588     output_book_toc (classifytitle, args, collectproto, disp,
    589             outconvert, textout, logout);
     592    book_toc (toptitle, args, collectproto, disp,
     593          outconvert, textout, logout);
    590594    } else {
    591595   
    592       if (classifytype == "Hierarchy")
    593     output_hierarchy_toc (classifytitle, args, collectproto, disp,
    594                   outconvert, textout, logout);
    595       else if (classifytype == "Datelist")
    596     output_datelist_toc (classifytitle, args, collectproto, disp,
    597                 outconvert, textout, logout);
    598       else if (classifytype == "List")
    599     output_list_toc (classifytitle, args, collectproto, disp,
    600             outconvert, textout, logout);
     596      if (toptype == "Hierarchy")
     597    hierarchy_toc (thistype, toptitle, args, collectproto,
     598               disp, outconvert, textout, logout);
     599      else if (toptype == "Datelist")
     600    datelist_toc (thistype, toptitle, args, collectproto,
     601              disp, outconvert, textout, logout);
     602      else if (toptype == "AZList")
     603    azlist_toc (thistype, toptitle, args, collectproto,
     604            disp, outconvert, textout, logout);
    601605      else
    602     // AZList is the default for a classification level toc - Book doesn't make
     606    // List is the default for a classification level toc - Book doesn't make
    603607    // sense for classification level
    604     output_azlist_toc (classifytitle, args, collectproto, disp,
    605               outconvert, textout, logout);
     608    list_toc (thistype, toptitle, args, collectproto,
     609          disp, outconvert, textout, logout);
    606610    }
    607611
Note: See TracChangeset for help on using the changeset viewer.