Changeset 11986


Ignore:
Timestamp:
2006-06-30T16:03:47+12:00 (18 years ago)
Author:
kjdon
Message:

collection links on home page no longer need to set ct, qt, qto args as this is done for the pages they are needed

File:
1 edited

Legend:

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

    r11958 r11986  
    3838#include "fileutil.h"
    3939#include "gsdltools.h"
     40#include "querytools.h"
    4041#include <time.h>
    4142
     
    148149                   cgiargsclass &args, const recptconf &configinfo,
    149150                   ostream &logout) {
    150    
    151    //text_t homeextra = "<center><table width=_pagewidth_><tr valign=top>\n";
    152   //bool found_valid_col = false;
    153151
    154152   text_t homeextra = "<form method=\"get\" name=\"browse\">\n";
     
    177175        if (cinfo->isPublic && (cinfo->buildDate > 0)) {
    178176
    179           text_t coll_type = "&amp;ct=";
    180           if ((cinfo->buildType == "mgpp") || (cinfo->buildType == "lucene")) {
    181 
    182         if (cinfo->buildType == "mgpp") {
    183           coll_type += "1";
    184         }
    185         else {
    186           coll_type += "2";
    187         }
    188 
    189         coll_type += "&amp;qto=";
    190 
    191         // now we also want to check search types to set the qto arg
    192         if (cinfo->searchTypes.size() == 0) {
    193           coll_type += "3"; // default to 3 (= both)
    194         } else {
    195           unsigned int search_types = 0;
    196           text_tarray::const_iterator type_here = cinfo->searchTypes.begin();
    197           text_tarray::const_iterator type_end = cinfo->searchTypes.end();
    198          
    199           while (type_here != type_end) {
    200             if (*type_here == "form") {
    201               search_types |= 2;
    202             } else if (*type_here == "plain") {
    203               search_types |= 1;
    204             }
    205             ++type_here;
    206           }
    207           coll_type += search_types;
    208           if (search_types == 3) {
    209             // both were specified, now need to look at the order to see which is the default
    210             type_here = cinfo->searchTypes.begin();
    211             if (*type_here == "form") {
    212               coll_type += "&amp;qt=1"; // set the default to form
    213             }
    214           }
    215  
    216         }
    217           }
    218           else {
    219         coll_type += "0";
    220           }
    221177          text_t collectionname = cinfo->get_collectionmeta("collectionname", args["l"]);
    222178          if (collectionname.empty()) {
     
    229185          if (!site_name.empty()) { optsite = "site="+site_name+"&amp;"; }
    230186         
    231           text_t link = "_gwcgi_?"+optsite+"a=p&amp;p=about&amp;c=" + *collist_here + coll_type;
     187          text_t link = "_gwcgi_?"+optsite+"a=p&amp;p=about&amp;c=" + *collist_here;
    232188          link += "&amp;l=" + args["l"] + "&amp;w=" + args["w"];
    233189
     
    292248      if (cinfo != NULL) {
    293249        if (cinfo->isPublic && (cinfo->buildDate > 0)) {
    294 
    295           text_t coll_type = "&amp;ct=";
    296           if ((cinfo->buildType == "mgpp") || (cinfo->buildType == "lucene")) {
    297 
    298         if (cinfo->buildType == "mgpp") {
    299           coll_type += "1";
    300         }
    301         else {
    302           coll_type += "2";
    303         }
    304 
    305         coll_type += "&amp;qto=";
    306 
    307         // now we also want to check search types to set the qto arg
    308         if (cinfo->searchTypes.size() == 0) {
    309           coll_type += "3"; // default to 3 (= both)
    310         } else {
    311           unsigned int search_types = 0;
    312           text_tarray::const_iterator type_here = cinfo->searchTypes.begin();
    313           text_tarray::const_iterator type_end = cinfo->searchTypes.end();
    314          
    315           while (type_here != type_end) {
    316             if (*type_here == "form") {
    317               search_types |= 2;
    318             } else if (*type_here == "plain") {
    319               search_types |= 1;
    320             }
    321             ++type_here;
    322           }
    323           coll_type += search_types;
    324           if (search_types == 3) {
    325             // both were specified, now need to look at the order to see which is the default
    326             type_here = cinfo->searchTypes.begin();
    327             if (*type_here == "form") {
    328               coll_type += "&amp;qt=1"; // set the default to form
    329             }
    330           }
    331  
    332         }
    333           }
    334           else {
    335         coll_type += "0";
    336           }
    337250
    338251          found_valid_col = true;
     
    382295          if (!site_name.empty()) { optsite = "site="+site_name+"&amp;"; }
    383296
    384           text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&amp;p=about&amp;c=" + *collist_here + coll_type;
     297          text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&amp;p=about&amp;c=" + *collist_here;
    385298          link += "&amp;l=" + args["l"] + "&amp;w=" + args["w"] + "\">";
    386299         
     
    439352          ++count;
    440353
    441           text_t coll_type = "&amp;ct=";
    442 
    443           if ((cinfo->buildType == "mgpp") || (cinfo->buildType == "lucene")) {
    444 
    445         if (cinfo->buildType == "mgpp") {
    446           coll_type += "1";
    447         }
    448         else {
    449           coll_type += "2";
    450         }
    451 
    452         coll_type += "&amp;qto=";
    453 
    454         // now we also want to check search types to set the qto arg
    455         if (cinfo->searchTypes.size() == 0) {
    456           coll_type += "3"; // default to 2 (= both)
    457         } else {
    458           int search_types = 0;
    459           text_tarray::const_iterator type_here = cinfo->searchTypes.begin();
    460           text_tarray::const_iterator type_end = cinfo->searchTypes.end();
    461          
    462           while (type_here != type_end) {
    463             if (*type_here == "form") {
    464               search_types |= 0x10;
    465             } else if (*type_here == "plain") {
    466               search_types |= 0x01;
    467             }
    468             ++type_here;
    469           }
    470           coll_type += search_types;
    471  
    472           if (search_types == 3) {
    473             // both were specified, now need to look at the order to see which is the default
    474             type_here = cinfo->searchTypes.begin();
    475             if (*type_here == "form") {
    476               coll_type += "&amp;qt=1"; // set the default to form
    477             }
    478           }
    479         }
    480           }
    481           else {
    482         coll_type += "0";
    483           }
    484354          text_t collectionname = cinfo->get_collectionmeta("collectionname", args["l"]);
    485355          if (collectionname.empty()) {
     
    492362          if (!site_name.empty()) { optsite = "site="+site_name+"&amp;"; }
    493363
    494           text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + coll_type+"\">";
     364          text_t link = "<a href=\"_gwcgi_?"+optsite+"a=p&p=about&c=" + *collist_here + "\">";
    495365
    496366          if (!cinfo->receptionist.empty())
     
    663533}
    664534
     535
    665536void pageaction::define_internal_macros (displayclass &disp, cgiargsclass &args,
    666537                     recptprotolistclass *protos, ostream &logout) {
     
    762633    }
    763634    disp.setmacro("numbytes", displayclass::defaultpackage, numbytes);
    764   }
    765 
     635
     636    // set up ct, qt, qto
     637    set_query_type_args(cinfo, args);
     638
     639  }
     640 
    766641  //setting _queryformcontent_ so that the query interface is consistent.
    767642  //also adding usability button if necessary
     
    998873      if (err != noError) issearchable = true;
    999874      outconvertclass t;
    1000       if (!issearchable) {
     875      if (!issearchable ) {
    1001876    disp.setmacro ("aboutqueryform", "about", "");
    1002877      }
Note: See TracChangeset for help on using the changeset viewer.