Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/server/ArtifactHelper.java @ 5540:25c2505df28f
Merged
author | Christian Lins <christian.lins@intevation.de> |
---|---|
date | Wed, 03 Apr 2013 16:00:21 +0200 |
parents | b660090b417d |
children |
comparison
equal
deleted
inserted
replaced
5539:8d0af912351c | 5540:25c2505df28f |
---|---|
37 | 37 |
38 /** | 38 /** |
39 * Name of the factory to generate a GaugeDischargeCurveArtifact | 39 * Name of the factory to generate a GaugeDischargeCurveArtifact |
40 */ | 40 */ |
41 private static final String GAUGE_DISCHARGE_CURVE_ARTIFACT = "gaugedischargecurve"; | 41 private static final String GAUGE_DISCHARGE_CURVE_ARTIFACT = "gaugedischargecurve"; |
42 | 42 private static final String SQ_RELATION_ARTIFACT = "staticsqrelation"; |
43 | 43 |
44 private ArtifactHelper() { | 44 private ArtifactHelper() { |
45 } | 45 } |
46 | 46 |
47 | 47 |
160 cf.add(entry.getKey(), cfs); | 160 cf.add(entry.getKey(), cfs); |
161 } | 161 } |
162 | 162 |
163 return cf; | 163 return cf; |
164 } | 164 } |
165 | |
166 | |
167 public static Artifact createSQRelationArtifact( | |
168 String serverUrl, | |
169 String locale, | |
170 String river, | |
171 int measurementStation) | |
172 throws ServerException | |
173 { | |
174 Document create = ClientProtocolUtils.newCreateDocument( | |
175 SQ_RELATION_ARTIFACT); | |
176 | |
177 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator( | |
178 create, | |
179 ArtifactNamespaceContext.NAMESPACE_URI, | |
180 ArtifactNamespaceContext.NAMESPACE_PREFIX); | |
181 | |
182 Element root = create.getDocumentElement(); | |
183 | |
184 Element eriver = ec.create("river"); | |
185 ec.addAttr(eriver, "name", river); | |
186 | |
187 Element estation = ec.create("measurement_station"); | |
188 ec.addAttr(estation, "number", String.valueOf(measurementStation)); | |
189 | |
190 root.appendChild(eriver); | |
191 root.appendChild(estation); | |
192 | |
193 return sendCreate(serverUrl, locale, create); | |
194 } | |
165 } | 195 } |
166 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 196 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |