Mercurial > lada > lada-server
changeset 813:5155b0b375cd
Added stammdaten queries.
author | Raimund Renkert <raimund.renkert@intevation.de> |
---|---|
date | Thu, 03 Dec 2015 12:01:27 +0100 |
parents | 9ed60af6e61e |
children | 6e5a0edba363 |
files | src/main/java/de/intevation/lada/query/QueryTools.java src/main/java/de/intevation/lada/rest/QueryService.java src/main/resources/stammdatenquery.json |
diffstat | 3 files changed, 58 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- 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}
--- 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()); + } }
--- /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": [ + ] +} +]