changeset 3111:a5fb0a2dfe2f

Load q-type facets with w-facets for differences' base data. flys-artifacts/trunk@4710 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Tue, 19 Jun 2012 18:40:35 +0000
parents 88d49a0a55f0
children cbb033073037
files flys-artifacts/doc/conf/artifacts/waterlevel.xml flys-artifacts/src/main/java/de/intevation/flys/artifacts/WaterlevelArtifact.java
diffstat 2 files changed, 18 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/flys-artifacts/doc/conf/artifacts/waterlevel.xml	Tue Jun 19 15:40:33 2012 +0000
+++ b/flys-artifacts/doc/conf/artifacts/waterlevel.xml	Tue Jun 19 18:40:35 2012 +0000
@@ -8,6 +8,7 @@
              <outputmode name="w_differences" description="output.w_differences" mime-type="image/png" type="chart">
                   <facets>
                      <facet name="longitudinal_section.w" description="facet.longitudinal_section.w" />
+                     <facet name="longitudinal_section.q" description="facet.longitudinal_section.q" />
                   </facets>
               </outputmode>
            </outputmodes>
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WaterlevelArtifact.java	Tue Jun 19 15:40:33 2012 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WaterlevelArtifact.java	Tue Jun 19 18:40:35 2012 +0000
@@ -1,5 +1,6 @@
 package de.intevation.flys.artifacts;
 
+import de.intevation.artifactdatabase.state.DefaultFacet;
 import de.intevation.artifactdatabase.state.Facet;
 
 import de.intevation.artifacts.Artifact;
@@ -52,9 +53,22 @@
     {
         super.setup(identifier, factory, context, callMeta, data);
         if(filterFacets != null) {
-            filterFacets.put(
-                "w_differences",
-                filterFacets.get("longitudinal_section"));
+            List<Facet> list = new ArrayList<Facet>();
+            List<Facet> qlist = new ArrayList<Facet>();
+            List<Facet> wlist = filterFacets.get("longitudinal_section");
+            for (Facet f: wlist) {
+                if (!f.getName().equals("longitudinal_section.q")) {
+                    DefaultFacet df = new DefaultFacet(f.getIndex(),
+                        "longitudinal_section.q", ""); 
+                    qlist.add(df);
+                }
+            }
+
+            list.addAll(qlist);
+            list.addAll(wlist);
+
+            filterFacets.put("longitudinal_section", list);
+            filterFacets.put("w_differences", list);
         }
     }
 

http://dive4elements.wald.intevation.org