Changeset 3167
- Timestamp:
- 2002-06-23T21:18:28+12:00 (21 years ago)
- Location:
- trunk/protemix/src/recpt
- Files:
-
- 1 added
- 4 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/protemix/src/recpt/Makefile.in
r3166 r3167 67 67 HEADERS = ptmxqueryaction.h 68 68 69 SOURCES = ptmxmain.cpp ptmxqueryaction.cpp 69 SOURCES = ptmxmain.cpp ptmxqueryaction.cpp browsetools.cpp 70 70 71 OBJECTS = ptmxmain.o ptmxqueryaction.o 71 OBJECTS = ptmxmain.o ptmxqueryaction.o browsetools.o 72 72 73 73 EXEC = ptmx … … 98 98 99 99 PTMX_OBJS = $(OBJECTS) \ 100 $(MAINRECPTDIR)/browsetools.o \101 100 $(MAINRECPTDIR)/browserclass.o \ 102 101 $(MAINRECPTDIR)/vlistbrowserclass.o \ -
trunk/protemix/src/recpt/ptmxmain.cpp
r3162 r3167 61 61 receptionist recpt; 62 62 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); 70 66 71 67 // set up the null protocol … … 121 117 recpt.add_browser (&aphindbrowserclass); 122 118 123 cgiwrapper (recpt, "p rotemix");119 cgiwrapper (recpt, "ptmx"); 124 120 delete cservers; 125 121 return 0; -
trunk/protemix/src/recpt/ptmxqueryaction.cpp
r3162 r3167 64 64 } 65 65 66 67 66 bool ptmxqueryaction::search_single_collection (cgiargsclass &args, const text_t &collection, 68 67 recptprotolistclass *protos, browsermapclass *browsers, … … 110 109 text_t formattedstring = ""; 111 110 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"; 120 113 } 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"]; 158 125 } 159 126 160 if (!formattedstring.empty()) { // do the query 127 logout << outconvert << "formattedstring: " << formattedstring << "\n"; 128 129 if (!formattedstring.empty()) { 161 130 // note! formattedstring is in unicode! mg and mgpp must convert! 162 131 set_queryfilter_options (request, formattedstring, args); … … 171 140 172 141 define_query_macros (args, disp, response); 173 174 // save the query if appropriate175 if (!save_search_history(args, response))176 logout << "save failed";177 142 } 178 179 define_history_macros (disp, args, protos, logout);180 143 181 144 textout << outconvert << disp << "_query:header_\n"
Note:
See TracChangeset
for help on using the changeset viewer.