Ignore:
Timestamp:
2010-05-06T12:58:19+12:00 (14 years ago)
Author:
davidb
Message:

Updating of code to support sql-query filter

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/runtime-src/src/colservr/collectserver.cpp

    r21324 r22050  
    5252  else {
    5353    cerr << "Error: buildtype '" << buildtype << "' is not a recognized indexer for Greenstone." << endl;
     54  }
     55
     56}
     57
     58
     59void check_if_valid_infodbtype(const text_t& infodbtype)
     60{
     61  if (infodbtype=="gdbm") {
     62#ifndef USE_GDBM
     63    cerr << "Warning: Greenstone installation has not been compiled to support infodbtype 'gdbm'." << endl;
     64#endif
     65  }
     66  else if (infodbtype=="gdbm-txtgz") {
     67#ifndef USE_GDBM
     68    cerr << "Warning: Greenstone installation has not been compiled to support infodbtype 'gdbm-txtgz'." << endl;
     69#endif
     70  }
     71  else if (infodbtype=="jdbm") {
     72#ifndef USE_JDBM
     73    cerr << "Warning: Greenstone installation has not been compiled to support infodbtype 'jdbm'." << endl;
     74#endif
     75  }
     76  else if (infodbtype=="sqlite") {
     77#ifndef USE_SQLITE
     78    cerr << "Warning: Greenstone installation has not been compiled to support infodbtype 'sqlite'." << endl;
     79#endif
     80  }
     81  else if (infodbtype=="mssql") {
     82#ifndef USE_MSSQL
     83    cerr << "Warning: Greenstone installation has not been compiled to support infodbtype 'mssql'." << endl;
     84#endif
     85  }
     86
     87  else {
     88    cerr << "Error: infodbtype '" << infodbtype << "' is not a recognized database type for Greenstone." << endl;
    5489  }
    5590
     
    242277      //collectinfo.searchTypes = cfgline;
    243278    }
     279    else if (key == "infodbtype") {
     280      check_if_valid_infodbtype(value); // prints warning if value (database type) is invalid
     281      collectinfo.infodbType = value;
     282    }
    244283    else if (key == "separate_cjk") {
    245284      if (value == "true") collectinfo.isSegmented = true;
Note: See TracChangeset for help on using the changeset viewer.