Ignore:
Timestamp:
2005-09-26T17:07:05+12:00 (19 years ago)
Author:
kjdon
Message:

made all index/gdbm db paths use indexstem instead of cluster_name

File:
1 edited

Legend:

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

    r10334 r10651  
    5252    extends AbstractDocumentRetrieve {
    5353
    54      protected static final String INDEX_STEM_ELEM = "indexStem";
    55 
    5654    //    protected static final String EXTLINK_PARAM = "ext"; here or in base??   
    5755    protected String index_stem = null;
     
    8078    System.out.println("Configuring AbstractGS2DocumentRetrieve...");
    8179    //this.config_info = info;
     80   
     81    // the index stem is either specified in the config file or is  the collection name
     82    Element index_stem_elem = (Element) GSXML.getChildByTagName(info, GSXML.INDEX_STEM_ELEM);
     83    if (index_stem_elem != null) {
     84        this.index_stem = index_stem_elem.getAttribute(GSXML.NAME_ATT);
     85    }
     86    if (this.index_stem == null || this.index_stem.equals("")) {
     87        System.err.println("AbstractGS2DocumentRetrieve.configure(): indexStem element not found, stem will default to collection name");
     88        this.index_stem = this.cluster_name;
     89    }
    8290
    8391    // Open GDBM database for querying
    84     String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name);
     92    String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name, this.index_stem);
    8593    if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) {
    8694        System.err.println("AbstractGS2DocumentRetrieve Error: Could not open GDBM database!");
    8795        return false;
    8896    }
    89    
    90     // the index stem is either specified in the config file or is  the collection name
    91     Element index_stem_elem = (Element) GSXML.getChildByTagName(info, INDEX_STEM_ELEM);
    92     if (index_stem_elem != null) {
    93         this.index_stem = index_stem_elem.getAttribute(GSXML.NAME_ATT);
    94     }
    95     if (this.index_stem == null || this.index_stem.equals("")) {
    96         System.err.println("AbstractGS2DocumentRetrieve.configure(): indexStem element not found, stem will default to collection name");
    97         this.index_stem = this.cluster_name;
    98     }
     97
    9998    return true;
    10099    }
Note: See TracChangeset for help on using the changeset viewer.