Changeset 4936 for trunk/gsdl/src/recpt/documentaction.cpp
- Timestamp:
- 2003-07-16T09:04:05+12:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/documentaction.cpp
r4906 r4936 25 25 26 26 #include <string.h> 27 #include <sstream> 28 27 29 #include "documentaction.h" 28 30 #include "browsetools.h" … … 416 418 // _httppagehome_ overridden home url if html collections have own homepage 417 419 418 // _usability_ -a macro for remote usability reporting420 // _usability_ a macro for remote usability reporting 419 421 420 422 // must have a valid collection server to continue 423 421 424 text_t &collection = args["c"]; 422 425 if (collection.empty()) return; … … 630 633 631 634 // must have a valid collection server to continue 632 text_t &collection = args["c"]; 635 636 text_t &collection = args["c"]; 633 637 if (collection.empty()) return; 634 638 recptproto *collectproto = protos->getrecptproto (collection, logout); … … 692 696 //call function in formattools.cpp which will return the text of the 693 697 //related documents in a vertical list. This is the default format. 698 694 699 if (get_info (arg_d, collection, metadata, options, false, collectproto, response, logout)) 695 700 relation += get_related_docs(collection, collectproto, response.docInfo[0], logout); 696 701 697 702 //set macro to be the related document string 703 698 704 disp.setmacro ("relateddoc", "document", relation); 699 705 } … … 837 843 << "</html>\n"; 838 844 } else { 839 output_document (OID, args, collectproto, disp, outconvert, textout, logout);845 output_document (OID, args, collectproto, browsers, disp, outconvert, textout, logout); 840 846 } 841 847 return true; … … 861 867 if (!args["d"].empty()) { 862 868 textout << outconvert << "<p>\n"; 863 output_document (OID, args, collectproto, disp, outconvert, textout, logout);869 output_document (OID, args, collectproto, browsers, disp, outconvert, textout, logout); 864 870 } 865 871 … … 872 878 const TermInfo_tarray &terminfo, const text_t &OID, 873 879 bool highlight, int hastxt, int wanttext, 874 text_t &collection, recptproto *collectproto, 875 displayclass &disp, outconvertclass &outconvert,876 o stream &textout, ostream &logout,877 cgiargsclass &args) {880 text_t &collection, recptproto *collectproto, 881 browsermapclass *browsers, displayclass &disp, 882 outconvertclass &outconvert, ostream &textout, 883 ostream &logout, cgiargsclass &args) { 878 884 879 885 DocumentRequest_t docrequest; … … 901 907 text_tmap options; 902 908 options["text"] = docresponse.doc; 909 options["DocImage"] = get_cover_image(); 910 911 ostringstream tmpstr(ostringstream::binary); 912 if (args["gc"] == "1") { 913 expanded_contents (args, 0, false, browsers, formatinfo, 914 collectproto, disp, outconvert, tmpstr, 915 logout); 916 } else { 917 contracted_contents (args, 0, false, browsers, formatinfo, 918 collectproto, disp, outconvert, tmpstr, logout); 919 } 920 text_t tmp = (char *)(tmpstr.str().c_str()); 921 int len = tmp.size(); 922 char *ctmp = tmp.getcstr(); 923 utf8inconvertclass utf82text_t; 924 utf82text_t.setinput(ctmp, len); 925 convertclass::status_t status; 926 utf82text_t.convert(tmp, status); 927 options["DocTOC"] = tmp; 928 delete ctmp; 929 930 options["DocumentButtonDetach"] = "_document:imagedetach_"; 931 if (args["hl"] == "1") { 932 options["DocumentButtonHighlight"] = "_document:imagenohighlight_"; 933 } else { 934 options["DocumentButtonHighlight"] = "_document:imagehighlight_"; 935 } 936 if (args["gc"] == "1") { 937 options["DocumentButtonExpandContents"] = "_document:imagecontracttoc_"; 938 } else { 939 options["DocumentButtonExpandContents"] = "_document:imageexpandtoc_"; 940 } 941 if (args["gt"] == "1") { 942 options["DocumentButtonExpandText"] = "_document:imagecontracttext_"; 943 } else { 944 options["DocumentButtonExpandText"] = "_document:imageexpandtext_"; 945 } 946 903 947 text_t doctext 904 948 = get_formatted_string (collection, collectproto, docinfo, disp, … … 916 960 917 961 void documentaction::output_document (const text_t &OID, cgiargsclass &args, 918 recptproto *collectproto, displayclass &disp,919 outconvertclass &outconvert, ostream &textout,920 ostream & logout) {962 recptproto *collectproto, browsermapclass *browsers, 963 displayclass &disp, outconvertclass &outconvert, 964 ostream &textout, ostream &logout) { 921 965 FilterResponse_t inforesponse; 922 966 FilterResponse_t queryresponse; … … 930 974 // if we have a query string and highlighting is turned on we need 931 975 // to redo the query to get the terms for highlighting 976 932 977 if (!args["q"].empty() && args.getintarg("hl")) { 933 978 FilterRequest_t request; … … 972 1017 output_text (inforesponse.docInfo[0], formatlistptr, queryresponse.termInfo, 973 1018 OID, highlight, hastxt, wanttext, collection, collectproto, 974 disp, outconvert, textout, logout, args);1019 browsers, disp, outconvert, textout, logout, args); 975 1020 976 1021 … … 1015 1060 output_text (thisdocinfo, formatlistptr, queryresponse.termInfo, 1016 1061 OID, highlight, hastxt, wanttext, collection, 1017 collectproto, disp, outconvert, textout, logout, args);1062 collectproto, browsers, disp, outconvert, textout, logout, args); 1018 1063 1019 1064 } … … 1032 1077 output_text (*sechere, formatlistptr, queryresponse.termInfo, 1033 1078 (*sechere).OID, highlight, shastxt, wanttext, collection, 1034 collectproto, disp, outconvert, textout, logout, args);1079 collectproto, browsers, disp, outconvert, textout, logout, args); 1035 1080 count ++; 1036 1081 sechere ++;
Note:
See TracChangeset
for help on using the changeset viewer.