changeset 6205:1298c1c2dadf

merged
author Tom Gottfried <tom.gottfried@intevation.de>
date Wed, 05 Jun 2013 13:16:28 +0200
parents 6a4f530a2af7 (diff) dc166b225775 (current diff)
children 743eab7acfdb
files
diffstat 167 files changed, 6299 insertions(+), 5707 deletions(-) [+]
line wrap: on
line diff
--- a/.hgtags	Fri May 24 16:26:41 2013 +0200
+++ b/.hgtags	Wed Jun 05 13:16:28 2013 +0200
@@ -50,3 +50,4 @@
 b740f0c4179edb5238d27013b25a0b3cc52e4e7f 3.0.3
 5f34e4cb80952b94e4683d90dbaab59e9da3711a 3.0.4
 1a169e10c0f3e1f33990a91dd294512ac97d1a70 3.0.5
+b689d2b9d1675739778083b2bcba336abb33f70c 3.0.6
--- a/artifacts/doc/conf/artifacts/minfo.xml	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/doc/conf/artifacts/minfo.xml	Wed Jun 05 13:16:28 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"/>
Binary file artifacts/doc/conf/jasper/sqrelation.jasper has changed
Binary file artifacts/doc/conf/jasper/sqrelation_en.jasper has changed
--- a/artifacts/doc/conf/mapserver/barrier_lines_class.vm	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/doc/conf/mapserver/barrier_lines_class.vm	Wed Jun 05 13:16:28 2013 +0200
@@ -30,3 +30,11 @@
         OUTLINECOLOR "#800000"
     END
 END
+CLASS
+    NAME "Ringdeich"
+    EXPRESSION ("[TYP]"="Ringdeich")
+    STYLE
+        SIZE 5
+        OUTLINECOLOR "#800000"
+    END
+END
--- a/artifacts/doc/conf/mapserver/mapfile.vm	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/doc/conf/mapserver/mapfile.vm	Wed Jun 05 13:16:28 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
--- a/artifacts/doc/conf/meta-data.xml	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/doc/conf/meta-data.xml	Wed Jun 05 13:16:28 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')">
@@ -255,7 +259,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 +276,641 @@
     </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: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="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="$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 +928,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 +947,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 +975,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 +984,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 +998,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 +1017,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 +1036,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 +1065,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 +1078,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 +1086,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 +1102,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 +1121,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 +1140,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>
@@ -1466,7 +1162,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 +1184,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>
 
@@ -1517,7 +1213,7 @@
             FROM bed_height_single WHERE river_id = ${river_id}
           </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>
@@ -1535,7 +1231,7 @@
             FROM bed_height_epoch WHERE river_id = ${river_id}
           </dc:statement>
           <dc:for-each>
-            <height factory="bedheight"
+            <height factory="bedheight" target_out="{$out}"
                     ids="bedheight-epoch-{$bedh_id}-{$bedh_interval_id}"
                     description="{$bedh_descr}"/>
           </dc:for-each>
@@ -1556,7 +1252,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 +1263,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 +1293,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 +1313,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 +1342,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 +1351,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 +1376,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 +1385,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 +1429,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 +1446,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 || '&lt;BR&gt;' ||
+                   'Rasterweite: '   || d.resolution || 'm&lt;BR&gt;' ||
+                   'Format: '  || d.format || '&lt;BR&gt;' ||
                    '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} &lt; r.a) or (${fromkm} &gt; r.b))
+            </dc:statement>
+            <dc:for-each>
+            <dem factory="demfactory" target_out="{$out}"
               ids="{$dem_id}"
               name="{$name}"
-              info="{dc:replace($info, '$', '&lt;BR&gt;')}{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 +1471,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 +1558,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 +1572,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 +1593,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 +1618,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 +1638,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 +1656,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 +1687,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 +1703,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 +1729,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 +1746,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 +1777,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 +1807,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 +1836,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 +1967,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 +2102,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 +2112,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 +2120,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 +2144,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 +2152,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 +2167,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 +2181,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 +2203,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 +2239,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 +2247,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 +2267,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 +2320,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 +2342,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 +2355,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 +2367,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 &lt;&gt; CAST(${artifact-id} AS uuid)
             AND EXISTS (
@@ -2678,41 +2388,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 &lt; $from) or $fromkm &gt; $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 &gt; $tokm or $defto &lt; $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>
--- a/artifacts/doc/conf/themes.xml	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/doc/conf/themes.xml	Wed Jun 05 13:16:28 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"
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/doc/conf/themes/default.xml	Wed Jun 05 13:16:28 2013 +0200
@@ -0,0 +1,2062 @@
+<?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>
+
+    <!-- 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>
--- a/artifacts/doc/conf/themes/default/cross-section.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/default/discharge.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/default/duration.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/default/fixings.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/default/floodmap.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/default/general.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/default/historical-discharge.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/default/longitudinal-section.xml	Fri May 24 16:26:41 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>-->
--- a/artifacts/doc/conf/themes/default/reference.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/default/sq-relation.xml	Fri May 24 16:26:41 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-->
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/doc/conf/themes/second.xml	Wed Jun 05 13:16:28 2013 +0200
@@ -0,0 +1,2062 @@
+<?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>
+
+    <!-- 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>
--- a/artifacts/doc/conf/themes/second/cross-section.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/second/discharge.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/second/duration.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/second/fixings.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/second/floodmap.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/second/general.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/second/historical-discharge.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/second/longitudinal-section.xml	Fri May 24 16:26:41 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>-->
--- a/artifacts/doc/conf/themes/second/reference.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/doc/conf/themes/second/sq-relation.xml	Fri May 24 16:26:41 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-->
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/CrossSectionArtifact.java	Wed Jun 05 13:16:28 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) {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/D4EArtifact.java	Wed Jun 05 13:16:28 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 :
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/MainValuesArtifact.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/MainValuesArtifact.java	Wed Jun 05 13:16:28 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) {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/StaticD4EArtifact.java	Wed Jun 05 13:16:28 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 :
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/WINFOArtifact.java	Wed Jun 05 13:16:28 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) {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedDifferencesAccess.java	Wed Jun 05 13:16:28 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,47 @@
         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) {
-            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);
+    public String [] getDiffs() {
+        if (diffs == null) {
+            diffs = getString("diffids").split("#");
+            if (logger.isDebugEnabled()) {
+                logger.debug("diffs: " + Arrays.toString(diffs));
+            }
         }
-        return artifacts;
+        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; i += 2) {
+                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] = diff1parts[1];
+            }
+        }
+
+        return differenceArtifactIds;
+    }
+
+    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) {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedHeightAccess.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedHeightAccess.java	Wed Jun 05 13:16:28 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);
     }
 
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedQualityAccess.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/BedQualityAccess.java	Wed Jun 05 13:16:28 2013 +0200
@@ -33,7 +33,7 @@
 
 
     public BedQualityAccess(D4EArtifact artifact, CallContext context) {
-        super(artifact, context);
+        super(artifact);
     }
 
     public List<DateRange> getDateRanges() {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/Calculation4Access.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/Calculation4Access.java	Wed Jun 05 13:16:28 2013 +0200
@@ -34,7 +34,7 @@
 
 
     public Calculation4Access(D4EArtifact artifact) {
-        super(artifact, null);
+        super(artifact);
     }
 
     public List<Segment> getSegments() {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/ExtremeAccess.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/ExtremeAccess.java	Wed Jun 05 13:16:28 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);
     }
 
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAccess.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAccess.java	Wed Jun 05 13:16:28 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() {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAnalysisAccess.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixAnalysisAccess.java	Wed Jun 05 13:16:28 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() {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixRealizingAccess.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FixRealizingAccess.java	Wed Jun 05 13:16:28 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() {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FlowVelocityAccess.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/FlowVelocityAccess.java	Wed Jun 05 13:16:28 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);
     }
 
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/GaugeAccess.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/GaugeAccess.java	Wed Jun 05 13:16:28 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);
     }
 
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/MapAccess.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/MapAccess.java	Wed Jun 05 13:16:28 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() {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/RangeAccess.java	Wed Jun 05 13:16:28 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;
     }
 
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/access/SedimentLoadAccess.java	Wed Jun 05 13:16:28 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() {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Recommendations.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/Recommendations.java	Wed Jun 05 13:16:28 2013 +0200
@@ -257,6 +257,7 @@
             new ArrayList<Builder.NamedConnection>(3);
 
         Connection userConnection = userId != null
+            || parameters.containsKey("ARTIFACT-ID")
             ? DBConfig
                 .getInstance()
                 .getDBConnection()
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/Builder.java	Wed Jun 05 13:16:28 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)
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/FunctionResolver.java	Wed Jun 05 13:16:28 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 {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/LinearInterpolated.java	Wed Jun 05 13:16:28 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 :
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedDomFacet.java	Wed Jun 05 13:16:28 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.
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacet.java	Wed Jun 05 13:16:28 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;
     }
 
     /**
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacetAdapter.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/ManagedFacetAdapter.java	Wed Jun 05 13:16:28 2013 +0200
@@ -46,7 +46,8 @@
             uuid,
             pos,
             active,
-            visible);
+            visible,
+            facet.getBoundToOut());
 
         this.facet = facet;
     }
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/extreme/ExtremeCurveFacet.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/extreme/ExtremeCurveFacet.java	Wed Jun 05 13:16:28 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);
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAnalysisPeriodsFacet.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAnalysisPeriodsFacet.java	Wed Jun 05 13:16:28 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,
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAvSectorFacet.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixAvSectorFacet.java	Wed Jun 05 13:16:28 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,
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDerivateFacet.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDerivateFacet.java	Wed Jun 05 13:16:28 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,
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDeviationFacet.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixDeviationFacet.java	Wed Jun 05 13:16:28 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,
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixEventFacet.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixEventFacet.java	Wed Jun 05 13:16:28 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);
     }
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalDeviationFacet.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalDeviationFacet.java	Wed Jun 05 13:16:28 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,
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalReferenceFacet.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixLongitudinalReferenceFacet.java	Wed Jun 05 13:16:28 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,
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWQCurveFacet.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixWQCurveFacet.java	Wed Jun 05 13:16:28 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,
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/HWS.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/map/HWS.java	Wed Jun 05 13:16:28 2013 +0200
@@ -34,7 +34,6 @@
 
     public HWS() {
         this.geom = null;
-        // TODO Auto-generated constructor stub
     }
 
     public HWS(String name) {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedDiffCalculation.java	Wed Jun 05 13:16:28 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();
         }
 
@@ -70,115 +61,104 @@
     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.toArray(new BedDiffYearResult[results.size()]), this);
+            return new CalculationResult(results, 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);
+            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 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(
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeight.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeight.java	Wed Jun 05 13:16:28 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;
     }
 
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightFacet.java	Wed Jun 05 13:16:28 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();
         }
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingle.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedHeightSingle.java	Wed Jun 05 13:16:28 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() {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityCalculation.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/minfo/BedQualityCalculation.java	Wed Jun 05 13:16:28 2013 +0200
@@ -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;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/sq/SQRelationJRDataSource.java	Wed Jun 05 13:16:28 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:raimund.renkert@intevation.de">Raimund Renkert</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 :
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/services/MainValuesService.java	Wed Jun 05 13:16:28 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.");
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DischargeState.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DischargeState.java	Wed Jun 05 13:16:28 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;
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DistanceOnlySelect.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DistanceOnlySelect.java	Wed Jun 05 13:16:28 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();
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DurationCurveState.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/DurationCurveState.java	Wed Jun 05 13:16:28 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(),
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FloodMapState.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FloodMapState.java	Wed Jun 05 13:16:28 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]);
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FlowVelocityState.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/FlowVelocityState.java	Wed Jun 05 13:16:28 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
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/HWSBarriersState.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/HWSBarriersState.java	Wed Jun 05 13:16:28 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);
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/MiddleBedHeight.java	Wed Jun 05 13:16:28 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
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/RangeState.java	Wed Jun 05 13:16:28 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();
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQAdapted.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/WQAdapted.java	Wed Jun 05 13:16:28 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);
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeCompute.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeCompute.java	Wed Jun 05 13:16:28 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;
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeQInput.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/extreme/ExtremeQInput.java	Wed Jun 05 13:16:28 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);
 
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixAnalysisCompute.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixAnalysisCompute.java	Wed Jun 05 13:16:28 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;
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixRealizingCompute.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/fixation/FixRealizingCompute.java	Wed Jun 05 13:16:28 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;
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferenceSelect.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferenceSelect.java	Wed Jun 05 13:16:28 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,
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/DifferencesState.java	Wed Jun 05 13:16:28 2013 +0200
@@ -71,11 +71,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;
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadCalculate.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadCalculate.java	Wed Jun 05 13:16:28 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);
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadYearSelect.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/states/minfo/SedimentLoadYearSelect.java	Wed Jun 05 13:16:28 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])
--- a/artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/collections/AttributeWriter.java	Wed Jun 05 13:16:28 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());
             }
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ATExporter.java	Wed Jun 05 13:16:28 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]);
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ChartGenerator.java	Wed Jun 05 13:16:28 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();
     }
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/ComputedDischargeCurveExporter.java	Wed Jun 05 13:16:28 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]));
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/DurationCurveExporter.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/DurationCurveExporter.java	Wed Jun 05 13:16:28 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]));
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityGenerator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/FlowVelocityGenerator.java	Wed Jun 05 13:16:28 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());
--- a/artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/HistoricalDischargeCurveGenerator.java	Wed Jun 05 13:16:28 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@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 :
--- a/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/MapGenerator.java	Wed Jun 05 13:16:28 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) {
--- a/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightGenerator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/MiddleBedHeightGenerator.java	Wed Jun 05 13:16:28 2013 +0200
@@ -31,7 +31,7 @@
  * @author <a href="mailto:ingo.weinzierl@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 });
     }
 
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/OutputHelper.java	Wed Jun 05 13:16:28 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();
         }
--- a/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/WaterlevelExporter.java	Wed Jun 05 13:16:28 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]);
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/extreme/ExtremeWQCurveGenerator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/extreme/ExtremeWQCurveGenerator.java	Wed Jun 05 13:16:28 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();
 
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATExport.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixATExport.java	Wed Jun 05 13:16:28 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();
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixDeltaWtGenerator.java	Wed Jun 05 13:16:28 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);
--- a/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/fixings/FixWQCurveGenerator.java	Wed Jun 05 13:16:28 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(": ");
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDiffHeightYearGenerator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDiffHeightYearGenerator.java	Wed Jun 05 13:16:28 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
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceEpochGenerator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceEpochGenerator.java	Wed Jun 05 13:16:28 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);
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceYearGenerator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedDifferenceYearGenerator.java	Wed Jun 05 13:16:28 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,7 +234,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
@@ -245,7 +249,11 @@
             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);
+            D4EArtifact flys = (D4EArtifact) master;
+            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);
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityGenerator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/BedQualityGenerator.java	Wed Jun 05 13:16:28 2013 +0200
@@ -88,7 +88,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
--- a/artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/minfo/SedimentLoadLSGenerator.java	Wed Jun 05 13:16:28 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);
             }
--- a/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/exports/sq/SQRelationExporter.java	Wed Jun 05 13:16:28 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.getSQRelation(context).format(parameters.getValue(0, "a"));
+            b  = Formatter.getSQRelation(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 :
--- a/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/Formatter.java	Wed Jun 05 13:16:28 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,12 @@
     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 = 0;
+    public static final int VARIANCE_MAX_DIGITS = 4;
+
+    // SQ Relation
+    public static final int SQ_RELATION_MAX_DIGITS = 8;
+    public static final int SQ_RELATION_MIN_DIGITS = 0;
 
     /**
      * Creates a localized NumberFormatter with given range of decimal digits.
@@ -106,7 +113,6 @@
         return nf;
     }
 
-
     public static NumberFormat getFormatter(CallContext c, int min, int max){
         return getFormatter(c.getMeta(), min, max);
     }
@@ -124,6 +130,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 +430,21 @@
                 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 getSQRelation(CallContext context) {
+        // Would be nice if E0 would not be shown
+        return getScientificFormater(
+                context,
+                SQ_RELATION_MIN_DIGITS,
+                SQ_RELATION_MAX_DIGITS);
+    }
+
     public static NumberFormat getMeterFormat(CallContext context) {
         return getFormatter(
                 context,
--- a/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/RiverUtils.java	Wed Jun 05 13:16:28 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!");
--- a/artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/utils/ThemeUtil.java	Wed Jun 05 13:16:28 2013 +0200
@@ -8,15 +8,19 @@
 
 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;
+import java.text.NumberFormat;
+import java.util.Locale;
 
 import org.apache.log4j.Logger;
 import org.w3c.dom.Document;
@@ -669,7 +673,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 +704,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 +722,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 +731,23 @@
         }
     }
 
+    // FIXME: i18n
+    protected static String createWSPLGENClassName(float val, float step, int idx, int maxIdx, CallMeta meta) {
+        Locale locale = Resources.getLocale(meta);
+        NumberFormat nf = NumberFormat.getInstance(locale);
+        if (idx < maxIdx) {
+            return "[Differenz] >= "
+                    + nf.format(val)
+                    + " m UND [Differenz] < "
+                    + nf.format(val + step)
+                    + " m";
+        }
+        else {
+            return "[Differenz] >= "
+                    + nf.format(val) + " m";
+        }
+    }
+
 
     public static String createMapserverStyle(Document theme) {
         String symbol    = getSymbol(theme);
--- a/artifacts/src/main/java/org/dive4elements/river/wsplgen/FacetCreator.java	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/java/org/dive4elements/river/wsplgen/FacetCreator.java	Wed Jun 05 13:16:28 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(
--- a/artifacts/src/main/resources/messages.properties	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/resources/messages.properties	Wed Jun 05 13:16:28 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]
@@ -300,15 +300,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 +390,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
@@ -616,6 +618,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
--- a/artifacts/src/main/resources/messages_de.properties	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/resources/messages_de.properties	Wed Jun 05 13:16:28 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]
@@ -301,10 +301,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 +391,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
@@ -402,7 +404,7 @@
 
 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
@@ -619,6 +621,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
--- a/artifacts/src/main/resources/messages_de_DE.properties	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/resources/messages_de_DE.properties	Wed Jun 05 13:16:28 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]
@@ -298,15 +298,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 +387,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
@@ -398,7 +400,7 @@
 
 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
@@ -617,6 +619,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
--- a/artifacts/src/main/resources/messages_en.properties	Fri May 24 16:26:41 2013 +0200
+++ b/artifacts/src/main/resources/messages_en.properties	Wed Jun 05 13:16:28 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]
@@ -303,10 +303,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 +392,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
@@ -617,6 +619,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
--- a/backend/doc/schema/oracle.sql	Fri May 24 16:26:41 2013 +0200
+++ b/backend/doc/schema/oracle.sql	Wed Jun 05 13:16:28 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;
 
--- a/backend/doc/schema/postgresql.sql	Fri May 24 16:26:41 2013 +0200
+++ b/backend/doc/schema/postgresql.sql	Wed Jun 05 13:16:28 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
--- a/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java	Fri May 24 16:26:41 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/importer/parsers/BedHeightParser.java	Wed Jun 05 13:16:28 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 {
--- a/backend/src/main/java/org/dive4elements/river/model/FlowVelocityModelValue.java	Fri May 24 16:26:41 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/FlowVelocityModelValue.java	Wed Jun 05 13:16:28 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));
--- a/backend/src/main/java/org/dive4elements/river/model/River.java	Fri May 24 16:26:41 2013 +0200
+++ b/backend/src/main/java/org/dive4elements/river/model/River.java	Wed Jun 05 13:16:28 2013 +0200
@@ -290,19 +290,36 @@
 
     /**
      * 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;
 
-        return gauges.isEmpty() ? null : gauges.get(idx);
+        if (a > b) {
+            for (int i = gauges.size() - 1; i >= 0; i--) {
+                Gauge g = gauges.get(i);
+                if (g.getRange().getA().doubleValue() == b)
+                    continue;
+                return g;
+            }
+        }
+
+        for (Gauge g: gauges) {
+            if ( g.getRange().getB().doubleValue() == a ) {
+                continue;
+            }
+            return g;
+        }
+
+        return null;
     }
 
     /**
--- a/contrib/make_flys_release/README	Fri May 24 16:26:41 2013 +0200
+++ b/contrib/make_flys_release/README	Wed Jun 05 13:16:28 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
--- a/contrib/make_flys_release/make_release.sh	Fri May 24 16:26:41 2013 +0200
+++ b/contrib/make_flys_release/make_release.sh	Wed Jun 05 13:16:28 2013 +0200
@@ -199,6 +199,10 @@
 sed -i -e "s@/tmp/flys-client.log@${LOG_DIR}/client-${VERSION}.log@g" \
     $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/log4j.properties
 
+if [ -r "$FEATURES_XML" ]; then
+    cp "$FEATURES_XML" $FLYS_SOURCE_DIR/river/gwt-client/src/main/webapp/WEB-INF/features.xml
+fi
+
 # XXX: Are they really used at runtime?
 find $FLYS_SOURCE_DIR/river/ -name \*.properties -o -name \*.xsl |  \
     xargs sed -i "s@https://flys-intern.intevation.de@${WIKI_URL}@g";
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYS.java	Wed Jun 05 13:16:28 2013 +0200
@@ -284,6 +284,7 @@
             public void onSuccess(River[] newRivers) {
                 GWT.log("Retrieved " + newRivers.length + " new rivers.");
                 rivers = newRivers;
+                newProject();
             }
         });
     }
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.java	Wed Jun 05 13:16:28 2013 +0200
@@ -604,6 +604,8 @@
 
     String bed_difference_height_year();
 
+    String fix_waterlevel_export();
+
     // ERRORS
 
     String error_years_wrong();
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants.properties	Wed Jun 05 13:16:28 2013 +0200
@@ -280,6 +280,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
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_de.properties	Wed Jun 05 13:16:28 2013 +0200
@@ -278,6 +278,7 @@
 eventselect = Ereignisauswahl
 events = Ereignisse
 kmchart = W/Q-Vorschau
+fix_waterlevel_export = Fixierungsanalysen Export
 
 exportATTooltip = Daten als AT Datei exportieren
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/FLYSConstants_en.properties	Wed Jun 05 13:16:28 2013 +0200
@@ -278,6 +278,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
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageWidget.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DatacageWidget.java	Wed Jun 05 13:16:28 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) {
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DemDatacagePanel.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/DemDatacagePanel.java	Wed Jun 05 13:16:28 2013 +0200
@@ -46,12 +46,6 @@
 
 
     @Override
-    public User getUser() {
-        return null;
-    }
-
-
-    @Override
     public String getOuts() {
         return OUT;
     }
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LinkSelection.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/LinkSelection.java	Wed Jun 05 13:16:28 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 :
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ModuleSelection.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/ModuleSelection.java	Wed Jun 05 13:16:28 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 :
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/QSegmentedInputPanel.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/QSegmentedInputPanel.java	Wed Jun 05 13:16:28 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) {
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RiverInfoPanel.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/RiverInfoPanel.java	Wed Jun 05 13:16:28 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() {
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/SelectProvider.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/SelectProvider.java	Wed Jun 05 13:16:28 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);
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/StyleEditorWindow.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/StyleEditorWindow.java	Wed Jun 05 13:16:28 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());
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WQAdaptedInputPanel.java	Wed Jun 05 13:16:28 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();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/WikiLinks.java	Wed Jun 05 13:16:28 2013 +0200
@@ -0,0 +1,44 @@
+/* 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 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());
+            }
+        };
+    }
+}
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/CrossSectionChartThemePanel.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/chart/CrossSectionChartThemePanel.java	Wed Jun 05 13:16:28 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;
     }
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/fixation/FixFunctionSelect.java	Wed Jun 05 13:16:28 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);
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedMultiPeriodPanel.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/minfo/BedMultiPeriodPanel.java	Wed Jun 05 13:16:28 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;
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugeListGrid.java	Wed Jun 05 13:16:28 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);
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugePanel.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/GaugePanel.java	Wed Jun 05 13:16:28 2013 +0200
@@ -29,7 +29,7 @@
      * @param flys The FLYS object
      */
     public GaugePanel(FLYS flys) {
-        super(new GaugeListGrid(flys));
+        super(flys, new GaugeListGrid(flys));
     }
 
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/InfoPanel.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/InfoPanel.java	Wed Jun 05 13:16:28 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);
         }
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationListGrid.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationListGrid.java	Wed Jun 05 13:16:28 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);
--- a/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationPanel.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/client/ui/stationinfo/MeasurementStationPanel.java	Wed Jun 05 13:16:28 2013 +0200
@@ -27,7 +27,7 @@
      * @param flys The FLYS object
      */
     public MeasurementStationPanel(FLYS flys) {
-        super(new MeasurementStationListGrid(flys));
+        super(flys, new MeasurementStationListGrid(flys));
     }
 
     /**
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactDescriptionFactory.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactDescriptionFactory.java	Wed Jun 05 13:16:28 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);
             }
         }
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactHelper.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/ArtifactHelper.java	Wed Jun 05 13:16:28 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);
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/CollectionHelper.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/CollectionHelper.java	Wed Jun 05 13:16:28 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;
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/FileUploadServiceImpl.java	Wed Jun 05 13:16:28 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();
 
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/SamlServlet.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/SamlServlet.java	Wed Jun 05 13:16:28 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);
     }
 }
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/UserServiceImpl.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/UserServiceImpl.java	Wed Jun 05 13:16:28 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) {
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/DefaultUser.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/DefaultUser.java	Wed Jun 05 13:16:28 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:
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/User.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/User.java	Wed Jun 05 13:16:28 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:
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/plain/Authenticator.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/plain/Authenticator.java	Wed Jun 05 13:16:28 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
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/saml/User.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/saml/User.java	Wed Jun 05 13:16:28 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);
     }
--- a/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/Response.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/server/auth/was/Response.java	Wed Jun 05 13:16:28 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:
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultUser.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/DefaultUser.java	Wed Jun 05 13:16:28 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 :
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/Recommendation.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/Recommendation.java	Wed Jun 05 13:16:28 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 :
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ToLoad.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/ToLoad.java	Wed Jun 05 13:16:28 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);
         }
--- a/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/User.java	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/java/org/dive4elements/river/client/shared/model/User.java	Wed Jun 05 13:16:28 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 :
--- a/gwt-client/src/main/webapp/WEB-INF/config.yaml	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/webapp/WEB-INF/config.yaml	Wed Jun 05 13:16:28 2013 +0200
@@ -196,12 +196,12 @@
               backgroundColor: #FFFFFF
         # The legend
         - !columns
-          absoluteX: 612
-          absoluteY: 390
-          width: 200
+          absoluteX: 562
+          absoluteY: 385
+          width: 250
           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
@@ -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
--- a/gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html	Fri May 24 16:26:41 2013 +0200
+++ b/gwt-client/src/main/webapp/images/FLYS_Karte_interactive.html	Wed Jun 05 13:16:28 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" />
Binary file gwt-client/src/main/webapp/images/FLYS_transp.png has changed
Binary file gwt-client/src/main/webapp/images/symbol_selected.png has changed

http://dive4elements.wald.intevation.org