annotate src/main/java/de/intevation/lada/rest/QueryService.java @ 269:5143a9604fb9

Fixed variable names.
author Torsten Irländer <torsten.irlaender@intevation.de>
date Wed, 24 Jul 2013 15:04:45 +0200
parents 58e1ed2ddbbd
children 93b12b077edf
rev   line source
265
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
1 package de.intevation.lada.rest;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
2
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
3 import java.util.ArrayList;
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
4 import java.util.List;
265
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
5
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
6 import javax.enterprise.context.RequestScoped;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
7 import javax.inject.Inject;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
8 import javax.inject.Named;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
9 import javax.ws.rs.GET;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
10 import javax.ws.rs.Path;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
11 import javax.ws.rs.Produces;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
12 import javax.ws.rs.core.Context;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
13 import javax.ws.rs.core.HttpHeaders;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
14 import javax.ws.rs.core.UriInfo;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
15
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
16 import de.intevation.lada.auth.Authentication;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
17 import de.intevation.lada.auth.AuthenticationException;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
18 import de.intevation.lada.model.LOrt;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
19
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
20 class ResultConfig {
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
21 String dataIndex;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
22 String header;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
23 Integer flex;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
24 Integer width;
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
25
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
26 public ResultConfig(String dataIndex, String header, Integer flex, Integer width) {
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
27 this.dataIndex= dataIndex;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
28 this.header= header;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
29 this.flex = flex;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
30 this.width = width;
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
31 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
32
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
33 public ResultConfig(String dataIndex, String header, Integer flex) {
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
34 this.dataIndex= dataIndex;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
35 this.header= header;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
36 this.flex = flex;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
37 this.width = null;
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
38 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
39
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
40 public ResultConfig(String dataIndex, String header) {
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
41 this.dataIndex= dataIndex;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
42 this.header= header;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
43 this.flex = 0;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
44 this.width = null;
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
45 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
46
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
47 /**
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
48 * @return the dataIndex
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
49 */
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
50 public String getDataIndex() {
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
51 return dataIndex;
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
52 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
53
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
54 /**
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
55 * @param dataIndex the dataIndex to set
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
56 */
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
57 public void setDataIndex(String dataIndex) {
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
58 this.dataIndex = dataIndex;
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
59 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
60
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
61 /**
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
62 * @return the header
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
63 */
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
64 public String getHeader() {
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
65 return header;
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
66 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
67
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
68 /**
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
69 * @param header the header to set
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
70 */
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
71 public void setHeader(String header) {
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
72 this.header = header;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
73 }
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
74
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
75 /**
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
76 * @return the width
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
77 */
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
78 public Integer getWidth() {
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
79 return width;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
80 }
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
81
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
82 /**
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
83 * @param width the width to set
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
84 */
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
85 public void setWidth(Integer width) {
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
86 this.width = width;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
87 }
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
88
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
89 /**
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
90 * @return the flex
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
91 */
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
92 public Integer getFlex() {
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
93 return flex;
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
94 }
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
95
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
96 /**
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
97 * @param flex the flex to set
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
98 */
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
99 public void setFlex(Integer flex) {
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
100 this.flex = flex;
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
101 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
102 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
103
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
104 class QueryConfig {
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
105 int id;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
106 String name;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
107 String description;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
108 String sql;
269
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
109 List<String> filters;
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
110 List<ResultConfig> results;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
111
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
112 public QueryConfig()
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
113 {
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
114 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
115
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
116 /**
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
117 * @return the id
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
118 */
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
119 public int getId() {
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
120 return id;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
121 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
122
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
123 /**
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
124 * @param id the id to set
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
125 */
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
126 public void setId(int id) {
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
127 this.id = id;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
128 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
129
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
130 /**
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
131 * @return the name
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
132 */
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
133 public String getName() {
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
134 return name;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
135 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
136
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
137 /**
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
138 * @param name the name to set
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
139 */
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
140 public void setName(String name) {
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
141 this.name = name;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
142 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
143
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
144 /**
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
145 * @return the description
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
146 */
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
147 public String getDescription() {
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
148 return description;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
149 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
150
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
151 /**
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
152 * @param description the description to set
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
153 */
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
154 public void setDescription(String description) {
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
155 this.description = description;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
156 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
157
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
158 /**
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
159 * @return the sql
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
160 */
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
161 public String getSql() {
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
162 return sql;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
163 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
164
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
165 /**
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
166 * @param sql the sql to set
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
167 */
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
168 public void setSql(String sql) {
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
169 this.sql = sql;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
170 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
171
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
172 /**
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
173 * @return the filter
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
174 */
269
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
175 public List<String> getFilters() {
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
176 return filters;
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
177 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
178
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
179 /**
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
180 * @param filter the filter to set
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
181 */
269
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
182 public void setFilters(List<String> filters) {
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
183 this.filters = filters;
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
184 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
185
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
186 /**
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
187 * @return the results
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
188 */
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
189 public List<ResultConfig> getResults() {
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
190 return results;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
191 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
192
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
193 /**
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
194 * @param results the results to set
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
195 */
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
196 public void setResults(List<ResultConfig> results) {
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
197 this.results = results;
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
198 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
199 }
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
200
265
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
201 /**
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
202 * This class produces a RESTful service to read, write and update
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
203 * LOrt objects.
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
204 *
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
205 * @author <a href="mailto:torsten.irlaender@intevation.de">Torsten Irländer</a>
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
206 */
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
207 @Path("/query")
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
208 @RequestScoped
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
209 public class QueryService
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
210 {
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
211 /**
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
212 * The authorization module.
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
213 */
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
214 @Inject
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
215 @Named("ldapauth")
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
216 private Authentication authentication;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
217
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
218 /**
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
219 * Request SQL-Queries
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
220 *
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
221 * Query parameters are used for the filter in form of key-value pairs.
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
222 *
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
223 * @param info The URL query parameters.
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
224 * @param headers The HTTP header containing authorization information.
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
225 * @return Response object.
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
226 */
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
227 @GET
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
228 @Produces("text/json")
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
229 public Response filter(
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
230 @Context UriInfo info,
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
231 @Context HttpHeaders headers
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
232 ) {
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
233 try {
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
234 if (!authentication.isAuthorizedUser(headers)) {
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
235 return new Response(false, 699, new ArrayList<LOrt>());
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
236 }
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
237 List<QueryConfig> queries = this.loadQueryConfig();
265
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
238 Response response = new Response(true, 200, queries);
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
239 return response;
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
240 }
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
241 catch(AuthenticationException ae) {
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
242 return new Response(false, 699, new ArrayList<LOrt>());
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
243 }
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
244 }
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
245
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
246 private List<QueryConfig> loadQueryConfig() {
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
247 List<QueryConfig> configs = new ArrayList<QueryConfig>();
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
248
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
249 /* Typicall available fields
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
250 {header: 'Datenbasis', dataIndex: 'datenbasisId', width: 70},
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
251 {header: 'MPL', dataIndex: 'mplId', width: 50},
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
252 {header: 'UWB', dataIndex: 'umwId', width: 50},
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
253 {header: 'MMT', dataIndex: 'messmethode'},
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
254 {header: 'HPNR', dataIndex: 'hauptprobenNr'},
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
255 {header: 'NPNR', dataIndex: 'nebenprobenNr'},
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
256 {header: 'E.Gemeinde', dataIndex: 'bezeichnung', flex: 1},
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
257 {header: 'Ursprungsgemeinde', dataIndex: 'kreis', flex: 1},
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
258 {header: 'ProbeID', dataIndex: 'probeId'},
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
259 {header: 'MST', dataIndex: 'mstId', width: 50}
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
260 */
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
261
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
262 /* Query 1 */
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
263 QueryConfig qc1 = new QueryConfig();
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
264 qc1.setId(1);
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
265 qc1.setName("MST, UWB");
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
266 qc1.setDescription("Das ist die Beschreibung von Abfrage 1");
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
267 qc1.setSql("Select * from l_probe");
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
268 List<String> filters = new ArrayList<String>();
269
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
269 filters.add("mstId");
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
270 filters.add("umwId");
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
271 qc1.setFilters(filters);
267
df168246a4d2 Add Dummy Query Configuration. Needs to be replaced with w more simple
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 266
diff changeset
272 List<ResultConfig> results = new ArrayList<ResultConfig>();
269
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
273 results.add(new ResultConfig("datenbasisId","Datenbasis"));
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
274 results.add(new ResultConfig("mplId","MPL"));
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
275 results.add(new ResultConfig("umwId","UWB"));
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
276 results.add(new ResultConfig("messmethode","MMT"));
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
277 results.add(new ResultConfig("hauptprobenNr","HPNR"));
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
278 results.add(new ResultConfig("nebenprobenNr","NPNR"));
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
279 results.add(new ResultConfig("bezeichnung","E.Gemeinde"));
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
280 results.add(new ResultConfig("kreis","Ursprungsgemeinde"));
269
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
281 results.add(new ResultConfig("probeId","ProbeID",1));
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
282 results.add(new ResultConfig("mstId","MS"));
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
283 qc1.setResults(results);
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
284 configs.add(qc1);
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
285 /* Query 2 */
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
286 QueryConfig qc2 = new QueryConfig();
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
287 qc2.setId(2);
269
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
288 qc2.setName("Einfach");
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
289 qc2.setDescription("Einfache Abfrage aller Proben ohne weitere Filterung.");
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
290 qc2.setSql("Select * from l_probe");
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
291 List<String> qcf2= new ArrayList<String>();
269
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
292 qc2.setFilters(qcf2);
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
293 List<ResultConfig> qcr2= new ArrayList<ResultConfig>();
269
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
294 qcr2.add(new ResultConfig("datenbasisId","Datenbasis"));
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
295 qcr2.add(new ResultConfig("nebenprobenNr","NPNR"));
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
296 qcr2.add(new ResultConfig("hauptprobenNr","HPNR"));
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
297 qcr2.add(new ResultConfig("mstId","MS"));
5143a9604fb9 Fixed variable names.
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 268
diff changeset
298 qcr2.add(new ResultConfig("probeId","ProbeID",1));
268
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
299 qc2.setResults(qcr2);
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
300 configs.add(qc2);
58e1ed2ddbbd Restructured the Dummy Query configuration to make it more feel like the EXT
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 267
diff changeset
301 return configs;
266
2e86f535f290 Added basic query configuration sekeleton
Torsten Irländer <torsten.irlaender@intevation.de>
parents: 265
diff changeset
302 }
265
6c26e6474c0f Added service to fetch sql query configurations.
Torsten Irländer <torsten.irlaender@intevation.de>
parents:
diff changeset
303 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)