- Timestamp:
- 2007-04-01T14:43:38+12:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractSearch.java
r13573 r13998 54 54 55 55 // optional standard params - some of these have to be implemented 56 protected static final String INDEX_SUBCOLLECTION_PARAM = "indexSubcollection"; 57 protected static final String INDEX_LANGUAGE_PARAM = "indexLanguage"; 56 58 protected static final String MAXDOCS_PARAM = "maxDocs"; 57 59 protected static final String HITS_PER_PAGE_PARAM = "hitsPerPage"; 58 60 protected static final String START_PAGE_PARAM = "startPage"; 61 62 protected static final String INDEX_SUBCOLLECTION_ELEM = "indexSubcollection"; 63 protected static final String INDEX_LANGUAGE_ELEM = "indexLanguage"; 64 59 65 60 66 // some other common params that may be used … … 84 90 protected String default_index = ""; 85 91 92 protected String default_index_subcollection = ""; 93 94 protected String default_index_language = ""; 95 86 96 public AbstractSearch() 87 97 { … … 111 121 // first look in buildConfig 112 122 Element format = (Element)GSXML.getChildByTagName(info, GSXML.FORMAT_ELEM); 113 123 114 124 if (format==null) { 115 125 String path = GSPath.appendLink(GSXML.SEARCH_ELEM, GSXML.FORMAT_ELEM); … … 185 195 { 186 196 createParameter(INDEX_PARAM, param_list, lang); 197 createParameter(INDEX_SUBCOLLECTION_PARAM,param_list, lang); 198 createParameter(INDEX_LANGUAGE_PARAM,param_list, lang); 187 199 if (does_chunking) { 188 200 createParameter(MAXDOCS_PARAM, param_list, lang); … … 225 237 param = GSXML.createParameterDescription2(this.doc, INDEX_PARAM, getTextString("param."+INDEX_PARAM, lang), param_type, this.default_index, index_ids, index_names); 226 238 param_list.appendChild(param); 227 } else if (name.equals(MAXDOCS_PARAM) || name.equals(HITS_PER_PAGE_PARAM)) { 239 } 240 else if (name.equals(INDEX_SUBCOLLECTION_PARAM)){ 241 Element index_sub_list = (Element)GSXML.getChildByTagName(this.config_info, INDEX_SUBCOLLECTION_ELEM+GSXML.LIST_MODIFIER); 242 if (index_sub_list == null) return; 243 ArrayList index_sub_ids = new ArrayList(); 244 ArrayList index_sub_names = new ArrayList(); 245 getIndexSubcollectionData(index_sub_ids, index_sub_names, lang); 246 String param_type = GSXML.PARAM_TYPE_ENUM_SINGLE; 247 if (does_multi_index_search) { 248 param_type = GSXML.PARAM_TYPE_ENUM_MULTI; 249 } 250 param = GSXML.createParameterDescription2(this.doc, INDEX_SUBCOLLECTION_PARAM, getTextString("param."+INDEX_SUBCOLLECTION_PARAM, lang), param_type, this.default_index_subcollection, index_sub_ids, index_sub_names); 251 param_list.appendChild(param); 252 } 253 else if(name.equals(INDEX_LANGUAGE_PARAM)){ 254 Element index_lang_list = (Element)GSXML.getChildByTagName(this.config_info, INDEX_LANGUAGE_ELEM+GSXML.LIST_MODIFIER); 255 if (index_lang_list == null) return; 256 ArrayList index_lang_ids = new ArrayList(); 257 ArrayList index_lang_names = new ArrayList(); 258 getIndexLanguageData(index_lang_ids, index_lang_names, lang); 259 String param_type = GSXML.PARAM_TYPE_ENUM_SINGLE; 260 if (does_multi_index_search) { 261 param_type = GSXML.PARAM_TYPE_ENUM_MULTI; 262 } 263 param = GSXML.createParameterDescription2(this.doc, INDEX_LANGUAGE_PARAM, getTextString("param."+INDEX_LANGUAGE_PARAM, lang), param_type, this.default_index_language, index_lang_ids, index_lang_names); 264 param_list.appendChild(param); 265 } 266 else if (name.equals(MAXDOCS_PARAM) || name.equals(HITS_PER_PAGE_PARAM)) { 228 267 String default_val = "100"; 229 268 if (name.equals(HITS_PER_PAGE_PARAM)) { … … 330 369 abstract protected void getIndexData(ArrayList index_ids, ArrayList index_names, String lang); 331 370 371 /** get the details about the indexexSubcollections available 372 * might be implemented by subclass 373 */ 374 protected void getIndexSubcollectionData(ArrayList index_ids, ArrayList index_names, String lang){} 375 376 /** get the details about the indexes available 377 * might be implemented by subclass 378 */ 379 protected void getIndexLanguageData(ArrayList index_ids, ArrayList index_names, String lang){} 380 381 332 382 } 333 383
Note:
See TracChangeset
for help on using the changeset viewer.