diff flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java @ 1771:c62ff9e72cea

Restore mapping of state id to facets (revert, rev 3083 and 3088). flys-artifacts/trunk@3092 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Thu, 27 Oct 2011 09:32:05 +0000
parents 5d8b3880a553
children a8aa343799a2
line wrap: on
line diff
--- a/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Wed Oct 26 12:55:32 2011 +0000
+++ b/flys-artifacts/src/main/java/de/intevation/flys/artifacts/WINFOArtifact.java	Thu Oct 27 09:32:05 2011 +0000
@@ -256,14 +256,16 @@
                 continue;
             }
 
-            if (facets == null || facets.size() == 0) {
+            List<Facet> fs = facets.get(stateId);
+
+            if (fs == null || fs.size() == 0) {
                 logger.debug("No facets for previous state found.");
                 continue;
             }
 
-            logger.debug("Found " + facets.size() + " facets in previous states.");
+            logger.debug("Found " + fs.size() + " facets in previous states.");
 
-            List<Output> generated = generateOutputs(list, facets);
+            List<Output> generated = generateOutputs(list, fs);
 
             ProtocolUtils.appendOutputModes(doc, outs, generated);
         }
@@ -276,10 +278,12 @@
                     logger.debug(
                         "Append output modes for current state: " + cur.getID());
 
-                    if (facets != null && facets.size() > 0) {
-                        List<Output> generated = generateOutputs(list, facets);
+                    List<Facet> fs = facets.get(cur.getID());
 
-                        logger.debug("Found " + facets.size() + " current facets.");
+                    if (fs != null && fs.size() > 0) {
+                        List<Output> generated = generateOutputs(list, fs);
+
+                        logger.debug("Found " + fs.size() + " current facets.");
                         if (!generated.isEmpty()) {
                             ProtocolUtils.appendOutputModes(
                                 doc, outs, generated);
@@ -1284,10 +1288,10 @@
      * @param index     index of the facet.
      */
     public int getInitialFacetActivity(String facetName, int index) {
-        return facetName.endsWith("q")
+        return (facetName.startsWith("longitudinal_section")
+                && facetName.endsWith("q"))
                ? 0
                : 1;
     }
-
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org