[Dive4elements-commits] [PATCH] merge changes from default into double-precision branch

Wald Commits scm-commit at wald.intevation.org
Tue Jun 11 09:59:17 CEST 2013


# HG changeset patch
# User Tom Gottfried <tom.gottfried at intevation.de>
# Date 1370936456 -7200
# Branch double-precision
# Node ID e8f152163a1e2269aa61a505d8e7701073077ffd
# Parent  a3fb76cf79b65e1f4acad985dd4e69ffa9042d85
# Parent  f01dee3a39fc2b5cfc1cbb4c0a076916912d9de6
merge changes from default into double-precision branch

diff -r a3fb76cf79b6 -r e8f152163a1e .hgtags
--- a/.hgtags	Wed Jun 05 11:56:38 2013 +0200
+++ b/.hgtags	Tue Jun 11 09:40:56 2013 +0200
@@ -50,3 +50,5 @@
 b740f0c4179edb5238d27013b25a0b3cc52e4e7f 3.0.3
 5f34e4cb80952b94e4683d90dbaab59e9da3711a 3.0.4
 1a169e10c0f3e1f33990a91dd294512ac97d1a70 3.0.5
+b689d2b9d1675739778083b2bcba336abb33f70c 3.0.6
+5733d7f27196c5a8cf18231fbf187738f8fea560 3.0.7
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/artifacts/minfo.xml
--- a/artifacts/doc/conf/artifacts/minfo.xml	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/doc/conf/artifacts/minfo.xml	Tue Jun 11 09:40:56 2013 +0200
@@ -229,7 +229,6 @@
                         <facet name="bedheight_difference.year.height2" description="A facet for raw heights."/>
                         <facet name="bedheight_difference.year.height1.filtered" description="A facet for raw heights."/>
                         <facet name="bedheight_difference.year.height2.filtered" description="A facet for raw heights."/>
-                        <facet name="longitudinal_section.annotations" description="facet.longitudinal_section.annotations"/>
                         <facet name="fix_sector_average_ls_0" description="Datacage facet"/>
                         <facet name="fix_sector_average_ls_1" description="Datacage facet"/>
                         <facet name="fix_sector_average_ls_2" description="Datacage facet"/>
@@ -257,7 +256,6 @@
                         <facet name="bed_difference_epoch.manualpoints" />
                         <facet name="bedheight_difference.epoch.height1" description="A facet for raw heights."/>
                         <facet name="bedheight_difference.epoch.height2" description="A facet for raw heights."/>
-                        <facet name="longitudinal_section.annotations" description="facet.longitudinal_section.annotations"/>
                         <facet name="fix_sector_average_ls_0" description="Datacage facet"/>
                         <facet name="fix_sector_average_ls_1" description="Datacage facet"/>
                         <facet name="fix_sector_average_ls_2" description="Datacage facet"/>
@@ -279,6 +277,12 @@
                         <facet name="morph-width" description="morphologic width, not sounding width!"/>
                     </facets>
                 </outputmode>
+                <outputmode name="bedheight_difference_export" description="output.bedheight_differenceexport" mime-type="text/plain" type="export">
+                    <facets>
+                        <facet name="csv" description="facet.bedheight_difference_export.csv" />
+                        <facet name="pdf" description="facet.bedheight_difference_export.pdf" />
+                    </facets>
+                </outputmode>
             </outputmodes>
         </state>
 
@@ -391,14 +395,17 @@
             <outputmodes>
                 <outputmode name="bed_longitudinal_section" description="output.bed_longitudinal_section" mime-type="image/png" type="chart">
                     <facets>
-                    	<facet name="bed_longitudinal_section.porosity_toplayer"/>
-                    	<facet name="bed_longitudinal_section.porosity_sublayer"/>
-                    	<facet name="bed_longitudinal_section.sediment_density_toplayer"/>
-                    	<facet name="bed_longitudinal_section.sediment_density_sublayer"/>
-                    	<facet name="bed_longitudinal_section.bed_diameter_toplayer"/>
+                        <facet name="bed_longitudinal_section.porosity_toplayer"/>
+                        <facet name="bed_longitudinal_section.porosity_sublayer"/>
+                        <facet name="bed_longitudinal_section.sediment_density_toplayer"/>
+                        <facet name="bed_longitudinal_section.sediment_density_sublayer"/>
+                        <facet name="bed_longitudinal_section.bed_diameter_toplayer"/>
                         <facet name="bed_longitudinal_section.bed_diameter_sublayer"/>
+                        <facet name="bed_longitudinal_section.bed_diameter_data_top"/>
+                        <facet name="bed_longitudinal_section.bed_diameter_data_sub"/>
+                        <facet name="bed_longitudinal_section.bedload_diameter_data"/>
                         <facet name="bed_longitudinal_section.manualpoints" />
-                    	<facet name="bed_longitudinal_section.bedload_diameter"/>
+                        <facet name="bed_longitudinal_section.bedload_diameter"/>
                         <facet name="longitudinal_section.annotations" description="facet.longitudinal_section.annotations"/>
                     </facets>
                 </outputmode>
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/conf.xml
--- a/artifacts/doc/conf/conf.xml	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/doc/conf/conf.xml	Tue Jun 11 09:40:56 2013 +0200
@@ -332,6 +332,7 @@
         <output-generator name="bed_difference_epoch_chartinfo">org.dive4elements.river.exports.minfo.BedDiffEpochInfoGenerator</output-generator>
         <output-generator name="bed_difference_height_year">org.dive4elements.river.exports.minfo.BedDiffHeightYearGenerator</output-generator>
         <output-generator name="bed_difference_height_year_chartinfo">org.dive4elements.river.exports.minfo.BedDiffHeightYearInfoGenerator</output-generator>
+        <output-generator name="bedheight_difference_export">org.dive4elements.river.exports.minfo.BedDifferenceExporter</output-generator>
         <output-generator name="sq_relation_a">org.dive4elements.river.exports.sq.SQRelationGeneratorA</output-generator>
         <output-generator name="sq_relation_b">org.dive4elements.river.exports.sq.SQRelationGeneratorB</output-generator>
         <output-generator name="sq_relation_c">org.dive4elements.river.exports.sq.SQRelationGeneratorC</output-generator>
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/jasper/beddifference.jasper
Binary file artifacts/doc/conf/jasper/beddifference.jasper has changed
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/jasper/beddifference_en.jasper
Binary file artifacts/doc/conf/jasper/beddifference_en.jasper has changed
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/jasper/sqrelation.jasper
Binary file artifacts/doc/conf/jasper/sqrelation.jasper has changed
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/jasper/sqrelation_en.jasper
Binary file artifacts/doc/conf/jasper/sqrelation_en.jasper has changed
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/mapserver/barrier_lines_class.vm
--- a/artifacts/doc/conf/mapserver/barrier_lines_class.vm	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/doc/conf/mapserver/barrier_lines_class.vm	Tue Jun 11 09:40:56 2013 +0200
@@ -30,3 +30,11 @@
         OUTLINECOLOR "#800000"
     END
 END
+CLASS
+    NAME "Ringdeich"
+    EXPRESSION ("[TYP]"="Ringdeich")
+    STYLE
+        SIZE 5
+        OUTLINECOLOR "#800000"
+    END
+END
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/mapserver/mapfile.vm
--- a/artifacts/doc/conf/mapserver/mapfile.vm	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/doc/conf/mapserver/mapfile.vm	Tue Jun 11 09:40:56 2013 +0200
@@ -14,7 +14,7 @@
     END
 
     DEBUG 5
-    CONFIG "MS_ERRORFILE" "/tmp/flys-user-wms.log"
+    CONFIG "MS_ERRORFILE" "d4e-wms.log"
 
     WEB
       METADATA
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/meta-data.xml
--- a/artifacts/doc/conf/meta-data.xml	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Tue Jun 11 09:40:56 2013 +0200
@@ -5,8 +5,12 @@
     <dc:comment>
       User specific part
       ------------------
+      This is a hack because we currently have no way to supress empty
+      folders (either in the client or in the datacage).
     </dc:comment>
-    <dc:if test="dc:contains($parameters, 'user-id') and not(dc:contains($artifact-outs, 'floodmap-hws'))">
+    <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>
 
@@ -32,7 +36,7 @@
     </dc:macro>
 
     <dc:macro name="generate-system-content">
-      <dc:call-macro name="user-range">
+      <dc:call-macro name="artifact-range">
         <dc:call-macro name="km-filtered-wsts">
           <dc:choose>
             <dc:when test="dc:contains($parameters, 'recommended')">
@@ -186,6 +190,7 @@
                     <dc:call-macro name="basedata_1_additionals"/>
                     <dc:call-macro name="basedata_2_fixations"/>
                     <dc:call-macro name="basedata_3_officials"/>
+                    <dc:call-macro name="basedata_6_delta_w"/>
                     <dc:call-macro name="annotations_per_type"/>
                     <dc:call-macro name="morph_width"/>
                   </dc:when>
@@ -242,12 +247,6 @@
                   </dc:when>
                   <dc:when test="$out = 'minfo-heights'">
                     <dc:call-macro name="minfo-heights"/>
-                    <dc:macro name="minfo-heights">
-                      <bedheights>
-                        <dc:call-macro name="bed-heights-single"/>
-                        <dc:call-macro name="bed-heights-epoch"/>
-                      </bedheights>
-                    </dc:macro>
                   </dc:when>
                   <dc:when test="$out = 'minfo-heights-epoch'">
                     <bedheights>
@@ -255,7 +254,7 @@
                     </bedheights>
                   </dc:when>
                   <dc:when test="$out = 'waterlevels'">
-                    <dc:if test="current-state-id != 'state.winfo.uesk.wsp'">
+                    <dc:if test="$current-state-id != 'state.winfo.uesk.wsp'">
                       <dc:call-macro name="basedata_0"/>
                       <dc:call-macro name="basedata_1_additionals"/>
                       <dc:call-macro name="basedata_2_fixations"/>
@@ -272,949 +271,642 @@
     </dc:macro>
 
     <dc:macro name="generate-user-content">
-      <dc:call-macro name="user-range">
-        <dc:call-macro name="km-filtered-userdata">
-          <dc:choose>
-            <dc:when test="dc:contains($parameters, 'recommended')">
-              <dc:comment>
-                Recommendations (client shall load immediately).
-              </dc:comment>
-              <dc:iterate var="out" container="artifact-outs">
-                <dc:choose>
-                  <dc:when test="$out = 'longitudinal_section'">
-                    <dc:call-macro name="officiallines_user"/>
-                  </dc:when>
-                </dc:choose>
-              </dc:iterate>
-            </dc:when>
-            <dc:otherwise>
-              <dc:comment>
-                Non Recommendations
-              </dc:comment>
-              <dc:iterate var="out" container="artifact-outs">
-                <dc:choose>
-                  <dc:when test="$out = 'longitudinal_section'">
-                    <dc:call-macro name="longitudinal"/>
-                    <dc:call-macro name="differences"/>
-                  </dc:when>
-                  <dc:when test="$out = 'discharge_longitudinal_section'">
-                    <dc:call-macro name="longitudinal"/>
-                    <dc:call-macro name="differences"/>
-                  </dc:when>
-                  <dc:when test="$out = 'w_differences'">
-                    <dc:call-macro name="longitudinal"/>
-                    <dc:call-macro name="differences"/>
-                  </dc:when>
-                  <dc:when test="$out = 'fix_deltawt_curve'">
-                    <dc:call-macro name="delta-wt"/>
-                  </dc:when>
-                  <dc:when test="$out = 'reference_curve'">
-                    <dc:call-macro name="reference-curves"/>
-                  </dc:when>
-                  <dc:when test="$out = 'computed_discharge_curve'">
-                    <dc:call-macro name="computed-discharge-curve"/>
-                  </dc:when>
-                  <dc:when test="$out = 'cross_section'">
-                    <dc:call-macro name="waterlevels"/>
-                  </dc:when>
-                  <dc:when test="$out = 'fix_longitudinal_section_curve'">
-                    <dc:call-macro name="longitudinal-section"/>
-                  </dc:when>
-                  <dc:when test="$out = 'fix_derivate_curve'">
-                    <dc:call-macro name="fix-derivate-curve"/>
-                  </dc:when>
-                  <dc:when test="$out = 'fix_wq_curve'">
-                    <dc:call-macro name="fix-wq-curve"/>
-                  </dc:when>
-                  <dc:when test="$out = 'duration_curve'">
-                    <dc:call-macro name="duration-curve"/>
-                  </dc:when>
-                  <dc:when test="$out = 'waterlevels'">
-                    <dc:call-macro name="waterlevels-fix"/>
-                  </dc:when>
-                  <dc:when test="$out = 'fix_wq_curve'">
-                    <dc:call-macro name="waterlevels-fix"/>
-                  </dc:when>
-                  <dc:when test="$out = 'floodmap'">
-                    <dc:call-macro name="flood-map"/>
-                  </dc:when>
-                  <dc:when test="$out = 'map'">
-                    <dc:call-macro name="flood-map"/>
-                  </dc:when>
-                  <dc:when test="$out = 'bedheight_middle'">
-                    <dc:call-macro name="waterlevels-discharge"/>
-                    <dc:call-macro name="waterlevels-fix"/>
-                  </dc:when>
-                  <dc:when test="$out = 'floodmap-hws'">
-                    <dc:call-macro name="floodmap-hws-user"/>
-                  </dc:when>
-                  <dc:when test="$out = 'flow_velocity'">
-                    <dc:call-macro name="bedquality-bed"/>
-                    <dc:call-macro name="bedquality-load"/>
-                  </dc:when>
-                  <dc:when test="$out = 'bed_longitudinal_section'">
-                    <dc:call-macro name="bedquality-bed"/>
-                    <dc:call-macro name="bedquality-load"/>
-                    <dc:call-macro name="bedquality-density"/>
-                    <dc:call-macro name="bedquality-porosity"/>
-                  </dc:when>
-                  <dc:when test="$out = 'sedimentload_ls'">
-                    <dc:call-macro name="differences"/>
-                    <dc:call-macro name="bedheight-differences"/>
-                    <dc:call-macro name="flow-velocity"/>
-                    <dc:call-macro name="sediment-load"/>
-                  </dc:when>
-                  <dc:when test="$out = 'bed_difference_year'">
-                    <dc:call-macro name="waterlevels-discharge"/>
-                    <dc:call-macro name="bedheight-differences"/>
-                    <dc:call-macro name="differences"/>
-                    <dc:call-macro name="waterlevels-fix"/>
-                    <dc:call-macro name="delta-wt-ls"/>
-                  </dc:when>
-                  <dc:when test="$out = 'bed_difference_epoch'">
-                    <dc:call-macro name="waterlevels-discharge"/>
-                    <dc:call-macro name="bedheight-differences"/>
-                    <dc:call-macro name="differences"/>
-                    <dc:call-macro name="waterlevels-fix"/>
-                    <dc:call-macro name="delta-wt-ls"/>
-                  </dc:when>
-                </dc:choose>
-              </dc:iterate>
-            </dc:otherwise>
-          </dc:choose>
+      <dc:call-macro name="artifact-range">
+        <dc:call-macro name="all-user-artifacts">
+          <dc:call-macro name="km-filtered-user-artifacts">
+            <dc:choose>
+              <dc:when test="dc:contains($parameters, 'recommended')">
+                <dc:comment>
+                  Recommendations (user)
+                </dc:comment>
+                <dc:iterate var="out" container="artifact-outs">
+                  <dc:choose>
+                    <dc:when test="$out = 'longitudinal_section'">
+                      <dc:call-macro name="officiallines_user"/>
+                    </dc:when>
+                  </dc:choose>
+                </dc:iterate>
+              </dc:when>
+              <dc:otherwise>
+                <dc:comment>
+                  Non Recommendations (user)
+                </dc:comment>
+                <dc:iterate var="out" container="artifact-outs">
+                  <dc:choose>
+                    <dc:when test="$out = 'longitudinal_section'">
+                      <dc:call-macro name="longitudinal"/>
+                      <dc:call-macro name="differences"/>
+                    </dc:when>
+                    <dc:when test="$out = 'discharge_longitudinal_section'">
+                      <dc:call-macro name="longitudinal"/>
+                      <dc:call-macro name="differences"/>
+                    </dc:when>
+                    <dc:when test="$out = 'w_differences'">
+                      <dc:call-macro name="longitudinal"/>
+                      <dc:call-macro name="differences"/>
+                    </dc:when>
+                    <dc:when test="$out = 'fix_deltawt_curve'">
+                      <dc:call-macro name="delta-wt"/>
+                    </dc:when>
+                    <dc:when test="$out = 'reference_curve'">
+                      <dc:call-macro name="reference-curves"/>
+                    </dc:when>
+                    <dc:when test="$out = 'computed_discharge_curve'">
+                      <dc:call-macro name="computed-discharge-curve"/>
+                    </dc:when>
+                    <dc:when test="$out = 'cross_section'">
+                      <dc:call-macro name="waterlevels"/>
+                    </dc:when>
+                    <dc:when test="$out = 'fix_longitudinal_section_curve'">
+                      <dc:call-macro name="longitudinal-section"/>
+                    </dc:when>
+                    <dc:when test="$out = 'fix_derivate_curve'">
+                      <dc:call-macro name="fix-derivate-curve"/>
+                    </dc:when>
+                    <dc:when test="$out = 'fix_wq_curve'">
+                      <dc:call-macro name="fix-wq-curve"/>
+                    </dc:when>
+                    <dc:when test="$out = 'duration_curve'">
+                      <dc:call-macro name="duration-curve"/>
+                    </dc:when>
+                    <dc:when test="$out = 'waterlevels'">
+                      <dc:call-macro name="waterlevels-fix"/>
+                    </dc:when>
+                    <dc:when test="$out = 'fix_wq_curve'">
+                      <dc:call-macro name="waterlevels-fix"/>
+                    </dc:when>
+                    <dc:when test="$out = 'floodmap'">
+                      <dc:call-macro name="flood-map"/>
+                    </dc:when>
+                    <dc:when test="$out = 'map'">
+                      <dc:call-macro name="flood-map"/>
+                    </dc:when>
+                    <dc:when test="$out = 'bedheight_middle'">
+                      <dc:call-macro name="waterlevels-discharge"/>
+                      <dc:call-macro name="waterlevels-fix"/>
+                    </dc:when>
+                    <dc:when test="$out = 'floodmap-hws'">
+                      <dc:call-macro name="floodmap-hws-user"/>
+                    </dc:when>
+                    <dc:when test="$out = 'flow_velocity'">
+                      <dc:call-macro name="bedquality-bed"/>
+                      <dc:call-macro name="bedquality-load"/>
+                    </dc:when>
+                    <dc:when test="$out = 'bed_longitudinal_section'">
+                      <dc:call-macro name="bedquality-bed"/>
+                      <dc:call-macro name="bedquality-load"/>
+                      <dc:call-macro name="bedquality-density"/>
+                      <dc:call-macro name="bedquality-porosity"/>
+                    </dc:when>
+                    <dc:when test="$out = 'sedimentload_ls'">
+                      <dc:call-macro name="differences"/>
+                      <dc:call-macro name="bedheight-differences"/>
+                      <dc:call-macro name="flow-velocity"/>
+                      <dc:call-macro name="sediment-load"/>
+                    </dc:when>
+                    <dc:when test="$out = 'bed_difference_year'">
+                      <dc:call-macro name="waterlevels-discharge"/>
+                      <dc:call-macro name="bedheight-differences"/>
+                      <dc:call-macro name="differences"/>
+                      <dc:call-macro name="waterlevels-fix"/>
+                      <dc:call-macro name="delta-wt-ls"/>
+                    </dc:when>
+                    <dc:when test="$out = 'bed_difference_epoch'">
+                      <dc:call-macro name="waterlevels-discharge"/>
+                      <dc:call-macro name="bedheight-differences"/>
+                      <dc:call-macro name="differences"/>
+                      <dc:call-macro name="waterlevels-fix"/>
+                      <dc:call-macro name="delta-wt-ls"/>
+                    </dc:when>
+                  </dc:choose>
+                </dc:iterate>
+              </dc:otherwise>
+            </dc:choose>
+          </dc:call-macro>
         </dc:call-macro>
       </dc:call-macro>
     </dc:macro>
 
     <!-- Macros to load user data -->
 
-    <dc:macro name="select-facets">
-      <dc:context>
-        <dc:statement>
-          SELECT a.gid         AS aid,
-                 f.id          AS fid,
-                 f.name        AS facet_name,
-                 f.num         AS facet_num,
-                 f.description AS facet_description
-          FROM artifacts a
-            JOIN outs o   ON o.artifact_id = a.id
-            JOIN facets f ON f.out_id = o.id
-          WHERE a.id = ${a_id}
-            AND f.name = ${facet_type}
-        </dc:statement>
+    <dc:macro name="differences">
+      <dc:filter expr="$facet_name = 'w_differences'">
         <dc:if test="dc:has-result()">
-          <dc:macro-body/>
+          <differences>
+            <dc:for-each>
+              <w_differences
+                description="{$facet_description}"
+                factory="winfo" target_out="{$out}"
+                artifact-id="{$aid}"
+                ids="{$aid}"
+                out="w_differences"/>
+            </dc:for-each>
+          </differences>
         </dc:if>
-      </dc:context>
-    </dc:macro>
-
-    <dc:macro name="differences">
-      <dc:variable name="facet_type" value="w_differences"/>
-      <dc:call-macro name="select-facets">
-        <differences>
-          <dc:for-each>
-            <w_differences
-              description="{$facet_description}"
-              factory="winfo"
-              artifact-id="{$aid}"
-              ids="{$aid}"
-              out="w_differences"/>
-          </dc:for-each>
-        </differences>
-      </dc:call-macro>
+      </dc:filter>
     </dc:macro>
 
     <dc:macro name="reference-curves">
-      <dc:variable name="facet_type" value="reference_curve"/>
-      <dc:call-macro name="select-facets">
-        <reference_curves>
-          <dc:for-each>
-            <dc:element name="${facet_name}">
-              <dc:attribute name="description" value="${facet_description}"/>
-              <dc:attribute name="factory" value="winfo"/>
-              <dc:attribute name="artifact-id" value="${aid}"/>
-              <dc:attribute name="ids" value="${aid}"/>
-              <dc:attribute name="out" value="reference_curve"/>
-            </dc:element>
-          </dc:for-each>
-        </reference_curves>
-      </dc:call-macro>
+      <dc:filter expr="$facet_name = 'reference_curve'">
+        <dc:if test="dc:has-result()">
+          <reference_curves>
+            <dc:for-each>
+              <dc:element name="${facet_name}">
+                <dc:attribute name="description" value="${facet_description}"/>
+                <dc:attribute name="factory" value="winfo"/>
+                <dc:attribute name="target_out" value="${out}"/>
+                <dc:attribute name="artifact-id" value="${a_id}"/>
+                <dc:attribute name="ids" value="${a_id}"/>
+                <dc:attribute name="out" value="reference_curve"/>
+              </dc:element>
+            </dc:for-each>
+          </reference_curves>
+        </dc:if>
+      </dc:filter>
     </dc:macro>
 
     <dc:macro name="computed-discharge-curve">
-      <dc:variable name="facet_type" value="computed_discharge_curve.q"/>
-      <dc:call-macro name="select-facets">
-        <computed_discharge_curves>
-          <dc:for-each>
-            <dc:element name="${facet_name}">
-              <dc:attribute name="description" value="${facet_description}"/>
-              <dc:attribute name="factory" value="winfo"/>
-              <dc:attribute name="artifact-id" value="${aid}"/>
-              <dc:attribute name="ids" value="${aid}"/>
-              <dc:attribute name="out" value="computed_discharge_curve"/>
-            </dc:element>
-          </dc:for-each>
-        </computed_discharge_curves>
-      </dc:call-macro>
-    </dc:macro>
-
-    <dc:macro name="flood-map">
-      <dc:variable name="facet_type" value="floodmap.wsplgen"/>
-      <dc:call-macro name="select-facets">
-        <floodmap>
-          <dc:for-each>
-            <dc:element name="${facet_name}">
-              <dc:attribute name="description" value="${facet_description}"/>
-              <dc:attribute name="factory" value="winfo"/>
-              <dc:attribute name="artifact-id" value="${aid}"/>
-              <dc:attribute name="ids" value="${aid}"/>
-              <dc:attribute name="out" value="floodmap"/>
-            </dc:element>
-          </dc:for-each>
-        </floodmap>
-      </dc:call-macro>
-    </dc:macro>
-
-    <dc:macro name="waterlevels">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS out_id
-          FROM outs
-          WHERE artifact_id = ${a_id} AND name = 'cross_section'
-        </dc:statement>
-        <dc:if test="dc:has-result()">
-          <waterlevels>
-            <dc:for-each>
-              <dc:context>
-                <dc:statement>
-                  SELECT name AS facet_name, num AS facet_num, description AS facet_description
-                    FROM facets
-                  WHERE out_id = ${out_id}
-                    ORDER BY num ASC, name DESC
-                </dc:statement>
-                <longitudinal_section_columns description="{$river} {$a_creation}">
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}"/>
-                      <dc:attribute name="factory" value="winfo"/>
-                      <dc:attribute name="artifact-id" value="${a_gid}"/>
-                      <dc:attribute name="out" value="cross_section"/>
-                    </dc:element>
-                  </dc:for-each>
-                </longitudinal_section_columns>
-              </dc:context>
-            </dc:for-each>
-          </waterlevels>
-        </dc:if>
-      </dc:context>
-    </dc:macro>
-
-    <dc:macro name="longitudinal">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS out_id
-          FROM outs
-          WHERE artifact_id = ${a_id}
-            AND name = 'longitudinal_section'
-        </dc:statement>
-        <dc:if test="dc:has-result()">
-          <waterlevels>
-            <dc:for-each>
-              <dc:context>
-                <dc:statement>
-                  SELECT name        AS facet_name,
-                         num         AS facet_num,
-                         description AS facet_description
-                  FROM facets
-                  WHERE out_id = ${out_id}
-                    ORDER BY num ASC, name DESC
-                </dc:statement>
-                <longitudinal_section_columns description="{$river} {$a_creation}">
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}"/>
-                      <dc:attribute name="factory" value="winfo"/>
-                      <dc:attribute name="artifact-id" value="${a_gid}"/>
-                      <dc:attribute name="out" value="longitudinal_section"/>
-                    </dc:element>
-                  </dc:for-each>
-                </longitudinal_section_columns>
-              </dc:context>
-            </dc:for-each>
-          </waterlevels>
-        </dc:if>
-      </dc:context>
-    </dc:macro>
-
-    <dc:macro name="longitudinal-section">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS out_id
-          FROM outs
-          WHERE artifact_id = ${a_id}
-            AND name = 'fix_longitudinal_section_curve'
-        </dc:statement>
-        <dc:if test="dc:has-result()">
-          <waterlevels>
-            <dc:for-each>
-              <dc:context>
-                <dc:statement>
-                  SELECT name        AS facet_name,
-                         num         AS facet_num,
-                         description AS facet_description
-                  FROM facets
-                  WHERE out_id = ${out_id} AND (
-                      name LIKE 'fix_deviation_ls%'       OR
-                      name LIKE 'fix_sector_average_ls%'  OR
-                      name LIKE 'fix_analysis_events_ls%' OR
-                      name LIKE 'fix_reference_events_ls%')
-                  ORDER BY num ASC, name DESC
-                </dc:statement>
-                <waterlevels description="{$river} {$a_creation} {$collection_name}">
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}"/>
-                      <dc:attribute name="factory" value="fixanalysis"/>
-                      <dc:attribute name="artifact-id" value="${a_gid}"/>
-                      <dc:attribute name="out" value="fix_longitudinal_section_curve"/>
-                    </dc:element>
-                  </dc:for-each>
-                </waterlevels>
-              </dc:context>
-            </dc:for-each>
-          </waterlevels>
-        </dc:if>
-      </dc:context>
-    </dc:macro>
-
-    <dc:macro name="delta-wt">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS out_id
-          FROM outs
-          WHERE artifact_id = ${a_id}
-            AND name = 'fix_deltawt_curve'
-        </dc:statement>
-        <dc:if test="dc:has-result()">
-          <waterlevels>
-            <dc:for-each>
-              <dc:context>
-                <dc:statement>
-                  SELECT name        AS facet_name,
-                         num         AS facet_num,
-                         description AS facet_description
-                  FROM facets
-                  WHERE out_id = ${out_id} and (
-                    name LIKE 'fix_sector_average_dwt%' OR
-                    name LIKE 'fix_deviation_dwt%'      OR
-                    name = 'fix_analysis_events_dwt'    OR
-                    name = 'fix_reference_events_dwt'   OR
-                    name = 'fix_analysis_periods_dwt')
-                  ORDER BY num ASC, name DESC
-                </dc:statement>
-                <waterlevels description="{$river} {$a_creation} {$collection_name}">
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}"/>
-                      <dc:attribute name="factory" value="fixanalysis"/>
-                      <dc:attribute name="artifact-id" value="${a_gid}"/>
-                      <dc:attribute name="out" value="fix_deltawt_curve"/>
-                    </dc:element>
-                  </dc:for-each>
-                </waterlevels>
-              </dc:context>
-            </dc:for-each>
-          </waterlevels>
-        </dc:if>
-      </dc:context>
-    </dc:macro>
-
-    <dc:macro name="delta-wt-ls">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS out_id
-          FROM outs
-          WHERE artifact_id = ${a_id} AND name = 'fix_deltawt_curve'
-        </dc:statement>
-        <dc:if test="dc:has-result()">
-          <waterlevels>
-            <dc:for-each>
-              <dc:context>
-                <dc:statement>
-                  SELECT name AS facet_name, num AS facet_num, description AS facet_description
-                  FROM facets
-                  WHERE out_id = ${out_id} and (
-                    name LIKE 'fix_sector_average_dwt%' OR
-                    name LIKE 'fix_deviation_dwt%')
-                  ORDER BY num ASC, name DESC
-                </dc:statement>
-                <waterlevels description="{$river} {$a_creation} {$collection_name}">
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}"/>
-                      <dc:attribute name="factory" value="fixanalysis"/>
-                      <dc:attribute name="artifact-id" value="${a_gid}"/>
-                      <dc:attribute name="out" value="fix_deltawt_curve"/>
-                    </dc:element>
-                  </dc:for-each>
-                </waterlevels>
-              </dc:context>
-            </dc:for-each>
-          </waterlevels>
-        </dc:if>
-      </dc:context>
-    </dc:macro>
-
-    <dc:macro name="fix-derivate-curve">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS out_id
-          FROM outs
-          WHERE artifact_id = ${a_id} AND name = 'fix_derivate_curve'
-        </dc:statement>
-        <dc:if test="dc:has-result()">
-          <waterlevels>
-            <dc:for-each>
-              <dc:context>
-                <dc:statement>
-                  SELECT name AS facet_name, num AS facet_num, description AS facet_description
-                  FROM facets
-                  WHERE out_id = ${out_id} and name = 'fix_derivate_curve'
-                  ORDER BY num ASC, name DESC
-                </dc:statement>
-                <waterlevels description="{$river} {$a_creation} {$collection_name}">
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}"/>
-                      <dc:attribute name="factory" value="fixanalysis"/>
-                      <dc:attribute name="artifact-id" value="${a_gid}"/>
-                      <dc:attribute name="out" value="fix_derivate_curve"/>
-                    </dc:element>
-                  </dc:for-each>
-                </waterlevels>
-              </dc:context>
-            </dc:for-each>
-          </waterlevels>
-        </dc:if>
-      </dc:context>
-    </dc:macro>
-
-    <dc:macro name="fix-wq-curve">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS out_id
-          FROM outs
-          WHERE artifact_id = ${a_id} AND name = 'fix_wq_curve'
-        </dc:statement>
-        <dc:if test="dc:has-result()">
-          <waterlevels>
-            <dc:for-each>
-              <dc:context>
-                <dc:statement>
-                  SELECT name AS facet_name, num AS facet_num, description AS facet_description
-                  FROM facets
-                  WHERE out_id = ${out_id} and (
-                    name LIKE 'fix_sector_average_wq%'  OR
-                    name = 'fix_wq_curve'               OR
-                    name LIKE 'fix_analysis_events_wq%' OR
-                    name LIKE 'fix_reference_events_wq%' )
-                  ORDER BY num ASC, name DESC
-                </dc:statement>
-                <waterlevels description="{$river} {$a_creation} {$collection_name}">
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}"/>
-                      <dc:attribute name="factory" value="fixanalysis"/>
-                      <dc:attribute name="artifact-id" value="${a_gid}"/>
-                      <dc:attribute name="out" value="fix_wq_curve"/>
-                    </dc:element>
-                  </dc:for-each>
-                </waterlevels>
-              </dc:context>
-            </dc:for-each>
-          </waterlevels>
-        </dc:if>
-      </dc:context>
-    </dc:macro>
-
-    <dc:macro name="duration-curve">
-      <dc:context>
-        <dc:statement>
-          SELECT a.gid         AS aid,
-                 f.id          AS fid,
-                 f.name        AS facet_name,
-                 f.num         AS facet_num,
-                 f.description AS facet_description
-          FROM outs AS o, facets AS f, artifacts AS a
-          WHERE
-              (f.name = 'duration_curve.q' OR f.name = 'duration_curve.w') AND
-              f.out_id = o.id         AND
-              o.artifact_id = ${a_id} AND
-              a.id = ${a_id}
-        </dc:statement>
+      <dc:filter expr="$facet_name = 'computed_discharge_curve.q'">
         <dc:if test="dc:has-result()">
           <computed_discharge_curves>
             <dc:for-each>
               <dc:element name="${facet_name}">
                 <dc:attribute name="description" value="${facet_description}"/>
                 <dc:attribute name="factory" value="winfo"/>
-                <dc:attribute name="artifact-id" value="${aid}"/>
-                <dc:attribute name="ids" value="${aid}"/>
+                <dc:attribute name="target_out" value="${out}"/>
+                <dc:attribute name="artifact-id" value="${a_id}"/>
+                <dc:attribute name="ids" value="${a_id}"/>
+                <dc:attribute name="out" value="computed_discharge_curve"/>
+              </dc:element>
+            </dc:for-each>
+          </computed_discharge_curves>
+        </dc:if>
+      </dc:filter>
+    </dc:macro>
+
+    <dc:macro name="flood-map">
+      <dc:filter expr="$facet_name = 'floodmap.wsplgen'">
+        <dc:if test="dc:has-result()">
+          <floodmap>
+            <dc:for-each>
+              <dc:variable name="combined_desc" expr="concat($facet_description, ' ', $a_creation, ' ', $collection_name)"/>
+              <dc:element name="${facet_name}">
+                <dc:attribute name="description" value="${combined_desc}"/>
+                <dc:attribute name="factory" value="winfo"/>
+                <dc:attribute name="target_out" value="${out}"/>
+                <dc:attribute name="artifact-id" value="${a_id}"/>
+                <dc:attribute name="ids" value="${a_id}"/>
+                <dc:attribute name="out" value="floodmap"/>
+              </dc:element>
+            </dc:for-each>
+          </floodmap>
+        </dc:if>
+      </dc:filter>
+    </dc:macro>
+
+    <dc:macro name="waterlevels">
+      <dc:filter expr="$out_name = 'cross_section'">
+        <dc:if test="dc:has-result()">
+          <waterlevels>
+            <dc:group expr="concat($river, ' ', $a_creation)">
+              <dc:comment>Aheinecke: Why is this grouping different from the rest?</dc:comment>
+              <longitudinal_section_columns description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}"/>
+                    <dc:attribute name="factory" value="winfo"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="artifact-id" value="${a_gid}"/>
+                    <dc:attribute name="out" value="cross_section"/>
+                  </dc:element>
+                </dc:for-each>
+              </longitudinal_section_columns>
+            </dc:group>
+          </waterlevels>
+        </dc:if>
+      </dc:filter>
+    </dc:macro>
+
+    <dc:macro name="longitudinal">
+      <dc:filter expr="$out_name = 'longitudinal_section'">
+        <dc:if test="dc:has-result()">
+          <waterlevels>
+            <dc:group expr="concat($river, ' ', $a_creation)">
+              <dc:comment>Aheinecke: Why is this grouping different from the rest?</dc:comment>
+              <longitudinal_section_columns description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}"/>
+                    <dc:attribute name="factory" value="winfo"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="artifact-id" value="${a_gid}"/>
+                    <dc:attribute name="out" value="longitudinal_section"/>
+                  </dc:element>
+                </dc:for-each>
+              </longitudinal_section_columns>
+            </dc:group>
+          </waterlevels>
+        </dc:if>
+      </dc:filter>
+    </dc:macro>
+
+    <dc:macro name="longitudinal-section">
+      <dc:filter expr="$out_name = 'fix_longitudinal_section_curve' and
+        (starts-with($facet_name, 'fix_deviation_ls') or
+        starts-with($facet_name, 'fix_sector_average_ls') or
+        starts-with($facet_name, 'fix_analysis_events_ls') or
+        starts-with($facet_name, 'fix_reference_events_ls'))">
+        <dc:if test="dc:has-result()">
+          <waterlevels>
+            <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
+              <waterlevels description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}"/>
+                    <dc:attribute name="factory" value="fixanalysis"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="artifact-id" value="${a_gid}"/>
+                    <dc:attribute name="out" value="fix_longitudinal_section_curve"/>
+                  </dc:element>
+                </dc:for-each>
+              </waterlevels>
+            </dc:group>
+          </waterlevels>
+        </dc:if>
+      </dc:filter>
+    </dc:macro>
+
+    <dc:macro name="delta-wt">
+      <dc:filter expr="$out_name = 'fix_deltawt_curve' and
+        ($facet_name = 'fix_analysis_events_dwt' or
+        $facet_name = 'fix_analysis_periods_dwt' or
+        $facet_name = 'fix_reference_events_dwt' or
+        starts-with($facet_name, 'fix_deviation_dwt') or
+        starts-with($facet_name, 'fix_sector_average_dwt'))">
+        <dc:if test="dc:has-result()">
+          <waterlevels>
+            <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
+              <waterlevels description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}"/>
+                    <dc:attribute name="factory" value="fixanalysis"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="artifact-id" value="${a_gid}"/>
+                    <dc:attribute name="out" value="fix_deltawt_curve"/>
+                  </dc:element>
+                </dc:for-each>
+              </waterlevels>
+            </dc:group>
+          </waterlevels>
+        </dc:if>
+      </dc:filter>
+    </dc:macro>
+
+    <dc:macro name="delta-wt-ls">
+      <dc:filter expr="$out_name = 'fix_deltawt_curve' and
+        (starts-with($facet_name, 'fix_sector_average_dwt') or
+        starts-with($facet_name, 'fix_deviation_dwt'))">
+        <dc:if test="dc:has-result()">
+          <waterlevels>
+            <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
+              <waterlevels description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}"/>
+                    <dc:attribute name="factory" value="fixanalysis"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="artifact-id" value="${a_gid}"/>
+                    <dc:attribute name="out" value="fix_deltawt_curve"/>
+                  </dc:element>
+                </dc:for-each>
+              </waterlevels>
+            </dc:group>
+          </waterlevels>
+        </dc:if>
+      </dc:filter>
+    </dc:macro>
+
+    <dc:macro name="fix-derivate-curve">
+      <dc:filter expr="$out_name = 'fix_derivate_curve' and $facet_name = 'fix_derivate_curve'">
+        <dc:if test="dc:has-result()">
+          <waterlevels>
+            <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
+              <waterlevels description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}"/>
+                    <dc:attribute name="factory" value="fixanalysis"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="artifact-id" value="${a_gid}"/>
+                    <dc:attribute name="out" value="fix_derivate_curve"/>
+                  </dc:element>
+                </dc:for-each>
+              </waterlevels>
+            </dc:group>
+          </waterlevels>
+        </dc:if>
+      </dc:filter>
+    </dc:macro>
+
+    <dc:macro name="fix-wq-curve">
+      <dc:filter expr="$out_name = 'fix_wq_curve' and
+        (starts-with($facet_name, 'fix_analysis_events_wq') or
+        starts-with($facet_name, 'fix_reference_events_wq') or
+        starts-with($facet_name, 'fix_sector_average_wq') or
+        $facet_name = 'fix_wq_curve')">
+        <dc:if test="dc:has-result()">
+          <waterlevels>
+            <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
+              <waterlevels description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}"/>
+                    <dc:attribute name="factory" value="fixanalysis"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="artifact-id" value="${a_gid}"/>
+                    <dc:attribute name="out" value="fix_wq_curve"/>
+                  </dc:element>
+                </dc:for-each>
+              </waterlevels>
+            </dc:group>
+          </waterlevels>
+        </dc:if>
+      </dc:filter>
+    </dc:macro>
+
+    <dc:macro name="duration-curve">
+      <dc:filter expr="$facet_name = 'duration_curve.q' or $facet_name = 'duration_curve.w'">
+        <dc:if test="dc:has-result()">
+          <computed_discharge_curves>
+            <dc:for-each>
+              <dc:element name="${facet_name}">
+                <dc:attribute name="description" value="${facet_description}"/>
+                <dc:attribute name="factory" value="winfo"/>
+                <dc:attribute name="target_out" value="${out}"/>
+                <dc:attribute name="artifact-id" value="${a_id}"/>
+                <dc:attribute name="ids" value="${a_id}"/>
                 <dc:attribute name="out" value="duration_curve"/>
               </dc:element>
             </dc:for-each>
           </computed_discharge_curves>
         </dc:if>
-      </dc:context>
+      </dc:filter>
     </dc:macro>
 
-    <dc:comment>TODO doesnt work nicely for fix/wq-diags.</dc:comment>
+    <dc:comment>TODO doesnt work nicely for fix/wq-diags. Aheinecke (27.5.2013): Why?</dc:comment>
     <dc:macro name="waterlevels-fix">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS out_id
-          FROM outs
-          WHERE artifact_id = ${a_id} AND name = 'longitudinal_section'
-        </dc:statement>
+      <dc:filter expr="$out_name = 'longitudinal_section' and $facet_name = 'longitudinal_section.w'">
         <dc:if test="dc:has-result()">
           <waterlevels>
-            <dc:for-each>
-              <dc:context>
-                <dc:statement>
-                  SELECT name AS facet_name, num AS facet_num, description AS facet_description
-                  FROM facets
-                  WHERE out_id = ${out_id} and name = 'longitudinal_section.w'
-                  ORDER BY num ASC, name DESC
-                </dc:statement>
-                <waterlevels description="{$river} {$a_creation} {$collection_name}">
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}"/>
-                      <dc:attribute name="factory" value="winfo"/>
-                      <dc:attribute name="artifact-id" value="${a_gid}"/>
-                      <dc:attribute name="out" value="longitudinal_section"/>
-                    </dc:element>
-                  </dc:for-each>
-                </waterlevels>
-              </dc:context>
-            </dc:for-each>
+            <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
+              <waterlevels description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}"/>
+                    <dc:attribute name="factory" value="winfo"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="artifact-id" value="${a_gid}"/>
+                    <dc:attribute name="out" value="longitudinal_section"/>
+                  </dc:element>
+                </dc:for-each>
+              </waterlevels>
+            </dc:group>
           </waterlevels>
         </dc:if>
-      </dc:context>
+      </dc:filter>
     </dc:macro>
 
     <dc:macro name="floodmap-hws-user">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS out_id
-          FROM outs
-          WHERE artifact_id = ${a_id} AND name = 'floodmap'
-        </dc:statement>
-        <dc:for-each>
-          <dc:context>
-            <dc:statement>
-              SELECT name        AS facet_name,
-                     num         AS facet_num,
-                     description AS facet_description
-              FROM facets
-              WHERE out_id = ${out_id} AND name = 'floodmap.usershape'
-              ORDER BY num ASC, name DESC
-            </dc:statement>
-            <own-hws>
-              <dc:for-each>
-                <dc:element name="${facet_name}">
-                  <dc:attribute name="description" value="${facet_description}"/>
-                  <dc:attribute name="ids" value="${facet_num}"/>
-                  <dc:attribute name="factory" value="winfo"/>
-                  <dc:attribute name="artifact-id" value="${a_gid}"/>
-                  <dc:attribute name="out" value="floodmap"/>
-                </dc:element>
-              </dc:for-each>
-            </own-hws>
-          </dc:context>
-        </dc:for-each>
-      </dc:context>
+      <dc:comment>No grouping in this?</dc:comment>
+      <dc:filter expr="$out_name = 'floodmap' and $facet_name = 'floodmap.usershape'">
+        <own-hws>
+          <dc:for-each>
+            <dc:element name="${facet_name}">
+              <dc:attribute name="description" value="${facet_description}"/>
+              <dc:attribute name="ids" value="${facet_num}"/>
+              <dc:attribute name="factory" value="winfo"/>
+              <dc:attribute name="target_out" value="${out}"/>
+              <dc:attribute name="artifact-id" value="${a_gid}"/>
+              <dc:attribute name="out" value="floodmap"/>
+            </dc:element>
+          </dc:for-each>
+        </own-hws>
+      </dc:filter>
     </dc:macro>
 
     <dc:macro name="bedquality-bed">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS oid
-          FROM outs AS o
-          WHERE
-            o.artifact_id = ${a_id} AND
-            o.name='bed_longitudinal_section'
-        </dc:statement>
+      <dc:filter expr="$out_name = 'bed_longitudinal_section' and
+        ($facet_name = 'bed_longitudinal_section.bed_diameter_toplayer' or
+        $facet_name = 'bed_longitudinal_section.bed_diameter_sublayer')">
         <dc:if test="dc:has-result()">
           <bed_quality_bed>
-            <dc:for-each>
-              <quality-bed description="{$river} {$a_creation} {$collection_name}">
-                <dc:context>
-                  <dc:statement>
-                    SELECT a.gid         AS aid,
-                           f.id          AS fid,
-                           f.name        AS facet_name,
-                           f.num         AS facet_num,
-                           f.description AS facet_description
-                    FROM outs AS o, facets AS f, artifacts AS a
-                    WHERE
-                      (f.name = 'bed_longitudinal_section.bed_diameter_toplayer'
-                       OR f.name = 'bed_longitudinal_section.bed_diameter_sublayer') AND
-                       f.out_id = o.id         AND
-                       o.artifact_id = ${a_id} AND
-                       a.id = ${a_id}
-                  </dc:statement>
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="factory" value="minfo"/>
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
-                      <dc:attribute name="artifact-id" value="${aid}"/>
-                      <dc:attribute name="out" value="bed_longitudinal_section"/>
-                    </dc:element>
-                  </dc:for-each>
-                </dc:context>
+            <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
+              <quality-bed description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="factory" value="minfo"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                    <dc:attribute name="artifact-id" value="${a_id}"/>
+                    <dc:attribute name="out" value="bed_longitudinal_section"/>
+                  </dc:element>
+                </dc:for-each>
               </quality-bed>
-            </dc:for-each>
+            </dc:group>
           </bed_quality_bed>
         </dc:if>
-      </dc:context>
+      </dc:filter>
     </dc:macro>
 
     <dc:macro name="bedquality-load">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS oid
-          FROM outs AS o
-          WHERE
-            o.artifact_id = ${a_id} AND
-            o.name='bed_longitudinal_section'
-        </dc:statement>
+      <dc:filter expr="$out_name = 'bed_longitudinal_section' and
+        $facet_name = 'bed_longitudinal_section.bedload_diameter'">
         <dc:if test="dc:has-result()">
           <bed_quality_load>
-            <dc:for-each>
-              <quality-load description="{$river} {$a_creation} {$collection_name}">
-                <dc:context>
-                  <dc:statement>
-                    SELECT a.gid         AS aid,
-                           f.id          AS fid,
-                           f.name        AS facet_name,
-                           f.num         AS facet_num,
-                           f.description AS facet_description
-                    FROM outs AS o, facets AS f, artifacts AS a
-                    WHERE
-                       f.name = 'bed_longitudinal_section.bedload_diameter' AND
-                       f.out_id = o.id         AND
-                       o.artifact_id = ${a_id} AND
-                       a.id = ${a_id}
-                  </dc:statement>
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="factory" value="minfo"/>
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
-                      <dc:attribute name="artifact-id" value="${aid}"/>
-                      <dc:attribute name="out" value="bed_longitudinal_section"/>
-                    </dc:element>
-                  </dc:for-each>
-                </dc:context>
+            <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
+              <quality-load description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="factory" value="minfo"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                    <dc:attribute name="artifact-id" value="${a_id}"/>
+                    <dc:attribute name="out" value="bed_longitudinal_section"/>
+                  </dc:element>
+                </dc:for-each>
               </quality-load>
-            </dc:for-each>
+            </dc:group>
           </bed_quality_load>
         </dc:if>
-      </dc:context>
+      </dc:filter>
     </dc:macro>
 
     <dc:macro name="bedquality-density">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS oid
-          FROM outs AS o
-          WHERE
-            o.artifact_id = ${a_id} AND
-            o.name='bed_longitudinal_section'
-        </dc:statement>
+      <dc:filter expr="$out_name = 'bed_longitudinal_section' and
+        ($facet_name = 'bed_longitudinal_section.sediment_density_toplayer' or
+         $facet_name = 'bed_longitudinal_section.sediment_density_sublayer')">
         <dc:if test="dc:has-result()">
           <bed_quality_density>
-            <dc:for-each>
-              <density description="{$river} {$a_creation} {$collection_name}">
-                <dc:context>
-                  <dc:statement>
-                    SELECT a.gid         AS aid,
-                           f.id          AS fid,
-                           f.name        AS facet_name,
-                           f.num         AS facet_num,
-                           f.description AS facet_description
-                    FROM outs AS o, facets AS f, artifacts AS a
-                    WHERE
-                       (f.name = 'bed_longitudinal_section.sediment_density_toplayer' OR
-                        f.name = 'bed_longitudinal_section.sediment_density_sublayer') AND
-                       f.out_id = o.id         AND
-                       o.artifact_id = ${a_id} AND
-                       a.id = ${a_id}
-                  </dc:statement>
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="factory" value="minfo"/>
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
-                      <dc:attribute name="artifact-id" value="${aid}"/>
-                      <dc:attribute name="out" value="bed_longitudinal_section"/>
-                    </dc:element>
-                  </dc:for-each>
-                </dc:context>
+            <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
+              <density description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="factory" value="minfo"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                    <dc:attribute name="artifact-id" value="${a_id}"/>
+                    <dc:attribute name="out" value="bed_longitudinal_section"/>
+                  </dc:element>
+                </dc:for-each>
               </density>
-            </dc:for-each>
+            </dc:group>
           </bed_quality_density>
         </dc:if>
-      </dc:context>
+      </dc:filter>
     </dc:macro>
 
     <dc:macro name="bedquality-porosity">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS oid
-          FROM outs AS o
-          WHERE
-            o.artifact_id = ${a_id} AND
-            o.name='bed_longitudinal_section'
-        </dc:statement>
+      <dc:filter expr="$out_name = 'bed_longitudinal_section' and
+        ($facet_name = 'bed_longitudinal_section.porosity_toplayer' or
+        $facet_name = 'bed_longitudinal_section.porosity_sublayer')">
         <dc:if test="dc:has-result()">
           <bed_quality_porosity>
-            <dc:for-each>
-              <porosity description="{$river} {$a_creation} {$collection_name}">
-                <dc:context>
-                  <dc:statement>
-                    SELECT a.gid         AS aid,
-                           f.id          AS fid,
-                           f.name        AS facet_name,
-                           f.num         AS facet_num,
-                           f.description AS facet_description
-                    FROM outs AS o, facets AS f, artifacts AS a
-                    WHERE
-                       (f.name = 'bed_longitudinal_section.porosity_toplayer' OR
-                        f.name = 'bed_longitudinal_section.porosity_sublayer') AND
-                       f.out_id = o.id         AND
-                       o.artifact_id = ${a_id} AND
-                       a.id = ${a_id}
-                  </dc:statement>
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="factory" value="minfo"/>
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
-                      <dc:attribute name="artifact-id" value="${aid}"/>
-                      <dc:attribute name="out" value="bed_longitudinal_section"/>
-                    </dc:element>
-                  </dc:for-each>
-                </dc:context>
+            <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
+              <porosity description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="factory" value="minfo"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                    <dc:attribute name="artifact-id" value="${a_id}"/>
+                    <dc:attribute name="out" value="bed_longitudinal_section"/>
+                  </dc:element>
+                </dc:for-each>
               </porosity>
-            </dc:for-each>
+            </dc:group>
           </bed_quality_porosity>
         </dc:if>
-      </dc:context>
+      </dc:filter>
     </dc:macro>
 
     <dc:macro name="flow-velocity">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS oid
-          FROM outs AS o
-          WHERE
-            o.artifact_id = ${a_id} and o.name='flow_velocity'
-        </dc:statement>
+      <dc:filter expr="$out_name = 'flow_velocity' and
+        ($facet_name = 'flow_velocity.totalchannel' or
+         $facet_name = 'flow_velocity.mainchannel' or
+         $facet_name = 'flow_velocity.totalchannel.filtered' or
+         $facet_name = 'flow_velocity.mainchannel.filtered')">
         <dc:if test="dc:has-result()">
           <flow-velocity>
-            <dc:for-each>
-              <flow description="{$river} {$a_creation} {$collection_name}">
-                <dc:context>
-                  <dc:statement>
-                    SELECT a.gid         AS aid,
-                           f.id          AS fid,
-                           f.name        AS facet_name,
-                           f.num         AS facet_num,
-                           f.description AS facet_description
-                    FROM outs AS o, facets AS f, artifacts AS a
-                    WHERE
-                      (f.name = 'flow_velocity.totalchannel' OR
-                       f.name = 'flow_velocity.mainchannel' OR
-                       f.name = 'flow_velocity.totalchannel.filtered' OR
-                       f.name = 'flow_velocity.mainchannel.filtered') AND
-                       f.out_id = o.id         AND
-                       o.artifact_id = ${a_id} AND
-                       a.id = ${a_id}
-                  </dc:statement>
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="factory" value="minfo"/>
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
-                      <dc:attribute name="artifact-id" value="${aid}"/>
-                      <dc:attribute name="out" value="flow_velocity"/>
-                    </dc:element>
-                  </dc:for-each>
-                </dc:context>
+            <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
+              <flow description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="factory" value="minfo"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                    <dc:attribute name="artifact-id" value="${a_id}"/>
+                    <dc:attribute name="out" value="flow_velocity"/>
+                  </dc:element>
+                </dc:for-each>
               </flow>
-            </dc:for-each>
+            </dc:group>
           </flow-velocity>
         </dc:if>
-      </dc:context>
+      </dc:filter>
     </dc:macro>
 
     <dc:macro name="sediment-load">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS oid
-          FROM outs AS o
-          WHERE
-            o.artifact_id = ${a_id} and o.name='sedimentload_ls'
-        </dc:statement>
+      <dc:filter expr="$out_name = 'sedimentload_ls' and starts-with($facet_name, 'sedimentload')">
         <dc:if test="dc:has-result()">
           <sediment-load>
-            <dc:for-each>
-              <load description="{$river} {$a_creation} {$collection_name}">
-                <dc:context>
-                  <dc:statement>
-                    SELECT a.gid         AS aid,
-                           f.id          AS fid,
-                           f.name        AS facet_name,
-                           f.num         AS facet_num,
-                           f.description AS facet_description
-                    FROM outs AS o, facets AS f, artifacts AS a
-                    WHERE f.name LIKE 'sedimentload%' AND
-                          f.out_id = o.id         AND
-                          o.artifact_id = ${a_id} AND
-                          a.id = ${a_id}
-                  </dc:statement>
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="factory" value="minfo"/>
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
-                      <dc:attribute name="artifact-id" value="${aid}"/>
-                      <dc:attribute name="out" value="sedimentload_ls"/>
-                    </dc:element>
-                  </dc:for-each>
-                </dc:context>
+            <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
+              <load description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="factory" value="minfo"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                    <dc:attribute name="artifact-id" value="${a_id}"/>
+                    <dc:attribute name="out" value="sedimentload_ls"/>
+                  </dc:element>
+                </dc:for-each>
               </load>
-            </dc:for-each>
+            </dc:group>
           </sediment-load>
         </dc:if>
-      </dc:context>
+      </dc:filter>
     </dc:macro>
 
     <dc:macro name="bedheight-differences">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS oid,
-                 name AS o_name
-          FROM outs AS o
-          WHERE
-            o.artifact_id = ${a_id} AND
-            (o.name = 'bed_difference_year' OR
-             o.name = 'bed_differnece_epoch')
-        </dc:statement>
+      <dc:filter expr="($out_name = 'bed_difference_year' or $out_name = 'bed_difference_epoch') and
+        (starts-with($facet_name, 'bedheight_difference.year') or starts-with($facet_name, 'bedheight_difference.epoch'))">
         <dc:if test="dc:has-result()">
           <bedheight-differences>
-            <dc:for-each>
-              <difference description="{$river} {$a_creation} {$collection_name}">
-                <dc:context>
-                  <dc:statement>
-                    SELECT a.gid         AS aid,
-                           f.id          AS fid,
-                           f.name        AS facet_name,
-                           f.num         AS facet_num,
-                           f.description AS facet_description
-                    FROM outs AS o, facets AS f, artifacts AS a
-                    WHERE (f.name LIKE 'bedheight_difference.year%' OR
-                           f.name LIKE 'bedheight_difference.epoch%') AND
-                          f.out_id = o.id         AND
-                          o.artifact_id = ${a_id} AND
-                          a.id = ${a_id}
-                  </dc:statement>
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="factory" value="minfo"/>
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
-                      <dc:attribute name="artifact-id" value="${aid}"/>
-                      <dc:choose>
-                        <dc:when test="dc:contains($o_name, 'bed_difference_year')">
-                          <dc:attribute name="out" value="bed_difference_year"/>
-                        </dc:when>
-                        <dc:otherwise>
-                          <dc:attribute name="out" value="bed_difference_epoch"/>
-                        </dc:otherwise>
-                      </dc:choose>
-                    </dc:element>
-                  </dc:for-each>
-                </dc:context>
+            <dc:group expr="concat($river, ' ', $a_creation, ' ', $collection_name)">
+              <difference description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="factory" value="minfo"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                    <dc:attribute name="artifact-id" value="${a_id}"/>
+                    <dc:attribute name="out" value="${out}"/>
+                  </dc:element>
+                </dc:for-each>
               </difference>
-            </dc:for-each>
+            </dc:group>
           </bedheight-differences>
         </dc:if>
-      </dc:context>
+      </dc:filter>
     </dc:macro>
 
     <dc:macro name="waterlevels-discharge">
-      <dc:context>
-        <dc:statement>
-          SELECT id AS oid
-          FROM outs AS o
-          WHERE
-            o.artifact_id = ${a_id} AND
-            o.name = 'discharge_longitudinal_section'
-        </dc:statement>
+      <dc:filter expr="$out_name = 'discharge_longitudinal_section' and $facet_name = 'discharge_longitudinal_section.w">
         <dc:if test="dc:has-result()">
           <waterlevels-discharge>
-            <dc:for-each>
-              <discharge description="{$oid} {$river} {$a_id} {$a_creation} {$collection_name}">
-                <dc:context>
-                  <dc:statement>
-                    SELECT a.gid         AS aid,
-                           f.id          AS fid,
-                           f.name        AS facet_name,
-                           f.num         AS facet_num,
-                           f.description AS facet_description
-                    FROM outs AS o, facets AS f, artifacts AS a
-                    WHERE f.name = 'discharge_longitudinal_section.w' AND
-                          f.out_id = o.id         AND
-                          o.artifact_id = ${a_id} AND
-                          a.id = ${a_id}
-                  </dc:statement>
-                  <dc:for-each>
-                    <dc:element name="${facet_name}">
-                      <dc:attribute name="factory" value="winfo"/>
-                      <dc:attribute name="description" value="${facet_description}"/>
-                      <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
-                      <dc:attribute name="artifact-id" value="${aid}"/>
-                      <dc:attribute name="out" value="longitudinal_section"/>
-                    </dc:element>
-                  </dc:for-each>
-                </dc:context>
+            <dc:group expr="concat($oid, ' ', $river, ' ', $a_id, ' ', $a_creation, ' ', $collection_name)">
+              <discharge description="{dc:group-key()}">
+                <dc:for-each>
+                  <dc:element name="${facet_name}">
+                    <dc:attribute name="factory" value="winfo"/>
+                    <dc:attribute name="target_out" value="${out}"/>
+                    <dc:attribute name="description" value="${facet_description}"/>
+                    <dc:attribute name="ids" value="${facet_num}-${facet_name}"/>
+                    <dc:attribute name="artifact-id" value="${a_id}"/>
+                    <dc:attribute name="out" value="longitudinal_section"/>
+                  </dc:element>
+                </dc:for-each>
               </discharge>
-            </dc:for-each>
+            </dc:group>
           </waterlevels-discharge>
         </dc:if>
-      </dc:context>
+      </dc:filter>
     </dc:macro>
     <!-- Macros to load system data -->
 
     <dc:macro name="annotations">
-      <annotation factory="annotations" ids="{$river_id}"/>
+      <annotation factory="annotations" ids="{$river_id}" target_out="{$out}" />
     </dc:macro>
 
     <dc:macro name="mainvalues">
-      <wmainvalue factory="mainvalue" ids="{$river_id}:w"/>
-      <qmainvalue factory="mainvalue" ids="{$river_id}:q"/>
+      <wmainvalue factory="mainvalue" ids="{$river_id}:w" target_out="{$out}" />
+      <qmainvalue factory="mainvalue" ids="{$river_id}:q" target_out="{$out}" />
     </dc:macro>
 
     <dc:macro name="cross_sections">
@@ -1232,7 +924,7 @@
           <dc:for-each>
             <cross_section name="{$prot_description}"
                            ids="{$prot_id}"
-                           factory="crosssections"/>
+                           factory="crosssections" target_out="{$out}" />
           </dc:for-each>
         </dc:context>
       </cross_sections>
@@ -1251,9 +943,9 @@
               AND he.km BETWEEN ${fromkm} AND ${tokm}
           </dc:statement>
           <dc:for-each>
-            <hyk name="{$hyk_description}" 
+            <hyk name="{$hyk_description}"
                  ids="{$hyk_id}"
-                 factory="hyk"/>
+                 factory="hyk" target_out="{$out}" />
           </dc:for-each>
         </dc:context>
       </hyks>
@@ -1279,7 +971,7 @@
       <dc:call-macro name="fixings-macro">
         <column name="{$wst_column_name}"
                 ids="fixations-wstv-{$wst_column_position}-{$wst_id}"
-                factory="wqinterpol"
+                factory="wqinterpol" target_out="{$out}"
                 info="{$info} [km {$deffrom} - {$defto}]"/>
       </dc:call-macro>
     </dc:macro>
@@ -1288,7 +980,7 @@
       <dc:call-macro name="fixings-macro">
         <column name="{$wst_column_name}"
                 ids="fixations-wstv-{$wst_column_position}-{$wst_id}"
-                factory="staticwqkms"
+                factory="staticwqkms" target_out="{$out}"
                 info="{$info} [km {$deffrom} - {$defto}]"/>
       </dc:call-macro>
     </dc:macro>
@@ -1302,7 +994,7 @@
                 <dc:for-each>
                   <column name="{$wst_column_name}"
                           ids="additionals-wstv-{$wst_column_position}-{$wst_id}"
-                          factory="staticwqkms"
+                          factory="staticwqkms" target_out="{$out}"
                           info="{$info} [km {$deffrom} - {$defto}]"/>
                 </dc:for-each>
               </official>
@@ -1321,7 +1013,7 @@
                 <dc:for-each>
                   <column name="{$wst_column_name}"
                           ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}"
-                          factory="staticwkms"
+                          factory="staticwkms" target_out="{$out}"
                           info="{$info} [km {$deffrom} - {$defto}]"/>
                 </dc:for-each>
               </heightmark>
@@ -1340,7 +1032,7 @@
                 <dc:for-each>
                   <column name="{$wst_column_name}"
                           ids="heightmarks_points-wstv-{$wst_column_position}-{$wst_id}"
-                          factory="staticwkms"
+                          factory="staticwkms" target_out="{$out}"
                           info="{$info} [km {$deffrom} - {$defto}]"/>
                 </dc:for-each>
               </relativepoint>
@@ -1369,7 +1061,7 @@
                 <dc:for-each>
                   <column name="{$wst_column_name}"
                           ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}"
-                          factory="staticwkms"
+                          factory="staticwkms" target_out="{$out}"
                           info="{$info} [km {$deffrom} - {$defto}]"/>
                 </dc:for-each>
               </flood_protection>
@@ -1382,7 +1074,7 @@
     <dc:macro name="annotations_per_type">
       <annotations>
         <dc:context>
-          <all_annotations factory="annotations" ids="{$river_id}"/>
+          <all_annotations factory="annotations" ids="{$river_id}" target_out="{$out}" />
           <dc:statement>
             SELECT id   AS anno_id,
                    name AS anno_description
@@ -1390,7 +1082,7 @@
           </dc:statement>
           <dc:for-each>
             <annotation name="{$anno_description}"
-                        factory="annotations"
+                        factory="annotations" target_out="{$out}"
                         ids="{$river_id}:{$anno_description}"/>
           </dc:for-each>
         </dc:context>
@@ -1406,7 +1098,7 @@
                 <dc:for-each>
                   <column name="{$wst_column_name}"
                           ids="fixations-wstv-{$wst_column_position}-{$wst_id}"
-                          factory="staticwkms"
+                          factory="staticwkms" target_out="{$out}"
                           info="{$info} [km {$deffrom} - {$defto}]"/>
                 </dc:for-each>
               </relativepoint>
@@ -1425,7 +1117,7 @@
                 <dc:for-each>
                   <column name="{$wst_column_name}"
                           ids="flood_protection-wstv-{$wst_column_position}-{$wst_id}"
-                          factory="staticwkms"
+                          factory="staticwkms" target_out="{$out}"
                           info="{$info} [km {$deffrom} - {$defto}]"/>
                 </dc:for-each>
               </relativepoint>
@@ -1444,7 +1136,7 @@
                 <dc:for-each>
                   <column name="{$wst_column_name}"
                           ids="additionals-wstv-{$wst_column_position}-{$wst_id}"
-                          factory="staticwkms"
+                          factory="staticwkms" target_out="{$out}"
                           info="{$info} [km {$deffrom} - {$defto}]"/>
                 </dc:for-each>
               </relativepoint>
@@ -1454,6 +1146,25 @@
       </dc:filter>
     </dc:macro>
 
+    <dc:macro name="basedata_6_delta_w">
+      <dc:filter expr="$kind=6">
+        <dc:if test="dc:has-result()">
+          <delta_w>
+            <dc:group expr="$wst_description">
+              <relativepoint name="{dc:group-key()}">
+                <dc:for-each>
+                  <column name="{$wst_column_name}"
+                          ids="delta_w-wstv-{$wst_column_position}-{$wst_id}"
+                          factory="staticwkms" target_out="{$out}"
+                          info="{$info} [km {$deffrom} - {$defto}]"/>
+                </dc:for-each>
+              </relativepoint>
+            </dc:group>
+          </delta_w>
+        </dc:if>
+      </dc:filter>
+    </dc:macro>
+
     <dc:macro name="discharge_table_gauge">
       <dc:context>
         <dc:statement>
@@ -1466,7 +1177,7 @@
             <discharge_table_gauge>
               <dc:for-each>
                 <gauge name="{$gauge_name}"
-                  factory="gaugedischarge"
+                  factory="gaugedischarge" target_out="{$out}"
                   from="{$g_start}"
                   to="{$g_stop}"
                   ids="{$gauge_name}"/>
@@ -1488,15 +1199,15 @@
     </dc:macro>
 
     <dc:macro name="qsectors">
-      <qsector factory="qsectors" ids="{$river_id}"/>
+      <qsector factory="qsectors" ids="{$river_id}" target_out="{$out}" />
     </dc:macro>
 
     <dc:macro name="flood-map-recommended">
       <kilometrage>
-        <riveraxis factory="riveraxis" ids="{$river_id}"/>
+        <riveraxis factory="riveraxis" ids="{$river_id}" target_out="{$out}" />
       </kilometrage>
       <rastermap>
-        <background factory="wmsbackground" ids="{$river_id}"/>
+        <background factory="wmsbackground" ids="{$river_id}" target_out="{$out}" />
       </rastermap>
     </dc:macro>
 
@@ -1514,10 +1225,12 @@
             SELECT id          AS bedh_id,
                    year        AS bedh_year,
                    description AS bedh_descr
-            FROM bed_height_single WHERE river_id = ${river_id}
+            FROM bed_height_single
+            WHERE river_id = ${river_id}
+              AND lower(description) NOT LIKE '%epoch%'
           </dc:statement>
           <dc:for-each>
-            <height factory="bedheight"
+            <height factory="bedheight" target_out="{$out}"
                     ids="bedheight-single-{$bedh_id}-{$bedh_year}"
                     description="{$bedh_descr}"/>
           </dc:for-each>
@@ -1529,14 +1242,16 @@
       <epoch>
         <dc:context>
           <dc:statement>
-            SELECT id               AS bedh_id,
-                   time_interval_id AS bedh_interval_id,
-                   description      AS bedh_descr
-            FROM bed_height_epoch WHERE river_id = ${river_id}
+            SELECT id          AS bedh_id,
+                   year        AS bedh_year,
+                   description AS bedh_descr
+            FROM bed_height_single
+            WHERE river_id = ${river_id}
+              AND lower(description) LIKE '%epoch%'
           </dc:statement>
           <dc:for-each>
-            <height factory="bedheight"
-                    ids="bedheight-epoch-{$bedh_id}-{$bedh_interval_id}"
+            <height factory="bedheight" target_out="{$out}"
+                    ids="bedheight-single-{$bedh_id}-{$bedh_year}"
                     description="{$bedh_descr}"/>
           </dc:for-each>
         </dc:context>
@@ -1556,7 +1271,7 @@
               <dc:comment>TODO: Why has this an id and factory?</dc:comment>
               <flow_velocity_measurement name="{$fvmd}"
                                          ids="{$fvmid}"
-                                         factory="flowvelocity">
+                                         factory="flowvelocity" target_out="{$out}" >
                 <dc:context>
                   <dc:statement>
                     SELECT id, description, station, datetime, v, w, q
@@ -1567,7 +1282,7 @@
                   <dc:for-each>
                     <measurement_value name="{$description} - {$station} - {$datetime}"
                                        ids="{$id}"
-                                       factory="flowvelocity"/>
+                                       factory="flowvelocity" target_out="{$out}" />
                   </dc:for-each>
                 </dc:context>
               </flow_velocity_measurement>
@@ -1597,7 +1312,7 @@
                 <dc:for-each>
                   <morphologic-width name="{$from_station} - {$to_station}"
                                      ids="{$width_id}"
-                                     factory="morph-width"/>
+                                     factory="morph-width" target_out="{$out}" />
                 </dc:for-each>
               </dc:context>
             </dc:for-each>
@@ -1617,7 +1332,7 @@
         <dc:if test="dc:has-result()">
           <soundings_width>
             <dc:for-each>
-              <height factory="bedheight"
+              <height factory="bedheight" target_out="{$out}"
                       ids="bedheight-singlevalues-{$bedh_id}-{$bedh_year}"
                       description="{$bedh_descr}"/>
             </dc:for-each>
@@ -1646,7 +1361,7 @@
       <dc:call-macro name="basedata_0_macro">
         <column name="{$wst_column_name}"
                 ids="base_data-wstv-{$wst_column_position}-{$wst_id}"
-                factory="staticwqkms"
+                factory="staticwqkms" target_out="{$out}"
                 info="{$info} [km {$deffrom} - {$defto}]"/>
       </dc:call-macro>
     </dc:macro>
@@ -1655,7 +1370,7 @@
       <dc:call-macro name="basedata_0_macro">
         <column name="{$wst_column_name}"
                 ids="base_data-wstv-{$wst_column_position}-{$wst_id}"
-                factory="wqinterpol"
+                factory="wqinterpol" target_out="{$out}"
                 info="{$info} [km {$deffrom} - {$defto}]"/>
       </dc:call-macro>
     </dc:macro>
@@ -1680,7 +1395,7 @@
       <dc:call-macro name="basedata_1_additionals_macro">
         <column name="{$wst_column_name}"
                 ids="additionals-wstv-{$wst_column_position}-{$wst_id}"
-                factory="staticwqkms"
+                factory="staticwqkms" target_out="{$out}"
                 info="{$info} [km {$deffrom} - {$defto}]"/>
       </dc:call-macro>
     </dc:macro>
@@ -1689,7 +1404,7 @@
       <dc:call-macro name="basedata_1_additionals_macro">
         <column name="{$wst_column_name}"
                 ids="additionalsmarks-wstv-{$wst_column_position}-{$wst_id}"
-                factory="staticwkms"
+                factory="staticwkms" target_out="{$out}"
                 info="{$info} [km {$deffrom} - {$defto}]"/>
       </dc:call-macro>
     </dc:macro>
@@ -1733,10 +1448,10 @@
          FIXME: Following two macros look identical to me.
       </dc:comment>
       <kilometrage>
-        <riveraxis factory="riveraxis" ids="{$river_id}"/>
+        <riveraxis factory="riveraxis" ids="{$river_id}" target_out="{$out}" />
       </kilometrage>
       <rastermap>
-        <background factory="wmsbackground" ids="{$river_id}"/>
+        <background factory="wmsbackground" ids="{$river_id}" target_out="{$out}" />
       </rastermap>
     </dc:macro>
 
@@ -1750,21 +1465,22 @@
                    d.name  AS name,
                    t.start_time AS start_time,
                    t.stop_time AS stop_time,
-                   'Projektion: ' || d.projection || '$' ||
-                   'Rasterweite: '   || d.resolution || 'm$' ||
-                   'Format: '  || d.format || '$' ||
+                   'Projektion: ' || d.projection || '<BR>' ||
+                   'Rasterweite: '   || d.resolution || 'm<BR>' ||
+                   'Format: '  || d.format || '<BR>' ||
                    'Zeitraum: '
                    AS info
             FROM dem d
               JOIN ranges r ON d.range_id = r.id
               LEFT JOIN time_intervals t ON d.time_interval_id = t.id
-            WHERE d.river_id = ${river_id}
-          </dc:statement>
-          <dc:for-each>
-            <dem factory="demfactory" 
+              WHERE d.river_id = ${river_id}
+              AND NOT((${tokm} < r.a) or (${fromkm} > r.b))
+            </dc:statement>
+            <dc:for-each>
+            <dem factory="demfactory" target_out="{$out}"
               ids="{$dem_id}"
               name="{$name}"
-              info="{dc:replace($info, '$', '<BR>')}{dc:date-format('yyyy', $start_time)} - {dc:date-format('yyyy', $stop_time)}"/>
+              info="{$info}{dc:date-format('yyyy', $start_time)} - {dc:date-format('yyyy', $stop_time)}"/>
           </dc:for-each>
         </dc:context>
       </dems>
@@ -1774,7 +1490,7 @@
       <dc:macro name="durchlass_damm_graben">
         <dc:macro name="ddg_factory">
           <dc:for-each>
-            <hws factory="hwsfactory" name="{$hws_name}"/>
+            <hws factory="hwsfactory" name="{$hws_name}" target_out="{$out}" />
           </dc:for-each>
         </dc:macro>
 
@@ -1861,7 +1577,7 @@
               AND kind = 2
           </dc:statement>
           <dc:for-each>
-            <line factory="wmshydrboundariesfactory" 
+            <line factory="wmshydrboundariesfactory" target_out="{$out}"
                   ids="{$river_id};{$name};2"
                   name="{$name}"/>
           </dc:for-each>
@@ -1875,7 +1591,7 @@
               AND kind = 2
           </dc:statement>
           <dc:for-each>
-            <line factory="wmshydrboundariespolyfactory"
+            <line factory="wmshydrboundariespolyfactory" target_out="{$out}"
                   ids="{$river_id};{$name};2"
                   name="{$name}"/>
           </dc:for-each>
@@ -1896,7 +1612,7 @@
         <dc:if test="dc:has-result()">
           <lines>
             <dc:for-each>
-              <line factory="wmshydrboundariesfactory"
+              <line factory="wmshydrboundariesfactory" target_out="{$out}"
                     ids="{$river_id};{$name};1"
                     name="{$name}"/>
             </dc:for-each>
@@ -1921,7 +1637,7 @@
             <sobek_areas>
               <dc:for-each>
                 <boundary name="{$sectie}"
-                          factory="wmshydrboundariespolyfactory"
+                          factory="wmshydrboundariespolyfactory" target_out="{$out}"
                           ids="{$river_id};{$sectie};1;{$sectie_id};-1"/>
               </dc:for-each>
             </sobek_areas>
@@ -1941,7 +1657,7 @@
             <sobek_flooded>
               <dc:for-each>
                 <boundary name="{$sobek}"
-                          factory="wmshydrboundariespolyfactory"
+                          factory="wmshydrboundariespolyfactory" target_out="{$out}"
                           ids="{$river_id};{$sobek};1;-1;{$sobek_id}"/>
               </dc:for-each>
             </sobek_flooded>
@@ -1959,7 +1675,7 @@
           </dc:statement>
           <dc:for-each>
             <boundary name="{$name}"
-                      factory="wmshydrboundariespolyfactory"
+                      factory="wmshydrboundariespolyfactory" target_out="{$out}"
                       ids="{$river_id};{$name}"/>
           </dc:for-each>
         </dc:context>
@@ -1990,7 +1706,7 @@
                     <dc:if test="dc:has-result()">
                       <bfg>
                         <dc:for-each>
-                          <floodmaps factory="wmsfloodmapsfactory"
+                          <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}"
                             ids="{$river_id};{$name}"
                             name="{$name}"/>
                         </dc:for-each>
@@ -2006,7 +1722,7 @@
                     <dc:if test="dc:has-result()">
                       <federal>
                         <dc:for-each>
-                          <floodmaps factory="wmsfloodmapsfactory"
+                          <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}"
                             ids="{$river_id};{$name}"
                             name="{$name}"/>
                         </dc:for-each>
@@ -2032,7 +1748,7 @@
                     <dc:if test="dc:has-result()">
                       <bfg>
                         <dc:for-each>
-                          <floodmaps factory="wmsfloodmapsfactory"
+                          <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}"
                             ids="{$river_id};{$name}"
                             name="{$name}"/>
                         </dc:for-each>
@@ -2049,7 +1765,7 @@
                     <dc:if test="dc:has-result()">
                       <federal>
                         <dc:for-each>
-                          <floodmaps factory="wmsfloodmapsfactory"
+                          <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}"
                             ids="{$river_id};{$name}"
                             name="{$name}"/>
                         </dc:for-each>
@@ -2080,7 +1796,7 @@
                         ${source}
                       </dc:statement>
                       <dc:for-each>
-                        <floodmaps factory="wmsfloodmapsfactory"
+                        <floodmaps factory="wmsfloodmapsfactory" target_out="{$out}"
                           ids="{$river_id};{$name}"
                           name="{$name}"/>
                       </dc:for-each>
@@ -2110,19 +1826,21 @@
           <floodplain>
             <dc:filter expr="$kind_id=1">
               <dc:for-each>
-                <floody factory="wmsfloodplainfactory"
+                <floody factory="wmsfloodplainfactory" target_out="{$out}"
                         description="{$kind_name}"
                         ids="{$river_id};{$kind_name};{$kind_id}"/>
               </dc:for-each>
             </dc:filter>
-            <dc:filter expr="kind_id!=1">
-              <other>
-                <dc:for-each>
-                  <floody factory="wmsfloodplainfactory"
-                          description="{$layer_name}"
-                          ids="{$river_id};{$layer_name};{$kind_id}"/>
-                </dc:for-each>
-              </other>
+            <dc:filter expr="$kind_id != 1">
+              <dc:if test="dc:has-result()">
+                <other>
+                  <dc:for-each>
+                    <floody factory="wmsfloodplainfactory" target_out="{$out}"
+                            description="{$layer_name}"
+                            ids="{$river_id};{$layer_name};{$kind_id}"/>
+                  </dc:for-each>
+                </other>
+              </dc:if>
             </dc:filter>
           </floodplain>
         </dc:if>
@@ -2137,7 +1855,7 @@
 
       <dc:macro name="hwspoints_by_kind_factory">
         <dc:for-each>
-          <hws factory="wmshwspointsfactory"
+          <hws factory="wmshwspointsfactory" target_out="{$out}"
                ids="{$river_id};{$hws_name}"
                name="{$hws_name}"/>
         </dc:for-each>
@@ -2268,7 +1986,7 @@
 
       <dc:macro name="hwslines_by_kind_factory">
         <dc:for-each>
-          <hws factory="wmshwslinesfactory"
+          <hws factory="wmshwslinesfactory" target_out="{$out}"
                ids="{$river_id};{$hws_name}"
                name="{$hws_name}"/>
         </dc:for-each>
@@ -2403,7 +2121,7 @@
           <floodmarks>
             <dc:for-each>
               <floodmark name="{$year}"
-                factory="wmsfloodmarkfactory"
+                factory="wmsfloodmarkfactory" target_out="{$out}"
                 ids="{$river_id};{$year};{$year}"/>
             </dc:for-each>
           </floodmarks>
@@ -2413,7 +2131,7 @@
 
     <dc:macro name="catchments">
       <catchments>
-        <catchment_wms factory="externalwmsfactory"
+        <catchment_wms factory="externalwmsfactory" target_out="{$out}"
                        ids="http://geoportal.bafg.de/wmsproxy/INSPIRE/DrainageBasin;HY.PHYSICALWATERS.CATCHMENTS;Einzugsgebiete (WMS)" />
         <dc:call-macro name="flood-map-gaugelocations"/>
       </catchments>
@@ -2421,10 +2139,10 @@
 
     <dc:macro name="flood-map-gaugelocations">
       <gaugelocations>
-        <gauge_points factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelpunkte;Pegelpunkte (WSV)"/>
-        <gauge_names factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelnamen;Pegelnamen (WSV)"/>
-        <gauge_level factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelwasserstand;Aktueller Wasserstand (WSV)"/>
-        <gauge_tendency factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;TendenzWasserstand;Tendenz des Wasserstands (WSV)"/>
+        <gauge_points factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelpunkte;Pegelpunkte (WSV)" target_out="{$out}" />
+        <gauge_names factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelnamen;Pegelnamen (WSV)" target_out="{$out}" />
+        <gauge_level factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;Pegelwasserstand;Aktueller Wasserstand (WSV)" target_out="{$out}" />
+        <gauge_tendency factory="externalwmsfactory" ids="http://www.pegelonline.wsv.de/webservices/gis/wms;TendenzWasserstand;Tendenz des Wasserstands (WSV)" target_out="{$out}" />
       </gaugelocations>
     </dc:macro>
 
@@ -2445,7 +2163,7 @@
               <dc:for-each>
                 <actual description="{$kind_name}"
                         ids="{$river_id};{$kind_name};{$kind_id}"
-                        factory="riveraxis"/>
+                        factory="riveraxis" target_out="{$out}" />
               </dc:for-each>
             </dc:filter>
             <dc:filter expr="$kind_id!=1">
@@ -2453,7 +2171,7 @@
                 <dc:for-each>
                   <misc-axis description="{$layer_name}"
                              ids="{$river_id};{$layer_name};{$kind_id}"
-                             factory="riveraxis"/>
+                             factory="riveraxis" target_out="{$out}" />
                 </dc:for-each>
               </other>
             </dc:filter>
@@ -2468,7 +2186,7 @@
           SELECT DISTINCT 1 FROM river_axes_km WHERE river_id = ${river_id}
         </dc:statement>
          <dc:for-each>
-            <kilometrage factory="wmskmfactory" ids="{$river_id}"/>
+            <kilometrage factory="wmskmfactory" ids="{$river_id}" target_out="{$out}" />
         </dc:for-each>
       </dc:context>
     </dc:macro>
@@ -2482,7 +2200,7 @@
             GROUP BY name
         </dc:statement>
         <dc:for-each>
-          <fixpoints factory="wmsfixpointsfactory"
+          <fixpoints factory="wmsfixpointsfactory" target_out="{$out}"
             ids="{$river_id};{$name}"/>
         </dc:for-each>
       </dc:context>
@@ -2504,18 +2222,20 @@
             <dc:filter expr="$kind_id=1">
               <dc:for-each>
                 <actual description="{$kind_name}"
-                        factory="wmsqpsfactory"
+                        factory="wmsqpsfactory" target_out="{$out}"
                         ids="{$river_id};{$kind_name};{$kind_id}"/>
               </dc:for-each>
             </dc:filter>
-            <dc:filter expr="kind_id=0">
-              <other>
-                <dc:for-each>
-                  <misc-qps description="{$layer_name}"
-                            factory="wmsqpsfactory"
-                            ids="{$river_id};{$layer_name};{$kind_id}"/>
-                </dc:for-each>
-              </other>
+            <dc:filter expr="$kind_id = 0">
+              <dc:if test="dc:has-result()">
+                <other>
+                  <dc:for-each>
+                    <misc-qps description="{$layer_name}"
+                              factory="wmsqpsfactory" target_out="{$out}"
+                              ids="{$river_id};{$layer_name};{$kind_id}"/>
+                  </dc:for-each>
+                </other>
+              </dc:if>
             </dc:filter>
           </qps>
         </dc:if>
@@ -2538,7 +2258,7 @@
             <dc:filter expr="$building_kind_id!=0">
               <dc:for-each>
                 <buildings description="{$building_kind}"
-                           factory="wmsbuildingsfactory"
+                           factory="wmsbuildingsfactory" target_out="{$out}"
                            ids="{$river_id};{$building_kind};{$building_kind_id}"/>
               </dc:for-each>
             </dc:filter>
@@ -2546,7 +2266,7 @@
               <other>
                 <dc:for-each>
                   <buildings description="{$building_name}"
-                             factory="wmsbuildingsfactory"
+                             factory="wmsbuildingsfactory" target_out="{$out}"
                              ids="{$river_id};{$building_name}"/>
                 </dc:for-each>
               </other>
@@ -2566,7 +2286,7 @@
             <jetties>
               <dc:for-each>
                 <jetty description="{$jetty_kind}"
-                       factory="wmsjettiesfactory"
+                       factory="wmsjettiesfactory" target_out="{$out}"
                        ids="{$river_id};{$jetty_kind};{$jetty_kind_id}"/>
               </dc:for-each>
             </jetties>
@@ -2619,6 +2339,7 @@
                     <dc:attribute name="name" value="${olname}"/>
                     <dc:attribute name="ids" value="additionals-wstv-${wstcolpos}-${wstid}"/>
                     <dc:attribute name="factory" value="staticwkms"/>
+                    <dc:attribute name="target_out" value="${out}"/>
                     <dc:attribute name="out" value="${out}"/>
                   </dc:element>
                 </dc:for-each>
@@ -2640,7 +2361,7 @@
                  wc.position    AS wst_column_position,
                  wc.description AS info,
                  w.description  AS wst_description,
-                 wc.name        AS wst_column_name,
+                 COALESCE(wc.name, '')        AS wst_column_name,
                  wr.a           AS deffrom,
                  wr.b           AS defto
           FROM wst_columns wc
@@ -2653,7 +2374,7 @@
       </dc:context>
     </dc:macro>
 
-    <dc:macro name="km-filtered-userdata">
+    <dc:macro name="all-user-artifacts">
         <dc:context connection="user">
         <dc:comment>Select collections and masterartifacts.</dc:comment>
         <dc:statement>
@@ -2665,10 +2386,18 @@
                  COALESCE(ma.ld_mode, '')      AS ld_m,
                  COALESCE(ma.ld_locations, '') AS ld_l,
                  COALESCE(ma.ld_from, '')      AS ld_f,
-                 COALESCE(ma.ld_to, '')        AS ld_t
+                 COALESCE(ma.ld_to, '')        AS ld_t,
+                 o.name                        AS out_name,
+                 o.id                          AS out_id,
+                 f.name                        AS facet_name,
+                 f.num                         AS facet_num,
+                 f.description                 AS facet_description,
+                 f.id                          AS fid
           FROM users u
             JOIN collections c             ON c.user_id = u.id
             JOIN master_artifacts_range ma ON ma.collection_id = c.id
+            JOIN outs o                    ON o.artifact_id = ma.id
+            JOIN facets f                  ON f.out_id = o.id
           WHERE  u.gid = CAST(${user-id} AS UUID)
             AND ma.gid <> CAST(${artifact-id} AS uuid)
             AND EXISTS (
@@ -2678,41 +2407,24 @@
                 AND k = 'river'
                 AND v = ${river})
         </dc:statement>
-          <dc:for-each>
-            <dc:variable name="from" type="number" expr="dc:fromValue($ld_m, $ld_l, $ld_f)"/>
-            <dc:variable name="to" type="number" expr="dc:toValue($ld_m, $ld_l, $ld_t)"/>
-            <dc:if test="not (($tokm < $from) or $fromkm > $tokm)">
-              <dc:macro-body/>
-            </dc:if>
-          </dc:for-each>
+        <dc:virtual-column name="deffrom" type="number" expr="dc:fromValue($ld_m, $ld_l, $ld_f)">
+          <dc:virtual-column name="defto" type="number" expr="dc:toValue($ld_m, $ld_l, $ld_t)">
+            <dc:macro-body/>
+          </dc:virtual-column>
+        </dc:virtual-column>
       </dc:context>
     </dc:macro>
 
-    <dc:macro name="user-range">
-      <dc:choose>
-        <dc:when test="dc:contains($parameters, 'user-id')">
-          <dc:context connection="user">
-            <dc:statement>
-              SELECT COALESCE(ld_mode, '')      AS ldm,
-                     COALESCE(ld_locations, '') AS ldl,
-                     COALESCE(ld_from, '')      AS ldf,
-                     COALESCE(ld_to, '')        AS ldt
-              FROM master_artifacts_range
-              WHERE gid = CAST(${artifact-id} AS uuid)
-            </dc:statement>
-            <dc:for-each>
-              <dc:variable name="fromkm" type="number" expr="dc:fromValue($ldm, $ldl, $ldf)"/>
-              <dc:variable name="tokm" type="number" expr="dc:toValue($ldm, $ldl, $ldt)"/>
-              <dc:macro-body/>
-            </dc:for-each>
-          </dc:context>
-        </dc:when>
-        <dc:otherwise>
-          <dc:variable name="fromkm" type="number" expr="dc:fromValue('', '', '')"/>
-          <dc:variable name="tokm" type="number" expr="dc:toValue('', '', '')"/>
-          <dc:macro-body/>
-        </dc:otherwise>
-      </dc:choose>
+    <dc:macro name="km-filtered-user-artifacts">
+      <dc:filter expr="not($deffrom > $tokm or $defto < $fromkm)">
+        <dc:macro-body/>
+      </dc:filter>
+    </dc:macro>
+
+    <dc:macro name="artifact-range">
+      <dc:variable name="fromkm" type="number" expr="dc:fromValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_from'))"/>
+      <dc:variable name="tokm" type="number" expr="dc:toValue(dc:get('ld_mode'), dc:get('ld_locations'), dc:get('ld_to'))"/>
+      <dc:macro-body/>
     </dc:macro>
 
   </datacage>
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes.xml
--- a/artifacts/doc/conf/themes.xml	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/doc/conf/themes.xml	Tue Jun 11 09:40:56 2013 +0200
@@ -1,55 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE themes [
     <!ENTITY virtual-themes SYSTEM "conf/themes/virtual.xml">
-    <!ENTITY general SYSTEM "conf/themes/default/general.xml">
-    <!ENTITY longitudinal-section SYSTEM "conf/themes/default/longitudinal-section.xml">
-    <!ENTITY cross-section SYSTEM "conf/themes/default/cross-section.xml">
-    <!ENTITY discharge SYSTEM "conf/themes/default/discharge.xml">
-    <!ENTITY duration SYSTEM "conf/themes/default/duration.xml">
-    <!ENTITY fixings SYSTEM "conf/themes/default/fixings.xml">
-    <!ENTITY floodmap SYSTEM "conf/themes/default/floodmap.xml">
-    <!ENTITY historical-discharge SYSTEM "conf/themes/default/historical-discharge.xml">
-    <!ENTITY reference SYSTEM "conf/themes/default/reference.xml">
-    <!ENTITY sq-relation SYSTEM "conf/themes/default/sq-relation.xml">
-
-    <!ENTITY general_sec SYSTEM "conf/themes/second/general.xml">
-    <!ENTITY longitudinal-section_sec SYSTEM "conf/themes/second/longitudinal-section.xml">
-    <!ENTITY cross-section_sec SYSTEM "conf/themes/second/cross-section.xml">
-    <!ENTITY discharge_sec SYSTEM "conf/themes/second/discharge.xml">
-    <!ENTITY duration_sec SYSTEM "conf/themes/second/duration.xml">
-    <!ENTITY fixings_sec SYSTEM "conf/themes/second/fixings.xml">
-    <!ENTITY floodmap_sec SYSTEM "conf/themes/second/floodmap.xml">
-    <!ENTITY historical-discharge_sec SYSTEM "conf/themes/second/historical-discharge.xml">
-    <!ENTITY reference_sec SYSTEM "conf/themes/second/reference.xml">
-    <!ENTITY sq-relation_sec SYSTEM "conf/themes/second/sq-relation.xml">
+    <!ENTITY default-themes SYSTEM "conf/themes/default.xml">
+    <!ENTITY second-themes  SYSTEM "conf/themes/second.xml">
 ]>
 <themes>
     &virtual-themes;
-
-    <themegroup name="default">
-      &longitudinal-section;
-      &cross-section;
-      &discharge;
-      &duration;
-      &fixings;
-      &floodmap;
-      &historical-discharge;
-      &reference;
-      &sq-relation;
-      &general;
-    </themegroup>
-    <themegroup name="second">
-      &longitudinal-section_sec;
-      &cross-section_sec;
-      &discharge_sec;
-      &duration_sec;
-      &fixings_sec;
-      &floodmap_sec;
-      &historical-discharge_sec;
-      &reference_sec;
-      &sq-relation_sec;
-      &general_sec;
-    </themegroup>
+    &default-themes;
+    &second-themes;
 
     <!-- Mappings are following now. A mapping maps between a name of a facet 
         and a theme. Always the first matching mapping is taken, so consider putting 
@@ -74,7 +32,7 @@
         <mapping from="longitudinal_section.w" masterAttr="ld_mode==location"
             pattern=".*(HQ200)(\D.*)*" to="LongitudinalSectionW_HQ200_Points" />
         <mapping from="longitudinal_section.w" masterAttr="ld_mode==location"
-            pattern=".*(HQ300)(\D.*)*" to="LongitudinalSectiLEVEL >= DEBUGonW_HQ300_Points" />
+            pattern=".*(HQ300)(\D.*)*" to="LongitudinalSectionW_HQ300_Points" />
         <mapping from="longitudinal_section.w" masterAttr="ld_mode==location"
             pattern=".*(HQ500)(\D.*)*" to="LongitudinalSectionW_HQ500_Points" />
         <mapping from="longitudinal_section.w" masterAttr="ld_mode==location"
@@ -258,6 +216,9 @@
         <mapping from="bed_longitudinal_section.bed_diameter_toplayer" to="BedDiameterTopLayer" />
         <mapping from="bed_longitudinal_section.bed_diameter_sublayer" to="BedDiameterSubLayer" />
         <mapping from="bed_longitudinal_section.bedload_diameter" to="BedLoadDiameter" />
+        <mapping from="bed_longitudinal_section.bed_diameter_data_top" to="BedDiameterDataTop"/>
+        <mapping from="bed_longitudinal_section.bed_diameter_data_sub" to="BedDiameterDataSub"/>
+        <mapping from="bed_longitudinal_section.bedload_diameter_data" to="BedloadDiameterData"/>
         <mapping from="bedheight_difference.year" to="BedheightDiffYear"/>
         <mapping from="bedheight_difference.year.filtered" to="BedheightDiffYear"/>
         <mapping from="bedheight_difference.morph_width" to="BedheightDiffMorphWidth"/>
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/default.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/doc/conf/themes/default.xml	Tue Jun 11 09:40:56 2013 +0200
@@ -0,0 +1,2097 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<themegroup name="default">
+    <theme name="MainValuesQ">
+        <inherits>
+            <inherit from="Lines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Farbe"
+                default="200, 0, 15" />
+            <field name="textorientation" type="boolean" display="Textausrichtung"
+                default="true" />
+            <field name="showlinelabel" type="boolean"
+                display="Linienbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="MainValuesQVerticalText">
+        <inherits>
+            <inherit from="Lines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Farbe"
+                default="200, 0, 15" />
+            <field name="textorientation" type="boolean" display="Textausrichtung"
+                default="false" />
+            <field name="showlinelabel" type="boolean"
+                display="Linienbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="MainValuesW">
+        <inherits>
+            <inherit from="Lines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Farbe"
+                default="0, 215, 0" />
+            <field name="textorientation" type="boolean" display="Textausrichtung"
+                default="true" />
+            <field name="showlinelabel" type="boolean"
+                display="Linienbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="RelativePoint">
+        <inherits>
+            <inherit from="Points" />
+        </inherits>
+    </theme>
+
+    <theme name="Annotations">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Text" />
+        </inherits>
+        <fields>
+        </fields>
+    </theme>
+
+    <theme name="ManualPoints">
+        <inherits>
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="3" hints="hidden" />
+            <field name="textorientation" type="boolean" display="Textausrichtung"
+                default="true" />
+        </fields>
+    </theme>
+
+    <theme name="WKms">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="WKmsAnnotation">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="3" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="WQKms">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="WQPoints">
+        <inherits>
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Linienfarbe"
+                default="204, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="heightmarks_points">
+        <inherits>
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="Area">
+        <inherits>
+            <inherit from="Areas" />
+        </inherits>
+        <fields>
+            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
+                default="true" hints="hidden" />
+            <field name="areashowborder" type="boolean" display="Begrenzung"
+                default="false" hints="hidden" />
+            <field name="areabordercolor" type="Color" default="0, 0, 0"
+                display="Begrenzungslinienfarbe" hints="hidden" />
+            <field name="showarea" type="boolean" display="Flaeche anzeigen"
+              default="true" hints="hidden" />
+            <field name="showarealabel" type="boolean"
+                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+    <!-- top level classes defining additional attributes-->
+    <theme name="LongitudinalSection">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="MinMaxPoints" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="bandwidth" type="double" display="Bandbreite"
+                default="0"/>
+            <field name="bandwidthcolor" type="Color" display="Bandbreitenfarbe"
+                default="104, 104, 104"/>
+            <field name="transparency" type="int" default="20" display="Transparenz"/>
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionPoints">
+        <inherits>
+            <inherit from="Points" />
+        </inherits>
+        <fields>
+        </fields>
+    </theme>
+
+    <theme name="Differences">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+
+    <!-- Classes defining special values -->
+    <theme name="LongitudinalSectionW_HQ1">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ2">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ5">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 153, 51" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ10">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ20">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="153, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ25">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 51, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ50">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ100">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ200">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 100, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ300">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 100" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ500">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ1000">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQRZ">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HSQ">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="253, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_MHQ">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 255, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_MNQ">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 255, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_MQ">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 51, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_NQ">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="153, 204, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQExtrem">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ1_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ2_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ5_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 153, 51" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ10_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ20_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="153, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ25_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="102, 51, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ50_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="255, 153, 153" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ100_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="255, 0, 51" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ200_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ300_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="255, 100, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ500_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="102, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ1000_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQRZ_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="102, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HSQ_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="253, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_MHQ_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="102, 255, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_MNQ_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 255, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_MQ_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 51, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_NQ_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="153, 204, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQExtrem_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ1">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ2">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ5">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 153, 51" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ10">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ20">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="153, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ25">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 51, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ50">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 153, 153" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ100">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 51" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ200">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ300">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 100, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ500">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ1000">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQRZ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HSQ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="253, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_MHQ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 255, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_MNQ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 255, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_MQ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 51, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_NQ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="153, 204, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQExtrem">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="DischargeLongitudinalSectionW">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+
+    <theme name="DischargeLongitudinalSectionC">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0 , 0" />
+        </fields>
+    </theme>
+
+    <theme name="DischargeLongitudinalSectionQ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQInfoldCut">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 102, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQInfolding">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="51, 51, 51" />
+        </fields>
+    </theme>
+
+    <!-- MIDDLE BED HEIGHT -->
+    <theme name="MiddleBedHeightSingle">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="MiddleBedHeightEpoch">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <!-- Bed Quality -->
+    <theme name="PorosityTopLayer">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="PorositySubLayer">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="DensityTopLayer">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="153, 99, 102" />
+        </fields>
+    </theme>
+
+    <theme name="DensitySubLayer">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="153, 99, 102" />
+        </fields>
+    </theme>
+
+    <theme name="BedDiameterTopLayer">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="BedDiameterSubLayer">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="BedLoadDiameter">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 255, 0" />
+        </fields>
+    </theme>
+
+    <theme name="BedDiameterDataTop">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="showlines" type="boolean" display="Linie anzeigen" default="false"/>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen" default="true"/>
+            <field name="pointsize" type="int" display="Punktdicke" default="2" />
+            <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 0, 100" />
+        </fields>
+    </theme>
+
+    <theme name="BedDiameterDataSub">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="showlines" type="boolean" display="Linie anzeigen" default="false"/>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen" default="true"/>
+            <field name="pointsize" type="int" display="Punktdicke" default="2" />
+            <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 0, 100" />
+        </fields>
+    </theme>
+
+    <theme name="BedloadDiameterData">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="showlines" type="boolean" display="Linie anzeigen" default="false"/>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen" default="true"/>
+            <field name="pointsize" type="int" display="Punktdicke" default="2" />
+            <field name="pointcolor" type="Color" display="Punktfarbe" default="100, 0, 0" />
+        </fields>
+    </theme>
+    <!-- Bedheight differences -->
+    <theme name="BedheightDiffYear">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="BedheightDiffMorphWidth">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 0" />
+        </fields>
+    </theme>
+
+    <theme name="BedheightDiffEpoch">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 0, 204" />
+        </fields>
+    </theme>
+
+    <theme name="BedheightDiffAbsHeight1">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 0, 204" />
+        </fields>
+    </theme>
+
+    <theme name="BedheightDiffAbsHeight2">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 100, 100" />
+        </fields>
+    </theme>
+
+    <theme name="BedheightDiffHeightYear">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="MorphologicWidth">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 100, 200" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+    <!-- Flow velocity -->
+    <theme name="FlowVelocityVMainChannel">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="FlowVelocityVTotalChannel">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="FlowVelocityTau">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="FlowVelocityDischarge">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 204, 0" />
+        </fields>
+    </theme>
+
+    <!-- Sediment load -->
+    <theme name="SedimentLoadCoarse">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadFineMid">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 0, 0" />
+        </fields>
+    </theme>
+    <theme name="SedimentLoadSand">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadSuspSand">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 255, 0" />
+        </fields>
+    </theme>
+
+     <theme name="SedimentLoadSediment">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 255, 255" />
+        </fields>
+    </theme>
+     <theme name="SedimentLoadSuspSandBed">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 255, 0" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+     <theme name="SedimentLoadFineTotalLoad">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 100, 100" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+    <theme name="SedimentLoadTotal">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 100, 200" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionArea">
+        <inherits>
+            <inherit from="Areas" />
+        </inherits>
+        <fields>
+            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
+                default="true" hints="hidden" />
+            <field name="areashowborder" type="boolean" display="Begrenzung"
+                default="false" hints="hidden" />
+            <field name="areabordercolor" type="Color" default="0, 0, 0"
+                display="Begrenzungslinienfarbe" hints="hidden" />
+            <field name="showarea" type="boolean" display="Flaeche anzeigen"
+              default="true" hints="hidden" />
+            <field name="showarealabel" type="boolean"
+                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+
+
+    <theme name="CrossSection">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="CrossSectionWaterLine">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0,0,153" />
+            <field name="showwidth" type="boolean" display="Breite anzeigen"
+                default="false" />
+            <field name="showlevel" type="boolean" display="Wasserstand anzeigen"
+                default="true" />
+            <field name="showlinelabel" type="boolean" default="true"
+                display="Beschriftung anzeigen" />
+            <field name="showmiddleheight" type="boolean"
+                display="Wasserstand anzeigen" default="false" />
+        </fields>
+    </theme>
+
+    <theme name="Hyk">
+        <inherits>
+            <inherit from="Text" />
+        </inherits>
+        <fields>
+            <field name="textorientation" type="boolean" display="Textausrichtung"
+                default="true" />
+        </fields>
+    </theme>
+
+    <theme name="CrossSectionArea">
+        <inherits>
+            <inherit from="Areas" />
+        </inherits>
+        <fields>
+            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
+                default="true" hints="hidden" />
+            <field name="areashowborder" type="boolean" display="Begrenzung"
+                default="false" hints="hidden" />
+            <field name="areabordercolor" type="Color" default="0, 0, 0"
+                display="Begrenzungslinienfarbe" hints="hidden" />
+            <field name="showarea" type="boolean" display="Flaeche anzeigen"
+              default="true" hints="hidden" />
+            <field name="showarealabel" type="boolean"
+                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+
+
+    <theme name="DischargeCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" hints="hidden" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 153" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="2" />
+        </fields>
+    </theme>
+
+    <theme name="ComputedDischargeCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 153" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="2" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="ComputedDischargeCurveQ">
+        <inherits>
+            <inherit from="ComputedDischargeCurve" />
+            <inherit from="Text" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Farbe"
+                default="200, 0, 15" />
+            <field name="textcolor" type="Color" display="Farbe"
+                default="200, 0, 15" />
+        </fields>
+    </theme>
+
+    <theme name="ComputedDischargeCurveW">
+        <inherits>
+            <inherit from="ComputedDischargeCurve" />
+            <inherit from="Text" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Farbe"
+                default="0, 215, 0" />
+            <field name="textcolor" type="Color" display="Farbe"
+                default="0, 215, 0" />
+            <field name="textorientation" type="boolean" display="Textausrichtung"
+                default="true" />
+        </fields>
+    </theme>
+
+    <theme name="GaugeDischargeCurve">
+        <inherits>
+            <inherit from="DischargeCurve" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 153" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="2" />
+        </fields>
+    </theme>
+
+    <theme name="ExtremeWQCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showextramark" type="boolean" display="Linie anzeigen ab wo extrapoliert wurde"
+                default="true" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 153" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="2" />
+            <field name="showlinelabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />           
+        </fields>
+    </theme>
+
+    <theme name="ExtremeWQBaseCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+        </inherits>
+        <fields>
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="2" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showlinelabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+
+
+    <theme name="DurationCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="2" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false"
+                hints="hidden"/>
+        </fields>
+    </theme>
+
+    <theme name="DurationCurveW">
+        <inherits>
+            <inherit from="DurationCurve" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0,51,204" />
+        </fields>
+    </theme>
+
+    <theme name="DurationCurveQ">
+        <inherits>
+            <inherit from="DurationCurve" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0,204,0" />
+        </fields>
+    </theme>
+
+
+
+    <theme name="FixPoints">
+        <inherits>
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="3" />
+        </fields>
+    </theme>
+
+    <theme name="FixLines">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" hints="hidden" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="3" />
+        </fields>
+    </theme>
+
+    <theme name="FixAreas">
+        <inherits>
+            <inherit from="Areas" />
+        </inherits>
+        <fields>
+            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
+                default="true" hints="hidden" />
+            <field name="areashowborder" type="boolean" display="Begrenzung"
+                default="false" hints="hidden" />
+            <field name="areabordercolor" type="Color" default="0, 0, 0"
+                display="Begrenzungslinienfarbe" hints="hidden" />
+            <field name="showarea" type="boolean" display="Flaeche anzeigen"
+              default="true" hints="hidden" />
+            <field name="showarealabel" type="boolean"
+                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="FixingWQCurve">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="227, 27, 162" />
+        </fields>
+    </theme>
+
+    <theme name="FixingDerivedCurve">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="227, 27, 162" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" hints="hidden" hidden="true" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="5" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorAverageWQ0">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 128, 0" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorAverageWQ1">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 0, 255" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorAverageWQ2">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="255, 0, 255" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorAverageWQ3">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="255, 0, 0" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingAnalysisEventsWQ">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 255, 0" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingReferenceEvents">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 80, 160" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingOutliers">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+        </fields>
+    </theme>
+
+    <theme name="FixingDeltaWtAverage0">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 128, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixingDeltaWtAverage1">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="FixingDeltaWtAverage2">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="FixingDeltaWtAverage3">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixingDeltaWtAnalysis">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 255, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixingLSAverage0">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 128, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixingLSAverage1">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="FixingLSAverage2">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="FixingLSAverage3">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorDeviationLS0">
+        <inherits>
+            <inherit from="FixAreas" />
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" display="Fuellfarbe"
+                default="0, 128, 0" />
+        </fields>
+    </theme>
+    <theme name="FixingSectorDeviationLS1">
+        <inherits>
+            <inherit from="FixAreas" />
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" display="Fuellfarbe"
+                default="0, 0, 255" />
+
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorDeviationLS2">
+        <inherits>
+            <inherit from="FixAreas" />
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" display="Fuellfarbe"
+                default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorDeviationLS3">
+        <inherits>
+            <inherit from="FixAreas" />
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" display="Fuellfarbe"
+                default="255, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixLSDeviation">
+        <inherits>
+            <inherit from="FixAreas" />
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" display="Fuellfarbe"
+                default="100, 100, 100" />
+        </fields>
+    </theme>
+
+    <theme name="FixLSAnalysis">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 255, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixLSReference">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 80, 160" />
+        </fields>
+    </theme>
+
+    <theme name="FixDeltaWtDeviation">
+        <inherits>
+            <inherit from="FixAreas"/>
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" default="0, 0, 0" display="Füllfarbe"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingDeltaWtAnalysisPeriods">
+        <inherits>
+            <inherit from="FixAreas"/>
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" default="255, 0, 0" display="Füllfarbe" />
+        </fields>
+    </theme>
+
+    <theme name="FixingReferencePeriod">
+        <inherits>
+            <inherit from="FixAreas"/>
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" default="0, 0, 255" display="Füllfarbe" />
+        </fields>
+    </theme>
+
+    <theme name="QSectors">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="true" hints="hidden" />
+        </fields>
+    </theme>
+
+
+
+    <theme name="MapLines">
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 205" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="3" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="Floodmaps">
+        <inherits>
+            <inherit from="Map" />
+        </inherits>
+    </theme>
+
+    <theme name="Floodplains">
+        <inherits>
+            <inherit from="Map" />
+        </inherits>
+    </theme>
+
+    <theme name="Floodmarks">
+        <inherits>
+            <inherit from="MapLines" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+    <theme name="WSPLGEN">
+        <inherits>
+            <inherit from="Uesk" />
+        </inherits>
+        <fields>
+            <field name="startcolor" type="Color"
+                display="Farbverlauf Startfarbe" default="178, 201, 215" />
+            <field name="endcolor" type="Color"
+                display="Farbverlauf Endfarbe" default="2, 27, 42" />
+            <field name="numclasses" type="int" display="Anzahl Klassen"
+                default="6" />
+        </fields>
+    </theme>
+
+    <theme name="RiverAxis">
+        <inherits>
+            <inherit from="MapLines" />
+        </inherits>
+        <fields>
+       </fields>
+    </theme>
+
+    <theme name="Kms">
+        <inherits>
+            <inherit from="MapLines" />
+            <inherit from="Label" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+
+    <theme name="Fixpoints">
+        <inherits>
+            <inherit from="MapLines" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+    <theme name="Floodmarks">
+        <inherits>
+            <inherit from="MapLines" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+
+    <theme name="GaugeLocation">
+        <inherits>
+            <inherit from="MapLines" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+    <theme name="Qps">
+        <inherits>
+            <inherit from="MapLines" />
+        </inherits>
+    </theme>
+
+    <theme name="Hws">
+        <inherits>
+            <inherit from="MapLines" />
+        </inherits>
+    </theme>
+
+    <theme name="HwsPoints">
+        <inherits>
+            <inherit from="MapLines"/>
+            <inherit from="Label" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+    <theme name="Catchment">
+        <inherits>
+            <inherit from="Map" />
+        </inherits>
+    </theme>
+
+    <theme name="FloodmapLines">
+        <inherits>
+            <inherit from="MapLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="140, 200, 130" />
+        </fields>
+    </theme>
+
+    <theme name="Buildings">
+        <inherits>
+            <inherit from="MapLines" />
+        </inherits>
+    </theme>
+
+    <theme name="HydrBoundariesLines">
+        <inherits>
+            <inherit from="MapLines" />
+        </inherits>
+    </theme>
+
+    <theme name="HydrBoundariesPolys">
+        <inherits>
+            <inherit from="Map" />
+        </inherits>
+    </theme>
+
+    <theme name="Jetties">
+        <inherits>
+            <inherit from="MapLines"/>
+            <inherit from="Label" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+
+
+    <theme name="HistoricalDischargeCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 153" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="2" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeCurveQ">
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeCurveQDiff">
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeCurveW">
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="100, 100, 153" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeCurveWDiff">
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="250, 250, 204" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeWQCurve">
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 204" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeWQW">
+        <!-- the facet has no styling...
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 255" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="1" />
+            <field name="linetype" type="Dash" display="Linienart"
+                default="10" />
+            <field name="showlines" type="boolean" display="Linie anzeigen"
+                default="true" hints="hidden" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="3" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>-->
+    </theme>
+
+    <theme name="HistoricalDischargeWQQ">
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="1" />
+            <field name="linetype" type="Dash" display="Linienart"
+                default="10" />
+            <field name="showlines" type="boolean" display="Linie anzeigen"
+                default="true" hints="hidden" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="3" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+
+
+    <theme name="ReferenceCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="ReferenceCurveNormalized">
+        <inherits>
+            <inherit from="ReferenceCurve" />
+        </inherits>
+        <fields>
+        </fields>
+    </theme>
+
+
+
+    <theme name="SQMeasurements">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" default="0, 153, 255" />
+            <field name="showlines" type="boolean" display="Linie anzeigen"
+                default="false" hints="hidden" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="1" hints="hidden" />
+            <field name="linetype" type="Dash" display="Linienart"
+                default="10" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" hints="hidden" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="SQOutliers">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" default="204, 0, 0" />
+            <field name="showlines" type="boolean" display="Linie anzeigen"
+                default="false" hints="hidden" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="1" hints="hidden" />
+            <field name="linetype" type="Dash" display="Linienart"
+                default="10" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" hints="hidden" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="SQCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" default="0, 0, 0" />
+        </fields>
+    </theme>
+</themegroup>
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/default/cross-section.xml
--- a/artifacts/doc/conf/themes/default/cross-section.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="CrossSection">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="CrossSectionWaterLine">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0,0,153" />
-            <field name="showwidth" type="boolean" display="Breite anzeigen"
-                default="false" />
-            <field name="showlevel" type="boolean" display="Wasserstand anzeigen"
-                default="true" />
-            <field name="showlinelabel" type="boolean" default="true"
-                display="Beschriftung anzeigen" />
-            <field name="showmiddleheight" type="boolean"
-                display="Wasserstand anzeigen" default="false" />
-        </fields>
-    </theme>
-
-    <theme name="Hyk">
-        <inherits>
-            <inherit from="Text" />
-        </inherits>
-        <fields>
-            <field name="textorientation" type="boolean" display="Textausrichtung"
-                default="true" />
-        </fields>
-    </theme>
-
-    <theme name="CrossSectionArea">
-        <inherits>
-            <inherit from="Areas" />
-        </inherits>
-        <fields>
-            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
-                default="true" hints="hidden" />
-            <field name="areashowborder" type="boolean" display="Begrenzung"
-                default="false" hints="hidden" />
-            <field name="areabordercolor" type="Color" default="0, 0, 0"
-                display="Begrenzungslinienfarbe" hints="hidden" />
-            <field name="showarea" type="boolean" display="Flaeche anzeigen"
-              default="true" hints="hidden" />
-            <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/default/discharge.xml
--- a/artifacts/doc/conf/themes/default/discharge.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="DischargeCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" hints="hidden" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 153" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="2" />
-        </fields>
-    </theme>
-
-    <theme name="ComputedDischargeCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 153" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="2" />
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="ComputedDischargeCurveQ">
-        <inherits>
-            <inherit from="ComputedDischargeCurve" />
-            <inherit from="Text" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Farbe"
-                default="200, 0, 15" />
-            <field name="textcolor" type="Color" display="Farbe"
-                default="200, 0, 15" />
-        </fields>
-    </theme>
-
-    <theme name="ComputedDischargeCurveW">
-        <inherits>
-            <inherit from="ComputedDischargeCurve" />
-            <inherit from="Text" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Farbe"
-                default="0, 215, 0" />
-            <field name="textcolor" type="Color" display="Farbe"
-                default="0, 215, 0" />
-            <field name="textorientation" type="boolean" display="Textausrichtung"
-                default="true" />
-        </fields>
-    </theme>
-
-    <theme name="GaugeDischargeCurve">
-        <inherits>
-            <inherit from="DischargeCurve" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 153" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="2" />
-        </fields>
-    </theme>
-
-    <theme name="ExtremeWQCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showextramark" type="boolean" display="Linie anzeigen ab wo extrapoliert wurde"
-                default="true" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 153" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="2" />
-            <field name="showlinelabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />           
-        </fields>
-    </theme>
-
-    <theme name="ExtremeWQBaseCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-        </inherits>
-        <fields>
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="2" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showlinelabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/default/duration.xml
--- a/artifacts/doc/conf/themes/default/duration.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-
-    <theme name="DurationCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="2" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false"
-                hints="hidden"/>
-        </fields>
-    </theme>
-
-    <theme name="DurationCurveW">
-        <inherits>
-            <inherit from="DurationCurve" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0,51,204" />
-        </fields>
-    </theme>
-
-    <theme name="DurationCurveQ">
-        <inherits>
-            <inherit from="DurationCurve" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0,204,0" />
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/default/fixings.xml
--- a/artifacts/doc/conf/themes/default/fixings.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,342 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="FixPoints">
-        <inherits>
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="3" />
-        </fields>
-    </theme>
-
-    <theme name="FixLines">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" hints="hidden" />
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="3" />
-        </fields>
-    </theme>
-
-    <theme name="FixAreas">
-        <inherits>
-            <inherit from="Areas" />
-        </inherits>
-        <fields>
-            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
-                default="true" hints="hidden" />
-            <field name="areashowborder" type="boolean" display="Begrenzung"
-                default="false" hints="hidden" />
-            <field name="areabordercolor" type="Color" default="0, 0, 0"
-                display="Begrenzungslinienfarbe" hints="hidden" />
-            <field name="showarea" type="boolean" display="Flaeche anzeigen"
-              default="true" hints="hidden" />
-            <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="FixingWQCurve">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="227, 27, 162" />
-        </fields>
-    </theme>
-
-    <theme name="FixingDerivedCurve">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="227, 27, 162" />
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" hints="h" hidden="true" />
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="5" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorAverageWQ0">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 128, 0" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorAverageWQ1">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 0, 255" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorAverageWQ2">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="255, 0, 255" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorAverageWQ3">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="255, 0, 0" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingAnalysisEventsWQ">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 255, 0" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingReferenceEvents">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 80, 160" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingOutliers">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-        </fields>
-    </theme>
-
-    <theme name="FixingDeltaWtAverage0">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 128, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixingDeltaWtAverage1">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="FixingDeltaWtAverage2">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="FixingDeltaWtAverage3">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixingDeltaWtAnalysis">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 255, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixingLSAverage0">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 128, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixingLSAverage1">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="FixingLSAverage2">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="FixingLSAverage3">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="255, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorDeviationLS0">
-        <inherits>
-            <inherit from="FixAreas" />
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" display="Fuellfarbe"
-                default="0, 128, 0" />
-        </fields>
-    </theme>
-    <theme name="FixingSectorDeviationLS1">
-        <inherits>
-            <inherit from="FixAreas" />
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" display="Fuellfarbe"
-                default="0, 0, 255" />
-
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorDeviationLS2">
-        <inherits>
-            <inherit from="FixAreas" />
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" display="Fuellfarbe"
-                default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorDeviationLS3">
-        <inherits>
-            <inherit from="FixAreas" />
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" display="Fuellfarbe"
-                default="255, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixLSDeviation">
-        <inherits>
-            <inherit from="FixAreas" />
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" display="Fuellfarbe"
-                default="100, 100, 100" />
-        </fields>
-    </theme>
-
-    <theme name="FixLSAnalysis">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 255, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixLSReference">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 80, 160" />
-        </fields>
-    </theme>
-
-    <theme name="FixDeltaWtDeviation">
-        <inherits>
-            <inherit from="FixAreas"/>
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" default="0, 0, 0" display="Füllfarbe"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingDeltaWtAnalysisPeriods">
-        <inherits>
-            <inherit from="FixAreas"/>
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" default="255, 0, 0" display="Füllfarbe" />
-        </fields>
-    </theme>
-
-    <theme name="FixingReferencePeriod">
-        <inherits>
-            <inherit from="FixAreas"/>
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" default="0, 0, 255" display="Füllfarbe" />
-        </fields>
-    </theme>
-
-    <theme name="QSectors">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="true" hints="h" />
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/default/floodmap.xml
--- a/artifacts/doc/conf/themes/default/floodmap.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,130 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="MapLines">
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 205" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="3" hints="h" />
-        </fields>
-    </theme>
-
-    <theme name="Floodmaps">
-        <inherits>
-            <inherit from="Map" />
-        </inherits>
-    </theme>
-
-    <theme name="Floodplains">
-        <inherits>
-            <inherit from="Map" />
-        </inherits>
-    </theme>
-
-    <theme name="WSPLGEN">
-        <inherits>
-            <inherit from="Uesk" />
-        </inherits>
-        <fields>
-            <field name="startcolor" type="Color"
-                display="Farbverlauf Startfarbe" default="178, 201, 215" />
-            <field name="endcolor" type="Color"
-                display="Farbverlauf Endfarbe" default="2, 27, 42" />
-            <field name="numclasses" type="int" display="Anzahl Klassen"
-                default="6" />
-        </fields>
-    </theme>
-
-    <theme name="RiverAxis">
-        <inherits>
-            <inherit from="MapLines" />
-        </inherits>
-        <fields>
-       </fields>
-    </theme>
-
-    <theme name="Kms">
-        <inherits>
-            <inherit from="MapLines" />
-            <inherit from="Label" />
-            <inherit from="Symbol" />
-        </inherits>
-    </theme>
-
-
-    <theme name="Fixpoints">
-        <inherits>
-            <inherit from="MapLines" />
-            <inherit from="Symbol" />
-        </inherits>
-    </theme>
-
-    <theme name="Floodmarks">
-        <inherits>
-            <inherit from="MapLines" />
-            <inherit from="Symbol" />
-        </inherits>
-    </theme>
-
-    <theme name="Qps">
-        <inherits>
-            <inherit from="MapLines" />
-        </inherits>
-    </theme>
-
-    <theme name="Hws">
-        <inherits>
-            <inherit from="MapLines" />
-        </inherits>
-    </theme>
-
-    <theme name="HwsPoints">
-        <inherits>
-            <inherit from="MapLines"/>
-            <inherit from="Label" />
-            <inherit from="Symbol" />
-        </inherits>
-    </theme>
-
-    <theme name="Catchment">
-        <inherits>
-            <inherit from="Map" />
-        </inherits>
-    </theme>
-
-    <theme name="FloodmapLines">
-        <inherits>
-            <inherit from="MapLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="140, 200, 130" />
-        </fields>
-    </theme>
-
-    <theme name="Buildings">
-        <inherits>
-            <inherit from="MapLines" />
-        </inherits>
-    </theme>
-
-    <theme name="HydrBoundariesLines">
-        <inherits>
-            <inherit from="MapLines" />
-        </inherits>
-    </theme>
-
-    <theme name="HydrBoundariesPolys">
-        <inherits>
-            <inherit from="Map" />
-        </inherits>
-    </theme>
-
-    <theme name="Jetties">
-        <inherits>
-            <inherit from="MapLines"/>
-            <inherit from="Label" />
-            <inherit from="Symbol" />
-        </inherits>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/default/general.xml
--- a/artifacts/doc/conf/themes/default/general.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,159 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="MainValuesQ">
-        <inherits>
-            <inherit from="Lines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Farbe"
-                default="200, 0, 15" />
-            <field name="textorientation" type="boolean" display="Textausrichtung"
-                default="true" />
-            <field name="showlinelabel" type="boolean"
-                display="Linienbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="MainValuesQVerticalText">
-        <inherits>
-            <inherit from="Lines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Farbe"
-                default="200, 0, 15" />
-            <field name="textorientation" type="boolean" display="Textausrichtung"
-                default="false" />
-            <field name="showlinelabel" type="boolean"
-                display="Linienbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="MainValuesW">
-        <inherits>
-            <inherit from="Lines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Farbe"
-                default="0, 215, 0" />
-            <field name="textorientation" type="boolean" display="Textausrichtung"
-                default="true" />
-            <field name="showlinelabel" type="boolean"
-                display="Linienbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="RelativePoint">
-        <inherits>
-            <inherit from="Points" />
-        </inherits>
-    </theme>
-
-    <theme name="Annotations">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Text" />
-        </inherits>
-        <fields>
-        </fields>
-    </theme>
-
-    <theme name="ManualPoints">
-        <inherits>
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="3" hints="hidden" />
-            <field name="textorientation" type="boolean" display="Textausrichtung"
-                default="true" />
-        </fields>
-    </theme>
-
-    <theme name="WKms">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="WKmsAnnotation">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="3" hints="h" />
-        </fields>
-    </theme>
-
-    <theme name="WQKms">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="WQPoints">
-        <inherits>
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Linienfarbe"
-                default="204, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="heightmarks_points">
-        <inherits>
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="Area">
-        <inherits>
-            <inherit from="Areas" />
-        </inherits>
-        <fields>
-            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
-                default="true" hints="hidden" />
-            <field name="areashowborder" type="boolean" display="Begrenzung"
-                default="false" hints="hidden" />
-            <field name="areabordercolor" type="Color" default="0, 0, 0"
-                display="Begrenzungslinienfarbe" hints="hidden" />
-            <field name="showarea" type="boolean" display="Flaeche anzeigen"
-              default="true" hints="hidden" />
-            <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/default/historical-discharge.xml
--- a/artifacts/doc/conf/themes/default/historical-discharge.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="HistoricalDischargeCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 153" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="2" />
-        </fields>
-    </theme>
-
-    <theme name="HistoricalDischargeCurveQ">
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="HistoricalDischargeCurveQDiff">
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="HistoricalDischargeCurveW">
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="100, 100, 153" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="HistoricalDischargeCurveWDiff">
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="250, 250, 204" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="HistoricalDischargeWQCurve">
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 204" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" />
-        </fields>
-    </theme>
-
-    <theme name="HistoricalDischargeWQW">
-        <!-- the facet has no styling...
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 255" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="1" />
-            <field name="linetype" type="Dash" display="Linienart"
-                default="10" />
-            <field name="showlines" type="boolean" display="Linie anzeigen"
-                default="true" hints="hidden" />
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" />
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="3" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>-->
-    </theme>
-
-    <theme name="HistoricalDischargeWQQ">
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="1" />
-            <field name="linetype" type="Dash" display="Linienart"
-                default="10" />
-            <field name="showlines" type="boolean" display="Linie anzeigen"
-                default="true" hints="hidden" />
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" />
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="3" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/default/longitudinal-section.xml
--- a/artifacts/doc/conf/themes/default/longitudinal-section.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,975 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <!-- top level classes defining additional attributes-->
-    <theme name="LongitudinalSection">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="MinMaxPoints" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="bandwidth" type="double" display="Bandbreite"
-                default="0"/>
-            <field name="bandwidthcolor" type="Color" display="Bandbreitenfarbe"
-                default="104, 104, 104"/>
-            <field name="transparency" type="int" default="20" display="Transparenz"/>
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionPoints">
-        <inherits>
-            <inherit from="Points" />
-        </inherits>
-        <fields>
-        </fields>
-    </theme>
-
-    <theme name="Differences">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-
-    <!-- Classes defining special values -->
-    <theme name="LongitudinalSectionW_HQ1">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ2">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ5">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 153, 51" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ10">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ20">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="153, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ25">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 51, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ50">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ100">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ200">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 100, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ300">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 100" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ500">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ1000">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQRZ">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HSQ">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="253, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_MHQ">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 255, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_MNQ">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 255, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_MQ">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 51, 204" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_NQ">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="153, 204, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQExtrem">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ1_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ2_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ5_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 153, 51" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ10_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ20_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="153, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ25_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="102, 51, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ50_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="255, 153, 153" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ100_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="255, 0, 51" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ200_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ300_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="255, 100, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ500_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="102, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ1000_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQRZ_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="102, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HSQ_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="253, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_MHQ_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="102, 255, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_MNQ_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 255, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_MQ_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 51, 204" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_NQ_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="153, 204, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQExtrem_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ1">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ2">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ5">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 153, 51" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ10">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ20">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="153, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ25">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 51, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ50">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 153, 153" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ100">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 51" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ200">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ300">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 100, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ500">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ1000">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQRZ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HSQ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="253, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_MHQ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 255, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_MNQ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 255, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_MQ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 51, 204" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_NQ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="153, 204, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQExtrem">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="DischargeLongitudinalSectionW">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-
-    <theme name="DischargeLongitudinalSectionC">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0 , 0" />
-        </fields>
-    </theme>
-
-    <theme name="DischargeLongitudinalSectionQ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQInfoldCut">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 102, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQInfolding">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="51, 51, 51" />
-        </fields>
-    </theme>
-
-    <!-- MIDDLE BED HEIGHT -->
-    <theme name="MiddleBedHeightSingle">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="MiddleBedHeightEpoch">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <!-- Bed Quality -->
-    <theme name="PorosityTopLayer">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="PorositySubLayer">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="DensityTopLayer">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="153, 99, 102" />
-        </fields>
-    </theme>
-
-    <theme name="DensitySubLayer">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="153, 99, 102" />
-        </fields>
-    </theme>
-
-    <theme name="BedDiameterTopLayer">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="BedDiameterSubLayer">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="BedLoadDiameter">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 255, 0" />
-        </fields>
-    </theme>
-
-    <!-- Bedheight differences -->
-    <theme name="BedheightDiffYear">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="BedheightDiffMorphWidth">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 0" />
-        </fields>
-    </theme>
-
-    <theme name="BedheightDiffEpoch">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 0, 204" />
-        </fields>
-    </theme>
-
-    <theme name="BedheightDiffAbsHeight1">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 0, 204" />
-        </fields>
-    </theme>
-
-    <theme name="BedheightDiffAbsHeight2">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 100, 100" />
-        </fields>
-    </theme>
-
-    <theme name="BedheightDiffHeightYear">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="MorphologicWidth">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 100, 200" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="h" />
-        </fields>
-    </theme>
-    <!-- Flow velocity -->
-    <theme name="FlowVelocityVMainChannel">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="FlowVelocityVTotalChannel">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="FlowVelocityTau">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="FlowVelocityDischarge">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 204, 0" />
-        </fields>
-    </theme>
-
-    <!-- Sediment load -->
-    <theme name="SedimentLoadCoarse">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="SedimentLoadFineMid">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="255, 0, 0" />
-        </fields>
-    </theme>
-    <theme name="SedimentLoadSand">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="SedimentLoadSuspSand">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="255, 255, 0" />
-        </fields>
-    </theme>
-
-     <theme name="SedimentLoadSediment">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 255, 255" />
-        </fields>
-    </theme>
-     <theme name="SedimentLoadSuspSandBed">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 255, 0" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="h" />
-        </fields>
-    </theme>
-     <theme name="SedimentLoadFineTotalLoad">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="255, 100, 100" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="h" />
-        </fields>
-    </theme>
-    <theme name="SedimentLoadTotal">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 100, 200" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="h" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionArea">
-        <inherits>
-            <inherit from="Areas" />
-        </inherits>
-        <fields>
-            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
-                default="true" hints="hidden" />
-            <field name="areashowborder" type="boolean" display="Begrenzung"
-                default="false" hints="hidden" />
-            <field name="areabordercolor" type="Color" default="0, 0, 0"
-                display="Begrenzungslinienfarbe" hints="hidden" />
-            <field name="showarea" type="boolean" display="Flaeche anzeigen"
-              default="true" hints="hidden" />
-            <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-<!--/themegroup>-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/default/reference.xml
--- a/artifacts/doc/conf/themes/default/reference.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="ReferenceCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="ReferenceCurveNormalized">
-        <inherits>
-            <inherit from="ReferenceCurve" />
-        </inherits>
-        <fields>
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/default/sq-relation.xml
--- a/artifacts/doc/conf/themes/default/sq-relation.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="SQMeasurements">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" default="0, 153, 255" />
-            <field name="showlines" type="boolean" display="Linie anzeigen"
-                default="false" hints="hidden" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="1" hints="hidden" />
-            <field name="linetype" type="Dash" display="Linienart"
-                default="10" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" hints="hidden" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="SQOutliers">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" default="204, 0, 0" />
-            <field name="showlines" type="boolean" display="Linie anzeigen"
-                default="false" hints="hidden" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="1" hints="hidden" />
-            <field name="linetype" type="Dash" display="Linienart"
-                default="10" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" hints="hidden" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="SQCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" default="0, 0, 0" />
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/second.xml
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/doc/conf/themes/second.xml	Tue Jun 11 09:40:56 2013 +0200
@@ -0,0 +1,2097 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<themegroup name="second">
+    <theme name="MainValuesQ">
+        <inherits>
+            <inherit from="Lines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Farbe"
+                default="200, 0, 15" />
+            <field name="textorientation" type="boolean" display="Textausrichtung"
+                default="true" />
+            <field name="showlinelabel" type="boolean"
+                display="Linienbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="MainValuesW">
+        <inherits>
+            <inherit from="Lines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Farbe"
+                default="0, 215, 0" />
+            <field name="textorientation" type="boolean" display="Textausrichtung"
+                default="true" />
+            <field name="showlinelabel" type="boolean"
+                display="Linienbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="MainValuesQVerticalText">
+        <inherits>
+            <inherit from="Lines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Farbe"
+                default="200, 0, 15" />
+            <field name="textorientation" type="boolean" display="Textausrichtung"
+                default="false" />
+            <field name="showlinelabel" type="boolean"
+                display="Linienbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="RelativePoint">
+        <inherits>
+            <inherit from="Points" />
+        </inherits>
+    </theme>
+
+    <theme name="Annotations">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Text" />
+        </inherits>
+        <fields>
+        </fields>
+    </theme>
+
+    <theme name="ManualPoints">
+        <inherits>
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="3" hints="hidden" />
+            <field name="textorientation" type="boolean" display="Textausrichtung"
+                default="true" />
+        </fields>
+    </theme>
+
+    <theme name="WKms">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="WKmsAnnotation">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="3" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="WQKms">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="WQPoints">
+        <inherits>
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Linienfarbe"
+                default="204, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="heightmarks_points">
+        <inherits>
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="Area">
+        <inherits>
+            <inherit from="Areas" />
+        </inherits>
+        <fields>
+            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
+                default="true" hints="hidden" />
+            <field name="areashowborder" type="boolean" display="Begrenzung"
+                default="false" hints="hidden" />
+            <field name="areabordercolor" type="Color" default="0, 0, 0"
+                display="Begrenzungslinienfarbe" hints="hidden" />
+            <field name="showarea" type="boolean" display="Flaeche anzeigen"
+              default="true" hints="hidden" />
+            <field name="showarealabel" type="boolean"
+                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+    <!-- top level classes defining additional attributes-->
+    <theme name="LongitudinalSection">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="MinMaxPoints" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="bandwidth" type="double" display="Bandbreite"
+                default="0"/>
+            <field name="bandwidthcolor" type="Color" display="Bandbreitenfarbe"
+                default="104, 104, 104"/>
+            <field name="transparency" type="int" default="20" display="Transparenz"/>
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionPoints">
+        <inherits>
+            <inherit from="Points" />
+        </inherits>
+        <fields>
+        </fields>
+    </theme>
+
+    <theme name="Differences">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+
+    <!-- Classes defining special values -->
+    <theme name="LongitudinalSectionW_HQ1">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ2">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ5">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 153, 51" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ10">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ20">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="153, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ25">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 51, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ50">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ100">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ200">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 100, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ300">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 100" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ500">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ1000">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQRZ">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HSQ">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="253, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_MHQ">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 255, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_MNQ">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 255, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_MQ">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 51, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_NQ">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="153, 204, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQExtrem">
+        <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ1_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ2_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ5_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 153, 51" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ10_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ20_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="153, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ25_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="102, 51, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ50_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="255, 153, 153" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ100_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="255, 0, 51" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ200_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ300_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="255, 100, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ500_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="102, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQ1000_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQRZ_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="102, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HSQ_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="253, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_MHQ_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="102, 255, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_MNQ_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 255, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_MQ_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 51, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_NQ_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="153, 204, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionW_HQExtrem_Points">
+        <inherits>
+            <inherit from="LongitudinalSectionPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ1">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ2">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ5">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 153, 51" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ10">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ20">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="153, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ25">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 51, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ50">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 153, 153" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ100">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 51" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ200">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ300">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 100, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ500">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQ1000">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQRZ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HSQ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="253, 153, 0" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_MHQ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 255, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_MNQ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 255, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_MQ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 51, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_NQ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="153, 204, 255" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQ_HQExtrem">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="DischargeLongitudinalSectionW">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+
+    <theme name="DischargeLongitudinalSectionC">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0 , 0" />
+        </fields>
+    </theme>
+
+    <theme name="DischargeLongitudinalSectionQ">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQInfoldCut">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="102, 102, 102" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionQInfolding">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="51, 51, 51" />
+        </fields>
+    </theme>
+
+    <!-- MIDDLE BED HEIGHT -->
+    <theme name="MiddleBedHeightSingle">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="MiddleBedHeightEpoch">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <!-- Bed Quality -->
+    <theme name="PorosityTopLayer">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="PorositySubLayer">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="DensityTopLayer">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="153, 99, 102" />
+        </fields>
+    </theme>
+
+    <theme name="DensitySubLayer">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="153, 99, 102" />
+        </fields>
+    </theme>
+
+    <theme name="BedDiameterTopLayer">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="BedDiameterSubLayer">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="BedLoadDiameter">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 255, 0" />
+        </fields>
+    </theme>
+
+    <theme name="BedDiameterDataTop">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="showlines" type="boolean" display="Linie anzeigen" default="false"/>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen" default="true"/>
+            <field name="pointsize" type="int" display="Punktdicke" default="2" />
+            <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 0, 100" />
+        </fields>
+    </theme>
+
+    <theme name="BedDiameterDataSub">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="showlines" type="boolean" display="Linie anzeigen" default="false"/>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen" default="true"/>
+            <field name="pointsize" type="int" display="Punktdicke" default="2" />
+            <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 0, 100" />
+        </fields>
+    </theme>
+
+    <theme name="BedloadDiameterData">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="showlines" type="boolean" display="Linie anzeigen" default="false"/>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen" default="true"/>
+            <field name="pointsize" type="int" display="Punktdicke" default="2" />
+            <field name="pointcolor" type="Color" display="Punktfarbe" default="100, 0, 0" />
+        </fields>
+    </theme>
+    <!-- Bedheight differences -->
+    <theme name="BedheightDiffYear">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="BedheightDiffMorphWidth">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 0" />
+        </fields>
+    </theme>
+
+    <theme name="BedheightDiffEpoch">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 0, 204" />
+        </fields>
+    </theme>
+
+    <theme name="BedheightDiffAbsHeight1">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 0, 204" />
+        </fields>
+    </theme>
+
+    <theme name="BedheightDiffAbsHeight2">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 100, 100" />
+        </fields>
+    </theme>
+
+    <theme name="BedheightDiffHeightYear">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="MorphologicWidth">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 100, 200" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+    <!-- Flow velocity -->
+    <theme name="FlowVelocityVMainChannel">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="FlowVelocityVTotalChannel">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 102" />
+        </fields>
+    </theme>
+
+    <theme name="FlowVelocityTau">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="FlowVelocityDischarge">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 204, 0" />
+        </fields>
+    </theme>
+
+    <!-- Sediment load -->
+    <theme name="SedimentLoadCoarse">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadFineMid">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 0, 0" />
+        </fields>
+    </theme>
+    <theme name="SedimentLoadSand">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="SedimentLoadSuspSand">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 255, 0" />
+        </fields>
+    </theme>
+
+     <theme name="SedimentLoadSediment">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 255, 255" />
+        </fields>
+    </theme>
+     <theme name="SedimentLoadSuspSandBed">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 255, 0" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+     <theme name="SedimentLoadFineTotalLoad">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 100, 100" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+    <theme name="SedimentLoadTotal">
+        <inherits>
+            <inherit from="LongitudinalSection" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 100, 200" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="LongitudinalSectionArea">
+        <inherits>
+            <inherit from="Areas" />
+        </inherits>
+        <fields>
+            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
+                default="true" hints="hidden" />
+            <field name="areashowborder" type="boolean" display="Begrenzung"
+                default="false" hints="hidden" />
+            <field name="areabordercolor" type="Color" default="0, 0, 0"
+                display="Begrenzungslinienfarbe" hints="hidden" />
+            <field name="showarea" type="boolean" display="Flaeche anzeigen"
+              default="true" hints="hidden" />
+            <field name="showarealabel" type="boolean"
+                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+
+
+    <theme name="CrossSection">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="CrossSectionWaterLine">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0,0,153" />
+            <field name="showwidth" type="boolean" display="Breite anzeigen"
+                default="false" />
+            <field name="showlevel" type="boolean" display="Wasserstand anzeigen"
+                default="true" />
+            <field name="showlinelabel" type="boolean" default="true"
+                display="Beschriftung anzeigen" />
+            <field name="showmiddleheight" type="boolean"
+                display="Wasserstand anzeigen" default="false" />
+        </fields>
+    </theme>
+
+    <theme name="Hyk">
+        <inherits>
+            <inherit from="Text" />
+        </inherits>
+        <fields>
+            <field name="textorientation" type="boolean" display="Textausrichtung"
+                default="true" />
+        </fields>
+    </theme>
+
+    <theme name="CrossSectionArea">
+        <inherits>
+            <inherit from="Areas" />
+        </inherits>
+        <fields>
+            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
+                default="true" hints="hidden" />
+            <field name="areashowborder" type="boolean" display="Begrenzung"
+                default="false" hints="hidden" />
+            <field name="areabordercolor" type="Color" default="0, 0, 0"
+                display="Begrenzungslinienfarbe" hints="hidden" />
+            <field name="showarea" type="boolean" display="Flaeche anzeigen"
+              default="true" hints="hidden" />
+            <field name="showarealabel" type="boolean"
+                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+
+
+    <theme name="DischargeCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" hints="hidden" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 153" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="2" />
+        </fields>
+    </theme>
+
+    <theme name="ComputedDischargeCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 153" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="2" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="ComputedDischargeCurveQ">
+        <inherits>
+            <inherit from="ComputedDischargeCurve" />
+            <inherit from="Text" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Farbe"
+                default="200, 0, 15" />
+            <field name="textcolor" type="Color" display="Farbe"
+                default="200, 0, 15" />
+        </fields>
+    </theme>
+
+    <theme name="ComputedDischargeCurveW">
+        <inherits>
+            <inherit from="ComputedDischargeCurve" />
+            <inherit from="Text" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Farbe"
+                default="0, 215, 0" />
+            <field name="textcolor" type="Color" display="Farbe"
+                default="0, 215, 0" />
+            <field name="textorientation" type="boolean" display="Textausrichtung"
+                default="true" />
+        </fields>
+    </theme>
+
+    <theme name="GaugeDischargeCurve">
+        <inherits>
+            <inherit from="DischargeCurve" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 153" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="2" />
+        </fields>
+    </theme>
+
+    <theme name="ExtremeWQCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showextramark" type="boolean" display="Linie anzeigen ab wo extrapoliert wurde"
+                default="true" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 153" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="2" />
+            <field name="showlinelabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />           
+        </fields>
+    </theme>
+
+    <theme name="ExtremeWQBaseCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+        </inherits>
+        <fields>
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="2" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showlinelabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+
+
+    <theme name="DurationCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="2" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false"
+                hints="hidden"/>
+        </fields>
+    </theme>
+
+    <theme name="DurationCurveW">
+        <inherits>
+            <inherit from="DurationCurve" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0,51,204" />
+        </fields>
+    </theme>
+
+    <theme name="DurationCurveQ">
+        <inherits>
+            <inherit from="DurationCurve" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0,204,0" />
+        </fields>
+    </theme>
+
+
+
+    <theme name="FixPoints">
+        <inherits>
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="3" />
+        </fields>
+    </theme>
+
+    <theme name="FixLines">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" hints="hidden" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="3" />
+        </fields>
+    </theme>
+
+    <theme name="FixAreas">
+        <inherits>
+            <inherit from="Areas" />
+        </inherits>
+        <fields>
+            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
+                default="true" hints="hidden" />
+            <field name="areashowborder" type="boolean" display="Begrenzung"
+                default="false" hints="hidden" />
+            <field name="areabordercolor" type="Color" default="0, 0, 0"
+                display="Begrenzungslinienfarbe" hints="hidden" />
+            <field name="showarea" type="boolean" display="Flaeche anzeigen"
+              default="true" hints="hidden" />
+            <field name="showarealabel" type="boolean"
+                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="FixingWQCurve">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="227, 27, 162" />
+        </fields>
+    </theme>
+
+    <theme name="FixingDerivedCurve">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="227, 27, 162" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" hints="hidden" hidden="true" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="5" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorAverageWQ0">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 128, 0" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorAverageWQ1">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 0, 255" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorAverageWQ2">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="255, 0, 255" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorAverageWQ3">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="255, 0, 0" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingAnalysisEventsWQ">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 255, 0" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingReferenceEvents">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 80, 160" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingOutliers">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+        </fields>
+    </theme>
+
+    <theme name="FixingDeltaWtAverage0">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 128, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixingDeltaWtAverage1">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="FixingDeltaWtAverage2">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="FixingDeltaWtAverage3">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="255, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixingDeltaWtAnalysis">
+        <inherits>
+            <inherit from="FixPoints" />
+        </inherits>
+        <fields>
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="true"/>
+            <field name="pointcolor" type="Color" display="Punktfarbe"
+                default="0, 255, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixingLSAverage0">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 128, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixingLSAverage1">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="FixingLSAverage2">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="FixingLSAverage3">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="255, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorDeviationLS0">
+        <inherits>
+            <inherit from="FixAreas" />
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" display="Fuellfarbe"
+                default="0, 128, 0" />
+        </fields>
+    </theme>
+    <theme name="FixingSectorDeviationLS1">
+        <inherits>
+            <inherit from="FixAreas" />
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" display="Fuellfarbe"
+                default="0, 0, 255" />
+
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorDeviationLS2">
+        <inherits>
+            <inherit from="FixAreas" />
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" display="Fuellfarbe"
+                default="255, 0, 255" />
+        </fields>
+    </theme>
+
+    <theme name="FixingSectorDeviationLS3">
+        <inherits>
+            <inherit from="FixAreas" />
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" display="Fuellfarbe"
+                default="255, 0, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixLSDeviation">
+        <inherits>
+            <inherit from="FixAreas" />
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" display="Fuellfarbe"
+                default="100, 100, 100" />
+        </fields>
+    </theme>
+
+    <theme name="FixLSAnalysis">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 255, 0" />
+        </fields>
+    </theme>
+
+    <theme name="FixLSReference">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" default="0, 80, 160" />
+        </fields>
+    </theme>
+
+    <theme name="FixDeltaWtDeviation">
+        <inherits>
+            <inherit from="FixAreas"/>
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" default="0, 0, 0" display="Füllfarbe"/>
+        </fields>
+    </theme>
+
+    <theme name="FixingDeltaWtAnalysisPeriods">
+        <inherits>
+            <inherit from="FixAreas"/>
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" default="255, 0, 0" display="Füllfarbe" />
+        </fields>
+    </theme>
+
+    <theme name="FixingReferencePeriod">
+        <inherits>
+            <inherit from="FixAreas"/>
+        </inherits>
+        <fields>
+            <field name="areabgcolor" type="Color" default="0, 0, 255" display="Füllfarbe" />
+        </fields>
+    </theme>
+
+    <theme name="QSectors">
+        <inherits>
+            <inherit from="FixLines" />
+        </inherits>
+        <fields>
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="true" hints="hidden" />
+        </fields>
+    </theme>
+
+
+
+    <theme name="MapLines">
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 205" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="3" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="Floodmaps">
+        <inherits>
+            <inherit from="Map" />
+        </inherits>
+    </theme>
+
+    <theme name="Floodplains">
+        <inherits>
+            <inherit from="Map" />
+        </inherits>
+    </theme>
+
+    <theme name="Floodmarks">
+        <inherits>
+            <inherit from="MapLines" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+    <theme name="WSPLGEN">
+        <inherits>
+            <inherit from="Uesk" />
+        </inherits>
+        <fields>
+            <field name="startcolor" type="Color"
+                display="Farbverlauf Startfarbe" default="178, 201, 215" />
+            <field name="endcolor" type="Color"
+                display="Farbverlauf Endfarbe" default="2, 27, 42" />
+            <field name="numclasses" type="int" display="Anzahl Klassen"
+                default="6" />
+        </fields>
+    </theme>
+
+    <theme name="RiverAxis">
+        <inherits>
+            <inherit from="MapLines" />
+        </inherits>
+        <fields>
+       </fields>
+    </theme>
+
+    <theme name="Kms">
+        <inherits>
+            <inherit from="MapLines" />
+            <inherit from="Label" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+
+    <theme name="Fixpoints">
+        <inherits>
+            <inherit from="MapLines" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+    <theme name="Floodmarks">
+        <inherits>
+            <inherit from="MapLines" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+
+    <theme name="GaugeLocation">
+        <inherits>
+            <inherit from="MapLines" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+    <theme name="Qps">
+        <inherits>
+            <inherit from="MapLines" />
+        </inherits>
+    </theme>
+
+    <theme name="Hws">
+        <inherits>
+            <inherit from="MapLines" />
+        </inherits>
+    </theme>
+
+    <theme name="HwsPoints">
+        <inherits>
+            <inherit from="MapLines"/>
+            <inherit from="Label" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+    <theme name="Catchment">
+        <inherits>
+            <inherit from="Map" />
+        </inherits>
+    </theme>
+
+    <theme name="FloodmapLines">
+        <inherits>
+            <inherit from="MapLines" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="140, 200, 130" />
+        </fields>
+    </theme>
+
+    <theme name="Buildings">
+        <inherits>
+            <inherit from="MapLines" />
+        </inherits>
+    </theme>
+
+    <theme name="HydrBoundariesLines">
+        <inherits>
+            <inherit from="MapLines" />
+        </inherits>
+    </theme>
+
+    <theme name="HydrBoundariesPolys">
+        <inherits>
+            <inherit from="Map" />
+        </inherits>
+    </theme>
+
+    <theme name="Jetties">
+        <inherits>
+            <inherit from="MapLines"/>
+            <inherit from="Label" />
+            <inherit from="Symbol" />
+        </inherits>
+    </theme>
+
+
+
+    <theme name="HistoricalDischargeCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 153" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="2" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeCurveQ">
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeCurveQDiff">
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeCurveW">
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="100, 100, 153" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeCurveWDiff">
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="250, 250, 204" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeWQCurve">
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 204" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" />
+        </fields>
+    </theme>
+
+    <theme name="HistoricalDischargeWQW">
+        <!-- the facet has no styling...
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 255" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="1" />
+            <field name="linetype" type="Dash" display="Linienart"
+                default="10" />
+            <field name="showlines" type="boolean" display="Linie anzeigen"
+                default="true" hints="hidden" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="3" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>-->
+    </theme>
+
+    <theme name="HistoricalDischargeWQQ">
+        <inherits>
+            <inherit from="HistoricalDischargeCurve" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="1" />
+            <field name="linetype" type="Dash" display="Linienart"
+                default="10" />
+            <field name="showlines" type="boolean" display="Linie anzeigen"
+                default="true" hints="hidden" />
+            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
+                default="false" />
+            <field name="pointsize" type="int" display="Punktdicke"
+                default="3" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+
+
+    <theme name="ReferenceCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+            <inherit from="MinMaxPoints" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="204, 204, 204" />
+        </fields>
+    </theme>
+
+    <theme name="ReferenceCurveNormalized">
+        <inherits>
+            <inherit from="ReferenceCurve" />
+        </inherits>
+        <fields>
+        </fields>
+    </theme>
+
+
+
+    <theme name="SQMeasurements">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" default="0, 153, 255" />
+            <field name="showlines" type="boolean" display="Linie anzeigen"
+                default="false" hints="hidden" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="1" hints="hidden" />
+            <field name="linetype" type="Dash" display="Linienart"
+                default="10" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" hints="hidden" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="SQOutliers">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+        </inherits>
+        <fields>
+            <field name="pointcolor" type="Color" default="204, 0, 0" />
+            <field name="showlines" type="boolean" display="Linie anzeigen"
+                default="false" hints="hidden" />
+            <field name="linesize" type="int" display="Liniendicke"
+                default="1" hints="hidden" />
+            <field name="linetype" type="Dash" display="Linienart"
+                default="10" hints="hidden" />
+            <field name="linecolor" type="Color" display="Linienfarbe"
+                default="0, 0, 0" hints="hidden" />
+            <field name="showlinelabel" type="boolean"
+                display="Beschriftung anzeigen" default="false" hints="hidden" />
+        </fields>
+    </theme>
+
+    <theme name="SQCurve">
+        <inherits>
+            <inherit from="Lines" />
+            <inherit from="Points" />
+            <inherit from="Label" />
+        </inherits>
+        <fields>
+            <field name="showpoints" type="boolean" display="Punkte anzeigen"
+                default="false" />
+            <field name="showpointlabel" type="boolean"
+                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
+            <field name="linecolor" type="Color" default="0, 0, 0" />
+        </fields>
+    </theme>
+</themegroup>
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/second/cross-section.xml
--- a/artifacts/doc/conf/themes/second/cross-section.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="CrossSection">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="CrossSectionWaterLine">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0,0,153" />
-            <field name="showwidth" type="boolean" display="Breite anzeigen"
-                default="false" />
-            <field name="showlevel" type="boolean" display="Wasserstand anzeigen"
-                default="true" />
-            <field name="showlinelabel" type="boolean" default="true"
-                display="Beschriftung anzeigen" />
-            <field name="showmiddleheight" type="boolean"
-                display="Wasserstand anzeigen" default="false" />
-        </fields>
-    </theme>
-
-    <theme name="Hyk">
-        <inherits>
-            <inherit from="Text" />
-        </inherits>
-        <fields>
-            <field name="textorientation" type="boolean" display="Textausrichtung"
-                default="true" />
-        </fields>
-    </theme>
-
-    <theme name="CrossSectionArea">
-        <inherits>
-            <inherit from="Areas" />
-        </inherits>
-        <fields>
-            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
-                default="true" hints="hidden" />
-            <field name="areashowborder" type="boolean" display="Begrenzung"
-                default="false" hints="hidden" />
-            <field name="areabordercolor" type="Color" default="0, 0, 0"
-                display="Begrenzungslinienfarbe" hints="hidden" />
-            <field name="showarea" type="boolean" display="Flaeche anzeigen"
-              default="true" hints="hidden" />
-            <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/second/discharge.xml
--- a/artifacts/doc/conf/themes/second/discharge.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,112 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="DischargeCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" hints="hidden" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 153" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="2" />
-        </fields>
-    </theme>
-
-    <theme name="ComputedDischargeCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 153" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="2" />
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="ComputedDischargeCurveQ">
-        <inherits>
-            <inherit from="ComputedDischargeCurve" />
-            <inherit from="Text" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Farbe"
-                default="200, 0, 15" />
-            <field name="textcolor" type="Color" display="Farbe"
-                default="200, 0, 15" />
-        </fields>
-    </theme>
-
-    <theme name="ComputedDischargeCurveW">
-        <inherits>
-            <inherit from="ComputedDischargeCurve" />
-            <inherit from="Text" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Farbe"
-                default="0, 215, 0" />
-            <field name="textcolor" type="Color" display="Farbe"
-                default="0, 215, 0" />
-            <field name="textorientation" type="boolean" display="Textausrichtung"
-                default="true" />
-        </fields>
-    </theme>
-
-    <theme name="GaugeDischargeCurve">
-        <inherits>
-            <inherit from="DischargeCurve" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 153" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="2" />
-        </fields>
-    </theme>
-
-    <theme name="ExtremeWQCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showextramark" type="boolean" display="Linie anzeigen ab wo extrapoliert wurde"
-                default="true" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 153" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="2" />
-            <field name="showlinelabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />           
-        </fields>
-    </theme>
-
-    <theme name="ExtremeWQBaseCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-        </inherits>
-        <fields>
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="2" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showlinelabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/second/duration.xml
--- a/artifacts/doc/conf/themes/second/duration.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,41 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-
-    <theme name="DurationCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="2" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false"
-                hints="hidden"/>
-        </fields>
-    </theme>
-
-    <theme name="DurationCurveW">
-        <inherits>
-            <inherit from="DurationCurve" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0,51,204" />
-        </fields>
-    </theme>
-
-    <theme name="DurationCurveQ">
-        <inherits>
-            <inherit from="DurationCurve" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0,204,0" />
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/second/fixings.xml
--- a/artifacts/doc/conf/themes/second/fixings.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,342 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="FixPoints">
-        <inherits>
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="3" />
-        </fields>
-    </theme>
-
-    <theme name="FixLines">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" hints="hidden" />
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="3" />
-        </fields>
-    </theme>
-
-    <theme name="FixAreas">
-        <inherits>
-            <inherit from="Areas" />
-        </inherits>
-        <fields>
-            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
-                default="true" hints="hidden" />
-            <field name="areashowborder" type="boolean" display="Begrenzung"
-                default="false" hints="hidden" />
-            <field name="areabordercolor" type="Color" default="0, 0, 0"
-                display="Begrenzungslinienfarbe" hints="hidden" />
-            <field name="showarea" type="boolean" display="Flaeche anzeigen"
-              default="true" hints="hidden" />
-            <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="FixingWQCurve">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="227, 27, 162" />
-        </fields>
-    </theme>
-
-    <theme name="FixingDerivedCurve">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="227, 27, 162" />
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" hints="h" hidden="true" />
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="5" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorAverageWQ0">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 128, 0" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorAverageWQ1">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 0, 255" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorAverageWQ2">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="255, 0, 255" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorAverageWQ3">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="255, 0, 0" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingAnalysisEventsWQ">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 255, 0" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingReferenceEvents">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 80, 160" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingOutliers">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-        </fields>
-    </theme>
-
-    <theme name="FixingDeltaWtAverage0">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 128, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixingDeltaWtAverage1">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="FixingDeltaWtAverage2">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="FixingDeltaWtAverage3">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixingDeltaWtAnalysis">
-        <inherits>
-            <inherit from="FixPoints" />
-        </inherits>
-        <fields>
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="true"/>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 255, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixingLSAverage0">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 128, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixingLSAverage1">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="FixingLSAverage2">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="FixingLSAverage3">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="255, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorDeviationLS0">
-        <inherits>
-            <inherit from="FixAreas" />
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" display="Fuellfarbe"
-                default="0, 128, 0" />
-        </fields>
-    </theme>
-    <theme name="FixingSectorDeviationLS1">
-        <inherits>
-            <inherit from="FixAreas" />
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" display="Fuellfarbe"
-                default="0, 0, 255" />
-
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorDeviationLS2">
-        <inherits>
-            <inherit from="FixAreas" />
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" display="Fuellfarbe"
-                default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="FixingSectorDeviationLS3">
-        <inherits>
-            <inherit from="FixAreas" />
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" display="Fuellfarbe"
-                default="255, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixLSDeviation">
-        <inherits>
-            <inherit from="FixAreas" />
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" display="Fuellfarbe"
-                default="100, 100, 100" />
-        </fields>
-    </theme>
-
-    <theme name="FixLSAnalysis">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 255, 0" />
-        </fields>
-    </theme>
-
-    <theme name="FixLSReference">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 80, 160" />
-        </fields>
-    </theme>
-
-    <theme name="FixDeltaWtDeviation">
-        <inherits>
-            <inherit from="FixAreas"/>
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" default="0, 0, 0" display="Füllfarbe"/>
-        </fields>
-    </theme>
-
-    <theme name="FixingDeltaWtAnalysisPeriods">
-        <inherits>
-            <inherit from="FixAreas"/>
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" default="255, 0, 0" display="Füllfarbe" />
-        </fields>
-    </theme>
-
-    <theme name="FixingReferencePeriod">
-        <inherits>
-            <inherit from="FixAreas"/>
-        </inherits>
-        <fields>
-            <field name="areabgcolor" type="Color" default="0, 0, 255" display="Füllfarbe" />
-        </fields>
-    </theme>
-
-    <theme name="QSectors">
-        <inherits>
-            <inherit from="FixLines" />
-        </inherits>
-        <fields>
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="true" hints="h" />
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/second/floodmap.xml
--- a/artifacts/doc/conf/themes/second/floodmap.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,139 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="MapLines">
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 205" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="3" hints="h" />
-        </fields>
-    </theme>
-
-    <theme name="Floodmaps">
-        <inherits>
-            <inherit from="Map" />
-        </inherits>
-    </theme>
-
-    <theme name="Floodplains">
-        <inherits>
-            <inherit from="Map" />
-        </inherits>
-    </theme>
-
-    <theme name="Floodmarks">
-        <inherits>
-            <inherit from="MapLines" />
-            <inherit from="Symbol" />
-        </inherits>
-    </theme>
-
-    <theme name="WSPLGEN">
-        <inherits>
-            <inherit from="Uesk" />
-        </inherits>
-        <fields>
-            <field name="startcolor" type="Color"
-                display="Farbverlauf Startfarbe" default="178, 201, 215" />
-            <field name="endcolor" type="Color"
-                display="Farbverlauf Endfarbe" default="2, 27, 42" />
-            <field name="numclasses" type="int" display="Anzahl Klassen"
-                default="6" />
-        </fields>
-    </theme>
-
-    <theme name="RiverAxis">
-        <inherits>
-            <inherit from="MapLines" />
-        </inherits>
-        <fields>
-       </fields>
-    </theme>
-
-    <theme name="Kms">
-        <inherits>
-            <inherit from="MapLines" />
-            <inherit from="Label" />
-            <inherit from="Symbol" />
-        </inherits>
-    </theme>
-
-
-    <theme name="Fixpoints">
-        <inherits>
-            <inherit from="MapLines" />
-            <inherit from="Symbol" />
-        </inherits>
-    </theme>
-
-
-    <theme name="GaugeLocation">
-        <inherits>
-            <inherit from="MapLines" />
-            <inherit from="Symbol" />
-        </inherits>
-    </theme>
-
-
-    <theme name="Qps">
-        <inherits>
-            <inherit from="MapLines" />
-        </inherits>
-    </theme>
-
-    <theme name="Hws">
-        <inherits>
-            <inherit from="MapLines" />
-        </inherits>
-    </theme>
-
-    <theme name="HwsPoints">
-        <inherits>
-            <inherit from="MapLines"/>
-            <inherit from="Label" />
-            <inherit from="Symbol" />
-        </inherits>
-    </theme>
-
-    <theme name="Catchment">
-        <inherits>
-            <inherit from="Map" />
-        </inherits>
-    </theme>
-
-    <theme name="FloodmapLines">
-        <inherits>
-            <inherit from="MapLines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="140, 200, 130" />
-        </fields>
-    </theme>
-
-    <theme name="Buildings">
-        <inherits>
-            <inherit from="MapLines" />
-        </inherits>
-    </theme>
-
-    <theme name="HydrBoundariesLines">
-        <inherits>
-            <inherit from="MapLines" />
-        </inherits>
-    </theme>
-
-    <theme name="HydrBoundariesPolys">
-        <inherits>
-            <inherit from="Map" />
-        </inherits>
-    </theme>
-
-    <theme name="Jetties">
-        <inherits>
-            <inherit from="MapLines"/>
-            <inherit from="Label" />
-            <inherit from="Symbol" />
-        </inherits>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/second/general.xml
--- a/artifacts/doc/conf/themes/second/general.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="MainValuesQ">
-        <inherits>
-            <inherit from="Lines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Farbe"
-                default="200, 0, 15" />
-            <field name="textorientation" type="boolean" display="Textausrichtung"
-                default="true" />
-            <field name="showlinelabel" type="boolean"
-                display="Linienbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="MainValuesW">
-        <inherits>
-            <inherit from="Lines" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Farbe"
-                default="0, 215, 0" />
-            <field name="textorientation" type="boolean" display="Textausrichtung"
-                default="true" />
-            <field name="showlinelabel" type="boolean"
-                display="Linienbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="RelativePoint">
-        <inherits>
-            <inherit from="Points" />
-        </inherits>
-    </theme>
-
-    <theme name="Annotations">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Text" />
-        </inherits>
-        <fields>
-        </fields>
-    </theme>
-
-    <theme name="ManualPoints">
-        <inherits>
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="3" hints="hidden" />
-            <field name="textorientation" type="boolean" display="Textausrichtung"
-                default="true" />
-        </fields>
-    </theme>
-
-    <theme name="WKms">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="WKmsAnnotation">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="3" hints="h" />
-        </fields>
-    </theme>
-
-    <theme name="WQKms">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="WQPoints">
-        <inherits>
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Linienfarbe"
-                default="204, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="heightmarks_points">
-        <inherits>
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="Area">
-        <inherits>
-            <inherit from="Areas" />
-        </inherits>
-        <fields>
-            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
-                default="true" hints="hidden" />
-            <field name="areashowborder" type="boolean" display="Begrenzung"
-                default="false" hints="hidden" />
-            <field name="areabordercolor" type="Color" default="0, 0, 0"
-                display="Begrenzungslinienfarbe" hints="hidden" />
-            <field name="showarea" type="boolean" display="Flaeche anzeigen"
-              default="true" hints="hidden" />
-            <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/second/historical-discharge.xml
--- a/artifacts/doc/conf/themes/second/historical-discharge.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,140 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="HistoricalDischargeCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 153" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="2" />
-        </fields>
-    </theme>
-
-    <theme name="HistoricalDischargeCurveQ">
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="HistoricalDischargeCurveQDiff">
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="HistoricalDischargeCurveW">
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="100, 100, 153" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="HistoricalDischargeCurveWDiff">
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="250, 250, 204" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="HistoricalDischargeWQCurve">
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 204" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" />
-        </fields>
-    </theme>
-
-    <theme name="HistoricalDischargeWQW">
-        <!-- the facet has no styling...
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 255" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="1" />
-            <field name="linetype" type="Dash" display="Linienart"
-                default="10" />
-            <field name="showlines" type="boolean" display="Linie anzeigen"
-                default="true" hints="hidden" />
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" />
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="3" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>-->
-    </theme>
-
-    <theme name="HistoricalDischargeWQQ">
-        <inherits>
-            <inherit from="HistoricalDischargeCurve" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-            <field name="linesize" type="int" display="Liniendicke"
-                default="1" />
-            <field name="linetype" type="Dash" display="Linienart"
-                default="10" />
-            <field name="showlines" type="boolean" display="Linie anzeigen"
-                default="true" hints="hidden" />
-            <field name="showpoints" type="boolean" display="Datenpunkte anzeigen"
-                default="false" />
-            <field name="pointsize" type="int" display="Punktdicke"
-                default="3" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/second/longitudinal-section.xml
--- a/artifacts/doc/conf/themes/second/longitudinal-section.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,945 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <!-- top level classes defining additional attributes-->
-    <theme name="LongitudinalSection">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="MinMaxPoints" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="bandwidth" type="double" display="Bandbreite"
-                default="0"/>
-            <field name="bandwidthcolor" type="Color" display="Bandbreitenfarbe"
-                default="104, 104, 104"/>
-            <field name="transparency" type="int" default="20" display="Transparenz"/>
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionPoints">
-        <inherits>
-            <inherit from="Points" />
-        </inherits>
-        <fields>
-        </fields>
-    </theme>
-
-    <theme name="Differences">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-
-    <!-- Classes defining special values -->
-    <theme name="LongitudinalSectionW_HQ1">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ2">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ5">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 153, 51" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ10">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ20">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="153, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ25">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 51, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ50">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ100">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ200">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 100, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ300">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 100" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ500">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ1000">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQRZ">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HSQ">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="253, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_MHQ">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 255, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_MNQ">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 255, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_MQ">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 51, 204" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_NQ">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="153, 204, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQExtrem">
-        <inherits>
-            <inherit from="LongitudinalSectionW" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ1_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ2_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ5_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 153, 51" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ10_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ20_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="153, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ25_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="102, 51, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ50_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="255, 153, 153" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ100_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="255, 0, 51" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ200_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ300_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="255, 100, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ500_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="102, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQ1000_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQRZ_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="102, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HSQ_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="253, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_MHQ_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="102, 255, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_MNQ_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 255, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_MQ_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 51, 204" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_NQ_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="153, 204, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionW_HQExtrem_Points">
-        <inherits>
-            <inherit from="LongitudinalSectionPoints" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" display="Punktfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ1">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ2">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ5">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 153, 51" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ10">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ20">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="153, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ25">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 51, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ50">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 153, 153" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ100">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 51" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ200">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ300">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 100, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ500">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQ1000">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQRZ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HSQ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="253, 153, 0" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_MHQ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="102, 255, 102" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_MNQ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 255, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_MQ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 51, 204" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_NQ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="153, 204, 255" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionQ_HQExtrem">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="DischargeLongitudinalSectionW">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-
-    <theme name="DischargeLongitudinalSectionC">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0 , 0" />
-        </fields>
-    </theme>
-
-    <theme name="DischargeLongitudinalSectionQ">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-    <!-- MIDDLE BED HEIGHT -->
-    <theme name="MiddleBedHeightSingle">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="MiddleBedHeightEpoch">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <!-- Bed Quality -->
-    <theme name="PorosityTopLayer">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="PorositySubLayer">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="DensityTopLayer">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="153, 99, 102" />
-        </fields>
-    </theme>
-
-    <theme name="DensitySubLayer">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="153, 99, 102" />
-        </fields>
-    </theme>
-
-    <theme name="BedDiameterTopLayer">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="BedDiameterSubLayer">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="BedLoadDiameter">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 255, 0" />
-        </fields>
-    </theme>
-
-    <!-- Bedheight differences -->
-    <theme name="BedheightDiffYear">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="BedheightDiffMorphWidth">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 0" />
-        </fields>
-    </theme>
-
-    <theme name="BedheightDiffEpoch">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 0, 204" />
-        </fields>
-    </theme>
-
-    <theme name="BedheightDiffAbsHeight1">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 0, 204" />
-        </fields>
-    </theme>
-
-    <theme name="BedheightDiffAbsHeight2">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="255, 100, 100" />
-        </fields>
-    </theme>
-
-    <theme name="BedheightDiffHeightYear">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 0, 0" />
-        </fields>
-    </theme>
-
-    <!-- Flow velocity -->
-    <theme name="FlowVelocityVMainChannel">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="FlowVelocityVTotalChannel">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 102" />
-        </fields>
-    </theme>
-
-    <theme name="FlowVelocityTau">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="FlowVelocityDischarge">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 204, 0" />
-        </fields>
-    </theme>
-
-    <!-- Sediment load -->
-    <theme name="SedimentLoadCoarse">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="255, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="SedimentLoadFineMid">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="255, 0, 0" />
-        </fields>
-    </theme>
-    <theme name="SedimentLoadSand">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 0, 255" />
-        </fields>
-    </theme>
-
-    <theme name="SedimentLoadSuspSand">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="255, 255, 0" />
-        </fields>
-    </theme>
-
-     <theme name="SedimentLoadSediment">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 255, 255" />
-        </fields>
-    </theme>
-     <theme name="SedimentLoadSuspSandBed">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 255, 0" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="h" />
-        </fields>
-    </theme>
-     <theme name="SedimentLoadFineTotalLoad">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="255, 100, 100" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="h" />
-        </fields>
-    </theme>
-     <theme name="SedimentLoadTotal">
-        <inherits>
-            <inherit from="LongitudinalSection" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="0, 100, 200" />
-            <field name="showlinelabel" type="boolean"
-                display="Beschriftung anzeigen" default="false" hints="h" />
-        </fields>
-    </theme>
-
-    <theme name="LongitudinalSectionArea">
-        <inherits>
-            <inherit from="Areas" />
-        </inherits>
-        <fields>
-            <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
-                default="true" hints="hidden" />
-            <field name="areashowborder" type="boolean" display="Begrenzung"
-                default="false" hints="hidden" />
-            <field name="areabordercolor" type="Color" default="0, 0, 0"
-                display="Begrenzungslinienfarbe" hints="hidden" />
-            <field name="showarea" type="boolean" display="Flaeche anzeigen"
-              default="true" hints="hidden" />
-            <field name="showarealabel" type="boolean"
-                display="Flächenbeschriftung anzeigen" default="false" hints="hidden" />
-        </fields>
-    </theme>
-<!--/themegroup>-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/second/reference.xml
--- a/artifacts/doc/conf/themes/second/reference.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="ReferenceCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-            <inherit from="MinMaxPoints" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="204, 204, 204" />
-        </fields>
-    </theme>
-
-    <theme name="ReferenceCurveNormalized">
-        <inherits>
-            <inherit from="ReferenceCurve" />
-        </inherits>
-        <fields>
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/doc/conf/themes/second/sq-relation.xml
--- a/artifacts/doc/conf/themes/second/sq-relation.xml	Wed Jun 05 11:56:38 2013 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--themegroup name="default"-->
-    <theme name="SQMeasurements">
-        <inherits>
-            <inherit from="Points" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" default="0, 153, 255" />
-        </fields>
-    </theme>
-
-    <theme name="SQOutliers">
-        <inherits>
-            <inherit from="Points" />
-        </inherits>
-        <fields>
-            <field name="pointcolor" type="Color" default="204, 0, 0" />
-        </fields>
-    </theme>
-
-    <theme name="SQCurve">
-        <inherits>
-            <inherit from="Lines" />
-            <inherit from="Points" />
-            <inherit from="Label" />
-        </inherits>
-        <fields>
-            <field name="showpoints" type="boolean" display="Punkte anzeigen"
-                default="false" />
-            <field name="showpointlabel" type="boolean"
-                display="Punktbeschriftung anzeigen" default="false" hints="hidden" />
-            <field name="linecolor" type="Color" default="0, 0, 0" />
-        </fields>
-    </theme>
-<!--/themegroup-->
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java	Tue Jun 11 09:40:56 2013 +0200
@@ -145,8 +145,6 @@
         addStringData(DATA_IS_NEWEST, newString);
         addStringData(DATA_IS_MASTER, newString);
 
-        StaticState state = (StaticState) getCurrentState(context);
-
         if (!fs.isEmpty()) {
             addFacets(getCurrentStateId(), fs);
         }
@@ -162,7 +160,7 @@
     {
         D4EArtifact flys = (D4EArtifact) artifact;
 
-        RangeAccess rangeAccess = new RangeAccess(flys, null);
+        RangeAccess rangeAccess = new RangeAccess(flys);
         double[] range = rangeAccess.getKmRange();
         double min = 0.0f;
         if (range != null && range.length > 0) {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Tue Jun 11 09:40:56 2013 +0200
@@ -17,8 +17,6 @@
 import java.util.Map;
 import java.util.Set;
 import java.util.TreeMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 
 import javax.xml.xpath.XPathConstants;
 
@@ -86,12 +84,11 @@
     public static final String XPATH_FILTER =
         "/art:action/art:filter/art:out";
 
-    public static final Pattern CONTAINS_OUT =
-        Pattern.compile( "^(.*):OUT=(.+)$");
-
     /** Path to 'ids' (data) in doc that comes from datacage. */
     public static final String XPATH_IDS = "/art:action/art:ids/@value";
 
+    /** Path to 'target_out' (data) in doc that comes from datacage. */
+    public static final String XPATH_TARGET_OUT = "/art:action/art:target_out/@value";
 
     /** The constant string that shows that an operation was successful. */
     public static final String OPERATION_SUCCESSFUL = "SUCCESS";
@@ -120,7 +117,7 @@
      */
     protected Map<String, List<Facet>> filterFacets;
 
-    protected String boundToOut;
+    private String boundToOut;
 
 
     /**
@@ -194,11 +191,7 @@
         CallMeta        callMeta,
         Document        data)
     {
-        boolean debug = log.isDebugEnabled();
-
-        if (debug) {
-            log.debug("Setup this artifact with the uuid: " + identifier);
-        }
+        log.debug("Setup this artifact with the uuid: " + identifier);
 
         super.setup(identifier, factory, context, callMeta, data);
 
@@ -208,9 +201,7 @@
 
         String name = getName();
 
-        if (debug) {
-            log.debug("setup(): Set initial state for artifact '" + name + "'");
-        }
+        log.debug("setup(): Set initial state for artifact '" + name + "'");
 
         if (states == null) {
             log.error("No states found from which an initial "
@@ -241,21 +232,13 @@
     }
 
     protected void extractOut(Document data) {
-        log.debug("extractOut");
-        String ids = XMLUtils.xpathString(data, XPATH_IDS,
+        String targetOut = XMLUtils.xpathString(data, XPATH_TARGET_OUT,
             ArtifactNamespaceContext.INSTANCE);
+        if (targetOut.isEmpty()) {
+            targetOut = null;
+        }
 
-        log.debug("ids: '" + ids + "'");
-        if (ids != null) {
-            Matcher m = CONTAINS_OUT.matcher(ids);
-            if (m.matches()) {
-                boundToOut = m.group(2);
-                log.debug("Bound to out :'" + boundToOut + "'");
-            }
-            else {
-                log.debug("does not match");
-            }
-        }
+        setBoundToOut(targetOut);
     }
 
     /**
@@ -264,17 +247,9 @@
      * @return the id element value of data document.
      */
     public static String getDatacageIDValue(Document data) {
-
         String ids = XMLUtils.xpathString(data, XPATH_IDS,
             ArtifactNamespaceContext.INSTANCE);
 
-        if (ids != null) {
-            Matcher m = CONTAINS_OUT.matcher(ids);
-            if (m.matches()) {
-                ids = m.group(1);
-            }
-        }
-
         return ids;
     }
 
@@ -977,9 +952,18 @@
      * @param facet that defines index and name of facet searched.
      * @return facet instance or null if not found.
      */
-    public Facet getNativeFacet(Facet facet) {
+    public Facet getNativeFacet(Facet facet, String outName) {
         String name  = facet.getName();
         int    index = facet.getIndex();
+        if (getBoundToOut() != null && !getBoundToOut().isEmpty() &&
+                !getBoundToOut().equals(outName)) {
+            log.debug(name + ": not returning facets for " + outName +
+                    " because bound to " + getBoundToOut());
+            return null;
+        }
+        log.debug("Facet: " + facet.getName());
+        log.debug("Bound to out: " + getBoundToOut());
+        log.debug("OutName: " + outName);
 
         for (List<Facet> fs: facets.values()) {
             for (Facet f: fs) {
@@ -1497,6 +1481,9 @@
      * @param facets List of facets to be stored
      */
     protected void addFacets(String id, List<Facet> facets) {
+        for (Facet fac : facets) {
+            fac.setBoundToOut(getBoundToOut());
+        }
         this.facets.put(id, facets);
     }
 
@@ -1509,7 +1496,8 @@
         // Include uuid, type, name
         log.debug(" - Name: " + getName());
         log.debug(" - UUID: " + identifier());
-        log.debug(" - Class: " + this.getClass().getName());
+        log.debug(" - Class: " + getClass().getName());
+        log.debug(" - BoundToOut: " + getBoundToOut());
 
         log.debug("------ DUMP DATA ------");
         Collection<StateData> allData = data.values();
@@ -1545,6 +1533,7 @@
             List<Facet> fs = entry.getValue();
             for (Facet f: fs) {
                 log.debug("  # " + out + " : " + f.getName());
+                log.debug("  # boundToOut : " + f.getBoundToOut());
             }
         }
 
@@ -1618,11 +1607,23 @@
      * @return List of Facets belonging to the state identifier
      */
     protected List<Facet> getFacets(String stateid) {
-        return this.facets.get(stateid);
+        return facets.get(stateid);
     }
 
     public String getBoundToOut() {
         return boundToOut;
     }
+
+    /**
+     * Binds this artifact and all its facet to an out
+     */
+    public void setBoundToOut(String out) {
+        boundToOut = out;
+        for (List<Facet> stateFacets: facets.values()) {
+            for (Facet fac: stateFacets) {
+                fac.setBoundToOut(out);
+            }
+        }
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/MainValuesArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/MainValuesArtifact.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/MainValuesArtifact.java	Tue Jun 11 09:40:56 2013 +0200
@@ -240,7 +240,7 @@
     protected void initialize(Artifact artifact, Object context, CallMeta meta) {
         logger.debug("MainValuesArtifact.initialize");
         D4EArtifact winfo = (D4EArtifact) artifact;
-        RangeAccess rangeAccess = new RangeAccess(winfo, null);
+        RangeAccess rangeAccess = new RangeAccess(winfo);
         double [] locations = rangeAccess.getKmRange();
 
         if (locations != null) {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java	Tue Jun 11 09:40:56 2013 +0200
@@ -18,6 +18,8 @@
 
 import org.dive4elements.artifacts.ArtifactNamespaceContext;
 import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.artifacts.ArtifactFactory;
+import org.dive4elements.artifacts.CallMeta;
 
 import org.dive4elements.artifactdatabase.data.StateData;
 import org.dive4elements.artifactdatabase.ProtocolUtils;
@@ -125,5 +127,17 @@
 
         return outs;
     }
+
+    @Override
+    public void setup(
+        String          identifier,
+        ArtifactFactory factory,
+        Object          context,
+        CallMeta        callMeta,
+        Document        data)
+    {
+        logger.debug("StaticD4EArtifact.setup");
+        super.setup(identifier, factory, context, callMeta, data);
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java	Tue Jun 11 09:40:56 2013 +0200
@@ -242,7 +242,7 @@
             return error(new WQKms[0], "no.wst.for.selected.river");
         }
 
-        RangeAccess rangeAccess = new RangeAccess(this, null);
+        RangeAccess rangeAccess = new RangeAccess(this);
         double [] range = rangeAccess.getKmRange();
         if (range == null) {
             return error(new WQKms[0], "no.range.found");
@@ -321,7 +321,7 @@
            return error(null, "no.gauge.selected");
         }
 
-        RangeAccess rangeAccess = new RangeAccess(this, null);
+        RangeAccess rangeAccess = new RangeAccess(this);
         double[] locations = rangeAccess.getLocations();
 
         if (locations == null) {
@@ -379,7 +379,7 @@
             return error(new WQKms[0], "no.river.selected");
         }
 
-        RangeAccess rangeAccess = new RangeAccess(this, null);
+        RangeAccess rangeAccess = new RangeAccess(this);
         double[] locations = rangeAccess.getLocations();
 
         if (locations == null) {
@@ -677,7 +677,7 @@
             return null;
         }
 
-        RangeAccess rangeAccess = new RangeAccess(this, null);
+        RangeAccess rangeAccess = new RangeAccess(this);
         double [] range = rangeAccess.getKmRange();
         if (range == null) {
             logger.warn("no ranges found");
@@ -849,7 +849,7 @@
      */
     public double[] getKms() {
         if (isRange()) {
-            RangeAccess rangeAccess = new RangeAccess(this, null);
+            RangeAccess rangeAccess = new RangeAccess(this);
             double [] distance = rangeAccess.getKmRange();
             return getKms(distance);
 
@@ -864,7 +864,7 @@
         if (!isRange()) {
             return null;
         }
-        RangeAccess rangeAccess = new RangeAccess(this, null);
+        RangeAccess rangeAccess = new RangeAccess(this);
         double [] fromTo = rangeAccess.getKmRange();
 
         if (fromTo == null) {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java	Tue Jun 11 09:40:56 2013 +0200
@@ -22,14 +22,14 @@
 extends RiverAccess
 {
     private static Logger logger = Logger.getLogger(BedDifferencesAccess.class);
-    private String yearEpoch;
-    private String[] diffs;
 
-    private CallContext context;
+    private String    yearEpoch;
+    private String [] diffs;
 
-    public BedDifferencesAccess(D4EArtifact artifact, CallContext context) {
+    private String [][] differenceArtifactIds;
+
+    public BedDifferencesAccess(D4EArtifact artifact) {
         super(artifact);
-        this.context = context;
     }
 
     public String getYearEpoch() {
@@ -37,20 +37,62 @@
         return yearEpoch;
     }
 
-    public D4EArtifact[][] getDifferenceArtifacts() {
-        diffs = getString("diffids").split("#");
-        logger.debug("diffs: " + Arrays.toString(diffs));
-        D4EArtifact[][] artifacts = new D4EArtifact[diffs.length/2][2];
-        for (int i = 0; i < diffs.length; i += 2) {
+    public String [] getDiffs() {
+        if (diffs == null) {
+            diffs = getString("diffids").split("#");
+            if (logger.isDebugEnabled()) {
+                logger.debug("diffs: " + Arrays.toString(diffs));
+            }
+        }
+        return diffs;
+    }
+
+    public String[][] getDifferenceArtifactIds() {
+
+        if (differenceArtifactIds == null) {
+            String [] diffs = getDiffs();
+            differenceArtifactIds = new String[diffs.length/2][2];
+            for (int i = 0; i < diffs.length/2; i++) {
+                String diff1 = StringUtil.unbracket(diffs[0 + 2*i]);
+                String diff2 = StringUtil.unbracket(diffs[1 + 2*i]);
+                String[] diff1parts = diff1.split(";");
+                String[] diff2parts = diff2.split(";");
+                if (logger.isDebugEnabled()) {
+                    logger.debug("creating 2 artifacts." + diff1parts[0] + "; " + diff2parts[0]);
+                }
+                differenceArtifactIds[i][0] = diff1parts[0];
+                differenceArtifactIds[i][1] = diff2parts[0];
+            }
+        }
+
+        return differenceArtifactIds;
+    }
+
+    public String[] getDifferenceArtifactNamePairs() {
+
+        String [] diffs = getDiffs();
+        String [] result = new String[diffs.length/2];
+        for (int i = 0; i < diffs.length/2; i++) {
             String diff1 = StringUtil.unbracket(diffs[0 + 2*i]);
             String diff2 = StringUtil.unbracket(diffs[1 + 2*i]);
             String[] diff1parts = diff1.split(";");
             String[] diff2parts = diff2.split(";");
-            logger.debug("creating 2 artifacts." + diff1parts[0] + "; " + diff2parts[0]);
-            artifacts[i][0] = RiverUtils.getArtifact(diff1parts[0], context);
-            artifacts[i][1] = RiverUtils.getArtifact(diff2parts[0], context);
+            result[i] = diff1parts[3] + " - " + diff2parts[3];
         }
-        return artifacts;
+
+        return result;
+    }
+
+    public int [][] extractHeightIds(CallContext context) {
+        String [][] artifactsIds = getDifferenceArtifactIds();
+        int [][] ids = new int[artifactsIds.length][2];
+        for (int i = 0; i < artifactsIds.length; ++i) {
+            D4EArtifact a1 = RiverUtils.getArtifact(artifactsIds[i][0], context);
+            D4EArtifact a2 = RiverUtils.getArtifact(artifactsIds[i][1], context);
+            ids[i][0] = getHeightId(a1);
+            ids[i][1] = getHeightId(a2);
+        }
+        return ids;
     }
 
     public static int getHeightId(D4EArtifact artifact) {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedHeightAccess.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedHeightAccess.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedHeightAccess.java	Tue Jun 11 09:40:56 2013 +0200
@@ -10,8 +10,6 @@
 
 import java.util.List;
 
-import org.dive4elements.artifacts.CallContext;
-
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.model.minfo.BedHeight;
 import org.dive4elements.river.artifacts.model.minfo.BedHeightFactory;
@@ -35,8 +33,8 @@
 
     private String time;
 
-    public BedHeightAccess(D4EArtifact artifact, CallContext context) {
-        super(artifact, context);
+    public BedHeightAccess(D4EArtifact artifact) {
+        super(artifact);
     }
 
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedQualityAccess.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedQualityAccess.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedQualityAccess.java	Tue Jun 11 09:40:56 2013 +0200
@@ -8,6 +8,7 @@
 
 package org.dive4elements.river.artifacts.access;
 
+import java.util.ArrayList;
 import java.util.Date;
 import java.util.LinkedList;
 import java.util.List;
@@ -33,7 +34,7 @@
 
 
     public BedQualityAccess(D4EArtifact artifact, CallContext context) {
-        super(artifact, context);
+        super(artifact);
     }
 
     public List<DateRange> getDateRanges() {
@@ -48,6 +49,9 @@
         if (bedDiameter == null && value != null) {
             bedDiameter = extractDiameter(value);
         }
+        if (bedDiameter == null) {
+            return new ArrayList<String>();
+        }
         return bedDiameter;
     }
 
@@ -56,6 +60,9 @@
         if (bedloadDiameter == null && value != null) {
             bedloadDiameter = extractDiameter(value);
         }
+        if (bedloadDiameter == null) {
+            return new ArrayList<String>();
+        }
         return bedloadDiameter;
     }
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/access/Calculation4Access.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/Calculation4Access.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/Calculation4Access.java	Tue Jun 11 09:40:56 2013 +0200
@@ -34,7 +34,7 @@
 
 
     public Calculation4Access(D4EArtifact artifact) {
-        super(artifact, null);
+        super(artifact);
     }
 
     public List<Segment> getSegments() {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/access/ExtremeAccess.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/ExtremeAccess.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/ExtremeAccess.java	Tue Jun 11 09:40:56 2013 +0200
@@ -8,8 +8,6 @@
 
 package org.dive4elements.river.artifacts.access;
 
-import org.dive4elements.artifacts.CallContext;
-
 import org.dive4elements.river.artifacts.D4EArtifact;
 
 import org.dive4elements.river.artifacts.model.RangeWithValues;
@@ -38,8 +36,8 @@
     protected List<RangeWithValues> ranges;
 
 
-    public ExtremeAccess(D4EArtifact artifact, CallContext context) {
-        super(artifact, context);
+    public ExtremeAccess(D4EArtifact artifact) {
+        super(artifact);
     }
 
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAccess.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAccess.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAccess.java	Tue Jun 11 09:40:56 2013 +0200
@@ -8,7 +8,6 @@
 
 package org.dive4elements.river.artifacts.access;
 
-import org.dive4elements.artifacts.CallContext;
 import org.dive4elements.river.artifacts.D4EArtifact;
 
 import java.util.Arrays;
@@ -33,8 +32,8 @@
 
     protected String  function;
 
-    public FixAccess(D4EArtifact artifact, CallContext context) {
-        super(artifact, context);
+    public FixAccess(D4EArtifact artifact) {
+        super(artifact);
     }
 
     public Long getStart() {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAnalysisAccess.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAnalysisAccess.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAnalysisAccess.java	Tue Jun 11 09:40:56 2013 +0200
@@ -9,7 +9,6 @@
 package org.dive4elements.river.artifacts.access;
 
 import org.dive4elements.artifactdatabase.data.StateData;
-import org.dive4elements.artifacts.CallContext;
 
 import org.dive4elements.river.artifacts.D4EArtifact;
 
@@ -30,8 +29,8 @@
 
     protected double [] qs;
 
-    public FixAnalysisAccess(D4EArtifact artifact, CallContext context) {
-        super(artifact, context);
+    public FixAnalysisAccess(D4EArtifact artifact) {
+        super(artifact);
     }
 
     public DateRange getReferencePeriod() {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixRealizingAccess.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixRealizingAccess.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixRealizingAccess.java	Tue Jun 11 09:40:56 2013 +0200
@@ -8,7 +8,6 @@
 
 package org.dive4elements.river.artifacts.access;
 
-import org.dive4elements.artifacts.CallContext;
 import org.dive4elements.river.artifacts.D4EArtifact;
 
 import org.dive4elements.river.artifacts.model.Segment;
@@ -28,8 +27,8 @@
 
     protected List<Segment> segments;
 
-    public FixRealizingAccess(D4EArtifact artifact, CallContext context) {
-        super(artifact, context);
+    public FixRealizingAccess(D4EArtifact artifact) {
+        super(artifact);
     }
 
     public Boolean isQ() {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/access/FlowVelocityAccess.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FlowVelocityAccess.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FlowVelocityAccess.java	Tue Jun 11 09:40:56 2013 +0200
@@ -8,8 +8,6 @@
 
 package org.dive4elements.river.artifacts.access;
 
-import org.dive4elements.artifacts.CallContext;
-
 import org.dive4elements.river.artifacts.D4EArtifact;
 
 
@@ -21,8 +19,8 @@
     private int[] mainChannels;
     private int[] totalChannels;
 
-    public FlowVelocityAccess(D4EArtifact artifact, CallContext context) {
-        super(artifact, context);
+    public FlowVelocityAccess(D4EArtifact artifact) {
+        super(artifact);
     }
 
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/access/GaugeAccess.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/GaugeAccess.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/GaugeAccess.java	Tue Jun 11 09:40:56 2013 +0200
@@ -10,7 +10,6 @@
 
 import org.apache.log4j.Logger;
 
-import org.dive4elements.artifacts.CallContext;
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.utils.RiverUtils;
 
@@ -21,8 +20,8 @@
 {
     private static Logger logger = Logger.getLogger(GaugeAccess.class);
 
-    public GaugeAccess(D4EArtifact artifact, CallContext context) {
-        super(artifact, context);
+    public GaugeAccess(D4EArtifact artifact) {
+        super(artifact);
     }
 
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/access/MapAccess.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/MapAccess.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/MapAccess.java	Tue Jun 11 09:40:56 2013 +0200
@@ -12,7 +12,6 @@
 import java.util.Arrays;
 import java.util.List;
 
-import org.dive4elements.artifacts.CallContext;
 import org.dive4elements.river.artifacts.D4EArtifact;
 
 
@@ -20,8 +19,8 @@
 extends RangeAccess
 {
 
-    public MapAccess(D4EArtifact artifact, CallContext context) {
-        super(artifact, context);
+    public MapAccess(D4EArtifact artifact) {
+        super(artifact);
     }
 
     public List<String> getHWS() {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java	Tue Jun 11 09:40:56 2013 +0200
@@ -8,10 +8,10 @@
 
 package org.dive4elements.river.artifacts.access;
 
+import gnu.trove.TDoubleArrayList;
+
 import org.apache.log4j.Logger;
 
-import gnu.trove.TDoubleArrayList;
-import org.dive4elements.artifacts.CallContext;
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.WINFOArtifact;
 
@@ -25,8 +25,6 @@
 {
     private static Logger logger = Logger.getLogger(RangeAccess.class);
 
-    private CallContext context;
-
     public static enum KM_MODE { RANGE, LOCATIONS, NONE };
 
     double[] kmRange;
@@ -40,9 +38,8 @@
     private KM_MODE mode;
 
 
-    public RangeAccess(D4EArtifact artifact, CallContext context) {
+    public RangeAccess(D4EArtifact artifact) {
         super(artifact);
-        this.context = context;
     }
 
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java	Tue Jun 11 09:40:56 2013 +0200
@@ -12,8 +12,6 @@
 
 import org.apache.log4j.Logger;
 
-import org.dive4elements.artifacts.CallContext;
-
 import org.dive4elements.river.artifacts.D4EArtifact;
 
 
@@ -22,14 +20,11 @@
 {
     private static final Logger logger = Logger.getLogger(BedHeightAccess.class);
 
-    private int[] singleIDs;
-    private int[] epochIDs;
-
     private String time;
     private String unit;
 
-    public SedimentLoadAccess(D4EArtifact artifact, CallContext context) {
-        super(artifact, context);
+    public SedimentLoadAccess(D4EArtifact artifact) {
+        super(artifact);
     }
 
     public Double getLowerKM() {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Recommendations.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Recommendations.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Recommendations.java	Tue Jun 11 09:40:56 2013 +0200
@@ -257,6 +257,7 @@
             new ArrayList<Builder.NamedConnection>(3);
 
         Connection userConnection = userId != null
+            || parameters.containsKey("ARTIFACT-ID")
             ? DBConfig
                 .getInstance()
                 .getDBConnection()
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java	Tue Jun 11 09:40:56 2013 +0200
@@ -298,7 +298,7 @@
                 }
                 catch (XPathExpressionException xee) {
                     log.warn("unable to apply filter expression '" +
-                        filter + "' to dataset.");
+                        filter + "' to dataset.", xee);
                 }
                 finally {
                     frames.leave();
@@ -517,6 +517,7 @@
             String [] origColumns = rd.getColumnLabels();
             int index = origColumns.length;
             String [] newColumns = Arrays.copyOf(origColumns, index+1);
+            newColumns[index] = name.toUpperCase();
             ResultData result = new ResultData(newColumns);
             fillResult(result, rd, index, index+1, expr, returnType);
             return result;
@@ -535,17 +536,15 @@
         }
 
         protected void fillResult(
-            ResultData result,
-            ResultData rd,
-            int        index,
-            int size,
+            ResultData      result,
+            ResultData      rd,
+            int             index,
+            int             size,
             XPathExpression expr,
-            QName returnType
+            QName           returnType
         ) {
-            List<Object []> rows = rd.getRows();
             String [] origColumns = rd.getColumnLabels();
-            for (int i = 0, R = rows.size(); i < R; ++i) {
-                Object [] row = rows.get(i);
+            for (Object [] row: rd.getRows()) {
                 frames.enter();
                 try {
                     frames.put(origColumns, row);
@@ -769,23 +768,11 @@
 
         /** Get macro node children, not resolving bodies. */
         protected NodeList getMacroChildren(String name) {
-            NodeList macros = template.getElementsByTagNameNS(
-                DC_NAMESPACE_URI, "macro");
 
-            Element macro = null;
-
-            for (int i = 0, N = macros.getLength(); i < N; ++i) {
-                Element m = (Element) macros.item(i);
-                if (name.equals(m.getAttribute("name"))) {
-                    macro = m;
-                    break;
-                }
-            }
-
-            if (macro != null) {
-                return macro.getChildNodes();
-            }
-            return null;
+            Element macro = macros.get(name);
+            return macro != null
+                ? macro.getChildNodes()
+                : null;
         }
 
         protected void ifClause(Node parent, Element current)
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java	Tue Jun 11 09:40:56 2013 +0200
@@ -9,11 +9,11 @@
 package org.dive4elements.river.artifacts.datacage.templating;
 
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
 import java.util.Collection;
 import java.util.Date;
 import java.util.List;
 import java.util.Map;
+import java.util.HashMap;
 
 import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
@@ -38,24 +38,32 @@
 
     public static final double FAR_AWAY = 99999d;
 
-    public static final class Entry {
+    protected static final class Entry {
 
-        String        name;
+        Entry         next;
         XPathFunction function;
         int           arity;
 
-        public Entry() {
+        public Entry(Entry next, XPathFunction function, int arity) {
+            this.next     = next;
+            this.function = function;
+            this.arity    = arity;
         }
 
-        public Entry(String name, XPathFunction function, int arity) {
-            this.name     = name;
-            this.function = function;
-            this.arity    = arity;
+        XPathFunction find(int arity) {
+            Entry current = this;
+            while (current != null) {
+                if (current.arity == arity) {
+                    return current.function;
+                }
+                current = current.next;
+            }
+            return null;
         }
     } // class Entry
 
     /** List of functions. */
-    protected List<Entry> functions;
+    protected Map<String, Entry> functions;
 
     protected Builder.BuildHelper buildHelper;
 
@@ -67,7 +75,7 @@
     public FunctionResolver(Builder.BuildHelper buildHelper) {
         this.buildHelper = buildHelper;
 
-        functions = new ArrayList<Entry>();
+        functions = new HashMap<String, Entry>();
 
         addFunction("contains", 2, new XPathFunction() {
             @Override
@@ -97,6 +105,13 @@
             }
         });
 
+        addFunction("replace-all", 3, new XPathFunction() {
+            @Override
+            public Object evaluate(List args) throws XPathFunctionException {
+                return replaceAll(args);
+            }
+        });
+
         addFunction("has-result", 0, new XPathFunction() {
             @Override
             public Object evaluate(List args) throws XPathFunctionException {
@@ -124,6 +139,18 @@
                 return FunctionResolver.this.buildHelper.frames.dump();
             }
         });
+
+        addFunction("get", 1, new XPathFunction() {
+            @Override
+            public Object evaluate(List args) throws XPathFunctionException {
+                Object o = args.get(0);
+                if (o instanceof String) {
+                    return FunctionResolver.this.buildHelper.frames.getNull(
+                        (String)o, StackFrames.NULL);
+                }
+                return StackFrames.NULL;
+            }
+        });
     }
 
     /**
@@ -133,7 +160,15 @@
      * @param function the function itself.
      */
     public void addFunction(String name, int arity, XPathFunction function) {
-        functions.add(new Entry(name, function, arity));
+        Entry entry = functions.get(name);
+        if (entry == null) {
+            entry = new Entry(null, function, arity);
+            functions.put(name, entry);
+        }
+        else {
+            Entry newEntry = new Entry(entry.next, function, arity);
+            entry.next = newEntry;
+        }
     }
 
     @Override
@@ -143,14 +178,10 @@
             return null;
         }
 
-        String name = functionName.getLocalPart();
-        for (Entry entry: functions) {
-            if (entry.arity == arity && entry.name.equals(name)) {
-                return entry.function;
-            }
-        }
-
-        return null;
+        Entry entry = functions.get(functionName.getLocalPart());
+        return entry != null
+            ? entry.find(arity)
+            : null;
     }
 
     /** Implementation of case-ignoring dc:contains. */
@@ -203,11 +234,7 @@
         Object locations = args.get(1);
         Object from      = args.get(2);
 
-        if (!(mode instanceof String)){
-            return -FAR_AWAY;
-        }
-
-        if (mode.equals("locations")) {
+        if (mode instanceof String && mode.equals("locations")) {
             if (!(locations instanceof String)) {
                 return -FAR_AWAY;
             }
@@ -230,7 +257,7 @@
                 return -FAR_AWAY;
             }
         }
-        else if (mode.equals("distance")) {
+        else {
             if (!(from instanceof String)) {
                 return -FAR_AWAY;
             }
@@ -242,9 +269,6 @@
                 return -FAR_AWAY;
             }
         }
-        else {
-            return -FAR_AWAY;
-        }
     }
 
     /** Implementation for getting the maximum value of location or distance
@@ -255,11 +279,7 @@
         Object locations = args.get(1);
         Object to        = args.get(2);
 
-        if (!(mode instanceof String)){
-            return FAR_AWAY;
-        }
-
-        if (mode.equals("locations")) {
+        if (mode instanceof String && mode.equals("locations")) {
             if (!(locations instanceof String)) {
                 return FAR_AWAY;
             }
@@ -282,7 +302,7 @@
                 return FAR_AWAY;
             }
         }
-        else if (mode.equals("distance")) {
+        else {
             if (!(to instanceof String)) {
                 return FAR_AWAY;
             }
@@ -291,14 +311,11 @@
                 try {
                     return Double.parseDouble(t);
                 }
-                catch(NumberFormatException nfe) {
+                catch (NumberFormatException nfe) {
                     return FAR_AWAY;
                 }
             }
         }
-        else {
-            return FAR_AWAY;
-        }
     }
 
     /** Implementation for doing a string replace
@@ -309,14 +326,30 @@
         Object needle      = args.get(1);
         Object replacement = args.get(2);
 
-        if (needle instanceof String &&
-            haystack instanceof String &&
-            replacement instanceof String) {
+        if (needle      instanceof String
+        &&  haystack    instanceof String
+        &&  replacement instanceof String) {
             return ((String)haystack).replace(
                     (String)needle, (String)replacement);
-        } else {
-            return haystack;
         }
+        return haystack;
+    }
+
+    /** Implementation for doing a string replace
+     *  dc:replace-all
+     */
+    public Object replaceAll(List args) throws XPathFunctionException {
+        Object haystack    = args.get(0);
+        Object needle      = args.get(1);
+        Object replacement = args.get(2);
+
+        if (needle      instanceof String
+        &&  haystack    instanceof String
+        &&  replacement instanceof String) {
+            return ((String)haystack).replaceAll(
+                    (String)needle, (String)replacement);
+        }
+        return haystack;
     }
 
     public Object dateFormat(List args) throws XPathFunctionException {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/FacetTypes.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FacetTypes.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/FacetTypes.java	Tue Jun 11 09:40:56 2013 +0200
@@ -281,6 +281,9 @@
     String BED_QUALITY_SEDIMENT_DENSITY_TOPLAYER = "bed_longitudinal_section.sediment_density_toplayer";
     String BED_QUALITY_SEDIMENT_DENSITY_SUBLAYER = "bed_longitudinal_section.sediment_density_sublayer";
     String BED_QUALITY_BEDLOAD_DIAMETER          = "bed_longitudinal_section.bedload_diameter";
+    String BED_DIAMETER_DATA_TOP                 = "bed_longitudinal_section.bed_diameter_data_top";
+    String BED_DIAMETER_DATA_SUB                 = "bed_longitudinal_section.bed_diameter_data_sub";
+    String BEDLOAD_DIAMETER_DATA                 = "bed_longitudinal_section.bedload_diameter_data";
 
     String BED_DIFFERENCE_YEAR          = "bedheight_difference.year";
     String BED_DIFFERENCE_YEAR_FILTERED = "bedheight_difference.year.filtered";
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/LinearInterpolated.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/LinearInterpolated.java	Tue Jun 11 09:40:56 2013 +0200
@@ -0,0 +1,228 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts.model;
+
+import gnu.trove.TDoubleArrayList;
+
+import java.io.Serializable;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+import java.util.TreeSet;
+
+import org.apache.commons.math.stat.descriptive.moment.StandardDeviation;
+
+import org.dive4elements.river.artifacts.math.Linear;
+
+import org.dive4elements.river.utils.EpsilonComparator;
+
+public class LinearInterpolated
+implements   Serializable
+{
+    public static final double EPSILON = 1e-5;
+    public static final double MULTIPLE_STD_DEV = 4d;
+
+    public static final EpsilonComparator CMP = new EpsilonComparator(EPSILON);
+
+    private TDoubleArrayList xs;
+    private TDoubleArrayList ys;
+
+    private List<Range> gaps;
+
+    public interface Operator {
+        double evaluate(double y1, double y2);
+    } // interface Operator
+
+    public static final Operator SUB = new Operator() {
+        @Override
+        public double evaluate(double y1, double y2) {
+            return y1 - y2;
+        }
+    };
+
+    public static final Operator MAX = new Operator() {
+        @Override
+        public double evaluate(double y1, double y2) {
+            return Math.max(y1, y2);
+        }
+    };
+
+    public LinearInterpolated() {
+        xs = new TDoubleArrayList();
+        ys = new TDoubleArrayList();
+    }
+
+    public LinearInterpolated(int capacity) {
+        xs = new TDoubleArrayList(capacity);
+        ys = new TDoubleArrayList(capacity);
+    }
+
+    public void add(double x, double y) {
+        xs.add(x);
+        ys.add(y);
+    }
+
+    public int size() {
+        return xs.size();
+    }
+
+    public void pointsInRange(double from, double to, Set<Double> points) {
+        if (from > to) {
+            double t = from;
+            from = to;
+            to = t;
+        }
+        for (int i = 0, S = size(); i < S; ++i) {
+            double x = xs.getQuick(i);
+            if (x >= from && x <= to) {
+                points.add(x);
+            }
+        }
+    }
+
+    public boolean inGap(double x) {
+        if (gaps != null) {
+            for (Range gap: gaps) {
+                if (gap.inside(x)) {
+                    return true;
+                }
+            }
+        }
+        return false;
+    }
+
+    public void detectGaps(double threshold) {
+        List<Range> gabs = new ArrayList<Range>();
+        for (int i = 1, S = size(); i < S; ++i) {
+            double x0 = xs.getQuick(i-1);
+            double x1 = xs.getQuick(i);
+            double minX, maxX;
+            if (x0 < x1) { minX = x0; maxX = x1; }
+            else         { minX = x1; maxX = x0; }
+            double diff = maxX - minX - 2d*EPSILON;
+            if (diff > threshold) {
+                gaps.add(new Range(minX+EPSILON, maxX-EPSILON));
+            }
+        }
+        this.gaps = gaps.isEmpty() ? null : gabs;
+    }
+
+    public void resetGaps() {
+        gaps = null;
+    }
+
+    public double guessGapThreshold() {
+        return guessGapThreshold(MULTIPLE_STD_DEV);
+    }
+
+    public double guessGapThreshold(double scale) {
+        int S = size();
+        if (S < 5) { // Too less points.
+            return Double.MAX_VALUE;
+        }
+
+        StandardDeviation s = new StandardDeviation();
+
+        for (int i = 1; i < S; ++i) {
+            double diff = Math.abs(xs.getQuick(i-1) - xs.getQuick(i));
+            s.increment(diff);
+        }
+
+        return scale*s.getResult();
+    }
+
+    public double value(double x) {
+        for (int i = 0, S = size(); i < S; ++i) {
+            double x1 = xs.getQuick(i);
+            if (Math.abs(x1 - x) < EPSILON) {
+                return ys.getQuick(i);
+            }
+            if (i > 0) {
+                double x0 = xs.getQuick(i-1);
+                double minX, maxX;
+                if (x0 < x1) { minX = x0; maxX = x1; }
+                else         { minX = x1; maxX = x0; }
+                if (x > minX && x < maxX) {
+                    return Linear.linear(
+                        x,
+                        x0, x1,
+                        ys.getQuick(i-1), ys.getQuick(i));
+                }
+            }
+        }
+        return Double.NaN;
+    }
+
+    public LinearInterpolated sub(
+        LinearInterpolated other, 
+        double             from,
+        double             to
+    ) {
+        return apply(SUB, other, from, to);
+    }
+
+    public LinearInterpolated max(
+        LinearInterpolated other, 
+        double             from,
+        double             to
+    ) {
+        return apply(MAX, other, from, to);
+    }
+
+    public boolean intersect(LinearInterpolated other) {
+        if (xs.isEmpty() || other.xs.isEmpty()) {
+            return false;
+        }
+
+        double tMax = xs.max();
+        double oMin = other.xs.min();
+        if (tMax < oMin) {
+            return false;
+        }
+
+        double tMin = xs.min();
+        double oMax = other.xs.max();
+        return !(tMin > oMax);
+    }
+
+    public LinearInterpolated apply(
+        Operator           operator,
+        LinearInterpolated other,
+        double             from,
+        double             to
+    ) {
+        LinearInterpolated result = new LinearInterpolated();
+        if (!intersect(other)) {
+            return result;
+        }
+
+        Set<Double> points = new TreeSet<Double>(CMP);
+        points.add(from);
+        points.add(to);
+
+        this .pointsInRange(from, to, points);
+        other.pointsInRange(from, to, points);
+
+
+        for (double x: points) {
+            if (!inGap(x) && !other.inGap(x)) {
+                double y1 = this .value(x);
+                double y2 = other.value(x);
+                double y  = operator.evaluate(y1, y2);
+                if (!Double.isNaN(y)) {
+                    result.add(x, y);
+                }
+            }
+        }
+
+        return result;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -24,13 +24,13 @@
  * values are set directly on the Element, the other attributes aren't
  * touched.
  */
-public class ManagedDomFacet extends ManagedFacet {
+public class ManagedDomFacet extends ManagedFacet
+{
 
     protected Element facet;
 
     public ManagedDomFacet(Element facet) {
         super(null, -1, null, null, -1, -1, -1);
-
         this.facet = facet;
     }
 
@@ -169,6 +169,29 @@
         return this.uuid;
     }
 
+    @Override
+    public String getBoundToOut() {
+        if (boundToOut == null) {
+            String bondageAttr = this.facet.getAttributeNS(
+                ArtifactNamespaceContext.NAMESPACE_URI,
+                "boundToOut");
+            if (bondageAttr != null && !bondageAttr.isEmpty()) {
+                boundToOut = bondageAttr;
+            }
+        }
+        return boundToOut;
+    }
+
+
+    @Override
+    public void setBoundToOut(String value) {
+        boundToOut = value;
+
+        facet.setAttributeNS(
+            ArtifactNamespaceContext.NAMESPACE_URI,
+            ArtifactNamespaceContext.NAMESPACE_PREFIX + ":" + "boundToOut",
+            getBoundToOut());
+    }
 
     /**
      * Import into document.
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -41,12 +41,18 @@
 
     public ManagedFacet(String name, int index, String desc, String uuid,
         int pos, int active, int visible) {
+        this(name, index, desc, uuid, pos, active, visible, null);
+    }
+
+    public ManagedFacet(String name, int index, String desc, String uuid,
+        int pos, int active, int visible, String boundToOut) {
         super(index, name, desc);
 
         this.uuid = uuid;
         this.position = pos;
         this.active = active;
         this.visible = visible;
+        this.boundToOut = boundToOut;
     }
 
     /**
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacetAdapter.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacetAdapter.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacetAdapter.java	Tue Jun 11 09:40:56 2013 +0200
@@ -46,7 +46,8 @@
             uuid,
             pos,
             active,
-            visible);
+            visible,
+            facet.getBoundToOut());
 
         this.facet = facet;
     }
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/extreme/ExtremeCurveFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/extreme/ExtremeCurveFacet.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/extreme/ExtremeCurveFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -95,7 +95,7 @@
                 logger.debug("A curve at km = " + currentKm);
                 Curve c = curveEntry.getValue();
                 // Find segment in which the curr. km is located.
-                ExtremeAccess access = new ExtremeAccess(flys, context);
+                ExtremeAccess access = new ExtremeAccess(flys);
 
                 double[] ds = access.getValuesForRange(currentKm);
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAnalysisPeriodsFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAnalysisPeriodsFacet.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAnalysisPeriodsFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -13,8 +13,6 @@
 
 import org.dive4elements.river.artifacts.D4EArtifact;
 
-import org.dive4elements.river.artifacts.access.FixAnalysisAccess;
-
 import org.dive4elements.river.artifacts.model.CalculationResult;
 import org.dive4elements.river.artifacts.model.DateRange;
 import org.dive4elements.river.artifacts.model.FacetTypes;
@@ -69,7 +67,6 @@
 
         if (artifact instanceof D4EArtifact) {
             D4EArtifact flys = (D4EArtifact)artifact;
-            FixAnalysisAccess access = new FixAnalysisAccess(flys, context);
 
             CalculationResult res =
                 (CalculationResult) flys.compute(context,
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAvSectorFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAvSectorFacet.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAvSectorFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -13,8 +13,6 @@
 
 import org.dive4elements.river.artifacts.D4EArtifact;
 
-import org.dive4elements.river.artifacts.access.FixAnalysisAccess;
-
 import org.dive4elements.river.artifacts.model.CalculationResult;
 import org.dive4elements.river.artifacts.model.FacetTypes;
 
@@ -69,7 +67,6 @@
 
         if (artifact instanceof D4EArtifact) {
             D4EArtifact flys = (D4EArtifact)artifact;
-            FixAnalysisAccess access = new FixAnalysisAccess(flys, context);
 
             CalculationResult res =
                 (CalculationResult) flys.compute(context,
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDerivateFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDerivateFacet.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDerivateFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -75,7 +75,7 @@
         }
 
         D4EArtifact flys = (D4EArtifact)artifact;
-        FixAnalysisAccess access = new FixAnalysisAccess(flys, context);
+        FixAnalysisAccess access = new FixAnalysisAccess(flys);
 
         CalculationResult res =
             (CalculationResult) flys.compute(context,
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDeviationFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDeviationFacet.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDeviationFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -12,7 +12,6 @@
 import org.dive4elements.artifacts.CallContext;
 
 import org.dive4elements.river.artifacts.D4EArtifact;
-import org.dive4elements.river.artifacts.access.FixAnalysisAccess;
 
 import org.dive4elements.river.artifacts.model.CalculationResult;
 import org.dive4elements.river.artifacts.model.FacetTypes;
@@ -67,7 +66,6 @@
         logger.debug("FixDeviationFacet.getData");
         if (artifact instanceof D4EArtifact) {
             D4EArtifact flys = (D4EArtifact)artifact;
-            FixAnalysisAccess access = new FixAnalysisAccess(flys, context);
 
             CalculationResult res =
                 (CalculationResult) flys.compute(context,
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixEventFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixEventFacet.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixEventFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -50,7 +50,7 @@
     public Object getData(Artifact artifact, CallContext context) {
         logger.debug("FixEventFacet.getData");
 
-        FixRealizingAccess access = new FixRealizingAccess((D4EArtifact) artifact, context);
+        FixRealizingAccess access = new FixRealizingAccess((D4EArtifact) artifact);
         int wstColID = access.getEvents()[index];
         return WQKmsFactory.getWQKmsCID(wstColID);
     }
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalDeviationFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalDeviationFacet.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalDeviationFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -13,8 +13,6 @@
 
 import org.dive4elements.river.artifacts.D4EArtifact;
 
-import org.dive4elements.river.artifacts.access.FixAnalysisAccess;
-
 import org.dive4elements.river.artifacts.model.CalculationResult;
 import org.dive4elements.river.artifacts.model.DataFacet;
 import org.dive4elements.river.artifacts.model.FacetTypes;
@@ -72,7 +70,6 @@
 
         if (artifact instanceof D4EArtifact) {
             D4EArtifact flys = (D4EArtifact)artifact;
-            FixAnalysisAccess access = new FixAnalysisAccess(flys, context);
 
             CalculationResult res =
                 (CalculationResult) flys.compute(context,
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalReferenceFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalReferenceFacet.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalReferenceFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -13,8 +13,6 @@
 
 import org.dive4elements.river.artifacts.D4EArtifact;
 
-import org.dive4elements.river.artifacts.access.FixAnalysisAccess;
-
 import org.dive4elements.river.artifacts.model.CalculationResult;
 import org.dive4elements.river.artifacts.model.DataFacet;
 import org.dive4elements.river.artifacts.model.FacetTypes;
@@ -72,7 +70,6 @@
 
         if (artifact instanceof D4EArtifact) {
             D4EArtifact flys = (D4EArtifact)artifact;
-            FixAnalysisAccess access = new FixAnalysisAccess(flys, context);
 
             CalculationResult res =
                 (CalculationResult) flys.compute(context,
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWQCurveFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWQCurveFacet.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWQCurveFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -69,7 +69,7 @@
         logger.debug("getData");
         if (artifact instanceof D4EArtifact) {
             D4EArtifact flys = (D4EArtifact)artifact;
-            FixAnalysisAccess access = new FixAnalysisAccess(flys, context);
+            FixAnalysisAccess access = new FixAnalysisAccess(flys);
 
             CalculationResult res =
                 (CalculationResult) flys.compute(context,
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/HWS.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/HWS.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/HWS.java	Tue Jun 11 09:40:56 2013 +0200
@@ -34,7 +34,6 @@
 
     public HWS() {
         this.geom = null;
-        // TODO Auto-generated constructor stub
     }
 
     public HWS(String name) {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiameterData.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiameterData.java	Tue Jun 11 09:40:56 2013 +0200
@@ -0,0 +1,27 @@
+package org.dive4elements.river.artifacts.model.minfo;
+
+import gnu.trove.TDoubleArrayList;
+
+
+public class BedDiameterData
+extends BedQualityDiameterResult
+{
+
+    private TDoubleArrayList data;
+
+    public BedDiameterData() {
+        super();
+    }
+
+    public BedDiameterData (
+        String type,
+        TDoubleArrayList kms,
+        TDoubleArrayList data) {
+        super(type, kms);
+        this.data = data;
+    }
+
+    public double[][] getDiameterData() {
+        return new double[][]{kms.toNativeArray(), data.toNativeArray()};
+    }
+}
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiameterDataFacet.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiameterDataFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -0,0 +1,93 @@
+package org.dive4elements.river.artifacts.model.minfo;
+
+import gnu.trove.TDoubleArrayList;
+
+import org.apache.log4j.Logger;
+import org.dive4elements.artifactdatabase.state.Facet;
+import org.dive4elements.artifacts.Artifact;
+import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.river.artifacts.D4EArtifact;
+import org.dive4elements.river.artifacts.access.BedQualityAccess;
+import org.dive4elements.river.artifacts.model.DataFacet;
+import org.dive4elements.river.artifacts.states.DefaultState.ComputeType;
+
+public class BedDiameterDataFacet
+extends DataFacet
+{
+    private static final Logger logger = Logger.getLogger(BedDiameterDataFacet.class);
+
+    public BedDiameterDataFacet() {
+    }
+
+    public BedDiameterDataFacet(
+        int ndx,
+        String name,
+        String description,
+        ComputeType type,
+        String stateId,
+        String hash
+    ) {
+        super(ndx, name, description, type, hash, stateId);
+    }
+
+    public Object getData(Artifact artifact, CallContext context) {
+        D4EArtifact d4e = (D4EArtifact) artifact;
+        BedQualityAccess access = new BedQualityAccess(d4e, context);
+        int ndx = getIndex() & 7;
+        int top = (getIndex() >> 3) & 1;
+        int diam = (getIndex() >> 4);
+        String diameter = "";
+        switch (diam) {
+            case 1: diameter = "d10"; break;
+            case 2: diameter = "d16"; break;
+            case 3: diameter = "d20"; break;
+            case 4: diameter = "d25"; break;
+            case 5: diameter = "d30"; break;
+            case 6: diameter = "d40"; break;
+            case 7: diameter = "d50"; break;
+            case 8: diameter = "d60"; break;
+            case 9: diameter = "d70"; break;
+            case 10: diameter = "d75"; break;
+            case 11: diameter = "d80"; break;
+            case 12: diameter = "d84"; break;
+            case 13: diameter = "d90"; break;
+            case 14: diameter = "dmin"; break;
+            case 15: diameter = "dmax"; break;
+            case 16: diameter = "dm"; break;
+            default: return null;
+        }
+
+        QualityMeasurements measurements =
+            QualityMeasurementFactory.getBedMeasurements(
+                access.getRiver(),
+                access.getFrom(),
+                access.getTo(),
+                access.getDateRanges().get(ndx).getFrom(),
+                access.getDateRanges().get(ndx).getTo());
+        TDoubleArrayList kms = new TDoubleArrayList();
+        TDoubleArrayList data = new TDoubleArrayList();
+        for (QualityMeasurement m : measurements.getMeasurements()) {
+            if (top == 1 && m.getDepth1() == 0d && m.getDepth2() <= 0.3) {
+                kms.add(m.getKm());
+                data.add(m.getDiameter(diameter) * 1000);
+            }
+            else if (top == 0 && m.getDepth1() > 0d && m.getDepth2() <= 0.5){
+                kms.add(m.getKm());
+                data.add(m.getDiameter(diameter) * 1000);
+            }
+        }
+        BedDiameterData bdd = new BedDiameterData(diameter, kms, data);
+        return bdd;
+    }
+
+    /** Copy deeply. */
+    @Override
+    public Facet deepCopy() {
+        BedDiameterDataFacet copy = new BedDiameterDataFacet();
+        copy.set(this);
+        copy.type = type;
+        copy.hash = hash;
+        copy.stateId = stateId;
+        return copy;
+    }
+}
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java	Tue Jun 11 09:40:56 2013 +0200
@@ -5,18 +5,15 @@
  * and comes with ABSOLUTELY NO WARRANTY! Check out the
  * documentation coming with Dive4Elements River for details.
  */
-
 package org.dive4elements.river.artifacts.model.minfo;
 
 import gnu.trove.TDoubleArrayList;
 
 import java.util.Date;
-import java.util.LinkedList;
-import java.util.List;
 
 import org.apache.log4j.Logger;
 
-import org.dive4elements.river.artifacts.D4EArtifact;
+import org.dive4elements.artifacts.CallContext;
 import org.dive4elements.river.artifacts.access.BedDifferencesAccess;
 import org.dive4elements.river.artifacts.model.Calculation;
 import org.dive4elements.river.artifacts.model.CalculationResult;
@@ -25,25 +22,23 @@
 public class BedDiffCalculation
 extends Calculation
 {
+    private static final Logger logger =
+        Logger.getLogger(BedDiffCalculation.class);
 
-    private static final Logger logger = Logger
-        .getLogger(BedDiffCalculation.class);
-
-    protected String river;
-    protected String yearEpoch;
-    protected D4EArtifact[][] artifacts;
+    protected String   river;
+    protected String   yearEpoch;
+    protected int [][] heightIds;
 
     public BedDiffCalculation() {
     }
 
-    public CalculationResult calculate(BedDifferencesAccess access) {
+    public CalculationResult calculate(BedDifferencesAccess access, CallContext context) {
         logger.info("BedDiffCalculation.calculate");
 
-        String river = access.getRiver();
-        String yearEpoch = access.getYearEpoch();
-        D4EArtifact[][] artifacts = access.getDifferenceArtifacts();
+        String river       = access.getRiver();
+        String yearEpoch   = access.getYearEpoch();
+        int [][] heightIds = access.extractHeightIds(context);
 
-        logger.debug("got artifacts: " + artifacts.length + "; " + artifacts[0].length);
         if (river == null) {
             // TODO: i18n
             addProblem("minfo.missing.river");
@@ -53,14 +48,10 @@
             addProblem("minfo.missing.year_epoch");
         }
 
-        if (artifacts == null) {
-            addProblem("minfo.missing.differences");
-        }
-
         if (!hasProblems()) {
-            this.river = river;
+            this.river     = river;
             this.yearEpoch = yearEpoch;
-            this.artifacts = artifacts;
+            this.heightIds = heightIds;
             return internalCalculate();
         }
 
@@ -69,116 +60,106 @@
 
     private CalculationResult internalCalculate() {
 
-        if (yearEpoch.equals("year")) {
-            List<BedDiffYearResult> results =
-                new LinkedList<BedDiffYearResult>();
+        BedDiffYearResult [] results = new BedDiffYearResult[heightIds.length];
 
-            for (int i = 0; i < artifacts.length; i++) {
-                BedHeight[] pair =
-                    getHeightPair(artifacts[i][0], artifacts[i][1], "single");
-                BedDiffYearResult res = calculateYearDifference(pair);
-                results.add(res);
+        for (int i = 0; i < heightIds.length; i++) {
+            BedHeight [] pair = getHeightPair(heightIds[i], "single");
+            results[i] = calculateYearDifference(pair);
+        }
+        return new CalculationResult(results, this);
+        // Currently epochs are handled like single years. To handle epochs
+        // uncomment the follwing code and use an if-clause in the code above.
+/*
+        if (yearEpoch.equals("epoch")) {
+            BedDiffEpochResult [] results = new BedDiffEpochResult[heightIds.length];
+
+            for (int i = 0; i < heightIds.length; i++) {
+                BedHeight[] pair = getHeightPair(heightIds[i], "epoch");
+                results[i] = calculateEpochDifference(pair);
             }
-            return new CalculationResult(
-                results.toArray(new BedDiffYearResult[results.size()]), this);
-        }
-        if (yearEpoch.equals("epoch")) {
-            List<BedDiffEpochResult> results =
-                new LinkedList<BedDiffEpochResult>();
-            for (int i = 0; i < artifacts.length; i++) {
-                BedHeight[] pair =
-                    getHeightPair(artifacts[i][0], artifacts[i][1], "epoch");
-                BedDiffEpochResult res = calculateEpochDifference(pair);
-                results.add(res);
-            }
-            return new CalculationResult(
-                results.toArray(new BedDiffEpochResult[results.size()]), this);
+            return new CalculationResult(results, this);
         }
 
        return new CalculationResult();
+       */
     }
 
-    private BedHeight[] getHeightPair(
-        D4EArtifact art1,
-        D4EArtifact art2,
-        String type
-    ) {
-        int id1 = BedDifferencesAccess.getHeightId(art1);
-        int id2 = BedDifferencesAccess.getHeightId(art2);
-
-        BedHeight[] heights = new BedHeight[2];
-        heights[0] = BedHeightFactory.getHeight(type, id1, 0);
-        heights[1] = BedHeightFactory.getHeight(type, id2, 0);
-        return heights;
+    private static BedHeight [] getHeightPair(int [] ids, String type) {
+        return new BedHeight [] {
+            BedHeightFactory.getHeight(type, ids[0], 0),
+            BedHeightFactory.getHeight(type, ids[1], 0)
+        };
     }
 
     private BedDiffEpochResult calculateEpochDifference(BedHeight[] pair) {
 
-        TDoubleArrayList stations = pair[0].getStations();
-        TDoubleArrayList diffRes = new TDoubleArrayList();
-        TDoubleArrayList kms = new TDoubleArrayList();
-        TDoubleArrayList heights1 = new TDoubleArrayList();
-        TDoubleArrayList heights2 = new TDoubleArrayList();
+        BedHeight bh1 = pair[0];
+        BedHeight bh2 = pair[1];
 
-        for (int i = 0; i < stations.size(); i++) {
-            if (!Double.isNaN(pair[0].getHeight(stations.get(i))) &&
-                !Double.isNaN(pair[1].getHeight(stations.get(i)))) {
-                double hDiff =
-                    pair[0].getHeight(stations.get(i)) -
-                    pair[1].getHeight(stations.get(i));
+        TDoubleArrayList stations = bh1.getStations();
+        int size = stations.size();
+
+        TDoubleArrayList diffRes  = new TDoubleArrayList(size);
+        TDoubleArrayList kms      = new TDoubleArrayList(size);
+        TDoubleArrayList heights1 = new TDoubleArrayList(size);
+        TDoubleArrayList heights2 = new TDoubleArrayList(size);
+
+        for (int i = 0; i < size; i++) {
+            double station = stations.getQuick(i);
+            double h1      = bh1.getHeight(station);
+            double h2      = bh2.getHeight(station);
+            double hDiff   = h1 - h2;
+            if (!Double.isNaN(hDiff)) {
                 diffRes.add(hDiff);
-                kms.add(stations.get(i));
-                heights1.add(pair[0].getHeight(stations.get(i)));
-                heights2.add(pair[1].getHeight(stations.get(i)));
+                kms.add(station);
+                heights1.add(h1);
+                heights2.add(h2);
             }
         }
-        Date start = ((BedHeightEpoch)pair[0]).getStart();
-        Date end = ((BedHeightEpoch)pair[1]).getEnd();
+        Date start = ((BedHeightEpoch)bh1).getStart();
+        Date end   = ((BedHeightEpoch)bh2).getEnd();
         return new BedDiffEpochResult(kms, diffRes, heights1, heights2, start, end);
     }
 
     private BedDiffYearResult calculateYearDifference(BedHeight[] pair) {
 
-        TDoubleArrayList stations = pair[0].getStations();
-        TDoubleArrayList diffRes = new TDoubleArrayList();
-        TDoubleArrayList kms = new TDoubleArrayList();
-        TDoubleArrayList morphs = new TDoubleArrayList();
-        TDoubleArrayList absolute = new TDoubleArrayList();
-        TDoubleArrayList gap = new TDoubleArrayList();
-        TDoubleArrayList heights1 = new TDoubleArrayList();
-        TDoubleArrayList heights2 = new TDoubleArrayList();
-
         BedHeightSingle s1 = (BedHeightSingle)pair[0];
         BedHeightSingle s2 = (BedHeightSingle)pair[1];
-        int range = s1.getYear() - s2.getYear();
-        if (range  < 0) {
-            range = range * -1;
-        }
-        for (int i = 0; i < stations.size(); i++) {
-            if (!Double.isNaN(s1.getHeight(stations.get(i))) &&
-                !Double.isNaN(s2.getHeight(stations.get(i)))) {
-                double hDiff =
-                    s1.getHeight(stations.get(i)) -
-                    s2.getHeight(stations.get(i));
+
+        TDoubleArrayList stations = s1.getStations();
+        int size = stations.size();
+
+        TDoubleArrayList diffRes  = new TDoubleArrayList(size);
+        TDoubleArrayList kms      = new TDoubleArrayList(size);
+        TDoubleArrayList morphs   = new TDoubleArrayList(size);
+        TDoubleArrayList absolute = new TDoubleArrayList(size);
+        TDoubleArrayList gap      = new TDoubleArrayList(size);
+        TDoubleArrayList heights1 = new TDoubleArrayList(size);
+        TDoubleArrayList heights2 = new TDoubleArrayList(size);
+
+        int range = Math.abs(s1.getYear() - s2.getYear());
+
+        for (int i = 0; i < size; i++) {
+            double station = stations.getQuick(i);
+            double h1      = s1.getHeight(station);
+            double h2      = s2.getHeight(station);
+            double hDiff   = h1 - h2;
+
+            if (!Double.isNaN(hDiff)) {
                 diffRes.add(hDiff);
-                double km = stations.get(i);
-                kms.add(km);
-                if (s1.getMorphWidth(km) >
-                    s2.getMorphWidth(km)) {
-                    morphs.add(s1.getMorphWidth(km));
-                }
-                else {
-                    morphs.add(s2.getMorphWidth(km));
-                }
-                if (s1.getDataGap(km) > s2.getDataGap(km)) {
-                    gap.add(s1.getDataGap(km));
-                }
-                else {
-                    gap.add(s2.getDataGap(km));
-                }
-                absolute.add((hDiff / range) * 100);
-                heights1.add(s1.getHeight(km));
-                heights2.add(s2.getHeight(km));
+                kms.add(station);
+
+                morphs.add(Math.max(
+                    s1.getMorphWidth(station),
+                    s2.getMorphWidth(station)));
+
+                gap.add(Math.max(
+                    s1.getDataGap(station),
+                    s2.getDataGap(station)));
+
+                absolute.add((hDiff / range) * 100d);
+                heights1.add(h1);
+                heights2.add(h2);
             }
         }
         return new BedDiffYearResult(
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffYearResult.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffYearResult.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffYearResult.java	Tue Jun 11 09:40:56 2013 +0200
@@ -90,7 +90,7 @@
 
     /** Get name of the second BedHeight (subtrahend). */
     public String getNameSecond() {
-        return this.nameFirst;
+        return this.nameSecond;
     }
 
     public void addMorphWidth(double value) {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDifferenceJRDataSource.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDifferenceJRDataSource.java	Tue Jun 11 09:40:56 2013 +0200
@@ -0,0 +1,79 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts.model.minfo;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.apache.log4j.Logger;
+
+import net.sf.jasperreports.engine.JRDataSource;
+import net.sf.jasperreports.engine.JRException;
+import net.sf.jasperreports.engine.JRField;
+
+
+/**
+ * @author <a href="mailto:aheinecke at intevation.de">Andre Heinecke</a>
+ */
+public class BedDifferenceJRDataSource implements JRDataSource
+{
+    /** The logger used in this exporter.*/
+    private static Logger logger = Logger.getLogger(BedDifferenceJRDataSource.class);
+
+    private ArrayList<String[]> data;
+    private HashMap<String, String> metaData;
+
+    private int index = -1;
+
+    public BedDifferenceJRDataSource() {
+        data = new ArrayList<String[]>();
+        metaData = new HashMap<String, String>();
+    }
+
+    public void addData(String[] val) {
+        data.add(val);
+    }
+
+    public void addMetaData(String key, String value) {
+        metaData.put(key, value);
+    }
+
+    public boolean next() throws JRException {
+        index++;
+        return (index < data.size());
+    }
+
+    public Object getFieldValue(JRField field) throws JRException {
+        Object value = "";
+        String fieldName = field.getName();
+        if ("river".equals(fieldName)) {
+            value = metaData.get("river");
+        }
+        else if ("calculation".equals(fieldName)) {
+            value = metaData.get("calculation");
+        }
+        else if ("ye_mode".equals(fieldName)) {
+            value = metaData.get("ye_mode");
+        }
+        else if ("date".equals(fieldName)) {
+            value = metaData.get("date");
+        }
+        else if ("differences".equals(fieldName)) {
+            value = metaData.get("differences");
+        }
+        else if ("km".equals(fieldName)) {
+            value = data.get(index)[0];
+        }
+        else if ("meter".equals(fieldName)) {
+            value = data.get(index)[1];
+        }
+        return value;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeight.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeight.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeight.java	Tue Jun 11 09:40:56 2013 +0200
@@ -78,10 +78,8 @@
     }
 
     public double getHeight(double station) {
-        if (this.station.indexOf(station) >= 0) {
-            return this.heights.get(this.station.indexOf(station));
-        }
-        return Double.NaN;
+        int index = this.station.indexOf(station);
+        return index >= 0 ? heights.getQuick(index) : Double.NaN;
     }
 
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -38,7 +38,7 @@
      */
     @Override
     public Object getData(Artifact artifact, CallContext context) {
-        BedHeightAccess access = new BedHeightAccess((D4EArtifact)artifact, context);
+        BedHeightAccess access = new BedHeightAccess((D4EArtifact)artifact);
         if (type.equals("singlevalues")) {
             return access.getSingleValues();
         }
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingle.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingle.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingle.java	Tue Jun 11 09:40:56 2013 +0200
@@ -51,25 +51,21 @@
     }
 
     public double getMorphWidth(int idx) {
-        return this.morphWidth.get(idx);
+        return this.morphWidth.getQuick(idx);
     }
 
     public double getDataGap(int idx) {
-        return this.data_gap.get(idx);
+        return this.data_gap.getQuick(idx);
     }
 
     public double getMorphWidth(double station) {
-        if (this.station.indexOf(station) >= 0) {
-            return this.morphWidth.get(this.station.indexOf(station));
-        }
-        return Double.NaN;
+        int index = this.station.indexOf(station);
+        return index >= 0 ? morphWidth.getQuick(index): Double.NaN;
     }
 
     public double getDataGap(double station) {
-        if (this.station.indexOf(station) >= 0) {
-            return this.getDataGap(this.station.indexOf(station));
-        }
-        return Double.NaN;
+        int index = this.station.indexOf(station);
+        return index >= 0 ? data_gap.getQuick(index) : Double.NaN;
     }
 
     public double[] getMorphWidths() {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityCalculation.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityCalculation.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityCalculation.java	Tue Jun 11 09:40:56 2013 +0200
@@ -253,7 +253,7 @@
             List<QualityMeasurement> measurements = qm.getMeasurements(km);
             double mid = calculateAverage(measurements, diameter);
             location.add(km);
-            avDiameter.add(mid);
+            avDiameter.add(mid * 1000);
         }
         return new BedloadDiameterResult(
             diameter,
@@ -299,22 +299,25 @@
 
     public double calculateDeviation(QualityMeasurement qm) {
         Map<String, Double> dm = qm.getAllDiameter();
-        double phiM = 0;
-        double[] phis = new double[dm.size()];
-        double[] ps = new double[dm.size()];
+        int size = dm.size();
+
+        double phiM    = 0;
+        double [] phis = new double[size];
+        double [] ps   = new double[size];
+        double scale   = -1d/Math.log(2d);
+
         int i = 0;
-        for (String key : dm.keySet()) {
-            double d = dm.get(key);
-            double phi = -Math.log(d)/Math.log(2);
+        for (Map.Entry<String, Double> entry: dm.entrySet()) {
+            double phi = scale*Math.log(entry.getValue());
+            double p   = calculateWeight(qm, entry.getKey());
+            phiM += phi * p;
+            ps[i]   = p;
             phis[i] = phi;
-            double p = calculateWeight(qm, key);
-            ps[i] = p;
-            phiM += phi * p;
             i++;
         }
 
         double sig = 0d;
-        for (i = 0; i < dm.size(); i++) {
+        for (i = 0; i < size; i++) {
             sig += ps[i] * Math.exp(phis[i] - phiM);
         }
         double deviation = Math.sqrt(sig);
@@ -331,7 +334,7 @@
 
         double sum = 0d;
         for (Double d : dm.values()) {
-            sum =+ d.doubleValue();
+            sum += d.doubleValue();
         }
         double weight = sum/100*value;
         return weight;
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedloadDiameterDataFacet.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedloadDiameterDataFacet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -0,0 +1,87 @@
+package org.dive4elements.river.artifacts.model.minfo;
+
+import gnu.trove.TDoubleArrayList;
+
+import org.apache.log4j.Logger;
+import org.dive4elements.artifactdatabase.state.Facet;
+import org.dive4elements.artifacts.Artifact;
+import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.river.artifacts.D4EArtifact;
+import org.dive4elements.river.artifacts.access.BedQualityAccess;
+import org.dive4elements.river.artifacts.model.DataFacet;
+import org.dive4elements.river.artifacts.states.DefaultState.ComputeType;
+
+
+public class BedloadDiameterDataFacet
+extends DataFacet
+{
+    private static final Logger logger = Logger.getLogger(BedDiameterDataFacet.class);
+
+    public BedloadDiameterDataFacet() {
+    }
+
+    public BedloadDiameterDataFacet(
+        int ndx,
+        String name,
+        String description,
+        ComputeType type,
+        String stateId,
+        String hash
+    ) {
+        super(ndx, name, description, type, hash, stateId);
+    }
+
+    public Object getData(Artifact artifact, CallContext context) {
+        D4EArtifact d4e = (D4EArtifact) artifact;
+        BedQualityAccess access = new BedQualityAccess(d4e, context);
+        int ndx = getIndex() & 7;
+        int diam = (getIndex() >> 3);
+        String diameter = "";
+        switch (diam) {
+            case 1: diameter = "d10"; break;
+            case 2: diameter = "d16"; break;
+            case 3: diameter = "d20"; break;
+            case 4: diameter = "d25"; break;
+            case 5: diameter = "d30"; break;
+            case 6: diameter = "d40"; break;
+            case 7: diameter = "d50"; break;
+            case 8: diameter = "d60"; break;
+            case 9: diameter = "d70"; break;
+            case 10: diameter = "d75"; break;
+            case 11: diameter = "d80"; break;
+            case 12: diameter = "d84"; break;
+            case 13: diameter = "d90"; break;
+            case 14: diameter = "dmin"; break;
+            case 15: diameter = "dmax"; break;
+            case 16: diameter = "dm"; break;
+            default: return null;
+        }
+
+        QualityMeasurements measurements =
+            QualityMeasurementFactory.getBedloadMeasurements(
+                access.getRiver(),
+                access.getFrom(),
+                access.getTo(),
+                access.getDateRanges().get(ndx).getFrom(),
+                access.getDateRanges().get(ndx).getTo());
+        TDoubleArrayList kms = new TDoubleArrayList();
+        TDoubleArrayList data = new TDoubleArrayList();
+        for (QualityMeasurement m : measurements.getMeasurements()) {
+            kms.add(m.getKm());
+            data.add(m.getDiameter(diameter)*1000);
+        }
+        BedDiameterData bdd = new BedDiameterData(diameter, kms, data);
+        return bdd;
+    }
+
+    /** Copy deeply. */
+    @Override
+    public Facet deepCopy() {
+        BedloadDiameterDataFacet copy = new BedloadDiameterDataFacet();
+        copy.set(this);
+        copy.type = type;
+        copy.hash = hash;
+        copy.stateId = stateId;
+        return copy;
+    }
+}
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQRelationJRDataSource.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQRelationJRDataSource.java	Tue Jun 11 09:40:56 2013 +0200
@@ -0,0 +1,100 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.artifacts.model.sq;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.apache.log4j.Logger;
+
+import net.sf.jasperreports.engine.JRDataSource;
+import net.sf.jasperreports.engine.JRException;
+import net.sf.jasperreports.engine.JRField;
+
+
+/**
+ * @author <a href="mailto:aheinecke at intevation.de">Andre Heinecke</a>
+ */
+public class SQRelationJRDataSource implements JRDataSource
+{
+    /** The logger used in this exporter.*/
+    private static Logger logger = Logger.getLogger(SQRelationJRDataSource.class);
+
+    private ArrayList<String[]> data;
+    private HashMap<String, String> metaData;
+
+    private int index = -1;
+
+    public SQRelationJRDataSource() {
+        data = new ArrayList<String[]>();
+        metaData = new HashMap<String, String>();
+    }
+
+    public void addData(String[] val) {
+        data.add(val);
+    }
+
+    public void addMetaData(String key, String value) {
+        metaData.put(key, value);
+    }
+
+    public boolean next() throws JRException {
+        index++;
+        return (index < data.size());
+    }
+
+    public Object getFieldValue(JRField field) throws JRException {
+        Object value = "";
+        String fieldName = field.getName();
+        if ("river".equals(fieldName)) {
+            value = metaData.get("river");
+        }
+        else if ("date".equals(fieldName)) {
+            value = metaData.get("date");
+        }
+        else if ("calculation".equals(fieldName)) {
+            value = metaData.get("calculation");
+        }
+        else if ("location".equals(fieldName)) {
+            value = metaData.get("location");
+        }
+        else if ("outliers".equals(fieldName)) {
+            value = metaData.get("outliers");
+        }
+        else if ("outliertest".equals(fieldName)) {
+            value = metaData.get("outliertest");
+        }
+        else if ("periods".equals(fieldName)) {
+            value = metaData.get("periods");
+        }
+        else if ("km".equals(fieldName)) {
+            value = data.get(index)[0];
+        }
+        else if ("param".equals(fieldName)) {
+            value = data.get(index)[1];
+        }
+        else if ("a".equals(fieldName)) {
+            value = data.get(index)[2];
+        }
+        else if ("b".equals(fieldName)) {
+            value = data.get(index)[3];
+        }
+        else if ("total".equals(fieldName)) {
+            value = data.get(index)[4];
+        }
+        else if ("out".equals(fieldName)) {
+            value = data.get(index)[5];
+        }
+        else if ("variance".equals(fieldName)) {
+            value = data.get(index)[6];
+        }
+        return value;
+    }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java	Tue Jun 11 09:40:56 2013 +0200
@@ -79,7 +79,7 @@
         }
 
         double[] minmax = getRequestedStartEnd(data, river);
-        Gauge gauge = river.maxOverlap(minmax[0], minmax[1]);
+        Gauge gauge = river.determineGauge(minmax[0], minmax[1]);
 
         if (gauge == null) {
             return error("no gauge found.");
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/DischargeState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DischargeState.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DischargeState.java	Tue Jun 11 09:40:56 2013 +0200
@@ -9,6 +9,8 @@
 package org.dive4elements.river.artifacts.states;
 
 import java.util.List;
+import java.util.Collections;
+import java.util.Comparator;
 
 import org.apache.log4j.Logger;
 
@@ -68,9 +70,16 @@
 
         KVP[] kvp = new KVP[zones.size()];
 
-        for (int i = 0, Z = zones.size(); i < Z; i++) {
-            DischargeZone zone = zones.get(i);
+        Collections.sort(zones, new Comparator<DischargeZone>() {
+            @Override
+            public int compare(DischargeZone a, DischargeZone b) {
+                return a.getValue().compareTo(b.getValue());
+            }
+        });
 
+        int i = 0;
+
+        for (DischargeZone zone: zones) {
             String lower = zone.getLowerDischarge();
             String upper = zone.getUpperDischarge();
 
@@ -80,6 +89,7 @@
             else {
                 kvp[i] = new KVP(zone.getId(), lower + " - " + upper);
             }
+            i++;
         }
 
         return kvp;
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/DistanceOnlySelect.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DistanceOnlySelect.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DistanceOnlySelect.java	Tue Jun 11 09:40:56 2013 +0200
@@ -34,7 +34,7 @@
         D4EArtifact flys = (D4EArtifact) artifact;
 
         try {
-            RangeAccess rangeAccess = new RangeAccess(flys, null);
+            RangeAccess rangeAccess = new RangeAccess(flys);
             double from = rangeAccess.getFrom();
             double to   = rangeAccess.getTo();
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/DurationCurveState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DurationCurveState.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DurationCurveState.java	Tue Jun 11 09:40:56 2013 +0200
@@ -75,7 +75,7 @@
             WQDay wqday = (WQDay)res.getData();
 
             if (wqday != null && facets != null) {
-                RangeAccess rangeAccess = new RangeAccess(winfo, context);
+                RangeAccess rangeAccess = new RangeAccess(winfo);
                 // Create an i18ed name for a (w or q) duration curve facet.
                 Object[] args = new Object[] {
                     RiverUtils.getRiver(winfo).getName(),
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/FloodMapState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FloodMapState.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FloodMapState.java	Tue Jun 11 09:40:56 2013 +0200
@@ -483,7 +483,7 @@
 
 
     protected void setRange(D4EArtifact artifact, WSPLGENJob job) {
-        RangeAccess rangeAccess = new RangeAccess(artifact, null);
+        RangeAccess rangeAccess = new RangeAccess(artifact);
         double[] range = rangeAccess.getKmRange();
 
         job.setStart(range[0]);
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/FlowVelocityState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FlowVelocityState.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FlowVelocityState.java	Tue Jun 11 09:40:56 2013 +0200
@@ -70,7 +70,7 @@
 
         List<Facet> newFacets = new ArrayList<Facet>();
 
-        FlowVelocityAccess access = new FlowVelocityAccess(artifact, context);
+        FlowVelocityAccess access = new FlowVelocityAccess(artifact);
 
         CalculationResult res = old instanceof CalculationResult
             ? (CalculationResult) old
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/HWSBarriersState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/HWSBarriersState.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/HWSBarriersState.java	Tue Jun 11 09:40:56 2013 +0200
@@ -110,7 +110,7 @@
             return null;
         }
 
-        MapAccess access = new MapAccess(artifact, context);
+        MapAccess access = new MapAccess(artifact);
         String river = access.getRiver();
         HWSContainer hwsLines = HWSFactory.getHWSLines(river);
         HWSContainer hwsPoints = HWSFactory.getHWSPoints(river);
@@ -219,7 +219,6 @@
     }
 
     private boolean extractUserShp(File dir) {
-        // TODO Auto-generated method stub
         File archive = new File(dir, USER_RGD_ZIP);
         boolean exists = archive.exists();
         logger.debug("Zip file exists: " + exists);
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java	Tue Jun 11 09:40:56 2013 +0200
@@ -46,7 +46,7 @@
 
         List<Facet> newFacets = new ArrayList<Facet>();
 
-        BedHeightAccess access = new BedHeightAccess(artifact, context);
+        BedHeightAccess access = new BedHeightAccess(artifact);
 
         CalculationResult res = old instanceof CalculationResult
             ? (CalculationResult) old
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java	Tue Jun 11 09:40:56 2013 +0200
@@ -83,7 +83,7 @@
         D4EArtifact flys = (D4EArtifact) artifact;
 
         try {
-            RangeAccess rangeAccess = new RangeAccess(flys, null);
+            RangeAccess rangeAccess = new RangeAccess(flys);
             double from = rangeAccess.getFrom();
             double to   = rangeAccess.getTo();
             double step = rangeAccess.getStep();
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQAdapted.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQAdapted.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQAdapted.java	Tue Jun 11 09:40:56 2013 +0200
@@ -137,7 +137,7 @@
 
         D4EArtifact flysArtifact = (D4EArtifact) artifact;
 
-        RangeAccess rangeAccess = new RangeAccess(flysArtifact, context);
+        RangeAccess rangeAccess = new RangeAccess(flysArtifact);
         double[]    dist   = rangeAccess.getKmRange();
         // TODO use Access to get River and gauges.
         River       river  = RiverUtils.getRiver(flysArtifact);
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeCompute.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeCompute.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeCompute.java	Tue Jun 11 09:40:56 2013 +0200
@@ -61,7 +61,7 @@
 
         CalculationResult res;
 
-        ExtremeAccess access = new ExtremeAccess(artifact, context);
+        ExtremeAccess access = new ExtremeAccess(artifact);
 
         if (old instanceof CalculationResult) {
             res = (CalculationResult)old;
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeQInput.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeQInput.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeQInput.java	Tue Jun 11 09:40:56 2013 +0200
@@ -86,7 +86,7 @@
 
         D4EArtifact flysArtifact = (D4EArtifact) artifact;
 
-        ExtremeAccess access = new ExtremeAccess(flysArtifact, context);
+        ExtremeAccess access = new ExtremeAccess(flysArtifact);
         River river = RiverFactory.getRiver(access.getRiver());
         WstValueTable wstValueTable = WstValueTableFactory.getTable(river);
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixAnalysisCompute.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixAnalysisCompute.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixAnalysisCompute.java	Tue Jun 11 09:40:56 2013 +0200
@@ -133,8 +133,7 @@
 
         CalculationResult res;
 
-        FixAnalysisAccess access =
-            new FixAnalysisAccess(artifact, context);
+        FixAnalysisAccess access = new FixAnalysisAccess(artifact);
 
         if (old instanceof CalculationResult) {
             res = (CalculationResult)old;
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixRealizingCompute.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixRealizingCompute.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixRealizingCompute.java	Tue Jun 11 09:40:56 2013 +0200
@@ -71,8 +71,7 @@
 
         CalculationResult res;
 
-        FixRealizingAccess access =
-            new FixRealizingAccess(artifact, context);
+        FixRealizingAccess access = new FixRealizingAccess(artifact);
 
         if (old instanceof CalculationResult) {
             res = (CalculationResult) old;
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityState.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/BedQualityState.java	Tue Jun 11 09:40:56 2013 +0200
@@ -15,6 +15,8 @@
 import org.apache.log4j.Logger;
 
 import org.dive4elements.artifactdatabase.state.Facet;
+import org.dive4elements.artifactdatabase.state.FacetActivity;
+import org.dive4elements.artifacts.Artifact;
 import org.dive4elements.artifacts.CallContext;
 import org.dive4elements.artifacts.CallMeta;
 import org.dive4elements.river.artifacts.D4EArtifact;
@@ -24,6 +26,7 @@
 import org.dive4elements.river.artifacts.model.DateRange;
 import org.dive4elements.river.artifacts.model.FacetTypes;
 import org.dive4elements.river.artifacts.model.minfo.BedDensityFacet;
+import org.dive4elements.river.artifacts.model.minfo.BedDiameterDataFacet;
 import org.dive4elements.river.artifacts.model.minfo.BedDiameterFacet;
 import org.dive4elements.river.artifacts.model.minfo.BedDiameterResult;
 import org.dive4elements.river.artifacts.model.minfo.BedParametersResult;
@@ -31,6 +34,7 @@
 import org.dive4elements.river.artifacts.model.minfo.BedQualityCalculation;
 import org.dive4elements.river.artifacts.model.minfo.BedQualityDiameterResult;
 import org.dive4elements.river.artifacts.model.minfo.BedQualityResult;
+import org.dive4elements.river.artifacts.model.minfo.BedloadDiameterDataFacet;
 import org.dive4elements.river.artifacts.model.minfo.BedloadDiameterFacet;
 import org.dive4elements.river.artifacts.model.minfo.BedloadDiameterResult;
 import org.dive4elements.river.artifacts.resources.Resources;
@@ -53,8 +57,37 @@
     public static final String I18N_FACET_BED_DENSITY_SUBLAYER = "facet.bedquality.bed.density.sublayer";
     public static final String I18N_FACET_BED_DIAMETER_TOPLAYER = "facet.bedquality.bed.diameter.toplayer";
     public static final String I18N_FACET_BED_DIAMETER_SUBLAYER = "facet.bedquality.bed.diameter.sublayer";
+    public static final String I18N_FACET_BED_DIAMETER_DATA_TOPLAYER = "facet.bedquality.bed.diameter.data.toplayer";
+    public static final String I18N_FACET_BED_DIAMETER_DATA_SUBLAYER = "facet.bedquality.bed.diameter.data.sublayer";
+    public static final String I18N_FACET_BEDLOAD_DIAMETER_DATA = "facet.bedquality.bedload.diameter.data";
     public static final String I18N_FACET_BEDLOAD_DIAMETER = "facet.bedquality.bedload.diameter";
 
+    static {
+        // Active/deactivate facets.
+        FacetActivity.Registry.getInstance().register(
+            "minfo",
+            new FacetActivity() {
+                @Override
+                public Boolean isInitialActive(
+                    Artifact artifact,
+                    Facet    facet,
+                    String   output
+                ) {
+                    String name = facet.getName();
+                    if (name.equals(BED_QUALITY_SEDIMENT_DENSITY_TOPLAYER) ||
+                        name.equals(BED_QUALITY_SEDIMENT_DENSITY_SUBLAYER) ||
+                        name.equals(BED_DIAMETER_DATA_TOP) ||
+                        name.equals(BED_DIAMETER_DATA_SUB) ||
+                        name.equals(BEDLOAD_DIAMETER_DATA)){
+                        return Boolean.FALSE;
+                    }
+                    else {
+                        return null;
+                    }
+                }
+            });
+    }
+
     @Override
     public Object computeAdvance(D4EArtifact artifact, String hash,
         CallContext context, List<Facet> facets, Object old) {
@@ -80,12 +113,138 @@
 
         generateFacets(context, newFacets, results, getID(), hash);
         logger.debug("Created " + newFacets.size() + " new Facets.");
-
+        generateDataFacets(context, newFacets, access, getID(), hash);
         facets.addAll(newFacets);
 
         return res;
     }
 
+    private void generateDataFacets(
+        CallContext context,
+        List<Facet> newFacets,
+        BedQualityAccess access,
+        String stateId,
+        String hash) {
+        List<String> diameters = access.getBedDiameter();
+        List<String> loadDiameters = access.getBedloadDiameter();
+        List<DateRange> ranges = access.getDateRanges();
+        for (int i = 0; i < ranges.size(); i++) {
+            DateRange range = ranges.get(i);
+            for (String diameter: diameters) {
+                int ndxTop = generateIndex(diameter);
+                int ndxSub = generateIndex(diameter);
+                ndxTop += 1;
+                ndxTop = ndxTop << 3;
+                ndxSub = ndxSub << 3;
+                ndxTop += i;
+                ndxSub += i;
+                String toplayer =
+                    Resources.getMsg(
+                        context.getMeta(), I18N_TOPLAYER, I18N_TOPLAYER);
+                String sublayer =
+                    Resources.getMsg(
+                        context.getMeta(), I18N_SUBLAYER, I18N_SUBLAYER);
+                //toplayer
+                newFacets.add(new BedDiameterDataFacet(
+                    ndxTop,
+                    BED_DIAMETER_DATA_TOP,
+                    Resources.getMsg(
+                        context.getMeta(),
+                        I18N_FACET_BED_DIAMETER_DATA_TOPLAYER,
+                        I18N_FACET_BED_DIAMETER_DATA_TOPLAYER,
+                        new Object[] { diameter.toUpperCase(),
+                            range.getFrom(), range.getTo(), toplayer}),
+                    ComputeType.ADVANCE,
+                    stateId,
+                    hash));
+                //sublayer
+                newFacets.add(new BedDiameterDataFacet(
+                    ndxSub,
+                    BED_DIAMETER_DATA_SUB,
+                    Resources.getMsg(
+                        context.getMeta(),
+                        I18N_FACET_BED_DIAMETER_DATA_TOPLAYER,
+                        I18N_FACET_BED_DIAMETER_DATA_TOPLAYER,
+                        new Object[] { diameter.toUpperCase(),
+                            range.getFrom(), range.getTo(), sublayer}),
+                    ComputeType.ADVANCE,
+                    stateId,
+                    hash));
+            }
+            for (String loadDiameter: loadDiameters) {
+                int ndx = generateIndex(loadDiameter);
+                ndx = ndx << 3;
+                ndx += i;
+                newFacets.add(new BedloadDiameterDataFacet(
+                    ndx,
+                    BEDLOAD_DIAMETER_DATA,
+                    Resources.getMsg(
+                        context.getMeta(),
+                        I18N_FACET_BEDLOAD_DIAMETER_DATA,
+                        I18N_FACET_BEDLOAD_DIAMETER_DATA,
+                        new Object[] { loadDiameter.toUpperCase(),
+                            range.getFrom(), range.getTo()}),
+                    ComputeType.ADVANCE,
+                    stateId,
+                    hash));
+            }
+        }
+    }
+
+    private int generateIndex(String diameter) {
+        int d = 0;
+        if(diameter.equals("d10")) {
+            d = 1;
+        }
+        else if (diameter.equals("d16")) {
+            d = 2;
+        }
+        else if (diameter.equals("d20")) {
+            d = 3;
+        }
+        else if (diameter.equals("d25")) {
+            d = 4;
+        }
+        else if (diameter.equals("d30")) {
+            d = 5;
+        }
+        else if (diameter.equals("d40")) {
+            d = 6;
+        }
+        else if (diameter.equals("d50")) {
+            d = 7;
+        }
+        else if (diameter.equals("d60")) {
+            d = 8;
+        }
+        else if (diameter.equals("d70")) {
+            d = 9;
+        }
+        else if (diameter.equals("d75")) {
+            d = 10;
+        }
+        else if (diameter.equals("d80")) {
+            d = 11;
+        }
+        else if (diameter.equals("d84")) {
+            d = 12;
+        }
+        else if (diameter.equals("d90")) {
+            d = 13;
+        }
+        else if (diameter.equals("dmin")) {
+            d = 14;
+        }
+        else if (diameter.equals("dmax")) {
+            d = 15;
+        }
+        else if (diameter.equals("dm")) {
+            d = 16;
+        }
+        int ndx = d << 1;
+        return ndx;
+    }
+
     protected void generateFacets(CallContext context, List<Facet> newFacets,
         BedQualityResult[] results, String stateId, String hash) {
         logger.debug("BedQualityState.generateFacets");
@@ -126,39 +285,41 @@
                     hash));
 
             }
-            BedParametersResult[] bedParameters = result.getParameters();
-            for (int j = 0; j < bedParameters.length; j++) {
-                newFacets.add(new BedPorosityFacet((idx << 8) + j,
-                    BED_QUALITY_POROSITY_TOPLAYER,
-                    createPorosityTopLayerDescription(
-                        meta,
-                        bedParameters[j],
-                        range),
-                    ComputeType.ADVANCE, stateId, hash));
+            if (bedDiameter.length > 0) {
+                BedParametersResult[] bedParameters = result.getParameters();
+                for (int j = 0; j < bedParameters.length; j++) {
+                    newFacets.add(new BedPorosityFacet((idx << 8) + j,
+                        BED_QUALITY_POROSITY_TOPLAYER,
+                        createPorosityTopLayerDescription(
+                            meta,
+                            bedParameters[j],
+                            range),
+                        ComputeType.ADVANCE, stateId, hash));
 
-                newFacets.add(new BedPorosityFacet((idx << 8) + j,
-                    BED_QUALITY_POROSITY_SUBLAYER,
-                    createPorositySubLayerDescription(
-                        meta,
-                        bedParameters[j],
-                        range),
-                    ComputeType.ADVANCE, stateId, hash));
+                    newFacets.add(new BedPorosityFacet((idx << 8) + j,
+                        BED_QUALITY_POROSITY_SUBLAYER,
+                        createPorositySubLayerDescription(
+                            meta,
+                            bedParameters[j],
+                            range),
+                        ComputeType.ADVANCE, stateId, hash));
 
-                newFacets.add(new BedDensityFacet((idx << 8) + j,
-                    BED_QUALITY_SEDIMENT_DENSITY_TOPLAYER,
-                    createDensityTopLayerDescription(
-                        meta,
-                        bedParameters[j],
-                        range),
-                    ComputeType.ADVANCE, stateId, hash));
+                    newFacets.add(new BedDensityFacet((idx << 8) + j,
+                        BED_QUALITY_SEDIMENT_DENSITY_TOPLAYER,
+                        createDensityTopLayerDescription(
+                            meta,
+                            bedParameters[j],
+                            range),
+                        ComputeType.ADVANCE, stateId, hash));
 
-                newFacets.add(new BedDensityFacet((idx << 8) + j,
-                    BED_QUALITY_SEDIMENT_DENSITY_SUBLAYER,
-                    createDensitySubLayerDescription(
-                        meta,
-                        bedParameters[j],
-                        range),
-                    ComputeType.ADVANCE, stateId, hash));
+                    newFacets.add(new BedDensityFacet((idx << 8) + j,
+                        BED_QUALITY_SEDIMENT_DENSITY_SUBLAYER,
+                        createDensitySubLayerDescription(
+                            meta,
+                            bedParameters[j],
+                            range),
+                        ComputeType.ADVANCE, stateId, hash));
+                }
             }
         }
     }
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferenceSelect.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferenceSelect.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferenceSelect.java	Tue Jun 11 09:40:56 2013 +0200
@@ -63,7 +63,7 @@
         CallContext             context)
     {
         Element[] elements = new Element[1];
-        BedHeightAccess bha = new BedHeightAccess((D4EArtifact)artifact, context);
+        BedHeightAccess bha = new BedHeightAccess((D4EArtifact)artifact);
         String time = bha.getYearEpoch();
         elements[0] = createItem(
             ec,
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java	Tue Jun 11 09:40:56 2013 +0200
@@ -22,6 +22,7 @@
 import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.access.BedDifferencesAccess;
 import org.dive4elements.river.artifacts.model.CalculationResult;
+import org.dive4elements.river.artifacts.model.DataFacet;
 import org.dive4elements.river.artifacts.model.FacetTypes;
 import org.dive4elements.river.artifacts.model.minfo.BedDiffCalculation;
 import org.dive4elements.river.artifacts.model.minfo.BedDiffEpochFacet;
@@ -71,11 +72,11 @@
 
         List<Facet> newFacets = new ArrayList<Facet>();
 
-        BedDifferencesAccess access =
-            new BedDifferencesAccess(artifact, context);
+        BedDifferencesAccess access = new BedDifferencesAccess(artifact);
 
-        CalculationResult res = old instanceof CalculationResult ? (CalculationResult) old
-            : new BedDiffCalculation().calculate(access);
+        CalculationResult res = old instanceof CalculationResult
+            ? (CalculationResult)old
+            : new BedDiffCalculation().calculate(access, context);
 
         if (facets == null || res == null) {
             return res;
@@ -102,6 +103,8 @@
 
         CallMeta meta = context.getMeta();
 
+        newFacets.add(new DataFacet(CSV, "CSV data", ComputeType.ADVANCE, hash, id));
+        newFacets.add(new DataFacet(PDF, "PDF data", ComputeType.ADVANCE, hash, id));
         for (int idx = 0; idx < results.length; idx++) {
             if (results[idx] instanceof BedDiffYearResult) {
                 newFacets.add(new BedDiffYearFacet(
@@ -386,20 +389,20 @@
                     if (name.equals(BED_DIFFERENCE_EPOCH) ||
                         name.equals(BED_DIFFERENCE_EPOCH_HEIGHT1) ||
                         name.equals(BED_DIFFERENCE_EPOCH_HEIGHT2) ||
+                        name.equals(BED_DIFFERENCE_EPOCH_HEIGHT1_FILTERED) ||
+                        name.equals(BED_DIFFERENCE_EPOCH_HEIGHT2_FILTERED) ||
                         name.equals(BED_DIFFERENCE_HEIGHT_YEAR) ||
                         name.equals(BED_DIFFERENCE_YEAR) ||
                         name.equals(BED_DIFFERENCE_YEAR_HEIGHT1) ||
-                        name.equals(BED_DIFFERENCE_YEAR_HEIGHT2)) {
+                        name.equals(BED_DIFFERENCE_YEAR_HEIGHT2) ||
+                        name.equals(BED_DIFFERENCE_YEAR_HEIGHT1_FILTERED) ||
+                        name.equals(BED_DIFFERENCE_YEAR_HEIGHT2_FILTERED)){
                         return Boolean.FALSE;
                     }
                     else if (name.equals(BED_DIFFERENCE_MORPH_WIDTH) ||
                         name.equals(BED_DIFFERENCE_EPOCH_FILTERED) ||
-                        name.equals(BED_DIFFERENCE_EPOCH_HEIGHT1_FILTERED) ||
-                        name.equals(BED_DIFFERENCE_EPOCH_HEIGHT2_FILTERED) ||
                         name.equals(BED_DIFFERENCE_HEIGHT_YEAR_FILTERED) ||
-                        name.equals(BED_DIFFERENCE_YEAR_FILTERED) ||
-                        name.equals(BED_DIFFERENCE_YEAR_HEIGHT1_FILTERED) ||
-                        name.equals(BED_DIFFERENCE_YEAR_HEIGHT2_FILTERED)){
+                        name.equals(BED_DIFFERENCE_YEAR_FILTERED)) {
                         return Boolean.TRUE;
                     }
                     else {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadCalculate.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadCalculate.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadCalculate.java	Tue Jun 11 09:40:56 2013 +0200
@@ -55,7 +55,7 @@
 
         List<Facet> newFacets = new ArrayList<Facet>();
 
-        SedimentLoadAccess access = new SedimentLoadAccess(artifact, context);
+        SedimentLoadAccess access = new SedimentLoadAccess(artifact);
 
         CalculationResult res = old instanceof CalculationResult ? (CalculationResult) old
             : new SedimentLoadCalculation().calculate(access);
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadYearSelect.java
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadYearSelect.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadYearSelect.java	Tue Jun 11 09:40:56 2013 +0200
@@ -44,7 +44,7 @@
     public boolean validate(Artifact artifact)
     throws IllegalArgumentException
     {
-        SedimentLoadAccess access = new SedimentLoadAccess((D4EArtifact) artifact, null);
+        SedimentLoadAccess access = new SedimentLoadAccess((D4EArtifact) artifact);
 
         // Second year should be later than first.
         if (access.getPeriod() != null && access.getPeriod()[1] < access.getPeriod()[0])
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java
--- a/artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java	Tue Jun 11 09:40:56 2013 +0200
@@ -188,18 +188,23 @@
            logger.debug("Compatible facets are " + compatibleFacets);
         }
 
-        for (int i = 0; i < num; i++) {
-            ManagedFacet facet = (ManagedFacet) newFacets.get(i);
+        for (Facet fac: newFacets) {
+            ManagedFacet facet = (ManagedFacet) fac;
 
             if (debug) {
                 logger.debug("Try to add Facet: " + facet.getName());
             }
 
             if (!compatibleFacets.contains(facet.getName())) {
-                logger.warn("Have incompatible facet, skip: " + facet.getName());
+                logger.debug("Have incompatible facet, skip: " + facet.getName());
                 continue;
-            }
-            else {
+            } else if (facet.getBoundToOut() != null &&
+                    !facet.getBoundToOut().equals(outputName)) {
+                logger.debug("Skip facet " + facet.getName() +
+                        " because it is bound to: " + facet.getBoundToOut());
+                continue;
+            } else {
+                logger.debug("Facet is bound to: " + facet.getBoundToOut());
                 logger.debug("Have compatible facet: " + facet.getName());
             }
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java	Tue Jun 11 09:40:56 2013 +0200
@@ -95,7 +95,7 @@
         }
 
         River river = RiverUtils.getRiver(master);
-        RangeAccess rangeAccess = new RangeAccess(master, context);
+        RangeAccess rangeAccess = new RangeAccess(master);
         double[] kms = rangeAccess.getLocations();
 
         Gauge gauge = river.determineGaugeByPosition(kms[0]);
@@ -111,7 +111,7 @@
                 gauge.getName(),
                 gauge.getDatum(),
                 interval.getStartTime(),
-                100d);
+                false);
         }
         else {
             // at km
@@ -123,7 +123,7 @@
                 null,
                 null,
                 null,
-                0d);
+                true);
         }
 
     }
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/ATWriter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ATWriter.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ATWriter.java	Tue Jun 11 09:40:56 2013 +0200
@@ -130,7 +130,7 @@
         Date        date
     ) {
         DateFormat f = DateFormat.getDateInstance();
-        out.print(Resources.getMsg(
+        out.print("*" + Resources.getMsg(
             callMeta,
             I18N_AT_GAUGE_HEADER,
             I18N_AT_GAUGE_HEADER,
@@ -144,7 +144,7 @@
         String      river,
         double      km
     ) {
-        out.print(Resources.getMsg(
+        out.print("*" + Resources.getMsg(
             callMeta,
             I18N_AT_HEADER,
             I18N_AT_HEADER,
@@ -160,7 +160,7 @@
         String gName,
         BigDecimal datum,
         Date date,
-        double scale)
+        boolean wOutUnitIsMeter)
     throws IOException
     {
         PrintWriter out = new PrintWriter(writer);
@@ -186,7 +186,13 @@
         int col = 0;
         for (double w = startW; w <= maxW; w += 0.01) {
             if (col == 0) {
-                out.printf(Locale.US, "%8d", (int)Math.round(w * scale));
+                if (wOutUnitIsMeter) {
+                    // For some crazy reason W's at a gauge should be in the
+                    // unit but W's exported elsewhere should be in Meter
+                    out.printf(Locale.US, "%5.2f", w);
+                } else {
+                    out.printf(Locale.US, "%8d", (int)Math.round(w * 100d));
+                }
             }
 
             if (w < minW) {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -1432,7 +1432,7 @@
     protected double[] getRange() {
         D4EArtifact flys = (D4EArtifact) master;
 
-        RangeAccess rangeAccess = new RangeAccess(flys, null);
+        RangeAccess rangeAccess = new RangeAccess(flys);
         return rangeAccess.getKmRange();
     }
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java	Tue Jun 11 09:40:56 2013 +0200
@@ -129,7 +129,7 @@
         logger.debug("ComputedDischargeCurveExporter.writeCSVHeader");
 
         String unit = RiverUtils.getRiver((D4EArtifact) master).getWstUnit().getName();
-        RangeAccess access = new RangeAccess((D4EArtifact)master, context);
+        RangeAccess access = new RangeAccess((D4EArtifact)master);
         double[] km = access.getLocations();
         String header =
             msg(CSV_W_HEADER, DEFAULT_CSV_W_HEADER, new Object[] { unit });
@@ -218,7 +218,7 @@
 
         source.addMetaData("date", df.format(new Date()));
 
-        RangeAccess rangeAccess = new RangeAccess(flys, null);
+        RangeAccess rangeAccess = new RangeAccess(flys);
         double[] kms = rangeAccess.getKmRange();
         source.addMetaData("range", String.valueOf(kms[0]));
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/DurationCurveExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DurationCurveExporter.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DurationCurveExporter.java	Tue Jun 11 09:40:56 2013 +0200
@@ -227,7 +227,7 @@
 
         source.addMetaData("date", df.format(new Date()));
 
-        RangeAccess rangeAccess = new RangeAccess(flys, null);
+        RangeAccess rangeAccess = new RangeAccess(flys);
         double[] kms = rangeAccess.getKmRange();
         source.addMetaData("range", String.valueOf(kms[0]));
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityGenerator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityGenerator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -240,13 +240,13 @@
         }
         else if (getXBounds(0) == null && getDomainAxisRange() == null) {
             D4EArtifact artifact = (D4EArtifact)artifactAndFacet.getArtifact();
-            FlowVelocityAccess access = new FlowVelocityAccess(artifact, context);
+            FlowVelocityAccess access = new FlowVelocityAccess(artifact);
             context.putContextValue("startkm", access.getLowerKM());
             context.putContextValue("endkm", access.getUpperKM());
         }
         else if (getXBounds(0) == null && getDomainAxisRange() != null){
             D4EArtifact artifact = (D4EArtifact)artifactAndFacet.getArtifact();
-            FlowVelocityAccess access = new FlowVelocityAccess(artifact, context);
+            FlowVelocityAccess access = new FlowVelocityAccess(artifact);
             Bounds b = new DoubleBounds(access.getLowerKM(), access.getUpperKM());
             Bounds bounds =
                 calculateZoom(b, getDomainAxisRange());
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -11,24 +11,33 @@
 import java.util.Date;
 
 import org.apache.log4j.Logger;
-import org.jfree.chart.plot.XYPlot;
-import org.jfree.data.general.SeriesException;
-import org.jfree.data.time.Day;
-import org.jfree.data.time.RegularTimePeriod;
-import org.jfree.data.time.TimeSeries;
-import org.jfree.data.time.TimeSeriesCollection;
-import org.w3c.dom.Document;
 
 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
+
 import org.dive4elements.river.artifacts.D4EArtifact;
+
 import org.dive4elements.river.artifacts.access.HistoricalDischargeAccess;
+
 import org.dive4elements.river.artifacts.model.FacetTypes;
 import org.dive4elements.river.artifacts.model.HistoricalWQTimerange;
 import org.dive4elements.river.artifacts.model.Timerange;
 import org.dive4elements.river.artifacts.model.WQTimerange;
+
 import org.dive4elements.river.jfree.StyledTimeSeries;
+
 import org.dive4elements.river.utils.RiverUtils;
 
+import org.jfree.chart.plot.XYPlot;
+
+import org.jfree.data.general.SeriesException;
+
+import org.jfree.data.time.FixedMillisecond;
+import org.jfree.data.time.RegularTimePeriod;
+import org.jfree.data.time.TimeSeries;
+import org.jfree.data.time.TimeSeriesCollection;
+
+import org.w3c.dom.Document;
+
 
 /**
  * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
@@ -249,18 +258,18 @@
     }
 
     /**
-     * Creates an array that consists of two <i>Minute</i> periods [start, end].
+     * Creates an array that consists of two <i>FixedMillisecond</i> periods [start, end].
      *
      * @param timerange
      *            Supports start and end time.
      *
-     * @return an array with two <i>Minute</i> periods [start, end].
+     * @return an array with two <i>FixedMillisecond</i> periods [start, end].
      */
     protected RegularTimePeriod[] newRegularTimePeriod(Timerange timerange) {
         Date start = new Date(timerange.getStart());
         Date end = new Date(timerange.getEnd() - 1000 * 60 * 60 * 24);
 
-        return new RegularTimePeriod[] { new Day(start), new Day(end) };
+        return new RegularTimePeriod[] { new FixedMillisecond(start), new FixedMillisecond(end) };
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -8,8 +8,6 @@
 
 package org.dive4elements.river.exports;
 
-import com.vividsolutions.jts.geom.Envelope;
-
 import org.dive4elements.artifactdatabase.data.StateData;
 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
 import org.dive4elements.artifactdatabase.state.Facet;
@@ -41,6 +39,8 @@
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
+import com.vividsolutions.jts.geom.Envelope;
+
 
 public class MapGenerator implements OutGenerator, FacetTypes {
 
@@ -102,7 +102,7 @@
         String name = artifactFacet.getFacetName();
 
         logger.debug("MapGenerator.doOut: " +
-            artifactFacet.getArtifact().identifier() + " | " + name);
+                artifactFacet.getArtifact().identifier() + " | " + name);
         D4EArtifact flys = (D4EArtifact) artifactFacet.getArtifact();
 
         Facet nativeFacet = artifactFacet.getFacet();
@@ -161,12 +161,12 @@
                 mfg.createUeskLayer(
                     flys,
                     (WSPLGENLayerFacet) wms,
-                    ThemeUtil.createDynamicMapserverStyle(attr, from, to, step),
+                    ThemeUtil.createDynamicMapserverStyle(attr, from, to, step, context.getMeta()),
                     context);
             }
             else {
                 logger.warn("Cannot create WSPLGEN layer from: " +
-                            wms.getClass());
+                        wms.getClass());
             }
         }
         catch (IOException ioe) {
@@ -225,9 +225,9 @@
 
             if (wms instanceof WMSDBLayerFacet) {
                 mfg.createDatabaseLayer(
-                    flys,
-                    (WMSDBLayerFacet) wms,
-                    ThemeUtil.createMapserverStyle(attr));
+                        flys,
+                        (WMSDBLayerFacet) wms,
+                        ThemeUtil.createMapserverStyle(attr));
             }
             else {
                 logger.warn("Cannot create DB layer from: " + wms.getClass());
@@ -244,7 +244,7 @@
 
     @Override
     public void generate()
-    throws IOException
+            throws IOException
     {
         logger.debug("MapGenerator.generate");
 
@@ -253,9 +253,9 @@
 
         Document response = XMLUtils.newDocument();
         ElementCreator c  = new ElementCreator(
-            response,
-            ArtifactNamespaceContext.NAMESPACE_URI,
-            ArtifactNamespaceContext.NAMESPACE_PREFIX);
+                response,
+                ArtifactNamespaceContext.NAMESPACE_URI,
+                ArtifactNamespaceContext.NAMESPACE_PREFIX);
 
         Element root   = c.create("floodmap");
         Element layers = c.create("layers");
@@ -267,7 +267,7 @@
         appendMapInformation(root, c);
 
         XMLUtils.toStream(response, out);
-    }
+            }
 
 
     protected void appendLayers(Element parent) {
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightGenerator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightGenerator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -31,7 +31,7 @@
  * @author <a href="mailto:ingo.weinzierl at intevation.de">Ingo Weinzierl</a>
  */
 public class MiddleBedHeightGenerator
-extends        XYChartGenerator
+extends      XYChartGenerator
 implements   FacetTypes
 {
     public enum YAXIS {
@@ -148,7 +148,13 @@
      * Get internationalized label for the y axis.
      */
     protected String getHAxisLabel() {
-        return msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
+        D4EArtifact flys = (D4EArtifact) master;
+
+        String unit = RiverUtils.getRiver(flys).getWstUnit().getName();
+
+        return msg(I18N_YAXIS_LABEL,
+            I18N_YAXIS_LABEL_DEFAULT,
+            new Object[] { unit });
     }
 
 
@@ -243,7 +249,7 @@
 
         XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
 
-        StyledSeriesBuilder.addPoints(series, data.getMiddleHeightsPoints(), false);
+        StyledSeriesBuilder.addPoints(series, data.getMiddleHeightsPoints(), false, 0.110d);
 
         addAxisSeries(series, YAXIS.H.idx, visible);
     }
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java	Tue Jun 11 09:40:56 2013 +0200
@@ -26,6 +26,7 @@
 import org.dive4elements.artifactdatabase.Backend;
 import org.dive4elements.artifactdatabase.Backend.PersistentArtifact;
 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
+import org.dive4elements.artifactdatabase.state.Facet;
 import org.dive4elements.artifacts.Artifact;
 import org.dive4elements.artifacts.ArtifactDatabase;
 import org.dive4elements.artifacts.ArtifactDatabaseException;
@@ -75,16 +76,11 @@
 
         ThemeList themeList = new ThemeList(attributes);
 
-        int size = themeList.size();
-        if (debug) {
-            log.debug("Output will contain " + size + " elements.");
-        }
-
         List<ArtifactAndFacet> dataProviders =
-            doBlackboardPass(themeList, context);
+            doBlackboardPass(themeList, context, outName);
 
         try {
-            for (int i = 0; i < size; i++) {
+            for (int i = 0; i < themeList.size(); i++) {
                 ManagedFacet theme = themeList.get(i);
 
                 if (theme == null) {
@@ -322,27 +318,40 @@
      * @param context   The "Blackboard".
      */
     protected List<ArtifactAndFacet> doBlackboardPass(
-        ThemeList themeList, CallContext context
+        ThemeList themeList, CallContext context, String outname
     ) {
         ArrayList<ArtifactAndFacet> dataProviders =
             new ArrayList<ArtifactAndFacet>();
-        int size = themeList.size();
 
         try {
             // Collect all ArtifactAndFacets for blackboard pass.
-            for (int i = 0; i < size; i++) {
+            for (int i = 0; i < themeList.size(); i++) {
+                log.debug("BLackboard pass for: " + outname);
                 ManagedFacet theme = themeList.get(i);
                 if (theme == null) {
                     log.warn("A ManagedFacet in ThemeList is null.");
+                    themeList.remove(i);
+                    i--;
                     continue;
                 }
+
                 String uuid        = theme.getArtifact();
                 Artifact artifact  = getArtifact(uuid, context);
                 D4EArtifact flys  = (D4EArtifact) artifact;
+                Facet face = flys.getNativeFacet(theme, outname);
+                log.debug("Looking for Native Facet for theme: " + theme + " and out: " +
+                        outname + " in artifact: " + uuid +
+                        face == null ? " Found. " : " Not Found. ");
+                if (face == null) {
+                    log.warn("Theme " + theme.getName() + " for " + outname + " has no facets!. Removing theme.");
+                    themeList.remove(i);
+                    i--;
+                    continue;
+                }
 
                 ArtifactAndFacet artifactAndFacet = new ArtifactAndFacet(
                     artifact,
-                    flys.getNativeFacet(theme));
+                    face);
 
                 // XXX HELP ME PLEASE
                 artifactAndFacet.setFacetDescription(theme.getDescription());
@@ -515,6 +524,10 @@
             return themes.get(idx);
         }
 
+        public void remove(int idx) {
+            themes.remove(idx);
+        }
+
         public int size() {
             return themes.size();
         }
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/StyledSeriesBuilder.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/StyledSeriesBuilder.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/StyledSeriesBuilder.java	Tue Jun 11 09:40:56 2013 +0200
@@ -40,6 +40,38 @@
 
 
     /**
+     * Add points to series, create gaps if certain distance between points is met.
+     *
+     * @param series Series to add points to.
+     * @param points Points to add to series, points[0] to 1st dim, points[1]
+     *               to 2nd dim.
+     * @param skipNANs if true, skip NAN values in points parameter.
+     * @param distance if two consecutive entries in points[0] are more
+     *                 than distance apart, create a NaN value to skip in display.
+     */
+    public static void addPoints(XYSeries series, double[][] points, boolean skipNANs, double distance) {
+        if (points == null || points.length <= 1) {
+            return;
+        }
+        double [] xPoints = points[0];
+        double [] yPoints = points[1];
+        for (int i = 0; i < xPoints.length; i++) {
+            if (skipNANs &&
+                (Double.isNaN(xPoints[i]) || Double.isNaN(yPoints[i]))) {
+                logger.warn ("Skipping NaN in StyledSeriesBuilder.");
+                continue;
+            }
+            // Create gap if distance >= distance.
+            if (i != 0 && Math.abs(xPoints[i-1] - xPoints[i]) >= distance) {
+                if (!Double.isNaN(yPoints[i-1]) && !Double.isNaN(yPoints[i])) {
+                    series.add((xPoints[i-1]+xPoints[i])/2.d, Double.NaN, false);
+                }
+            }
+            series.add(xPoints[i], yPoints[i], false);
+        }
+    }
+
+    /**
      * Add points to series.
      *
      * @param series Series to add points to.
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java	Tue Jun 11 09:40:56 2013 +0200
@@ -346,7 +346,7 @@
                 new Object[] { RiverUtils.getRivername(flys) })
         });
 
-        RangeAccess rangeAccess = new RangeAccess(flys, null);
+        RangeAccess rangeAccess = new RangeAccess(flys);
         double[] kms = rangeAccess.getKmRange();
         writer.writeNext(new String[] {
             Resources.getMsg(
@@ -573,7 +573,7 @@
         }
         else if (flys instanceof FixationArtifact) {
             // Get W/Q input per gauge for this case.
-            FixRealizingAccess fixAccess = new FixRealizingAccess(flys, getCallContext());
+            FixRealizingAccess fixAccess = new FixRealizingAccess(flys);
             segments = fixAccess.getSegments();
             if (segments != null && !segments.isEmpty()) {
                 isFixRealize = true;
@@ -772,7 +772,7 @@
 
         source.addMetaData("date", df.format(new Date()));
 
-        RangeAccess rangeAccess = new RangeAccess(flys, null);
+        RangeAccess rangeAccess = new RangeAccess(flys);
         double[] kms = rangeAccess.getKmRange();
         source.addMetaData("range", kms[0] + " - " + kms[kms.length-1]);
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/extreme/ExtremeWQCurveGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/extreme/ExtremeWQCurveGenerator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/extreme/ExtremeWQCurveGenerator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -159,7 +159,7 @@
 
     @Override
     protected String getDefaultChartSubtitle() {
-        FixAnalysisAccess access = new FixAnalysisAccess(artifact, context);
+        FixAnalysisAccess access = new FixAnalysisAccess(artifact);
         DateRange dateRange = access.getDateRange();
         DateRange refRange  = access.getReferencePeriod();
 
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATExport.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATExport.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATExport.java	Tue Jun 11 09:40:56 2013 +0200
@@ -62,7 +62,7 @@
             logger.debug("No CalculationResult found for AT export.");
             return;
         }
-        FixAccess access = new FixAccess((D4EArtifact)this.master, context);
+        FixAccess access = new FixAccess((D4EArtifact)this.master);
         String f = access.getFunction();
         if (f == null || f.length() == 0) {
             logger.debug("No function found for AT export.");
@@ -80,7 +80,7 @@
 
         Writer writer = new OutputStreamWriter(out, DEFAULT_CSV_CHARSET);
 
-        FixAccess access = new FixAccess((D4EArtifact)this.master, context);
+        FixAccess access = new FixAccess((D4EArtifact)this.master);
         FixATWriter atWriter = new FixATWriter(this.function, this.parameters);
         NodeList nodes = request.getElementsByTagName("km");
         String km = nodes.item(0).getTextContent();
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATWriter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATWriter.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATWriter.java	Tue Jun 11 09:40:56 2013 +0200
@@ -118,11 +118,8 @@
 
         out.printf(Locale.US, "%8d", wRow);
 
-        if (wcm > 0) {
-            int rest = 10 - wcm;
-            while (rest-- > 0) {
-                out.print(ATWriter.EMPTY);
-            }
+        for (int i = 0; i < wcm; i++) {
+            out.print(ATWriter.EMPTY);
         }
 
         for (;;) {
@@ -156,7 +153,7 @@
         String      river,
         double      km
     ) {
-        out.println(Resources.format(
+        out.println("*" + Resources.format(
             meta,
             I18N_HEADER_KEY,
             I18N_HEADER_DEFAULT,
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -37,6 +37,7 @@
 import org.jfree.chart.annotations.XYTextAnnotation;
 import org.jfree.data.time.Day;
 import org.jfree.data.time.RegularTimePeriod;
+import org.jfree.data.time.FixedMillisecond;
 import org.jfree.data.time.TimeSeries;
 import org.jfree.data.time.TimeSeriesCollection;
 import org.w3c.dom.Document;
@@ -118,7 +119,7 @@
 
     @Override
     protected String getDefaultChartSubtitle() {
-        FixAnalysisAccess access = new FixAnalysisAccess(artifact, context);
+        FixAnalysisAccess access = new FixAnalysisAccess(artifact);
         DateRange dateRange = access.getDateRange();
         DateRange refRange  = access.getReferencePeriod();
         return Resources.format(
@@ -234,11 +235,11 @@
         logger.debug("doReferencePeriodsOut()");
 
         if (visible) {
-            FixAnalysisAccess access = new FixAnalysisAccess(artifact, context);
+            FixAnalysisAccess access = new FixAnalysisAccess(artifact);
             DateRange refRange  = access.getReferencePeriod();
 
-            RegularTimePeriod start = new Day(refRange.getFrom());
-            RegularTimePeriod end = new Day(refRange.getTo());
+            RegularTimePeriod start = new FixedMillisecond(refRange.getFrom());
+            RegularTimePeriod end = new FixedMillisecond(refRange.getTo());
             StyledDomainMarker marker = new StyledDomainMarker(
                     start.getMiddleMillisecond(),
                     end.getMiddleMillisecond(),
@@ -264,7 +265,7 @@
         if (qwd == null || qwd.qwd == null || qwd.dateRange == null) {
             return;
         }
-        RegularTimePeriod rtp = new Day(qwd.qwd.getDate());
+        RegularTimePeriod rtp = new FixedMillisecond(qwd.qwd.getDate());
         double value = qwd.qwd.getDeltaW();
 
         // Draw a line spanning the analysis time.
@@ -323,7 +324,7 @@
 
         int idxInterpol = 0;
         int idxRegular = 0;
-        RegularTimePeriod rtp = new Day(qwd.getDate());
+        RegularTimePeriod rtp = new FixedMillisecond(qwd.getDate());
         double value =  qwd.getDeltaW();
         boolean interpolate = qwd.getInterpolated();
         if (interpolate) {
@@ -437,8 +438,8 @@
         }
         for (int i = 0; i < ranges.length; i++) {
             logger.debug("creating domain marker");
-            RegularTimePeriod start = new Day(ranges[i].getFrom());
-            RegularTimePeriod end = new Day(ranges[i].getTo());
+            RegularTimePeriod start = new FixedMillisecond(ranges[i].getFrom());
+            RegularTimePeriod end = new FixedMillisecond(ranges[i].getTo());
             StyledDomainMarker marker =
                     new StyledDomainMarker(start.getMiddleMillisecond(),
                             end.getMiddleMillisecond(), theme);
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -554,7 +554,7 @@
 
     @Override
     protected String getDefaultChartSubtitle() {
-        FixAnalysisAccess access = new FixAnalysisAccess(artifact, context);
+        FixAnalysisAccess access = new FixAnalysisAccess(artifact);
         DateRange dateRange = access.getDateRange();
         DateRange refRange  = access.getReferencePeriod();
 
@@ -586,7 +586,7 @@
         StringBuilder buf = new StringBuilder();
 
         // Add analysis periods as additional subtitle
-        FixAnalysisAccess access = new FixAnalysisAccess(artifact, context);
+        FixAnalysisAccess access = new FixAnalysisAccess(artifact);
         DateRange[] aperiods = access.getAnalysisPeriods();
         buf.append(msg("fix.analysis.periods"));
         buf.append(": ");
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDiffHeightYearGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDiffHeightYearGenerator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDiffHeightYearGenerator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -148,7 +148,9 @@
 
     @Override
     protected String getDefaultXAxisLabel() {
-        return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT);
+        return msg(I18N_XAXIS_LABEL,
+            I18N_XAXIS_LABEL_DEFAULT,
+            new Object[] { getRiverName() });
     }
 
     @Override
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceEpochGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceEpochGenerator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceEpochGenerator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -29,6 +29,7 @@
 import org.dive4elements.river.jfree.RiverAnnotation;
 import org.dive4elements.river.jfree.StyledXYSeries;
 import org.dive4elements.river.utils.DataUtil;
+import org.dive4elements.river.utils.RiverUtils;
 
 
 public class BedDifferenceEpochGenerator
@@ -113,13 +114,13 @@
         }
         else if (getXBounds(0) == null && getDomainAxisRange() == null) {
             D4EArtifact artifact = (D4EArtifact)bundle.getArtifact();
-            FlowVelocityAccess access = new FlowVelocityAccess(artifact, context);
+            FlowVelocityAccess access = new FlowVelocityAccess(artifact);
             context.putContextValue("startkm", access.getLowerKM());
             context.putContextValue("endkm", access.getUpperKM());
         }
         else if (getXBounds(0) == null && getDomainAxisRange() != null){
             D4EArtifact artifact = (D4EArtifact)bundle.getArtifact();
-            FlowVelocityAccess access = new FlowVelocityAccess(artifact, context);
+            FlowVelocityAccess access = new FlowVelocityAccess(artifact);
             Bounds b = new DoubleBounds(access.getLowerKM(), access.getUpperKM());
             Bounds bounds =
                 calculateZoom(b, getDomainAxisRange());
@@ -186,7 +187,9 @@
 
     @Override
     protected String getDefaultXAxisLabel() {
-        return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT);
+        return msg(I18N_XAXIS_LABEL,
+            I18N_XAXIS_LABEL_DEFAULT,
+            new Object[] {getRiverName()});
     }
 
     @Override
@@ -196,7 +199,11 @@
             label = msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
         }
         else if (pos == YAXIS.H.idx) {
-            label = msg(I18N_SECOND_YAXIS_LABEL, I18N_SECOND_YAXIS_LABEL_DEFAULT);
+            D4EArtifact flys = (D4EArtifact) master;
+            label = msg(I18N_SECOND_YAXIS_LABEL,
+                I18N_SECOND_YAXIS_LABEL_DEFAULT,
+                new Object[]
+                    { RiverUtils.getRiver(flys).getWstUnit().getName() });
         }
         else if (pos == YAXIS.dW.idx) {
             return msg(I18N_DW_YAXIS_LABEL, I18N_DW_YAXIS_LABEL_DEFAULT);
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceExporter.java	Tue Jun 11 09:40:56 2013 +0200
@@ -0,0 +1,186 @@
+package org.dive4elements.river.exports.minfo;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.text.NumberFormat;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Locale;
+import java.util.Date;
+import java.text.DateFormat;
+
+import org.apache.log4j.Logger;
+import org.apache.commons.lang.StringUtils;
+
+import net.sf.jasperreports.engine.JasperExportManager;
+import net.sf.jasperreports.engine.JasperFillManager;
+import net.sf.jasperreports.engine.JasperPrint;
+import net.sf.jasperreports.engine.JRException;
+
+import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.artifacts.CallMeta;
+import org.dive4elements.river.artifacts.D4EArtifact;
+import org.dive4elements.river.artifacts.access.BedDifferencesAccess;
+import org.dive4elements.artifacts.common.utils.Config;
+import org.dive4elements.river.artifacts.resources.Resources;
+import org.dive4elements.river.artifacts.model.CalculationResult;
+import org.dive4elements.river.artifacts.model.minfo.BedDifferencesResult;
+import org.dive4elements.river.artifacts.model.minfo.BedDifferenceJRDataSource;
+import org.dive4elements.river.exports.AbstractExporter;
+import org.dive4elements.river.utils.Formatter;
+import org.dive4elements.river.utils.RiverUtils;
+
+import org.w3c.dom.Document;
+
+import au.com.bytecode.opencsv.CSVWriter;
+
+
+public class BedDifferenceExporter
+extends AbstractExporter
+{
+
+    /** Private logger. */
+    private static Logger logger =
+        Logger.getLogger(BedDifferenceExporter.class);
+
+    private static final String CSV_HEADER_KM =
+        "export.minfo.beddifference.km";
+
+    private static final String CSV_HEADER_DIFF =
+        "export.minfo.beddifference.diff";
+
+    public static final String JASPER_FILE =
+        "export.minfo.beddifference.pdf.file";
+
+    public static final String PDF_TITLE=
+        "export.minfo.beddifference.pdf.title";
+
+    public static final String PDF_HEADER_MODE=
+        "export.minfo.beddifference.pdf.mode";
+
+    private BedDifferencesResult[] results;
+
+    @Override
+    public void init(Document request, OutputStream out, CallContext context) {
+        logger.debug("init");
+        super.init(request, out, context);
+        results = new BedDifferencesResult[0];
+    }
+
+    @Override
+    protected void writeCSVData(CSVWriter writer) throws IOException {
+        writeCSVHeader(writer);
+
+        NumberFormat kmf = Formatter.getCalculationKm(context.getMeta());
+        NumberFormat mf = Formatter.getMeterFormat(context);
+        for (int i = 0; i < results.length; i++) {
+            BedDifferencesResult result = results[i];
+            double[][] kms = result.getDifferencesData();
+            for (int j = 0; j < kms[0].length; j++) {
+                writer.writeNext(new String[] {
+                    kmf.format(kms[0][j]), mf.format(kms[1][j])});
+            }
+        }
+    }
+
+    @Override
+    protected void addData(Object data) {
+        if (!(data instanceof CalculationResult)) {
+            logger.warn("Invalid data type.");
+            return;
+        }
+        Object[] d = (Object[])((CalculationResult)data).getData();
+
+        if (!(d instanceof BedDifferencesResult[])) {
+            logger.warn("Invalid result object.");
+            return;
+        }
+        results = (BedDifferencesResult[])d;
+    }
+
+    protected void addMetaData(BedDifferenceJRDataSource source) {
+        CallMeta meta = context.getMeta();
+
+        D4EArtifact arti = (D4EArtifact) master;
+
+        source.addMetaData ("river", RiverUtils.getRivername(arti));
+
+        Locale locale = Resources.getLocale(meta);
+        DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
+
+        source.addMetaData("date", df.format(new Date()));
+
+        source.addMetaData("calculation", Resources.getMsg(
+                                            locale,
+                                            PDF_HEADER_MODE,
+                                            "Bedheight difference"));
+
+        // Now the dynamic parts
+
+        BedDifferencesAccess access = new BedDifferencesAccess(arti);
+        source.addMetaData("ye_mode", Resources.getMsg(locale,
+                    "state.minfo." + access.getYearEpoch(),
+                    access.getYearEpoch()));
+
+        source.addMetaData("differences", StringUtils.join(
+                access.getDifferenceArtifactNamePairs(), "\n"));
+    }
+
+
+    protected void writeCSVHeader(CSVWriter writer) {
+        logger.debug("writeCSVHeader()");
+
+        List<String> header = new LinkedList<String>();
+        if (results != null)  {
+            header.add(msg(CSV_HEADER_KM, "km"));
+            header.add(msg(CSV_HEADER_DIFF, "m"));
+        }
+        writer.writeNext(header.toArray(new String[header.size()]));
+    }
+
+    protected BedDifferenceJRDataSource createJRData() {
+        BedDifferenceJRDataSource source = new BedDifferenceJRDataSource();
+
+        addMetaData(source);
+        NumberFormat kmf = Formatter.getCalculationKm(context.getMeta());
+        NumberFormat mf = Formatter.getMeterFormat(context);
+        for (BedDifferencesResult result: results) {
+            double[][] kms = result.getDifferencesData();
+            for (int j = 0; j < kms[0].length; j++) {
+                source.addData(new String[] {
+                    kmf.format(kms[0][j]), mf.format(kms[1][j])});
+            }
+        }
+        return source;
+    }
+
+    @Override
+    protected void writePDF(OutputStream out) {
+        logger.debug("write PDF");
+        BedDifferenceJRDataSource source = createJRData();
+
+        String jasperFile = Resources.getMsg(
+                                context.getMeta(),
+                                JASPER_FILE,
+                                "/jasper/beddifference_en.jasper");
+        String confPath = Config.getConfigDirectory().toString();
+
+
+        Map parameters = new HashMap();
+        parameters.put("ReportTitle", Resources.getMsg(
+                    context.getMeta(), PDF_TITLE, "Exported Data"));
+        try {
+            JasperPrint print = JasperFillManager.fillReport(
+                confPath + jasperFile,
+                parameters,
+                source);
+            JasperExportManager.exportReportToPdfStream(print, out);
+        }
+        catch(JRException je) {
+            logger.warn("Error generating PDF Report!", je);
+        }
+    }
+
+}
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceYearGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceYearGenerator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceYearGenerator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -14,6 +14,7 @@
 
 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
 import org.dive4elements.artifactdatabase.state.Facet;
+import org.dive4elements.river.artifacts.D4EArtifact;
 import org.dive4elements.river.artifacts.model.FacetTypes;
 import org.dive4elements.river.artifacts.model.WKms;
 import org.dive4elements.river.artifacts.model.minfo.BedDiffYearResult;
@@ -29,6 +30,7 @@
 import org.dive4elements.river.jfree.RiverAnnotation;
 import org.dive4elements.river.jfree.StyledXYSeries;
 import org.dive4elements.river.utils.DataUtil;
+import org.dive4elements.river.utils.RiverUtils;
 
 
 public class BedDifferenceYearGenerator
@@ -232,12 +234,15 @@
 
     @Override
     protected String getDefaultXAxisLabel() {
-        return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT);
+        return msg(I18N_XAXIS_LABEL,
+                   I18N_XAXIS_LABEL_DEFAULT,
+                   new Object[] { getRiverName() });
     }
 
     @Override
     protected String getDefaultYAxisLabel(int pos) {
         String label = "default";
+        D4EArtifact flys = (D4EArtifact) master;
         if (pos == YAXIS.D.idx) {
             label = msg(I18N_YAXIS_LABEL, I18N_YAXIS_LABEL_DEFAULT);
         }
@@ -245,13 +250,18 @@
             label = msg(I18N_SECOND_YAXIS_LABEL, I18N_SECOND_YAXIS_LABEL_DEFAULT);
         }
         else if (pos == YAXIS.H.idx) {
-            label = msg(I18N_THIRD_YAXIS_LABEL, I18N_THIRD_YAXIS_LABEL_DEFAULT);
+            label = msg(I18N_THIRD_YAXIS_LABEL,
+                I18N_THIRD_YAXIS_LABEL_DEFAULT,
+                new Object[]
+                    { RiverUtils.getRiver(flys).getWstUnit().getName() });
         }
         else if (pos == YAXIS.dW.idx) {
             label = msg(I18N_DW_YAXIS_LABEL, I18N_DW_YAXIS_LABEL_DEFAULT);
         }
         else if (pos == YAXIS.W.idx) {
-            return msg(I18N_W_YAXIS_LABEL, I18N_W_YAXIS_LABEL_DEFAULT);
+            return msg(I18N_W_YAXIS_LABEL, I18N_W_YAXIS_LABEL_DEFAULT,
+                new Object[]
+                    { RiverUtils.getRiver(flys).getWstUnit().getName() });
         }
 
         return label;
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityGenerator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityGenerator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -15,6 +15,7 @@
 import org.dive4elements.artifactdatabase.state.ArtifactAndFacet;
 import org.dive4elements.artifactdatabase.state.Facet;
 import org.dive4elements.river.artifacts.model.FacetTypes;
+import org.dive4elements.river.artifacts.model.minfo.BedDiameterData;
 import org.dive4elements.river.artifacts.model.minfo.BedDiameterResult;
 import org.dive4elements.river.artifacts.model.minfo.BedParametersResult;
 import org.dive4elements.river.artifacts.model.minfo.BedloadDiameterResult;
@@ -88,7 +89,9 @@
      */
     @Override
     protected String getDefaultXAxisLabel() {
-        return msg(I18N_XAXIS_LABEL, I18N_XAXIS_LABEL_DEFAULT);
+        return msg(I18N_XAXIS_LABEL,
+            I18N_XAXIS_LABEL_DEFAULT,
+            new Object[] {getRiverName()});
     }
 
     @Override
@@ -191,6 +194,13 @@
                 (BedParametersResult) artifactAndFacet.getData(context),
                 artifactAndFacet, attr, visible);
         }
+        else if (name.equals(BED_DIAMETER_DATA_TOP) ||
+                 name.equals(BED_DIAMETER_DATA_SUB) ||
+                 name.equals(BEDLOAD_DIAMETER_DATA)) {
+            doBedDiameterDataOut(
+                (BedDiameterData) artifactAndFacet.getData(context),
+                artifactAndFacet, attr, visible);
+        }
         else if (name.equals(LONGITUDINAL_ANNOTATION)) {
             doAnnotations(
                 (RiverAnnotation) artifactAndFacet.getData(context),
@@ -208,6 +218,18 @@
         }
     }
 
+    private void doBedDiameterDataOut(
+        BedDiameterData data,
+        ArtifactAndFacet aandf,
+        Document theme,
+        boolean visible
+    ) {
+        XYSeries series = new StyledXYSeries(aandf.getFacetDescription(), theme);
+        StyledSeriesBuilder.addPoints(series, data.getDiameterData(), true);
+
+        addAxisSeries(series, YAXIS.W.idx, visible);
+    }
+
     protected void doBedDiameterTopLayerOut(BedDiameterResult data,
         ArtifactAndFacet aandf, Document theme, boolean visible) {
         logger.debug("BedQuality.doBedDiameterTopLayerOut");
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -119,20 +119,20 @@
         }
         else if (getXBounds(0) == null && getDomainAxisRange() == null) {
             D4EArtifact artifact = (D4EArtifact)bundle.getArtifact();
-            RangeAccess access = new RangeAccess(artifact, context);
+            RangeAccess access = new RangeAccess(artifact);
             context.putContextValue("startkm", access.getFrom());
             context.putContextValue("endkm", access.getTo());
         }
         else if (getXBounds(0) == null && getDomainAxisRange() != null){
             D4EArtifact artifact = (D4EArtifact)bundle.getArtifact();
-            RangeAccess access = new RangeAccess(artifact, context);
+            RangeAccess access = new RangeAccess(artifact);
             Bounds b = new DoubleBounds(access.getFrom(), access.getTo());
             Bounds bounds =
                 calculateZoom(b, getDomainAxisRange());
             context.putContextValue("startkm", bounds.getLower());
             context.putContextValue("endkm", bounds.getUpper());
         }
-        if (FacetTypes.IS.SEDIMENT_LOAD(SEDIMENT_LOAD_COARSE)) {
+        if (FacetTypes.IS.SEDIMENT_LOAD(name)) {
             doSedimentLoadOut(
                 (double[][]) bundle.getData(context),
                 bundle,
@@ -226,7 +226,7 @@
     protected String getDefaultYAxisLabel(int pos) {
         String label = "default";
         if (pos == YAXIS.L.idx) {
-            SedimentLoadAccess access = new SedimentLoadAccess(artifact, context);
+            SedimentLoadAccess access = new SedimentLoadAccess(artifact);
             if (access.getUnit().equals("m3_per_a")) {
                 label = msg(I18N_YAXIS_LABEL_2, I18N_YAXIS_LABEL_DEFAULT_2);
             }
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java
--- a/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java	Tue Jun 11 09:40:56 2013 +0200
@@ -11,21 +11,43 @@
 import java.io.OutputStream;
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Date;
+import java.util.Locale;
+import java.text.DateFormat;
 
 import org.w3c.dom.Document;
 
+import net.sf.jasperreports.engine.JasperExportManager;
+import net.sf.jasperreports.engine.JasperFillManager;
+import net.sf.jasperreports.engine.JasperPrint;
+import net.sf.jasperreports.engine.JRException;
+
 import au.com.bytecode.opencsv.CSVWriter;
 
 import org.dive4elements.artifacts.CallContext;
+import org.dive4elements.artifacts.CallMeta;
 
 import org.dive4elements.river.artifacts.model.CalculationResult;
-
 import org.dive4elements.river.artifacts.model.sq.SQFractionResult;
 import org.dive4elements.river.artifacts.model.sq.SQResult;
+import org.dive4elements.river.artifacts.model.sq.SQRelationJRDataSource;
 import org.dive4elements.river.artifacts.model.Parameters;
+import org.dive4elements.river.artifacts.model.DateRange;
+import org.dive4elements.river.artifacts.access.SQRelationAccess;
+
+import org.dive4elements.river.artifacts.resources.Resources;
+
+import org.dive4elements.river.artifacts.D4EArtifact;
 
 import org.dive4elements.river.exports.AbstractExporter;
 
+import org.dive4elements.river.utils.RiverUtils;
+import org.dive4elements.river.utils.Formatter;
+
+import org.dive4elements.artifacts.common.utils.Config;
+
 import org.apache.log4j.Logger;
 
 /**
@@ -80,6 +102,14 @@
     public static final String CSV_VARIANCE =
         "export.sqrelation.csv.header.variance";
 
+    public static final String PDF_TITLE=
+        "export.sqrelation.pdf.title";
+
+    public static final String PDF_HEADER_MODE =
+        "export.sqrelation.pdf.mode";
+
+    public static final String JASPER_FILE =
+        "export.sqrelation.pdf.file";
 
     protected List<SQResult []> data;
 
@@ -120,16 +150,14 @@
 
         for (SQResult [] results: data) {
             for (SQResult result: results) {
-                data2CSV(writer, result);
+                writer.writeAll(data2StringArrays(result));
             }
         }
     }
 
-    protected void data2CSV(CSVWriter writer, SQResult result) {
-        logger.debug("data2CSV");
-
-        // TODO: i18n
+    protected List<String[]> data2StringArrays(SQResult result) {
         String km = String.valueOf(result.getKm());
+        List<String[]> retval = new ArrayList<String[]>();
 
         for (int i = 0; i < SQResult.NUMBER_FRACTIONS; ++i) {
             SQFractionResult fraction = result.getFraction(i);
@@ -142,29 +170,97 @@
                 continue;
             }
 
-            double a  = parameters.getValue(0, "a");
-            double b  = parameters.getValue(0, "b");
-            double sd = Math.sqrt(parameters.getValue(0, "std_dev"));
-            int    o  = fraction.totalNumOutliers();
-            int    t  = fraction.numMeasurements() + o;
+            String a, b, sd, o, t;
+            a  = Formatter.getSQRelationA(context).format(parameters.getValue(0, "a"));
+            b  = Formatter.getSQRelationB(context).format(parameters.getValue(0, "b"));
+            sd = Formatter.getVariance(context).format(Math.sqrt(parameters.getValue(0, "std_dev")));
 
-            writer.writeNext(new String[] {
+            o  = String.valueOf(fraction.totalNumOutliers());
+            t  = String.valueOf(fraction.numMeasurements() + o);
+
+            retval.add(new String[] {
                 km,
                 name,
-                String.valueOf(a),
-                String.valueOf(b),
-                String.valueOf(t),
-                String.valueOf(o),
-                String.valueOf(sd)
+                a,
+                b,
+                t,
+                o,
+                sd
             });
         }
+        return retval;
     }
 
 
+    protected SQRelationJRDataSource createJRData() {
+        SQRelationJRDataSource source = new SQRelationJRDataSource();
+
+        addMetaData(source);
+        for (SQResult [] results: data) {
+            for (SQResult result: results) {
+                for (String[] res: data2StringArrays(result)) {
+                    source.addData(res);
+                }
+            }
+        }
+        return source;
+    }
+
+    protected void addMetaData(SQRelationJRDataSource source) {
+        CallMeta meta = context.getMeta();
+
+        D4EArtifact arti = (D4EArtifact) master;
+
+        source.addMetaData ("river", RiverUtils.getRivername(arti));
+
+        Locale locale = Resources.getLocale(meta);
+        DateFormat df = DateFormat.getDateInstance(DateFormat.SHORT, locale);
+
+        source.addMetaData("date", df.format(new Date()));
+
+        SQRelationAccess access = new SQRelationAccess(arti);
+        source.addMetaData("location", "KM " + getKmFormatter().format(access.getLocation()));
+
+        DateRange period = access.getPeriod();
+        source.addMetaData("periods", df.format(period.getFrom()) + " - " +
+            df.format(period.getTo()));
+
+        source.addMetaData("outliertest", Resources.getMsg(meta,
+                    access.getOutlierMethod(),
+                    access.getOutlierMethod()));
+        source.addMetaData("outliers", access.getOutliers().toString());
+
+        source.addMetaData("calculation", Resources.getMsg(
+                                            locale,
+                                            PDF_HEADER_MODE,
+                                            "SQRelation"));
+    }
+
     @Override
     protected void writePDF(OutputStream out) {
-        logger.debug("writePDF");
-        logger.error("NOT IMPLEMENTED: writePDF");
+        logger.debug("write PDF");
+        SQRelationJRDataSource source = createJRData();
+
+        String jasperFile = Resources.getMsg(
+                                context.getMeta(),
+                                JASPER_FILE,
+                                "/jasper/sqrelation_en.jasper");
+        String confPath = Config.getConfigDirectory().toString();
+
+
+        Map parameters = new HashMap();
+        parameters.put("ReportTitle", Resources.getMsg(
+                    context.getMeta(), PDF_TITLE, "Exported Data"));
+        try {
+            JasperPrint print = JasperFillManager.fillReport(
+                confPath + jasperFile,
+                parameters,
+                source);
+            JasperExportManager.exportReportToPdfStream(print, out);
+        }
+        catch(JRException je) {
+            logger.warn("Error generating PDF Report!", je);
+        }
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java
--- a/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Tue Jun 11 09:40:56 2013 +0200
@@ -11,6 +11,7 @@
 import java.text.DateFormat;
 import java.text.NumberFormat;
 import java.text.SimpleDateFormat;
+import java.text.DecimalFormat;
 import java.util.Locale;
 
 import org.dive4elements.artifacts.CallContext;
@@ -87,6 +88,14 @@
     public static final int FIX_DELTA_W_DELTA_Q_MIN_DIGITS  = 0;
     public static final int FIX_DELTA_W_DELTA_Q_MAX_DIGITS  = 2;
 
+    public static final int VARIANCE_MIN_DIGITS = 3;
+    public static final int VARIANCE_MAX_DIGITS = 3;
+
+    // SQ Relation
+    public static final int SQ_RELATION_A_MAX_DIGITS = 7;
+    public static final int SQ_RELATION_A_MIN_DIGITS = 7;
+    public static final int SQ_RELATION_B_MAX_DIGITS = 3;
+    public static final int SQ_RELATION_B_MIN_DIGITS = 3;
 
     /**
      * Creates a localized NumberFormatter with given range of decimal digits.
@@ -106,7 +115,6 @@
         return nf;
     }
 
-
     public static NumberFormat getFormatter(CallContext c, int min, int max){
         return getFormatter(c.getMeta(), min, max);
     }
@@ -124,6 +132,32 @@
         return NumberFormat.getInstance(locale);
     }
 
+    /**
+     * Returns a formatter in engineering notation
+     */
+    public static NumberFormat getEngFormatter(CallContext c) {
+        NumberFormat nf = getRawFormatter(c);
+        if (nf instanceof DecimalFormat) {
+            DecimalFormat df = (DecimalFormat)nf;
+            df.applyPattern("##0.#####E0");
+        }
+        return nf;
+    }
+
+    /**
+     * Returns a number formatter that uses an exponent after max digits
+     */
+    public static NumberFormat getScientificFormater(CallContext c, int min, int max) {
+        NumberFormat nf = getRawFormatter(c);
+        if (nf instanceof DecimalFormat) {
+            DecimalFormat df = (DecimalFormat)nf;
+            df.applyPattern("0.0E0");
+            df.setMaximumFractionDigits(max);
+            df.setMinimumFractionDigits(min);
+        }
+        return nf;
+    }
+
 
     /**
      * Returns a date formatter with SHORT style.
@@ -398,6 +432,27 @@
                 FIX_DELTA_W_DELTA_W_MAX_DIGITS);
     }
 
+    public static NumberFormat getVariance(CallContext context) {
+        return getFormatter(
+                context,
+                VARIANCE_MIN_DIGITS,
+                VARIANCE_MAX_DIGITS);
+    }
+
+    public static NumberFormat getSQRelationA(CallContext context) {
+        return getFormatter(
+                context,
+                SQ_RELATION_A_MIN_DIGITS,
+                SQ_RELATION_A_MAX_DIGITS);
+    }
+
+    public static NumberFormat getSQRelationB(CallContext context) {
+        return getFormatter(
+                context,
+                SQ_RELATION_B_MIN_DIGITS,
+                SQ_RELATION_B_MAX_DIGITS);
+    }
+
     public static NumberFormat getMeterFormat(CallContext context) {
         return getFormatter(
                 context,
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java
--- a/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java	Tue Jun 11 09:40:56 2013 +0200
@@ -459,7 +459,7 @@
             return null;
         }
 
-        RangeAccess rangeAccess = new RangeAccess(flys, null);
+        RangeAccess rangeAccess = new RangeAccess(flys);
         double[] dist = rangeAccess.getKmRange();
 
         if (dist == null) {
@@ -915,7 +915,7 @@
             return null;
         }
 
-        RangeAccess rangeAccess = new RangeAccess(flys, null);
+        RangeAccess rangeAccess = new RangeAccess(flys);
         double[] dist = rangeAccess.getKmRange();
         if (dist == null) {
             logger.debug("getGauges: no dist!");
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java
--- a/artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java	Tue Jun 11 09:40:56 2013 +0200
@@ -8,12 +8,14 @@
 
 package org.dive4elements.river.utils;
 
+import org.dive4elements.artifacts.CallMeta;
 import org.dive4elements.artifacts.common.utils.XMLUtils;
 import org.dive4elements.river.artifacts.model.MapserverStyle;
 import org.dive4elements.river.artifacts.model.MapserverStyle.Clazz;
 import org.dive4elements.river.artifacts.model.MapserverStyle.Expression;
 import org.dive4elements.river.artifacts.model.MapserverStyle.Label;
 import org.dive4elements.river.artifacts.model.MapserverStyle.Style;
+import org.dive4elements.river.artifacts.resources.Resources;
 
 import java.awt.Color;
 import java.awt.Font;
@@ -31,6 +33,10 @@
     private static Logger logger =
             Logger.getLogger(ThemeUtil.class);
 
+    private static final String MSG_ISOBATH_CLASS = "floodmap.isobath.class";
+
+    private static final String MSG_ISOBATH_LASTCLASS = "floodmap.isobath.lastclass";
+
     public final static String XPATH_FILL_COLOR =
             "/theme/field[@name='fillcolor']/@default";
 
@@ -669,7 +675,7 @@
      * @return String representation of the MapserverStyle
      */
     public static String createDynamicMapserverStyle(Document theme,
-            float from, float to, float step)
+            float from, float to, float step, CallMeta meta)
     {
         MapserverStyle ms = new MapserverStyle();
 
@@ -700,9 +706,10 @@
             newColor.append(' ');
             newColor.append(startColor.getBlue()  + Math.round(n * bd));
 
-            String expr = createWSPLGENExpression(from + n * step, step, n + 1, numClasses);
+            String expr = createWSPLGENClassExpression(from + n * step, step, n + 1, numClasses);
+            String name = createWSPLGENClassName(from + n * step, step, n + 1, numClasses, meta);
 
-            Clazz c = new Clazz(expr);
+            Clazz c = new Clazz(name);
             Style s = new Style();
             s.setColor(newColor.toString());
             s.setSize(5);
@@ -717,7 +724,7 @@
     }
 
 
-    protected static String createWSPLGENExpression(float val, float step, int idx, int maxIdx) {
+    protected static String createWSPLGENClassExpression(float val, float step, int idx, int maxIdx) {
         if (idx < maxIdx) {
             return "[DIFF] >= " + val + " AND  [DIFF] < " + (val + step);
         }
@@ -726,6 +733,30 @@
         }
     }
 
+    /**
+     * Creates a class name for the mapfile style that visualizes a floodmap.
+     * The class names are used in the map's legend.
+     *
+     * @param val       Current isobath value.
+     * @param step      Difference between to class values.
+     * @param idx       Current class index that is being processed.
+     * @param maxIdx    Highest class index.
+     * @param meta      Caller meta object used to determine locale.
+     * @return
+     */
+    protected static String createWSPLGENClassName(float val, float step, int idx, int maxIdx, CallMeta meta) {
+        assert meta != null : "CallMeta instance is null";
+
+        if (idx < maxIdx) {
+            return Resources.getMsg(meta, MSG_ISOBATH_CLASS,
+                    new Object[] {val, val + step});
+        }
+        else {
+            return Resources.getMsg(meta, MSG_ISOBATH_LASTCLASS,
+                    new Object[] {val});
+        }
+    }
+
 
     public static String createMapserverStyle(Document theme) {
         String symbol    = getSymbol(theme);
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/java/org/dive4elements/river/wsplgen/FacetCreator.java
--- a/artifacts/src/main/java/org/dive4elements/river/wsplgen/FacetCreator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/wsplgen/FacetCreator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -85,7 +85,7 @@
 
     protected Envelope getWSPLGENBounds() {
         String river = getRiver();
-        RangeAccess rangeAccess = new RangeAccess(artifact, null);
+        RangeAccess rangeAccess = new RangeAccess(artifact);
         double kms[] = rangeAccess.getKmRange();
 
         logger.debug("### getWSPLGENBounds");
@@ -123,7 +123,7 @@
 
     public void createWSPLGENFacet() {
         String river = getRiver();
-        RangeAccess rangeAccess = new RangeAccess(artifact, null);
+        RangeAccess rangeAccess = new RangeAccess(artifact);
         double kms[] = rangeAccess.getKmRange();
 
         WSPLGENLayerFacet wsplgen = new WSPLGENLayerFacet(
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/resources/messages.properties
--- a/artifacts/src/main/resources/messages.properties	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/resources/messages.properties	Tue Jun 11 09:40:56 2013 +0200
@@ -209,13 +209,13 @@
 chart.fixings.analysis.title = Longitudinal section at km {0}
 
 chart.bedquality.title=Bed Longitudinal Section
-chart.bedquality.xaxis.label=River-Km
+chart.bedquality.xaxis.label={0}-km
 chart.bedquality.yaxis.label=Diameter [mm]
 chart.bedquality.yaxis.label.porosity=Porosity [%]
 chart.bedquality.yaxis.label.density=Density [t/m\u00b3]
 
 chart.bedheight_middle.section.title=Middle Bed Height
-chart.bedheight_middle.section.yaxis.label=middle Bed Height [mm a NN]
+chart.bedheight_middle.section.yaxis.label=middle Bed Height [{0}]
 
 chart.flow_velocity.section.title=Geschwindigkeit- und Schubspannung
 chart.flow_velocity.section.yaxis.label=Speed v [m/s]
@@ -277,6 +277,9 @@
 facet.bedquality.bed.density.sublayer = Density ({0,date} - {1,date}) ({2})
 facet.bedquality.bed.diameter.toplayer = {0}_Bed ({1,date} - {2,date}) ({3})
 facet.bedquality.bed.diameter.sublayer = {0}_Bed ({1,date} - {2,date}) ({3})
+facet.bedquality.bed.diameter.data.toplayer = {0} Bed ({1,date} - {2,date}) ({3}) - measurements
+facet.bedquality.bed.diameter.data.sublayer = {0} Bed ({1,date} - {2,date}) ({3}) - measurements
+facet.bedquality.bedload.diameter.data = {0} Bedload - measurements
 facet.bedquality.bedload.diameter = {0}_Bedload
 bedquality.toplayer = 0.0m - 0.3m
 bedquality.sublayer = 0.1m - 0.5m
@@ -300,15 +303,15 @@
 facet.morphologic.width = morphologic Width
 
 chart.beddifference.height.title = Bedheight Difference
-chart.beddifference.height.xaxis.label = River-Km [km]
+chart.beddifference.height.xaxis.label = {0}-km
 chart.beddifference.height.yaxis.label = Difference [cm/year]
 chart.beddifference.epoch.title = Bedheight Difference
-chart.beddifference.xaxis.label = River-Km [km]
+chart.beddifference.xaxis.label = {0}-km
 chart.beddifference.yaxis.label.diff = Difference [m]
-chart.beddifference.yaxis.label.height = Absolute Height [m]
+chart.beddifference.yaxis.label.height = Absolute Height [{0}]
 chart.beddifference.year.title = Bedheight Difference
 chart.beddifference.yaxis.label.morph = Width [m]
-chart.beddifference.yaxis.label.heights = Absolute Height [m]
+chart.beddifference.yaxis.label.heights = Absolute Height [{0}]
 
 
 export.waterlevel.csv.header.km = River-Km
@@ -390,6 +393,8 @@
 export.sqrelation.csv.header.c.duan = C (DUAN)
 export.sqrelation.csv.header.c.ferguson = C (FERGUSON)
 export.sqrelation.csv.header.variance = Standard variance
+export.sqrelation.pdf.file = /jasper/sqrelation_en.jasper
+export.sqrelation.pdf.mode = Load Discharge Relation
 export.minfo.bedquality.km = km
 export.minfo.bedquality.density_cap = Density Toplayer
 export.minfo.bedquality.density_sub = Density Sublayer
@@ -398,6 +403,11 @@
 export.minfo.bedquality.bedload = Bedload Diameter
 export.minfo.bedquality.bed_cap = Bed Diameter Toplayer
 export.minfo.bedquality.bed_sub = Bed Diameter Sublayer
+export.minfo.beddifference.km = km
+export.minfo.beddifference.diff = m
+export.minfo.beddifference.pdf.file = /jasper/beddifference_en.jasper
+export.minfo.beddifference.pdf.title = Bedheight Difference
+export.minfo.beddifference.pdf.mode = Bedheight Difference
 
 floodmap.wmsbackground = Background Map
 floodmap.riveraxis = River Axis
@@ -415,6 +425,8 @@
 floodmap.fixpoints = Fixpoints
 floodmap.floodmaps = Floodmaps
 floodmap.usershape = User data
+floodmap.isobath.class = {0,number,#.#} m to {1,number,#.#} m
+floodmap.isobath.lastclass = greater {0,number,#.#} m
 
 wsplgen.job.queued = WSPLGEN job in queue.
 wsplgen.job.error = An unexpected error while starting WSPLGEN occured.
@@ -616,6 +628,11 @@
 gauge.discharge.service.chart.series.title = Discharge Curve {0,date,short} - {1,date,short}
 gauge.discharge.service.chart.series.title.master = Current Discharge Curve since {0,date,short}
 
+bed.km.chart.label = Sedimentdata
+bed.km.chart.title = Sedimentdata SedDB
+bedload.km.chart.label = Geschiebedaten
+bedload.km.chart.title = Geschiebedatenbestand SedDB
+
 help.state.fix.river=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.river
 help.state.fix.calculation.mode=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.calculation.mode
 help.state.fix.location=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.location
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/resources/messages_de.properties
--- a/artifacts/src/main/resources/messages_de.properties	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Tue Jun 11 09:40:56 2013 +0200
@@ -210,13 +210,13 @@
 chart.w_differences.yaxis.second.label = W [NN + m]
 
 chart.bedquality.title=Sohlen L\u00e4ngsschnitt
-chart.bedquality.xaxis.label=Fluss-Km
+chart.bedquality.xaxis.label={0}-km
 chart.bedquality.yaxis.label=Durchmesser [mm]
 chart.bedquality.yaxis.label.porosity=Porosit\u00e4t [%]
 chart.bedquality.yaxis.label.density=Dichte [t/m\u00b3]
 
 chart.bedheight_middle.section.title=Mittlere Sohlh\u00f6he
-chart.bedheight_middle.section.yaxis.label=mittlere Sohlh\u00f6hen [mm\u00fcNN]
+chart.bedheight_middle.section.yaxis.label=mittlere Sohlh\u00f6hen [{0}]
 
 chart.flow_velocity.section.title=Geschwindigkeit- und Schubspannung
 chart.flow_velocity.section.yaxis.label=Geschwindigkeit v [m/s]
@@ -278,6 +278,9 @@
 facet.bedquality.bed.density.sublayer = Dichte ({0,date} - {1,date}) ({2})
 facet.bedquality.bed.diameter.toplayer = {0}_Sohle ({1,date} - {2,date}) ({3})
 facet.bedquality.bed.diameter.sublayer = {0}_Sohle ({1,date} - {2,date}) ({3})
+facet.bedquality.bed.diameter.data.toplayer = {0} Sohle ({1,date} - {2,date}) ({3}) - Messungen
+facet.bedquality.bed.diameter.data.sublayer = {0} Sohle ({1,date} - {2,date}) ({3}) - Messungen
+facet.bedquality.bedload.diameter.data = {0} Geschiebe - Messungen
 facet.bedquality.bedload.diameter = {0}_Geschiebe
 bedquality.toplayer = 0,0m - 0,3m
 bedquality.sublayer = 0,1m - 0,5m
@@ -301,10 +304,10 @@
 facet.morphologic.width = Morphologische Breite
 
 chart.beddifference.height.title = Sohlh\u00f6hendifferenz
-chart.beddifference.height.xaxis.label = Fluss-Km [km]
+chart.beddifference.height.xaxis.label = {0}-km
 chart.beddifference.height.yaxis.label = Differenz [cm/Jahr]
 chart.beddifference.epoch.title = Sohlh\u00f6hendifferenz
-chart.beddifference.xaxis.label = Fluss-Km [km]
+chart.beddifference.xaxis.label = {0}-km
 chart.beddifference.yaxis.label.diff = Differenz [m]
 chart.beddifference.yaxis.label.height = Absolute H\u00f6he [m]
 chart.beddifference.year.title = Sohlh\u00f6hendifferenz
@@ -391,6 +394,8 @@
 export.sqrelation.csv.header.c.duan = C (DUAN)
 export.sqrelation.csv.header.c.ferguson = C (FERGUSON)
 export.sqrelation.csv.header.variance = Standardabweichung
+export.sqrelation.pdf.file = /jasper/sqrelation.jasper
+export.sqrelation.pdf.mode = Transport-Abfluss Beziehung
 export.minfo.bedquality.km = km
 export.minfo.bedquality.density_cap = Sedimentdichte Deckschicht
 export.minfo.bedquality.density_sub = Sedimentdichte Unterschicht
@@ -399,10 +404,15 @@
 export.minfo.bedquality.bedload = Geschiebedurchmesser
 export.minfo.bedquality.bed_cap = Sohldurchmesser Deckschicht
 export.minfo.bedquality.bed_sub = Sohldurchmesser Unterschicht
+export.minfo.beddifference.km = Fluss-km
+export.minfo.beddifference.diff = m
+export.minfo.beddifference.pdf.file = /jasper/beddifference.jasper
+export.minfo.beddifference.pdf.title = Sohlh\u00f6hendifferenz
+export.minfo.beddifference.pdf.mode = Sohlh\u00f6hendifferenz
 
 floodmap.wmsbackground = Hintergrundkarte
 floodmap.riveraxis = Flussachse
-floodmap.uesk = \u00dcsg: {0}-km {1,number,####} - {2,number,####}
+floodmap.uesk = \u00dcSG: {0}-km {1,number,####} - {2,number,####}
 floodmap.barriers = Digitalisierte Objekte
 floodmap.kms = Kilometrierung
 floodmap.qps = Querprofilspuren
@@ -416,6 +426,8 @@
 floodmap.fixpoints = Festpunkte
 floodmap.floodmaps = \u00dcberschwemmungsfl\u00e4che
 floodmap.usershape = Benutzerdaten
+floodmap.isobath.class = {0,number,#.#} m bis {1,number,#.#} m
+floodmap.isobath.lastclass = gr\u00f6\u00dfer {0,number,#.#} m
 
 wsplgen.job.queued = WSPLGEN Berechnung befindet sich in Warteschlange.
 wsplgen.job.error = Ein unerwarteter Fehler beim Starten von WSPLGEN ist aufgetreten.
@@ -619,6 +631,11 @@
 gauge.discharge.service.chart.series.title = Abflusskurve {0,date,short} - {1,date,short}
 gauge.discharge.service.chart.series.title.master = Aktuelle Abflusskurve ab {0,date,short}
 
+bed.km.chart.label = Sohldaten
+bed.km.chart.title = Sohldatenbestand SedDB
+bedload.km.chart.label = Geschiebedaten
+bedload.km.chart.title = Geschiebedatenbestand SedDB
+
 help.state.fix.river=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.river
 help.state.fix.calculation.mode=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.calculation.mode
 help.state.fix.location=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.location
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/resources/messages_de_DE.properties
--- a/artifacts/src/main/resources/messages_de_DE.properties	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/resources/messages_de_DE.properties	Tue Jun 11 09:40:56 2013 +0200
@@ -207,13 +207,13 @@
 chart.w_differences.yaxis.second.label = W [NN + m]
 
 chart.bedquality.title=Sohlen L\u00e4ngsschnitt
-chart.bedquality.xaxis.label=Fluss-Km
+chart.bedquality.xaxis.label={0}-km
 chart.bedquality.yaxis.label=Durchmesser [mm]
 chart.bedquality.yaxis.label.porosity=Porosit\u00e4t [%]
 chart.bedquality.yaxis.label.density=Dichte [t/m\u00b3]
 
 chart.bedheight_middle.section.title=Mittlere Sohlh\u00f6he
-chart.bedheight_middle.section.yaxis.label=mittlere Sohlh\u00f6hen [mm\u00fcNN]
+chart.bedheight_middle.section.yaxis.label=mittlere Sohlh\u00f6hen [{0}]
 
 chart.flow_velocity.section.title=Geschwindigkeit- und Schubspannung
 chart.flow_velocity.section.yaxis.label=Geschwindigkeit v [m/s]
@@ -275,6 +275,9 @@
 facet.bedquality.bed.density.sublayer = Dichte ({0,date} - {1,date}) ({2})
 facet.bedquality.bed.diameter.toplayer = {0}_Sohle ({1,date} - {2,date}) ({3})
 facet.bedquality.bed.diameter.sublayer = {0}_Sohle ({1,date} - {2,date}) ({3})
+facet.bedquality.bed.diameter.data.toplayer = {0} Sohle ({1,date} - {2,date}) ({3}) - Messungen
+facet.bedquality.bed.diameter.data.sublayer = {0} Sohle ({1,date} - {2,date}) ({3}) - Messungen
+facet.bedquality.bedload.diameter.data = {0} Geschiebe - Messungen
 facet.bedquality.bedload.diameter = {0}_Geschiebe
 bedquality.toplayer = 0,0m - 0,3m
 bedquality.sublayer = 0,1m - 0,5m
@@ -298,15 +301,15 @@
 facet.morphologic.width = Morphologische Breite
 
 chart.beddifference.height.title = Sohlh\u00f6hendifferenz
-chart.beddifference.height.xaxis.label = Fluss-Km [km]
+chart.beddifference.height.xaxis.label = {0}-km
 chart.beddifference.height.yaxis.label = Differenz [cm/Jahr]
 chart.beddifference.epoch.title = Sohlh\u00f6hendifferenz
-chart.beddifference.xaxis.label = Fluss-Km [km]
+chart.beddifference.xaxis.label = {0}-km
 chart.beddifference.yaxis.label.diff = Differenz [m]
-chart.beddifference.yaxis.label.height = Absolute H\u00f6he [m]
+chart.beddifference.yaxis.label.height = Absolute H\u00f6he [{0}]
 chart.beddifference.year.title = Sohlh\u00f6hendifferenz
 chart.beddifference.yaxis.label.morph = Breite [m]
-chart.beddifference.yaxis.label.heights = Absolute H\u00f6he [m]
+chart.beddifference.yaxis.label.heights = Absolute H\u00f6he [{0}]
 
 export.waterlevel.csv.header.km = Fluss-Km
 export.waterlevel.csv.header.w = W [{0}]
@@ -387,6 +390,8 @@
 export.sqrelation.csv.header.c.duan = C (DUAN)
 export.sqrelation.csv.header.c.ferguson = C (FERGUSON)
 export.sqrelation.csv.header.variance = Standardabweichung
+export.sqrelation.pdf.file = /jasper/sqrelation.jasper
+export.sqrelation.pdf.mode = Transport-Abfluss Beziehung
 export.minfo.bedquality.km = km
 export.minfo.bedquality.density_cap = Sedimentdichte Deckschicht
 export.minfo.bedquality.density_sub = Sedimentdichte Unterschicht
@@ -395,10 +400,15 @@
 export.minfo.bedquality.bedload = Geschiebedurchmesser
 export.minfo.bedquality.bed_cap = Sohldurchmesser Deckschicht
 export.minfo.bedquality.bed_sub = Sohldurchmesser Unterschicht
+export.minfo.beddifference.km = Fluss-km
+export.minfo.beddifference.diff = m
+export.minfo.beddifference.pdf.file = /jasper/beddifference.jasper
+export.minfo.beddifference.pdf.title = Sohlh\u00f6hendifferenz
+export.minfo.beddifference.pdf.mode = Sohlh\u00f6hendifferenz
 
 floodmap.wmsbackground = Hintergrundkarte
 floodmap.riveraxis = Flussachse
-floodmap.uesk = \u00dcsg: {0}-km {1,number,####} - {2,number,####}
+floodmap.uesk = \u00dcSG: {0}-km {1,number,####} - {2,number,####}
 floodmap.barriers = Digitalisierte Objekte
 floodmap.kms = Kilometrierung
 floodmap.qps = Querprofilspuren
@@ -412,6 +422,8 @@
 floodmap.fixpoints = Festpunkte
 floodmap.floodmaps = \u00dcberschwemmungsfl\u00e4che
 floodmap.usershape = Benutzerdaten
+floodmap.isobath.class = {0,number,#.#} m bis {1,number,#.#} m
+floodmap.isobath.lastclass = gr\u00f6\u00dfer {0,number,#.#} m
 
 wsplgen.job.queued = WSPLGEN Berechnung befindet sich in Warteschlange.
 wsplgen.job.error = Ein unerwarteter Fehler beim Starten von WSPLGEN ist aufgetreten.
@@ -617,6 +629,11 @@
 gauge.discharge.service.chart.series.title = Abflusskurve {0,date,short} - {1,date,short}
 gauge.discharge.service.chart.series.title.master = Aktuelle Abflusskurve ab {0,date,short}
 
+bed.km.chart.label = Sohldaten
+bed.km.chart.title = Sohldatenbestand SedDB
+bedload.km.chart.label = Geschiebedaten
+bedload.km.chart.title = Geschiebedatenbestand SedDB
+
 help.state.fix.river=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.river
 help.state.fix.calculation.mode=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.calculation.mode
 help.state.fix.location=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.location
diff -r a3fb76cf79b6 -r e8f152163a1e artifacts/src/main/resources/messages_en.properties
--- a/artifacts/src/main/resources/messages_en.properties	Wed Jun 05 11:56:38 2013 +0200
+++ b/artifacts/src/main/resources/messages_en.properties	Tue Jun 11 09:40:56 2013 +0200
@@ -211,13 +211,13 @@
 chart.w_differences.yaxis.second.label = W [NN + m]
 
 chart.bedquality.title=Bed Longitudinal Section
-chart.bedquality.xaxis.label=River-Km
+chart.bedquality.xaxis.label={0}-km
 chart.bedquality.yaxis.label=Diameter [mm]
 chart.bedquality.yaxis.label.porosity=Porosity [%]
 chart.bedquality.yaxis.label.density=Density [t/m\u00b3]
 
 chart.bedheight_middle.section.title=Middle Bed Height
-chart.bedheight_middle.section.yaxis.label=middle Bed Height [mm a NN]
+chart.bedheight_middle.section.yaxis.label=middle Bed Height [{0}]
 
 chart.flow_velocity.section.title=Geschwindigkeit- und Schubspannung
 chart.flow_velocity.section.yaxis.label=Speed v [m/s]
@@ -280,6 +280,9 @@
 facet.bedquality.bed.density.sublayer = Density ({0,date} - {1,date}) ({2})
 facet.bedquality.bed.diameter.toplayer = {0}_Bed ({1,date} - {2,date}) ({3})
 facet.bedquality.bed.diameter.sublayer = {0}_Bed ({1,date} - {2,date}) ({3})
+facet.bedquality.bed.diameter.data.toplayer = {0} Bed ({1,date} - {2,date}) ({3}) - measurements
+facet.bedquality.bed.diameter.data.sublayer = {0} Bed ({1,date} - {2,date}) ({3}) - measurements
+facet.bedquality.bedload.diameter.data = {0} Bedload - measurements
 facet.bedquality.bedload.diameter = {0}_Bedload
 bedquality.toplayer = 0.0m - 0.3m
 bedquality.sublayer = 0.1m - 0.5m
@@ -303,10 +306,10 @@
 facet.morphologic.width = morphologic Width
 
 chart.beddifference.height.title = Bedheight Difference
-chart.beddifference.height.xaxis.label = River-Km [km]
+chart.beddifference.height.xaxis.label = {0}-km
 chart.beddifference.height.yaxis.label = Difference [cm/year]
 chart.beddifference.epoch.title = Bedheight Difference
-chart.beddifference.xaxis.label = River-Km [km]
+chart.beddifference.xaxis.label = {0}-km
 chart.beddifference.yaxis.label.diff = Difference [m]
 chart.beddifference.yaxis.label.height = Absolute Height [m]
 chart.beddifference.year.title = Bedheight Difference
@@ -392,6 +395,8 @@
 export.sqrelation.csv.header.c.duan = C (DUAN)
 export.sqrelation.csv.header.c.ferguson = C (FERGUSON)
 export.sqrelation.csv.header.variance = Standard variance
+export.sqrelation.pdf.file = /jasper/sqrelation_en.jasper
+export.sqrelation.pdf.mode = Load Discharge Relation
 export.minfo.bedquality.km = km
 export.minfo.bedquality.density_cap = Density Toplayer
 export.minfo.bedquality.density_sub = Density Sublayer
@@ -400,6 +405,11 @@
 export.minfo.bedquality.bedload = Bedload Diameter
 export.minfo.bedquality.bed_cap = Bed Diameter Toplayer
 export.minfo.bedquality.bed_sub = Bed Diameter Sublayer
+export.minfo.beddifference.km = km
+export.minfo.beddifference.diff = m
+export.minfo.beddifference.pdf.file = /jasper/beddifference_en.jasper
+export.minfo.beddifference.pdf.title = Bedheight Difference
+export.minfo.beddifference.pdf.mode = Bedheight Difference
 
 floodmap.wmsbackground = Background Map
 floodmap.riveraxis = River Axis
@@ -417,6 +427,8 @@
 floodmap.fixpoints = Fixpoints
 floodmap.floodmaps = Floodmaps
 floodmap.usershape = User data
+floodmap.isobath.class = {0,number,#.#} m to {1,number,#.#} m
+floodmap.isobath.lastclass = greater {0,number,#.#} m
 
 wsplgen.job.queued = WSPLGEN job in queue.
 wsplgen.job.error = An unexpected error while starting WSPLGEN occured.
@@ -617,6 +629,11 @@
 gauge.discharge.service.chart.series.title = Discharge Curve {0,date,short} - {1,date,short}
 gauge.discharge.service.chart.series.title.master = Current Discharge Curve since {0,date,short}
 
+bed.km.chart.label = Sedimentdata
+bed.km.chart.title = Sedimentdata SedDB
+bedload.km.chart.label = Geschiebedaten
+bedload.km.chart.title = Geschiebedatenbestand SedDB
+
 help.state.fix.river=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.river
 help.state.fix.calculation.mode=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.calculation.mode
 help.state.fix.location=${help.url}/OnlineHilfe/Fixierungsanalyse#help.state.fix.location
diff -r a3fb76cf79b6 -r e8f152163a1e backend/doc/schema/oracle.sql
--- a/backend/doc/schema/oracle.sql	Wed Jun 05 11:56:38 2013 +0200
+++ b/backend/doc/schema/oracle.sql	Tue Jun 11 09:40:56 2013 +0200
@@ -54,7 +54,6 @@
     y                       NUMBER(38,2) NOT NULL,
     cross_section_line_id   NUMBER(38,0) NOT NULL,
     PRIMARY KEY             (id),
-    UNIQUE (cross_section_line_id, col_pos)
 );
 
 
@@ -430,7 +429,7 @@
         JOIN ranges r
              ON wqr.range_id=r.id
         JOIN wst_column_values wcv
-             ON wcv.wst_column_id=wc.id AND wcv.position between r.a and r.b;
+             ON wcv.wst_column_id=wc.id AND wcv.position between r.a and r.b
     ORDER  BY wcv.position ASC,
         wc.position DESC;
 
diff -r a3fb76cf79b6 -r e8f152163a1e backend/doc/schema/postgresql.sql
--- a/backend/doc/schema/postgresql.sql	Wed Jun 05 11:56:38 2013 +0200
+++ b/backend/doc/schema/postgresql.sql	Tue Jun 11 09:40:56 2013 +0200
@@ -259,7 +259,7 @@
         JOIN ranges r
              ON wqr.range_id=r.id
         JOIN wst_column_values wcv
-             ON wcv.wst_column_id=wc.id AND wcv.position between r.a and r.b;
+             ON wcv.wst_column_id=wc.id AND wcv.position between r.a and r.b
     ORDER  BY wcv.position ASC,
         wc.position DESC;
 
@@ -315,7 +315,6 @@
     col_pos               int             NOT NULL,
     x                     NUMERIC         NOT NULL,
     y                     NUMERIC         NOT NULL,
-    UNIQUE (cross_section_line_id, col_pos)
 );
 
 -- Indices for faster access of the points
diff -r a3fb76cf79b6 -r e8f152163a1e backend/src/main/java/org/dive4elements/river/importer/parsers/AtFileParser.java
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/AtFileParser.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/AtFileParser.java	Tue Jun 11 09:40:56 2013 +0200
@@ -132,8 +132,8 @@
 
                     dischargeTable.addDischargeTableValue(
                         new ImportDischargeTableValue(
-                            new BigDecimal(iQ/100.0),
-                            new BigDecimal(iW/100.0)));
+                            new BigDecimal(iQ),
+                            new BigDecimal(iW)));
                 }
 
                 beginning = false;
diff -r a3fb76cf79b6 -r e8f152163a1e backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java	Tue Jun 11 09:40:56 2013 +0200
@@ -113,7 +113,7 @@
     public void parse(File file) throws IOException {
         log.info("Parsing bed height single file '" + file + "'");
 
-        ImportBedHeight obj = newImportBedHeight(file.getName());
+        ImportBedHeight obj = newImportBedHeight(file.getName().replaceAll("\\.csv", ""));
 
         LineNumberReader in = null;
         try {
@@ -273,10 +273,11 @@
                 return true;
             }
             catch (NumberFormatException e) {
-                log.warn("BHP: Could not parse sounding width: " + line, e);
-                log.warn("-> Set default value '0'");
+                log.warn("BHP: Could not parse sounding width in line '" + line + 
+			 "'. -> Set default value '0'");
             }
             obj.setSoundingWidth(0);
+	    return true;
         }
 
         return false;
@@ -345,7 +346,7 @@
         Matcher m = META_TYPE.matcher(line);
 
         if (m.matches()) {
-            String tmp = m.group(1).replace(";", "");
+            String tmp = m.group(1).replace(";", "").trim();
 
             BedHeightType bht = BedHeightType.fetchBedHeightTypeForType(
 		tmp, ImporterSession.getInstance().getDatabaseSession());
diff -r a3fb76cf79b6 -r e8f152163a1e backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/FlowVelocityModelParser.java	Tue Jun 11 09:40:56 2013 +0200
@@ -250,7 +250,7 @@
             Double key = Double.valueOf(km);
 
             if (kmExists.contains(key)) {
-                log.warn("duplicate stattion '" + km + "': -> ignored");
+                log.warn("duplicate station '" + km + "': -> ignored");
                 return;
             }
 
diff -r a3fb76cf79b6 -r e8f152163a1e backend/src/main/java/org/dive4elements/river/model/FlowVelocityModelValue.java
--- a/backend/src/main/java/org/dive4elements/river/model/FlowVelocityModelValue.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/FlowVelocityModelValue.java	Tue Jun 11 09:40:56 2013 +0200
@@ -154,7 +154,8 @@
             "from FlowVelocityModelValue where " +
             "   flowVelocity=:model and" +
             "   station >= :kmLo and " +
-            "   station <= :kmHi");
+            "   station <= :kmHi" +
+            "   order by station");
 
         query.setParameter("model", model);
         query.setParameter("kmLo", new BigDecimal(kmLo));
diff -r a3fb76cf79b6 -r e8f152163a1e backend/src/main/java/org/dive4elements/river/model/River.java
--- a/backend/src/main/java/org/dive4elements/river/model/River.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/River.java	Tue Jun 11 09:40:56 2013 +0200
@@ -290,19 +290,34 @@
 
     /**
      * This method returns the first gauge that is intersected by <i>a</i> and
-     * <i>b</i>,
+     * <i>b</i>, but which possibly does not ends with a or starts with b.
      *
      * @param a A start point.
      * @param b An end point.
      *
-     * @return the first intersecting gauge.
+     * @return the first intersecting gauge that does not border with a or b,
+     * the first intersecting gauge if that is impossible.
      */
     public Gauge determineGauge(double a, double b) {
         List<Gauge> gauges = determineGauges(a, b);
 
-        int idx = a < b ? 0 : gauges.size() - 1;
+        if (a > b) {
+            for (int i = gauges.size() - 1; i >= 0; i--) {
+                Gauge g = gauges.get(i);
+                if (KM_CMP.compare(g.getRange().getA().doubleValue(), a) == 0)
+                    continue;
+                return g;
+            }
+        }
 
-        return gauges.isEmpty() ? null : gauges.get(idx);
+        for (Gauge g: gauges) {
+            if (KM_CMP.compare(g.getRange().getB().doubleValue(), a) == 0) {
+                continue;
+            }
+            return g;
+        }
+
+        return null;
     }
 
     /**
diff -r a3fb76cf79b6 -r e8f152163a1e contrib/make_flys_release/README
--- a/contrib/make_flys_release/README	Wed Jun 05 11:56:38 2013 +0200
+++ b/contrib/make_flys_release/README	Tue Jun 11 09:40:56 2013 +0200
@@ -27,6 +27,8 @@
 BACKENDUSER
 BACKENDPASS
 
+FEATURES_XML (Wenn gesetzt pfad zu einer zu verwendenden features.xml)
+
 Prozess:
 ========
 Als erstes muss man eine halbwegs aktuelle version von artifacts-common
diff -r a3fb76cf79b6 -r e8f152163a1e contrib/make_flys_release/make_release.sh
--- a/contrib/make_flys_release/make_release.sh	Wed Jun 05 11:56:38 2013 +0200
+++ b/contrib/make_flys_release/make_release.sh	Tue Jun 11 09:40:56 2013 +0200
@@ -66,16 +66,16 @@
 #   --seddb-back                    Sediment db backend. Default: $SEDDBBACK
 TOMCAT_PORT=${TOMCAT_PORT:-8282}
 MAPSERVER_URL=${MAPSERVER_URL:-http://flys-devel.intevation.de}
-WIKI_URL=${WIKI_URL:-https://flys-intern.intevation.de/Flys-3.0}
+WIKI_URL=${WIKI_URL:-https://flys3-devel.bafg.de/wiki}
 # Prefix to FreeSans.ttf
 FONT_PATH=${FONT_PATH:-/opt/flys}
 
 # Seddb Configuration
 SEDDBURL=${SEDDBURL:-czech-republic.atlas.intevation.de}
-SEDDBPORT=${SEDDBPORT:-1521}
-SEDDBBACK=${SEDDBBACK:-XE}
-SEDDBUSER=${SEDDBUSER:-seddb}
-SEDDBPASS=${SEDDBPASS:-seddbpass}
+SEDDBPORT=${SEDDBPORT:-5432}
+SEDDBBACK=${SEDDBBACK:-seddb}
+SEDDBUSER=${SEDDBUSER:-flys}
+SEDDBPASS=${SEDDBPASS:-flys}
 SEDINITSQLS=${SEDINITSQLS:-}
 
 
@@ -199,7 +199,10 @@
 sed -i -e "s@/tmp/flys-client.log@${LOG_DIR}/client-${VERSION}.log at g" \
     $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/log4j.properties
 
-# XXX: Are they really used at runtime?
+if [ -r "$FEATURES_XML" ]; then
+    cp "$FEATURES_XML" $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/features.xml
+fi
+
 find $FLYS_SOURCE_DIR/river/ -name \*.properties -o -name \*.xsl |  \
     xargs sed -i "s at https://flys-intern.intevation.de@${WIKI_URL}@g";
 
@@ -293,18 +296,6 @@
        -e "s@<help-url>http://example.com</help-url>@<help-url>${WIKI_URL}</help-url>@g" \
     $WORK_DIR/server/conf/conf.xml
 
-cat > $WORK_DIR/server/conf/seddb-db.xml << EOF
-<?xml version="1.0" encoding="UTF-8" ?>
-<seddb-database>
-    <!-- This is the default SedDB db configuration. -->
-    <user>$SEDDBUSER</user>
-    <password>$SEDDBPASS</password>
-    <dialect>org.hibernate.dialect.Oracle9iDialect</dialect>
-    <driver>oracle.jdbc.driver.OracleDriver</driver>
-    <url>jdbc:oracle:thin:@//$SEDDBURL:$SEDDBPORT/$SEDDBBACK</url>
-    <connection-init-sqls>$SEDINITSQLS</connection-init-sqls>
-</seddb-database>
-EOF
 
 if [ "$BUILD_ORACLE" = "TRUE" ]; then
     # Oracle backend configuration
@@ -319,6 +310,19 @@
     <connection-init-sqls>$INITSQLS</connection-init-sqls>
 </backend-database>
 EOF
+
+cat > $WORK_DIR/server/conf/seddb-db.xml << EOF
+<?xml version="1.0" encoding="UTF-8" ?>
+<seddb-database>
+    <user>$SEDDBUSER</user>
+    <password>$SEDDBPASS</password>
+    <dialect>org.hibernate.dialect.Oracle9iDialect</dialect>
+    <driver>oracle.jdbc.driver.OracleDriver</driver>
+    <url>jdbc:oracle:thin:@//$SEDDBURL:$SEDDBPORT/$SEDDBBACK</url>
+    <connection-init-sqls>$SEDINITSQLS</connection-init-sqls>
+</seddb-database>
+EOF
+
 else
     #Postgresql backend configuration
     cat > $WORK_DIR/server/conf/backend-db.xml << EOF
@@ -332,6 +336,18 @@
     <connection-init-sqls>$INITSQLS</connection-init-sqls>
 </backend-database>
 EOF
+
+cat > $WORK_DIR/server/conf/seddb-db.xml << EOF
+<?xml version="1.0" encoding="UTF-8" ?>
+<seddb-database>
+    <user>$SEDDBUSER</user>
+    <password>$SEDDBPASS</password>
+    <dialect>org.hibernate.dialect.PostgreSQLDialect</dialect>
+    <driver>org.postgresql.Driver</driver>
+    <url>jdbc:postgresql://$SEDDBURL:$SEDDBPORT/$SEDDBBACK</url>
+</seddb-database>
+EOF
+
 fi
 
 mkdir $WORK_DIR/artifactsdb
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java	Tue Jun 11 09:40:56 2013 +0200
@@ -284,6 +284,7 @@
             public void onSuccess(River[] newRivers) {
                 GWT.log("Retrieved " + newRivers.length + " new rivers.");
                 rivers = newRivers;
+                newProject();
             }
         });
     }
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Tue Jun 11 09:40:56 2013 +0200
@@ -604,6 +604,10 @@
 
     String bed_difference_height_year();
 
+    String bedheight_difference_export();
+
+    String fix_waterlevel_export();
+
     // ERRORS
 
     String error_years_wrong();
@@ -922,6 +926,8 @@
 
     String datacage_add_pair();
 
+    String delta_w();
+
     // Capabilities Information Panel
 
     String addwmsInputTitle();
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Tue Jun 11 09:40:56 2013 +0200
@@ -255,9 +255,10 @@
 bed_diameter = Bed Diameter
 soundings = Soundings
 soundings_width = Soundings Width
-bed_difference_year = Single Bedheight Differences
+bed_difference_year = Bedheight Differences
 bed_difference_epoch = Epoch Bedheight Differences
 bed_difference_height_year = Bedheight Differences per year
+bedheight_difference_export = Bedheight Differences Export
 
 exportATTooltip = Export as AT file
 
@@ -280,6 +281,7 @@
 eventselect = Eventselection
 events = Events
 kmchart = W/Q-Preview
+fix_waterlevel_export = Fixing analysis export
 
 chart_themepanel_header_themes = Theme
 chart_themepanel_header_actions = Actions
@@ -489,6 +491,7 @@
 measurements = Measurements
 floodmarks = Flood Marks
 pegel_had_measurement_points = HAD Discharge-Measurement points
+delta_w = Delta W
 # No translation for the pegelonline wms service layer names.
 gauge_points = Pegelpunkte (WSV)
 gauge_level = Aktueller Wasserstand (WSV)
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Tue Jun 11 09:40:56 2013 +0200
@@ -255,9 +255,10 @@
 bed_diameter = Sohldurchmesser
 soundings = Peilungen
 soundings_width = Gepeilte Breite
-bed_difference_year = Sohlh\u00f6hendifferenz (Jahr)
+bed_difference_year = Sohlh\u00f6hendifferenz
 bed_difference_epoch = Sohlh\u00f6hendifferenz (Epoche)
 bed_difference_height_year = Sohlh\u00f6hendifferenz pro Jahr
+bedheight_difference_export = Sohlh\u00f6hendifferenz Export
 
 waterlevel_export = Wasserstand/Wasserspiegellagen Export
 waterlevel_report = Wasserstand/Wasserspiegellagen Bericht
@@ -278,6 +279,7 @@
 eventselect = Ereignisauswahl
 events = Ereignisse
 kmchart = W/Q-Vorschau
+fix_waterlevel_export = Fixierungsanalysen Export
 
 exportATTooltip = Daten als AT Datei exportieren
 
@@ -494,6 +496,7 @@
 measurements = Messungen
 floodmarks = HW-Marken
 pegel_had_measurement_points = HAD Abflussmessstellen (WMS)
+delta_w = W Differenzen
 gauge_points = Pegelmessstelle (WMS)
 gauge_level = Wasserstand (WMS)
 gauge_names = Pegelname (WMS)
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties	Tue Jun 11 09:40:56 2013 +0200
@@ -253,9 +253,10 @@
 bed_diameter = Bed Diameter
 soundings = Soundings
 soundings_width = Soundings Width
-bed_difference_year = Single Bedheight Differences
+bed_difference_year = Bedheight Differences
 bed_difference_epoch = Epoch Bedheight Differences
 bed_difference_height_year = Bedheight Difference per year
+bedheight_difference_export = Bedheight Differences Export
 
 exportATTooltip = Export as AT file
 
@@ -278,6 +279,7 @@
 eventselect = Eventselection
 events = Events
 kmchart = W/Q-Preview
+fix_waterlevel_export = Fixing analysis export
 
 chart_themepanel_header_themes = Theme
 chart_themepanel_header_actions = Actions
@@ -473,6 +475,7 @@
 bedheights = Bedheights
 morph_width = morphologic Width
 datacage = Datacage
+delta_w = Delta W
 
 startcolor = Colorrange start color
 endcolor = Colorrange end color
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractUIProvider.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractUIProvider.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/AbstractUIProvider.java	Tue Jun 11 09:40:56 2013 +0200
@@ -19,6 +19,7 @@
 import com.smartgwt.client.widgets.layout.VLayout;
 
 import org.dive4elements.river.client.client.FLYSConstants;
+import org.dive4elements.river.client.client.FLYS;
 import org.dive4elements.river.client.client.event.HasStepBackHandlers;
 import org.dive4elements.river.client.client.event.HasStepForwardHandlers;
 import org.dive4elements.river.client.client.event.StepBackEvent;
@@ -178,11 +179,11 @@
 
 
     @Override
-    public Canvas createHelpLink(DataList dataList, Data data) {
+    public Canvas createHelpLink(DataList dataList, Data data, FLYS instance) {
         String iUrl    = GWT.getHostPageBaseURL() + MSG.getFeatureInfo();
         String helpUrl = dataList.getHelpText();
 
-        return new ImgLink(iUrl, helpUrl, 30, 30, true);
+        return new WikiImgLink(iUrl, helpUrl, 30, 30, instance);
     }
 
 
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageWidget.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageWidget.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageWidget.java	Tue Jun 11 09:40:56 2013 +0200
@@ -381,6 +381,7 @@
                 String name     = node.getAttribute("facet");
                 String ids      = node.getAttribute("ids");
                 String displayname = node.getAttribute("name");
+                String targetOut = node.getAttribute("target_out");
                 String debugAttributeValues = "";
                 for (String attr: node.getAttributes()) {
                     debugAttributeValues += ("[" + attr +": "
@@ -394,7 +395,8 @@
                      out,
                      name,
                      ids,
-                     displayname);
+                     displayname,
+                     targetOut);
             }
             TreeNode [] children = tree.getChildren(node);
             if (children != null) {
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DemDatacagePanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DemDatacagePanel.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DemDatacagePanel.java	Tue Jun 11 09:40:56 2013 +0200
@@ -46,12 +46,6 @@
 
 
     @Override
-    public User getUser() {
-        return null;
-    }
-
-
-    @Override
     public String getOuts() {
         return OUT;
     }
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ImgLink.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ImgLink.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ImgLink.java	Tue Jun 11 09:40:56 2013 +0200
@@ -14,13 +14,13 @@
 
 public class ImgLink extends HTMLPane {
 
-    private int width;
-    private int height;
+    protected int width;
+    protected int height;
 
-    private String href;
-    private String imgUrl;
+    protected String href;
+    protected String imgUrl;
 
-    private boolean newTab;
+    protected boolean newTab;
 
 
     public ImgLink(String imgUrl, String href, int width, int height) {
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LinkSelection.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LinkSelection.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LinkSelection.java	Tue Jun 11 09:40:56 2013 +0200
@@ -16,7 +16,10 @@
 import com.smartgwt.client.types.VerticalAlignment;
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.HTMLPane;
+import com.smartgwt.client.widgets.Img;
 import com.smartgwt.client.widgets.Label;
+import com.smartgwt.client.widgets.events.VisibilityChangedEvent;
+import com.smartgwt.client.widgets.events.VisibilityChangedHandler;
 import com.smartgwt.client.widgets.form.DynamicForm;
 import com.smartgwt.client.widgets.form.fields.LinkItem;
 import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
@@ -42,6 +45,7 @@
  */
 public class LinkSelection
 extends      MapSelection
+implements   VisibilityChangedHandler
 {
 
     private static final long serialVersionUID = -7138270638349711024L;
@@ -51,7 +55,9 @@
 
     /** The selected river*/
     protected Data river;
-    private static Map<String, LinkItem> rivers;
+    private static Map<String, Img> riverHighlight;
+    private static Map<String, HLayout> riverList;
+    private static String selected;
     private static HLayout columns;
 
     private static Trigger trigger;
@@ -95,7 +101,8 @@
     public Canvas create(DataList data) {
         trigger = new Trigger(this);
         createCallback();
-        rivers = new HashMap<String, LinkItem>();
+        riverHighlight = new HashMap<String, Img>();
+        riverList = new HashMap<String, HLayout>();
 
         VLayout v = new VLayout();
         v.setMembersMargin(10);
@@ -182,22 +189,37 @@
 
             int counter = 0;
             for (DataItem item: d.getItems()) {
+                HLayout row = new HLayout();
                 LinkItem link = new LinkItem("river");
+                link.setHoverDelay(0);
                 link.setLinkTitle(item.getLabel());
                 link.setTarget(item.getStringValue());
                 link.setShowTitle(false);
+                Img img = new Img();
+                img.setShowTitle(false);
+                img.setSrc("symbol_selected.png");
+                img.setWidth(18);
+                img.setHeight(18);
+                img.setVisible(false);
+                Canvas container = new Canvas();
+                container.addChild(img);
+                container.setHeight(20);
+                container.setWidth(20);
                 DynamicForm f = new DynamicForm();
-                rivers.put(item.getStringValue(), link);
-
+                riverList.put(item.getStringValue(), row);
+                riverHighlight.put(item.getStringValue(), img);
                 f.setItems(link);
+                row.addMember(container);
+                row.addMember(f);
+                row.addVisibilityChangedHandler(this);
+                link.setColSpan(20);
                 if (counter < d.getItems().length/2) {
-                    formLayout1.addMember(f);
+                    formLayout1.addMember(row);
                 }
                 else {
-                    formLayout2.addMember(f);
+                    formLayout2.addMember(row);
                 }
                 counter++;
-
                 link.addClickHandler(new ClickHandler() {
                     @Override
                     public void onClick(ClickEvent event) {
@@ -218,27 +240,22 @@
                     @Override
                     public void onItemHover(ItemHoverEvent event) {
                         String river = ((LinkItem)event.getItem()).getLinkTitle();
-                        for (Map.Entry<String, LinkItem> entry: rivers.entrySet()) {
-                            String s = entry.getKey();
-                            LinkItem item = entry.getValue();
-                            if (item.getLinkTitle().equals(river)) {
-                                item.setCellStyle("riverLinkHighlight");
-                                callHighlightRiver(river);
+                        Img item = riverHighlight.get(river);
+                        if (item != null) {
+                            item.setVisible(true);
+                            if (selected != null && !selected.equals(river)) {
+                                riverHighlight.get(selected).setVisible(false);
+                                callUnHighlightRiver(selected);
                             }
-                            else {
-                                item.setCellStyle("formCell");
-                                callUnHighlightRiver(s);
-                            }
-                        }
-                        if (columns != null) {
-                            columns.redraw();
+                            callHighlightRiver(river);
+                            selected = river;
                         }
                     }
                 });
             }
 
             if (module != null) {
-                getModuleSelection().setRivers(rivers);
+                getModuleSelection().setRivers(riverList);
             }
             label.setWidth(50);
 
@@ -248,7 +265,6 @@
             layout.addMember(columns);
 
         }
-        layout.addMember(getNextButton());
         HTMLPane map = new HTMLPane();
         map.setContentsURL("images/FLYS_Karte_interactive.html");
 
@@ -270,24 +286,31 @@
 
     private native void createCallback() /*-{
         $wnd.highlightRiver = @org.dive4elements.river.client.client.ui.LinkSelection::highlightCallback(Ljava/lang/String;);
+        $wnd.unHighlightRiver = @org.dive4elements.river.client.client.ui.LinkSelection::unHighlightCallback(Ljava/lang/String;);
         $wnd.selectRiver = @org.dive4elements.river.client.client.ui.LinkSelection::selectCallback(Ljava/lang/String;);
         $wnd.availableRiver = @org.dive4elements.river.client.client.ui.LinkSelection::availableRiver(Ljava/lang/String;);
     }-*/;
 
     private static void highlightCallback(String name) {
-        for (Map.Entry<String, LinkItem> entry: rivers.entrySet()) {
-            String s = entry.getKey();
-            LinkItem item = entry.getValue();
-            item.setCellStyle(s.equals(name) ? "riverLinkHighlight" : "formCell");
+        if (riverHighlight.containsKey(name)) {
+            riverHighlight.get(name).setVisible(true);
+            if(selected != null && !selected.equals(name)) {
+                riverHighlight.get(selected).setVisible(false);
+            }
+            selected = name;
         }
-        if (columns != null) {
-            columns.redraw();
+    }
+
+    private static void unHighlightCallback(String name) {
+        if (riverHighlight.containsKey(name)) {
+            riverHighlight.get(name).setVisible(false);
+            selected = null;
         }
     }
 
     private static boolean availableRiver(String river) {
-        LinkItem ri = rivers.get(river);
-        return ri != null && ri.isVisible();
+        HLayout row = riverList.get(river);
+        return row != null && row.isVisible();
     }
 
     private static void selectCallback(String name) {
@@ -303,5 +326,15 @@
     private native void callUnHighlightRiver(String name) /*-{
         $wnd.unHighlight(name);
     }-*/;
+
+
+    @Override
+    public void onVisibilityChanged(VisibilityChangedEvent event) {
+        for (Map.Entry<String, Img> entry: riverHighlight.entrySet()) {
+            entry.getValue().setVisible(false);
+            callUnHighlightRiver(entry.getKey());
+        }
+        selected = null;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ModuleSelection.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ModuleSelection.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ModuleSelection.java	Tue Jun 11 09:40:56 2013 +0200
@@ -16,7 +16,6 @@
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.Label;
 import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.fields.LinkItem;
 import com.smartgwt.client.widgets.form.fields.RadioGroupItem;
 import com.smartgwt.client.widgets.form.fields.events.ChangeEvent;
 import com.smartgwt.client.widgets.form.fields.events.ChangeHandler;
@@ -55,7 +54,7 @@
     protected FLYSConstants MESSAGES = GWT.create(FLYSConstants.class);
 
     /** The module checkboxes.*/
-    protected RadioGroupItem radio;
+    protected static RadioGroupItem radio;
 
     /** */
     protected Module[] modules;
@@ -65,7 +64,7 @@
 
     private List<String> fixRivers;
     private List<String> minfoRivers;
-    protected Map<String, LinkItem> rivers;
+    protected Map<String, HLayout> rivers;
 
     /**
      * The default constructor.
@@ -110,6 +109,7 @@
     @Override
     public Canvas create(DataList data) {
         GWT.log("ModuleSelection - create()");
+        createCallback();
         VLayout newLayout = new VLayout();
         newLayout.setMembersMargin(10);
         newLayout.setAlign(VerticalAlignment.TOP);
@@ -179,7 +179,7 @@
             public void onChange(ChangeEvent event) {
                 String selected = (String)event.getValue();
                 if (!rivers.isEmpty()) {
-                    for (Map.Entry<String, LinkItem> s: rivers.entrySet()) {
+                    for (Map.Entry<String, HLayout> s: rivers.entrySet()) {
                         if (selected.equals("minfo") && !minfoRivers.contains(s.getKey())) {
                             s.getValue().hide();
                         }
@@ -188,9 +188,7 @@
                         }
                         else {
                             s.getValue().show();
-                            s.getValue().setCellStyle("formCell");
                         }
-                        callUnHighlightRiver(s.getKey());
                     }
                 }
             }
@@ -235,12 +233,17 @@
         return new Data[] {data};
     }
 
-    public void setRivers(Map<String, LinkItem> rivers) {
+    public void setRivers(Map<String, HLayout> rivers) {
         this.rivers = rivers;
     }
 
-    private native void callUnHighlightRiver(String name) /*-{
-        $wnd.unHighlight(name);
+    private native void createCallback() /*-{
+        $wnd.getModule = @org.dive4elements.river.client.client.ui.ModuleSelection::getSelectedModule();
     }-*/;
+
+    private static String getSelectedModule() {
+        GWT.log("selected: " + radio.getValueAsString());
+        return radio.getValueAsString();
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ParameterList.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ParameterList.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ParameterList.java	Tue Jun 11 09:40:56 2013 +0200
@@ -576,7 +576,7 @@
 
         if (current != null && uiProvider != null) {
             Canvas c = uiProvider.create(current);
-            Canvas h = uiProvider.createHelpLink(current, null);
+            Canvas h = uiProvider.createHelpLink(current, null, this.flys);
 
             HLayout wrapper = new HLayout();
             wrapper.addMember(h);
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/QSegmentedInputPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/QSegmentedInputPanel.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/QSegmentedInputPanel.java	Tue Jun 11 09:40:56 2013 +0200
@@ -44,7 +44,6 @@
 
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 
@@ -242,13 +241,10 @@
         List<String> errors = new ArrayList<String>();
         NumberFormat nf     = NumberFormat.getDecimalFormat();
 
-        Iterator<String> iter = wqranges.keySet().iterator();
+        for (Map.Entry<String, DoubleArrayPanel> entry: wqranges.entrySet()) {
 
-        while (iter.hasNext()) {
-            List<String> tmpErrors = new ArrayList<String>();
-
-            String           key = iter.next();
-            DoubleArrayPanel dap = wqranges.get(key);
+            String           key = entry.getKey();
+            DoubleArrayPanel dap = entry.getValue();
 
             if (!dap.validateForm()) {
                 errors.add(MSG.error_invalid_double_value());
@@ -261,6 +257,7 @@
                 continue;
             }
 
+            List<String> tmpErrors = new ArrayList<String>();
             double[] values = dap.getInputValues();
             // might geht npe here if one field not filled
             double[] good   = new double[values.length];
@@ -362,10 +359,9 @@
     protected Data getWQValues() {
         String wqvalue = null;
 
-        Iterator<String> iter = wqranges.keySet().iterator();
-        while (iter.hasNext()) {
-            String           key = iter.next();
-            DoubleArrayPanel dap = wqranges.get(key);
+        for (Map.Entry<String, DoubleArrayPanel> entry: wqranges.entrySet()) {
+            String           key = entry.getKey();
+            DoubleArrayPanel dap = entry.getValue();
 
             double[] values = dap.getInputValues();
             if (wqvalue == null) {
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RiverInfoPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RiverInfoPanel.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RiverInfoPanel.java	Tue Jun 11 09:40:56 2013 +0200
@@ -16,7 +16,9 @@
 import com.google.gwt.user.client.ui.HorizontalPanel;
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.Widget;
+import com.google.gwt.user.client.ui.HTML;
 
+import org.dive4elements.river.client.client.FLYS;
 import org.dive4elements.river.client.client.FLYSConstants;
 
 import org.dive4elements.river.client.shared.model.RiverInfo;
@@ -27,6 +29,9 @@
  */
 public class RiverInfoPanel extends HorizontalPanel {
 
+    /** The flys instance */
+    protected FLYS flys;
+
     /** The message class that provides i18n strings.*/
     protected FLYSConstants MSG = GWT.create(FLYSConstants.class);
 
@@ -35,7 +40,9 @@
     public final static int PADDING = 8;
     public final static int MARGIN = 10;
 
-    public RiverInfoPanel(RiverInfo riverinfo) {
+    public RiverInfoPanel(FLYS flys, RiverInfo riverinfo) {
+        this.flys = flys;
+
         setStyleName("riverinfopanel");
         setHeight("" + HEIGHT + "px");
         setVerticalAlignment(ALIGN_MIDDLE);
@@ -91,8 +98,8 @@
         String url = number != null ?
             MSG.gauge_river_url() + number :
             MSG.gauge_river_url();
-        Anchor anchor = new Anchor(MSG.gauge_river_info_link(), url, "_blank");
-        add(anchor);
+        add(new HTML(WikiLinks.linkHTML(this.flys, url,
+                                        MSG.gauge_river_info_link())));
     }
 
     public static int getStaticHeight() {
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/SelectProvider.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/SelectProvider.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/SelectProvider.java	Tue Jun 11 09:40:56 2013 +0200
@@ -31,7 +31,6 @@
 import org.dive4elements.river.client.shared.model.DefaultDataItem;
 
 import java.util.ArrayList;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
@@ -260,14 +259,13 @@
     @Override
     protected Data[] getData() {
         Map<?,?> values  = form.getValues();
-        Iterator<?> keys = values.keySet().iterator();
 
         Data[] list = new Data[values.size()];
         int       i = 0;
 
-        while (keys.hasNext()) {
-            String fieldname = ((String) keys.next()).replace('_', ' ');
-            String selection = (String) values.get(fieldname);
+        for (Map.Entry<?, ?> entry: values.entrySet()) {
+            String fieldname = ((String)entry.getKey()).replace('_', ' ');
+            String selection = (String)entry.getValue();
 
             DataItem item    = new DefaultDataItem(fieldname, null, selection);
 
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/StyleEditorWindow.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/StyleEditorWindow.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/StyleEditorWindow.java	Tue Jun 11 09:40:56 2013 +0200
@@ -49,7 +49,6 @@
 import org.dive4elements.river.client.shared.model.Theme;
 
 import java.util.Arrays;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map;
 import java.util.Set;
@@ -196,9 +195,7 @@
                     LinkedHashMap<String, String> valueMap =
                         new LinkedHashMap<String, String>();
                     valueMap.put("aktuell", "Aktuell");
-                    Iterator<String> iter = keys.iterator();
-                    while (iter.hasNext()) {
-                        String s = iter.next().toString();
+                    for (String s: keys) {
                         Style tmp = styleGroups.get(s);
                         tmp.setFacet(current.getFacet());
                         tmp.setIndex(current.getIndex());
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProvider.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProvider.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/UIProvider.java	Tue Jun 11 09:40:56 2013 +0200
@@ -18,6 +18,8 @@
 import org.dive4elements.river.client.shared.model.Artifact;
 import org.dive4elements.river.client.shared.model.Collection;
 
+import org.dive4elements.river.client.client.FLYS;
+
 /**
  * This interface describes a method that creates a Canvas element displaying
  * DataItems for a current state of the artifact.
@@ -48,7 +50,7 @@
     public Canvas createOld(DataList dataList);
 
 
-    public Canvas createHelpLink(DataList dataList, Data data);
+    public Canvas createHelpLink(DataList dataList, Data data, FLYS instance);
 
 
     /**
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java	Tue Jun 11 09:40:56 2013 +0200
@@ -51,7 +51,6 @@
 
 import java.util.ArrayList;
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
@@ -220,7 +219,6 @@
                         return;
                     }
 
-                    int    idx = e.getColNum();
                     Record r   = e.getRecord();
                     double val = r.getAttributeAsDouble("value");
 
@@ -385,13 +383,10 @@
         List<String> errors = new ArrayList<String>();
         NumberFormat nf     = NumberFormat.getDecimalFormat();
 
-        Iterator<String> iter = wqranges.keySet().iterator();
+        for (Map.Entry<String, DoubleArrayPanel> entry: wqranges.entrySet()) {
 
-        while (iter.hasNext()) {
-            List<String> tmpErrors = new ArrayList<String>();
-
-            String           key = iter.next();
-            DoubleArrayPanel dap = wqranges.get(key);
+            String           key = entry.getKey();
+            DoubleArrayPanel dap = entry.getValue();
 
             if (!dap.validateForm()) {
                 errors.add(MSG.error_invalid_double_value());
@@ -409,6 +404,7 @@
 
             int idx = 0;
 
+            List<String> tmpErrors = new ArrayList<String>();
             for (double value: values) {
                 if (value < mm[0] || value > mm[1]) {
                     String tmp = MSG.error_validate_range();
@@ -697,10 +693,9 @@
     protected Data getWQValues() {
         String wqvalue = null;
 
-        Iterator<String> iter = wqranges.keySet().iterator();
-        while (iter.hasNext()) {
-            String           key = iter.next();
-            DoubleArrayPanel dap = wqranges.get(key);
+        for (Map.Entry<String, DoubleArrayPanel> entry: wqranges.entrySet()) {
+            String           key = entry.getKey();
+            DoubleArrayPanel dap = entry.getValue();
             String label = dap.getItemTitle();
 
             double[] values = dap.getInputValues();
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiImgLink.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiImgLink.java	Tue Jun 11 09:40:56 2013 +0200
@@ -0,0 +1,33 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.client.client.ui;
+
+import com.smartgwt.client.types.Overflow;
+
+import org.dive4elements.river.client.client.FLYS;
+import org.dive4elements.river.client.client.ui.WikiLinks;
+
+public class WikiImgLink extends ImgLink {
+
+    protected FLYS instance;
+
+    public WikiImgLink(String imgUrl, String href, int width, int height, FLYS instance) {
+        super(imgUrl, href, width, height, false);
+        this.instance = instance;
+        update();
+    }
+
+    @Override
+    protected void update() {
+        setContents(WikiLinks.imageLinkHTML(instance, href, imgUrl));
+        setWidth(width);
+        setHeight(height);
+        setOverflow(Overflow.VISIBLE);
+    }
+}
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiLinks.java
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiLinks.java	Tue Jun 11 09:40:56 2013 +0200
@@ -0,0 +1,65 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.client.client.ui;
+
+import com.smartgwt.client.widgets.grid.CellFormatter;
+import com.smartgwt.client.widgets.grid.ListGridRecord;
+import com.google.gwt.safehtml.shared.SafeHtmlUtils;
+
+import org.dive4elements.river.client.client.FLYS;
+
+public class WikiLinks
+{
+    public static String imageLinkHTML(FLYS instance, String url, String imageUrl) {
+        String saml = null;
+        if (instance != null && instance.getCurrentUser() != null) {
+            saml = instance.getCurrentUser().getSamlXMLBase64();
+        }
+        String quotedUrl = SafeHtmlUtils.htmlEscape(url);
+        String quotedImage = SafeHtmlUtils.htmlEscape(imageUrl);
+
+        if (saml != null) {
+            return "<form method=\"POST\" target=\"_blank\" action=\""
+                + quotedUrl + "\">"
+                + "<input type=\"hidden\" name=\"saml\" value=\""
+                + SafeHtmlUtils.htmlEscape(saml) + "\">"
+                + "<input type=\"image\" src=\""+ quotedImage + "\">"
+                + "</form>";
+        }
+        else {
+            return "<a href=\"" + quotedUrl + "\"><img src=\"" + quotedImage + "\"></a>";
+        }
+    }
+
+    public static String linkHTML(FLYS flys, String url, String text) {
+        String saml = flys.getCurrentUser().getSamlXMLBase64();
+        String quotedUrl = SafeHtmlUtils.htmlEscape(url);
+        String quotedText = SafeHtmlUtils.htmlEscape(text);
+        if (saml != null) {
+            return "<form method=\"POST\" target=\"_blank\" action=\""
+                + quotedUrl + "\">"
+                + "<input type=\"hidden\" name=\"saml\" value=\""
+                + SafeHtmlUtils.htmlEscape(saml) + "\">"
+                + "<input type=\"submit\" value=\"" + quotedText + "\">"
+                + "</form>";
+        }
+        else {
+            return "<a href=\"" + quotedUrl + "\">" + quotedText + "</a>";
+        }
+    }
+
+    public static CellFormatter cellFormatter(final FLYS flys) {
+        return new CellFormatter() {
+            public String format(Object value, ListGridRecord record,
+                                 int rowNum, int colNum) {
+                return linkHTML(flys, (String)value, record.getLinkText());
+            }
+        };
+    }
+}
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartToolbar.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartToolbar.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/ChartToolbar.java	Tue Jun 11 09:40:56 2013 +0200
@@ -118,7 +118,7 @@
 
         if (chartTab.getMode().getName().equals("fix_wq_curve")) {
             exportAT = new ImgLink(
-                baseUrl + MSG.downloadCSV(),
+                baseUrl + MSG.downloadAT(),
                 moduleUrl + "export" +
                    "?uuid=" + chartTab.getCollection().identifier() +
                    "&name=" + chartTab.getMode().getName() +
@@ -335,6 +335,7 @@
             exportAT.setSource(
                    moduleUrl + "export" +
                    "?uuid=" + chartTab.getCollection().identifier() +
+                   "&name=" + chartTab.getMode().getName() +
                    "&mode=" + chartTab.getMode().getName() + "_at_export" +
                    "&type=at" +
                    "&server=" + config.getServerUrl() +
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/CrossSectionChartThemePanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/CrossSectionChartThemePanel.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/CrossSectionChartThemePanel.java	Tue Jun 11 09:40:56 2013 +0200
@@ -79,7 +79,7 @@
     /** Data item name for CrossSections selected km. */
     protected static String CS_KM = "cross_section.km";
 
-    /** Data item name for CrossSections selected km. */
+    /** Data item name for CrossSections reference ('master') flag. */
     protected static String CS_IS_MASTER = "cross_section.master?";
 
     /** List of cross-section themes through which is moved through synchronously. */
@@ -178,6 +178,8 @@
         }
         // There is none selected. Take the first one.
         if (firstCSUuid != null) {
+            // TODO better take the one closest to first km!
+            // issue1157, query next/prev kms, select the one which is closest.
             setCurrentCSMaster(firstCSUuid);
             feedTellMaster(firstCSUuid);
         }
@@ -410,7 +412,11 @@
      *                    \param to.
      */
     @Override
-    public void spinnerValueEntered(KMSpinner spinner, final double enteredKm, final FacetRecord facetRecord, final boolean up) {
+    public void spinnerValueEntered(KMSpinner spinner,
+        final double enteredKm,
+        final FacetRecord facetRecord,
+        final boolean up
+    ) {
         disable();
         Config config       = Config.getInstance();
         final String locale = config.getLocale();
@@ -502,6 +508,7 @@
 
                     String fieldName = this.getFieldName(colNum);
 
+                    // Place KMSpinner in Grid with currently chosen km value.
                     if (fieldName.equals(GRID_FIELD_ACTIONS)) {
                         double currentValue =
                             Double.valueOf(facetRecord.getTheme().getCollectionItem().getData().get(CS_KM));
@@ -520,6 +527,7 @@
         list.setShowAllRecords(true);
         list.setShowHeaderContextMenu(false);
         list.setLeaveScrollbarGap(false);
+
         return list;
     }
 
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java	Tue Jun 11 09:40:56 2013 +0200
@@ -23,7 +23,6 @@
 import org.dive4elements.river.client.shared.model.DefaultDataItem;
 
 import java.util.HashMap;
-import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.Map;
 
@@ -145,15 +144,14 @@
 
     @Override
     public Data[] getData() {
-        Map values    = form.getValues();
-        Iterator keys = values.keySet().iterator();
+        Map<?, ?> values = form.getValues();
 
         Data[] list = new Data[values.size()];
         int       i = 0;
 
-        while (keys.hasNext()) {
-            String fieldname = (String) keys.next();
-            String selection = (String) values.get(fieldname);
+        for (Map.Entry<?, ?>entry: values.entrySet()) {
+            String fieldname = (String)entry.getKey();
+            String selection = (String)entry.getValue();
 
             DataItem item    = new DefaultDataItem(fieldname, null, selection);
 
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapPrintPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapPrintPanel.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/map/MapPrintPanel.java	Tue Jun 11 09:40:56 2013 +0200
@@ -8,44 +8,42 @@
 
 package org.dive4elements.river.client.client.ui.map;
 
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.gwt.user.client.Window;
-
-import com.smartgwt.client.util.SC;
-import com.smartgwt.client.widgets.Canvas;
-import com.smartgwt.client.widgets.form.DynamicForm;
-import com.smartgwt.client.widgets.form.fields.TextItem;
-import com.smartgwt.client.widgets.form.fields.ButtonItem;
-import com.smartgwt.client.widgets.form.fields.SelectItem;
-import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
-import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
-import com.smartgwt.client.types.Alignment;
-
-import org.gwtopenmaps.openlayers.client.Bounds;
-import org.gwtopenmaps.openlayers.client.Map;
-
 import org.dive4elements.river.client.client.Config;
 import org.dive4elements.river.client.client.FLYSConstants;
 import org.dive4elements.river.client.client.services.CollectionAttributeService;
 import org.dive4elements.river.client.client.services.CollectionAttributeServiceAsync;
+import org.dive4elements.river.client.shared.model.Artifact;
+import org.dive4elements.river.client.shared.model.ArtifactDescription;
 import org.dive4elements.river.client.shared.model.Collection;
+import org.dive4elements.river.client.shared.model.Data;
+import org.dive4elements.river.client.shared.model.DataItem;
+import org.dive4elements.river.client.shared.model.DataList;
 import org.dive4elements.river.client.shared.model.OutputSettings;
 import org.dive4elements.river.client.shared.model.Property;
 import org.dive4elements.river.client.shared.model.PropertySetting;
 import org.dive4elements.river.client.shared.model.Settings;
-import org.dive4elements.river.client.shared.model.Artifact;
-import org.dive4elements.river.client.shared.model.ArtifactDescription;
-import org.dive4elements.river.client.shared.model.Data;
-import org.dive4elements.river.client.shared.model.DataItem;
-import org.dive4elements.river.client.shared.model.DataList;
 
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.smartgwt.client.types.Alignment;
+import com.smartgwt.client.util.SC;
+import com.smartgwt.client.widgets.Canvas;
+import com.smartgwt.client.widgets.form.DynamicForm;
+import com.smartgwt.client.widgets.form.fields.ButtonItem;
+import com.smartgwt.client.widgets.form.fields.SelectItem;
+import com.smartgwt.client.widgets.form.fields.TextItem;
+import com.smartgwt.client.widgets.form.fields.events.ClickEvent;
+import com.smartgwt.client.widgets.form.fields.events.ClickHandler;
 
 import java.util.ArrayList;
 import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.MissingResourceException;
 
+import org.gwtopenmaps.openlayers.client.Bounds;
+import org.gwtopenmaps.openlayers.client.Map;
+
 public class MapPrintPanel extends Canvas {
 
     private static final String MAPFISH_MAPTITLE = "mapfish_mapTitle";
@@ -138,7 +136,7 @@
         this.pageCreator.setTitle(MSG.mapCreator());
         this.pageDatePlace.setTitle(MSG.mapDate());
 
-        pageTitle.setLength(30);
+        pageTitle.setLength(20);
         pageSubtitle.setLength(30);
         pageRange.setLength(30);
         pageStretch.setLength(30);
@@ -201,6 +199,7 @@
         ButtonItem btn = new ButtonItem();
         btn.addClickHandler(new ClickHandler() {
 
+            @Override
             public void onClick(ClickEvent event) {
                 updateCollection();
                 Window.open(createPrintUrl(), "_blank", "");
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedMultiPeriodPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedMultiPeriodPanel.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedMultiPeriodPanel.java	Tue Jun 11 09:40:56 2013 +0200
@@ -11,7 +11,7 @@
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.events.ResizedEvent;
 import com.smartgwt.client.widgets.events.ResizedHandler;
-import com.smartgwt.client.widgets.layout.VLayout;
+import com.smartgwt.client.widgets.layout.HLayout;
 
 import org.dive4elements.river.client.client.ui.MultiPeriodPanel;
 
@@ -28,7 +28,7 @@
     protected Canvas createHelper() {
         chartContainer1 = new BedCampaignChart(artifact, this);
         chartContainer2 = new BedloadCampaignChart(artifact, this);
-        VLayout layout = new VLayout();
+        HLayout layout = new HLayout();
         layout.addMember(chartContainer1);
         layout.addMember(chartContainer2);
         return layout;
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java	Tue Jun 11 09:40:56 2013 +0200
@@ -21,6 +21,7 @@
 import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
 
 import org.dive4elements.river.client.client.FLYS;
+import org.dive4elements.river.client.client.ui.WikiLinks;
 import org.dive4elements.river.client.shared.model.Data;
 import org.dive4elements.river.client.shared.model.DataItem;
 import org.dive4elements.river.client.shared.model.DataList;
@@ -44,6 +45,7 @@
         ListGridField stfield = new ListGridField("station", "Station [km]");
         ListGridField lfield = new ListGridField("link", "Info");
         lfield.setType(ListGridFieldType.LINK);
+        lfield.setCellFormatter(WikiLinks.cellFormatter(flys));
         ListGridField cfield = new ListGridField("curvelink", MSG.gauge_curve_link());
         cfield.addRecordClickHandler(this);
 
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugePanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugePanel.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugePanel.java	Tue Jun 11 09:40:56 2013 +0200
@@ -29,7 +29,7 @@
      * @param flys The FLYS object
      */
     public GaugePanel(FLYS flys) {
-        super(new GaugeListGrid(flys));
+        super(flys, new GaugeListGrid(flys));
     }
 
 
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/InfoPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/InfoPanel.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/InfoPanel.java	Tue Jun 11 09:40:56 2013 +0200
@@ -14,6 +14,7 @@
 import com.smartgwt.client.widgets.Canvas;
 import com.smartgwt.client.widgets.layout.SectionStackSection;
 import com.smartgwt.client.widgets.layout.VLayout;
+import org.dive4elements.river.client.client.FLYS;
 import org.dive4elements.river.client.client.FLYSConstants;
 import org.dive4elements.river.client.client.services.RiverInfoService;
 import org.dive4elements.river.client.client.services.RiverInfoServiceAsync;
@@ -26,6 +27,9 @@
  */
 public abstract class InfoPanel extends VLayout {
 
+    /** The instance of FLYS */
+    protected FLYS flys;
+
     /** SectionStackSection where this InfoPanel belongs in*/
     protected SectionStackSection section;
 
@@ -44,7 +48,7 @@
 
     public final static String SECTION_ID = "InfoPanelSection";
 
-    public InfoPanel(InfoListGrid listgrid) {
+    public InfoPanel(FLYS flys, InfoListGrid listgrid) {
         SectionStackSection section = new SectionStackSection();
         section.setExpanded(false);
         section.setTitle(getSectionTitle());
@@ -54,6 +58,8 @@
         setOverflow(Overflow.HIDDEN);
         setStyleName("infopanel");
 
+        this.flys = flys;
+
         section.setHidden(true);
         section.setItems(this);
         this.section = section;
@@ -80,7 +86,7 @@
 
     protected void render(RiverInfo riverinfo) {
         if (this.riverinfopanel == null) {
-            this.riverinfopanel = new RiverInfoPanel(riverinfo);
+            this.riverinfopanel = new RiverInfoPanel(this.flys, riverinfo);
 
             this.addMember(this.riverinfopanel, 0);
         }
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationListGrid.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationListGrid.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationListGrid.java	Tue Jun 11 09:40:56 2013 +0200
@@ -19,6 +19,7 @@
 import com.smartgwt.client.widgets.grid.events.RecordClickHandler;
 
 import org.dive4elements.river.client.client.FLYS;
+import org.dive4elements.river.client.client.ui.WikiLinks;
 import org.dive4elements.river.client.shared.model.MeasurementStation;
 import org.dive4elements.river.client.shared.model.RiverInfo;
 
@@ -40,6 +41,7 @@
         ListGridField stfield = new ListGridField("station", "Station [km]");
         ListGridField lfield = new ListGridField("link", "Link");
         lfield.setType(ListGridFieldType.LINK);
+        lfield.setCellFormatter(WikiLinks.cellFormatter(flys));
         ListGridField cfield = new ListGridField("curvelink", "SQ");
         cfield.addRecordClickHandler(this);
         this.setFields(nfield, sfield, efield, stfield, lfield, cfield);
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationPanel.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationPanel.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationPanel.java	Tue Jun 11 09:40:56 2013 +0200
@@ -27,7 +27,7 @@
      * @param flys The FLYS object
      */
     public MeasurementStationPanel(FLYS flys) {
-        super(new MeasurementStationListGrid(flys));
+        super(flys, new MeasurementStationListGrid(flys));
     }
 
     /**
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactDescriptionFactory.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactDescriptionFactory.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactDescriptionFactory.java	Tue Jun 11 09:40:56 2013 +0200
@@ -575,12 +575,15 @@
         Recommendation[] rec = new Recommendation[num];
 
         for (int i = 0; i < num; i++) {
-            Element e       = (Element) list.item(i);
-            String  factory = e.getAttribute("factory");
-            String  index   = e.getAttribute("ids");
+            Element e           = (Element) list.item(i);
+            String  factory     = e.getAttribute("factory");
+            String  index       = e.getAttribute("ids");
+            String  targetOut   = e.getAttribute("target_out");
 
             if (factory != null && factory.length() > 0) {
-                rec[i] = new Recommendation(factory, index);
+                logger.debug("Adding Recommendation. Factory: " + factory +
+                        " IDs: " + index + " target out " + targetOut);
+                rec[i] = new Recommendation(factory, index, null, null, targetOut);
             }
         }
 
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactHelper.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactHelper.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactHelper.java	Tue Jun 11 09:40:56 2013 +0200
@@ -71,20 +71,23 @@
         String         uuid;
         String         ids;
         CreationFilter filter;
+        String         targetOut;
 
         if (recommendation != null) {
-            uuid   = recommendation.getMasterArtifact();
-            ids    = recommendation.getIDs();
-            filter = convertFilter(recommendation.getFilter());
+            uuid      = recommendation.getMasterArtifact();
+            ids       = recommendation.getIDs();
+            filter    = convertFilter(recommendation.getFilter());
+            targetOut = recommendation.getTargetOut();
         }
         else {
-            uuid   = null;
-            ids    = null;
-            filter = null;
+            uuid      = null;
+            ids       = null;
+            filter    = null;
+            targetOut = null;
         }
 
         Document create = ClientProtocolUtils.newCreateDocument(
-            factory, uuid, ids, filter);
+            factory, uuid, ids, filter, targetOut);
 
         return sendCreate(serverUrl, locale, create);
 
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/server/CapabilitiesParser.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/CapabilitiesParser.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/CapabilitiesParser.java	Tue Jun 11 09:40:56 2013 +0200
@@ -8,8 +8,14 @@
 
 package org.dive4elements.river.client.server;
 
+import org.dive4elements.artifacts.common.utils.XMLUtils;
+import org.dive4elements.river.client.shared.exceptions.ServerException;
+import org.dive4elements.river.client.shared.model.Capabilities;
+import org.dive4elements.river.client.shared.model.ContactInformation;
+import org.dive4elements.river.client.shared.model.WMSLayer;
+
+import java.io.IOException;
 import java.io.InputStream;
-import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
 import java.net.URLConnection;
@@ -20,21 +26,15 @@
 
 import javax.xml.xpath.XPathConstants;
 
+import org.apache.log4j.Logger;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import org.apache.log4j.Logger;
-
-import org.dive4elements.artifacts.common.utils.XMLUtils;
-
-import org.dive4elements.river.client.shared.exceptions.ServerException;
-import org.dive4elements.river.client.shared.model.Capabilities;
-import org.dive4elements.river.client.shared.model.ContactInformation;
-import org.dive4elements.river.client.shared.model.WMSLayer;
-
-
+/**
+ * Parser for GetCapabilities of a WMS.
+ */
 public class CapabilitiesParser {
 
     private static final Logger logger =
@@ -96,6 +96,12 @@
     public static final String XPATH_LAYERS =
         "Capability/Layer";
 
+    public static final String XPATH_MAP_FORMAT =
+        "Capability/Request/GetMap/Format";
+
+    public static final String XPATH_GETMAP_ONLINERESOURCE =
+        "Capability/Request/GetMap/DCPType/HTTP/Get/OnlineResource/@href";
+
     public static final Pattern SRS_PATTERN = Pattern.compile("(EPSG:\\d+)*");
 
 
@@ -110,9 +116,14 @@
         LoggingConfigurator.init(log4jProperties);
 
         try {
-            Capabilities caps = getCapabilities(System.getProperty("test.wms"));
+            String wmsURL = System.getProperty("test.wms");
+            if (wmsURL == null || args.length > 0) {
+                wmsURL = args[0];
+            }
+            Capabilities caps = getCapabilities(wmsURL);
 
             logger.debug(caps.toString());
+            System.out.println(caps.toString());
         }
         catch (ServerException se) {
             se.printStackTrace();
@@ -204,7 +215,20 @@
             XPATH_LAYERS,
             XPathConstants.NODESET);
 
-        List<WMSLayer> layers = parseLayers(layerNodes, onlineResource);
+        String getMapOnlineResource = (String) XMLUtils.xpath(
+            capabilities,
+            XPATH_GETMAP_ONLINERESOURCE,
+            XPathConstants.STRING);
+
+        List<WMSLayer> layers = parseLayers(layerNodes, getMapOnlineResource);
+
+        // Parse MIME types of supported return types, e.g. image/jpeg
+        NodeList mapFormatNodes = (NodeList)
+                XMLUtils.xpath(capabilities, XPATH_MAP_FORMAT, XPathConstants.NODESET);
+        List<String> mapFormats = new ArrayList<String>();
+        for (int n = 0; n < mapFormatNodes.getLength(); n++) {
+            mapFormats.add(mapFormatNodes.item(n).getTextContent());
+        }
 
         return new Capabilities(
             title,
@@ -212,7 +236,8 @@
             ci,
             fees,
             accessConstraints,
-            layers);
+            layers,
+            mapFormats);
     }
 
 
@@ -327,6 +352,12 @@
 
         logger.debug("Found layer: " + title + "(" + name + ")");
 
+        boolean queryable = true;
+        Node queryableAttr = layerNode.getAttributes().getNamedItem("queryable");
+        if (queryableAttr != null && queryableAttr.getNodeValue().equals("0")) {
+            queryable = false;
+        }
+
         List<String> srs = parseSRS(layerNode);
 
         NodeList layersNodes = (NodeList) XMLUtils.xpath(
@@ -336,7 +367,7 @@
 
         List<WMSLayer> layers = parseLayers(layersNodes, onlineResource);
 
-        return new WMSLayer(onlineResource, title, name, srs, layers);
+        return new WMSLayer(onlineResource, title, name, srs, layers, queryable);
     }
 
 
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/server/CollectionHelper.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/CollectionHelper.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/CollectionHelper.java	Tue Jun 11 09:40:56 2013 +0200
@@ -403,6 +403,10 @@
     public static Collection parseCollection(Document description) {
         logger.debug("CollectionHelper.parseCollection");
 
+        if (logger.isDebugEnabled()) {
+            logger.debug(XMLUtils.toString(description));
+        }
+
         if (description == null) {
             logger.warn("The DESCRIBE of the Collection is null!");
             return null;
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java	Tue Jun 11 09:40:56 2013 +0200
@@ -52,9 +52,10 @@
         try {
             Document result = client.callService(url, "fileupload", request);
 
+            resp.setContentType("text/html");
+
             PrintWriter respWriter = resp.getWriter();
-            respWriter.write("<html><link href='FLYS.css' rel='stylesheet' type='text/css'>");
-            respWriter.write("<body><div style='font-face: Arial,Verdana,sans-serif; font-size: 11px'>");
+            respWriter.write("<html><body><div style='font-face: Arial,Verdana,sans-serif; font-size: 11px'>");
 
             if (result == null) {
                 logger.warn("FileUpload service returned no result.");
@@ -81,7 +82,7 @@
 
 
     protected Document createFileXML(HttpServletRequest req) {
-           ServletFileUpload upload = new ServletFileUpload();
+        ServletFileUpload upload = new ServletFileUpload();
 
         try{
             FileItemIterator iter = upload.getItemIterator(req);
@@ -92,14 +93,18 @@
 
                 // Process the input stream
                 ByteArrayOutputStream out = new ByteArrayOutputStream();
-                int len;
+                int len, cnt = 0;
                 byte[] buffer = new byte[stream.available()];
                 while ((len = stream.read(buffer, 0, buffer.length)) != -1) {
                     out.write(buffer, 0, len);
+                    cnt += len;
                 }
 
-                buffer = Base64.encodeBase64(buffer);
+                buffer = Base64.encodeBase64(out.toByteArray());
                 String b64File = new String(buffer);
+                logger.debug("FileUploadServiceImpl.createFileXML(): " + cnt
+                        + "/" + b64File.length()
+                        + " bytes (orig/base64) file to be uploaded");
 
                 Document fileDoc = XMLUtils.newDocument();
 
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/server/GGInATrustStrategy.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/GGInATrustStrategy.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/GGInATrustStrategy.java	Tue Jun 11 09:40:56 2013 +0200
@@ -16,7 +16,7 @@
 public class GGInATrustStrategy implements TrustStrategy {
 
     /**
-     * Tempoary class to accept all certificates for GGinA Authentication
+     * Temporary class to accept all certificates for GGinA Authentication.
      */
 
     @Override
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/server/SamlServlet.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/SamlServlet.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/SamlServlet.java	Tue Jun 11 09:40:56 2013 +0200
@@ -37,7 +37,7 @@
     throws ServletException, IOException
     {
         String encoding = req.getCharacterEncoding();
-        String samlTicketXML = req.getParameter("samlTicket");
+        String samlTicketXML = req.getParameter("saml");
 
         logger.debug("Processing post request");
 
@@ -86,6 +86,7 @@
 
         Features features = (Features)sc.getAttribute(Features.CONTEXT_ATTRIBUTE);
         return new org.dive4elements.river.client.server.auth.saml.User(
-            assertion, features.getFeatures(assertion.getRoles()), null);
+            assertion, samlTicketXML,
+            features.getFeatures(assertion.getRoles()), null);
     }
 }
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/server/UserServiceImpl.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/UserServiceImpl.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/UserServiceImpl.java	Tue Jun 11 09:40:56 2013 +0200
@@ -60,7 +60,8 @@
                 String name = user.getAttributeNS(
                         ArtifactNamespaceContext.NAMESPACE_URI, "name");
 
-                return new DefaultUser(uuid, name);
+                return new DefaultUser(uuid, name,
+                                       loginuser.getSamlXMLBase64());
             }
         }
         catch (ConnectionException ce) {
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/server/auth/DefaultUser.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/DefaultUser.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/DefaultUser.java	Tue Jun 11 09:40:56 2013 +0200
@@ -16,6 +16,7 @@
     protected String  name;
     protected String  account;
     protected String  password;
+    protected String  samlXML;
     protected boolean expired;
     protected List<String> roles;
     protected List<String> features;
@@ -26,12 +27,14 @@
     public DefaultUser(
         String       name,
         String       password,
+        String       samlXML,
         boolean      expired,
         List<String> roles,
         List<String> features
     ) {
         this.name     = name;
         this.password = password;
+        this.samlXML  = samlXML;
         this.expired  = expired;
         this.roles    = roles;
         this.features = features;
@@ -92,5 +95,14 @@
     public void setAccount(String account) {
         this.account = account;
     }
+
+    @Override
+    public String getSamlXMLBase64() {
+        return this.samlXML;
+    }
+
+    public void setSamlXMLBase64(String samlXML) {
+        this.samlXML = samlXML;
+    }
 }
 // vim:set ts=4 sw=4 si et fenc=utf8 tw=80:
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/server/auth/User.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/User.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/User.java	Tue Jun 11 09:40:56 2013 +0200
@@ -46,5 +46,12 @@
      * Returns the users account name
      */
     public String getAccount();
+
+    /**
+     * Returns the SAML ticket for single sign-on.
+     * @return The SAML ticket in base64 encoded XML. null if no ticket
+     * is available.
+     */
+    public String getSamlXMLBase64();
 }
 // vim:set ts=4 sw=4 si et fenc=utf8 tw=80:
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/server/auth/plain/Authenticator.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/plain/Authenticator.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/plain/Authenticator.java	Tue Jun 11 09:40:56 2013 +0200
@@ -63,7 +63,7 @@
         @Override
         public User getUser() {
             return isSuccess()
-                ? new DefaultUser(user, password, false, roles, this.features.getFeatures(roles))
+                ? new DefaultUser(user, password, null, false, roles, this.features.getFeatures(roles))
                 : null;
         }
     } // class Authentication
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/server/auth/saml/User.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/saml/User.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/saml/User.java	Tue Jun 11 09:40:56 2013 +0200
@@ -18,11 +18,13 @@
 
     private Assertion assertion;
 
-    public User(Assertion assertion, List<String> features, String password) {
+    public User(Assertion assertion, String samlXML, List<String> features,
+                String password) {
         this.setName(assertion.getNameID());
         this.setAccount(assertion.getNameID());
         this.setRoles(assertion.getRoles());
         this.assertion = assertion;
+        this.setSamlXMLBase64(samlXML);
         this.setAllowedFeatures(features);
         this.setPassword(password);
     }
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/Response.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/Response.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/Response.java	Tue Jun 11 09:40:56 2013 +0200
@@ -10,11 +10,13 @@
 
 import java.io.IOException;
 import java.io.InputStream;
+import java.io.StringBufferInputStream;
 import java.util.List;
 
 import org.apache.commons.codec.binary.Base64InputStream;
 
 import org.apache.http.HttpEntity;
+import org.apache.http.util.EntityUtils;
 
 import org.apache.log4j.Logger;
 
@@ -37,6 +39,7 @@
     private static Logger logger = Logger.getLogger(Response.class);
 
     private Element root;
+    private String samlTicketXML;
     private Assertion assertion;
     private String username;
     private String password;
@@ -53,8 +56,9 @@
         }
 
         String contenttype = entity.getContentType().getValue();
+        String samlTicketXML = EntityUtils.toString(entity);
 
-        InputStream in = entity.getContent();
+        InputStream in = new StringBufferInputStream(samlTicketXML);
 
         if (!contenttype.equals("application/vnd.ogc.se_xml")) {
             // XXX: Assume base64 encoded content.
@@ -70,6 +74,7 @@
                                                           "ServiceException"));
         }
 
+        this.samlTicketXML = samlTicketXML;
         this.root = root;
         this.username = username;
         this.password = password;
@@ -113,7 +118,7 @@
                 this.assertion.getRoles());
         logger.debug("User " + this.username + " with features " + features +
                      " successfully authenticated.");
-        return new User(assertion, features, this.password);
+        return new User(assertion, this.samlTicketXML, features, this.password);
     }
 }
 // vim: set si et fileencoding=utf-8 ts=4 sw=4 tw=80:
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/shared/model/Capabilities.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/Capabilities.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/Capabilities.java	Tue Jun 11 09:40:56 2013 +0200
@@ -12,7 +12,9 @@
 import java.util.ArrayList;
 import java.util.List;
 
-
+/**
+ * Capabilities of a WMS.
+ */
 public class Capabilities implements Serializable {
 
     protected String title;
@@ -23,6 +25,7 @@
     protected ContactInformation contactInformation;
 
     protected List<WMSLayer> layers;
+    protected List<String> mapFormats;
 
 
     public Capabilities() {
@@ -41,7 +44,8 @@
         ContactInformation contactInformation,
         String             fees,
         String             accessConstraints,
-        List<WMSLayer>     layers
+        List<WMSLayer>     layers,
+        List<String>       mapFormats
     ) {
         this.title              = title;
         this.onlineResource     = onlineResource;
@@ -49,6 +53,7 @@
         this.fees               = fees;
         this.accessConstraints  = accessConstraints;
         this.layers             = layers;
+        this.mapFormats         = mapFormats;
     }
 
 
@@ -82,6 +87,11 @@
     }
 
 
+    public List<String> getMapFormats() {
+        return mapFormats;
+    }
+
+
     @Override
     public String toString() {
         StringBuilder sb = new StringBuilder();
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultUser.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultUser.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultUser.java	Tue Jun 11 09:40:56 2013 +0200
@@ -22,6 +22,8 @@
     /** The name of the user.*/
     protected String name;
 
+    /** The saml ticket used for single sign-on.*/
+    protected String samlXML;
 
     /**
      * The default constructor.
@@ -36,9 +38,10 @@
      * @param identifier The uuid of the user.
      * @param name The name of the user.
      */
-    public DefaultUser(String identifier, String name) {
+    public DefaultUser(String identifier, String name, String samlXML) {
         this.identifier = identifier;
         this.name       = name;
+        this.samlXML    = samlXML;
     }
 
 
@@ -63,6 +66,16 @@
 
 
     /**
+     * Returns the SAML ticket for single sign-on.
+     *
+     * @return the SAML ticket as base64 encoded XML
+     */
+    public String getSamlXMLBase64() {
+        return samlXML;
+    }
+
+
+    /**
      * Set the identifier of the user.
      *
      * @param identifier The new identifier.
@@ -80,5 +93,14 @@
     public void setName(String name) {
         this.name = name;
     }
+
+    /**
+     * Set the SAML Ticket for single sign-on.
+     *
+     * @param samlXML the SAML ticket as base64 encoded XML.
+     */
+    public void setSamlXMLBase64(String samlXML) {
+        this.samlXML = samlXML;
+    }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/shared/model/Recommendation.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/Recommendation.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/Recommendation.java	Tue Jun 11 09:40:56 2013 +0200
@@ -117,6 +117,9 @@
     protected String masterArtifact;
     /** Optional facet filter. */
     protected Filter filter;
+    /** The out this Artifact should be added to **/
+    protected String targetOut;
+
     protected String displayName = null;
 
     public Recommendation() {
@@ -126,16 +129,39 @@
         this(factory, ids, null, null);
     }
 
+    public Recommendation(String factory, String ids, String targetOut) {
+        this(factory, ids, null, null, targetOut);
+    }
+
     public Recommendation(
         String factory,
         String ids,
         String masterArtifact,
         Filter filter
     ) {
+        this(factory, ids, masterArtifact, filter, null);
+    }
+
+    public Recommendation(
+        String factory,
+        String ids,
+        String masterArtifact,
+        Filter filter,
+        String targetOut
+    ) {
         this.factory        = factory;
         this.ids            = ids;
         this.masterArtifact = masterArtifact;
         this.filter         = filter;
+        this.targetOut      = targetOut;
+    }
+
+    public String getTargetOut() {
+        return targetOut;
+    }
+
+    public void setTargetOut(String value) {
+        targetOut = value;
     }
 
     public String getFactory() {
@@ -190,6 +216,9 @@
         hash += (getMasterArtifact() != null)
             ? getMasterArtifact().hashCode()
             : 0;
+        hash += (getTargetOut() != null)
+            ? getTargetOut().hashCode()
+            : 0;
         return hash;
     }
 
@@ -221,7 +250,8 @@
         return (same(this.getFactory(), rec.getFactory()))
             && (same(this.getIDs(),     rec.getIDs()))
             && (same(this.getFilter(),  rec.getFilter()))
-            && (same(this.getMasterArtifact(), rec.getMasterArtifact()));
+            && (same(this.getMasterArtifact(), rec.getMasterArtifact()))
+            && (same(this.getTargetOut(), rec.getTargetOut()));
     }
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ToLoad.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ToLoad.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ToLoad.java	Tue Jun 11 09:40:56 2013 +0200
@@ -15,6 +15,8 @@
 
 import java.io.Serializable;
 
+import com.google.gwt.core.client.GWT;
+
 public class ToLoad implements Serializable
 {
 
@@ -49,6 +51,16 @@
         }
         return key;
     }
+   public void add(
+        String artifactName,
+        String factory,
+        String out,
+        String name,
+        String ids,
+        String displayName
+    ) {
+       add(artifactName, factory, out, name, ids, displayName, null);
+    }
 
     public void add(
         String artifactName,
@@ -56,8 +68,13 @@
         String out,
         String name,
         String ids,
-        String displayName
+        String displayName,
+        String targetOut
     ) {
+        GWT.log("Adding artifact: " + artifactName + " Factory: " + factory +
+                " Out: " + out + " Name: " + name + " Ids: " + ids +
+                " Display Name: " + displayName + " Target Out: " + targetOut);
+
         if (artifactName == null) {
             artifactName = uniqueKey(artifacts);
         }
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/shared/model/User.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/User.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/User.java	Tue Jun 11 09:40:56 2013 +0200
@@ -17,8 +17,12 @@
 
     String getName();
 
+    String getSamlXMLBase64();
+
     void setName(String name);
 
     void setIdentifier(String identifier);
+
+    void setSamlXMLBase64(String samlXml);
 }
 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WMSLayer.java
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WMSLayer.java	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/WMSLayer.java	Tue Jun 11 09:40:56 2013 +0200
@@ -22,6 +22,8 @@
     protected List<String>   srs;
     protected List<WMSLayer> layers;
 
+    protected boolean queryable = true;
+
 
     public WMSLayer() {
         layers = new ArrayList<WMSLayer>();
@@ -39,13 +41,15 @@
         String         title,
         String         name,
         List<String>   srs,
-        List<WMSLayer> layers
+        List<WMSLayer> layers,
+        boolean        queryable
     ) {
-        this.server = server;
-        this.title  = title;
-        this.name   = name;
-        this.srs    = srs;
-        this.layers = layers;
+        this.server    = server;
+        this.title     = title;
+        this.name      = name;
+        this.srs       = srs;
+        this.layers    = layers;
+        this.queryable = queryable;
     }
 
 
@@ -74,6 +78,11 @@
     }
 
 
+    public boolean isQueryable() {
+        return queryable;
+    }
+
+
     public boolean supportsSrs(String srs) {
         if (this.srs == null || this.srs.size() == 0) {
             return true;
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/webapp/WEB-INF/config.yaml
--- a/gwt-client/src/main/webapp/WEB-INF/config.yaml	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/webapp/WEB-INF/config.yaml	Tue Jun 11 09:40:56 2013 +0200
@@ -183,7 +183,7 @@
               url: '${configDir}/../${logo}'
         # Scalebar
         - !columns
-          absoluteX: 460
+          absoluteX: 455
           absoluteY: 40
           width: 150
           items:
@@ -197,11 +197,11 @@
         # The legend
         - !columns
           absoluteX: 612
-          absoluteY: 390
+          absoluteY: 385
           width: 200
           items:
             - !legends
-              maxHeight: 310
+              maxHeight: 350
               maxWidth: 0
               maxIconHeight: 0
               inline: true
@@ -213,7 +213,7 @@
               fontEncoding: Identity-H
               classFont: FreeSans
               layerFont: FreeSans
-              defaultScale: 0.5
+              defaultScale: 0.7
           config:
             borderWidthLeft: 1
             borderWidthRight: 1
@@ -227,7 +227,7 @@
           items:
             - !image
               maxWidth: 260
-              maxHeight: 184
+              maxHeight: 190
               url: '${configDir}/../images/white.png'
 
         # Title of the map
@@ -238,21 +238,16 @@
           condition: mapTitle
           items:
             - !text
+              fontSize: 18
               text: '${mapTitle}'
 
         # The Stamp
         - !columns
           absoluteX: 562
-          absoluteY: 555
+          absoluteY: 550
           width: 250
-        #  config:
-        #    borderWidthLeft: 5
-        #    borderWidthRight: 5
-        #    borderWidthTop: 5
-        #    borderWidthBottom: 5
-            #padding: 10
-            #backgroundColor: #FFFFFF
-            #borderColor: #FFFFFF
+          config:
+            borderWidth: 1
           items:
             - !attributes
               source: data
@@ -266,7 +261,7 @@
                   cell: !columns
                     config:
                       cells:
-                        - borderWidth: 1
+                        - borderWidth: 0.5
                           padding: 5
                     items:
                       - !text
@@ -284,7 +279,7 @@
                   cell: !columns
                     config:
                       cells:
-                        - borderWidth: 1
+                        - borderWidth: 0.5
                           padding: 5
                     items:
                       - !text
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html
--- a/gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html	Wed Jun 05 11:56:38 2013 +0200
+++ b/gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html	Tue Jun 11 09:40:56 2013 +0200
@@ -2,25 +2,39 @@
   <head>
     <script type="text/javascript">
       var highlighted = "";
+      function stripRiver(name) {
+        var module = getModule();
+        if (module === 'fixanalysis') {
+          if (name.contains('Donau') ||
+              name.contains('Main') ||
+              name.contains('Neckar')) {
+            return name.split(' ')[0];
+          }
+        }
+        return name;
+      }
       function highlight(name){
         unHighlight(highlighted);
         var river;
+        name = stripRiver(name);
         if (availableRiver(name)) {
-          console.log('highlighting ' + name);
           river = document.getElementById(name);
         }
         else {
-          console.log('not available' + name);
           river = document.getElementById(name + "_inactive");
         }
         if (river) {
           highlighted = name;
-          highlightRiver(name);
           river.style.visibility="visible";
         }
       }
+      function highlightList(name) {
+        name = stripRiver(name);
+        highlightRiver(name);
+      }
       function unHighlight(name) {
         var river;
+        name = stripRiver(name);
         if (availableRiver(name)) {
           river = document.getElementById(name);
         }
@@ -31,6 +45,10 @@
           river.style.visibility="hidden";
         }
       }
+      function unHighlightList(name) {
+        name = stripRiver(name);
+        unHighlightRiver(name);
+      }
     </script>
   </head>
   <body>
@@ -41,30 +59,30 @@
 
         <!--FLYS_Karte.map-->
         <!-- mit daten -->
-        <area id="donau_area" shape="poly" onmouseover="highlight('Donau')" onmouseout="unHighlight('Donau')" onclick="selectRiver('Donau')" coords="226,668,276,668,277,646,385,578,433,576,431,587,458,604,429,620,396,634,363,658,305,681,230,691" />
-        <area id="donau_Ende_area" shape="poly" onmouseover="highlight('Donau')" onmouseout="unHighlight('Donau')" onclick="selectRiver('Donau')" coords="482,551,505,534,559,530,560,574,639,621,639,659,562,646,561,631,589,595,557,579,525,589,490,573" />
-        <area id="donau_nordarm_area" shape="poly" onmouseover="highlight('Donau (Regensburg Nordarm)')" onmouseout="unHighlight('Donau (Regensburg Nordarm)')" onclick="selectRiver('Donau (Regensburg Nordarm)')" coords="437,567,432,587,454,600,478,596,467,570,491,542,443,534,441,556" />
-        <area id="donau_schleusen_area" shape="poly" onmouseover="highlight('Donau (Schleusenkanäle)')" onmouseout="unHighlight('Donau (Schleusenkanäle)')" onclick="selectRiver('Donau (Schleusenkanäle)')" coords="467,569,482,552,490,573,526,589,559,579,589,596,561,631,557,614,522,618,504,600,477,594" />
-        <area id="elbe_area" shape="poly" onmouseover="highlight('Elbe')" onmouseout="unHighlight('Elbe')" onclick="selectRiver('Elbe')" coords="271,131,261,147,345,191,337,243,388,243,418,238,395,284,412,310,446,315,454,329,514,397,550,447,580,451,593,461,593,466,629,489,643,470,639,444,596,392,575,360,573,327,509,293,462,289,444,229,448,219,298,131" />
-        <area id="fulda_sommer_area" shape="poly" onmouseover="highlight('Fulda (Sommer)')" onmouseout="unHighlight('Fulda (Sommer)')" onclick="selectRiver('Fulda (Sommer)')" coords="315,363,307,371,307,381,313,386,310,393,322,402,322,414,312,425,305,437,338,436,350,410,334,399,326,389" />
-        <area id="fulda_winter_area" shape="poly" onmouseover="highlight('Fulda (Winter)')" onmouseout="unHighlight('Fulda (Winter)')" onclick="selectRiver('Fulda (Winter)')" coords="315,362,307,370,307,380,313,385,310,392,315,397,322,401,322,413,313,423,305,436,279,434,262,411,260,395,275,375,299,357" />
-        <area id="havel_area" shape="poly" onmouseover="highlight('Havel')" onmouseout="unHighlight('Havel')" onclick="selectRiver('Havel')" coords="444,230,462,288,519,270,533,217,519,177,491,189,458,202" />
-        <area id="lahn_area" shape="poly" onmouseover="highlight('Lahn')" onmouseout="unHighlight('Lahn')" onclick="selectRiver('Lahn')" coords="195,464,197,450,186,413,262,411,285,442,270,459,217,472" />
-        <area id="main_area" shape="poly" onmouseover="highlight('Main')" onmouseout="unHighlight('Main')" onclick="selectRiver('Main')" coords="240,492,240,466,303,462,335,445,375,444,454,469,468,501,394,500,381,480,350,480,337,493,344,541,308,529,272,524,269,504" />
-        <area id="main_limbach_area" shape="poly" onmouseover="highlight('Main (Wehrarm Limbach)')" onmouseout="unHighlight('Main (Wehrarm Limbach)')" onclick="selectRiver('Main (Wehrarm Limbach)')" coords="360,480,381,480,393,500,383,519,368,520" />
-        <area id="main_volkach_area" shape="poly" onmouseover="highlight('Main (Wehrarm Volkach)')" onmouseout="unHighlight('Main (Wehrarm Volkach)')" onclick="selectRiver('Main (Wehrarm Volkach)')" coords="350,480,360,480,368,522,343,541,337,493" />
-        <area id="mosel_area" shape="poly" onmouseover="highlight('Mosel')" onmouseout="unHighlight('Mosel')" onclick="selectRiver('Mosel')" coords="190,467,170,461,138,453,102,466,103,494,98,537,86,600,125,604,149,583,130,543,140,518,162,515,194,511" />
-        <area id="neckar_area" shape="poly" onmouseover="highlight('Neckar')" onmouseout="unHighlight('Neckar')" onclick="selectRiver('Neckar')" coords="231,641,253,653,288,640,386,577,357,559,342,541,319,540,292,547,290,583,308,590,306,615,250,604,226,630" />
-        <area id="neckar_wehrarm_area" shape="poly" onmouseover="highlight('Neckar (über Wehrarme)')" onmouseout="unHighlight('Neckar (über Wehrarme)')" onclick="selectRiver('Neckar (über Wehrarme)')" coords="272,524,248,540,253,561,259,570,254,605,306,615,308,590,290,583,292,546,320,540,309,529" />
-        <area id="oder_area" shape="poly" onmouseover="highlight('Oder')" onmouseout="unHighlight('Oder')" onclick="selectRiver('Oder')" coords="572,143,542,155,542,178,529,203,541,238,565,252,583,273,570,307,603,327,641,320,639,286,633,275,614,269,619,246,635,236,637,195,606,160" />
-        <area id="rhein_area" shape="poly" onmouseover="highlight('Rhein')" onmouseout="unHighlight('Rhein')" onclick="selectRiver('Rhein')" coords="86,301,138,317,157,334,153,355,177,381,185,407,198,450,197,464,219,471,224,478,240,473,241,492,269,502,273,523,249,539,254,561,260,570,256,597,227,628,229,639,252,653,277,644,279,668,236,670,237,690,265,687,281,696,283,717,248,728,188,737,170,718,167,669,203,569,222,545,213,521,195,521,193,467,171,459,145,444,122,403,49,391,52,352,23,344,4,304" />
-        <area id="saale_area" shape="poly" onmouseover="highlight('Saale')" onmouseout="unHighlight('Saale')" onclick="selectRiver('Saale')" coords="445,314,414,311,366,299,366,342,395,346,404,356,424,358,477,354,463,341" />
-        <area id="saale_thüringen_area" shape="poly" onmouseover="highlight('Saale-Thüringen')" onmouseout="unHighlight('Saale-Thüringen')" onclick="selectRiver('Saale-Thüringen')" coords="424,358,476,354,490,384,430,461,375,444,387,415,402,408,420,387,435,383" />
-        <area id="saar_area" shape="poly" onmouseover="highlight('Saar')" onmouseout="unHighlight('Saar')" onclick="selectRiver('Saar')" coords="150,539,129,544,139,564,155,588,181,593,187,565,201,536,195,526,195,512,154,516" />
-        <area id="saar_wittingerbogen_area" shape="poly" onmouseover="highlight('Saar (Wiltinger Bogen)')" onmouseout="unHighlight('Saar (Wiltinger Bogen)')" onclick="selectRiver('Saar (Wiltinger Bogen)')" coords="139,518,155,516,149,540,130,542" />
-        <area id="werra_sommer_area" shape="poly" onmouseover="highlight('Werra (Sommer)')" onmouseout="unHighlight('Werra (Sommer)')" onclick="selectRiver('Werra (Sommer)')" coords="316,361,334,351,360,342,387,345,398,354,384,372,381,389,371,400,350,390,345,382,336,378,334,372,329,368" />
-        <area id="werra_winter_area" shape="poly" onmouseover="highlight('Werra (Winter)')" onmouseout="unHighlight('Werra (Winter)')" onclick="selectRiver('Werra (Winter)')" coords="315,362,326,388,334,398,350,409,370,400,353,391,347,388,346,385,344,382,335,378,333,372,329,368" />
-        <area id="weser_area" shape="poly" onmouseover="highlight('Weser')" onmouseout="unHighlight('Weser')" onclick="selectRiver('Weser')" coords="255,166,227,172,232,227,268,237,241,279,246,298,247,313,275,313,282,330,289,353,314,363,332,351,318,328,316,308,299,280,303,255,300,217,263,203,273,176" />
+        <area id="donau_area" shape="poly" onmouseover="highlight('Donau'); highlightList('Donau')" onmouseout="unHighlight('Donau'); unHighlightList('Donau')" onclick="selectRiver('Donau')" coords="226,668,276,668,277,646,385,578,433,576,431,587,458,604,429,620,396,634,363,658,305,681,230,691" />
+        <area id="donau_Ende_area" shape="poly" onmouseover="highlight('Donau'); highlightList('Donau')" onmouseout="unHighlight('Donau'); unHighlightList('Donau')" onclick="selectRiver('Donau')" coords="482,551,505,534,559,530,560,574,639,621,639,659,562,646,561,631,589,595,557,579,525,589,490,573" />
+        <area id="donau_nordarm_area" shape="poly" onmouseover="highlight('Donau (Regensburg Nordarm)'); highlightList('Donau (Regensburg Nordarm)')" onmouseout="unHighlight('Donau (Regensburg Nordarm)'); unHighlightList('Donau (Regensburg Nordarm)')" onclick="selectRiver('Donau (Regensburg Nordarm)')" coords="437,567,432,587,454,600,478,596,467,570,491,542,443,534,441,556" />
+        <area id="donau_schleusen_area" shape="poly" onmouseover="highlight('Donau (Schleusenkanäle)'); highlightList('Donau (Schleusenkanäle)')" onmouseout="unHighlight('Donau (Schleusenkanäle)'); unHighlightList('Donau (Schleusenkanäle)')" onclick="selectRiver('Donau (Schleusenkanäle)')" coords="467,569,482,552,490,573,526,589,559,579,589,596,561,631,557,614,522,618,504,600,477,594" />
+        <area id="elbe_area" shape="poly" onmouseover="highlight('Elbe'); highlightList('Elbe')" onmouseout="unHighlight('Elbe'); unHighlightList('Elbe')" onclick="selectRiver('Elbe')" coords="271,131,261,147,345,191,337,243,388,243,418,238,395,284,412,310,446,315,454,329,514,397,550,447,580,451,593,461,593,466,629,489,643,470,639,444,596,392,575,360,573,327,509,293,462,289,444,229,448,219,298,131" />
+        <area id="fulda_sommer_area" shape="poly" onmouseover="highlight('Fulda (Sommer)'); highlightList('Fulda (Sommer)')" onmouseout="unHighlight('Fulda (Sommer)'); unHighlightList('Fulda (Sommer)')" onclick="selectRiver('Fulda (Sommer)')" coords="315,363,307,371,307,381,313,386,310,393,322,402,322,414,312,425,305,437,338,436,350,410,334,399,326,389" />
+        <area id="fulda_winter_area" shape="poly" onmouseover="highlight('Fulda (Winter)'); highlightList('Fulda (Winter)')" onmouseout="unHighlight('Fulda (Winter)'); unHighlightList('Fulda (Winter)')" onclick="selectRiver('Fulda (Winter)')" coords="315,362,307,370,307,380,313,385,310,392,315,397,322,401,322,413,313,423,305,436,279,434,262,411,260,395,275,375,299,357" />
+        <area id="havel_area" shape="poly" onmouseover="highlight('Havel'); highlightList('Havel')" onmouseout="unHighlight('Havel'); unHighlightList('Havel')" onclick="selectRiver('Havel')" coords="444,230,462,288,519,270,533,217,519,177,491,189,458,202" />
+        <area id="lahn_area" shape="poly" onmouseover="highlight('Lahn'); highlightList('Lahn')" onmouseout="unHighlight('Lahn'); unHighlightList('Lahn')" onclick="selectRiver('Lahn')" coords="195,464,197,450,186,413,262,411,285,442,270,459,217,472" />
+        <area id="main_area" shape="poly" onmouseover="highlight('Main'); highlightList('Main')" onmouseout="unHighlight('Main'); unHighlightList('Main')" onclick="selectRiver('Main')" coords="240,492,240,466,303,462,335,445,375,444,454,469,468,501,394,500,381,480,350,480,337,493,344,541,308,529,272,524,269,504" />
+        <area id="main_limbach_area" shape="poly" onmouseover="highlight('Main (Wehrarm Limbach)'); highlightList('Main (Wehrarm Limbach)')" onmouseout="unHighlight('Main (Wehrarm Limbach)'); unHighlightList('Main (Wehrarm Limbach)')" onclick="selectRiver('Main (Wehrarm Limbach)')" coords="360,480,381,480,393,500,383,519,368,520" />
+        <area id="main_volkach_area" shape="poly" onmouseover="highlight('Main (Wehrarm Volkach)'); highlightList('Main (Wehrarm Volkach)')" onmouseout="unHighlight('Main (Wehrarm Volkach)'); unHighlightList('Main (Wehrarm Volkach)')" onclick="selectRiver('Main (Wehrarm Volkach)')" coords="350,480,360,480,368,522,343,541,337,493" />
+        <area id="mosel_area" shape="poly" onmouseover="highlight('Mosel'); highlightList('Mosel')" onmouseout="unHighlight('Mosel'); unHighlightList('Mosel')" onclick="selectRiver('Mosel')" coords="190,467,170,461,138,453,102,466,103,494,98,537,86,600,125,604,149,583,130,543,140,518,162,515,194,511" />
+        <area id="neckar_area" shape="poly" onmouseover="highlight('Neckar'); highlightList('Neckar')" onmouseout="unHighlight('Neckar'); unHighlightList('Neckar')" onclick="selectRiver('Neckar')" coords="231,641,253,653,288,640,386,577,357,559,342,541,319,540,292,547,290,583,308,590,306,615,250,604,226,630" />
+        <area id="neckar_wehrarm_area" shape="poly" onmouseover="highlight('Neckar (über Wehrarme)'); highlightList('Neckar (über Wehrarme)')" onmouseout="unHighlight('Neckar (über Wehrarme)'); unHighlightList('Neckar (über Wehrarme)')" onclick="selectRiver('Neckar (über Wehrarme)')" coords="272,524,248,540,253,561,259,570,254,605,306,615,308,590,290,583,292,546,320,540,309,529" />
+        <area id="oder_area" shape="poly" onmouseover="highlight('Oder'); highlightList('Oder')" onmouseout="unHighlight('Oder'); unHighlightList('Oder')" onclick="selectRiver('Oder')" coords="572,143,542,155,542,178,529,203,541,238,565,252,583,273,570,307,603,327,641,320,639,286,633,275,614,269,619,246,635,236,637,195,606,160" />
+        <area id="rhein_area" shape="poly" onmouseover="highlight('Rhein'); highlightList('Rhein')" onmouseout="unHighlight('Rhein'); unHighlightList('Rhein')" onclick="selectRiver('Rhein')" coords="86,301,138,317,157,334,153,355,177,381,185,407,198,450,197,464,219,471,224,478,240,473,241,492,269,502,273,523,249,539,254,561,260,570,256,597,227,628,229,639,252,653,277,644,279,668,236,670,237,690,265,687,281,696,283,717,248,728,188,737,170,718,167,669,203,569,222,545,213,521,195,521,193,467,171,459,145,444,122,403,49,391,52,352,23,344,4,304" />
+        <area id="saale_area" shape="poly" onmouseover="highlight('Saale'); highlightList('Saale')" onmouseout="unHighlight('Saale'); unHighlightList('Saale')" onclick="selectRiver('Saale')" coords="445,314,414,311,366,299,366,342,395,346,404,356,424,358,477,354,463,341" />
+        <area id="saale_thüringen_area" shape="poly" onmouseover="highlight('Saale-Thüringen'); highlightList('Saale-Thüringen')" onmouseout="unHighlight('Saale-Thüringen'); unHighlightList('Saale-Thüringen')" onclick="selectRiver('Saale-Thüringen')" coords="424,358,476,354,490,384,430,461,375,444,387,415,402,408,420,387,435,383" />
+        <area id="saar_area" shape="poly" onmouseover="highlight('Saar'); highlightList('Saar')" onmouseout="unHighlight('Saar'); unHighlightList('Saar')" onclick="selectRiver('Saar')" coords="150,539,129,544,139,564,155,588,181,593,187,565,201,536,195,526,195,512,154,516" />
+        <area id="saar_wittingerbogen_area" shape="poly" onmouseover="highlight('Saar (Wiltinger Bogen)'); highlightList('Saar (Wiltinger Bogen)')" onmouseout="unHighlight('Saar (Wiltinger Bogen)'); unHighlightList('Saar (Wiltinger Bogen)')" onclick="selectRiver('Saar (Wiltinger Bogen)')" coords="139,518,155,516,149,540,130,542" />
+        <area id="werra_sommer_area" shape="poly" onmouseover="highlight('Werra (Sommer)'); highlightList('Werra (Sommer)')" onmouseout="unHighlight('Werra (Sommer)'); unHighlightList('Werra (Sommer)')" onclick="selectRiver('Werra (Sommer)')" coords="316,361,334,351,360,342,387,345,398,354,384,372,381,389,371,400,350,390,345,382,336,378,334,372,329,368" />
+        <area id="werra_winter_area" shape="poly" onmouseover="highlight('Werra (Winter)'); highlightList('Werra (Winter)')" onmouseout="unHighlight('Werra (Winter)'); unHighlightList('Werra (Winter)')" onclick="selectRiver('Werra (Winter)')" coords="315,362,326,388,334,398,350,409,370,400,353,391,347,388,346,385,344,382,335,378,333,372,329,368" />
+        <area id="weser_area" shape="poly" onmouseover="highlight('Weser'); highlightList('Weser')" onmouseout="unHighlight('Weser'); unHighlightList('Weser')" onclick="selectRiver('Weser')" coords="255,166,227,172,232,227,268,237,241,279,246,298,247,313,275,313,282,330,289,353,314,363,332,351,318,328,316,308,299,280,303,255,300,217,263,203,273,176" />
         <!-- ohne daten -->
         <area id="donau_1_area" shape="poly" onmouseover="highlight('Donau_1')" onmouseout="unHighlight('Donau_1')" onclick="selectRiver('Donau_1')" coords="346,639,316,672,334,750,379,750,374,735,369,715,370,696,372,664,365,648" />
         <area id="donau_2_area" shape="poly" onmouseover="highlight('Donau_2')" onmouseout="unHighlight('Donau_2')" onclick="selectRiver('Donau_2')" coords="394,615,370,655,373,670,370,721,380,749,409,741,403,706,413,682,412,644,416,623" />
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/webapp/images/FLYS_transp.png
Binary file gwt-client/src/main/webapp/images/FLYS_transp.png has changed
diff -r a3fb76cf79b6 -r e8f152163a1e gwt-client/src/main/webapp/images/symbol_selected.png
Binary file gwt-client/src/main/webapp/images/symbol_selected.png has changed


More information about the Dive4elements-commits mailing list