Changeset 9852


Ignore:
Timestamp:
2005-05-10T16:44:39+12:00 (19 years ago)
Author:
kjdon
Message:

made the [Text] format item work even if you are not in documentaction. options[Text] will not be defined, so we need to query the collection server for the text. so this may be expensive. also, if the text has macros in it, they may not be defined (eg _thisOID_ for image links etc). but is anyone going to use it anyway?

File:
1 edited

Legend:

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

    r9745 r9852  
    4242
    4343static text_t format_summary (const text_t& collection, recptproto* collectproto,
     44                  ResultDocInfo_t &docinfo, displayclass &disp,
     45                  text_tmap &options, ostream& logout);
     46static text_t format_text (const text_t& collection, recptproto* collectproto,
    4447                  ResultDocInfo_t &docinfo, displayclass &disp,
    4548                  text_tmap &options, ostream& logout);
     
    15131516    }
    15141517     case comDoc:
    1515     return options["text"];
     1518    return format_text(collection, collectproto, docinfo, disp, options, logout);
     1519    //return options["text"];
    15161520     case comImage:
    15171521    return expand_metadata(options["DocImage"], collection, collectproto, docinfo, disp, options, logout);
     
    15601564
    15611565
     1566// we have only preloaded the text in DocumentAction. But you may want to get the text in query. so copy what we have done with format_summary and get the text here. probably is quite expensive?
     1567text_t format_text (const text_t& collection, recptproto* collectproto,
     1568               ResultDocInfo_t &docinfo, displayclass &disp,
     1569               text_tmap &options, ostream& logout) {
     1570  if(!options["text"].empty()) {
     1571    return options["text"];
     1572  }
     1573  // else get document text here
     1574  DocumentRequest_t docrequest;
     1575  DocumentResponse_t docresponse;
     1576  comerror_t err;
     1577  docrequest.OID = docinfo.OID;
     1578  collectproto->get_document (collection, docrequest, docresponse, err, logout);
     1579  return docresponse.doc;
     1580
     1581}
     1582 
    15621583/* FUNCTION NAME: format_summary
    15631584 * DESC: this is invoked when a [Summary] special metadata is processed.
Note: See TracChangeset for help on using the changeset viewer.