Changeset 10789


Ignore:
Timestamp:
2005-10-28T15:41:33+13:00 (19 years ago)
Author:
kjdon
Message:

added an option 'supercollectionoptions uniform_search_results_formatting' so that search results formatting all comes from the collection you are in rather than the each individual collection

Location:
trunk/gsdl/src
Files:
4 edited

Legend:

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

    r9934 r10789  
    8080      else collectinfo.isBeta = false;
    8181    } else if ((key == "ccscols") || (key == "supercollection")) collectinfo.ccsCols = cfgline;
     82    else if (key == "supercollectionoptions") {
     83      text_tarray::const_iterator begin = cfgline.begin();
     84      text_tarray::const_iterator end = cfgline.end();
     85      while(begin != end) {
     86   
     87    if (*begin == "uniform_search_results_formatting") {
     88      collectinfo.ccsOptions |= CCSUniformSearchResultsFormatting;
     89    }
     90    begin++;
     91      }
     92    }
    8293    else if (key == "builddate") collectinfo.buildDate = value.getint();
    8394    else if (key == "languages") collectinfo.languages = cfgline;
  • trunk/gsdl/src/recpt/comtypes.cpp

    r9930 r10789  
    5656  languages.erase(languages.begin(), languages.end());
    5757  ccsCols.erase(ccsCols.begin(), ccsCols.end());
     58  ccsOptions = 0;
    5859  buildDate=0;
    5960  buildType.clear();
  • trunk/gsdl/src/recpt/comtypes.h

    r9930 r10789  
    7272typedef map<text_t, text_tmap, lttext_t> collectionmeta_map; // maps meta name to langmap
    7373
     74#define CCSUniformSearchResultsFormatting 1
     75
    7476struct ColInfoResponse_t {
    7577  void clear ();
     
    8385  unsigned long buildDate;
    8486  text_tarray ccsCols;    // empty if collection does not use cross-collection searching
     87  int ccsOptions; // uses #defines from above
    8588  text_tarray languages;
    8689  unsigned long numDocs;     // 0 if not known
  • trunk/gsdl/src/recpt/queryaction.cpp

    r10361 r10789  
    11071107
    11081108  map<text_t, int, lttext_t> termfreqs;
     1109 
     1110  // just check the main col for formatting info - use individual format statements, or the main one?
     1111 
     1112  browserclass *bptr = browsers->getbrowser (browsertype);
     1113 
     1114  text_t main_col = args["c"];
     1115  cinfo = recpt->get_collectinfo_ptr (collectproto, main_col, logout);
     1116  if (cinfo == NULL) {
     1117    logout << "ERROR (query_action::search_multiple_collections): get_collectinfo_ptr returned NULL for '"<<main_col<<"'\n";
     1118    return false;
     1119  }
     1120 
     1121  bool use_main_col_format = false;
     1122  if (cinfo->ccsOptions & CCSUniformSearchResultsFormatting) {
     1123    use_main_col_format = true;
     1124  }
     1125 
     1126  request.fields.erase (request.fields.begin(), request.fields.end());
     1127  request.getParents = false;
     1128  bptr->load_metadata_defaults (request.fields);
     1129 
     1130  text_t formatstring;
     1131  format_t *formatlistptr = new format_t();
     1132  if (use_main_col_format) {
     1133    // just get one format for main coll and use it for each subcol
     1134    if (!get_formatstring (classification, browsertype,
     1135               cinfo->format, formatstring)) {
     1136      formatstring = bptr->get_default_formatstring();
     1137    }
     1138   
     1139    parse_formatstring (formatstring, formatlistptr, request.fields, request.getParents);
     1140  }
     1141 
    11091142  while (col_here != col_end) {
    1110 
    1111     request.fields.erase (request.fields.begin(), request.fields.end());
    1112     request.getParents = false;
    11131143
    11141144    collectproto = protos->getrecptproto (*col_here, logout);
     
    11251155      continue;
    11261156    }
     1157
     1158    if (!use_main_col_format) {
     1159      request.fields.erase (request.fields.begin(), request.fields.end());
     1160      request.getParents = false;
     1161      bptr->load_metadata_defaults (request.fields);
     1162     
     1163    //browserclass *bptr = browsers->getbrowser (browsertype);
     1164
     1165    // get the formatstring if there is one
     1166      if (!get_formatstring (classification, browsertype,
     1167                 cinfo->format, formatstring)) {
     1168    formatstring = bptr->get_default_formatstring();
     1169      }
     1170
     1171      formatlistptr = new format_t();
     1172      parse_formatstring (formatstring, formatlistptr, request.fields, request.getParents);
     1173    }
    11271174   
    1128     browserclass *bptr = browsers->getbrowser (browsertype);
    1129 
    1130     // get the formatstring if there is one
    1131     text_t formatstring;
    1132     if (!get_formatstring (classification, browsertype,
    1133                cinfo->format, formatstring))
    1134       formatstring = bptr->get_default_formatstring();
    1135 
    1136     bptr->load_metadata_defaults (request.fields);
    1137 
    1138     format_t *formatlistptr = new format_t();
    1139     parse_formatstring (formatstring, formatlistptr, request.fields, request.getParents);
    1140 
    11411175    colinfo_t thiscolinfo;
    11421176    thiscolinfo.formatlistptr = formatlistptr;
Note: See TracChangeset for help on using the changeset viewer.