Changeset 4752


Ignore:
Timestamp:
2003-06-23T14:09:43+12:00 (21 years ago)
Author:
kjdon
Message:

changed the level configure stuff a bit

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/mgppqueryfilter.cpp

    r4218 r4752  
    5353
    5454  // --  IndexField, enumerated, used to list available fields
    55   // ZZ used to represent "AllFields"
    5655  filtopt.clear();
    5756  filtopt.name = "IndexField";
    5857  filtopt.type = FilterOption_t::enumeratedt;
    5958  filtopt.repeatable = FilterOption_t::onePerTerm;
    60   filtopt.validValues.push_back("ZZ");
    61   filtopt.defaultValue = "ZZ";
     59  filtopt.defaultValue = "";
    6260  filterOptions["IndexField"] = filtopt;
    6361
     
    8583    text_tarray::const_iterator here = options.begin();
    8684    text_tarray::const_iterator end = options.end();
    87    
     85    bool start = true;
    8886    while (here !=end) {
    89       if (!(*here).empty())
     87      if (!(*here).empty()) {
    9088    filterOptions["IndexField"].validValues.push_back(*here);
     89    if (start) {
     90      filterOptions["IndexField"].defaultValue = *here;
     91      start = false;
     92    }
     93      }
    9194      here++;
    9295    }
     
    9497
    9598  if (key == "levels") {
     99    // if levels has been specified, we remove the default Document from valid values - currently, it is the only one - not yet
     100    //filterOptions["Level"].validValues.erase(0);
    96101    text_tarray::const_iterator here = cfgline.begin();
    97102    text_tarray::const_iterator end = cfgline.end();
    98 
     103   
    99104    while (here != end) {
    100105      if (!(*here).empty()) {
    101     filterOptions["Level"].validValues.push_back(*here);
    102     if ((*here) == "Section") {
     106    if ((*here) == "section" || (*here) == "Section") {
     107      filterOptions["Level"].validValues.push_back("Section");
     108      filterOptions["Level"].defaultValue = "Section";
    103109      text_t sect = "Section";
    104110      ((mgppsearchclass *)mgsearchptr)->set_gdbm_level(sect);
    105     }
    106 
     111    } else if ((*here) == "document" || (*here) == "Document") {
     112      //filterOptions["Level"].validValues.push_back("Document");
     113    } else if ((*here) == "paragraph" || (*here) == "Paragraph") {
     114      filterOptions["Level"].validValues.push_back("Paragraph");
     115    }
    107116      }
    108117      here++;
    109118    }
     119    // just check to make sure that there have been some levels specified
     120    // if (filterOptions["Level"].validValues.empty()) {
     121      // add back in document
     122    // filterOptions["Level"].validValues.push_back("Document");
     123    // }
    110124   
    111125  }
Note: See TracChangeset for help on using the changeset viewer.