- Timestamp:
- 2007-01-11T14:27:38+13:00 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/service/GS2MGRetrieve.java
r13270 r13567 41 41 // Elements used in the config file that are specific to this class 42 42 private static final String DEFAULT_INDEX_ELEM = "defaultIndex"; 43 private static final String INDEX_LIST_ELEM = "indexList"; 44 private static final String INDEX_ELEM = "index"; 43 45 44 46 private MGWrapper mg_src = null; … … 46 48 private String mg_textdir = null; 47 49 private String default_index = null; 50 private boolean has_default_index = false; 48 51 49 52 public GS2MGRetrieve() { … … 72 75 } 73 76 if (this.default_index == null || this.default_index.equals("")) { 74 logger.error("default index not specified!"); 75 return false; 77 logger.error("default index is not specified, the content of a document will not be retrieved"); 78 has_default_index = false; 79 return true; 80 //} 76 81 } 77 82 logger.debug("Default index: " + this.default_index); 78 83 79 84 // The location of the MG index and text files 80 85 mg_basedir = GSFile.collectionBaseDir(this.site_home, this.cluster_name) + File.separatorChar; // Needed by MG … … 83 88 String indexpath = GSFile.collectionIndexPath(this.index_stem, this.default_index); 84 89 this.mg_src.setIndex(indexpath); 85 90 has_default_index = true; 86 91 return true; 87 92 } … … 100 105 Element content_node = this.doc.createElement(GSXML.NODE_CONTENT_ELEM); 101 106 102 String doc_content = this.mg_src.getDocument(this.mg_basedir, 103 this.mg_textdir, doc_num); 104 107 108 String doc_content = null; 109 110 if (has_default_index ){ 111 doc_content = this.mg_src.getDocument(this.mg_basedir, 112 this.mg_textdir, doc_num); 113 } 114 105 115 if (doc_content!=null) { 106 116 // remove any ctrl-c or ctrl-b … … 111 121 } else { 112 122 logger.error("the doc content was null, not getting that section\n"); 113 doc_content = "couldn't retrieve content for this section \n";123 doc_content = "couldn't retrieve content for this section, please check the log file for more detail\n"; 114 124 } 115 125 Text t = this.doc.createTextNode(doc_content);
Note:
See TracChangeset
for help on using the changeset viewer.