Permalink
Browse files

Ability to seed jetty with json config for whelks.

  • Loading branch information...
1 parent 96ddb6b commit 013345cf4519f19828b2167aa5eaac3732ae4ccd @mskold mskold committed Oct 11, 2012
@@ -20,6 +20,7 @@ sourceSets {
jettyRun.contextPath = '/'
+jettyRun.description = "Starts a jetty instance. To use a specific json-file to configure whelks, use -Dargs=whelk.config.uri=<URI of json file> (example: -Dargs=whelk.config.uri='file:src/main/resources/whelks.json')"
run {
@@ -18,8 +18,8 @@ import se.kb.libris.whelks.plugin.external.*
@Log
class RestManager extends Application {
- final String WHELKCONFIGFILE = "/tmp/whelkconfig.json"
- //WhelkManager manager
+ final String WHELKCONFIGFILE = "file:src/main/resource/barebones-whelks.json"
+
def whelks = []
RestManager(Context parentContext) {
@@ -29,9 +29,16 @@ class RestManager extends Application {
}
void init() {
- def wi = new WhelkInitializer(this.class.classLoader.getResourceAsStream("whelks.json"))
+ URI whelkconfig = new URI(System.getProperty("whelk.config.uri", WHELKCONFIGFILE))
+ log.info("Initializing whelks using definitions in $whelkconfig")
+ System.properties.each {k, v ->
+ println "Property: $k = $v"
+ }
+ println "URI scheme: " + whelkconfig.getScheme()
+ //def wi = new WhelkInitializer(this.class.classLoader.getResourceAsStream("whelks.json"))
+ def wi = new WhelkInitializer(whelkconfig.toURL().newInputStream())
whelks = wi.getWhelks()
- println "These whelks are available: $whelks"
+
/*
def bibwhelk = new WhelkImpl("bib")
def authwhelk = new WhelkImpl("auth")
@@ -8,18 +8,19 @@
</appender>
+ <!--
<logger name="se.kb.libris.whelks.component.ElasticSearch">
<level value="debug"/>
</logger>
- <!--
<logger name="se.kb.libris.whelks.basic.BasicDocument">
<level value="trace"/>
</logger>
- -->
+
<logger name="se.kb.libris.whelks.plugin">
<level value="debug"/>
</logger>
+ -->
<root level="info">
<appender-ref ref="STDOUT" />
@@ -14,7 +14,7 @@
},
{
"suggest":{
- "_plugins": [ "index", "search", "autocomplete", "suggestformatconverter",
+ "_plugins": [ "index", "document", "search", "autocomplete", "suggestformatconverter",
"biblistener" ]
}
}

0 comments on commit 013345c

Please sign in to comment.