Changeset 3167


Ignore:
Timestamp:
2002-06-23T21:18:28+12:00 (20 years ago)
Author:
sjboddie
Message:

* empty log message *

Location:
trunk/protemix/src/recpt
Files:
1 added
4 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/protemix/src/recpt/Makefile.in

    r3166 r3167  
    6767HEADERS = ptmxqueryaction.h
    6868
    69 SOURCES = ptmxmain.cpp ptmxqueryaction.cpp
     69SOURCES = ptmxmain.cpp ptmxqueryaction.cpp browsetools.cpp
    7070
    71 OBJECTS = ptmxmain.o ptmxqueryaction.o
     71OBJECTS = ptmxmain.o ptmxqueryaction.o browsetools.o
    7272
    7373EXEC    = ptmx
     
    9898
    9999PTMX_OBJS = $(OBJECTS) \
    100     $(MAINRECPTDIR)/browsetools.o \
    101100    $(MAINRECPTDIR)/browserclass.o \
    102101    $(MAINRECPTDIR)/vlistbrowserclass.o \
  • trunk/protemix/src/recpt/ptmxmain.cpp

    r3162 r3167  
    6161  receptionist recpt;
    6262  nullproto    nproto;
    63  
    64   text_t gsdlhome, httpdomain, httpprefix;
    65   // get gsdlhome (if we fail the error will be picked up later -- in
    66   // cgiwrapper)
    67   site_cfg_read (gsdlhome, httpdomain, httpprefix);
    68   collectset *cservers = new collectset();
    69   cservers->add_collection ("protemix", &recpt, gsdlhome, gsdlhome);
     63  text_t gsdlhome;
     64
     65  collectset *cservers = new collectset(gsdlhome);
    7066
    7167  // set up the null protocol
     
    121117  recpt.add_browser (&aphindbrowserclass);
    122118
    123   cgiwrapper (recpt, "protemix");
     119  cgiwrapper (recpt, "ptmx");
    124120  delete cservers;
    125121  return 0;
  • trunk/protemix/src/recpt/ptmxqueryaction.cpp

    r3162 r3167  
    6464}
    6565
    66 
    6766bool ptmxqueryaction::search_single_collection (cgiargsclass &args, const text_t &collection,
    6867                        recptprotolistclass *protos, browsermapclass *browsers,
     
    110109  text_t formattedstring = "";
    111110
    112   logout << "here we go...\n";
    113 
    114   if (args["qt"]=="0") { // normal text search
    115     logout << "normal text search ...\n";
    116     formattedstring = args["q"];
    117     format_querystring (formattedstring, args.getintarg("b"));
    118     add_dates(formattedstring, args.getintarg("ds"), args.getintarg("de"),
    119         args.getintarg("dsbc"), args.getintarg("debc"));
     111  if (!args["c1"].empty() && args["c1"] != "Any") {
     112    formattedstring = "[" + args["c1"] + "]:CL";
    120113  }
    121   else if (args["qt"]=="1" ){ // form search
    122 
    123     logout << "form search ...\n";
    124 
    125     if (args["b"]=="1" && args["fqa"]=="1") { // explicit query
    126       formattedstring = args["q"];
    127     }
    128     else { // form search
    129       if (args["b"]=="0") { // regular form
    130     parse_reg_query_form(formattedstring, args);
    131       }
    132       else  { // advanced form
    133     parse_adv_query_form(formattedstring, args);
    134       }
    135       args["q"] = formattedstring;
    136      
    137       // reset the cgiargfqv macro - need to escape any quotes in it
    138       disp.setmacro("cgiargfqv", "query", escape_quotes(args["fqv"]));
    139 
    140       // also reset the _cgiargq_ macro as it has changed now
    141       disp.setmacro("cgiargq", "Global", html_safe(args["q"]));
    142      
    143       // reset the compressed options to include the q arg
    144       text_t compressedoptions = recpt->get_compressed_arg(args, logout);
    145       if (!compressedoptions.empty()) {
    146     disp.setmacro ("compressedoptions", "Global", dm_safe(compressedoptions));
    147     // need a decoded version of compressedoptions for use within forms
    148     // as browsers encode values from forms before sending to server
    149     // (e.g. %25 becomes %2525)
    150     decode_cgi_arg (compressedoptions);
    151     disp.setmacro ("decodedcompressedoptions", "Global", dm_safe(compressedoptions));
    152       }
    153     } // form search
    154   } // args["qt"]=1
    155   else {
    156     logout << "ERROR (query_action::search_single_collection): querytype not defined\n";
    157     return false;
     114  if (!args["c2"].empty() && args["c2"] != "Any") {
     115    if (!formattedstring.empty()) formattedstring += " & ";
     116    formattedstring += "[" + args["c2"] + "]:CA";
     117  }
     118  if (!args["c3"].empty() && args["c3"] != "Any") {
     119    if (!formattedstring.empty()) formattedstring += " & ";
     120    formattedstring += "[" + args["c3"] + "]:CS";
     121  }
     122  if (!args["q"].empty()) {
     123    if (!formattedstring.empty()) formattedstring += " & ";
     124    formattedstring += args["q"];
    158125  }
    159126
    160   if (!formattedstring.empty()) { // do the query
     127  logout << outconvert << "formattedstring: " << formattedstring << "\n";
     128
     129  if (!formattedstring.empty()) {
    161130    // note! formattedstring is in unicode! mg and mgpp must convert!
    162131    set_queryfilter_options (request, formattedstring, args);
     
    171140 
    172141    define_query_macros (args, disp, response);
    173 
    174     // save the query if appropriate
    175     if (!save_search_history(args, response))
    176       logout << "save failed";
    177142  }
    178 
    179   define_history_macros (disp, args, protos, logout);
    180143 
    181144  textout << outconvert << disp << "_query:header_\n"
Note: See TracChangeset for help on using the changeset viewer.