[Lada-commits] [PATCH 1 of 4] Added service to request messung queries

Wald Commits scm-commit at wald.intevation.org
Fri Apr 8 19:36:30 CEST 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1460136912 -7200
# Node ID b45141649eec898404941299d4925f345935dd18
# Parent  2f6781557bea7c145b182cfe8fffed59a662089a
Added service to request messung queries.

diff -r 2f6781557bea -r b45141649eec src/main/java/de/intevation/lada/rest/stamm/QueryService.java
--- a/src/main/java/de/intevation/lada/rest/stamm/QueryService.java	Thu Apr 07 15:56:14 2016 +0200
+++ b/src/main/java/de/intevation/lada/rest/stamm/QueryService.java	Fri Apr 08 19:35:12 2016 +0200
@@ -100,6 +100,31 @@
     }
 
     /**
+     * Request all configured messung queries.
+     */
+    @GET
+    @Path("/messung")
+    @Produces("application/json")
+    public Response getMessung(
+        @Context HttpServletRequest request
+    ) {
+        UserInfo userInfo = authorization.getInfo(request);
+        QueryBuilder<Query> builder = new QueryBuilder<Query>(
+            repository.entityManager("stamm"),
+            Query.class
+        );
+        builder.and("type", "messung");
+        List<Query> queries = repository.filterPlain(builder.getQuery(), "stamm");
+
+        markFavorites(queries, userInfo);
+
+        setFilterValues(queries, 0);
+        setFilterValues(queries, userInfo.getUserId());
+
+        return new Response(true, 200, queries);
+    }
+
+    /**
      * Request all configured messprogramm queries.
      */
     @GET


More information about the Lada-commits mailing list