Changeset 14945 for greenstone3

Show
Ignore:
Timestamp:
18.01.2008 11:38:39 (12 years ago)
Author:
shaoqun
Message:

add two default value variables so that subclasses can overwrite them

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • greenstone3/trunk/src/java/org/greenstone/gsdl3/service/AbstractSearch.java

    r14183 r14945  
    9393 
    9494    protected String default_index_language = ""; 
    95  
     95    
     96    protected String default_max_docs = "100"; 
     97     
     98    protected String default_hits_per_page = "10"; 
     99  
    96100    public AbstractSearch() 
    97101    { 
     
    285289        param_list.appendChild(param); 
    286290    } 
    287         else if (name.equals(MAXDOCS_PARAM) || name.equals(HITS_PER_PAGE_PARAM)) { 
    288         String default_val = "100"; 
    289         if (name.equals(HITS_PER_PAGE_PARAM)) { 
    290         default_val = "10"; 
    291         } 
    292         param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_INTEGER, default_val, null, null); 
    293         param_list.appendChild(param); 
    294     } else if (name.equals(CASE_PARAM) || name.equals(STEM_PARAM) || name.equals(ACCENT_PARAM)) { 
     291        else if (name.equals(MAXDOCS_PARAM)) { 
     292        param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_INTEGER, this.default_max_docs, null, null); 
     293        param_list.appendChild(param); 
     294    } 
     295    else if(name.equals(HITS_PER_PAGE_PARAM)){ 
     296         param = GSXML.createParameterDescription(this.doc, name, getTextString("param."+name, lang), GSXML.PARAM_TYPE_INTEGER, this.default_hits_per_page, null, null); 
     297        param_list.appendChild(param); 
     298    } 
     299    else if (name.equals(CASE_PARAM) || name.equals(STEM_PARAM) || name.equals(ACCENT_PARAM)) { 
    295300        String[] bool_ops = {"0", "1"}; 
    296301        String[] bool_texts = {getTextString("param.boolean.off", lang),getTextString("param.boolean.on", lang)};