Revision 1951
Added by Matt Jones over 20 years ago
MetaCatServlet.java | ||
---|---|---|
66 | 66 |
import javax.servlet.ServletOutputStream; |
67 | 67 |
|
68 | 68 |
import org.ecoinformatics.eml.EMLParser; |
69 |
import edu.ucsb.nceas.utilities.Options; |
|
69 | 70 |
|
70 | 71 |
import org.xml.sax.SAXException; |
71 | 72 |
|
... | ... | |
127 | 128 |
public static final String SCHEMALOCATIONKEYWORD = ":schemaLocation"; |
128 | 129 |
public static final String NONAMESPACELOCATION = ":noNamespaceSchemaLocation"; |
129 | 130 |
public static final String EML2KEYWORD =":eml"; |
131 |
private static final String CONFIG_DIR = "WEB-INF"; |
|
132 |
private static final String CONFIG_NAME = "metacat.properties"; |
|
130 | 133 |
|
131 | 134 |
/** |
132 | 135 |
* Initialize the servlet by creating appropriate database connections |
... | ... | |
138 | 141 |
this.context = config.getServletContext(); |
139 | 142 |
System.out.println("MetaCatServlet Initialize"); |
140 | 143 |
|
144 |
// Initialize the properties file for our options |
|
145 |
String dirPath = context.getRealPath(CONFIG_DIR); |
|
146 |
File propertyFile = new File(dirPath,CONFIG_NAME); |
|
147 |
Options options = null; |
|
148 |
try { |
|
149 |
options = Options.initialize(propertyFile); |
|
150 |
MetaCatUtil.debugMessage("Options configured: " + |
|
151 |
options.getOption("configured"), 20); |
|
152 |
} catch (IOException ioe) { |
|
153 |
MetaCatUtil.debugMessage("Error in loading options: " |
|
154 |
+ioe.getMessage(), 20); |
|
155 |
} |
|
156 |
|
|
141 | 157 |
util = new MetaCatUtil(); |
142 | 158 |
|
143 | 159 |
//initial DBConnection pool |
Also available in: Unified diff
Moved the metacat.properties file from the jar file to now be located in
the tomcat context directory in WEB-INF. Now the metacat configuration is
editable in place. This change depends on a new Options.java class in the
utilities module, so be sure you do a "clean" build in metacat so that you
pick up this new class. This satisfies needs for bug 1230.