comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadLSFacet.java @ 8142:d4e4dde1d5cb

With the exception of real calculation results, descriptions of sediment loads can all follow the same pattern.
author Tom Gottfried <tom@intevation.de>
date Tue, 26 Aug 2014 17:16:21 +0200
parents c200b76145ce
children eb48b244921d
comparison
equal deleted inserted replaced
8141:37cdfad302cb 8142:d4e4dde1d5cb
95 public void setup(Artifact artifact, Document data, CallMeta callMeta) { 95 public void setup(Artifact artifact, Document data, CallMeta callMeta) {
96 logger.debug("setup"); 96 logger.debug("setup");
97 String code = D4EArtifact.getDatacageIDValue(data); 97 String code = D4EArtifact.getDatacageIDValue(data);
98 String[] split = code.split(";"); 98 String[] split = code.split(";");
99 String idStr = split[0]; 99 String idStr = split[0];
100 String desc = ""; 100 String years = split.length >= 2 ? split[1] : "";
101 if (split.length >= 2) {
102 desc = split[1];
103 }
104 101
105 int id = Integer.valueOf(idStr); 102 int id = Integer.valueOf(idStr);
106 SedimentLoadLS theLoad = SedimentLoadLS.getSedimentLoadById(id); 103 SedimentLoadLS theLoad = SedimentLoadLS.getSedimentLoadById(id);
107 if (theLoad == null) { 104 if (theLoad == null) {
108 logger.error("No load found for id: " + idStr); 105 logger.error("No load found for id: " + idStr);
141 138
142 logger.debug("Created facet: " + name); 139 logger.debug("Created facet: " + name);
143 140
144 description = Resources.getMsg( 141 description = Resources.getMsg(
145 callMeta, 142 callMeta,
146 "facet.sedimentload.ls." + gfName, 143 "facet.sedimentload." + gfName,
147 "Error: please add l10n for facet.sedimentload.ls." + gfName, 144 "Error: please add l10n for facet.sedimentload." + gfName,
148 new Object[] { desc, i18nUnit }); 145 new Object[] { years, i18nUnit });
149 ((D4EArtifact)artifact).addStringData("load_id", idStr); 146 ((D4EArtifact)artifact).addStringData("load_id", idStr);
150 } 147 }
151 148
152 149
153 /** Copy deeply. */ 150 /** Copy deeply. */

http://dive4elements.wald.intevation.org