Changeset 10651
- Timestamp:
- 2005-09-26T17:07:05+12:00 (18 years ago)
- Location:
- trunk/gsdl3/src/java/org/greenstone/gsdl3/service
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractGS2DocumentRetrieve.java
r10334 r10651 52 52 extends AbstractDocumentRetrieve { 53 53 54 protected static final String INDEX_STEM_ELEM = "indexStem";55 56 54 // protected static final String EXTLINK_PARAM = "ext"; here or in base?? 57 55 protected String index_stem = null; … … 80 78 System.out.println("Configuring AbstractGS2DocumentRetrieve..."); 81 79 //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 } 82 90 83 91 // 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); 85 93 if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) { 86 94 System.err.println("AbstractGS2DocumentRetrieve Error: Could not open GDBM database!"); 87 95 return false; 88 96 } 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 99 98 return true; 100 99 } -
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/AbstractMGPPSearch.java
r9966 r10651 91 91 private static final int ADVANCED_QUERY = 2; 92 92 93 protected static final String INDEX_STEM_ELEM = "indexStem";94 93 protected static final String FIELD_ATT = "field"; 95 94 private MGPPWrapper mgpp_src=null; … … 135 134 136 135 // the index stem is either specified in the config file or is "index" 137 Element index_stem_elem = (Element) GSXML.getChildByTagName(info, INDEX_STEM_ELEM);136 Element index_stem_elem = (Element) GSXML.getChildByTagName(info, GSXML.INDEX_STEM_ELEM); 138 137 if (index_stem_elem != null) { 139 138 this.index_stem = index_stem_elem.getAttribute(GSXML.NAME_ATT); -
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2Browse.java
r10093 r10651 68 68 69 69 System.err.println("Configuring GS2Browse..."); 70 // the index stem is either specified in the config file or is the collection name 71 Element index_stem_elem = (Element) GSXML.getChildByTagName(info, GSXML.INDEX_STEM_ELEM); 72 String index_stem = null; 73 if (index_stem_elem != null) { 74 index_stem = index_stem_elem.getAttribute(GSXML.NAME_ATT); 75 } 76 if (index_stem == null || index_stem.equals("")) { 77 index_stem = this.cluster_name; 78 } 79 70 80 // Open GDBM database for querying 71 String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name );81 String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name, index_stem); 72 82 if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) { 73 83 System.err.println("GS2Browse Error: Could not open GDBM database!"); -
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGPPRetrieve.java
r10093 r10651 78 78 // The location of the MGPP text files 79 79 mgpp_textdir = GSFile.collectionBaseDir(this.site_home, this.cluster_name) + 80 File.separatorChar + GSFile.collectionTextPath(this. cluster_name);80 File.separatorChar + GSFile.collectionTextPath(this.index_stem); 81 81 82 82 // Do generic configuration -
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGPPSearch.java
r10093 r10651 37 37 { 38 38 protected GDBMWrapper gdbm_src = null; 39 protected String index_stem = null; 39 40 40 41 /** constructor */ … … 57 58 58 59 // Open GDBM database for querying 59 String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name );60 String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name, this.index_stem); 60 61 if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) { 61 62 System.err.println("Error: Could not open GDBM database!"); -
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGRetrieve.java
r10093 r10651 77 77 // The location of the MG index and text files 78 78 mg_basedir = GSFile.collectionBaseDir(this.site_home, this.cluster_name) + File.separatorChar; // Needed by MG 79 mg_textdir = GSFile.collectionTextPath(this. cluster_name);79 mg_textdir = GSFile.collectionTextPath(this.index_stem); 80 80 // index is only needed to start up MG, not used so just use the default index 81 String indexpath = GSFile.collectionIndexPath(this. cluster_name, this.default_index);81 String indexpath = GSFile.collectionIndexPath(this.index_stem, this.default_index); 82 82 this.mg_src.setIndex(indexpath); 83 83 -
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGSearch.java
r10093 r10651 56 56 57 57 // Open GDBM database for querying 58 String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name );58 String gdbm_db_file = GSFile.GDBMDatabaseFile(this.site_home, this.cluster_name, this.index_stem); 59 59 if (!this.gdbm_src.openDatabase(gdbm_db_file, GDBMWrapper.READER)) { 60 60 System.err.println("Error: Could not open GDBM database!");
Note:
See TracChangeset
for help on using the changeset viewer.