Sam Adams avatar Sam Adams committed 405052d

Updated config loading

Comments (0)

Files changed (2)

src/main/java/uk/ac/cam/ch/wwmm/quixote/QuixoteChempoundServletConfig.java

 import org.restlet.Component;
 import org.restlet.Context;
 import org.restlet.data.Protocol;
-import uk.ac.cam.ch.wwmm.chempound.ChempoundConfiguration;
+import uk.ac.cam.ch.wwmm.chempound.config.ChempoundConfiguration;
 import uk.ac.cam.ch.wwmm.chempound.DefaultChempoundModule;
 import uk.ac.cam.ch.wwmm.chempound.comp.CompChemModule;
 import uk.ac.cam.ch.wwmm.chempound.crystal.CrystallographyModule;
         return new AbstractModule() {
             @Override
             protected void configure() {
-                File workspaceDir = new File(workspace);
-                URI uri = URI.create(baseUri);
-                ChempoundConfiguration config = new ChempoundConfiguration(uri, workspaceDir);
-                bind(ChempoundConfiguration.class).toInstance(config);
+                try {
+                    File workspaceDir = new File(workspace);
+                    URI uri = URI.create(baseUri);
+                    ChempoundConfiguration config = ChempoundConfiguration.load(uri, workspaceDir);
 
-                try {
+                    bind(ChempoundConfiguration.class).toInstance(config);
+
                     TripleStore dataStore = createDataStore(config);
                     ResourceStore resourceStore = createResourceStore(config);
                     bind(TripleStore.class).toInstance(dataStore);

src/main/resources/log4j.properties

+
+log4j.rootLogger = WARN, A
+
+log4j.appender.A = org.apache.log4j.ConsoleAppender
+log4j.appender.A.layout = org.apache.log4j.PatternLayout
+log4j.appender.A.layout.ConversionPattern = %-4r [%t] %-5p %c %x - %m%n
+log4j.appender.A.target = System.err
+
+log4j.logger.uk.ac.cam.ch.wwmm.chempound = DEBUG
+
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.