Mercurial > dive4elements > river
comparison gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactServiceImpl.java @ 6040:cbdf839008a7
Add a new function to create a GaugeDischarge+MainValueArtifact collection.
author | Felix Wolfsteller <felix.wolfsteller@intevation.de> |
---|---|
date | Thu, 16 May 2013 16:31:09 +0200 |
parents | b6dab05553e2 |
children | 238fc722f87a |
comparison
equal
deleted
inserted
replaced
6039:b6dab05553e2 | 6040:cbdf839008a7 |
---|---|
56 String url = getServletContext().getInitParameter("server-url"); | 56 String url = getServletContext().getInitParameter("server-url"); |
57 | 57 |
58 return ArtifactHelper.createArtifact(url, locale, factory, recom); | 58 return ArtifactHelper.createArtifact(url, locale, factory, recom); |
59 } | 59 } |
60 | 60 |
61 | |
62 /** | |
63 * Create a new GaugeDischageCurveArtifact and MainValueArtifact, stuff | |
64 * them into a collection. | |
65 * | |
66 * @param river the river. | |
67 * @param gaugeref reference id of the gauge. | |
68 */ | |
69 public Artifact createGaugeDischargeView( | |
70 Collection collection, | |
71 String locale, | |
72 String river, | |
73 Long gaugeRef) | |
74 throws ServerException | |
75 { | |
76 logger.info("ArtifactServiceImpl.createGaugeDischargeCurveView"); | |
77 String url = getServletContext().getInitParameter("server-url"); | |
78 | |
79 Artifact artifact = ArtifactHelper.createGaugeDischargeCurveArtifact(url, | |
80 locale, river, gaugeRef); | |
81 if (artifact == null) { | |
82 return null; | |
83 } | |
84 logger.info("GaugeDischargeCurveArtifact created successfully"); | |
85 | |
86 CollectionHelper.addArtifact(collection, artifact, url, locale); | |
87 Artifact mainVArtifact = ArtifactHelper.createMainvalueArtifact(url, | |
88 locale, river, gaugeRef); | |
89 if (mainVArtifact == null) { | |
90 logger.info("Failed to create MainValueArtifact"); | |
91 return null; | |
92 } | |
93 CollectionHelper.addArtifact(collection, mainVArtifact, url, locale); | |
94 | |
95 return artifact; | |
96 } | |
97 | |
61 /** | 98 /** |
62 * Create a new GaugeDischageCurveArtifact | 99 * Create a new GaugeDischageCurveArtifact |
63 * | 100 * |
64 * @param river the river | 101 * @param river the river |
65 * @param gaugeref reference id of the gauge | 102 * @param gaugeref reference id of the gauge |