- Timestamp:
- 2003-03-11T16:58:35+13:00 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2Search.java
r3822 r3851 30 30 /** 31 31 * 32 * @author <a href="mailto: [email protected]">Katherine Don</a>32 * @author <a href="mailto:[email protected]">Michael Dewsnip</a> 33 33 * @version $Revision$ 34 34 */ … … 42 42 43 43 // Parameters used 44 protected static final String INDEX_PARAM = "index"; 44 45 protected static final String CASE_PARAM = "case"; 45 46 protected static final String STEM_PARAM = "stem"; … … 58 59 protected static final String FREQ_ATT = "freq"; 59 60 61 // Elements used in the config file that are specific to this class 62 protected static final String DEFAULT_INDEX_ELEM = "defaultIndex"; 63 protected static final String DEFAULT_LEVEL_ELEM = "defaultLevel"; 64 protected static final String INDEX_ELEM = "index"; 65 protected static final String LEVEL_ELEM = "level"; 66 60 67 protected GDBMWrapper gdbm_src_ = null; 61 68 62 69 protected Element config_info_ = null; 70 71 /** the default index */ 72 protected String default_index_ = null; 63 73 64 74 … … 75 85 System.out.println("Configuring GS2Search..."); 76 86 config_info_ = info; 87 88 // Get the default index out of <defaultIndex> (buildConfig.xml) 89 Element def = (Element) GSXML.getChildByTagName(info, DEFAULT_INDEX_ELEM); 90 if (def != null) { 91 default_index_ = def.getAttribute(GSXML.NAME_ATT); 92 } 93 if (default_index_ == null || default_index_.equals("")) { 94 System.err.println("Error: default index not specified!"); 95 return false; 96 } 77 97 78 98 // these entries should reflect the build config file - some services may not be available depending on how the colleciton was built. … … 103 123 104 124 /** creates a new param element and adds it to the param list */ 105 protected void createParameter(String name, Element param_list, boolean display,106 String lang)125 protected void createParameter(String name, Element param_list, 126 boolean display, String lang) 107 127 { 108 128 Element param=null; … … 162 182 * otherwise it creates the description version 163 183 */ 164 protected boolean createTextQueryParamList(Element param_list, boolean display, 165 String lang) 166 { 167 // the order they are specified here is the order they appear on 168 // the query form 169 createParameter(CASE_PARAM, param_list, display, lang); 170 createParameter(STEM_PARAM, param_list, display, lang); 171 createParameter(MATCH_PARAM, param_list, display, lang); 172 createParameter(MAXDOCS_PARAM, param_list, display, lang); 173 createParameter(QUERY_PARAM, param_list, display, lang); 174 return true; 175 } 176 184 protected abstract boolean createTextQueryParamList(Element param_list, 185 boolean display, 186 String lang); 177 187 178 188 /** creates a display element containing all the text strings needed to display … … 182 192 // Create a service display for the basic text query service 183 193 Element display = doc_.createElement(GSXML.DISPLAY_ELEM); 184 display.appendChild(GSXML.createTextElement(doc_, GSXML.DISPLAY_NAME_ELEM, 185 getTextString(service+".name", lang))); 186 display.appendChild(GSXML.createTextElement(doc_, GSXML.DISPLAY_SUBMIT_ELEM, 187 getTextString(service+".submit", lang))); 194 display.appendChild(GSXML.createTextElement(doc_, GSXML.DISPLAY_NAME_ELEM, getTextString(service+".name", lang))); 195 display.appendChild(GSXML.createTextElement(doc_, GSXML.DISPLAY_SUBMIT_ELEM, getTextString(service+".submit", lang))); 188 196 189 197 // now need to add in the params
Note:
See TracChangeset
for help on using the changeset viewer.