[Lada-commits] [PATCH 4 of 4] Added stammdaten queries

Wald Commits scm-commit at wald.intevation.org
Thu Dec 3 12:01:47 CET 2015


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1449140487 -3600
# Node ID 5155b0b375cd72295473f8d663f3acfea42bf72e
# Parent  9ed60af6e61e8d4bac9193edc90eceb937b55def
Added stammdaten queries.

diff -r 9ed60af6e61e -r 5155b0b375cd src/main/java/de/intevation/lada/query/QueryTools.java
--- a/src/main/java/de/intevation/lada/query/QueryTools.java	Thu Dec 03 11:59:41 2015 +0100
+++ b/src/main/java/de/intevation/lada/query/QueryTools.java	Thu Dec 03 12:01:27 2015 +0100
@@ -35,6 +35,7 @@
 {
     private static String PROBE_CONFIG = "/probequery.json";
     private static String MESSPROGRAMM_CONFIG = "/messprogrammquery.json";
+    private static String STAMMDATEN_CONFIG = "/stammdatenquery.json";
     /**
      * Read the config file using the system property
      * "de.intevation.lada.sqlconfig".
@@ -79,6 +80,7 @@
                 qConf.setName(query.getString("name"));
                 qConf.setDescription(query.getString("description"));
                 qConf.setSql(query.getString("sql"));
+                qConf.setType(query.getString("type"));
                 JsonArray filters = query.getJsonArray("filters");
                 List<QueryFilter> qFilters = new ArrayList<QueryFilter>();
                 for (int j = 0; j < filters.size(); j++) {
@@ -120,6 +122,10 @@
         return getConfig(MESSPROGRAMM_CONFIG);
     }
 
+    public static List<QueryConfig> getStammdatenConfig() {
+        return getConfig(STAMMDATEN_CONFIG);
+    }
+
     /**
      * Get a query by id.
      * First reads the config file and returns the {@link QueryConfig}
diff -r 9ed60af6e61e -r 5155b0b375cd src/main/java/de/intevation/lada/rest/QueryService.java
--- a/src/main/java/de/intevation/lada/rest/QueryService.java	Thu Dec 03 11:59:41 2015 +0100
+++ b/src/main/java/de/intevation/lada/rest/QueryService.java	Thu Dec 03 12:01:27 2015 +0100
@@ -69,4 +69,14 @@
     public Response getMessprogramm() {
         return new Response(true, 200, QueryTools.getMessprogrammConfig());
     }
+
+    /**
+     * Request all configured stammdaten queries.
+     */
+    @GET
+    @Path("/stammdaten")
+    @Produces("application/json")
+    public Response getStammdaten() {
+        return new Response(true, 200, QueryTools.getStammdatenConfig());
+    }
 }
diff -r 9ed60af6e61e -r 5155b0b375cd src/main/resources/stammdatenquery.json
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/resources/stammdatenquery.json	Thu Dec 03 12:01:27 2015 +0100
@@ -0,0 +1,42 @@
+[
+{   "id": "1",
+    "name": "Orte",
+    "description": "Abfrage der Orte",
+    "sql": "",
+    "type": "ort",
+    "result": [
+    ],
+    "filters": [
+    ]
+}, {
+    "id": "2",
+    "name": "Probenehmer",
+    "description": "Abfrage aller Probenehmer",
+    "sql": "",
+    "type": "probenehmer",
+    "result": [
+    ],
+    "filters": [
+    ]
+}, {
+    "id": "3",
+    "name": "Datensatzerzeuger",
+    "description": "Abfrage aller Datensatzerzeuger",
+    "sql": "",
+    "type": "datensatzerzeuger",
+    "result": [
+    ],
+    "filters": [
+    ]
+}, {
+    "id": "4",
+    "name": "Messprogrammkategorie",
+    "description": "Abfrage der Messprogrammkategorien",
+    "sql": "",
+    "type": "messprogrammkategorie",
+    "result": [
+    ],
+    "filters": [
+    ]
+}
+]


More information about the Lada-commits mailing list