changeset 915:b45141649eec

Added service to request messung queries.
author Raimund Renkert <raimund.renkert@intevation.de>
date Fri, 08 Apr 2016 19:35:12 +0200
parents 2f6781557bea
children fffa587904a8
files src/main/java/de/intevation/lada/rest/stamm/QueryService.java
diffstat 1 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)