diff --git a/app/controllers/nwbib/Application.java b/app/controllers/nwbib/Application.java index c56dd0d..babd0c6 100644 --- a/app/controllers/nwbib/Application.java +++ b/app/controllers/nwbib/Application.java @@ -943,4 +943,12 @@ private static List starredIds() { return new ArrayList<>(Arrays.asList(currentlyStarred().split(" ")).stream() .filter(s -> !s.trim().isEmpty()).collect(Collectors.toList())); } + + public static Result put(String id, String secret) { + JsonNode inputData = request().body().asJson(); + System.out.println(id + ", will transform: " + inputData); // TODO run flux transformation + boolean willIndex = !secret.trim().isEmpty() && secret.equals(CONFIG.getString("secret")); + System.out.printf("Secret '%s', will index: %b\n", secret, willIndex); + return ok(Json.toJson("TODO: not implemented")); + } } diff --git a/conf/nwbib.conf b/conf/nwbib.conf index 114cd0c..23343b8 100644 --- a/conf/nwbib.conf +++ b/conf/nwbib.conf @@ -4,6 +4,7 @@ item.api="http://lobid.org/items" hbz01.api="http://lobid.org/hbz01" orgs.api="http://lobid.org/organisations" nwbib.filter="inCollection.id:\"http://lobid.org/resources/HT013494180#!\"" +secret="" # Embedded Elasticsearch index for classification data index { diff --git a/conf/nwbib.routes b/conf/nwbib.routes index ee232ad..b445db6 100644 --- a/conf/nwbib.routes +++ b/conf/nwbib.routes @@ -33,4 +33,5 @@ GET /robots.txt controllers.Assets.at(path="/public",file="robots. GET /cgi-bin/wwwalleg/:name.pl controllers.nwbib.Application.showPl(name, db ?= "rnam", index: Int ?= 1, zeilen: Int ?= 1, s1) GET /sw/:rpbId controllers.nwbib.Application.showSw(rpbId) GET /o:id controllers.nwbib.Application.searchSpatial(id, from:Int?=0, size:Int?=25, format?="html") -GET /:id controllers.nwbib.Application.show(id, format ?= "") \ No newline at end of file +GET /:id controllers.nwbib.Application.show(id, format ?= "") +PUT /:id controllers.nwbib.Application.put(id, secret ?= "") \ No newline at end of file