changeset 8905:93e6afa30045

Merge
author gernotbelger
date Thu, 22 Feb 2018 18:28:33 +0100
parents d9f2ce1d6bef (diff) 0a900d605d52 (current diff)
children bd3095b3f028
files .hgignore gwt-client/pom.xml
diffstat 5 files changed, 85 insertions(+), 49 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/doc/conf/themes/default.xml	Thu Feb 22 17:04:06 2018 +0100
+++ b/artifacts/doc/conf/themes/default.xml	Thu Feb 22 18:28:33 2018 +0100
@@ -143,16 +143,12 @@
             <inherit from="Areas" />
         </inherits>
         <fields>
-            <!-- 'areashowbg': no code exits that reads it... -->
             <field name="areashowbg" type="boolean" display="Hintergrund anzeigen"
                 default="true" hints="hidden" />
-            <!-- FIXME: "areashowborder" does not exist, the constant in ThemeDocument is 'showborder" -->
             <field name="areashowborder" type="boolean" display="Begrenzung"
                 default="false" hints="hidden" />
-            <!-- 'areabordercolor' is not used in the code... -->
             <field name="areabordercolor" type="Color" default="0, 0, 0"
                 display="Begrenzungslinienfarbe" hints="hidden" />
-            <!-- 'showarea' is not used in the code... -->
             <field name="showarea" type="boolean" display="Flaeche anzeigen"
               default="true" hints="hidden" />
             <field name="showarealabel" type="boolean"
@@ -2880,7 +2876,7 @@
     <!-- S-INFO Flow-Depth Themes -->
     <theme name="SInfoFlowDepth">
         <inherits>
-            <inherit from="LongitudinalSection" />
+            <inherit from="LongitudinalSectionW" />
         </inherits>
         <fields>
             <field name="linecolor" type="Color" display="Linienfarbe" default="0, 0, 255" />
@@ -2888,27 +2884,31 @@
     </theme>
     <theme name="SInfoFlowDepthTkh">
         <inherits>
-            <inherit from="LongitudinalSection" />
+            <inherit from="LongitudinalSectionW" />
         </inherits>
         <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe" default="0, 0, 128" />
+            <field name="linecolor" type="Color" display="Linienfarbe" default="0, 204, 255" />
         </fields>
     </theme>
     <theme name="SInfoTkh">
         <inherits>
-            <inherit from="LongitudinalSectionArea" />
+            <inherit from="LongitudinalSection" />
         </inherits>
         <fields>
             <field name="calculateRange" type="boolean" display="Ausdehnung berechnen" default="true" hints="hidden" />
-            
-            <field name="showborder" type="boolean" display="Begrenzung" default="true" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe" default="241, 195, 155" />
-            <field name="linesize" type="int" display="Liniendicke" default="2"/>
-            
-            <field name="areabgcolor" type="Color" default="241, 195, 155" display="Füllfarbe" />            
-            <field name="areatransparency" type="int" default="85"  />
-            
+
+            <!-- Areas use 'showborder' instead of showlines (but inconsistently uses 'linecolor' and 'linesize'), so we hide 'showline' and replace it with 'showbordder' -->
+            <field name="showlines" type="boolean" display="Linie anzeigen" default="true" hints="hidden"/>
+            <field name="showborder" type="boolean" display="Linien anzeigen" default="true" />
+            <field name="linecolor" type="Color" display="Linienfarbe" default="228, 108, 10" />
+            <field name="linesize" type="int" display="Liniendicke" default="1"/>
+
+            <field name="showarea" type="boolean" display="Flaeche anzeigen" default="true" />
+            <field name="areabgcolor" type="Color" default="245, 245, 220" display="Füllfarbe" />            
+            <field name="areabgpattern" type="areapattern" default="pattern1" display="Flächenfarbe" />            
+            <field name="areatransparency" type="int" default="10"  />
+
             <field name="showarealabel" type="boolean" display="Flächenbeschriftung anzeigen" default="false" hint="hidden"/>
         </fields>
     </theme>
-</themegroup>
+</themegroup>
\ No newline at end of file
--- a/artifacts/doc/conf/themes/second.xml	Thu Feb 22 17:04:06 2018 +0100
+++ b/artifacts/doc/conf/themes/second.xml	Thu Feb 22 18:28:33 2018 +0100
@@ -956,6 +956,7 @@
             <field name="pointcolor" type="Color" display="Punktfarbe" default="0, 255, 0" />
         </fields>
     </theme>
+
     <theme name="PorosityTopLines">
         <inherits>
             <inherit from="LongitudinalSection" />
@@ -2495,15 +2496,6 @@
         </fields>
     </theme>
 
-    <theme name="MySQCurve">
-        <inherits>
-            <inherit from="SQCurve" />
-        </inherits>
-        <fields>
-            <field name="linecolor" type="Color" default="255, 0, 0" />
-        </fields>
-    </theme>
-
     <theme name="SQMeasurementsA">
         <inherits>
             <inherit from="SQMeasurements" />
@@ -2869,40 +2861,42 @@
             <field name="linecolor" type="color" default="175, 175, 175" />
         </fields>
     </theme>
-    
+
     <!-- S-INFO Flow-Depth Themes -->
     <theme name="SInfoFlowDepth">
         <inherits>
-            <inherit from="LongitudinalSection" />
+            <inherit from="LongitudinalSectionW" />
         </inherits>
         <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 255" />
+            <field name="linecolor" type="Color" display="Linienfarbe" default="0, 0, 255" />
         </fields>
     </theme>
     <theme name="SInfoFlowDepthTkh">
         <inherits>
+            <inherit from="LongitudinalSectionW" />
+        </inherits>
+        <fields>
+            <field name="linecolor" type="Color" display="Linienfarbe" default="0, 204, 255" />
+        </fields>
+    </theme>
+    <theme name="SInfoTkh">
+        <inherits>
             <inherit from="LongitudinalSection" />
         </inherits>
         <fields>
-            <field name="linecolor" type="Color" display="Linienfarbe"
-                default="0, 0, 128" />
-        </fields>
-    </theme>
-    <theme name="SInfoTkh">
-        <inherits>
-            <inherit from="LongitudinalSectionArea" />
-        </inherits>
-        <fields>
             <field name="calculateRange" type="boolean" display="Ausdehnung berechnen" default="true" hints="hidden" />
-            
-            <field name="showborder" type="boolean" display="Begrenzung" default="true" hints="hidden" />
-            <field name="linecolor" type="Color" display="Linienfarbe" default="241, 195, 155" />
-            <field name="linesize" type="int" display="Liniendicke" default="2"/>
-            
-            <field name="areabgcolor" type="Color" default="241, 195, 155" display="Füllfarbe" />            
-            <field name="areatransparency" type="int" default="85"  />
-            
+
+            <!-- Areas use 'showborder' instead of showlines (but inconsistently uses 'linecolor' and 'linesize'), so we hide 'showline' and replace it with 'showbordder' -->
+            <field name="showlines" type="boolean" display="Linie anzeigen" default="true" hints="hidden"/>
+            <field name="showborder" type="boolean" display="Linien anzeigen" default="true" />
+            <field name="linecolor" type="Color" display="Linienfarbe" default="228, 108, 10" />
+            <field name="linesize" type="int" display="Liniendicke" default="1"/>
+
+            <field name="showarea" type="boolean" display="Flaeche anzeigen" default="true" />
+            <field name="areabgcolor" type="Color" default="245, 245, 220" display="Füllfarbe" />            
+            <field name="areabgpattern" type="areapattern" default="pattern1" display="Flächenfarbe" />            
+            <field name="areatransparency" type="int" default="10"  />
+
             <field name="showarealabel" type="boolean" display="Flächenbeschriftung anzeigen" default="false" hint="hidden"/>
         </fields>
     </theme>
--- a/artifacts/doc/conf/themes/virtual.xml	Thu Feb 22 17:04:06 2018 +0100
+++ b/artifacts/doc/conf/themes/virtual.xml	Thu Feb 22 18:28:33 2018 +0100
@@ -79,16 +79,20 @@
 
     <theme name="Areas" type="virtual">
         <fields>
+            <!-- 'showarea' is not used in the code... -->        
             <field name="showarea" type="boolean" display="Flaeche anzeigen"
                 default="true" />
             <field name="showarealabel" type="boolean"
                 display="Flaechenbeschriftung anzeigen" default="false" />
             <field name="areabgcolor" type="Color" display="Fuellfarbe"
                 default="0, 100, 0" />
+            <!-- 'areashowbg': no code exits that reads it... -->                
             <field name="areashowbg" type="boolean"
                 display="Hintergrund anzeigen" default="true" hidden="true" />
+            <!-- FIXME: "areashowborder" does not exist, the constant in ThemeDocument is 'showborder" -->
             <field name="areashowborder" type="boolean"
                 display="Flaechebegrenzungslinie anzeigen" default="false" />
+            <!-- 'areabordercolor' is not used in the code..., implementation uses 'linecolor' -->                
             <field name="areabordercolor" type="Color" default="0, 0, 0"
                 display="Begrenzungslinienfarbe" />
             <field name="areatransparency" type="int" default="50" display="Transparenz" />
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/App.java	Thu Feb 22 17:04:06 2018 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/datacage/templating/App.java	Thu Feb 22 18:28:33 2018 +0100
@@ -13,17 +13,19 @@
 
 import java.io.IOException;
 import java.io.OutputStream;
+import java.net.MalformedURLException;
 import java.io.File;
 import java.io.FileOutputStream;
 
 import org.dive4elements.river.backend.SessionFactoryProvider;
 
 import org.hibernate.Session;
-
+import org.slf4j.bridge.SLF4JBridgeHandler;
 import org.w3c.dom.Document;
 
 import org.apache.log4j.Logger;
-
+import org.apache.log4j.PropertyConfigurator;
+import org.dive4elements.artifacts.common.utils.Config;
 import org.dive4elements.artifacts.common.utils.XMLUtils;
 
 import org.dive4elements.river.artifacts.datacage.Recommendations;
@@ -32,6 +34,12 @@
 {
     private static Logger log = Logger.getLogger(App.class);
 
+    /**
+     * The logging is done via Log4j. To configure the logging
+     * a file 'log4j.properties' is search in the configuration directory.
+     */
+    private static final String LOG4J_PROPERTIES = "log4j.properties";
+    
     public static final String template =
         System.getProperty("meta.data.template", "meta-data.xml");
 
@@ -58,8 +66,28 @@
         return map;
     }
 
+    /**
+     * Trys to load the Log4j configuration from ${config.dir}/log4j.properties.
+     */
+    private static final void configureLogging() {
+        File configDir = Config.getConfigDirectory();
+        File propFile = new File(configDir, LOG4J_PROPERTIES);
+
+        if (propFile.isFile() && propFile.canRead()) {
+            try {
+                PropertyConfigurator.configure(propFile.toURI().toURL());
+                SLF4JBridgeHandler.install();
+            }
+            catch (MalformedURLException mue) {
+                mue.printStackTrace(System.err);
+            }
+        }
+    }
+    
     public static void main(String [] args) {
 
+        configureLogging();
+        
         Recommendations rec = Recommendations.createRecommendations(
             new File(template));
 
@@ -71,6 +99,9 @@
         final Document result = XMLUtils.newDocument();
 
         final Map<String, Object> parameters = getParameters();
+        parameters.put("ARTIFACT-OUTS", new String[] { "LONGITUDINAL_SECTION" });
+        parameters.put("PARAMETERS", parameters);
+        parameters.put("USER-ID", userId);
 
         Session session = SessionFactoryProvider
             .createSessionFactory()
@@ -99,7 +130,12 @@
         }
 
         try {
+            out.write('\n');
             XMLUtils.toStream(result, out);
+            out.write('\n');
+        }
+        catch (IOException e) {
+            log.error(e);
         }
         finally {
             if (OUTPUT != null) {
--- a/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixRealizingCalculationExtended.java	Thu Feb 22 17:04:06 2018 +0100
+++ b/artifacts/src/main/java/org/dive4elements/river/artifacts/model/fixings/FixRealizingCalculationExtended.java	Thu Feb 22 18:28:33 2018 +0100
@@ -35,6 +35,8 @@
         final FixingsOverview overview = FixingsOverviewFactory.getOverview(this.river);
         final ColumnCache cc = new ColumnCache();
 
+        // FIXME: dass die Hälfte der zeitlichen Differenz zwischen der ältesten und neusten WSPL
+
         final List<Column> columns = getEventColumns(overview, cc);
         for (final Column column : columns) {
             final Date date = column.getDate();

http://dive4elements.wald.intevation.org