changeset 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 5d5fb6ee1888
children 84f42caeea2a
files artifacts/doc/conf/meta-data.xml artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/SedimentLoadFacet.java
diffstat 2 files changed, 9 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- 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">
--- 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);
     }
 

http://dive4elements.wald.intevation.org