[PATCH] Reconstruct facet description of sediment load at measurement stations. i18n will follow

Wald Commits scm-commit at wald.intevation.org
Wed Aug 20 17:08:43 CEST 2014


# HG changeset patch
# User "Tom Gottfried <tom at intevation.de>"
# Date 1408547237 -7200
# Node ID f5c0ed04f67324ac0b1e207f89d7a97083efe640
# Parent  5d5fb6ee1888d933cd5ea193f298cc69f9707754
Reconstruct facet description of sediment load at measurement stations. i18n will follow.

diff -r 5d5fb6ee1888 -r f5c0ed04f673 artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Wed Aug 20 14:53:29 2014 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Wed Aug 20 17:07:17 2014 +0200
@@ -1407,18 +1407,15 @@
       </densities>
     </dc:macro>
 
-    <dc:comment> TODO aheinecke: Needs the kind in the ids;2 field </dc:comment>
-    <dc:comment> TODO aheinecke: Does seperation by Id even make sense here? Is not a year filter required?</dc:comment>
     <dc:macro name="one-load">
       <dc:variable name="syear" type="string" expr="dc:date-format('yyyy', $year)"/>
       <year description="{$syear}"
             factory="sedimentload"
             target_out="{$out}"
             info="{$description}"
-            ids="{$syid};{$station_name} - {$syear}" />
+            ids="{$syid};{$fraction};{$syear}" />
     </dc:macro>
 
-    <dc:comment> TODO aheinecke: Needs the kind in the name</dc:comment>
     <dc:macro name="epoch-load">
       <dc:variable name="syear" type="string" expr="dc:date-format('yyyy', $startyear)"/>
       <dc:variable name="eyear" type="string" expr="dc:date-format('yyyy', $endyear)"/>
@@ -1426,7 +1423,7 @@
             factory="sedimentload"
             target_out="{$out}"
             info="{$description}"
-            ids="{$syid};{$station_name} - {$syear}-{$eyear}" />
+            ids="{$syid};{$fraction};{$syear}-{$eyear}" />
     </dc:macro>
 
     <dc:macro name="one-load_ls">
diff -r 5d5fb6ee1888 -r f5c0ed04f673 artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Wed Aug 20 14:53:29 2014 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java	Wed Aug 20 17:07:17 2014 +0200
@@ -49,8 +49,6 @@
 {
     private static Logger logger = Logger.getLogger(SedimentLoadFacet.class);
 
-    /* Aheinecke we probably need to get the kind and split this up here
-     * in some way */
     private static final String NAME = SEDIMENT_LOAD_TA_STATIC;
 
     public SedimentLoadFacet() {
@@ -98,17 +96,17 @@
         String code = D4EArtifact.getDatacageIDValue(data);
         String[] split = code.split(";");
         String idStr = split[0];
-        String desc = "";
-        if (split.length >= 2) {
-            desc = split[1];
-        }
+
+        String fraction = split.length >= 2 ? split[1] : "";
+        String years    = split.length >= 3 ? " - " + split[2] : "";
 
         name = NAME;
+
         description = Resources.getMsg(
                 callMeta,
-                "facet.sedimentload",
-                "Sedimentload",
-                new Object[] { desc });
+                "facet.sedimentload." + fraction,
+                new Object[] { years });
+
         ((D4EArtifact)artifact).addStringData("load_id", idStr);
     }
 


More information about the Dive4Elements-commits mailing list