changeset 8298:5dfb3ff98bc6

Purge clash of out-names, resulting hacks and tests for not existing outs and give some more meaningful names.
author "Tom Gottfried <tom@intevation.de>"
date Fri, 19 Sep 2014 15:31:03 +0200
parents 6f866709bbff
children de42523b2e27
files artifacts/doc/conf/meta-data.xml gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageTwinPanel.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DemDatacagePanel.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/HWSDatacagePanel.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WspDatacagePanel.java gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedHeightsDatacagePanel.java
diffstat 6 files changed, 23 insertions(+), 83 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/meta-data.xml	Fri Sep 19 09:49:09 2014 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Fri Sep 19 15:31:03 2014 +0200
@@ -2,17 +2,7 @@
 <dc:template xmlns:dc="http://www.intevation.org/2011/Datacage">
   <datacage>
 
-    <dc:comment>
-      User specific part
-      ------------------
-      Since rev 4b29bb2c785f we (only?) need this hack to suppress
-      user-content in DEM-selection during floodmap parameterisation.
-    </dc:comment>
-    <dc:if test="dc:contains($parameters, 'user-id') and
-      not(dc:contains($artifact-outs, 'floodmap-hws')) and
-      not($current-state-id = 'state.winfo.uesk.dgm')">
-      <dc:call-macro name="load-user"/>
-    </dc:if>
+    <dc:call-macro name="load-user"/>
 
     <dc:call-macro name="load-system"/>
 
@@ -102,17 +92,6 @@
                   <dc:when test="$out = 'floodmap'">
                     <dc:call-macro name="flood-map-recommended"/>
                   </dc:when>
-                  <dc:when test="$out = 'floodmap-hws'">
-                    <dc:call-macro name="flood-map-recommended"/>
-                  </dc:when>
-                  <dc:when test="$out = 'minfo-heights'">
-                    <dc:call-macro name="minfo-heights"/>
-                  </dc:when>
-                  <dc:when test="$out = 'minfo-heights-epoch'">
-                    <bedheights>
-                      <dc:call-macro name="bed-heights-epoch"/>
-                    </bedheights>
-                  </dc:when>
                   <dc:when test="$out = 'sedimentload_ls'">
                     <dc:call-macro name="annotations"/>
                     <dc:call-macro name="sedimentload_off_epochs"/>
@@ -133,7 +112,7 @@
               <dc:iterate var="out" container="artifact-outs">
                 <dc:message>Non Rec out iteration for: {$out}</dc:message>
                 <dc:choose>
-                  <dc:when test="$out = 'minfo-heights-diff'">
+                  <dc:when test="$out = 'minfo_diff_panel'">
                     <dc:call-macro name="minfo-heights-diff"/>
                   </dc:when>
                   <dc:when test="$out = 'cross_section'">
@@ -212,37 +191,17 @@
                   <dc:when test="$out = 'bed_difference_year'">
                     <dc:call-macro name="longitudinal-section-prototype"/>
                   </dc:when>
+                  <dc:when test="$out = 'floodmap_dem_panel'">
+                    <dc:call-macro name="flood-map-dem"/>
+                  </dc:when>
                   <dc:when test="$out = 'floodmap'">
-                    <dc:choose>
-                      <dc:when test="dc:contains($parameters, 'dem')">
-                        <dc:call-macro name="flood-map-dem"/>
-                      </dc:when>
-                      <dc:when test="dc:contains($parameters, 'hws')">
-                        <hws>
-                          <dc:call-macro name="flood-map-hws-lines"/>
-                          <dc:call-macro name="flood-map-hws-points"/>
-                        </hws>
-                      </dc:when>
-                      <dc:otherwise>
-                        <dc:call-macro name="flood-map-complete"/>
-                      </dc:otherwise>
-                    </dc:choose>
+                    <dc:call-macro name="flood-map-complete"/>
                   </dc:when>
-                  <dc:when test="$out = 'floodmap-hws'">
-                    <dc:choose>
-                      <dc:when test="dc:contains($parameters, 'dem')">
-                        <dc:call-macro name="flood-map-dem"/>
-                      </dc:when>
-                      <dc:when test="dc:contains($parameters, 'hws')">
-                        <hws>
-                          <dc:call-macro name="flood-map-hws-lines"/>
-                          <dc:call-macro name="flood-map-hws-points"/>
-                        </hws>
-                      </dc:when>
-                      <dc:otherwise>
-                        <dc:call-macro name="flood-map-complete"/>
-                      </dc:otherwise>
-                    </dc:choose>
+                  <dc:when test="$out = 'floodmap_hws_panel'">
+                    <hws>
+                      <dc:call-macro name="flood-map-hws-lines"/>
+                      <dc:call-macro name="flood-map-hws-points"/>
+                    </hws>
                   </dc:when>
                   <dc:when test="$out = 'computed_discharge_curve'">
                     <dc:call-macro name="discharge-curve-prototype"/>
@@ -253,15 +212,7 @@
                       <dc:call-macro name="mainvalues"/>
                     </computed_discharge_curve>
                   </dc:when>
-                  <dc:when test="$out = 'minfo-heights'">
-                    <dc:call-macro name="minfo-heights"/>
-                  </dc:when>
-                  <dc:when test="$out = 'minfo-heights-epoch'">
-                    <bedheights>
-                      <dc:call-macro name="bed-heights-epoch"/>
-                    </bedheights>
-                  </dc:when>
-                  <dc:when test="$out = 'differenceable'">
+                  <dc:when test="$out = 'winfo_diff_twin_panel'">
                     <dc:if test="$current-state-id != 'state.winfo.uesk.wsp'">
                       <dc:call-macro name="basedata_0"/>
                       <dc:call-macro name="basedata_1_additionals"/>
@@ -270,7 +221,7 @@
                       <dc:call-macro name="basedata_5_flood-protections"/>
                     </dc:if>
                   </dc:when>
-                  <dc:when test="$out = 'waterlevels'">
+                  <dc:when test="$out = 'waterlevels_panel'">
                     <dc:call-macro name="basedata_0"/>
                     <dc:call-macro name="basedata_1_additionals"/>
                     <dc:call-macro name="basedata_2_fixations"/>
@@ -351,14 +302,14 @@
                     <dc:when test="$out = 'duration_curve'">
                       <dc:call-macro name="duration-curve"/>
                     </dc:when>
-                    <dc:when test="$out = 'differenceable'">
-                      <dc:call-macro name="differenceable-fix"/>
+                    <dc:when test="$out = 'winfo_diff_twin_panel'">
+                      <dc:call-macro name="differences-fix"/>
                       <dc:call-macro name="differences"/>
                       <dc:comment comment="Candidate for:">
                         <dc:call-macro name="longitudinal-section-user-prototype"/>
                       </dc:comment>
                     </dc:when>
-                    <dc:when test="$out = 'waterlevels'">
+                    <dc:when test="$out = 'waterlevels_panel'">
                       <dc:call-macro name="waterlevels-fix"/>
                       <dc:comment comment="Candidate for:">
                         <dc:call-macro name="longitudinal-section-user-prototype"/>
@@ -373,7 +324,7 @@
                     <dc:when test="$out = 'bedheight_middle'">
                       <dc:call-macro name="longitudinal-section-user-prototype"/>
                     </dc:when>
-                    <dc:when test="$out = 'floodmap-hws'">
+                    <dc:when test="$out = 'floodmap_hws_panel'">
                       <dc:call-macro name="floodmap-hws-user"/>
                     </dc:when>
                     <dc:when test="$out = 'flow_velocity'">
@@ -859,13 +810,7 @@
     </dc:macro>
 
     <dc:comment comment="For building differences." />
-    <dc:macro name="differenceable-fix">
-      <dc:comment>
-        No diffs between beddiffs and others, for now.
-        <beddifferences>
-           <dc:call-macro name="bedheight_differences"/>
-        </beddifferences>
-      </dc:comment>
+    <dc:macro name="differences-fix">
       <dc:comment comment="Vollmer curves need own factory"/>
       <dc:filter expr="$a_state = 'state.fix.vollmer.compute' and $facet_name = 'longitudinal_section.w'">
         <dc:if test="dc:has-result()">
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageTwinPanel.java	Fri Sep 19 09:49:09 2014 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageTwinPanel.java	Fri Sep 19 15:31:03 2014 +0200
@@ -175,7 +175,7 @@
         VLayout layout       = new VLayout();
         HLayout helperLayout = new HLayout();
         helperLayout.addMember(new DatacagePairWidget(this.artifact,
-            user, "differenceable", differencesList));
+            user, "winfo_diff_twin_panel", differencesList));
 
         layout.addMember(widget);
         layout.addMember(submit);
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DemDatacagePanel.java	Fri Sep 19 09:49:09 2014 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DemDatacagePanel.java	Fri Sep 19 15:31:03 2014 +0200
@@ -24,7 +24,7 @@
 
     private static final long serialVersionUID = -2301633938080411687L;
 
-    public static final String OUT        = "floodmap";
+    public static final String OUT        = "floodmap_dem_panel";
     public static final String PARAMETERS = "dem:true";
 
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/HWSDatacagePanel.java	Fri Sep 19 09:49:09 2014 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/HWSDatacagePanel.java	Fri Sep 19 15:31:03 2014 +0200
@@ -30,7 +30,7 @@
 public class HWSDatacagePanel
 extends DatacagePanel
 {
-    public static final String OUT        = "floodmap-hws";
+    public static final String OUT        = "floodmap_hws_panel";
     public static final String PARAMETERS = "hws:true;load-system:true";
 
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WspDatacagePanel.java	Fri Sep 19 09:49:09 2014 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WspDatacagePanel.java	Fri Sep 19 15:31:03 2014 +0200
@@ -41,7 +41,7 @@
 
     private static final long serialVersionUID = 2494432743877141135L;
 
-    public static final String WATERLEVEL_OUTS = "waterlevels";
+    public static final String WATERLEVEL_OUTS = "waterlevels_panel";
 
     public static final FLYSConstants MSG = GWT.create(FLYSConstants.class);
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedHeightsDatacagePanel.java	Fri Sep 19 09:49:09 2014 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedHeightsDatacagePanel.java	Fri Sep 19 15:31:03 2014 +0200
@@ -57,10 +57,6 @@
 
 // TODO Probably better to branch off AbstractUIProvider.
 // TODO Merge with other datacage-widget impls.
-/**
- * Panel containing a Grid and a "next" button. The Grid is fed by a
- * DatacagePairWidget which is put in the input-helper area.
- */
 public class BedHeightsDatacagePanel
 extends      DatacageTwinPanel {
 
@@ -122,11 +118,10 @@
     public Canvas create(DataList dataList) {
         GWT.log("createData()");
 
-        String filter = "minfo-heights-diff";
         Canvas widget = createWidget();
         Canvas submit = getNextButton();
         datacage = new DatacageWidget(
-            this.artifact, user, filter, "load-system:true", false);
+            this.artifact, user, "minfo_diff_panel", "load-system:true", false);
 
         Button plusBtn = new Button(MSG.datacage_add_pair());
         plusBtn.setAutoFit(true);

http://dive4elements.wald.intevation.org