Changeset 1620
- Timestamp:
- 11/17/11 23:05:42 (13 years ago)
- Location:
- SMC/trunk/SMC/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
SMC/trunk/SMC/src/eu/clarin/cmdi/smc/SMC.java
r1610 r1620 9 9 import java.util.List; 10 10 import java.util.Map; 11 import java.util.Properties; 12 //import org.apache.commons.configuration.Configuration; 13 //import org.apache.commons.lang.exception.NestableException; 14 //import org.apache.commons.configuration.ConfigurationException; 15 //import org.apache.commons.configuration.PropertiesConfiguration; 16 // 17 18 11 19 12 20 import javax.xml.transform.TransformerException; … … 26 34 27 35 public SMC () { 28 Utils.loadConfig("smc.properties"); 36 //Utils.loadConfig("smc.properties"); 37 38 this.configure(); 29 39 this.addParam("cache_dir", Utils.getConfig("cache.dir")); 40 //this.addParam("cache_dir", config.getString("cache.dir")); 41 30 42 } 31 43 private Map<String,String[]> params; 32 44 33 45 public static Logger log = Logger.getLogger("SMC"); 46 34 47 35 48 public static void main(String[] args) { … … 45 58 } 46 59 60 public void configure(){ 61 Utils.loadConfig("smc", "smc.properties", this.getClass().getClassLoader()); 62 } 63 public void configure(String configPath) { 64 try { 65 Utils.loadConfig("smc", configPath, this.getClass().getClassLoader()); 66 //config = new PropertiesConfiguration("smc.properties"); 67 } catch (Exception e) { 68 // TODO Auto-generated catch block 69 e.printStackTrace(); 70 } 71 } 47 72 /** 48 73 * load data from registries based on configuration … … 52 77 53 78 InputStream is =null; 54 is = Utils.load2Stream(Utils.getConfig("termsets.config.file")); 79 is = Utils.load2Stream(Utils.getConfig("termsets.config.file"),this.getClass().getClassLoader()); 80 //is = Utils.load2Stream(config.getString("termsets.config.file")); 55 81 56 82 MDTransformer transformer = new MDTransformer(); 83 //transformer.configure(config, this.getClass().getClassLoader()); 57 84 // set URL as srcFile (for MDTransformer to pass to xsl-scripts) 58 85 // TODO: WHY?? … … 70 97 // store the result in the cache 71 98 String output_path = Utils.getConfig("cache.dir") + getParam("data_key") + ".xml" ; 99 //String output_path = config.getString("cache.dir") + getParam("data_key") + ".xml" ; 72 100 File f = Utils.write2File(output_path, resultStream); 73 101 log.debug("result stored in: " + f.getAbsolutePath()); … … 165 193 public InputStream listTermsets(String context) { 166 194 InputStream is =null; 167 is = Utils.load2Stream(Utils.getConfig("termsets.config.file") );195 is = Utils.load2Stream(Utils.getConfig("termsets.config.file").trim(), this.getClass().getClassLoader()); 168 196 return is; 169 197 } -
SMC/trunk/SMC/src/smc.properties
r1607 r1620 1 termsets.config.file = smc_config.xml 2 cache.dir = C:/Users/m/3lingua/clarin/CMDI/SMC/cache/ 1 termsets.config.file = smc_config.xml 2 #cache.dir = C:/Users/m/3lingua/clarin/CMDI/SMC/cache/ 3 cache.dir = C:/apache-tomcat-6.0.26/webapps/SMC_cache/ 3 4 4 5 scripts.path = scripts/
Note: See TracChangeset
for help on using the changeset viewer.