Ignore:
Timestamp:
2001-02-09T15:41:33+13:00 (23 years ago)
Author:
jmt14
Message:

Modified files:

browsetools.cpp documentaction.cpp formattools.cpp
formattools.h

File:
1 edited

Legend:

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

    r1860 r1941  
    121121}
    122122
     123//this function outputs the related documents in the format specified
     124//in the collection configuration file if the collection preferences
     125//indicate they wish related documents to be displayed.
     126void output_related_docs (cgiargsclass &args, recptproto *collectproto,
     127              formatinfo_t &formatinfo, displayclass &disp,
     128              outconvertclass &outconvert, ostream &textout,
     129              ostream &logout) {
     130
     131  if (args["d"].empty()) return; //if no OID
     132  if (args["rd"] != "1") return; //if preferences say no related documents
     133 
     134  text_tset metadata;
     135  bool getParents;
     136  FilterResponse_t response;
     137
     138  //create new format pointer and parse the related doc format
     139  //string specified in the collection config file
     140  format_t *formatlistptr = new format_t();
     141  parse_formatstring (formatinfo.RelatedDocuments, formatlistptr, metadata, getParents);
     142
     143  if (!get_info (args["d"], args["c"], metadata, getParents, collectproto, response, logout))
     144    return;
     145 
     146  //get the format string from formattools.cpp
     147  text_t relateddocs =  get_formatted_string (args["c"],collectproto, response.docInfo[0],
     148                          disp, formatlistptr, logout);
     149  //output the related documents
     150  textout << outconvert << disp << relateddocs;
     151}
     152
     153
    123154
    124155static void recurse_contents (ResultDocInfo_t &section, cgiargsclass &args, bool fulltoc,
     
    542573    output_controls (args, formatinfo.DocumentButtons, collectproto, disp,
    543574             outconvert, textout, logout);
    544     textout << "</td><td valign=top>\n";
     575    textout << "</td><td valign=top>\n"; 
    545576    havecontrols = true;
    546577  }
     
    560591  }
    561592
    562   if (havecontrols) textout << "</td></tr></table></center>\n";
    563 }
     593  if (havecontrols) textout << "</td></tr></table></center>\n";
     594
     595  //if there is a format specified in the config file then
     596  //try to display the related documents (may not be displayed
     597  //if preference file does not indicate a wish to display
     598  //related documents.
     599  if (!formatinfo.RelatedDocuments.empty())
     600    output_related_docs(args, collectproto, formatinfo, disp, outconvert, textout, logout);
     601 
     602}
     603
     604
Note: See TracChangeset for help on using the changeset viewer.