Changeset 11964
- Timestamp:
- 2006-06-22T14:37:57+12:00 (18 years ago)
- Location:
- trunk/gsdl/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/src/colservr/collectserver.cpp
r10789 r11964 98 98 else if (key == "numbytes") collectinfo.numBytes = value.getint(); 99 99 else if (key == "collectionmeta") { 100 // genuine collmeta get added as collectionmeta and collection_macros 101 // .collmeta just get added as collection_macros 100 102 text_t params; 101 103 if (cfgline.size() == 3) { … … 138 140 139 141 // add all collectionmeta to macro list 140 if (cfgline.size() == 2) // no params for this macro 141 collectinfo.collection_macros 142 .insert( make_pair(meta_name, make_pair(g_EmptyText,cfgline[1])) ); 142 text_tmap params_map = collectinfo.collection_macros[meta_name]; 143 144 if (cfgline.size() == 2) {// no params for this macro 145 params_map[g_EmptyText] = cfgline[1]; 146 } 143 147 else if (cfgline.size() == 3) {// has params 144 // can we somehow add this is with no params if there is not already 145 // a no params entry?? 146 collectinfo.collection_macros 147 .insert( make_pair(meta_name, make_pair(params,cfgline[2])) ); 148 } 148 params_map[params] = cfgline[2]; 149 if (params_map[g_EmptyText].empty()) { 150 params_map[g_EmptyText] = cfgline[2]; 151 } 152 } 153 collectinfo.collection_macros[meta_name] = params_map; 149 154 } 150 155 else if (key == "collectionmacro") { 151 156 text_t nobrackets; 157 text_tmap params_map = collectinfo.collection_macros[cfgline[0]]; 152 158 // add all to macro list 153 if (cfgline.size() == 2) // no params for this macro154 collectinfo.collection_macros155 .insert( make_pair(cfgline[0], make_pair(g_EmptyText,cfgline[1])) ); 159 if (cfgline.size() == 2) { // no params for this macro 160 params_map[g_EmptyText] = cfgline[1]; 161 } 156 162 else if (cfgline.size() == 3) {// has params 157 163 // strip [ ] brackets from params … … 159 165 text_t::const_iterator last=cfgline[1].end()-1; 160 166 nobrackets=substr(first, last); 161 collectinfo.collection_macros 162 .insert( make_pair(cfgline[0], make_pair(nobrackets,cfgline[2])) ); 163 } 167 params_map[nobrackets] = cfgline[2]; 168 } 169 collectinfo.collection_macros[cfgline[0]] = params_map; 170 164 171 } else if (key == "format" && cfgline.size() == 2) 165 172 collectinfo.format[cfgline[0]] = cfgline[1]; -
trunk/gsdl/src/recpt/comtypes.h
r10789 r11964 67 67 }; 68 68 69 /* macro name -> (params, value) */ 70 typedef multimap<text_t, pair<text_t, text_t>, less<text_t> > macros_map; 71 72 typedef map<text_t, text_tmap, lttext_t> collectionmeta_map; // maps meta name to langmap 69 // for collection metadata: metadata name -> lang -> value 70 // for collection macros: macro name -> params -> value 71 typedef map<text_t, text_tmap, lttext_t> collectionmeta_map; 73 72 74 73 #define CCSUniformSearchResultsFormatting 1 … … 91 90 unsigned long numWords; // 0 if not known 92 91 unsigned long numBytes; // 0 if not known 93 //text_tmap collectionmeta;94 92 collectionmeta_map collectionmeta; 95 93 text_tmap format; 96 macros_map collection_macros; // for collectionmacro config directive (> gsdl 2.53)94 collectionmeta_map collection_macros; // for collectionmacro config directive (> gsdl 2.53) 97 95 text_tmap building; 98 96 text_t httpdomain; // GRB: could these two http items need removing -
trunk/gsdl/src/recpt/receptionist.cpp
r10931 r11964 1519 1519 // as of gsdl 2.53, collect.cfg can specify macros 1520 1520 if (cinfo.collection_macros.size() > 0) { 1521 macros_map::const_iterator this_macro=cinfo.collection_macros.begin();1522 macros_map::const_iterator done_macro=cinfo.collection_macros.end();1521 collectionmeta_map::const_iterator this_macro=cinfo.collection_macros.begin(); 1522 collectionmeta_map::const_iterator done_macro=cinfo.collection_macros.end(); 1523 1523 while (this_macro != done_macro) { 1524 1524 text_t package = "Global"; … … 1537 1537 } 1538 1538 1539 disp.setcollectionmacro(package, 1540 macroname, 1541 this_macro->second.first, // params 1542 this_macro->second.second); // value 1539 text_tmap params_map = this_macro->second; 1540 text_tmap::const_iterator this_param = params_map.begin(); 1541 text_tmap::const_iterator done_param = params_map.end(); 1542 while (this_param != done_param) { 1543 disp.setcollectionmacro(package, 1544 macroname, 1545 this_param->first, 1546 this_param->second); 1547 ++this_param; 1548 } 1549 1543 1550 ++this_macro; 1544 1551 }
Note:
See TracChangeset
for help on using the changeset viewer.