Changeset 19311


Ignore:
Timestamp:
2009-05-03T09:42:26+12:00 (15 years ago)
Author:
davidb
Message:

Further mods to support metadata-spanwrap

File:
1 edited

Legend:

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

    r19302 r19311  
    910910
    911911      if (metadata_spanwrap) {
    912     fresh_metatext = "<span metaname=\"" + meta.metaname + "\" metapos=\"" + i + "\">" + fresh_metatext + "</span>";
     912    fresh_metatext = "<span class=\"editable-metadata\" metaname=\"" + meta.metaname + "\" metapos=\"" + i + "\">" + fresh_metatext + "</span>";
    913913      }
    914914      formatted_metatext += fresh_metatext;
     
    935935
    936936    if (metadata_spanwrap) {
    937       fresh_metatext = "<span metaname=\"" + meta.metaname + "\" metapos=\"" + position + "\">" + fresh_metatext + "</span>";
     937      fresh_metatext = "<span class=\"editable-metadata\" metaname=\"" + meta.metaname + "\" metapos=\"" + position + "\">" + fresh_metatext + "</span>";
    938938    }
    939939
     
    12561256    if (meta_text == "Text") {
    12571257      outtext = format_text(collection, collectproto, docinfo, disp, options, logout);
    1258     } else {
     1258    }
     1259    else {
    12591260
    12601261      text_tset metadata;
     
    15881589     case comRel: //if [RelatedDocuments] appears in format string, collect relation data
    15891590    return get_related_docs(collection, collectproto, docinfo, logout);
     1591
    15901592     case comSummary:
    1591     return format_summary(collection, collectproto, docinfo, disp, options, logout);
     1593       {
     1594     text_t summary = format_summary(collection, collectproto, docinfo, disp, options, logout);
     1595     if (metadata_spanwrap) {
     1596       summary = "<span class=\"editable-metadata\" metaname=\"Summary\">"+summary+"</span>";
     1597     }
     1598     return summary;
     1599       }
     1600
    15921601     case comMeta:
    15931602    {
     
    15951604       return expand_metadata(metavalue, collection, collectproto, docinfo, disp, options, logout);
    15961605    }
     1606
    15971607     case comDoc:
    1598     return format_text(collection, collectproto, docinfo, disp, options, logout);
    1599     //return options["text"];
     1608       return format_text(collection, collectproto, docinfo, disp, options, logout);
     1609
    16001610     case comImage:
    16011611    return expand_metadata(options["DocImage"], collection, collectproto, docinfo, disp, options, logout);
     
    16611671text_t format_text (const text_t& collection, recptproto* collectproto,
    16621672            ResultDocInfo_t &docinfo, displayclass &disp,
    1663             text_tmap &options, ostream& logout) {
     1673            text_tmap &options, ostream& logout)
     1674{
     1675  text_t text;
     1676
    16641677  if(!options["text"].empty()) {
    1665     return options["text"];
    1666   }
    1667   // else get document text here
    1668   DocumentRequest_t docrequest;
    1669   DocumentResponse_t docresponse;
    1670   comerror_t err;
    1671   docrequest.OID = docinfo.OID;
    1672   collectproto->get_document (collection, docrequest, docresponse, err, logout);
    1673   return docresponse.doc;
    1674 
     1678    text = options["text"];
     1679  }
     1680  else {
     1681    // get document text here
     1682    DocumentRequest_t docrequest;
     1683    DocumentResponse_t docresponse;
     1684    comerror_t err;
     1685    docrequest.OID = docinfo.OID;
     1686    collectproto->get_document (collection, docrequest, docresponse, err, logout);
     1687    text = docresponse.doc;
     1688  }
     1689
     1690  if (metadata_spanwrap) {
     1691    text = "<div class=\"editable-text\" metaname=\"Text\">"+text+"</div>";
     1692  }
     1693
     1694  return text;
    16751695}
    16761696 
     
    17001720     collectproto->get_document (collection, docrequest, docresponse, err, logout);
    17011721     textToSummarise = docresponse.doc;
    1702   } else // in practice, this would not happen, because text is only
    1703          // loaded with the [Text] command
    1704      textToSummarise = options["text"];
     1722  }
     1723  else {
     1724    // in practice, this would not happen, because text is only
     1725    // loaded with the [Text] command
     1726    textToSummarise = options["text"];
     1727  }
     1728
    17051729  disp.expandstring("_cgiargq_",query);
    17061730  return summarise(textToSummarise,query,80);
Note: See TracChangeset for help on using the changeset viewer.