Changeset 9000


Ignore:
Timestamp:
2005-02-10T16:41:07+13:00 (19 years ago)
Author:
kjdon
Message:

added indexStem info into configure

Location:
trunk/gsdl3/src/java/org/greenstone/gsdl3/service
Files:
2 edited

Legend:

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

    r8959 r9000  
    5151    extends AbstractDocumentRetrieve {
    5252
    53  
    54     //    protected static final String EXTLINK_PARAM = "ext"; here or in base??
     53     protected static final String INDEX_STEM_ELEM = "indexStem";
     54
     55    //    protected static final String EXTLINK_PARAM = "ext"; here or in base??   
     56    protected String index_stem = null;
     57
    5558    protected GDBMWrapper gdbm_src = null;
    5659
     
    7780        return false;
    7881    }
     82   
     83    // the index stem is either specified in the config file or is  the collection name
     84    Element index_stem_elem = (Element) GSXML.getChildByTagName(info, INDEX_STEM_ELEM);
     85    if (index_stem_elem != null) {
     86        this.index_stem = index_stem_elem.getAttribute(GSXML.NAME_ATT);
     87    }
     88    if (this.index_stem == null || this.index_stem.equals("")) {
     89        System.err.println("AbstractGS2DocumentRetrieve.configure(): indexStem element not found, stem will default to collection name");
     90        this.index_stem = this.cluster_name;
     91    }
     92
    7993
    8094    return super.configure(info, extra_info);
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractGS3DocumentRetrieve.java

    r8959 r9000  
    5050public abstract class AbstractGS3DocumentRetrieve
    5151    extends AbstractDocumentRetrieve {
     52    protected static final String INDEX_STEM_ELEM = "indexStem";
    5253
    5354    protected SQLQuery database = null;
     55    protected String index_stem = null;
    5456
    5557
     
    6870    System.out.println("Configuring AbstractGS3DocumentRetrieve...");
    6971
     72    // the index stem is either specified in the config file or is "index"
     73    Element index_stem_elem = (Element) GSXML.getChildByTagName(info, INDEX_STEM_ELEM);
     74    if (index_stem_elem != null) {
     75        this.index_stem = index_stem_elem.getAttribute(GSXML.NAME_ATT);
     76    }
     77    if (this.index_stem == null || this.index_stem.equals("")) {
     78        System.err.println("GS3MGRetrieve.configure(): indexStem element not found, stem will default to 'index'");
     79        this.index_stem = "index";
     80    }
     81
    7082    // open the database for querying
    7183    // the database name is a combination of site name and collection name
     
    8193        return false;
    8294    }
     95
    8396    if (!database.setDatabase(site_name+"_"+this.cluster_name)) {
    8497        System.err.println("GS3Retrieve Error: Could not open SQL database!");
Note: See TracChangeset for help on using the changeset viewer.