# HG changeset patch # User Thomas Arendsen Hein # Date 1348827322 -7200 # Node ID f444cfce0b3d35cf88b2df58f3b50aca1434519c # Parent 597163195dc9b28158705f0e2d25993307d53df3# Parent 11d8cc2deb92a34ab09fc4cd7e4212d7d1500d86 dummy merge for repo head diff -r 11d8cc2deb92 -r f444cfce0b3d doc/ChangeLog --- a/doc/ChangeLog Fri Sep 28 12:13:58 2012 +0200 +++ b/doc/ChangeLog Fri Sep 28 12:15:22 2012 +0200 @@ -1,5 +1,70 @@ +2012-07-05 Felix Wolfsteller + + * README: New file with minimal instructions how to build the + documentation. + +2010-08-13 Tim Englich + + * admin-manual/installation-artifact-server.tex, + admin-manual/operating-the-system.tex, + admin-manual/installation-base.tex, + admin-manual/installation-webclient.tex: + Added corrections and wishes of the training on the installation + which was given to the BSH. + +2010-06-30 Ingo Weinzierl + + * admin-manual/installation-base.tex: Some refactoring of the proxy + installation. + +2010-06-30 Ingo Weinzierl + + * config-manual/general_settings.tex: Removed section 'Adding new + Languages'. This section should be placed in an own file. + + * config-manual/adding_new_languages.tex: New file for section 'Adding new + Languages'. + + * config-manual/config-manual.tex: Include section 'Adding new Languages'. + +2010-06-29 Tim Englich + + * admin-manual/installation-base.tex: + Added Section which explains how to install the proxy-script + which is required for the OpenLayers-Client which is integrated in the + GNV-Web-Client. + +2010-06-29 Tim Englich + + * config-manual/general_settings.tex: + Added section with the description how to add a new + language to the system into the config-manual. + +2010-06-25 Ingo Weinzierl + + * licenses/overview.txt: Overview of external libs and its licenses. + 2010-05-12 Hans Plum + Tagging as Version 1.0 + +2010-05-12 Hans Plum + + * config-manual/config-manual.tex, + config-manual/model_of_transitions.tex, + config-manual/title.tex, + config-manual/generating_maps.tex, + config-manual/general_settings.tex, + config-manual/miscellanea.tex, + config-manual/Makefile, + config-manual/administering_artifact-server.tex: + Adapted titlepage to admin manual. Replaced with public Makefile + according to admin manual. (XXX) Added some workaround linebreaks with + typewriter sections + +2010-05-12 Hans Plum + + * config-manual/config-manual.tex, config-manual/model_of_transitions.tex, config-manual/generating_maps.tex, diff -r 11d8cc2deb92 -r f444cfce0b3d doc/README --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/README Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,11 @@ +To build pdf documentation, call `make` with the documents name without the +".tex" extension, e.g. + + cd admin-manual + make installation-admin-manual + +will result in + + installation-admin-manual.pdf + +. diff -r 11d8cc2deb92 -r f444cfce0b3d doc/admin-manual/installation-artifact-server.tex --- a/doc/admin-manual/installation-artifact-server.tex Fri Sep 28 12:13:58 2012 +0200 +++ b/doc/admin-manual/installation-artifact-server.tex Fri Sep 28 12:15:22 2012 +0200 @@ -17,6 +17,7 @@ \begin{lstlisting} cd /var/log mkdir artifacts + chown -r root:artifacts artifacts chmod 770 artifacts chmod g+s artifacts \end{lstlisting} @@ -85,7 +86,8 @@ Integrate artifact-server in startup-process of operating system: \begin{lstlisting} - cp -i /opt/artifact-server/bin/debian/artifact-server /etc/init.d/ + cp -i /opt/artifact-server/install/debian/artifact-server/artifact-server-init-scipt + /etc/init.d/artifact-server chmod +x /etc/init.d/artifact-server update-rc.d artifact-server defaults \end{lstlisting} @@ -115,14 +117,14 @@ 19509 Jps 19441 App - cat /var/run/artifact-server + cat /var/run/artifact-server.pid \end{lstlisting} Task: Compare the running process numbers. 2. Network: Check if the artifact-server opens a TCP-port (default: 8181) \begin{lstlisting} - netstat -nltp + netstat -nltp | grep 8181 # Check for an entry like: tcp 0 0 127.0.0.1:8181 0.0.0.0:* LISTEN 18648/java diff -r 11d8cc2deb92 -r f444cfce0b3d doc/admin-manual/installation-base.tex --- a/doc/admin-manual/installation-base.tex Fri Sep 28 12:13:58 2012 +0200 +++ b/doc/admin-manual/installation-base.tex Fri Sep 28 12:15:22 2012 +0200 @@ -54,6 +54,21 @@ {\em Hint}: Configuring of partitions, firewalls, etc. for the system is out of the scope of this documentation. +\subsection{Preparations} + +In some steps it is required to use templates wich are packed in +\verb+ artifact-server-$VERSION.tar.bz2+ to get access to those files. + +Please extract the tar.bz2 file as explained in +Chapter~\ref{ref:artifact-server-install}, + p.~\pageref{ref:artifact-server-install}. + +The complete document use the system-variable \verb+$ARTIFACT_SERVER_HOME+ +to refer the root-directory of the Artifac-Server. +It might be helpful to export this variable using the following command: + +\verb+ export ARTIFACT_SERVER_HOME=/opt/artifact-server+ + \subsection{Java Environment} \subsubsection*{Installation Sun Java 6} @@ -76,8 +91,10 @@ Install Sun Java 6 and its dependencies by executing the following: -\verb+ apt-get install sun-java6-jdk+ - +\begin{lstlisting} + apt-get update + apt-get install sun-java6-jdk +\end{lstlisting} \subsubsection*{Install Native Components for Java6 (optional)} @@ -130,8 +147,8 @@ Check if a version of 1.6.0* has been set. Check: \begin{lstlisting} - java version "1.6.0_12" - Java(TM) SE Runtime Environment (build 1.6.0_12-b04) + java version "1.6.0_20-b02" + Java(TM) SE Runtime Environment (build 1.6.0_20-b02) Java HotSpot(TM) Server VM (build 11.2-b01, mixed mode) \end{lstlisting} @@ -153,6 +170,9 @@ \verb+/etc/default/tomcat5.5+: \begin{lstlisting} + - #JAVA_HOME="/usr/lib/jvm/java-6-sun/" + + JAVA_HOME="/usr/lib/jvm/java-6-sun/" + - #JAVA_OPTS="-Djava.awt.headless=true -Xmx128M" + JAVA_OPTS="-Djava.awt.headless=true -Xmx1024m -server" @@ -245,7 +265,7 @@ After finishing the configuration, enable the module in Apache WebServer: \verb+ a2enmod jk+ and restart the server -\verb+ /etc/init.d/apache restart+. +\verb+ /etc/init.d/apache2 restart+. \subsubsection*{Publish the site in Apache WebServer} @@ -263,7 +283,7 @@ Enable the specific site (VirtualHost) in Apache WebServer: \begin{lstlisting} - cp -i $ARTIFACT_SERVER_HOME/install/debian/apache2 to /etc/apache2/sites-available + cp -i $ARTIFACT_SERVER_HOME/install/debian/apache2/gnv to /etc/apache2/sites-available # Activate site for GNV a2ensite gnv /etc/init.d/apache reload @@ -305,27 +325,90 @@ dpkg -i cgi-mapserver-gp_5.6.3-1~gp+1_i386.deb \end{lstlisting} -Provide a possibility to integrate MapServer properly and transfer +If there are libraries which are required by the Mapserver but not +installed yet run the following command: +\begin{lstlisting} +apt-get -f install +\end{lstlisting} + + +Provide a possibility to integrate Mapserver properly and transfer configurations to MapServer during runtime: \begin{lstlisting} cd /usr/lib/cgi-bin cp -i $ARTIFACT_SERVER_HOME/install/debian/umn-mapserver/gnv-wms . +chmod +x gnv-wms \end{lstlisting} For setting proper contact details in the WMS Capabilities response, edit the file \verb+ $ARTIFACT_SERVER_HOME/conf/maptemplates/mapfile.vm+ in the section WEB $\rightarrow$ METADATA. +The Mapserver will need fonts for rendering lables in the map. +To provide this it is required to install the freefonts. +\begin{lstlisting} +apt-get install ttf-freefont +\end{lstlisting} + + \subsubsection*{Test of installation} Check for a sucessful installation via: \begin{lstlisting} cd root curl \ -"http://localhost/cgi-bin/gnv-wms?service=WMS&request=GetCapabilities&version=1.1.1" \ +"http://localhost/cgi-bin/gnv-wms" \ -o mapserver \end{lstlisting} For a sucessful configuration, the response document \verb+ mapserver+ -contains a XML document describing the capabilities of the mapserver. +contains a Value which contains the following message of the mapserver. + +TODO: QUERYSTRING WAS EMPTY HINZUFUEGEN + +\subsection{Proxy-Script: Installation and Configuration} +The Proxy-Script is required to allow the Map-Client to request external +services. Security policies forbit and prevent requesting those services - like +a GetFeatureInfo request - directly. + +\subsubsection{Installation} + +First make sure that python is installed on the operating system. +Otherwise install python using the following command: + +\verb+ apt-get install python+ + +Then the script itself must be published on the server by executing the +following steps: + +\begin{lstlisting} +cd /usr/lib/cgi-bin +cp -i $ARTIFACT_SERVER_HOME/install/debian/ol-proxy/proxy.cgi . +\end{lstlisting} + +\subsubsection{Configuration} +The Proxy-Script can only communicate with servers it is allowed to. +To enable the communication to the server where the UMN-Mapserver is hosted +or to other Server it is necessary to edit {\tt allowedHosts} in the +Proxy-Script at line 18. + +There you have to replace the placeholder THISHOSTNAME with the name which +will be used to reach the GNV-Web-Client. + +You can add further servers using the syntax which is given in the script. + +\subsubsection{Test of installation} + +It is possible to test the installation using the following command: + +\begin{lstlisting} +curl http://localhost/cgi-bin/proxy.cgi?url=http%3A%2F%2Flocalhost/cgi-bin/mapserv-gp +\end{lstlisting} + +If localhost is allowed in the proxy-script the result might be this: + +\begin{lstlisting} +TODO: QUERYSTRING WAS EMPTY HINZUFUEGEN +\end{lstlisting} + diff -r 11d8cc2deb92 -r f444cfce0b3d doc/admin-manual/installation-webclient.tex --- a/doc/admin-manual/installation-webclient.tex Fri Sep 28 12:13:58 2012 +0200 +++ b/doc/admin-manual/installation-webclient.tex Fri Sep 28 12:15:22 2012 +0200 @@ -45,7 +45,7 @@ Testing the installation via Apache WebServer, mod\_jk and Apache Tomcat: \begin{lstlisting} - curl "http://localhost/gnv/" -o gnv + curl "http://localhost/gnv/start.do" -o gnv \end{lstlisting} The file \verb+gnv+ includes HTML describing the startpage of the diff -r 11d8cc2deb92 -r f444cfce0b3d doc/admin-manual/operating-the-system.tex --- a/doc/admin-manual/operating-the-system.tex Fri Sep 28 12:13:58 2012 +0200 +++ b/doc/admin-manual/operating-the-system.tex Fri Sep 28 12:15:22 2012 +0200 @@ -41,8 +41,8 @@ \paragraph*{Database problems} For checking problems with the connection to the database server, check the logfile of the artifact-server (c.f. -chapter~\chapter{ref:artifact-server-install}, -p.~pageref{ref:artifact-server-install}. +Chapter~\ref{ref:artifact-server-install}, +p.~\pageref{ref:artifact-server-install}). In most cases, a restart of the artifact-server will help to solve problems in the artifact-server. If you still encounter problems, check diff -r 11d8cc2deb92 -r f444cfce0b3d doc/config-manual/adding_new_languages.tex --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/config-manual/adding_new_languages.tex Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,23 @@ +\subsection{Adding new Languages} +The GNV-Server has the possibility to handle different languages. It is +necessary to configure those. + +The configuration is divided into three steps: + +\begin{enumerate} + \item Adding the required resource-file to the GNV-Server + \\{\tt /gnv-artifacts/src/main/resources/lang } + \item Adding the required resource-file to the GNV-Web-Client + {\tt /gnv/src/main/resources} + \item Publishing the new language to the GNV-Server by adding the + language-code to the file + \\{\tt /gnv-artifacts/src/main/resources/lang/lang.conf} +\end{enumerate} + +To generate the resource-files it might be helpful to copy an existing one and +translate its content into the desired language. + +Please note that you have to re-package the modules gnv and gnv-artifacts to +enable the new languages - currently, only german and english are provided. +If you want to provide further languages you have to change the toggle-mechanism +for switching the language in the web-client. diff -r 11d8cc2deb92 -r f444cfce0b3d doc/config-manual/config-manual.tex --- a/doc/config-manual/config-manual.tex Fri Sep 28 12:13:58 2012 +0200 +++ b/doc/config-manual/config-manual.tex Fri Sep 28 12:15:22 2012 +0200 @@ -200,6 +200,7 @@ \include{administering_artifact-server} \include{generating_charts} \include{generating_maps} +\include{adding_new_languages} \include{model_of_transitions} \include{miscellanea} \end{document} diff -r 11d8cc2deb92 -r f444cfce0b3d doc/config-manual/general_settings.tex --- a/doc/config-manual/general_settings.tex Fri Sep 28 12:13:58 2012 +0200 +++ b/doc/config-manual/general_settings.tex Fri Sep 28 12:15:22 2012 +0200 @@ -77,3 +77,4 @@ SQL-Statements" covering the main elements {\tt factories, artifacts} \end{enumerate} + diff -r 11d8cc2deb92 -r f444cfce0b3d doc/licenses/overview.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/doc/licenses/overview.txt Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,225 @@ +=============================================================================== +Primärabhängigkeiten: + * junit-3.8.1.jar (gnv + gnv-artifacts + geo-backend) + - Common Public License Version 1.0 + - http://www.opensource.org/licenses/cpl1.0.txt + + * log4j-1.2.14.jar (gnv + gnv-artifacts + geo-backend) + - Apache License Version 2.0 + + * jfreechart-1.0.13.jar (gnv-artifacts) + - LGPL v2.1 or later + + * batik-dom-1.7.jar (gnv-artifacts) + - Apache License Version 2.0 + + * batik-svggen-1.7.jar (gnv-artifacts) + - Apache License Version 2.0 + + * velocity-1.6.1.jar (gnv-artifacts) + - Apache License 2.0 + + * itext-2.1.7.jar (gnv-artifacts) + - Mozilla Public License 1.1 + + * opencsv-2.0.jar (gnv-artifacts) + - Apache License Version 2.0 + + * commons-math-2.0.jar (gnv-artifacts + geo-backend) + - Apache License Version 2.0) + + * ehcache-1.6.2.jar (gnv-artifacts + geo-backend) + - Apache License Version 2.0 + + * commons-validator-1.3.1.jar (gnv + gnv-artifacts) + - Apache License Version 2.0 + + * oro-2.0.8.jar (gnv-artifacts) + - Apache License 1.1 + + * gt-epsg-wkt-2.5.8.jar (gnv-artifacts) + - LGPL v2 or later + + * gt-shapefile-2.5.8.jar (gnv-artifact) + - LGPL v2 or later + + * jts-1.9.jar (gnv-artifacts + geo-backend) + - LGPL v2.1 or later) + + * trove-2.1.1.jar (gnv-artifacts) + - LGPL v2.1 or later + + * commons-fileupload-1.2.1.jar (gnv) + - Apache License Version 2.0 + + * commons-pool-1.3.jar (artifact-database + gnv-artifacts + geo-backend) + - Apache License Version 2.0) + + * org.restlet-2.0-SNAPSHOT.jar (artifact-database + gnv + gnv-artifacts) + - LGPL V3.0 or LGPL V2.1 or CDDL V1.0 or EPL V1.0) + + * org.restlet.ext.xml-2.0-SNAPSHOT.jar (artifact-database + gnv + gnv-artifacts) + - LGPL V3.0 or LGPL V2.1 or CDDL V1.0 or EPL V1.0 + + * servlet-api-5.5.15.jar (gnv) + - Apache License 2.0 + + * struts-1.2.9.jar (gnv) + - Apache License 2.0 + + * struts-el-1.2.9.jar (gnv) + - Apache License 2.0 + + * h2-1.1.117.jar (artifact-database + gnv-artifacts) + - Dual licensed: + - MPL 1.1 + - http://www.mozilla.org/MPL + - EPL 1.0 + - http://opensource.org/licenses/eclipse-1.0.php + + * postgresql-8.3-603.jdbc4.jar (artifact-database + gnv-artifacts) + - BSD License + + * commons-codec-1.4.jar (artifact-database + gnv-artifacts) + - Apache License Version 2.0 + + * jul-to-slf4j-1.5.11.jar (artifact-database + gnv-artifacts) + - MIT License + + * slf4j-log4j12-1.5.11.jar (artifact-database + gnv-artifacts) + - MIT License + +=============================================================================== +Sekundärabhängigkeiten: + * antlr-2.7.2.jar (gnv) + - ANTLR 3 License + - http://www.antlr.org/license.html + + * batik-awt-util-1.7.jar (gnv-artifacts) + - Apache License Version 2.0 + + * batik-css-1.7.jar (gnv-artifacts) + - Apache License Version 2.0 + + * batik-ext-1.7.jar (gnv-artifacts) + - Apache License Version 2.0 + + * batik-util-1.7.jar (gnv-artifacts) + - Apache License Version 2.0 + + * batik-xml-1.7.jar (gnv-artifacts) + - Apache License Version 2.0 + + * bcmail-jdk14-1.38.jar (gnv-artifacts) + - Bouncy Castle Licence (Adaption der Apache License) + - http://www.bouncycastle.org/licence.html + + * bcprov-jdk14-1.38.jar (gnv-artifacts) + - Bouncy Castle Licence (Adaption der Apache License) + - http://www.bouncycastle.org/licence.html + + * bctsp-jdk14-1.38.jar (gnv-artifacts) + - Bouncy Castle Licence (Adaption der Apache License) + - http://www.bouncycastle.org/licence.html + + * commons-beanutils-1.7.0.jar (gnv + gnv-artifacts) + - Apache License Version 2.0 + + * commons-collections-3.2.1.jar (gnv + gnv-artifacts) + - Apache License Version 2.0 + + * commons-dbcp-1.2.2.jar (artifact-database + gnv-artifacts) + - Apache License Version 2.0 + + * commons-digester-1.6.jar (gnv + gnv-artifacts) + - Apache License Version 2.0 + + * commons-lang-2.4.jar (gnv-artifacts) + - Apache License Version 2.0 + + * commons-logging-1.0.4.jar (gnv + gnv-artifacts) + - Apache License Version 2.0 + + * geoapi-2.2.0.jar (gnv-artifacts) + - eine OGC License + - http://www.opengeospatial.org/ogc/legal + + * gt-api-2.5.8.jar (gnv-artifacts) + - LGPL v2 or later + + * gt-main-2.5.8.jar (gnv-artifacts) + - LGPL v2 or later + + * gt-metadata-2.5.8.jar (gnv-artifacts) + - LGPL v2 or later + + * gt-referencing-2.5.8.jar (gnv-artifacts) + - LGPL v2 or later + + * jcommon-1.0.13.jar (gnv-artifacts) + - LGPL v2.1 or later + + * jdom-1.0.jar (gnv-artifacts) + - eigene Lizenz + - (siehe ./licenses/JDOM-LICENSE.txt) + + * jsr-275-1.0-beta-2.jar (gnv-artifacts) + - BSD License + - http://jscience.org/doc/license.txt + + * jstl-1.0.6.jar (gnv) + - Apache License 2.0 + + * oro-2.0.7.jar (gnv) + - Apache License 1.1 + + * osgi_R4_core-1.0.jar (artifact-database + gnv + gnv-artifacts) + - EPL 1.0 + + * slf4j-api-1.5.11.jar (artifact-database + gnv-artifacts) + - MIT License + + * standard-1.0.6.jar (gnv) + - Apache License 2.0 + + * velocity-1.4.jar (gnv-artifacts) + - Apache License 2.0 + + * velocity-dep-1.4.jar (gnv-artifacts) + - Apache License 2.0 + + * xalan-2.6.0.jar (gnv-artifacts) + - Apache License 2.0 + + * xalan-2.5.1.jar (gnv) + - Apache License 2.0 + + * xml-apis-1.0.b2.jar (gnv) + - Apache License 2.0 + - W3C License (siehe ./licenses/XML-APIS-DOM-LICENSE.txt) + + * xml-apis-1.3.04.jar (gnv-artifacts) + - Apache License 2.0 and W3C License + - (siehe ./licenses/XML-APIS-DOM-LICENSE.txt) + + * xml-apis-ext-1.3.04.jar (gnv-artifacts) + - Apache License 2.0 and W3C License + - (siehe ./licenses/XML-APIS-DOM-LICENSE.txt) + +=============================================================================== +Proprietäre Bibliotheken: + * jpe_sdkres-9.3.jar (gnv-artifacts + geo-backend) + + * jsde_sdk-9.3.jar (gnv-artifacts + geo-backend) + + * jpe_sdk-9.3.jar (gnv-artifacts + geo-backend) + +=============================================================================== +Bibliotheken mit unklarer Lizenz: + * icu4j-3.2.jar (gnv-artifacts + geo-backend) + - ICU License + - http://source.icu-project.org/repos/icu/icu/trunk/license.html + + * vecmath-1.3.1.jar (gnv-artifacts) + - JRL + - (siehe ./licenses/JRL.txt) diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/ChangeLog --- a/geo-backend/ChangeLog Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/ChangeLog Fri Sep 28 12:15:22 2012 +0200 @@ -1,5 +1,121 @@ +2010-11-02 Ingo Weinzierl + + * src/test/java/de/intevation/gnv/geobackend/base/query/QueryExecutorTestCase.java, + src/test/java/de/intevation/gnv/geobackend/base/query/ToCharSample.java, + src/test/java/de/intevation/gnv/geobackend/base/query/cache/CacheCleanerTestCase.java, + src/test/java/de/intevation/gnv/geobackend/base/query/GroupBySample.java, + src/test/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEConnectionPoolTestCase.java, + src/main/java/de/intevation/gnv/geobackend/config/Configuration.java, + src/main/java/de/intevation/gnv/geobackend/base/DefaultResultDescriptor.java, + src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java, + src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutorBase.java, + src/main/java/de/intevation/gnv/geobackend/base/query/container/QueryContainerFactory.java, + src/main/java/de/intevation/gnv/geobackend/base/query/container/QueryContainer.java, + src/main/java/de/intevation/gnv/geobackend/base/query/container/DefaultQueryContainer.java, + src/main/java/de/intevation/gnv/geobackend/base/query/container/exception/QueryContainerException.java, + src/main/java/de/intevation/gnv/geobackend/base/query/cache/CacheCleaner.java, + src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutor.java, + src/main/java/de/intevation/gnv/geobackend/base/query/CachingQueryExecutorFactory.java, + src/main/java/de/intevation/gnv/geobackend/base/query/DefaultQueryExceutor.java, + src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutorFactory.java, + src/main/java/de/intevation/gnv/geobackend/base/query/exception/QueryException.java, + src/main/java/de/intevation/gnv/geobackend/base/connectionpool/ConnectionPoolFactory.java, + src/main/java/de/intevation/gnv/geobackend/base/connectionpool/ConnectionPool.java, + src/main/java/de/intevation/gnv/geobackend/base/connectionpool/exception/ConnectionException.java, + src/main/java/de/intevation/gnv/geobackend/base/ResultDescriptor.java, + src/main/java/de/intevation/gnv/geobackend/base/Result.java, + src/main/java/de/intevation/gnv/geobackend/sde/connectionpool/ArcSDEConnectionPool.java, + src/main/java/de/intevation/gnv/geobackend/sde/connectionpool/ArcSDEPoolableObjectFactory.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEConnection.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/UncacheableSDEResultSet.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/ColDefinition.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/SDEResultSet.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/RasterObject.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/ResultSet.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/Uncacheable.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEResultSetMetaData.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/DatasourceException.java, + src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/TechnicalException.java, + src/main/java/de/intevation/gnv/geobackend/util/XMLUtils.java, + src/main/java/de/intevation/gnv/geobackend/util/RedundancyRemover.java: + Added license headers at the top of each of these files. + + * LGPL.txt: Added license file of the GNU LGPL v2.1 + +2010-06-30 Ingo Weinzierl + + RELEASE 1.1 + + * ChangeLog, Changes, NEWS: Summarized changes. + +2010-06-14 Ingo Weinzierl + + * pom.xml: Write svn revision to MANIFEST file while creating jar archive. + +2010-06-04 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/geobackend/base/query/CachingQueryExecutorFactory.java: + The ehcache CacheManager and the MBeanServer of the JVM are connected + so that the statistics of the sql-cache is available as MBean using + JConsole. + +2010-06-04 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/geobackend/sde/datasources/Uncacheable.java: + A new marker interface. It should be implemented by objects that should + not be cached. + + * src/main/java/de/intevation/gnv/geobackend/sde/datasources/UncacheableSDEResultSet.java: + A new SDEResultSet class that implements Uncacheable. Currently, it is + used for raster elements returned from ArcSDE. + + * src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java: + Raster elements are put into an UncacheableSDEResultSet container. This + has the effect that raster elements are not cached. + + * src/main/java/de/intevation/gnv/geobackend/base/query/DefaultQueryExceutor.java: + Only objects that do not implement Uncacheable will be cached. + +2010-06-03 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/geobackend/config/Configuration.java: A + global configuration for this geo-backend. Before using the geo-backend, + it is now necessary to create an instance of this class and call its + initialize(.) method. This method currently takes the following arguments: + + - conf: an xml document that should contain a node named 'geo-backend' + that contains all configurations required by the geo-backend. + - configDir: the absolute path to the root configuration directory that + might contain further configuration files. + - placeholder: the placeholder string that is used in the central config + file to replace the path to the configuration directory. + + Furthermore, this Configuration is used to initialize the so-called + 'sql-cache' that caches sql statements - it has been configured via system + properties until now. + + * src/main/java/de/intevation/gnv/geobackend/base/query/CachingQueryExecutorFactory.java, + src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutorFactory.java: + The sql-cache configuration is not read from system properties but from + global configuration now. + +2010-06-03 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/geobackend/util/XMLUtils.java: Some + functions to handle xml stuff. + +2010-05-31 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/geobackend/base/query/DefaultQueryExceutor.java: + Show the execution time of a database query as INFO log. + 2010-04-28 Ingo Weinzierl + RELEASE 1.0 + * Changes, NEWS, ChangeLog: Summarized changes. 2010-04-28 Ingo Weinzierl diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/Changes --- a/geo-backend/Changes Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/Changes Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,17 @@ +2010-06-30 RELEASE 1.1 + + NEW: + + * Cache statistics are available as MBean using JConsole. + + * Deactivated the caching of raster elements to improve performance. + + DDED: + + * A central Configuration instance that might be used to adjust settings + of the geo-backend. + + 2010-04-28 RELEASE 1.0 NEW: diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/LGPL.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/geo-backend/LGPL.txt Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/NEWS --- a/geo-backend/NEWS Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/NEWS Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,10 @@ +2010-06-30 RELEASE 1.1 + + * Evaluable cache statistics + + * Central configuration for this Geo-Backend + + 2010-04-28 RELEASE 1.0 NEW: diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/pom.xml --- a/geo-backend/pom.xml Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/pom.xml Fri Sep 28 12:15:22 2012 +0200 @@ -4,10 +4,14 @@ de.intevation.bsh geo-backend jar - - 1.0-SNAPSHOT + 1.0-SNAPSHOT geo-backend http://maven.apache.org + + scm:svn:svn+ssh://${user}@thoe.intevation.de/home/projects/Geospatial/bsh-generischer-viewer/Material/SVN/geo-backend + scm:svn:svn+ssh://${user}@thoe.intevation.de/home/projects/Geospatial/bsh-generischer-viewer/Material/SVN/geo-backend + scm:svn:svn+ssh://${user}@thoe.intevation.de/home/projects/Geospatial/bsh-generischer-viewer/Material/SVN/geo-backend + @@ -24,6 +28,36 @@ 1.5 + + org.codehaus.mojo + buildnumber-maven-plugin + + + validate + + create + + + + + true + false + + + + org.apache.maven.plugins + maven-jar-plugin + + + + true + + + ${buildNumber} + + + + diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResult.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base; import java.util.Date; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResultDescriptor.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResultDescriptor.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/DefaultResultDescriptor.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base; import java.util.ArrayList; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/Result.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/Result.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/Result.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/ResultDescriptor.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/ResultDescriptor.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/ResultDescriptor.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/ConnectionPool.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/ConnectionPool.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/ConnectionPool.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.connectionpool; import de.intevation.gnv.geobackend.base.connectionpool.exception.ConnectionException; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/ConnectionPoolFactory.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/ConnectionPoolFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/ConnectionPoolFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.connectionpool; import de.intevation.gnv.geobackend.sde.connectionpool.ArcSDEConnectionPool; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/exception/ConnectionException.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/exception/ConnectionException.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/exception/ConnectionException.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.connectionpool.exception; import com.esri.sde.sdk.client.SeError; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/CachingQueryExecutorFactory.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/CachingQueryExecutorFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/CachingQueryExecutorFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,16 +1,33 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query; +import de.intevation.gnv.geobackend.base.Result; + +import de.intevation.gnv.geobackend.base.query.cache.CacheCleaner; + +import de.intevation.gnv.geobackend.config.Configuration; + +import java.lang.management.ManagementFactory; + import java.util.Collection; import java.util.Iterator; +import javax.management.MBeanServer; + import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; import net.sf.ehcache.Element; -import org.apache.log4j.Logger; +import net.sf.ehcache.management.ManagementService; -import de.intevation.gnv.geobackend.base.Result; -import de.intevation.gnv.geobackend.base.query.cache.CacheCleaner; +import org.apache.log4j.Logger; /** * @author Sascha L. Teichmann @@ -18,7 +35,6 @@ public class CachingQueryExecutorFactory extends QueryExecutorFactory { - public static final String QUERY_EXECUTOR_FACTORY = "caching.query.executor.config"; public static final String CACHE_NAME = "sql.cache"; private static Logger log = Logger.getLogger(CachingQueryExecutorFactory.class); @@ -27,11 +43,26 @@ public CachingQueryExecutorFactory() { log.info("using SQL cache"); - String configFile = System.getProperty(QUERY_EXECUTOR_FACTORY); + init(); + } + + private void init() { + Configuration config = Configuration.getInstance(); + + if (config == null) { + log.error("No geobackend configuration found. " + + "Wasn't able to initialize cache."); + return; + } + String configFile = config.getCacheConfiguration(); manager = configFile != null ? new CacheManager(configFile) : new CacheManager(); manager.addCache(CACHE_NAME); + MBeanServer mBeanServer = + ManagementFactory.getPlatformMBeanServer(); + ManagementService.registerMBeans( + manager, mBeanServer, false, false, false, true); CacheCleaner cc = new CacheCleaner(); cc.start(); } diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/DefaultQueryExceutor.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/DefaultQueryExceutor.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/DefaultQueryExceutor.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query; import de.intevation.gnv.geobackend.base.Result; @@ -13,12 +21,15 @@ import de.intevation.gnv.geobackend.base.query.exception.QueryException; +import de.intevation.gnv.geobackend.sde.datasources.Uncacheable; + import java.sql.Connection; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Statement; import java.util.Collection; +import java.util.Date; import org.apache.log4j.Logger; @@ -73,22 +84,35 @@ return returnValue; } - Connection connection = null; + boolean cacheable = true; + Connection connection = null; ConnectionPool connectionPool = ConnectionPoolFactory.getInstance().getConnectionPool(); try { // Submit the Query connection = connectionPool.getConnection(this.connectionID); if (connection != null){ Statement stmt = connection.createStatement(); + Date start = new Date(); ResultSet rs = stmt.executeQuery(queryString); + Date end = new Date(); + log.info("-> Database query took " + + (end.getTime() - start.getTime()) + " ms."); + + cacheable = !(rs instanceof Uncacheable); + returnValue = super.createResultCollection(rs); - }else{ log.error("Could not establish Databaseconnection."); throw new QueryException("Could not establish Databaseconnection."); } - cacheResults(queryString, returnValue); + if (cacheable) { + log.debug("Elements are cacheable."); + cacheResults(queryString, returnValue); + } + else { + log.debug("Elements are NOT cacheable."); + } } catch (ConnectionException e) { log.error(e,e); diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutor.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutor.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutor.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query; import java.util.Collection; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutorBase.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutorBase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutorBase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query; import java.sql.ResultSet; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutorFactory.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutorFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/QueryExecutorFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,5 +1,15 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query; +import de.intevation.gnv.geobackend.config.Configuration; + import org.apache.log4j.Logger; /** @@ -34,32 +44,18 @@ */ public static synchronized QueryExecutorFactory getInstance(){ if (instance == null) { - String className = System.getProperty(QUERY_EXECUTOR_FACTORY); - if (className != null) { - try { - Class clazz = Class.forName(className); - final QueryExecutorFactory factory = - (QueryExecutorFactory)clazz.newInstance(); - Runtime.getRuntime().addShutdownHook(new Thread() { - @Override - public void run() { - factory.shutdown(); - } - }); - return instance = factory; - } - catch (ClassNotFoundException cnfe) { - log.error(cnfe); - } - catch (InstantiationException ie) { - log.error(ie); - } - catch(IllegalAccessException iae) { - log.error(iae); - } - catch (ClassCastException cce) { - log.error(cce); - } + Configuration config = Configuration.getInstance(); + + if (config.isCacheEnabled()) { + final QueryExecutorFactory factory = + new CachingQueryExecutorFactory(); + Runtime.getRuntime().addShutdownHook(new Thread() { + @Override + public void run() { + factory.shutdown(); + } + }); + return instance = factory; } instance = new QueryExecutorFactory(); diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/cache/CacheCleaner.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/cache/CacheCleaner.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/cache/CacheCleaner.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + /** * */ diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/DefaultQueryContainer.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/DefaultQueryContainer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/DefaultQueryContainer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query.container; import de.intevation.gnv.geobackend.base.query.container.exception.QueryContainerException; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/QueryContainer.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/QueryContainer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/QueryContainer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query.container; import java.util.Properties; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/QueryContainerFactory.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/QueryContainerFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/QueryContainerFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query.container; import java.util.Properties; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/exception/QueryContainerException.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/exception/QueryContainerException.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/container/exception/QueryContainerException.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query.container.exception; /** diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/exception/QueryException.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/exception/QueryException.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/query/exception/QueryException.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query.exception; /** diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/config/Configuration.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/config/Configuration.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,249 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.geobackend.config; + +import de.intevation.gnv.geobackend.base.connectionpool.ConnectionPoolFactory; + +import de.intevation.gnv.geobackend.base.query.container.QueryContainerFactory; + +import de.intevation.gnv.geobackend.base.query.container.exception.QueryContainerException; + +import de.intevation.gnv.geobackend.util.XMLUtils; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; + +import java.util.Properties; + +import javax.xml.xpath.XPathConstants; + +import org.apache.log4j.Logger; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * @author Ingo Weinzierl + */ +public final class Configuration { + + public static final String CONFIGURATION_ROOT = "geo-backend"; + public static final String XPATH_QUERIES = "query-configuration"; + public static final String XPATH_BACKEND = "backend-configuration"; + public static final String XPATH_CACHE = "cache"; + public static final String XPATH_CACHE_ENABLED = "@enabled"; + public static final String XPATH_CACHE_CONFIG = "configuration"; + + private static Logger logger = Logger.getLogger(Configuration.class); + + private static Configuration instance; + + private Node config; + private String configDir; + private String placeholder; + + private boolean cacheEnabled; + private String cacheConfiguration; + + + + /** + * Returns an instance of Configuration. + * + * @return an instance of Configuration. + */ + public static Configuration getInstance() { + if (instance == null) + instance = new Configuration(); + + return instance; + } + + + /** + * Constructor that creates a new Configuration object with disabled cache. + */ + public Configuration() { + cacheEnabled = false; + } + + + /** + * Initialize the geo-backend before it is ready to be used. This method + * calls other init* methods. + * + * @param conf A configuration document. This document should contain a node + * geo-backend. If there are more nodes named geo-backend, the + * first node is used. + * @param configDir The path to the root configuration directory. + * @param placeholder The placeholder used in the configuration document for + * the root configuration directory. + */ + public void init(Document conf, String configDir, String placeholder) + throws QueryContainerException, FileNotFoundException, IOException + { + this.config = conf; + this.configDir = configDir; + this.placeholder = placeholder; + + NodeList root = conf.getElementsByTagName(CONFIGURATION_ROOT); + if (root == null || root.getLength() == 0) { + logger.error("No valid configuration for this geobackend given!"); + return; + } + + initQueries(root.item(0)); + initConnection(root.item(0)); + initCache(root.item(0)); + } + + + /** + * Initialize sql statements. + * + * @param conf The geo-backend configuration node. + */ + protected void initQueries(Node conf) + throws FileNotFoundException, IOException, QueryContainerException + { + String queriesFile = (String) XMLUtils.xpath( + conf, XPATH_QUERIES, XPathConstants.STRING, null); + + queriesFile = replaceConfigDir(queriesFile); + logger.info("Initialize queries: " + queriesFile); + + Properties queries = getProperties(queriesFile); + QueryContainerFactory qcf = QueryContainerFactory.getInstance(); + qcf.initializeQueryContainer(queries); + } + + + /** + * Initialize necessary objects used for the database connection. + * + * @param connection The geo-backend configuration node. + */ + protected void initConnection(Node connection) + throws FileNotFoundException, IOException + { + String config = (String)XMLUtils.xpath( + connection, XPATH_BACKEND, XPathConstants.STRING, null); + + config = replaceConfigDir(config); + logger.info("Initialize database connection: " + config); + + Properties properties = getProperties(config); + ConnectionPoolFactory cpf = ConnectionPoolFactory.getInstance(); + cpf.initializeConnectionPool(properties); + } + + + /** + * Initialize necessary objects used for the sql cache. + * + * @param conf The geo-backend configuration node. + */ + protected void initCache(Node conf) { + Node cache = (Node) XMLUtils.xpath( + conf, XPATH_CACHE, XPathConstants.NODE, null); + + String on = (String) XMLUtils.xpath( + cache, XPATH_CACHE_ENABLED, XPathConstants.STRING, null); + + boolean enabled = Boolean.parseBoolean(on); + + if (enabled) { + String config = (String) XMLUtils.xpath( + cache, XPATH_CACHE_CONFIG, XPathConstants.STRING, null); + + if (config != null && config.length() > 0) { + config = replaceConfigDir(config); + logger.info("Initialize sql cache with config: " + config); + + this.cacheConfiguration = config; + this.cacheEnabled = true; + } + else { + logger.error("SQL cache is enabled, " + + "but no configuration was found."); + } + } + else { + logger.info("SQL cache is disabled."); + } + } + + + /** + * Replace placeholder in the configuration. Placeholder are used for the + * base configuration directory. + * + * @param path A string that might contain placeholders. + * + * @return path with replaced placeholder. + */ + protected String replaceConfigDir(String path) { + return path.replace(placeholder, configDir); + } + + + /** + * Read a file that contains properties and return a Java Properties object. + * + * @param path Path to a properties file. + * + * @return the properties contained in the file. + */ + protected Properties getProperties(String path) + throws FileNotFoundException, IOException + { + InputStream inputStream = null; + + try { + inputStream = new FileInputStream(path); + Properties properties = new Properties(); + properties.load(inputStream); + + return properties; + } + finally { + if (inputStream != null) { + try { + inputStream.close(); + } + catch (IOException ioe) { + } + } + } + } + + + /** + * Returns the state of the cache. + * + * @return true if sql queries are cache, otherwise false. + */ + public boolean isCacheEnabled() { + return cacheEnabled; + } + + + /** + * Returns the path of the cache configuration file. + * + * @return configuration path. + */ + public String getCacheConfiguration() { + return cacheConfiguration; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/connectionpool/ArcSDEConnectionPool.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/connectionpool/ArcSDEConnectionPool.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/connectionpool/ArcSDEConnectionPool.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.connectionpool; import java.sql.Connection; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/connectionpool/ArcSDEPoolableObjectFactory.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/connectionpool/ArcSDEPoolableObjectFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/connectionpool/ArcSDEPoolableObjectFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.connectionpool; import de.intevation.gnv.geobackend.base.connectionpool.exception.ConnectionException; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEConnection.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEConnection.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEConnection.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.datasources; import java.sql.Array; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEResultSetMetaData.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEResultSetMetaData.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEResultSetMetaData.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.datasources; import java.sql.ResultSetMetaData; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEStatement.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.datasources; import com.esri.sde.sdk.client.SDEPoint; @@ -494,7 +502,9 @@ log.debug("ArcSDEStatement.handleResultSet()"); } - SDEResultSet lSet = new SDEResultSet(); + SDEResultSet lSet = isRaster + ? new UncacheableSDEResultSet() + : new SDEResultSet(); SeRow row = null; int lCount; if (!isRaster){ diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEUtils.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.datasources; import com.esri.sde.sdk.client.SDEPoint; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ColDefinition.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ColDefinition.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ColDefinition.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.datasources; import org.apache.log4j.Logger; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/RasterObject.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/RasterObject.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/RasterObject.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.datasources; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ResultSet.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ResultSet.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/ResultSet.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.datasources; import org.apache.log4j.Logger; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Row.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.datasources; import com.esri.sde.sdk.client.SDEPoint; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/SDEResultSet.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/SDEResultSet.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/SDEResultSet.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.datasources; import de.intevation.gnv.geobackend.sde.datasources.exception.TechnicalException; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Uncacheable.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/Uncacheable.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,20 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.geobackend.sde.datasources; + +/** + * This interface is a marker interface. It is used for objects that should + * not be cached. + * + * @author Ingo Weinzierl + */ +public interface Uncacheable { + +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/UncacheableSDEResultSet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/UncacheableSDEResultSet.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.geobackend.sde.datasources; + +/** + * This ResultSet has no special tasks but implements Uncacheable + * to avoid this objects being cached. + * + * @author Ingo Weinzierl + */ +public class UncacheableSDEResultSet +extends SDEResultSet +implements Uncacheable +{ + /** + * Creates a new UncacheableSDResultSet object. + */ + public UncacheableSDEResultSet() { + + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/DatasourceException.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/DatasourceException.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/DatasourceException.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.datasources.exception; /** diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/TechnicalException.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/TechnicalException.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/sde/datasources/exception/TechnicalException.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.datasources.exception; import org.apache.log4j.Logger; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/util/RedundancyRemover.java --- a/geo-backend/src/main/java/de/intevation/gnv/geobackend/util/RedundancyRemover.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/util/RedundancyRemover.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.util; import java.util.LinkedHashMap; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/main/java/de/intevation/gnv/geobackend/util/XMLUtils.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/util/XMLUtils.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,69 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.geobackend.util; + +import javax.xml.namespace.NamespaceContext; +import javax.xml.namespace.QName; + +import javax.xml.xpath.XPath; +import javax.xml.xpath.XPathExpressionException; +import javax.xml.xpath.XPathFactory; + +import org.apache.log4j.Logger; + + +/** + * @author Ingo Weinzierl + */ +public final class XMLUtils { + + private static Logger logger = Logger.getLogger(XMLUtils.class); + + + private XMLUtils() { + } + + + public static Object xpath( + Object root, + String query, + QName returnType, + NamespaceContext namespaceContext + ) { + if (root == null) { + return null; + } + + try { + XPath xpath = newXPath(namespaceContext); + + if (xpath != null) { + return xpath.evaluate(query, root, returnType); + } + } + catch (XPathExpressionException xpee) { + logger.error(xpee.getLocalizedMessage(), xpee); + } + + return null; + } + + + public static XPath newXPath(NamespaceContext namespaceContext) { + XPathFactory factory = XPathFactory.newInstance(); + XPath xpath = factory.newXPath(); + + if (namespaceContext != null) { + xpath.setNamespaceContext(namespaceContext); + } + + return xpath; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/GroupBySample.java --- a/geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/GroupBySample.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/GroupBySample.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query; import com.esri.sde.sdk.client.SDEPoint; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/QueryExecutorTestCase.java --- a/geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/QueryExecutorTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/QueryExecutorTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query; import de.intevation.gnv.geobackend.base.Result; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/ToCharSample.java --- a/geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/ToCharSample.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/ToCharSample.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query; import com.esri.sde.sdk.client.SDEPoint; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/cache/CacheCleanerTestCase.java --- a/geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/cache/CacheCleanerTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/test/java/de/intevation/gnv/geobackend/base/query/cache/CacheCleanerTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.base.query.cache; import java.io.FileInputStream; diff -r 11d8cc2deb92 -r f444cfce0b3d geo-backend/src/test/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEConnectionPoolTestCase.java --- a/geo-backend/src/test/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEConnectionPoolTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/geo-backend/src/test/java/de/intevation/gnv/geobackend/sde/datasources/ArcSDEConnectionPoolTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.geobackend.sde.datasources; import de.intevation.gnv.geobackend.base.connectionpool.ConnectionPool; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/ChangeLog --- a/gnv-artifacts/ChangeLog Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/ChangeLog Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,1085 @@ +2012-03-12 Ingo Weinzierl + + * src/test/java/de/intevation/gnv/artifacts/TestCallContext.java, + src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCaseBase.java, + src/test/java/de/intevation/gnv/artifacts/TestArtifactDatabase.java, + src/main/java/de/intevation/gnv/artifacts/fis/SelectProductArtifact.java, + src/main/java/de/intevation/gnv/artifacts/GNVProductArtifactFactory.java, + src/main/java/de/intevation/gnv/artifacts/services/MetaDataService.java, + src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java, + src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java, + src/main/java/de/intevation/gnv/profile/horizontalcrosssection/HorizontalCrossSectionMeshArtifact.java, + src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshParallelArtifact.java, + src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshArtifact.java, + src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileArtifact.java, + src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileArtifact.java, + src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java, + src/main/java/de/intevation/gnv/layer/LayerArtifact.java, + pom.xml: Made it compile again with an updated ArtifactDatabase. + +2011-03-14 Sascha L. Teichmann + + * src/**/*.java: Changed imports to fit new positions of XMLUtils and Config: + $ find -name \*.java | xargs sed -i \ + -e 's/import de\.intevation\.artifactdatabase\.Config/import de.intevation.artifacts.common.utils.Config/' \ + -e 's/import de\.intevation\.artifactdatabase\.XMLUtils/import de.intevation.artifacts.common.utils.XMLUtils/' + +2010-11-04 Sascha L. Teichmann + + * contrib/palette2polygonVM.xsl, + contrib/visualize-transitions.xsl: Added author names. + +2010-11-02 Ingo Weinzierl + + * contrib/palette2polygonVM.xsl, + contrib/palette2qgis.xsl, + contrib/visualize-transitions.xsl, + doc/schema/externalinterface_schema.sql, + doc/schema/externalinterface_testdata.sql, + doc/conf/maptemplates/caps.xml, + src/test/java/de/intevation/gnv/artifacts/MeshHorizontalCrossSectionTestCase.java, + src/test/java/de/intevation/gnv/artifacts/MeshVerticalProfileTestCase.java, + src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestSuite.java, + src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointTimeSeriesTestCase.java, + src/test/java/de/intevation/gnv/artifacts/InstantaneousPointVerticalProfileTestCase.java, + src/test/java/de/intevation/gnv/artifacts/TestCallContext.java, + src/test/java/de/intevation/gnv/artifacts/MeshVerticalCrossSectionTestCase.java, + src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCaseBase.java, + src/test/java/de/intevation/gnv/artifacts/MeshTimeSeriesTestCase.java, + src/test/java/de/intevation/gnv/artifacts/TestArtifactDatabase.java, + src/test/java/de/intevation/gnv/artifacts/MeshHorizontalProfileTestCase.java, + src/test/java/de/intevation/gnv/artifacts/ressource/RessourceFactoryTestCase.java, + src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointVerticalProfileTestCase.java, + src/test/java/de/intevation/gnv/artifacts/InstantaneousPointHorizontalProfileTestCase.java, + src/test/java/de/intevation/gnv/artifacts/util/DistanceCalculatorTestCase.java, + src/test/java/de/intevation/gnv/artifacts/util/ShapeFileWriterTestCase.java, + src/main/java/de/intevation/gnv/artifacts/APP.java, + src/main/java/de/intevation/gnv/artifacts/GNVArtifactFactory.java, + src/main/java/de/intevation/gnv/artifacts/fis/product/Product.java, + src/main/java/de/intevation/gnv/artifacts/fis/product/DefaultProduct.java, + src/main/java/de/intevation/gnv/artifacts/fis/SelectProductArtifact.java, + src/main/java/de/intevation/gnv/artifacts/GNVProductArtifactFactory.java, + src/main/java/de/intevation/gnv/artifacts/PreSettingArtifact.java, + src/main/java/de/intevation/gnv/artifacts/cache/CacheFactory.java, + src/main/java/de/intevation/gnv/artifacts/services/MetaDataServiceException.java, + src/main/java/de/intevation/gnv/artifacts/services/MetaDataService.java, + src/main/java/de/intevation/gnv/artifacts/services/requestobjects/Parameter.java, + src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultLayer.java, + src/main/java/de/intevation/gnv/artifacts/services/requestobjects/FIS.java, + src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultMapService.java, + src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultParameter.java, + src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultFIS.java, + src/main/java/de/intevation/gnv/artifacts/services/requestobjects/Layer.java, + src/main/java/de/intevation/gnv/artifacts/services/requestobjects/MapService.java, + src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java, + src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java, + src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContext.java, + src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java, + src/main/java/de/intevation/gnv/artifacts/GNVDefaultArtifact.java, + src/main/java/de/intevation/gnv/state/OutputState.java, + src/main/java/de/intevation/gnv/state/DefaultInputValue.java, + src/main/java/de/intevation/gnv/state/OutputMode.java, + src/main/java/de/intevation/gnv/state/StateFactory.java, + src/main/java/de/intevation/gnv/state/exception/StateException.java, + src/main/java/de/intevation/gnv/state/cache/ThematicDataCacheCleaner.java, + src/main/java/de/intevation/gnv/state/cache/QueryObject.java, + src/main/java/de/intevation/gnv/state/MeasurementState.java, + src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java, + src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesVectorOutputState.java, + src/main/java/de/intevation/gnv/state/AutoResumeState.java, + src/main/java/de/intevation/gnv/state/PreSettingsTransferCoordinateSelectionState.java, + src/main/java/de/intevation/gnv/state/DefaultExportMode.java, + src/main/java/de/intevation/gnv/state/layer/LayerMetaData.java, + src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java, + src/main/java/de/intevation/gnv/state/InputValue.java, + src/main/java/de/intevation/gnv/state/DefaultAutoResumeState.java, + src/main/java/de/intevation/gnv/state/SingleInputState.java, + src/main/java/de/intevation/gnv/state/SwitchModeState.java, + src/main/java/de/intevation/gnv/state/DefaultOutputMode.java, + src/main/java/de/intevation/gnv/state/ExtendedInputData.java, + src/main/java/de/intevation/gnv/state/StateBase.java, + src/main/java/de/intevation/gnv/state/PreSettingsTransferState.java, + src/main/java/de/intevation/gnv/state/State.java, + src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java, + src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/OutputHelper.java, + src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionParallelOutputState.java, + src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java, + src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java, + src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshOutputState.java, + src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshVectorOutputState.java, + src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileOutputState.java, + src/main/java/de/intevation/gnv/state/profile/horizontal/NorthSouthEastWestState.java, + src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileVectorOutputState.java, + src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileMeshVectorOutputState.java, + src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileOutputState.java, + src/main/java/de/intevation/gnv/state/DefaultState.java, + src/main/java/de/intevation/gnv/state/ExportMode.java, + src/main/java/de/intevation/gnv/state/MinMaxDateState.java, + src/main/java/de/intevation/gnv/state/InputData.java, + src/main/java/de/intevation/gnv/state/MinMaxState.java, + src/main/java/de/intevation/gnv/state/describedata/NamedArrayList.java, + src/main/java/de/intevation/gnv/state/describedata/ExtendedKeyValueData.java, + src/main/java/de/intevation/gnv/state/describedata/NamedCollection.java, + src/main/java/de/intevation/gnv/state/describedata/MinMaxDescribeData.java, + src/main/java/de/intevation/gnv/state/describedata/DefaultKeyValueDescribeData.java, + src/main/java/de/intevation/gnv/state/describedata/DefaultMinMaxDescribeData.java, + src/main/java/de/intevation/gnv/state/describedata/SingleValueDescribeData.java, + src/main/java/de/intevation/gnv/state/describedata/DescribeData.java, + src/main/java/de/intevation/gnv/state/describedata/DefaultSingleValueDescribeData.java, + src/main/java/de/intevation/gnv/state/describedata/KeyValueDescibeData.java, + src/main/java/de/intevation/gnv/state/OutputStateBase.java, + src/main/java/de/intevation/gnv/state/DefaultInputData.java, + src/main/java/de/intevation/gnv/state/CoordinateSelectionState.java, + src/main/java/de/intevation/gnv/math/ConstantFunction.java, + src/main/java/de/intevation/gnv/math/ConstantXYDepth.java, + src/main/java/de/intevation/gnv/math/LinearMetrics.java, + src/main/java/de/intevation/gnv/math/QueriedXYDepth.java, + src/main/java/de/intevation/gnv/math/L1Comparator.java, + src/main/java/de/intevation/gnv/math/HeightValue.java, + src/main/java/de/intevation/gnv/math/Metrics.java, + src/main/java/de/intevation/gnv/math/IJKey.java, + src/main/java/de/intevation/gnv/math/LinearToMap.java, + src/main/java/de/intevation/gnv/math/Interpolation2D.java, + src/main/java/de/intevation/gnv/math/XYColumn.java, + src/main/java/de/intevation/gnv/math/Interpolation3D.java, + src/main/java/de/intevation/gnv/math/Point2d.java, + src/main/java/de/intevation/gnv/math/AreaInterpolation.java, + src/main/java/de/intevation/gnv/math/LinearFunction.java, + src/main/java/de/intevation/gnv/math/Interpolator.java, + src/main/java/de/intevation/gnv/math/GridCell.java, + src/main/java/de/intevation/gnv/math/XYDepth.java, + src/main/java/de/intevation/gnv/math/AttributedXYColumns.java, + src/main/java/de/intevation/gnv/math/AttributedPoint2ds.java, + src/main/java/de/intevation/gnv/statistics/StatisticSet.java, + src/main/java/de/intevation/gnv/statistics/VerticalCrossSectionStatistics.java, + src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java, + src/main/java/de/intevation/gnv/statistics/HorizontalProfileStatistics.java, + src/main/java/de/intevation/gnv/statistics/VerticalProfileStatistics.java, + src/main/java/de/intevation/gnv/statistics/Statistic.java, + src/main/java/de/intevation/gnv/statistics/TimeseriesVectorStatistics.java, + src/main/java/de/intevation/gnv/statistics/HorizontalProfileVectorStatistics.java, + src/main/java/de/intevation/gnv/statistics/VerticalProfileVectorStatistics.java, + src/main/java/de/intevation/gnv/statistics/Statistics.java, + src/main/java/de/intevation/gnv/statistics/VectorStatistics.java, + src/main/java/de/intevation/gnv/statistics/exception/StatisticsException.java, + src/main/java/de/intevation/gnv/statistics/AbstractStatistics.java, + src/main/java/de/intevation/gnv/transition/DefaultTransition.java, + src/main/java/de/intevation/gnv/transition/TransitionFactory.java, + src/main/java/de/intevation/gnv/transition/TransitionBase.java, + src/main/java/de/intevation/gnv/transition/PresettingsValueCompareTransition.java, + src/main/java/de/intevation/gnv/transition/Transition.java, + src/main/java/de/intevation/gnv/transition/ValueCompareTransition.java, + src/main/java/de/intevation/gnv/histogram/HistogramHelper.java, + src/main/java/de/intevation/gnv/profile/horizontalcrosssection/HorizontalCrossSectionMeshArtifact.java, + src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshParallelArtifact.java, + src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshArtifact.java, + src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshCrossArtifact.java, + src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshArtifact.java, + src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileArtifact.java, + src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileInstantaneousPointArtifact.java, + src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileMeshArtifact.java, + src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileArtifact.java, + src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileInstantaneousPointArtifact.java, + src/main/java/de/intevation/gnv/raster/Raster.java, + src/main/java/de/intevation/gnv/raster/PolygonDatasetProducer.java, + src/main/java/de/intevation/gnv/raster/ExternalIndexConverter.java, + src/main/java/de/intevation/gnv/raster/AbstractProducer.java, + src/main/java/de/intevation/gnv/raster/JTSMultiLineStringProducer.java, + src/main/java/de/intevation/gnv/raster/RasterToPPM.java, + src/main/java/de/intevation/gnv/raster/IsoPolygonSeriesProducer.java, + src/main/java/de/intevation/gnv/raster/DemuxRingsHandler.java, + src/main/java/de/intevation/gnv/raster/Filter.java, + src/main/java/de/intevation/gnv/raster/IsoAttributeGenerator.java, + src/main/java/de/intevation/gnv/raster/KernelFilter.java, + src/main/java/de/intevation/gnv/raster/JTSMultiPolygonProducer.java, + src/main/java/de/intevation/gnv/raster/PaletteManager.java, + src/main/java/de/intevation/gnv/raster/Vectorizer.java, + src/main/java/de/intevation/gnv/raster/Palette.java, + src/main/java/de/intevation/gnv/raster/IsoProducer.java, + src/main/java/de/intevation/gnv/utils/FileUtils.java, + src/main/java/de/intevation/gnv/utils/IndexBuffer.java, + src/main/java/de/intevation/gnv/utils/DistanceCalculator.java, + src/main/java/de/intevation/gnv/utils/InputValidator.java, + src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java, + src/main/java/de/intevation/gnv/utils/ExclusiveExec.java, + src/main/java/de/intevation/gnv/utils/exception/ValidationException.java, + src/main/java/de/intevation/gnv/utils/MetaWriter.java, + src/main/java/de/intevation/gnv/utils/MapfileGenerator.java, + src/main/java/de/intevation/gnv/utils/WKTUtils.java, + src/main/java/de/intevation/gnv/utils/StringUtils.java, + src/main/java/de/intevation/gnv/utils/Pair.java, + src/main/java/de/intevation/gnv/utils/VectorDataProcessor.java, + src/main/java/de/intevation/gnv/utils/ShapeFileWriter.java, + src/main/java/de/intevation/gnv/chart/VerticalProfileVectorChart.java, + src/main/java/de/intevation/gnv/chart/Chart.java, + src/main/java/de/intevation/gnv/chart/DefaultHistogram.java, + src/main/java/de/intevation/gnv/chart/XMLChartTheme.java, + src/main/java/de/intevation/gnv/chart/HorizontalCrossProfileChart.java, + src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java, + src/main/java/de/intevation/gnv/chart/exception/TechnicalChartException.java, + src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java, + src/main/java/de/intevation/gnv/chart/TimeSeriesVectorChart.java, + src/main/java/de/intevation/gnv/chart/HorizontalProfileVectorChart.java, + src/main/java/de/intevation/gnv/chart/AbstractHistogram.java, + src/main/java/de/intevation/gnv/chart/ChartLabels.java, + src/main/java/de/intevation/gnv/chart/AbstractChart.java, + src/main/java/de/intevation/gnv/chart/AdvancedHistogramDataset.java, + src/main/java/de/intevation/gnv/chart/VerticalCrossSectionChart.java, + src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java, + src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java, + src/main/java/de/intevation/gnv/exports/Export.java, + src/main/java/de/intevation/gnv/exports/ShapeDataCollector.java, + src/main/java/de/intevation/gnv/exports/ChartExportHelper.java, + src/main/java/de/intevation/gnv/exports/SimpleOdvDataCollector.java, + src/main/java/de/intevation/gnv/exports/DefaultDataCollector.java, + src/main/java/de/intevation/gnv/exports/DefaultProfile.java, + src/main/java/de/intevation/gnv/exports/DefaultExport.java, + src/main/java/de/intevation/gnv/exports/ODVExport.java, + src/main/java/de/intevation/gnv/exports/StringArrayKey.java, + src/main/java/de/intevation/gnv/exports/VerticalCrossODVExport.java, + src/main/java/de/intevation/gnv/wms/LayerInfo.java, + src/main/java/de/intevation/gnv/timeseries/TimeSeriesMeshArtifact.java, + src/main/java/de/intevation/gnv/timeseries/gap/TimeGap.java, + src/main/java/de/intevation/gnv/timeseries/gap/DefaultTimeGap.java, + src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java, + src/main/java/de/intevation/gnv/layer/LayerArtifact.java, + src/main/java/de/intevation/gnv/jfreechart/LevelOrderIndices.java, + src/main/java/de/intevation/gnv/jfreechart/PolygonSeries.java, + src/main/java/de/intevation/gnv/jfreechart/PolygonPlot.java, + src/main/java/de/intevation/gnv/jfreechart/CompactXYItems.java, + src/main/java/de/intevation/gnv/jfreechart/PolygonSeriesLabelGenerator.java, + src/main/java/de/intevation/gnv/jfreechart/PolygonDataset.java, + src/main/java/de/intevation/gnv/jfreechart/PolygonRenderer.java, + bin/run.sh: Added license header to each these files. + + * LGPL.txt: Added license file of the GNU LGPL v2.1 + +2010-06-30 Ingo Weinzierl + + RELEASE 1.1 + + * ChangeLog, Changes, NEWS: Summarized changes. + +2010-06-30 Ingo Weinzierl + + Issue320 + + * src/main/java/de/intevation/gnv/chart/AdvancedHistogramDataset.java: The + minimum number of bins in an histogram is set to 1. If the user has chosen + a value for the class width that results in number < 1, the bin number is + set to 1. + +2010-06-29 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java: + Write missing bbox into meta file while WMS publishing - the missing bbox + prevented the map from initializing properly and it wasn't displayed in + the gui. + +2010-06-29 Ingo Weinzierl + + Issue315, Issue314 + + * src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java, + src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java: All + generated wms layers will now have a prefix 'GNV_'. On this way, we can + ensure that the name of wms layers never start with a digit. This is + necessary to prevent the mapserver from generating invalid xml while + creating a GetFeatureInfo response (mapserver generates xml elements from + layer names - xml nodes may not start with a digit!). + +2010-06-29 Ingo Weinzierl + + Issue318 + + * doc/conf/products/verticalcrosssection/conf_mesh_parallel.xml: Transition + bugfix: Given points from mapviewer call are now taken into account as + well. + +2010-06-29 Ingo Weinzierl + + Issue286 + + * src/main/java/de/intevation/gnv/utils/InputValidator.java: Added a buffer + of 1 second for the valid time range. The valid values that are returnd + from database differ in milliseconds. Example: the lower time returned + from database is 00:00:00.650, the gui will display 00:00:00. This caused + an error because the data given by the user was 650 ms under the lower + bound. With a 1 second range, the lower bound is moved to 23:59:59.650, so + that the time given by the user is in the valid range. + +2010-06-29 Tim Englich + + Issue318 + + * doc/conf/products/verticalcrosssection/conf_mesh_parallel.xml: + Removed duplicate xmlns:xlink definition. + +2010-06-29 Ingo Weinzierl + + Issue316 + + * src/main/java/de/intevation/gnv/chart/DefaultHistogram.java: Set the + specified locale in the constructor which is used to localize the axes. + + * src/main/java/de/intevation/gnv/chart/AbstractHistogram.java: Adjust the + localization of x and y axes corresponding the specified locale. + +2010-06-29 Ingo Weinzierl + + Issue318 + + * doc/conf/products/verticalcrosssection/conf_mesh_parallel.xml: Added + transition chain for the external mapviewer call. + +2010-06-28 Ingo Weinzierl + + Issue284 + + * doc/conf/queries.properties: Added missing column MESHID to chart data + query for product 'Horizontales Schnittprofil'. This column is required + by the csv export of this product. + +2010-06-28 Ingo Weinzierl + + Issue233 + + * src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java: Fixed + the range calculation for y-axes if there is only a single datapoint + existing in the chart. + +2010-06-28 Tim Englich + + Issue283: + + * src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java (getRequestedLayerMetadata): + Bugfix: Now geometries of the generated layers will also be clipped if a + polygon served by the mv-gnv-interface should be used. + +2010-06-28 Ingo Weinzierl + + Issue281 + + * src/main/java/de/intevation/gnv/state/MeasurementState.java: Fixed an + ArrayIndexOutOfBounds exception that occured while initializing the + ParameterMatrix. + +2010-06-28 Ingo Weinzierl + + Issue230 + + * doc/conf/queries.properties: Removed multiplication of depth value with + factor -1 for odv queries on vertical profiles. + +2010-06-28 Ingo Weinzierl + + Issue300 + + * doc/conf/products/verticalcrosssection/conf_mesh_parallel.xml: Fixed + broken transition. The transition chain ended after choosing a subarea; + now it leads to the coordinate selection. + +2010-06-15 Tim Englich + + ISSUE299v + + * doc/conf/products/horizontalprofile/conf_mesh.xml: + Bugfix: Change multiselect to false for the Parameter-State of + vector-values. It is not possible to render more than one Parameter if + vector-values are used. + +2010-06-15 Tim Englich + + ISSUE299 + + * doc/conf/products/verticalprofile/conf_mesh.xml: + Bugfix: Change multiselect to false for the Parameter-State of + vector-values. It is not possible to render more than one Parameter if + vector-values are used. + +2010-06-15 Tim Englich + + * src/main/resources/lang/artifactMessages_en.properties, + src/main/resources/lang/artifactMessages.properties: + Fixed typo. Scalar Values will now be written capitalized. + +2010-06-15 Tim Englich + + ISSUE297 + + * src/main/resources/lang/artifactMessages*.properties: + Added localized exceptionmessage for MinMaxState. + + * src/main/java/de/intevation/gnv/state/MinMaxState.java (feed): + Localized exceptionmessage which will be displayed in the GUI of the GNV + Web-Client. + +2010-06-14 Ingo Weinzierl + + * pom.xml: Write svn revision to MANIFEST file while creating jar archive. + +2010-06-14 Ingo Weinzierl + + Issue250 - Adjusted subtitle of 'Achsenparalleles Vertikalprofil' + + * src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionParallelOutputState.java: + Adapted the subtitle of charts from type 'Achsenparalleles + Vertikalprofil'. + +2010-06-14 Ingo Weinzierl + + * doc/conf/products/verticalcrosssection/conf_mesh_parallel.xml: Renamed + parameter 'coordinate' to 'mesh_coordinate', because the strings shown in + the gui depend on the parameter names. 'mesh_coordinate' matches + "Geographische Position (z.B. 56n30 6e20)" in the german resource bundle. + "Koordinate" has been displayed before this change has taken place. + +2010-06-12 Ingo Weinzierl + + * doc/conf/products/horizontalprofile/conf_mesh_parallel.xml: Configuration + for the new product 'Achsenparalleler Vertikalschnitt'. + + * doc/conf/queries.properties: A new sql statement to query all points of a + given axis of a mesh. + + * doc/conf/conf.xml: Added the new product to fis 'Modeldaten'. + + * src/main/resources/lang/artifactMessages.properties, + src/main/resources/lang/artifactMessages_de_DE.properties, + src/main/resources/lang/artifactMessages_en.properties, + src/main/resources/lang/artifactMessages_de.properties: Added a name for + the new product 'Achsenparalleler Vertikalschnitt'. + + TODO: Find an english name for this product! + +2010-06-12 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshParallelArtifact.java: + A new artifact that is used for the product 'Achsenparalleler + Vertikalschnitt'. + + * src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java: + The determination of the linestring that is used in the interpolation is + outsourced to an own method. This makes it possible to be overriden by + subclasses. + + * src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionParallelOutputState.java: + Inherits of VerticalCrossSectionOutputState. It overrides the linestring + determination. In this product, no linestring is given by user input but + an axis of the mesh is selected. The linestring is made up by the point of + this axis. + +2010-06-10 Ingo Weinzierl + + Issue286 - Input validation of time ranges + + * src/main/java/de/intevation/gnv/utils/InputValidator.java: Removed the + epsilon that has been used to compare time values. Now, we just compare + the seconds of a time value pair - background: datetime objects differ in + milliseconds. + +2010-06-10 Ingo Weinzierl + + Issue290 - Centering of pdf exports + + * src/main/java/de/intevation/gnv/exports/ChartExportHelper.java: PDF + exports of histograms are centered now. + +2010-06-10 Ingo Weinzierl + + Issue290 - Centering of pdf exports + + * src/main/java/de/intevation/gnv/exports/ChartExportHelper.java: PDF + exports of charts are centered now. + +2010-06-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/chart/VerticalProfileVectorChart.java, + src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java: Improved + data initialization and range calculation. Gap detection will be entered, + if start and end position are valid indices for the array that contains + the data. The x and y range for each axis is improved. + +2010-06-09 Ingo Weinzierl + + * doc/conf/products/timeseries/conf_mesh.xml, + doc/conf/products/timeseries/conf_timeseriespoint.xml, + doc/conf/products/horizontalprofile/conf_mesh.xml, + doc/conf/products/verticalprofile/conf_mesh.xml, + doc/conf/products/verticalprofile/conf_timeseriespoint.xml: Limited + parameterization so that just a single vector can be selected at the same + time. + +2010-06-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileVectorOutputState.java: + Overide method getHistograms(.) to create histograms for + verticalprofiles that contain the components of vectorial parameters. + +2010-06-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshVectorOutputState.java: + Overide method getHistograms(.) to create histograms for + horizontalprofiles that contain the components of vectorial parameters. + +2010-06-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesVectorOutputState.java: + Override method getHistograms(.) of TimeSeriesOutputState to create + histograms that contain the components of vectorial parameters. This + method doesn't have many tasks but calls getHistograms(.) of + VectorDataProcessor. + + * src/main/java/de/intevation/gnv/utils/VectorDataProcessor.java: The real + implementation of getHistograms(.) for creating histograms that contain + the components of vectorial parameters. This place was chosen to make it + possible to use this method in all vector output states (because multiple + inheritance is not available in Java). + + * src/main/java/de/intevation/gnv/histogram/HistogramHelper.java: + A new method to prepare the data for histograms that contain the + components of vectorial parameters. + +2010-06-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java: + Seperated the histogram creation into an own method. This enables + subclasses to override the histogram creation. Moved the method + createHistogramLabels(.) to HistogramHelper. + + * src/main/java/de/intevation/gnv/histogram/HistogramHelper.java: + New method to create histogram labels (moved from TimeSeriesOutputState). + +2010-06-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/statistics/VerticalProfileVectorStatistics.java: + This class created statistics for vertical proifles with vectorial + parameters. + + * src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileVectorOutputState.java: + Added a new method that returns an instance of + VerticalProfileVectorStatistics. + +2010-06-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/statistics/HorizontalProfileVectorStatistics.java: + This is a class to create statistics for horizontal profiles with + vectorial parameters. + + * src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshVectorOutputState.java: + Added a new method to return an instance of + HorizontalProfileVectorStatistics. + + * src/main/java/de/intevation/gnv/statistics/TimeseriesVectorStatistics.java, + src/main/java/de/intevation/gnv/statistics/VectorStatistics.java: Added a + method to clean the statistics for the next vector component. + +2010-06-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/statistics/VectorStatistics.java: This is + an abstract base class for statistics of vectorial parameters. There are + two methods that need to be overriden by subclasses. + + * src/main/java/de/intevation/gnv/statistics/TimeseriesVectorStatistics.java: + A concrete statistics class for timeseries statistics of vectorial + parameters. + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesVectorOutputState.java: + Added a new method that returns an instance of TimeseriesVectorStatistics + to create a statistic for this product type. + +2010-06-08 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshVectorOutputState.java: + Added odv support for horizontal profiles using vector data. + +2010-06-08 Ingo Weinzierl + + * doc/conf/products/horizontalprofile/conf_mesh.xml: Added the transitions + for horizontal profiles on meshes that make use of vector data. + +2010-06-08 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshVectorOutputState.java: + A new output state for horizontal profiles using vector data. + + * src/main/java/de/intevation/gnv/chart/HorizontalProfileVectorChart.java: A + new horizontal profile chart type using vector data. + +2010-06-07 Ingo Weinzierl + + * doc/conf/products/verticalprofile/conf_mesh.xml, + doc/conf/products/verticalprofile/conf_timeseriespoint.xml: Added + transitions for working with vertical profiles that contain vector data. + +2010-06-07 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileMeshVectorOutputState.java: + A new output state for verticalprofiles on meshes that contain vector + data. + +2010-06-07 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/utils/VectorDataProcessor.java: The + columns used for the final ResultDescriptor are no longer configured here + - they need to be configured in the output states of each product. The + VectorDataProcessor is called with the data collection and these columns + now (so the method signature of process(.) changed). + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesVectorOutputState.java: + Configured ResultDescriptor columns here and adapted method call of + VectorDataProcessor.process(.). + + * src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileVectorOutputState.java: + This output state is used while working vector data on verticalprofiles. + Before a chart is generated by this state, the vector data are converted + using VectorDataProcessor. + + * src/main/java/de/intevation/gnv/chart/VerticalProfileVectorChart.java: A + new chart type used for verticalprofiles with vector data. + + * doc/conf/queries.properties: A parameter of an sql statement got a name. + +2010-06-07 Tim Englich + + Added functionality to publish the the mbr of the generated layer to + the client. + * src/main/java/de/intevation/gnv/utils/MetaWriter.java (insertMbr): + Added function to add an box-element to the mapserver-fragmet of the + Metafile + * src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java, + src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java: + Calculate the box and write it into the metafile using the insertMbr-method + of MetaWriter to publish the mbr of the data which was fetched during the + request to the client. + +2010-06-07 Tim Englich + + * doc/conf/conf.xml: + Revert wrong Commit Revision 1163. + +2010-06-07 Tim Englich + + * doc/conf/maptemplates/horizontalcrosssection_*.vm, + doc/conf/maptemplates/layer_polygon.vm, + doc/conf/maptemplates/layer_point.vm, + doc/conf/maptemplates/layer_linestring.vm: + Added Configuration Elements TEMPLATE, DUMP, TOLERANCE and + METADATA/gml_include_items to enable GetFeatureInforRequests using gml + as INFO_FORMAT for products of type layer. + +2010-06-07 Tim Englich + + * doc/conf/maptemplates/mapfile.vm: + Added MAXSIZE to the mapfiletemplate so that it is possible to render the + layer in the fullscreenmode of a mapclient which will request images that + size are greater than 2048 Pixel. + +2010-06-04 Ingo Weinzierl + + * doc/conf/products/timeseries/conf_mesh.xml: Added vector support for + timeseries points on meshes. + +2010-06-04 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifacts/cache/CacheFactory.java: The + ehcache CacheManager and the MBeanServer of the JVM are connected so that + the statistics of the cache is available as MBean in JConsole. + +2010-06-03 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java: + Removed needless imports. + +2010-06-03 Ingo Weinzierl + + * doc/conf/sql-cache.xml: SQL-cache configuration. + + * doc/conf/conf.xml: Added a new section to the geo-backend section to + configure, enable/disable the sql-cache. The sql-cache is activated in + the default configuration. + + * src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java: + Removed the initialization of geo-backend related objects (as ArcSDE + connection settings, queries). This work is done in the geo-backend + itself, now. At this place, a new geo-backend Configuration object is + created and its init(.) method is called. + +2010-06-02 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java: Remove + cached elements of each state that is visited while stepping back to a + previous state. + +2010-06-01 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java: Do not + call endOfLife of the current state before advancing to the next state. + This would make it impossible to use the cache. + +2010-06-01 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/state/StateBase.java: Remove existing + elements from cache that belong to an outdated state if its enfOfLife(.) + is called. It was necessary to adapt the signature of getHash(.) for this + - removed the parameter uuid - because endOfLife is called without any + information about the current uuid. The uuid has not been used in + getHash() anyway. + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesVectorOutputState.java, + src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java, + src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java, + src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java, + src/main/java/de/intevation/gnv/state/OutputStateBase.java: Adapted the + signature of getHash() regarding the changes in the implementing class + StateBase. + +2010-05-31 Tim Englich + + * doc/conf/queries.properties: + Added queries for TimeSeriesPoints using vectorvalues for verticalprofiles. + +2010-05-28 Ingo Weinzierl + + Issue291 + + * src/main/java/de/intevation/gnv/exports/ODVExport.java: Fixed the + aggregation of parameters. + +2010-05-27 Ingo Weinzierl + + Issue198 + + * src/main/java/de/intevation/gnv/utils/MetaWriter.java: Product 'Layer' and + 'Horizontalschnitt' use the same code to write meta files. To create a + meta file, it is now necessary to use four methods: + - initMeta(): creates a new xml document and inserts the root node 'meta' + - insertAbstractMeta(.): adds meta information into the meta file + - insertLayer(.): adds layer specific information into the meta file + - writeMetaFile(.): writes the meta information file to disk. + + * src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java, + src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java: Make + use of the new methods of MetaWriter. Both classes use the same methods + now! + + * doc/conf/queries.properties: Fetch the layername from database while + requesting wms data. + + * src/main/java/de/intevation/gnv/state/layer/LayerMetaData.java: Added the + title of a layer. The title is used while creating the meta information + file for wms layers. + + * doc/conf/maptemplates/horizontalcrosssection_salinity.vm, + doc/conf/maptemplates/horizontalcrosssection_salinity_isolines.vm, + doc/conf/maptemplates/layer_linestring.vm, + doc/conf/maptemplates/horizontalcrosssection_flow-velocity.vm, + doc/conf/maptemplates/horizontalcrosssection_flow-velocity_isolines.vm, + doc/conf/maptemplates/horizontalcrosssection_water-levels.vm, + doc/conf/maptemplates/layer_polygon.vm, + doc/conf/maptemplates/horizontalcrosssection_water-temperature.vm, + doc/conf/maptemplates/layer_point.vm, + doc/conf/maptemplates/horizontalcrosssection_water-levels_isolines.vm, + doc/conf/maptemplates/horizontalcrosssection_water-temperature_isolines.vm: + Adjusted the templates regarding the changes in meta file. Each parameter + that is necessary in these templates is contained in the LayerInfo object. + So there is no need to concatenate parameters as it was the case before + these changes. Furthermore, there is a new section that contains the title + of a layer - the title is adjustable by the user. + +2010-05-27 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/exports/ChartExportHelper.java: Fixed a + bug while exporting charts and histograms to pdf. Charts/histograms that + are larger than the pdf page have been cut. The reason was a usage of + wrong values when creating the graphics area for the charts/histograms. + +2010-05-27 Ingo Weinzierl + + Issue288 + + * src/main/java/de/intevation/gnv/chart/DefaultHistogram.java: Use + AdvancedHistogramDataset as dataset for histograms instead of JFreeChart's + HistogramDataset. Adjusted the calculation of bin width and number of bins + for this. + + * src/main/java/de/intevation/gnv/chart/AdvancedHistogramDataset.java: This + class is mainly a copy of JFreeChart's class HistogramDataset. The + difference between these two classes is, that AdvancedHistogramDataset + takes an argument for setting the bin width as well as an argument to + adjust the number of bins - HistogramDataset just takes the number of + bins. The reason why AdvancedHistogramDataset doesn't inherit from + HistogramDataset is, that basic attributes of that class have private + access. + +2010-05-26 Ingo Weinzierl + + Issue289 + + * src/main/java/de/intevation/gnv/chart/DefaultHistogram.java: Values + specifying the bin width or the number of bins are inserted into this + histogram as double values - no longer as i18n strings. So the complete + parsing code is removed. + +2010-05-26 Ingo Weinzierl + + Issue290 - PDF format of histograms depends on histograms' apsect ratio. + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java: + Removed the boolean parameter to adjust the page format when calling the + pdf export method of a histogram. + + * src/main/java/de/intevation/gnv/exports/ChartExportHelper.java: The format + of a histogram depends on its width and height. Width and height depends + on user input or the default size (600x400). + +2010-05-26 Ingo Weinzierl + + Issue290 - PDF format depends on the chart's aspect ratio. + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java: + Removed reading the system property "export.pdf.landscape" to adjust the + page format of a pdf. + + * src/main/java/de/intevation/gnv/exports/ChartExportHelper.java: The page + format of a pdf now depends on the chart's aspect ratio. If width > height + the format will be landscape, otherwise the format will be portrait. + +2010-05-25 Ingo Weinzierl + + Issue286 + + * src/main/java/de/intevation/gnv/utils/InputValidator.java: Introduced an + epsilon environment to be more tolerant while comparing date objects. The + value of the current epsilon is 750ms. + +2010-05-25 Ingo Weinzierl + + Issue290 + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java: + Added chart width and chart height as new parameters for the pdf creation. + + * src/main/java/de/intevation/gnv/exports/ChartExportHelper.java: Don't use + the maximum size of a pdf page to draw the chart but use the parameter + chart width and chart height. Scale the chart down if its size and/or + height exceed the maximum size of the pdf page - the original aspect + ratio keeps alive. + +2010-05-25 Ingo Weinzierl + + Issue287 + + * src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java: + Corrected the distance calculation of a 'Horizontal Profil' and adjusted + the gap detection according to these changes. + +2010-05-24 Ingo Weinzierl + + Issue290 + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java: + The size of an svg export depends on the size chosen by the user (or the + default size if the user did not change the size) - it is not fixed + anymore. + +2010-05-21 Tim Englich + + * doc/conf/queries.properties: + Added queries for meshes using vectorvalues for "Horizontales Schnittprofil" + +2010-05-21 Tim Englich + + * doc/conf/queries.properties: + Added queries for meshes using vectorvalues for horizontalprofiles. + +2010-05-21 Tim Englich + + * doc/conf/queries.properties: + Added queries for meshes using vectorvalues for verticalprofiles. + +2010-05-21 Ingo Weinzierl + + Issue269 + + * src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java: + Improved the directory handling for wms requests (directories are created + if there is no directory existing for the shapefiles; the content of + directories is deleted if the directory is existing). The shapefiles are + always generated again as well if there is an directory existing and it + contains files - we cannot know if these files are shapefiles that have + been created by our application. + +2010-05-21 Tim Englich + + * doc/conf/queries.properties: + Added queries for Meshes using Vectorvalues for TimeSeries. + +2010-05-21 Tim Englich + + * doc/conf/queries.properties: + Integrated View MEDIAN.TIMESERIESFULLVECTORVALUE in queries for fetching + the data for Charts and ODV-Export on TimeSeriesPoints using vetcor data. + +2010-05-20 Ingo Weinzierl + + Issue27 - Implemented odv export for vector data of timeseriespoints. + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesVectorOutputState.java: + Implemented the odv export for vector data on timeseriespoints.Therefore, + the getData(.) method for processing vector data has been removed. The + processing needs to take place after getData(.) fetched the data from + database, because it's not necessary to process vector data used for an + odv export (which is fetched via getData(.) as well). + +2010-05-19 Ingo Weinzierl + + Issue27 - Vector data support for timeseriespoints finished. + + * doc/conf/products/timeseries/conf_timeseriespoint.xml: Adjusted the + relevant OutputState for timeseries with components of vector data. + + * src/main/java/de/intevation/gnv/utils/VectorDataProcessor.java: A helper + class that converts vector data into a useful container for our chart + classes. Our chart classes just use one single data value of each Result + object - but there is a data value for each component of a vector. So we + need to split Result object into many Result objects - one for each vector + component. + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesVectorOutputState.java: + Inherits from TimeSeriesOutputStates. Currently, the only reason for this + class is to instantiate TimeSeriesVectorChart objects instead of + TimeSeriesChart objects. + + * src/main/java/de/intevation/gnv/chart/TimeSeriesVectorChart.java: This + chart type inherits from TimeSeriesChart. The only difference between + these two types is the way how to add datasets and how to create names for + series - most of the code is equal. + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java: + Timegap definitions have protected access now. + +2010-05-19 Ingo Weinzierl + + * doc/conf/products/timeseries/conf_timeseriespoint.xml: Added the vector + value path. + +2010-05-18 Ingo Weinzierl + + Issue27 - First step to provide vector values. + + * doc/conf/products/timeseries/conf_timeseriespoint.xml: Added a further + step to choose between vector or scalar values. + + TODO: Configure the parameterization path for working with vector values. + + * src/main/java/de/intevation/gnv/state/SwitchModeState.java: A new state + that allows users to choose between scalar or vector values. + + * src/main/java/de/intevation/gnv/state/StateBase.java, + src/main/java/de/intevation/gnv/state/MeasurementState.java, + src/main/java/de/intevation/gnv/state/DefaultAutoResumeState.java, + src/main/java/de/intevation/gnv/state/SingleInputState.java: Adjusted + method signature of getDescriptionForInputData(.) - added the CallContext + as further parameter that is necessary to retrieve the current locale. + + * src/main/resources/lang/artifactMessages.properties, + src/main/resources/lang/artifactMessages_de_DE.properties, + src/main/resources/lang/artifactMessages_en.properties, + src/main/resources/lang/artifactMessages_de.properties: Added labels for + the user interface. + +2010-05-18 Tim Englich + + * doc/conf/queries.properties: + Added queries for TimeSeriesPoints on Vectorvalues for TimeSeries. + +2010-05-17 Tim Englich + + * src/main/java/de/intevation/gnv/state/cache/package.html, + src/main/java/de/intevation/gnv/state/cache/QueryObject.java: + Add more JavaDocs. + +2010-05-10 Tim Englich + + * doc/conf/products/timeseries/timegap_definition.xml: + Added Documentation for the definition of gaps in TimeSeries on + TimeSeriesPoints. Also added the reference to the Place where the + definitions are taken. + +2010-05-10 Ingo Weinzierl + + Issue260 (Implemented an odv export for 'Horizontales Schnittprofil') + + * doc/conf/products/horizontalprofile/conf_mesh_cross.xml: Added odv as + further export format of product type 'Horizontales Schnittprofil'. + + * src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java: + Implemented an odv exporter for this product type. + + * src/main/java/de/intevation/gnv/exports/StringArrayKey.java: Added a + getKey() method to be able to retrieve the key of such objects. + +2010-05-07 Hans Plum + + * doc/conf/queries.properties: + Added a comment after implementing the admin tables for cache cleaner + +2010-05-06 Ingo Weinzierl + + * contrib/mapserv, + contrib/gnv-wms: Renamed mapserv to gnv-wms relating to the configuration + changes in rev1068. + +2010-05-06 Hans Plum + + * doc/conf/conf.xml: + Adapted path to gnv-wrapper after changing it upstream. + +2010-05-06 Ingo Weinzierl + + Issue264 & Issue268 (Removed bugs in the caching mechanism) + + * src/main/java/de/intevation/gnv/state/DefaultInputData.java: Implemented + hashCode() and equals(.) method. The hashCode() method is used while + creating hashes for caching elements (see StateBase). + + * src/main/java/de/intevation/gnv/state/StateBase.java: Improved hash + creation. The hashes are used as keys for the caching mechanism. The key + contains the uuid of the current artifact, the state id and a hash code + created by InputData elements. User input is stored in a TreeMap instead + of a HashMap, because the elements in a TreeMap are sorted. This is very + import for us, because we need a defined order to create equal hashes if + the input data elements, uuid and state id are equal. + + * src/main/java/de/intevation/gnv/state/MeasurementState.java: Replaced the + HashMap to store user input with a TreeMap which elements are sorted. + + * src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java, + src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java: + Added some more debug output that shows the usage of the cache. + + * src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java: + Removed a critical bug that avoided using this product type if no cache + have been initialized. + + * src/main/java/de/intevation/gnv/state/OutputStateBase.java: Adjusted + getHash(.) method call. + +2010-05-04 Tim Englich + + * doc/conf/conf.xml: + Do some Documentation of the Artifact-Database. + +2010-05-04 Tim Englich + * src/main/java/de/intevation/gnv/artifacts/fis/SelectProductArtifact.java (appendSelectProducts): + BUGFIX: Added NULL-Check to Variable products to prevent NPEs if + no Products are configured to the FIS. + * src/main/java/de/intevation/gnv/artifacts/GNVProductArtifactFactory.java (parseProductFactories): + BUGFIX: Trim Classname to prevent ClassNotFound-Exceptions if the + Configuration contains whitespaces in the XML-Element which configures the + Artifact. + 2010-04-28 Ingo Weinzierl * doc/conf/maptemplates/layer_polygon.vm: Do not use point symbols to draw @@ -5,6 +1087,8 @@ 2010-04-28 Ingo Weinzierl + RELEASE 1.0 + * NEWS, Changes: Summarized changes. 2010-04-28 Ingo Weinzierl diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/Changes --- a/gnv-artifacts/Changes Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/Changes Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,42 @@ +2010-06-30 RELEASE 1.1 + + NEW: + + * New product: 'Achsenparalleles Vertikalprofil' + * Support for products with vectorial parameters (#27) + * Integrated configuration section for sql-cache + * Statistics of ehcaches are available as MBean using JConsole + * N-Step back history for the parameterization + * ODV export for product 'Horizontales Schnittprofil' (#260) + * MANIFEST contains svn buildnumbers + + FIXES: + + * Corrected chart titles (#138, #120) + * Fixed defect range calculation for chart axes (#233) + * Corrected distance calculation in product 'Horizontalprofil' (#287) + * Fixed bin width calculation in histograms (#288) + * Changing width/height of charts ended in Stacktace (#294) + * Multi layer selection for product 'Layer' (#252) + * Renaming a layer just changes its title (#198), + * WMS layers now have a prefix 'GNV_' (#315, #314) + * Disabled multi selection for vectorial parameter (#299) + * Fixed broken transition chain of 'Achsenparalleler + Vertikalprofil' (#300, #318, #154) + * Fixed ODV export that created invalid odv files (#291) + * Added missing column for csv export for product 'Horizontales + Schnittprofil' (#284) + * Depths have negative values in odv exports (#230) + * Keep aspect ratio in PDF/SVG exports (#290) + * Fixed hash creation for caching elements (#264, #268) + * Further JavaDoc (#274) + * Fixed discrepancy in parameter matrix between parameter values and + description (#281) + * Fixed broken geometry clipping (#283) + * Fixed user input validation (#286, #289) + * Exception handling improvements (#188, #251, #265, #18, #269, #266) + + 2010-04-28 RELEASE 1.0 NEW: diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/LGPL.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/LGPL.txt Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/NEWS --- a/gnv-artifacts/NEWS Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/NEWS Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,16 @@ +2010-06-30 RELEASE 1.1 + + * Integration of a new product 'Achsenparalleles Vertikalprofil' + + * Support for vectorial parameters + + * Configuration supports the usage of an sql-cache + + * Evaluable cache statistics + + * Parameterization supports an N-Step-Back history + + 2010-04-28 RELEASE 1.0 NEW: diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/bin/run.sh --- a/gnv-artifacts/bin/run.sh Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/bin/run.sh Fri Sep 28 12:15:22 2012 +0200 @@ -1,5 +1,11 @@ #!/bin/bash +# Copyright (c) 2010 by Intevation GmbH\ +# +# This program is free software under the LGPL (>=v2.1)\ +# Read the file LGPL.txt coming with the software for details\ +# or visit http://www.gnu.org/licenses/ if it does not exist.\ + DIR=`dirname $0`/.. CLASSPATH= for l in `find -name \*.jar -print`; do diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/contrib/gnv-wms --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/contrib/gnv-wms Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,3 @@ +#!/bin/sh +export MS_MAPFILE=/opt/artifacts/mapfiles/mapfile.map +./mapserv-gp diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/contrib/mapserv --- a/gnv-artifacts/contrib/mapserv Fri Sep 28 12:13:58 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,3 +0,0 @@ -#!/bin/sh -export MS_MAPFILE=/opt/artifacts/mapfiles/mapfile.map -./mapserv-gp diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/contrib/palette2polygonVM.xsl --- a/gnv-artifacts/contrib/palette2polygonVM.xsl Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/contrib/palette2polygonVM.xsl Fri Sep 28 12:15:22 2012 +0200 @@ -1,4 +1,15 @@ + + + + + de.intevation.gnv.artifacts.context.GNVArtifactContextFactory + de.intevation.gnv.artifacts.GNVProductArtifactFactory de.intevation.gnv.artifacts.GNVProductArtifactFactory + + + de.intevation.gnv.artifacts.GNVArtifactFactory + + + + + de.intevation.gnv.artifacts.GNVArtifactFactory @@ -436,6 +447,8 @@ + + @@ -498,7 +511,7 @@ - + ${artifacts.config.dir}/maptemplates @@ -508,10 +521,13 @@ - + + + @@ -529,6 +545,9 @@ Queries of the System are stored. --> ${artifacts.config.dir}/arcsdeconnectionpool.properties ${artifacts.config.dir}/queries.properties + + ${artifacts.config.dir}/sql-cache.xml + @@ -540,6 +559,8 @@ 60000 + SA jdbc:h2:${artifacts.config.dir}/../artifactdb/artifacts.db diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_flow-velocity.vm --- a/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_flow-velocity.vm Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_flow-velocity.vm Fri Sep 28 12:15:22 2012 +0200 @@ -1,8 +1,15 @@ LAYER - NAME "$info.getTitle()" - GROUP "$info.getTitle()" + NAME "$info.getName()" TYPE $info.getType() - DATA "${info.getName()}/${info.getData()}" + DATA "${info.getData()}" STATUS $info.getStatus() + TEMPLATE map.html + DUMP TRUE + + METADATA + "wms_title" "$info.getTitle()" + "gml_include_items" "all" + END + #include("flow-velocity_polygons.class.vm") END diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_flow-velocity_isolines.vm --- a/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_flow-velocity_isolines.vm Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_flow-velocity_isolines.vm Fri Sep 28 12:15:22 2012 +0200 @@ -1,9 +1,17 @@ LAYER - NAME "$info.getTitle()_isolines" - GROUP "$info.getTitle()" - DATA "${info.getName()}/${info.getData()}" + NAME "$info.getName()" + DATA "$info.getData()" TYPE $info.getType() STATUS $info.getStatus() LABELITEM DESC + TEMPLATE map.html + TOLERANCE 10 + DUMP TRUE + + METADATA + "wms_title" "$info.getTitle()" + "gml_include_items" "all" + END + #include("flow-velocity_isolines.class.vm") END diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_salinity.vm --- a/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_salinity.vm Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_salinity.vm Fri Sep 28 12:15:22 2012 +0200 @@ -1,8 +1,15 @@ LAYER - NAME "$info.getTitle()" - GROUP "$info.getTitle()" + NAME "$info.getName()" TYPE $info.getType() - DATA "${info.getName()}/${info.getData()}" + DATA "$info.getData()" STATUS $info.getStatus() + TEMPLATE map.html + DUMP TRUE + + METADATA + "wms_title" "$info.getTitle()" + "gml_include_items" "all" + END + #include("salinity_polygons.class.vm") END diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_salinity_isolines.vm --- a/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_salinity_isolines.vm Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_salinity_isolines.vm Fri Sep 28 12:15:22 2012 +0200 @@ -1,9 +1,17 @@ LAYER - NAME "$info.getTitle()_isolines" - GROUP "$info.getTitle()" - DATA "${info.getName()}/${info.getData()}" + NAME "$info.getName()" + DATA "$info.getData()" TYPE $info.getType() STATUS $info.getStatus() LABELITEM DESC + TEMPLATE map.html + TOLERANCE 10 + DUMP TRUE + + METADATA + "wms_title" "$info.getTitle()" + "gml_include_items" "all" + END + #include("salinity_isolines.class.vm") END diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_water-levels.vm --- a/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_water-levels.vm Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_water-levels.vm Fri Sep 28 12:15:22 2012 +0200 @@ -1,8 +1,15 @@ LAYER - NAME "$info.getTitle()" - GROUP "$info.getTitle()" + NAME "$info.getName()" TYPE $info.getType() - DATA "${info.getName()}/${info.getData()}" + DATA "$info.getData()" STATUS $info.getStatus() + TEMPLATE map.html + DUMP TRUE + + METADATA + "wms_title" "$info.getTitle()" + "gml_include_items" "all" + END + #include("water-levels_polygons.class.vm") END diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_water-levels_isolines.vm --- a/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_water-levels_isolines.vm Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_water-levels_isolines.vm Fri Sep 28 12:15:22 2012 +0200 @@ -1,9 +1,17 @@ LAYER - NAME "$info.getTitle()_isolines" - GROUP "$info.getTitle()" - DATA "${info.getName()}/${info.getData()}" + NAME "$info.getName()" + DATA "$info.getData()" TYPE $info.getType() STATUS $info.getStatus() LABELITEM DESC + TEMPLATE map.html + TOLERANCE 10 + DUMP TRUE + + METADATA + "wms_title" "$info.getTitle()" + "gml_include_items" "all" + END + #include("water-levels_isolines.class.vm") END diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_water-temperature.vm --- a/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_water-temperature.vm Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_water-temperature.vm Fri Sep 28 12:15:22 2012 +0200 @@ -1,8 +1,15 @@ LAYER - NAME "$info.getTitle()" - GROUP "$info.getTitle()" + NAME "$info.getName()" TYPE $info.getType() - DATA "${info.getName()}/${info.getData()}" + DATA "$info.getData()" STATUS $info.getStatus() + TEMPLATE map.html + DUMP TRUE + + METADATA + "wms_title" "$info.getTitle()" + "gml_include_items" "all" + END + #include("water-temperature_polygons.class.vm") END diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_water-temperature_isolines.vm --- a/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_water-temperature_isolines.vm Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/maptemplates/horizontalcrosssection_water-temperature_isolines.vm Fri Sep 28 12:15:22 2012 +0200 @@ -1,9 +1,17 @@ LAYER - NAME "$info.getTitle()_isolines" - GROUP "$info.getTitle()" - DATA "${info.getName()}/${info.getData()}" + NAME "$info.getName()" + DATA "$info.getData()" TYPE $info.getType() STATUS $info.getStatus() LABELITEM DESC + TEMPLATE map.html + TOLERANCE 10 + DUMP TRUE + + METADATA + "wms_title" "$info.getTitle()" + "gml_include_items" "all" + END + #include("water-temperature_isolines.class.vm") END diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/maptemplates/layer_linestring.vm --- a/gnv-artifacts/doc/conf/maptemplates/layer_linestring.vm Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/maptemplates/layer_linestring.vm Fri Sep 28 12:15:22 2012 +0200 @@ -1,9 +1,17 @@ LAYER - NAME "$info.getTitle()" + NAME "$info.getName()" TYPE $info.getType() - DATA "${info.getName()}/${info.getData()}" + DATA "$info.getData()" STATUS $info.getStatus() - + TEMPLATE map.html + TOLERANCE 10 + DUMP TRUE + + METADATA + "wms_title" "$info.getTitle()" + "gml_include_items" "all" + END + CLASS NAME "Layer" STYLE diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/maptemplates/layer_point.vm --- a/gnv-artifacts/doc/conf/maptemplates/layer_point.vm Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/maptemplates/layer_point.vm Fri Sep 28 12:15:22 2012 +0200 @@ -1,8 +1,16 @@ LAYER - NAME "$info.getTitle()" + NAME "$info.getName()" TYPE $info.getType() - DATA "${info.getName()}/${info.getData()}" + DATA "$info.getData()" STATUS $info.getStatus() + TEMPLATE map.html + TOLERANCE 10 + DUMP TRUE + + METADATA + "wms_title" "$info.getTitle()" + "gml_include_items" "all" + END CLASS NAME "Layer" diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/maptemplates/layer_polygon.vm --- a/gnv-artifacts/doc/conf/maptemplates/layer_polygon.vm Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/maptemplates/layer_polygon.vm Fri Sep 28 12:15:22 2012 +0200 @@ -1,8 +1,15 @@ LAYER - NAME "$info.getTitle()" + NAME "$info.getName()" TYPE $info.getType() - DATA "${info.getName()}/${info.getData()}" + DATA "$info.getData()" STATUS $info.getStatus() + TEMPLATE map.html + DUMP TRUE + + METADATA + "wms_title" "$info.getTitle()" + "gml_include_items" "all" + END CLASS NAME "Layer" diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/maptemplates/mapfile.vm --- a/gnv-artifacts/doc/conf/maptemplates/mapfile.vm Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/maptemplates/mapfile.vm Fri Sep 28 12:15:22 2012 +0200 @@ -2,6 +2,7 @@ NAME "GNV-Map" STATUS ON SIZE 600 400 + MAXSIZE 4000 EXTENT -1 53 11 58 UNITS DD SHAPEPATH "../shapefiles" diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh.xml --- a/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh.xml Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh.xml Fri Sep 28 12:15:22 2012 +0200 @@ -178,7 +178,7 @@ - + axisid false @@ -189,12 +189,36 @@ - + - + - + + + vectorscalar + false + + + + + + + + + + + + + + + + + + + + + verticalprofile_mesh_parameter parameterid @@ -208,12 +232,31 @@ - + + + verticalprofile_mesh_parameter_vector + parameterid + parameter + false + + + + + + + + + - + + + + + + horizontalprofile_meshpoint_depth depthid @@ -227,12 +270,31 @@ - + + + horizontalprofile_meshpoint_depth + depthid + false + + + + + + + + + + + + + + + verticalprofile_mesh_year yearid @@ -248,11 +310,31 @@ + + verticalprofile_mesh_year_vector + yearid + true + + + + + + + + + + + - + + + + + + verticalprofile_mesh_date dateid @@ -268,12 +350,33 @@ - + + + verticalprofile_mesh_date_vector + dateid + false + + + + + + + + + + + + - + + + + + + horizontalprofile_mesh_chart_data @@ -323,5 +426,54 @@ + + + horizontalprofile_mesh_chart_data_vector + horizontalprofile_mesh_odv_data_vector + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh_cross.xml --- a/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh_cross.xml Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh_cross.xml Fri Sep 28 12:15:22 2012 +0200 @@ -281,6 +281,7 @@ + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/products/timeseries/conf_mesh.xml --- a/gnv-artifacts/doc/conf/products/timeseries/conf_mesh.xml Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/products/timeseries/conf_mesh.xml Fri Sep 28 12:15:22 2012 +0200 @@ -178,9 +178,71 @@ + + + + + + vectorscalar + false + + + + + + + + + + + + + + + + + + + + + + + + timeseries_mesh_parameter + parameterid + parameter + true + + + + + + + + + + timeseries_mesh_parameter_vector + parameterid + parameter + false + + + + + + + + + + - + + + + + + timeseries_meshpoint_depth depthid @@ -190,33 +252,33 @@ - - - - - - - - - - timeseries_mesh_parameter - parameterid - parameter - true - - - - - - + + + timeseries_meshpoint_depth + depthid + false + + + + + + + + + - + - + + + + + + timeseries_mesh_interval timeinterval @@ -231,12 +293,32 @@ - + + + timeseries_mesh_interval_vector + timeinterval + false + + + + + + + + + + + - + + + + + + timeseries_mesh_chart_data timeseries_mesh_odv_data @@ -286,6 +368,56 @@ - + + + timeseries_mesh_chart_data_vector + timeseries_mesh_odv_data_vector + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/products/timeseries/conf_timeseriespoint.xml --- a/gnv-artifacts/doc/conf/products/timeseries/conf_timeseriespoint.xml Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/products/timeseries/conf_timeseriespoint.xml Fri Sep 28 12:15:22 2012 +0200 @@ -61,7 +61,7 @@ - + @@ -141,12 +141,12 @@ - + - + - + timeseries_timeseriespoint_with_area featureid @@ -158,12 +158,35 @@ - + + + + + + vectorscalar + false + + + + + + + + + + + - + + + + + + + timeseries_parameter parameterid @@ -175,12 +198,29 @@ - + + + timeseries_parameter_vector + parameterid + parameter + false + + + + + + + - + + + + + + timeseries_depth_height measurementid @@ -192,11 +232,28 @@ - + + + timeseries_depth_height_vector + measurementid + false + + + + + + + + + + + + + timeseries_interval @@ -210,12 +267,30 @@ + + + timeseries_interval_vector + timeinterval + false + + + + + + + + - + + + + + + @@ -263,6 +338,50 @@ each Parameter in each FIS can have --> - + + + timeseries_chart_data_vector + timeseries_odv_data_vector + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/products/timeseries/timegap_definition.xml --- a/gnv-artifacts/doc/conf/products/timeseries/timegap_definition.xml Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/products/timeseries/timegap_definition.xml Fri Sep 28 12:15:22 2012 +0200 @@ -1,5 +1,21 @@ + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/products/verticalcrosssection/conf_mesh_parallel.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/products/verticalcrosssection/conf_mesh_parallel.xml Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,295 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + verticalprofile_mesh_with_wkt + meshid + false + + + + + + + + + + + + + + + + area_filter + areaid + false + true + + + + + + + + + + + + + + + + + + + + subarea_filter + subareaid + false + + + + + + + + + + + + + + + verticalprofile_mesh_with_area + meshid + false + + + + + + + + + + + + + + + + + + + + + + verticalprofile_mesh + meshid + false + + + + + + + + + + + + + + + + + + + + + mesh_coordinate + false + + + + + + + + + + + + + + + verticalprofile_mesh_point + mesh_point + false + + + + + + + + + + + + verticalprofile_mesh_point + mesh_point + false + + + + + + + + + + + + + + + + + + + + + + + axisid + false + + + + + + + + + + + + + + + + + verticalprofile_mesh_parameter + parameterid + parameter + false + + + + + + + + + + + + + + + + verticalcrosssection_mesh_year + yearid + false + + + + + + + + + + + + + + + + + verticalcrosssection_mesh_date + dateid + false + + + + + + + + + + + + + + + + + + verticalcrosssection_mesh_chart_data + verticalcrosssection_mesh_linestring + verticalcrosssection_mesh_parallel_odv_data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml --- a/gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml Fri Sep 28 12:15:22 2012 +0200 @@ -211,12 +211,37 @@ - + - + - + + + vectorscalar + false + + + + + + + + + + + + + + + + + + + + + + verticalprofile_mesh_parameter parameterid @@ -232,11 +257,31 @@ + + verticalprofile_mesh_parameter_vector + parameterid + parameter + false + + + + + + + + + + - + + + + + + verticalprofile_mesh_year yearid @@ -251,12 +296,32 @@ + + + verticalprofile_mesh_year_vector + yearid + true + + + + + + + + + + - + + + + + + verticalprofile_mesh_date dateid @@ -272,12 +337,33 @@ - + + + verticalprofile_mesh_date_vector + dateid + false + + + + + + + + + + + + - + + + + + + verticalprofile_mesh_chart_data verticalprofile_mesh_odv_data @@ -326,5 +412,54 @@ + + + verticalprofile_mesh_chart_data_vector + verticalprofile_mesh_odv_data_vector + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/products/verticalprofile/conf_timeseriespoint.xml --- a/gnv-artifacts/doc/conf/products/verticalprofile/conf_timeseriespoint.xml Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/products/verticalprofile/conf_timeseriespoint.xml Fri Sep 28 12:15:22 2012 +0200 @@ -37,7 +37,7 @@ - + @@ -93,7 +93,7 @@ - + @@ -110,9 +110,31 @@ + + + + + vectorscalar + false + + + + + + + + + - - + + + + + + + + + verticalprofile_parameter parameterid @@ -124,12 +146,29 @@ + + + verticalprofile_parameter_vector + parameterid + parameter + false + + + + + + + + + + + verticalprofile_year yearid @@ -141,11 +180,28 @@ + + + verticalprofile_year_vector + yearid + true + + + + + + + + + + + + verticalprofile_date @@ -159,12 +215,30 @@ + + + verticalprofile_date_vector + dateid + false + + + + + + + + - + + + + + + verticalprofile_minmaxdepth depthrange @@ -178,12 +252,31 @@ - + + + verticalprofile_minmaxdepth_vector + depthrange + true + + + + + + + + + + - + + + + + + verticalprofile_chart_data verticalprofile_odv_data @@ -231,5 +324,53 @@ + + + verticalprofile_chart_data_vector + verticalprofile_odv_data_vector + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/queries.properties --- a/gnv-artifacts/doc/conf/queries.properties Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/conf/queries.properties Fri Sep 28 12:15:22 2012 +0200 @@ -125,8 +125,109 @@ TSV.TIMESERIESID, \ TSV.TIMEVALUE +############################################# +############################################# +########## Zeitserie ############## +########## Vektordaten ############### +############################################# +############################################# -############################################# +timeseries_parameter_vector=SELECT DISTINCT \ + p.PARAMETERID KEY, \ + p.GERMANNAME || ' ['|| p.UNIT ||']' VALUE, \ + p.GERMANNAME \ + FROM MEDIAN.PARAMETER P, \ + MEDIAN.TIMESERIES TS, \ + MEDIAN.TIMESERIESVECTORVALUE TSV, \ + MEDIAN.MEASUREMENT M, \ + MEDIAN.TIMESERIESPOINT TSP \ + WHERE M.FEATUREID = TSP.FEATUREID AND \ + M.MEASUREMENTID = TSV.MEASUREMENTID AND \ + TS.TIMESERIESID = TSV.TIMESERIESID AND \ + P.PARAMETERID = TS.PARAMETERID AND \ + TSP.FEATUREID = ? \ + ORDER BY P.GERMANNAME + +timeseries_depth_height_vector=SELECT DISTINCT \ + M.MEASUREMENTID KEY, \ + M.ZLOCATION VALUE, \ + P.PARAMETERID PARAMETERID \ + FROM MEDIAN.MEASUREMENT M, \ + MEDIAN.TIMESERIESVECTORVALUE TSV, \ + MEDIAN.TIMESERIES T, \ + MEDIAN.PARAMETER P \ + WHERE M.MEASUREMENTID = TSV.MEASUREMENTID AND \ + TSV.TIMESERIESID = T.TIMESERIESID AND \ + T.PARAMETERID = P.PARAMETERID AND \ + M.FEATUREID = ? AND \ + P.PARAMETERID = ? \ + ORDER BY m.ZLOCATION DESC + +timeseries_interval_vector=select min(tsv.TIMEVALUE) MIN, \ + max(tsv.TIMEVALUE) MAX \ + from MEDIAN.TIMESERIES t, \ + MEDIAN.TIMESERIESVECTORVALUE tsv \ + where tsv.TIMESERIESID = t.TIMESERIESID AND \ + t.PARAMETERID = ? AND \ + tsv.MEASUREMENTID = ? + +timeseries_chart_data_vector=SELECT tsv.TIMEVALUE XORDINATE, \ + tsv.XCOMPONENT, \ + tsv.YCOMPONENT, \ + tsv.ZCOMPONENT, \ + tsv.SPEED, \ + tsv.DIRECTION, \ + t.PARAMETERID GROUP1, \ + tsv.MEASUREMENTID GROUP2, \ + tsv.TIMESERIESID GROUP3, \ + t.TIMEINTERVAL GAPID \ + FROM MEDIAN.TIMESERIESFULLVECTORVALUE tsv, \ + MEDIAN.TIMESERIES t \ + WHERE tsv.TIMESERIESID = t.TIMESERIESID AND \ + t.PARAMETERID = ? AND \ + tsv.MEASUREMENTID = ? AND \ + tsv.TIMEVALUE >= ? AND \ + tsv.TIMEVALUE <= ? \ + ORDER BY tsv.MEASUREMENTID, \ + tsv.TIMESERIESID, \ + t.PARAMETERID, \ + tsv.TIMEVALUE + +timeseries_odv_data_vector = SELECT SI.NAME CRUISE, \ + MEDIAN.TIMESERIESPOINT.NAME STATION, \ + '*' TYPE, \ + ST_ASTEXT(SHAPE), \ + 0 BOTDEPTH, \ + (M.ZLOCATION *-1) DEPTH, \ + TSV.TIMEVALUE, \ + TSV.XCOMPONENT, \ + TSV.YCOMPONENT, \ + TSV.ZCOMPONENT, \ + TSV.SPEED, \ + TSV.DIRECTION, \ + TS.PARAMETERID PARAMETER, \ + TSV.MEASUREMENTID, \ + TSV.TIMESERIESID, \ + '1' QF \ + FROM MEDIAN.TIMESERIESPOINT, \ + MEDIAN.TIMESERIESFULLVECTORVALUE TSV, \ + MEDIAN.TIMESERIES TS, \ + MEDIAN.MEASUREMENT M, \ + MEDIAN.SOURCEINFO SI \ + WHERE SI.SOURCEID = M.SOURCEID AND \ + M.FEATUREID = MEDIAN.TIMESERIESPOINT.FEATUREID AND \ + M.MEASUREMENTID = TSV.MEASUREMENTID AND \ + TSV.TIMESERIESID = TS.TIMESERIESID AND \ + TS.PARAMETERID = ? AND \ + TSV.MEASUREMENTID = ? AND \ + TSV.TIMEVALUE >= ? AND \ + TSV.TIMEVALUE <= ? \ + ORDER BY TS.PARAMETERID, \ + TSV.MEASUREMENTID, \ + TSV.TIMESERIESID, \ + TSV.TIMEVALUE + +############################################ ############################################# ########## Zeitserie Mesh ############## ############################################# @@ -236,6 +337,98 @@ msv.TIMEVALUE, \ msv.PARAMETERID +############################################# +############################################# +########## Zeitserie Mesh ############## +########## Vektordaten ############## +############################################# +############################################# + +timeseries_mesh_parameter_vector=SELECT DISTINCT \ + P.PARAMETERID KEY, \ + P.GERMANNAME || ' ['|| P.UNIT ||']' VALUE, \ + P.GERMANNAME \ + FROM MEDIAN.PARAMETER P, \ + MEDIAN.MESHVECTORVALUE MVV, \ + MEDIAN.MESH M \ + WHERE M.OBJECTID = ? AND \ + MVV.PARTID >= M.PARTIDMIN AND \ + MVV.PARTID <= M.PARTIDMAX AND \ + MVV.PARAMETERID = P.PARAMETERID \ + ORDER BY P.GERMANNAME + +timeseries_mesh_interval_vector=SELECT /*+ parallel(TIMEVALUE,5) */ \ + MIN(TIMEVALUE) MIN, \ + MAX(TIMEVALUE) MAX \ + FROM MEDIAN.MESHVECTORVALUE MVV, \ + MEDIAN.MESH M \ + WHERE M.OBJECTID = ? AND \ + MVV.PARTID >= M.PARTIDMIN AND \ + MVV.PARTID <= M.PARTIDMAX AND \ + MVV.PARAMETERID IN (?) + +timeseries_mesh_chart_data_vector =SELECT /*+ parallel(TIMEVALUE,10) */ \ + MVV.TIMEVALUE XORDINATE, \ + MVV.XCOMPONENT, \ + MVV.YCOMPONENT, \ + MVV.ZCOMPONENT, \ + MVV.SPEED, \ + MVV.DIRECTION, \ + MVV.PARAMETERID GROUP1, \ + MVV.FEATUREID GROUP2, \ + MP.FEATUREID GROUP3, \ + -1 GAPID \ + FROM MEDIAN.MESHCURRENTVALUE MVV, \ + MEDIAN.MESHPOINT MP, \ + MEDIAN.MESH M \ + WHERE (M.OBJECTID = ? AND \ + MVV.PARTID >= M.PARTIDMIN AND \ + MVV.PARTID <= M.PARTIDMAX ) AND \ + MVV.FEATUREID = MP.FEATUREID AND \ + MVV.PARAMETERID in ( ? ) AND \ + MP.FEATUREID in ( ? ) AND \ + MVV.TIMEVALUE >= ? AND \ + MVV.TIMEVALUE <= ? \ + ORDER BY MP.FEATUREID, \ + MVV.FEATUREID, \ + MVV.PARAMETERID, \ + MVV.TIMEVALUE + +timeseries_mesh_odv_data_vector = SELECT /*+ parallel(timevalue,10) */ \ + SI.NAME CRUISE, \ + M.MESHID || '-' || MEDIAN.MESHPOINT.IPOSITION || '-' || MEDIAN.MESHPOINT.JPOSITION STATION, \ + '*' TYPE, \ + ST_ASTEXT(SHAPE), \ + 0 BOTDEPTH, \ + (((ML.UPPERZLOCATION + ML.LOWERZLOCATION) / 2)*-1) DEPTH, \ + MVV.TIMEVALUE, \ + MVV.XCOMPONENT, \ + MVV.YCOMPONENT, \ + MVV.ZCOMPONENT, \ + MVV.SPEED, \ + MVV.DIRECTION, \ + MVV.PARAMETERID PARAMETER, \ + '1' QF \ + FROM MEDIAN.MESHCURRENTVALUE MVV, \ + MEDIAN.MESHPOINT, \ + MEDIAN.MESH M, \ + MEDIAN.SOURCEINFO SI, \ + MEDIAN.MESHLAYER ML \ + WHERE (M.OBJECTID = ? AND \ + MVV.PARTID >= M.PARTIDMIN AND \ + MVV.PARTID <= M.PARTIDMAX ) AND \ + M.SOURCEID = SI.SOURCEID AND \ + ML.MESHID = MEDIAN.MESHPOINT.MESHID AND \ + ML.KPOSITION = MEDIAN.MESHPOINT.KPOSITION AND \ + MVV.FEATUREID = MEDIAN.MESHPOINT.FEATUREID AND \ + MVV.PARAMETERID in (? ) AND \ + MEDIAN.MESHPOINT.FEATUREID in ( ? ) AND \ + MVV.TIMEVALUE >= ? AND \ + MVV.TIMEVALUE <= ? \ + ORDER BY MEDIAN.MESHPOINT.FEATUREID, \ + MVV.FEATUREID, \ + MVV.TIMEVALUE, \ + MVV.PARAMETERID ############################################# ############################################# @@ -330,7 +523,7 @@ '*' TYPE, \ ST_ASTEXT(SHAPE), \ 0 BOTDEPTH, \ - (M.ZLOCATION *-1) DEPTH, \ + (M.ZLOCATION) DEPTH, \ TSV.TIMEVALUE, \ TSV.DATAVALUE, \ TS.PARAMETERID PARAMETER, \ @@ -355,8 +548,125 @@ TSV.TIMESERIESID, \ TSV.TIMEVALUE, \ TS.PARAMETERID - - + +############################################# +############################################# +########## Vertikalprofil ############## +########## Vektordaten ############## +############################################# +############################################# + +verticalprofile_parameter_vector=SELECT DISTINCT \ + P.PARAMETERID KEY, \ + P.GERMANNAME || ' ['|| P.UNIT ||']' VALUE, \ + P.GERMANNAME \ + from MEDIAN.PARAMETER P, \ + MEDIAN.TIMESERIES TS, \ + MEDIAN.TIMESERIESVECTORVALUE TVV, \ + MEDIAN.MEASUREMENT M \ + where TS.PARAMETERID = P.PARAMETERID AND \ + TS.TIMESERIESID = TVV.TIMESERIESID AND \ + M.MEASUREMENTID = TVV.MEASUREMENTID AND \ + M.FEATUREID = ? \ + ORDER BY P.GERMANNAME + +verticalprofile_minmaxdepth_vector= SELECT MIN(M.ZLOCATION) MIN, \ + MAX(M.ZLOCATION) MAX \ + FROM MEDIAN.MEASUREMENT M, \ + MEDIAN.TIMESERIES TS, \ + MEDIAN.TIMESERIESVECTORVALUE TVV \ + WHERE TS.TIMESERIESID = TVV.TIMESERIESID AND \ + M.MEASUREMENTID = TVV.MEASUREMENTID AND \ + M.FEATUREID = ? AND \ + TS.PARAMETERID = ? + +verticalprofile_year_vector=SELECT DISTINCT \ + TO_CHAR(TVV.TIMEVALUE,'YYYY') KEY, \ + TO_CHAR(TVV.TIMEVALUE,'YYYY') VALUE \ + FROM MEDIAN.TIMESERIES TS, \ + MEDIAN.TIMESERIESVECTORVALUE TVV, \ + MEDIAN.MEASUREMENT M \ + WHERE TS.TIMESERIESID = TVV.TIMESERIESID AND \ + M.MEASUREMENTID = TVV.MEASUREMENTID AND \ + M.FEATUREID = ? AND \ + TS.PARAMETERID = ? \ + ORDER BY to_char(TVV.TIMEVALUE,'YYYY') + +verticalprofile_date_vector=SELECT DISTINCT \ + TVV.TIMEVALUE KEY, \ + TVV.TIMEVALUE VALUE \ + from MEDIAN.TIMESERIES TS, \ + MEDIAN.TIMESERIESVECTORVALUE TVV, \ + MEDIAN.MEASUREMENT M \ + WHERE TS.TIMESERIESID = TVV.TIMESERIESID AND \ + M.MEASUREMENTID = TVV.MEASUREMENTID AND \ + M.FEATUREID = ? AND \ + TS.PARAMETERID = ? AND \ + TO_CHAR(TVV.TIMEVALUE,'YYYY') IN (?) \ + ORDER BY TVV.TIMEVALUE + +verticalprofile_chart_data_vector= SELECT M.ZLOCATION XORDINATE, \ + TS.PARAMETERID GROUP1, \ + TVV.TIMEVALUE GROUP2, \ + TVV.XCOMPONENT, \ + TVV.YCOMPONENT, \ + TVV.ZCOMPONENT, \ + TVV.SPEED, \ + TVV.DIRECTION, \ + 1 GROUP3, \ + 1 DATAID, \ + M.FEATUREID, \ + TS.TIMESERIESID \ + FROM MEDIAN.TIMESERIES TS, \ + MEDIAN.TIMESERIESFULLVECTORVALUE TVV, \ + MEDIAN.MEASUREMENT M \ + WHERE TS.TIMESERIESID = TVV.TIMESERIESID AND \ + M.MEASUREMENTID = TVV.MEASUREMENTID AND \ + M.FEATUREID = ? AND \ + TS.PARAMETERID = ? AND \ + TVV.TIMEVALUE = ? AND \ + M.ZLOCATION >= ? AND \ + M.ZLOCATION <= ? \ + ORDER BY TVV.TIMEVALUE, \ + TVV.TIMESERIESID, \ + TS.PARAMETERID, \ + TVV.TIMEVALUE + +verticalprofile_odv_data_vector = SELECT SI.NAME CRUISE, \ + MEDIAN.TIMESERIESPOINT.NAME STATION, \ + '*' TYPE, \ + ST_ASTEXT(SHAPE), \ + 0 BOTDEPTH, \ + (M.ZLOCATION) DEPTH, \ + TVV.TIMEVALUE, \ + TVV.XCOMPONENT, \ + TVV.YCOMPONENT, \ + TVV.ZCOMPONENT, \ + TVV.SPEED, \ + TVV.DIRECTION, \ + TS.PARAMETERID PARAMETER, \ + TVV.MEASUREMENTID, \ + TVV.TIMESERIESID, \ + '1' QF \ + FROM MEDIAN.TIMESERIESPOINT, \ + MEDIAN.TIMESERIESFULLVECTORVALUE TVV, \ + MEDIAN.TIMESERIES TS, \ + MEDIAN.MEASUREMENT M, \ + MEDIAN.SOURCEINFO SI \ + WHERE SI.SOURCEID = M.SOURCEID AND \ + M.FEATUREID = MEDIAN.TIMESERIESPOINT.FEATUREID AND \ + M.MEASUREMENTID = TVV.MEASUREMENTID AND \ + TVV.TIMESERIESID = TS.TIMESERIESID AND \ + M.FEATUREID = ? AND \ + TS.PARAMETERID = ? AND \ + TVV.TIMEVALUE = ? AND \ + M.ZLOCATION >= ? AND \ + M.ZLOCATION <= ? \ + ORDER BY TVV.MEASUREMENTID, \ + TVV.TIMESERIESID, \ + TVV.TIMEVALUE, \ + TS.PARAMETERID + ############################################# ############################################# ########## Vertikalprofil Mesh ############## @@ -506,7 +816,7 @@ '*' TYPE, \ ST_ASTEXT(SHAPE), \ 0 BOTDEPTH, \ - (((ML.UPPERZLOCATION + ML.LOWERZLOCATION) / 2)*-1) DEPTH, \ + (((ML.UPPERZLOCATION + ML.LOWERZLOCATION) / 2)) DEPTH, \ msv.DATAVALUE, \ msv.PARAMETERID PARAMETER, \ msv.TIMEVALUE , \ @@ -539,7 +849,133 @@ order by msv.TIMEVALUE, \ ml.UPPERZLOCATION, \ msv.PARAMETERID + +############################################# +############################################# +########## Vertikalprofil Mesh ############## +########## Vektordaten ############## +############################################# +############################################# + +verticalprofile_mesh_parameter_vector=SELECT DISTINCT \ + P.PARAMETERID KEY, \ + P.GERMANNAME || ' ['|| P.UNIT ||']' VALUE, \ + P.GERMANNAME \ + FROM MEDIAN.PARAMETER P, \ + MEDIAN.MESHVECTORVALUE MVV, \ + MEDIAN.MESH M \ + WHERE M.OBJECTID = ? AND \ + MVV.PARTID >= M.PARTIDMIN AND \ + MVV.PARTID <= M.PARTIDMAX AND \ + MVV.PARAMETERID = P.PARAMETERID \ + ORDER BY P.GERMANNAME + +verticalprofile_mesh_year_vector= SELECT DISTINCT \ + to_char(MVV.TIMEVALUE,'YYYY') KEY, \ + to_char(MVV.TIMEVALUE,'YYYY') VALUE \ + FROM MEDIAN.MESHVECTORVALUE MVV, \ + MEDIAN.MESH M \ + WHERE M.OBJECTID = ? AND \ + MVV.PARTID >= M.PARTIDMIN AND \ + MVV.PARTID <= M.PARTIDMAX AND \ + MVV.PARAMETERID in (?) \ + ORDER BY to_char(MVV.TIMEVALUE, 'YYYY') + +verticalprofile_mesh_date_vector= SELECT DISTINCT \ + MVV.TIMEVALUE KEY, \ + MVV.TIMEVALUE VALUE \ + FROM MEDIAN.MESHVECTORVALUE MVV, \ + MEDIAN.MESH M \ + WHERE M.OBJECTID = ? AND \ + MVV.PARTID >= M.PARTIDMIN AND \ + MVV.PARTID <= M.PARTIDMAX AND \ + MVV.PARAMETERID in (?) AND \ + to_char(MVV.TIMEVALUE,'YYYY') in (?) \ + ORDER BY MVV.TIMEVALUE + +verticalprofile_mesh_chart_data_vector=SELECT ML.UPPERZLOCATION XORDINATE, \ + MP.KPOSITION KPOSITION, \ + MVV.XCOMPONENT, \ + MVV.YCOMPONENT, \ + MVV.ZCOMPONENT, \ + MVV.SPEED, \ + MVV.DIRECTION, \ + MVV.PARAMETERID GROUP1, \ + MVV.TIMEVALUE GROUP2, \ + 1 GROUP3, \ + 2 DATAID, \ + MP.FEATUREID, \ + MP.MESHID \ + from MEDIAN.MESHLAYER ML, \ + MEDIAN.MESHPOINT MP, \ + MEDIAN.MESH M, \ + MEDIAN.MESHCURRENTVALUE MVV \ + where MVV.FEATUREID = MP. FEATUREID AND \ + ML.KPOSITION = MP.KPOSITION AND \ + ML.MESHID = MP.MESHID AND \ + M.MESHID = MP.MESHID AND \ + M.PARTIDMIN <= MVV.PARTID AND \ + M.PARTIDMAX >= MVV.PARTID AND \ + MVV.PARAMETERID IN (?) AND \ + MVV.TIMEVALUE IN (?) AND \ + M.OBJECTID = ? AND \ + MP.FEATUREID IN \ + ( SELECT FEATUREID \ + FROM MEDIAN.MESHPOINT MP, \ + MEDIAN.MESH M \ + WHERE M.OBJECTID = ? AND \ + MP.MESHID = M.MESHID AND \ + IPOSITION = (SELECT IPOSITION FROM MEDIAN.MESHPOINT WHERE FEATUREID = ?) AND \ + JPOSITION = (SELECT JPOSITION FROM MEDIAN.MESHPOINT WHERE FEATUREID = ?)) AND \ + MP.KPOSITION <= ? AND \ + MP.KPOSITION >= ? \ + ORDER BY MVV.PARAMETERID, \ + MVV.TIMEVALUE, \ + ML.UPPERZLOCATION +verticalprofile_mesh_odv_data_vector=SELECT SI.NAME CRUISE, \ + M.MESHID || '-' || MEDIAN.MESHPOINT.IPOSITION || '-' || MEDIAN.MESHPOINT.JPOSITION STATION, \ + '*' TYPE, \ + ST_ASTEXT(SHAPE), \ + 0 BOTDEPTH, \ + (((ML.UPPERZLOCATION + ML.LOWERZLOCATION) / 2)) DEPTH, \ + MVV.XCOMPONENT, \ + MVV.YCOMPONENT, \ + MVV.ZCOMPONENT, \ + MVV.SPEED, \ + MVV.DIRECTION, \ + MVV.PARAMETERID PARAMETER, \ + MVV.TIMEVALUE , \ + '1' QF \ + FROM MEDIAN.MESHLAYER ML, \ + MEDIAN.MESHPOINT, \ + MEDIAN.MESH M, \ + MEDIAN.MESHCURRENTVALUE MVV, \ + MEDIAN.SOURCEINFO SI \ + WHERE M.SOURCEID = SI.SOURCEID AND \ + MVV.FEATUREID = MEDIAN.MESHPOINT. FEATUREID AND \ + ML.KPOSITION = MEDIAN.MESHPOINT.KPOSITION AND \ + ML.MESHID = MEDIAN.MESHPOINT.MESHID AND \ + M.MESHID = MEDIAN.MESHPOINT.MESHID AND \ + M.PARTIDMIN <= MVV.PARTID AND \ + M.PARTIDMAX >= MVV.PARTID AND \ + MVV.PARAMETERID IN (?) AND \ + MVV.TIMEVALUE IN (?) AND \ + M.OBJECTID = ? AND \ + MEDIAN.MESHPOINT.FEATUREID IN \ + ( SELECT FEATUREID \ + FROM MEDIAN.MESHPOINT MP, \ + MEDIAN.MESH M \ + WHERE M.OBJECTID = ? AND \ + MP.MESHID = M.MESHID AND \ + IPOSITION = (SELECT IPOSITION FROM MEDIAN.MESHPOINT WHERE FEATUREID = ?) AND \ + JPOSITION = (SELECT JPOSITION FROM MEDIAN.MESHPOINT WHERE FEATUREID = ?)) AND \ + MEDIAN.MESHPOINT.KPOSITION <= ? AND \ + MEDIAN.MESHPOINT.KPOSITION >= ? \ + ORDER BY MVV.TIMEVALUE, \ + ML.UPPERZLOCATION, \ + MVV.PARAMETERID + ############################################# ############################################# ##### Vertikalprofil InstantaneousPoint ##### @@ -687,7 +1123,7 @@ '*' TYPE, \ ST_ASTEXT(SHAPE), \ 0 BOTDEPTH, \ - (M.ZLOCATION * -1) DEPTH, \ + (M.ZLOCATION) DEPTH, \ MSV.DATAVALUE, \ MSV.PARAMETERID PARAMETER, \ MEDIAN.INSTANTANEOUSPOINT.TIMEVALUE , \ @@ -1058,7 +1494,99 @@ MEDIAN.MESHPOINT.JPOSITION, \ MEDIAN.MESHPOINT.IPOSITION, \ msv.PARAMETERID - + +############################################# +############################################# +########### Horizontalprofil MESH ########### +########### Vektordaten ########### +############################################# +############################################# + +horizontalprofile_mesh_chart_data_vector= SELECT ST_ASTEXT(SHAPE), \ + MVV.XCOMPONENT, \ + MVV.YCOMPONENT, \ + MVV.ZCOMPONENT, \ + MVV.SPEED, \ + MVV.DIRECTION, \ + MVV.PARAMETERID GROUP1, \ + MEDIAN.MESHPOINT.KPOSITION GROUP2, \ + MVV.TIMEVALUE GROUP3, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION, \ + 2 DATAID, \ + MEDIAN.MESHPOINT.MESHID \ + FROM MEDIAN.MESHLAYER ML, \ + MEDIAN.MESHPOINT, \ + MEDIAN.MESH M, \ + MEDIAN.MESHCURRENTVALUE MVV \ + WHERE MVV.FEATUREID = MEDIAN.MESHPOINT. FEATUREID AND \ + ML.KPOSITION = MEDIAN.MESHPOINT.KPOSITION AND \ + ML.MESHID = MEDIAN.MESHPOINT.MESHID AND \ + M.MESHID = MEDIAN.MESHPOINT.MESHID AND \ + M.PARTIDMIN <= MVV.PARTID AND \ + M.PARTIDMAX >= MVV.PARTID AND \ + MVV.PARAMETERID = ? AND \ + MVV.TIMEVALUE = ? AND \ + M.OBJECTID = ? AND \ + MEDIAN.MESHPOINT.FEATUREID IN \ + ( SELECT FEATUREID \ + from MEDIAN.MESHPOINT MP, \ + MEDIAN.MESH M \ + where M.OBJECTID = ? AND \ + MP.MESHID = M.MESHID AND \ + KPOSITION IN ( ? ) AND \ + ? = (SELECT ? FROM MEDIAN.MESHPOINT WHERE FEATUREID = ?)) \ + ORDER BY MVV.TIMEVALUE, \ + MEDIAN.MESHPOINT.KPOSITION, \ + MVV.PARAMETERID, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION + +horizontalprofile_mesh_odv_data_vector= SELECT SI.NAME CRUISE, \ + M.MESHID || '-' || MEDIAN.MESHPOINT.IPOSITION || '-' || MEDIAN.MESHPOINT.JPOSITION STATION, \ + '*' TYPE, \ + ST_ASTEXT(SHAPE), \ + 0 BOTDEPTH, \ + (((ML.UPPERZLOCATION + ML.LOWERZLOCATION) / 2)*-1) DEPTH, \ + MVV.XCOMPONENT, \ + MVV.YCOMPONENT, \ + MVV.ZCOMPONENT, \ + MVV.SPEED, \ + MVV.DIRECTION, \ + MVV.PARAMETERID PARAMETER, \ + MVV.TIMEVALUE, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION , \ + '1' QF \ + from MEDIAN.MESHLAYER ML, \ + MEDIAN.MESHPOINT, \ + MEDIAN.MESH M, \ + MEDIAN.MESHCURRENTVALUE MVV, \ + MEDIAN.SOURCEINFO SI \ + where MVV.FEATUREID = MEDIAN.MESHPOINT. FEATUREID AND \ + ML.KPOSITION = MEDIAN.MESHPOINT.KPOSITION and \ + ML.MESHID = MEDIAN.MESHPOINT.MESHID and \ + M.MESHID = MEDIAN.MESHPOINT.MESHID AND \ + M.SOURCEID = SI.SOURCEID AND \ + M.PARTIDMIN <= MVV.PARTID AND \ + M.PARTIDMAX >= MVV.PARTID AND \ + MVV.PARAMETERID = ? AND \ + MVV.TIMEVALUE = ? AND \ + M.OBJECTID = ? AND \ + MEDIAN.MESHPOINT.FEATUREID IN \ + ( SELECT FEATUREID \ + FROM MEDIAN.MESHPOINT MP, \ + MEDIAN.MESH M \ + WHERE M.OBJECTID = ? AND \ + MP.MESHID = M.MESHID AND \ + KPOSITION IN ( ? ) AND \ + ? = (SELECT ? FROM MEDIAN.MESHPOINT WHERE FEATUREID = ?)) \ + ORDER BY MVV.TIMEVALUE, \ + MEDIAN.MESHPOINT.KPOSITION, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION, \ + MVV.PARAMETERID + ############################################# ############################################# ########### Horizontalprofil MESH ########### @@ -1095,6 +1623,7 @@ msv.TIMEVALUE GROUP3, \ MEDIAN.MESHPOINT.JPOSITION, \ MEDIAN.MESHPOINT.IPOSITION, \ + MEDIAN.MESHPOINT.MESHID MESHID, \ 2 DATAID \ from MEDIAN.MESHLAYER ml, \ MEDIAN.MESHPOINT, \ @@ -1121,6 +1650,53 @@ msv.PARAMETERID, \ MEDIAN.MESHPOINT.JPOSITION, \ MEDIAN.MESHPOINT.IPOSITION + +############################################# +############################################# +########### Horizontalprofil MESH ########### +########### Schnittprofil ########### +########### Vektordaten ########### +############################################# +############################################# + +horizontalprofile_mesh_cross_chart_data_vector = SELECT ST_ASTEXT(SHAPE), \ + MVV.XCOMPONENT, \ + MVV.YCOMPONENT, \ + MVV.ZCOMPONENT, \ + MVV.SPEED, \ + MVV.DIRECTION, \ + MVV.PARAMETERID GROUP1, \ + MEDIAN.MESHPOINT.KPOSITION GROUP2, \ + MVV.TIMEVALUE GROUP3, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION, \ + 2 DATAID \ + FROM MEDIAN.MESHLAYER ML, \ + MEDIAN.MESHPOINT, \ + MEDIAN.MESH M, \ + MEDIAN.MESHCURRENTVALUE MVV \ + WHERE MVV.FEATUREID = MEDIAN.MESHPOINT.FEATUREID AND \ + ML.KPOSITION = MEDIAN.MESHPOINT.KPOSITION AND \ + ML.MESHID = MEDIAN.MESHPOINT.MESHID AND \ + M.MESHID = MEDIAN.MESHPOINT.MESHID AND \ + M.PARTIDMIN <= MVV.PARTID AND \ + M.PARTIDMAX >= MVV.PARTID AND \ + MVV.PARAMETERID = ? AND \ + MVV.TIMEVALUE = ? AND \ + M.OBJECTID = ? AND \ + ML.KPOSITION in (?) AND \ + MEDIAN.MESHPOINT.FEATUREID in \ + ( \ + SELECT DISTINCT FEATUREID \ + FROM MEDIAN.MESHPOINT \ + WHERE ? \ + ) \ + ORDER BY MVV.TIMEVALUE, \ + MEDIAN.MESHPOINT.KPOSITION, \ + MVV.PARAMETERID, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION + ############################################# ############################################# ############# Profilschnitt MESH ############ @@ -1221,7 +1797,37 @@ MEDIAN.MESHPOINT.IPOSITION, \ MEDIAN.MESHPOINT.KPOSITION, \ msv.PARAMETERID - + +############################################## +#### Special case of VerticalCrossSection #### +############################################## +verticalcrosssection_mesh_parallel_linestring = SELECT ST_ASTEXT(SHAPE), \ + IPOSITION, \ + JPOSITION \ + from MEDIAN.MESHLAYER ml, \ + MEDIAN.MESHPOINT, \ + MEDIAN.MESH m, \ + MEDIAN.MESHSCALARVALUE msv \ + where msv.FEATUREID = MEDIAN.MESHPOINT.FEATUREID AND \ + ml.KPOSITION = MEDIAN.MESHPOINT.KPOSITION and \ + ml.MESHID = MEDIAN.MESHPOINT.MESHID and \ + m.MESHID = MEDIAN.MESHPOINT.MESHID AND \ + m.PARTIDMIN <= msv.PARTID AND \ + m.PARTIDMAX >= msv.PARTID AND \ + msv.PARAMETERID in (?) AND \ + msv.TIMEVALUE in (?) AND \ + m.OBJECTID = ? AND \ + MEDIAN.MESHPOINT.FEATUREID in \ + ( select FEATUREID \ + from MEDIAN.MESHPOINT mp, \ + MEDIAN.MESH m \ + where m.OBJECTID = ? AND \ + mp.MESHID = m.MESHID AND \ + KPOSITION in ( 1 ) and \ + ? = (select ? from MEDIAN.MESHPOINT where FEATUREID = ?)) \ + order by MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION + ############################################# ############################################# ########## Horizontalschnitt MESH ########### @@ -1373,7 +1979,8 @@ layer_request_data = SELECT ID_FEATURECLASS, \ QUERY_STRING, \ - ID_MAPSERVICE || '_' ||ID_LAYER \ + ID_MAPSERVICE || '_' ||ID_LAYER, \ + TITLE || '-' || LAYER_NAME || '-' || BAND VALUE \ FROM MEDIAN.LAYER_HAS_SUBTYPES \ WHERE ROW_ID IN (?) @@ -1402,7 +2009,13 @@ where f_table_schema = '?' and \ f_table_name = '?' and \ f_geometry_column='SHAPE' - + + +############################################# +############################################# +###### Sync of cache after DB updates ####### +############################################# +############################################# updated_tables = SELECT FULLTABLENAME \ FROM MEDIAN.LASTUPDATED \ - WHERE LASTUPDATE >= to_date('?', 'YYYY.MM.DD HH24:MI:SS') \ No newline at end of file + WHERE LASTUPDATE >= to_date('?', 'YYYY.MM.DD HH24:MI:SS') diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/conf/sql-cache.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/sql-cache.xml Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,11 @@ + + + + + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/schema/externalinterface_schema.sql --- a/gnv-artifacts/doc/schema/externalinterface_schema.sql Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/schema/externalinterface_schema.sql Fri Sep 28 12:15:22 2012 +0200 @@ -1,4 +1,12 @@ -/* +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +/* * Lookup-Tabelle für das FIS anhand eines Gebietes. * Diese Tabelle ist in der ArcSDE als Layer zu integrieren. * Die Inhalte der Spalte id_fis müssen mit den vergebenen IDs @@ -69,4 +77,4 @@ ALTER TABLE mapservice_has_parameter ADD - PRIMARY KEY (id_mapservice,id_parameter); \ No newline at end of file + PRIMARY KEY (id_mapservice,id_parameter); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/doc/schema/externalinterface_testdata.sql --- a/gnv-artifacts/doc/schema/externalinterface_testdata.sql Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/doc/schema/externalinterface_testdata.sql Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + *Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + INSERT INTO fis_has_mapservice (id_fis,id_mapservice) VALUES ('modeldata','BSH_IMS_Prediction_Model_Salinity'); INSERT INTO fis_has_mapservice (id_fis,id_mapservice) VALUES ('marnet','BSH_IMS_Marine_Environment_Monitoring_Network'); @@ -7,4 +15,4 @@ INSERT INTO layer_has_parameter(id_mapservice,id_layer,layer_name,id_group,id_parameter) VALUES ('BSH_IMS_Marine_Environment_Monitoring_Network', 2, 'Temperature', null, 1); INSERT INTO layer_has_parameter(id_mapservice,id_layer,layer_name,id_group,id_parameter) VALUES ('BSH_IMS_Marine_Environment_Monitoring_Network', 3, 'Salinity', null, 2); INSERT INTO layer_has_parameter(id_mapservice,id_layer,layer_name,id_group,id_parameter) VALUES ('BSH_IMS_Marine_Environment_Monitoring_Network', 4, 'OxygenSaturation', null, 31); -INSERT INTO layer_has_parameter(id_mapservice,id_layer,layer_name,id_group,id_parameter) VALUES ('BSH_IMS_Marine_Environment_Monitoring_Network', 5, 'Current', null, ?); \ No newline at end of file +INSERT INTO layer_has_parameter(id_mapservice,id_layer,layer_name,id_group,id_parameter) VALUES ('BSH_IMS_Marine_Environment_Monitoring_Network', 5, 'Current', null, ?); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/pom.xml --- a/gnv-artifacts/pom.xml Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/pom.xml Fri Sep 28 12:15:22 2012 +0200 @@ -7,12 +7,33 @@ 1.0-SNAPSHOT gnv-artifacts http://maven.apache.org + + scm:svn:svn+ssh://${user}@thoe.intevation.de/home/projects/Geospatial/bsh-generischer-viewer/Material/SVN/gnv-artifacts + scm:svn:svn+ssh://${user}@thoe.intevation.de/home/projects/Geospatial/bsh-generischer-viewer/Material/SVN/gnv-artifacts + scm:svn:svn+ssh://${user}@thoe.intevation.de/home/projects/Geospatial/bsh-generischer-viewer/Material/SVN/gnv-artifacts + UTF-8 + org.codehaus.mojo + buildnumber-maven-plugin + + + validate + + create + + + + + false + false + + + org.apache.maven.plugins maven-eclipse-plugin 2.5.1 @@ -26,6 +47,20 @@ 1.5 + + org.apache.maven.plugins + maven-jar-plugin + + + + true + + + ${buildNumber} + + + + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/APP.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/APP.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/APP.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import de.intevation.artifactdatabase.App; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,8 +1,16 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; -import de.intevation.artifactdatabase.Config; +import de.intevation.artifacts.common.utils.Config; import de.intevation.artifactdatabase.ProxyArtifact; -import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.Artifact; import de.intevation.artifacts.ArtifactDatabase; @@ -10,6 +18,7 @@ import de.intevation.artifacts.ArtifactNamespaceContext; import de.intevation.artifacts.CallContext; import de.intevation.artifacts.CallMeta; +import de.intevation.artifacts.GlobalContext; import de.intevation.gnv.artifacts.context.GNVArtifactContext; @@ -191,7 +200,9 @@ } // step backward - else if((next = getPreviousState(current, targetState)) != null) { + else if((next = getPreviousState(current, targetState, context)) + != null) + { if (current != null) { current.endOfLife(context.globalContext()); @@ -215,7 +226,12 @@ GNVProductArtifactFactory fac = (GNVProductArtifactFactory) db.getInternalArtifactFactory(fis); - Artifact select = fac.createArtifact(identifier, context, null); + Artifact select = fac.createArtifact( + identifier, + (GlobalContext) context.globalContext(), + context.getMeta(), + null); + context.putContextValue(ProxyArtifact.REPLACE_PROXY, select); result = createReport( @@ -255,10 +271,6 @@ next.setParent(current); next.setPreSettings(this.preSettings); - if (current != null) { - current.endOfLife(context.globalContext()); - } - // 3. Switch to next State current = next; @@ -296,7 +308,9 @@ /** * Step back to the previous state specified by name. */ - protected State getPreviousState(State current, String name) { + protected State getPreviousState( + State current, String name, CallContext context) + { if (current == null) { return null; } @@ -305,7 +319,8 @@ return current; } else { - return getPreviousState(current.getParent(), name); + current.endOfLife(context); + return getPreviousState(current.getParent(), name, context); } } @@ -477,10 +492,15 @@ * contains necessary information for this artifact. */ @Override - public void setup(String identifier, ArtifactFactory factory, - Object context,Document data) { + public void setup( + String identifier, + ArtifactFactory factory, + Object context, + CallMeta meta, + Document data + ) { log.debug("GNVArtifactBase.setup"); - super.setup(identifier, factory, context, data); + super.setup(identifier, factory, context, meta, data); Object localContext = context; if (context instanceof CallContext) { diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactFactory.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import de.intevation.artifactdatabase.DefaultArtifactFactory; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVDefaultArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVDefaultArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVDefaultArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,7 +1,15 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import de.intevation.artifactdatabase.DefaultArtifact; -import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.ArtifactNamespaceContext; import de.intevation.artifacts.CallContext; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVProductArtifactFactory.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVProductArtifactFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVProductArtifactFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,17 +1,12 @@ -package de.intevation.gnv.artifacts; - -import de.intevation.artifactdatabase.DefaultArtifactFactory; -import de.intevation.artifactdatabase.ProxyArtifact; -import de.intevation.artifactdatabase.XMLUtils; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.artifacts.Artifact; -import de.intevation.artifacts.ArtifactFactory; - -import de.intevation.gnv.artifacts.fis.SelectProductArtifact; - -import de.intevation.gnv.artifacts.fis.product.DefaultProduct; - -import de.intevation.gnv.state.DefaultInputData; +package de.intevation.gnv.artifacts; import java.util.ArrayList; import java.util.Collection; @@ -21,11 +16,21 @@ import javax.xml.xpath.XPathConstants; import org.apache.log4j.Logger; - import org.w3c.dom.Document; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import de.intevation.artifactdatabase.DefaultArtifactFactory; +import de.intevation.artifactdatabase.ProxyArtifact; +import de.intevation.artifacts.common.utils.XMLUtils; +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallMeta; +import de.intevation.artifacts.GlobalContext; +import de.intevation.gnv.artifacts.fis.SelectProductArtifact; +import de.intevation.gnv.artifacts.fis.product.DefaultProduct; +import de.intevation.gnv.state.DefaultInputData; + /** * This factory is called to create a {@link * de.intevation.gnv.artifacts.fis.SelectProductArtifact} which lets the user @@ -70,16 +75,20 @@ * @return The created artifact. */ @Override - public Artifact createArtifact(String identifier, Object context, Document data) { - + public Artifact createArtifact( + String identifier, + GlobalContext context, + CallMeta meta, + Document data + ) { // create a SelectProductArtifact for initial product selection - Artifact artifact = super.createArtifact(identifier, context, data); + Artifact artifact = super.createArtifact(identifier, context, meta, data); if (artifact instanceof ProxyArtifact) { SelectProductArtifact select = new SelectProductArtifact(); select.setProducts(products); - select.setup(identifier, this, context, data); + select.setup(identifier, this, context, meta, data); ((ProxyArtifact) artifact).setProxied(select); } @@ -134,7 +143,7 @@ Node factoryNode = (Node) XMLUtils.xpath( product, XPATH_PRODUCT_FACTORY, XPathConstants.NODE); - String factoryClass = factoryNode.getTextContent(); + String factoryClass = factoryNode.getTextContent().trim(); if (factoryClass == null || factoryClass.equals("")) { logger.warn("No artifact factory class found for " + name); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/PreSettingArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/PreSettingArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/PreSettingArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import de.intevation.gnv.state.InputData; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/cache/CacheFactory.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/cache/CacheFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/cache/CacheFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,8 +1,22 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.cache; +import java.lang.management.ManagementFactory; + +import javax.management.MBeanServer; + import net.sf.ehcache.Cache; import net.sf.ehcache.CacheManager; +import net.sf.ehcache.management.ManagementService; + import org.apache.log4j.Logger; import de.intevation.gnv.geobackend.base.query.cache.CacheCleaner; @@ -75,6 +89,11 @@ if (cacheManager == null) { cacheManager = new CacheManager(configurationFileName); cacheManager.addCache(CACHENAME); + + MBeanServer beanServer = ManagementFactory.getPlatformMBeanServer(); + ManagementService.registerMBeans( + cacheManager, beanServer, false, false, false, true); + this.cacheCleaner = new ThematicDataCacheCleaner(); this.cacheCleaner.start(); } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContext.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContext.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContext.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.context; import de.intevation.artifactdatabase.DefaultArtifactContext; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,19 +1,26 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.context; -import de.intevation.artifactdatabase.Config; -import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.common.utils.Config; +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.ArtifactContextFactory; +import de.intevation.artifacts.GlobalContext; import de.intevation.gnv.artifacts.cache.CacheFactory; import de.intevation.gnv.chart.XMLChartTheme; -import de.intevation.gnv.geobackend.base.connectionpool.ConnectionPoolFactory; +import de.intevation.gnv.geobackend.base.query.container.exception.QueryContainerException; -import de.intevation.gnv.geobackend.base.query.container.QueryContainerFactory; - -import de.intevation.gnv.geobackend.base.query.container.exception.QueryContainerException; +import de.intevation.gnv.geobackend.config.Configuration; import de.intevation.gnv.raster.Filter; import de.intevation.gnv.raster.Palette; @@ -59,7 +66,7 @@ * */ public static final String XPATH_GEOBACKEND_CONFIGURATION = - "artifact-database/geo-backend/backend-configuration"; + "artifact-database/geo-backend"; /** * @@ -167,29 +174,12 @@ * @return GNVArtifactContext * @see de.intevation.artifacts.ArtifactContextFactory#createArtifactContext(org.w3c.dom.Document) */ - public Object createArtifactContext(Document config) { + public GlobalContext createArtifactContext(Document config) { GNVArtifactContext returnValue = null; try { log.debug("GNVArtifactContextFactory.createArtifactContext"); - log.info("Initialisation of the Geo-BackendConnectionPool"); - String backendConfigurationFile = Config.getStringXPath(config, - XPATH_GEOBACKEND_CONFIGURATION); - backendConfigurationFile = Config.replaceConfigDir( - backendConfigurationFile); - Properties properties = getProperties(backendConfigurationFile); - ConnectionPoolFactory cpf = ConnectionPoolFactory.getInstance(); - cpf.initializeConnectionPool(properties); - - log.info("Initialisation of the QueryContainer"); - String queryConfigurationFile = Config.getStringXPath(config, - XPATH_GEOBACKEND_QUERYCONFIGURATION); - queryConfigurationFile = Config.replaceConfigDir( - queryConfigurationFile); - - Properties queryProperties = getProperties(queryConfigurationFile); - QueryContainerFactory qcf = QueryContainerFactory.getInstance(); - qcf.initializeQueryContainer(queryProperties); + configureGeoBackend(config); configureCache(config); @@ -217,6 +207,14 @@ return returnValue; } + protected void configureGeoBackend(Document config) + throws FileNotFoundException, IOException, QueryContainerException + { + Configuration geoConf = Configuration.getInstance(); + String configDir = Config.getConfigDirectory().getAbsolutePath(); + geoConf.init(config, configDir, Config.CONFIG_DIR_PLACEHOLDER); + } + /** * * @param config diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/SelectProductArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/SelectProductArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/SelectProductArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,29 +1,15 @@ -package de.intevation.gnv.artifacts.fis; - -import de.intevation.artifactdatabase.ProxyArtifact; -import de.intevation.artifactdatabase.XMLUtils; - -import de.intevation.artifacts.Artifact; -import de.intevation.artifacts.ArtifactFactory; -import de.intevation.artifacts.ArtifactNamespaceContext; -import de.intevation.artifacts.CallContext; -import de.intevation.artifacts.CallMeta; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.gnv.artifacts.GNVArtifactBase; -import de.intevation.gnv.artifacts.GNVDefaultArtifact; -import de.intevation.gnv.artifacts.GNVProductArtifactFactory; -import de.intevation.gnv.artifacts.PreSettingArtifact; - -import de.intevation.gnv.artifacts.fis.product.Product; - -import de.intevation.gnv.artifacts.ressource.RessourceFactory; - -import de.intevation.gnv.state.DefaultInputData; -import de.intevation.gnv.state.InputData; +package de.intevation.gnv.artifacts.fis; import java.io.IOException; import java.io.OutputStream; - import java.util.Collection; import java.util.HashMap; import java.util.Iterator; @@ -32,12 +18,28 @@ import javax.xml.xpath.XPathConstants; import org.apache.log4j.Logger; - import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; +import de.intevation.artifactdatabase.ProxyArtifact; +import de.intevation.artifacts.common.utils.XMLUtils; +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.ArtifactNamespaceContext; +import de.intevation.artifacts.CallContext; +import de.intevation.artifacts.CallMeta; +import de.intevation.artifacts.GlobalContext; +import de.intevation.gnv.artifacts.GNVArtifactBase; +import de.intevation.gnv.artifacts.GNVDefaultArtifact; +import de.intevation.gnv.artifacts.GNVProductArtifactFactory; +import de.intevation.gnv.artifacts.PreSettingArtifact; +import de.intevation.gnv.artifacts.fis.product.Product; +import de.intevation.gnv.artifacts.ressource.RessourceFactory; +import de.intevation.gnv.state.DefaultInputData; +import de.intevation.gnv.state.InputData; + /** * This artifact is used to handle to input/output at the beginning of a * parameterization when no product has been selected so far. After the user @@ -114,9 +116,11 @@ String identifier, ArtifactFactory factory, Object context, - Document data) { + CallMeta meta, + Document data + ) { log.debug("SelectProductArtifact.setup()"); - super.setup(identifier, factory, context,data); + super.setup(identifier, factory, context, meta, data); this.name = factory.getName(); // Read the Parameters that should be used for the setup from the @@ -265,7 +269,11 @@ .getInternalArtifactFactory(this.name); factory = ((GNVProductArtifactFactory)factory) .getArtifactFactoryByName(current.getName()); - artifact = factory.createArtifact(uuid, context, null); + artifact = factory.createArtifact( + uuid, + (GlobalContext) context.globalContext(), + context.getMeta(), + null); if (this.preSettings != null && artifact instanceof PreSettingArtifact){ @@ -386,22 +394,24 @@ Node parent, Object context ) { - Iterator iter = products.values().iterator(); - - XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( - document, - ArtifactNamespaceContext.NAMESPACE_URI, - ArtifactNamespaceContext.NAMESPACE_PREFIX - ); + if (products != null && !products.isEmpty()){ + Iterator iter = products.values().iterator(); - while(iter.hasNext()) { - Product prod = (Product) iter.next(); - String name = prod.getName(); + XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( + document, + ArtifactNamespaceContext.NAMESPACE_URI, + ArtifactNamespaceContext.NAMESPACE_PREFIX + ); - Element current = creator.create("state"); - creator.addAttr(current, "name", name); - creator.addAttr(current, "description", name); - parent.appendChild(current); + while(iter.hasNext()) { + Product prod = (Product) iter.next(); + String name = prod.getName(); + + Element current = creator.create("state"); + creator.addAttr(current, "name", name); + creator.addAttr(current, "description", name); + parent.appendChild(current); + } } } @@ -441,23 +451,24 @@ Element choiceNode = creator.create("choices"); selectNode.appendChild(lableNode); selectNode.appendChild(choiceNode); + if (products != null && !products.isEmpty()){ + Iterator it = products.values().iterator(); + while (it.hasNext()) { + Product p = (Product) it.next(); + Element itemNode = creator.create("item"); + Element choiceLableNode = creator.create("label"); + choiceLableNode.setTextContent(ressource.getRessource( + callMeta.getLanguages(), + p.getName(), + p.getName() + )); + itemNode.appendChild(choiceLableNode); - Iterator it = products.values().iterator(); - while (it.hasNext()) { - Product p = (Product) it.next(); - Element itemNode = creator.create("item"); - Element choiceLableNode = creator.create("label"); - choiceLableNode.setTextContent(ressource.getRessource( - callMeta.getLanguages(), - p.getName(), - p.getName() - )); - itemNode.appendChild(choiceLableNode); - - Element choiceValueNode = creator.create("value"); - choiceValueNode.setTextContent(p.getName()); - itemNode.appendChild(choiceValueNode); - choiceNode.appendChild(itemNode); + Element choiceValueNode = creator.create("value"); + choiceValueNode.setTextContent(p.getName()); + itemNode.appendChild(choiceValueNode); + choiceNode.appendChild(itemNode); + } } node.appendChild(selectNode); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/product/DefaultProduct.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/product/DefaultProduct.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/product/DefaultProduct.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.fis.product; import de.intevation.gnv.state.InputData; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/product/Product.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/product/Product.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/product/Product.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.fis.product; import de.intevation.gnv.state.InputData; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.ressource; import de.intevation.artifacts.PreferredLocale; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/MetaDataService.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/MetaDataService.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/MetaDataService.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.services; import java.util.ArrayList; @@ -17,9 +25,10 @@ import com.vividsolutions.jts.io.WKTReader; import de.intevation.artifactdatabase.DefaultService; -import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.ArtifactNamespaceContext; import de.intevation.artifacts.CallMeta; +import de.intevation.artifacts.GlobalContext; import de.intevation.artifacts.ServiceFactory; import de.intevation.gnv.artifacts.services.requestobjects.DefaultFIS; import de.intevation.gnv.artifacts.services.requestobjects.DefaultLayer; @@ -92,8 +101,11 @@ } @Override - public Document process(Document data, Object globalContext, - CallMeta callMeta) { + public Document process( + Document data, + GlobalContext globalContext, + CallMeta callMeta + ) { log.debug("MetaDataService.process"); Document document = null; try { @@ -441,7 +453,7 @@ } @Override - public void setup(ServiceFactory factory, Object globalContext) { + public void setup(ServiceFactory factory, GlobalContext globalContext) { log.debug("MetaDataService.setup"); super.setup(factory, globalContext); // TODO: Perhaps it is necessary to init the QueryIds here. diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/MetaDataServiceException.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/MetaDataServiceException.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/MetaDataServiceException.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.services; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultFIS.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultFIS.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultFIS.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.services.requestobjects; import java.util.Collection; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultLayer.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultLayer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultLayer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.services.requestobjects; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultMapService.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultMapService.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultMapService.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.services.requestobjects; import java.util.Collection; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultParameter.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultParameter.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/DefaultParameter.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.services.requestobjects; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/FIS.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/FIS.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/FIS.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.services.requestobjects; import java.util.Collection; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/Layer.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/Layer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/Layer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.services.requestobjects; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/MapService.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/MapService.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/MapService.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.services.requestobjects; import java.util.Collection; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/Parameter.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/Parameter.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/services/requestobjects/Parameter.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.services.requestobjects; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractChart.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractChart.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractChart.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.chart; import java.util.Collection; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractHistogram.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractHistogram.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractHistogram.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.chart; import java.util.Locale; @@ -8,6 +16,9 @@ import org.jfree.chart.ChartTheme; import org.jfree.chart.JFreeChart; +import org.jfree.chart.axis.NumberAxis; +import org.jfree.chart.axis.TickUnitSource; + import org.jfree.chart.plot.PlotOrientation; import org.jfree.chart.plot.XYPlot; @@ -91,6 +102,8 @@ theme.apply(chart); adjustPlot(); + adjustDomainAxis(chart); + adjustRangeAxis(chart); return chart; } @@ -108,6 +121,26 @@ } + protected void adjustDomainAxis(JFreeChart chart) { + XYPlot plot = (XYPlot) chart.getPlot(); + NumberAxis domainAxis = (NumberAxis) plot.getDomainAxis(); + + TickUnitSource tus = domainAxis.createStandardTickUnits(locale); + domainAxis.setStandardTickUnits(tus); + } + + + protected void adjustRangeAxis(JFreeChart chart) { + XYPlot plot = (XYPlot) chart.getPlot(); + NumberAxis rangeAxis = (NumberAxis) plot.getRangeAxis(); + + TickUnitSource tus = rangeAxis.createStandardTickUnits(locale); + rangeAxis.setStandardTickUnits(tus); + } + + + + /** * This method needs to be implemented by subclasses and should add valid * HistogramDataset objects to the created chart. It is called diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.chart; import de.intevation.gnv.geobackend.base.Result; @@ -207,7 +215,18 @@ // litte workarround to adjust the max range of axes. // NumberAxis.setAutoRange(true) doesn't seem to work properly. Range yRange = (Range) ranges.get(seriesKey); - yAxis.setRange(Range.expand(yRange, LOWER_MARGIN, UPPER_MARGIN)); + double lo = yRange.getLowerBound(); + double hi = yRange.getUpperBound(); + + if (lo == hi) { + yRange = new Range( + lo - (lo / 100 * LOWER_MARGIN), + hi + (hi / 100 * UPPER_MARGIN)); + } + else { + yRange = Range.expand(yRange, LOWER_MARGIN, UPPER_MARGIN); + } + yAxis.setRange(yRange); log.debug("Max Range of dataset is: " + yRange.toString()); if (seriesKey.contains("richtung")) { diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/AdvancedHistogramDataset.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/AdvancedHistogramDataset.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,516 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.chart; + +import java.io.Serializable; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; + +import org.jfree.data.general.DatasetChangeEvent; +import org.jfree.data.xy.AbstractIntervalXYDataset; +import org.jfree.data.xy.IntervalXYDataset; + +import org.jfree.data.statistics.HistogramType; +import org.jfree.data.statistics.HistogramBin; + +import org.jfree.util.ObjectUtilities; +import org.jfree.util.PublicCloneable; + +/** + * This class extends the functionality of the internal JFreeChart class + * HistogramDataset. AdvancedHistogramDataset takes + * the number of bins OR a bin width. It is mainly a copy of this class. The + * reason why there is no inheritance from JFreeChart's internal class is, + * that basic attributes have private access there. + * + * @author Ingo Weinzierl + */ +public class AdvancedHistogramDataset +extends AbstractIntervalXYDataset +implements IntervalXYDataset, Cloneable, PublicCloneable, Serializable +{ + /** A list of maps. */ + protected List list; + + /** The histogram type. */ + protected HistogramType type; + + /** The width of a single bin. */ + protected double binWidth = -1; + + /** The number of bins. */ + protected int bins = -1; + + /** The logger */ + private static Logger logger = + Logger.getLogger(AdvancedHistogramDataset.class); + + + /** + * Creates a new (empty) dataset with a default type of + * {@link HistogramType}.FREQUENCY. + */ + public AdvancedHistogramDataset() { + this.list = new ArrayList(); + this.type = HistogramType.FREQUENCY; + } + + /** + * Creates a new (empty) dataset with a default type of + * {@link HistogramType}.FREQUENCY. + */ + public AdvancedHistogramDataset(int bins, double binWidth) { + this.list = new ArrayList(); + this.type = HistogramType.FREQUENCY; + this.bins = bins; + this.binWidth = binWidth; + } + + /** + * Returns the histogram type. + * + * @return The type (never null). + */ + public HistogramType getType() { + return this.type; + } + + /** + * Sets the histogram type and sends a {@link DatasetChangeEvent} to all + * registered listeners. + * + * @param type the type (null not permitted). + */ + public void setType(HistogramType type) { + if (type == null) { + throw new IllegalArgumentException("Null 'type' argument"); + } + this.type = type; + notifyListeners(new DatasetChangeEvent(this, this)); + } + + /** + * Adds a series to the dataset, using the specified number of bins. + * + * @param key the series key (null not permitted). + * @param values the values (null not permitted). + */ + public void addSeries(Comparable key, double[] values) { + double minimum = getMinimum(values); + double maximum = getMaximum(values); + addSeries(key, values, minimum, maximum); + } + + /** + * Adds a series to the dataset. Any data value less than minimum will be + * assigned to the first bin, and any data value greater than maximum will + * be assigned to the last bin. Values falling on the boundary of + * adjacent bins will be assigned to the higher indexed bin. + * + * @param key the series key (null not permitted). + * @param values the raw observations. + * @param bins the number of bins (must be at least 1). + * @param minimum the lower bound of the bin range. + * @param maximum the upper bound of the bin range. + */ + public void addSeries(Comparable key, + double[] values, + double minimum, + double maximum) { + + if (key == null) { + throw new IllegalArgumentException("Null 'key' argument."); + } + if (values == null) { + throw new IllegalArgumentException("Null 'values' argument."); + } + if (bins <= 0 && binWidth <= 0) { + throw new IllegalArgumentException( + "We need at least a bin width or the number of bins."); + } + + // There is a binWidth given to calculate the number of bins in this + // case + if (bins <= 0) { + double tmp = (maximum - minimum) / binWidth; + bins = (int) tmp; + bins = tmp % 1 > 0 ? bins + 1 : bins; + + double overlap = minimum + bins * binWidth - maximum; + tmp = minimum; + minimum -= overlap / 2; + + logger.debug("There is an overlap of " + overlap); + logger.info("The lower bound is moved left from " + + tmp + " to " + minimum); + + tmp = maximum; + maximum += overlap / 2; + logger.info("The upper bound is moved right from " + + tmp + " to " + maximum); + } + + if (bins <= 0) { + bins = 1; + } + + // in this case, there is a number of bins given, so we need to + // calculate the width of a single bin + if (binWidth <= 0) + binWidth = (maximum - minimum) / bins; + + logger.info("bin width: " + binWidth); + logger.info("number of bins: " + bins); + + double lower = minimum; + double upper; + List binList = new ArrayList(bins); + for (int i = 0; i < bins; i++) { + HistogramBin bin; + // make sure bins[bins.length]'s upper boundary ends at maximum + // to avoid the rounding issue. the bins[0] lower boundary is + // guaranteed start from min + if (i == bins - 1) { + bin = new HistogramBin(lower, maximum); + } + else { + upper = minimum + (i + 1) * binWidth; + bin = new HistogramBin(lower, upper); + lower = upper; + } + binList.add(bin); + } + // fill the bins + for (int i = 0; i < values.length; i++) { + int binIndex = bins - 1; + if (values[i] < maximum) { + double fraction = (values[i] - minimum) / (maximum - minimum); + if (fraction < 0.0) { + fraction = 0.0; + } + binIndex = (int) (fraction * bins); + // rounding could result in binIndex being equal to bins + // which will cause an IndexOutOfBoundsException - see bug + // report 1553088 + if (binIndex >= bins) { + binIndex = bins - 1; + } + } + HistogramBin bin = (HistogramBin) binList.get(binIndex); + bin.incrementCount(); + } + // generic map for each series + Map map = new HashMap(); + map.put("key", key); + map.put("bins", binList); + map.put("values.length", new Integer(values.length)); + map.put("bin width", new Double(binWidth)); + this.list.add(map); + } + + /** + * Returns the minimum value in an array of values. + * + * @param values the values (null not permitted and + * zero-length array not permitted). + * + * @return The minimum value. + */ + private double getMinimum(double[] values) { + if (values == null || values.length < 1) { + throw new IllegalArgumentException( + "Null or zero length 'values' argument."); + } + double min = Double.MAX_VALUE; + for (int i = 0; i < values.length; i++) { + if (values[i] < min) { + min = values[i]; + } + } + return min; + } + + /** + * Returns the maximum value in an array of values. + * + * @param values the values (null not permitted and + * zero-length array not permitted). + * + * @return The maximum value. + */ + private double getMaximum(double[] values) { + if (values == null || values.length < 1) { + throw new IllegalArgumentException( + "Null or zero length 'values' argument."); + } + double max = -Double.MAX_VALUE; + for (int i = 0; i < values.length; i++) { + if (values[i] > max) { + max = values[i]; + } + } + return max; + } + + /** + * Returns the bins for a series. + * + * @param series the series index (in the range 0 to + * getSeriesCount() - 1). + * + * @return A list of bins. + * + * @throws IndexOutOfBoundsException if series is outside the + * specified range. + */ + List getBins(int series) { + Map map = (Map) this.list.get(series); + return (List) map.get("bins"); + } + + /** + * Returns the total number of observations for a series. + * + * @param series the series index. + * + * @return The total. + */ + private int getTotal(int series) { + Map map = (Map) this.list.get(series); + return ((Integer) map.get("values.length")).intValue(); + } + + /** + * Returns the bin width for a series. + * + * @param series the series index (zero based). + * + * @return The bin width. + */ + private double getBinWidth(int series) { + if (binWidth > 0) + return binWidth; + + Map map = (Map) this.list.get(series); + return ((Double) map.get("bin width")).doubleValue(); + } + + /** + * Returns the number of series in the dataset. + * + * @return The series count. + */ + public int getSeriesCount() { + return this.list.size(); + } + + /** + * Returns the key for a series. + * + * @param series the series index (in the range 0 to + * getSeriesCount() - 1). + * + * @return The series key. + * + * @throws IndexOutOfBoundsException if series is outside the + * specified range. + */ + public Comparable getSeriesKey(int series) { + Map map = (Map) this.list.get(series); + return (Comparable) map.get("key"); + } + + /** + * Returns the number of data items for a series. + * + * @param series the series index (in the range 0 to + * getSeriesCount() - 1). + * + * @return The item count. + * + * @throws IndexOutOfBoundsException if series is outside the + * specified range. + */ + public int getItemCount(int series) { + return getBins(series).size(); + } + + /** + * Returns the X value for a bin. This value won't be used for plotting + * histograms, since the renderer will ignore it. But other renderers can + * use it (for example, you could use the dataset to create a line + * chart). + * + * @param series the series index (in the range 0 to + * getSeriesCount() - 1). + * @param item the item index (zero based). + * + * @return The start value. + * + * @throws IndexOutOfBoundsException if series is outside the + * specified range. + */ + public Number getX(int series, int item) { + List bins = getBins(series); + HistogramBin bin = (HistogramBin) bins.get(item); + double x = (bin.getStartBoundary() + bin.getEndBoundary()) / 2.; + return new Double(x); + } + + /** + * Returns the y-value for a bin (calculated to take into account the + * histogram type). + * + * @param series the series index (in the range 0 to + * getSeriesCount() - 1). + * @param item the item index (zero based). + * + * @return The y-value. + * + * @throws IndexOutOfBoundsException if series is outside the + * specified range. + */ + public Number getY(int series, int item) { + List bins = getBins(series); + HistogramBin bin = (HistogramBin) bins.get(item); + double total = getTotal(series); + double binWidth = getBinWidth(series); + + if (this.type == HistogramType.FREQUENCY) { + return new Double(bin.getCount()); + } + else if (this.type == HistogramType.RELATIVE_FREQUENCY) { + return new Double(bin.getCount() / total); + } + else if (this.type == HistogramType.SCALE_AREA_TO_1) { + return new Double(bin.getCount() / (binWidth * total)); + } + else { // pretty sure this shouldn't ever happen + throw new IllegalStateException(); + } + } + + /** + * Returns the start value for a bin. + * + * @param series the series index (in the range 0 to + * getSeriesCount() - 1). + * @param item the item index (zero based). + * + * @return The start value. + * + * @throws IndexOutOfBoundsException if series is outside the + * specified range. + */ + public Number getStartX(int series, int item) { + List bins = getBins(series); + HistogramBin bin = (HistogramBin) bins.get(item); + return new Double(bin.getStartBoundary()); + } + + /** + * Returns the end value for a bin. + * + * @param series the series index (in the range 0 to + * getSeriesCount() - 1). + * @param item the item index (zero based). + * + * @return The end value. + * + * @throws IndexOutOfBoundsException if series is outside the + * specified range. + */ + public Number getEndX(int series, int item) { + List bins = getBins(series); + HistogramBin bin = (HistogramBin) bins.get(item); + return new Double(bin.getEndBoundary()); + } + + /** + * Returns the start y-value for a bin (which is the same as the y-value, + * this method exists only to support the general form of the + * {@link IntervalXYDataset} interface). + * + * @param series the series index (in the range 0 to + * getSeriesCount() - 1). + * @param item the item index (zero based). + * + * @return The y-value. + * + * @throws IndexOutOfBoundsException if series is outside the + * specified range. + */ + public Number getStartY(int series, int item) { + return getY(series, item); + } + + /** + * Returns the end y-value for a bin (which is the same as the y-value, + * this method exists only to support the general form of the + * {@link IntervalXYDataset} interface). + * + * @param series the series index (in the range 0 to + * getSeriesCount() - 1). + * @param item the item index (zero based). + * + * @return The Y value. + * + * @throws IndexOutOfBoundsException if series is outside the + * specified range. + */ + public Number getEndY(int series, int item) { + return getY(series, item); + } + + /** + * Tests this dataset for equality with an arbitrary object. + * + * @param obj the object to test against (null permitted). + * + * @return A boolean. + */ + public boolean equals(Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof AdvancedHistogramDataset)) { + return false; + } + AdvancedHistogramDataset that = (AdvancedHistogramDataset) obj; + if (!ObjectUtilities.equal(this.type, that.type)) { + return false; + } + if (!ObjectUtilities.equal(this.list, that.list)) { + return false; + } + return true; + } + + /** + * Returns a clone of the dataset. + * + * @return A clone of the dataset. + * + * @throws CloneNotSupportedException if the object cannot be cloned. + */ + public Object clone() throws CloneNotSupportedException { + AdvancedHistogramDataset clone = (AdvancedHistogramDataset) super.clone(); + int seriesCount = getSeriesCount(); + clone.list = new java.util.ArrayList(seriesCount); + for (int i = 0; i < seriesCount; i++) { + clone.list.add(new HashMap((Map) this.list.get(i))); + } + return clone; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/Chart.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/Chart.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/Chart.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.chart; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartLabels.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartLabels.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartLabels.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + /* Copyright (C) 2007 con terra GmbH (http://www.conterra.de) * All rights reserved * diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/DefaultHistogram.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/DefaultHistogram.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/DefaultHistogram.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,7 +1,12 @@ -package de.intevation.gnv.chart; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import java.text.NumberFormat; -import java.text.ParseException; +package de.intevation.gnv.chart; import java.util.Locale; import java.util.Map; @@ -12,8 +17,6 @@ import org.jfree.chart.plot.XYPlot; -import org.jfree.data.statistics.HistogramDataset; - /** * Default implementation of {@link de.intevation.gnv.chart.AbstractHistogram}. * @@ -51,12 +54,6 @@ public static final String REQUEST_KEY_CHART_WIDTH = "width"; /** - * Default key to retrieve the Locale object from {@link - * #requestParameter} used for i18n support. - */ - public static final String REQUEST_KEY_LOCALE = "locale"; - - /** * Default key to retrieve the object from {@link #requestParameter}. It * defines which value this chart has to be used for bin calculation. You * can either adjust the number of bins or the width of a single bin. @@ -73,6 +70,8 @@ */ protected Map requestParameter; + protected double[] minmax = null; + /** * Constructor to create DefaultHistogram objects. @@ -87,6 +86,7 @@ ) { super(labels, data, theme); this.requestParameter = requestParameter; + this.locale = (Locale) requestParameter.get("locale"); } @@ -97,10 +97,13 @@ // prepare data and create add them to histogram dataset String name = (String) data[0]; double[] values = toDouble((Double[]) data[1]); - int bins = getBinCount(values); - HistogramDataset dataset = new HistogramDataset(); - dataset.addSeries(name, values, bins); + double binWidth = getBinWidth(values); + int binCount = getBinCount(); + + AdvancedHistogramDataset dataset = + new AdvancedHistogramDataset(binCount, binWidth); + dataset.addSeries(name, values); plot.setDataset(0, dataset); } @@ -116,6 +119,9 @@ * @return Array which contains min and max value */ protected double[] getMinMax(double[] values) { + if (minmax != null) + return minmax; + double[] minmax = new double[2]; minmax[0] = Double.MAX_VALUE; minmax[1] = Double.MIN_VALUE; @@ -126,6 +132,8 @@ minmax[1] = values[i] > minmax[1] ? values[i] : minmax[1]; } + this.minmax = minmax; + return minmax; } @@ -150,38 +158,21 @@ /** - * Method to calculate the number of bins this chart should be parted into. - * The real calculation takes place in {@link #getBinCountByNumber} and - * {@link #getBinCountByWidth}. This method switches between these methods - * depending on the object stored in {@link #requestParameter}. - * - * @param values All values used in this histogram + * Method to retrieve the number of bins. * - * @return Number of bins + * @return the number of bins that is specified in requestParameter + * or -1 if the number of bins is not the dominant value to calculate the + * width of a single bin. */ - protected int getBinCount(double[] values) { - String param = (String) requestParameter.get(REQUEST_KEY_BIN_CHOICE); - - if (param != null && param.equalsIgnoreCase(REQUEST_KEY_BIN_WIDTH)) { - return getBinCountByWidth(values); + protected int getBinCount() { + // Return -1 to trigger a calculation of the number of bins in + // AdvancedHistogramDataset if the user chose the bin width as dominant + // value. + String choice = (String) requestParameter.get(REQUEST_KEY_BIN_CHOICE); + if (choice != null && choice.equalsIgnoreCase(REQUEST_KEY_BIN_WIDTH)) { + return -1; } - else { - return getBinCountByNumber(); - } - } - - /** - * Method to retrieve the number of bins. If {@link #requestParameter} - * contains a valid Integer at - * REQUEST_KEY_BIN_COUNT and this is smaller than or equal - * {@link #MAXIMAL_BINS}, this value is used. If no valid - * Integer is given or if the value in {@link #requestParameter} - * is bigger than {@link #MAXIMAL_BINS}, {@link #DEFAULT_BINS} is used. - * - * @return Number of bins - */ - protected int getBinCountByNumber() { int bins = -1; String param = (String) requestParameter.get(REQUEST_KEY_BIN_COUNT); @@ -202,61 +193,42 @@ /** - * Serves the number of bins depending on a given width for each bin, but - * maximum bin count is limited by {@link #MAXIMAL_BINS}. + * Serves width of a single bin. * * @param values All values in this histogram * - * @return Number of bins + * @return The bin width that is given in requestParameter or -1 if + * the bin width is not the dominant value for calculating the number of + * bins in the histogram. */ - protected int getBinCountByWidth(double[] values) { - int bins = -1; - String param = (String) requestParameter.get(REQUEST_KEY_BIN_WIDTH); - Locale locale = (Locale) requestParameter.get(REQUEST_KEY_LOCALE); - NumberFormat format = NumberFormat.getInstance(locale); - - try { - double[] minmax = getMinMax(values); - double totalWidth = minmax[1] - minmax[0]; - Number number = format.parse(param); - double binWidth = -1d; + protected double getBinWidth(double[] values) { + // Return -1 to trigger a calculation of the bin width in + // AdvancedHistogramDataset if the user chose the number of bins as + // dominant value. + String choice = (String) requestParameter.get(REQUEST_KEY_BIN_CHOICE); + if (choice == null || !choice.equalsIgnoreCase(REQUEST_KEY_BIN_WIDTH)) { + return -1; + } - if (number instanceof Double) { - binWidth = ((Double) number).doubleValue(); - } - else if (number instanceof Long) { - binWidth = ((Long) number).doubleValue(); - } - else if (number instanceof Integer) { - binWidth = ((Integer) number).doubleValue(); - } - else { - logger.warn("Invalid bin width for histogram chart: " + param); - logger.warn("Return default bins: " + DEFAULT_BINS); - - return DEFAULT_BINS; - } - - double tmpBins = totalWidth / binWidth; + int bins = -1; + String param = (String) requestParameter.get(REQUEST_KEY_BIN_WIDTH); - bins = (int) Math.round(tmpBins); - bins = bins <= 0 ? DEFAULT_BINS : bins; - bins = bins > MAXIMAL_BINS ? MAXIMAL_BINS : bins; + double[] minmax = getMinMax(values); + double totalWidth = minmax[1] - minmax[0]; + double binWidth = Double.parseDouble(param); - return bins; + double tmpBins = totalWidth / binWidth; + + bins = (int) Math.round(tmpBins); + bins = bins <= 0 ? DEFAULT_BINS : bins; + + // the calculated number of bins with the given width exceed the maximum + // number of bins. + if (bins > MAXIMAL_BINS) { + return totalWidth / (MAXIMAL_BINS); } - catch (ParseException pe) { - logger.warn("Invalid bin width for histogram chart: " + param); - logger.warn("Return default bins: " + DEFAULT_BINS); - return DEFAULT_BINS; - } - catch (NumberFormatException nfe) { - logger.warn("Invalid bin width for histogram chart: " + param); - logger.warn("Return default bins: " + DEFAULT_BINS); - - return DEFAULT_BINS; - } + return binWidth; } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/HorizontalCrossProfileChart.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/HorizontalCrossProfileChart.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/HorizontalCrossProfileChart.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.chart; import de.intevation.gnv.geobackend.base.Result; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.chart; import com.vividsolutions.jts.geom.Point; @@ -53,7 +61,9 @@ * The first point in a HorizontalProfileChart. It is used to calculate the * distance between the currently processed point an the start. */ - private Point firstPoint; + protected Point lastPoint; + + protected double distance = 0d; /** * Constructor used to create horizontal profile charts. @@ -147,23 +157,20 @@ @Override protected void addValue(Result row, Series series) { - double distance = 0; - try { Point point = (Point) wktReader.read(row.getString("SHAPE")); - if (firstPoint != null) { - distance = DistanceCalculator.calculateDistance( - firstPoint, point + if (lastPoint != null) { + distance += DistanceCalculator.calculateDistance( + lastPoint, point ); } - else { - firstPoint = point; - } ((XYSeries) series).add( distance, row.getDouble("YORDINATE") ); + + lastPoint = point; } catch(ParseException pe) { log.warn("No data found while parsing."); @@ -175,8 +182,9 @@ protected void addSeries(Series series, String label, int idx) { super.addSeries(series, label, idx); - // reset firstPoint for next series - firstPoint = null; + // reset lastPoint and distance of the last series + lastPoint = null; + distance = 0; } @@ -280,26 +288,19 @@ Point lastPoint = null; Point currentPoint = null; - try { - firstPoint = getPoint(results[0]); - } - catch (ParseException pe) { - log.error("Unable to parse start point for gap detection."); - return; - } - + double distance = 0; + double distanceOld = 0; for (int i = startPos+1; i < endPos; i++) { try { last = results[i-1].getInteger(axis); lastPoint = getPoint(results[i-1]); current = results[i].getInteger(axis); currentPoint = getPoint(results[i]); - double distance = DistanceCalculator.calculateDistance( - firstPoint, + + distanceOld = distance; + distance += DistanceCalculator.calculateDistance( + lastPoint, currentPoint); - double distanceOld = DistanceCalculator.calculateDistance( - firstPoint, - lastPoint); boolean detected = gridDetection(last, current); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/HorizontalProfileVectorChart.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/HorizontalProfileVectorChart.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.chart; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.geobackend.base.ResultDescriptor; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Locale; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; + +import org.jfree.chart.plot.XYPlot; + +import org.jfree.data.xy.XYSeries; +import org.jfree.data.xy.XYSeriesCollection; + +/** + * This class is used to create xy charts of vertical profiles. + * + * @author Ingo Weinzierl + */ +public class HorizontalProfileVectorChart +extends HorizontalProfileChart +{ + private static Logger logger = + Logger.getLogger(HorizontalProfileVectorChart.class); + + + public HorizontalProfileVectorChart( + ChartLabels labels, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Collection result, + Collection timeGaps, + Locale locale, + boolean linesVisible, + boolean shapesVisible + ) { + super(labels, theme, parameters, measurements, dates, result, + timeGaps, locale, linesVisible, shapesVisible); + } + + + @Override + protected void initData() { + Iterator iter = resultSet.iterator(); + Result row = null; + String seriesName = null; + XYSeries series = null; + + int idx = 0; + int startPos = 0; + int endPos = 0; + + double startValue = 0; + double endValue = 0; + + ResultDescriptor rd = null; + int idxSeries = -1; + int idxX = -1; + int idxY = -1; + + Result[] results = + (Result[]) resultSet.toArray(new Result[resultSet.size()]); + + while (iter.hasNext()) { + row = (Result) iter.next(); + + if (rd == null) { + rd = row.getResultDescriptor(); + idxSeries = rd.getColumnIndex("SERIES"); + idxX = rd.getColumnIndex("XORDINATE"); + idxY = rd.getColumnIndex("YORDINATE"); + } + + if (!row.getString(idxSeries).equals(seriesName)) { + logger.debug("prepare data/plot for next dataset."); + + if (series != null) { + gapDetection(results, series, startPos, endPos); + addSeries(series, seriesName, idx); + + startPos = endPos + 1; + } + + seriesName = row.getString(idxSeries); + + logger.debug("next data is '" + seriesName + "'"); + series = new XYSeries(seriesName); + } + + addValue(row, series); + Object x = getValue(row); + Double y = row.getDouble(idxY); + if (x != null && y != null) { + storeMaxRange(ranges, y, seriesName); + storeMaxValue(values, x, seriesName); + } + + endPos++; + } + + if (results.length == 0) + return; + + gapDetection(results, series, startPos, endPos); + addSeries(series, seriesName, idx); + + addDatasets(); + } + + + @Override + protected void addDatasets() { + XYPlot plot = chart.getXYPlot(); + int idx = 0; + + XYSeriesCollection sc = null; + Iterator iter = datasets.keySet().iterator(); + + while (iter.hasNext()) { + String key = (String) iter.next(); + sc = (XYSeriesCollection)datasets.get(key); + plot.setDataset(idx, sc ); + logger.debug("Added " + key + " parameter to plot."); + prepareAxis(key, idx); + adjustRenderer( + idx++, + sc.getSeriesCount(), + linesVisible, + shapesVisible + ); + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.chart; import de.intevation.gnv.artifacts.ressource.RessourceFactory; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesVectorChart.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesVectorChart.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.chart; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.geobackend.base.ResultDescriptor; + +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; +import java.util.Locale; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; +import org.jfree.chart.plot.XYPlot; + +import org.jfree.data.time.Minute; +import org.jfree.data.time.TimeSeries; +import org.jfree.data.time.TimeSeriesCollection; + + +/** + * This class is used to create timeseries charts that contain components of a + * vector parameter. The domain axis contains multiple date/time objects. + * + * @author Ingo Weinzierl + */ +public class TimeSeriesVectorChart extends TimeSeriesChart { + + private static Logger logger =Logger.getLogger(TimeSeriesVectorChart.class); + + public TimeSeriesVectorChart( + ChartLabels labels, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Collection result, + Collection timeGaps, + Locale locale, + boolean linesVisible, + boolean shapesVisible + ) { + super(labels, theme, parameters, measurements, dates, result, + timeGaps, locale, linesVisible, shapesVisible); + } + + + @Override + protected void initData() { + logger.debug("init data for timeseries vector chart"); + + Iterator iter = resultSet.iterator(); + Result row = null; + String seriesName = null; + TimeSeries series = null; + + int idx = 0; + int startPos = 0; + int endPos = 0; + Date startDate = null; + Date endDate = null; + + ResultDescriptor rd = null; + int idxSeries = -1; + int idxX = -1; + int idxY = -1; + + Result[] results = + (Result[]) resultSet.toArray(new Result[resultSet.size()]); + + while (iter.hasNext()) { + row = (Result) iter.next(); + + if (rd == null) { + rd = row.getResultDescriptor(); + idxSeries = rd.getColumnIndex("SERIES"); + idxX = rd.getColumnIndex("XORDINATE"); + idxY = rd.getColumnIndex("YORDINATE"); + } + + // add current data to plot and prepare for next one + if (!row.getString(idxSeries).equals(seriesName)) { + logger.debug("prepare data/plot for next dataset"); + + if(series != null) { + // add gaps before adding series to chart + startDate = results[startPos].getDate(idxX); + endDate = results[endPos-1].getDate(idxX); + addGaps(results,series,startDate,endDate,startPos,endPos); + addSeries(series, seriesName, idx); + + startPos = endPos + 1; + } + + // prepare variables for next plot + seriesName = row.getString(idxSeries); + + logger.debug("next dataset is '" + seriesName + "'"); + series = new TimeSeries(seriesName, Minute.class); + } + + addValue(row, series); + storeMaxRange(ranges, row.getDouble(idxY), seriesName); + endPos++; + } + + if (startPos < results.length && endPos-1 < results.length) { + // add the last dataset if existing to plot and prepare its axis + startDate = results[startPos].getDate(idxX); + endDate = results[endPos-1].getDate(idxX); + addGaps(results, series, startDate, endDate, startPos, endPos); + addSeries(series, seriesName, idx); + } + + addDatasets(); + } + + + @Override + protected void addDatasets() { + XYPlot plot = chart.getXYPlot(); + int idx = 0; + + TimeSeriesCollection tsc = null; + Iterator iter = datasets.keySet().iterator(); + + while (iter.hasNext()) { + String key = (String) iter.next(); + tsc = (TimeSeriesCollection)datasets.get(key); + plot.setDataset(idx, tsc ); + logger.debug("Added " + key + " parameter to plot."); + prepareAxis(key, idx); + adjustRenderer( + idx++, + tsc.getSeriesCount(), + linesVisible, + shapesVisible + ); + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalCrossSectionChart.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalCrossSectionChart.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalCrossSectionChart.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.chart; import de.intevation.gnv.jfreechart.PolygonDataset; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.chart; import de.intevation.gnv.geobackend.base.Result; @@ -127,6 +135,9 @@ protected void initData() { log.debug("init data for VerticalProfileChart"); + int items = resultSet.size(); + log.debug("Found " + items + " items for this chart."); + String breakPoint1 = null; String breakPoint2 = null; String breakPoint3 = null; @@ -157,7 +168,9 @@ log.debug("prepare data/plot for next dataset"); if(series != null) { - gapDetection(results, series, startPos, endPos); + if (startPos >= 0 && endPos < items) { + gapDetection(results, series, startPos, endPos); + } addSeries(series, parameter, idx); startPos = endPos +1; @@ -189,10 +202,12 @@ endPos++; } - if (results.length == 0) + if (items == 0) return; - gapDetection(results, series, startPos, endPos); + if (startPos >= 0 && endPos < items) { + gapDetection(results, series, startPos, endPos); + } addSeries(series, parameter, idx); addDatasets(); @@ -244,51 +259,59 @@ super.prepareAxis(seriesKey, idx); XYPlot plot = chart.getXYPlot(); - NumberAxis domainAxis = (NumberAxis) plot.getRangeAxis(); - NumberAxis rangeAxis = (NumberAxis) plot.getDomainAxis(); + NumberAxis domainAxis = (NumberAxis) plot.getRangeAxis(idx); Range domainRange = domainAxis.getRange(); - Range rangeRange = rangeAxis.getRange(); log.debug("Domain axis range before: " + domainRange.toString()); - log.debug("Range axis range before: " + rangeRange.toString()); domainRange = Range.expand(domainRange, LOWER_MARGIN, UPPER_MARGIN); - rangeRange = Range.expand(rangeRange, LOWER_MARGIN, UPPER_MARGIN); double lower = domainRange.getLowerBound(); double upper = domainRange.getUpperBound(); if (lower == upper) { - domainRange = new Range( - lower - (lower * 0.05d), - upper + (upper * 0.05d)); + double lo = lower > 0 ? lower - lower*0.05d : lower + lower*0.05d; + double up = upper > 0 ? upper + upper*0.05d : upper - upper*0.05d; + + domainRange = new Range(lo, up); } - log.debug("Domain axis range after: " + domainRange.toString()); - log.debug("Range axis range after: " + rangeRange.toString()); + log.debug("Range axis range after: " + domainRange.toString()); domainAxis.setRange(domainRange); - rangeAxis.setRange(rangeRange); - - plot.setRangeAxis(domainAxis); + plot.setRangeAxis(idx, domainAxis); } /** - * Method to expand max range of a range axis identified by seriesKey. + * Method to expand max range of a range axis. * LOWER_MARGIN and UPPER_MARGIN are used to * expand the range. - * - * @param seriesKey Key to identify the series stored at the current - * Dataset. - * @param idx Currently not used. */ protected void prepareRangeAxis(String seriesKey, int idx) { + log.debug("Adjust domain range now..."); XYPlot plot = chart.getXYPlot(); - NumberAxis xAxis = (NumberAxis) plot.getDomainAxis(); + NumberAxis yAxis = (NumberAxis) plot.getDomainAxis(); - Range xRange = (Range) values.get(seriesKey); - xAxis.setRange(Range.expand(xRange, LOWER_MARGIN, UPPER_MARGIN)); - log.debug("Max X-Range of dataset is: " + xRange.toString()); + Range yRange = yAxis.getRange(); + double lo = yRange.getLowerBound(); + double hi = yRange.getUpperBound(); + + Iterator iter = values.values().iterator(); + while (iter.hasNext()) { + Range tmp = (Range) iter.next(); + log.debug("Series range: " + tmp.toString()); + + lo = lo < tmp.getLowerBound() ? lo : tmp.getLowerBound(); + hi = hi > tmp.getUpperBound() ? hi : tmp.getUpperBound(); + } + + Range merged = Range.expand( + new Range(lo, hi), + LOWER_MARGIN, UPPER_MARGIN); + log.debug("Calculated range for all series = " + merged.toString()); + + yAxis.setRange(merged); + plot.setDomainAxis(yAxis); } @@ -359,6 +382,8 @@ ); } } + + prepareRangeAxis(null, -1); } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileVectorChart.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileVectorChart.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,159 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.chart; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.geobackend.base.ResultDescriptor; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Locale; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; + +import org.jfree.chart.plot.XYPlot; + +import org.jfree.data.xy.XYSeries; +import org.jfree.data.xy.XYSeriesCollection; + +/** + * This class is used to create xy charts of vertical profiles. + * + * @author Ingo Weinzierl + */ +public class VerticalProfileVectorChart +extends VerticalProfileChart +{ + private static Logger logger = + Logger.getLogger(VerticalProfileVectorChart.class); + + public VerticalProfileVectorChart( + ChartLabels labels, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Collection result, + Collection timeGaps, + Locale locale, + boolean linesVisible, + boolean shapesVisible + ) { + super(labels, theme, parameters, measurements, dates, result, + timeGaps, locale, linesVisible, shapesVisible); + } + + + @Override + protected void initData() { + logger.debug("init data for verticalprofile chart with vector data."); + + int items = resultSet.size(); + logger.debug("Found " + items + " items for this chart."); + + Iterator iter = resultSet.iterator(); + Result row = null; + String seriesName = null; + XYSeries series = null; + + int idx = 0; + int startPos = 0; + int endPos = 0; + + double startValue = 0; + double endValue = 0; + + ResultDescriptor rd = null; + int idxSeries = -1; + int idxX = -1; + int idxY = -1; + + Result[] results = + (Result[]) resultSet.toArray(new Result[resultSet.size()]); + + while (iter.hasNext()) { + row = (Result) iter.next(); + + if (rd == null) { + rd = row.getResultDescriptor(); + idxSeries = rd.getColumnIndex("SERIES"); + idxX = rd.getColumnIndex("XORDINATE"); + idxY = rd.getColumnIndex("YORDINATE"); + } + + if (!row.getString(idxSeries).equals(seriesName)) { + logger.debug("prepare data/plot for next dataset."); + + if (series != null) { + if (startPos >= 0 && endPos < items) { + gapDetection(results, series, startPos, endPos); + } + + addSeries(series, seriesName, idx); + + startPos = endPos + 1; + } + + seriesName = row.getString(idxSeries); + + logger.debug("next data is '" + seriesName + "'"); + series = new XYSeries(seriesName); + } + + addValue(row, series); + Object x = getValue(row); + Double y = row.getDouble(idxY); + if (x != null && y != null) { + storeMaxRange(ranges, y, seriesName); + storeMaxValue(values, x, seriesName); + } + + endPos++; + } + + if (results.length == 0) + return; + + if (startPos >= 0 && endPos < items) { + gapDetection(results, series, startPos, endPos); + } + addSeries(series, seriesName, idx); + + addDatasets(); + } + + + @Override + protected void addDatasets() { + XYPlot plot = chart.getXYPlot(); + int idx = 0; + + XYSeriesCollection sc = null; + Iterator iter = datasets.keySet().iterator(); + + while (iter.hasNext()) { + String key = (String) iter.next(); + sc = (XYSeriesCollection)datasets.get(key); + plot.setDataset(idx, sc ); + logger.debug("Added " + key + " parameter to plot."); + prepareAxis(key, idx); + adjustRenderer( + idx++, + sc.getSeriesCount(), + linesVisible, + shapesVisible + ); + } + + prepareRangeAxis(null, -1); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/XMLChartTheme.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/XMLChartTheme.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/XMLChartTheme.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,14 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.chart; -import de.intevation.artifactdatabase.Config; +import de.intevation.artifacts.common.utils.Config; import java.awt.Color; import java.awt.Font; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/chart/exception/TechnicalChartException.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/chart/exception/TechnicalChartException.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/exception/TechnicalChartException.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.chart.exception; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/exports/ChartExportHelper.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/ChartExportHelper.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/ChartExportHelper.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.exports; import com.lowagie.text.Document; @@ -9,7 +17,9 @@ import com.lowagie.text.pdf.PdfTemplate; import com.lowagie.text.pdf.PdfWriter; -import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.CallContext; + +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.gnv.chart.Chart; @@ -233,20 +243,56 @@ OutputStream out, JFreeChart chart, String pageFormat, - boolean landscape, float marginLeft, float marginRight, float marginTop, - float marginBottom + float marginBottom, + CallContext context ) { log.info("export chart as pdf."); if (pageFormat == null) pageFormat = DEFAULT_PAGE_SIZE; + // max size of the chart Rectangle page = PageSize.getRectangle(pageFormat); - int pageWidth = (int) (page.getRight(marginRight) - page.getLeft(marginLeft)); - int pageHeight = (int) (page.getTop(marginTop) - page.getBottom(marginBottom)); + float pageWidth = page.getWidth(); + float pageHeight = page.getHeight(); + + // the chart width + int chartWidth = (Integer) context.getContextValue("chart.width"); + int chartHeight = (Integer) context.getContextValue("chart.height"); + + boolean landscape = chartWidth > chartHeight ? true : false; + + float width = 0; + float height = 0; + if (landscape) { + width = pageHeight; + height = pageWidth; + } + else { + width = pageWidth; + height = pageHeight; + } + + float spaceX = width - marginLeft - marginRight; + if (chartWidth > spaceX) { + log.warn("Width of the chart is too big for pdf -> resize it now."); + double ratio = ((double)spaceX) / chartWidth; + chartWidth *= ratio; + chartHeight *= ratio; + log.debug("Resized chart to " + chartWidth + "x" + chartHeight); + } + + float spaceY = height - marginTop - marginBottom; + if (chartHeight > spaceY) { + log.warn("Height of the chart is too big for pdf -> resize it now."); + double ratio = ((double)spaceY) / chartHeight; + chartWidth *= ratio; + chartHeight *= ratio; + log.debug("Resized chart to " + chartWidth + "x" + chartHeight); + } Document document = null; if (landscape) { @@ -265,24 +311,20 @@ PdfContentByte content = writer.getDirectContent(); - int width = 0; - int height = 0; - if (landscape) { - width = pageHeight; - height = pageWidth; - } - else { - width = pageWidth; - height = pageHeight; - } - PdfTemplate template = content.createTemplate(width, height); Graphics2D graphics = template.createGraphics(width, height); - Rectangle2D area = new Rectangle2D.Double(0.0D, 0.0D,width,height); + + double[] origin = getCenteredAnchor( + marginLeft, marginRight, marginBottom, marginTop, + width, height, + chartWidth, chartHeight); + + Rectangle2D area = new Rectangle2D.Double( + origin[0], origin[1], chartWidth, chartHeight); chart.draw(graphics, area); graphics.dispose(); - content.addTemplate(template, marginLeft, marginBottom); + content.addTemplate(template, 0f, 0f); } catch (DocumentException de) { log.error("Error while exporting chart to pdf.", de); @@ -313,11 +355,11 @@ OutputStream out, Chart[] histograms, String pageFormat, - boolean landscape, float marginLeft, float marginRight, float marginTop, - float marginBottom + float marginBottom, + CallContext context ) { log.info("export histogram as pdf."); @@ -325,10 +367,43 @@ pageFormat = DEFAULT_PAGE_SIZE; Rectangle page = PageSize.getRectangle(pageFormat); - int pageWidth = - (int) (page.getRight(marginRight) - page.getLeft(marginLeft)); - int pageHeight = - (int) (page.getTop(marginTop) - page.getBottom(marginBottom)); + float pageWidth = page.getWidth(); + float pageHeight = page.getHeight(); + + // the chart width + int chartWidth = (Integer) context.getContextValue("chart.width"); + int chartHeight = (Integer) context.getContextValue("chart.height"); + + boolean landscape = chartWidth > chartHeight ? true : false; + + float width = 0; + float height = 0; + if (landscape) { + width = pageHeight; + height = pageWidth; + } + else { + width = pageWidth; + height = pageHeight; + } + + float spaceX = width - marginLeft - marginRight; + if (chartWidth > spaceX) { + log.warn("Histogram width is too big for pdf -> resize it now."); + double ratio = ((double)spaceX) / chartWidth; + chartWidth *= ratio; + chartHeight *= ratio; + log.debug("Resized chart to " + chartWidth + "x" + chartHeight); + } + + float spaceY = height - marginTop - marginBottom; + if (chartHeight > spaceY) { + log.warn("Histogram height is too big for pdf -> resize it now."); + double ratio = ((double)spaceY) / chartHeight; + chartWidth *= ratio; + chartHeight *= ratio; + log.debug("Resized chart to " + chartWidth + "x" + chartHeight); + } Document document = null; if (landscape) { @@ -346,17 +421,6 @@ PdfContentByte content = writer.getDirectContent(); - int width = 0; - int height = 0; - if (landscape) { - width = pageHeight; - height = pageWidth; - } - else { - width = pageWidth; - height = pageHeight; - } - int size = histograms.length; for (int i = 0; i < size; i++) { if (i > 0) { @@ -366,20 +430,80 @@ JFreeChart chart = histograms[i].generateChart(); PdfTemplate template = content.createTemplate(width, height); Graphics2D graphics = template.createGraphics(width, height); + + double[] origin = getCenteredAnchor( + marginLeft, marginRight, marginBottom, marginTop, + width, height, + chartWidth, chartHeight); + Rectangle2D area = new Rectangle2D.Double( - 0.0D, 0.0D,width,height); + origin[0], origin[1], chartWidth, chartHeight); chart.draw(graphics, area); graphics.dispose(); - content.addTemplate(template, marginLeft, marginBottom); + content.addTemplate(template, 0f, 0f); } } catch (DocumentException de) { - log.error("Error while exporting chart to pdf.", de); + log.error("Error while exporting histogram to pdf.", de); } finally { document.close(); } } + + + /** + * This method returns the anchor of the chart so that the chart is centered + * according to the given parameters. + * + * @param mLeft Left margin + * @param mRight Right margin + * @param mBottom Bottom margin + * @param mTop Top margin + * @param width The complete width of the drawing area. + * @param height The complete height of the drawing area. + * @param chartWidth The width of the chart. + * @param chartHeight The height of the chart. + * + * @return an array that contains the anchor for a chart with the given + * parameters. The first value is the x point, the second value is the y + * point. + */ + public static double[] getCenteredAnchor( + double mLeft, double mRight, double mBottom, double mTop, + double width, double height, + double chartWidth, double chartHeight + ) { + if (log.isDebugEnabled()) { + log.debug("Calculate centered origin..."); + log.debug("-> PDF width : " + width); + log.debug("-> PDF height : " + height); + log.debug("-> Chart width : " + chartWidth); + log.debug("-> Chart height : " + chartHeight); + log.debug("-> margin left : " + mLeft); + log.debug("-> margin right : " + mRight); + log.debug("-> margin bottom: " + mBottom); + log.debug("-> margin top : " + mTop); + } + + double[] origin = new double[2]; + + double centerX = width / 2; + double centerY = height / 2; + + origin[0] = centerX - chartWidth / 2; + origin[1] = centerY - chartHeight / 2; + + origin[0] = origin[0] >= mLeft ? origin[0] : mLeft; + origin[1] = origin[1] >= mTop ? origin[1] : mTop; + + if (log.isDebugEnabled()) { + log.debug("==> centered left origin: " + origin[0]); + log.debug("==> centered top origin: " + origin[1]); + } + + return origin; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultDataCollector.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultDataCollector.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultDataCollector.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.exports; import de.intevation.gnv.geobackend.base.Result; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultExport.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultExport.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultExport.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.exports; import au.com.bytecode.opencsv.CSVWriter; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultProfile.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultProfile.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultProfile.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.exports; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/exports/Export.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/Export.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/Export.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.exports; import de.intevation.gnv.geobackend.base.Result; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/exports/ODVExport.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/ODVExport.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/ODVExport.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.exports; import java.util.ArrayList; @@ -54,9 +62,12 @@ @Override - protected void writeData(Profile profile, Collection result, - CSVWriter writer) throws StateException { + protected void writeData( + Profile profile, Collection result, CSVWriter writer + )throws StateException + { Iterator it = result.iterator(); + log.debug("Put " + result.size() + " elements into odv export."); String[] header = profile.getHeader(); ArrayList headerList = new ArrayList(); @@ -69,9 +80,8 @@ } ArrayList paramids = new ArrayList(); - Map> aggregatedRows = new HashMap>(); - - String currentParameterID = "N/N"; + Map> aggregatedRows = + new HashMap>(); while (it.hasNext()) { Result res = it.next(); @@ -81,17 +91,17 @@ String parameterValue = res.getString("DATAVALUE"); String parameterID = res.getString("PARAMETER"); - if (!currentParameterID.equals(parameterID)){ + if (!paramids.contains(parameterID)){ paramids.add(parameterID); - headerList.add(this.findParamTitle(parameters, parameterID)); + headerList.add(findParamTitle(parameters, parameterID)); headerList.add("QF"); - currentParameterID = parameterID; } Map aggregatedRow = aggregatedRows.get(key); if (aggregatedRow!= null){ aggregatedRow.put(parameterID, parameterValue); - }else{ + } + else{ Map params = new HashMap(); params.put(parameterID, parameterValue); aggregatedRows.put(key, params); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/exports/ShapeDataCollector.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/ShapeDataCollector.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/ShapeDataCollector.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.exports; import com.vividsolutions.jts.geom.Point; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/exports/SimpleOdvDataCollector.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/SimpleOdvDataCollector.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/SimpleOdvDataCollector.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.exports; import com.vividsolutions.jts.geom.Point; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/exports/StringArrayKey.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/StringArrayKey.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/StringArrayKey.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.exports; /** * A simple Key Class for generating an syntetic key using the @@ -58,4 +66,8 @@ public String[] getValue() { return value; } + + public String getKey() { + return key; + } } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/exports/VerticalCrossODVExport.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/exports/VerticalCrossODVExport.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/VerticalCrossODVExport.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.exports; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/histogram/HistogramHelper.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/histogram/HistogramHelper.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/histogram/HistogramHelper.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,5 +1,19 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.histogram; +import de.intevation.artifacts.CallContext; + +import de.intevation.gnv.artifacts.ressource.RessourceFactory; + +import de.intevation.gnv.chart.ChartLabels; + import de.intevation.gnv.geobackend.base.Result; import de.intevation.gnv.geobackend.base.ResultDescriptor; @@ -9,6 +23,7 @@ import java.util.Collection; import java.util.Iterator; import java.util.List; +import java.util.Locale; import org.apache.log4j.Logger; @@ -215,5 +230,113 @@ } return ""; } + + + /** + * Creates and returns labels to decorate histograms. + * + * @param uuid The UUID of the current artifact. + * @param context The CallContext object. + * @param data An array storing strings. + * @return A ChartLabels object with the 1st string in data as title. + */ + public static ChartLabels createHistogramLabels( + String uuid, CallContext context, Locale locale, Object[] data) + { + RessourceFactory fac = RessourceFactory.getInstance(); + + return new ChartLabels( + (String) data[0], + "", + "", + fac.getRessource(locale, "histogram.axis.range.title", "")); + } + + + public static Object[][] prepareVectorialHistogramData(Collection input) { + List names = new ArrayList(); + List data = new ArrayList(); + + if (logger.isDebugEnabled()) { + logger.debug("######### prepare vectorial histogram data #######"); + logger.debug("Input data size: " + input.size()); + } + + if (input == null) { + return new Object[0][0]; + } + + int sIdx = -1; + int yIdx = -1; + + String series = null; + + try { + Iterator iter = input.iterator(); + + if (iter.hasNext()) { + Result row = (Result) iter.next(); + Result previousRow = row; + + if (sIdx == -1 || yIdx == -1) { + ResultDescriptor rd = row.getResultDescriptor(); + sIdx = rd.getColumnIndex("SERIES"); + yIdx = rd.getColumnIndex("YORDINATE"); + + if (sIdx == -1 || yIdx == -1) { + return new Object[0][0]; + } + } + + List values = new ArrayList(); + while (iter.hasNext()) { + row = (Result) iter.next(); + + // found new series + if (series != null && !series.equals(row.getString(sIdx))) { + + // add values and parameter name + data.add((Double[]) + values.toArray(new Double[values.size()])); + names.add(series); + + if (logger.isDebugEnabled()) { + logger.debug(" --- series name: " + series); + logger.debug(" --- series items: " + values.size()); + } + + values.clear(); + } + + Double value = row.getDouble(yIdx); + if (value != null) + values.add(value); + + series = row.getString(sIdx); + } + + if (logger.isDebugEnabled()) { + logger.debug(" --- series name: " + series); + logger.debug(" --- series items: " + values.size()); + } + + data.add((Double[]) values.toArray(new Double[values.size()])); + names.add(series); + } + } + catch (Exception e) { + logger.error(e.getMessage(), e); + } + + int count = data.size(); + logger.debug(" === Found total: " + count); + Object[][] obj = new Object[count][2]; + for (int i = 0; i < count; i++) { + obj[i][0] = names.get(i); + obj[i][1] = (Double[]) data.get(i); + } + + return obj; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/CompactXYItems.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/CompactXYItems.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/CompactXYItems.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.jfreechart; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/LevelOrderIndices.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/LevelOrderIndices.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/LevelOrderIndices.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.jfreechart; import java.util.LinkedList; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonDataset.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonDataset.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonDataset.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.jfreechart; import java.util.ArrayList; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonPlot.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonPlot.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonPlot.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.jfreechart; import java.awt.AlphaComposite; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonRenderer.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonRenderer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonRenderer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.jfreechart; import java.awt.BasicStroke; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonSeries.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonSeries.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonSeries.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.jfreechart; import java.util.HashMap; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonSeriesLabelGenerator.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonSeriesLabelGenerator.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/jfreechart/PolygonSeriesLabelGenerator.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.jfreechart; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/layer/LayerArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/layer/LayerArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/layer/LayerArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,9 +1,18 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.layer; import org.apache.log4j.Logger; import org.w3c.dom.Document; import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallMeta; import de.intevation.gnv.artifacts.GNVArtifactBase; /** @@ -32,10 +41,15 @@ } @Override - public void setup(String identifier, ArtifactFactory factory, - Object context, Document data) { + public void setup( + String identifier, + ArtifactFactory factory, + Object context, + CallMeta meta, + Document data + ) { log.debug("LayerArtifact.setup"); - super.setup(identifier, factory, context, data); + super.setup(identifier, factory, context, meta, data); } } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/AreaInterpolation.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/AreaInterpolation.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/AreaInterpolation.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/AttributedPoint2ds.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/AttributedPoint2ds.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/AttributedPoint2ds.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.geom.MultiLineString; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/AttributedXYColumns.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/AttributedXYColumns.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/AttributedXYColumns.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import de.intevation.gnv.jfreechart.PolygonDataset; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/ConstantFunction.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/ConstantFunction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/ConstantFunction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import org.apache.commons.math.analysis.UnivariateRealFunction; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/ConstantXYDepth.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/ConstantXYDepth.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/ConstantXYDepth.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/GridCell.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/GridCell.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/GridCell.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.algorithm.CGAlgorithms; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/HeightValue.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/HeightValue.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/HeightValue.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/IJKey.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/IJKey.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/IJKey.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation2D.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation2D.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation2D.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation3D.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation3D.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation3D.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolator.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolator.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolator.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/L1Comparator.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/L1Comparator.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/L1Comparator.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearFunction.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearFunction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearFunction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import org.apache.commons.math.FunctionEvaluationException; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearMetrics.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearMetrics.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearMetrics.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearToMap.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearToMap.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearToMap.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/Metrics.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/Metrics.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/Metrics.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/Point2d.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/Point2d.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/Point2d.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/QueriedXYDepth.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/QueriedXYDepth.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/QueriedXYDepth.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/XYColumn.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/XYColumn.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/XYColumn.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import java.util.ArrayList; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/math/XYDepth.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/math/XYDepth.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/XYDepth.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.math; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,15 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.profile.horizontal; import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallMeta; import de.intevation.gnv.artifacts.GNVArtifactBase; @@ -40,9 +49,14 @@ * org.w3c.dom.Document) */ @Override - public void setup(String identifier, ArtifactFactory factory, - Object context, Document data) { + public void setup( + String identifier, + ArtifactFactory factory, + Object context, + CallMeta meta, + Document data + ) { log.debug("HorizontalProfileArtifact.setup"); - super.setup(identifier, factory, context, data); + super.setup(identifier, factory, context, meta, data); } } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileInstantaneousPointArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileInstantaneousPointArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileInstantaneousPointArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.profile.horizontal; import org.apache.log4j.Logger; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.profile.horizontal; import org.apache.log4j.Logger; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshCrossArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshCrossArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshCrossArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.profile.horizontal; import org.apache.log4j.Logger; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontalcrosssection/HorizontalCrossSectionMeshArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontalcrosssection/HorizontalCrossSectionMeshArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontalcrosssection/HorizontalCrossSectionMeshArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,15 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.profile.horizontalcrosssection; import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallMeta; import de.intevation.gnv.artifacts.GNVArtifactBase; @@ -40,10 +49,15 @@ * org.w3c.dom.Document) */ @Override - public void setup(String identifier, ArtifactFactory factory, - Object context, Document data) { + public void setup( + String identifier, + ArtifactFactory factory, + Object context, + CallMeta meta, + Document data + ) { log.debug("HorizontalCrossSectionMeshArtifact.setup"); - super.setup(identifier, factory, context, data); + super.setup(identifier, factory, context, meta, data); } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,15 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.profile.vertical; import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallMeta; import de.intevation.gnv.artifacts.GNVArtifactBase; @@ -39,10 +48,15 @@ * org.w3c.dom.Document) */ @Override - public void setup(String identifier, ArtifactFactory factory, - Object context, Document data) { + public void setup( + String identifier, + ArtifactFactory factory, + Object context, + CallMeta meta, + Document data + ) { log.debug("VerticalProfileArtifact.setup"); - super.setup(identifier, factory, context, data); + super.setup(identifier, factory, context, meta, data); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileInstantaneousPointArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileInstantaneousPointArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileInstantaneousPointArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.profile.vertical; import org.apache.log4j.Logger; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileMeshArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileMeshArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileMeshArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.profile.vertical; import org.apache.log4j.Logger; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,15 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.profile.verticalcrosssection; import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallMeta; import de.intevation.gnv.artifacts.GNVArtifactBase; @@ -40,10 +49,15 @@ * org.w3c.dom.Document) */ @Override - public void setup(String identifier, ArtifactFactory factory, - Object context, Document data) { + public void setup( + String identifier, + ArtifactFactory factory, + Object context, + CallMeta meta, + Document data + ) { log.debug("VerticalCrossSectionMeshArtifact.setup"); - super.setup(identifier, factory, context, data); + super.setup(identifier, factory, context, meta, data); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshParallelArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshParallelArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.profile.verticalcrosssection; + +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallMeta; + +import de.intevation.gnv.artifacts.GNVArtifactBase; + +import org.apache.log4j.Logger; + +import org.w3c.dom.Document; + +/** + * @author Ingo Weinzierl + * + */ +public class VerticalCrossSectionMeshParallelArtifact extends GNVArtifactBase { + + private static Logger logger = + Logger.getLogger(VerticalCrossSectionMeshParallelArtifact.class); + + + public VerticalCrossSectionMeshParallelArtifact() { + super(); + this.name = "verticalCrossSectionMeshParallel"; + } + + + @Override + public void setup( + String identifier, + ArtifactFactory factory, + Object context, + CallMeta meta, + Document data + ){ + super.setup(identifier, factory, context, meta, data); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/AbstractProducer.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/AbstractProducer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/AbstractProducer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import de.intevation.gnv.raster.Vectorizer.RingsHandler; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/DemuxRingsHandler.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/DemuxRingsHandler.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/DemuxRingsHandler.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import de.intevation.gnv.raster.Vectorizer.Edge; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/ExternalIndexConverter.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/ExternalIndexConverter.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/ExternalIndexConverter.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import org.apache.log4j.Logger; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/Filter.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/Filter.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/Filter.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import org.w3c.dom.Element; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/IsoAttributeGenerator.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/IsoAttributeGenerator.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/IsoAttributeGenerator.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/IsoPolygonSeriesProducer.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/IsoPolygonSeriesProducer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/IsoPolygonSeriesProducer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import de.intevation.gnv.jfreechart.CompactXYItems; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/IsoProducer.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/IsoProducer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/IsoProducer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import de.intevation.gnv.math.IJKey; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/JTSMultiLineStringProducer.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/JTSMultiLineStringProducer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/JTSMultiLineStringProducer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/JTSMultiPolygonProducer.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/JTSMultiPolygonProducer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/JTSMultiPolygonProducer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import com.vividsolutions.jts.algorithm.CGAlgorithms; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/KernelFilter.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/KernelFilter.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/KernelFilter.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import org.apache.log4j.Logger; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/Palette.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/Palette.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/Palette.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import de.intevation.gnv.raster.Raster.ValueToIndex; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/PaletteManager.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/PaletteManager.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/PaletteManager.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import java.lang.ref.SoftReference; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/PolygonDatasetProducer.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/PolygonDatasetProducer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/PolygonDatasetProducer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import de.intevation.gnv.jfreechart.CompactXYItems; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/Raster.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/Raster.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/Raster.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/RasterToPPM.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/RasterToPPM.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/RasterToPPM.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import java.awt.Color; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/raster/Vectorizer.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/raster/Vectorizer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/raster/Vectorizer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.raster; import gnu.trove.TIntObjectHashMap; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/AutoResumeState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/AutoResumeState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/AutoResumeState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/CoordinateSelectionState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/CoordinateSelectionState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/CoordinateSelectionState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import java.util.ArrayList; @@ -13,7 +21,7 @@ import com.vividsolutions.jts.geom.Point; -import de.intevation.artifactdatabase.Config; +import de.intevation.artifacts.common.utils.Config; import de.intevation.gnv.geobackend.base.Result; import de.intevation.gnv.state.describedata.DefaultKeyValueDescribeData; import de.intevation.gnv.state.describedata.KeyValueDescibeData; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultAutoResumeState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultAutoResumeState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultAutoResumeState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,5 +1,15 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; +import de.intevation.artifacts.CallContext; + import de.intevation.gnv.geobackend.base.Result; import java.util.ArrayList; @@ -34,7 +44,8 @@ @Override - protected String[] getDescriptionForInputData(InputData data, String uuid) { + protected String[] getDescriptionForInputData( + InputData data, CallContext context, String uuid) { return new String[0]; } } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultExportMode.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultExportMode.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultExportMode.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultInputData.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultInputData.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultInputData.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import java.util.HashMap; @@ -161,5 +169,53 @@ return null; } + @Override + public int hashCode() { + logger.debug("*************************************"); + logger.debug("HashCode name: " + name); + + int hash = 0; + + hash ^= name.hashCode(); + + if (value != null) { + hash ^= value.hashCode() << 2; + } + + if (object != null) { + hash ^= object.hashCode() << 4; + } + + logger.debug("HashCode value: " + hash); + logger.debug("*************************************"); + + return hash; + } + + + @Override + public boolean equals(Object o) { + if (!(o instanceof DefaultInputData)) + return false; + + DefaultInputData other = (DefaultInputData) o; + + if (!name.equals(other.name)) + return false; + + if ((value == null) && (other.value == null)) + return false; + + if (!value.equals(other.value)) + return false; + + if (!(object == null) && (other.object == null)) + return false; + + if (!(object == other.object)) + return false; + + return true; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultInputValue.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultInputValue.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultInputValue.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultOutputMode.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultOutputMode.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultOutputMode.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import java.util.Collection; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/ExportMode.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/ExportMode.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/ExportMode.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/ExtendedInputData.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/ExtendedInputData.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/ExtendedInputData.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/InputData.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/InputData.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/InputData.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/InputValue.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/InputValue.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/InputValue.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/MeasurementState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/MeasurementState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/MeasurementState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,14 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; -import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.CallContext; import de.intevation.artifacts.CallMeta; @@ -22,10 +30,10 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; -import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Locale; +import java.util.TreeMap; import org.apache.log4j.Logger; @@ -108,17 +116,15 @@ if (i < 0) { measurements.add(key); i = measurements.indexOf(key); + + mDescriptions.add(val); + tmp = mDescriptions.indexOf(val); } if (j < 0) { logger.warn("Not a valid parameter: " + parameter); } - if (tmp < 0) { - mDescriptions.add(val); - tmp = mDescriptions.indexOf(val); - } - if (i >= 0 && i < measurements.size() && j >= 0 && j < parameters.size()) { @@ -388,7 +394,7 @@ } if (inputData == null) { - inputData = new HashMap(); + inputData = new TreeMap(); } ExtendedInputData extended = new ExtendedInputData( @@ -398,7 +404,8 @@ tupel[1]); if (name.equals(dataName)) { - String[] desc = getDescriptionForInputData(extended, uuid); + String[] desc = getDescriptionForInputData( + extended, context, uuid); extended.setDescription(desc); } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxDateState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxDateState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxDateState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import java.util.Collection; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import java.util.ArrayList; @@ -6,13 +14,14 @@ import java.util.GregorianCalendar; import java.util.Iterator; import java.util.List; +import java.util.Locale; import org.apache.log4j.Logger; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; -import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.CallContext; import de.intevation.artifacts.CallMeta; import de.intevation.gnv.artifacts.ressource.RessourceFactory; @@ -39,7 +48,13 @@ */ private static Logger log = Logger.getLogger(MinMaxState.class); - /** + /** + * Key to lookup the localized exceptionmessage in the ResourceFiles. + */ + public static final String EXCEPTION_INVALID_MIN_MAX_INPUT = + "input.is.not.valid.minmax"; + + /** * Constructor */ public MinMaxState() { @@ -123,8 +138,16 @@ } if (min != null && max != null) { - if (!InputValidator.isInputValid((String) min, (String) max, type)) { - String msg = "Input is not valid for this state."; + if (!InputValidator.isInputValid((String) min, + (String) max, + type)) { + Locale[] serverLocales = resFactory.getLocales(); + Locale locale = context.getMeta() + .getPreferredLocale( + serverLocales); + String msg = resFactory.getRessource(locale, + EXCEPTION_INVALID_MIN_MAX_INPUT, + EXCEPTION_INVALID_MIN_MAX_INPUT); log.error(msg); return feedFailure(msg); } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputMode.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputMode.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputMode.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import de.intevation.artifacts.CallContext; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputStateBase.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputStateBase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputStateBase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import java.io.OutputStream; @@ -18,8 +26,8 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import de.intevation.artifactdatabase.Config; -import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.common.utils.Config; +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.CallContext; import de.intevation.artifacts.CallMeta; import de.intevation.gnv.artifacts.cache.CacheFactory; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/PreSettingsTransferCoordinateSelectionState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/PreSettingsTransferCoordinateSelectionState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/PreSettingsTransferCoordinateSelectionState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,14 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; -import de.intevation.artifactdatabase.Config; +import de.intevation.artifacts.common.utils.Config; import de.intevation.artifacts.CallContext; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/PreSettingsTransferState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/PreSettingsTransferState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/PreSettingsTransferState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,14 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; -import de.intevation.artifactdatabase.Config; +import de.intevation.artifacts.common.utils.Config; import de.intevation.artifacts.CallContext; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/SingleInputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/SingleInputState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/SingleInputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import de.intevation.artifacts.CallContext; @@ -101,7 +109,7 @@ tmpItem.getValue(), inputValue.getType()); if (valid) { - String[] desc = getDescriptionForInputData(tmpItem, uuid); + String[] desc = getDescriptionForInputData(tmpItem, context, uuid); tmpItem.setDescription(desc); this.inputData.put(tmpItem.getName(), tmpItem); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/State.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/State.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/State.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import de.intevation.artifacts.CallContext; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import java.text.DateFormat; @@ -13,6 +21,8 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import java.util.Set; +import java.util.TreeMap; import javax.xml.xpath.XPathConstants; @@ -24,8 +34,8 @@ import org.w3c.dom.Node; import org.w3c.dom.NodeList; -import de.intevation.artifactdatabase.Config; -import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.common.utils.Config; +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.ArtifactNamespaceContext; import de.intevation.artifacts.CallContext; import de.intevation.artifacts.CallMeta; @@ -243,8 +253,7 @@ InputValue inputValue = this.inputValues.get(tmpItem.getName()); if (inputValue != null) { if (this.inputData == null) { - this.inputData = new HashMap( - inputData.size()); + this.inputData = new TreeMap(); } boolean valid = InputValidator.isInputValid(tmpItem.getValue(), @@ -252,7 +261,8 @@ if (valid) { if (tmpItem.getName().equals(this.dataName)){ - String[] desc = getDescriptionForInputData(tmpItem, uuid); + String[] desc = getDescriptionForInputData( + tmpItem, context, uuid); tmpItem.setDescription(desc); } this.inputData.put(tmpItem.getName(), tmpItem); @@ -300,7 +310,9 @@ } - protected String[] getDescriptionForInputData(InputData data, String uuid) { + protected String[] getDescriptionForInputData( + InputData data, CallContext context, String uuid) + { // there is only one element in the list, so take the first Object obj = getDescibeData(uuid).get(0); List descs = new ArrayList(); @@ -348,8 +360,7 @@ InputValue inputValue = this.inputValues.get(tmpItem.getName()); if (inputValue != null) { if (this.inputData == null) { - this.inputData = new HashMap( - inputData.size()); + this.inputData = new TreeMap(); } boolean valid = InputValidator.isInputValid(tmpItem.getValue(), @@ -462,6 +473,7 @@ InputData data = this.inputData.get(value); if (data != null && this.inputValues.containsKey(data.getName())) { + int size = this.inputValues.get(data.getName()) .usedInQueries(); String type = this.inputValues.get(data.getName()) @@ -695,7 +707,7 @@ String uuid) { State parent = getParent(); - if (parent != null && parent instanceof StateBase) { + if (parent instanceof StateBase) { ((StateBase) parent).describeStatic( artCreator, creator, document, staticNode, context, uuid); } @@ -712,7 +724,7 @@ Node staticNode, CallMeta callMeta ) { - InputData data = inputData.get(dataName); + InputData data = dataName!= null ? inputData.get(dataName) : null; if (data == null) { return; @@ -937,11 +949,21 @@ protected void setHash(String uuid) { - this.hash = uuid + - HASH_ID_SEPARATOR + - id + - HASH_ID_SEPARATOR + - inputData.hashCode(); + String newHash = uuid + HASH_ID_SEPARATOR + id + HASH_ID_SEPARATOR; + Set keys = inputData.keySet(); + + int nhash = 0; + int shift = 0; + + for (Object o: keys) { + nhash ^= inputData.get(o).hashCode() << shift; + shift += 2; + } + + log.info("### OLD HASH: " + hash); + log.info("### NEW HASH: " + (newHash + nhash)); + + this.hash = newHash + nhash; } @@ -954,10 +976,11 @@ CacheFactory factory = CacheFactory.getInstance(); if (factory.isInitialized()) { // we use a cache - log.debug("Using cache."); Cache cache = factory.getCache(); String key = getHash(); + log.debug("Using cache - key: " + key); + net.sf.ehcache.Element value = cache.get(key); if (value != null) { // element already in cache, so return it. @@ -973,6 +996,7 @@ List data = queryDatabase(filterValues, uuid); cache.put(new net.sf.ehcache.Element(key, data)); + return data; } catch (QueryException qe) { @@ -1043,6 +1067,17 @@ public void endOfLife(Object globalContext) { + log.debug("end of life of the current state."); + + CacheFactory factory = CacheFactory.getInstance(); + if (factory.isInitialized()) { + Cache cache = factory.getCache(); + String key = getHash(); + + if (key != null && cache.remove(key)) { + log.info("Removed element from cache - key: " + key); + } + } } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/StateFactory.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/StateFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/StateFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state; import de.intevation.gnv.artifacts.GNVArtifactBase; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/SwitchModeState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/SwitchModeState.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,136 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.state; + +import de.intevation.artifacts.common.utils.XMLUtils; + +import de.intevation.artifacts.CallContext; +import de.intevation.artifacts.CallMeta; +import de.intevation.artifacts.PreferredLocale; + +import de.intevation.gnv.artifacts.ressource.RessourceFactory; + +import org.apache.log4j.Logger; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; + + +/** + * This task of this State implementation is to switch between + * working with vector or scalar data. + * + * @author Ingo Weinzierl + */ +public class SwitchModeState extends StateBase { + + public static final String VECTOR_VALUE = "vector"; + public static final String SCALAR_VALUE = "scalar"; + + public static final String RESSOURCE_VECTOR = "vectorvalues"; + public static final String RESSOURCE_SCALAR = "scalarvalues"; + + private static Logger logger = Logger.getLogger(SwitchModeState.class); + + public SwitchModeState() { + } + + + @Override + protected void describeDynamic( + XMLUtils.ElementCreator artCreator, + XMLUtils.ElementCreator creator, + Document document, + Node dynamic, + CallContext context, + String uuid) + { + RessourceFactory ressource = RessourceFactory.getInstance(); + CallMeta callMeta = context.getMeta(); + PreferredLocale[] locales = callMeta.getLanguages(); + + Element selectNode = creator.create("select1"); + creator.addAttr(selectNode, "ref", dataName); + + Element labelNode = creator.create("label"); + labelNode.setTextContent(ressource.getRessource( + locales, dataName, dataName)); + selectNode.appendChild(labelNode); + + selectNode.appendChild(createChoices(creator, context)); + dynamic.appendChild(selectNode); + logger.debug("creating dynamic ui elements finished"); + } + + + protected Node createChoices( + XMLUtils.ElementCreator creator, + CallContext context) + { + RessourceFactory ressource = RessourceFactory.getInstance(); + CallMeta callMeta = context.getMeta(); + PreferredLocale[] locales = callMeta.getLanguages(); + + Element choiceNodes = creator.create("choices"); + + // add choice for scalar values + logger.debug("create choice for scalar values"); + Element scalar = creator.create("item"); + Element label = creator.create("label"); + label.setTextContent(ressource.getRessource( + locales, RESSOURCE_SCALAR, RESSOURCE_SCALAR)); + scalar.appendChild(label); + + Element value = creator.create("value"); + value.setTextContent(SCALAR_VALUE); + scalar.appendChild(value); + + // add choice for vector values + logger.debug("create choice for vector values"); + Element vector = creator.create("item"); + label = creator.create("label"); + label.setTextContent(ressource.getRessource( + locales, RESSOURCE_VECTOR, RESSOURCE_VECTOR)); + vector.appendChild(label); + + value = creator.create("value"); + value.setTextContent(VECTOR_VALUE); + vector.appendChild(value); + + choiceNodes.appendChild(scalar); + choiceNodes.appendChild(vector); + + return choiceNodes; + } + + + @Override + protected String[] getDescriptionForInputData( + InputData data, CallContext context, String uuid) + { + RessourceFactory ressource = RessourceFactory.getInstance(); + CallMeta callMeta = context.getMeta(); + PreferredLocale[] locales = callMeta.getLanguages(); + + String value = data.getValue(); + + if (value != null && value.equals(SCALAR_VALUE)) { + return new String[] { ressource.getRessource( + locales, RESSOURCE_SCALAR, RESSOURCE_SCALAR) }; + } + else if (value != null && value.equals(VECTOR_VALUE)) { + return new String[] { ressource.getRessource( + locales, RESSOURCE_VECTOR, RESSOURCE_VECTOR) }; + } + + return null; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/cache/QueryObject.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/cache/QueryObject.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/cache/QueryObject.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,8 +1,17 @@ -/** +/* + * Copyright (c) 2010 by Intevation GmbH * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. */ + package de.intevation.gnv.state.cache; /** + * This Class is a Container which carries the + * databasequery which belongs to an state. + * It is also possible to look up if the query contains a specific + * TableName. * @author Tim Englich * */ diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/cache/ThematicDataCacheCleaner.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/cache/ThematicDataCacheCleaner.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/cache/ThematicDataCacheCleaner.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + /** * */ @@ -15,7 +23,7 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; -import de.intevation.artifactdatabase.Config; +import de.intevation.artifacts.common.utils.Config; import de.intevation.gnv.artifacts.cache.CacheFactory; import de.intevation.gnv.geobackend.base.query.cache.CacheCleaner; import de.intevation.gnv.geobackend.base.query.container.QueryContainerFactory; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/cache/package.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/cache/package.html Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,9 @@ + + + + + +Classes in this package provide the cleanup mechanism for the +Thematic-Data-Cache of the Application. + + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultKeyValueDescribeData.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultKeyValueDescribeData.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultKeyValueDescribeData.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.describedata; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultMinMaxDescribeData.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultMinMaxDescribeData.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultMinMaxDescribeData.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.describedata; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultSingleValueDescribeData.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultSingleValueDescribeData.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultSingleValueDescribeData.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.describedata; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DescribeData.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DescribeData.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DescribeData.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.describedata; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/ExtendedKeyValueData.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/ExtendedKeyValueData.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/ExtendedKeyValueData.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.describedata; import org.apache.log4j.Logger; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/KeyValueDescibeData.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/KeyValueDescibeData.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/KeyValueDescibeData.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.describedata; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/MinMaxDescribeData.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/MinMaxDescribeData.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/MinMaxDescribeData.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.describedata; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedArrayList.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedArrayList.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedArrayList.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.describedata; import java.util.ArrayList; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedCollection.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedCollection.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedCollection.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.describedata; import java.util.Collection; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/SingleValueDescribeData.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/SingleValueDescribeData.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/SingleValueDescribeData.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.describedata; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/exception/StateException.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/exception/StateException.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/exception/StateException.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.exception; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerMetaData.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerMetaData.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerMetaData.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + /** * */ @@ -17,6 +25,7 @@ private String templateID = null; private String[] queryValues = null; private String geometryWKT = null; + private String layertitle = null; /** * Constructor @@ -32,15 +41,17 @@ */ public LayerMetaData(String table, String geometryType, String where, String columns, String templateID, - String[] queryValues,String geometryWKT) { + String[] queryValues,String geometryWKT, + String layertitle) { super(); - this.table = table; + this.table = table; this.geometryType = geometryType; - this.where = where; - this.columns = columns; - this.templateID = templateID; - this.queryValues = queryValues; - this.geometryWKT = geometryWKT; + this.where = where; + this.columns = columns; + this.templateID = templateID; + this.queryValues = queryValues; + this.geometryWKT = geometryWKT; + this.layertitle = layertitle; } /** @@ -103,4 +114,12 @@ return queryValues; } + /** + * Returns the layer title. + * @return the layer title. + */ + public String getLayertitle() { + return layertitle; + } + } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/layer/LayerOutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.layer; import java.io.File; @@ -11,12 +19,13 @@ import org.w3c.dom.Document; import org.w3c.dom.Node; +import com.vividsolutions.jts.geom.Envelope; import com.vividsolutions.jts.geom.Geometry; import com.vividsolutions.jts.io.ParseException; import com.vividsolutions.jts.io.WKTReader; -import de.intevation.artifactdatabase.Config; -import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.common.utils.Config; +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.ArtifactNamespaceContext; import de.intevation.artifacts.CallContext; import de.intevation.gnv.artifacts.context.GNVArtifactContext; @@ -170,6 +179,7 @@ String where = resultValue.getString(1); String columns = this.fetchColumns(table); String templateID = resultValue.getString(2); + String layername = resultValue.getString(3); String[] queryValues = null; String geometryWKT = null; if (this.geometryID != null){ @@ -203,6 +213,7 @@ table, where, geometryWKTData.getValue()}; + geometryWKT = geometryWKTData.getValue(); }else{ queryValues = new String[]{columns,table,where}; } @@ -221,10 +232,9 @@ queryValues = new String[]{columns,table,where}; } } - returnValue.add(new LayerMetaData(table, geometryType, - where, columns, - templateID, queryValues, - geometryWKT)); + returnValue.add(new LayerMetaData( + table, geometryType, where, columns, + templateID, queryValues, geometryWKT, layername)); } } return returnValue; @@ -235,7 +245,7 @@ * * @return the resultdata. */ - protected Collection fetchData(LayerMetaData layerMetaData){ + protected Collection fetchData(LayerMetaData layerMetaData, Envelope mbr){ log.debug("LayerOutputState.fetchData"); Collection data = null; QueryExecutor queryExecutor = QueryExecutorFactory.getInstance() @@ -243,9 +253,12 @@ try { data = queryExecutor.executeQuery(dataQueryID, layerMetaData.getQueryValues()); - if (data != null && layerMetaData.getGeometryWKT() != null){ + if (data != null){ WKTReader wktReader = new WKTReader(); - Geometry border = wktReader.read(layerMetaData.getGeometryWKT()); + Geometry border = null; + if (layerMetaData.getGeometryWKT() != null){ + border = wktReader.read(layerMetaData.getGeometryWKT()); + } Iterator dataIt = data.iterator(); while (dataIt.hasNext()){ // Trim the Geometries using the @@ -260,8 +273,15 @@ log.error(e,e); } if (currentGeometry != null){ - Geometry newGeometry = currentGeometry.intersection(border); - current.addColumnValue(0, newGeometry.toText()); + if (border != null){ + currentGeometry = currentGeometry.intersection(border); + current.addColumnValue(0, currentGeometry.toText()); + } + if (mbr.isNull()){ + mbr.init(currentGeometry.getEnvelopeInternal()); + }else{ + mbr.expandToInclude(currentGeometry.getEnvelopeInternal()); + } } } } @@ -475,9 +495,10 @@ } Iterator it = layerMetaData.iterator(); int i = 1; + Envelope mbr = new Envelope(); while(it.hasNext()){ LayerMetaData lmd = it.next(); - Collection data = this.fetchData(lmd); + Collection data = this.fetchData(lmd, mbr); p = writeToShapeFile(uuid, data, callContext,lmd.getGeometryType(),i++); } if (p != null) { @@ -501,6 +522,16 @@ } } + + /** + * Set the shapefile path. + */ + public void setShapeFilePath(String shapeFilePath) { + synchronized (shapeFileLock) { + this.shapeFilePath = shapeFilePath; + } + } + /** * Returns the basic-directory where the Shapefiles should be placed in. * @param callContext the Context of this Call @@ -576,67 +607,101 @@ * type, time to live of the current artifact, etc). * @throws StateException if an error occured while shapefile writing. */ - protected Document getWMS(String uuid, - CallContext callContext, - Collection layerMetaData, - Collection inputData) + protected Document getWMS( + String uuid, + CallContext callContext, + Collection layerMetaData, + Collection inputData) throws StateException { - String path = getShapeFilePath(); - if (path != null && new File(path).isDirectory()){ - return this.refreshMetaFile(layerMetaData, inputData, - uuid, callContext); - }else{ - Document document = XMLUtils.newDocument(); - if (this.shapeFilePath == null){ - File baseDir = shapefileDirectory(callContext); - if (!this.createShapeDir(baseDir, uuid)){ - // TODO Insert Error Report - return document; + Document document = XMLUtils.newDocument(); + + File baseDir = shapefileDirectory(callContext); + File shapeDir = new File(baseDir, uuid); + + boolean success = false; + boolean createdDir = false; + + try { + // create shapefile directory or delete content if it already exists + synchronized (shapeFileLock) { + if (shapeDir.exists()) { + FileUtils.deleteContent(shapeDir); } + else if (!shapeDir.mkdirs()) { + log.error("cannot create directory '" + + shapeDir.getAbsolutePath() + "'"); + return null; + } + setShapeFilePath(shapeDir.getAbsolutePath()); + createdDir = true; } - path = getShapeFilePath(); + + // process data Iterator it = layerMetaData.iterator(); - Node meta = null; + + // create meta file + Document meta = MetaWriter.initMeta(); + MetaWriter.insertAbstractMeta(callContext, meta); + + String path = getShapeFilePath(); + String prefix = getLayerPrefix(inputData); + + if (prefix == null) { + prefix = uuid; + } + int layerNumber = 0; + Envelope mbr = new Envelope(); while (it.hasNext()){ LayerMetaData lmd = it.next(); layerNumber ++; + String geometryType = lmd.getGeometryType(); - String templateId = lmd.getTemplateID(); + String templateId = lmd.getTemplateID(); + ExclusiveExec.UniqueKey key = ExclusiveExec.INSTANCE.acquire(uuid); try{ - Collection data = this.fetchData(lmd); - if (data != null && - (this.writeToShapeFile(uuid, data, callContext, - geometryType,layerNumber)) != null) { - String paramType = findParameterTitle(geometryType,templateId); - String title = getLayerTitle(inputData); - if (title == null) { - title = uuid+"_"+layerNumber; - }else{ - title = title+"_"+layerNumber; - } - if (meta == null){ - meta = MetaWriter.writeLayerMeta(callContext,document); - } - MetaWriter.writeLayerMeta(callContext, document, - meta, uuid, paramType, - this.determineGeometryType(geometryType), - createShapeFileName(layerNumber), - title); + Collection results = this.fetchData(lmd,mbr); + if (results != null && writeToShapeFile(uuid, results, + callContext, + geometryType, + layerNumber) != null) { + String name = getLayerName(uuid, layerNumber); + String base = lmd.getLayertitle(); + String title = getLayerTitle(prefix, base); + String data = getLayerData( + uuid, createShapeFileName(layerNumber)); + String type = determineGeometryType(geometryType); + String status = "OFF"; + String model = findParameterTitle( + geometryType, templateId); + + MetaWriter.insertLayer( + callContext, meta, name, title, + data, model, type, status); } + + success = true; + if (meta != null && !it.hasNext()) { - MetaWriter.writeMetaFile(path,document); + MetaWriter.insertMbr(mbr, "EPSG:4326",meta); + MetaWriter.writeMetaFile(path, meta); MapfileGenerator.getInstance().update(); - return document; + return meta; } }finally{ ExclusiveExec.INSTANCE.release(key); } } + return document; } + finally { + if (!success && createdDir) { + FileUtils.deleteRecursive(shapeDir); + } + } } /** @@ -648,58 +713,24 @@ return SHAPEFILE_NAME+"_"+layerNumber+".shp"; } - /** - * Method that refreshes the Metadatafile for publishing the WMS - * Without generating the Data ones again. - * @param layerMetaData the Metadata which is required to create the Layers - * @param inputData the Inputdata which was sent by the Client - * @param uuid the uuid of the Artifact - * @param callContext the context of this Call - * @return a refreshed Metadata-Document - */ - private Document refreshMetaFile(Collection layerMetaData, - Collection inputData, - String uuid, - CallContext callContext){ - Document document = XMLUtils.newDocument(); - Node meta = null; - int layerNumber = 0; - Iterator it = layerMetaData.iterator(); - while (it.hasNext()){ - LayerMetaData lmd = it.next(); - layerNumber ++; - String geometryType = lmd.getGeometryType(); - String templateId = lmd.getTemplateID(); - String title = getLayerTitle(inputData); - if (title == null) { - title = uuid+"_"+layerNumber; - }else{ - title = title+"_"+layerNumber; - } - callContext.putContextValue( - MetaWriter.CONTEXT_LAYER_TITLE, title); - String paramType = findParameterTitle(geometryType,templateId); - if (log.isDebugEnabled()) { - log.debug("Layer title: " + title); - log.debug("Layer type: " + paramType); - } - if (meta == null){ - meta = MetaWriter.writeLayerMeta(callContext,document); - } - MetaWriter.writeLayerMeta(callContext, document, - meta, uuid, paramType, - this.determineGeometryType(geometryType), - createShapeFileName(layerNumber), - title); - if (meta != null && !it.hasNext()) { - MetaWriter.writeMetaFile(getShapeFilePath(),document); - MapfileGenerator.getInstance().update(); - return document; - } - } - return document; + + protected String getLayerName(String uuid, int idx) { + return "GNV_" + uuid + "_" + idx; } + + protected String getLayerTitle(String prefix, String base) { + return "GNV_" + prefix + "_" + base; + } + + + protected String getLayerData(String shapeDir, String filename) { + File path = new File(shapeDir, filename); + + return path.toString(); + } + + /** * Returns the parameterType for the Layer. * @param geometryType @@ -721,7 +752,7 @@ * @param inputData A collection with InputData objects. * @return the title. */ - protected String getLayerTitle(Collection inputData) { + protected String getLayerPrefix(Collection inputData) { for (InputData data: inputData) { String name = data.getName(); if (name != null && name.equals("title")) { diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,8 +1,18 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.profile.horizontal; +import au.com.bytecode.opencsv.CSVWriter; + import com.vividsolutions.jts.geom.Coordinate; -import de.intevation.artifactdatabase.Config; +import de.intevation.artifacts.common.utils.Config; import de.intevation.artifacts.CallContext; @@ -14,6 +24,10 @@ import de.intevation.gnv.chart.ChartLabels; import de.intevation.gnv.chart.HorizontalCrossProfileChart; +import de.intevation.gnv.exports.DefaultProfile; +import de.intevation.gnv.exports.Export; +import de.intevation.gnv.exports.StringArrayKey; + import de.intevation.gnv.geobackend.base.DefaultResult; import de.intevation.gnv.geobackend.base.DefaultResultDescriptor; import de.intevation.gnv.geobackend.base.Result; @@ -29,16 +43,31 @@ import de.intevation.gnv.math.Point2d; import de.intevation.gnv.state.InputData; +import de.intevation.gnv.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.state.exception.StateException; import de.intevation.gnv.utils.DistanceCalculator; import de.intevation.gnv.utils.StringUtils; import de.intevation.gnv.utils.WKTUtils; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; + +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; + import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Locale; +import java.util.Map; import org.apache.log4j.Logger; @@ -57,6 +86,207 @@ extends HorizontalProfileMeshOutputState { + /** + * Constant field which defines the source format of a given datetime. + */ + public static final String SRC_FORMAT = "yyyy.MM.dd HH:mm:ss"; + + /** + * Constant field which defines the target format of a given datetime. + */ + public static final String DEST_FORMAT = "yyyy-MM-dd HH:mm"; + + /** + * Source format. + */ + public static DateFormat srcFormat = new SimpleDateFormat(SRC_FORMAT); + + /** + * Target format. + */ + public static DateFormat destFormat = new SimpleDateFormat(DEST_FORMAT); + + + /** + * This class represents an exporter used for exporting 'Horizontale + * Schnittprofile' as odv. + * + * @author Ingo Weinzierl + */ + public class HorizontalProfileMeshCrossODVExporter + implements Export + { + private ResultDescriptor rd; + + private Collection parameters; + + private int dateIdx; + private int paramIdx; + private int depthIdx; + private int valueIdx; + private int shpIdx; + + public HorizontalProfileMeshCrossODVExporter(Collection parameters) { + this.parameters = parameters; + } + + public void create( + Profile profile, + OutputStream outputStream, + Collection result) + throws + IOException, + UnsupportedEncodingException, + StateException + { + CSVWriter writer = new CSVWriter( + new OutputStreamWriter(outputStream, profile.getEncoding()), + profile.getSeparator(), + profile.getQuoteCharacter(), + profile.getEscapeCharacter()); + + writeData(profile, writer, result); + + writer.close(); + } + + protected void writeData( + Profile profile, + CSVWriter writer, + Collection results) + { + log.debug("Put " + results.size() + " elements into odv export."); + + // just write header into odv export + String[] header = profile.getHeader(); + ArrayList headerList = new ArrayList(); + for (int i= 0; i < header.length; i++){ + headerList.add(header[i]); + } + + ArrayList paramids = new ArrayList(); + + Map> aggregatedRows = + new HashMap>(); + + for (Result res: results) { + if (rd == null) { + rd = res.getResultDescriptor(); + paramIdx = rd.getColumnIndex("GROUP1"); + depthIdx = rd.getColumnIndex("GROUP2"); + dateIdx = rd.getColumnIndex("GROUP3"); + shpIdx = rd.getColumnIndex("SHAPE"); + valueIdx = rd.getColumnIndex("YORDINATE"); + } + + String[] row = generateRow(res); + StringArrayKey key = new StringArrayKey(row); + String parameterValue = res.getString(valueIdx); + String parameterID = res.getString(paramIdx); + + if (!paramids.contains(parameterID)) { + paramids.add(parameterID); + headerList.add(findParamTitle(parameters, parameterID)); + headerList.add("QF"); + } + + Map aggregatedRow = aggregatedRows.get(key); + if (aggregatedRow != null) { + aggregatedRow.put(parameterID, parameterValue); + } + else{ + Map params = new HashMap(); + params.put(parameterID, parameterValue); + aggregatedRows.put(key, params); + } + } + + if (header != null){ + writer.writeNext(headerList.toArray(header)); + } + + Iterator rows = aggregatedRows.keySet().iterator(); + int idx = 1; + while (rows.hasNext()){ + StringArrayKey row = rows.next(); + Map params = aggregatedRows.get(row); + + ArrayList rowList = new ArrayList(); + String[] rowArray = row.getValue(); + for (int i= 0; i < rowArray.length; i++){ + String value = rowArray[i]; + if (value != null && value.equals("GNV_STATION")) { + value += "_" + idx++; + } + rowList.add(value); + } + for (int i = 0; i < paramids.size();i++){ + String key = paramids.get(i); + String value = params.get(key); + if (value == null){ + value = ""; + } + rowList.add(value); + rowList.add("1"); + } + log.debug("Write new line into odv export."); + writer.writeNext(rowList.toArray(rowArray)); + } + } + + protected String[] generateRow(Result res) { + Date tmpDate = null; + String dateTmp = res.getString(dateIdx); + try { + tmpDate = srcFormat.parse(dateTmp); + } + catch (ParseException pe) { + log.warn(pe,pe); + } + + String shapeTmp = res.getString(shpIdx); + Coordinate p = WKTUtils.toCoordinate(shapeTmp); + + String cruise = "GNV_EXPORT"; + String station = "GNV_STATION"; + String type = "*"; + String date = tmpDate != null + ? destFormat.format(tmpDate) + : dateTmp; + String lon = "" + p.x; + String lat = "" + p.y; + String botDepth = "0"; + String depth = res.getString(depthIdx); + + return new String[] { + cruise, station, type, date, lon, lat, botDepth, depth + }; + } + + /** + * This method is used to search specific value coresponding to its key + * id and return its description. + * + * @param values Collection of parameters. + * @param id Key used to find the value. + * + * @return Description of searched value. + */ + protected String findParamTitle(Collection values, String id) { + if (values != null){ + Iterator it = values.iterator(); + while (it.hasNext()) { + KeyValueDescibeData data = (KeyValueDescibeData) it.next(); + + if (id.equals(data.getKey())) + return data.getValue(); + } + } + return ""; + } + } // HorizontalProfileMeshCrossODVExporter + + public static final boolean USE_INDEX_BUFFER = Boolean.getBoolean("gnv.horizontal.profile.mesh.cross.index.buffer"); @@ -150,6 +380,46 @@ return chart; } + + @Override + protected void createODV( + OutputStream outputStream, String uuid, CallContext callContext) + throws IOException, StateException { + + String [] COLUMN_HEADER = { + "Cruise", + "Station", + "Type", + "yyyy-mm-dd hh:mm", + "Lon (°E)", + "Lat (°N)", + "Bot. Depth [m]", + "Depth [m]" + }; + + Export.Profile ODV_PROFILE = new DefaultProfile( + COLUMN_HEADER, + '\t', + CSVWriter.NO_QUOTE_CHARACTER, + CSVWriter.NO_ESCAPE_CHARACTER, + "ODV", + "ISO-8859-1"); + + Collection result = (Collection) getChartResult( + uuid, callContext); + + if (result == null) { + log.error("No data for export found."); + return; + } + + Export export = new HorizontalProfileMeshCrossODVExporter( + getParameters(uuid)); + + export.create(ODV_PROFILE, outputStream, result); + } + + private static int numSamples(CallContext callContext) { GNVArtifactContext context = (GNVArtifactContext)callContext.globalContext(); @@ -163,69 +433,73 @@ @Override protected Object getChartResult(String uuid, CallContext callContext) { log.debug("HorizontalProfileMeshCrossOutputState.getChartResult"); - Collection result = null; - if (CacheFactory.getInstance().isInitialized()) { - String key = uuid + super.getID(); - log.debug("Hash for Queryelements: " + key); - net.sf.ehcache.Element value = CacheFactory.getInstance().getCache().get(key); - if (value != null) { - result = (Collection) (value.getObjectValue()); - }else{ - - InputData meshLine = inputData.get("mesh_linestring"); - InputData meshId = inputData.get("meshid"); - - if (meshLine == null) { - log.error("mesh_linestring is not defined"); - throw new IllegalStateException("missing mesh_linestring"); - } - - if (meshId == null) { - log.error("meshid is not defined"); - throw new IllegalStateException("missing meshid"); - } - - Coordinate [] coords = WKTUtils.toCoordinates( - meshLine.getValue()); - - if (coords == null) { - throw new IllegalStateException("cannot read coordinates"); - } - try { - String additionWhere = USE_INDEX_BUFFER - ? WKTUtils.worldCoordinatesToIndex( - coords, - result, - meshId.getValue(), - ijkQueryID) - : WKTUtils.TRUE_EXPRESSION; - - String[] addedFilterValues = StringUtils.append( - generateFilterValuesFromInputData(), - additionWhere); + String key = getHash(); + if (CacheFactory.getInstance().isInitialized()) { + log.debug("Using cache - key: " + key); + net.sf.ehcache.Element value = CacheFactory.getInstance().getCache().get(key); - QueryExecutor queryExecutor = QueryExecutorFactory - .getInstance() - .getQueryExecutor(); - - result = process( - Arrays.asList(coords), - numSamples(callContext), - queryExecutor.executeQuery( - queryID, - addedFilterValues)); - } - catch (QueryException e) { - log.error(e,e); - } - - if (CacheFactory.getInstance().isInitialized()) { - CacheFactory.getInstance().getCache().put(new net.sf.ehcache.Element(key, result)); - } - + if (value != null) { + log.debug("Found element in cache."); + return (Collection) (value.getObjectValue()); } } + + log.debug("Not using cache or element not found."); + Collection result = null; + + InputData meshLine = inputData.get("mesh_linestring"); + InputData meshId = inputData.get("meshid"); + + if (meshLine == null) { + log.error("mesh_linestring is not defined"); + throw new IllegalStateException("missing mesh_linestring"); + } + + if (meshId == null) { + log.error("meshid is not defined"); + throw new IllegalStateException("missing meshid"); + } + + Coordinate [] coords = WKTUtils.toCoordinates( + meshLine.getValue()); + + if (coords == null) { + throw new IllegalStateException("cannot read coordinates"); + } + + try { + String additionWhere = USE_INDEX_BUFFER + ? WKTUtils.worldCoordinatesToIndex( + coords, + result, + meshId.getValue(), + ijkQueryID) + : WKTUtils.TRUE_EXPRESSION; + + String[] addedFilterValues = StringUtils.append( + generateFilterValuesFromInputData(), + additionWhere); + + QueryExecutor queryExecutor = QueryExecutorFactory + .getInstance() + .getQueryExecutor(); + + result = process( + Arrays.asList(coords), + numSamples(callContext), + queryExecutor.executeQuery( + queryID, + addedFilterValues)); + } + catch (QueryException e) { + log.error(e,e); + } + + if (CacheFactory.getInstance().isInitialized()) { + CacheFactory.getInstance().getCache().put(new net.sf.ehcache.Element(key, result)); + } + return result; } @@ -270,9 +544,11 @@ DefaultResultDescriptor resultDescriptor = new DefaultResultDescriptor(); + log.debug("------------------------------------------------------"); for (int j = 0; j < columns; ++j) { String columnName = rd.getColumnName(j); if (!StringUtils.contains(COLUMN_BLACKLIST, columnName)) { + log.debug("!!! COLUMN NAME: " + columnName); resultDescriptor.addColumn( columnName, rd.getColumnClassName(j)); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshOutputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshOutputState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshOutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.profile.horizontal; import java.util.Locale; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshVectorOutputState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshVectorOutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.state.profile.horizontal; + +import au.com.bytecode.opencsv.CSVWriter; + +import de.intevation.artifacts.CallContext; + +import de.intevation.gnv.artifacts.cache.CacheFactory; + +import de.intevation.gnv.chart.Chart; +import de.intevation.gnv.chart.ChartLabels; +import de.intevation.gnv.chart.HorizontalProfileVectorChart; + +import de.intevation.gnv.exports.DefaultExport; +import de.intevation.gnv.exports.DefaultProfile; +import de.intevation.gnv.exports.Export; +import de.intevation.gnv.exports.Export.Profile; +import de.intevation.gnv.exports.SimpleOdvDataCollector; + +import de.intevation.gnv.geobackend.base.Result; + +import de.intevation.gnv.utils.VectorDataProcessor; + +import de.intevation.gnv.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.state.exception.StateException; + +import de.intevation.gnv.statistics.Statistics; +import de.intevation.gnv.statistics.HorizontalProfileVectorStatistics; + +import java.io.IOException; +import java.io.OutputStream; + +import java.util.Collection; +import java.util.Locale; +import java.util.Map; + +import net.sf.ehcache.Cache; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; + + +/** + * @author Ingo Weinzierl + */ +public class HorizontalProfileMeshVectorOutputState +extends HorizontalProfileMeshOutputState +{ + private static Logger logger = + Logger.getLogger(HorizontalProfileMeshVectorOutputState.class); + + public static final String[] RESULT_COLUMNS = { + "YORDINATE", "SHAPE", + "GROUP1", "GROUP2", "GROUP3", + "IPOSITION", "JPOSITION", + "DATAID", "MESHID", + "SERIES" + }; + + + public static final String[] ODV_COLUMN_HEADERS = { + "Cruise", + "Station", + "Type", + "yyyy-mm-dd hh:mm", + "Lon (°E)", + "Lat (°N)", + "Bot. Depth [m]", + "Depth [m]", + "QF", + "XComponent", + "QF", + "YComponent", + "QF", + "ZComponent", + "QF", + "Speed", + "QF", + "Direction", + "QF" + }; + + + public static final String[] ODV_PROFILE_NAMES = { + "CRUISE", + "STATION", + "TYPE", + "TIMEVALUE", + "SHAPE", + "BOTDEPTH", + "DEPTH", + "QF", + "XCOMPONENT", + "QF", + "YCOMPONENT", + "QF", + "ZCOMPONENT", + "QF", + "SPEED", + "QF", + "DIRECTION", + "QF"}; + + + @Override + protected Object getChartResult(String uuid, CallContext callContext) { + logger.debug("Fetch data for horizontalprofile chart with vector data"); + CacheFactory factory = CacheFactory.getInstance(); + + if (factory.isInitialized()) { + // we use a cache + logger.info("Using cache."); + Cache cache = factory.getCache(); + String key = "chart_" + getHash(); + + net.sf.ehcache.Element value = cache.get(key); + if (value != null) { + logger.debug("Found element in cache."); + return value.getObjectValue(); + } + else { + logger.debug("Element not in cache, we ask the database"); + Collection res = (Collection)getData(queryID); + res = VectorDataProcessor.process(res, RESULT_COLUMNS); + logger.debug("Got " + res.size() + " elements from database."); + + cache.put(new net.sf.ehcache.Element(key, res)); + + return res; + } + } + else { + // we don't use a cache, so we have to query the database every + // single time + logger.info("Not using a cache."); + return VectorDataProcessor.process( + getData(queryID), RESULT_COLUMNS); + } + } + + + @Override + protected Chart getChart( + ChartLabels chartLables, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Object result, + Locale locale, + String uuid, + boolean linesVisible, + boolean shapesVisible, + CallContext callContext + ) { + Chart chart = new HorizontalProfileVectorChart( + chartLables, + theme, + parameters, + measurements, + dates, + (Collection)result, + timeGapDefinitions, + locale, + linesVisible, + shapesVisible + ); + chart.generateChart(); + + return chart; + } + + + @Override + protected Chart[] getHistograms( + String uuid, + CallContext callContext, + Collection parameters, + Collection measurements, + Collection dates, + Map requestParameter + ) { + Collection results = (Collection) getChartResult(uuid, callContext); + ChartTheme theme = createStyle(callContext); + + return VectorDataProcessor.getHistograms( + uuid, callContext, results, theme, requestParameter); + } + + + @Override + protected void createODV( + OutputStream outputStream, Collection result, String uuid) + throws IOException, StateException + { + logger.info("Start exporting " + result.size() + " items to odv."); + Export export = new DefaultExport( + new SimpleOdvDataCollector(ODV_PROFILE_NAMES)); + + Profile profile = new DefaultProfile( + ODV_COLUMN_HEADERS, + '\t', + CSVWriter.NO_QUOTE_CHARACTER, + CSVWriter.NO_ESCAPE_CHARACTER, + "ODV", + "ISO-8859-1"); + + export.create(profile, outputStream, result); + } + + + protected Statistics getStatisticsGenerator() { + return new HorizontalProfileVectorStatistics(); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileOutputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileOutputState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileOutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.profile.horizontal; import java.io.IOException; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/NorthSouthEastWestState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/NorthSouthEastWestState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/NorthSouthEastWestState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.profile.horizontal; import de.intevation.artifacts.CallContext; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.profile.horizontalcrosssection; import java.awt.Dimension; @@ -22,8 +30,8 @@ import com.vividsolutions.jts.geom.MultiPolygon; import com.vividsolutions.jts.geom.Polygon; -import de.intevation.artifactdatabase.Config; -import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.common.utils.Config; +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.ArtifactNamespaceContext; import de.intevation.artifacts.CallContext; import de.intevation.gnv.artifacts.cache.CacheFactory; @@ -94,6 +102,8 @@ private Boolean shapeFileLock = new Boolean(true); private String shapeFilePath; + + private Envelope bbox = null; /** * Constructor @@ -306,24 +316,36 @@ String path = getShapeFilePath(); if (path != null && new File(path).isDirectory()) { - String title = getLayerTitle(inputData); - if (title == null) { - title = uuid; + Document meta = MetaWriter.initMeta(); + MetaWriter.insertAbstractMeta(callContext, meta); + + String prefix = getLayerPrefix(inputData); + if (prefix == null) { + prefix = uuid; } - callContext.putContextValue( - MetaWriter.CONTEXT_LAYER_TITLE, title); - - String paramType = findParameterType(callContext); + // append polygon meta + String model = findParameterType(callContext); + String type = "POLYGON"; + String name = getLayerName(uuid, type); + String title = getLayerTitle(prefix, type); + String data = getLayerData(uuid, POLYGON_NAME); + String status = "OFF"; + MetaWriter.insertLayer( + callContext, meta, name, title, data, model, type, status); - if (log.isDebugEnabled()) { - log.debug("Layer title: " + title); - log.debug("Layer type: " + paramType); - } + // append isoline meta + model += "_isolines"; + type = "LINE"; + name = getLayerName(uuid, type); + title = getLayerTitle(prefix, type); + data = getLayerData(uuid, ISOLINES_NAME); + MetaWriter.insertLayer( + callContext, meta, name, title, data, model, type, status); - Document meta = MetaWriter.writeHorizontalcrosssectionMeta( - callContext, uuid, path, paramType); if (meta != null) { + MetaWriter.insertMbr(this.bbox, "EPSG:4326", meta); + MetaWriter.writeMetaFile(path, meta); MapfileGenerator.getInstance().update(); return meta; } @@ -336,25 +358,36 @@ try{ if (result != null && (path = writeToShapeFile(uuid, result, callContext)) != null) { - - String paramType = findParameterType(callContext); + Document meta = MetaWriter.initMeta(); + MetaWriter.insertAbstractMeta(callContext, meta); - String title = getLayerTitle(inputData); - if (title == null) { - title = uuid; - } - callContext.putContextValue( - MetaWriter.CONTEXT_LAYER_TITLE, title); - - if (log.isDebugEnabled()) { - log.debug("Parameter type: " + paramType); - log.debug("Layer title: " + title); + String prefix = getLayerPrefix(inputData); + if (prefix == null) { + prefix = uuid; } - Document meta = MetaWriter.writeHorizontalcrosssectionMeta( - callContext, uuid, path, paramType); + // append polygon meta + String model = findParameterType(callContext); + String type = "POLYGON"; + String name = getLayerName(uuid, type); + String title = getLayerTitle(prefix, type); + String data = getLayerData(uuid, POLYGON_NAME); + String status = "OFF"; + MetaWriter.insertLayer( + callContext, meta, name, title, data, model, type, status); + + // append isoline meta + model += "_isolines"; + type = "LINE"; + name = getLayerName(uuid, type); + title = getLayerTitle(prefix, type); + data = getLayerData(uuid, ISOLINES_NAME); + MetaWriter.insertLayer( + callContext, meta, name, title, data, model, type, status); if (meta != null) { + MetaWriter.insertMbr(this.bbox, "EPSG:4326", meta); + MetaWriter.writeMetaFile(path, meta); MapfileGenerator.getInstance().update(); return meta; } @@ -400,7 +433,7 @@ * @param inputData A collection with InputData objects. * @return the title. */ - protected String getLayerTitle(Collection inputData) { + protected String getLayerPrefix(Collection inputData) { for (InputData data: inputData) { String name = data.getName(); if (name != null && name.equals("title")) { @@ -411,6 +444,44 @@ return null; } + + /** + * Returns the name of the layer. + * + * @param uuid The uuid the the current session. It is the base part of the + * layername. + * @param type The type of the layer ('POLYGON' or 'LINE'). + * @return the name of the layer. + */ + protected String getLayerName(String uuid, String type) { + return "GNV_" + uuid + "-" + type; + } + + /** + * Returns the layer title. + * + * @param prefix A prefix (null not permitted). + * @param type The layer type. + * @return the title of the layer. + */ + protected String getLayerTitle(String prefix, String type) { + return "GNV_" + prefix + "-" + type; + } + + + /** + * Returns the path to the shapefile that serves the layer data. + * + * @param shapeDir The shapefile directory. + * @param filename The name of the shapefile. + * @return the relative path to the shapefile. + */ + protected String getLayerData(String shapeDir, String filename) { + File path = new File(shapeDir, filename); + + return path.toString(); + } + /** * Write the resulting data to shapefiles. * @@ -504,12 +575,15 @@ String key = getHash(); if (cf.isInitialized()) { + log.debug("Using cache - key: " + key); net.sf.ehcache.Element value = cf.getCache().get(key); if (value != null) { - return (AttributedPoint2ds)value.getObjectValue(); + log.debug("Found element in cache."); + return (AttributedPoint2ds)value.getObjectValue(); } } + log.debug("Not using cache or element not found."); AttributedPoint2ds result = produceResult(callContext); if (result != null && cf.isInitialized()) { @@ -553,6 +627,7 @@ try { Envelope env = p.getEnvelopeInternal(); + this.bbox = env; String additionWhere; if (USE_INDEX_BUFFER) { diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileMeshVectorOutputState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileMeshVectorOutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,79 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.state.profile.vertical; + +import de.intevation.artifacts.CallContext; + +import de.intevation.gnv.artifacts.cache.CacheFactory; + +import de.intevation.gnv.geobackend.base.Result; + +import de.intevation.gnv.utils.VectorDataProcessor; + +import java.util.Collection; + +import net.sf.ehcache.Cache; + +import org.apache.log4j.Logger; + + +/** + * @author Ingo Weinzierl + */ +public class VerticalProfileMeshVectorOutputState +extends VerticalProfileVectorOutputState +{ + public static final String[] RESULT_COLUMNS = { + "YORDINATE", "XORDINATE", "KPOSITION", + "GROUP1", "GROUP2", "GROUP3", + "DATAID", "FEATUREID", "MESHID", + "SERIES" + }; + + private static Logger logger = + Logger.getLogger(VerticalProfileMeshVectorOutputState.class); + + + @Override + protected Object getChartResult(String uuid, CallContext callContext) { + logger.debug("Fetch chart data for vertical profile with vector data."); + CacheFactory factory = CacheFactory.getInstance(); + + if (factory.isInitialized()) { + // we use a cache + logger.info("Using cache."); + Cache cache = factory.getCache(); + String key = "chart_" + getHash(); + + net.sf.ehcache.Element value = cache.get(key); + if (value != null) { + logger.debug("Found element in cache."); + return value.getObjectValue(); + } + else { + logger.debug("Element not in cache, we ask the database"); + Collection res = (Collection)getData(queryID); + logger.debug("Got " + res.size() + " elements from db."); + + res = VectorDataProcessor.process(res, RESULT_COLUMNS); + cache.put(new net.sf.ehcache.Element(key, res)); + + return res; + } + } + else { + // we don't use a cache, so we have to query the database every + // single time + logger.info("Not using a cache."); + return VectorDataProcessor.process( + getData(queryID), RESULT_COLUMNS); + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileOutputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileOutputState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileOutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.profile.vertical; import de.intevation.artifacts.CallContext; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileVectorOutputState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileVectorOutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,221 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.state.profile.vertical; + +import au.com.bytecode.opencsv.CSVWriter; + +import de.intevation.artifacts.CallContext; + +import de.intevation.gnv.artifacts.cache.CacheFactory; + +import de.intevation.gnv.chart.Chart; +import de.intevation.gnv.chart.ChartLabels; +import de.intevation.gnv.chart.VerticalProfileVectorChart; + +import de.intevation.gnv.exports.DefaultExport; +import de.intevation.gnv.exports.DefaultProfile; +import de.intevation.gnv.exports.Export; +import de.intevation.gnv.exports.Export.Profile; +import de.intevation.gnv.exports.SimpleOdvDataCollector; + +import de.intevation.gnv.geobackend.base.Result; + +import de.intevation.gnv.utils.VectorDataProcessor; + +import de.intevation.gnv.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.state.exception.StateException; + +import de.intevation.gnv.statistics.Statistics; +import de.intevation.gnv.statistics.VerticalProfileVectorStatistics; + +import java.io.IOException; +import java.io.OutputStream; + +import java.util.Collection; +import java.util.Locale; +import java.util.Map; + +import net.sf.ehcache.Cache; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; + +/** + * @author Ingo Weinzierl + */ +public class VerticalProfileVectorOutputState +extends VerticalProfileOutputState +{ + private static Logger logger = + Logger.getLogger(VerticalProfileVectorOutputState.class); + + public static final String[] RESULT_COLUMNS = { + "YORDINATE", "XORDINATE", + "GROUP1", "GROUP2", "GROUP3", + "DATAID", "FEATUREID", "TIMESERIESID", + "SERIES" + }; + + + public static final String[] ODV_COLUMN_HEADERS = { + "Cruise", + "Station", + "Type", + "yyyy-mm-dd hh:mm", + "Lon (°E)", + "Lat (°N)", + "Bot. Depth [m]", + "Depth [m]", + "QF", + "XComponent", + "QF", + "YComponent", + "QF", + "ZComponent", + "QF", + "Speed", + "QF", + "Direction", + "QF" + }; + + public static final String[] ODV_PROFILE_NAMES = { + "CRUISE", + "STATION", + "TYPE", + "TIMEVALUE", + "SHAPE", + "BOTDEPTH", + "DEPTH", + "QF", + "XCOMPONENT", + "QF", + "YCOMPONENT", + "QF", + "ZCOMPONENT", + "QF", + "SPEED", + "QF", + "DIRECTION", + "QF"}; + + + @Override + protected Object getChartResult(String uuid, CallContext callContext) { + logger.debug("Fetch chart data for vertical profile with vector data."); + CacheFactory factory = CacheFactory.getInstance(); + + if (factory.isInitialized()) { + // we use a cache + logger.info("Using cache."); + Cache cache = factory.getCache(); + String key = "chart_" + getHash(); + + net.sf.ehcache.Element value = cache.get(key); + if (value != null) { + logger.debug("Found element in cache."); + return value.getObjectValue(); + } + else { + logger.debug("Element not in cache, we ask the database"); + Collection res = (Collection)getData(queryID); + logger.debug("Got " + res.size() + " elements from db."); + + res = VectorDataProcessor.process(res, RESULT_COLUMNS); + cache.put(new net.sf.ehcache.Element(key, res)); + + return res; + } + } + else { + // we don't use a cache, so we have to query the database every + // single time + logger.info("Not using a cache."); + return VectorDataProcessor.process( + getData(queryID), RESULT_COLUMNS); + } + } + + + @Override + protected Chart getChart( + ChartLabels chartLables, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Object result, + Locale locale, + String uuid, + boolean linesVisible, + boolean shapesVisible, + CallContext callContext + ) { + Chart chart = new VerticalProfileVectorChart( + chartLables, + theme, + parameters, + measurements, + dates, + (Collection)result, + timeGapDefinitions, + locale, + linesVisible, + shapesVisible + ); + chart.generateChart(); + + return chart; + } + + + @Override + protected Chart[] getHistograms( + String uuid, + CallContext callContext, + Collection parameters, + Collection measurements, + Collection dates, + Map requestParameter + ) { + Collection results = (Collection) getChartResult(uuid, callContext); + ChartTheme theme = createStyle(callContext); + + return VectorDataProcessor.getHistograms( + uuid, callContext, results, theme, requestParameter); + } + + + @Override + protected void createODV( + OutputStream outputStream, Collection result, String uuid) + throws IOException, StateException + { + logger.info("Start exporting " + result.size() + " items to odv."); + Export export = new DefaultExport( + new SimpleOdvDataCollector(ODV_PROFILE_NAMES)); + + Profile profile = new DefaultProfile( + ODV_COLUMN_HEADERS, + '\t', + CSVWriter.NO_QUOTE_CHARACTER, + CSVWriter.NO_ESCAPE_CHARACTER, + "ODV", + "ISO-8859-1"); + + export.create(profile, outputStream, result); + } + + + protected Statistics getStatisticsGenerator() { + return new VerticalProfileVectorStatistics(); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/OutputHelper.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/OutputHelper.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/OutputHelper.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.profile.verticalcrosssection; import de.intevation.gnv.jfreechart.CompactXYItems; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.profile.verticalcrosssection; import au.com.bytecode.opencsv.CSVWriter; @@ -159,11 +167,10 @@ protected Object getChartResult(String uuid, CallContext callContext) { log.debug("VerticalCrossSectionOutputState.getChartResult"); String key = getHash(); - log.debug("Hash: "+key); CacheFactory factory = CacheFactory.getInstance(); if (factory.isInitialized()) { - log.info("Using a cachce."); + log.info("Using a cachce - key: " + key); Cache cache = factory.getCache(); Element element = cache.get(key); @@ -192,8 +199,8 @@ */ protected Object getData(String uuid, CallContext callContext) { Collection result = null; - InputData meshLine = inputData.get("mesh_linestring"); InputData meshId = inputData.get("meshid"); + String meshLine = getLineString(); if (meshLine == null) { log.error("mesh_linestring is not defined"); @@ -206,7 +213,7 @@ } Coordinate [] coords = WKTUtils.toCoordinates( - meshLine.getValue()); + meshLine); if (coords == null) { throw new IllegalStateException("cannot read coordinates"); @@ -244,6 +251,13 @@ } + protected String getLineString() { + InputData meshLine = inputData.get("mesh_linestring"); + + return meshLine != null ? meshLine.getValue() : null; + } + + @Override protected String getSelectedInputDataName(String uuid, String id) { Collection values = getCollection(id, uuid); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionParallelOutputState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionParallelOutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.state.profile.verticalcrosssection; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.CoordinateSequence; +import com.vividsolutions.jts.geom.impl.CoordinateArraySequenceFactory; + +import com.vividsolutions.jts.io.WKTWriter; + +import de.intevation.gnv.artifacts.ressource.RessourceFactory; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.geobackend.base.ResultDescriptor; + +import de.intevation.gnv.geobackend.base.query.QueryExecutor; +import de.intevation.gnv.geobackend.base.query.QueryExecutorFactory; + +import de.intevation.gnv.geobackend.base.query.exception.QueryException; + +import de.intevation.gnv.state.InputData; + +import de.intevation.gnv.utils.WKTUtils; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Locale; + +import org.apache.log4j.Logger; + +/** + * @author Ingo Weinzierl + */ +public class VerticalCrossSectionParallelOutputState +extends VerticalCrossSectionOutputState +{ + public static final String QUERY_LINESTRING = + "verticalcrosssection_mesh_parallel_linestring"; + + private static Logger logger = + Logger.getLogger(VerticalCrossSectionParallelOutputState.class); + + @Override + protected String getLineString() { + Coordinate[] coordinates = null; + + try { + String[] filters = generateFilterValues(); + + QueryExecutor exec = QueryExecutorFactory + .getInstance() + .getQueryExecutor(); + + Collection results = exec.executeQuery(QUERY_LINESTRING, filters); + Iterator iter = results.iterator(); + + coordinates = new Coordinate[results.size()]; + int sIdx = -1; + int idx = 0; + + while (iter.hasNext()) { + Result result = (Result) iter.next(); + + if (sIdx == -1) { + ResultDescriptor rd = result.getResultDescriptor(); + sIdx = rd.getColumnIndex("SHAPE"); + } + + logger.debug(result.getString(sIdx)); + Coordinate c = WKTUtils.toCoordinate(result.getString(sIdx)); + + coordinates[idx++] = c; + } + } + catch (QueryException qe) { + logger.error(qe, qe); + } + + CoordinateArraySequenceFactory factory = + CoordinateArraySequenceFactory.instance(); + + if (coordinates == null) + return null; + + CoordinateSequence seq = factory.create(coordinates); + return seq != null ? WKTWriter.toLineString(seq) : null; + } + + + protected String[] generateFilterValues() { + String[] filters = new String[7]; + + InputData parameterid = inputData.get("parameterid"); + InputData timevalue = inputData.get("dateid"); + InputData meshid = inputData.get("meshid"); + InputData axisid = inputData.get("axisid"); + InputData meshpoint = inputData.get("mesh_point"); + + filters[0] = parameterid.getValue(); + filters[1] = "to_date('" + timevalue.getValue() + "', 'YYYY.MM.DD HH24:MI:SS')"; + filters[2] = meshid.getValue(); + filters[3] = meshid.getValue(); + filters[4] = axisid.getValue(); + filters[5] = axisid.getValue(); + filters[6] = meshpoint.getValue(); + + return filters; + } + + + @Override + protected String createChartSubtitle(Locale locale, String uuid) { + String subtitle = super.createChartSubtitle(locale, uuid); + + InputData data = inputData.get("mesh_point"); + if (data == null) + return subtitle; + + RessourceFactory factory = RessourceFactory.getInstance(); + String coordinate = factory.getRessource( + locale, "coordinate", "coordinate"); + + subtitle += "\n" + coordinate + ": "; + subtitle += data.getDescription(data.getValue()); + + return subtitle; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.state.timeseries; import java.io.IOException; @@ -26,8 +34,8 @@ import org.w3c.dom.NodeList; import au.com.bytecode.opencsv.CSVWriter; -import de.intevation.artifactdatabase.Config; -import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.common.utils.Config; +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.ArtifactNamespaceContext; import de.intevation.artifacts.CallContext; import de.intevation.artifacts.CallMeta; @@ -85,15 +93,6 @@ Boolean.parseBoolean(System.getProperty("cache.chart", "false")); /** - * A field parsing a system property to adjust the alignment of pdf exports. - * The system property is 'export.pdf.landscape' and should be true or - * false. If this property is true, PDFs will be created in landscape - * format. - */ - protected static final boolean PDF_FORMAT_LANDSCAPE = - Boolean.parseBoolean(System.getProperty("export.pdf.landscape","true")); - - /** * Supported image export formats. */ protected static final String[] IMG_EXPORT_FORMAT = { @@ -111,7 +110,7 @@ private static Logger log = Logger .getLogger(TimeSeriesOutputState.class); - private List timeGapDefinitions = null; + protected List timeGapDefinitions = null; /** * Key in resource bundle the x-axis title is stored. @@ -375,6 +374,12 @@ ); } else if (mode.equalsIgnoreCase("pdf")) { + callContext.putContextValue("chart.width", chartWidth); + callContext.putContextValue("chart.height", chartHeight); + callContext.putContextValue("shapes.visible", sVisible); + callContext.putContextValue("lines.visible", lVisible); + callContext.putContextValue("locale", locale); + createPDF( outputStream, parameters, @@ -383,10 +388,6 @@ chartLables, uuid, "A4", - true, - lVisible, - sVisible, - locale, callContext ); } @@ -409,24 +410,15 @@ } // HISTOGRAM else if (outputMode.equalsIgnoreCase("histogram")) { - Collection results = (Collection) getChartResult(uuid, callContext); requestParameter.put("locale", locale); - Object[][] data = HistogramHelper.prepareHistogramData( - results, parameters, measurements, dates); - - int size = data.length; - Chart[] histograms = new Chart[size]; - - for (int i = 0; i < size; i++) { - ChartLabels labels = createHistogramLabels( - uuid, callContext, locale, data[i]); - - ChartTheme theme = createStyle(callContext); - - histograms[i] = new DefaultHistogram( - labels, data[i], theme, requestParameter); - } + Chart[] histograms = getHistograms( + uuid, + callContext, + parameters, + measurements, + dates, + requestParameter); if (mode.equalsIgnoreCase("img")) { ChartExportHelper.exportHistograms( @@ -438,12 +430,15 @@ ); } else if (mode.equalsIgnoreCase("pdf")) { + callContext.putContextValue("chart.width", chartWidth); + callContext.putContextValue("chart.height", chartHeight); + ChartExportHelper.exportHistogramsAsPDF( outputStream, histograms, "A4", - PDF_FORMAT_LANDSCAPE, - 50F, 50F, 50F, 50F + 50F, 50F, 50F, 50F, + callContext ); } else if (mode.equalsIgnoreCase("svg")) { @@ -504,6 +499,36 @@ } + protected Chart[] getHistograms( + String uuid, + CallContext callContext, + Collection parameters, + Collection measurements, + Collection dates, + Map requestParameter + ) { + Locale locale = (Locale) requestParameter.get("locale"); + + Collection results = (Collection) getChartResult(uuid, callContext); + ChartTheme theme = createStyle(callContext); + + Object[][] data = HistogramHelper.prepareHistogramData( + results, parameters, measurements, dates); + + int size = data.length; + Chart[] histograms = new Chart[size]; + + for (int i = 0; i < size; i++) { + ChartLabels labels = HistogramHelper.createHistogramLabels( + uuid, callContext, locale, data[i]); + + histograms[i] = new DefaultHistogram( + labels, data[i], theme, requestParameter); + } + + return histograms; + } + /** * @param outputStream * @param uuid @@ -845,10 +870,6 @@ ChartLabels chartLables, String uuid, String exportFormat, - boolean landscape, - boolean linesVisible, - boolean shapesVisible, - Locale locale, CallContext context ) { Chart chart = getChart( @@ -858,10 +879,10 @@ measurements, dates, getChartResult(uuid, context), - locale, + (Locale) context.getContextValue("locale"), uuid, - linesVisible, - shapesVisible, + Boolean.TRUE.equals(context.getContextValue("lines.visible")), + Boolean.TRUE.equals(context.getContextValue("shapes.visible")), context ); @@ -874,8 +895,8 @@ outputStream, chart.generateChart(), "A4", - PDF_FORMAT_LANDSCAPE, - 50F, 50F, 50F, 50F + 50F, 50F, 50F, 50F, + context ); } @@ -935,7 +956,7 @@ outputStream, chart.generateChart(), null, - 600, 400 + width, height ); log.debug("svg export finished."); @@ -1109,27 +1130,6 @@ /** - * Creates and returns labels to decorate histograms. - * - * @param uuid The UUID of the current artifact. - * @param context The CallContext object. - * @param data An array storing strings. - * @return A ChartLabels object with the 1st string in data as title. - */ - protected ChartLabels createHistogramLabels( - String uuid, CallContext context, Locale locale, Object[] data) - { - RessourceFactory fac = RessourceFactory.getInstance(); - - return new ChartLabels( - (String) data[0], - "", - "", - fac.getRessource(locale, "histogram.axis.range.title", "")); - } - - - /** * Returns the selected fis name. * * @param locale The Locale object used to adjust the language. diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesVectorOutputState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesVectorOutputState.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,217 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.state.timeseries; + +import au.com.bytecode.opencsv.CSVWriter; + +import de.intevation.artifacts.CallContext; + +import de.intevation.gnv.artifacts.cache.CacheFactory; + +import de.intevation.gnv.chart.Chart; +import de.intevation.gnv.chart.ChartLabels; +import de.intevation.gnv.chart.TimeSeriesVectorChart; + +import de.intevation.gnv.exports.DefaultExport; +import de.intevation.gnv.exports.DefaultProfile; +import de.intevation.gnv.exports.Export; +import de.intevation.gnv.exports.Export.Profile; +import de.intevation.gnv.exports.SimpleOdvDataCollector; + +import de.intevation.gnv.geobackend.base.Result; + +import de.intevation.gnv.utils.VectorDataProcessor; + +import de.intevation.gnv.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.state.exception.StateException; + +import de.intevation.gnv.statistics.Statistics; +import de.intevation.gnv.statistics.TimeseriesVectorStatistics; + +import java.io.IOException; +import java.io.OutputStream; + +import java.util.Collection; +import java.util.Locale; +import java.util.Map; + +import net.sf.ehcache.Cache; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; + +/** + * @author Ingo Weinzierl + */ +public class TimeSeriesVectorOutputState extends TimeSeriesOutputState { + + private static Logger logger = + Logger.getLogger(TimeSeriesVectorOutputState.class); + + public static final String[] RESULT_COLUMNS = { + "YORDINATE", "XORDINATE", "GROUP1", "GROUP2", "GROUP3", "GAPID", "SERIES" + }; + + public static final String[] ODV_COLUMN_HEADERS = { + "Cruise", + "Station", + "Type", + "yyyy-mm-dd hh:mm", + "Lon (°E)", + "Lat (°N)", + "Bot. Depth [m]", + "Depth [m]", + "QF", + "XComponent", + "QF", + "YComponent", + "QF", + "ZComponent", + "QF", + "Speed", + "QF", + "Direction", + "QF" + }; + + public static final String[] ODV_PROFILE_NAMES = { + "CRUISE", + "STATION", + "TYPE", + "TIMEVALUE", + "SHAPE", + "BOTDEPTH", + "DEPTH", + "QF", + "XCOMPONENT", + "QF", + "YCOMPONENT", + "QF", + "ZCOMPONENT", + "QF", + "SPEED", + "QF", + "DIRECTION", + "QF"}; + + public TimeSeriesVectorOutputState() { + } + + + @Override + protected Object getChartResult(String uuid, CallContext callContext) { + logger.debug("OutputStateBase.getChartResult"); + CacheFactory factory = CacheFactory.getInstance(); + + if (factory.isInitialized()) { + // we use a cache + logger.info("Using cache."); + Cache cache = factory.getCache(); + String key = "chart_" + getHash(); + + net.sf.ehcache.Element value = cache.get(key); + if (value != null) { + logger.debug("Found element in cache."); + return value.getObjectValue(); + } + else { + logger.debug("Element not in cache, we ask the database"); + Collection res = (Collection)getData(queryID); + res = VectorDataProcessor.process(res, RESULT_COLUMNS); + cache.put(new net.sf.ehcache.Element(key, res)); + + return res; + } + } + else { + // we don't use a cache, so we have to query the database every + // single time + logger.info("Not using a cache."); + return VectorDataProcessor.process( + getData(queryID), RESULT_COLUMNS); + } + } + + + @Override + protected Chart getChart( + ChartLabels chartLables, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Object result, + Locale locale, + String uuid, + boolean linesVisible, + boolean shapesVisible, + CallContext callContext + ) { + Chart chart = new TimeSeriesVectorChart( + chartLables, + theme, + parameters, + measurements, + dates, + (Collection)result, + timeGapDefinitions, + locale, + linesVisible, + shapesVisible + ); + chart.generateChart(); + + return chart; + } + + + @Override + protected Chart[] getHistograms( + String uuid, + CallContext callContext, + Collection parameters, + Collection measurements, + Collection dates, + Map requestParameter + ) { + Collection results = (Collection) getChartResult(uuid, callContext); + ChartTheme theme = createStyle(callContext); + + return VectorDataProcessor.getHistograms( + uuid, callContext, results, theme, requestParameter); + } + + + @Override + protected void createODV( + OutputStream outputStream, Collection result, String uuid) + throws IOException, StateException + { + logger.info("Start exporting " + result.size() + " items to odv."); + Export export = new DefaultExport( + new SimpleOdvDataCollector(ODV_PROFILE_NAMES)); + + Profile profile = new DefaultProfile( + ODV_COLUMN_HEADERS, + '\t', + CSVWriter.NO_QUOTE_CHARACTER, + CSVWriter.NO_ESCAPE_CHARACTER, + "ODV", + "ISO-8859-1"); + + export.create(profile, outputStream, result); + } + + + protected Statistics getStatisticsGenerator() { + return new TimeseriesVectorStatistics(); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/statistics/AbstractStatistics.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/AbstractStatistics.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/AbstractStatistics.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.statistics; import org.apache.commons.math.stat.descriptive.DescriptiveStatistics; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/statistics/HorizontalProfileStatistics.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/HorizontalProfileStatistics.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/HorizontalProfileStatistics.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.statistics; import java.sql.SQLException; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/statistics/HorizontalProfileVectorStatistics.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/HorizontalProfileVectorStatistics.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.statistics; + +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.io.ParseException; +import com.vividsolutions.jts.io.WKTReader; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.geobackend.base.ResultDescriptor; + +import de.intevation.gnv.utils.DistanceCalculator; + +import java.sql.SQLException; + +import org.apache.log4j.Logger; + +/** + * @author Ingo Weinzierl + */ +public class HorizontalProfileVectorStatistics +extends VectorStatistics +{ + + private static Logger logger = + Logger.getLogger(HorizontalProfileVectorStatistics.class); + + private WKTReader wktReader = new WKTReader(); + + private double distance; + + + public HorizontalProfileVectorStatistics() { + distance = 0; + } + + + protected void clear() { + distance = 0; + } + + + protected int getValueIdx(ResultDescriptor rd) { + return rd.getColumnIndex("YORDINATE"); + } + + + protected double calculateXOrdinateValue(Result prev, Result row) + throws SQLException + { + try { + Point start = (Point) wktReader.read(prev.getString("SHAPE")); + Point current = (Point) wktReader.read(row.getString("SHAPE")); + + double delta = DistanceCalculator.calculateDistance(start, current); + + distance = !Double.isNaN(delta) ? distance + delta : distance; + } + catch (ParseException e) { + logger.error(e,e); + } + return distance; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/statistics/Statistic.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/Statistic.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/Statistic.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + /** * Title: Statistic, $Header: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/output/statistics/Statistic.java,v 1.2 2007/12/21 12:31:15 blume Exp $ * Source: $Source: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/output/statistics/Statistic.java,v $ diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/statistics/StatisticSet.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/StatisticSet.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/StatisticSet.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.statistics; import java.util.ArrayList; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/statistics/Statistics.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/Statistics.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/Statistics.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + /** * Title: Statistics, $Header: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/output/statistics/Statistics.java,v 1.2 2008/01/30 12:38:34 blume Exp $ * Source: $Source: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/output/statistics/Statistics.java,v $ diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + /** * Title: TimeseriesStatistics, $Header: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/output/statistics/TimeseriesStatistics.java,v 1.3 2008/08/18 14:50:33 drewnak Exp $ * Source: $Source: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/output/statistics/TimeseriesStatistics.java,v $ diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/statistics/TimeseriesVectorStatistics.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/TimeseriesVectorStatistics.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.statistics; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.geobackend.base.ResultDescriptor; + +import java.sql.SQLException; + + +/** + * @author Ingo Weinzierl + */ +public class TimeseriesVectorStatistics +extends VectorStatistics +{ + public TimeseriesVectorStatistics() { + } + + + protected void clear() { + // nothing to clear + } + + + protected int getValueIdx(ResultDescriptor rd) { + return rd.getColumnIndex("YORDINATE"); + } + + + protected double calculateXOrdinateValue(Result prev, Result row) + throws SQLException + { + return new Double((row.getDate("XORDINATE")).getTime() / 1000 / 3600); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/statistics/VectorStatistics.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/VectorStatistics.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,134 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.statistics; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.geobackend.base.ResultDescriptor; + +import de.intevation.gnv.state.describedata.KeyValueDescibeData; + +import de.intevation.gnv.statistics.exception.StatisticsException; + +import java.sql.SQLException; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; + +import org.apache.commons.math.stat.descriptive.DescriptiveStatistics; + +import org.apache.commons.math.stat.regression.SimpleRegression; + +import org.apache.log4j.Logger; + + +/** + * @author Ingo Weinzierl + */ +public abstract class VectorStatistics +extends AbstractStatistics +{ + private static Logger logger = + Logger.getLogger(VectorStatistics.class); + + private ResultDescriptor rd; + + + public VectorStatistics() { + } + + + public Collection calculateStatistics( + Object result, + Collection parameters, + Collection measurements, + Collection dates + ) throws StatisticsException { + if (!(result instanceof Collection)) + return new ArrayList(); + + Collection results = (Collection) result; + Collection stats = new ArrayList(); + + SimpleRegression lRegression = new SimpleRegression(); + DescriptiveStatistics lStatistics = new DescriptiveStatistics(); + + Result previous = null; + Result row = null; + String seriesName = null; + int valueIdx = -1; + int seriesIdx = -1; + + Iterator iter = results.iterator(); + + while (iter.hasNext()) { + row = iter.next(); + previous = previous == null ? row : previous; + + if (rd == null || seriesIdx == -1) { + rd = row.getResultDescriptor(); + valueIdx = getValueIdx(rd); + seriesIdx = rd.getColumnIndex("SERIES"); + } + + if (seriesName != null + && !row.getString(seriesIdx).equals(seriesName)) + { + stats.add(generateStatisticsValues( + lStatistics, lRegression, seriesName)); + + lStatistics.clear(); + lRegression.clear(); + + clear(); + } + + Double yValue = getValue(row, valueIdx); + + if (yValue != null) { + lStatistics.addValue(yValue); + + try { + double x = calculateXOrdinateValue(previous, row); + lRegression.addData(x, yValue); + } + catch (SQLException sqle) { + logger.warn(sqle, sqle); + } + } + + seriesName = row.getString(seriesIdx); + previous = row; + } + + if (seriesName != null && row != null) { + stats.add(generateStatisticsValues( + lStatistics, lRegression, seriesName)); + + lStatistics.clear(); + lRegression.clear(); + } + + return stats; + } + + + protected Double getValue(Result row, int idx) { + return row.getDouble(idx); + } + + + abstract protected void clear(); + + abstract protected int getValueIdx(ResultDescriptor rd); + + abstract protected double calculateXOrdinateValue(Result prev, Result now) + throws SQLException; +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/statistics/VerticalCrossSectionStatistics.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/VerticalCrossSectionStatistics.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/VerticalCrossSectionStatistics.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.statistics; import de.intevation.gnv.math.AttributedXYColumns; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/statistics/VerticalProfileStatistics.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/VerticalProfileStatistics.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/VerticalProfileStatistics.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.statistics; import de.intevation.gnv.geobackend.base.Result; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/statistics/VerticalProfileVectorStatistics.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/VerticalProfileVectorStatistics.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.statistics; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.geobackend.base.ResultDescriptor; + +import java.sql.SQLException; + + +/** + * @author Ingo Weinzierl + */ +public class VerticalProfileVectorStatistics +extends VectorStatistics +{ + public VerticalProfileVectorStatistics() { + } + + + protected void clear() { + // nothing to clear + } + + + protected int getValueIdx(ResultDescriptor rd) { + return rd.getColumnIndex("YORDINATE"); + } + + + protected double calculateXOrdinateValue(Result prev, Result row) + throws SQLException + { + return row.getDouble("XORDINATE"); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/statistics/exception/StatisticsException.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/exception/StatisticsException.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/exception/StatisticsException.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.statistics.exception; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,15 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.timeseries; import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallMeta; import de.intevation.gnv.artifacts.GNVArtifactBase; @@ -38,10 +47,15 @@ @Override - public void setup(String identifier, ArtifactFactory factory, - Object context, Document data) { + public void setup( + String identifier, + ArtifactFactory factory, + Object context, + CallMeta meta, + Document data + ) { log.debug("TimeSeriesArtifact.setup"); - super.setup(identifier, factory, context, data); + super.setup(identifier, factory, context, meta, data); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/TimeSeriesMeshArtifact.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/TimeSeriesMeshArtifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/TimeSeriesMeshArtifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.timeseries; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/gap/DefaultTimeGap.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/gap/DefaultTimeGap.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/gap/DefaultTimeGap.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.timeseries.gap; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/gap/TimeGap.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/gap/TimeGap.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/gap/TimeGap.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.timeseries.gap; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/transition/DefaultTransition.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/DefaultTransition.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/DefaultTransition.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.transition; import de.intevation.gnv.state.State; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/transition/PresettingsValueCompareTransition.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/PresettingsValueCompareTransition.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/PresettingsValueCompareTransition.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.transition; import java.util.Map; @@ -5,7 +13,7 @@ import org.apache.log4j.Logger; import org.w3c.dom.Node; -import de.intevation.artifactdatabase.Config; +import de.intevation.artifacts.common.utils.Config; import de.intevation.gnv.state.InputData; import de.intevation.gnv.state.State; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/transition/Transition.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/Transition.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/Transition.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.transition; import de.intevation.gnv.state.State; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,14 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.transition; -import de.intevation.artifactdatabase.Config; +import de.intevation.artifacts.common.utils.Config; import org.w3c.dom.Node; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionFactory.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.transition; import org.apache.log4j.Logger; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/transition/ValueCompareTransition.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/ValueCompareTransition.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/ValueCompareTransition.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.transition; import java.util.Iterator; @@ -5,7 +13,7 @@ import org.apache.log4j.Logger; import org.w3c.dom.Node; -import de.intevation.artifactdatabase.Config; +import de.intevation.artifacts.common.utils.Config; import de.intevation.gnv.state.InputData; import de.intevation.gnv.state.State; import de.intevation.gnv.state.exception.StateException; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.utils; import java.io.ByteArrayInputStream; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/DistanceCalculator.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/DistanceCalculator.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/DistanceCalculator.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.utils; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/ExclusiveExec.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/ExclusiveExec.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/ExclusiveExec.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.utils; import java.util.HashMap; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/FileUtils.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/FileUtils.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/FileUtils.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.utils; import java.io.BufferedInputStream; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/IndexBuffer.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/IndexBuffer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/IndexBuffer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.utils; import java.awt.Point; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.utils; import com.vividsolutions.jts.geom.Coordinate; @@ -221,14 +229,20 @@ * @return true, if tmp is valid, otherwise false. */ public static boolean isDateValid(Date tmp, Date lo, Date up) { - // we need to transform the given dates into seconds, because - // they differ in milliseconds -> that's why we cannot use the - // Date.compareTo(Date) method. + // take the time in seconds to compare long tmpTime = tmp.getTime() / 1000; long tmpLow = lo.getTime() / 1000; long tmpUp = up.getTime() / 1000; - if (tmpTime < tmpLow || tmpTime > tmpUp) { + if (log.isDebugEnabled()) { + log.debug("Date validation..."); + log.debug("-> lower bound [sec]: " + tmpLow); + log.debug("-> upper bound [sec]: " + tmpUp); + log.debug("-> input data [sec]: " + tmpTime); + } + + // XXX There is a buffer of 1 second for the valid range of the time. + if (tmpTime < (tmpLow-1) || tmpTime > (tmpUp+1)) { log.warn( "Date [" + tmp.toString() + "] is out of range [" + lo.toString() + " to "+ up.toString() + "]."); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/MapfileGenerator.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/MapfileGenerator.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/MapfileGenerator.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,7 +1,15 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.utils; -import de.intevation.artifactdatabase.Config; -import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.common.utils.Config; +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.ArtifactNamespaceContext; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/MetaWriter.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/MetaWriter.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/MetaWriter.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.utils; import java.io.File; @@ -5,14 +13,19 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.text.DecimalFormat; import java.util.Date; +import javax.xml.xpath.XPathConstants; + import org.apache.log4j.Logger; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; -import de.intevation.artifactdatabase.XMLUtils; +import com.vividsolutions.jts.geom.Envelope; + +import de.intevation.artifacts.common.utils.XMLUtils; import de.intevation.artifacts.ArtifactNamespaceContext; import de.intevation.artifacts.CallContext; import de.intevation.gnv.artifacts.context.GNVArtifactContext; @@ -34,11 +47,9 @@ public static final String NODE_TTL = "ttl"; public static final String META_FILE_NAME = "meta.xml"; - public static final String ISOLINES_NAME = "isolines.shp"; - public static final String POLYGON_NAME = "polygons.shp"; - - public static final String CONTEXT_LAYER_TITLE = "wms.title"; + public static final String XPATH_META = "/art:meta"; + public static final String XPATH_MAPSERVER = "art:meta/art:"+NODE_MAPSERVER; /** * Constructor. @@ -46,41 +57,13 @@ private MetaWriter() { } - /** - * Writes a meta information file for product type 'Layer'. - * - * @param context CallContext object. - * @param meta the document where the information should be placed in. - * @return the meta document. - */ - public static Node writeLayerMeta(CallContext context, Document meta){ - XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( - meta, - ArtifactNamespaceContext.NAMESPACE_URI, - ArtifactNamespaceContext.NAMESPACE_PREFIX); - Element root = creator.create("meta"); - meta.appendChild(root); - - writeAbstractMeta(context, meta, root); - return root; - } - /** - * Writes a meta information file for product type 'Horizontalschnitt'. + * Just create a new document and insert the root node. * - * @param context The CallContext object. - * @param uuid The UUID of the current artifact. - * @param path The destination of the meta file. - * @param paramType The parameter type. - * @return the meta document. + * @return the meta document with necessary root node. */ - public static Document writeHorizontalcrosssectionMeta( - CallContext context, - String uuid, - String path, - String paramType) - { + public static Document initMeta() { Document meta = XMLUtils.newDocument(); XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( meta, @@ -90,19 +73,108 @@ Element root = creator.create("meta"); meta.appendChild(root); - writeAbstractMeta(context, meta, root); - writePolygonMeta(context, meta, root, uuid, paramType); - writeIsolineMeta(context, meta, root, uuid, paramType); - - boolean success = writeMetaFile(path, meta); - - if (success){ - return meta; - }else{ - return null; - } + return meta; } + public static boolean insertLayer( + CallContext context, + Document document, + String name, + String title, + String data, + String model, + String type, + String status + ) { + if (document == null) { + document = initMeta(); + } + + Node meta = (Node) XMLUtils.xpath( + document, + XPATH_META, + XPathConstants.NODE, + ArtifactNamespaceContext.INSTANCE); + + if (meta == null) { + logger.error("No meta node was found in the given document. " + + "Cannot insert layer!"); + return false; + } + + XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( + document, + ArtifactNamespaceContext.NAMESPACE_URI, + ArtifactNamespaceContext.NAMESPACE_PREFIX); + + Element layerEl = creator.create(LayerInfo.LAYER); + Element nameEl = creator.create(LayerInfo.LAYER_NAME); + Element titleEl = creator.create(LayerInfo.LAYER_TITLE); + Element dataEl = creator.create(LayerInfo.LAYER_DATA); + Element modelEl = creator.create(LayerInfo.LAYER_MODEL); + Element typeEl = creator.create(LayerInfo.LAYER_TYPE); + Element statusEl = creator.create(LayerInfo.LAYER_STATUS); + + modelEl.setTextContent(model); + nameEl.setTextContent(name); + titleEl.setTextContent(title); + typeEl.setTextContent(type); + statusEl.setTextContent(status); + dataEl.setTextContent(data); + + layerEl.appendChild(modelEl); + layerEl.appendChild(nameEl); + layerEl.appendChild(titleEl); + layerEl.appendChild(dataEl); + layerEl.appendChild(typeEl); + layerEl.appendChild(statusEl); + + if (logger.isDebugEnabled()) { + logger.debug("--------------- WMS LAYER PARAMS ---------------"); + logger.debug("Name : " + name); + logger.debug("Title : " + title); + logger.debug("Data : " + data); + logger.debug("Type : " + type); + logger.debug("Model : " + model); + logger.debug("Status: " + status); + } + + meta.appendChild(layerEl); + + return true; + } + + /** + * Method to write the meta document down to a file. + * + * @param path The destination of the file. + * @param meta The xml document storing the meta information. + */ + public static boolean insertMbr(Envelope mbr, String srs, Document meta) { + Node mapserverNode = (Node) XMLUtils.xpath( + meta, + XPATH_MAPSERVER, + XPathConstants.NODE, + ArtifactNamespaceContext.INSTANCE); + if (mapserverNode != null){ + XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( + meta, + ArtifactNamespaceContext.NAMESPACE_URI, + ArtifactNamespaceContext.NAMESPACE_PREFIX); + Element bboxNode = creator.create("Box"); + bboxNode.setAttribute("srsName", srs); + Element coordinateNode = creator.create("coordinates"); + + DecimalFormat formatter = new DecimalFormat("###.############"); + coordinateNode.setTextContent(formatter.format(mbr.getMinX()).replace(',', '.') +","+ + formatter.format(mbr.getMinY()).replace(',', '.')+" "+ + formatter.format(mbr.getMaxX()).replace(',', '.') +","+ + formatter.format(mbr.getMaxY()).replace(',', '.')); + mapserverNode.appendChild(bboxNode); + bboxNode.appendChild(coordinateNode); + } + return true; + } /** * Method to write the meta document down to a file. * @@ -160,11 +232,20 @@ * @param document The meta information document. * @param meta The element where the new information need to be appended to. */ - public static void writeAbstractMeta( + public static void insertAbstractMeta( CallContext callContext, - Document document, - Element meta + Document document ) { + if (document == null) { + document = initMeta(); + } + + Node meta = (Node) XMLUtils.xpath( + document, + XPATH_META, + XPathConstants.NODE, + ArtifactNamespaceContext.INSTANCE); + XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( document, ArtifactNamespaceContext.NAMESPACE_URI, @@ -179,197 +260,29 @@ String map = (String) context.get(GNVArtifactContext.MAPSERVER_MAP_PATH_KEY); + Long time = callContext.getTimeToLive(); + time = time != null ? time + new Date().getTime() : null; + String ttl = time != null ? time.toString() : null; + if (logger.isDebugEnabled()) { logger.debug("MAPSERVER PATH: " + server); logger.debug("MAP PATH: " + map); + logger.debug("TTL: " + ttl); } Element mapserver = creator.create(NODE_MAPSERVER); Element serverPath = creator.create(NODE_SERVER); Element mapPath = creator.create(NODE_MAP); + Element timetolive = creator.create(NODE_TTL); mapPath.setTextContent(map); serverPath.setTextContent(server); + timetolive.setTextContent(ttl); mapserver.appendChild(serverPath); mapserver.appendChild(mapPath); + mapserver.appendChild(timetolive); meta.appendChild(mapserver); } - - /** - * Append layer information to the meta document. - * - * @param callContext The CallContext object. - * @param document The meta document. - * @param root The element where the new information need to be appended to. - * @param uuid The UUID of the current artifact. - * @param paramType The parameter type (e.g. salinity). - * @param layerType The layer type. - * @param shapefileName the name of the Shapefile - * @param shapefileName the Title of the Layer - */ - public static void writeLayerMeta( - CallContext callContext, - Document document, - Node root, - String uuid, - String paramType, - String layerType, - String shapefileName, - String layerTitle - ) { - XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( - document, - ArtifactNamespaceContext.NAMESPACE_URI, - ArtifactNamespaceContext.NAMESPACE_PREFIX); - - Long time = callContext.getTimeToLive(); - time = time != null ? time + new Date().getTime() : null; - String ttl = time != null ? time.toString() : null; - - logger.debug("Artifacts time to live: " + ttl); - - Element layer = creator.create(LayerInfo.LAYER); - Element model = creator.create(LayerInfo.LAYER_MODEL); - Element name = creator.create(LayerInfo.LAYER_NAME); - Element title = creator.create(LayerInfo.LAYER_TITLE); - Element type = creator.create(LayerInfo.LAYER_TYPE); - Element status = creator.create(LayerInfo.LAYER_STATUS); - Element data = creator.create(LayerInfo.LAYER_DATA); - Element timeToLive = creator.create(NODE_TTL); - - model.setTextContent(paramType); - name.setTextContent(uuid); - type.setTextContent(layerType); - status.setTextContent("OFF"); - data.setTextContent(shapefileName); - timeToLive.setTextContent(ttl); - - title.setTextContent(layerTitle); - - layer.appendChild(model); - layer.appendChild(name); - layer.appendChild(title); - layer.appendChild(type); - layer.appendChild(status); - layer.appendChild(data); - layer.appendChild(timeToLive); - - root.appendChild(layer); - } - - - /** - * Append polygon layer information to meta document. - * - * @param context - * @param document The meta document. - * @param meta The element where the new information need to be appended to. - * @param uuid The UUID of the current artifact. - * @param paramType The parameter type (e.g. salinity). - */ - public static void writePolygonMeta( - CallContext context, - Document document, - Element meta, - String uuid, - String paramType - ) { - XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( - document, - ArtifactNamespaceContext.NAMESPACE_URI, - ArtifactNamespaceContext.NAMESPACE_PREFIX); - - Long time = context.getTimeToLive(); - time = time != null ? time + new Date().getTime() : null; - String ttl = time != null ? time.toString() : null; - - logger.debug("Artifacts time to live: " + ttl); - - Element layer = creator.create(LayerInfo.LAYER); - Element model = creator.create(LayerInfo.LAYER_MODEL); - Element name = creator.create(LayerInfo.LAYER_NAME); - Element title = creator.create(LayerInfo.LAYER_TITLE); - Element type = creator.create(LayerInfo.LAYER_TYPE); - Element status = creator.create(LayerInfo.LAYER_STATUS); - Element data = creator.create(LayerInfo.LAYER_DATA); - Element timeToLive = creator.create(NODE_TTL); - - model.setTextContent(paramType); - name.setTextContent(uuid); - title.setTextContent( - (String) context.getContextValue(CONTEXT_LAYER_TITLE)); - type.setTextContent("POLYGON"); - status.setTextContent("OFF"); - data.setTextContent(POLYGON_NAME); - timeToLive.setTextContent(ttl); - - layer.appendChild(model); - layer.appendChild(name); - layer.appendChild(title); - layer.appendChild(type); - layer.appendChild(status); - layer.appendChild(data); - layer.appendChild(timeToLive); - - meta.appendChild(layer); - } - - - /** - * Append isoline layer information to meta document. - * - * @param context - * @param document The meta document. - * @param meta The element where the new information need to be appended to. - * @param uuid The UUID of the current artifact. - * @param paramType The parameter type (e.g. salinity). - */ - public static void writeIsolineMeta( - CallContext context, - Document document, - Element meta, - String uuid, - String paramType - ) { - XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( - document, - ArtifactNamespaceContext.NAMESPACE_URI, - ArtifactNamespaceContext.NAMESPACE_PREFIX); - - Long time = context.getTimeToLive(); - time = time != null ? time + new Date().getTime() : null; - String ttl = time != null ? time.toString() : null; - - logger.debug("Artifacts time to live: " + ttl); - - Element layer = creator.create(LayerInfo.LAYER); - Element model = creator.create(LayerInfo.LAYER_MODEL); - Element name = creator.create(LayerInfo.LAYER_NAME); - Element title = creator.create(LayerInfo.LAYER_TITLE); - Element type = creator.create(LayerInfo.LAYER_TYPE); - Element status = creator.create(LayerInfo.LAYER_STATUS); - Element data = creator.create(LayerInfo.LAYER_DATA); - Element timeToLive = creator.create(NODE_TTL); - - model.setTextContent(paramType+"_isolines"); - name.setTextContent(uuid); - title.setTextContent( - (String) context.getContextValue(CONTEXT_LAYER_TITLE)); - type.setTextContent("LINE"); - status.setTextContent("OFF"); - data.setTextContent(ISOLINES_NAME); - timeToLive.setTextContent(ttl); - - layer.appendChild(model); - layer.appendChild(name); - layer.appendChild(title); - layer.appendChild(type); - layer.appendChild(status); - layer.appendChild(data); - layer.appendChild(timeToLive); - - meta.appendChild(layer); - } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/Pair.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/Pair.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/Pair.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.utils; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/ShapeFileWriter.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/ShapeFileWriter.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/ShapeFileWriter.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.utils; import java.io.File; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/StringUtils.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/StringUtils.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/StringUtils.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.utils; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/VectorDataProcessor.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/VectorDataProcessor.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,153 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.utils; + +import de.intevation.artifacts.CallContext; + +import de.intevation.gnv.chart.Chart; +import de.intevation.gnv.chart.ChartLabels; +import de.intevation.gnv.chart.DefaultHistogram; + +import de.intevation.gnv.geobackend.base.DefaultResult; +import de.intevation.gnv.geobackend.base.DefaultResultDescriptor; +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.geobackend.base.ResultDescriptor; + +import de.intevation.gnv.histogram.HistogramHelper; + +import de.intevation.gnv.state.describedata.KeyValueDescibeData; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; + + +/** + * @author Ingo Weinzierl + */ +public final class VectorDataProcessor { + + private static Logger logger = Logger.getLogger(VectorDataProcessor.class); + + public static Collection process( + Collection input, String[] columnNames) + { + logger.info("Process vector data (" + input.size() + " items)"); + + ResultDescriptor outDescriptor = initResultDescriptor(columnNames); + ResultDescriptor inDescriptor = null; + int[] inIndices = null; + int columns = -1; + + Map series = new HashMap(); + + // for each result of the incoming result + for (Result result: input) { + if (inDescriptor == null || inIndices == null) { + inDescriptor = result.getResultDescriptor(); + inIndices = inDescriptor.getColumnIndices(columnNames); + columns = inDescriptor.getColumnCount(); + } + + // for each column of the incoming result object + for (int i = 0; i < columns; i++) { + String name = inDescriptor.getColumnName(i); + + if (!StringUtils.contains(columnNames, name)) { + List list = (List) series.get(name); + if (list == null) + list = new ArrayList(); + + Result out = new DefaultResult(outDescriptor); + Object value = result.getObject(i); + + // skipp results that have no data value + if (value == null) + continue; + + out.addColumnValue(0, value); + + // add meta data to result object + // TODO: Maybe we could do this one single time, because the + // TODO: meta data will not change + for (int j = 1; j < inIndices.length -1; j++) { + out.addColumnValue(j, result.getObject(inIndices[j])); + } + + // add the name of the component to distinguish between + // different series later in the chart creation + out.addColumnValue(inIndices.length-1, name); + + list.add(out); + series.put(name, list); + } + } + } + + // finally, we put all lists together + Iterator iter = series.values().iterator(); + List output = new ArrayList(); + while (iter.hasNext()) { + output.addAll((Collection)iter.next()); + } + + logger.info("Data processing created " + output.size() + " elements."); + return output; + } + + + public static ResultDescriptor initResultDescriptor(String[] columnNames) { + logger.debug("Init ResultDescriptor for outgoing results."); + + ResultDescriptor desc = new DefaultResultDescriptor(); + + for (String name: columnNames) { + desc.addColumn(name, "java.lang.String"); + } + + logger.debug("Outgoing ResultDescriptor has " + desc.getColumnCount() + + " columns"); + return desc; + } + + + public static Chart[] getHistograms( + String uuid, + CallContext callContext, + Collection results, + ChartTheme theme, + Map requestParameter + ) { + Locale locale = (Locale) requestParameter.get("locale"); + + Object[][] data = HistogramHelper.prepareVectorialHistogramData(results); + int size = data.length; + + Chart[] histograms = new Chart[size]; + + for (int i = 0; i < size; i++) { + ChartLabels labels = HistogramHelper.createHistogramLabels( + uuid, callContext, locale, data[i]); + + histograms[i] = new DefaultHistogram( + labels, data[i], theme, requestParameter); + } + + return histograms; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/WKTUtils.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/WKTUtils.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/WKTUtils.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.utils; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/utils/exception/ValidationException.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/utils/exception/ValidationException.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/exception/ValidationException.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.utils.exception; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/java/de/intevation/gnv/wms/LayerInfo.java --- a/gnv-artifacts/src/main/java/de/intevation/gnv/wms/LayerInfo.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/wms/LayerInfo.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.wms; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/resources/lang/artifactMessages.properties --- a/gnv-artifacts/src/main/resources/lang/artifactMessages.properties Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages.properties Fri Sep 28 12:15:22 2012 +0200 @@ -27,6 +27,7 @@ horizontalProfileCross = Horizontales Schnittprofil horizontalCrossSection = Horizontal cross-section verticalcrosssection = Vertical cross-section +verticalcrosssectionparallel = Achsenparalleler Vertikalschnitt layer = Layer featureid = Station mesh_coordinate = Geographic position (e.g. 56n30 6e20) @@ -62,6 +63,9 @@ coordinate.template.southeast={0}\u00b0S {1}'' {2}\u00b0E {3}'' coordinate.template.northwest={0}\u00b0N {1}'' {2}\u00b0W {3}'' coordinate.template.southwest={0}\u00b0S {1}'' {2}\u00b0W {3}'' +vectorscalar = Vector / Scalar values +vectorvalues = Vector values +scalarvalues = Scalar values chart.timeseries.date.format=yyyy-MMM-dd chart.timeseries.title.xaxis=Time [UTC] @@ -77,6 +81,7 @@ no.input.data= No Entry was chosen. Please select at least one entry. input.is.not.valid=Invalid input. Please try again. input.is.not.valid.date.required=Invalid input. A date is required. Please try again. +input.is.not.valid.minmax=Input is not valid for this state. start.date.after.end.date=Start date lies after end date. Please try again. date.out.of.range=Date is out of range. missing.data.field=Can't validate selected date. Missing date, lower or upper date bound. diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/resources/lang/artifactMessages_de.properties --- a/gnv-artifacts/src/main/resources/lang/artifactMessages_de.properties Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages_de.properties Fri Sep 28 12:15:22 2012 +0200 @@ -26,6 +26,7 @@ horizontalProfileCross = Horizontales Schnittprofil horizontalCrossSection = Horizontalschnitt verticalcrosssection = Profilschnitt +verticalcrosssectionparallel = Achsenparalleler Vertikalschnitt layer = Layer featureid = Station meshid= Datengitter @@ -62,6 +63,9 @@ coordinate.template.southeast={0}\u00b0S {1}'' {2}\u00b0O {3}'' coordinate.template.northwest={0}\u00b0N {1}'' {2}\u00b0W {3}'' coordinate.template.southwest={0}\u00b0S {1}'' {2}\u00b0W {3}'' +vectorscalar = Vektorielle / Skalare Werte +vectorvalues = Vektorielle Werte +scalarvalues = Skalare Werte chart.timeseries.date.format=dd-MMM-yyyy chart.timeseries.title.xaxis=Zeit [UTC] @@ -77,6 +81,7 @@ no.input.data=Es wurde kein Eintrag ausgew\u00e4hlt. Bitte w\u00e4hlen sie mindestens einen Eintrag aus. input.is.not.valid=Ung\u00fcltige Eingabe. Bitte versuchen Sie es erneut. input.is.not.valid.date.required=Ung\u00fcltige Eingabe. Ein Datum wird ben\u00f6tigt. Bitte versuchen Sie es erneut. +input.is.not.valid.minmax=Die get\u00e4tigte Eingabe ist ung\u00fctig. start.date.after.end.date=Anfangsdatum liegt hinter dem Enddatum. Bitte versuchen Sie es erneut. date.out.of.range=Das gew\u00e4hlte Datum liegt au\u00dferhalb des gültigen Wertebereiches. missing.data.field=Validierung der Datumseingabe nicht m\u00f6glich. Datum, obere oder untere Grenze fehlt. diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/resources/lang/artifactMessages_de_DE.properties --- a/gnv-artifacts/src/main/resources/lang/artifactMessages_de_DE.properties Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages_de_DE.properties Fri Sep 28 12:15:22 2012 +0200 @@ -26,6 +26,7 @@ horizontalProfileCross = Horizontales Schnittprofil horizontalCrossSection = Horizontalschnitt verticalcrosssection = Profilschnitt +verticalcrosssectionparallel = Achsenparalleler Vertikalschnitt layer = Layer featureid = Station meshid= Datengitter @@ -62,6 +63,9 @@ coordinate.template.southeast={0}\u00b0S {1}'' {2}\u00b0O {3}'' coordinate.template.northwest={0}\u00b0N {1}'' {2}\u00b0W {3}'' coordinate.template.southwest={0}\u00b0S {1}'' {2}\u00b0W {3}'' +vectorscalar = Vektorielle / Skalare Werte +vectorvalues = Vektorielle Werte +scalarvalues = Skalare Werte chart.timeseries.date.format=dd-MMM-yyyy chart.timeseries.title.xaxis=Zeit [UTC] @@ -77,6 +81,7 @@ no.input.data=Es wurde kein Eintrag ausgew\u00e4hlt. Bitte w\u00e4hlen sie mindestens einen Eintrag aus. input.is.not.valid=Ung\u00fcltige Eingabe. Bitte versuchen Sie es erneut. input.is.not.valid.date.required=Ung\u00fcltige Eingabe. Ein Datum wird ben\u00f6tigt. Bitte versuchen Sie es erneut. +input.is.not.valid.minmax=Die get\u00e4tigte Eingabe ist ung\u00fctig. start.date.after.end.date=Anfangsdatum liegt nach dem Enddatum. Bitte versuchen Sie es erneut. date.out.of.range=Das gew\u00e4hlte Datum liegt au\u00dferhalb des gültigen Wertebereiches. missing.data.field=Validierung der Datumseingabe nicht m\u00f6glich. Datum, obere oder untere Grenze fehlt. diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/main/resources/lang/artifactMessages_en.properties --- a/gnv-artifacts/src/main/resources/lang/artifactMessages_en.properties Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages_en.properties Fri Sep 28 12:15:22 2012 +0200 @@ -27,6 +27,7 @@ horizontalProfileCross = Horizontales Schnittprofil horizontalCrossSection = Horizontal cross-section verticalcrosssection = Vertical cross-section +verticalcrosssectionparallel = Achsenparalleler Vertikalschnitt layer = Layer featureid = Station mesh_coordinate = Geographic position (e.g. 56n30 6e20) @@ -62,6 +63,9 @@ coordinate.template.southeast={0}\u00b0S {1}'' {2}\u00b0E {3}'' coordinate.template.northwest={0}\u00b0N {1}'' {2}\u00b0W {3}'' coordinate.template.southwest={0}\u00b0S {1}'' {2}\u00b0W {3}'' +vectorscalar = Vector / Scalar values +vectorvalues = Vector values +scalarvalues = Scalar values chart.timeseries.date.format=yyyy-MMM-dd @@ -78,6 +82,7 @@ no.input.data= No Entry was chosen. Please select at least one entry. input.is.not.valid=Invalid input. Please try again. input.is.not.valid.date.required=Invalid input. A date is required. Please try again. +input.is.not.valid.minmax=Input is not valid for this state. start.date.after.end.date=Start date lies after end date. Please try again. date.out.of.range=Date is out of range. missing.data.field=Can't validate selected date. Missing date, lower or upper date bound. diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCaseBase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCaseBase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCaseBase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,14 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; -import de.intevation.artifactdatabase.Config; +import de.intevation.artifacts.common.utils.Config; import de.intevation.artifactdatabase.DefaultCallMeta; import de.intevation.artifactdatabase.DefaultPreferredLocale; import de.intevation.artifactdatabase.FactoryBootstrap; @@ -182,6 +190,7 @@ Artifact artifact = artifactFactory.createArtifact( "" + System.currentTimeMillis(), bootstrap.getContext(), + null, setupData); assertNotNull(artifact); log.debug("Artifact is available"); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestSuite.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestSuite.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestSuite.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import junit.framework.Test; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/InstantaneousPointHorizontalProfileTestCase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/InstantaneousPointHorizontalProfileTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/InstantaneousPointHorizontalProfileTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import de.intevation.artifacts.Artifact; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/InstantaneousPointVerticalProfileTestCase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/InstantaneousPointVerticalProfileTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/InstantaneousPointVerticalProfileTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import de.intevation.artifacts.Artifact; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshHorizontalCrossSectionTestCase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshHorizontalCrossSectionTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshHorizontalCrossSectionTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import de.intevation.artifacts.Artifact; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshHorizontalProfileTestCase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshHorizontalProfileTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshHorizontalProfileTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import de.intevation.artifacts.Artifact; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshTimeSeriesTestCase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshTimeSeriesTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshTimeSeriesTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import de.intevation.artifacts.Artifact; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshVerticalCrossSectionTestCase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshVerticalCrossSectionTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshVerticalCrossSectionTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import de.intevation.artifacts.Artifact; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshVerticalProfileTestCase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshVerticalProfileTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshVerticalProfileTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import de.intevation.artifacts.Artifact; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TestArtifactDatabase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TestArtifactDatabase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TestArtifactDatabase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,5 +1,14 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; +import de.intevation.artifacts.Artifact; import de.intevation.artifacts.ArtifactDatabase; import de.intevation.artifacts.ArtifactDatabaseException; import de.intevation.artifacts.ArtifactFactory; @@ -77,13 +86,26 @@ /** * @see de.intevation.artifacts.ArtifactDatabase#out(java.lang.String, org.w3c.dom.Document, de.intevation.artifacts.CallMeta) */ - public DeferredOutput out(String artifact, Document format, - CallMeta callMeta) - throws ArtifactDatabaseException { + public DeferredOutput out( + String artifact, + Document format, + CallMeta callMeta) + throws ArtifactDatabaseException { return null; } + public DeferredOutput out( + String artifact, + String type, + Document format, + CallMeta callMeta) + throws ArtifactDatabaseException + { + return null; + + } + public Document process(String service, Document input, CallMeta callMeta) { return null; } @@ -100,4 +122,259 @@ throw new UnsupportedOperationException("Not supported yet."); } + + public void loadAllArtifacts(ArtifactLoadedCallback callback) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Artifact getRawArtifact(String identifier) + throws ArtifactDatabaseException { + throw new UnsupportedOperationException("Not supported yet."); + } + + + + // COLLECTION API + + public Document setCollectionTTL(String collectionId, Document doc, CallMeta meta) + throws ArtifactDatabaseException { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Document setCollectionName(String collectionId, Document doc, CallMeta meta) + throws ArtifactDatabaseException { + throw new UnsupportedOperationException("Not supported yet."); + } + + + public DeferredOutput outCollection(String collectionId, Document format, CallMeta callMeta) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public DeferredOutput outCollection(String collectionId, String type, Document format, CallMeta callMeta) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * @param collectionId + * @param meta + * + * @throws ArtifactDatabaseException + * + * @return + */ + public Document getCollectionsMasterArtifact( + String collectionId, + CallMeta meta + ) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * @param userId + * @param callMeta + * + * @throws ArtifactDatabaseException + * + * @return + */ + public Document listCollections(String userId, CallMeta callMeta) + throws ArtifactDatabaseException { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * @param ownerId + * @param data + * @param callMeta + * + * @throws ArtifactDatabaseException + * + * @return + */ + public Document createCollection( + String ownerId, + Document data, + CallMeta callMeta + ) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * @param collectionId + * @param callMeta + * + * @throws ArtifactDatabaseException + * + * @return + */ + public Document deleteCollection(String collectionId, CallMeta callMeta) + throws ArtifactDatabaseException { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * @param collectionId + * @param callMeta + * + * @throws ArtifactDatabaseException + * + * @return + */ + public Document describeCollection(String collectionId, CallMeta callMeta) + throws ArtifactDatabaseException { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * @param collectionId + * @param callMeta + * + * @throws ArtifactDatabaseException + * + * @return + */ + public Document getCollectionAttribute( + String collectionId, + CallMeta callMeta + ) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Document setCollectionAttribute( + String collectionId, + CallMeta callMeta, + Document attribute) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * @param collectionId + * @param artifactId + * @param callMeta + * + * @throws ArtifactDatabaseException + * + * @return + */ + public Document getCollectionItemAttribute( + String collectionId, + String artifactId, + CallMeta callMeta + ) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * @param collectionId + * @param artifactId + * @param attribute + * @param callMeta + * + * @throws ArtifactDatabaseException + * + * @return + */ + public Document setCollectionItemAttribute( + String collectionId, + String artifactId, + Document attribute, + CallMeta callMeta + ) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * @param collectionId + * @param artifactId + * @param input + * @param callMeta + * + * @throws ArtifactDatabaseException + * + * @return + */ + public Document addCollectionArtifact( + String collectionId, + String artifactId, + Document input, + CallMeta callMeta + ) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * @param collectionId + * @param artifactId + * @param callMeta + * + * @throws ArtifactDatabaseException + * + * @return + */ + public Document removeCollectionArtifact( + String collectionId, + String artifactId, + CallMeta callMeta + ) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + /** + * @param collectionId + * @param callMeta + * + * @throws ArtifactDatabaseException + * + * @return + */ + public Document listCollectionArtifacts( + String collectionId, + CallMeta callMeta + ) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + + public Document listUsers(CallMeta callMeta) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Document createUser(Document data, CallMeta callMeta) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } + + public Document deleteUser(String userId, CallMeta callMeta) + throws ArtifactDatabaseException + { + throw new UnsupportedOperationException("Not supported yet."); + } } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TestCallContext.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TestCallContext.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TestCallContext.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,9 +1,22 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; +import java.util.List; +import java.util.LinkedList; + import de.intevation.artifacts.ArtifactDatabase; import de.intevation.artifacts.ArtifactFactory; import de.intevation.artifacts.CallContext; import de.intevation.artifacts.CallMeta; +import de.intevation.artifacts.DataProvider; +import de.intevation.artifacts.Message; /** * @author Tim Englich @@ -40,6 +53,14 @@ public void afterCall(int action) { } + public boolean isInBackground() { + throw new UnsupportedOperationException("Not supported yet."); + } + + public void addBackgroundMessage(Message msg) { + throw new UnsupportedOperationException("Not supported yet."); + } + /** * @see de.intevation.artifacts.CallContext#globalContext() */ @@ -66,4 +87,16 @@ public Long getTimeToLive() { throw new UnsupportedOperationException("Not supported yet."); } + + public Object registerDataProvider(Object key, DataProvider provider) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public List getDataProvider(Object key) { + throw new UnsupportedOperationException("Not supported yet."); + } + + public LinkedList getBackgroundMessages() { + throw new UnsupportedOperationException("Not supported yet."); + } } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointTimeSeriesTestCase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointTimeSeriesTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointTimeSeriesTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import de.intevation.artifacts.Artifact; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointVerticalProfileTestCase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointVerticalProfileTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointVerticalProfileTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts; import de.intevation.artifacts.Artifact; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/ressource/RessourceFactoryTestCase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/ressource/RessourceFactoryTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/ressource/RessourceFactoryTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.ressource; import de.intevation.artifactdatabase.DefaultPreferredLocale; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/util/DistanceCalculatorTestCase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/util/DistanceCalculatorTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/util/DistanceCalculatorTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.util; import com.vividsolutions.jts.geom.Coordinate; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/util/ShapeFileWriterTestCase.java --- a/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/util/ShapeFileWriterTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/util/ShapeFileWriterTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifacts.util; import com.vividsolutions.jts.geom.MultiLineString; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/ChangeLog --- a/gnv/ChangeLog Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/ChangeLog Fri Sep 28 12:15:22 2012 +0200 @@ -1,5 +1,983 @@ +2011-02-01 Ingo Weinzierl + + * pom.xml: Upgraded the Restlet version from 2.0-SNAPSHOT to 2.0.4 which is + the current stable release. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Renamed the packages of Request and Response that have been changed from + Restlet 2.0-SNAPSHOT to 2.0.4. + +2010-11-30 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java: + Bugfix: if debug logging was disabled for this class, a Nullpointer + exception would have been thrown. + +2010-11-29 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/util/CaptureInputStream.java: New. This + class makes it possible to capture incoming data (InputStream) in a proper + way. + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java: + Improved the mechanism to print the incoming data to log by using the + CaptureInputStream class. + +2010-11-26 Ingo Weinzierl + + ISSUE #323 + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java: + In addition to the last revision: XML documents of HTTP Post request are + also logged to the logfile. + +2010-11-26 Ingo Weinzierl + + ISSUE #323 + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java: + Log the xml document of the MapViewer call (DEBUG). + + * src/main/webapp/WEB-INF/classes/log4j.properties: Enabled the DEBUG + output of the MapViewerCallAction logging, so that the MapViewer call xml + document can be found in the log file. + +2010-11-02 Ingo Weinzierl + + * src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java, + src/test/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserTestCase.java, + src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java, + src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java, + src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java, + src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java, + src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseInputException.java, + src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java, + src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java, + src/main/java/de/intevation/gnv/action/CommunicationKeys.java, + src/main/java/de/intevation/gnv/action/DoExportAction.java, + src/main/java/de/intevation/gnv/action/SwitchLanguageAction.java, + src/main/java/de/intevation/gnv/action/WMSAction.java, + src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java, + src/main/java/de/intevation/gnv/action/ShowStatisticAction.java, + src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java, + src/main/java/de/intevation/gnv/action/LoadAction.java, + src/main/java/de/intevation/gnv/action/SelectFisAction.java, + src/main/java/de/intevation/gnv/action/CreateHistogramAction.java, + src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java, + src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java, + src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserException.java, + src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParser.java, + src/main/java/de/intevation/gnv/action/mapviewer/parser/XMLExternalCallParser.java, + src/main/java/de/intevation/gnv/action/DoOutputAction.java, + src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java, + src/main/java/de/intevation/gnv/action/MapClientStandaloneAction.java, + src/main/java/de/intevation/gnv/action/CreateChartAction.java, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java, + src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/StoreAction.java, + src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java, + src/main/java/de/intevation/gnv/util/XMLUtils.java, + src/main/java/de/intevation/gnv/util/XSLTransformer.java, + src/main/webapp/images/bfg-logo.gif, + src/main/webapp/WEB-INF/jsp/wmslayout.jsp, + src/main/webapp/WEB-INF/jsp/version.jsp, + src/main/webapp/WEB-INF/jsp/index.jsp, + src/main/webapp/WEB-INF/jsp/header.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_wms_basic_informations.jsp, + src/main/webapp/WEB-INF/jsp/includes/info_german.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_wms_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/info_english.jsp, + src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp, + src/main/webapp/WEB-INF/jsp/info.jsp, + src/main/webapp/WEB-INF/jsp/footer.jsp, + src/main/webapp/WEB-INF/jsp/wmsstandalone.jsp, + src/main/webapp/WEB-INF/jsp/imprint.jsp, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Added a license header to each + of these files. + + * LGPL.txt: Added the license text of the GNU LGPL. + +2010-07-05 Hans Plum + + * src/main/webapp/WEB-INF/jsp/includes/info_german.jsp: + Made name more precise. + +2010-07-01 Ingo Weinzierl + + RELEASE 1.1 + + * src/main/webapp/styles/gnv.css: Some style adjustments for the info pages. + + * src/main/webapp/WEB-INF/jsp/info.jsp: The outer info page. It handles the + different languages (german, english) and includes the localized info page + corresponding the current locale. + + * src/main/webapp/WEB-INF/jsp/includes/info_german.jsp, + src/main/webapp/WEB-INF/jsp/includes/info_english.jsp: German and english + info pages. Currently, just the german page is filled with content. + + * pom.xml: Do not check if there are local changes before writing + buildnumber into MANIFEST. Local changes would stop the build process. + +2010-06-30 Ingo Weinzierl + + * Changes, NEWS, ChangeLog: Summarized changes + +2010-06-30 Ingo Weinzierl + + Issue311 + + * src/main/webapp/scripts/viewport.jsp: Changed OpenLayers MouseDefault + control with a Navigation control which is initially disabled. Users need + to activate the navigation control for panning expicitly before panning. + +2010-06-30 Ingo Weinzierl + + Issue307 + + * src/main/webapp/scripts/viewport.jsp: Added a 'resize' listener for the + browser window. If the browser window is resized, the size of the map + panel is adapted. For example, you have a small browser window at the + beginning and resize it later to its maximal size, the map panel takes all + the place it can get. Currently, just the width is adapted, because outer + div container has a fix height that doesn't change. + +2010-06-29 Tim Englich + + ISSU317 + + * src/main/resources/applicationMessages*.properties: + Added i18n support for the Name of the GNV Web Map Service. + + * src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp: + Added variable capfile to be able to reference the combobox directly. + + * src/main/webapp/WEB-INF/config/reachable-servers.conf: + Added configurationfile to fill the combobox with WMS. + + * src/main/webapp/scripts/olutils.jsp: + Read URL to Capabilities-Document from selected Item in Combobox. + Also switched to singleTile mode for inserted Layers. + + * src/main/webapp/scripts/viewport.jsp: + Switched Inputfile for GetCapabilities URl to an Combobox. + +2010-06-29 Tim Englich + + * src/main/webapp/images/ol/cloud-popup-relative.png: + Added missing Image for the PopupWindow of GetFeatureInforRequests. + +2010-06-28 Tim Englich + + ISSUE308 + + * src/main/webapp/styles/ol_style.css: + Removed unused CSS .title + + * src/main/webapp/images/ol/wvHeaderBG.gif: + Removed unused Image. + +2010-06-28 Tim Englich + + ISSUE311 + + * src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp: + Syncronized size of the headline of fullscreen-mode of the map-client + to the size of the headline of the web-client. + +2010-06-28 Tim Englich + + ISSUE311 + + * src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp: + Syncronized size of the headline of fullscreen-mode of the map-client + to the size of the headline of the web-client. + +2010-06-28 Tim Englich + + ISSUE311 + + * src/main/webapp/images/ol/slider.png: + Added missing Image slider.png using the colors of the BSH. + + * src/main/webapp/styles/ol_style.css: + Added CSS for Zoombox. Modified CSS for Mouseposition. The background now + is gray with opacity 0.75 + + * src/main/webapp/scripts/viewport.jsp: + Switched order of Controls to tree, legend, add layers. + +2010-06-28 Tim Englich + + ISSUE 306 + + * src/main/webapp/scripts/viewport.jsp: + Removed ScaleLine from Viewport + +2010-06-28 Tim Englich + + ISSUE 305 + + * src/main/webapp/scripts/viewport.jsp: + Removed store.load() because calling this function without a given + url to a capabilities-file will cause that the complete page, where the + Web-Client is placed in, will be loaded using the proxy without the post- + Parameter. + +2010-06-28 Tim Englich + + ISSUE 305 + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties, + src/main/webapp/WEB-INF/jsp/includes/display_wms_basic_informations.jsp: + Removed duplicate Information about Layernames / Layertitle from GUI. + Also removed unused resources. + +2010-06-25 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/util/XSLTransformer.java, + src/main/webapp/styles/gnv.css, + src/main/webapp/WEB-INF/config/struts-config.xml, + src/main/webapp/WEB-INF/config/templates/describe-ui.xsl, + src/main/webapp/WEB-INF/jsp/index.jsp: Removed the changes of rev1214 and + rev1206. + +2010-06-15 Tim Englich + + * src/main/webapp/WEB-INF/jsp/wmsstandalone.jsp, + src/main/webapp/WEB-INF/jsp/version.jsp, + src/main/webapp/WEB-INF/jsp/info.jsp, + src/main/webapp/WEB-INF/jsp/imprint.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp: + Fixed some more XHTML-Mistakes. + +2010-06-15 Tim Englich + + * src/main/webapp/scripts/olutils.js: + Removed file which was commited in r1202 by mistake + +2010-06-15 Tim Englich + + ISSUE 278: Again: Because something was wrong with r1202. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Prevent NPE if the Mapviewer has delivered no Geometry. + +2010-06-15 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Render direct links as list. + +2010-06-14 Ingo Weinzierl + + * pom.xml: The svn revision number is written to MANIFEST.MF while creating + war archive. + +2010-06-10 Sascha L. Teichmann + + Issue 219 + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java: + Broke over long line. + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Fed + more parameters into XSL transformation to allow better form rendering. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: + use explicit boolean to indicate that we are still able to advance. + + * src/main/java/de/intevation/gnv/util/XSLTransformer.java: Removed + stupid initial size of hash map. + + * src/main/webapp/styles/gnv.css: Added style to render direct + links to look like buttons. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added a few + forwards. The log is full of unresolvable forwards. TODO: This + needs to be checked and is not a problem introduced by direct + link feature. + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Render + the direct links if there are less than six item in a single + select list. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Cleanup a bit. Removed + form rendering here and moved it into the dynamic XSL transformation. + +2010-06-11 Tim Englich + + Issue278 + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Prevent NPE if the Mapviewer has delivered no Geometry. + + +2010-06-11 Tim Englich + + Customize Look and Feel to styleguide of the bsh. + + * src/main/webapp/scripts/viewport.jsp: + Link OpenLayers image-folder to images/ol to get the navigation-bar in + a customize look and feel. + + * src/main/webapp/styles/ol_style.css: + Added missing styles of Openlayer that must be overriden. + + * src/main/webapp/images/ol/east-mini.png, + src/main/webapp/images/ol/feature_info_off.png, + src/main/webapp/images/ol/feature_info_on.png, + src/main/webapp/images/ol/folder-open.gif, + src/main/webapp/images/ol/folder.gif, + src/main/webapp/images/ol/leaf.gif, + src/main/webapp/images/ol/navigation_history.png, + src/main/webapp/images/ol/north-mini.png, + src/main/webapp/images/ol/pan_off.png, + src/main/webapp/images/ol/pan_on.png, + src/main/webapp/images/ol/south-mini.png, + src/main/webapp/images/ol/tool-sprites.gif, + src/main/webapp/images/ol/west-mini.png, + src/main/webapp/images/ol/wvHeaderBG.gif, + src/main/webapp/images/ol/zoom_box_off.png, + src/main/webapp/images/ol/zoom_box_on.png, + src/main/webapp/images/ol/zoom-minus-mini.png, + src/main/webapp/images/ol/zoom-plus-mini.png, + src/main/webapp/images/ol/zoom-world-mini.png, + src/main/webapp/images/ol/zoombar.png: + Added missing icons and put an blue-filter to all icons. + +2010-06-11 Tim Englich + + * src/main/webapp/images/ol/measure_line_off.png, + src/main/webapp/images/ol/measure_line_on.png, + src/main/webapp/images/ol/measure_polygon_off.png, + src/main/webapp/images/ol/measure_polygon_on.png: + Removed unused Icons. + +2010-06-11 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/util/XSLTransformer.java, + src/main/webapp/styles/gnv.css, + src/main/webapp/WEB-INF/config/struts-config.xml, + src/main/webapp/WEB-INF/config/templates/describe-ui.xsl, + src/main/webapp/WEB-INF/jsp/index.jsp: Reverted the changes of rev1194 - + the feature implemented in rev1194 has not been finished so far. + +2010-06-11 Tim Englich + + * src/main/webapp/scripts/viewport.jsp, + src/main/webapp/scripts/olutils.jsp: + Modified output of the GetfeatureInfo-request. + All attributes of each feature which was returned by the request will be + put in one separte Table. + +2010-06-11 Tim Englich + + * src/main/resources/applicationMessages*.properties: + Added localized message if no layer were created. + +2010-06-11 Tim Englich + + * src/main/webapp/scripts/layers.jsp: + Bugfix: All Layer will only use one single Tile for displaying it. + +2010-06-11 Tim Englich + + Added the informations about how the WMS which was published during the + Workflow to the GUI. The URL to the capablities-documenet, the names of + the layer and the ttl will be listed. + + * src/main/java/de/intevation/gnv/action/WMSAction.java (execute): + Write the TTL to the Mapservice which is published. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java: + Added Getter for the Attribute TTL. Which shows how long the Layer of this + Service will be available. + + * src/main/webapp/WEB-INF/jsp/includes/display_wms_basic_informations.jsp: + Added new JSP-File for publishing the Basic-Informations of the WMS. + The URL which will deliver the Capablities is shown. + Also the Names of the Layers are listed. + At least the Time untiöl teh Layers are available is displayed. + + * src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp: + Included Informationblock for the WMS which was produced in the workflow + before and now is published in the map. + +2010-06-10 Sascha L. Teichmann + + Issue 219 + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java: + Broke over long line. + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Fed + more parameters into XSL transformation to allow better form rendering. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: + use explicit boolean to indicate that we are still able to advance. + + * src/main/java/de/intevation/gnv/util/XSLTransformer.java: Removed + stupid initial size of hash map. + + * src/main/webapp/styles/gnv.css: Added style to render direct + links to look like buttons. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added a few + forwards. The log is full of unresolvable forwards. TODO: This + needs to be checked and is not a problem introduced by direct + link feature. + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Render + the direct links if there are less than six item in a single + select list. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Cleanup a bit. Removed + form rendering here and moved it into the dynamic XSL transformation. + +2010-06-10 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Removed some + code for testing that have been commited by mistaken. + +2010-06-10 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java: + New methods for session validation. Method isSessionExhausted(.) returns + true, if the session of the user is new. Another medhod returns the + ActionForward for selecting a fis - which is the start point of our + application. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java, + src/main/java/de/intevation/gnv/action/DoExportAction.java, + src/main/java/de/intevation/gnv/action/SwitchLanguageAction.java, + src/main/java/de/intevation/gnv/action/WMSAction.java, + src/main/java/de/intevation/gnv/action/ShowStatisticAction.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java, + src/main/java/de/intevation/gnv/action/LoadAction.java, + src/main/java/de/intevation/gnv/action/CreateHistogramAction.java, + src/main/java/de/intevation/gnv/action/DoOutputAction.java, + src/main/java/de/intevation/gnv/action/CreateChartAction.java, + src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/StoreAction.java: Validate the + session before doing some other stuff. If the session is exhausted, we + will return to the start point - the fis selection. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Renders an error message if the + session of the user is exhausted. There will be no link to return to the + last point in the parameterization. + + * src/main/java/de/intevation/gnv/action/CommunicationKeys.java: A new key + for session errors. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: An error message for + a session that timed out. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added a new forward to + the export action that makes it possible to step back to the fis + selection. + +2010-06-10 Ingo Weinzierl + + Issue177 - Messages for Java heap size errors. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added an error + message for Java heap size errors. + +2010-06-08 Tim Englich + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: + Added localization for the message that will be displayed if no + layer where found. + + * src/main/webapp/scripts/olutils.jsp: + Improved the workflow for inserting new layer into the client. + If no layer are found using the given url an exceptionmessage will be + displayed using an ext-window. + Now it is also possible to add more than one layer at once. + +2010-06-08 Tim Englich + + * src/main/webapp/scripts/layers.jsp: + Switched from Untiled Layer to standard layer objects to fix a bug + in the drag and drop function of the layertree and to enable the output + of the LegendGraphicPanel. + +2010-06-08 Tim Englich + + * src/main/webapp/scripts/olutils.jsp: + Rename olutils.js to olutils.jsp to enable possibility of i18n in this file. + Added references to resources in in Method addLayer. + + * src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp: + Replace linkt to olutils.js to olutils.jsp. + + +2010-06-08 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp: + Added reference to the new css-file extjs-override.css + + * src/main/webapp/images/folder-open.gif, + src/main/webapp/images/folder.gif, + src/main/webapp/images/leaf.gif, + src/main/webapp/images/tool-sprites.gif, + src/main/webapp/styles/extjs-override.css: + Customize Look and Feel to the css of this project. + +2010-06-08 Tim Englich + + * src/main/webapp/styles/ol_style.css: + Switch color of coordinate display of mousposition and scalebar from + black to white. + +2010-06-07 Tim Englich + + * src/main/webapp/scripts/viewport.jsp: + Put the bboxx from the mapservice-object and write it to an + javascript-variable. This variable will be used to center the map to + the extend of the data which should be visualized. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java (getBBoxValue), + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java (getBBoxValue): + Added a method for getting the bbox as a string from the mapservice-object. + + * src/main/java/de/intevation/gnv/action/WMSAction.java (execute): + Read the bbox from the retrieved meta-document and out it into the + mapservice-object which is used to represent the WMS in the client. + +2010-06-07 Tim Englich + + * src/main/webapp/scripts/viewport.jsp: + Switch the URl for the GetFeatureInfor Control to the URL of the WMS which + provide the generated Data of the GNV. + Also switch the Format of the Responsdata of the GetFeatureInfor-request to + GML. + +2010-06-07 Tim Englich + + * src/main/webapp/WEB-INF/config/struts-config.xml: + Added the Action "mapclient" for switching to the FullScreen-Mode of the + MapClient. + + * src/main/webapp/scripts/viewport.jsp: + Integrated the Viewport to render tne Mapclient in FullScreen-Mode. + + * src/main/java/de/intevation/gnv/action/MapClientStandaloneAction.java : + Added Action for handling the businesslogic to switch the Mapclient to the + FullScreen-Mode. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: + Added i18n for the Link-labeling for switching to the FullScreen-Mode. + + * src/main/webapp/WEB-INF/jsp/wmsstandalone.jsp: + Added JSP-Page wich will be used to render the gui for the + FullScreen-Mode of the Mapclient. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp, + src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp: + Extracted header for the html-page whcih will contain the mapclient so + that it could be used in several pages. + + * src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp: + Added JSP-Fragment which contains the gui for the FullScreen-Mode of the + Mapclient. + + * src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp: + Added link for switching to the fullscreenmode + +2010-06-04 Tim Englich + + * src/main/resources/applicationMessages.properties: + Replaced incompatible Umlauts + +2010-06-04 Tim Englich + + + * src/main/webapp/scripts/viewport.jsp, + src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: + Added i18n support to the mapclient. + +2010-06-04 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp, + /src/main/webapp/scripts/olutils.js: + Fixed bug that the "Add Layer"-Button was not correctly displayed if a + new WMS-Capabilities-Document was loaded. + Also improved the GUI that it is now Possible to load a WMS with a lot of + layer which could not be displayed in the GUI without uisng a scrollbar. + +2010-06-04 Ingo Weinzierl + + Issue275 + + * src/main/webapp/WEB-INF/jsp/index.jsp, + src/main/webapp/WEB-INF/jsp/header.jsp, + src/main/webapp/WEB-INF/jsp/footer.jsp, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Removed (X)HTML + errors/warnings. + +2010-06-04 Ingo Weinzierl + + Issue293 + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added strings for + refresh-button tooltip and png export-button. + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp: + Changed and added some tooltips. + +2010-06-01 Tim Englich + + + Checkin of changes which are necessary for the checkin of Revision 1139. + + * src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java (selectArtifactFactory), + src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java (selectedArtifactFactory): + Added functions for getting and setting a Mapservice to the SessionModel. + + * src/main/java/de/intevation/gnv/action/WMSAction.java : + Integrated the possibility to read all Layes from Metafile. + +2010-06-01 Tim Englich + + Providing functionality to read an WMS-Capabilities-Documnet and list all + layers which are include. This is the first step to provide the requested + function to integrate external WMS-Layers. + + To read the XML-Documents it is required to integrate the proxy.cgi script + into the Apache Webserver. for this you have to copy the proxy.cgi script + to /usr/lib/cgi-bin. + + You might have to change the allowedHosts in this script. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: + Integrated link to JavaScript-file olutils.js + + * /src/main/webapp/scripts/olutils.js: + Integrate Utilities-javaScript-fiel from Demonstrator to provide + JavaScript-Functions for handling WMS-Capabilities-Requests. + * src/main/webapp/scripts/viewport.jsp: + Integrated JavaScript-Elements for WMS-Capabilities Request. + + * src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp: + Integrated HTML-Elements for the WMS-Capabilities Request. + +2010-06-01 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + Implemented a N-step back history. There is a back-button besides every + parameter in the static ui part now. + +2010-06-01 Tim Englich + + * src/main/webapp/scripts/viewport.jsp: + Removed som obsolet Code. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: + Added reference to the new css-file. + + * src/main/webapp/images/ol/*.png: + Added Icons for an customized Toolbar. + + * src/main/webapp/styles/ol_style.css: + Added separat CSS-File for create own Style of the Buttons of the + OL-Buttonbar. + +2010-06-01 Tim Englich + + * src/main/webapp/scripts/openlayers, + src/main/webapp/scripts/geoext/, + src/main/webapp/scripts/ext/: + Added subfolders of third party libraries to svn-ignore. + +2010-06-01 Tim Englich + + Integrated the Openlayers-libraray according to the Intevation-Demonstrator + into the GUI. Now it is also possible to see all layers which are put into + the WMS by the user. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: + Removed the old JavaScript-references to the OpenLayers-Library and + put the references to the JavaScript-Files and CSS-files for + OpenLayers, ext and geoext into it. + + * src/main/webapp/WEB-INF/jsp/index.jsp: + Removed the html-elements which are required to render the MapClient and + put them into the file includes/display_map_inc.jsp. + + * src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp: + Added own include-file for all html-elements which are required to render + the Mapclient. + + * src/main/webapp/scripts/viewport.jsp: + Added a JSP-file which creats an JavaScript-file which includes the + informations how to create the GUI of the WMS-Client.A JSP-file is required + because we have to insert dynamic usespecific Data into the file. + + * src/main/webapp/scripts/layers.jsp: + Added a JSP-file which creats an JavaScript-file which includes all + layers which should be displayed by OpenLayers. A JSP-file is required + because we have to insert dynamic usespecific Data into the file. + + * src/main/webapp/scripts/openlayers: + Folder for storing the JavaScript-Library Openlayers. + * src/main/webapp/scripts/openlayers/readme: + Readme-File which explains which steps must be done to provide the + required Version of the Openlayers-Library. + + * src/main/webapp/scripts/geoext/: + Folder for storing the JavaScript-Library geoext. + * src/main/webapp/scripts/geoext/readme: + Readme-File which explains which steps must be done to provide the + required Version of the GeoExt-Library. + + * src/main/webapp/scripts/ext/: + Folder for storing the JavaScript-Library Ext. + * src/main/webapp/scripts/ext/readme: + Readme-File which explains which steps must be done to provide the + required Version of the Ext-Library. + + +2010-05-27 Ingo Weinzierl + + Issue198 + + * src/main/java/de/intevation/gnv/action/WMSAction.java: Changed the XPath + of the layer name and the time to live. Rev1134 introduced a title for wms + layers - the title has been used before to specify a wms layer. The time + to live moved from layer node to abstract meta information. + + NOTE: Just the first layer of a wms request is visible in the OL + application currently, because there is no group-layer anymore. + +2010-05-27 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/includes/display_wms_options_inc.jsp: Make use + of the new method of DiagrammOptions to retrieve the value of an option as + string that have been introduced in rev1129. + +2010-05-27 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/header.jsp: Don't use the old session id when + restarting the application - start the application without old id. + +2010-05-26 Ingo Weinzierl + + Issue289 + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Store + chart/histogram options inserted by the user in the SessionModel. In the + case of a wrong input we are able to reuse the previous value. Options + inserted by the user are stored as native objects - no longer as string. + + * src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java: + Store options as Object instead of String to keep the information about + the type of the option (string, integer, double, etc). Furthermore there + is a new method getValue(String key, Locale locale) that returns the value + as string. Double values are formatted using the locale object. This + method is used in the gui to display a well formatted i18n string. + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp: + Make use of the new method in DiagrammOptions to retrieve the value as + formatted string. + +2010-05-25 Ingo Weinzierl + + Issue272 + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Read strings + for example linestring/polygon from resource bundle and put them into the + XSL-transformator. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added labels for + links to insert example linestring/polygon. + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Don't use static + strings for example linestring/polygon links but use the parameter that + have been added in DescribeUIAction - which are i18n. + +2010-05-25 Ingo Weinzierl + + Issue266 + + * src/main/java/de/intevation/gnv/action/SwitchLanguageAction.java: + Switching the language in the initial state will not throw an exception + anymore, but the language is toggled. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java (getValue), + src/main/java/de/intevation/gnv/util/XMLUtils.java (getXPath): + Fixed some warnings which are displaied during the javadoc-generation. + +namespaceContext + + * src/main/java/de/intevation/gnv/action/StoreAction.java, + src/main/java/de/intevation/gnv/action/ShowStatisticAction.java, + src/main/java/de/intevation/gnv/action/SelectFisAction.java, + src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java, + src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/LoadAction.java, + src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java, + src/main/java/de/intevation/gnv/action/CreateHistogramAction.java, + src/main/java/de/intevation/gnv/action/CreateChartAction.java, + src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java: + Added more Javadocs. Did some Codeformatting. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/util/XSLTransformer.java: + * src/main/java/de/intevation/gnv/util/XMLUtils.java: + * src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java: + Added more Javadocs. Did some Codeformatting. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java, + src/main/java/de/intevation/gnv/servlet/package.html: + Added more Javadocs. Did some Codeformatting. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/propertiesreader/package.html, + src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java, + src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java: + Added more Javadocs. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java: + Added more Javadocs. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java: + Added more Javadocs. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (doAdvance): + Added more Javadoc. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/package.html: + Added more Javadoc. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/action/sessionmodel/package.html: + Removed duplicate documentation from file. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/action/sessionmodel/package.html, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java: + Added more Javadocs. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/action/mapviewer/parser/package.html, + src/main/java/de/intevation/gnv/action/mapviewer/parser/XMLExternalCallParser.java, + src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserException.java, + src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParser.java: + Added more Javadocs. Format some Linees of code which are longer than 80 Chars. + +2010-05-17 Tim Englich + + * src/main/java/de/intevation/gnv/action/mapviewer/package.html, + src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java, + src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java: + Added more Javadocs. + +2010-05-09 Sascha L. Teichmann + + * src/main/webapp/styles/calendar-blue.css: Deleted. Not needed any more. + +2010-05-05 Ingo Weinzierl + + * src/main/webapp/WEB-INF/web.xml: Removed useless log4j configuration + section. + + * src/main/webapp/WEB-INF/classes/log4j.properties: Adapted logging + configuration for a productive system. + 2010-04-28 Ingo Weinzierl + RELEASE 1.0 + * Changes, NEWS, ChangeLog: Summarized changes. 2010-04-28 Ingo Weinzierl diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/Changes --- a/gnv/Changes Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/Changes Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,22 @@ +2010-06-30 RELEASE 1.1 + + NEW: + + * Integrated an enhanced map client for working with gnv internal and + external wms layers + * N-Step back history for parameterization + * Added JavaDoc + + FIXES: + + * Input validation corresponding the current locale (#289) + * Fixed broken XPathes while wms publishing + * Removed duplicated layernames from gui (#305) + * Missing i18n for gui elements (#227, #272, #297, #177) + * Typos (#293) + + + 2010-04-28 RELEASE 1.0 NEW: diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/LGPL.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/LGPL.txt Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/NEWS --- a/gnv/NEWS Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/NEWS Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,12 @@ +2010-06-30 RELEASE 1.1 + + * Integrated an enhanced map client for working with gnv internal and + external wms layers + + * N-Step back history for parameterization + + + 2010-04-28 RELEASE 1.0 NEW: diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/pom.xml --- a/gnv/pom.xml Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/pom.xml Fri Sep 28 12:15:22 2012 +0200 @@ -7,6 +7,11 @@ 1.0-SNAPSHOT gnv http://maven.apache.org + + scm:svn:svn+ssh://${user}@thoe.intevation.de/home/projects/Geospatial/bsh-generischer-viewer/Material/SVN/gnv + scm:svn:svn+ssh://${user}@thoe.intevation.de/home/projects/Geospatial/bsh-generischer-viewer/Material/SVN/gnv + scm:svn:svn+ssh://${user}@thoe.intevation.de/home/projects/Geospatial/bsh-generischer-viewer/Material/SVN/gnv + UTF-8 @@ -30,14 +35,14 @@ test - org.restlet + org.restlet.jse org.restlet - 2.0-SNAPSHOT + 2.0.4 - org.restlet + org.restlet.jse org.restlet.ext.xml - 2.0-SNAPSHOT + 2.0.4 tomcat @@ -85,6 +90,14 @@ + + + true + + + ${buildNumber} + + @@ -126,32 +139,21 @@ - org.codehaus.mojo - buildnumber-maven-plugin - 1.0-beta-2 - - - initialize - - create - - - - - false - false - {0, date, yyyy-MM-dd HH:mm:ss} - {0,date,yyyy-MM-dd HH:mm:ss} - - timestamp - - - no_revision - - - - - + org.codehaus.mojo + buildnumber-maven-plugin + + + validate + + create + + + + + false + false + + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java --- a/gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,22 +1,41 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; import org.apache.log4j.Logger; - import org.apache.struts.action.Action; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; /** + * Basicimplemantation for all Actions which should serv request for + * the GNV. * @author Tim Englich * */ public class ArtifactDatabaseActionBase extends Action { + /** + * The id of the action which should used if the execution + * of the action was successful. + */ protected final static String SUCCSESS_FORWARD_ID = "success"; + + /** + * The id of the action which should be used if an exception has occurred + * during the execution. + */ protected final static String EXCEPTION_FORWARD_ID = "success"; /** @@ -32,25 +51,31 @@ super(); } - @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { log.debug("ArtifactDatabaseActionBase.execute"); - ActionForward forward = mapping.findForward(SUCCSESS_FORWARD_ID); return forward; } - + /** + * Returns the Action that should be used if an exception has occurred. + * @param mapping the mapping which holds all available Actions + * @return the Action that should be used. + */ protected ActionForward getExceptionForward(ActionMapping mapping) { log.debug("ArtifactDatabaseActionBase.getExceptionForward"); ActionForward lForward = mapping.findForward(EXCEPTION_FORWARD_ID); return lForward; } - + /** + * Encodes the String to prevent cross-site-scripting + * @param s the string that should be encoded + * @return the encoded string + */ protected String encode(String s) { log.debug("String to encode: " + s); s = s.replaceAll("<", "<"); @@ -62,7 +87,11 @@ return s; } - + /** + * Encodes the StringArray to prevent cross-site-scripting + * @param s the stringarray that should be encoded + * @return the encoded stringarray + */ protected String[] encode(String[] s) { if (s == null) return null; @@ -74,5 +103,27 @@ return good; } + + + protected boolean isSessionExhausted(HttpServletRequest request) { + HttpSession session = request.getSession(); + return session.isNew(); + } + + + protected ActionForward sessionExhaustedForward( + ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) + throws Exception + { + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_SESSION_ID, + "SessionTimeout has occured"); + + log.warn("Session timed out."); + + return new FetchArtifactFactoriesAction().execute( + mapping, form, request, response); + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action; import de.intevation.gnv.action.sessionmodel.DiagrammOptions; @@ -48,6 +56,10 @@ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + log.debug("NextArtifactStepAction.execute"); try { SessionModel sm = SessionModelFactory.getInstance() @@ -55,19 +67,23 @@ ArtifactDescription ad = sm.getArtifactDescription(); - String target = request.getParameter("target"); + String target = request.getParameter("target"); OutputMode outputMode = sm.getOutputMode(target); + Locale locale = sm.getCurrentLocale(); + if (outputMode != null) { - Collection op = outputMode .getOutputParameters(); if (op != null) { Iterator it = op.iterator(); + DiagrammOptions oldOptions = sm.getDiagrammOptions(); DiagrammOptions diagrammOptions = new DiagrammOptions(); while (it.hasNext()) { OutputParameter parameter = it.next(); String name = parameter.getName(); - String old = parameter.getValue(); + Object old = oldOptions != null + ? oldOptions.getValue(name) + : parameter.getValue(); String value = request.getParameter(name); String type = parameter.getType(); @@ -108,10 +124,14 @@ } } else if (type.equalsIgnoreCase("double")) { - if (validDouble(request.getLocale(), value)) { - diagrammOptions.setValue(name, value); + try { + double val = parseDoubleValue(locale, value); + String valStr = Double.toString(val); + log.debug("Change diagram options [" + + name +"] to " + val); + diagrammOptions.setValue(name, val); } - else { + catch (ParseException pe) { log.warn("Text is not a valid double: "+value); diagrammOptions.setValue(name, old); @@ -178,19 +198,14 @@ } } - protected boolean validDouble(Locale locale, String value) { - try { - NumberFormat format = NumberFormat.getInstance(locale); - Number number = format.parse(value); + protected double parseDoubleValue(Locale locale, String value) + throws ParseException + { + log.error("LOCALE FOR DOUBLE PARSING: " + locale.toString()); + NumberFormat format = NumberFormat.getNumberInstance(locale); + Number number = format.parse(value); - if (number.doubleValue() < 0) - return false; - - return (number instanceof Double) || validInteger(locale, value); - } - catch (ParseException pe) { - return false; - } + return number.doubleValue(); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/CommunicationKeys.java --- a/gnv/src/main/java/de/intevation/gnv/action/CommunicationKeys.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/CommunicationKeys.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action; /** @@ -12,6 +20,9 @@ */ public final static String REQUEST_EXCEPTION_MESSAGE_ID = "request_exception_message_id"; + + public final static String REQUEST_EXCEPTION_SESSION_ID = "request_exception_session_id"; + /** * Key used to store exceptions relating to wrong user input. */ diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/CreateChartAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/CreateChartAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/CreateChartAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,17 +1,24 @@ -package de.intevation.gnv.action; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.gnv.action.sessionmodel.SessionModel; -import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +package de.intevation.gnv.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + /** * This controller is called to display charts.
* An attribute 'chart' on the request object is activated which inserts an @@ -21,9 +28,15 @@ */ public class CreateChartAction extends DescribeUIAction { + /** + * the logger, used to log exceptions and additonaly information + */ private static Logger logger = Logger.getLogger(CreateChartAction.class); + /** + * Constructor + */ public CreateChartAction() { super(); } @@ -36,6 +49,10 @@ HttpServletRequest request, HttpServletResponse response) throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + logger.debug("Create chart."); SessionModel sm = SessionModelFactory.getInstance().getSessionModel( diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/CreateHistogramAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/CreateHistogramAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/CreateHistogramAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,17 +1,24 @@ -package de.intevation.gnv.action; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.gnv.action.sessionmodel.SessionModel; -import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +package de.intevation.gnv.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + /** * This controller is called to display histograms.
* An attribute 'histogram' on the request object is activated which inserts an @@ -21,9 +28,15 @@ */ public class CreateHistogramAction extends DescribeUIAction { + /** + * the logger, used to log exceptions and additonaly information + */ private static Logger logger = Logger.getLogger(CreateHistogramAction.class); + /** + * Constructor + */ public CreateHistogramAction() { super(); } @@ -36,6 +49,10 @@ HttpServletRequest request, HttpServletResponse response) throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + logger.debug("Create histogram."); SessionModel sm = SessionModelFactory.getInstance().getSessionModel( diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,35 +1,37 @@ -package de.intevation.gnv.action; - -import de.intevation.gnv.action.sessionmodel.SessionModel; -import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; - -import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; -import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; - -import de.intevation.gnv.util.ArtifactNamespaceContext; -import de.intevation.gnv.util.XMLUtils; -import de.intevation.gnv.util.XSLTransformer; +package de.intevation.gnv.action; import java.util.Locale; import java.util.ResourceBundle; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; - +import javax.servlet.http.HttpSession; import javax.xml.xpath.XPathConstants; import org.apache.log4j.Logger; - import org.apache.struts.Globals; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import org.w3c.dom.Node; -import org.w3c.dom.Node; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.util.ArtifactNamespaceContext; +import de.intevation.gnv.util.XMLUtils; +import de.intevation.gnv.util.XSLTransformer; /** * This controller is called to fetch the current artifact description using the @@ -51,9 +53,15 @@ public static final String XSL_SHEET_STATIC = "WEB-INF/config/templates/describe-ui-static.xsl"; + /** + * the logger, used to log exceptions and additonaly information + */ private static Logger logger = Logger.getLogger(DescribeUIAction.class); + /** + * Constructor + */ public DescribeUIAction() { super(); } @@ -67,6 +75,11 @@ HttpServletResponse response ) throws Exception { + if (isSessionExhausted(request)) { + // session timed out before + return sessionExhaustedForward(mapping, form, request, response); + } + logger.info("describe user interface"); try { // render describe document and create user interface @@ -99,7 +112,12 @@ if (currentUI != null) { ResourceBundle res = ResourceBundle.getBundle( "applicationMessages", locale); - String editText = res.getString("gnviewer.history.back.button"); + String editText = res.getString( + "gnviewer.history.back.button"); + String exampleLinestring = res.getString( + "gnviewer.example.linestring"); + String examplePolygon = res.getString( + "gnviewer.example.polygon"); XSLTransformer transformer = new XSLTransformer(); @@ -107,6 +125,10 @@ mapping.findForward("back").getPath()); transformer.addParameter("back-url", url); transformer.addParameter("edit", editText); + transformer.addParameter("example-polygon", examplePolygon); + transformer.addParameter( + "example-linestring", + exampleLinestring); String fisUrl = response.encodeURL( mapping.findForward("selectfis").getPath()); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action; import de.intevation.gnv.action.sessionmodel.SessionModel; @@ -56,6 +64,10 @@ HttpServletResponse response) throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + try { String target = request.getParameter("target"); String mimeType = request.getParameter("mimetype"); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/DoOutputAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/DoOutputAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoOutputAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action; import de.intevation.gnv.action.sessionmodel.SessionModel; @@ -52,6 +60,10 @@ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + log.debug("DoOutputAction.execute"); try { String target = request.getParameter("target"); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,13 +1,12 @@ -package de.intevation.gnv.action; - -import de.intevation.gnv.action.sessionmodel.SessionModel; -import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; - -import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; - -import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +package de.intevation.gnv.action; import java.util.Collection; @@ -15,11 +14,16 @@ import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; + /** * This controller fetches artifact factories from artifact server and stores * them on a SessionModel object. @@ -28,12 +32,16 @@ * @author Ingo Weinzierl */ public class FetchArtifactFactoriesAction extends ArtifactDatabaseActionBase { + /** * the logger, used to log exceptions and additonaly information */ private static Logger log = Logger .getLogger(FetchArtifactFactoriesAction.class); + /** + * Constructor + */ public FetchArtifactFactoriesAction() { super(); } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/LoadAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/LoadAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/LoadAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,22 +1,15 @@ -package de.intevation.gnv.action; - -import de.intevation.gnv.action.sessionmodel.SessionModel; -import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; - -import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; - -import de.intevation.gnv.artifactdatabase.objects.Artifact; -import de.intevation.gnv.artifactdatabase.objects.ArtifactFactory; - -import de.intevation.gnv.util.ArtifactNamespaceContext; -import de.intevation.gnv.util.XMLUtils; +package de.intevation.gnv.action; import java.io.IOException; import java.io.InputStream; - import java.util.List; import javax.servlet.http.HttpServletRequest; @@ -24,16 +17,22 @@ import org.apache.commons.fileupload.FileItemIterator; import org.apache.commons.fileupload.FileItemStream; - import org.apache.commons.fileupload.servlet.ServletFileUpload; - import org.apache.log4j.Logger; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import org.w3c.dom.Document; -import org.w3c.dom.Document; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; +import de.intevation.gnv.artifactdatabase.objects.Artifact; +import de.intevation.gnv.artifactdatabase.objects.ArtifactFactory; +import de.intevation.gnv.util.ArtifactNamespaceContext; +import de.intevation.gnv.util.XMLUtils; /** * This controller is called for reloading projects from xml files. It waits for @@ -48,12 +47,19 @@ public static final String RESOURCE_UPLOAD_FAILURE = "upload.failure"; public static final String RESOURCE_INVALID_ARTIFACT = "invalid.artifact"; + /** + * the logger, used to log exceptions and additonaly information + */ private static Logger logger = Logger.getLogger(LoadAction.class); + /** + * Constructor + */ public LoadAction() { super(); } + @Override public ActionForward execute( ActionMapping mapping, ActionForm form, @@ -61,6 +67,10 @@ HttpServletResponse response) throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + logger.info("Import artifact."); ServletFileUpload upload = new ServletFileUpload(); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/MapClientStandaloneAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/MapClientStandaloneAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +/** + * + */ +package de.intevation.gnv.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +/** + * @author Tim Englich + * + */ +public class MapClientStandaloneAction extends ArtifactDatabaseActionBase { + + public final static String MAPCLIENTSTANDALONE_KEY = + "de.intevation.gnv.action.MapClientStandaloneAction"; + /** + * Constructor + */ + public MapClientStandaloneAction() { + super(); + } + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + + request.setAttribute(MAPCLIENTSTANDALONE_KEY, true); + return super.execute(mapping, form, request, response); + } + + +} diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,16 +1,12 @@ -package de.intevation.gnv.action; - -import de.intevation.gnv.action.sessionmodel.SessionModel; -import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; - -import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseInputException; - -import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; -import de.intevation.gnv.artifactdatabase.objects.DefaultInputParameter; -import de.intevation.gnv.artifactdatabase.objects.InputParameter; +package de.intevation.gnv.action; import java.util.ArrayList; import java.util.Collection; @@ -22,11 +18,19 @@ import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseInputException; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.DefaultInputParameter; +import de.intevation.gnv.artifactdatabase.objects.InputParameter; + /** * This controller feeds the artifact server with the current input data and * refreshes the gui with the current artifact description after the next state @@ -50,12 +54,6 @@ super(); } - /** - * @see de.intevation.gnv.action.ArtifactDatabaseActionBase#execute(org.apache.struts.action.ActionMapping, - * org.apache.struts.action.ActionForm, - * javax.servlet.http.HttpServletRequest, - * javax.servlet.http.HttpServletResponse) - */ @Override public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, @@ -137,8 +135,6 @@ } catch (ArtifactDatabaseInputException e) { - log.debug("================ CATCH ME ======================"); - log.debug("===== ERROR MSG: " + e.getMessage()); log.error(e, e); request.setAttribute( CommunicationKeys.REQUEST_EXCEPTION_INPUT_ID, @@ -155,9 +151,7 @@ } }else{ log.warn("SessionTimeout has occured"); - request.setAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, - "SessionTimeout has occured"); - new FetchArtifactFactoriesAction().execute(mapping, form, request, response); + return sessionExhaustedForward(mapping, form, request, response); } return super.execute(mapping, form, request, response); } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,23 +1,28 @@ -package de.intevation.gnv.action; - -import de.intevation.gnv.action.sessionmodel.SessionModel; -import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; - -import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; -import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +package de.intevation.gnv.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; + /** * This controller is used to step back to a previous state of the current * artifact. After calling the advance operation of the artifact server have @@ -31,10 +36,16 @@ public static final String URL_STATE_KEY = "target"; + /** + * the logger, used to log exceptions and additonaly information + */ private static Logger logger = Logger.getLogger(PreviousArtifactStepAction.class); + /** + * Constructor + */ public PreviousArtifactStepAction() { super(); } @@ -55,12 +66,10 @@ if (ad == null) { logger.warn("Session timed out."); request.setAttribute( - CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + CommunicationKeys.REQUEST_EXCEPTION_SESSION_ID, "SessionTimeout has occured"); - new FetchArtifactFactoriesAction().execute( + return new FetchArtifactFactoriesAction().execute( mapping, form, request, response); - - return super.execute(mapping, form, request, response); } // TODO check if target is reachable diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,12 +1,12 @@ -package de.intevation.gnv.action; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.gnv.action.sessionmodel.SessionModel; -import de.intevation.gnv.action.sessionmodel.SessionModelFactory; - -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; - -import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +package de.intevation.gnv.action; import java.util.Collection; @@ -14,23 +14,35 @@ import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; + /** * This controller is called to select a specific fis. * * @author Tim Englich */ public class SelectArtifactFactoryAction extends DescribeUIAction { + /** * the logger, used to log exceptions and additonaly information */ private static Logger log = Logger .getLogger(SelectArtifactFactoryAction.class); + /** + * Constructor + */ + public SelectArtifactFactoryAction() { + super(); + } @Override public ActionForward execute(ActionMapping mapping, ActionForm form, @@ -72,11 +84,5 @@ return super.getExceptionForward(mapping); } } - - /** - * Constructor - */ - public SelectArtifactFactoryAction() { - } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/SelectFisAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/SelectFisAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/SelectFisAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,17 +1,24 @@ -package de.intevation.gnv.action; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.gnv.action.sessionmodel.SessionModel; -import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +package de.intevation.gnv.action; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + /** * This controller is used to step back to the fis selection. It is called when * pushing the step-back button besides the currently selected fis. @@ -20,6 +27,9 @@ */ public class SelectFisAction extends ArtifactDatabaseActionBase { + /** + * the logger, used to log exceptions and additonaly information + */ private static Logger logger = Logger.getLogger(SelectFisAction.class); @Override diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/ShowStatisticAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/ShowStatisticAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/ShowStatisticAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,12 +1,12 @@ -package de.intevation.gnv.action; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.gnv.action.sessionmodel.SessionModel; -import de.intevation.gnv.action.sessionmodel.SessionModelFactory; - -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; - -import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; +package de.intevation.gnv.action; import java.util.Collection; @@ -14,11 +14,16 @@ import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; + /** * This controller is used to display to statistic of the current * parameterization. @@ -27,9 +32,15 @@ */ public class ShowStatisticAction extends DescribeUIAction { + /** + * the logger, used to log exceptions and additonaly information + */ private static Logger logger = Logger.getLogger(ShowStatisticAction.class); + /** + * Constructor + */ public ShowStatisticAction() { super(); } @@ -43,6 +54,10 @@ HttpServletResponse response ) throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + logger.info("show statistic"); SessionModel sm = SessionModelFactory.getInstance().getSessionModel( request); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/StoreAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/StoreAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/StoreAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,12 +1,12 @@ -package de.intevation.gnv.action; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.gnv.action.sessionmodel.SessionModel; -import de.intevation.gnv.action.sessionmodel.SessionModelFactory; - -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; - -import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +package de.intevation.gnv.action; import java.io.OutputStream; @@ -14,11 +14,16 @@ import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; + /** * This controller is used to save the current artifact to an xml file. A file * dialog is opened to save the file to the local disk. @@ -29,12 +34,19 @@ public static final String RESOURCE_DOWNLOAD_FAILURE = "no.artifact.chosen"; + /** + * the logger, used to log exceptions and additonaly information + */ private static Logger logger = Logger.getLogger(StoreAction.class); + /** + * Constructor + */ public StoreAction() { super(); } + @Override public ActionForward execute( ActionMapping mapping, ActionForm form, @@ -42,6 +54,10 @@ HttpServletResponse response) throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + SessionModelFactory sf = SessionModelFactory.getInstance(); SessionModel sm = sf.getSessionModel(request); @@ -77,7 +93,12 @@ return null; } - + + /** + * Sets the header of the response. + * @param response the response + * @param uuid the uuid of the artifact + */ protected void setHeaders(HttpServletResponse response, String uuid) { String filename = "GNVArtefakt_" + uuid + ".xml"; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/SwitchLanguageAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/SwitchLanguageAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/SwitchLanguageAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,7 +1,16 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action; import de.intevation.gnv.action.sessionmodel.SessionModel; import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; import java.util.Locale; @@ -10,6 +19,7 @@ import org.apache.log4j.Logger; +import org.apache.struts.Globals; import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; @@ -32,10 +42,21 @@ HttpServletResponse response ) throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + SessionModelFactory factory = SessionModelFactory.getInstance(); SessionModel sm = factory.getSessionModel(request); + Locale locale = switchLanguage(sm.getCurrentLocale()); - sm.setCurrentLocale(switchLanguage(sm.getCurrentLocale())); + sm.setCurrentLocale(locale); + ArtifactObject artifactFactory = sm.getSelectedArtifactFactory(); + + if (artifactFactory == null) { + request.getSession().setAttribute(Globals.LOCALE_KEY, locale); + return mapping.findForward(SUCCSESS_FORWARD_ID); + } return super.execute(mapping, form, request, response); } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/WMSAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/WMSAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/WMSAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,22 +1,14 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action; -import de.intevation.gnv.action.sessionmodel.DiagrammOptions; -import de.intevation.gnv.action.sessionmodel.SessionModel; -import de.intevation.gnv.action.sessionmodel.SessionModelFactory; - -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; - -import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; -import de.intevation.gnv.artifactdatabase.objects.DefaultInputParameter; -import de.intevation.gnv.artifactdatabase.objects.InputParameter; -import de.intevation.gnv.artifactdatabase.objects.OutputMode; -import de.intevation.gnv.artifactdatabase.objects.OutputParameter; - -import de.intevation.gnv.util.XMLUtils; - import java.text.DateFormat; - import java.util.ArrayList; import java.util.Collection; import java.util.Date; @@ -26,12 +18,28 @@ import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import org.w3c.dom.Document; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; -import org.w3c.dom.Document; +import de.intevation.gnv.action.sessionmodel.DiagrammOptions; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.DefaultInputParameter; +import de.intevation.gnv.artifactdatabase.objects.InputParameter; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; +import de.intevation.gnv.artifactdatabase.objects.OutputParameter; +import de.intevation.gnv.artifactdatabase.objects.map.DefaultLayer; +import de.intevation.gnv.artifactdatabase.objects.map.DefaultMapService; +import de.intevation.gnv.artifactdatabase.objects.map.Layer; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; +import de.intevation.gnv.util.XMLUtils; /** * This controller is used to publish the results of the current artifact as @@ -50,11 +58,20 @@ public static final String XPATH_MAPSERVER_MAPFILE = "/art:meta/art:mapserver/art:map/text()"; + public static final String XPATH_LAYERNODESET = + "/art:meta/art:layer"; + public static final String XPATH_LAYER_TITLE = - "/art:meta/art:layer/art:title/text()"; + "art:title/text()"; - public static final String XPATH_LAYER_TTL = - "/art:meta/art:layer/art:ttl/text()"; + public static final String XPATH_LAYER_NAME = + "art:name/text()"; + + public static final String XPATH_TTL = + "/art:meta/art:mapserver/art:ttl/text()"; + + public static final String XPATH_BBOX = + "/art:meta/art:mapserver/art:Box/art:coordinates/text()"; /** * the logger, used to log exceptions and additonaly information @@ -72,6 +89,10 @@ public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + logger.debug("WMSAction.execute"); try { SessionModel sm = SessionModelFactory.getInstance().getSessionModel( @@ -119,16 +140,16 @@ // do wms publishing Document meta = adc.publishWMS(artifactfactory,artifact,ips); + + // read the Server-information String mapserverPath = XMLUtils.getStringXPath( meta, XPATH_MAPSERVER_PATH); String mapfilePath = XMLUtils.getStringXPath( meta, XPATH_MAPSERVER_MAPFILE); - String layer = XMLUtils.getStringXPath( - meta, XPATH_LAYER_TITLE); String tmpTTL = XMLUtils.getStringXPath( - meta, XPATH_LAYER_TTL); - layer = layer != null ? layer : artifact.getId(); - + meta, XPATH_TTL); + + String bbox = XMLUtils.getStringXPath(meta, XPATH_BBOX); String ttl = null; if (tmpTTL != null) { DateFormat df = DateFormat.getDateTimeInstance( @@ -151,22 +172,44 @@ if (logger.isDebugEnabled()) { logger.debug("Mapserver path: " + mapserverPath); logger.debug("Mapfile path: " + mapfilePath); - logger.debug("Layer title: " + layer); logger.debug("Layer ttl: " + ttl); } + // read the layer information + + NodeList layerNodes = XMLUtils.getNodeSetXPath(meta, + XPATH_LAYERNODESET); + Collection layers = null; + if (layerNodes != null && layerNodes.getLength() > 0){ + layers = new ArrayList(layerNodes.getLength()); + for (int i = 0 ; i < layerNodes.getLength(); i++){ + Node tmpLayerNode = layerNodes.item(i); + String layerName = XMLUtils.getStringXPath( + tmpLayerNode, XPATH_LAYER_NAME); + String layerTitle = XMLUtils.getStringXPath( + tmpLayerNode, XPATH_LAYER_TITLE); + // TODO: write layerTitle to title and not to id + Layer currentLayer = new DefaultLayer(layerTitle, layerName, + false, null); + layers.add(currentLayer); + } + } + - request.setAttribute("wms", true); - request.setAttribute("mapserver", mapserverPath); - request.setAttribute("mapfile", mapfilePath); - request.setAttribute("layer", layer); - request.setAttribute("ttl", ttl); + + + // TODO PUT MAPFILEPATH AND TTL to MapServiceObject + if (mapserverPath != null && - mapfilePath != null && - layer != null){ + mapfilePath != null) { request.setAttribute("wms_published", Boolean.TRUE); + + MapService mapService = new DefaultMapService("0815", layers, + "UMN", mapserverPath, + bbox,ttl); + sm.setLocalMapService(mapService); return super.execute(mapping, form, request, response); }else{ - return super.getExceptionForward(mapping); + return super.execute(mapping, form, request, response); } } catch (Exception e) { diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,22 +1,16 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action.mapviewer; -import de.intevation.gnv.action.ArtifactDatabaseActionBase; - -import de.intevation.gnv.action.mapviewer.parser.ExternalCallParser; -import de.intevation.gnv.action.mapviewer.parser.XMLExternalCallParser; - -import de.intevation.gnv.action.sessionmodel.SessionModel; -import de.intevation.gnv.action.sessionmodel.SessionModelFactory; - -import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; - -import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; - -import de.intevation.gnv.artifactdatabase.objects.map.MapService; - import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; import java.io.InputStream; - import java.util.ArrayList; import java.util.Collection; import java.util.Iterator; @@ -25,12 +19,27 @@ import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import de.intevation.gnv.action.ArtifactDatabaseActionBase; +import de.intevation.gnv.action.mapviewer.parser.ExternalCallParser; +import de.intevation.gnv.action.mapviewer.parser.XMLExternalCallParser; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; +import de.intevation.gnv.util.CaptureInputStream; + /** + * This class provides the businesslogic for handling an + * MV-GNV-Interface-call. + * This call can be done in two ways. + * First is to put the requestbody into the body of the http-post-request. + * Second to put the requestbody to the parameter "document" of the + * http-post-request. * @author Tim Englich */ public class MapViewerCallAction extends ArtifactDatabaseActionBase { @@ -65,9 +74,20 @@ } if (inputStream != null){ + CaptureInputStream capture = log.isDebugEnabled() + ? new CaptureInputStream(inputStream) + : null; + try { - ExternalCallParser ecp = new XMLExternalCallParser(inputStream); + ExternalCallParser ecp = new XMLExternalCallParser( + capture != null ? capture : inputStream); ecp.parse(); + + // print incoming data to log + if (capture != null) { + log.debug("REQUEST DOCUMENT: " + capture.copyToString()); + } + String geometry = ecp.getGeometry(); String srs = ecp.getSRS(); Collection mapServices = ecp.getMapServices(); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java --- a/gnv/src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,17 +1,26 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action.mapviewer; -import de.intevation.gnv.action.ArtifactDatabaseActionBase; - import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.log4j.Logger; - import org.apache.struts.action.ActionForm; import org.apache.struts.action.ActionForward; import org.apache.struts.action.ActionMapping; +import de.intevation.gnv.action.ArtifactDatabaseActionBase; + /** + * This class provides the businesslogic to show the demo GUI for + * testing the MV-GNV-Interface. * @author Tim Englich */ public class ShowMapViewerCallBodyAction extends ArtifactDatabaseActionBase { diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/mapviewer/package.html --- a/gnv/src/main/java/de/intevation/gnv/action/mapviewer/package.html Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/package.html Fri Sep 28 12:15:22 2012 +0200 @@ -3,6 +3,6 @@ -DOCUMENT ME! +This package provides actions for handling the MV-GNV-Interface calls. diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParser.java --- a/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParser.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParser.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,20 +1,45 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action.mapviewer.parser; +import java.util.Collection; + import de.intevation.gnv.artifactdatabase.objects.map.MapService; -import java.util.Collection; - /** + * Interfacedefinition for an XMl-parser of the MV-GNV-Interface requestdocument. * @author Tim Englich */ public interface ExternalCallParser { + /** + * Returns the geometry which was parsed from the XML-document. + * @return the geometry. + */ String getGeometry(); + /** + * Returns the srid which was parsed from the XML-document. + * @return the srid. + */ String getSRS(); + /** + * Returns the mapservices which was parsed from the XML-document. + * @return the mapservices. + */ Collection getMapServices(); + /** + * Does the parsing work. + * @throws ExternalCallParserException + */ void parse() throws ExternalCallParserException; } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserException.java --- a/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserException.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserException.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,16 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action.mapviewer.parser; /** + * Exceptionclass for qualifying exception which were caused by the + * ExternalCallParser. * @author Tim Englich * */ diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/XMLExternalCallParser.java --- a/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/XMLExternalCallParser.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/XMLExternalCallParser.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,24 +1,33 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action.mapviewer.parser; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + import de.intevation.gnv.artifactdatabase.objects.map.DefaultLayer; import de.intevation.gnv.artifactdatabase.objects.map.DefaultMapService; import de.intevation.gnv.artifactdatabase.objects.map.Layer; import de.intevation.gnv.artifactdatabase.objects.map.MapService; - import de.intevation.gnv.util.XMLUtils; -import java.io.InputStream; - -import java.util.ArrayList; -import java.util.Collection; - -import org.apache.log4j.Logger; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.NodeList; - /** + * This class provides an XMl-Parser which try's to create an DOM from + * an given Inputstream. Is this is possible it try to read the required + * informations e.g. Mapservices, Layer, SRID and Geometry from the + * document. * @author Tim Englich */ public class XMLExternalCallParser implements ExternalCallParser { @@ -37,47 +46,54 @@ private static String ATTRIBUTE_TYPE = "type"; private static String ATTRIBUTE_URL = "url"; + /** + * The geometry which was parsed from the document. + */ private String geometry = null; + + /** + * The srid which was parsed from the document. + */ private String srs = null; + /** + * The mapservices that were parsed from the document. + */ private Collection mapServices = null; + /** + * The inputstream where the data should be read from. + */ private InputStream inputStream = null; /** * Constructor + * @param inputStream The stream where the data should be read from */ public XMLExternalCallParser(InputStream inputStream) { this.inputStream = inputStream; } - /** - * @see de.intevation.gnv.action.mapviewer.parser.ExternalCallParser#getGeometry() - */ public String getGeometry() { return this.geometry; } - /** - * @see de.intevation.gnv.action.mapviewer.parser.ExternalCallParser#getMapServices() - */ public Collection getMapServices() { return this.mapServices; } - /** - * @see de.intevation.gnv.action.mapviewer.parser.ExternalCallParser#parse() - */ public void parse() throws ExternalCallParserException { if (inputStream != null){ XMLUtils xmlUtils = new XMLUtils(); Document document = xmlUtils.readDocument(this.inputStream); if (document != null){ - this.geometry = xmlUtils.getStringXPath(document, XPATH_GEOMETRY); + this.geometry = xmlUtils.getStringXPath(document, + XPATH_GEOMETRY); this.srs = xmlUtils.getStringXPath(document, XPATH_SRS); NodeList mapservicesNodes = - xmlUtils.getNodeSetXPath(document, XPATH_MAPSERVICES_NODESET); + xmlUtils.getNodeSetXPath(document, + XPATH_MAPSERVICES_NODESET); if (mapservicesNodes != null){ this.mapServices = new ArrayList(mapservicesNodes.getLength()); for (int i = 0; i < mapservicesNodes.getLength(); i++){ @@ -100,13 +116,15 @@ } }else{ - String errMsg = "XML-Document does not contain any Mapservices which are required."; + String errMsg = "XML-Document does not contain any " + + "Mapservices which are required."; log.error(errMsg); throw new ExternalCallParserException(errMsg); } }else{ - String errMsg = "XML-Document could not be read from InputStream."; + String errMsg = "XML-Document could not " + + "be read from InputStream."; log.error(errMsg); throw new ExternalCallParserException(errMsg); } @@ -119,18 +137,21 @@ /** * This Method extracts all Layers and put them into the Collection. - * @param layer - * @param groupId - * @param layerNodes - * @return + * @param layer the collection where the layer should be add to. + * @param groupId the id of the group of the layers + * @param layerNodes the Nodes which should contain the intormations + * about layers + * @return the layer */ - private Collection extractLayer(Collection layer, String groupId, NodeList layerNodes){ - XMLUtils xmlUtils = new XMLUtils(); + private Collection extractLayer(Collection layer, + String groupId, + NodeList layerNodes){ for (int i = 0; i < layerNodes.getLength(); i++){ Element layerNode = (Element)layerNodes.item(i); String id = layerNode.getAttribute(ATTRIBUTE_ID); String name = layerNode.getAttribute(ATTRIBUTE_NAME); - NodeList localLayerNodes = xmlUtils.getNodeSetXPath(layerNode, XPATH_LAYER); + NodeList localLayerNodes = XMLUtils.getNodeSetXPath(layerNode, + XPATH_LAYER); Layer tmpLayer = new DefaultLayer(id, name, (localLayerNodes != null && localLayerNodes.getLength() > 0), @@ -143,9 +164,6 @@ return layer; } - /** - * @see de.intevation.gnv.action.mapviewer.parser.ExternalCallParser#getSRS() - */ public String getSRS() { return this.srs; } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/package.html --- a/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/package.html Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/package.html Fri Sep 28 12:15:22 2012 +0200 @@ -3,6 +3,7 @@ -DOCUMENT ME! +This package provides the XML-parser for parsing the XML-Documents which +were send by the MapViewer to the GMV-WebClient. diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java --- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,9 +1,12 @@ -package de.intevation.gnv.action.sessionmodel; +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ -import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; -import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; -import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; -import de.intevation.gnv.artifactdatabase.objects.OutputMode; +package de.intevation.gnv.action.sessionmodel; import java.util.Collection; import java.util.Iterator; @@ -11,6 +14,12 @@ import org.apache.log4j.Logger; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + /** * The default implementation of SessionModel which stores the * current artifact object and the digram options selected by the user. @@ -20,6 +29,8 @@ */ public class DefaultSessionModel implements SessionModel { + + /** * the logger, used to log exceptions and additonaly information */ @@ -30,19 +41,41 @@ */ private static final long serialVersionUID = 3431484439985158311L; + /** + * Container for ArtifactFactory-objects. + */ private Collection artifactFactories = null; + /** + * The selected ArtifactFactory + */ private ArtifactObject selectedArtifactFactory = null; + /** + * The currently used artifact. + */ private ArtifactObject currentArtifact = null; + /** + * The Diagrammoptions. + */ private DiagrammOptions diagrammOptions = null; + /** + * The Container for statistic-values. + */ private Collection statistics = null; + /** + * The Locale that currently should be used. + */ private Locale currentLocale; /** + * The Mapservice containing all Layers that should be displayed. + */ + private MapService localMapService = null; + /** * Constructor */ public DefaultSessionModel() { @@ -51,7 +84,6 @@ /** * Constructor - * * @param currentLocale A locale used to create the user interface. */ public DefaultSessionModel(Locale currentLocale) { @@ -82,7 +114,7 @@ public void setArtifacteFactories( - Collection artifactFactories) { + Collection artifactFactories) { this.artifactFactories = artifactFactories; } @@ -161,5 +193,13 @@ public void setCurrentLocale(Locale currentLocale) { this.currentLocale = currentLocale; } + + public MapService getLocalMapService() { + return this.localMapService; + } + + public void setLocalMapService(MapService mapService) { + this.localMapService = mapService; + } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java --- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,17 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action.sessionmodel; +import java.text.NumberFormat; + import java.util.HashMap; +import java.util.Locale; import java.util.Map; /** @@ -11,7 +22,7 @@ */ public class DiagrammOptions { - private Map values = new HashMap(); + private Map values = new HashMap(); /** * Constructor @@ -21,21 +32,42 @@ } /** + * Returns the Value to a given Key + * @param key The key of the value that should be returned. * @return the value. */ - public String getValue(String key) { + public Object getValue(String key) { return this.values.get(key); } /** + * Returns the value as string. + * @param key The key of the value that should be returned. + * @param locale A locale object used to format numbers. + * @return the value as string. + */ + public String getValue(String key, Locale locale) { + Object obj = values.get(key); + + if (obj instanceof Double && locale != null) { + Double value = (Double) obj; + NumberFormat format = NumberFormat.getNumberInstance(locale); + + return format.format(value); + } + + return (String) obj; + } + + /** * Set a value with the given key. * * @param key The given key. * @param value The value to be stored. */ - public void setValue(String key, String value) { - this.values.put(key, value); + public void setValue(String key, Object value) { + values.put(key, value); } } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java --- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,14 +1,22 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action.sessionmodel; +import java.io.Serializable; +import java.util.Collection; +import java.util.Locale; + import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; import de.intevation.gnv.artifactdatabase.objects.OutputMode; - -import java.io.Serializable; - -import java.util.Collection; -import java.util.Locale; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; /** * This interface describe basic methods to store artifacts and diagram options. @@ -19,34 +27,115 @@ */ public interface SessionModel extends Serializable { + /** + * Returns all Artifactfactories which were retrieved from the + * Artifactdatabases which are connected to the Client. + * @return the artifactfactories. + */ Collection getArtifactFactories(); + /** + * Sets all Artifactfactories which were retieved from the Artifactdatabases + * to the SessionModel. + * @param artifactFactories the artifactfactories. + */ void setArtifacteFactories(Collection artifactFactories); + /** + * Set the Artifactfactory which match to the given id to selected. + * @param artiFactFactoryId the id of the artifactfactory which should + * be selected. + */ void selectArtifactFactory(String artiFactFactoryId); + /** + * Returns the Artifactfactory which is selected. + * @return the artifactfactory which is selected. + */ ArtifactObject getSelectedArtifactFactory(); + /** + * Returns the currently used artifact. + * This Artifact will retrieved from the selected artifactfactory and will + * be used to do handle the special businesslogic. + * @return the artifact which is currently used. + */ ArtifactObject getCurrentArtifact(); + /** + * Sets a new Artifact as the artifact that should be used. + * @param artifact the new artifact which should be used. + */ void setCurrentArtifact(ArtifactObject artifact); + /** + * Sets the currently used diagrammoptions to the Sessionmodel. + * Diagrammoptions will be used to manipulate the look of diagramms + * and render the GUI so that the user is enabled to switch the options. + * Diagrammoptions are also used for Histogram, all Exports and WMS + * @param diagrammOptions the Options that should be used. + */ void setDiagrammOptions(DiagrammOptions diagrammOptions); + /** + * Returns the diagrammoptions that currently set to the SessionModel. + * @return the diagrammoptions that currently set to the SessionModel. + */ DiagrammOptions getDiagrammOptions(); + /** + * Returns the Outputmode that matches to the given name of an mode. + * Outputmodes are used to define which kind of modes are defined to + * generate an result for a given Artifact (chart, export, wms,...) + * @param name the name of the OutputMode that should be used + * @return the OutputMode that matches to the given name. + */ OutputMode getOutputMode(String name); + /** + * Returns the description to the currently used Artifact. + * The description can be used to retrieve the supported OutputModes, + * the parameters that could be feed, ... + * @return the description of the artifact which is currently used. + */ ArtifactDescription getArtifactDescription(); + /** + * Reset the Model. So that it will have the status as no Artifactfactory + * was selected. + */ void resetModel(); + /** + * Sets the Statistics that were retrieved from the currently used Artifact + * to the SessionModel. + * @param statistics the Statistics that should be shown in the GUI. + */ void setStatistics(Collection statistics); + /** + * Returns the statistics that are currently set to the SessionModel + * @return the statistics that are currently set to the SessionModel + */ Collection getStatistics(); + /** + * Sets the locale that should be used. + * The loacle will be used to customize the GUI for a language that matches + * to the locale or it will be used to tell the Artifactdatabase which locale + * has to be used. + * @param locale the locale that should be used. + */ void setCurrentLocale(Locale locale); + /** + * Returns the currently used locale. + * @return the locale that is currently used. + */ Locale getCurrentLocale(); + + void setLocalMapService(MapService mapService); + + MapService getLocalMapService(); } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java --- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action.sessionmodel; import javax.servlet.http.HttpServletRequest; @@ -12,7 +20,13 @@ */ public class SessionModelFactory { - public final static String SESSION_MODEL_ID = "de.intevation.gnv.action.sessionmodel.SessionModel.ID"; + /** + * The id of the SessionModel that must be used to lookup the + * model from the given HttpSession of the request. + */ + public final static String SESSION_MODEL_ID = "de.intevation.gnv.action." + + "sessionmodel.SessionModel.ID"; + /** * the logger, used to log exceptions and additonaly information */ @@ -32,10 +46,10 @@ /** * This Method provides an singleton Instance of this Class. - * * @return an singleton Instance of this Class */ public synchronized static SessionModelFactory getInstance() { + log.debug("SessionModelFactory.getInstance"); if (instance == null) { instance = new SessionModelFactory(); } @@ -44,10 +58,11 @@ /** * Getting the ArtifactDatabaseClient - * + * @param request the tequest from which the SessionModel should be read. * @return the ArtifactDatabaseClient */ public SessionModel getSessionModel(HttpServletRequest request) { + log.debug("SessionModelFactory.getSessionModel"); synchronized (request) { SessionModel sm = null; Object obj = request.getSession().getAttribute(SESSION_MODEL_ID); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/action/sessionmodel/package.html --- a/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/package.html Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/package.html Fri Sep 28 12:15:22 2012 +0200 @@ -3,7 +3,8 @@ -Store important values in the session using classes and interfaces in this -package. +This package provides the classes and interface-definitions for providing an +SessionModel for storing Information which can be reused during a session. + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,24 +1,29 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.client; +import java.io.IOException; +import java.io.OutputStream; +import java.util.Collection; +import java.util.Locale; + +import org.w3c.dom.Document; + import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseInputException; - import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; import de.intevation.gnv.artifactdatabase.objects.ArtifactFactory; import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; import de.intevation.gnv.artifactdatabase.objects.InputParameter; - import de.intevation.gnv.artifactdatabase.objects.map.MapService; -import java.io.IOException; -import java.io.OutputStream; - -import java.util.Collection; -import java.util.Locale; - -import org.w3c.dom.Document; - /** * This interface describes basic methods for the communication between artifact * server and this client. @@ -91,11 +96,25 @@ Collection inputParameter) throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; + /** + * Calls the advancecommand for the given Artifact at the Artifactdatabase. + * Stepping to the given target using the given Artifactfactory + * @param factory the Factory which provide the information about which + * Artifactdatabase has to be called. + * @param artifact the Artifact which should be moved to the next state. + * @param target the Id of the next State which should the artifact should + * be moved to. + * @throws IOException + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException + */ public void doAdvance( ArtifactObject factory, ArtifactObject artifact, String target) - throws IOException, ArtifactDatabaseClientException, ArtifactDatabaseInputException; + throws IOException, + ArtifactDatabaseClientException, + ArtifactDatabaseInputException; /** * @param artifactFactory diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.client; import java.util.Locale; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,8 +1,44 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.client; +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.restlet.Client; +import org.restlet.Request; +import org.restlet.Response; +import org.restlet.data.ClientInfo; +import org.restlet.data.Language; +import org.restlet.data.Method; +import org.restlet.data.Preference; +import org.restlet.data.Protocol; +import org.restlet.representation.Representation; +import org.restlet.representation.StringRepresentation; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseInputException; - import de.intevation.gnv.artifactdatabase.objects.Artifact; import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; import de.intevation.gnv.artifactdatabase.objects.ArtifactFactory; @@ -19,49 +55,12 @@ import de.intevation.gnv.artifactdatabase.objects.OutputParameter; import de.intevation.gnv.artifactdatabase.objects.ParametrizedArtifactFactory; import de.intevation.gnv.artifactdatabase.objects.ParametrizedArtifactObject; - import de.intevation.gnv.artifactdatabase.objects.map.Layer; import de.intevation.gnv.artifactdatabase.objects.map.MapService; - import de.intevation.gnv.propertiesreader.PropertiesReader; import de.intevation.gnv.propertiesreader.PropertiesReaderFactory; - import de.intevation.gnv.util.XMLUtils; -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.io.OutputStream; -import java.io.OutputStreamWriter; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -import org.apache.log4j.Logger; - -import org.restlet.Client; - -import org.restlet.data.ClientInfo; -import org.restlet.data.Language; -import org.restlet.data.Method; -import org.restlet.data.Preference; -import org.restlet.data.Protocol; -import org.restlet.data.Request; -import org.restlet.data.Response; - -import org.restlet.representation.Representation; -import org.restlet.representation.StringRepresentation; - -import org.w3c.dom.Document; -import org.w3c.dom.Element; -import org.w3c.dom.Node; -import org.w3c.dom.NodeList; - /** * The default implementation of ArtifactDatabaseClient which * implements methods to communicate via HTTP protocol with the artifact server. @@ -274,6 +273,11 @@ private InputStream doPostRequest(String requestUrl, Document requestBody) throws IOException { + + log.debug("URL: "+ requestUrl); + log.debug("Body"); + log.debug(XMLUtils.writeDocument2String(requestBody)); + Client client = new Client(Protocol.HTTP); Request request = initialize(new Request(Method.POST, requestUrl)); String documentBody = XMLUtils.writeDocument2String(requestBody); @@ -1091,11 +1095,12 @@ Node rootNode = this.createArtifactElement(document, "GetMetaData"); document.appendChild(rootNode); - Element locationNode = this.createArtifactElement(document, "location"); - locationNode.setAttribute("srs", srs); - locationNode.appendChild(document.createTextNode(geometry)); - rootNode.appendChild(locationNode); - + if (geometry != null){ + Element locationNode = this.createArtifactElement(document, "location"); + locationNode.setAttribute("srs", srs); + locationNode.appendChild(document.createTextNode(geometry)); + rootNode.appendChild(locationNode); + } Element mapServicesNode = this.createArtifactElement(document, "mapservices"); Iterator it = mapServices.iterator(); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.client.exception; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseInputException.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseInputException.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseInputException.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.client.exception; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; import java.util.Collection; @@ -19,18 +27,63 @@ */ private static final long serialVersionUID = 8606869493141810364L; + /** + * The uuid of this Artifact which must be used to identify + * the artifact at the ArtifactDatabase. + */ private String id = null; + + /** + * The hash of the artifact which was send be the ArtifactDatabase. + */ private String hash = null; + + /** + * Flag which marks if the Artifact is currently selected or not. + */ private boolean selected = false; + /** + * The XML-Node of the current User-Interface + */ private Node currentUI = null; + + /** + * The XML-Nodes of the OutputModes. + */ private Node currentOut = null; + /** + * The ids of the states which could be reached. + */ private Collection reachableStates; + + /** + * The parameters whcih could be feed to the artifact at the current state. + */ private Collection inputParameter; + + /** + * The OutputModes that could be reached at the current state. + */ private Map outputModes; + + /** + * The id of the state which is currently used. + */ private String currentState = null; + /** + * Constructor + * @param uuid the uuid of this Artifact which must be used to identify + * the artifact at the ArtifactDatabase + * @param hash the hash of the artifact which was send be the + * ArtifactDatabase + */ + public Artifact(String uuid, String hash) { + this.id = uuid; + this.hash = hash; + } public Node getCurrentUI() { return currentUI; @@ -71,16 +124,6 @@ this.currentState = currentState; } - /** - * Constructor - */ - public Artifact(String uuid, String hash) { - - this.id = uuid; - this.hash = hash; - } - - public String getHash() { return this.hash; } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,20 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; /** + * Implementation of an ArtifactObject> which represents an + * ArtifactFactory + * This Class provides the name, the description, the URL where the + * the ArtifactDatabase the factory belongs to could be reached + * and if the ArtifacFactory is currently selected or not. + * * @author Tim Englich */ public class ArtifactFactory implements ArtifactObject { @@ -10,12 +24,25 @@ */ private static final long serialVersionUID = 5453748230625831527L; + /** + * The name of the factory. + */ private String name = null; + /** + * The description of the Factory. + */ private String description = null; + /** + * Flag which mark the Artifactfactory as selected if value is true + * unselected if value is false. + */ private boolean selected = false; + /** + * The URL where the Factory could be reached. + */ private String dataBaseUrl = null; /** @@ -33,7 +60,9 @@ * @param description the description of the Factory * @param dataBaseUrl the URL where the Factory could be reached. */ - public ArtifactFactory(String name, String description, String dataBaseUrl) { + public ArtifactFactory(String name, + String description, + String dataBaseUrl) { super(); this.name = name; this.description = description; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; /** @@ -12,8 +20,14 @@ */ private static final long serialVersionUID = -8409111023127835398L; + /** + * The key of the new Value. + */ private String key = null; + /** + * The value of the Object. + */ private String value = null; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; import java.util.ArrayList; @@ -16,12 +24,19 @@ */ private static final long serialVersionUID = 6738878381515708602L; + /** + * The name of the StatisticsSet. + */ private String name = null; + /** + * The statisticsvalues which belong to this set. + */ private Collection statisticValues = new ArrayList(); /** * Constructor + * @param name the name of the StatisticsSet */ public DefaultArtifactStatisticsSet(String name) { this.name = name; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; /** @@ -9,8 +17,19 @@ public class DefaultExportMode implements ExportMode { + /** + * The name of this parameter. + */ protected String name; + + /** + * The description of this mode. + */ protected String description; + + /** + * The mimetype used for this mode. + */ protected String mimeType; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; /** @@ -8,15 +16,23 @@ */ public class DefaultInputParameter implements InputParameter { + /** + * The UID of this Class. + */ private static final long serialVersionUID = 6597439837482244211L; + /** + * The name of this parameter. + */ private String name = null; + /** + * The values of this parameter. + */ private String[] values = null; /** * Constructor - * * @param name The name of this parameter. * @param values The values of this parameter. */ diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; import java.util.Collection; @@ -15,14 +23,33 @@ */ private static final long serialVersionUID = 7487880486604174521L; + /** + * The name of the OutputMode + */ private String name = null; + /** + * The mimetype of the OutputMode + */ private String mimeType = null; + /** + * The parameters that could be used for this OutputMode + */ private Collection outputParameter = null; + /** + * The exports that can be called using this outputMode + */ private Map exports; + /** + * Constructor + * @param name The name of the OutputMode + * @param mimeType The mimetype of the OutputMode + * @param outputParameter The parameters that could be used for this OutputMode + * @param exports The exports that can be called using this outputMode + */ public DefaultOutputMode( String name, String mimeType, diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; /** @@ -12,20 +20,33 @@ */ private static final long serialVersionUID = -8416057640116638152L; + /** + * The name of the parameter + */ private String name = null; + /** + * The value of the parameter + */ private String value = null; + /** + * The description of the parameter + */ private String description = null; + /** + * The type of the parameter + */ private String type = null; /** * Constructor * - * @param name - * @param value - * @param description + * @param name The name of the parameter + * @param value The value of the parameter + * @param description The description of the parameter + * @param type The type of the parameter */ public DefaultOutputParameter(String name, String value, String description, String type) { diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; import java.io.Serializable; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; import java.util.Collection; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects; import java.util.Collection; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects.map; /** @@ -8,16 +16,34 @@ public class DefaultLayer implements Layer { + /** + * The id of this layer. + */ private String id = null; + /** + * The name of this layer. + */ private String name = null; + /** + * Flag which defines if this layer is an grouplayer. + */ private boolean groupLayer = false; + /** + * The id of the parent layer or null if this layer is an rootlayer. + */ private String parentId = null; /** * Constructor + * + * @param id the id of this layer + * @param name the name of this layer + * @param groupLayer flag which defines if this layer is an grouplayer + * @param parentId the id of the parent layer or null if this layer is an + * rootlayer */ public DefaultLayer(String id,String name, boolean groupLayer,String parentId) { diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects.map; import java.util.Collection; @@ -9,16 +17,43 @@ */ public class DefaultMapService implements MapService { + /** + * The id of this mapservice. + */ private String id = null; + /** + * The layer which are provided by this mapservice. + */ private Collection layer = null; + /** + * The type of this mapservice. + */ private String type = null; + /** + * The URl of this mapservice. + */ private String url = null; + + /** + * The Bbox which surrounds the data of the Mapservice + */ + private String bbox = null; + + /** + * The time until the server will provide the data. + */ + private String ttl = null; /** * Constructor + * + * @param id the id of this mapservice + * @param layer the layer which are provided by this mapservice + * @param type the type of this mapservice + * @param url the URl of this mapservice */ public DefaultMapService(String id, Collection layer, String type, String url) { @@ -28,6 +63,23 @@ this.type = type; this.url = url; } + + /** + * Constructor + * + * @param id the id of this mapservice + * @param layer the layer which are provided by this mapservice + * @param type the type of this mapservice + * @param url the URl of this mapservice + * @param bbox the Bbox which surrounds the data of the Mapservice + * @param ttl the time until the server will provide the data. + */ + public DefaultMapService(String id, Collection layer, + String type, String url, String bbox, String ttl) { + this(id,layer,type,url); + this.bbox = bbox; + this.ttl = ttl; + } public String getID() { @@ -48,5 +100,12 @@ public String getURL() { return this.url; } + + public String getBBoxValue() { + return this.bbox; + } + public String getTtl() { + return this.ttl; +} } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects.map; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.objects.map; import java.util.Collection; @@ -39,5 +47,17 @@ * @return the layers served by a map service. */ Collection getLayer(); + + /** + * Retrieves the bboxvalue served by a map service. + * @return the bboxvalue + */ + String getBBoxValue (); + + /** + * Returns the Time until the Service will provide the Data. + * @return the Time until the Service will provide the Data. + */ + String getTtl(); } // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/artifactdatabase/package.html --- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/package.html Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/package.html Fri Sep 28 12:15:22 2012 +0200 @@ -3,6 +3,7 @@ -DOCUMENT ME! +This package and it's subpackages provides the required infrastructure to +communicate with the ArtifactDatabase. diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java --- a/gnv/src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.propertiesreader; import java.util.Map; @@ -14,10 +22,16 @@ private static Logger log = Logger.getLogger(MapPropertiesReader.class); + /** + * The properties which are served by this PropertiesReader. + */ private Map properties = null; /** * Constructs a new MapPropertiesReader with an initial map. + * + * @param properties the properties which should be served by this + * PropertiesReader. */ public MapPropertiesReader(Map properties) { super(); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java --- a/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.propertiesreader; /** diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java --- a/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.propertiesreader; import java.util.Map; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java --- a/gnv/src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.propertiesreader; import java.util.Enumeration; @@ -9,6 +17,11 @@ import org.apache.log4j.Logger; /** + * This reader fetches the properties it will provide from the + * ServletConfig of an Context. + * It will read the InitParameters which could be configured using + * the web.xmlcontext. + * * @author Tim Englich * */ @@ -19,10 +32,16 @@ */ private static Logger log = Logger.getLogger(ServletPropertiesReader.class); + /** + * The properties which are read from the ServletConfig. + */ private Map properties = null; /** * Constructor + * + * @param config the ServletConfig where + * the properties should be read from. */ public ServletPropertiesReader(ServletConfig config) { super(); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/propertiesreader/package.html --- a/gnv/src/main/java/de/intevation/gnv/propertiesreader/package.html Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/package.html Fri Sep 28 12:15:22 2012 +0200 @@ -3,6 +3,7 @@ -DOCUMENT ME! +This package provides reader and factories which will provide properties which +are configured in different files (e.g. web.xml) in the whole system. diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java --- a/gnv/src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,17 +1,26 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.servlet; -import de.intevation.gnv.propertiesreader.PropertiesReaderFactory; - import javax.servlet.ServletConfig; import javax.servlet.ServletException; import org.apache.log4j.Logger; import org.apache.log4j.PropertyConfigurator; +import org.apache.struts.action.ActionServlet; -import org.apache.struts.action.ActionServlet; +import de.intevation.gnv.propertiesreader.PropertiesReaderFactory; /** * The GNV ActionServlet. + * This Servelt will be used to handle all requests which are + * send to the GNV-WebClient. * * @author Tim Englich */ @@ -22,12 +31,17 @@ */ private static Logger log = null; - static { - // BasicConfigurator.configure(); - } + /** + * The id which must be used to lookup the path to the + * log4j.properties file which is configured + * in the web.xml + */ + private final static String LOGGINIG_CONFIG_FILE_ID = "de.intevation.gnv." + + "servlet.log4j.configuration"; - static String LOGGINIG_CONFIG_FILE_ID = "de.intevation.gnv.servlet.log4j.configuration"; - + /** + * The UID of this class. + */ private static final long serialVersionUID = 3597396283436383943L; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/servlet/package.html --- a/gnv/src/main/java/de/intevation/gnv/servlet/package.html Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/servlet/package.html Fri Sep 28 12:15:22 2012 +0200 @@ -3,6 +3,7 @@ -DOCUMENT ME! +This package provides the Servlet which will be used to handle +all requests which are send to the GNV-WebClient. diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java --- a/gnv/src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,9 +1,16 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.util; import java.util.Iterator; import javax.xml.XMLConstants; - import javax.xml.namespace.NamespaceContext; /** @@ -25,9 +32,15 @@ */ public final static String NAMESPACE_PREFIX = "art"; + /** + * The singleton instance of this NamespaceContext + */ public static final ArtifactNamespaceContext INSTANCE = new ArtifactNamespaceContext(); + /** + * Constructor + */ public ArtifactNamespaceContext() { } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/util/CaptureInputStream.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/util/CaptureInputStream.java Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.util; + +import java.io.FilterInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; + +/** + * @author Sascha Teichmann + */ +public class CaptureInputStream +extends FilterInputStream +{ + protected ByteArrayOutputStream copy; + + public CaptureInputStream(InputStream in) { + super(in); + copy = new ByteArrayOutputStream(10*1024); + } + + public int read() throws IOException { + int x = in.read(); + if (x != -1) { + copy.write(x); + } + return x; + } + + public int read(byte [] b, int off, int len) throws IOException { + int r = in.read(b, off, len); + if (r > 0) { + copy.write(b, off, r); + } + return r; + } + + public long skip(long n) throws IOException { + long m = in.skip(n); + for (long i = m; i > 0L; --i) { // simulate gab + copy.write(0); + } + return m; + } + + public String copyToString() { + return copy.toString(); + } + + public String copyToString(String charsetName) + throws UnsupportedEncodingException + { + return copy.toString(charsetName); + } + + public byte [] toByteArray() { + return copy.toByteArray(); + } + + public void clear() { + copy.reset(); + } +} diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/util/XMLUtils.java --- a/gnv/src/main/java/de/intevation/gnv/util/XMLUtils.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/util/XMLUtils.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.util; import java.io.IOException; @@ -8,62 +16,99 @@ import javax.xml.namespace.NamespaceContext; import javax.xml.namespace.QName; - import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; - import javax.xml.transform.Transformer; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactoryConfigurationError; - import javax.xml.transform.dom.DOMSource; - import javax.xml.transform.stream.StreamResult; - import javax.xml.xpath.XPath; import javax.xml.xpath.XPathConstants; import javax.xml.xpath.XPathExpressionException; import javax.xml.xpath.XPathFactory; import org.apache.log4j.Logger; - import org.w3c.dom.Attr; import org.w3c.dom.Document; import org.w3c.dom.Element; import org.w3c.dom.Node; import org.w3c.dom.NodeList; - import org.xml.sax.SAXException; /** - * @author Sascha L. Teichmann + * This class provides many helper-Methods for handling different kinds of + * XML-stuff. + * @author Tim Englich + * @author Sascha L. Teichmann */ public class XMLUtils { + + /** + * the logger, used to log exceptions and additonaly information + */ private static Logger logger = Logger.getLogger(XMLUtils.class); + /** + * Constructor + */ public XMLUtils() { } + /** + * Class which could be used to create XML-Elements + * @author Sascha L. Teichmann + * + */ public static class ElementCreator { + + /** + * The document the elements should be placed in. + */ protected Document document; + + /** + * The namespace that should be used. + */ protected String ns; + + /** + * The prefix of the namespace that should be used. + */ protected String prefix; + /** + * Constructor + * @param document the document the elements should be placed in + * @param ns the namespace that should be used + * @param prefix the prefix of the namespace that should be used + */ public ElementCreator(Document document, String ns, String prefix) { this.document = document; this.ns = ns; this.prefix = prefix; } + /** + * Creates a new element using the given name. + * @param name the name of the new element. + * @return the new element + */ public Element create(String name) { Element element = document.createElementNS(ns, name); element.setPrefix(prefix); return element; } + /** + * Adds a new attribute to the given element. + * @param element the element where the attribute should be placed in. + * @param name the name of the attribute + * @param value the value of the attribute + */ public void addAttr(Element element, String name, String value) { Attr attr = document.createAttributeNS(ns, name); attr.setValue(value); @@ -72,6 +117,10 @@ } } // class ElementCreator + /** + * Creates a new document. + * @return the new document + */ public static Document newDocument() { try { return DocumentBuilderFactory.newInstance().newDocumentBuilder() @@ -82,10 +131,19 @@ return null; } + /** + * Creates a new XPath-expression + * @return the new XPath-expression + */ public static XPath newXPath() { return newXPath(null); } + /** + * Creates a new XPath-expression + * @param namespaceContext the namespacecontext that should be used. + * @return the new XPath-expression + */ public static XPath newXPath(NamespaceContext namespaceContext) { XPathFactory factory = XPathFactory.newInstance(); XPath xpath = factory.newXPath(); @@ -95,66 +153,127 @@ return xpath; } - public static Object xpath(Object root, String query, QName returnTyp) { - return xpath(root, query, returnTyp, null); - } - + /** + * Fetch the value of an element or attribute from the given resource + * using the query. + * @param root the source where the value should be fetch from + * @param query the query that should be used to fetch the value + * @param namespaceContext the namespacecontext that must match to + * fetch the value. + * @return the value + */ public static final String xpathString(Object root, String query, NamespaceContext namespaceContext) { return (String) xpath(root, query, XPathConstants.STRING, namespaceContext); } + /** + * Fetch the object rom the given resource using the query. + * @param root the source where the value should be fetch from + * @param query the query that should be used to fetch the object + * @param returnType the Type that must be used to return the object, + * @param namespaceContext the namespacecontext that must match to + * fetch the object. + * @return the value + */ public static final Object xpath(Object root, String query, QName returnType, NamespaceContext namespaceContext) { if (root == null) { return null; } - try { - XPath xpath = new XMLUtils().newXPath(namespaceContext); + XPath xpath = XMLUtils.newXPath(namespaceContext); if (xpath != null) { return xpath.evaluate(query, root, returnType); } } catch (XPathExpressionException xpee) { logger.error(xpee.getLocalizedMessage(), xpee); } - return null; } + /** + * Fetch the object rom the given resource using the query + * and the default ArtifactNamespaceContext + * @param root the source where the value should be fetch from + * @param query the query that should be used to fetch the object + * @param returnType the Type that must be used to return the object + * @return the value + */ public static Object getXPath(Object root, String query, QName returnType) { return getXPath(root,query,returnType,ArtifactNamespaceContext.INSTANCE); } + /** + * Fetch the object rom the given resource using the query + * and the default ArtifactNamespaceContext + * @param root the source where the value should be fetch from + * @param query the query that should be used to fetch the object + * @param returnType the Type that must be used to return the object. + * @param context the namespacecontext that must match to + * fetch the object. + * @return the value + */ public static Object getXPath( Object root, String query, QName returnType, NamespaceContext context ) { return xpath(root, query, returnType, context); } - public static String getStringXPath(String xpath) { - return getStringXPath(xpath, null); - } - + /** + * Fetch a Nodeset value from a XML-Fragment or XML-Document using the + * given query. + * @param root the source where the String should be fetched from + * @param query the query that should be used, + * @return the Nodeset fetched from the source + */ public static NodeList getNodeSetXPath(Object root, String query) { return (NodeList) getXPath(root, query, XPathConstants.NODESET); } + /** + * Fetch a Node from a XML-Fragment or XML-Document using the + * given query. + * @param root the source where the Node should be fetched from + * @param query the query that should be used, + * @return the Node fetched from the source + */ public static Node getNodeXPath(Object root, String query) { return (Node) getXPath(root, query, XPathConstants.NODE); } + /** + * Fetch a String value from a XML-Fragment or XML-Document using the + * given query. + * @param root the source where the String should be fetched from + * @param xpath the query that should be used, + * @return the String fetched from the source + */ public static String getStringXPath(Object root, String xpath) { return getStringXPath(root, xpath, null); } + /** + * Fetch a String value from a XML-Fragment or XML-Document using the + * given query. + * @param root the source where the String should be fetched from + * @param query the query that should be used, + * @param def the default-value that will be returned id no value was found + * @return the String fetched from the source + */ public static String getStringXPath(Object root, String query, String def) { String s = (String) getXPath(root, query, XPathConstants.STRING); return s == null || s.length() == 0 ? def : s; } + /** + * Reads an XML-document from a given InputStream + * @param inputStream the InputStream where the document + * should be read from + * @return the document that could be read. + */ public static Document readDocument(InputStream inputStream) { Document returnValue = null; try { @@ -173,6 +292,11 @@ return returnValue; } + /** + * Writes an single XML-Node to a string + * @param node the XML-Node that should be written + * @return the encoded XML-Node + */ public static String writeNode2String(Node node) { try { DOMSource source = new DOMSource(node); @@ -187,13 +311,25 @@ return null; } + /** + * Reinitialize the doument. + * This is neccessary because the namespace sometimes is invalid + * using a document which was created and used in the same step. + * @param document the document which should be reinitialize + * @return the document + */ public static Document reInitDocument(Document document) { - StringBufferInputStream inputStream = new StringBufferInputStream( writeDocument2String(document)); return readDocument(inputStream); } + /** + * Writes the given Document into a String. + * This is very helpful for debugging. + * @param document the document which should be written to the string. + * @return the encoded xml-document. + */ public static String writeDocument2String(Document document) { try { DOMSource source = new DOMSource(document); @@ -209,8 +345,9 @@ } /** - * @param source - * @return + * Writes a given DOMSource into a String + * @param source the source that should be written to string + * @return the encoded DOMSource * @throws TransformerFactoryConfigurationError * @throws TransformerConfigurationException * @throws TransformerException @@ -228,7 +365,13 @@ return sw.getBuffer().toString(); } - public static boolean toStream(Document document, OutputStream out) { + /** + * Writes a given Document to an OutputStream + * @param document the document that should be written + * @param out the stream where the document should be written to, + * @return true if it was successful, false if not. + */ + public static boolean toStream(Document document, OutputStream out) { try { Transformer transformer = TransformerFactory.newInstance().newTransformer(); @@ -246,7 +389,6 @@ catch (TransformerException te) { logger.error(te.getLocalizedMessage(), te); } - return false; } } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java --- a/gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,9 +1,16 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.util; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.UnsupportedEncodingException; - import java.util.HashMap; import java.util.Map; @@ -13,14 +20,11 @@ import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; import javax.xml.transform.TransformerFactoryConfigurationError; - import javax.xml.transform.dom.DOMSource; - import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; import org.apache.log4j.Logger; - import org.w3c.dom.Node; /** @@ -30,12 +34,15 @@ * @author Tim Englich */ public class XSLTransformer { + /** * the logger, used to log exceptions and additonaly information */ private static Logger log = Logger.getLogger(XSLTransformer.class); - + /** + * The parameter that is required in the XSL sheet. + */ private Map params; /** @@ -60,7 +67,6 @@ String templateFileName) { String resultValue = null; try { - //XMLUtils xmlUtils = new XMLUtils(); Source templateSource = new StreamSource(new File(templateFileName)); TransformerFactory xformFactory = TransformerFactory.newInstance(); Transformer transformer = xformFactory diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/resources/applicationMessages.properties --- a/gnv/src/main/resources/applicationMessages.properties Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/resources/applicationMessages.properties Fri Sep 28 12:15:22 2012 +0200 @@ -44,6 +44,8 @@ gnviewer.select.button = Ausw\u00e4hlen gnviewer.select.button.src = ./images/auswaehlen.png gnviewer.draw.button = Aktualisieren +gnviewer.example.linestring=Beispiel WKT-Linestring einf\u00fcgen +gnviewer.example.polygon=Beispiel WKT-Polygon einf\u00fcgen gnviewer.productselection.overlay.title = Die Anfrage wird bearbeitet. Bitte gedulden Sie sich einen Moment. gnviewer.productselection.fisselection.title = Fachinformationssystem @@ -82,16 +84,16 @@ # wms gnviewer.wms.server.path=URL des WMS -gnviewer.wms.server.layer=Name des Layers gnviewer.wms.layer.ttl=Layer ist g\u00fcltig bis gnviewer.wms.options.header.title=WMS Optionen # attachedOutputOptions gnviewer.output.options.diagramm.alt=Diagramm gnviewer.output.options.histogram.alt=Histogramm -gnviewer.output.options.save.title=Diagramm speichern +gnviewer.output.options.refresh.title=Diagramm aktualisieren gnviewer.output.options.export.csv.title=Daten als CSV exportieren gnviewer.output.options.export.odv.title=Daten als ODV exportieren +gnviewer.output.options.export.png.title=Diagramm als PNG exportieren gnviewer.output.options.export.pdf.title=Diagramm als PDF exportieren gnviewer.output.options.export.svg.title=Diagramm als SVG exportieren gnviewer.output.options.export.zip.title=ZIP-Archiv exportieren @@ -123,3 +125,26 @@ mismatching.checksum=Ung\u00fcltiges Artefakt Dokument gefunden. no.such.factory=Ung\u00fcltiges Artefakt Dokument gefunden. java.io.ioexception..no.such.artifact=Ihr Artefakt ist ung\u00fcltig oder bereits abgelaufen. +java.io.ioexception..java.heap.space =Es ist ein interner Serverfehler aufgetreten. Bitte benachrichtigen Sie den Support. +sessiontimeout.has.occured=Ihre Sitzung ist abgelaufen. + +# the map client +gnvview.mapclient.fullscreen = Vollbild +gnviewer.mapclient.layercontrol = Layerkontrolle +gnviewer.mapclient.layercontrol.baselayer = Hintergrundlayer +gnviewer.mapclient.layercontrol.overlay = Generierte Layer +gnviewer.mapclient.legend = Legende +gnviewer.mapclient.wms.load.title = Weitere Layer hinzuf\u00fcgen +gnviewer.mapclient.wms.load.addlayer = Layer hinzuf\u00fcgen +gnviewer.mapclient.wms.load.grid.name = Name +gnviewer.mapclient.wms.load.grid.title = Titel +gnviewer.mapclient.wms.load.bt.text = Laden +gnviewer.mapclient.wms.load.bt.tooltip = L\u00e4d das Capabilities Dokument vom angegebenen Server +gnviewer.mapclient.wms.load.grid.error.title = Fehler +gnviewer.mapclient.wms.load.grid.error.message = Unter der angegebenen Url konnten keine Layer ermittelt werden. +gnviewer.mapclient.controls.nav.previous.title = Springt zum letzten Kartenausschnitt +gnviewer.mapclient.controls.nav.next.title = Springt zum vorherigen Kartenausschnitt +gnviewer.mapclient.controls.navigate.title = Verschieben der Karte +gnviewer.mapclient.controls.zoombox.title = Zum Zoomen ziehen Sie eine Box auf, indem Sie klicken und ziehen +gnviewer.mapclient.controls.info.title = Detailinformationen zu Objekten durch Klicken in die Karte +gnviewer.mapclient.wms.local.service.name = GNV Web Map Service diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/resources/applicationMessages_en.properties --- a/gnv/src/main/resources/applicationMessages_en.properties Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/resources/applicationMessages_en.properties Fri Sep 28 12:15:22 2012 +0200 @@ -44,6 +44,8 @@ gnviewer.select.button = Choose gnviewer.select.button.src = ./images/choose.png gnviewer.draw.button = Update +gnviewer.example.linestring=Insert an example linestring as wkt +gnviewer.example.polygon=Insert an example polygon as wkt gnviewer.productselection.overlay.title = Your request will be processed. Please wait... gnviewer.productselection.fisselection.title = Data set @@ -82,16 +84,16 @@ # wms gnviewer.wms.server.path=WMS URL -gnviewer.wms.server.layer=Layername gnviewer.wms.layer.ttl=Layer is valid to gnviewer.wms.options.header.title=WMS Optionen # attachedOutputOptions gnviewer.output.options.diagramm.alt=Diagram gnviewer.output.options.histogram.alt=Histogram -gnviewer.output.options.save.title=Save Diagram +gnviewer.output.options.refresh.title=Refresh chart gnviewer.output.options.export.csv.title=Export Data as CSV gnviewer.output.options.export.odv.title=Export Data as ODV +gnviewer.output.options.export.png.title=Export chart as PNG gnviewer.output.options.export.pdf.title=Export chart as PDF gnviewer.output.options.export.svg.title=Export chart as SVG gnviewer.output.options.export.zip.title=Export as ZIP archive @@ -109,9 +111,9 @@ java.io.ioexception..connection.reset = The Connection to the ArtifactDatabase is interrupted. Please try again later. java.io.ioexception..unable.to.parse.the.response.http.version..end.of.stream.reached.too.early= The Connection to the ArtifactDatabase was interrupted unexpected. no.inputdata.given..please.select.at.least.one.entry = No Entry was chosen. Please select at least one entry. -de.intevation.gnv.geobackend.base.query.exception.queryexception..java.sql.sqlexception: A internal Server error has occurred. Please contact the Support. -java.io.ioexception..the.server.encountered.an.unexpected.condition.which.prevented.it.from.fulfilling.the.request = A internal Server error has occurred. Please contact the Support. -java.lang.illegalargumentexception..inputstream.cannot.be.null = A internal Server error has occurred. Please contact the Support. +de.intevation.gnv.geobackend.base.query.exception.queryexception..java.sql.sqlexception=An internal server error has occurred. Please contact the support. +java.io.ioexception..the.server.encountered.an.unexpected.condition.which.prevented.it.from.fulfilling.the.request=An internal server error has occurred. Please contact the support. +java.lang.illegalargumentexception..inputstream.cannot.be.null = An internal server error has occurred. Please contact the support. input.is.not.valid.for.this.state=You entered an invalid value. Please try again. input.not.a.integer= is not a valid integer. Please try again. input.not.a.double= is not a valid floating-point number. Please try again. @@ -121,3 +123,26 @@ mismatching.checksum=Invalid artifact found. no.such.factory=Invalid artifact found. java.io.ioexception..no.such.artifact=Your artifact is invalid or out of date. +java.io.ioexception..java.heap.space = An internal server error has occurred. Please contact the support. +sessiontimeout.has.occured=Your session timed out. + +# the map client +gnvview.mapclient.fullscreen = Full screen +gnviewer.mapclient.layercontrol = Layercontrol +gnviewer.mapclient.layercontrol.baselayer = Baselayer +gnviewer.mapclient.layercontrol.overlay = Overlay +gnviewer.mapclient.legend = Legend +gnviewer.mapclient.wms.load.title = Add further Layer +gnviewer.mapclient.wms.load.addlayer = Add Layer +gnviewer.mapclient.wms.load.grid.name = Name +gnviewer.mapclient.wms.load.grid.title = Title +gnviewer.mapclient.wms.load.bt.text = Load +gnviewer.mapclient.wms.load.bt.tooltip = Load the Capabilities document from the given destination. +gnviewer.mapclient.wms.load.grid.error.title = Error +gnviewer.mapclient.wms.load.grid.error.message = No layer could be determined under the given url. +gnviewer.mapclient.controls.nav.previous.title = Jumps to the last Mapview +gnviewer.mapclient.controls.nav.next.title = Jumps to the last Mapview +gnviewer.mapclient.controls.navigate.title = Moves the map +gnviewer.mapclient.controls.zoombox.title = Zoom by clicking an moving the mouse to generate a box +gnviewer.mapclient.controls.info.title = Identify features by clicking +gnviewer.mapclient.wms.local.service.name = GNV Web Map Service diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/classes/log4j.properties --- a/gnv/src/main/webapp/WEB-INF/classes/log4j.properties Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/classes/log4j.properties Fri Sep 28 12:15:22 2012 +0200 @@ -1,20 +1,18 @@ -# Set root logger level to DEBUG and its only appender to A1. -log4j.rootLogger=DEBUG, A1 -log4j.rootLogger=DEBUG, BSH +#### Log just errors and warnings to a file. +log4j.rootLogger=WARN, BSH -# A1 is set to be a ConsoleAppender. -log4j.appender.A1=org.apache.log4j.ConsoleAppender +## The following line enables the output of the MapViewer call document. +log4j.category.de.intevation.gnv.action.mapviewer.MapViewerCallAction=DEBUG -# A1 uses PatternLayout. -log4j.appender.A1.layout=org.apache.log4j.PatternLayout -log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n +#### Log everything to a file. +#log4j.rootLogger=DEBUG, BSH log4j.appender.BSH=org.apache.log4j.RollingFileAppender log4j.appender.BSH.File=${catalina.base}/logs/gnv.log log4j.appender.BSH.layout=org.apache.log4j.PatternLayout log4j.appender.BSH.layout.ConversionPattern=%d [%t] %-5p %c - %m%n -# Abschalten des geschwätzigen Loggings in dre Klasse JspServlet +# set WARN log level for following packages to reduce output. log4j.category.org.apache.jasper=WARN log4j.category.org.apache.catalina=WARN log4j.category.org.apache.commons=WARN diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/config/reachable-servers.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/config/reachable-servers.conf Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,34 @@ +['BSH WMS Background','http://gdisrv.bsh.de/arcgis/services/Background/Background/MapServer/WMSServer'], +['BSH WMS CONTIS Administration','http://gdisrv.bsh.de/arcgis/services/CONTIS/Administration/MapServer/WMSServer'], +['BSH WMS CONTIS Facilities','http://gdisrv.bsh.de/arcgis/services/CONTIS/Facilities/MapServer/WMSServer'], +['BSH WMS NAUTHIS Skin of the Earth','http://gdisrv.bsh.de/arcgis/services/Nauthis/SkinOfTheEarth/MapServer/WMSServer '], +['BSH WMS NAUTHIS Navigational Aids','http://gdisrv.bsh.de/arcgis/services/Nauthis/NavigationalAids/MapServer/WMSServer '], +['BSH WMS NAUTHIS Seawards Limits','http://gdisrv.bsh.de/arcgis/services/Nauthis/SeawardsLimits/MapServer/WMSServer'], +['BSH WMS NAUTHIS Rocks Wrecks Obstructions','http://gdisrv.bsh.de/arcgis/services/Nauthis/RocksWrecksObstructions/MapServer/WMSServer'], +['BSH WMS NAUTHIS Hydrography','http://gdisrv.bsh.de/arcgis/services/Nauthis/Hydrography/MapServer/WMSServer'], +['BSH WMS NAUTHIS Topography','http://gdisrv.bsh.de/arcgis/services/Nauthis/Topography/MapServer/WMSServer'], +['BSH WMS Water Pollution Reports','http://gdisrv.bsh.de/arcgis/services/WaterPollution/WaterPollution/MapServer/WMSServer'], +['BSH WMS Marine Environmental Monitoring Network','http://gdisrv.bsh.de/arcgis/services/MARNET/MARNET/MapServer/WMSServer'], +['BSH WMS Remote Sensing Sea Surface Temperature','http://gdisrv.bsh.de/arcgis/services/RemoteSensing/SeaSurfaceTemperature/MapServer/WMSServer'], +['BSH WMS Sea Surface Temperature Analysis','http://gdisrv.bsh.de/arcgis/services/SeaSurfaceTemperature/SeaSurfaceTemperature/MapServer/WMSServer'], +['BSH WMS Prediction Model Current','http://gdisrv.bsh.de/arcgis/services/PredictionModel/WaterCurrent/MapServer/WMSServer'], +['BSH WMS Prediction Model Water Level NN','http://gdisrv.bsh.de/arcgis/services/PredictionModel/WaterLevelNN/MapServer/WMSServer'], +['BSH WMS Prediction Model Water Temperature','http://gdisrv.bsh.de/arcgis/services/PredictionModel/WaterTemperature/MapServer/WMSServer'], +['BSH WMS Prediction Model Salinity','http://gdisrv.bsh.de/arcgis/services/PredictionModel/WaterSalinity/MapServer/WMSServer'], +['BSH WMS SGE Additional Information','http://gdisrv.bsh.de/arcgis/services/SGE/AdditionalInformation/MapServer/WMSServer'], +['BSH WMS SGE Seabed Sediments','http://gdisrv.bsh.de/arcgis/services/SGE/SeabedSediments/MapServer/WMSServer'], +['BSH WMS SGE Subsurface Sediments','http://gdisrv.bsh.de/arcgis/services/SGE/SubsurfaceSediments/MapServer/WMSServer'], +['BSH WMS SGE Survey','http://gdisrv.bsh.de/arcgis/services/SGE/Survey/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Sediment PCB','http://gdisrv.bsh.de/arcgis/services/MUDAB/SedimentPCB/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Sediment Metalle','http://gdisrv.bsh.de/arcgis/services/MUDAB/SedimentMetals/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Sediment HCH','http://gdisrv.bsh.de/arcgis/services/MUDAB/SedimentHCH/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser PCB','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterPCB/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser Nährstoffe','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterNutrients/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser Metalle','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterMetals/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser HCH','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterHCH/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser Physik','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterPhysical/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser PAH','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterPAH/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser Pestizide','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterPesticide/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Biota PCB','http://gdisrv.bsh.de/arcgis/services/MUDAB/BiotaPCB/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Biota Metalle','http://gdisrv.bsh.de/arcgis/services/MUDAB/BiotaMetals/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Biota HCH','http://gdisrv.bsh.de/arcgis/services/MUDAB/BiotaHCH/MapServer/WMSServer'] \ No newline at end of file diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/config/struts-config.xml --- a/gnv/src/main/webapp/WEB-INF/config/struts-config.xml Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/config/struts-config.xml Fri Sep 28 12:15:22 2012 +0200 @@ -156,10 +156,22 @@ name="selectfis" path="/gnv/selectFis.do"/> + + + + + - - - {$edit} - - + + {$edit} + {$edit} diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl --- a/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Fri Sep 28 12:15:22 2012 +0200 @@ -9,6 +9,9 @@ + + + @@ -157,10 +160,10 @@ - Beispiel WKT-Linestring einfügen:
+ :
- Beispiel WKT-Polygon einfügen:
+ :
diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/footer.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/footer.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/footer.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,29 +1,35 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" language="java" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> - - - - - - - - - -
© 2010 Bundesamt für Seeschifffahrt und Hydrographie
- - - - - - -
- + + + + + + + + +
© 2010 Bundesamt für Seeschifffahrt und Hydrographie
+ + + + + + +
<%--div style="clear: left; margin-top: 40px;"/--%> diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/header.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/header.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/header.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" language="java"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%> @@ -9,16 +17,16 @@

BSH Generischer Viewer

-
+
diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/imprint.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/imprint.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/imprint.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,4 +1,13 @@ + +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> @@ -16,7 +25,7 @@

BSH Generischer Viewer

-
+
diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> <%@page import="de.intevation.gnv.action.CommunicationKeys"%> @@ -9,6 +17,7 @@ <%@page import="de.intevation.gnv.artifactdatabase.objects.ExportMode"%> <%@page import="java.util.Collection"%> <%@page import="java.util.Iterator"%> +<%@page import="java.util.Locale"%> <%@page import="java.net.URLEncoder"%> <% String exceptionMsg = (String)request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE); @@ -18,6 +27,7 @@ String targetSVG = "svg"; String targetIMG = "img"; SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + Locale locale = sm.getCurrentLocale(); OutputMode outputMode = sm.getOutputMode(target); DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); @@ -77,23 +87,23 @@ <%}%>
- "/> + " title=""/> <%}%> <%if (supportIMG != null) { %> - "> + "> <%}%> <%if (supportPDF != null) { %> diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> <%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> <%@page import="de.intevation.gnv.action.CommunicationKeys"%> @@ -9,6 +17,7 @@ <%@page import="de.intevation.gnv.artifactdatabase.objects.ExportMode"%> <%@page import="java.util.Collection"%> <%@page import="java.util.Iterator"%> +<%@page import="java.util.Locale"%> <%@page import="java.net.URLEncoder"%> <% String exceptionMsg = (String)request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE); @@ -18,6 +27,7 @@ String targetSVG = "svg"; String targetIMG = "img"; SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + Locale locale = sm.getCurrentLocale(); OutputMode outputMode = sm.getOutputMode(target); DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); @@ -84,7 +94,7 @@ else { check = "checked=\"checked\""; }%> - name="bintype" value="bincount" id="checkCount" onClick="toggleBinType('checkWidth')">  + name="bintype" value="bincount" id="checkCount" onClick="toggleBinType('checkWidth')"/> <%}%> <%if (om.getName().equals("binwidth")) { String check = ""; @@ -94,7 +104,7 @@ else if (diaOpts == null) { check = ""; }%> - name="bintype" value="binwidth" id="checkWidth" onClick="toggleBinType('checkCount')">  + name="bintype" value="binwidth" id="checkWidth" onClick="toggleBinType('checkCount')"/> <%}%> @@ -102,13 +112,13 @@ <%if (om.getType().equalsIgnoreCase("boolean")){ - boolean checked = useDiagrammOptions ? "true".equalsIgnoreCase(diagrammOptions.getValue(om.getName())) : om.getValue().equalsIgnoreCase("true"); + boolean checked = useDiagrammOptions ? "true".equalsIgnoreCase(diagrammOptions.getValue(om.getName(), locale)) : om.getValue().equalsIgnoreCase("true"); %> /> <%}else{%> - + <%}%> diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,19 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%> +
+

BSH Generischer Viewer

+
+
+
+
+
+
+
+
\ No newline at end of file diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,24 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%> + +
+

+ +

+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <% String geometry = "POINT (6.3333 56.5)"; String geometrytype = request.getParameter("gt"); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/display_wms_basic_informations.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_wms_basic_informations.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,32 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.map.MapService"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<% +SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); +MapService localMapService = sm.getLocalMapService(); +Collection layer = localMapService.getLayer(); +%> + +<%@page import="java.util.Collection"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.map.Layer"%> +<%@page import="java.util.Iterator"%>
+ + + + + + + + + +
:<%=localMapService.getURL()%>?SERVICE=WMS&REQUEST=GetCapabilities
:<%=localMapService.getTtl()%>
+
diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/display_wms_options_inc.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/includes/display_wms_options_inc.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_wms_options_inc.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> <%@page import="de.intevation.gnv.action.CommunicationKeys"%> @@ -8,6 +16,7 @@ <%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> <%@page import="java.util.Collection"%> <%@page import="java.util.Iterator"%> +<%@page import="java.util.Locale"%> <%@page import="java.net.URLEncoder"%> <% String exceptionMsg = (String) request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE); @@ -15,6 +24,7 @@ String layer = (String) request.getAttribute("layer"); String target = "wms"; SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + Locale locale = sm.getCurrentLocale(); OutputMode om = sm.getOutputMode(target); DiagrammOptions opts = sm.getDiagrammOptions(); String uuid = sm.getCurrentArtifact().getId(); @@ -44,7 +54,7 @@ <%if (param.getType().equalsIgnoreCase("boolean")) { - boolean checked = (opts != null) ? "true".equalsIgnoreCase(opts.getValue(param.getName())) : param.getValue().equalsIgnoreCase("true"); + boolean checked = (opts != null) ? "true".equalsIgnoreCase(opts.getValue(param.getName(), locale)) : param.getValue().equalsIgnoreCase("true"); %> /> <%} diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/info_english.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/info_english.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,13 @@ + + +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +
+
Further information are available in German only.
+
diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/info_german.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/info_german.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,67 @@ + + +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +
+ +

Informationen über den Generischen Viewer in der GDI BSH

+ + In der Geodateninfrastruktur des + Bundesamtes für Seeschifffahrt und Hydrographie (BSH) werden alle + wesentlichen marinen Geodaten in einem Data Warehouse vorgehalten. Neben dem + Geodatenportal, dem + GeoSeaPortal, werden v.a. die Parameter, die räumlich und zeitlich + variieren, über den Generischen Viewer bereitgestellt. +
Der Generische Viewer übernimmt die Aufgaben, den umfangreichen + Datenbestand des Data Warehouses Endnutzern strukturierbar anzubieten, um + fachliche Analysen wie Zeitreihen, unterschiedliche Profile, Schnittoperationen + und Statistiken browsergestützt durchführen zu können. Über umfangreiche + Exportfunktionen stehen Fachdaten und Visualisierungsprodukte zur weiteren + Bearbeitung bereit. Der Generische Viewer liefert damit einen zentralen + Zugangspunkt für Fachdaten, die über eine rein kartographische Visualisierung + hinausgehen. +
+ Weitere Informationen zur Geodateninfrastruktur des BSH (GDI-BSH) unter + http://www.geoseaportal.de + +

Kontakt

+ + Projektgruppe GDI BSH im Bundesamt + für Seeschifffahrt und Hydrographie Bernhard-Nocht-Straße 78 20359 Hamburg +

+ Fachliche Fragen Jürgen Schulz-Ohlberg +

+ Technische Fragen Jörg Gerdes +

+

Über Generischen Viewer (GNV)

+ + Die Software "Generische Viewer GDI-BSH" setzt auf dem verteilbaren Softwaresystem + des "Open Water Analyst" auf, um auf die umfangreichen Datenbestände des + Data Warehouses des BSH, realisiert auf ESRI ArcSDE und Oracle. Über ein + einheitliches Protokoll auf der Basis von REST steuert die webgestützte Oberfläche + des Generischen Viewers die Serverkomponente an, die für die Datenbeschaffung, die + -analyse und Ausgabengenerierung verantwortlich ist. Um vor allem Datenzugriffe zu + beschleunigen, sind Caching-Mechanismen integriert worden, die Zwischenergebnisse + vorhalten. + + Die Implementierung ist vollständig auf Basis Freier Software realisiert worden + und bindet alleinig properietäre Elemente zum Zugriff auf ESRI ArcSDE ein. Der + Generische Viewer ist eine Fachapplikation des Open Water Analyst. Die Umsetzung + weitere Fachlösungen ist aufgrund des Designs und eingesetzten Protokolles möglich. + +

Umsetzung

+ + Design und Implementation der Software durch die + Intevation GmbH, Bereich Geospatial: Hans Plum (Projektleitung), Tim + Englich, Sascha L. Teichmann und Ingo Weinzierl. + +

Lizenz

+ + Die Software wird voraussichtlich im Sommer 2010 als Freie Software veröffentlicht. +
diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,48 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@page import="de.intevation.gnv.action.MapClientStandaloneAction"%> +<% +boolean standalone = request.getAttribute(MapClientStandaloneAction.MAPCLIENTSTANDALONE_KEY) != null; +%> + + + + <bean:message key="gnviewer.app.title"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/index.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/index.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/index.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> <%@page import="java.util.Collection"%> @@ -14,15 +22,10 @@ Object chart = request.getAttribute("chart"); Object statistic = request.getAttribute("statistic"); Object histogram = request.getAttribute("histogram"); - Object wms = request.getAttribute("wms"); Object wms_published = request.getAttribute("wms_published"); - String serverPath = (String) request.getAttribute("mapserver"); - String mapfilePath = (String) request.getAttribute("mapfile"); - String layerName = (String) request.getAttribute("layer"); - String timeToLive = (String) request.getAttribute("ttl"); boolean furthertargets = true; - if (chart == null && statistic == null && histogram == null && wms == null) { + if (chart == null && statistic == null && histogram == null && wms_published == null) { boolean supportChart = sm.getOutputMode("chart") != null; if (supportChart) { chart = "true"; @@ -38,6 +41,10 @@ exceptionMessage = (exceptionMessage != null ? exceptionMessage.toString().replaceAll(" ", ".").replaceAll(":",".").toLowerCase() : null); exceptionMessage = (exceptionMessage != null && exceptionMessage.toString().endsWith(".") ? exceptionMessage.toString().substring(0,exceptionMessage.toString().length()-1) : exceptionMessage); + Object sessionException = request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_SESSION_ID); + sessionException = (sessionException != null ? sessionException.toString().replaceAll(" ", ".").replaceAll(":",".").toLowerCase() : null); + sessionException = (sessionException != null && sessionException.toString().endsWith(".") ? sessionException.toString().substring(0,sessionException.toString().length()-1) : sessionException); + boolean showmapviewercallBody = request.getAttribute("MAPVIEWERCALL") != null; String exceptionProject = (String) request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_PROJECT); @@ -107,7 +114,7 @@ <%=ui != null ? ui.toString().replaceAll(" ", "") : "" %> <%if(furthertargets){%> -
+
"/> <%}%> @@ -128,7 +135,7 @@ <%}%> <%-- render wms options --%> - <%if (wms != null) {%> + <%if (wms_published != null) {%> <%}%>
@@ -144,6 +151,11 @@

<%}%> + <%if (sessionException != null){ %> +
+ +
+ <%}%> <%if (chart != null) {%> <%-- render chart options if existing for this state --%> @@ -161,25 +173,7 @@ <%-- render wms layer --%> <%if (wms_published != null) {%> -
-
- - - - - - - - - - - - - -
:<%=serverPath%>?SERVICE=WMS&REQUEST=GetCapabilities
:<%=layerName%>
:<%=timeToLive%>
-
-
-
+ <%}%> diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/info.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/info.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/info.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,6 +1,23 @@ + +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@ page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@ page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@ page import="java.util.Locale"%> + +<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + Locale locale = sm.getCurrentLocale(); +%> @@ -16,7 +33,7 @@

BSH Generischer Viewer

-
+
@@ -31,7 +48,18 @@
- TODO: Info + <% + if (locale.getLanguage().equals(Locale.GERMAN.getLanguage())) { + %> + + <% + } + else { + %> + + <% + } + %>
diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,5 +1,14 @@ + +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> @@ -69,13 +78,11 @@
-

- -

- "> - - -

+ +

+ "> + +

diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/version.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/version.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/version.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,7 +1,16 @@ + +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> - + <bean:message key="gnviewer.app.title"/> @@ -42,4 +51,4 @@ <jsp:include page="footer.jsp" /> </div> </body> -</html> \ No newline at end of file +</html> diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp --- a/gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -1,84 +1,20 @@ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> -<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> -<% - String serverPath = (String) request.getAttribute("mapserver"); - String mapfilePath = (String) request.getAttribute("mapfile"); - String layerName = (String) request.getAttribute("layer"); - String timeToLive = (String) request.getAttribute("ttl"); -%> - -<html xmlns="http://www.w3.org/1999/xhtml"> - <head> - <title> - <bean:message key="gnviewer.app.title"/> - - - - - - - - - - - - - - +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> + + +
@@ -94,7 +30,7 @@
-
+
diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/jsp/wmsstandalone.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/wmsstandalone.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,16 @@ + + +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + + + + + + + diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/WEB-INF/web.xml --- a/gnv/src/main/webapp/WEB-INF/web.xml Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/WEB-INF/web.xml Fri Sep 28 12:15:22 2012 +0200 @@ -15,15 +15,6 @@ /WEB-INF/config/struts-config.xml - - - de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.count diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/cloud-popup-relative.png Binary file gnv/src/main/webapp/images/ol/cloud-popup-relative.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/east-mini.png Binary file gnv/src/main/webapp/images/ol/east-mini.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/feature_info_off.png Binary file gnv/src/main/webapp/images/ol/feature_info_off.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/feature_info_on.png Binary file gnv/src/main/webapp/images/ol/feature_info_on.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/folder-open.gif Binary file gnv/src/main/webapp/images/ol/folder-open.gif has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/folder.gif Binary file gnv/src/main/webapp/images/ol/folder.gif has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/leaf.gif Binary file gnv/src/main/webapp/images/ol/leaf.gif has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/navigation_history.png Binary file gnv/src/main/webapp/images/ol/navigation_history.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/north-mini.png Binary file gnv/src/main/webapp/images/ol/north-mini.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/pan_off.png Binary file gnv/src/main/webapp/images/ol/pan_off.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/pan_on.png Binary file gnv/src/main/webapp/images/ol/pan_on.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/slider.png Binary file gnv/src/main/webapp/images/ol/slider.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/south-mini.png Binary file gnv/src/main/webapp/images/ol/south-mini.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/tool-sprites.gif Binary file gnv/src/main/webapp/images/ol/tool-sprites.gif has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/west-mini.png Binary file gnv/src/main/webapp/images/ol/west-mini.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/zoom-minus-mini.png Binary file gnv/src/main/webapp/images/ol/zoom-minus-mini.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/zoom-plus-mini.png Binary file gnv/src/main/webapp/images/ol/zoom-plus-mini.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/zoom-world-mini.png Binary file gnv/src/main/webapp/images/ol/zoom-world-mini.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/zoom_box_off.png Binary file gnv/src/main/webapp/images/ol/zoom_box_off.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/zoom_box_on.png Binary file gnv/src/main/webapp/images/ol/zoom_box_on.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/images/ol/zoombar.png Binary file gnv/src/main/webapp/images/ol/zoombar.png has changed diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/scripts/ext/readme --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/ext/readme Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,3 @@ +curl "http://www.extjs.com/deploy/ext-2.3.0.zip" > ext-2.3.0.zip +unzip ext-2.3.0.zip +rm ext-2.3.0.zip \ No newline at end of file diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/scripts/geoext/readme --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/geoext/readme Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,4 @@ +curl "http://trac.geoext.org/attachment/wiki/Download/GeoExt-release-0.6.zip?format=raw" > GeoExt-release-0.6.zip +unzip GeoExt-release-0.6.zip +mv GeoExt geoext-0.6 +rm GeoExt-release-0.6.zip \ No newline at end of file diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/scripts/layers.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/layers.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,62 @@ + +<%@page import="java.util.Iterator"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.map.Layer"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.map.MapService"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%>/** + * This function is called while initializing the application. You are allowed + * to change/add/remove layers. But be are of the comments inline this code! + */ +function initLayers() { + /** + * XXX This application needs a layer that is stored in a variable called + * 'layer'. So do not change the name of this variable. Just change the WMS + * layer itself. + */ + layer = new OpenLayers.Layer.WMS( + "Background1", + "http://gdisrv.bsh.de/arcgis/services/Background/Background/MapServer/WMSServer?", + { + layers: '0', + format: 'image/png', + transparent: false + }, + { + isBaseLayer: true, + singleTile: true + } + + ); + /** + * XXX This application needs an ARRAY that stores some layers (or a single + * layer). Do not change the name of the following variable 'layers'. + */ + layers = []; + layers[0] = layer; + + <% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + MapService localMapService = sm.getLocalMapService(); + Iterator it = localMapService.getLayer().iterator(); + int i = 1; + while (it.hasNext()){ + Layer layer = it.next(); + %> + layer<%=i%> = new OpenLayers.Layer.WMS( + "<%=layer.getID() %>", + "<%=localMapService.getURL() %>", + { + layers: '<%=layer.getName()%>', + format: 'image/png', + transparent: true + }, + { + isBaseLayer: false, + singleTile: true + } + + ); + layers[<%=i%>] = layer<%=i++%>; + <%}%> + +} diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/scripts/olutils.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/olutils.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,238 @@ +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +function handleMeasurements(event) { + var geometry = event.geometry; + var units = event.units; + var order = event.order; + var measure = event.measure; + var element = document.getElementById('measurements'); + + var out = ""; + if(order == 1) { + out += "L\u00e4nge: " + measure.toFixed(3) + " " + units; + } else { + out += "Fl\u00e4che: " + measure.toFixed(3) + " " + units + "2"; + } + + element.innerHTML=out; +}; + + + +function readWMC(merge) { + var layers = mapPanel.layers; + map = mapPanel.map; + + var format = new OpenLayers.Format.WMC({'layerOptions': {buffer: 0}}); + var text = document.getElementById("wmc").value; + + merge = true; + if(merge) { + try { + map = format.read(text, {map: map}); + } catch(err) { + document.getElementById("wmc").value = err; + } + } else { + map.destroy(); + try { + var jsonFormat = new OpenLayers.Format.JSON(); + var mapOptions = jsonFormat.read(); + map = format.read(text, {map: mapOptions}); + } catch(err) { + document.getElementById("wmc").value = err; + } + } + + // create MapPanel + mapPanel = new GeoExt.MapPanel({ + border: true, + title: "Karte", + region: "center", + map: map, + zoom: 1, + layers: map.layers + }); +} + + +function writeWMC(merge) { + var format = new OpenLayers.Format.WMC({'layerOptions': {buffer: 0}}); + + try { + var text = format.write(map); + document.getElementById("wmc").value = text; + } catch(err) { + document.getElementById("wmc").value = err; + } +} + + + +function toggleGetFeatureInfo(evt) { + if (infoActive) { + infoControls.click.deactivate(); + infoActive = false; + } + else { + infoControls.click.activate(); + infoActive = true; + } +} + + +function showInfo(evt) { +} + + +function addLayer() { + var records = grid.getSelectionModel().getSelections(); + for (rec in records){ + + var record = records[rec]; + // TODO: Look for something better than object + if (typeof record == "object"){ + var copy = record.copy(); + copy.set("layer", record.get("layer")); + copy.get("layer").mergeNewParams({ + format: "image/png", + transparent: true + }); + mapPanel.layers.add(copy); + } + } + +} + + +// this is just copied from OpenLayers.Util +function urlAppend(url, paramStr) { + var newUrl = url; + if(paramStr) { + var parts = (url + " ").split(/[?&]/); + newUrl += (parts.pop() === " " ? + paramStr : + parts.length ? "&" + paramStr : "?" + paramStr); + } + return newUrl; +} + +function showWarning(){ + if (store.data.length == 0){ + Ext.MessageBox.alert("", '', grid); + return; + } +} + + +function updateCapabilities() { + + var url = capfield.getValue(); + var service = "SERVICE=WMS"; + var request = "REQUEST=GetCapabilities"; + var version = "VERSION=1.1.1"; + url = urlAppend(url, service); + url = urlAppend(url, request); + url = urlAppend(url, version); + + store = new GeoExt.data.WMSCapabilitiesStore({ + url: url, + layerOptions: {singleTile: true} + }); + store.load({ + callback: showWarning + }); + + grid.destroy(); + grid = new Ext.grid.GridPanel({ + id: 'wmsgrid', + collapsible: false, + split: false, + border: true, + // TODO: autoHeight might cause trouble + autoHeight: true, + overflow: 'auto', + store: store, + cm: new Ext.grid.ColumnModel([ + { + header: '', + dataIndex: 'name', + sortable: true + }, + { + id: 'title', + header: '', + dataIndex: 'title', + sortable: true + }]), + renderTo: 'capgrid', + bbar: [{ + text: '', + handler: addLayer + }] + }); +} + + +function editFeature(e) { + var feature = e.feature; + + // TODO SET FEATURE ATTRIBUTES + //feature.attributes['lawa'] = 999; + //feature.attributes['lawa_id'] = 999; + //feature.attributes['w_gwk_lawa'] = 999; + //feature.attributes['w_wrrl'] = 999; + //feature.attributes['length_fee'] = 999; +} + +function updateControls() { + var controls = panel.controls; + + controls.remove(drawPointControl); + controls.remove(drawPathControl); + controls.remove(drawPolygonControl); + + panel.destroy(); + panel = new OpenLayers.Control.Panel(); + panel.addControls(controls); + + if (points.getVisibility()) + panel.addControls(drawPointControl); + if (lines.getVisibility()) + panel.addControls(drawPathControl); + if (polygons.getVisibility()) + panel.addControls(drawPolygonControl); + + map.addControl(panel); +} +function parseGetFeatureInfoData(event) { + var contentHTML = "
"; + var features = event.features; + var first = true; + for (feat in features){ + if (feat != 'remove'){ + var feature = features[feat]; + var attributes = feature.attributes; + if (first){ + first = false; + }else{ + contentHTML += "
"; + } + contentHTML += ""; + for (att in attributes){ + contentHTML += ""; + } + contentHTML += "
"+att+":" + attributes[att] + "
"; + } + + } + contentHTML += "
"; + + mapPanel.map.addPopup(new OpenLayers.Popup.FramedCloud( + "chicken", + mapPanel.map.getLonLatFromPixel(event.xy), + null, + contentHTML, + null, + true + )); +} \ No newline at end of file diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/scripts/openlayers/readme --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/openlayers/readme Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,3 @@ +curl "http://www.openlayers.org/download/OpenLayers-2.9.zip" > OpenLayers.zip +unzip OpenLayers.zip +rm OpenLayers.zip \ No newline at end of file diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/scripts/viewport.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/viewport.jsp Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,301 @@ +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="de.intevation.gnv.action.MapClientStandaloneAction"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.map.MapService"%> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<% +boolean standalone = request.getParameter(MapClientStandaloneAction.MAPCLIENTSTANDALONE_KEY) != null && +request.getParameter(MapClientStandaloneAction.MAPCLIENTSTANDALONE_KEY).equals("true"); +MapService mapService = SessionModelFactory.getInstance().getSessionModel(request).getLocalMapService(); +%> +OpenLayers.ImgPath = "images/ol/"; +OpenLayers.ProxyHost= "/cgi-bin/proxy.cgi?url="; +OpenLayers.Lang.setCode('<%=SessionModelFactory.getInstance().getSessionModel(request).getCurrentLocale().getLanguage() %>'); +Ext.BLANK_IMAGE_URL = "scripts/openlayers/OpenLayers-2.9/theme/default/img/blank.gif"; + +/** + * XXX + * Change specific attributes for map, wfs-t, etc here. Do not change these + * settings inline the code! + */ +PROJECTION = "EPSG:4326"; +MAX_EXTENT = new OpenLayers.Bounds(-90,-180,90,180); +CURRENT_EXTENT = new OpenLayers.Bounds(<%=mapService.getBBoxValue().replace(' ',',')%>); +INITIAL_CENTER = new OpenLayers.LonLat(5, 55); +GETFEATUREINFO_URL = "<%=mapService.getURL()%>"; + +Ext.onReady(function() { + + /* this function call initialized the layers that are defined by the user. + * The variable 'layer' and 'layers' are initialized in this function as + * well, that are used in the following code! So do not remove this function + * call. + */ + initLayers(); + + var options = { + maxExtent: MAX_EXTENT, + projection: PROJECTION, + controls: [], + units: 'm' + }; + + +/* ------------------------ Create map and add controls ---------------------*/ + // create map + map = new OpenLayers.Map(options); + map.displayProjection = new OpenLayers.Projection(PROJECTION); + + // add controls + + + var nav = new OpenLayers.Control.NavigationHistory(); + nav.previous.title = ""; + nav.next.title = ""; + map.addControl(nav); + + panel = new OpenLayers.Control.Panel(); + controls = { + previous: nav.previous, + next : nav.next, + navigate: new OpenLayers.Control.Navigation( + { + displayClass: 'olControlPan', + autoActivate: 'false', + title:'' + } + ), + zoombox: new OpenLayers.Control.ZoomBox( + { + displayClass: 'olControlZoomBox', + title: '' + } + ), + info : new OpenLayers.Control.WMSGetFeatureInfo({ + displayClass: "olControlFeatureInfo", + url: GETFEATUREINFO_URL, + title: '', + queryVisible: true, + infoFormat: 'application/vnd.ogc.gml', + eventListeners: { + getfeatureinfo: parseGetFeatureInfoData + } + }) + }; + + for (var key in controls) { + panel.addControls([controls[key]]); + } + + map.addControl(panel); + map.addControl(new OpenLayers.Control.PanZoomBar({zoomWorldIcon: 'true'})); + // Displaying the mouse postion + mousePosition = new OpenLayers.Control.MousePosition(); + map.addControl(mousePosition); + +/* --------------------------------------------------------------------------- */ + + // create MapPanel + mapPanel = new GeoExt.MapPanel({ + border: true, + region: "center", + map: map, + layers: layers + }); + + //map.setCenter(INITIAL_CENTER); + + + store = new GeoExt.data.WMSCapabilitiesStore({ + }); + + grid = new Ext.grid.GridPanel({ + id: 'wmsgrid', + collapsible: false, + split: false, + border: true, + //height: 400, + autoHeight: true, + store: store, + cm: new Ext.grid.ColumnModel([ + { + header: '', + dataIndex: 'name', + sortable: true + }, + { + id: 'title', + header: '', + dataIndex: 'title', + sortable: true + }]), + renderTo: 'capgrid', + bbar: [{ + text: '', + handler: addLayer + }] + }); + var cap = new Ext.Panel({ + id: 'wmspanel', + border: true, + region: 'east', + title: '', + collapsible: false, + split: false, + height: 400, + contentEl: 'cap' + + }); + + var capstore = new Ext.data.SimpleStore({ + fields: ['name','url'], + data : [['','<%=mapService.getURL()%>'],] + }); + capfield = new Ext.form.ComboBox({ + id: 'capfield', + store: capstore, + displayField:'name', + width: 245, + valueField: 'url', + mode: 'local', + triggerAction: 'all', + selectOnFocus: true, + renderTo: 'urlinput', + editable: false, + value: '<%=mapService.getURL()%>' + + }); + + + + var capbutton = new Ext.Button({ + id: 'capbutton', + region: 'west', + handler: updateCapabilities, + text: '', + tooltip: '', + renderTo: 'urlbutton' + }); + + + + +/* --------------------------- Layer Tree ----------------------------------- */ + + + // LayerTree + var tree = new Ext.tree.TreePanel({ + border: true, + enableDD: true, + region: "east", + title: "", + width: 200, + split: true, + collapsible: false, + collapseMode: "mini", + autoScroll: true, + loader: new Ext.tree.TreeLoader({ + applyLoader: false, + }), + root: { + nodeType: "async", + children: [{ + nodeType: "gx_baselayercontainer", + text: "", + expanded: true + }, { + nodeType: "gx_overlaylayercontainer", + text: "", + expanded: true, + loader: { + filter: function(record) { + var layer = record.get("layer"); + return layer.displayInLayerSwitcher === true && + layer.isBaseLayer === false; + } + } + }] + }, + rootVisible: false, + lines: false + }); + +/*-------------------------------- Feature grid -------------------------------*/ + + // create legend paneclass="headerLineLinksl + legendPanel = new GeoExt.LegendPanel({ + id: 'legendpanel', + dynamic: true, + border: true, + title: '', + collapsible: false, + split: false, + defaults: { + labelCls: 'legend', + style: 'padding: 5px' + }, + bodyStyle: 'padding:5px', + width: 250, + autoScroll: true, + region: 'east', + }); + + +// use separate panels + // Create GUI + + var mylegend = new Ext.Panel( + { + region: "west", + title: '', + split: true, + width: 250, + minSize: 225, + maxSize: 400, + collapsible: false, + overflow: 'auto', + margins: '0 0 0 5', + layout: 'accordion', + layoutConfig: { + animate: true, + activeOnTop: false + }, + items: [ + tree, + legendPanel, + cap + ] + } + ); + <%if (!standalone){%> + // The main panel + new Ext.Panel({ + renderTo: "mapcontainer", + layout: "border", + height: 400, + items: [mapPanel, mylegend] + }); + <%}else{ %> + // Create GUI + new Ext.Viewport({ + layout: "border", + items: [ + { + region: "north", + contentEl: "headline", + cls: 'title', + height: 40 + }, + mylegend, + mapPanel + ] + }); + <%}%> + map.zoomToExtent(CURRENT_EXTENT); + + // some code for automatically resizing the map panel if the window size + // changes + window.onresize=function() { + var mapcontainer = Ext.get('mapcontainer'); + mapPanel.setSize(mapcontainer.getSize()); + } +}); diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/styles/calendar-blue.css --- a/gnv/src/main/webapp/styles/calendar-blue.css Fri Sep 28 12:13:58 2012 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,232 +0,0 @@ -/* The main calendar widget. DIV containing a table. */ - -div.calendar { position: relative; } - -.calendar, .calendar table { - border: 1px solid #556; - font-size: 11px; - color: #000; - cursor: default; - background: #eef; - font-family: tahoma,verdana,sans-serif; -} - -/* Header part -- contains navigation buttons and day names. */ - -.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ - text-align: center; /* They are the navigation buttons */ - padding: 2px; /* Make the buttons seem like they're pressing */ -} - -.calendar .nav { - background: #778 url(menuarrow.gif) no-repeat 100% 100%; -} - -.calendar thead .title { /* This holds the current "month, year" */ - font-weight: bold; /* Pressing it will take you to the current date */ - text-align: center; - background: #fff; - color: #000; - padding: 2px; -} - -.calendar thead .headrow { /* Row containing navigation buttons */ - background: #778; - color: #fff; -} - -.calendar thead .daynames { /* Row containing the day names */ - background: #bdf; -} - -.calendar thead .name { /* Cells containing the day names */ - border-bottom: 1px solid #556; - padding: 2px; - text-align: center; - color: #000; -} - -.calendar thead .weekend { /* How a weekend day name shows in header */ - color: #a66; -} - -.calendar thead .hilite { /* How do the buttons in header appear when hover */ - background-color: #aaf; - color: #000; - border: 1px solid #04f; - padding: 1px; -} - -.calendar thead .active { /* Active (pressed) buttons in header */ - background-color: #77c; - padding: 2px 0px 0px 2px; -} - -/* The body part -- contains all the days in month. */ - -.calendar tbody .day { /* Cells containing month days dates */ - width: 2em; - color: #456; - text-align: right; - padding: 2px 4px 2px 2px; -} -.calendar tbody .day.othermonth { - font-size: 80%; - color: #bbb; -} -.calendar tbody .day.othermonth.oweekend { - color: #fbb; -} - -.calendar table .wn { - padding: 2px 3px 2px 2px; - border-right: 1px solid #000; - background: #bdf; -} - -.calendar tbody .rowhilite td { - background: #def; -} - -.calendar tbody .rowhilite td.wn { - background: #eef; -} - -.calendar tbody td.hilite { /* Hovered cells */ - background: #def; - padding: 1px 3px 1px 1px; - border: 1px solid #bbb; -} - -.calendar tbody td.active { /* Active (pressed) cells */ - background: #cde; - padding: 2px 2px 0px 2px; -} - -.calendar tbody td.selected { /* Cell showing today date */ - font-weight: bold; - border: 1px solid #000; - padding: 1px 3px 1px 1px; - background: #fff; - color: #000; -} - -.calendar tbody td.weekend { /* Cells showing weekend days */ - color: #a66; -} - -.calendar tbody td.today { /* Cell showing selected date */ - font-weight: bold; - color: #00f; -} - -.calendar tbody .disabled { color: #999; } - -.calendar tbody .emptycell { /* Empty cells (the best is to hide them) */ - visibility: hidden; -} - -.calendar tbody .emptyrow { /* Empty row (some months need less than 6 rows) */ - display: none; -} - -/* The footer part -- status bar and "Close" button */ - -.calendar tfoot .footrow { /* The in footer (only one right now) */ - text-align: center; - background: #556; - color: #fff; -} - -.calendar tfoot .ttip { /* Tooltip (status bar) cell */ - background: #fff; - color: #445; - border-top: 1px solid #556; - padding: 1px; -} - -.calendar tfoot .hilite { /* Hover style for buttons in footer */ - background: #aaf; - border: 1px solid #04f; - color: #000; - padding: 1px; -} - -.calendar tfoot .active { /* Active (pressed) style for buttons in footer */ - background: #77c; - padding: 2px 0px 0px 2px; -} - -/* Combo boxes (menus that display months/years for direct selection) */ - -.calendar .combo { - position: absolute; - display: none; - top: 0px; - left: 0px; - width: 4em; - cursor: default; - border: 1px solid #655; - background: #def; - color: #000; - font-size: 90%; - z-index: 100; -} - -.calendar .combo .label, -.calendar .combo .label-IEfix { - text-align: center; - padding: 1px; -} - -.calendar .combo .label-IEfix { - width: 4em; -} - -.calendar .combo .hilite { - background: #acf; -} - -.calendar .combo .active { - border-top: 1px solid #46a; - border-bottom: 1px solid #46a; - background: #eef; - font-weight: bold; -} - -.calendar td.time { - border-top: 1px solid #000; - padding: 1px 0px; - text-align: center; - background-color: #f4f0e8; -} - -.calendar td.time .hour, -.calendar td.time .minute, -.calendar td.time .ampm { - padding: 0px 3px 0px 4px; - border: 1px solid #889; - font-weight: bold; - background-color: #fff; -} - -.calendar td.time .ampm { - text-align: center; -} - -.calendar td.time .colon { - padding: 0px 2px 0px 3px; - font-weight: bold; -} - -.calendar td.time span.hilite { - border-color: #000; - background-color: #667; - color: #fff; -} - -.calendar td.time span.active { - border-color: #f00; - background-color: #000; - color: #0f0; -} diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/styles/extjs-override.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/styles/extjs-override.css Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,35 @@ +.x-panel-header { + background: #F2F1F5; + border:1px solid #003A66; + color:#003A66; +} + +.x-border-layout-ct { + background:#F2F1F5; +} + +.x-panel-body { + border:1px solid #003A66; +} + +.x-toolbar{ + background:#F2F1F5; +} + +.x-panel-bbar .x-toolbar { + border:1px solid #003A66; +} + +.x-tool { + background:transparent url(../images/ol/tool-sprites.gif) no-repeat; +} + +.x-tree-node-expanded .x-tree-node-icon{ + background-image:url(../images/ol/folder-open.gif); +} +.x-tree-node-leaf .x-tree-node-icon{ + background-image:url(../images/ol/leaf.gif); +} +.x-tree-node-collapsed .x-tree-node-icon{ + background-image:url(../images/ol/folder.gif); +} \ No newline at end of file diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/styles/gnv.css --- a/gnv/src/main/webapp/styles/gnv.css Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/main/webapp/styles/gnv.css Fri Sep 28 12:15:22 2012 +0200 @@ -80,6 +80,13 @@ padding: 10px; } +.infoheadline { + border: 0; + color: #4C7594; + font-family: "Arial Black",Arial,Helvetica,sans-serif; + padding: 0; +} + .headerTableLinks { width: 100%; background-color: #003a66; @@ -128,6 +135,11 @@ vertical-align: top; } +.info-content { + padding-left : 15px; + padding-right: 15px; +} + #parameterColumn { width: 400px; } diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/main/webapp/styles/ol_style.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/styles/ol_style.css Fri Sep 28 12:15:22 2012 +0200 @@ -0,0 +1,69 @@ +.wmcbox { + width: 100%; + height: 480px; +} + +.olControlPanel div { + background-color: white; + float: left; + display: block; + position: relative; + left: 80px; + margin: 5px; + width: 24px; + height: 24px; +} + +.olControlPanel .olControlFeatureInfoItemActive { + width: 22px; + height: 22px; + background-image: url("../images/ol/feature_info_on.png"); +} +.olControlPanel .olControlFeatureInfoItemInactive { + width: 22px; + height: 22px; + background-image: url("../images/ol/feature_info_off.png"); +} + + +.olControlNavigationHistory { + background-image: url("../images/ol/navigation_history.png"); + background-repeat: no-repeat; + width: 22px; + height: 22px; + +} + +.olControlPanel .olControlPanItemActive { + width: 22px; + height: 22px; + background-image: url("../images/ol/pan_on.png"); +} +.olControlPanel .olControlPanItemInactive { + width: 22px; + height: 22px; + background-image: url("../images/ol/pan_off.png"); +} + +.olControlPanel .olControlZoomBoxItemActive { + width: 22px; + height: 22px; + background-image: url("../images/ol/zoom_box_on.png"); +} +.olControlPanel .olControlZoomBoxItemInactive { + width: 22px; + height: 22px; + background-image: url("../images/ol/zoom_box_off.png"); +} + +div.olControlMousePosition { + color:#003A66; + background-color: #F2F1F5; + filter: alpha(opacity=75); + opacity: 0.75 +} + +.olHandlerBoxZoomBox { + border: 2px solid #003A66; + background-color: #F2F1F5;; +} diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/test/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserTestCase.java --- a/gnv/src/test/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/test/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.action.mapviewer.parser; import de.intevation.gnv.artifactdatabase.objects.map.Layer; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java --- a/gnv/src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.artifactdatabase.client; import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; diff -r 11d8cc2deb92 -r f444cfce0b3d gnv/src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java --- a/gnv/src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java Fri Sep 28 12:13:58 2012 +0200 +++ b/gnv/src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java Fri Sep 28 12:15:22 2012 +0200 @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + package de.intevation.gnv.util; import de.intevation.gnv.artifactdatabase.client.DefaultArtifactDatabaseClient;