# HG changeset patch
# User gernotbelger
# Date 1524818908 -7200
# Node ID 4dc047fb36332790a565a2e6f04bbdcb2022ce1d
# Parent 3e90c84f3aea30d8aa344d7e18ccbb52c452e192
adding removed files
diff -r 3e90c84f3aea -r 4dc047fb3633 .hgignore
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/.hgignore Fri Apr 27 10:48:28 2018 +0200
@@ -0,0 +1,29 @@
+syntax: regexp
+artifacts/target # maven output
+artifacts/\.classpath # eclipse
+artifacts/\.project # eclipse
+artifacts/\.settings # eclipse
+artifacts/test-output # eclipse junit/testng plugin output
+backend/target # maven output
+backend/\.classpath # eclipse
+backend/\.project # eclipse
+backend/\.settings # eclipse
+backend/test-output # eclipse junit/testng plugin output
+gwt-client/target # maven output
+gwt-client/\.classpath # eclipse
+gwt-client/\.project # eclipse
+gwt-client/\.settings # eclipse
+gwt-client/test-output # eclipse junit/testng plugin output
+gwt-client/src/main/webapp/OpenLayers-2.11
+gwt-client/SmartGWT/.*
+etl/target # maven output
+etl/\.classpath # eclipse
+etl/\.project # eclipse
+etl/\.settings # eclipse
+etl/test-output # eclipse junit/testng plugin output
+\.swp
+\.swo
+\.pyc
+TAGS
+syntax: glob
+artifacts/build/**
diff -r 3e90c84f3aea -r 4dc047fb3633 artifacts/doc/conf/backend-db.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/doc/conf/backend-db.xml Fri Apr 27 10:48:28 2018 +0200
@@ -0,0 +1,11 @@
+
+
+
+ d4e
+ d4e
+ org.hibernate.dialect.PostgreSQLDialect
+ org.postgresql.Driver
+ jdbc:postgresql://localhost:5432/d4e
+ select 1 from rivers
+ 30000
+
diff -r 3e90c84f3aea -r 4dc047fb3633 artifacts/doc/conf/conf.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/doc/conf/conf.xml Fri Apr 27 10:48:28 2018 +0200
@@ -0,0 +1,387 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+]>
+
+ YOUR_SECRET
+
+ org.dive4elements.river.artifacts.context.RiverContextFactory
+
+ org.dive4elements.artifactdatabase.DefaultArtifactCollectionFactory
+
+
+
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+
+
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+
+
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+
+
+
+
+
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+
+
+ org.dive4elements.artifactdatabase.DefaultArtifactFactory
+
+
+
+ org.dive4elements.artifactdatabase.DefaultUserFactory
+
+
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+ org.dive4elements.artifactdatabase.DefaultServiceFactory
+
+
+
+
+
+ org.dive4elements.river.artifacts.datacage.Datacage
+ org.dive4elements.river.wsplgen.SchedulerSetup
+ org.dive4elements.river.artifacts.map.RiverMapfileGeneratorStarter
+
+
+
+ org.dive4elements.river.artifacts.datacage.DatacageBackendListener
+
+
+ org.dive4elements.river.artifacts.context.SessionCallContextListener
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ &sqrelation-artifact;
+ &sqrelation-datacage-artifact;
+ &porosity-artifact;
+ &gaugedischargecurve-artifact;
+ &sedimentload-artifact;
+ &sedimentload-ls-artifact;
+
+ &sinfo_artifact;
+ &uinfo_artifact;
+
+
+ &modules;
+
+
+
+
+
+
+ &generators;
+
+
+
+ ${artifacts.config.dir}/meta-data.xml
+
+
+ &floodmap;
+ &rivermap;
+
+ &rest-server;
+
+
+
+ 60000
+
+
+
+ ${artifacts.config.dir}/cache.xml
+
+
+
+ &artifact-db;
+ &datacage-db;
+ &backend-db;
+ &seddb-db;
+
+
+
+ ${artifacts.config.dir}/themes.xml
+
+
+
+
+ &zoom-scales;
+
+ /opt/d4e-river/dgm/
+
+ 1.9
+
+
+
+ http://example.com
+
diff -r 3e90c84f3aea -r 4dc047fb3633 artifacts/doc/conf/seddb-db.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/artifacts/doc/conf/seddb-db.xml Fri Apr 27 10:48:28 2018 +0200
@@ -0,0 +1,14 @@
+
+
+
+ seddb
+ seddb
+ org.hibernate.dialect.PostgreSQLDialect
+ org.postgresql.Driver
+ jdbc:postgresql://localhost:5432/seddb
+ select 1 from gewaesser
+ 30000
+
+
diff -r 3e90c84f3aea -r 4dc047fb3633 backend/contrib/run_geo.sh
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/backend/contrib/run_geo.sh Fri Apr 27 10:48:28 2018 +0200
@@ -0,0 +1,62 @@
+#!/bin/bash
+
+# Set this to your target database for Oracle
+HOST=localhost
+BACKEND_NAME="XE"
+USER=flys28
+PASS=flys28
+# Alternatively you can provide a direct connection string:
+# OGR_CONNECTION="PG:dbname=flys host=localhost port=63333 user=flys password=flys"
+
+# Optional
+VERBOSE=1
+SKIP_AXIS=0
+SKIP_KMS=0
+SKIP_CROSSSECTIONS=0
+SKIP_FIXPOINTS=0
+SKIP_BUILDINGS=0
+SKIP_FLOODPLAINS=0
+SKIP_HYDR_BOUNDARIES=0
+SKIP_HWS_LINES=0
+SKIP_HWS_POINTS=0
+SKIP_UESG=0
+SKIP_DGM=0
+SKIP_JETTIES=0
+SKIP_FLOODMARKS=0
+
+# Default encoding. Change here if necessary
+export LC_ALL=de_DE@euro
+
+# There should be no need to change anything below this line
+GEW_FILE="$1"
+RIVER_NAME=$(grep "Gew.sser" "$1" | sed 's/Gew.sser: //')
+
+RIVER_PATH=$(grep "WSTDatei:" "$GEW_FILE" | awk '{print $2}')
+RIVER_PATH=$(dirname "$RIVER_PATH")/../..
+RIVER_PATH=$(readlink -f "$RIVER_PATH")
+
+DIR=`dirname $0`
+DIR=`readlink -f "$DIR"`
+
+exec python $DIR/shpimporter/shpimporter.py \
+ --directory $RIVER_PATH \
+ --river_name "$RIVER_NAME" \
+ --ogr_connection "$OGR_CONNECTION" \
+ --host $HOST/$BACKEND_NAME \
+ --user $USER \
+ --password $PASS \
+ --verbose $VERBOSE \
+ --skip_axis $SKIP_AXIS \
+ --skip_kms $SKIP_KMS \
+ --skip_crosssections $SKIP_CROSSSECTIONS \
+ --skip_fixpoints $SKIP_FIXPOINTS \
+ --skip_buildings $SKIP_BUILDINGS \
+ --skip_floodplains $SKIP_FLOODPLAINS \
+ --skip_hydr_boundaries $SKIP_HYDR_BOUNDARIES \
+ --skip_uesgs $SKIP_UESG \
+ --skip_hws_lines $SKIP_HWS_LINES \
+ --skip_hws_points $SKIP_HWS_POINTS \
+ --skip_dgm $SKIP_DGM \
+ --skip_jetties $SKIP_JETTIES \
+ --skip_floodmarks $SKIP_FLOODMARKS \
+ 2>&1
diff -r 3e90c84f3aea -r 4dc047fb3633 backend/doc/schema/Dockerfile
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/backend/doc/schema/Dockerfile Fri Apr 27 10:48:28 2018 +0200
@@ -0,0 +1,82 @@
+# Docker file for postgresql 9.4 on debain
+#
+# build with e.g. `docker build --force-rm=true -t d4e/river_db .',
+# then run with e.g.
+# `docker run --name d4eriver_db -dp 2345:63333 d4e/river_db:latest'
+#
+
+FROM debian:jessie
+MAINTAINER tom@intevation.de
+
+#
+# Use utf-8
+#
+RUN echo \
+ "locales locales/locales_to_be_generated multiselect en_US.UTF-8 UTF-8" | \
+ debconf-set-selections && \
+ echo "locales locales/default_environment_locale select en_US.UTF-8" | \
+ debconf-set-selections
+
+RUN apt-get update -y && apt-get install -y locales
+
+ENV LC_ALL en_US.UTF-8
+
+#
+# Install packages
+#
+RUN apt-get update && \
+ apt-get install -y postgresql-9.4-postgis-2.1 postgis curl
+
+#
+# Use user postgres to run the next commands
+#
+USER postgres
+
+RUN /etc/init.d/postgresql start && \
+ psql --command "CREATE USER admin WITH SUPERUSER PASSWORD 'secret';"
+
+#
+# Adjust PostgreSQL configuration so that remote connections to the
+# database are possible.
+#
+RUN echo "host all all 0.0.0.0/0 md5" >> \
+ /etc/postgresql/9.4/main/pg_hba.conf
+
+ENV PGCONF /etc/postgresql/9.4/main/postgresql.conf
+RUN echo "listen_addresses='*'" >> $PGCONF
+
+#
+# Expose the PostgreSQL port
+#
+EXPOSE 5432
+
+#
+# Create database
+#
+# Don't mind scary messages like
+# 'FATAL: the database system is starting up'.
+# It's because of the -w
+#
+ADD . /opt/d4eriver_db
+
+# Go to postgres home for write permissions
+WORKDIR /var/lib/postgresql
+ENV DATA_ARCH demodaten_3.1.10-bis-3.2.x.tar.gz
+RUN curl -k "https://wald.intevation.org/frs/download.php/2282/$DATA_ARCH" | \
+ tar xz
+
+ENV PGDATA /var/lib/postgresql/9.4/main
+RUN /usr/lib/postgresql/9.4/bin/pg_ctl start -wo "--config_file=$PGCONF" && \
+ /opt/d4eriver_db/postgresql-setup.sh && \
+ psql -f demodaten/d4e_demodata.dump.sql d4e && \
+ createuser -S -D -R seddb && \
+ createdb seddb && \
+ psql -f demodaten/seddb_demodata.dump.sql seddb && \
+ /usr/lib/postgresql/9.4/bin/pg_ctl stop
+
+#
+# Set the default command to run when starting the container
+#
+CMD ["/usr/lib/postgresql/9.4/bin/postgres", "-D", \
+ "/var/lib/postgresql/9.4/main", "-c", \
+ "config_file=/etc/postgresql/9.4/main/postgresql.conf"]
diff -r 3e90c84f3aea -r 4dc047fb3633 backend/src/main/java/org/dive4elements/river/backend/SedDBCredentials.java
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/backend/src/main/java/org/dive4elements/river/backend/SedDBCredentials.java Fri Apr 27 10:48:28 2018 +0200
@@ -0,0 +1,79 @@
+/* Copyright (C) 2011, 2012, 2013 by Bundesanstalt für Gewässerkunde
+ * Software engineering by Intevation GmbH
+ *
+ * This file is Free Software under the GNU AGPL (>=v3)
+ * and comes with ABSOLUTELY NO WARRANTY! Check out the
+ * documentation coming with Dive4Elements River for details.
+ */
+
+package org.dive4elements.river.backend;
+
+import org.dive4elements.artifacts.common.utils.Config;
+
+public class SedDBCredentials extends Credentials {
+ public static final String XPATH_USER = "/artifact-database/seddb-database/user/text()";
+
+ public static final String XPATH_PASSWORD = "/artifact-database/seddb-database/password/text()";
+
+ public static final String XPATH_DIALECT = "/artifact-database/seddb-database/dialect/text()";
+
+ public static final String XPATH_DRIVER = "/artifact-database/seddb-database/driver/text()";
+
+ public static final String XPATH_URL = "/artifact-database/seddb-database/url/text()";
+
+ public static final String XPATH_CONNECTION_INIT_SQLS = "/artifact-database/seddb-database/connection-init-sqls/text()";
+
+ public static final String XPATH_VALIDATION_QUERY = "/artifact-database/seddb-database/validation-query/text()";
+
+ public static final String XPATH_MAX_WAIT = "/artifact-database/seddb-database/max-wait/text()";
+
+ public static final String DEFAULT_USER = System.getProperty("flys.seddb.user", "seddb");
+
+ public static final String DEFAULT_PASSWORD = System.getProperty("flys.seddb.password", "seddb");
+
+ public static final String DEFAULT_DIALECT = System.getProperty("flys.seddb.dialect", "org.hibernate.dialect.PostgreSQLDialect");
+
+ public static final String DEFAULT_DRIVER = System.getProperty("flys.seddb.driver", "org.postgresql.Driver");
+
+ public static final String DEFAULT_URL = System.getProperty("flys.seddb.url", "jdbc:postgresql://localhost:5432/seddb");
+
+ public static final String DEFAULT_CONNECTION_INIT_SQLS = System.getProperty("flys.seddb.connection.init.sqls");
+
+ public static final String DEFAULT_VALIDATION_QUERY = System.getProperty("flys.seddb.connection.validation.query");
+
+ public static final String DEFAULT_MAX_WAIT = System.getProperty("flys.seddb.connection.max.wait");
+
+ public static final Class[] CLASSES = {};
+
+ private static Credentials instance;
+
+ public SedDBCredentials() {
+ }
+
+ public SedDBCredentials(final String user, final String password, final String dialect, final String driver, final String url,
+ final String connectionInitSqls, final String validationQuery, final String maxWait) {
+ super(user, password, dialect, driver, url, connectionInitSqls, validationQuery, maxWait, CLASSES);
+ }
+
+ public static synchronized Credentials getInstance() {
+ if (instance == null) {
+ final String user = Config.getStringXPath(XPATH_USER, DEFAULT_USER);
+ final String password = Config.getStringXPath(XPATH_PASSWORD, DEFAULT_PASSWORD);
+ final String dialect = Config.getStringXPath(XPATH_DIALECT, DEFAULT_DIALECT);
+ final String driver = Config.getStringXPath(XPATH_DRIVER, DEFAULT_DRIVER);
+ final String url = Config.getStringXPath(XPATH_URL, DEFAULT_URL);
+ final String connectionInitSqls = Config.getStringXPath(XPATH_CONNECTION_INIT_SQLS, DEFAULT_CONNECTION_INIT_SQLS);
+ final String validationQuery = Config.getStringXPath(XPATH_VALIDATION_QUERY, DEFAULT_VALIDATION_QUERY);
+ final String maxWait = Config.getStringXPath(XPATH_MAX_WAIT, DEFAULT_MAX_WAIT);
+
+ instance = new SedDBCredentials(user, password, dialect, driver, url, connectionInitSqls, validationQuery, maxWait);
+ }
+ return instance;
+ }
+
+ public static Credentials getDefault() {
+ return new SedDBCredentials(DEFAULT_USER, DEFAULT_PASSWORD, DEFAULT_DIALECT, DEFAULT_DRIVER, DEFAULT_URL, DEFAULT_CONNECTION_INIT_SQLS,
+ DEFAULT_VALIDATION_QUERY, DEFAULT_MAX_WAIT);
+ }
+}
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
diff -r 3e90c84f3aea -r 4dc047fb3633 etl/doc/conf.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/etl/doc/conf.xml Fri Apr 27 10:48:28 2018 +0200
@@ -0,0 +1,39 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ /the/path/to/the/dips/file
+ /the/path/to/the/xslt/to/repair/dips
+
+
+
+
+ org.postgresql.Driver
+ flys
+ flys
+ jdbc:postgresql://localhost:5432/flys
+
+
+
+
+
+ org.sqlite.JDBC
+
+
+ jdbc:sqlite:/path/to/aft.db
+
+
+
+