comparison gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactHelper.java @ 6044:477d2d18452e

Implement function to spawn a mainvalueartifact, given gauge and river.
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 16 May 2013 17:58:16 +0200
parents c47337657f8c
children 8d9859d776e5
comparison
equal deleted inserted replaced
6043:c47337657f8c 6044:477d2d18452e
88 88
89 return sendCreate(serverUrl, locale, create); 89 return sendCreate(serverUrl, locale, create);
90 90
91 } 91 }
92 92
93 /**
94 * Creates a new MainvaluesArtifact.
95 *
96 * @param river the name of the river
97 */
98 public static Artifact createMainvalueArtifact(
99 String serverUrl,
100 String locale,
101 String river,
102 Long gaugeRef)
103 throws ServerException
104 {
105 Document create = ClientProtocolUtils.newCreateDocument(
106 MAINVALUE_ARTIFACT_FACTORY);
107
108 XMLUtils.ElementCreator ec = new XMLUtils.ElementCreator(
109 create,
110 ArtifactNamespaceContext.NAMESPACE_URI,
111 ArtifactNamespaceContext.NAMESPACE_PREFIX);
112
113 Element root = create.getDocumentElement();
114
115 Element eriver = ec.create("river");
116 ec.addAttr(eriver, "name", river);
117
118 Element egauge = ec.create("gauge");
119 ec.addAttr(egauge, "reference", gaugeRef.toString());
120
121 root.appendChild(eriver);
122 root.appendChild(egauge);
123
124 return sendCreate(serverUrl, locale, create);
125 }
93 /** 126 /**
94 * Creates a new GaugeDischargeCurverArtifact 127 * Creates a new GaugeDischargeCurverArtifact
95 * 128 *
96 * @param river the name of the river 129 * @param river the name of the river
97 * @param reference the reference id of the gauge (official number) 130 * @param reference the reference id of the gauge (official number)

http://dive4elements.wald.intevation.org