Changeset 22948


Ignore:
Timestamp:
09/23/10 15:55:32 (11 years ago)
Author:
ak19
Message:

Dr Bainbridge fixed more bugs tangentially related to the advanced searching combined with fielded searching bug that was previously crashing the library.cgi and server.exe. This time around, there were no crashes but the recent corrections to the combined searching needed to work with SQL queries as well. When testing this last, it was discovered that 1. the SQL form wasn't displaying in preferences even when sqlite was set as the infodbtype in collect.cfg and its format Searchtypes line set to include sqlform next to plain and form. This was fixed by making CGIWrapper remember to instantiate sqlqueryaction and not just queryaction. 2. the RunQuery button would eat commas on submission (previously choosing to turn them into non-descript spaces), this has now been fixed in the query.dm macro.

Location:
main/trunk/greenstone2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/macros/query.dm

    r22876 r22948  
    613613
    614614
    615 // convert commas and spaces to plus
    616 // also convert other illegal characters to %xx codes
     615// convert spaces to plus
     616// also convert other illegal characters (including commas) to %xx codes
     617// This routine used to treat commas like spaces (replacing them with a plus),
     618// but this is no longer good enough for handling sql-queries
    617619function format(string) \{
    618620   var str = "" + string;
     
    622624   for (j = 0; j < str.length; j++) \{
    623625       ch=str.charAt(j);
    624        if (ch == " "|| ch == ",") \{
     626       if (ch == " ") \{
    625627           if (flag == 0) \{     
    626628          out += "+";
     
    629631        continue;
    630632    \}
    631     if (ch == ";" || ch == ":" || ch == "/" || ch == "?" ||
     633    if (ch == "," || ch == ";" || ch == ":" || ch == "/" || ch == "?" ||
    632634            ch == "@" || ch == "&" || ch == "=" || ch == "#" ||
    633635        ch == "%") \{
     
    920922<p>For example:<br>
    921923<i>
    922   element in ('dc.Keywords') AND value='Farming'<br>
    923   element in ('dls.Title') AND value LIKE 'F%'<br>
    924   element in ('dls.Title') AND value<'F%'<br>
     924  element in (\'dc.Keywords\') AND value=\'Farming\'<br>
     925  element in (\'dls.Title\') AND value LIKE \'F%\'<br>
     926  element in (\'dls.Title\') AND value<\'F%\'<br>
    925927</i>
    926928)
  • main/trunk/greenstone2/runtime-src/src/w32server/cgiwrapper.cpp

    r22833 r22948  
    6161#include "pingaction.h"
    6262#include "queryaction.h"
     63#if defined(USE_SQLITE)
     64#include "sqlqueryaction.h"
     65#endif
     66
    6367#include "documentaction.h"
    6468#include "dynamicclassifieraction.h"
     
    346350tipaction *atipaction = NULL;
    347351queryaction *aqueryaction = NULL;
     352#if defined(USE_SQLITE)
     353sqlqueryaction *asqlqueryaction = NULL;
     354#endif
    348355documentaction *adocumentaction = NULL;
    349356dynamicclassifieraction *adynamicclassifieraction = NULL;
     
    584591  }
    585592 
     593#if defined(USE_SQLITE)
     594  if (asqlqueryaction == NULL) {
     595    asqlqueryaction = new sqlqueryaction();
     596    asqlqueryaction->set_receptionist (&recpt);
     597    recpt.add_action (asqlqueryaction);
     598  }
     599#endif
     600
    586601  if (adocumentaction == NULL) {
    587602    adocumentaction = new documentaction();
Note: See TracChangeset for help on using the changeset viewer.