changeset 362:b199946e9654

Fixed LProbe service. Send all visible objects if no parameter is set.
author Raimund Renkert <rrenkert@intevation.de>
date Fri, 06 Sep 2013 12:54:38 +0200
parents c0357bd00666
children e56527c79a46
files src/main/java/de/intevation/lada/rest/LProbeService.java
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/intevation/lada/rest/LProbeService.java	Thu Sep 05 17:36:28 2013 +0200
+++ b/src/main/java/de/intevation/lada/rest/LProbeService.java	Fri Sep 06 12:54:38 2013 +0200
@@ -143,13 +143,17 @@
         try {
             AuthenticationResponse auth =
                 authentication.authorizedGroups(header);
-            QueryBuilder<LProbeInfo> builder =
-                new QueryBuilder<LProbeInfo>(
-                    repository.getEntityManager(),
-                    LProbeInfo.class);
-
             MultivaluedMap<String, String> params = info.getQueryParameters();
             if (params.isEmpty() || !params.containsKey("qid")) {
+                QueryBuilder<LProbeInfo> builder =
+                    new QueryBuilder<LProbeInfo>(
+                        repository.getEntityManager(),
+                        LProbeInfo.class);
+                builder.or("fertig", true);
+                List<String> netzbetreiberIds = auth.getNetzbetreiber();
+                for (String netzbetreiberId: netzbetreiberIds) {
+                    builder.or("netzbetreiberId", netzbetreiberId);
+                }
                 return repository.filter(builder.getQuery());
             }
             String qid = params.getFirst("qid");
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)