comparison gwt-client/src/main/java/org/dive4elements/river/client/client/ui/range/DistanceInfoDataSource.java @ 5838:5aa05a7a34b7

Rename modules to more fitting names.
author Sascha L. Teichmann <teichmann@intevation.de>
date Thu, 25 Apr 2013 15:23:37 +0200
parents flys-client/src/main/java/org/dive4elements/river/client/client/ui/range/DistanceInfoDataSource.java@821a02bbfb4e
children 172338b1407f
comparison
equal deleted inserted replaced
5837:d9901a08d0a6 5838:5aa05a7a34b7
1 package org.dive4elements.river.client.client.ui.range;
2
3 import com.google.gwt.core.client.GWT;
4
5 import com.smartgwt.client.data.DataSource;
6 import com.smartgwt.client.data.DataSourceField;
7 import com.smartgwt.client.types.DSDataFormat;
8 import com.smartgwt.client.types.FieldType;
9
10
11 public class DistanceInfoDataSource extends DataSource {
12
13 public static final String XPATH_DISTANCE_DEFAULT = "/distances/distance";
14
15
16 public DistanceInfoDataSource(String url, String river, String filter) {
17 setDataFormat(DSDataFormat.XML);
18 setRecordXPath(XPATH_DISTANCE_DEFAULT);
19
20 DataSourceField desc = new DataSourceField(
21 "description", FieldType.TEXT, "description");
22
23 DataSourceField from = new DataSourceField(
24 "from", FieldType.TEXT, "from");
25
26 DataSourceField to = new DataSourceField(
27 "to", FieldType.TEXT, "to");
28
29 DataSourceField side = new DataSourceField(
30 "riverside", FieldType.TEXT, "riverside");
31
32 DataSourceField top = new DataSourceField(
33 "top", FieldType.TEXT, "top");
34
35 DataSourceField bottom = new DataSourceField(
36 "bottom", FieldType.TEXT, "bottom");
37
38 setFields(desc, from, to, side, top, bottom);
39 setDataURL(getServiceURL(url, river, filter));
40 }
41
42
43 protected String getServiceURL(String server, String river, String filter) {
44 String url = GWT.getModuleBaseURL();
45 url += "distanceinfoxml";
46 url += "?server=" + server;
47 url += "&river=" + river;
48 url += "&filter=" + filter;
49
50 return url;
51 }
52 }
53 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org