Changeset 2967
- Timestamp:
- 2002-02-15T13:51:52+13:00 (22 years ago)
- Location:
- trunk/gsdl/src/recpt
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/recpt/formattools.cpp
r2706 r2967 27 27 #include "cgiutils.h" 28 28 #include "OIDtools.h" 29 #include "summarise.h" 29 30 30 31 #include <assert.h> … … 39 40 static bool parse_action (text_t::const_iterator &here, const text_t::const_iterator &end, 40 41 format_t *formatlistptr, text_tset &metadata, bool &getParents); 42 43 text_t format_summary (const text_t& collection, recptproto* collectproto, 44 ResultDocInfo_t &docinfo, displayclass &disp, 45 const text_t &text, bool highlight, 46 ostream& logout); 47 41 48 42 49 void metadata_t::clear() { … … 530 537 formatlistptr->command = comEndHighlight; 531 538 539 else if (meta == "Summary") 540 formatlistptr->command = comSummary; 541 532 542 else { 533 543 formatlistptr->command = comMeta; … … 959 969 case comRel: //if [RelatedDocuments] appears in format string, collect relation data 960 970 return get_related_docs(collection, collectproto, docinfo, logout); 971 case comSummary: 972 return format_summary(collection,collectproto,docinfo,disp,text,highlight,logout); 961 973 case comMeta: 962 974 … … 1077 1089 text, logout); 1078 1090 } 1091 1092 1093 /* FUNCTION NAME: format_summary 1094 * DESC: this is invoked when a [Summary] special metadata is processed. 1095 * RETURNS: a query-biased summary for the document */ 1096 1097 text_t format_summary (const text_t& collection, recptproto* collectproto, 1098 ResultDocInfo_t &docinfo, displayclass &disp, 1099 const text_t &text, bool highlight, 1100 ostream& logout) { 1101 text_t textToSummarise, query; 1102 if(text.empty()) { // get document text 1103 DocumentRequest_t docrequest; 1104 DocumentResponse_t docresponse; 1105 comerror_t err; 1106 docrequest.OID = docinfo.OID; 1107 collectproto->get_document (collection, docrequest, docresponse, err, logout); 1108 textToSummarise = docresponse.doc; 1109 } else // in practice, this would not happen, because text is only 1110 // loaded with the [Text] command 1111 textToSummarise = text; 1112 disp.expandstring("_cgiargq_",query); 1113 return summarise(textToSummarise,query,80); 1114 } -
trunk/gsdl/src/recpt/formattools.h
r2706 r2967 34 34 35 35 enum command_t {comIf, comOr, comMeta, comText, comLink, comEndLink, comNum, comIcon, 36 comDoc, comHighlight, comEndHighlight, comRel, comHref };36 comDoc, comHighlight, comEndHighlight, comRel, comHref, comSummary}; 37 37 enum pcommand_t {pNone, pImmediate, pTop, pAll}; 38 38 enum dcommand_t {dMeta, dText}; -
trunk/gsdl/src/recpt/win32.mak
r2501 r2967 79 79 datelistbrowserclass.h invbrowserclass.h pagedbrowserclass.h \ 80 80 htmlbrowserclass.h historydb.h phindbrowserclass.h collectoraction.h \ 81 nullproto.h argdb.h browseaction.h browseactiontools.h phindaction.h 81 nullproto.h argdb.h browseaction.h browseactiontools.h phindaction.h \ 82 summarise.h 82 83 83 84 CGIHEADERS = cgiwrapper.h … … 95 96 invbrowserclass.cpp pagedbrowserclass.cpp htmlbrowserclass.cpp \ 96 97 historydb.cpp phindbrowserclass.cpp collectoraction.cpp nullproto.cpp \ 97 argdb.cpp browseaction.cpp browseactiontools.cpp phindaction.cpp 98 argdb.cpp browseaction.cpp browseactiontools.cpp phindaction.cpp \ 99 summarise.cpp 98 100 99 101 CGISOURCES = librarymain.cpp cgiwrapper.cpp … … 111 113 invbrowserclass.obj pagedbrowserclass.obj htmlbrowserclass.obj \ 112 114 historydb.obj phindbrowserclass.obj collectoraction.obj nullproto.obj \ 113 argdb.obj browseaction.obj browseactiontools.obj phindaction.obj 115 argdb.obj browseaction.obj browseactiontools.obj phindaction.obj \ 116 summarise.obj 114 117 115 118 CGIOBJECTS = librarymain.obj cgiwrapper.obj
Note:
See TracChangeset
for help on using the changeset viewer.