Changeset 10873

Show
Ignore:
Timestamp:
08.11.2005 17:30:57 (14 years ago)
Author:
jrm21
Message:

documentaction modified for new HTML4/CSS stuff (eg stop looking for
icon width macros). Other files modified to tidy up output (put tag
attribute values in quotes, use & instead of &, etc). Not quite
finished yet but it works.

Location:
trunk/gsdl/src/recpt
Files:
6 modified

Legend:

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

    r9923 r10873  
    380380 
    381381   if (!use_pulldown) { 
    382       navigationbar += "<nobr>\n"; 
     382 
     383      navigationbar += "_navtabsearch_"; 
    383384      if (has_search_button) { 
    384385     if (args["a"] == "q") { 
    385         navigationbar += "_icontabsearchgreen_"; 
    386      } else { 
    387         navigationbar += "_imagesearch_"; 
     386        navigationbar += "(selected)"; 
    388387     } 
    389388      } 
    390389   
    391       if (has_search_button || numc == 0) navigationbar += "_imagespacer_"; 
     390      if (has_search_button || numc == 0) navigationbar += "_navbarspacer_"; 
    392391   
    393392      bool first = true; 
    394393      while (dochere != docend) { 
    395394    date_extra = g_EmptyText; 
    396      if (!first) navigationbar += "_imagespacer_"; 
     395     if (!first) navigationbar += "_navbarspacer_"; 
    397396      
    398397     text_t title = (*dochere).metadata["Title"].values[0]; 
     
    402401         date_meta = "Date"; 
    403402       } 
    404        date_extra = "&dm="+date_meta; 
     403       date_extra = "&amp;dm="+date_meta; 
    405404     } 
    406405     bool unknown = false; 
    407406      
    408      // test the _XXXwidth_ macro to see if image macros are 
    409      // defined for this type of classification - if not we'll 
    410      // just display the text 
     407     // test if the _tabtext$FIELD_ macro is defined, which means 
     408     // this is a "known" metadata type and we have a translation for it 
    411409     text_t tmpwidth; 
    412      disp.expandstring ("document", "_" + title + "width_", tmpwidth); 
    413      if (tmpwidth == ("_" + title + "width_")) unknown = true; 
     410     text_t macroname="_tabtext" + title + "_"; 
     411     disp.expandstring ("document", macroname, tmpwidth); 
     412     if (tmpwidth == macroname) // it wasn't expanded 
     413       unknown = true; 
    414414      
    415415     // if we're inside a document all the classification buttons should be enabled 
    416      if (arg_d.empty() && ((*dochere).OID == topparent)) { 
    417         if (unknown) navigationbar += " " + title + " "; 
    418         else navigationbar += "_icontab" + title + "green_"; 
    419      } else { 
    420          
    421         // set the _httpbrowseXXX_ macro for this classification 
    422         if (unknown) navigationbar += " <a href=\"_httpdocument_&cl=" +  
    423                 (*dochere).OID + date_extra+"\">" + title + "</a> "; 
    424         else { 
    425            navigationbar += "_image" + title + "_"; 
    426            disp.setmacro ("httpbrowse" + title, displayclass::defaultpackage, "_httpdocument_&cl=" + (*dochere).OID+date_extra); 
    427         } 
     416     text_t this_tab; 
     417     bool is_top; 
     418 
     419     is_top = ((*dochere).OID == topparent); 
     420 
     421     // set default text fragment 
     422     this_tab = "_navtab_("; 
     423 
     424     if (unknown) { // just give the field name 
     425       if (!is_top) { 
     426         // work out the link for this classifier, as it isn't the 
     427         // current page 
     428         this_tab += "_httpdocument_&amp;cl=" + (*dochere).OID 
     429           + date_extra; 
     430       } 
     431       this_tab += "," + title + ","; 
     432     } else { // use the macro for this field so we get translations 
     433       this_tab += "_httpbrowse" + title; 
     434       this_tab += "_,_tabtext" + title; 
     435       this_tab += "_,_textdescr" + title + "_"; 
    428436     } 
     437 
     438     if (arg_d.empty() && is_top) { 
     439       // don't link to this classifier as it is the current one 
     440       this_tab += ",selected"; 
     441     } else if (!unknown) { 
     442       // set the _httpbrowseXXX_ macro for this classification 
     443       // set the correct url for this link 
     444       disp.setmacro ("httpbrowse" + title, displayclass::defaultpackage, "_httpdocument_&amp;cl=" + (*dochere).OID+date_extra); 
     445     } 
     446 
     447     this_tab += ")"; 
     448 
     449     navigationbar += this_tab; 
     450 
    429451     ++dochere; 
    430452     first = false; 
    431453      } 
    432454 
    433       if (!has_search_button && numc == 1) navigationbar += "_imagespacer_"; 
    434  
    435       navigationbar += "\n</nobr>\n"; 
    436       navigationbar += "<!-- End of Navigation Bar -->\n"; 
     455      if (!has_search_button && numc == 1) navigationbar += "_navbarspacer_"; 
     456 
     457      navigationbar += "\n<!-- End of Navigation Bar -->\n"; 
    437458 
    438459   } else { 
     
    451472        navigationbar += " selected"; 
    452473     } 
    453      navigationbar += ">_texticontabsearchgreen_</option>\n"; 
     474     navigationbar += ">_tabtextsearch_</option>\n"; 
    454475      } 
    455476 
     
    461482         date_meta = "Date"; 
    462483       } 
    463        date_extra = "&dm="+date_meta; 
     484       date_extra = "&amp;dm="+date_meta; 
    464485     } 
    465486 
    466      navigationbar += "<option value=\"_httpdocument_&cl=" + dochere->OID +date_extra+ "\""; 
     487     navigationbar += "<option value=\"_httpdocument_&amp;cl=" + dochere->OID +date_extra+ "\""; 
    467488     if (topparent == dochere->OID) { 
    468489        navigationbar += " selected"; 
     
    505526  // _httppagehome_      overridden home url if html collections have own homepage 
    506527 
    507   // _usability_         a macro for remote usability reporting 
    508528 
    509529  // must have a valid collection server to continue 
     
    549569      text_t httpdocument; 
    550570      disp.expandstring (displayclass::defaultpackage, "_httpdocument_", httpdocument); 
    551       httpdocument += "&f=1"; 
     571      httpdocument += "&amp;f=1"; 
    552572      disp.setmacro ("httpdocument", displayclass::defaultpackage, httpdocument); 
    553573      disp.setmacro ("gsdltop", displayclass::defaultpackage, "documenttop"); 
     
    592612    } 
    593613  } 
    594   text_tmap::iterator usability = cinfo.format.find("Usability"); 
    595   if(usability!=cinfo.format.end()){ 
    596     disp.setmacro("usability",displayclass::defaultpackage,"_imageusab_"); 
    597     disp.setmacro("usabinterface",displayclass::defaultpackage,("_usab"+(*usability).second+"_")); 
    598     disp.setmacro("usabilityscript", displayclass::defaultpackage, "_usabshowscript_"); 
    599   } 
    600614} 
    601615 
     
    612626  if (get_info (inlink, args["c"], args["l"], metadata, false, collectproto, response, logout)) { 
    613627    if (!response.docInfo[0].metadata["section"].values[0].empty()) { 
    614       outlink = "_httpdocument_&d=" + response.docInfo[0].metadata["section"].values[0]; 
     628      outlink = "_httpdocument_&amp;d=" + response.docInfo[0].metadata["section"].values[0]; 
    615629      return true; 
    616630    } 
     
    635649      if (get_info (inlink, *col_here, args["l"], metadata, false, collectproto, response, logout)) { 
    636650    if (!response.docInfo[0].metadata["section"].values[0].empty()) { 
    637       outlink = "_httpdocument_&c=" + *col_here + "&d=" + 
     651      outlink = "_httpdocument_&amp;c=" + *col_here + "&amp;d=" + 
    638652        response.docInfo[0].metadata["section"].values[0]; 
    639653      return true; 
     
    869883    bool unknown = false; 
    870884 
    871     // test the _XXXwidth_ macro to see if image macros are 
     885    // test the _iconXXXpage_ macro to see if image macros are 
    872886    // defined for this type of classification - if not we'll 
    873887    // just display the text 
    874888    text_t tmp; 
    875     disp.expandstring ("document", "_" + title + "width_", tmp); 
    876     if (tmp == ("_" + title + "width_")) unknown = true; 
     889    text_t macroname="_icon" + title + "page_"; 
     890    disp.expandstring ("document", macroname, tmp); 
     891    if (tmp == macroname) unknown = true; // it wasn't expanded 
    877892 
    878893    if (unknown) { 
     
    12781293  // work out values for next link 
    12791294  if (haschildren) { 
    1280     disp.setmacro ("httpnextarrow", "document", "_httpdocument_&cl=" + args["cl"] + 
    1281            "&d=" + arg_d + ".fc"); 
     1295    disp.setmacro ("httpnextarrow", "document", "_httpdocument_&amp;cl=" + args["cl"] + 
     1296           "&amp;d=" + arg_d + ".fc"); 
    12821297  } else { 
    12831298    text_tarray::const_iterator h = next_siblings.begin(); 
     
    12851300    while (h != e) { 
    12861301      if (!(*h).empty()) { 
    1287     disp.setmacro ("httpnextarrow", "document", "_httpdocument_&cl=" + args["cl"] + 
    1288                "&d=" + *h); 
     1302    disp.setmacro ("httpnextarrow", "document", "_httpdocument_&amp;cl=" + args["cl"] + 
     1303               "&amp;d=" + *h); 
    12891304    break; 
    12901305      } 
     
    12951310  // work out value for previous link 
    12961311  if (!previous_sibling.empty()) { 
    1297     disp.setmacro ("httpprevarrow", "document", "_httpdocument_&cl=" + args["cl"] + 
    1298            "&d=" + previous_sibling); 
     1312    disp.setmacro ("httpprevarrow", "document", "_httpdocument_&amp;cl=" + args["cl"] + 
     1313           "&amp;d=" + previous_sibling); 
    12991314  } else { 
    13001315    if (countchar(arg_d.begin(), arg_d.end(), '.')) { 
    1301       disp.setmacro ("httpprevarrow", "document", "_httpdocument_&cl=" + args["cl"] + 
    1302              "&d=" + get_parent(arg_d)); 
     1316      disp.setmacro ("httpprevarrow", "document", "_httpdocument_&amp;cl=" + args["cl"] + 
     1317             "&amp;d=" + get_parent(arg_d)); 
    13031318    } 
    13041319  } 
  • trunk/gsdl/src/recpt/hlistbrowserclass.cpp

    r9620 r10873  
    133133      link = "<a href=\"_httpdocument_"; 
    134134      if (doctype == "classify")  
    135     link += "&cl=" + (*tsibling).OID + "\">"; 
     135    link += "&amp;cl=" + (*tsibling).OID + "\">"; 
    136136      else { 
    137     link += "&cl=" + arg_cl + "&d=" + (*tsibling).OID;// + "\">"; 
     137    link += "&amp;cl=" + arg_cl + "&amp;d=" + (*tsibling).OID;// + "\">"; 
    138138    // [modification to allow default document detach settings -- kjdon] 
    139139    if (args["xx"]=="1") { 
    140140      // documents should be detached 
    141       link += "&x=1\" target=\\_blank>"; 
     141      link += "&amp;x=1\" target=\\_blank>"; 
    142142    } else { 
    143143      link += "\">"; 
  • trunk/gsdl/src/recpt/pageaction.cpp

    r9931 r10873  
    177177        if (cinfo->isPublic && (cinfo->buildDate > 0)) { 
    178178 
    179           text_t coll_type = "&ct="; 
     179          text_t coll_type = "&amp;ct="; 
    180180          if ((cinfo->buildType == "mgpp") || (cinfo->buildType == "lucene")) { 
    181181 
     
    187187        } 
    188188 
    189         coll_type += "&qto="; 
     189        coll_type += "&amp;qto="; 
    190190 
    191191        // now we also want to check search types to set the qto arg  
     
    210210            type_here = cinfo->searchTypes.begin(); 
    211211            if (*type_here == "form") {  
    212               coll_type += "&qt=1"; // set the default to form 
     212              coll_type += "&amp;qt=1"; // set the default to form 
    213213            } 
    214214          } 
     
    227227          text_t optsite = g_EmptyText; 
    228228          text_t site_name = (*rprotolist_here).p->get_site_name (err); 
    229           if (!site_name.empty()) { optsite = "site="+site_name+"&"; } 
    230            
    231           text_t link = "_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + coll_type; 
    232           link += "&l=" + args["l"] + "&w=" + args["w"]; 
     229          if (!site_name.empty()) { optsite = "site="+site_name+"&amp;"; } 
     230           
     231          text_t link = "_gwcgi_?"+optsite+"a=p&amp;p=about&amp;c=" + *collist_here + coll_type; 
     232          link += "&amp;l=" + args["l"] + "&amp;w=" + args["w"]; 
    233233 
    234234          // We are "dynamically" overriding so to speak the 
     
    271271                 ostream &logout) { 
    272272   
    273   text_t homeextra = "<center><table width=_pagewidth_><tr valign=top>\n"; 
     273  text_t homeextra = "<table class=\"collections\"><tr valign=\"top\">\n"; 
    274274  bool found_valid_col = false; 
    275275  recptprotolistclass::iterator rprotolist_here = protos->begin(); 
     
    293293        if (cinfo->isPublic && (cinfo->buildDate > 0)) { 
    294294 
    295           text_t coll_type = "&ct="; 
     295          text_t coll_type = "&amp;ct="; 
    296296          if ((cinfo->buildType == "mgpp") || (cinfo->buildType == "lucene")) { 
    297297 
     
    303303        } 
    304304 
    305         coll_type += "&qto="; 
     305        coll_type += "&amp;qto="; 
    306306 
    307307        // now we also want to check search types to set the qto arg  
     
    326326            type_here = cinfo->searchTypes.begin(); 
    327327            if (*type_here == "form") {  
    328               coll_type += "&qt=1"; // set the default to form 
     328              coll_type += "&amp;qt=1"; // set the default to form 
    329329            } 
    330330          } 
     
    369369         
    370370        collectionname  
    371           = "<img width=150 border=1 src=\"" + iconurl + "\" alt=\"" + alt + "\">"; 
     371          = "<img width=\"150\" border=\"1\" src=\"" + iconurl + "\" alt=\"" + alt + "\">"; 
    372372          } else { 
    373373        collectionname = alt; 
     
    375375           
    376376          if ((count%configinfo.HomePageCols == 0) && (!first)) 
    377         homeextra += "</tr><tr valign=top>\n"; 
     377        homeextra += "</tr><tr valign=\"top\">\n"; 
    378378           
    379379          comerror_t err; 
    380380          text_t optsite = g_EmptyText; 
    381381          text_t site_name = (*rprotolist_here).p->get_site_name (err); 
    382           if (!site_name.empty()) { optsite = "site="+site_name+"&"; } 
    383  
    384           text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + coll_type; 
    385           link += "&l=" + args["l"] + "&w=" + args["w"] + "\">"; 
     382          if (!site_name.empty()) { optsite = "site="+site_name+"&amp;"; } 
     383 
     384          text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&amp;p=about&amp;c=" + *collist_here + coll_type; 
     385          link += "&amp;l=" + args["l"] + "&amp;w=" + args["w"] + "\">"; 
    386386           
    387387          if (!cinfo->receptionist.empty())  
     
    400400      } 
    401401    } 
    402     homeextra += "</td></tr>\n<tr>\n"; 
     402    homeextra += "</tr>\n<tr>\n"; 
    403403    ++rprotolist_here; 
    404404  } 
     
    407407    homeextra += "<td>No valid (i.e. built and public) collections are available</td>\n"; 
    408408  } 
    409   homeextra += "</tr></table></center>\n"; 
     409  homeextra += "</tr></table>\n"; 
    410410  disp.setmacro ("homeextra", "home", homeextra);  
    411411} 
     
    439439          ++count; 
    440440 
    441           text_t coll_type = "&ct="; 
     441          text_t coll_type = "&amp;ct="; 
    442442 
    443443          if ((cinfo->buildType == "mgpp") || (cinfo->buildType == "lucene")) { 
     
    450450        } 
    451451 
    452         coll_type += "&qto="; 
     452        coll_type += "&amp;qto="; 
    453453 
    454454        // now we also want to check search types to set the qto arg  
     
    474474            type_here = cinfo->searchTypes.begin(); 
    475475            if (*type_here == "form") {  
    476               coll_type += "&qt=1"; // set the default to form 
     476              coll_type += "&amp;qt=1"; // set the default to form 
    477477            } 
    478478          } 
     
    490490          text_t optsite = g_EmptyText; 
    491491          text_t site_name = (*rprotolist_here).p->get_site_name (err); 
    492           if (!site_name.empty()) { optsite = "site="+site_name+"&"; } 
     492          if (!site_name.empty()) { optsite = "site="+site_name+"&amp;"; } 
    493493 
    494494          text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + coll_type+"\">"; 
  • trunk/gsdl/src/recpt/queryaction.cpp

    r10789 r10873  
    13631363    text_t& arg_d = (*thissection).OID; 
    13641364    text_t doc_url = "_httpdocument_"; 
    1365     doc_url += "&c=" + collection; 
    1366     doc_url += "&d=" + arg_d; 
     1365    doc_url += "&amp;c=" + collection; 
     1366    doc_url += "&amp;d=" + arg_d; 
    13671367 
    13681368    // location response (url may contain macros!!) 
     
    13751375    text_t query_url = "_gwcgi_"; 
    13761376    query_url += "?e=" + args["e"]; 
    1377     query_url += "&h=" + args["h"]; 
    1378     query_url += "&q=" + args["q"]; 
    1379     query_url += "&r=" + args["r"]; 
    1380     query_url += "&t=" + args["t"]; 
    1381     query_url += "&hs=" + args["hs"]; 
     1377    query_url += "&amp;h=" + args["h"]; 
     1378    query_url += "&amp;q=" + args["q"]; 
     1379    query_url += "&amp;r=" + args["r"]; 
     1380    query_url += "&amp;t=" + args["t"]; 
     1381    query_url += "&amp;hs=" + args["hs"]; 
    13821382 
    13831383    textout << outconvert << disp << "Location: " << query_url << "\n\n"; 
     
    16001600  } 
    16011601  query += "c="+args["c"]; 
    1602   query += "&h="+args["h"]; 
    1603   query += "&t="+args["t"]; 
    1604   query += "&b="+args["b"]; 
    1605   query += "&j="+args["j"]; 
    1606   query += "&n="+args["n"]; 
    1607   query += "&s="+args["s"]; 
    1608   query += "&k="+args["k"]; 
    1609   query += "&g="+args["g"];  
     1602  query += "&amp;h="+args["h"]; 
     1603  query += "&amp;t="+args["t"]; 
     1604  query += "&amp;b="+args["b"]; 
     1605  query += "&amp;j="+args["j"]; 
     1606  query += "&amp;n="+args["n"]; 
     1607  query += "&amp;s="+args["s"]; 
     1608  query += "&amp;k="+args["k"]; 
     1609  query += "&amp;g="+args["g"];  
    16101610   
    16111611  text_t qstring = args["q"]; 
    16121612  //text_t formattedquery =cgi_safe(qstring); 
    1613   //query += "&q="+formattedquery; 
    1614   query += "&q="+qstring; 
     1613  //query += "&amp;q="+formattedquery; 
     1614  query += "&amp;q="+qstring; 
    16151615  bool display=false; 
    16161616  int hd = args.getintarg("hd"); 
  • trunk/gsdl/src/recpt/statusaction.cpp

    r9931 r10873  
    6161      << "_status:infoheader_(_titlewelcome_)\n" 
    6262      << "_status:welcome_" 
    63       << "<center><table width=_pagewidth_>\n" 
     63      << "<table>\n" 
    6464      << "<th align=left>abbrev.</th><th align=left>collection</th>" 
    6565      << "<th align=left>public?</th><th align=left>running?</th></tr>\n"; 
     
    127127  } 
    128128 
    129   textout << "</table></center>\n"; 
     129  textout << "</table>\n"; 
    130130  textout << outconvert << disp << "_status:infofooter_\n"; 
    131131} 
  • trunk/gsdl/src/recpt/vlistbrowserclass.cpp

    r9620 r10873  
    7474 
    7575  text_t collink = collection; 
    76   if (!collink.empty()) collink = "&c=" + collink; 
     76  if (!collink.empty()) collink = "&amp;c=" + collink; 
    7777 
    7878  get_link_icon (section, args, collink, link, icon); 
     
    124124 
    125125  text_t collink = collection; 
    126   if (!collink.empty()) collink = "&c=" + collink; 
     126  if (!collink.empty()) collink = "&amp;c=" + collink; 
    127127 
    128128  if (colnumber > 0) { 
     
    209209  link = "<a href=\"_httpdocument_" + collink; 
    210210  text_t link_end = "\">"; 
    211   text_t detach_link_end = "&x=1\" target=\\_blank>"; // to detach the link, and x=1 signifies it is a detached page 
     211  text_t detach_link_end = "&amp;x=1\" target=\\_blank>"; // to detach the link, and x=1 signifies it is a detached page 
    212212  icon = "_document:icontext_"; 
    213213 
     
    225225  if (args["a"] == "q") { 
    226226    // query results list 
    227     link += "&cl=search&d=" + section.OID; 
     227    link += "&amp;cl=search&amp;d=" + section.OID; 
    228228     
    229229    if (args["xx"] == "1") { 
     
    243243    link = "<a href=\"_httpquery_\">"; 
    244244      } 
    245       else link += "&cl=" + arg_cl + "\">"; 
     245      else link += "&amp;cl=" + arg_cl + "\">"; 
    246246       
    247247    } else if (haschildren == 1) { 
     
    250250      (section.OID == arg_d)) { 
    251251    icon = "_document:iconopenfolder_"; 
    252     link += "&cl=" + arg_cl + "&d=" + section.OID + ".pr\">"; 
     252    link += "&amp;cl=" + arg_cl + "&amp;d=" + section.OID + ".pr\">"; 
    253253      } else { 
    254254    icon = "_document:iconclosedfolder_"; 
    255     link += "&cl=" + arg_cl + "&d=" + section.OID + "\">"; 
     255    link += "&amp;cl=" + arg_cl + "&amp;d=" + section.OID + "\">"; 
    256256      } 
    257257    } else { 
    258258      if (args["gt"] == "0") { 
    259     link += "&cl=" + arg_cl + "&d=" + section.OID + "\">"; 
     259    link += "&amp;cl=" + arg_cl + "&amp;d=" + section.OID + "\">"; 
    260260      } else { 
    261     link += "&cl=" + arg_cl + "&d=" + section.OID + "#" + section.OID + "\">"; 
     261    link += "&amp;cl=" + arg_cl + "&amp;d=" + section.OID + "#" + section.OID + "\">"; 
    262262      } 
    263263    } 
     
    271271        (section.OID == arg_cl)) { 
    272272      icon = "_document:iconopenbookshelf_"; 
    273       link += "&cl=" + section.OID + ".pr\">"; 
     273      link += "&amp;cl=" + section.OID + ".pr\">"; 
    274274    } else { 
    275275      icon = "_document:iconclosedbookshelf_"; 
    276       link += "&cl=" + section.OID + "\">"; 
     276      link += "&amp;cl=" + section.OID + "\">"; 
    277277    } 
    278278      } else { 
    279279     
    280280    icon = "_document:iconclosedbook_"; 
    281     link += "&cl=" + arg_cl + "&d=" + section.OID; 
     281    link += "&amp;cl=" + arg_cl + "&amp;d=" + section.OID; 
    282282    if (args["xx"] == "1") { 
    283283      link +=  detach_link_end; 
     
    290290      if (doctype == "classify") link = ""; 
    291291      else { 
    292     link += "&cl=" + arg_cl + "&d=" + section.OID; 
     292    link += "&amp;cl=" + arg_cl + "&amp;d=" + section.OID; 
    293293    if (args["xx"] == "1") { 
    294294      link +=  detach_link_end;