Changeset 4738


Ignore:
Timestamp:
2003-06-20T11:04:31+12:00 (21 years ago)
Author:
sjboddie
Message:

The first entry in the "indexes" field of a collect.cfg file will now be
used as the default if no "defaultindex" field is specified. Likewise
for defaultsubcollection and defaultlanguage fields.

Location:
trunk/gsdl/src
Files:
3 edited

Legend:

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

    r2212 r4738  
    7575
    7676  if (!sourceclass::init (logout)) return false;
     77
     78  if (defaultindex.empty()) {
     79    // use first index in map as default if no default is set explicitly
     80    text_tarray fromarray;
     81    indexmap.getfromarray(fromarray);
     82    if (fromarray.size()) {
     83      defaultindex = fromarray[0];
     84    }
     85  }
     86
     87  if (defaultsubcollection.empty()) {
     88    // use first subcollection in map as default if no default is set explicitly
     89    text_tarray fromarray;
     90    subcollectionmap.getfromarray(fromarray);
     91    if (fromarray.size()) {
     92      defaultsubcollection = fromarray[0];
     93    }
     94  }
     95
     96  if (defaultlanguage.empty()) {
     97    // use first language in map as default if no default is set explicitly
     98    text_tarray fromarray;
     99    languagemap.getfromarray(fromarray);
     100    if (fromarray.size()) {
     101      defaultlanguage = fromarray[0];
     102    }
     103  }
    77104 
    78105  // get the collection directory name
  • trunk/gsdl/src/colservr/queryfilter.cpp

    r3096 r4738  
    329329    filterOptions["Language"].validValues = options;
    330330
    331   } else if (key == "defaultlanguage")
     331  } else if (key == "defaultlanguage") {
    332332    languagemap.from2to (cfgline[0], filterOptions["Language"].defaultValue);
     333  }
    333334}
    334335
     
    337338
    338339  if (!filterclass::init(logout)) return false;
     340
     341  if (filterOptions["Index"].defaultValue.empty()) {
     342    // use first index in map as default if no default is set explicitly
     343    text_tarray fromarray;
     344    indexmap.getfromarray(fromarray);
     345    if (fromarray.size()) {
     346      filterOptions["Index"].defaultValue = fromarray[0];
     347    }
     348  }
     349
     350  if (filterOptions["Subcollection"].defaultValue.empty()) {
     351    // use first subcollection in map as default if no default is set explicitly
     352    text_tarray fromarray;
     353    subcollectionmap.getfromarray(fromarray);
     354    if (fromarray.size()) {
     355      filterOptions["Subcollection"].defaultValue = fromarray[0];
     356    }
     357  }
     358
     359  if (filterOptions["Language"].defaultValue.empty()) {
     360    // use first language in map as default if no default is set explicitly
     361    text_tarray fromarray;
     362    languagemap.getfromarray(fromarray);
     363    if (fromarray.size()) {
     364      filterOptions["Language"].defaultValue = fromarray[0];
     365    }
     366  }
    339367
    340368  // get the filename for the database and make sure it exists
  • trunk/gsdl/src/recpt/win32.mak

    r4290 r4738  
    146146         $(LINK) $(OBJECTS) $(LIBS)
    147147
    148 # we want statusaction to always be compiled in case the status of
     148# we want the following to always be compiled in case the status of
    149149# GSDL_LOCAL_LIBRARY has changed
    150150statusaction.obj: FORCE
     151configaction.obj: FORCE
    151152
    152153FORCE:
Note: See TracChangeset for help on using the changeset viewer.