comparison artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java @ 8113:f5c0ed04f673

Reconstruct facet description of sediment load at measurement stations. i18n will follow.
author "Tom Gottfried <tom@intevation.de>"
date Wed, 20 Aug 2014 17:07:17 +0200
parents 4bcc0c8425d2
children ca072278ad02
comparison
equal deleted inserted replaced
8112:5d5fb6ee1888 8113:f5c0ed04f673
47 extends DataFacet 47 extends DataFacet
48 implements FacetTypes, StaticFacet 48 implements FacetTypes, StaticFacet
49 { 49 {
50 private static Logger logger = Logger.getLogger(SedimentLoadFacet.class); 50 private static Logger logger = Logger.getLogger(SedimentLoadFacet.class);
51 51
52 /* Aheinecke we probably need to get the kind and split this up here
53 * in some way */
54 private static final String NAME = SEDIMENT_LOAD_TA_STATIC; 52 private static final String NAME = SEDIMENT_LOAD_TA_STATIC;
55 53
56 public SedimentLoadFacet() { 54 public SedimentLoadFacet() {
57 } 55 }
58 56
96 public void setup(Artifact artifact, Document data, CallMeta callMeta) { 94 public void setup(Artifact artifact, Document data, CallMeta callMeta) {
97 logger.debug("setup"); 95 logger.debug("setup");
98 String code = D4EArtifact.getDatacageIDValue(data); 96 String code = D4EArtifact.getDatacageIDValue(data);
99 String[] split = code.split(";"); 97 String[] split = code.split(";");
100 String idStr = split[0]; 98 String idStr = split[0];
101 String desc = ""; 99
102 if (split.length >= 2) { 100 String fraction = split.length >= 2 ? split[1] : "";
103 desc = split[1]; 101 String years = split.length >= 3 ? " - " + split[2] : "";
104 }
105 102
106 name = NAME; 103 name = NAME;
104
107 description = Resources.getMsg( 105 description = Resources.getMsg(
108 callMeta, 106 callMeta,
109 "facet.sedimentload", 107 "facet.sedimentload." + fraction,
110 "Sedimentload", 108 new Object[] { years });
111 new Object[] { desc }); 109
112 ((D4EArtifact)artifact).addStringData("load_id", idStr); 110 ((D4EArtifact)artifact).addStringData("load_id", idStr);
113 } 111 }
114 112
115 113
116 /** Copy deeply. */ 114 /** Copy deeply. */

http://dive4elements.wald.intevation.org