changeset 744:6290ab85782b

Changed the structure for parameter/measurement matrix in the describe document (issue199). gnv-artifacts/trunk@783 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 16 Mar 2010 10:29:16 +0000
parents a4b66195d55a
children d194939ecbaf
files gnv-artifacts/ChangeLog gnv-artifacts/src/main/java/de/intevation/gnv/state/MeasurementState.java
diffstat 2 files changed, 17 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/gnv-artifacts/ChangeLog	Tue Mar 16 08:51:50 2010 +0000
+++ b/gnv-artifacts/ChangeLog	Tue Mar 16 10:29:16 2010 +0000
@@ -1,3 +1,13 @@
+2010-03-16  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	  Issue199
+
+	* src/main/java/de/intevation/gnv/state/MeasurementState.java: Changed the
+	  describe document creation a bit. The describe document will now have a
+	  section for measurement/parameter with each parameter in an own
+	  xform:select node which contains different xform:item nodes for each 
+	  measurement for this parameter.
+
 2010-03-16  Tim Englich  <tim.englich@intevation.de>
 
 	* doc/conf/products/layer/conf.xml: 
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/MeasurementState.java	Tue Mar 16 08:51:50 2010 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/MeasurementState.java	Tue Mar 16 10:29:16 2010 +0000
@@ -218,12 +218,12 @@
         int measurements = matrix.measurementSize();
         int parameters   = matrix.parameterSize();
 
-        for (int i = 0; i < measurements; i++) {
+        for (int i = 0; i < parameters; i++) {
             Element select = creator.create("select");
-            creator.addAttr(select, "label", matrix.getMDescription(i));
+            creator.addAttr(select, "label", inputParam.getDescription(matrix.getParameter(i)));
             creator.addAttr(select, "ref", name);
 
-            for (int j = 0; j < parameters; j++) {
+            for (int j = 0; j < measurements; j++) {
                 Element item  = creator.create("item");
                 Element label = creator.create("label");
                 Element value = creator.create("value");
@@ -232,17 +232,17 @@
                 creator.addAttr(
                     item,
                     "parameter",
-                    inputParam.getDescription(matrix.getParameter(j)));
+                    matrix.getMDescription(j));
 
-                if (!matrix.isValid(i, j)) {
+                if (!matrix.isValid(j, i)) {
                     creator.addAttr(item, "disabled", "true");
                 }
                 else {
                     creator.addAttr(item, "disabled", "false");
                 }
 
-                label.setTextContent(matrix.getMDescription(i));
-                value.setTextContent(matrix.getMeasurement(i));
+                label.setTextContent(matrix.getMDescription(j));
+                value.setTextContent(matrix.getMeasurement(j));
 
                 item.appendChild(label);
                 item.appendChild(value);

http://dive4elements.wald.intevation.org