Mercurial > dive4elements > river
comparison flys-client/src/main/java/org/dive4elements/river/client/client/ui/range/DistanceInfoDataSource.java @ 5834:f507086aa94b
Repaired internal references.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Thu, 25 Apr 2013 12:31:32 +0200 |
parents | flys-client/src/main/java/de/intevation/flys/client/client/ui/range/DistanceInfoDataSource.java@4a7ece57f44c |
children | 821a02bbfb4e |
comparison
equal
deleted
inserted
replaced
5833:a2bdc0f524e8 | 5834:f507086aa94b |
---|---|
1 package de.intevation.flys.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 : |