# HG changeset patch # User Thomas Arendsen Hein # Date 1348827227 -7200 # Node ID 465e70422e664d796c77c11e46ce9ed7d9c47036 # Parent d8f3ef441bf28079d57acd5781d3246bb0df050b# Parent 27082b83c2677503b0c31927158aa1fcc93ea491 merged geo-backend/0.3 diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/ChangeLog --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/ChangeLog Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,2754 @@ +2009-12-17 Sascha L. Teichmann + + RELEASE 0.3 + + * Changes, NEWS, ChangeLog: Summarized activities + +2009-12-17 Sascha L. Teichmann + + * doc/conf/conf.xml: Bind REST server to localhost. + +2009-12-17 Sascha L. Teichmann + + * src/test/ressources/lang/artifactMessages_de_DE.properties, + src/main/resources/lang/artifactMessages_de_DE.properties, + src/main/resources/lang/artifactMessages_de.properties: + s/Modeldaten/Modelldaten + +2009-12-17 Sascha L. Teichmann + + * src/main/resources/lang/artifactMessages_de_DE.properties, + src/main/resources/lang/artifactMessages_de.properties: Removed + wkt line strings. + +2009-12-17 Ingo Weinzierl + + * doc/conf/queries.properties: Added K-position to sql statement for + verticalprofile charts on meshes. + + * src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java, + src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java: Changed + the depending axis for gap detection on meshes for verticalprofile charts. + +2009-12-17 Ingo Weinzierl + + Issue 106 + + * src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java: + Fixed a file-leak bug while reading chart template. Sourced parsing of xml + file out to XMLUtils of de.intevation.artifactdatabase.XMLUtils. + +009-12-17 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileOutputState.java, + src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileOutputState.java, + src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java: + Added column labels for csv export. + +2009-12-17 Hans Plum + + Issue 129: Release 0.2: Verbesserung der Übersetzungen + + * src/main/resources/lang/artifactMessages_de_DE.properties, + src/main/resources/lang/artifactMessages_de.properties: + Fixed i18n strings for german language + +2009-12-16 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/math/Interpolation2D.java: + Fixed index error in i-gab detection between neighbors. + +2009-12-16 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java: + Override method to create chart. Fixed some bugs for interpolation. + + * src/main/java/de/intevation/gnv/chart/HorizontalCrossProfileChart.java: + Chart class for generating horizontal crossprofile charts. Horizontal + crossprofile charts are a subclass of horizontal profile charts. + + * src/main/java/de/intevation/gnv/math/Point2d.java: Changed epsilon value. + + * src/main/java/de/intevation/gnv/math/Interpolation2D.java: Fixed some bugs + regarding buffer size to limit data for interpolation. + + TODO: At the moment, there is no gap detection for horizontal crossprofile + charts. + +2009-12-16 Ingo Weinzierl + + Issue100 + + * src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java, + src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java, + src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java: + Workarround: Store information about max range of data for each parameter + while iterating over all data values. Set the max range at the end of + chart generation. + + NOTE: NumberAxis.setAutoRange(true) doesn't seem to work properly. + +2009-12-16 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java: + Removed useless import of VerticalCrossSectionChartFactory. + + * src/main/java/de/intevation/gnv/chart/HorizontalCrossSectionChartFactory.java, + src/main/java/de/intevation/gnv/chart/VerticalProfileChartFactory.java, + src/main/java/de/intevation/gnv/chart/VerticalCrossSectionChartFactory.java, + src/main/java/de/intevation/gnv/chart/HorizontalProfileChartFactory.java, + src/main/java/de/intevation/gnv/chart/ChartFactory.java: Removed useless + chart factory classes. + +2009-12-16 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/utils/DistanceCalculator.java: + Added method to calculate distance of path. + TODO: Move this class into math package and and add + an slerp interpolator so it can be used as a metric inside + the interpolation code. + + * src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java: + Added code to disassemble the incoming result set, interpolate + along a given path and returns an adjusted result set. + The (i, j) got lost on this track because we don't travel along + the main axis of the grid any more. The test for gaps has to be + adjusted because, because the dx/dy on the path depends on how + many steps are made on the way [*]. This is controlled by the system + property 'interpolation.step.width'. It is set in meters + and defaults to 100m. TODO: This should be configurable + in the conf.xml file. + + [*] I opt strongly for integration of the outlier test based gap + detection to overcome this problem. + +2009-12-15 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/math/LinearToMap.java: + Uses JTS Coordinate as geometry model now. + + * src/main/java/de/intevation/gnv/math/Metrics.java, + src/main/java/de/intevation/gnv/math/Interpolator.java: New. + Moved from inner class of LinearToMap to top level class + to be more reusable. Uses JTS Coordinate as geometry model now. + + * src/main/java/de/intevation/gnv/math/Point2d.java: New. + Extends JTS Coordinate to have an additional (i, j) + to model the topological neighborhood within the mesh, too. + + * src/main/java/de/intevation/gnv/math/Interpolation2D.java: New. + Has a method interpolate() which takes a path line string in form + of a list of JTS Coordinates, a list of grid points (Point2d + to carry the topology, too), a linear range in diagram coordinate + space, a metric to cope with the projection. It reports + interpolated points to an implementor of the new inner interface + Consumer as a JTS Coordinate. (x, y) of this coordinate is the + postion on the map, the z value is the interpolated attribute. + + To speed up the search for the neighbors the input points are + sorted into a quadtree and are queried first level with a buffer of + size (max(abs(p[i].x - p[i+1].x)), max(abs(p[i].y - p[i+1].y))) + around the point to be interpolated. The second level filter + is performed by an inverse L1-ordering with region coding, so + that only the nearest four neighbors are taken into acount. + Only if all four neighbors are present and no + i- or j-gaps exist the interpolation is performed. TODO: Create + a better extrapolation strategy in these cases were these conditions + are not fulfilled. + + * src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java: + Added a process() method to perform the interpolation. It does + nothing by now. TODO: bring it to life. + +2009-12-15 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/math/LinearToMap.java: Map linear + coordinates (from, to) to world coordinates (x, y) along a line string + given by a set of java.awt.geom.Point2D points. + + * src/main/java/de/intevation/gnv/math/LinearMetrics.java: Implements + Euclidean metric used by LinearToMap. TODO: Do same for WGS84 to + be more precise. + +2009-12-15 Tim Englich + + * src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java (calculateStatistics): + Issue96 Resloved big that one entry is missiing in the Statitic. + The last row of the ResultSet was never used. + +2009-12-15 Ingo Weinzierl + + Issue106 + + * doc/conf/conf.xml: Added charttemplate to global configuration. + + * src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java: Made + method static to call it without initiating an object of its class. + + * src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java: + Create ChartTheme at startup of artifact server and put it into global + context. The theme is created one time on this way. + + * src/main/java/de/intevation/gnv/state/OutputState.jav, + src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java: Changed + signature of 'out'-method. Call 'out' with CallContext instead of + CallMeta, which is contained in CallContext. CallContext is needed to + fetch the ChartTheme out of it. + + * 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/HorizontalProfileOutputState.java, + src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileOutputState.java: + Changed signature of 'getChart'-method which now gets the CallContext + containing the ChartTheme. + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java: + Get ChartTheme from CallContext instead of reading the XML file here. + +2009-12-15 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java: + If a few (i, j) values are not available (gaps in the grid) try + to fill the holes with guessing the values by the ones which could + be fetched. We are using a componentwise linear function here. + This is surely slightly wrong because world coordinates are + in WGS84 which is ellipsoid in nature. TODO: Look at the errors + and if needed compensate them by using cubic polynonial or ellipsoid + function terms. + + * src/main/java/de/intevation/gnv/math/LinearFunction.java: New. + Linear function to be used in curve fitting process. + +2009-12-15 Tim Englich + + * doc/conf/queries.properties: + Added the Unit of the Parameter to the Query for Parameters in + all Parameterqueries where it was still missing. Now the Unit will + be displaied in the Combobox and in the Diagramm-Axis-Description. + +2009-12-15 Sascha L. Teichmann + + * pom.xml: Upgraded to Apache Commons Math 2.0. Needed for + curve fitting (splines e.g) + + * src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java: + Use 'new DescriptiveStatistics()' instead of + 'DescriptiveStatistics().newInstance()' to be compatible with new + math api. + +2009-12-15 Tim Englich + + Added the Unit of the Parameter to the Query for Parameters in + TimeSeries. Now teh Unit will be displaied in the Combobox and + in the Diagramm-Axis-Description. + + * src/main/resources/lang/artifactMessages*.properties: + Added the name Productname for "horizontale Schnittprofile". to the + Resources so that it could be displaied properly in the GUI + +2009-12-15 Tim Englich + + * src/main/resources/lang/artifactMessages*.properties: + Added the required Resources for the Outputelements of "horizontale Schnittprofile". + * doc/conf/queries.properties: + Added the specialized Queries for getting the Data and the depths for + generating "horizontale Schnittprofile". + * src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java (log): + Added an new OutputTransition to handle the special Way to d detremine the required + Data for generating "horizontale Schnittprofile". + * doc/conf/conf.xml, + doc/conf/products/horizontalprofile/conf_mesh_cross.xml, + src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshCrossArtifact.java: + Added Support for "Horizontales Schnittprofil"-Artifacts to the Project + +2009-12-15 Ingo Weinzierl + + Issue102 + + * src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java: + Reset 'nextColor' at the beginning of chart creation. Now, color of lines + in charts are stable, which means, that an export will look like the chart + in the gui itself. + +2009-12-14 Ingo Weinzierl + + Issue101 + + * src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java: Changed date + representation in timeseries charts. Date format is sourced out to + ressource files. German date representation is now 'dd-MMM-yyyy' (eg + 31-12-2009) and the english date representation is 'yyyy-MMM-dd' (eg + 2009-12-31). + + * 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 date format + strings for timeseries charts. + +2009-12-14 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/utils/IndexBuffer.java: + Creates SQL-WHERE clauses for buffers around a list of + line segments in index (i, j) space. + +2009-12-11 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileOutputState.java: + Exception handling while creating subtitle of horizontalprofile charts. + Included the case, that there is no start and no end date. + +2009-12-11 Sascha L. Teichmann + + * src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointTimeSeriesTestCase.java, + src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java: + Removed needless imports. + +2009-12-11 Tim Englich + + * doc/conf/queries.properties: + Added Z-Value to verticalcrosssection_mesh_chart_data. + +2009-12-11 Tim Englich + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCaseBase.java, + src/test/java/de/intevation/gnv/artifacts/InstantaneousPointHorizontalProfileTestCase.java, + src/test/java/de/intevation/gnv/artifacts/InstantaneousPointVerticalProfileTestCase.java, + src/test/java/de/intevation/gnv/artifacts/MeshHorizontalCrossSectionTestCase.java, + src/test/java/de/intevation/gnv/artifacts/MeshHorizontalProfileTestCase.java, + src/test/java/de/intevation/gnv/artifacts/MeshTimeSeriesTestCase.java, + src/test/java/de/intevation/gnv/artifacts/MeshVerticalCrossSectionTestCase.java, + src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointTimeSeriesTestCase.java, + src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointVerticalProfileTestCase.java, + src/test/java/de/intevation/gnv/artifacts/MeshVerticalProfileTestCase.java: + Split all Unittestcases in separat Classes. Now it is easier to uses the UnitTests with Maven. + +2009-12-11 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java: Fade out + gridlines of range axis in charts if there are more than one axis. + +2009-12-11 Ingo Weinzierl + + * 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 axis labels + for horizontalprofile, verticalprofile, horizontalcrosssection and + verticalcrosssection charts. + + * 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/HorizontalProfileOutputState.java, + src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileOutputState.java: + Read axis labels from ressources instead of hard coded strings in code. + +2009-12-11 Ingo Weinzierl + + Cleared Issue104. + + * 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 axis label + for timeseries charts. + + * src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java: + Removed hard coded axis label of timeseries charts. Read label from + ressources. + +2009-12-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java, + src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java: Added + gap detection for horizontal and vertical profile charts. + +2009-12-09 Sascha L. Teichmann + + * doc/conf/conf.xml: Expanded the time to live of inactive artifacts + to 3600000ms (= 1h). Dead artifacts are removed from databasse + only every 15mins now. Improved the description on the artifact + factories. + +2009-12-08 Tim Englich + + * doc/conf/queries.properties: + Added the Unit of the Parameter to the Query for Parameters in + TimeSeries. Now teh Unit will be displaied in the Combobox and + in the Diagramm-Axis-Description. + +2009-12-08 Tim Englich + * src/main/java/de/intevation/gnv/transition/profile: + Removed empty needless package. + * src/main/java/de/intevation/gnv/transition/TransitionFactory.java: + src/main/java/de/intevation/gnv/transition/ValueCompareTransition.java, + src/main/java/de/intevation/gnv/transition/TransitionBase.java, + src/main/java/de/intevation/gnv/transition/Transition.java, + src/main/java/de/intevation/gnv/transition/DefaultTransition.java: + The new Transitions which has the only job to provide the connectios between + the different States and look if it is Possible to go the different Ways. + * src/main/java/de/intevation/gnv/state/StateBase.java, + src/main/java/de/intevation/gnv/state/State.java: + Removed the Logic to descide which State is be reacable as next. + Now the Transition configured in the Artifacts will do that according + to the modified TransitionModel. + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java (transitions): + Added the Transitions to the Artifact and changed the Logic. + Now the Transition is able to decide if it could be uses or not. + * doc/conf/products/verticalprofile/*.xml: + Modified the Configuration. Splitted States and Transitions into + different XML-Fragments according to the modified Transitionmodel. + +2009-12-08 Ingo Weinzierl + + * doc/conf/queries.properties: Added marker ('DATAID') for different data + sources. + +2009-12-08 Tim Englich + + * doc/conf/products/*.xml: + Switched all Package and Classnames to the new Names. + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java: + Switched Imports from de.intevation.gnv.transition to de.intevation.gnv.state + and renamed all Mebers and local Variables from *transition* to *state* + * src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java: + Changed the Class for the loggeer from TimeseriesoutputTransition + to ArtifactXMLUtilities because it was wrong. + * src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java, + src/main/java/de/intevation/gnv/artifacts/fis/product/DefaultProduct.java, + src/main/java/de/intevation/gnv/artifacts/fis/product/Product.java, + src/main/java/de/intevation/gnv/statistics/VerticalProfileStatistics.java, + src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java, + src/main/java/de/intevation/gnv/statistics/Statistics.java, + src/main/java/de/intevation/gnv/statistics/HorizontalProfileStatistics.java, + src/main/java/de/intevation/gnv/exports/SimpleOdvDataCollector.java, + src/main/java/de/intevation/gnv/exports/ShapeDataCollector.java, + src/main/java/de/intevation/gnv/exports/Export.java, + src/main/java/de/intevation/gnv/exports/DefaultExport.java, + src/main/java/de/intevation/gnv/exports/DefaultDataCollector.java, + src/main/java/de/intevation/gnv/chart/VerticalProfileChartFactory.java, + src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java, + src/main/java/de/intevation/gnv/chart/VerticalCrossSectionChartFactory.java, + src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java, + src/main/java/de/intevation/gnv/chart/HorizontalProfileChartFactory.java, + src/main/java/de/intevation/gnv/chart/HorizontalCrossSectionChartFactory.java, + src/main/java/de/intevation/gnv/chart/ChartFactory.java, + src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java: + Changed import from de.intevation.gnv.transition.* to de.intevation.gnv.state.* + according to refactoring Work in the Transitionsmodel. + * de.intevation.gnv.transition.* + Moved to de.intevation.gnv.state.* + and renamed all Mebers, local Variables, and Methodsignatures from *transition* to *state* + +2009-12-07 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Remove unselected parameters from parameters list before initiating + charts. Parameter names are used as axis labels. + + * src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java, + src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java, + src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java: Changed + the way of adding data to charts: same parameters are stored in the same + dataset. Now, each parameter has only one axis. Axes and renderer are + adjusted one time after collecting data - not after creating every + single series. + + * src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java: Added some + more colors to distinguish between different parameters/attributes. + Changed method to adjust rendering options regarding the changes of + datasets described above. + +2009-12-07 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java: Changed method + generateChart to initChart, which just created a new timeseries chart. + General chart stuff is done in AbstractXYLineChart. + + * src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java: Sourced + ChartFactory call out to a new initChart method. This has been done, + because TimeSeriesCharts needs to initiate another type of chart than + horizontal or vertical charts. + +2009-12-04 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java: + Added method to fetch a string from ressource bundle with a specified + locale. Before, there just have been existing a method to fetch string + from ressource bundle on basis of the first locale in a list of locales. + + * src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java: + Added method to fetch strings from ressource bundle from RessourceFactory + with a specified locale, a key and a default value, if there is no string + matching key in bundle. + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Added methods for creating title and subtitle of charts. FIS name is + fetched from ressource bundle with best locale (regarding supported server + and client locales) instead of first locale in list of supported locales + of the server. + + * src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java: + Changed title of charts. The main title contains FIS and station name. The + subtitle contains the time period, the cruise, the depth and the position + of a chart. + + * src/main/java/de/intevation/gnv/chart/ChartLabels.java: Added subtitle as + parameter in class and constructor. + + * src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java: Added a + subtitle to charts. Titles and subtitles are stored in a ChartLabels + object. + + * 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 strings for + chart title. + +2009-12-04 Sascha L. Teichmann + + * ChangeLog: Cleaned up a bit. + +2009-12-02 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java: Added time gap + detection. If a time gap is detected, a null value will be inserted to + break the current line. + +2009-12-02 Ingo Weinzierl + + * pom.xml: Added JBoss repository for JFreeChart 1.0.13 and removed explicit + JCommon dependency which is now needless. Now, it is no more necessary to + install JFreeChart into the local maven repository on your own. + +2009-12-02 Ingo Weinzierl + + * doc/conf/charttemplate.xml: Added lines to configure rendering of lines + and points in charts (visibility of lines/points and size of points). + + * src/main/java/de/intevation/gnv/chart/XMLChartTheme.java: Added method + parsing the rendering options for lines and points in charts. + + * src/main/java/de/intevation/gnv/chart/AbstractChart.java: Added boolean + member attributes which are used to control the visibility of lines and + points in charts. + + * src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java, + src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java, + src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java: + Constructor needs two further boolean parameter to control the visibility + of lines and points in charts. + + * src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java: The + renderer controlling the style of a series is adjusted after adding a + new series to the chart. + + * src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/verticalcrosssection/VerticalCrossSectionOutputTransition.jav, + src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java, + src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Adjusted method calls regarding the constructor changes in *Chart classes. + + TODO: Lines and points in charts will both always be rendered at the + moment. This needs to be changed as soon as a new gui option is + implemented to control the visibility of lines/points. + +2009-12-01 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java: + Added one more Transitionstep to each Testcase according to the refactored Transitionmodel. + * src/test/ressources/verticalprofile/verticalprofile_step_*_advance.xml, + src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_*_advance.xml, + src/test/ressources/verticalprofile_mesh/verticalprofile_step_*_advance.xml, + src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_*_advance.xml, + src/test/ressources/timeseries_mesh/timeseries_step_*_advance.xml, + src/test/ressources/timeseries/timeseries_step_*_advance.xml, + src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_*_advance.xml, + src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_*_advance.xml, + src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_*_advance.xml: + Moved each Adancedocument plus one according to the refactored Transitionmodel. + Added the first advanced Call for the Product-Artifact + +2009-12-01 Tim Englich + + * src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java: + All Data which is required to generate the Charts is now fetched using the + Method getChartResult. The Method advance and initialize now have nothing to do. + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (out): + Removed the advance call because all Data which is required to generate the Charts is + fetched using the Method getChartResult. + * src/main/java/de/intevation/gnv/transition/profile/horizontal/NorthSouthEastWestTransition.java (initialize): + Use Method instantiate instead of Advance to add the required Data for describe + and feed this Transition. + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (initialize), + src/main/java/de/intevation/gnv/transition/Transition.java (initialize): + Added new Method Initaialize which will be callcall to Initailize the current + Transition. In this step all Data will be fetched which is required to Ddescribe and + feed each Transition. + Also the AlternativeTransition was removed because it is not longer required. + + * src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java (advance): + Switched to the usage of the Method initialize instead of Advance while instantiating + a new Productartifact, according to the Refactoring work wich is done in the + TransitionModel. + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java (initialize): + Added new Function Initialize so that it is possible to Initialize an Artifact + without doing this in the Constructor. That is nessessary because some Artifacts need + some Metadata (e.g. SourceID) befor it can be initialized. + + * doc/conf/products/verticalprofile/conf_timeseriespoint.xml, + doc/conf/products/verticalprofile/conf_mesh.xml, + doc/conf/products/verticalprofile/conf_instantaneouspoint.xml, + doc/conf/products/verticalcrosssection/conf_mesh.xml, + doc/conf/products/timeseries/conf_timeseriespoint.xml, + doc/conf/products/timeseries/conf_mesh.xml, + doc/conf/products/horizontalprofile/conf_mesh.xml, + doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml, + doc/conf/products/horizontalcrosssection/conf_mesh.xml: + Some Refactoring work done according to the Refactoring Work wich + was done in the Transitionmodel. + +2009-11-30 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java, + src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java, + src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/verticalcrosssection/VerticalCrossSectionOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java: + Removed needless imports. + +2009-11-30 Ingo Weinzierl + + * pom.xml: Updated batik dependencies to 1.7 + + * src/main/java/de/intevation/gnv/exports/ChartExportHelper.java: Use + java native DOMImplementation instead of Batik's SVGDOMImplementation, + which is not present in batik 1.7 libs. + +2009-11-30 Ingo Weinzierl + + * doc/conf/products/horizontalcrosssection/conf_mesh.xml, + doc/conf/products/verticalcrosssection/conf_mesh.xml, + doc/conf/products/timeseries/conf_mesh.xml, + doc/conf/products/timeseries/conf_timeseriespoint.xml, + doc/conf/products/horizontalprofile/conf_mesh.xml, + doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml, + doc/conf/products/verticalprofile/conf_mesh.xml, + doc/conf/products/verticalprofile/conf_timeseriespoint.xml, + doc/conf/products/verticalprofile/conf_instantaneouspoint.xml: Added svg + to output modes (MimeType image/svg+xml). + + * pom.xml: Added batik 1.6.1 dependencies which are used to create svg + exports. + + * src/main/java/de/intevation/gnv/exports/ChartExportHelper.java: + Implemented chart export to svg. + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Output mode 'svg' will call svg export of ChartExportHelper. + +2009-11-30 Ingo Weinzierl + + * pom.xm: Added iText 2.1.7 dependency (to create pdf's). + + * src/main/java/de/intevation/gnv/exports/ChartExportHelper.java: + Implemented chart export to pdf using iText library. The chart fills the + complete page. A boolean system property "export.pdf.landscape" can be + used to adjust the page orientation (portrait or landscape, default is + landscape). + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Added method for exporting chart to pdf. Calls the new method of + ChartExportHelper. + +2009-11-27 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java + (testHorizontalProfileInstantaneousPointArtifact), + src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_*.xml: + Added new stapes using the RegionFilter into the Tescase of HorizontalProfiles Instantaneous Point. + * src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_feed.xml, + src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_feed.xml: + Bugfix: Removed second dateid. horizontalcrosssection and verticalcrosssection only provide the usage of one dateid. + * doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml: + Added the RegionFilters into the configuration of the Products for + Horizontalprofiles IntantaneousPoints. + * doc/conf/queries.properties: + Query to select only Ships, Cruises, Tracks which are within an Region. + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (extractKVP): + Added Row-Number lookup for ColumnNames for Performanceimprofements. + +2009-11-26 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/exports/ChartExportHelper.java: Helper + class to export charts. Dependencies on JFreeChart and iText are capsuled + here, no further dependencies in OutputTransitions. Export methods for + images and pdf already implemented. + + * src/main/java/de/intevation/gnv/chart/Chart.java, + src/main/java/de/intevation/gnv/chart/AbstractChart.java: Outsourcing of + export methods to ChartExportHelper. + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Adapted current export of charts. + +2009-11-26 Ingo Weinzierl + + * doc/conf/products/horizontalcrosssection/conf_mesh.xml, + doc/conf/products/verticalcrosssection/conf_mesh.xml, + doc/conf/products/timeseries/conf_mesh.xml, + doc/conf/products/timeseries/conf_timeseriespoint.xml, + doc/conf/products/horizontalprofile/conf_mesh.xml, + doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml, + doc/conf/products/verticalprofile/conf_mesh.xml, + doc/conf/products/verticalprofile/conf_timeseriespoint.xml, + doc/conf/products/verticalprofile/conf_instantaneouspoint.xml: Added pdf + as export format. + +2009-11-26 Ingo Weinzierl + + * TODO: Added point in TODO regarding tick units and distance between tick + units in timeseries charts. + +2009-11-26 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java: Localized + chart axis. Two method have been added - method to localize y-axis of + charts, abstract method to localize x-axis of charts. + + * src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java, + src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java: Override + abstract method to localize x-axis. + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Call algorithm to determine the best locale regarding intersection of + supported server and browser locales. This locale is used to create + localized charts. + +2009-11-26 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java: + New method getLocales() which returns an array of locales which are + supported by the server. + + * src/main/resources/lang/lang.conf: Config-file for supported languages. + The resource bundles for localized text should be configured here. It is + used to determine the best locale regarding the supported locales by + server and browser. + +2009-11-25 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java: Override + method generateChart to instantiate TimeSeries charts instead of XY + charts. Before these changes, timeseries charts did not have a valid date + axis. + +2009-11-24 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java, + src/main/java/de/intevation/gnv/chart/AbstractChart.java, + src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java, + src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java: Added + timegap definitions, adapted constructors. + + * src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/verticalcrosssection/VerticalCrossSectionOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java, + src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Adapted creation of charts regarding changes of constructors. + +2009-11-24 Tim Englich + + * src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_feed.xml, + src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_feed.xml, + src/test/ressources/timeseries_mesh/timeseries_step_08_feed.xml, + src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_feed.xml, + src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_feed.xml, + src/test/ressources/timeseries/timeseries_step_06_out_chart.xml: + Added new Timevalues because the Data in the DWH has changed. + +2009-11-24 Ingo Weinzierl + + * pom.xml: Added dependencies for esri and ibm libraries required for unit + tests. + +2009-11-24 Tim Englich + + * src/test/ressources/timeseries/timeseries_step_06_out_chart.xml: + Added mime-type to get a propper output-result and not an NPE + * src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java (findValueTitle): + Added null-value check to prevent NPEs. + * src/main/java/de/intevation/gnv/transition/profile/verticalcrosssection/VerticalCrossSectionOutputTransition.java (getChart), + src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java (getChart), + src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java (getChart), + src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java (getChart): + Changed Method-Signature to this one which the base method provide. + Now the Methods will be used again. + +2009-11-24 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/TestCallContext.java (TestCallContext): + Removed Compilationerrors that were triggert by API-Changes in + Module Artifact-Database. + + * doc/conf/queries.properties, + doc/conf/products/timeseries/conf_mesh.xml: + Removed Meshpoint from SQL-Query because the same value will be + insert by using the depthid. + depthid on layer 1 = featureid + In the old configuration only Charts on Layer 1 were drawn. + issue91 + +2009-11-23 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java: + Remove chart from cache when data which is displayed has changed. + +2009-11-23 Ingo Weinzierl + + * doc/conf/charttemplate.xml: Added configuration file for chart themes. + + * src/main/java/de/intevation/gnv/chart/XMLChartTheme.java: Theme class for + reading xml files which describe chart styles. It extends the + StandardChartTheme class of JFreeChart which defines default values for + chart parameters. It is possible to apply different xml configurations for + different charts. + + * src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java, + src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Before creating a new chart, an instance of XMLChartTheme is initialized + which is responsible for the chart style. + + NOTE: 'charttemplate.xml' is used by artifact server and has to be placed + in the config directory. + +2009-11-20 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Export format of charts (png, jpeg, gif) depends on mime-type. + + * src/main/java/de/intevation/gnv/chart/Chart.java, + src/main/java/de/intevation/gnv/chart/AbstractChart.java: Renamed export + method, because it doesn't export just png anymore, but jpeg or gif as + well. + +2009-11-20 Ingo Weinzierl + + * src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_chart.xml, + src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_out_chart.xml, + src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_out_chart.xml, + src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_out_chart.xml, + src/test/ressources/timeseries_mesh/timeseries_step_08_out_chart.xml, + src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_chart.xml, + src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_chart.xml, + src/test/ressources/verticalprofile/verticalprofile_step_06_out_chart.xml: + Removed mistake in xml structure of artifact protocol. Mime-type node was + called 'out' instead of 'mime-type'. + +2009-11-20 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java, + src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java, + src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java, + src/main/java/de/intevation/gnv/chart/AbstractChart.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/SimpleOdvDataCollector.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/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java, + src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Removed duplicated and needless imports. + +2009-11-20 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java: + Added methods for caching charts. + + * src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/verticalcrosssection/VerticalCrossSectionOutputTransition.java, + src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Changed chart generation. Charts will now be generated in a central place + in TimeSeriesOutputTransition which is the parent class of other + OutputTransitions. Each OutputTransition got a new method to serve its own + special chart class. + + * TODO: Added hint for caching charts. Verticalcrosssection and + orizontalcrosssection charts aren't implemented yet. + + NOTE: Charts can be cached. This could be useful if the user exports + charts as svg, png or pdf. The caching of charts is configured via system + property 'cache.chart' at the moment. + +2009-11-19 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java, + src/main/java/de/intevation/gnv/transition/OutputTransition.java, + src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Changed parameter of 'out'-method of OutputTransition. Now, the + OutputTransition gets the complete xml document of the request (before + just the target name). The mime type of this xml ist used to distinguish + between different output formats of charts (png, jpeg). + +2009-11-19 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java, + src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java, + src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java: + Classes for creating charts of different output transitions, inherit from + AbstractXYLineChart. The subclasses should only implement special code. + General configurations should be done in AbstractChart or + AbstractXYLineChart. + + TODO: Take care of gaps between two values. + +2009-11-19 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/chart/Chart.java: Interface, which + declares basic method to create charts and export it in different formats. + + * src/main/java/de/intevation/gnv/chart/AbstractChart.java, + src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java: Abstract + chart classes which declare basic methods for chart creation and implement + general methods used by subclasses. + +2009-11-19 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/utils/DistanceCalculator.java: Declared a + method as static, which can be used without instantiating an object of its + class. + +2009-11-17 Ingo Weinzierl + + * pom.xml: Changed version of JFreeChart from 1.0.12 to 1.0.13 and added + dependency of JCommon 1.0.15, which is used by JFreeChart. + + NOTE: The JFreeChart 1.0.13 jar has to be installed on your own for the + time the central maven repository is broken. + +2009-11-17 Ingo Weinzierl + + * pom.xml: Changed version of JFreeChart from 1.0.7 to 1.0.12, which + includes the template mechanism to configure the style of charts. + + NOTE: JFreeChart 1.0.13 is the newest release, but the maven repository + does not contain a pom.xml file. Created an issue on + (http://jira.codehaus.org/browse/MEV-647). + +2009-11-16 Ingo Weinzierl + + * bin/run.sh: Added start-script to version control. + +2009-11-13 Hans Plum + + * RELEASE 0.2: + Summarized activities in NEWS, Changes + +2009-11-13 Hans Plum + + * ChangeLog: + Unified style of ChangeLog descriptions refering to issues. + +2009-11-13 Tim Englich + + * doc/conf/products/timeseries/conf_timeseriespoint.xml: + Moved Comment according to Instantiationerrors loading Artifact. + +2009-11-13 Tim Englich + + * doc/conf/log4j.properties,, + doc/conf/conf.xml, + doc/conf/arcsdeconnectionpool.properties, + doc/conf/products/timeseries/conf_timeseriespoint.xml: + Added Documentation of Configuration-Files. + +2009-11-13 Tim Englich + + * doc/conf/products/verticalcrosssection/conf_mesh.xml, + doc/conf/products/horizontalcrosssection/conf_mesh.xml: + Removed statistics as possible out-Variant from Configuration + according to TG_0030.061 + + * src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_out_statistics.xml, + src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_out_statistics.xml, + src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testHorizontalCrossSectionMeshArtifact), + (testVerticalCrossSectionMeshArtifact): + Removed Statistics-Test on This Artifact-Test because no Statistic is required + for this Producttyp. + + * src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/ + HorizontalCrossSectionMeshOutputTransition.java (createCSV): + No Statistics for this Output is required. + + * src/main/java/de/intevation/gnv/statistics/HorizontalCrossSectionStatistics.java: + Removed becaus the Statistics for ths product is not required. + +2009-11-12 Tim Englich + + * src/main/java/de/intevation/gnv/statistics/HorizontalCrossSectionStatistics.java (calculateXOrdinateValue), + src/main/java/de/intevation/gnv/statistics/HorizontalProfileStatistics.java (calculateXOrdinateValue), + src/main/java/de/intevation/gnv/statistics/VerticalProfileStatistics.java (calculateXOrdinateValue), + src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java : + Added the previous Row to the Method for calculating the GAP between + those Rows. Also added Calculation of the Distance between two Points in + HorizontalProfileStatistic and returning the Depth in VerticalProfileStatistics. + Also added the Metjod clearStatistics to restet the Object if an new Calculation + will started. + +2009-11-12 Tim Englich + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (extractKVP): + Translated "Keine Auswahl" to "No Selection" according to the Specification that + the primary Language is english. Please note that the Values that are currently + displaied are almost in german. + +2009-11-12 Tim Englich + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (writeStatistics2XML): + Changed XML-Syntaxt according to the new Structure of StatisticValues. + (out): + Changed Call of calculateStatistics according to the new Methodsignature. + + * 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/TimeseriesStatistics.java, + src/main/java/de/intevation/gnv/statistics/Statistics.java: + Extended Methods calculateStatistics to put Lable-Values into the + Calculation. Now for each Group of Statistics is it possible + to calclulate a separat name which is simmilar to the name of + the Diagramm-Series-Name. + Also the Representation of the Statistics has changed so each Group + will be stored in one StatisticSet + + * src/main/java/de/intevation/gnv/statistics/StatisticSet.java: + Bean for Storing the Statistic to one Group and also storing the + Name of the Statistic. + +2009-11-11 Tim Englich + + Issue 19: Validation of max. min value order + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (putInputData): + Added Validation if a given maxvalue is greater than a given minvalue issue19 + * src/main/java/de/intevation/gnv/utils/InputValidator.java (isInputValid): + Added new Method for validating if a maxvalue is greater than a minvalue. issue19 + +2009-11-11 Tim Englich + + Issue 81: Keeping input values in coordinate input fields + + * src/main/java/de/intevation/gnv/transition/describedata/DefaultSingleValueDescribeData.java + (setValue), src/main/java/de/intevation/gnv/transition/describedata/SingleValueDescribeData.java: + Added setValue-Method + for setting the Value which was sent back to the Server using the feed-request. issue81 + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (getDescribeData): + Added SingleValueDescribeData to the method for storing InputValues for + Describeoutput issue81 + +2009-11-11 Tim Englich + + * src/main/java/de/intevation/gnv/transition/describedata/MinMaxDescribeData.java, + src/main/java/de/intevation/gnv/transition/describedata/DefaultMinMaxDescribeData.java: + Added getName and added Constants for minValue and maxValue Id to + enable the storage of this Values which would be put using the + feed command. + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (describe): + Changed the usage of the Name of the MinMaxTransition from getMinName to getName. + + * src/main/java/de/intevation/gnv/transition/MinMaxTransition.java (purifyResult): + Changed the Constructor of MinMaxTransition according to API-Changes of + DefaultMinMaxDescribeData + +2009-11-11 Tim Englich + + Issue 76: Improving XML config documents + + * doc/conf/products/verticalprofile/conf_mesh.xml, + doc/conf/products/verticalprofile/conf_instantaneouspoint.xml, + doc/conf/products/verticalcrosssection/conf_mesh.xml, + doc/conf/products/timeseries/conf_mesh.xml, + doc/conf/products/horizontalprofile/conf_mesh.xml, + doc/conf/products/horizontalcrosssection/conf_mesh.xml: + Removed unnecessary characters 'v' from the Documents. issue76 + +2009-11-10 Tim Englich + + * src/main/resources/lang/artifactMessages_*.properties: + Added Ressources for the AreaFilter Ids areaid and subareid + +2009-11-10 Tim Englich + + Issue 68: Improving ODV Export + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (TIMESERIES_ODV_PROFILE_NAMES): + Sort Columns to the given order of the ODV-Specification + and added the Columns DATAVALUE and PARAMETER to the output + according to issue68 + + * doc/conf/queries.properties: + Changed Column-alias in Query for HorizontalProfile ODV-Exports in Meshes + from PARAMETERID to PARAMETER to be able to use in only on ODV-Export-Profile + +2009-11-10 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testVerticalCrossSectionMeshArtifact): + Added the ODV-Export to the Unit-Testcase for VerticalCrossSection-Mesh. + Some Refactoring Work done. + * doc/conf/products/verticalcrosssection/conf_mesh.xml: + Added QueryID for ODV-Exports to the Configuration of an + Mesh-VerticalCrossSection-Artifacts + * doc/conf/queries.properties: + Added Query for VerticalCrossSection ODV-Exports in Meshes. + * src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_feed.xml: + Changed Datevalue, because the old value was out of range to the Data. + * src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_out_odv.xml: + Added Out-Request for ODV-Export to the JUnitTest Configuration for + VerticalCrossSection Mesh. + +2009-11-10 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testHorizontalCrossSectionMeshArtifact): + Added the ODV-Export to the Unit-Testcase for HorizontalCrossSection-Mesh. + Some Refactoring Work done. + * doc/conf/queries.properties: + Added Query for HorizontalCrossSection ODV-Exports in Meshes. + * doc/conf/products/horizontalcrosssection/conf_mesh.xml: + Added QueryID for ODV-Exports to the Configuration of an + Mesh-HorizontalCrossSection-Artifacts + * src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_feed.xml: + Changed Datevalue, because the old value was out of range to the Data. + * src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_out_odv.xml: + Added Out-Request for ODV-Export to the JUnitTest Configuration for + HorizontalCrossSection Mesh. + +2009-11-10 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testHorizontalProfileInstantaneousPointArtifact): + Added the ODV-Export to the Unit-Testcase for HorizontalProfile-InstantaneousPoint. + Some Refactoring Work done. + * src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_odv.xml: + Added Out-Request for ODV-Export to the JUnitTest Configuration for + HorizontalProfiles InstantaneousPoint. + * doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml: + Added QueryID for ODV-Exports to the Configuration of an + InstantaneousPoint-HorizontalProfile-Artifacts + * doc/conf/queries.properties: + Added Query for HorizontalProfile ODV-Exports in InstantaneousPoint + +2009-11-10 Tim Englich + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testVerticalProfileInstantaneousPointArtifact): + Added the ODV-Export to the Unit-Testcase for VerticalProfile-InstantaneousPoint. + Some Refactoring Work done. + * doc/conf/products/verticalprofile/conf_instantaneouspoint.xml: + Added QueryID for ODV-Exports to the Configuration of an + InstantaneousPoint-VerticalProfile-Artifacts + * doc/conf/queries.properties: + Added Query for VerticalProfile ODV-Exports in InstantaneousPoint + * src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_out_odv.xml: + Added Out-Request for ODV-Export to the JUnitTest Configuration for VerticalProfiles InstantaneousPoint. + +2009-11-10 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testHorizontalProfileMeshPointArtifact): + Added the ODV-Export to the Unit-Testcase for HorizontalProfile-Mesh. + Some Refactoring Work done. + * doc/conf/products/horizontalprofile/conf_mesh.xml: + Added QueryID for ODV-Exports to the Configuration of an + Mesh-HorizontalProfile-Artifacts + * doc/conf/queries.properties: + Added Query for HorizontalProfile ODV-Exports in Meshes + * src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_odv.xml: + Added Out-Request for ODV-Export to the JUnitTest Configuration for HorizontalProfiles Mesh. + * src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_feed.xml: + BugFix: Changed missspelled Input-Name + +2009-11-09 Tim Englich + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (TIMESERIES_ODV_PROFILE_NAMES): + Changed the Order of Columnlookup for ODV-Exports and added column "Depth" to the Export + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testTimeSeriesMeshArtifact): + Added the ODV-Export to the Unit-Testcase for TimeSeries-Mesh. + Some Refactoring Work done. + * doc/conf/queries.properties: + Added Query for VerticalProfile ODV-Exports in Meshes + * doc/conf/products/verticalprofile/conf_mesh.xml: + Added QueryID for ODV-Exports to the Configuration of an + Mesh-VerticalProfile-Artifacts + * src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_odv.xml, + src/test/ressources/verticalprofile/verticalprofile_step_06_out_odv.xml: + Added Out-Request for ODV-Export to the JUnitTest Configuration for VerticalProfiles. + +2009-11-09 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testTimeSeriesMeshArtifact): + Added the ODV-Export to the Unit-Testcase for TimeSeries-Mesh. + Some Refactoring Work done. + + * src/test/ressources/timeseries_mesh/timeseries_step_08_out_odv.xml: + Added Out-request for ODV-Export to the JUnitTest Configuration for TimeSeries Mesh. + + * doc/conf/products/timeseries/conf_mesh.xml: + Added QueryID for ODV-Exports to the Configuration of an Mesh-TimeSeries-Artifacts + + * doc/conf/queries.properties: Added Query for TimeSeries ODV-Exports in Meshes + +2009-11-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/exports/Export.java + src/main/java/de/intevation/gnv/exports/DefaultProfile.java + src/main/java/de/intevation/gnv/exports/DefaultExport.java: Added the + possibility to print column labels in the first line of an export. + + * src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java, + src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Adjusted instantiation of the DefaultExport object and added column labels + for odv export. + +2009-11-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/exports/SimpleOdvDataCollector.java: + Implemented a DataCollector for Odv exports. + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + OEV-export uses a SimpleOdvDataCollector to collect export data. + +2009-11-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/exports/ShapeDataCollector.java, + src/main/java/de/intevation/gnv/exports/HorizontalProfileDataCollector.java: + Renamed HorizontalProfileDataCollector into ShapeDataCollector, because it + will be used by other transitions as well. + + * src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java: + Adjusted class name of DataCollector after renaming. + +2009-11-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/exports/HorizontalProfileDataCollector.java: + Special DataCollector for fetching data used for horizontal profile + exports. + + * src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java: + Uses the an exporter for csv export. + +2009-11-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/exports/Export.java, + src/main/java/de/intevation/gnv/exports/DefaultDataCollector.java: + Implemented a DataCollector to collect all data used to create exports. + DefaultCollector fetches data with help of its headers. For special + exports, where a header returns more than one value, special + DataCollectors needs to be implemented (overwritung the 'getData' method). + + * src/main/java/de/intevation/gnv/exports/DefaultProfile.java, + src/main/java/de/intevation/gnv/exports/DefaultExport.java: Export now + uses a DataCollector to get the data. + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Adjusted exports of csv export. + +2009-11-09 Tim Englich + + * doc/conf/queries.properties: + Added SQLStatemenet for ODV-Data for VerticalProfiles + on TimeSeriesPoints. + * doc/conf/products/verticalprofile/conf_timeseriespoint.xml: + Added QueryID for ODV-Data-Query + +2009-11-09 Tim Englich + + * src/test/ressources/timeseries/timeseries_step_06_out_*.xml: + Added the missing out-Modes to the Testcase and rename it to + the common used way in this TestCases. + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testTimeSeriesArtifact): + Added the ODV-Export to the Unit-Testcase. + Some Refactoring Work done. + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (out): + The Method for generating ODV-Export now reads its Data from + the special Method which delivers the adapted Data. + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (generateFilterValuesFromInputData): + Extracted the Generation of the FilterValues for the geo-backend + to use it in several methods. + * src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java (getODVResult): + Added Method for getting the rquired Data for ODV-Exports + * doc/conf/products/timeseries/conf_timeseriespoint.xml: + Added separat QueryID Lookup for ODV-Data-Queryies + * doc/conf/queries.properties: + DB-Queries for ODV-Support TimeSeries on TimeSeriesPoints added. + +2009-11-06 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/exports, + src/main/java/de/intevation/gnv/exports/Export.java, + src/main/java/de/intevation/gnv/exports/DefaultProfile.java, + src/main/java/de/intevation/gnv/exports/DefaultExport.java: Implemented an + Exporter for odv and csv exports. Each exports just needs a Profile, which + describes the output. + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Added an exemplary export for CSV and ODV formats of + TimeSeriesOutputTransition. + + TODO: ODV exporter exports the same data as CSV exporter does. This needs + to be adapted. + +2009-11-06 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java: + Added and moved Workflowsteps because of changes in the Workflow of these Artifacts. + Now the Region-Filter is added to the Workflow an can be tested using + this UnitTestCases. + + * src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_*.xml, + src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_*.xml, + src/test/ressources/timeseries/timeseries_step_*.xml, + src/test/ressources/timeseries_mesh/timeseries_step_*.xml, + src/test/ressources/verticalprofile/verticalprofile_step_*.xml, + src/test/ressources/verticalprofile_mesh/verticalprofile_step_*.xml: + Added and moved Files because of changes in the Workflow of these Artifacts. + Now the Region-Filter is added to the Workflow an can be tested using + the UnitTestCases. + +2009-11-06 Ingo Weinzierl + + * doc/conf/products/horizontalcrosssection/conf_mesh.xml, + doc/conf/products/timeseries/conf_mesh.xml, + doc/conf/products/timeseries/conf_timeseriespoint.xml, + doc/conf/products/horizontalprofile/conf_mesh.xml, + doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml, + doc/conf/products/verticalprofile/conf_mesh.xml, + doc/conf/products/verticalprofile/conf_timeseriespoint.xml, + doc/conf/products/verticalprofile/conf_instantaneouspoint.xml: Added odv + as output format. + +2009-11-06 Tim Englich + + * src/main/java/de/intevation/gnv/chart/ChartFactory.java (calculateMaxGap): + Bugfix Gap-Calculation moved maxGap into negative Valies because of + overflow of Long-Variable. + +2009-11-05 Tim Englich + + * doc/conf/queries.properties: + Query to select only those TimeSeriesPoints + which are within an Region + + * doc/conf/products/timeseries/conf_timeseriespoint.xml, + doc/conf/products/verticalprofile/conf_timeseriespoint.xml: + Added the RegionFilters into the configuration of the Products + for TimeSeriesPoints. + +2009-11-05 Tim Englich + + * doc/conf/queries.properties: + Added new Queries to fill the Lists for the + Regionfilters and one Query to select only those Meshes + which are within an Region. + + * doc/conf/products/verticalprofile/conf_mesh.xml, + doc/conf/products/verticalcrosssection/conf_mesh.xml, + doc/conf/products/timeseries/conf_mesh.xml, + doc/conf/products/horizontalprofile/conf_mesh.xml, + doc/conf/products/horizontalcrosssection/conf_mesh.xml: + Added the RegionFilters into the configuration of the Products + for Meshes. + +2009-11-05 Tim Englich + + * src/test/ressources/*_describe.xml: + Added the DescribeRequestBodies to each TestCaseData. + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java: + Added the DescribeRequestBody to Describe-Calls in the Test + * src/main/java/de/intevation/gnv/transition/TransitionBase.java: + Added the possibility to switch to an alternative Transition if no value was choosen. + + * src/main/java/de/intevation/gnv/utils/InputValidator.java (isInputValid): + Added that the Inputvalue is valid if it fullfills the confitions of "no value choosen" (n/n) + + * src/main/java/de/intevation/gnv/statistics/HorizontalProfileStatistics.java (calculateXOrdinateValue): + Added Dummyvalue for X-OrdinateValue + src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java (describe), + src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshArtifact.java (describe), + src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileArtifact.java (describe), + src/main/java/de/intevation/gnv/profile/horizontalcrosssection/HorizontalCrossSectionMeshArtifact.java (describe), + src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileArtifact.java (describe), + src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java (describe), + src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java (createDescibeOutput): + Added the possibility to exclude the UI from the DescribeRequest. + +2009-11-03 Tim Englich + + * src/main/java/de/intevation/gnv/chart/ChartFactory.java (getTimeGapValue): + Integrated special case for TimeGaps in Meshes. There is no Gap defined in + Meshes so we have to use Long.MAXVALE to define a Gap for a Mesh which value + canno be reached. + +2009-11-02 Tim Englich + + * src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java + (createCSV): Code Cleanup: Removed obsoled TODO Flag + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (setSelection): + Changed the Value of the min and maxvalue of the Request to the Value which is unsed to name + the Inputfields in the DescribeOutput. + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/horizontal/NorthSouthEastWestTransition.java, + src/main/java/de/intevation/gnv/transition/Transition.java, + src/main/java/de/intevation/gnv/transition/SingleInputTransition.java, + src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java, + src/main/java/de/intevation/gnv/transition/MinMaxTransition.java, + src/main/java/de/intevation/gnv/transition/DefaultTransition.java, + src/main/java/de/intevation/gnv/transition/CoordinateSelectionTransition.java, + src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java (advance), + CodeCleanup: Removed needless Method validate from Transition, + because it had always returned true + +2009-10-30 Tim Englich + + * src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_*.xml: + Added the Testdata for the Unittest for HorizontalCrossSectionMeshArtifacts. + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testHorizontalCrossSectionMeshArtifact): + Added the UnitTest-Case for HorizontalCrossSectionMeshArtifacts + +2009-10-30 Tim Englich + + * doc/conf/queries.properties: + Added the Query for selecting the Data for generating Outputs of + HorizontalCrossSectionMeshOutputTransition + * doc/conf/products/horizontalcrosssection/conf_mesh.xml: + Added the configuration for the HorizontalCrossSectionMeshOutputTransition + * src/main/java/de/intevation/gnv/transition/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputTransition.java: + Added the OutputTransition for generating /HorizontalCrossSections. + * src/main/java/de/intevation/gnv/statistics/HorizontalCrossSectionStatistics.java: + The Class for generating the Statistics to HorizontalCrossSections + * src/main/java/de/intevation/gnv/chart/HorizontalCrossSectionChartFactory.java: + The Class Stub for generating HorizontalCrossSections Charts. + +2009-10-29 Tim Englich + + Issue 45: Defining gaps for spatial and temporal gaps + + * doc/conf/products/timeseries/timegap_definition.xml, + doc/conf/products/timeseries/conf_timeseriespoint.xml: + Added the Configuration for TimeGaps to the TimeSeries-Configurations. issue45 + + * doc/conf/queries.properties: + Added TimeGapIp to the Queries for the Resultdata of TimeSeriesArtifacts. issue45 + + * src/main/java/de/intevation/gnv/timeseries/gap/DefaultTimeGap.java, + src/main/java/de/intevation/gnv/timeseries/gap/TimeGap.java, + src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (setup): + src/main/java/de/intevation/gnv/chart/ChartFactory.java (calculateMaxGap): + Added configurable TimeGap Support to the TimeSeries-Chart-Generation. issue45 + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java, + src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java (readConfiguration): + Moved Method from GNVArtifactBase to make it assesible for more Objects. issue45 + +2009-10-28 Tim Englich + + * src/main/java/de/intevation/gnv/profile/horizontalcrosssection/ + HorizontalCrossSectionMeshArtifact.java (HorizontalCrossSectionMeshArtifact), + doc/conf/queries.properties, doc/conf/conf.xml, + doc/conf/products/horizontalcrosssection/conf_mesh.xml, + src/main/resources/lang/artifactMessages* .properties: + Added Workflow for determining the Query-Parameters for Horizontal cross-sections. + +2009-10-28 Tim Englich + + * doc/conf/conf.xml: + Added Configuration for two new FIS. Current Meter and Ice Station Reports + + * src/main/resources/lang/artifactMessages*.properties: + Added Ressources for two new FIS. Current Meter and Ice Station Reports + +2009-10-27 Tim Englich + + * doc/conf/conf.xml: + Added Configuration for two new FIS. Sea State and SEACAT + + * src/main/resources/lang/artifactMessages*.properties: + Added Ressources for two new FIS. Sea State and SEACAT + +2009-10-27 Tim Englich + + Issue 61: Vertical profile (Meshes): Selection of minimal and maximal + depths zones + + * src/main/resources/lang/artifactMessages*.properties: + Added Ressources for the minimal and maximal Layer to use in VerticalProfiles of Meshes issue61 + + * doc/conf/products/verticalprofile/conf_mesh.xml: + Added two new Transitions for selecting the min and max-Layer to use. issue61 + + * doc/conf/queries.properties: + Added Queries for Selecting the Depth for selecting the minimum and the maximum Layer to use + Drawing the Chart. issue61 + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testVerticalProfileMeshArtifact): + Integrated two further Transitions-Steps according to changes in Workflow of + VerticalProfiles in Meshes. issue61 + + * src/test/ressources/verticalprofile_mesh/verticalprofile_step_*.xml: + New Testdata generated according to changes in Workflow of VerticalProfiles in Meshes. issue61 + +2009-10-26 Tim Englich + + Issue 31: TG_0020.018: Input of manual depth zones + + * src/main/resources/lang/artifactMessages_de_DE.properties: + Added Ressources for the minimal and maximal value of the depth + + * src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_out_statistics.xml (renamed), + src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_out_csv.xml (renamed), + src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_out_chart.xml(renamed), + src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_feed.xml, + src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_04_advance.xml, + src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_03_advance.xml, + src/test/ressources/verticalprofile/verticalprofile_step_05_out_statistics.xml(renamed), + src/test/ressources/verticalprofile/verticalprofile_step_05_out_csv.xml(renamed), + src/test/ressources/verticalprofile/verticalprofile_step_05_out_chart.xml(renamed), + src/test/ressources/verticalprofile/verticalprofile_step_05_feed.xml, + src/test/ressources/verticalprofile/verticalprofile_step_04_advance.xml, + src/test/ressources/verticalprofile/verticalprofile_step_03_advance.xml, + src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java: + Edited the RestCases for VerticalProfiles according to the requirement that + the user should be able to enter the minimal and maximal Value of the depth that + should be show n in the charts. issue31 + + * doc/conf/queries.properties, + doc/conf/products/verticalprofile/conf_timeseriespoint.xml, + doc/conf/products/verticalprofile/conf_instantaneouspoint.xml: + Adding required Configuration-Parts to get the possible to enter the minmum + and maximum depth value that should be shown in the charts. issue31 + +2009-10-23 Tim Englich + + * src/test/ressources/timeseries_mesh/timeseries_step_07_feed.xml: + The Timeperiod of the Modeldata has changed. so it was nessessarry to change + the Unittest to get propper Results + +2009-10-23 Tim Englich + + * doc/conf/queries.properties: + Some Queryimproofments done. Inner-Selects has been removed where it was possible. + +2009-10-23 Tim Englich + + Issue 3: Artifact: Storing the internal state instead of results + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java, + src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java (describe), + src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshArtifact.java (describe), + src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileArtifact.java (describe), + src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileArtifact.java (describe): + Use super.identifier as uuid. issue3 + +2009-10-23 Tim Englich + + * src/test/ressources/verticalprofile/verticalprofile_step_04_feed.xml, + src/test/ressources/verticalprofile/verticalprofile_step_03_advance.xml, + src/test/ressources/verticalprofile/verticalprofile_step_04_out_*.xml, + src/test/ressources/timeseries_mesh/timeseries_step_07_out_*.xml, + src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_out_*.xml: + Changed the uuid because the new Storage shows that there were different ones in one Testcase + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Put the UUID into the Resultlookup + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java: + Removed the Storage of Results in the Object and put them into the ehcache + + * src/main/java/de/intevation/gnv/transition/Transition.java: + Removed some needless Methods that were not longer Required + + * src/main/java/de/intevation/gnv/transition/profile/horizontal/NorthSouthEastWestTransition.java + (advance), src/main/java/de/intevation/gnv/transition/SingleInputTransition.java + (purifyResult), src/main/java/de/intevation/gnv/transition/MinMaxTransition.java + (purifyResult), src/main/java/de/intevation/gnv/transition/CoordinateSelectionTransition.java + (extractKVP), src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java + (describe), src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshArtifact.java + (describe), src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileArtifact.java + (describe), src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileArtifact.java + (describe), src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java (uuid): + Lookup the Results from ehcache and centralize the Lookup to one methode. + +2009-10-23 Tim Englich + + * doc/conf/queries.properties: + Optimized Query horizontalprofile_instantaneouspoint_cruise because it is not warranted + that the name of an cruise is set. issue60 + +2009-10-22 Tim Englich + + * src/main/java/de/intevation/gnv/transition/CoordinateSelectionTransition.java + (extractKVP): Added the possiblility to fetch an further Column with + the alias Value to display it together with the Coordinatevalues + + * doc/conf/queries.properties: + Added the Coordinates to an Measuementpoint to display it. + + * doc/conf/products/verticalprofile/conf_instantaneouspoint.xml: + Change TransitionType for displaying Coordinatevalues aditionaly to + the Time of an Measurement + +2009-10-22 Tim Englich + + Issue 40: Instantiation of artifacts slow + + * doc/conf/conf.xml, doc/conf/products/*/conf_*.xml: + Split the Configuration of the ArtifactDatabase in several Configurationfiles. + For Each Product-Artifact one single File to make it easier to administer the System. + + * src/main/java/de/intevation/gnv/transition/TransitionFactory.java (createTransition), + src/main/java/de/intevation/gnv/transition/TransitionBase.java (setup), + src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java (setup), + src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java (setup): + Lookup of XML-Attributes was changed from XPath-lookup to direct + Access on the fetched Element to speed up the Artifactinstantiation issue40 + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java (getConfigurationFragment): + Read Configuration information for the Productartifact from a separat folder if an xlink:href + Attribute exists in tne Configurationnode of the Artifact. + This was inserted to speed up the Artifactinstantiation and to split the Configuration + in several Configurationfiles that where smallaer issue40 + Also the lookup of XML-Attributes was changed from XPath-lookup to direct + Access on the fetched Element + +2009-10-21 Tim Englich + + Issue 59: Added relative pathnames to central config document + + * doc/conf/conf.xml: + Added relative locations for further required configurationfiles . issue59 + * src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java (createArtifactContext): + Added the prossibility to configure the location of required configurationfiles not absolute. issue59 + +2009-10-21 Tim Englich + + * doc/conf/arcsdeconnectionpool.properties: + Added separat ConnectionPoolProperties to this Project. + * doc/conf/*: + Moved ConfigurationFiles from src/test/ressources to doc/conf + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (configurationDir): + Changed Configuration Folder to doc/conf + +2009-10-20 Tim Englich + + * doc/conf: + Added Folder for the Configuration of the gnv-artifacts. + +2009-10-20 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testVerticalCrossSectionMeshArtifact): + Added Testcase for testing the Workflow for generating VerticalCrossSections. + * src/test/ressources/queries.properties: + Added the required Queries for providing VerticalCrossSection using Meshes. + * src/test/ressources/conf.xml: + Added the Configuration for an VerticalCrossSection using Meshes. + * src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_*.xml: + Adding Requestdocuments for testing the Workflow of Generating an VerticalCrossSection. + * src/main/java/de/intevation/gnv/transition/profile/verticalcrosssection/VerticalCrossSectionOutputTransition.java : + Added an OutputTransition for renedering the Data of VerticalCrossSections. + * src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshArtifact.java: + Added Class for the Representation of VerticalCrossSection Artifacts into the Project. + * src/main/java/de/intevation/gnv/chart/VerticalCrossSectionChartFactory.java (createProfileChart): + Put Class-Sub for the Chart generation of VerticalCrossSections into the Project. + +2009-10-20 Tim Englich + + Issue 54: Errors in diagramms for time series in IMIS + + * src/test/ressources/queries.properties: + Bugfix for TIMESERIESPOINT the first and the last value weren't used + in the Query which was integrated from the Prototyp to the Project + ussue54 + +2009-10-19 Tim Englich + + Issue 55: Harmoization of coordinate values for input fields + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (describe): + Added uniform Visualization of Single Input-Elements to MinMax-Elements. issue55 + +2009-10-19 Tim Englich + + Issue 56: Error - Behavior of a form without constraint values + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java (feed): + Catch Exception that the Calling Program could not put no InputData + into the feed Request.issue56 + +2009-10-19 Tim Englich + + Issue 19: Validation of date and double values + + * src/main/java/de/intevation/gnv/chart/ChartFactory.java (createDataset), + src/main/java/de/intevation/gnv/chart/VerticalProfileChartFactory.java (createDataset): + Adding empty Series into Chart to prevent NPE issue 19 + +2009-10-19 Tim Englich + + Issue 35: Wrong date values force the panel to start from beginning + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (putInputData): + Correct misspelled Exception-Message as an Result of fixing issue35 + +2009-10-19 Tim Englich + + Issue 50: Adding the layer number for depth information + + * src/test/ressources/queries.properties: + Changed the Value of Layer and Depth range visualization of Meshes + according to issue50 + +2009-10-19 Tim Englich + + Issue 47: Translation of strings for time series + + * src/main/resources/lang/artifactMessages*.properties: + Changed the displayed-Values as defined in issue47 + * src/test/ressources/conf.xml: + Changed the Key for the DataName of MIN-Max-Transitions to put a propper Name + into the UI-Describeoutput issue47 + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (describe): + Added the X-Forms-Group-Element to surround the MinMaxDescibeObject-output to Give the + Group of Objects a propper Name issue47 + * src/main/java/de/intevation/gnv/transition/MinMaxTransition.java (purifyResult): + Added the name of the Data to the MinMaxDescibeObject to put it into the UI-output + +2009-10-16 Tim Englich + + Issue 53: Changing of strings in parameter panel + + * src/test/ressources/timeseries_mesh/timeseries_step_05_feed.xml: + src/test/ressources/conf.xml: + src/main/resources/lang/artifactMessages*.properties: + Conformation to the tanslation of the MeshObjects issue53 + +2009-10-16 Tim Englich + + Issue 49: Integration of FIS to Meshes + + * src/test/ressources/queries.properties: + There are different FIS in the Relation Median.Mesh so it is + nessessary to sepcify which FIS should be selected by using the sourceid + issue49 + * src/test/ressources/conf.xml: + Adding two further FIS to the Configuration which are based on Meshes. + Added the Sourceid to the ModelData issue49 + * src/main/resources/lang/artifactMessages*.properties: + Adding the Names of the two new FIS to the Propertiesfiles issue49 + +2009-10-16 Tim Englich + + * src/main/java/de/intevation/gnv/chart/HorizontalProfileChartFactory.java (createXYSeries): + Adding 5% bigger Valuearea to the Chart according to GT0030.011 + +2009-10-16 Tim Englich + + * src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java (VerticalProfileOutputTransition): + Changed Domainlable for Verticalprofiles according to the Specification GT_0030.005 + * src/test/java/de/intevation/gnv/artifacts/util/DistanceCalculatorTestCase.java (testDistanceCalculator): + Added Testcase for the DistanceCalculation + * src/main/java/de/intevation/gnv/chart/HorizontalProfileChartFactory.java (createXYSeries): + * src/main/java/de/intevation/gnv/utils/DistanceCalculator.java (calculateDistance): + Added Calculation of the Distance in the unit km for Geodetic-Coordinates according to the Specification GT_0030.005 + * src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java (HorizontalProfileOutputTransition): + Changed Domainlable for Horizintalprofiles according to the Specification GT_0030.005 + +2009-10-16 Tim Englich + + * src/test/ressources/queries.properties: + The Levelnumber of Meshes will also be visualized in the choose of depth GT_0020.0020 + +2009-10-16 Tim Englich + + * src/test/ressources/conf.xml: + Added Coordinate-Values to Title of the TimeseriesDiagramm for Meshes + +2009-10-16 Tim Englich + + * src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java (putInputData): + Bugfix ChartValues were not Recalculated after feed was called second Time. + +2009-10-16 Tim Englich + + * src/test/ressources/conf.xml: + Bugfix in MinMaxTransition the Maxvalue was not the correct Value. + +2009-10-16 Tim Englich + + Issue 38: Horizontal profiles: Visualization of distances in km + + * src/main/java/de/intevation/gnv/transition/CoordinateSelectionTransition.java (convert2DisplayCoordinate): + Added Transformation from WKT-Coordinate Reperesentation to BSH-Coordinate Representation. issue38 + +2009-10-15 Tim Englich + + * src/main/java/de/intevation/gnv/chart/HorizontalProfileChartFactory.java, + src/main/java/de/intevation/gnv/chart/VerticalProfileChartFactory.java, + src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java, + src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java, + src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java, + src/test/ressources/queries.properties, src/test/ressources/conf.xml: + Added missing Class Description Values to the Horizontal Profile Charts + +2009-10-15 Tim Englich + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (getFisName): + Added Method for lookup FIS Names + * src/main/resources/lang/artifactMessages*.properties: + Added further Key-Value-Pairs for FIS + * src/test/ressources/conf.xml: + Changed Configuratioon to get the ID of an FIS to the Chartgeneration + +2009-10-15 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testHorizontalProfileMeshPointArtifact): + Activate Tests for CSV and Statistics on HorizontalProfiles + + * + src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java + (createCSV), + src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java + (createCSV): + Integrated special CSV-Export for HorizontalProfiles + +2009-10-14 Tim Englich + + * src/main/java/de/intevation/gnv/chart/HorizontalProfileChartFactory.java (createXYSeries): + Load WKT from ResultSet and calculate Distance to last point. + * src/test/ressources/queries.properties: + Switch Chart-Queries to Spatial-Queries. + +2009-10-13 Tim Englich + + Issue 33: Improved logging for time-interval queries + + * src/test/ressources/queries.properties, + src/test/ressources/conf.xml: + Added Parameter-Usage in Time-Interval-Query ISSUE-33 + +2009-10-13 Tim Englich + + * src/test/ressources/verticalprofile_mesh/verticalprofile_step_*_feed.xml, + src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_*_feed.xml: + Switched to Szenario where it is possible to select Data using the Coordinate. + * src/test/ressources/conf.xml, + src/test/ressources/queries.properties: + Switched to SFS-Conformant-Queries in HorzintalProfile- and VerticalProfile-Mesh + +2009-10-13 Tim Englich + + * src/main/resources/lang/artifactMessages_*.properties: + Switched to better Description of an Coordinate-Input-Field + + * src/test/ressources/timeseries_mesh/timeseries_*_feed.xml: + Switched to Szenario where it is possible to select Data using the Coordinate. + + * src/test/ressources/queries.properties, src/test/ressources/conf.xml: + Switched to SFS-Conformant-Queries in Timeseries-Mesh + + * pom.xml: + Added dependency to JTS 1.9 + + * src/main/java/de/intevation/gnv/utils/exception/ValidationException.java + (ValidationException), src/main/java/de/intevation/gnv/utils/InputValidator.java + (getPointValue), src/main/java/de/intevation/gnv/transition/TransitionBase.java + (prepareInputData4RegionDBQuery): + Added the Support for specialized Handling of InputValues of type Coordinate. + + * src/main/java/de/intevation/gnv/transition/CoordinateSelectionTransition.java: + Added Transition for the Support of Coordinateinput handling. + +2009-10-12 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java: + Closed small file descriptor leak. + +2009-10-09 Tim Englich + + * src/main/java/de/intevation/gnv/**/*.java Edited: + Code Formatting and Cleanup. + +2009-10-09 Tim Englich + + * src/test/ressources/queries.properties Edited: + Add Parameters to the Queries to select only the Dates where + the Parameters has been measured. + * src/test/ressources/conf.xml Edited: + Set that the ParameterIds should be used in the Query of the Dates. + +2009-10-07 Sascha L. Teichmann + + RELEASE 0.1 + + * Changes, NEWS: Summarized changes. + +2009-10-06 Tim Englich + + * src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java (HorizontalProfileOutputTransition) Edited : + Switch Lable-Value for Domain-Axis. + * src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java (getRessource) Edited: + Added missing Import + * src/main/java/de/intevation/gnv/transition/profile/horizontal/NorthSouthEastWestTransition.java (advance) Edited: + Added i18n Support + * src/main/resources/lang/artifactMessages*.properties Edited: + Added some missing RessourceValues + +2009-10-06 Sascha L. Teichmann + + * src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_04_out_csv.xml, + src/test/ressources/conf.xml, + src/test/ressources/timeseries_mesh/timeseries_step_07_out_csv.xml, + src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_out_csv.xml, + src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_out_csv.xml, + src/test/ressources/verticalprofile/verticalprofile_step_04_out_csv.xml: + s@test/plain@text/plain@g to correct MIME type of CSV export + +2009-10-06 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/artifacts/ressource/*.properties: + Deleted. + + * src/main/resources/lang/*.properties: Re-inserted here. Maven now + includes them in the jar package. + + * src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java: + Make code more robust. TODO: We need a better implementation here. + + * Changelog -> ChangeLog: To make eclipse happy. Unified changelog style. + + * pom.xml: xmllint-ed and set encoding of filtered resources to UTF-8 + +2009-10-06 Tim Englich + + * src/test/ressources/queries.properties Edited: + Bugfix in Query for getting Data for the Output. + Now the Values will be sorted Correcly. Timevalue + has been removed from the Query because it is not a + Parameter which could be choosen from the User. + Also dummies for XCOORD-Value and YCOORD-Value integrated so + that is now Possible to visualize the Profile + gnv/issue21 + +2009-10-05 Tim Englich + + * src/main/java/de/intevation/gnv/artifacts/ressource/artifactMessages*.properties Edited: + Added further Ressourec Values. + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testVerticalProfileInstantaneousPointArtifact) Edited: + Changed ArtifactName to real FIS. + * src/test/ressources/timeseries_mesh/timeseries_step_01_feed.xml Edited: + Changed Product-Name from timeSeriesMesh to timeSeries to provide a General-Naming-Structure + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (setup) Edited, + src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java Edited, + src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java Edited: + Added Configurationsupport for the Labeling Data. Now it is possible do define the + value-names in the Configurationfile. + * src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_03_feed.xml Edited, + src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_02_feed.xml Edited, + src/test/ressources/queries.properties Edited: + Changed the Queries for the VerticalProfileInstantaneusPoint to the FIS-Query Mode. + This Mode was send by Mr. Schulz-Ohlberg. + * src/test/ressources/conf.xml: + Changed the Workflow for the VerticalProfileInstantaneusPoint to the FIS-Query Mode. + This Mode was send by Mr. Schulz-Ohlberg. + Also Added the support for value-names to the Configuration of VerticalProfileInstantaneusPoint. + +2009-10-05 Tim Englich + + * src/main/java/de/intevation/gnv/artifacts/ressource/artifactMessages_en.properties Renamed: + Renamed from artifactMessages_en_EN.properties to artifactMessages_en.properties to get a + propper support for PreferedLocale + * src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java (getRessource) Edited, + * src/test/java/de/intevation/gnv/artifacts/ressource/RessourceFactoryTestCase.java (setUp) Edited, + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (describe) Edited, + * src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java (createSelectBox) Edited: + Changed Method Signature from Locale to PreferedLocale[] to put all Useable Languages to + the RessourceFactory + +2009-10-02 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/ressource/RessourceFactoryTestCase.java Added: + TestCase for Testing the RessourceFactory + + * src/main/java/de/intevation/gnv/artifacts/ressource/artifactMessages*.properties Added, + src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java Added: + Added Factory and Propertiesfiles for getting the localized Values + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java Edited, + src/main/java/de/intevation/gnv/transition/profile/horizontal/NorthSouthEastWestTransition.java Edited, + src/main/java/de/intevation/gnv/transition/TransitionBase.java Edited, + src/main/java/de/intevation/gnv/transition/Transition.java Edited, + src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java Edited, + src/main/java/de/intevation/gnv/transition/OutputTransition.java Edited, + src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java Edited, + src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileArtifact.java Edited, + src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileArtifact.java Edited, + src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java Edited, + src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Edited: + LanguageSupport Integrated + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (createCallContext) Edited: + Extracted Method and Put CallMeta with Language German to the CallContext. Otherwise + TestCase will produce NPEs. + * src/test/java/de/intevation/gnv/artifacts/TestCallContext.java Edited: + Added Real CallMeta to the Method for usage in Artifacts. Otherwise + TestCase will produce NPEs. + * src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_feed.xml Edited, + src/test/ressources/timeseries_mesh/timeseries_step_02_feed.xml Edited, + src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_feed.xml Edited, + src/test/ressources/conf.xml Edited: + Changed som Identifiers for Localisation. + +2009-10-02 Tim Englich + + * src/test/ressources/conf.xml Edited: + Added the Configuration of the Horizontal-Profile.Mesh. + Also Edited the Workflowq for HorizontalProfile-Instantaneouspoint and + Put three n ew FIS into the Configuration which represents HorizontalProfile-Instantaneouspoint. + * src/test/ressources/horizontalProfile_instantaneouspoint/*.xml Edited, + src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testHorizontalProfileInstantaneousPointArtifact) Edited: + Edited the Workflowlogic given by new Specification of the BSH. + * src/test/ressources/horizontalProfile_mesh/*.xml Added: + The Request for do an Workflow for an HorizontalProfile-Mesh + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testHorizontalProfileMeshPointArtifact) Edited: + Added TestCase for HorizontalProfiles of Type Mesh. + * src/test/java/de/intevation/gnv/artifacts/TestCallContext.java (getMeta) Edited: + Added new Method which is defined in the implemented Interface. + * src/main/java/de/intevation/gnv/utils/InputValidator.java (isInputValid) Edited: + Added the Validation of InputValues from Type AttributeName which should represent + an QueryValue of Type String which must not put into "'". + * src/main/java/de/intevation/gnv/transition/profile/horizontal/NorthSouthEastWestTransition.java Added: + Transition to provide the possibility of choosing the axis of an Grid that should be used. + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (dataMultiSelect) Edited: + Changed from private to protected so that this mMeber could be accessed by within extending Classes. + * src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshArtifact.java Added: + Class for the Representation of Horizontal Profiles for the Type Mesh. + * src/main/java/de/intevation/gnv/chart/HorizontalProfileChartFactory.java (HorizontalProfileChartFactory) Edited: + Changed PlotOrientation so that the Profile is displayed correctly. + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java (advance) Edited: + Added Log-Message for better Workflowanalyzis. + +2009-10-01 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java, + src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java, + src/main/java/de/intevation/gnv/utils/ArtifactFactoryUtilities.java, + src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java, + src/main/java/de/intevation/gnv/transition/MinMaxTransition.java, + src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java, + src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java: + Removed needless imports. + + * src/main/java/de/intevation/gnv/utils/InputValidator.java: + Import org.apache.commons.validator.GenericValidator instead of + absolute usage in methods. + +2009-09-30 Tim Englich + + * src/test/ressources/queries.properties Edited: + Added the Queries for HorizontalProfiles of InstantaneousPoints. + * src/test/ressources/conf.xml Edited: + Added the Configuration for HorizontalProfilArtifact for InstantaneousPoints + * src/test/ressources/horizontalProfile_instantaneouspoint/*.xml Added: + Added XML-Requests for the TestCase of HorizontalProfiles of InstantaneousPoints. + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testHorizontalProfileInstantaneousPointArtifact) Edited: + Added TestCase for HorizontalProfiles of InstantaneousPoints. + +2009-09-30 Tim Englich + + * src/main/java/de/intevation/gnv/utils/InputValidator.java (isInputValid) Edited: + Added the Validation for Double-Values. + * src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java (createChart) Edited: + The Name of the Method for generaing Charts has changed. + * src/main/java/de/intevation/gnv/transition/profile/horizontal/HorizontalProfileOutputTransition.java Added: + New outputTransition for HorizontalProfiles + * src/main/java/de/intevation/gnv/statistics/HorizontalProfileStatistics.java Added: + Class which calculates the Statistics for Horizontal Profiles. + * src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileInstantaneousPointArtifact.java Added, + * src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileArtifact.java Added: + Classes which represents HorizontalProfileArtifacts + * src/main/java/de/intevation/gnv/chart/VerticalProfileChartFactory.java (plotOrientation) Edited: + Added Member for the representation of the Plotorientation to overwrite it in + extende Classes + Rename Method for generatim the Charts in a common Name. + * src/main/java/de/intevation/gnv/chart/HorizontalProfileChartFactory.java Added: + Class for drawing Horzontal Profiles + +2009-09-30 Sascha L. Teichmann + + * src/test/ressources/conf.xml: s@test/xml@text/xml@g + +2009-09-29 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (doNextStep) Edited: + Add Responsevalidation for feed-Requests. + * pom.xml Edited: + Add required Library ORO to the Dependencies which is required by Commons-Validator + to do matchRegexp Requests. + * src/main/java/de/intevation/gnv/utils/InputValidator.java (isInputValid) Edited: + Add a Validator for the type Point + * src/test/ressources/conf.xml Edited: + Changed mesh_coordinate from type Integer to type Point + +2009-09-29 Tim Englich + + * src/main/java/de/intevation/gnv/chart/VerticalProfileChartFactory.java (findValueTitle): + Key of KeyValueDescribeData is a String. So it is not nessessary to parse the + id into an Integer Value. + Also some NP-Access removed. + +2009-09-29 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Edited: + Some Coderedundances refactored. + +2009-09-29 Tim Englich + + * src/test/ressources/queries.properties Edited: + Bug fixed: Mesh TimeSeries will now Handle Charts with multiple Depth-Values properly. + +2009-09-29 Tim Englich + + * src/test/ressources/timeseries_mesh/*.xml Added : + TestCaseRequests for Timeseries FIS Mesh + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testTimeSeriesMeshArtifact) Edited: + Add Testcase for Timeseries Mesh + +2009-09-29 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (check4ExceptionReport) edited: + ExceptionTest for Responsdocuments added. + UnitTest will now fail if the Artifact delivers an ExceptionReport using the advance Request. + +2009-09-29 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testVerticalProfileMeshArtifact) Edited: + Added TestCase for Vertical Profiles for Mesh + * src/test/ressources/verticalprofile_mesh/*.xml Added: + TestCaseRequests for VerticalProfile FIS Mesh + +2009-09-29 Tim Englich + + * src/main/java/de/intevation/gnv/utils/InputValidator.java (isInputValid) Edited: + Bugfix: Remove leading- and trailingwhitspaces from Date- and Integervalues + +2009-09-29 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testVerticalProfileArtifact): + (testVerticalProfileInstantaneousPointArtifact) Edited: + Added Testcases for VerticalProfile and VerticalProfile Instantaneouspoint + * src/test/ressources/verticalprofile_instantaneouspoint/*.xml Added: + TestCaseRequests for VerticalProfile Instantaneouspoint + * src/test/ressources/verticalprofile/*.xml Added: + TestCaseRequests for VerticalProfile FIS Marnet + +2009-09-29 Tim Englich + + * src/test/ressources/queries.properties Edited: + Remove to_date from TimeSeries-Quueries becaus of Changes in the conf.xml-File + * src/test/ressources/conf.xml Edited: + Correct Types for min- and max-Values from Integer to Date + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java (testTimeSeriesArtifact) Edited: + Add CallContext to the Tests. + * src/test/java/de/intevation/gnv/artifacts/TestCallContext.java Add: + A CallContext used only in Junit-Tests + +2009-09-29 Tim Englich + + * pom.xml Edited: + Added the dependency to Apache-Commons-Validator Version 1.3.1 which is + used for the InputValoue-validation. + * src/main/java/de/intevation/gnv/utils/InputValidator.java Added : + An InputValidator for Validating InputValues. + At this Moment only Integer, String and Date is supported. + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (putInputData) Edited: + Add the InputValidator to validate the incomming Values from the Clients. + +2009-09-28 Tim Englich + + * src/main/java/de/intevation/gnv/chart/ChartFactory.java (createTimeSeries) Edited: + Performanceimprovement: The Loop will be interrupted if the Pointer is bigger than the + last Pointer of the Value that must be visualised. + +2009-09-28 Tim Englich + + * pom.xml Edited: + Added the Dependeny to the ehcache-Library + * src/test/ressources/ehcache.xml Added: + The ehcache-Configuration. + * src/test/ressources/conf.xml Edited: + Added the Link to the ehcache-Configuration. + * src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java (createArtifactContext) Edited: + Added the Initialisation of the CacheManager. + + * src/main/java/de/intevation/gnv/artifacts/cache/CacheFactory.java Added: + An Fractoryimplementation for the central access to the Cache. + + * src/main/java/de/intevation/gnv/transition/MinMaxTransition.java (purifyResult) Edited, + * src/main/java/de/intevation/gnv/transition/SingleInputTransition.java (purifyResult) Edited, + * src/main/java/de/intevation/gnv/transition/Transition.java Edited, + * src/main/java/de/intevation/gnv/transition/TransitionBase.java Edited, + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Edited: + Signature of Methods purifyResults, advanced and feed Changed to put the uuid to the Transition + * src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java (createChart) Edited: + Methodsignatur of getChartResult change for putting the uuid of an Artifact into it + * src/main/java/de/intevation/gnv/transition/OutputTransition.java (out) Edited, + src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (out) Edited: + Method Signature Changed for putting the uuid of an Artifact to the Transition. + stored + * src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java Edited: + removed the persitence of the Chartresults and put them into an Cache instance. + +2009-09-28 Tim Englich + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (getStatisticsGenerator) Edited: + Extracted the Instantiation of the Statistics-object to an protected Methode + to make it possible that extending Classes could change it. + * src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java (getStatisticsGenerator) Edited: + Overwrite getStatisticsGenerator to instantiate the VerticalProfileStatistics- + * src/main/java/de/intevation/gnv/statistics/VerticalProfileStatistics.java Added: + Class for Calculating Statistics for VerticalProfiles- The Only thing whisch differs to + TimeSeriesStatists is that the XoordinateValue is an double and not an Date-Value + * src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java (calculateXOrdinateValue) Edited: + Added the Methode calculateXOrdinateValue to this Class to switch is Values in extending Classes. + * src/main/java/de/intevation/gnv/statistics/Statistics.java (calculateStatistics) Edited: + Added methodsignature to Interface for usage in different Implementations of Statistics. + +2009-09-28 Tim Englich + + * src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java (calculateStatistics) Edited: + Bug fixed. Now all Values will be used to calculate the Statistics + +2009-09-28 Tim Englich + + * src/test/ressources/conf.xml Edited : + Changed the Output-format of Statistics from text/plain to text/xml. + +2009-09-28 Tim Englich + + * src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java Edited: + Moved the calculating-Methods from the Conmstructor to an separat Method. + Switched the ResultContainer from Array to Collection + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (out) Edited: + Added the Output-Variante for generating Statistics + +2009-09-28 Tim Englich + + * pom.xml Edited: + Added Link to Apache-Commons-Math to get the required Classes for the calculation + of Statistics. + * src/main/java/de/intevation/gnv/statistics/exception/StatisticsException.java Added: + Specified ExceptionClass for the Statistics Part of the gnv-artifacts + * src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java Edited: + Remove compileErrors and switch to new Datastructure + +2009-09-28 Tim Englich + + * src/main/java/de/intevation/gnv/statistics/Statistic.java Added , + src/main/java/de/intevation/gnv/statistics/Statistics.java Added , + src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java Added: + Imported Statistics-Classes from old Project. Revision: 3101 Does not compile + +2009-09-25 Tim Englich + + * src/test/ressources/conf.xml Edited: + Added with and height Inputparameter to each Chart-OutputMode. + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (out) Edited: + Added the usage of the Parameters revieved from the client for the ChartRendering + + * src/main/java/de/intevation/gnv/transition/DefaultInputValue.java (DefaultInputValue) (getDefaultValue) Edited , + src/main/java/de/intevation/gnv/transition/InputValue.java (getDefaultValue) Edited: + Added the Method getDefaultValue to the Interface for getting the + deafultvalue of an Parameter. + + * src/main/java/de/intevation/gnv/transition/DefaultOutputMode.java Edited, + src/main/java/de/intevation/gnv/transition/OutputMode.java (getInputParameters) Edited: + Added the Method getInputParameters to the OutputMode for Handling the required Parameters + of an OutputMode. + + * src/main/java/de/intevation/gnv/transition/OutputTransition.java (out) Edited: + Put the InputParameter recived from the Client to the Methodsignature so that + they can be used during the outputprocessing. + + * src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java Edited: + Read rquired Outputparameters from the Configuration + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Edited: + Added support for Parameters in OutputNode of Describe-Artifact + +2009-09-24 Tim Englich + + * pom.xml Edited: + Added Library for CSV-Support + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (out) Edited: + Add support for CSV-Export + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java (out) Edited: + Add Fag on Context for storing the Artifact status after out. + +2009-09-24 Tim Englich + + * src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java (createSuccessReport) Edited: + Added a centraL Method for creating an Successreoprt. + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Edited, + src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java Edited: + Add ResultReporting to the different Metshods of an Artifact + +2009-09-24 Tim Englich + + * src/main/java/de/intevation/gnv/chart/VerticalProfileChartFactory.java Edited: + Obsolet TODOs removed + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Edited, + src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java Edited, + src/main/java/de/intevation/gnv/transition/TransitionBase.java Edited: + Create Exception Report added + * src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java (createExceptionReport) Edited: + Method for creating Exceptionreports added. + +2009-09-24 Tim Englich + + * src/test/ressources/queries.properties Edited: + Queries formatted so that they can be analysed and extended easier. + Some Bugs removed + +2009-09-24 Tim Englich + + * src/main/java/de/intevation/gnv/chart/VerticalProfileChartFactory.java Edited, + src/main/java/de/intevation/gnv/chart/ChartLabels.java Edited, + src/main/java/de/intevation/gnv/chart/ChartFactory.java Edited: + Removed obsolet Parameters an Methods. + Use the ChartLable to put the DomainAxisLable into the Chart. + + * src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java Edited: + Some more Loggingoutput integrated. + Some Performanceimprovements done. The ResultData will only be refreshed if + the InputValues has changed. + Some Refactoring Work done. Move some Members into from extending Classes + into this implementation. + * src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java Edited, + src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java Edited: + Dummywerte fuer Diagrammgenerierung durch Echtwerte ersetzt. + Obsolete Uebergabeparameter entfernt. + +2009-09-23 Tim Englich + + * src/test/ressources/queries.properties Edited: + Statements for InstantaneousPoint Vertical Profiles added + * src/test/ressources/conf.xml Edited: + Configuration for Vertikal Profiles for InstantaneousPoints added + * src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileInstantaneousPointArtifact.java (VerticalProfileInstantaneousPointArtifact) Added: + New Artifact-Class Reperesenting Artifacts for InstantaneousPoints Creating VerticalProfiles added. + +2009-09-23 Tim Englich + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (prepareInputData4DateDBQuery) Edited: + Bug Fixed, now all Inputvalues of String and Date will be put into the Query + +2009-09-23 Tim Englich + + * src/main/java/de/intevation/gnv/chart/VerticalProfileChartFactory.java (createXYSeries) Edited: + Bug fixed. Now all Values will be Renderd to the Chart + * src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileMeshArtifact.java Added: + Artifact-class for VerticalProfile Mesh added + * src/main/java/de/intevation/gnv/transition/TransitionBase.java Edited: + Support for StringQuieries and OracleDateQueries added + * src/test/ressources/queries.properties Edited: + Queries for VerticalProfile Mesh integrated + * src/test/ressources/conf.xml Edited: + Artifact for VerticalProfile Mesh integrated + +2009-09-22 Tim Englich + + * src/test/ressources/queries.properties Edited: + Added Queries for the Workfloe of collecting the + required Information to generate a vertical Profile + * src/test/ressources/conf.xml Edited: + Added the Configuration of the VerticalProfileArtifact + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java (getCollection) Edited: + Some Codrefactoring done for reuse of Functionality in extended Classes. + * src/main/java/de/intevation/gnv/transition/profile/vertical/VerticalProfileOutputTransition.java Added: + Outputtransition for the Support of VerticalPropfiles + * src/main/java/de/intevation/gnv/transition/describedata/KeyValueDescibeData.java (getKey), + src/main/java/de/intevation/gnv/transition/describedata/DefaultKeyValueDescribeData.java (getKey) Edietd, + src/main/java/de/intevation/gnv/transition/TransitionBase.java (purifyResult) Edited: + Change KEY-Attribute of KeyValueDescribeData from Integer to String for the required + Representation of Date-KeyValue-Pairs + * src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileArtifact.java Added: + ArtifactClass for the representation of VerticalProfiles + * src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java (createSelectBox) Edited: + Added support for selected Products in static UI. + * src/main/java/de/intevation/gnv/chart/VerticalProfileChartFactory.java Added: + Factory for producing VerticalCharts added. + * src/main/java/de/intevation/gnv/chart/ChartFactory.java Edited: + Names of Getter for Columns Changed. + +2009-09-21 Tim Englich + + * src/test/ressources/queries.properties Edited: + Queryie for TimeSeriesMesh added. + * src/test/ressources/conf.xml Edited: + New Artifact representing the TimeSeries-Mesh added to the Configuration. + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java Edited: + Inputdata for the Chartgeneration will now be allocated by name and not by position in Transitionorder. + * src/main/java/de/intevation/gnv/transition/describedata/SingleValueDescribeData.java Added, + src/main/java/de/intevation/gnv/transition/describedata/DefaultSingleValueDescribeData.java Added, + src/main/java/de/intevation/gnv/transition/SingleInputTransition.java Added: + New Class for Representing a single Input Transition + * src/main/java/de/intevation/gnv/transition/TransitionBase.java Edited: + Added support of usage inputValues none or multiple times in Queries. + Added support for SingleInputTransitions in Describe-Output + * src/main/java/de/intevation/gnv/transition/InputValue.java Edited, + src/main/java/de/intevation/gnv/transition/DefaultInputValue.java Edited: + An InputValue now is possible to use none or multiple times in Queries. + * src/main/java/de/intevation/gnv/timeseries/TimeSeriesMeshArtifact.java Added: + ArtifactClass for the Representation of an Mesh-Timeseries-Artifact + +2009-09-17 Tim Englich + + * src/test/ressources/conf.xml Edited: + Database Cleanup Interval set to 5 minutes. + +2009-09-17 Tim Englich + * src/test/ressources/conf.xml Edited: + Some structurechanges done. + + * src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java Edited: + Fixed Bug supporting UTF-8 Documents properly. + * src/main/java/de/intevation/gnv/transition/describedata/DefaultKeyValueDescribeData.java Edited, + * src/main/java/de/intevation/gnv/transition/describedata/KeyValueDescibeData.java Edited, + Added Methods for setting and getting the selection-state of this objects. + + * src/main/java/de/intevation/gnv/transition/describedata/DefaultMinMaxDescribeData.java Edited, + src/main/java/de/intevation/gnv/transition/describedata/MinMaxDescribeData.java Edited: + Added setter for min an max-Values and getters an setters for minName and maxName + + * src/main/java/de/intevation/gnv/transition/describedata/NamedCollection.java Added, + src/main/java/de/intevation/gnv/transition/describedata/NamedArrayList.java Added: + Collection ans an Implementation of this Collection for Storing Name of the Collection and if + the Values in it are multiselectable. + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java : + Static UI-Support and valid SelectionStorage added. + I added also an imporvement of the multiselect Methods for Datasets + * src/main/java/de/intevation/gnv/transition/MinMaxTransition.java Edited: + Storage of changed Values added + + * src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java Edited: + Static UI Support Added + + +2009-09-16 Tim Englich + + * src/test/ressources/conf.xml Edited, + src/main/java/de/intevation/gnv/transition/TransitionBase.java (describe) Edited, + src/main/java/de/intevation/gnv/transition/InputValue.java (isMultiselect) Edited, + src/main/java/de/intevation/gnv/transition/InputData.java (concartValue) Edited, + src/main/java/de/intevation/gnv/transition/DefaultInputValue.java (isMultiselect) Edited, + src/main/java/de/intevation/gnv/transition/DefaultInputData.java (concartValue)Edited, + src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java (createUserInterface) Edited, + src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java (parseInputData) Edited: + Added Multiselectsupport for InputValues + +2009-09-16 Tim Englich + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java (setup) Edited: + Bug Fixed because of Infrastructure Changes in the Artifact-Module + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java Edited: + Put only the last DescribeData to the UI-Output bnecause auf Renderingproblems in the Client + + * src/main/java/de/intevation/gnv/transition/describedata/DefaultKeyValueDescribeData.java Edited, + src/main/java/de/intevation/gnv/transition/describedata/DefaultMinMaxDescribeData.java Edited, + src/main/java/de/intevation/gnv/transition/describedata/KeyValueDescibeData.java Edited: + Made Interface Serializable, add UIDs to the Implementations of the Interface + +2009-09-15 Tim Englich + + * src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java (createUserInterface) Edited: + Integrate UI-Representation for Describe into the FISArtifact. + * src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java (createXFormElement) Refactoring, + src/main/java/de/intevation/gnv/transition/TransitionBase.java (describe) Refactoring: + Extract the Element-Creation of XForms Nodes into a Common Class to make them available for + other Classes which have to create XForm-Fragments + +2009-09-14 Tim Englich + + * src/main/java/de/intevation/gnv/transition/Transition.java Edited, + src/main/java/de/intevation/gnv/transition/InputData.java Edited, + src/main/java/de/intevation/gnv/transition/OutputMode.java Edited, + src/main/java/de/intevation/gnv/transition/InputValue.java Edited, + src/main/java/de/intevation/gnv/artifacts/fis/product/Product.java Edited, + src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java Edited, + src/main/java/de/intevation/gnv/transition/describedata/DescribeData.java Edited: + Make the Interfaces Serializable to make them usable in the Artifactdatabase + +2009-09-14 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Edited, + src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java Edited, + src/main/java/de/intevation/gnv/transition/OutputTransition.java Edited , + src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java Edited, + src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java Edited, + src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Edited: + Refactoring Work depending on Infrastructurchanges in the Artifact-Module + +2009-09-10 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Edited, + src/test/ressources/timeseries/timeseries_step_01_feed.xml Edited, + src/test/ressources/timeseries/timeseries_step_01_advance.xml Edited, + src/test/ressources/conf.xml Edited: + TestCase moced from TimeSeriesArtifact to FISArtifact. Used FIS: Marnet + +2009-09-10 Tim Englich + + * src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java Added: + Utilities-Class for some XML-Stuff that is only for gnv-artifacts + + * src/main/java/de/intevation/gnv/utils/ArtifactFactoryUtilities.java Added: + Factory to Instantiiate an ArtifactFactory (TODO: Should be moved to Artifact-database) + + * src/main/java/de/intevation/gnv/artifacts/fis/product/Product.java Added, + src/main/java/de/intevation/gnv/artifacts/fis/product/DefaultProduct.java Added: + Interfcaedefinition and Defaultimplementation for the Representation of the different + Products in an FIS. + + * src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java Added: + Artifact to Repersent an FIS. This Artifact is able to switch between different + SubArtifacts for handling the different Products of an FIS. + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Edited: + Refactoring Work done because of changes in the artifact-modules + +2009-09-10 Tim Englich + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Edited, + src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java Edited: + Refactoringwork done because of changes in the artifact-module + +2009-09-10 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Edited: + src/test/ressources/conf.xml Renamed: + Project Structure changed in artifact-database. So we have to rename + the Testconfigurationfile in conf.xml. + + * src/test/ressources/results Added: + Integrated Folder for temporal storing Resultfiles of the TestCases + + * src/test/ressources/queries.properties Edited: + Further Queries for Testcases integrated + * src/test/ressources/timeseries/timeseries_step_05_out.xml Added, + src/test/ressources/timeseries/timeseries_step_05_feed.xml Added: + Integrated the last step of the TimeSeries-Workflow. + Now the TestCase is able to render Charts. + + * src/test/ressources/timeseries/timeseries_step_04_feed.xml Edited, + src/test/ressources/timeseries/timeseries_step_03_feed.xml Edited: + Names of the feed-Parametes changed to the Syntax of BSH-Spelling + +2009-09-09 Tim Englich + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java: + Chart Rendering completed with some Fixes to do + * src/main/java/de/intevation/gnv/transition/TransitionBase.java: + Integrated usage of KeyValueDescibeData + * src/main/java/de/intevation/gnv/transition/OutputTransition.java (getOutputModes): + Errorhandling integrated + * src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java Edited, + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Edited: + Refactored out-Method from Extending Class + +2009-09-09 Tim Englich + + * src/main/java/de/intevation/gnv/chart/exception/TechnicalChartException.java Added, + src/main/java/de/intevation/gnv/chart/ChartFactory.java Edited: + Refactoring of the ChartFactory so that it colud be use and it is possible to compile + this class. + + * src/main/java/de/intevation/gnv/transition/describedata/KeyValueDescibeData.java Added, + src/main/java/de/intevation/gnv/transition/describedata/DefaultKeyValueDescribeData.java Added: + Added an new Representation of Describedata for Key Value Pairs using for the Parameter Lists + of the Transitions an put it into the Chartgeneration + +2009-09-09 Tim Englich + + * pom.xml Edited: + Added JfreeChart Dependency to pom-file + +2009-09-09 Tim Englich + + * src/main/java/de/intevation/gnv/chart/Insets.java Added, + src/main/java/de/intevation/gnv/chart/ChartStyle.java Added, + src/main/java/de/intevation/gnv/chart/ChartLabels.java Added, + src/main/java/de/intevation/gnv/chart/ChartFactory.java Added: + Insert Chart-Classes from OLD-Repository Revision: 3101 Does not compile + +2009-09-09 Tim Englich + + * src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java Added: + The specifed OutputTransition for the Product TimeSeries. + + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Edited: + Integration of the OutputModes in the DescriberesultDocument. + + * src/main/java/de/intevation/gnv/transition/OutputTransitionBase.java Added, + src/main/java/de/intevation/gnv/transition/OutputTransition.java Added: + The Interface and the abstract Basicimplementation of an Transition which + can produce different outputs. + + * src/main/java/de/intevation/gnv/transition/DefaultOutputMode.java Added, + src/main/java/de/intevation/gnv/transition/OutputMode.java Added: + Interfacestructur and Defaultimplementation for the Representation of the + Different OutputModes given in an Artifact. + +2009-09-09 Tim Englich + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java (describe) Edited: + Changed DateoutputFormat from German- to Anericanstyle + +2009-09-09 Tim Englich + + * src/test/ressources/timeseries/timeseries_step_04_feed.xml Added, + * src/test/ressources/timeseries/timeseries_step_04_advance.xml Added: + Two more ArtifactCommands for the next Step in TimeSeriesArtifactTestCase + * src/test/ressources/queries.properties Edited: + New Queries for timeseries_timeinterval added. + Also use KEY ,VALUE, MIN and MAX as Identifiers for the different Columns. + * src/test/ressources/GNVArtifactsTestCase_Configuration.xml Edited, + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Edited: + Modified the TimeseriesArtifact and added one further TransitionStep + +2009-09-09 Tim Englich + + * src/main/java/de/intevation/gnv/transition/describedata/DefaultMinMaxDescribeData.java , + * src/main/java/de/intevation/gnv/transition/describedata/MinMaxDescribeData.java, + * src/main/java/de/intevation/gnv/transition/describedata/DescribeData.java Added: + Interface Structure and Defaultimplementation for Representing DescribeData of an + Transition added. In this Way we are able to switch between different Renderingmethods + for descibe. + * src/main/java/de/intevation/gnv/transition/MinMaxTransition.java Added: + Added MinMaxTransition for representing Min-/Max-Value Results in a Tansition + * src/main/java/de/intevation/gnv/transition/TransitionBase.java Edited: + Integrated Min- / MAX-Value Support for Describe. Also done some Refactoring Work + for easy creating Extensions of this Class. + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Edited: + Userinterface Informations were integrated in the wrong Method. Now the + Informations are put into the ui-Node + +2009-09-08 Tim Englich + + * src/test/ressources/timeseries/timeseries_step_01_advance.xml Edited, + src/test/ressources/timeseries/timeseries_step_01_feed.xml Edited, + src/test/ressources/timeseries/timeseries_step_02_advance.xml Added, + src/test/ressources/timeseries/timeseries_step_02_feed.xml Added, + src/test/ressources/timeseries/timeseries_step_03_advance.xml Added, + src/test/ressources/timeseries/timeseries_step_03_feed.xml Added, + src/test/ressources/GNVArtifactsTestCase_Configuration.xml: Edited, + src/test/ressources/queries.properties Added, + src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Edited: + TestCase implemented until Choosing the TimeInetval of an TimeSeries + + One Entry is Missing + +2009-09-08 Tim Englich + + * src/main/java/de/intevation/gnv/transition/TransitionBase.java Edited, + src/main/java/de/intevation/gnv/transition/Transition.java Edited, + src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Edited, + src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java Edited, + src/test/ressources/GNVArtifactsTestCase_Configuration.xml Edited, + src/test/ressources/timeseries/timeseries_step_01_feed.xml Added , + src/test/ressources/timeseries/timeseries_step_01_advance.xml Added : + Artifact.advance initial implementiert + +2009-09-08 Tim Englich + + * src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java Edited, + src/main/java/de/intevation/gnv/transition/DefaultInputData.java Added, + src/main/java/de/intevation/gnv/transition/InputData.java Added, + src/main/java/de/intevation/gnv/transition/exception/TransitionException.java Added, + src/main/java/de/intevation/gnv/transition/TransitionBase.java Edited, + src/main/java/de/intevation/gnv/transition/Transition.java Edited, + src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Edited: + Funktionalitat Feed initial bereitgestellt. + +2009-09-08 Tim Englich + + * src/test/ressources/GNVArtifactsTestCase_Configuration.xml, + src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java, + src/main/java/de/intevation/gnv/transition/TransitionBase.java, + src/main/java/de/intevation/gnv/transition/DefaultInputValue.java Edited: + Required Inputelements integrated in BasicArtifact-Descibe-Output + +2009-09-08 Tim Englich + + * src/main/java/de/intevation/gnv/transition/DefaultInputValue.java Added, + src/main/java/de/intevation/gnv/transition/InputValue.java Added, + src/main/java/de/intevation/gnv/transition/TransitionBase.java Edited, + src/main/java/de/intevation/gnv/transition/Transition.java Edited, + src/test/ressources/GNVArtifactsTestCase_Configuration.xml Edited: + Constructs for the required Inputvalues for an Transition created + +2009-09-08 Tim Englich + + * src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java, + * src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java:, + * src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java: Edited + Added Output for Describe to the Artifactimplementation + +2009-09-08 Tim Englich + + * src/test/ressources/GNVArtifactsTestCase_Configuration.xml, + src/main/java/de/intevation/gnv/transition/Transition.java (getDescription), + src/main/java/de/intevation/gnv/transition/TransitionBase.java (setup), (getDescription): + Added Description to a Transition + +2009-09-07 Tim Englich + + * src/test/ressources/GNVArtifactsTestCase_Configuration.xml, + src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCase.java: ADD + TestClass for GNV-Artifacts an TimeSeriesArtifacs + + * 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/Transition.java, + src/main/java/de/intevation/gnv/transition/DefaultTransition.java: ADD + Transitionimplementation for handling the substeps of an Artifact Livecycle + + * src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java: ADD + The Artifact for handling the TimeSeries + * 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/GNVArtifactBase.java: + The Basic-Classes for providing GNC Artifacts. this Classes should be the Fundament + for the Implementation of Specialized Artifacts e.g. TimeSeries + * pom: Edited Projectreferences to the other GNV-Projects added + +2009-09-04 Tim Englich + + * src/main/java/de/intevation/gnv/artifacts/ArtifactFactoryBase.java: + Implementation of the General ArtifactFactory + +2009-09-04 Tim Englich + + * pom.xml: Created with maven and put the Moduledependencies into it + * target | .settings | .project | .classpath: Add to SVN-Ignore + * Changes | Changelog | NEWS | README | TODO: Added + * src/**: Added to the Project diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/Changes --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/Changes Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,75 @@ +2009-12-17 RELEASE 0.3 + + New: + + * SVG export for charts (introducing Apache Batik dependency) + * PDF export for charts. (introducing iText dependency) + * style templating for charts via XML. + * Units are now localized and added to the charts + * Gap detection for horizontal and vertical profile charts. + + * 'Horizontale Schnittprofile' + + * Added region filters + + Fixed: + + * Various i18n messages. (Issue 129) + * problems with verticalprofile charts. + * TG_0030.008: "Unterscheidung bei Farben wechselt + zwischen verschiedenen Ausgabeprodukten bei gleicher Parameterwahl" + * TG_0030.004: "Jahreszahlen an der Abszisse werden nicht angezeigt" + * TG_0030.004 : i18n funktioniert an Abzissenbeschriftung noch nicht (Issue 104) + + Changed: + + * The configuration system to define the workflows + with artifacts. Cleaner separation states vs. transistions. + + * Default configuration of ttl of artifacts is more realistic now. + + * Used more recent versions of JFreeChart and Apache Common Math. + + * Local caching of data is now used more consequently + + Removed: + + * Old conterra charting code. + +2009-11-13 RELEASE 0.2 + + * Adding support for relative pathnames relating to central + config document (issue 59) + + * Splitting of configuration documents (Issue 40) + + * Corrected data model of artifacs (issue 3) + + * Added FIS Sea State, SEACAT, Current Meter, Ice Station Reports + + * Implemented gaps for spatial and temportal gaps (issue 45) + + * TG_0040.005: Added a first ODV support + + * Added more input validation to make it more user-friendly + + * Added a first documentation of configuration documents + + +2009-10-07 RELEASE 0.1 + + * Initial release of the artifacts special for the + BSH Generic Viewer. They are to be configured to live + inside an artifact database via conf.xml. + + * The collection of parameters is modelled by transistions + inside the XML. + + * src/test/ressources/conf.xml gives a setup to use all + the provided artifacts. + + * Products can be produced for following FIS: + Marnet, IMIS, STAUN, Modeldata, Delphin, Thermosalinograph, + Chemusurvey, GTS, CTD, CBT in form of time series, + vertical profiles and horizontal profiles on meshes + and instantaneous points. diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/NEWS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/NEWS Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,37 @@ +2009-12-17 RELEASE 0.3 + + * PDF export + * SVG export + * Chart Templating + * 'Horizontale Schnittprofile' + * various i18n fixes + +2009-11-13 RELEASE 0.2 + + * Added support for all required FIS: + Marnet, IMIS, STAUN, Modelldaten, Eisklimatologie, Eismeldungen, SST, + Delphin, Thermosalinograph, Chemusurvey, GTS, CTD, XBT, SeaCat, + Seegangsarchiv, Strommesser (Req. TG_0020.001) + + * Added support for vertical profiles (Chapter 3.3.3.2.2) + + * Added support for horizontal profiles (Chapter 3.3.3.2.3); + part independent of MapViewer + + * Added a first support for ODV format (Req. TG_0040.005) + + * Enabling client for multi-instances (Req. 00_0000.007) + + * Adding of support of internal area filter (Req. TG_0020.012 b) + + * Added more support for internationalization (TG_0050.004) + + * Improved error handling with more user-friendly messages + + * Added required statistical support (Chapter 3.3.3.3.1) + + +2009-10-07 RELEASE 0.1 + + * Initial release of the artifacts special for the Generic BSH Viewer. + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/TODO --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/TODO Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ +TODO: + * Caching of charts is configured via system property. This should be done + in another way. (Property: -Dcache.chart) + * charts for verticalcrosssection and horizontalcrosssection need to be + implemented + * distance of tick units in timeseries charts are in form of "dd-MMM". This + needs to be adapted depending on range of x-axis. diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/bin/run.sh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/bin/run.sh Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,16 @@ +#!/bin/bash + +DIR=`dirname $0`/.. +CLASSPATH= +for l in `find -name \*.jar -print`; do + CLASSPATH=$CLASSPATH:$l +done + +export CLASSPATH + +exec java -Xmx256m \ + -server \ + -Djava.io.tmpdir=/tmp/ \ + -Dartifact.database.dir="$DIR/conf" \ + de.intevation.artifactdatabase.App \ + 2>&1 > /dev/null diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/arcsdeconnectionpool.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/arcsdeconnectionpool.properties Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,31 @@ +############################################################################### +############################################################################### +# In this File it is possible to configure the Connectionpool to the the +# ArcSDE-DataBackend. +# maxActive: Number of maximal Connection which can be used. +# testOnBorrow: Should the Pool test the Connection which will be borrowed +# if it is Valid +# testOnReturn: Should the Pool test the Connection which will be returned +# if it is Valid +# testWhileIdle: Should the Pool test the Connection while it is Idl +# if it is Valid +# timeBetweenEvictionRunsMillis : Time in Milliseconds which is allowed +# to reused a returned Connection. +# server: The URL of the Server where the Database is reachable. +# username: The Username which should be used to Connect to the Databackend. +# credentials: The Credentials to the given username +# port: The Communicationport which must be used to connect to the Databackend +# database: The Name of the Instance which should be connected to. +############################################################################### +############################################################################### + +maxActive=2 +testOnBorrow=true +testOnReturn=false +testWhileIdle=false +timeBetweenEvictionRunsMillis=360000 +server=localhost +username=gast +credentials=gast +port=22119 +database=esri_sde \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/charttemplate.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/charttemplate.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,80 @@ + + + + + + + + + + + + <font> + <size value="20" /> + <type value="Tahoma" /> + <color value="0x000000" /> + <bold value="true" /> + </font> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 5 + 5 + 5 + 5 + + + + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/conf.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,423 @@ + + + de.intevation.gnv.artifacts.context.GNVArtifactContextFactory + + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + de.intevation.artifactdatabase.DefaultArtifactFactory + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${artifacts.config.dir}/ehcache.xml + + + + ${artifacts.config.dir}/arcsdeconnectionpool.properties + ${artifacts.config.dir}/queries.properties + + + + 8181 + localhost + + + + 900000 + + + SA + + + + + + ${artifacts.config.dir}/charttemplate.xml + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/ehcache.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/ehcache.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/log.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/log.conf Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,4 @@ +.level=FINEST +handlers=java.util.logging.ConsoleHandler +java.util.logging.FileHandler.formatter=java.util.logging.SimpleFormatter +java.util.logging.FileHandler.pattern=rest-%u-%g.log diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/log4j.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/log4j.properties Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,17 @@ +############################################################################### +# Developmentconfiguration for the Loggingengine. +# The Configuration will only log the Information to the Console. +# For Test- and Productionenviroment it is necessary to create a +# separate Configuration which will be log the Informations e.g. into +# a File (RolingFileAppender). +############################################################################### + +# Set root logger level to DEBUG and its only appender to A1. +log4j.rootLogger=DEBUG, A1 + +# A1 is set to be a ConsoleAppender. +log4j.appender.A1=org.apache.log4j.ConsoleAppender + +# A1 uses PatternLayout. +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/products/horizontalcrosssection/conf_mesh.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/products/horizontalcrosssection/conf_mesh.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,159 @@ + + + + + area_filter + areaid + false + true + + + + + + + + + + + + + + + + + + + + subarea_filter + subareaid + false + + + + + + + + + + + + + + + verticalprofile_mesh + meshid + false + + + + + + + + + + + + + + + verticalprofile_mesh_with_area + meshid + false + + + + + + + + + + + + + + + horizontalcrosssection_meshpoint_depth + depthid + false + + + + + + + + + + + + + + verticalprofile_mesh_parameter + parameterid + false + + + + + + + + + + + + + + + horizontalcrosssection_mesh_date + dateid + false + + + + + + + + + + + + + + + + horizontalcrosssection_mesh_data + horizontalcrosssection_mesh_odv_data + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/products/horizontalprofile/conf_instantaneouspoint.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,235 @@ + + + + + area_filter + areaid + false + true + + + + + + + + + + + + + + + + + + + + subarea_filter + subareaid + false + + + + + + + + + + + + + + + + horizontalprofile_instantaneouspoint_vehicle_with_area + vehicleid + false + + + + + + + + + + + + + + + horizontalprofile_instantaneouspoint_cruise_with_area + cruiseid + false + + + + + + + + + + + + + + + + horizontalprofile_instantaneouspoint_track_with_area + trackid + false + + + + + + + + + + + + + + + + horizontalprofile_instantaneouspoint_vehicle + vehicleid + false + + horizontalprofile_instantaneouspoint_cruise + + + + + + + + + + + + + + + horizontalprofile_instantaneouspoint_cruise + cruiseid + false + + + + + + + + + + + + + + + horizontalprofile_instantaneouspoint_track + trackid + false + + + + + + + + + + + + + + horizontalprofile_instantaneouspoint_surveyinfo + surveyid + false + + + + + + + + + + + + + + + horizontalprofile_instantaneouspoint_parameter + parameterid + true + + + + + + + + + + + + + + + + horizontalprofile_instantaneouspoint_depth + measurementid + true + + + + + + + + + + + + + + + + + horizontalprofile_instantaneouspoint_chart_data + horizontalprofile_instantaneouspoint_odv_data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,214 @@ + + + + + area_filter + areaid + false + true + + + + + + + + + + + + + + + + + + + + subarea_filter + subareaid + false + + + + + + + + + + + + + + + verticalprofile_mesh + meshid + false + + + + + + + + + + + + + + verticalprofile_mesh_with_area + meshid + false + + + + + + + + + + + + + + + mesh_coordinate + false + + + + + + + + + + + + + + verticalprofile_mesh_point + mesh_point + false + + + + + + + + + + + + + + + axisid + false + + + + + + + + + + + + + + + verticalprofile_mesh_parameter + parameterid + true + + + + + + + + + + + + + + + + horizontalprofile_meshpoint_depth + depthid + true + + + + + + + + + + + + + + + + + verticalprofile_mesh_date + dateid + true + + + + + + + + + + + + + + + + + + horizontalprofile_mesh_chart_data + horizontalprofile_mesh_odv_data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh_cross.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/products/horizontalprofile/conf_mesh_cross.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,181 @@ + + + + + area_filter + areaid + false + true + + + + + + + + + + + + + + + + + + + + subarea_filter + subareaid + false + + + + + + + + + + + + + + + verticalprofile_mesh + meshid + false + + + + + + + + + + + + + + verticalprofile_mesh_with_area + meshid + false + + + + + + + + + + + + + + + mesh_linestring + false + + + + + + + + + + + + + + + + + verticalprofile_mesh_parameter + parameterid + true + + + + + + + + + + + + + + + horizontalprofile_meshpoint_depth + depthid + true + + + + + + + + + + + + + + + + verticalprofile_mesh_date + dateid + true + + + + + + + + + + + + + + + + + horizontalprofile_mesh_cross_chart_data + horizontalprofile_meshpoint_cross_ij + horizontalprofile_mesh_odv_data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/products/timeseries/conf_mesh.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/products/timeseries/conf_mesh.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,197 @@ + + + + + area_filter + areaid + false + true + + + + + + + + + + + + + + + + + + + + subarea_filter + subareaid + false + + + + + + + + + + + + + + + verticalprofile_mesh + meshid + false + + + + + + + + + + + + + + verticalprofile_mesh_with_area + meshid + false + + + + + + + + + + + + + + + mesh_coordinate + false + + + + + + + + + + + + + + timeseries_meshpoint + mesh_point + false + + + + + + + + + + + + + + + timeseries_meshpoint_depth + depthid + true + + + + + + + + + + + + + + + timeseries_mesh_parameter + parameterid + true + + + + + + + + + + + + + + + + timeseries_mesh_interval + timeinterval + false + + + + + + + + + + + + + + + + + + timeseries_mesh_chart_data + timeseries_mesh_odv_data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/products/timeseries/conf_timeseriespoint.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/products/timeseries/conf_timeseriespoint.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,211 @@ + + + + + + + + + + + + + area_filter + + + areaid + + + false + + + true + + + + + + + + + + + + + + + + + + + + + + subarea_filter + subareaid + false + + + + + + + + + + + + + + + timeseries_timeseriespoint + featureid + false + + + + + + + + + + + + + + timeseries_timeseriespoint_with_area + featureid + false + + + + + + + + + + + + + + + timeseries_parameter + parameterid + true + + + + + + + + + + + + + + timeseries_depth_height + measurementid + true + + + + + + + + + + + + + + + timeseries_interval + timeinterval + false + + + + + + + + + + + + + + + + + timeseries_chart_data + timeseries_odv_data + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/products/timeseries/timegap_definition.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/products/timeseries/timegap_definition.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/products/verticalcrosssection/conf_mesh.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/products/verticalcrosssection/conf_mesh.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,191 @@ + + + + + area_filter + areaid + false + true + + + + + + + + + + + + + + + + + + + + subarea_filter + subareaid + false + + + + + + + + + + + + + + + verticalprofile_mesh + meshid + false + + + + + + + + + + + + + + verticalprofile_mesh_with_area + meshid + false + + + + + + + + + + + + + + + mesh_coordinate + false + + + + + + + + + + + + + + verticalprofile_mesh_point + mesh_point + false + + + + + + + + + + + + + + + axisid + false + + + + + + + + + + + + + + + verticalprofile_mesh_parameter + parameterid + false + + + + + + + + + + + + + + + + verticalcrosssection_mesh_date + dateid + false + + + + + + + + + + + + + + + + + verticalcrosssection_mesh_chart_data + verticalcrosssection_mesh_odv_data + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/products/verticalprofile/conf_instantaneouspoint.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/products/verticalprofile/conf_instantaneouspoint.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,104 @@ + + + + + verticalprofile_instantaneouspoint_series + seriesid + false + + + + + + + + + + + + + + verticalprofile_instantaneouspoint_point + instantaneouspoint_point + false + + + + + + + + + + + + + + + verticalprofile_instantaneouspoint_parameter + parameterid + true + + + + + + + + + + + + + + + verticalprofile_instantaneouspoint_minmaxdepth + depthrange + true + + + + + + + + + + + + + + + + + verticalprofile_instantaneouspoint_chart_data + verticalprofile_instantaneouspoint_odv_data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/products/verticalprofile/conf_mesh.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,218 @@ + + + + + area_filter + areaid + false + true + + + + + + + + + + + + + + + + + + + + subarea_filter + subareaid + false + + + + + + + + + + + + + + + verticalprofile_mesh + meshid + false + + + + + + + + + + + + + + verticalprofile_mesh_with_area + meshid + false + + + + + + + + + + + + + + + mesh_coordinate + false + + + + + + + + + + + + + + verticalprofile_mesh_point + mesh_point + false + + + + + + + + + + + + + + + verticalprofile_mesh_mindepth + mindepthid + false + + + + + + + + + + + + + + + verticalprofile_mesh_maxdepth + maxdepthid + false + + verticalprofile_meshpoint_parameter + + + + + + + + + + + + + + + + + verticalprofile_mesh_parameter + parameterid + true + + + + + + + + + + + + + + + + + verticalprofile_mesh_date + dateid + true + + + + + + + + + + + + + + + + + + verticalprofile_mesh_chart_data + verticalprofile_mesh_odv_data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/products/verticalprofile/conf_timeseriespoint.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/products/verticalprofile/conf_timeseriespoint.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,160 @@ + + + + + area_filter + areaid + false + true + + + + + + + + + + + + + + + + + + + + subarea_filter + subareaid + false + + + + + + + + + + + + + + + verticalprofile_point + featureid + false + + + + + + + + + + + + + + timeseries_timeseriespoint_with_area + featureid + false + + + + + + + + + + + + + + + verticalprofile_parameter + parameterid + true + + + + + + + + + + + + + + verticalprofile_date + dateid + true + + + + + + + + + + + + + + + verticalprofile_minmaxdepth + depthrange + true + + + + + + + + + + + + + + + + + verticalprofile_chart_data + verticalprofile_odv_data + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/doc/conf/queries.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/doc/conf/queries.properties Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,1140 @@ +############################################# +############################################# +########## Zeitserie ############## +############################################# +############################################# + +timeseries_timeseriespoint=SELECT DISTINCT \ + tsp.FEATUREID KEY, \ + tsp.NAME VALUE \ + FROM MEDIAN.TIMESERIESPOINT tsp, \ + MEDIAN.MEASUREMENT mmt \ + WHERE tsp.FEATUREID = mmt.FEATUREID AND \ + mmt.SOURCEID = ? \ + order by tsp.name + +timeseries_timeseriespoint_with_area=SELECT \ + MEDIAN.TIMESERIESPOINT.FEATUREID KEY, \ + MEDIAN.TIMESERIESPOINT.NAME VALUE \ + FROM MEDIAN.TIMESERIESPOINT, \ + MEDIAN.MEASUREMENT MMT \ + WHERE MEDIAN.TIMESERIESPOINT.FEATUREID = MMT.FEATUREID AND \ + MMT.SOURCEID = ? AND \ + INTERSECTS(SHAPE, \ + (SELECT st_astext(SHAPE) \ + FROM MEDIAN.FEATUREAREA \ + WHERE (FEATURETYPE = 7 OR FEATURETYPE = 8) AND \ + FEATURECODE = ? )\ + )\ + ORDER BY MEDIAN.TIMESERIESPOINT.NAME + +timeseries_parameter=SELECT DISTINCT \ + p.PARAMETERID KEY, \ + p.GERMANNAME || ' ['|| p.UNIT ||']' VALUE, \ + p.GERMANNAME \ + FROM MEDIAN.PARAMETER P, \ + MEDIAN.TIMESERIES TS, \ + MEDIAN.TIMESERIESVALUE 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=SELECT DISTINCT \ + M.MEASUREMENTID KEY, \ + M.ZLOCATION VALUE \ + FROM MEDIAN.MEASUREMENT M, \ + MEDIAN.TIMESERIESVALUE 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 IN (?)\ + ORDER BY m.ZLOCATION DESC + +timeseries_interval=select min(tv.TIMEVALUE) MIN, \ + max(tv.TIMEVALUE) MAX \ + from MEDIAN.TIMESERIES t, \ + MEDIAN.TIMESERIESVALUE tv \ + where tv.TIMESERIESID = t.TIMESERIESID AND \ + t.PARAMETERID IN ( ? ) AND \ + tv.MEASUREMENTID IN ( ? ) + +timeseries_chart_data=SELECT tv.TIMEVALUE XORDINATE, \ + tv.DATAVALUE YORDINATE, \ + t.PARAMETERID GROUP1, \ + tv.MEASUREMENTID GROUP2, \ + tv.TIMESERIESID GROUP3, \ + t.TIMEINTERVAL GAPID \ + FROM MEDIAN.TIMESERIESVALUE tv, \ + MEDIAN.TIMESERIES t \ + WHERE tv.TIMESERIESID = t.TIMESERIESID AND \ + t.PARAMETERID IN ( ? ) AND \ + tv.MEASUREMENTID IN ( ? ) AND \ + tv.TIMEVALUE >= ? AND \ + tv.TIMEVALUE <= ? \ + ORDER BY tv.MEASUREMENTID, \ + tv.TIMESERIESID, \ + t.PARAMETERID, \ + tv.TIMEVALUE + +timeseries_odv_data = SELECT SI.NAME CRUISE, \ + MEDIAN.TIMESERIESPOINT.NAME STATION, \ + '*' TYPE, \ + ST_ASTEXT(SHAPE), \ + 0 BOTDEPTH, \ + (M.ZLOCATION *-1) DEPTH, \ + TSV.TIMEVALUE, \ + TSV.DATAVALUE, \ + TS.PARAMETERID PARAMETER, \ + TSV.MEASUREMENTID, \ + TSV.TIMESERIESID \ + FROM MEDIAN.TIMESERIESPOINT, \ + MEDIAN.TIMESERIESVALUE 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 IN ( ? ) AND \ + TSV.MEASUREMENTID IN ( ? ) AND \ + TSV.TIMEVALUE >= ? AND \ + TSV.TIMEVALUE <= ? \ + ORDER BY TSV.MEASUREMENTID, \ + TSV.TIMESERIESID, \ + TS.PARAMETERID, \ + TSV.TIMEVALUE + +############################################# +############################################# +########## Zeitserie Mesh ############## +############################################# +############################################# + +timeseries_mesh = SELECT OBJECTID KEY, \ + m.NAME VALUE \ + FROM MEDIAN.MESH m \ + WHERE SOURCEID IN (?) \ + ORDER BY m.NAME +timeseries_meshpoint = SELECT MEDIAN.MESHPOINT.FEATUREID, \ + ST_ASTEXT(SHAPE) \ + FROM MEDIAN.MESHPOINT, \ + MEDIAN.MESH M \ + WHERE MEDIAN.MESHPOINT.MESHID = M.MESHID AND \ + KPOSITION = 1 AND \ + M.OBJECTID = ? AND \ + INTERSECTS(SHAPE,"?") + +timeseries_meshpoint_depth = SELECT MP.FEATUREID KEY, \ + 'Layer ' || ML.KPOSITION || ': ' || -ML.UPPERZLOCATION || ' - '|| -ML.LOWERZLOCATION VALUE \ + from MEDIAN.MESHLAYER ML, \ + MEDIAN.MESHPOINT MP, \ + MEDIAN.MESH M \ + WHERE ML.KPOSITION = MP.KPOSITION AND \ + ML.MESHID = MP.MESHID AND \ + 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 = ?) \ + ORDER BY ML.UPPERZLOCATION DESC + +timeseries_mesh_parameter=SELECT distinct \ + p.PARAMETERID KEY, \ + p.GERMANNAME || ' ['|| p.UNIT ||']' VALUE, \ + p.GERMANNAME \ + from MEDIAN.PARAMETER p, \ + MEDIAN.MESHSCALARVALUE msc, \ + MEDIAN.MESH m \ + where m.OBJECTID = ? AND \ + msc.PARTID = m.PARTIDMIN AND \ + msc.PARAMETERID = p.PARAMETERID \ + order by p.GERMANNAME +timeseries_mesh_interval=select /*+ parallel(TIMEVALUE,5) */ \ + min(TIMEVALUE) MIN, \ + max(TIMEVALUE) MAX \ + from MEDIAN.MESHSCALARVALUE msc, \ + MEDIAN.MESH m \ + where m.OBJECTID = ? AND \ + msc.PARTID >= m.PARTIDMIN AND \ + msc.PARTID <= m.PARTIDMAX AND \ + msc.PARAMETERID IN (?) + +timeseries_mesh_chart_data=select /*+ parallel(timevalue,10) */ \ + msv.TIMEVALUE XORDINATE, \ + msv.DATAVALUE YORDINATE, \ + msv.PARAMETERID GROUP1, \ + msv.FEATUREID GROUP2, \ + mp.FEATUREID GROUP3, \ + -1 GAPID \ + from MEDIAN.MESHSCALARVALUE msv, \ + MEDIAN.MESHPOINT mp, \ + MEDIAN.MESH m \ + where (m.OBJECTID = ? AND \ + msv.PARTID >= m.PARTIDMIN AND \ + msv.PARTID <= m.PARTIDMAX ) AND \ + msv.FEATUREID = mp.FEATUREID AND \ + msv.PARAMETERID in ( ? ) AND \ + mp.FEATUREID in ( ? ) AND \ + msv.TIMEVALUE >= ? AND \ + msv.TIMEVALUE <= ? \ + order by mp.FEATUREID, \ + msv.FEATUREID, \ + msv.PARAMETERID, \ + msv.TIMEVALUE + +timeseries_mesh_odv_data = 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, \ + msv.TIMEVALUE, \ + msv.DATAVALUE, \ + msv.PARAMETERID PARAMETER \ + from MEDIAN.MESHSCALARVALUE msv, \ + MEDIAN.MESHPOINT, \ + MEDIAN.MESH m, \ + MEDIAN.SOURCEINFO SI, \ + MEDIAN.MESHLAYER ML \ + where (m.OBJECTID = ? AND \ + msv.PARTID >= m.PARTIDMIN AND \ + msv.PARTID <= m.PARTIDMAX ) AND \ + m.SOURCEID = SI.SOURCEID AND \ + ML.MESHID = MEDIAN.MESHPOINT.MESHID AND \ + ML.KPOSITION = MEDIAN.MESHPOINT.KPOSITION AND \ + msv.FEATUREID = MEDIAN.MESHPOINT.FEATUREID AND \ + msv.PARAMETERID in (? ) AND \ + MEDIAN.MESHPOINT.FEATUREID in ( ? ) AND \ + msv.TIMEVALUE >= ? AND \ + msv.TIMEVALUE <= ? \ + order by MEDIAN.MESHPOINT.FEATUREID, \ + msv.FEATUREID, \ + msv.PARAMETERID, \ + msv.TIMEVALUE + + +############################################# +############################################# +########## Vertikalprofil ############## +############################################# +############################################# + +verticalprofile_point=SELECT DISTINCT \ + tsp.FEATUREID KEY, \ + tsp.NAME VALUE \ + FROM MEDIAN.TIMESERIESPOINT tsp, \ + MEDIAN.MEASUREMENT mmt \ + WHERE tsp.FEATUREID = mmt.FEATUREID AND \ + mmt.SOURCEID = ? \ + order by tsp.name + +verticalprofile_parameter=SELECT DISTINCT \ + p.PARAMETERID KEY, \ + p.GERMANNAME || ' ['|| p.UNIT ||']' VALUE, \ + p.GERMANNAME \ + from MEDIAN.PARAMETER p, \ + MEDIAN.TIMESERIES ts, \ + MEDIAN.TIMESERIESVALUE tsv, \ + MEDIAN.MEASUREMENT m \ + where ts.PARAMETERID = p.PARAMETERID and \ + ts.TIMESERIESID = tsv.TIMESERIESID and \ + m.MEASUREMENTID = tsv.MEASUREMENTID and \ + m.FEATUREID = ? \ + ORDER BY p.GERMANNAME + +verticalprofile_minmaxdepth= SELECT min(M.ZLOCATION) MIN, \ + max(M.ZLOCATION) MAX \ + FROM MEDIAN.MEASUREMENT M, \ + MEDIAN.TIMESERIES TS, \ + MEDIAN.TIMESERIESVALUE TSV \ + WHERE TS.TIMESERIESID = TSV.TIMESERIESID and \ + M.MEASUREMENTID = TSV.MEASUREMENTID and \ + M.FEATUREID = ? and \ + TS.PARAMETERID IN ( ? ) + +verticalprofile_date=select distinct \ + tsv.TIMEVALUE KEY, \ + tsv.TIMEVALUE VALUE \ + from MEDIAN.TIMESERIES ts, \ + MEDIAN.TIMESERIESVALUE tsv, \ + MEDIAN.MEASUREMENT m \ + where ts.TIMESERIESID = tsv.TIMESERIESID and \ + m.MEASUREMENTID = tsv.MEASUREMENTID and \ + m.FEATUREID = ? and \ + ts.PARAMETERID IN ( ? ) \ + order by tsv.TIMEVALUE + +verticalprofile_chart_data= SELECT M.ZLOCATION XORDINATE, \ + TSV.DATAVALUE YORDINATE, \ + TS.PARAMETERID GROUP1, \ + TSV.TIMEVALUE GROUP2, \ + 1 GROUP3, \ + 1 DATAID \ + from MEDIAN.TIMESERIES TS, \ + MEDIAN.TIMESERIESVALUE TSV, \ + MEDIAN.MEASUREMENT M \ + where TS.TIMESERIESID = TSV.TIMESERIESID AND \ + M.MEASUREMENTID = TSV.MEASUREMENTID AND \ + M.FEATUREID = ? AND \ + TS.PARAMETERID IN ( ? ) AND \ + TSV.TIMEVALUE IN (?) AND \ + M.ZLOCATION >= ? AND \ + M.ZLOCATION <= ? \ + ORDER BY TSV.TIMEVALUE, \ + TSV.TIMESERIESID, \ + TS.PARAMETERID, \ + TSV.TIMEVALUE + +verticalprofile_odv_data = SELECT SI.NAME CRUISE, \ + MEDIAN.TIMESERIESPOINT.NAME STATION, \ + '*' TYPE, \ + ST_ASTEXT(SHAPE), \ + 0 BOTDEPTH, \ + (M.ZLOCATION *-1) DEPTH, \ + TSV.TIMEVALUE, \ + TSV.DATAVALUE, \ + TS.PARAMETERID PARAMETER, \ + TSV.MEASUREMENTID, \ + TSV.TIMESERIESID \ + FROM MEDIAN.TIMESERIESPOINT, \ + MEDIAN.TIMESERIESVALUE 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 \ + M.FEATUREID = ? AND \ + TS.PARAMETERID IN ( ? ) AND \ + TSV.TIMEVALUE IN (?) AND \ + M.ZLOCATION >= ? AND \ + M.ZLOCATION <= ? \ + ORDER BY TSV.MEASUREMENTID, \ + TSV.TIMESERIESID, \ + TS.PARAMETERID, \ + TSV.TIMEVALUE + +############################################# +############################################# +########## Vertikalprofil Mesh ############## +############################################# +############################################# + +verticalprofile_mesh = SELECT OBJECTID KEY, \ + m.NAME VALUE \ + FROM MEDIAN.MESH m \ + WHERE SOURCEID IN (?) \ + order by m.NAME + +verticalprofile_mesh_with_area = SELECT M.OBJECTID KEY, \ + M.NAME VALUE \ + FROM MEDIAN.MESHPOINT, \ + MEDIAN.MESH M \ + WHERE M.SOURCEID IN (?) AND \ + M.MESHID = MEDIAN.MESHPOINT.MESHID AND \ + INTERSECTS(SHAPE, \ + (SELECT st_astext(SHAPE) \ + FROM MEDIAN.FEATUREAREA \ + WHERE (FEATURETYPE = 7 OR FEATURETYPE = 8) AND \ + FEATURECODE = ? )\ + ) \ + order by M.NAME + +verticalprofile_mesh_point = SELECT FEATUREID, \ + ST_ASTEXT(SHAPE) \ + FROM MEDIAN.MESHPOINT \ + WHERE MESHID in \ + (SELECT DISTINCT MESHID \ + FROM MEDIAN.MESH \ + WHERE OBJECTID = ?) AND \ + KPOSITION = 1 AND \ + INTERSECTS(SHAPE,"?") + +verticalprofile_mesh_mindepth = SELECT MP.KPOSITION KEY, \ + 'Layer ' || ML.KPOSITION || ': ' || -ML.UPPERZLOCATION || ' - '|| -ML.LOWERZLOCATION VALUE \ + from MEDIAN.MESHLAYER ML, \ + MEDIAN.MESHPOINT MP, \ + MEDIAN.MESH M \ + WHERE ML.KPOSITION = MP.KPOSITION AND \ + ML.MESHID = MP.MESHID AND \ + 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 = ?) \ + ORDER BY ML.UPPERZLOCATION DESC + +verticalprofile_mesh_maxdepth = SELECT MP.KPOSITION KEY, \ + 'Layer ' || ML.KPOSITION || ': ' || -ML.UPPERZLOCATION || ' - '|| -ML.LOWERZLOCATION VALUE \ + from MEDIAN.MESHLAYER ML, \ + MEDIAN.MESHPOINT MP, \ + MEDIAN.MESH M \ + WHERE ML.KPOSITION = MP.KPOSITION AND \ + ML.MESHID = MP.MESHID AND \ + 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 < ? \ + ORDER BY ML.UPPERZLOCATION DESC + +verticalprofile_mesh_parameter=SELECT distinct \ + p.PARAMETERID KEY, \ + p.GERMANNAME || ' ['|| p.UNIT ||']' VALUE, \ + p.GERMANNAME \ + from MEDIAN.PARAMETER p, \ + MEDIAN.MESHSCALARVALUE msc, \ + MEDIAN.MESH m \ + where m.OBJECTID = ? AND \ + m.PARTIDMIN = msc.PARTID AND \ + msc.PARAMETERID = p.PARAMETERID \ + order by p.GERMANNAME + +verticalprofile_mesh_date= select distinct \ + msv.TIMEVALUE KEY, \ + msv.TIMEVALUE VALUE \ + from MEDIAN.MESHSCALARVALUE msv, \ + MEDIAN.MESH m \ + where m.OBJECTID = ? AND \ + msv.PARTID >= m.PARTIDMIN AND \ + msv.PARTID <= m.PARTIDMAX AND \ + msv.PARAMETERID in (?) \ + order by msv.TIMEVALUE + +verticalprofile_mesh_chart_data=select ml.UPPERZLOCATION XORDINATE, \ + msv.DATAVALUE YORDINATE, \ + mp.KPOSITION KPOSITION, \ + msv.PARAMETERID GROUP1, \ + msv.TIMEVALUE GROUP2, \ + 1 GROUP3, \ + 2 DATAID \ + from MEDIAN.MESHLAYER ml, \ + MEDIAN.MESHPOINT mp, \ + MEDIAN.MESH m, \ + MEDIAN.MESHSCALARVALUE msv \ + where msv.FEATUREID = mp. FEATUREID AND \ + ml.KPOSITION = mp.KPOSITION and \ + ml.MESHID = mp.MESHID and \ + m.MESHID = mp.MESHID AND \ + m.PARTIDMIN <= msv.PARTID AND \ + m.PARTIDMAX >= msv.PARTID AND \ + msv.PARAMETERID in (?) AND \ + msv.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 msv.PARAMETERID, \ + msv.TIMEVALUE, \ + ml.UPPERZLOCATION + +verticalprofile_mesh_odv_data=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, \ + msv.DATAVALUE, \ + msv.PARAMETERID PARAMETER, \ + msv.TIMEVALUE \ + from MEDIAN.MESHLAYER ml, \ + MEDIAN.MESHPOINT, \ + MEDIAN.MESH m, \ + MEDIAN.MESHSCALARVALUE msv, \ + MEDIAN.SOURCEINFO SI \ + where m.SOURCEID = SI.SOURCEID AND \ + 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 \ + 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 msv.PARAMETERID, \ + msv.TIMEVALUE, \ + ml.UPPERZLOCATION + +############################################# +############################################# +##### Vertikalprofil InstantaneousPoint ##### +############################################# +############################################# + +verticalprofile_instantaneouspoint_series = SELECT DISTINCT \ + S.SERIESID KEY, \ + S.DESCRIPTION VALUE \ + FROM MEDIAN.SERIES S, \ + MEDIAN.INSTANTANEOUSPOINT I, \ + MEDIAN.MEASUREMENT M \ + WHERE S.SERIESID = I.SERIESID AND \ + I.POINTSPEC = 4 AND \ + I.FEATUREID = M.FEATUREID AND \ + M.SOURCEID= ? \ + ORDER BY S.DESCRIPTION + +verticalprofile_instantaneouspoint_series_with_area = SELECT \ + S.SERIESID KEY, \ + S.DESCRIPTION VALUE \ + FROM MEDIAN.INSTANTANEOUSPOINT, \ + MEDIAN.SERIES S, \ + MEDIAN.MEASUREMENT M \ + WHERE S.SERIESID = MEDIAN.INSTANTANEOUSPOINT.SERIESID AND \ + MEDIAN.INSTANTANEOUSPOINT.POINTSPEC = 4 AND \ + MEDIAN.INSTANTANEOUSPOINT.FEATUREID = M.FEATUREID AND \ + M.SOURCEID= ? AND \ + INTERSECTS(SHAPE, \ + (SELECT st_astext(SHAPE) \ + FROM MEDIAN.FEATUREAREA \ + WHERE (FEATURETYPE = 7 OR FEATURETYPE = 8) AND \ + FEATURECODE = ? )\ + ) \ + ORDER BY S.DESCRIPTION + +verticalprofile_instantaneouspoint_point = SELECT \ + MEDIAN.INSTANTANEOUSPOINT.FEATUREID, \ + to_char(MEDIAN.INSTANTANEOUSPOINT.TIMEVALUE,'DD.MM.YYYY HH24:MI') VALUE, \ + MEDIAN.INSTANTANEOUSPOINT.TIMEVALUE, \ + ST_ASTEXT(SHAPE) \ + FROM MEDIAN.INSTANTANEOUSPOINT, \ + MEDIAN.MEASUREMENT M \ + WHERE MEDIAN.INSTANTANEOUSPOINT.SERIESID = ? AND \ + MEDIAN.INSTANTANEOUSPOINT.POINTSPEC = 4 AND \ + MEDIAN.INSTANTANEOUSPOINT.FEATUREID = M.FEATUREID AND \ + M.SOURCEID = ? \ + ORDER BY MEDIAN.INSTANTANEOUSPOINT.FEATUREID, \ + MEDIAN.INSTANTANEOUSPOINT.TIMEVALUE + +verticalprofile_instantaneouspoint_parameter = SELECT DISTINCT \ + P.PARAMETERID KEY, \ + p.GERMANNAME || ' ['|| p.UNIT ||']' VALUE, \ + p.GERMANNAME \ + FROM MEDIAN.PARAMETER P, \ + MEDIAN.INSTANTANEOUSPOINT IP, \ + MEDIAN.MEASUREMENT M, \ + MEDIAN.MEASUREDSCALARVALUE MSV \ + WHERE IP.FEATUREID = M.FEATUREID AND \ + M.MEASUREMENTID = MSV.MEASUREMENTID AND \ + MSV.PARAMETERID = P.PARAMETERID AND \ + IP.FEATUREID = ? \ + ORDER BY P.GERMANNAME + +verticalprofile_instantaneouspoint_minmaxdepth = SELECT min(M.ZLOCATION) MIN, \ + max(M.ZLOCATION) MAX \ + FROM MEDIAN.INSTANTANEOUSPOINT IP, \ + MEDIAN.MEASUREMENT M, \ + MEDIAN.MEASUREDSCALARVALUE MSV \ + WHERE IP.FEATUREID = M.FEATUREID AND \ + M.MEASUREMENTID = MSV.MEASUREMENTID AND \ + IP.FEATUREID = ? AND \ + MSV.PARAMETERID in (?) + +verticalprofile_instantaneouspoint_chart_data = SELECT M.ZLOCATION XORDINATE, \ + MSV.DATAVALUE YORDINATE, \ + MSV.PARAMETERID GROUP1, \ + IP.TIMEVALUE GROUP2, \ + 1 GROUP3, \ + 3 DATAID \ + FROM MEDIAN.INSTANTANEOUSPOINT IP, \ + MEDIAN.MEASUREMENT M, \ + MEDIAN.MEASUREDSCALARVALUE MSV \ + WHERE IP.FEATUREID = M.FEATUREID AND \ + M.MEASUREMENTID = MSV.MEASUREMENTID AND \ + IP.FEATUREID = ? AND \ + MSV.PARAMETERID in (?) AND \ + M.ZLOCATION >= ? AND \ + M.ZLOCATION <= ? \ + ORDER BY IP.TIMEVALUE, \ + MSV.PARAMETERID, \ + M.ZLOCATION + +verticalprofile_instantaneouspoint_odv_data = SELECT S.DESCRIPTION CRUISE, \ + MEDIAN.INSTANTANEOUSPOINT.FEATUREID STATION, \ + '*' TYPE, \ + ST_ASTEXT(SHAPE), \ + 0 BOTDEPTH, \ + (M.ZLOCATION * -1) DEPTH, \ + MSV.DATAVALUE, \ + MSV.PARAMETERID PARAMETER, \ + MEDIAN.INSTANTANEOUSPOINT.TIMEVALUE \ + FROM MEDIAN.SERIES S, \ + MEDIAN.INSTANTANEOUSPOINT, \ + MEDIAN.MEASUREMENT M, \ + MEDIAN.MEASUREDSCALARVALUE MSV \ + WHERE S.SERIESID = MEDIAN.INSTANTANEOUSPOINT.SERIESID AND \ + MEDIAN.INSTANTANEOUSPOINT.FEATUREID = M.FEATUREID AND \ + M.MEASUREMENTID = MSV.MEASUREMENTID AND \ + MEDIAN.INSTANTANEOUSPOINT.FEATUREID = ? AND \ + MSV.PARAMETERID in (?) AND \ + M.ZLOCATION >= ? AND \ + M.ZLOCATION <= ? \ + ORDER BY MEDIAN.INSTANTANEOUSPOINT.TIMEVALUE, \ + MSV.PARAMETERID, \ + M.ZLOCATION + +############################################# +############################################# +#### Horizontalprofil InstantaneousPoint #### +############################################# +############################################# +horizontalprofile_instantaneouspoint_vehicle = SELECT DISTINCT \ + V.VEHICLEID KEY, \ + V.NAME VALUE \ + FROM MEDIAN.VEHICLE V, \ + MEDIAN.CRUISE C, \ + MEDIAN.TRACK T, \ + MEDIAN.SURVEYINFO S, \ + MEDIAN.INSTANTANEOUSPOINT I, \ + MEDIAN.MEASUREMENT M \ + WHERE V.VEHICLEID = C.VEHICLEID AND \ + C.CRUISEID = T.CRUISEID AND \ + T.TRACKID = S.TRACKID AND \ + S.SURVEYID = I.SURVEYID AND \ + I.FEATUREID = M.FEATUREID AND \ + M.SOURCEID = ? \ + ORDER BY V.NAME + +horizontalprofile_instantaneouspoint_vehicle_with_area = SELECT V.VEHICLEID KEY, \ + V.NAME VALUE \ + FROM MEDIAN.TRACK, \ + MEDIAN.VEHICLE V, \ + MEDIAN.CRUISE C \ + WHERE V.VEHICLEID = C.VEHICLEID AND \ + C.CRUISEID = MEDIAN.TRACK.CRUISEID AND \ + MEDIAN.TRACK.TRACKID IN \ + (SELECT DISTINCT S.TRACKID \ + FROM MEDIAN.MEASUREMENT M ,\ + MEDIAN.INSTANTANEOUSPOINT I, \ + MEDIAN.SURVEYINFO S \ + WHERE M.SOURCEID = ? AND \ + I.FEATUREID = M.FEATUREID AND \ + S.SURVEYID = I.SURVEYID)AND \ + INTERSECTS(SHAPE, \ + (SELECT st_astext(SHAPE) \ + FROM MEDIAN.FEATUREAREA \ + WHERE (FEATURETYPE = 7 OR FEATURETYPE = 8) AND \ + FEATURECODE = ? )\ + ) \ + ORDER BY V.NAME +horizontalprofile_instantaneouspoint_cruise = SELECT DISTINCT \ + C.CRUISEID KEY, \ + V.NAME || ' ' || \ + C.NAME || ' ' || \ + TO_CHAR(C.STARTDATE,'DD.MM.YYYY') || ' - ' || \ + TO_CHAR(C.ENDDATE,'DD.MM.YYYY') VALUE, \ + V.NAME, \ + C.NAME \ + FROM MEDIAN.CRUISE C, \ + MEDIAN.VEHICLE V, \ + MEDIAN.TRACK T, \ + MEDIAN.SURVEYINFO S, \ + MEDIAN.INSTANTANEOUSPOINT I, \ + MEDIAN.MEASUREMENT M \ + WHERE C.VEHICLEID = V.VEHICLEID AND \ + C.CRUISEID = T.CRUISEID AND \ + T.TRACKID = S.TRACKID AND \ + S.SURVEYID = I.SURVEYID AND \ + I.FEATUREID = M.FEATUREID AND \ + C.VEHICLEID = ? AND \ + M.SOURCEID = ? \ + ORDER BY V.NAME, C.NAME + +horizontalprofile_instantaneouspoint_cruise_with_area = SELECT C.CRUISEID KEY, \ + V.NAME || ' ' || \ + C.NAME || ' ' || \ + TO_CHAR(C.STARTDATE,'DD.MM.YYYY') || ' - ' || \ + TO_CHAR(C.ENDDATE,'DD.MM.YYYY') VALUE, \ + V.NAME, \ + C.NAME \ + FROM MEDIAN.TRACK, \ + MEDIAN.VEHICLE V, \ + MEDIAN.CRUISE C \ + WHERE V.VEHICLEID = C.VEHICLEID AND \ + C.CRUISEID = MEDIAN.TRACK.CRUISEID AND \ + MEDIAN.TRACK.TRACKID IN \ + (SELECT DISTINCT S.TRACKID \ + FROM MEDIAN.MEASUREMENT M ,\ + MEDIAN.INSTANTANEOUSPOINT I, \ + MEDIAN.SURVEYINFO S \ + WHERE M.SOURCEID = ? AND \ + C.VEHICLEID = ? AND \ + I.FEATUREID = M.FEATUREID AND \ + S.SURVEYID = I.SURVEYID)AND \ + INTERSECTS(SHAPE, \ + (SELECT st_astext(SHAPE) \ + FROM MEDIAN.FEATUREAREA \ + WHERE (FEATURETYPE = 7 OR FEATURETYPE = 8) AND \ + FEATURECODE = ? )\ + ) \ + ORDER BY V.NAME +horizontalprofile_instantaneouspoint_track= SELECT \ + T.TRACKID KEY, \ + to_char(T.STARTDATE,'DD.MM.YYYY HH24:MI') || ' - '|| to_char(T.ENDDATE,'DD.MM.YYYY HH24:MI') || ' - '|| T.NAME VALUE \ + FROM MEDIAN.TRACK T \ + WHERE T.CRUISEID = ? \ + ORDER BY T.STARTDATE, \ + T.ENDDATE, \ + T.NAME + +horizontalprofile_instantaneouspoint_track_with_area = SELECT \ + MEDIAN.TRACK.TRACKID KEY, \ + to_char(STARTDATE,'DD.MM.YYYY HH24:MI') || ' - '|| to_char(ENDDATE,'DD.MM.YYYY HH24:MI') || ' - '|| NAME VALUE, \ + NAME \ + FROM MEDIAN.TRACK \ + WHERE MEDIAN.TRACK.CRUISEID = ? AND \ + INTERSECTS(SHAPE, \ + (SELECT st_astext(SHAPE) \ + FROM MEDIAN.FEATUREAREA \ + WHERE (FEATURETYPE = 7 OR FEATURETYPE = 8) AND \ + FEATURECODE = ? )\ + ) \ + ORDER BY STARTDATE, \ + ENDDATE, \ + NAME +horizontalprofile_instantaneouspoint_surveyinfo = SELECT \ + SURVEYID KEY, \ + to_char(STARTDATE,'DD.MM.YYYY HH24:MI') || ' - '|| to_char(ENDDATE,'DD.MM.YYYY HH24:MI') || ' - '|| DESCRIPTION VALUE \ + FROM MEDIAN.SURVEYINFO \ + WHERE TRACKID = ? \ + ORDER BY STARTDATE, \ + ENDDATE, \ + DESCRIPTION +horizontalprofile_instantaneouspoint_parameter = SELECT DISTINCT \ + P.PARAMETERID KEY, \ + p.GERMANNAME || ' ['|| p.UNIT ||']' VALUE, \ + p.GERMANNAME \ + FROM MEDIAN.PARAMETER P, \ + MEDIAN.MEASUREMENT M, \ + MEDIAN.INSTANTANEOUSPOINT IP, \ + MEDIAN.MEASUREDSCALARVALUE MSV \ + WHERE P.PARAMETERID = MSV.PARAMETERID AND \ + MSV.MEASUREMENTID = M.MEASUREMENTID AND \ + M.FEATUREID = IP.FEATUREID AND \ + IP.SURVEYID = ? \ + ORDER BY P.GERMANNAME +horizontalprofile_instantaneouspoint_depth = SELECT DISTINCT \ + M.ZLOCATION KEY, \ + M.ZLOCATION VALUE \ + FROM MEDIAN.MEASUREMENT M, \ + MEDIAN.INSTANTANEOUSPOINT IP \ + WHERE M.FEATUREID = IP.FEATUREID AND \ + IP.SURVEYID = ? \ + ORDER BY M.ZLOCATION +horizontalprofile_instantaneouspoint_chart_data = SELECT ST_ASTEXT(SHAPE), \ + MEDIAN.INSTANTANEOUSPOINT.TIMEVALUE TIME, \ + MSV.DATAVALUE YORDINATE, \ + MSV.PARAMETERID GROUP1, \ + ZLOCATION GROUP2, \ + 1 GROUP3, \ + 3 DATAID \ + FROM MEDIAN.INSTANTANEOUSPOINT, \ + MEDIAN.MEASUREMENT M, \ + MEDIAN.MEASUREDSCALARVALUE MSV \ + WHERE MEDIAN.INSTANTANEOUSPOINT.FEATUREID = M.FEATUREID AND \ + M.MEASUREMENTID = MSV.MEASUREMENTID AND \ + MEDIAN.INSTANTANEOUSPOINT.SURVEYID = ? AND \ + M.ZLOCATION IN (?) AND \ + MSV.PARAMETERID in (?) \ + ORDER BY MSV.PARAMETERID, \ + M.ZLOCATION, \ + MEDIAN.INSTANTANEOUSPOINT.TIMEVALUE +horizontalprofile_instantaneouspoint_odv_data = SELECT V.NAME || ' ' || C.NAME CRUISE, \ + MEDIAN.InstantaneousPoint.FEATUREID STATION, \ + '*' TYPE, \ + 0 BOTDEPTH, \ + (M.ZLOCATION * -1) DEPTH, \ + ST_ASTEXT(SHAPE), \ + MEDIAN.INSTANTANEOUSPOINT.TIMEVALUE, \ + MSV.DATAVALUE, \ + MSV.PARAMETERID PARAMETER \ + FROM MEDIAN.INSTANTANEOUSPOINT, \ + MEDIAN.VEHICLE V, \ + MEDIAN.CRUISE C, \ + (SELECT TRACKID,CRUISEID FROM MEDIAN.TRACK) T, \ + MEDIAN.SURVEYINFO S, \ + MEDIAN.MEASUREMENT M, \ + MEDIAN.MEASUREDSCALARVALUE MSV \ + WHERE V.VEHICLEID = C.VEHICLEID AND \ + C.CRUISEID = T.CRUISEID AND \ + T.TRACKID = S.TRACKID AND \ + S.SURVEYID = MEDIAN.INSTANTANEOUSPOINT.SURVEYID AND \ + MEDIAN.INSTANTANEOUSPOINT.FEATUREID = M.FEATUREID AND \ + M.MEASUREMENTID = MSV.MEASUREMENTID AND \ + MEDIAN.INSTANTANEOUSPOINT.SURVEYID = ? AND \ + M.ZLOCATION IN (?) AND \ + MSV.PARAMETERID in (?) \ + ORDER BY MSV.PARAMETERID, \ + M.ZLOCATION, \ + MEDIAN.INSTANTANEOUSPOINT.TIMEVALUE + +############################################# +############################################# +########### Horizontalprofil MESH ########### +############################################# +############################################# +horizontalprofile_meshpoint_depth = SELECT DISTINCT \ + mp.KPOSITION KEY, \ + 'Layer ' || ml.KPOSITION || ': ' || -ml.UPPERZLOCATION || ' - '|| -ml.LOWERZLOCATION VALUE \ + from MEDIAN.MESHLAYER ml, \ + MEDIAN.MESHPOINT mp \ + where ml.KPOSITION = mp.KPOSITION and \ + ml.MESHID = mp.MESHID 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 = ?)) \ + order by mp.KPOSITION + +horizontalprofile_mesh_chart_data = SELECT ST_ASTEXT(SHAPE), \ + msv.DATAVALUE YORDINATE, \ + msv.PARAMETERID GROUP1, \ + MEDIAN.MESHPOINT.KPOSITION GROUP2, \ + msv.TIMEVALUE GROUP3, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION, \ + 2 DATAID \ + 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 ( ? ) and \ + ? = (select ? from MEDIAN.MESHPOINT where FEATUREID = ?)) \ + order by msv.TIMEVALUE, \ + MEDIAN.MESHPOINT.KPOSITION, \ + msv.PARAMETERID, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION + +horizontalprofile_mesh_odv_data = 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, \ + msv.DATAVALUE, \ + msv.PARAMETERID PARAMETER, \ + msv.TIMEVALUE, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION \ + from MEDIAN.MESHLAYER ml, \ + MEDIAN.MESHPOINT, \ + MEDIAN.MESH m, \ + MEDIAN.MESHSCALARVALUE msv, \ + MEDIAN.SOURCEINFO SI \ + 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.SOURCEID = SI.SOURCEID 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 ( ? ) and \ + ? = (select ? from MEDIAN.MESHPOINT where FEATUREID = ?)) \ + order by msv.TIMEVALUE, \ + MEDIAN.MESHPOINT.KPOSITION, \ + msv.PARAMETERID, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION + +############################################# +############################################# +########### Horizontalprofil MESH ########### +########### Schnittprofil ########### +############################################# +############################################# +horizontalprofile_meshpoint_depth = SELECT DISTINCT \ + mp.KPOSITION KEY, \ + 'Layer ' || ml.KPOSITION || ': ' || -ml.UPPERZLOCATION || ' - '|| -ml.LOWERZLOCATION VALUE \ + from MEDIAN.MESHLAYER ml, \ + MEDIAN.MESHPOINT mp \ + where ml.KPOSITION = mp.KPOSITION and \ + ml.MESHID = mp.MESHID and \ + mp.FEATUREID in \ + ( select FEATUREID \ + from MEDIAN.MESHPOINT mp, \ + MEDIAN.MESH m \ + where m.OBJECTID = ? AND \ + mp.MESHID = m.MESHID )\ + order by mp.KPOSITION + +horizontalprofile_meshpoint_cross_ij=SELECT MEDIAN.MESHFACE.JPOSITION, \ + MEDIAN.MESHFACE.IPOSITION \ + FROM MEDIAN.MESHFACE, \ + MEDIAN.MESH M \ + WHERE MEDIAN.MESHFACE.KPOSITION = 1 AND \ + M.MESHID = MEDIAN.MESHFACE.MESHID AND \ + M.OBJECTID = ? AND \ + INTERSECTS(SHAPE, "?") +horizontalprofile_mesh_cross_chart_data = SELECT ST_ASTEXT(SHAPE), \ + msv.DATAVALUE YORDINATE, \ + msv.PARAMETERID GROUP1, \ + MEDIAN.MESHPOINT.KPOSITION GROUP2, \ + msv.TIMEVALUE GROUP3, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION, \ + 2 DATAID \ + 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 \ + ml.KPOSITION in (?) AND \ + MEDIAN.MESHPOINT.FEATUREID in \ + ( \ + SELECT distinct FEATUREID \ + FROM MEDIAN.MESHPOINT \ + WHERE ? \ + ) \ + order by msv.TIMEVALUE, \ + MEDIAN.MESHPOINT.KPOSITION, \ + msv.PARAMETERID, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION +############################################# +############################################# +############# Profilschnitt MESH ############ +############################################# +############################################# +verticalcrosssection_mesh_date = select distinct \ + msv.TIMEVALUE KEY, \ + msv.TIMEVALUE VALUE \ + from MEDIAN.MESHSCALARVALUE msv, \ + MEDIAN.MESH m \ + where m.OBJECTID = ? AND \ + msv.PARTID >= m.PARTIDMIN AND \ + msv.PARTID <= m.PARTIDMAX AND \ + msv.PARAMETERID = ? \ + order by msv.TIMEVALUE +verticalcrosssection_mesh_chart_data = SELECT ST_ASTEXT(SHAPE), \ + ((ml.UPPERZLOCATION + ml.LOWERZLOCATION) / 2) Z, \ + msv.DATAVALUE YORDINATE, \ + msv.PARAMETERID GROUP1, \ + msv.TIMEVALUE GROUP2, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION, \ + MEDIAN.MESHPOINT.KPOSITION \ + 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 = ? AND \ + msv.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 \ + ? = (select ? from MEDIAN.MESHPOINT where FEATUREID = ?)) \ + order by msv.TIMEVALUE, \ + msv.PARAMETERID, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION, \ + MEDIAN.MESHPOINT.KPOSITION + +verticalcrosssection_mesh_odv_data = 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, \ + MSV.TIMEVALUE, \ + MSV.DATAVALUE, \ + MSV.PARAMETERID PARAMETER, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION, \ + MEDIAN.MESHPOINT.KPOSITION, \ + 2 DATAID \ + from MEDIAN.MESHLAYER ml, \ + MEDIAN.MESHPOINT, \ + MEDIAN.MESH m, \ + MEDIAN.SOURCEINFO SI, \ + 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 \ + M.SOURCEID = SI.SOURCEID AND \ + msv.PARAMETERID = ? AND \ + msv.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 \ + ? = (select ? from MEDIAN.MESHPOINT where FEATUREID = ?)) \ + order by msv.TIMEVALUE, \ + msv.PARAMETERID, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION, \ + MEDIAN.MESHPOINT.KPOSITION + +############################################# +############################################# +########## Horizontalschnitt MESH ########### +############################################# +############################################# +horizontalcrosssection_meshpoint_depth = SELECT DISTINCT MP.KPOSITION KEY, \ + 'Layer ' || ML.KPOSITION || ': ' || -ML.UPPERZLOCATION || ' - '|| -ML.LOWERZLOCATION VALUE \ + from MEDIAN.MESHLAYER ML, \ + MEDIAN.MESHPOINT MP, \ + MEDIAN.MESH M \ + WHERE ML.KPOSITION = MP.KPOSITION AND \ + ML.MESHID = MP.MESHID AND \ + M.OBJECTID = ? AND \ + MP.MESHID = M.MESHID \ + ORDER BY MP.KPOSITION + +horizontalcrosssection_mesh_date = select distinct \ + msv.TIMEVALUE KEY, \ + msv.TIMEVALUE VALUE \ + from MEDIAN.MESHSCALARVALUE msv, \ + MEDIAN.MESH m \ + where m.OBJECTID = ? AND \ + msv.PARTID >= m.PARTIDMIN AND \ + msv.PARTID <= m.PARTIDMAX AND \ + msv.PARAMETERID = ? \ + order by msv.TIMEVALUE + +horizontalcrosssection_mesh_data = SELECT ST_ASTEXT(SHAPE), \ + MSV.DATAVALUE YORDINATE, \ + MEDIAN.MESHFACE.JPOSITION, \ + MEDIAN.MESHFACE.IPOSITION, \ + MEDIAN.MESHFACE.KPOSITION, \ + 2 DATAID \ + from MEDIAN.MESHLAYER ML, \ + MEDIAN.MESHFACE, \ + MEDIAN.MESH M, \ + MEDIAN.MESHSCALARVALUE MSV \ + where MSV.FEATUREID = MEDIAN.MESHFACE.FEATUREID AND \ + ML.KPOSITION = MEDIAN.MESHFACE.KPOSITION and \ + ML.MESHID = MEDIAN.MESHFACE.MESHID and \ + M.MESHID = MEDIAN.MESHFACE.MESHID AND \ + M.PARTIDMIN <= MSV.PARTID AND \ + M.PARTIDMAX >= MSV.PARTID AND \ + MSV.PARAMETERID = ? AND \ + MSV.TIMEVALUE = ? AND \ + M.OBJECTID = ? AND \ + MEDIAN.MESHFACE.KPOSITION = ? \ + order by MEDIAN.MESHFACE.JPOSITION, \ + MEDIAN.MESHFACE.IPOSITION +horizontalcrosssection_mesh_odv_data = 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, \ + MSV.TIMEVALUE, \ + MSV.DATAVALUE, \ + MSV.PARAMETERID PARAMETER, \ + MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION, \ + MEDIAN.MESHPOINT.KPOSITION \ + from MEDIAN.MESHLAYER ML, \ + MEDIAN.MESHPOINT, \ + MEDIAN.MESH M, \ + MEDIAN.SOURCEINFO SI, \ + 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 \ + M.SOURCEID = SI.SOURCEID AND \ + MSV.PARAMETERID = ? AND \ + MSV.TIMEVALUE = ? AND \ + M.OBJECTID = ? AND \ + MEDIAN.MESHPOINT.KPOSITION = ? \ + order by MEDIAN.MESHPOINT.JPOSITION, \ + MEDIAN.MESHPOINT.IPOSITION + +area_filter = SELECT DISTINCT \ + FEATUREID KEY ,\ + DESCRIPTION VALUE \ + FROM MEDIAN.FEATUREAREA \ + WHERE (FEATURETYPE = 7 OR FEATURETYPE = 8) AND \ + FEATUREID > 0 \ + ORDER BY FEATUREID + +subarea_filter = SELECT \ + FEATURECODE KEY, \ + NAME VALUE \ + FROM MEDIAN.FEATUREAREA \ + WHERE (FEATURETYPE = 7 OR FEATURETYPE = 8) AND \ + FEATUREID = ? \ + ORDER BY NAME diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/pom.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/pom.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,134 @@ + + + 4.0.0 + de.intevation.bsh.artifacts + gnv-artifacts + jar + 1.0-SNAPSHOT + gnv-artifacts + http://maven.apache.org + + UTF-8 + + + + + org.apache.maven.plugins + maven-eclipse-plugin + 2.5.1 + + + org.apache.maven.plugins + maven-compiler-plugin + 2.0.2 + + 1.5 + 1.5 + + + + + + + de.intevation.bsh.artifact-database + artifact-database + 1.0-SNAPSHOT + + + de.intevation.bsh.geo-backend + geo-backend + 1.0-SNAPSHOT + + + junit + junit + 3.8.1 + test + + + com.esri.sde + jsde_sdk + 9.2.5 + test + + + com.esri.sde + jpe_sdk + 9.2.5 + test + + + com.ibm + icu4j + 3.2 + test + + + log4j + log4j + [1.2,) + + + jfree + jfreechart + 1.0.13 + + + org.apache.xmlgraphics + batik-dom + 1.7 + + + org.apache.xmlgraphics + batik-svggen + 1.7 + + + com.lowagie + itext + 2.1.7 + + + net.sf.opencsv + opencsv + 2.0 + + + org.apache.commons + commons-math + 2.0 + + + net.sf.ehcache + ehcache + 1.6.2 + + + commons-validator + commons-validator + 1.3.1 + + + oro + oro + 2.0.8 + + + com.vividsolutions + jts + 1.9 + + + + + gt2.repo + GeoTools2 Repository including JTS + http://maven.geotools.fr/repository + + + repository.jboss.org + JBoss Repository + http://repository.jboss.com/maven2 + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/APP.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/APP.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,21 @@ +/** + * + */ +package de.intevation.gnv.artifacts; + +import de.intevation.artifactdatabase.App; + +/** + * @author Tim Englich + * + */ +public class APP { + + /** + * @param args + */ + public static void main(String[] args) { + App.main(args); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/GNVArtifactBase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,513 @@ +/** + * + */ +package de.intevation.gnv.artifacts; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +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.Config; +import de.intevation.artifactdatabase.DefaultArtifact; +import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.ArtifactNamespaceContext; +import de.intevation.artifacts.CallContext; +import de.intevation.artifacts.CallMeta; +import de.intevation.gnv.artifacts.context.GNVArtifactContext; +import de.intevation.gnv.state.DefaultInputData; +import de.intevation.gnv.state.InputData; +import de.intevation.gnv.state.InputValue; +import de.intevation.gnv.state.OutputMode; +import de.intevation.gnv.state.OutputState; +import de.intevation.gnv.state.State; +import de.intevation.gnv.state.StateFactory; +import de.intevation.gnv.state.exception.StateException; +import de.intevation.gnv.transition.Transition; +import de.intevation.gnv.transition.TransitionFactory; +import de.intevation.gnv.utils.ArtifactXMLUtilities; + +/** + * @author Tim Englich + * + */ +public abstract class GNVArtifactBase extends DefaultArtifact { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(GNVArtifactBase.class); + /** + * The UID of this Class + */ + private static final long serialVersionUID = -8907096744400741458L; + + /** + * The Identifier for the Replacement of the Artifactname + */ + public static final String XPATH_IDENTIFIER_REPLACE = "IDENTIFIER"; + + /** + * The XPATH to the XML-Fragment that should be used for the Configuration + */ + public static final String XPATH_ARTIFACT_CONFIGURATION = "/artifact-database/artifacts/artifact[@name='" + + XPATH_IDENTIFIER_REPLACE + + "']"; + + /** + * The current State + */ + protected State current = null; + + /** + * The States that can be used + */ + protected Map states = null; + + /** + * The Transitions which can switch between the different States. + */ + protected Collection transitions = null; + + /** + * The Name of the Artifact + */ + protected String name = null; + + private ArtifactXMLUtilities xmlUtilities = new ArtifactXMLUtilities(); + + /** + * Constructor + */ + public GNVArtifactBase() { + super(); + } + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#advance(org.w3c.dom.Document, + * de.intevation.artifacts.CallContext) + */ + @Override + public Document advance(Document target, CallContext context) { + log.debug("GNVArtifactBase.advance"); + Document result = XMLUtils.newDocument(); + try { + if (this.current != null) { + String stateName = this.readStateName(target); + log.debug("Statename: " + stateName); + if (this.isStateCurrentlyReachable(stateName)) { + try { + State nextStep = this.states + .get(stateName); + // 1.Ergebnisse Berechnen + this.current.advance(super.identifier, context.getMeta()); + // 2. Ergebnisse Übergeben + nextStep.putInputData(this.current.getInputData(), + super.identifier); + // 3. Umschalten auf neue Transistion + this.current = nextStep; + + // 4. Initialisieren des nächsten Schrittes == Laden der Daten + this.current.initialize(super.identifier, context.getMeta()); + + result = new ArtifactXMLUtilities() + .createSuccessReport("Advance success", + XMLUtils.newDocument()); + } catch (StateException e) { + log.error(e, e); + result = new ArtifactXMLUtilities() + .createExceptionReport(e + .getLocalizedMessage(), XMLUtils + .newDocument()); + } + } else { + String msg = "Transitionsübergang wird nicht unterstützt."; + log.error(msg); + result = new ArtifactXMLUtilities().createExceptionReport( + msg, XMLUtils.newDocument()); + } + } else { + String msg = "Kein State aktiviert."; + log.error(msg); + result = new ArtifactXMLUtilities().createExceptionReport(msg, + XMLUtils.newDocument()); + } + } catch (Exception e) { + log.error(e, e); + result = new ArtifactXMLUtilities().createExceptionReport(e + .getLocalizedMessage(), XMLUtils.newDocument()); + } + return result; + } + + + private boolean isStateCurrentlyReachable(String stateid){ + log.debug("GNVArtifactBase.isStateCurrentlyReachable "+stateid); + Iterator it = this.transitions.iterator(); + String from = this.current.getID(); + while (it.hasNext()){ + Transition transition = it.next(); + if (transition.getFrom().equals(from)){ + if (transition.getTo().equals(stateid) && transition.isValid(this.current)){ + return true; + } + } + } + return false; + } + + public Document initialize (CallContext context) { + Document result = XMLUtils.newDocument(); + try { + this.current.initialize(super.identifier, context.getMeta()); + result = new ArtifactXMLUtilities() + .createSuccessReport("Initialize success", + XMLUtils.newDocument()); + } catch (StateException e) { + log.error(e,e); + result = new ArtifactXMLUtilities().createExceptionReport(e + .getLocalizedMessage(), XMLUtils.newDocument()); + } + return result; + } + + protected String readStateName(Document document) { + String returnValue = Config.getStringXPath(document, + "action/target/@name"); + return returnValue; + } + + protected Node getConfigurationFragment(Document document) { + log.debug("GNVArtifactBase.getConfigurationFragment"); + String xpathQuery = XPATH_ARTIFACT_CONFIGURATION.replaceAll( + XPATH_IDENTIFIER_REPLACE, this.name); + log.debug(xpathQuery); + + Element configurationNode = (Element)Config.getNodeXPath(document, xpathQuery); + + String link = configurationNode.getAttribute("xlink:href"); + if (link != null ){ + String absolutFileName = Config.replaceConfigDir(link); + configurationNode = (Element)new ArtifactXMLUtilities().readConfiguration(absolutFileName); + } + + return configurationNode; + } + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#feed(org.w3c.dom.Document, + * de.intevation.artifacts.CallContext) + */ + @Override + public Document feed(Document target, CallContext context) { + log.debug("GNVArtifactBase.feed"); + Document result = XMLUtils.newDocument(); + try { + if (this.current != null) { + Collection inputData = this.parseInputData(target, + "/action/data/input"); + if (!inputData.isEmpty()){ + this.current.putInputData(inputData, super.identifier); + result = new ArtifactXMLUtilities().createSuccessReport( + "Feed success", XMLUtils.newDocument()); + }else{ + String msg = "No Inputdata given. Please select at least one Entry."; + log.warn(msg); + result = new ArtifactXMLUtilities().createExceptionReport(msg, + XMLUtils.newDocument()); + } + } else { + String msg = "No State instantiated"; + log.warn(msg); + result = new ArtifactXMLUtilities().createExceptionReport(msg, + XMLUtils.newDocument()); + } + } catch (StateException e) { + log.error(e, e); + result = new ArtifactXMLUtilities().createExceptionReport(e + .getLocalizedMessage(), XMLUtils.newDocument()); + } + return result; + } + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#setup(java.lang.String, + * java.lang.Object) + */ + @Override + public void setup(String identifier, ArtifactFactory factory, Object context) { + log.debug("GNVArtifactBase.setup"); + super.setup(identifier, factory, context); + + Object localContext = context; + if (context instanceof CallContext) { + localContext = ((CallContext) context).globalContext(); + + } + + if (localContext instanceof GNVArtifactContext) { + GNVArtifactContext gnvContext = (GNVArtifactContext) localContext; + Document doc = gnvContext.getConfig(); + Node artifactNode = this.getConfigurationFragment(doc); + + NodeList stateList = Config.getNodeSetXPath(artifactNode, + "states/state"); + this.states = new HashMap(stateList + .getLength()); + for (int i = 0; i < stateList.getLength(); i++) { + State tmpState = StateFactory.getInstance() + .createState(stateList.item(i)); + if (tmpState != null) { + this.states.put(tmpState.getID(), tmpState); + if (this.current == null) { + this.current = tmpState; + } + } + } + + NodeList transitionList = Config.getNodeSetXPath(artifactNode, + "states/transition"); + this.transitions = new ArrayList(transitionList.getLength()); + for (int i = 0; i < transitionList.getLength(); i++) { + Transition tmpTransition = TransitionFactory.getInstance() + .createTransition(transitionList.item(i)); + if (tmpTransition != null) { + this.transitions.add(tmpTransition); + } + } + + } + } + + + + protected Document createDescibeOutput(CallMeta callMeta, String uuid, boolean incudeUI) { + log.debug("GNVArtifactBase.createDescibeOutput"); + Document document = XMLUtils.newDocument(); + Element rootNode = this.createRootNode(document); + this.createHeader(rootNode, document, "describe"); + this.createOutputs(rootNode, document); + this.createCurrentState(rootNode, document); + this.createReachableStates(rootNode, document); + this.createModel(rootNode, document); + if (incudeUI){ + this.createUserInterface(rootNode, document, callMeta, uuid); + } + return document; + } + + protected boolean getIncludeUIFromDocument(Document document){ + String value = Config.getStringXPath(document, "action/include-ui"); + boolean includeUI = false; + if (value != null){ + includeUI = Boolean.parseBoolean(value); + } + return includeUI; + } + + protected Element createRootNode(Document document) { + Element rootNode = xmlUtilities.createArtifactElement(document, + "result"); + document.appendChild(rootNode); + return rootNode; + } + + protected void createHeader(Element parent, Document document, + String documentType) { + Element typeNode = xmlUtilities.createArtifactElement(document, "type"); + typeNode.setAttribute("name", documentType); + parent.appendChild(typeNode); + + Element uuidNode = xmlUtilities.createArtifactElement(document, "uuid"); + uuidNode.setAttribute("value", super.identifier); + parent.appendChild(uuidNode); + + Element hashNode = xmlUtilities.createArtifactElement(document, "hash"); + hashNode.setAttribute("value", this.hash()); + parent.appendChild(hashNode); + } + + protected void createReachableStates(Element parent, Document document) { + Element stateNode = xmlUtilities.createArtifactElement(document, + "reachable-states"); + if (this.current != null) { + Iterator transitions = this.transitions.iterator(); + while (transitions.hasNext()) { + Transition tmpTransition = transitions.next(); + if (tmpTransition.getFrom().equals(current.getID()) && + tmpTransition.isValid(this.current)){ + Element currentNode = xmlUtilities.createArtifactElement( + document, "state"); + currentNode.setAttribute("name", tmpTransition.getTo()); + log.debug("Reachable State: " + tmpTransition.getTo()); + currentNode.setAttribute("description", + this.states.get(tmpTransition.getTo()) + .getDescription()); + stateNode.appendChild(currentNode); + } + } + } + parent.appendChild(stateNode); + } + + protected void createCurrentState(Element parent, Document document) { + Element stateNode = xmlUtilities.createArtifactElement(document, + "state"); + stateNode.setAttribute("name", this.current.getID()); + stateNode.setAttribute("description", this.current.getDescription()); + parent.appendChild(stateNode); + } + + protected void createModel(Element parent, Document document) { + Element modelNode = xmlUtilities.createArtifactElement(document, + "model"); + if (this.current != null) { + Collection inputValues = this.current + .getRequiredInputValues(); + if (inputValues != null) { + Iterator it = inputValues.iterator(); + while (it.hasNext()) { + InputValue inputValue = it.next(); + Element inputNode = xmlUtilities.createArtifactElement( + document, "input"); + inputNode.setAttribute("name", inputValue.getName()); + inputNode.setAttribute("type", inputValue.getType()); + modelNode.appendChild(inputNode); + } + } + } + parent.appendChild(modelNode); + } + + protected void createUserInterface(Element parent, Document document, + CallMeta callMeta, String uuid) { + Element uiNode = xmlUtilities.createArtifactElement(document, "ui"); + + if (this.current != null) { + this.current.describe(document, uiNode, callMeta, uuid); + } + + parent.appendChild(uiNode); + } + + protected void createOutputs(Element parent, Document document) { + log.debug("GNVArtifactBase.createOutputs"); + Element outputsNode = xmlUtilities.createArtifactElement(document, + "outputs"); + if (this.current instanceof OutputState) { + Collection outputModes = ((OutputState) this.current) + .getOutputModes(); + if (outputModes != null) { + Iterator it = outputModes.iterator(); + while (it.hasNext()) { + OutputMode outputMode = it.next(); + log.debug("Write Outputnode for " + outputMode.toString()); + Element outputModeNode = xmlUtilities + .createArtifactElement(document, "output"); + outputModeNode.setAttribute("name", outputMode.getName()); + outputModeNode.setAttribute("description", outputMode + .getDescription()); + outputModeNode.setAttribute("mime-type", outputMode + .getMimeType()); + outputsNode.appendChild(outputModeNode); + + Collection inputParameters = outputMode + .getInputParameters(); + if (inputParameters != null) { + Element inputParametersNode = xmlUtilities + .createArtifactElement(document, "parameter"); + outputModeNode.appendChild(inputParametersNode); + Iterator it2 = inputParameters.iterator(); + while (it2.hasNext()) { + InputValue inputValue = it2.next(); + Element inputParameterNode = xmlUtilities + .createArtifactElement(document, + "parameter"); + inputParametersNode.appendChild(inputParameterNode); + inputParameterNode.setAttribute("name", inputValue + .getName()); + inputParameterNode.setAttribute("type", inputValue + .getType()); + inputParameterNode.setAttribute("value", inputValue + .getDefaultValue()); + } + } + } + } else { + log.warn("No Outputmodes given."); + } + } + parent.appendChild(outputsNode); + } + + protected Collection parseInputData(Document document, + String xPath) { + log.debug("GNVArtifactBase.parseInputData"); + HashMap returnValue = null; + + log.debug(new ArtifactXMLUtilities().writeDocument2String(document)); + + NodeList inputElemets = (NodeList) XMLUtils.xpath(document, xPath, + XPathConstants.NODESET, ArtifactNamespaceContext.INSTANCE);// Config.getNodeSetXPath(document, + // ""); + if (inputElemets != null) { + returnValue = new HashMap(inputElemets + .getLength()); + for (int i = 0; i < inputElemets.getLength(); i++) { + Element inputDataNode = (Element)inputElemets.item(i); + String name = inputDataNode.getAttribute("name"); + String value = inputDataNode.getAttribute("value"); + + if (returnValue.containsKey(name)) { + InputData inputData = returnValue.get(name); + inputData.concartValue(value); + log.debug(inputData.toString()); + returnValue.put(name, inputData); + } else { + InputData inputData = new DefaultInputData(name, value); + + returnValue.put(name, inputData); + } + } + } + return returnValue.values(); + } + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#out(org.w3c.dom.Document, + * java.io.OutputStream, de.intevation.artifacts.CallContext) + */ + @Override + public void out(Document format, OutputStream outputStream, + CallContext context) throws IOException { + log.debug("TGNVArtifactBase.out"); + try { + + if (current != null && current instanceof OutputState) { + ((OutputState) current) + .out(format, this.parseInputData( + format, "/action/out/params/input"), + outputStream, super.identifier, context); + } + } catch (StateException e) { + log.error(e, e); + throw new IOException(e.getMessage()); + } + } + + protected String readOutputType(Document document) { + String value = Config.getStringXPath(document, "action/out/@name"); + return value; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/cache/CacheFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/cache/CacheFactory.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,86 @@ +/** + * + */ +package de.intevation.gnv.artifacts.cache; + +import net.sf.ehcache.Cache; +import net.sf.ehcache.CacheManager; + +import org.apache.log4j.Logger; + +/** + * @author Tim Englich + * + */ +public class CacheFactory { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(CacheFactory.class); + + private final static String CACHENAME = "artifactdata"; + + /** + * The singleton Instance of this Factory. + */ + private static CacheFactory instance = null; + + /** + * + */ + private CacheManager cacheManager = null; + + /** + * Basic-Constructor of this Class + */ + private CacheFactory() { + super(); + } + + /** + * This Method provides an singleton Instance of this Class. + * + * @return an singleton Instance of this Class + */ + public static CacheFactory getInstance() { + if (instance == null) { + instance = new CacheFactory(); + } + return instance; + } + + /** + * Getting the ConnectionPool + * + * @return the ConnectionPool + */ + public Cache getCache() { + return this.cacheManager.getCache(CACHENAME); + } + + /** + * Initializes the ConnectionPool. Should only be called once on system + * startup + * + * @param properties + * the Properties for the Individual Configuration of the + * ConnectionPool + */ + public void initializeCache(String configurationFileName) { + if (cacheManager == null) { + cacheManager = new CacheManager(configurationFileName); + cacheManager.addCache(CACHENAME); + } + } + + /** + * Checks if the ConnectionPool has already been initialized. + * + * @return true if the ConnectionPool is initialized. + */ + public boolean isInitialized() { + return this.cacheManager != null; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContext.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContext.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,31 @@ +/** + * + */ +package de.intevation.gnv.artifacts.context; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifactdatabase.DefaultArtifactContext; + +/** + * @author Tim Englich + * + */ +public class GNVArtifactContext extends DefaultArtifactContext { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(GNVArtifactContext.class); + + public GNVArtifactContext() { + super(); + log.debug("GNVArtifactContext.Constructor"); + } + + public GNVArtifactContext(Document config) { + super(config); + log.debug("GNVArtifactContext.Constructor(config)"); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/context/GNVArtifactContextFactory.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,141 @@ +/** + * + */ +package de.intevation.gnv.artifacts.context; + +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.InputStream; +import java.io.File; + +import java.util.Properties; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifactdatabase.Config; +import de.intevation.artifacts.ArtifactContextFactory; +import de.intevation.gnv.artifacts.cache.CacheFactory; +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.chart.XMLChartTheme; + +import de.intevation.artifactdatabase.XMLUtils; + +/** + * @author Tim Englich + * + */ +public class GNVArtifactContextFactory implements ArtifactContextFactory { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(GNVArtifactContext.class); + + public static final String XPATH_GEOBACKEND_CONFIGURATION = "artifact-database/geo-backend/backend-configuration"; + + public static final String XPATH_GEOBACKEND_QUERYCONFIGURATION = "artifact-database/geo-backend/query-configuration"; + + private final static String CACHECONFIGNODEPATH = "/artifact-database/ehcache/configuration"; + + private final static String CHARTCONFIGNODEPATH = "/artifact-database/charttemplate/configuration"; + + public final static String CHARTTEMPLATE = "template"; + + /** + * Constructor + */ + public GNVArtifactContextFactory() { + super(); + log.debug("GNVArtifactContextFactory.Constructor"); + } + + /** + * @see de.intevation.artifacts.ArtifactContextFactory#createArtifactContext(org.w3c.dom.Document) + */ + public Object 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); + + log.info("Initialisation of the Cache"); + String cacheConfigurationFile = Config.getStringXPath(config, + CACHECONFIGNODEPATH); + cacheConfigurationFile = Config.replaceConfigDir(cacheConfigurationFile); + CacheFactory cf = CacheFactory.getInstance(); + cf.initializeCache(cacheConfigurationFile); + + log.info("Initialisation of chart template"); + String chartConfigFile = Config.getStringXPath( + config, CHARTCONFIGNODEPATH + ); + chartConfigFile = Config.replaceConfigDir(chartConfigFile); + log.debug("Parse xml configuration of " + chartConfigFile); + + Document tmpl = XMLUtils.parseDocument(new File(chartConfigFile)); + XMLChartTheme theme = new XMLChartTheme("XMLChartTheme"); + if (tmpl != null) { + theme.applyXMLConfiguration(tmpl); + } + else { + log.error( + "Cannot load chart template from '" + + chartConfigFile + "'"); + } + + returnValue = new GNVArtifactContext(config); + + returnValue.put(CHARTTEMPLATE, theme); + } catch (FileNotFoundException e) { + log.error(e, e); + } catch (IOException e) { + log.error(e, e); + } catch (QueryContainerException e) { + log.error(e, e); + } + return returnValue; + } + + /** + * @param filePath + * @return + * @throws FileNotFoundException + * @throws IOException + */ + private Properties getProperties(String filePath) + throws FileNotFoundException, + IOException { + InputStream inputStream = null; + try { + inputStream = new FileInputStream(filePath); + Properties properties = new Properties(); + properties.load(inputStream); + return properties; + } + finally { + if (inputStream != null) { + try { inputStream.close(); } + catch (IOException ioe) {} + } + } + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/FISArtifact.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,478 @@ +/** + * + */ +package de.intevation.gnv.artifacts.fis; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +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.Config; +import de.intevation.artifactdatabase.DefaultArtifact; +import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; +import de.intevation.artifacts.CallMeta; +import de.intevation.gnv.artifacts.GNVArtifactBase; +import de.intevation.gnv.artifacts.context.GNVArtifactContext; +import de.intevation.gnv.artifacts.fis.product.DefaultProduct; +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; +import de.intevation.gnv.utils.ArtifactFactoryUtilities; +import de.intevation.gnv.utils.ArtifactXMLUtilities; + +/** + * @author Tim Englich + * + */ +public class FISArtifact extends DefaultArtifact { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(GNVArtifactBase.class); + /** + * The UID of this Class + */ + private static final long serialVersionUID = 2874044542701727083L; + + /** + * The Identifier for the Replacement of the Artifactname + */ + public static final String XPATH_IDENTIFIER_REPLACE = "IDENTIFIER"; + + /** + * The XPATH to the XML-Fragment that should be used for the Configuration + */ + public static final String XPATH_ARTIFACT_CONFIGURATION = "/artifact-database/artifacts/artifact[@name='" + + XPATH_IDENTIFIER_REPLACE + + "']"; + + /** + * The Name of the Artifact + */ + private String name = null; + + private Map products = null; + + private Artifact productArtifact = null; + + private Product current = null; + + private ArtifactXMLUtilities xmlUtilities = new ArtifactXMLUtilities(); + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#advance(org.w3c.dom.Document, + * de.intevation.artifacts.CallContext) + */ + @Override + public Document advance(Document target, CallContext context) { + + Document result = null; + if (this.productArtifact == null) { + if (this.current != null) { + + String uuid = Config.getStringXPath(target, + "action/uuid/@value"); + String hash = Config.getStringXPath(target, + "action/hash/@value"); + this.productArtifact = this.current.getArtifactFactory() + .createArtifact(uuid, context); + + Document feedDocument = xmlUtilities.reInitDocument(this + .createFeedProductArtifactDocument(uuid, hash)); + log.debug("Feed ==> " + + this.xmlUtilities + .writeDocument2String(feedDocument)); + this.productArtifact.feed(feedDocument, context); + result = ((GNVArtifactBase)this.productArtifact).initialize(context); + } else { + String msg = "Artifact is not configured properly. Call feed first."; + log.error(msg); + result = new ArtifactXMLUtilities().createExceptionReport(msg, + XMLUtils.newDocument()); + } + } else { + result = this.productArtifact.advance(target, context); + } + return result; + } + + private Document createDescribeRequestBody(String uuid, + String hash, + boolean includeUI){ + Document document = XMLUtils.newDocument(); + + Element rootNode = xmlUtilities.createArtifactElement(document,"action"); + document.appendChild(rootNode); + + Element typeNode = this.xmlUtilities.createArtifactElement(document, "type"); + typeNode.setAttribute("name", "describe"); + rootNode.appendChild(typeNode); + + Element uuidNode = this.xmlUtilities.createArtifactElement(document, "uuid"); + uuidNode.setAttribute("value",uuid); + rootNode.appendChild(uuidNode); + + Element hashNode = this.xmlUtilities.createArtifactElement(document, "hash"); + hashNode.setAttribute("value", hash); + rootNode.appendChild(hashNode); + + Element includeUINode = this.xmlUtilities.createArtifactElement(document, "include-ui"); + includeUINode.setTextContent(""+includeUI); + rootNode.appendChild(includeUINode); + + return document; + } + + private Document createAdvanceProductArtifactDocument(String uuid, + String hash, + String targetName) { + Document document = XMLUtils.newDocument(); + Element rootNode = xmlUtilities.createArtifactElement(document, + "action"); + + Element typeNode = xmlUtilities.createArtifactElement(document, "type"); + typeNode.setAttribute("name", "advanve"); + rootNode.appendChild(typeNode); + + Element uuidNode = xmlUtilities.createArtifactElement(document, "uuid"); + uuidNode.setAttribute("value", uuid); + rootNode.appendChild(uuidNode); + + Element hashNode = xmlUtilities.createArtifactElement(document, "hash"); + hashNode.setAttribute("value", hash); + rootNode.appendChild(hashNode); + Element targetNode = xmlUtilities.createArtifactElement(document, + "target"); + targetNode.setAttribute("name", targetName); + rootNode.appendChild(targetNode); + + document.appendChild(rootNode); + return document; + } + + private Document createFeedProductArtifactDocument(String uuid, String hash) { + Document document = XMLUtils.newDocument(); + Element rootNode = xmlUtilities.createArtifactElement(document, + "action"); + + Element typeNode = xmlUtilities.createArtifactElement(document, "type"); + typeNode.setAttribute("name", "feed"); + rootNode.appendChild(typeNode); + + Element uuidNode = xmlUtilities.createArtifactElement(document, "uuid"); + uuidNode.setAttribute("value", uuid); + rootNode.appendChild(uuidNode); + + Element hashNode = xmlUtilities.createArtifactElement(document, "hash"); + hashNode.setAttribute("value", hash); + rootNode.appendChild(hashNode); + + Element dataNode = xmlUtilities.createArtifactElement(document, "data"); + rootNode.appendChild(dataNode); + + Collection parameter = this.current.getParameter(); + if (parameter != null) { + Iterator parameterIt = parameter.iterator(); + while (parameterIt.hasNext()) { + InputData inputData = parameterIt.next(); + Element inputNode = xmlUtilities.createArtifactElement( + document, "input"); + inputNode.setAttribute("name", inputData.getName()); + inputNode.setAttribute("value", inputData.getValue()); + dataNode.appendChild(inputNode); + } + } + document.appendChild(rootNode); + return document; + + } + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#describe(org.w3c.dom.Document, de.intevation.artifacts.CallContext) + */ + @Override + public Document describe(Document data, CallContext context) { + if (this.productArtifact == null) { + return this.createDescibeOutput(context.getMeta()); + } else { + Document document = this.productArtifact.describe(data,context); + document = new ArtifactXMLUtilities().reInitDocument(document); + Node staticNode = Config + .getNodeXPath(document, "/result/ui/static"); + if (staticNode != null) { + Node staticUI = this.createSelectBox(document, context + .getMeta()); + staticNode.insertBefore(staticUI, staticNode.getFirstChild()); + } + return document; + } + } + + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#feed(org.w3c.dom.Document, + * java.lang.Object) + */ + @Override + public Document feed(Document target, CallContext context) { + log.debug("FISArtifact.feed"); + Document result = null; + if (this.productArtifact == null) { + String productName = Config.getStringXPath(target, + "action/data/input[@name='product']/@value"); + log.debug("Looking for ProductArtifact " + productName); + if (this.products.containsKey(productName)) { + this.current = this.products.get(productName); + result = new ArtifactXMLUtilities().createSuccessReport( + "Feed success New ProductArtifact created", XMLUtils + .newDocument()); + } else { + String msg = "Product does not exists for " + productName; + log.error(msg); + result = new ArtifactXMLUtilities().createExceptionReport(msg, + XMLUtils.newDocument()); + } + } else { + log.debug("Feed a Productartifact"); + result = this.productArtifact.feed(target, context); + } + return result; + } + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#out(org.w3c.dom.Document, + * java.lang.Object) + */ + @Override + public void out(Document format, OutputStream outputStream, + CallContext context) throws IOException { + if (this.productArtifact != null) { + this.productArtifact.out(format, outputStream, context); + } + } + + /** + * Constructor + */ + public FISArtifact() { + super(); + } + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#setup(java.lang.String, + * de.intevation.artifacts.ArtifactFactory, java.lang.Object) + */ + @Override + public void setup(String identifier, ArtifactFactory factory, Object context) { + log.debug("FISArtifact.setup"); + this.name = factory.getName(); + super.setup(identifier, factory, context); + if (context instanceof GNVArtifactContext) { + GNVArtifactContext gnvContext = (GNVArtifactContext) context; + Document doc = gnvContext.getConfig(); + Node artifactNode = this.getConfigurationFragment(doc); + + NodeList products = Config.getNodeSetXPath(artifactNode, + "products/product"); + if (products != null) { + this.products = new HashMap(products + .getLength()); + + for (int i = 0; i < products.getLength(); i++) { + Element productNode = (Element)products.item(i); + String productName = productNode.getAttribute("name"); + NodeList parameterNodes = Config.getNodeSetXPath( + productNode, "parameters/parameter"); + Collection parameter = null; + if (parameterNodes != null) { + parameter = new ArrayList(parameterNodes + .getLength()); + for (int j = 0; j < parameterNodes.getLength(); j++) { + Element parameterNode = (Element)parameterNodes.item(j); + String name = parameterNode.getAttribute("name"); + String value = parameterNode.getAttribute("value"); + parameter.add(new DefaultInputData(name, value)); + } + } + Node artifactFactoryNode = Config.getNodeXPath(productNode, + "artifact-factory"); + ArtifactFactory artifactFactory = new ArtifactFactoryUtilities() + .createArtitfactFactor(doc, artifactFactoryNode); + this.products.put(productName, new DefaultProduct( + productName, parameter, artifactFactory)); + } + } + } + } + + protected Node getConfigurationFragment(Document document) { + log.debug("GNVArtifactBase.getConfigurationFragment"); + String xpathQuery = XPATH_ARTIFACT_CONFIGURATION.replaceAll( + XPATH_IDENTIFIER_REPLACE, this.name); + log.debug(xpathQuery); + return Config.getNodeXPath(document, xpathQuery); + } + + protected Document createDescibeOutput(CallMeta callMeta) { + log.debug("GNVArtifactBase.createDescibeOutput"); + Document document = XMLUtils.newDocument(); + Element rootNode = this.createRootNode(document); + this.createHeader(rootNode, document, "describe"); + this.createOutputs(rootNode, document); + this.createCurrentState(rootNode, document); + this.createReachableStates(rootNode, document); + this.createModel(rootNode, document); + this.createUserInterface(rootNode, document, callMeta); + + return document; + } + + protected Element createRootNode(Document document) { + Element rootNode = xmlUtilities.createArtifactElement(document, + "result"); + document.appendChild(rootNode); + return rootNode; + } + + protected void createHeader(Element parent, Document document, + String documentType) { + Element typeNode = xmlUtilities.createArtifactElement(document, "type"); + typeNode.setAttribute("name", documentType); + parent.appendChild(typeNode); + + Element uuidNode = xmlUtilities.createArtifactElement(document, "uuid"); + uuidNode.setAttribute("value", super.identifier); + parent.appendChild(uuidNode); + + Element hashNode = xmlUtilities.createArtifactElement(document, "hash"); + hashNode.setAttribute("value", this.hash()); + parent.appendChild(hashNode); + + } + + protected void createReachableStates(Element parent, Document document) { + Element stateNode = xmlUtilities.createArtifactElement(document, + "reachable-states"); + if (this.products != null) { + Iterator products = this.products.values().iterator(); + while (products.hasNext()) { + Product product = products.next(); + Element currentNode = xmlUtilities.createArtifactElement( + document, "state"); + currentNode.setAttribute("name", product.getName()); + currentNode.setAttribute("description", product.getName()); + stateNode.appendChild(currentNode); + } + } + parent.appendChild(stateNode); + } + + protected void createCurrentState(Element parent, Document document) { + Element stateNode = xmlUtilities.createArtifactElement(document, + "state"); + stateNode.setAttribute("name", "choose-product"); + stateNode.setAttribute("description", + "Initialer Stand Auswahl des products"); + parent.appendChild(stateNode); + } + + protected void createModel(Element parent, Document document) { + Element modelNode = xmlUtilities.createArtifactElement(document, + "model"); + + Element inputNode = xmlUtilities.createArtifactElement(document, + "input"); + inputNode.setAttribute("name", "product"); + inputNode.setAttribute("type", "String"); + modelNode.appendChild(inputNode); + + parent.appendChild(modelNode); + } + + protected void createUserInterface(Element parent, Document document, + CallMeta callMeta) { + Element uiNode = xmlUtilities.createArtifactElement(document, "ui"); + ArtifactXMLUtilities xmlUtilities = new ArtifactXMLUtilities(); + Node dynamic = xmlUtilities.createArtifactElement(document, "dynamic"); + uiNode.appendChild(dynamic); + if (this.products != null && !this.products.isEmpty()) { + Element selectNode = createSelectBox(document, callMeta); + + dynamic.appendChild(selectNode); + } + + parent.appendChild(uiNode); + } + + /** + * @param document + * @param xmlUtilities + * @return + */ + private Element createSelectBox(Document document, CallMeta callMeta) { + + ArtifactXMLUtilities xmlUtilities = new ArtifactXMLUtilities(); + String selectboxName = "product"; + Iterator it = this.products.values().iterator(); + Element selectNode = xmlUtilities.createXFormElement(document, + "select1"); + selectNode.setAttribute("ref", selectboxName); + + Element lableNode = xmlUtilities.createXFormElement(document, "label"); + lableNode.setTextContent(RessourceFactory.getInstance().getRessource( + callMeta.getLanguages(), selectboxName, selectboxName)); + selectNode.appendChild(lableNode); + Element choiceNode = xmlUtilities.createXFormElement(document, + "choices"); + selectNode.appendChild(choiceNode); + while (it.hasNext()) { + Product p = it.next(); + Element itemNode = xmlUtilities + .createXFormElement(document, "item"); + + if (this.current != null + && this.current.getName().equals(p.getName())) { + itemNode.setAttribute("selected", "true"); + } + + Element choiceLableNode = xmlUtilities.createXFormElement(document, + "label"); + choiceLableNode.setTextContent(RessourceFactory.getInstance() + .getRessource(callMeta.getLanguages(), p.getName(), + p.getName())); + itemNode.appendChild(choiceLableNode); + + Element choicValueNode = xmlUtilities.createXFormElement(document, + "value"); + choicValueNode.setTextContent(p.getName()); + itemNode.appendChild(choicValueNode); + + choiceNode.appendChild(itemNode); + + } + return selectNode; + } + + protected void createOutputs(Element parent, Document document) { + log.debug("GNVArtifactBase.createOutputs"); + Element outputsNode = xmlUtilities.createArtifactElement(document, + "outputs"); + parent.appendChild(outputsNode); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/product/DefaultProduct.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/product/DefaultProduct.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,64 @@ +/** + * + */ +package de.intevation.gnv.artifacts.fis.product; + +import java.util.Collection; + +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.gnv.state.InputData; + +/** + * @author Tim Englich + * + */ +public class DefaultProduct implements Product { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = 6473812725442092770L; + + private String name = null; + + private Collection parameter = null; + + private ArtifactFactory artifactFactory = null; + + /** + * Constructor + * + * @param name + * @param parameter + * @param artifactFactory + */ + public DefaultProduct(String name, Collection parameter, + ArtifactFactory artifactFactory) { + super(); + this.name = name; + this.parameter = parameter; + this.artifactFactory = artifactFactory; + } + + /** + * @see de.intevation.gnv.artifacts.fis.product.Product#getName() + */ + public String getName() { + return this.name; + } + + /** + * @see de.intevation.gnv.artifacts.fis.product.Product#getParameter() + */ + public Collection getParameter() { + return this.parameter; + } + + /** + * @see de.intevation.gnv.artifacts.fis.product.Product#getArtifactFactory() + */ + public ArtifactFactory getArtifactFactory() { + return this.artifactFactory; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/product/Product.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/fis/product/Product.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,23 @@ +/** + * + */ +package de.intevation.gnv.artifacts.fis.product; + +import java.io.Serializable; +import java.util.Collection; + +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.gnv.state.InputData; + +/** + * @author Tim Englich + * + */ +public interface Product extends Serializable { + + public String getName(); + + public Collection getParameter(); + + public ArtifactFactory getArtifactFactory(); +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/artifacts/ressource/RessourceFactory.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,171 @@ +/** + * + */ +package de.intevation.gnv.artifacts.ressource; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.IOException; +import java.util.ArrayList; +import java.util.Locale; +import java.util.List; +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +import org.apache.log4j.Logger; + +import de.intevation.artifacts.PreferredLocale; + +/** + * @author Tim Englich + * + */ +public class RessourceFactory { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(RessourceFactory.class); + + /** + * The singleton Instance of this Factory. + */ + private static RessourceFactory instance = null; + + private static String RESSOURCE_BASE_ID = "artifact.ressource.dir"; + + private static String ressourceName = "artifactMessages"; + private static String DEFAULT_DIR = "lang"; + private static String LANG_CONFIG_FILE = "lang.conf"; + + private String ressourceDir = null; + + private Locale[] locales = null; + + /** + * Basic-Constructor of this Class + */ + private RessourceFactory() { + super(); + ressourceDir = System.getProperty(RESSOURCE_BASE_ID, DEFAULT_DIR); + } + + /** + * This Method provides an singleton Instance of this Class. + * + * @return an singleton Instance of this Class + */ + public static synchronized RessourceFactory getInstance() { + if (instance == null) { + instance = new RessourceFactory(); + } + return instance; + } + + + /** + * This method reads locales, configured in LANG_CONFIG_FILE, from + * filesystem and returns them as array. + * + * @return Array of locales supported by the the server. + */ + public Locale[] getLocales() { + + if (locales != null) + return locales; + + log.debug("Supported locales have not been read - read now."); + try { + String config = "/" + ressourceDir + "/" + LANG_CONFIG_FILE; + InputStream in = RessourceFactory.class.getResourceAsStream(config); + + BufferedReader reader = new BufferedReader( + new InputStreamReader(in) + ); + + String line = null; + String country = null; + String language = null; + int idx = -1; + + List tmpLocales = new ArrayList(); + + while((line = reader.readLine()) != null) { + // validate if defined locale has a valid length + if (line.length() != 2 && line.length() != 5) { + log.warn("Illegal locale definition found."); + continue; + } + + idx = line.indexOf("_"); + if (idx > 0) { + // found locale containing language and country code + language = line.substring(0, idx); + country = line.substring(idx+1); + tmpLocales.add(new Locale(language, country)); + } + else { + // found locale containing languagey code only + tmpLocales.add(new Locale(line)); + } + } + + locales = (Locale[]) tmpLocales.toArray( + new Locale[tmpLocales.size()] + ); + + return locales; + } + catch (FileNotFoundException fnfe) { + log.warn("File not found: " + LANG_CONFIG_FILE, fnfe); + } + catch (IOException ioe) { + log.warn(ioe.getLocalizedMessage(), ioe); + } + + return null; + } + + + /** + * Deliveres the translated Value for an Key to an given Language + * + * @param locale + * The choosen locale + * @param key + * the key + * @param defaultValue + * the Value that should be returned. + * @return the translated Value + */ + public String getRessource(PreferredLocale[] preferredLocales, String key, + String defaultValue) { + if (key == null || preferredLocales.length == 0) { + return defaultValue; + } + + return getRessource(preferredLocales[0].getLocale(), key, defaultValue); + } + + + public String getRessource(Locale locale, String key, String defaultVal) { + if (key == null || locale == null) + return defaultVal; + + try { + ResourceBundle rb = ResourceBundle.getBundle( + ressourceDir + "/" + ressourceName, + locale + ); + + return rb.getString(key); + } + catch (MissingResourceException mre) { + log.warn("No resource bundle: " + locale.toString(), mre); + return defaultVal; + } + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractChart.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractChart.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,31 @@ +package de.intevation.gnv.chart; + +import java.util.Collection; +import java.util.Locale; + +import org.jfree.chart.JFreeChart; +import org.jfree.chart.ChartTheme; + +/** + * @author Ingo Weinzierl + */ +public abstract class AbstractChart +implements Chart +{ + protected JFreeChart chart; + protected boolean linesVisible; + protected boolean shapesVisible; + + protected Locale locale; + + protected ChartLabels labels; + protected ChartTheme theme; + protected Collection parameters; + protected Collection measurements; + protected Collection resultSet; + protected Collection dates; + protected Collection timeGaps; + + public abstract JFreeChart generateChart(); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=latin1 : diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/AbstractXYLineChart.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,273 @@ +package de.intevation.gnv.chart; + +import java.awt.Color; +import java.awt.geom.Ellipse2D; +import java.text.NumberFormat; +import java.util.Collection; +import java.util.Iterator; +import java.util.Locale; +import java.util.Map; + +import org.apache.log4j.Logger; + +import org.jfree.chart.JFreeChart; +import org.jfree.chart.ChartFactory; +import org.jfree.chart.axis.Axis; +import org.jfree.chart.axis.NumberAxis; +import org.jfree.chart.axis.NumberTickUnit; +import org.jfree.chart.axis.AxisLocation; +import org.jfree.chart.plot.PlotOrientation; +import org.jfree.chart.plot.XYPlot; +import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; +import org.jfree.chart.title.TextTitle; +import org.jfree.data.xy.XYDataset; +import org.jfree.data.Range; +import org.jfree.data.general.Series; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.describedata.KeyValueDescibeData; + + +/** + * @author Ingo Weinzierl + */ +public abstract class AbstractXYLineChart +extends AbstractChart +{ + public static final double LOWER_MARGIN = 0.05D; + public static final double UPPER_MARGIN = 0.05D; + + private static Logger log = Logger.getLogger(AbstractXYLineChart.class); + + protected static Color[] COLOR = { + Color.black, Color.red, Color.green, Color.blue, Color.yellow, + Color.gray, Color.orange, Color.pink, Color.cyan + }; + + protected static int nextColor = 0; + + protected PlotOrientation PLOT_ORIENTATION = PlotOrientation.VERTICAL; + + /** Map to store datasets for each parameter */ + protected Map datasets; + + /** Map to store max ranges of each parameter (axis.setAutoRange(true) + * doesn't seem to work */ + protected Map ranges; + + protected abstract void initData(); + protected abstract void addValue(Result row, Series series); + protected abstract void addSeries(Series series, String label, int idx); + protected abstract void localizeDomainAxis(Axis axis, Locale locale); + protected abstract String createSeriesName( + String breakPoint1, + String breakPoint2, + String breakPoint3 + ); + + + public JFreeChart generateChart() { + log.debug("generate XYLineChart"); + nextColor = 0; + + if (chart != null) + return chart; + + initChart(); + + chart.addSubtitle(new TextTitle(labels.getSubtitle())); + + theme.apply(chart); + initData(); + + adjustPlot((XYPlot)chart.getPlot()); + + return chart; + } + + + protected void initChart() { + chart = ChartFactory.createXYLineChart( + labels.getTitle(), + labels.getDomainAxisLabel(), + null, + null, + PLOT_ORIENTATION, + true, + false, + false + ); + } + + + protected void prepareAxis(String seriesKey, int idx) { + log.debug("prepare axis of xychart"); + + XYPlot plot = chart.getXYPlot(); + Axis xAxis = plot.getDomainAxis(); + NumberAxis yAxis = new NumberAxis(seriesKey); + + localizeDomainAxis(xAxis, locale); + localizeRangeAxis(yAxis, locale); + + // 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)); + log.debug("Max Range of dataset is: " + yRange.toString()); + + if (seriesKey.contains("richtung")) { + yAxis.setTickUnit(new NumberTickUnit(30.0)); + yAxis.setUpperBound(360.0); + yAxis.setLowerBound(0.0); + } + else { + yAxis.setFixedDimension(10.0); + yAxis.setAutoRangeIncludesZero(false); + } + + plot.setRangeAxis(idx, yAxis); + yAxis.configure(); + + if (idx % 2 != 0) + plot.setRangeAxisLocation(idx, AxisLocation.BOTTOM_OR_RIGHT); + else + plot.setRangeAxisLocation(idx, AxisLocation.BOTTOM_OR_LEFT); + } + + + protected void adjustRenderer( + int idx, + int seriesCount, + boolean renderLines, + boolean renderShapes + ) { + log.debug("Adjust render of series"); + XYLineAndShapeRenderer renderer = null; + XYPlot plot = chart.getXYPlot(); + + try { + renderer = (XYLineAndShapeRenderer)((XYLineAndShapeRenderer) + (plot.getRenderer())).clone(); + } + catch (CloneNotSupportedException cnse) { + log.warn("Error while cloning renderer.", cnse); + renderer = new XYLineAndShapeRenderer(renderLines, renderShapes); + renderer.setBaseShape(new Ellipse2D.Double(-2,-2,4,4)); + } + + for (int i = 0; i < seriesCount; i++) { + renderer.setSeriesShape(i, renderer.getSeriesShape(0)); + renderer.setSeriesPaint(i, COLOR[nextColor%COLOR.length]); + renderer.setSeriesShapesVisible(i, renderShapes); + renderer.setSeriesLinesVisible(i, renderLines); + nextColor++; + } + plot.setRenderer(idx, renderer); + } + + + protected void adjustPlot(XYPlot plot) { + if (plot.getRangeAxisCount() > 1) + plot.setRangeGridlinesVisible(false); + } + + + protected void localizeRangeAxis(Axis axis, Locale locale) { + if (locale == null) + return; + + log.debug( + "Set language of axis [" + axis.getLabel() + "] " + + "to " + locale.toString() + ); + + NumberFormat format = NumberFormat.getInstance(locale); + ((NumberAxis) axis).setNumberFormatOverride(format); + } + + + public Range getMaxRangeOfDataset(XYDataset dataset) { + int seriesCount = dataset.getSeriesCount(); + double upper = Double.NEGATIVE_INFINITY; + double lower = Double.POSITIVE_INFINITY; + + for (int i = 0; i < seriesCount; i++) { + int itemCount = dataset.getItemCount(i); + + for (int j = 0; j < itemCount; j++) { + Number num = dataset.getY(i, j); + + if (num != null) { + double y = num.doubleValue(); + lower = y < lower ? y : lower; + upper = y > upper ? y : upper; + } + } + } + + return new Range(lower, upper); + } + + + public Range getMaxRangeOfDatasetWithMargin( + XYDataset dataset, + double percent + ) { + Range range = getMaxRangeOfDataset(dataset); + double length = range.getLength(); + double upper = range.getUpperBound() + length /100 * percent; + double lower = range.getLowerBound() - length /100 * percent; + + return new Range(lower, upper); + } + + + protected String findParameter(String label) { + Iterator iter = parameters.iterator(); + + while (iter.hasNext()) { + KeyValueDescibeData data = (KeyValueDescibeData) iter.next(); + String key = data.getValue(); + + if (label.indexOf(key) > -1) + return key; + } + + return label; + } + + + protected String findValueTitle(Collection values, String id) { + log.debug("find description of dataset"); + + if (values != null){ + Iterator it = values.iterator(); + while (it.hasNext()) { + KeyValueDescibeData data = (KeyValueDescibeData) it.next(); + + if (id.equals(data.getKey())) + return data.getValue(); + } + } + return ""; + } + + + protected void storeMaxRange(double value, String parameter) { + Range range = null; + + range = ranges.containsKey(parameter) + ? (Range) ranges.get(parameter) + : new Range(value, value); + + double lower = range.getLowerBound(); + double upper = range.getUpperBound(); + + lower = value < lower ? value : lower; + upper = value > upper ? value : upper; + + ranges.put(parameter, new Range(lower, upper)); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/chart/Chart.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/Chart.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,12 @@ +package de.intevation.gnv.chart; + +import org.jfree.chart.JFreeChart; + + +/** + * @author Ingo Weinzierl + */ +public interface Chart { + + public JFreeChart generateChart(); +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartLabels.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartLabels.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,68 @@ +/* Copyright (C) 2007 con terra GmbH (http://www.conterra.de) + * All rights reserved + * + * $Id: ChartLabels.java,v 1.1 2007/12/10 13:57:13 drewnak Exp $ + * + * created by: drewnak + * created at : 10.12.2007 + * created at : 11:48:39 + * + * modified by: $Author: drewnak $ + * modified at: $Date: 2007/12/10 13:57:13 $ + */ +package de.intevation.gnv.chart; + +/** + * @author drewnak + * @author Tim Englich Changes and codecleanup + */ +public class ChartLabels { + /** + * + */ + private String title; + + /** + * + */ + private String subtitle; + + /** + * + */ + private String domainAxisLabel; + + /** + * Constructor + * + * @param title + * @param domainAxisLabel + */ + public ChartLabels(String title, String subtitle, String domainAxisLabel) { + this.title = title; + this.subtitle = subtitle; + this.domainAxisLabel = domainAxisLabel; + } + + /** + * @return the title + */ + public String getTitle() { + return this.title; + } + + + /** + * @return the subtitle + */ + public String getSubtitle() { + return subtitle; + } + + /** + * @return the timeAxisLabel + */ + public String getDomainAxisLabel() { + return this.domainAxisLabel; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartStyle.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/ChartStyle.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,170 @@ +/* Copyright (C) 2007 con terra GmbH (http://www.conterra.de) + * All rights reserved + * + * $Id: ChartStyle.java,v 1.2 2007/12/21 12:31:15 blume Exp $ + * + * created by: drewnak + * created at : 10.12.2007 + * created at : 13:07:44 + * + * modified by: $Author: blume $ + * modified at: $Date: 2007/12/21 12:31:15 $ + */ +package de.intevation.gnv.chart; + +import java.awt.Color; +import java.awt.Dimension; + +/** + * @author drewnak + */ +public class ChartStyle { + + private Color mCanvasColor; + private Color mPlotBackgroundColor; + private Color mDomainGridlineColor; + private Color mRangeGridlineColor; + private boolean mDomainCrosshairVisible; + private boolean mRangeCrosshairVisible; + private Insets mAxisOffset; + private boolean mOverrideDefaultChartWidth = false; + private Dimension mChartSize; + + private boolean mUseUpperDataLevel = false; + private boolean mUseLowerDataLevel = false; + private int mUpperLevel; + private int mLowerLevel; + + /** + * @param pCanvasColor + * @param pPlotBackgroundColor + * @param pDomainGridlineColor + * @param pRangeGridlineColor + * @param pDomainCrosshairVisible + * @param pRangeCrosshairVisible + * @param pAxisOffset + */ + public ChartStyle(Color pCanvasColor, Color pPlotBackgroundColor, + Color pDomainGridlineColor, Color pRangeGridlineColor, + boolean pDomainCrosshairVisible, + boolean pRangeCrosshairVisible, Insets pAxisOffset, + Dimension pChartSize) { + super(); + mCanvasColor = pCanvasColor; + mPlotBackgroundColor = pPlotBackgroundColor; + mDomainGridlineColor = pDomainGridlineColor; + mRangeGridlineColor = pRangeGridlineColor; + mDomainCrosshairVisible = pDomainCrosshairVisible; + mRangeCrosshairVisible = pRangeCrosshairVisible; + mAxisOffset = pAxisOffset; + mChartSize = pChartSize; + } + + public Color getCanvasColor() { + return mCanvasColor; + } + + public void setCanvasColor(Color pCanvasColor) { + mCanvasColor = pCanvasColor; + } + + public Color getDomainGridlineColor() { + return mDomainGridlineColor; + } + + public void setDomainGridlineColor(Color pDomainGridlineColor) { + mDomainGridlineColor = pDomainGridlineColor; + } + + public Color getRangeGridlineColor() { + return mRangeGridlineColor; + } + + public void setRangeGridlineColor(Color pRangeGridlineColor) { + mRangeGridlineColor = pRangeGridlineColor; + } + + public boolean isDomainCrosshairVisible() { + return mDomainCrosshairVisible; + } + + public void setDomainCrosshairVisible(boolean pDomainCrosshairVisible) { + mDomainCrosshairVisible = pDomainCrosshairVisible; + } + + public boolean isRangeCrosshairVisible() { + return mRangeCrosshairVisible; + } + + public void setRangeCrosshairVisible(boolean pRangeCrosshairVisible) { + mRangeCrosshairVisible = pRangeCrosshairVisible; + } + + public Insets getAxisOffset() { + return mAxisOffset; + } + + public void setAxisOffset(Insets pAxisOffset) { + mAxisOffset = pAxisOffset; + } + + public Color getPlotBackgroundColor() { + return mPlotBackgroundColor; + } + + public void setPlotBackgroundColor(Color pPlotBackgroundColor) { + mPlotBackgroundColor = pPlotBackgroundColor; + } + + public Dimension getChartSize() { + return mChartSize; + } + + public void setChartSize(Dimension pChartSize) { + mChartSize = pChartSize; + } + + public boolean isOverrideDefaultChartWidth() { + return mOverrideDefaultChartWidth; + } + + public void setOverrideDefaultChartWidth(boolean pOverrideDefaultChartWidth) { + mOverrideDefaultChartWidth = pOverrideDefaultChartWidth; + } + + public void setNewChartWidth(int pNewChartWidth) { + mChartSize.setSize(pNewChartWidth, mChartSize.getHeight()); + } + + public boolean isUseUpperDataLevel() { + return mUseUpperDataLevel; + } + + public void setUseUpperDataLevel(boolean pUseUpperDataLevel) { + mUseUpperDataLevel = pUseUpperDataLevel; + } + + public boolean isUseLowerDataLevel() { + return mUseLowerDataLevel; + } + + public void setUseLowerDataLevel(boolean pUseLowerDataLevel) { + mUseLowerDataLevel = pUseLowerDataLevel; + } + + public int getUpperLevel() { + return mUpperLevel; + } + + public void setUpperLevel(int pUpperLevel) { + mUpperLevel = pUpperLevel; + } + + public int getLowerLevel() { + return mLowerLevel; + } + + public void setLowerLevel(int pLowerLevel) { + mLowerLevel = pLowerLevel; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/chart/HorizontalCrossProfileChart.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/HorizontalCrossProfileChart.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,62 @@ +package de.intevation.gnv.chart; + +import java.util.Collection; +import java.util.Locale; + +import de.intevation.gnv.chart.ChartLabels; +import de.intevation.gnv.geobackend.base.Result; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; +import org.jfree.data.general.Series; + +/** + * @author Ingo Weinzierl + */ +public class HorizontalCrossProfileChart +extends HorizontalProfileChart +{ + private static Logger log = Logger.getLogger(HorizontalCrossProfileChart.class); + + public HorizontalCrossProfileChart( + 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 gapDetection( + Result[] results, + Series series, + int startPos, + int endPos + ) { + log.warn( + "No gap detection for horizontalcrossprofile charts " + + "implemented yet." + ); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/HorizontalProfileChart.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,283 @@ +package de.intevation.gnv.chart; + +import java.util.Collection; +import java.util.Locale; + +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.io.WKTReader; +import com.vividsolutions.jts.io.ParseException; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; +import org.jfree.chart.plot.PlotOrientation; +import org.jfree.data.general.Series; +import org.jfree.data.xy.XYSeries; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.utils.DistanceCalculator; + + +/** + * @author Ingo Weinzierl + */ +public class HorizontalProfileChart +extends VerticalProfileChart +{ + private static Logger log = Logger.getLogger(HorizontalProfileChart.class); + + private static WKTReader wktReader = new WKTReader(); + private Point lastPoint; + private double distance; + + + public HorizontalProfileChart( + 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 + ); + this.PLOT_ORIENTATION = PlotOrientation.VERTICAL; + this.distance = 0; + } + + + protected void gapDetection( + Result[] results, + Series series, + int startPos, + int endPos + ) { + log.debug("Start gap detection."); + try { + Point startValue = getPoint(results[startPos]); + Point endValue = getPoint(results[endPos-1]); + if (results[0].getInteger("DATAID") == 2) + addGapsOnGrid(results, series, startPos, endPos); + else + addGaps( + results, + series, + startValue, + endValue, + startPos, + endPos + ); + } + catch (ParseException pe) { + log.warn( + "Error while parsing points for gap detection. " + + "No gaps for current series will be detected." + ); + } + + log.debug("Gap detection finished."); + } + + + protected void addValue(Result row, Series series) { + try { + Point point = (Point) wktReader.read(row.getString("SHAPE")); + if (lastPoint != null) + distance = distance + DistanceCalculator.calculateDistance( + lastPoint, point + ); + lastPoint = point; + + ((XYSeries) series).add( + distance, + row.getDouble("YORDINATE") + ); + } + catch(ParseException pe) { + log.warn("No data found while parsing."); + } + } + + + protected void addSeries(Series series, String label, int idx) { + super.addSeries(series, label, idx); + + // reset values used by current series for next series + lastPoint = null; + distance = 0; + } + + + protected String createSeriesName( + String breakPoint1, + String breakPoint2, + String breakPoint3 + ) { + log.debug("create seriesname of horizontalprofile chart"); + return super.createSeriesName( + breakPoint1, + breakPoint2, + breakPoint3) + + " " + + findValueTitle(dates, breakPoint3); + } + + + protected void addGapsOnGrid( + Result[] results, + Series series, + int startPos, + int endPos + ) { + String axis = getDependendAxisName( + results[startPos], + results[startPos+1] + ); + + double range = 0; + double distance = 0; + int last = 0; + int current = 0; + Point lastPoint = null; + Point currentPoint = null; + + 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]); + distance = DistanceCalculator.calculateDistance( + lastPoint, + currentPoint + ); + + boolean detected = gridDetection(last, current); + + if (detected) { + log.debug( + "Gap detected on grid between " + range + + " and " + (range+distance) + ); + + ((XYSeries) series).add(range+0.0001, null); + } + + range += distance; + } + catch (ParseException pe) { + log.warn("Error while parsing point for gap detection.", pe); + } + } + } + + + protected void addGaps( + Result[] results, + Series series, + Point startValue, + Point endValue, + int startPos, + int endPos + ) { + double range = 0; + Point last = null; + Point now = null; + + for (int i = startPos+1; i < endPos; i++) { + boolean detected = false; + + try { + last = (Point) getPoint(results[i-1]); + now = (Point) getPoint(results[i]); + + // gap detection for more than GAP_MAX_VALUES values + if (results.length > GAP_MAX_VALUES) + detected = simpleDetection(startValue, endValue, last, now); + // gap detection for less than GAP_MAX_VALUES values + else + detected = specialDetection( + startValue, + endValue, + last, + now, + results.length + ); + + // gap detected, insert null value to break line + if (detected) { + log.info("Gap after " + range); + double x = range + 0.0001; + + ((XYSeries)series).add(x, null); + } + + range += DistanceCalculator.calculateDistance(last,now); + } + catch (ParseException pe) { + log.warn("Error while parsing point."); + } + + } + } + + + protected boolean simpleDetection( + Point start, + Point end, + Point last, + Point current + ) { + double delta = DistanceCalculator.calculateDistance(start, end); + double deltaSmall = DistanceCalculator.calculateDistance(last,current); + + return (deltaSmall > (delta / 100 * PERCENTAGE)); + } + + + protected boolean specialDetection( + Point start, + Point end, + Point last, + Point current, + int count + ) { + double delta = Math.abs( + DistanceCalculator.calculateDistance(end, start) + ); + double smallDelta = Math.abs( + DistanceCalculator.calculateDistance(current, last) + ); + + return (smallDelta > (3.0 / (count - 1) * delta)); + } + + @Override + protected String getDependendAxisName(Result first, Result second) { + if (first.getInteger("IPOSITION") == second.getInteger("IPOSITION")) + return "JPOSITION"; + + return "IPOSITION"; + } + + private Point getPoint(Result result) + throws ParseException + { + return (Point) wktReader.read(result.getString("SHAPE")); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/chart/Insets.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/Insets.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,34 @@ +/* Copyright (C) 2007 con terra GmbH (http://www.conterra.de) + * All rights reserved + * + * $Id: Insets.java,v 1.1 2007/12/10 13:57:13 drewnak Exp $ + * + * created by: drewnak + * created at : 10.12.2007 + * created at : 13:31:12 + * + * modified by: $Author: drewnak $ + * modified at: $Date: 2007/12/10 13:57:13 $ + */ +package de.intevation.gnv.chart; + +public class Insets { + public double mUpper; + public double mLower; + public double mLeft; + public double mRight; + + /** + * @param pUpper + * @param pLower + * @param pLeft + * @param pRight + */ + public Insets(double pUpper, double pLeft, double pLower, double pRight) { + super(); + mUpper = pUpper; + mLower = pLower; + mLeft = pLeft; + mRight = pRight; + } +} \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/TimeSeriesChart.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,354 @@ +package de.intevation.gnv.chart; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.Collection; +import java.util.Date; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Locale; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; +import org.jfree.chart.ChartFactory; +import org.jfree.chart.axis.Axis; +import org.jfree.chart.axis.DateAxis; +import org.jfree.chart.plot.XYPlot; +import org.jfree.chart.plot.PlotOrientation; +import org.jfree.data.general.Series; +import org.jfree.data.time.TimeSeries; +import org.jfree.data.time.Minute; +import org.jfree.data.time.TimeSeriesCollection; + +import de.intevation.gnv.artifacts.ressource.RessourceFactory; +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.timeseries.gap.TimeGap; + + +/** + * @author Ingo Weinzierl + */ +public class TimeSeriesChart +extends AbstractXYLineChart +{ + + private static final String DATE_FORMAT = "chart.timeseries.date.format"; + + public static final String DEFAULT_DATE_FORMAT = "dd-MMM-yyyy"; + + private static final long NO_TIME_GAP = Long.MAX_VALUE - 1000; + + private static Logger log = Logger.getLogger(TimeSeriesChart.class); + + + public TimeSeriesChart( + ChartLabels labels, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Collection result, + Collection timeGaps, + Locale locale, + boolean linesVisible, + boolean shapesVisible + ) { + this.labels = labels; + this.theme = theme; + this.parameters = parameters; + this.measurements = measurements; + this.dates = dates; + this.resultSet = result; + this.timeGaps = timeGaps; + this.locale = locale; + this.PLOT_ORIENTATION = PlotOrientation.VERTICAL; + this.linesVisible = linesVisible; + this.shapesVisible = shapesVisible; + this.datasets = new HashMap(); + this.ranges = new HashMap(); + } + + + protected void initChart() { + chart = ChartFactory.createTimeSeriesChart( + labels.getTitle(), + labels.getDomainAxisLabel(), + null, + null, + true, + false, + false + ); + } + + + protected void initData() { + log.debug("init data for timeseries chart"); + + String breakPoint1 = null; + String breakPoint2 = null; + String breakPoint3 = null; + + Iterator iter = resultSet.iterator(); + Result row = null; + String seriesName = null; + String parameter = null; + TimeSeries series = null; + + int idx = 0; + int startPos = 0; + int endPos = 0; + Date startDate = null; + Date endDate = null; + + Result[] results = + (Result[]) resultSet.toArray(new Result[resultSet.size()]); + + while (iter.hasNext()) { + row = (Result) iter.next(); + + // add current data to plot and prepare for next one + if (!row.getString("GROUP1").equals(breakPoint1) || + !row.getString("GROUP2").equals(breakPoint2) || + !row.getString("GROUP3").equals(breakPoint3) + ) { + log.debug("prepare data/plot for next dataset"); + + if(series != null) { + // add gaps before adding series to chart + startDate = results[startPos].getDate("XORDINATE"); + endDate = results[endPos-1].getDate("XORDINATE"); + addGaps(results,series,startDate,endDate,startPos,endPos); + addSeries(series, parameter, idx); + + startPos = endPos + 1; + } + + // prepare variables for next plot + breakPoint1 = row.getString("GROUP1"); + breakPoint2 = row.getString("GROUP2"); + breakPoint3 = row.getString("GROUP3"); + + seriesName = createSeriesName( + breakPoint1, + breakPoint2, + breakPoint3 + ); + parameter = findParameter(seriesName); + + log.debug("next dataset is '" + seriesName + "'"); + series = new TimeSeries(seriesName, Minute.class); + } + + addValue(row, series); + storeMaxRange(row.getDouble("YORDINATE"), parameter); + endPos++; + } + + // add the last dataset if existing to plot and prepare its axis + startDate = results[startPos].getDate("XORDINATE"); + endDate = results[endPos-1].getDate("XORDINATE"); + addGaps(results, series, startDate, endDate, startPos, endPos); + addSeries(series, parameter, idx); + + addDatasets(); + } + + + protected void addValue(Result row, Series series) { + ((TimeSeries) series).addOrUpdate( + new Minute(row.getDate("XORDINATE")), + row.getDouble("YORDINATE") + ); + } + + + protected void addSeries(Series series, String parameter, int idx) { + log.debug("add series (" + parameter + ")to timeseries chart"); + + if (series == null) { + log.warn("no data to add"); + return; + } + + TimeSeriesCollection tsc = null; + + if (datasets.containsKey(parameter)) + tsc = (TimeSeriesCollection) datasets.get(parameter); + else + tsc = new TimeSeriesCollection(); + + tsc.addSeries((TimeSeries) series); + datasets.put(parameter, tsc); + } + + + protected void addDatasets() { + Iterator iter = parameters.iterator(); + XYPlot plot = chart.getXYPlot(); + int idx = 0; + + TimeSeriesCollection tsc = null; + KeyValueDescibeData data = null; + String key = null; + while (iter.hasNext()) { + data = (KeyValueDescibeData) iter.next(); + key = data.getValue(); + + if (datasets.containsKey(key)) { + tsc = (TimeSeriesCollection)datasets.get(key); + plot.setDataset(idx, tsc ); + log.debug("Added " + key + " parameter to plot."); + prepareAxis(key, idx); + adjustRenderer( + idx++, + tsc.getSeriesCount(), + linesVisible, + shapesVisible + ); + } + } + } + + + protected void localizeDomainAxis(Axis axis, Locale locale) { + if (locale == null) + return; + + log.debug( + "Set language of axis [" + axis.getLabel() + "] " + + "to " + locale.toString() + ); + + String dateFormat = getMessage(locale, DATE_FORMAT,DEFAULT_DATE_FORMAT); + DateFormat format = new SimpleDateFormat(dateFormat, locale); + ((DateAxis) axis).setDateFormatOverride(format); + } + + + protected String getMessage(Locale locale, String key, String def) { + return RessourceFactory.getInstance().getRessource(locale, key, def); + } + + + protected String createSeriesName( + String breakPoint1, + String breakPoint2, + String breakPoint3 + ) { + log.debug("create seriesname of timeseries chart"); + return findValueTitle(parameters, breakPoint1) + + " " + + findValueTitle(measurements, breakPoint2) + + "m"; + } + + + protected void addGaps( + Result[] results, + Series series, + Date startDate, + Date endDate, + int startPos, + int endPos + ) { + int gapID = results[startPos].getInteger("GAPID"); + long maxDiff = calculateGapSize( + startDate, endDate, startPos, endPos, gapID + ); + + Date last = startDate; + for (int i = startPos+1; i < endPos; i++) { + Result res = results[i]; + Date now = res.getDate("XORDINATE"); + + if ((now.getTime() - last.getTime()) > maxDiff) { + // add gap, add 1 minute to last date and add null value + log.info( + "Gap between " + + last.toString() + " and " + now.toString() + ); + last.setTime(last.getTime() + 60000); + ((TimeSeries) series).addOrUpdate(new Minute(last), null); + } + + last = now; + } + } + + + protected long calculateGapSize( + Date start, + Date end, + int startPos, + int endPos, + int gapID + ){ + long maxGap = (end.getTime() - start.getTime()) / 20; + long interval = getTimeGapValue(start, end, startPos, endPos, gapID); + + if (maxGap < interval) + maxGap = interval + 10; + + return maxGap; + } + + + protected long getTimeGapValue( + Date dStart, + Date dEnd, + int pStart, + int pEnd, + int gapID + ){ + long gap = 0; + + if (gapID < 0 || gapID >= 99) { + + if (gapID == -1) { + // no gaps in meshes + gap = NO_TIME_GAP; + } + else if (pEnd-pStart < 60) { + gap = (3/(pEnd-pStart)) * (dEnd.getTime() - dStart.getTime()); + } + } + else{ + Iterator it = timeGaps.iterator(); + + while (it.hasNext()) { + TimeGap tempTimeGap = (TimeGap) it.next(); + + if (tempTimeGap.getKey() == gapID){ + String unit = tempTimeGap.getUnit(); + int gapValue = tempTimeGap.getValue(); + + if (unit.equals(TimeGap.TIME_UNIT_MINUTE)) { + gap = gapValue * TimeGap.MINUTE_IN_MILLIS; + } + else if (unit.equals(TimeGap.TIME_UNIT_HOUR)) { + gap = gapValue * TimeGap.HOUR_IN_MILLIS; + } + else if (unit.equals(TimeGap.TIME_UNIT_DAY)) { + gap = gapValue * TimeGap.DAY_IN_MILLIS; + } + else if (unit.equals(TimeGap.TIME_UNIT_WEEK)) { + gap = gapValue * TimeGap.WEEK_IN_MILLIS; + } + else if (unit.equals(TimeGap.TIME_UNIT_MONTH)) { + gap = gapValue * (TimeGap.DAY_IN_MILLIS *30); + } + else if (unit.equals(TimeGap.TIME_UNIT_YEAR)) { + gap = gapValue * (TimeGap.DAY_IN_MILLIS *365); + } + break; + } + } + } + + return gap; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/VerticalProfileChart.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,329 @@ +package de.intevation.gnv.chart; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Locale; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; +import org.jfree.chart.axis.Axis; +import org.jfree.chart.plot.XYPlot; +import org.jfree.chart.plot.PlotOrientation; +import org.jfree.data.xy.XYSeries; +import org.jfree.data.general.Series; +import org.jfree.data.xy.XYSeriesCollection; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.describedata.KeyValueDescibeData; + + +/** + * @author Ingo Weinzierl + */ +public class VerticalProfileChart +extends AbstractXYLineChart +{ + private static Logger log = Logger.getLogger(VerticalProfileChart.class); + + protected final double PERCENTAGE = 5.0; + protected final double GAP_MAX_LEVEL = Math.sqrt(2.0); + protected final int GAP_MAX_VALUES = 60; + + + public VerticalProfileChart( + ChartLabels labels, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Collection result, + Collection timeGaps, + Locale locale, + boolean linesVisible, + boolean shapesVisible + ) { + this.labels = labels; + this.theme = theme; + this.parameters = parameters; + this.measurements = measurements; + this.dates = dates; + this.resultSet = result; + this.timeGaps = timeGaps; + this.locale = locale; + this.PLOT_ORIENTATION = PlotOrientation.HORIZONTAL; + this.linesVisible = linesVisible; + this.shapesVisible = shapesVisible; + this.datasets = new HashMap(); + this.ranges = new HashMap(); + } + + + protected void initData() { + log.debug("init data for VerticalProfileChart"); + + String breakPoint1 = null; + String breakPoint2 = null; + String breakPoint3 = null; + + Iterator iter = resultSet.iterator(); + Result row = null; + String seriesName = null; + String parameter = null; + XYSeries series = null; + + int idx = 0; + int startPos = 0; + int endPos = 0; + double startValue = 0; + double endValue = 0; + + Result[] results = + (Result[]) resultSet.toArray(new Result[resultSet.size()]); + + while (iter.hasNext()) { + row = (Result) iter.next(); + + // add current data to plot and prepare for next one + if (!row.getString("GROUP1").equals(breakPoint1) || + !row.getString("GROUP2").equals(breakPoint2) || + !row.getString("GROUP3").equals(breakPoint3) + ) { + log.debug("prepare data/plot for next dataset"); + + if(series != null) { + gapDetection(results, series, startPos, endPos); + addSeries(series, parameter, idx); + + startPos = endPos +1; + } + + // prepare variables for next plot + breakPoint1 = row.getString("GROUP1"); + breakPoint2 = row.getString("GROUP2"); + breakPoint3 = row.getString("GROUP3"); + + seriesName = createSeriesName( + breakPoint1, + breakPoint2, + breakPoint3 + ); + parameter = findParameter(seriesName); + + log.debug("next dataset is '" + seriesName + "'"); + series = new XYSeries(seriesName); + } + + addValue(row, series); + storeMaxRange(row.getDouble("YORDINATE"), parameter); + endPos++; + } + + if (results.length == 0) + return; + + gapDetection(results, series, startPos, endPos); + addSeries(series, parameter, idx); + + addDatasets(); + } + + + protected void gapDetection( + Result[] results, + Series series, + int startPos, + int endPos + ) { + double startValue = results[startPos].getDouble("XORDINATE"); + double endValue = results[endPos-1].getDouble("XORDINATE"); + if (results[0].getInteger("DATAID") == 2) + addGapsOnGrid(results, series, startPos, endPos); + else + addGaps(results, series, startValue, endValue, startPos, endPos); + } + + + protected void addValue(Result row, Series series) { + ((XYSeries) series).add( + row.getDouble("XORDINATE"), + row.getDouble("YORDINATE") + ); + } + + + protected void addSeries(Series series, String parameter, int idx) { + log.debug("add series (" + parameter + ")to chart"); + + if (series == null) { + log.warn("no data to add"); + return; + } + + XYSeriesCollection xysc = null; + + if (datasets.containsKey(parameter)) + xysc = (XYSeriesCollection) datasets.get(parameter); + else + xysc = new XYSeriesCollection(); + + xysc.addSeries((XYSeries) series); + datasets.put(parameter, xysc); + } + + + protected void addDatasets() { + Iterator iter = parameters.iterator(); + XYPlot plot = chart.getXYPlot(); + int idx = 0; + + XYSeriesCollection xysc = null; + KeyValueDescibeData data = null; + String key = null; + while (iter.hasNext()) { + data = (KeyValueDescibeData) iter.next(); + key = data.getValue(); + + if (datasets.containsKey(key)) { + xysc = (XYSeriesCollection)datasets.get(key); + plot.setDataset(idx, xysc ); + log.debug("Added " + key + " parameter to plot."); + prepareAxis(key, idx); + adjustRenderer( + idx++, + xysc.getSeriesCount(), + linesVisible, + shapesVisible + ); + } + } + } + + + protected void localizeDomainAxis(Axis axis, Locale locale) { + // call localizeRangeAxis from superclass which formats NumberAxis + super.localizeRangeAxis(axis, locale); + } + + + protected String createSeriesName( + String breakPoint1, + String breakPoint2, + String breakPoint3 + ) { + log.debug("create seriesname of verticalprofile chart"); + return findValueTitle(parameters, breakPoint1) + + " " + + findValueTitle(measurements, breakPoint2) + + "m"; + } + + + protected void addGapsOnGrid( + Result[] results, + Series series, + int startPos, + int endPos + ) { + String axis = getDependendAxisName( + results[startPos], + results[startPos+1] + ); + double range = 0; + int last = 0; + int current = 0; + + for (int i = startPos+1; i < endPos; i++) { + last = results[i-1].getInteger(axis); + current = results[i].getInteger(axis); + + boolean detected = gridDetection(last, current); + + if (detected) { + double xOld = results[i-1].getDouble("XORDINATE"); + double xNow = results[i].getDouble("XORDINATE"); + log.debug("Gap detected on grid between "+ xOld +" and "+ xNow); + ((XYSeries) series).add(xOld+0.0001, null); + } + } + } + + + protected void addGaps( + Result[] results, + Series series, + double startValue, + double endValue, + int startPos, + int endPos + ) { + + double last = 0; + double current = 0; + int num = results.length; + + for (int i = startPos+1; i < endPos; i++) { + boolean detected = false; + + last = results[i-1].getDouble("YORDINATE"); + current = results[i].getDouble("YORDINATE"); + + // gap detection for more than GAP_MAX_VALUES values + if (num > GAP_MAX_VALUES) + detected = simpleDetection(startValue, endValue, last, current); + // gap detection for less than GAP_MAX_VALUES values + else + detected = specialDetection( + startValue, + endValue, + last, + current, + num + ); + + if (detected) { + log.info("Gap between " + last + " and " + current); + ((XYSeries) series).add((last+current)/2, null); + } + } + } + + + protected boolean simpleDetection( + double start, + double end, + double last, + double current + ) { + double delta = Math.abs(end - start); + double smallDelta = Math.abs(current - last); + + return (smallDelta > delta / 100 * PERCENTAGE); + } + + + protected boolean specialDetection( + double start, + double end, + double last, + double current, + int count + ) { + double delta = Math.abs(end - start); + double smallDelta = Math.abs(current - last); + + return (smallDelta > (3.0 / (count - 1) * delta)); + } + + + protected boolean gridDetection(double last, double current) { + return (Math.abs(current - last) > GAP_MAX_LEVEL); + } + + + protected String getDependendAxisName(Result first, Result second) { + return "KPOSITION"; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/chart/XMLChartTheme.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/XMLChartTheme.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,295 @@ +package de.intevation.gnv.chart; + +import java.awt.Font; +import java.awt.Color; +import java.awt.geom.Ellipse2D; +import java.lang.NumberFormatException; + +import org.apache.log4j.Logger; + +import org.jfree.chart.StandardChartTheme; +import org.jfree.chart.plot.XYPlot; +import org.jfree.chart.renderer.xy.XYLineAndShapeRenderer; +import org.jfree.ui.RectangleInsets; +import org.jfree.util.UnitType; + + +import org.w3c.dom.Document; + +import de.intevation.artifactdatabase.Config; + +/** + * @author Ingo Weinzierl + */ +public class XMLChartTheme +extends StandardChartTheme +{ + private static final Color DEFAULT_COLOR = Color.BLACK; + + private Logger log = Logger.getLogger(XMLChartTheme.class); + + protected boolean domainCrosshairVisible; + protected boolean rangeCrosshairVisible; + protected boolean renderLines; + protected boolean renderShapes; + + protected int pointWidth; + protected int pointHeight; + + + public XMLChartTheme(String name) { + super(name); + } + + + public void setDomainCrosshairVisible(boolean visible) { + this.domainCrosshairVisible = visible; + } + + + public boolean getDomainCrosshairVisible() { + return domainCrosshairVisible; + } + + + public boolean getRangeCrosshairVisible() { + return rangeCrosshairVisible; + } + + + public void setRangeCrosshairVisible(boolean visible) { + this.rangeCrosshairVisible = visible; + } + + + public void applyXMLConfiguration(Document document) { + log.debug("create XMLChartTheme"); + + init(document); + } + + + private void init(Document document) { + log.debug("init XMLChartTheme parameters"); + + initChartParameters(document); + initTitleParameters(document); + initSubtitleParameters(document); + initPlotParameters(document); + initAxisParameters(document); + initLegendParameters(document); + initRenderer(document); + } + + + private void initTitleParameters(Document document) { + log.debug("init title parameters."); + + int size = getInt(document, "theme/title/font/size/@value"); + String type = getString(document, "theme/title/font/type/@value"); + boolean bold = getBool(document, "theme/title/font/bold/@value"); + + setExtraLargeFont(createFont(type, size, bold)); + + String color = getString(document, "theme/title/font/color/@value"); + Color c = decodeColor(color); + if (c != null) + setTitlePaint(c); + } + + + private void initSubtitleParameters(Document document) { + log.debug("init title parameters."); + + int size = getInt(document, "theme/subtitle/font/size/@value"); + String type = getString(document, "theme/subtitle/font/type/@value"); + boolean bold = getBool(document, "theme/subtitle/font/bold/@value"); + + setLargeFont(createFont(type, size, bold)); + + String col = getString(document, "theme/subtitle/font/color/@value"); + setSubtitlePaint(Color.decode(col)); + } + + + private void initChartParameters(Document document) { + log.debug("init chart parameters."); + + String bg = getString(document, "theme/chart/background/color/@value"); + Color c = decodeColor(bg); + if (c != null) + setChartBackgroundPaint(c); + } + + + private void initPlotParameters(Document document) { + log.debug("init plot parameters."); + + String tmp = null; + tmp = getString(document, "theme/plot/background/color/@value"); + Color c = decodeColor(tmp); + if (c != null) + setPlotBackgroundPaint(c); + + tmp = getString(document, "theme/plot/outline/color/@value"); + c = decodeColor(tmp); + if (c != null) + setPlotOutlinePaint(c); + + tmp = getString(document, "theme/plot/domaingridline/color/@value"); + c = decodeColor(tmp); + if (c != null) + setDomainGridlinePaint(c); + + tmp = getString(document, "theme/plot/rangegridline/color/@value"); + c = decodeColor(tmp); + if (c != null) + setRangeGridlinePaint(c); + + boolean rangeCrosshairVisible = getBool( + document, "theme/plot/rangecrosshair/visible/@value"); + setRangeCrosshairVisible(rangeCrosshairVisible); + + boolean domainCrosshairVisible = getBool( + document, "theme/plot/domaincrosshair/visible/@value"); + setDomainCrosshairVisible(domainCrosshairVisible); + + int top = getInt(document, "theme/plot/offset/top/@value"); + int bottom = getInt(document, "theme/plot/offset/bottom/@value"); + int left = getInt(document, "theme/plot/offset/left/@value"); + int right = getInt(document, "theme/plot/offset/right/@value"); + setAxisOffset(new RectangleInsets( + UnitType.RELATIVE, + top, left, bottom, right) + ); + } + + + private void initAxisParameters(Document document) { + log.debug("init axis parameters."); + + String tmp = null; + tmp = getString(document, "theme/axis/label/color/@value"); + Color c = decodeColor(tmp); + if (c != null) + setAxisLabelPaint(c); + + tmp = getString(document, "theme/axis/ticklabel/color/@value"); + c = decodeColor(tmp); + if (c != null) + setTickLabelPaint(c); + } + + + private void initLegendParameters(Document document) { + log.debug("init legend parameters."); + + String tmp = null; + tmp = getString(document, "theme/legend/font/color/@value"); + Color c = decodeColor(tmp); + if (c != null) + setLegendItemPaint(c); + + tmp = getString(document, "theme/legend/background/color/@value"); + c = decodeColor(tmp); + if (c != null) + setLegendBackgroundPaint(c); + } + + + private void initRenderer(Document document) { + log.debug("init renderer parameters."); + + pointWidth = getInt(document, "theme/plot/itemrenderer/width/@value"); + log.debug("Read point width of " + pointWidth); + pointHeight = getInt(document, "theme/plot/itemrenderer/height/@value"); + log.debug("Read point height of " + pointHeight); + renderLines = getBool( + document, "theme/plot/itemrenderer/renderLines/@value" + ); + renderShapes = getBool( + document, "theme/plot/itemrenderer/renderPoints/@value" + ); + } + + + private static String getString(Document document, String xpath) { + return Config.getStringXPath(document, xpath); + } + + + private static int getInt(Document document, String xpath) { + String tmp = getString(document, xpath); + + if (tmp != null) + return Integer.parseInt(tmp); + else + return 0; + } + + + private static boolean getBool(Document document, String xpath) { + String tmp = getString(document, xpath); + + if (tmp != null) + return Boolean.parseBoolean(tmp); + else + return false; + } + + + protected Color decodeColor(String color) { + try { + if (color == null) + return null; + + return Color.decode(color); + } + catch (NumberFormatException nfe) { + log.warn("Error while parsing color: " + color, nfe); + } + + return null; + } + + + protected Font createFont(String type, int size, boolean bold) { + Font font = null; + if (bold) + font = new Font(type, Font.BOLD, size); + else + font = new Font(type, Font.PLAIN, size); + + return font; + } + + + protected void applyToXYPlot(XYPlot plot) { + log.debug("apply theme parameter to XYPlot"); + + super.applyToXYPlot(plot); + plot.setDomainCrosshairVisible(this.domainCrosshairVisible); + plot.setRangeCrosshairVisible(this.rangeCrosshairVisible); + + applyToXYLineAndShapeRenderer(plot); + } + + + protected void applyToXYLineAndShapeRenderer(XYPlot plot) { + if (plot == null) + return; + + XYLineAndShapeRenderer renderer = + (XYLineAndShapeRenderer) plot.getRenderer(); + + Ellipse2D.Double point = new Ellipse2D.Double( + -(pointWidth/2), -(pointHeight/2), pointWidth, pointHeight + ); + + renderer.setSeriesShape(0, point); + renderer.setSeriesShapesVisible(0, renderShapes); + renderer.setSeriesLinesVisible(0, renderLines); + + plot.setRenderer(renderer); + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/chart/exception/TechnicalChartException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/chart/exception/TechnicalChartException.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,51 @@ +/** + * + */ +package de.intevation.gnv.chart.exception; + +/** + * @author Tim Englich + * + */ +public class TechnicalChartException extends Exception { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = -5325863742368006109L; + + /** + * Constructor + */ + public TechnicalChartException() { + } + + /** + * Constructor + * + * @param message + */ + public TechnicalChartException(String message) { + super(message); + } + + /** + * Constructor + * + * @param cause + */ + public TechnicalChartException(Throwable cause) { + super(cause); + } + + /** + * Constructor + * + * @param message + * @param cause + */ + public TechnicalChartException(String message, Throwable cause) { + super(message, cause); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/exports/ChartExportHelper.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/ChartExportHelper.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,153 @@ +package de.intevation.gnv.exports; + +import com.lowagie.text.Document; +import com.lowagie.text.DocumentException; +import com.lowagie.text.PageSize; +import com.lowagie.text.Rectangle; +import com.lowagie.text.pdf.PdfContentByte; +import com.lowagie.text.pdf.PdfTemplate; +import com.lowagie.text.pdf.PdfWriter; + +import java.awt.Transparency; +import java.awt.Graphics2D; +import java.awt.geom.Rectangle2D; +import java.awt.geom.Rectangle2D.Double; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import javax.imageio.ImageIO; + +import org.apache.batik.svggen.SVGGraphics2D; +import org.apache.batik.svggen.SVGGraphics2DIOException; +import org.apache.log4j.Logger; + +import org.jfree.chart.JFreeChart; + +import de.intevation.artifactdatabase.XMLUtils; + + +/** + * @author Ingo Weinzierl + */ +public class ChartExportHelper { + + private static final String DEFAULT_PAGE_SIZE = "A4"; + private static final String DEFAULT_ENCODING = "UTF-8"; + + private static Logger log = Logger.getLogger(ChartExportHelper.class); + + public static void exportImage( + OutputStream out, + JFreeChart chart, + String format, + int width, + int height + ) + throws IOException + { + log.info("export chart as png"); + + ImageIO.write( + chart.createBufferedImage( + width, height, Transparency.BITMASK, null + ), + format, + out + ); + } + + + public static void exportSVG( + OutputStream out, + JFreeChart chart, + String encoding, + int width, + int height + ) { + log.info("export chart as svg"); + + if (encoding == null) + encoding = DEFAULT_ENCODING; + + org.w3c.dom.Document document = XMLUtils.newDocument(); + SVGGraphics2D graphics = new SVGGraphics2D(document); + + chart.draw(graphics, new Rectangle2D.Double(0.0D, 0.0D,width,height)); + + try { + graphics.stream(new OutputStreamWriter(out, encoding)); + } + catch (SVGGraphics2DIOException svge) { + log.error("Error while writing svg export to output stream.", svge); + } + catch (UnsupportedEncodingException uee) { + log.error("Unsupported encoding: " + encoding, uee); + } + } + + + public static void exportPDF( + OutputStream out, + JFreeChart chart, + String pageFormat, + boolean landscape, + float marginLeft, + float marginRight, + float marginTop, + float marginBottom + ) { + log.info("export chart as pdf."); + + if (pageFormat == null) + 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)); + + Document document = null; + if (landscape) { + document = new Document(page.rotate()); + log.debug("Create landscape pdf."); + } + else + document = new Document(page); + + try { + PdfWriter writer = PdfWriter.getInstance(document, out); + + document.addSubject(chart.getTitle().getText()); + document.addCreationDate(); + document.open(); + + 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); + + chart.draw(graphics, area); + graphics.dispose(); + content.addTemplate(template, marginLeft, marginBottom); + } + catch (DocumentException de) { + log.error("Error while exporting chart to pdf.", de); + } + finally { + document.close(); + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultDataCollector.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultDataCollector.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,48 @@ +package de.intevation.gnv.exports; + +import java.util.List; +import java.util.ArrayList; + +import org.apache.log4j.Logger; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.geobackend.base.ResultDescriptor; +import de.intevation.gnv.state.exception.StateException; + + +/** + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +public class DefaultDataCollector +implements Export.DataCollector +{ + private Logger log = Logger.getLogger(DefaultDataCollector.class); + + protected ResultDescriptor rd; + protected String [] names; + + + public DefaultDataCollector(String[] names) { + this.names = names; + } + + public void init(Result res) { + rd = res.getResultDescriptor(); + } + + public String[] getData(Result result) + throws StateException { + + if (rd == null) + init(result); + + List entries = new ArrayList(); + + int[] indices = rd.getColumnIndices(names); + for (int i = 0; i < names.length; ++i) { + entries.add(result.getString(indices[i])); + } + + return (String[]) entries.toArray((new String[entries.size()])); + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultExport.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultExport.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,83 @@ +package de.intevation.gnv.exports; + +import org.apache.log4j.Logger; + +import au.com.bytecode.opencsv.CSVWriter; + +import java.util.Iterator; +import java.util.Collection; + +import java.io.UnsupportedEncodingException; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.OutputStream; + +import de.intevation.gnv.geobackend.base.Result; + +import de.intevation.gnv.state.exception.StateException; + +/** + * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +public class DefaultExport +implements Export +{ + private static Logger log = Logger.getLogger(DefaultExport.class); + + private Export.DataCollector collector; + + public DefaultExport(Export.DataCollector collector) { + this.collector = collector; + } + + protected void writeData( + Profile profile, + Collection result, + CSVWriter writer + ) + throws StateException { + log.debug("create content for export."); + Iterator it = result.iterator(); + + String[] header = profile.getHeader(); + if (header != null) + writer.writeNext(header); + + while (it.hasNext()) { + Result res = it.next(); + + writer.writeNext(collector.getData(res)); + } + } + + public void create( + Profile profile, + OutputStream outputStream, + Collection result + ) + throws + IOException, + UnsupportedEncodingException, + StateException + { + if (result == null) { + String msg = "No data given for generation of " + + profile.getType() + " file."; + log.error(msg); + throw new StateException(msg); + } + + CSVWriter writer = new CSVWriter( + new OutputStreamWriter( + outputStream, + profile.getEncoding()), + profile.getSeparator(), + profile.getQuoteCharacter(), + profile.getEscapeCharacter()); + + writeData(profile, result, writer); + + writer.close(); + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultProfile.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/DefaultProfile.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,66 @@ +package de.intevation.gnv.exports; + + +/** + * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +public class DefaultProfile +implements Export.Profile +{ + protected Export.DataCollector collector; + protected String [] header; + protected String [] names; + protected char separator; + protected char escapeCharacter; + protected char quoteCharacter; + protected String type; + protected String encoding; + + public DefaultProfile() { + } + + public DefaultProfile( + String [] header, + char separator, + char escapeCharacter, + char quoteCharacter, + String type, + String encoding + ) { + this.header = header; + this.separator = separator; + this.escapeCharacter = escapeCharacter; + this.quoteCharacter = quoteCharacter; + this.type = type; + this.encoding = encoding; + } + + public String toString(int index, String value) { + return value; + } + + public char getSeparator() { + return separator; + } + + public char getEscapeCharacter() { + return escapeCharacter; + } + + public char getQuoteCharacter() { + return quoteCharacter; + } + + public String getType() { + return type; + } + + public String getEncoding() { + return encoding; + } + + public String[] getHeader() { + return header; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/exports/Export.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/Export.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,40 @@ +package de.intevation.gnv.exports; + +import java.util.Collection; + +import java.io.OutputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.exception.StateException; + +/** + * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +public interface Export { + + public interface Profile { + String toString(int column, String value); + char getSeparator(); + char getEscapeCharacter(); + char getQuoteCharacter(); + String getType(); + String getEncoding(); + String [] getHeader(); + } + + public interface DataCollector { + String[] getData(Result result) + throws StateException; + } + + public void create( + Profile profile, + OutputStream outputStream, + Collection result + ) + throws IOException, UnsupportedEncodingException, StateException; + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/exports/ShapeDataCollector.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/ShapeDataCollector.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,57 @@ +package de.intevation.gnv.exports; + +import org.apache.log4j.Logger; + +import com.vividsolutions.jts.io.WKTReader; +import com.vividsolutions.jts.io.ParseException; +import com.vividsolutions.jts.geom.Point; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.exception.StateException; + + +/** + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +public class ShapeDataCollector +extends DefaultDataCollector +{ + private Logger log = Logger.getLogger(ShapeDataCollector.class); + + protected WKTReader wktReader = new WKTReader(); + + public ShapeDataCollector(String[] names) { + super(names); + } + + public String[] getData(Result result) + throws StateException { + + if (rd == null) + init(result); + + try { + String [] entries = new String[names.length+1]; + int j = 0; + for (int i = 0; i < names.length; i++) { + + if (names[i].equals("SHAPE")) { + Point p = (Point)wktReader.read(result.getString("SHAPE")); + + entries[j++] = ""+p.getX(); + entries[j++] = ""+p.getY(); + } + else { + entries[j++] = result.getString(names[i]); + } + } + + return entries; + } + catch (ParseException pe) { + log.error(pe, pe); + throw new StateException( + "Error occured while parsing a Point from WKT."); + } + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/exports/SimpleOdvDataCollector.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/exports/SimpleOdvDataCollector.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,74 @@ +package de.intevation.gnv.exports; + +import java.util.Date; +import java.text.DateFormat; +import java.text.SimpleDateFormat; + +import org.apache.log4j.Logger; + +import com.vividsolutions.jts.io.ParseException; +import com.vividsolutions.jts.geom.Point; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.exception.StateException; + +/** + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +public class SimpleOdvDataCollector +extends ShapeDataCollector +{ + private static Logger log = Logger.getLogger(SimpleOdvDataCollector.class); + + public static final String SRC_FORMAT = "yyyy.MM.dd HH:mm:ss"; + public static final String DEST_FORMAT = "yyyy-MM-dd HH:mm"; + + public static DateFormat srcFormat = new SimpleDateFormat(SRC_FORMAT); + public static DateFormat destFormat = new SimpleDateFormat(DEST_FORMAT); + + public SimpleOdvDataCollector(String[] names) { + super(names); + } + + public String[] getData(Result result) + throws StateException + { + if (rd == null) + init(result); + + try { + String [] entries = new String[names.length+1]; + int j = 0; + for (int i = 0; i < names.length; i++) { + + if (names[i].equals("SHAPE")) { + Point p = (Point)wktReader.read(result.getString("SHAPE")); + + entries[j++] = ""+p.getX(); + entries[j++] = ""+p.getY(); + } + // Change the datetime format from yyyy.MM.dd HH:mm:ss to + // yyyy-MM-dd HH:mm + else if (names[i].equals("TIMEVALUE")) { + Date source = srcFormat.parse(result.getString(names[i])); + entries[j++] = destFormat.format(source); + } + else { + entries[j++] = result.getString(names[i]); + } + } + + return entries; + } + catch (ParseException pe) { + log.error(pe, pe); + throw new StateException( + "Error occured while parsing source data."); + } + catch (java.text.ParseException pe) { + log.error(pe, pe); + throw new StateException( + "Error occured while parsing source data."); + } + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation2D.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolation2D.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,214 @@ +package de.intevation.gnv.math; + +import java.util.ArrayList; +import java.util.List; +import java.util.HashMap; +import java.util.Collections; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.Envelope; + +import com.vividsolutions.jts.index.quadtree.Quadtree; + +import org.apache.log4j.Logger; + +/** + * @author Sascha L. Teichmann + */ +public final class Interpolation2D +{ + private static Logger log = Logger.getLogger(Interpolation2D.class); + + public interface Consumer { + void interpolated(Coordinate point); + } // interface Consumer + + private Interpolation2D() { + } + + public static void interpolate( + List path, + List points, + double from, + double to, + int steps, + Metrics metrics, + Consumer consumer + ) { + int N = path.size(); + int M = points.size(); + + log.debug("Size of path: " + N); + log.debug("Size of points: " + M); + + if (M < 1 || N < 2) { // nothing to do + return; + } + + HashMap> map = new HashMap>(); + + for (int k = M-1; k >= 0; --k) { + Point2d p = points.get(k); + + ArrayList list = map.get(p.j); + + if (list == null) { + map.put(p.j, list = new ArrayList()); + } + list.add(p); + } + + double dxMax = -Double.MAX_VALUE; + + for (ArrayList v: map.values()) { + Collections.sort(v, Point2d.X_COMPARATOR); + for (int i = 1, L = v.size(); i < L; ++i) { + double dx = Math.abs(v.get(i).x - v.get(i-1).x); + if (dx > dxMax) { + dxMax = dx; + } + } + } + + dxMax = dxMax + 1e-5d; + + map.clear(); + + for (int k = M-1; k >= 0; --k) { + Point2d p = points.get(k); + + ArrayList list = map.get(p.i); + + if (list == null) { + map.put(p.i, list = new ArrayList()); + } + list.add(p); + } + + double dyMax = -Double.MAX_VALUE; + + for (ArrayList v: map.values()) { + Collections.sort(v, Point2d.Y_COMPARATOR); + for (int i = 1, L = v.size(); i < L; ++i) { + double dy = Math.abs(v.get(i).y - v.get(i-1).y); + if (dy > dyMax) { + dyMax = dy; + } + } + } + + dyMax = dyMax + 1e-5d; + + map = null; + + log.debug("buffer size: " + dxMax + " / " + dyMax); + + // put into spatial index to speed up finding neighbors. + Quadtree spatialIndex = new Quadtree(); + + for (int i = 0; i < M; ++i) { + Point2d p = points.get(i); + spatialIndex.insert(p.envelope(), p); + } + + LinearToMap linearToMap = new LinearToMap( + path, from, to, metrics); + + double dP = (to - from)/steps; + + Coordinate center = new Coordinate(); + + Envelope queryBuffer = new Envelope(); + + Point2d [] neighbors = new Point2d[4]; + + int missedInterpolations = 0; + int interpolations = 0; + + for (double p = from; p <= to; p += dP) { + if (!linearToMap.locate(p, center)) { + continue; + } + queryBuffer.init( + center.x - dxMax, center.x + dxMax, + center.y - dyMax, center.y + dyMax); + + List potential = spatialIndex.query(queryBuffer); + + L1Comparator invL1 = new L1Comparator(center); + Collections.sort(potential, invL1); + + neighbors[0] = neighbors[1] = + neighbors[2] = neighbors[3] = null; + + /* bit code of neighbors + 0---1 + | x | + 2---3 + */ + + int mask = 0; + // reversed order is essential here! + for (int i = potential.size()-1; i >= 0; --i) { + Point2d n = (Point2d)potential.get(i); + int code = n.x > center.x ? 1 : 0; + if (n.y > center.y) code |= 2; + neighbors[code] = n; + mask |= 1 << code; + } + + int numNeighbors = Integer.bitCount(mask); + + // only interpolate if we have all four neighbors + // and we do not have any gaps. + if (numNeighbors == 4 + && !neighbors[0].hasIGap(neighbors[1]) + && !neighbors[1].hasJGap(neighbors[3]) + && !neighbors[3].hasIGap(neighbors[2]) + && !neighbors[2].hasJGap(neighbors[0]) + ) { + double z1 = interpolate( + neighbors[0].x, neighbors[0].z, + neighbors[1].x, neighbors[1].z, + center.x); + double z2 = interpolate( + neighbors[2].x, neighbors[2].z, + neighbors[3].x, neighbors[3].z, + center.x); + double y1 = interpolate( + neighbors[0].x, neighbors[0].y, + neighbors[1].x, neighbors[1].y, + center.x); + double y2 = interpolate( + neighbors[2].x, neighbors[2].y, + neighbors[3].x, neighbors[3].y, + center.x); + center.z = interpolate( + y1, z1, + y2, z2, + center.y); + consumer.interpolated(center); + ++interpolations; + } + else { + ++missedInterpolations; + } + } + + log.debug("interpolations: " + interpolations + " / " + missedInterpolations); + } + + public static final double interpolate( + double x1, double y1, + double x2, double y2, + double x + ) { + if (x2 == x1) { + return (y1 + y2)*0.5d; + } + double m = (y2-y1)/(x2-x1); + double b = y1 - m*x1; + return m*x + b; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolator.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/Interpolator.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,12 @@ +package de.intevation.gnv.math; + +import com.vividsolutions.jts.geom.Coordinate; + +/** + * @author Sascha L. Teichmann + */ +public interface Interpolator +{ + void interpolate(double t, Coordinate v); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/math/L1Comparator.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/L1Comparator.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,30 @@ +package de.intevation.gnv.math; + +import java.util.Comparator; + +import com.vividsolutions.jts.geom.Coordinate; + +/** + * @author Sascha L. Teichmann + */ +public class L1Comparator +implements Comparator +{ + private Coordinate ref; + + public L1Comparator(Coordinate ref) { + this.ref = ref; + } + + public int compare(Object a, Object b) { + Coordinate pa = (Coordinate)a; + Coordinate pb = (Coordinate)b; + double da = Point2d.L1(ref, pa); + double db = Point2d.L1(ref, pb); + if (da < db) return -1; + if (da > db) return +1; + return 0; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearFunction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearFunction.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,30 @@ +package de.intevation.gnv.math; + +import org.apache.commons.math.optimization.fitting.ParametricRealFunction; + +import org.apache.commons.math.FunctionEvaluationException; + +/** + * @author Sascha L. Teichmann + */ +public class LinearFunction +implements ParametricRealFunction +{ + public static final LinearFunction INSTANCE = new LinearFunction(); + + public LinearFunction() { + } + + public double value(double x, double [] parameters) + throws FunctionEvaluationException + { + return x*parameters[0] + parameters[1]; + } + + public double [] gradient(double x, double [] parameters) + throws FunctionEvaluationException + { + return new double [] { x, 1f }; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearMetrics.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearMetrics.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,59 @@ +package de.intevation.gnv.math; + +import com.vividsolutions.jts.geom.Coordinate; + +/** + * @author Sascha L. Teichmann + */ +public final class LinearMetrics +implements Metrics +{ + public static final Metrics INSTANCE = + new LinearMetrics(); + + public static final class LinearInterpolator + implements Interpolator + { + private double mx; + private double bx; + private double my; + private double by; + + public LinearInterpolator(Coordinate p1, Coordinate p2) { + + /* + I) p1.x = 0*m + bx + II) p2.x = 1*m + bx + + bx = p1.x + + p2.x = m + p1.x + + mx = p2.x - p1.x + */ + + bx = p1.x; + mx = p2.x - bx; + + by = p1.y; + my = p2.y - by; + } + + public void interpolate(double t, Coordinate v) { + v.x = t*mx + bx; + v.y = t*my + by; + } + } // class LinearInterpolator + + private LinearMetrics() { + } + + public double distance(Coordinate p1, Coordinate p2) { + return p1.distance(p2); + } + + public Interpolator getInterpolator(Coordinate p1, Coordinate p2) { + return new LinearInterpolator(p1, p2); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearToMap.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/LinearToMap.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,184 @@ +package de.intevation.gnv.math; + +import com.vividsolutions.jts.geom.Coordinate; + +import java.util.List; +import java.util.Iterator; +import java.util.NoSuchElementException; + +/** + * @author Sascha L. Teichmann + */ +public class LinearToMap +{ + public static final class Range { + private Range next; + + private double from; + private double to; + private double b; + + private Coordinate p1; + private Coordinate p2; + + private Interpolator interpolator; + + public Range() { + } + + public Range( + double from, + double to, + Interpolator interpolator, + Coordinate p1, + Coordinate p2 + ) { + this.from = from; + this.to = to; + this.interpolator = interpolator; + this.p1 = p1; + this.p2 = p2; + + b = from == to + ? 0d + : 1.0d/(to - from); + } + + public void eval(double x, Coordinate v) { + interpolator.interpolate((x - from)*b, v); + } + + public boolean inside(double x) { + return x >= from && x <= to; + } + + public Coordinate startPoint() { + return p1; + } + + public Coordinate endPoint() { + return p2; + } + } // class Range + + protected Range head; + protected Range last; + + public LinearToMap() { + } + + public LinearToMap( + List path, + double from, + double to, + Metrics metrics + ) { + double diagramLength = Math.abs(to - from); + + double worldLength = length(path, metrics); + + double rangeStart = from; + + Range last = null; + + for (int i = 1, N = path.size(); i < N; ++i) { + Coordinate p1 = path.get(i-1); + Coordinate p2 = path.get(i); + double segmentLength = metrics.distance(p1, p2); + + double relativeLength = segmentLength / worldLength; + + double rangeLength = diagramLength * relativeLength; + + double rangeEnd = rangeStart + rangeLength; + + Range range = new Range( + rangeStart, rangeEnd, + metrics.getInterpolator(p1, p2), + p1, p2); + + if (last == null) { + last = head = range; + } + else { + last.next = range; + last = range; + } + rangeStart = rangeEnd; + } + } + + protected Range locateRange(double diagramX) { + + if (last != null && last.inside(diagramX)) { + return last; + } + + Range current = head; + while (current != null) { + if (current.inside(diagramX)) { + return last = current; + } + current = current.next; + } + + return null; + } + + public boolean locate(double diagramX, Coordinate v) { + Range range = locateRange(diagramX); + if (range == null) { + return false; + } + range.eval(diagramX, v); + return true; + } + + public static double length( + List path, + Metrics metrics + ) { + double sum = 0d; + for (int i = path.size()-1; i >= 1; --i) { + Coordinate p1 = path.get(i); + Coordinate p2 = path.get(i-1); + sum += metrics.distance(p1, p2); + } + return sum; + } + + public int numRanges() { + int count = 0; + Range current = head; + while (current != null) { + ++count; + current = current.next; + } + return count; + } + + public Iterator ranges() { + return new Iterator() { + + Range current = head; + + public boolean hasNext() { + return current != null; + } + + public Object next() { + if (!hasNext()) { + throw new NoSuchElementException(); + } + Range x = current; + current = current.next; + return x; + } + + public void remove() { + throw new UnsupportedOperationException(); + } + }; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/math/Metrics.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/Metrics.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,14 @@ +package de.intevation.gnv.math; + +import com.vividsolutions.jts.geom.Coordinate; + +/** + * @author Sascha L. Teichmann + */ +public interface Metrics +{ + double distance(Coordinate p1, Coordinate p2); + + Interpolator getInterpolator(Coordinate p1, Coordinate p2); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/math/Point2d.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/math/Point2d.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,95 @@ +package de.intevation.gnv.math; + +import java.util.Comparator; + +import com.vividsolutions.jts.geom.Envelope; +import com.vividsolutions.jts.geom.Coordinate; + +/** + * @author Sascha L. Teichmann + */ +public class Point2d +extends Coordinate +{ + public static final double EPSILON = 1e-3d; + + public static final Comparator X_COMPARATOR = new Comparator() { + public int compare(Object a, Object b) { + double xa = ((Coordinate)a).x; + double xb = ((Coordinate)b).x; + if (xa < xb) return -1; + if (xa > xb) return +1; + return 0; + } + }; + + public static final Comparator Y_COMPARATOR = new Comparator() { + public int compare(Object a, Object b) { + double ya = ((Coordinate)a).y; + double yb = ((Coordinate)b).y; + if (ya < yb) return -1; + if (ya > yb) return +1; + return 0; + } + }; + + public static class InverseL1Comparator + implements Comparator + { + private Point2d ref; + + public InverseL1Comparator(Point2d ref) { + this.ref = ref; + } + + public int compare(Object a, Object b) { + Point2d pa = (Point2d)a; + Point2d pb = (Point2d)b; + double da = ref.L1(pa); + double db = ref.L1(pb); + if (da < db) return -1; + if (da > db) return +1; + return 0; + } + } // class InverseL1Comparator + + public int i; + public int j; + + public Point2d() { + } + + public Point2d(double x, double y, double z, int i, int j) { + super(x, y, z); + this.i = i; + this.j = j; + } + + + public double L1(Point2d other) { + return L1(this, other); + } + + public static double L1(Coordinate a, Coordinate b) { + return Math.abs(a.x - b.x) + Math.abs(a.y - b.y); + } + + public Envelope envelope() { + return envelope(EPSILON); + } + + public Envelope envelope(double epsilon) { + return new Envelope( + x-epsilon, x+epsilon, + y-epsilon, y+epsilon); + } + + public boolean hasIGap(Point2d other) { + return Math.abs(i - other.i) > 1; + } + + public boolean hasJGap(Point2d other) { + return Math.abs(j - other.j) > 1; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileArtifact.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,58 @@ +/** + * + */ +package de.intevation.gnv.profile.horizontal; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; +import de.intevation.gnv.artifacts.GNVArtifactBase; + +/** + * @author Tim Englich + * + */ +public class HorizontalProfileArtifact extends GNVArtifactBase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(HorizontalProfileArtifact.class); + /** + * + */ + private static final long serialVersionUID = -721831166719594662L; + + /** + * Constructor + */ + public HorizontalProfileArtifact() { + super(); + log.debug("HorizontalProfileArtifact.Constructor"); + this.name = "horizontalProfile"; + } + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#describe(org.w3c.dom.Document, de.intevation.artifacts.CallContext) + */ + @Override + public Document describe(Document data, CallContext context) { + log.debug("HorizontalProfileArtifact.describe"); + return super.createDescibeOutput(context.getMeta(), + super.identifier, + this.getIncludeUIFromDocument(data)); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactBase#setup(java.lang.String, + * de.intevation.artifacts.ArtifactFactory, java.lang.Object) + */ + @Override + public void setup(String identifier, ArtifactFactory factory, Object context) { + log.debug("HorizontalProfileArtifact.setup"); + super.setup(identifier, factory, context); + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileInstantaneousPointArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileInstantaneousPointArtifact.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,33 @@ +/** + * + */ +package de.intevation.gnv.profile.horizontal; + +import org.apache.log4j.Logger; + +/** + * @author Tim Englich + * + */ +public class HorizontalProfileInstantaneousPointArtifact extends + HorizontalProfileArtifact { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(HorizontalProfileInstantaneousPointArtifact.class); + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = -6700816287500004553L; + + /** + * Constructor + */ + public HorizontalProfileInstantaneousPointArtifact() { + super(); + log.debug("HorizontalProfileInstantaneousPointArtifact.Constructor"); + super.name = super.name + "InstantaneousPoint"; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshArtifact.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,32 @@ +/** + * + */ +package de.intevation.gnv.profile.horizontal; + +import org.apache.log4j.Logger; + +/** + * @author Tim Englich + * + */ +public class HorizontalProfileMeshArtifact extends HorizontalProfileArtifact { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(HorizontalProfileMeshArtifact.class); + + /** + * The UID of this class + */ + private static final long serialVersionUID = -8291547966693867205L; + + /** + * Constructor + */ + public HorizontalProfileMeshArtifact() { + super(); + log.debug("VerticalProfileMeshArtifact.Constructor"); + super.name = super.name + "Mesh"; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshCrossArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontal/HorizontalProfileMeshCrossArtifact.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,34 @@ +/** + * + */ +package de.intevation.gnv.profile.horizontal; + +import org.apache.log4j.Logger; + +/** + * @author Tim Englich + * + */ +public class HorizontalProfileMeshCrossArtifact extends + HorizontalProfileMeshArtifact { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = 3955589051619129854L; + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(HorizontalProfileMeshCrossArtifact.class); + + /** + * Constructor + */ + public HorizontalProfileMeshCrossArtifact() { + super(); + log.debug("HorizontalProfileMeshCrossArtifact.Constructor"); + super.name = super.name + "Cross"; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontalcrosssection/HorizontalCrossSectionMeshArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/horizontalcrosssection/HorizontalCrossSectionMeshArtifact.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,58 @@ +/** + * + */ +package de.intevation.gnv.profile.horizontalcrosssection; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; +import de.intevation.gnv.artifacts.GNVArtifactBase; + +/** + * @author Tim Englich + * + */ +public class HorizontalCrossSectionMeshArtifact extends GNVArtifactBase { + /** + * + */ + private static final long serialVersionUID = -2687278172203755640L; + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(HorizontalCrossSectionMeshArtifact.class); + + + /** + * Constructor + */ + public HorizontalCrossSectionMeshArtifact() { + super(); + log.debug("HorizontalCrossSectionMeshArtifact.Constructor"); + this.name = "horizontalCrossSectionMesh"; + } + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#describe(org.w3c.dom.Document, de.intevation.artifacts.CallContext) + */ + @Override + public Document describe(Document data, CallContext context) { + log.debug("HorizontalCrossSectionMeshArtifact.describe"); + return super.createDescibeOutput(context.getMeta(), + super.identifier, + this.getIncludeUIFromDocument(data)); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactBase#setup(java.lang.String, + * de.intevation.artifacts.ArtifactFactory, java.lang.Object) + */ + @Override + public void setup(String identifier, ArtifactFactory factory, Object context) { + log.debug("HorizontalCrossSectionMeshArtifact.setup"); + super.setup(identifier, factory, context); + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileArtifact.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,57 @@ +/** + * + */ +package de.intevation.gnv.profile.vertical; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; +import de.intevation.gnv.artifacts.GNVArtifactBase; + +/** + * @author Tim Englich + * + */ +public class VerticalProfileArtifact extends GNVArtifactBase { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(VerticalProfileArtifact.class); + + /** + * The UID of this class + */ + private static final long serialVersionUID = -8291547966693867205L; + + /** + * Constructor + */ + public VerticalProfileArtifact() { + super(); + log.debug("VerticalProfileArtifact.Constructor"); + this.name = "verticalProfile"; + } + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#describe(org.w3c.dom.Document, de.intevation.artifacts.CallContext) + */ + @Override + public Document describe(Document data, CallContext context) { + log.debug("VerticalProfileArtifact.describe"); + return super.createDescibeOutput(context.getMeta(), + super.identifier, + this.getIncludeUIFromDocument(data)); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactBase#setup(java.lang.String, + * de.intevation.artifacts.ArtifactFactory, java.lang.Object) + */ + @Override + public void setup(String identifier, ArtifactFactory factory, Object context) { + log.debug("VerticalProfileArtifact.setup"); + super.setup(identifier, factory, context); + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileInstantaneousPointArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileInstantaneousPointArtifact.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,33 @@ +/** + * + */ +package de.intevation.gnv.profile.vertical; + +import org.apache.log4j.Logger; + +/** + * @author Tim Englich + * + */ +public class VerticalProfileInstantaneousPointArtifact extends + VerticalProfileArtifact { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(VerticalProfileInstantaneousPointArtifact.class); + + /** + * The UID of this class + */ + private static final long serialVersionUID = -8291547966693867205L; + + /** + * Constructor + */ + public VerticalProfileInstantaneousPointArtifact() { + super(); + log.debug("VerticalProfileInstantaneousPointArtifact.Constructor"); + super.name = super.name + "InstantaneousPoint"; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileMeshArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/vertical/VerticalProfileMeshArtifact.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,32 @@ +/** + * + */ +package de.intevation.gnv.profile.vertical; + +import org.apache.log4j.Logger; + +/** + * @author Tim Englich + * + */ +public class VerticalProfileMeshArtifact extends VerticalProfileArtifact { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(VerticalProfileMeshArtifact.class); + + /** + * The UID of this class + */ + private static final long serialVersionUID = -8291547966693867205L; + + /** + * Constructor + */ + public VerticalProfileMeshArtifact() { + super(); + log.debug("VerticalProfileMeshArtifact.Constructor"); + super.name = super.name + "Mesh"; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/profile/verticalcrosssection/VerticalCrossSectionMeshArtifact.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,58 @@ +/** + * + */ +package de.intevation.gnv.profile.verticalcrosssection; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; +import de.intevation.gnv.artifacts.GNVArtifactBase; + +/** + * @author Tim Englich + * + */ +public class VerticalCrossSectionMeshArtifact extends GNVArtifactBase { + /** + * + */ + private static final long serialVersionUID = -2687278172203755640L; + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(VerticalCrossSectionMeshArtifact.class); + + + /** + * Constructor + */ + public VerticalCrossSectionMeshArtifact() { + super(); + log.debug("VerticalCrossSectionMeshArtifact.Constructor"); + this.name = "verticalCrossSectionMesh"; + } + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#describe(org.w3c.dom.Document, de.intevation.artifacts.CallContext) + */ + @Override + public Document describe(Document data, CallContext context) { + log.debug("VerticalCrossSectionMeshArtifact.describe"); + return super.createDescibeOutput(context.getMeta(), + super.identifier, + this.getIncludeUIFromDocument(data)); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactBase#setup(java.lang.String, + * de.intevation.artifacts.ArtifactFactory, java.lang.Object) + */ + @Override + public void setup(String identifier, ArtifactFactory factory, Object context) { + log.debug("VerticalCrossSectionMeshArtifact.setup"); + super.setup(identifier, factory, context); + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/CoordinateSelectionState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/CoordinateSelectionState.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,138 @@ +/** + * + */ +package de.intevation.gnv.state; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; + +import org.apache.log4j.Logger; + +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.state.describedata.DefaultKeyValueDescribeData; +import de.intevation.gnv.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.state.describedata.NamedArrayList; +import de.intevation.gnv.state.describedata.NamedCollection; +import de.intevation.gnv.utils.InputValidator; +import de.intevation.gnv.utils.exception.ValidationException; + +/** + * @author Tim Englich + * + */ +public class CoordinateSelectionState extends StateBase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(CoordinateSelectionState.class); + + /** + * The UID of this Class + */ + private static final long serialVersionUID = 6318923553625195063L; + + /** + * Constructor + */ + public CoordinateSelectionState() { + super(); + } + + @Override + protected void purifyResult(Collection result, String uuid) { + log.debug("CoordinateSelectionState.purifyResult"); + Collection describeData = this.getDescibeData(uuid); + if (describeData == null) { + describeData = new ArrayList(); + } + NamedCollection keyValueDescibeData = this + .extractKVP(result, "FEATUREID", "SHAPE"); + describeData.add(keyValueDescibeData); + this.setDescibeData(uuid, describeData); + } + + @Override + protected String prepareInputData4RegionDBQuery(String value) { + log.debug("CoordinateSelectionState.prepareInputData4RegionDBQuery"); + double distance=0.; + String returnValue = null; + try { + Point center = new InputValidator().getPointValue(value); + String meshIDValue = super.inputData.get("meshid").getValue(); + int segments = 97; + int meshid = new Integer(meshIDValue); + if (meshid == 3 || meshid == 5){ // TODO nicht hier festbrennen. + distance = 0.15; //nord-ostsee 6nm // 97 Stützpunkte + }else if (meshid == 1 || meshid == 4){ + distance = 0.03; //Kuestenmodell 1 nm + }else if (meshid == 2 || meshid == 321){ + distance = 0.3; //SST Karten ca 20km + }else if (meshid == 641){ + distance = 0.3; //Eisdaten Klima + } + returnValue = center.buffer(distance,segments).toText(); + } catch (NumberFormatException e) { + log.error(e,e); + } catch (ValidationException e) { + log.error(e,e); + } + return returnValue; + + } + + /** + * @see de.intevation.gnv.state.StateBase#extractKVP(java.util.Collection, java.lang.String, java.lang.String) + */ + @Override + protected NamedCollection extractKVP( + Collection result, + String keyid, + String valueid) { + Iterator rit = result.iterator(); + NamedCollection keyValueDescibeData = new NamedArrayList( + this.dataName, result.size()); + keyValueDescibeData.setMultiSelect(this.dataMultiSelect); + String prevKey = null; + while (rit.hasNext()) { + Result resultValue = rit.next(); + String key = resultValue.getString(keyid); + if(prevKey == null || !prevKey.equals(key)){ // müssen wir so machen, da die sde kein select distinct auf layern zulässt. + String geomString = this.convert2DisplayCoordinate(resultValue.getString(valueid)); + String value = geomString; + if (resultValue.getResultDescriptor().getColumnIndex("VALUE") > 0){ + value = resultValue.getString("VALUE") + " - "+value; + } + + + keyValueDescibeData.add(new DefaultKeyValueDescribeData(key,value )); + } + prevKey = key; + } + return keyValueDescibeData; + } + + protected String convert2DisplayCoordinate(String wkt){ + String formattedCoordinate = null; + try { + Point p = (Point)new WKTReader().read(wkt); + double lat = p.getY(); + double lon =p.getX(); + String nord="N"; + String ost="E"; + if (lat <0 ){nord="S"; lat=-lat;} + if (lon <0 ){ost="W"; lon=-lon;} + formattedCoordinate = String.format("%1$02d°%2$1S %3$05.2f' %4$03d°%5$1S %6$05.2f'", + (int)lat, nord,60.*(lat-((int)lat)),(int)lon,ost,60.*(lon-((int)lon))); + } catch (ParseException e) { + log.error(e,e); + } + + return formattedCoordinate; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultInputData.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultInputData.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,56 @@ +/** + * + */ +package de.intevation.gnv.state; + +/** + * @author Tim Englich + * + */ +public class DefaultInputData implements InputData { + + /** + * + */ + private static final long serialVersionUID = 4308041648698108066L; + private String name = null; + private String value = null; + + /** + * Constructor + */ + public DefaultInputData(String name, String value) { + this.name = name; + this.value = value; + } + + /** + * @see de.intevation.gnv.state.InputData#getName() + */ + public String getName() { + return this.name; + } + + /** + * @see de.intevation.gnv.state.InputData#getValue() + */ + public String getValue() { + return this.value; + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return this.name + "==> " + this.value; + } + + /** + * @see de.intevation.gnv.state.InputData#concartValue(java.lang.String) + */ + public void concartValue(String value) { + this.value = this.value + " , " + value; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultInputValue.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultInputValue.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,78 @@ +/** + * + */ +package de.intevation.gnv.state; + +/** + * @author Tim Englich + * + */ +public class DefaultInputValue implements InputValue { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = -8518824299166180986L; + private String name = null; + private String type = null; + private boolean multiselect = false; + private int usedInQueries = 1; + private String defaultValue = "N/N"; + + public DefaultInputValue(String name, String type, String defaultValue, + boolean multiselect) { + this(name, type, multiselect, 1); + this.defaultValue = defaultValue; + + } + + /** + * Constructor + */ + public DefaultInputValue(String name, String type, boolean multiselect, + int usedInQueries) { + this.name = name; + this.type = type; + this.multiselect = multiselect; + this.usedInQueries = usedInQueries; + } + + /** + * @see de.intevation.gnv.state.InputValue#getName() + */ + public String getName() { + return this.name; + } + + /** + * @see de.intevation.gnv.state.InputValue#getType() + */ + public String getType() { + return this.type; + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "InputValue " + this.name + " ==> " + this.type + + "==> multiselect: " + this.multiselect; + } + + /** + * @see de.intevation.gnv.state.InputValue#isMultiselect() + */ + public boolean isMultiselect() { + return this.multiselect; + } + + public int usedInQueries() { + return this.usedInQueries; + } + + public String getDefaultValue() { + return this.defaultValue; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultOutputMode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultOutputMode.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,76 @@ +/** + * + */ +package de.intevation.gnv.state; + +import java.util.Collection; + +/** + * @author Tim Englich + * + */ +public class DefaultOutputMode implements OutputMode { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = -6459085460904827056L; + private String name = null; + private String description = null; + private String mimeType = null; + private Collection inputParameters = null; + + /** + * Constructor + * + * @param name + * @param description + * @param mimeType + */ + public DefaultOutputMode(String name, String description, String mimeType, + Collection inputParameters) { + super(); + this.name = name; + this.description = description; + this.mimeType = mimeType; + this.inputParameters = inputParameters; + } + + /** + * @see de.intevation.gnv.state.OutputMode#getDescription() + */ + public String getDescription() { + return this.description; + } + + /** + * @see de.intevation.gnv.state.OutputMode#getMimeType() + */ + public String getMimeType() { + return this.mimeType; + } + + /** + * @see de.intevation.gnv.state.OutputMode#getName() + */ + public String getName() { + return this.name; + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "Name: " + this.name + " ; Description: " + this.description + + " ; Mime-Type: " + this.mimeType; + } + + /** + * @see de.intevation.gnv.state.OutputMode#getInputParameters() + */ + public Collection getInputParameters() { + return this.inputParameters; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/DefaultState.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,23 @@ +/** + * + */ +package de.intevation.gnv.state; + +/** + * @author Tim Englich + * + */ +public class DefaultState extends StateBase { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = 8934030362091576766L; + + /** + * Constructor + */ + public DefaultState() { + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/InputData.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/InputData.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,19 @@ +/** + * + */ +package de.intevation.gnv.state; + +import java.io.Serializable; + +/** + * @author Tim Englich + * + */ +public interface InputData extends Serializable { + + public String getName(); + + public String getValue(); + + public void concartValue(String value); +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/InputValue.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/InputValue.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,24 @@ +/** + * + */ +package de.intevation.gnv.state; + +import java.io.Serializable; + +/** + * @author Tim Englich + * + */ +public interface InputValue extends Serializable { + + public String getName(); + + public String getType(); + + public String getDefaultValue(); + + public boolean isMultiselect(); + + public int usedInQueries(); + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/MinMaxState.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,62 @@ +/** + * + */ +package de.intevation.gnv.state; + +import java.util.ArrayList; +import java.util.Collection; + +import org.apache.log4j.Logger; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.describedata.DefaultMinMaxDescribeData; +import de.intevation.gnv.state.describedata.DescribeData; + +/** + * @author Tim Englich + * + */ +public class MinMaxState extends StateBase { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = -3525903792105187408L; + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(MinMaxState.class); + + /** + * Constructor + */ + public MinMaxState() { + super(); + } + + /** + * @see de.intevation.gnv.state.StateBase#purifyResult(java.util.Collection, + * java.lang.String) + */ + @Override + protected void purifyResult(Collection result, String uuid) { + log.debug("MinMaxState.purifyResult"); + Collection describeData = this.getDescibeData(uuid); + if (describeData == null) { + describeData = new ArrayList(); + } + if (result != null && result.size() == 1) { + + Result value = result.iterator().next(); + DescribeData values = new DefaultMinMaxDescribeData(this.dataName, + value.getObject("MIN"), + value.getObject("MAX")); + log.debug(values.toString()); + describeData.add(values); + } else { + log.warn("Result cannot be handled as MinMax Resultset"); + } + this.setDescibeData(uuid, describeData); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputMode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputMode.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,22 @@ +/** + * + */ +package de.intevation.gnv.state; + +import java.io.Serializable; +import java.util.Collection; + +/** + * @author Tim Englich + * + */ +public interface OutputMode extends Serializable { + + public String getName(); + + public String getDescription(); + + public String getMimeType(); + + public Collection getInputParameters(); +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputState.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,42 @@ +/** + * + */ +package de.intevation.gnv.state; + +import java.io.OutputStream; +import java.util.Collection; + +import org.w3c.dom.Document; + +import de.intevation.artifacts.CallContext; +import de.intevation.gnv.state.exception.StateException; + +/** + * @author Tim Englich + * + */ +public interface OutputState extends State { + + /** + * Returns the Rendered Result of an State. + * + * @param outputMode + * The Mode that should be produces (Chart, Map, ...) + * @return The Bytecode of the Result + * @throws StateException + */ + public void out( + Document format, + Collection inputData, + OutputStream outputStream, + String uuid, + CallContext callContext + ) throws StateException; + + /** + * Delivers the provided OutputModes of an State + * + * @return the provided OutputModes of an State + */ + public Collection getOutputModes(); +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputStateBase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/OutputStateBase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,273 @@ +/** + * + */ +package de.intevation.gnv.state; + +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Collection; +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 org.w3c.dom.NodeList; + +import de.intevation.artifactdatabase.Config; +import de.intevation.artifacts.CallMeta; +import de.intevation.gnv.artifacts.cache.CacheFactory; +import de.intevation.gnv.artifacts.ressource.RessourceFactory; +import de.intevation.gnv.geobackend.base.Result; +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.exception.StateException; + +/** + * @author Tim Englich + * + */ +public abstract class OutputStateBase extends StateBase implements + OutputState { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = -1718732895737303823L; + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(OutputStateBase.class); + + /** + * The different Outputmodes which are provided by an OutputState + */ + protected Collection outputModes = null; + + protected String queryODVID = null; + + /** + * Constructor + */ + public OutputStateBase() { + super(); + } + + /** + * @see de.intevation.gnv.state.OutputState#getOutputModes() + */ + public Collection getOutputModes() { + log.debug("OutputStateBase.getOutputModes"); + return this.outputModes; + } + + /** + * @see de.intevation.gnv.state.StateBase#setup(org.w3c.dom.Node) + */ + @Override + public void setup(Node configuration) { + log.debug("OutputStateBase.setup"); + super.setup(configuration); + + this.queryODVID = Config.getStringXPath(configuration,"queryID-odv"); + + NodeList outputModeList = Config.getNodeSetXPath(configuration, + "outputsModes/outputsMode"); + if (outputModeList != null) { + log.debug(outputModeList.getLength() + " were found."); + this.outputModes = new ArrayList(outputModeList + .getLength()); + for (int i = 0; i < outputModeList.getLength(); i++) { + Element currentNode = (Element)outputModeList.item(i); + String name = currentNode.getAttribute("name"); + String description =currentNode.getAttribute("description"); + String mimeType = currentNode.getAttribute("mime-type"); + NodeList inputValuesList = Config.getNodeSetXPath(currentNode, + "parameters/inputvalue"); + Collection inputParameters = null; + if (inputValuesList != null) { + inputParameters = new ArrayList(inputValuesList + .getLength()); + for (int j = 0; j < inputValuesList.getLength(); j++) { + Element currentInputValuesNode = (Element)inputValuesList.item(j); + String inputValueName = currentInputValuesNode.getAttribute("name"); + String inputValueType = currentInputValuesNode.getAttribute("type"); + String defaultValue =currentInputValuesNode.getAttribute("value"); + boolean isMultiselect = false; + InputValue inputValue = new DefaultInputValue( + inputValueName, inputValueType, defaultValue, + isMultiselect); + inputParameters.add(inputValue); + } + } + + OutputMode outputMode = new DefaultOutputMode(name, + description, mimeType, inputParameters); + log.debug(outputMode.toString()); + this.outputModes.add(outputMode); + + } + } + } + + /** + * @see de.intevation.gnv.state.StateBase#advance() + */ + @Override + public void advance(String uuid, CallMeta callMeta) + throws StateException { + } + + @Override + public void initialize(String uuid, CallMeta callMeta) + throws StateException { + } + + public void out(Document format, Collection inputData, + OutputStream outputStream, String uuid, CallMeta callMeta) + throws StateException { + } + + /** + * @see de.intevation.gnv.state.OutputState#out(java.lang.String, + * java.util.Collection, java.io.OutputStream) + */ + public void out(String outputMode, Collection inputData, + OutputStream outputStream) throws StateException { + } + + /** + * @return + */ + protected Collection getChartResult(String uuid) { + log.debug("OutputStateBase.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{ + result = this.getData(this.queryID); + if (CacheFactory.getInstance().isInitialized()) { + CacheFactory.getInstance().getCache().put(new net.sf.ehcache.Element(key, result)); + } + + } + } + return result; + } + + protected Object getChartFromCache(String uuid) { + log.debug("Fetch chart [" + uuid + "] from cache"); + CacheFactory cacheFactory = CacheFactory.getInstance(); + if (cacheFactory.isInitialized()) { + String key = "chart_" + uuid + super.getID(); + net.sf.ehcache.Element object = cacheFactory.getCache().get(key); + + if (object != null) { + return object.getObjectValue(); + } + } + return null; + } + + protected Collection getODVResult(String uuid) { + log.debug("OutputStateBase.getODVResult"); + // TODO add Caching? I think it's not nessessary + Collection returnValue = null; + if (this.queryODVID != null){ + returnValue = this.getData(this.queryODVID); + }else{ + log.warn("No Query for ODV Data is defined."); + } + return returnValue; + } + + /** + * @param returnValue + * @return + */ + private Collection getData(String queryID) { + log.debug("OutputStateBase.getData"); + Collection returnValue = null; + try { + String[] filterValues = this.generateFilterValuesFromInputData(); + try { + QueryExecutor queryExecutor = QueryExecutorFactory + .getInstance() + .getQueryExecutor(); + returnValue = queryExecutor.executeQuery(queryID,filterValues); + } catch (RuntimeException e) { + log.error(e, e); + } + } catch (QueryException e) { + log.error(e, e); + } + return returnValue; + } + + protected void removeChartResult(String uuid) { + log.debug("OutputStateBase.getChartResult"); + 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) { + CacheFactory.getInstance().getCache().remove(key); + } + } + } + + protected void removeChart(String uuid) { + log.debug("OutputStateBase.removeChart from cache"); + + CacheFactory cacheFactory = CacheFactory.getInstance(); + if (cacheFactory.isInitialized()) { + String key = "chart_" + uuid + super.getID(); + net.sf.ehcache.Element object = cacheFactory.getCache().get(key); + if (object != null) + cacheFactory.getCache().remove(key); + } + } + + protected void purifyChart(Object chart, String uuid) { + log.debug("Prufify chart [" + uuid + "]"); + CacheFactory cacheFactory = CacheFactory.getInstance(); + if (cacheFactory.isInitialized()) { + String key = "chart_" + uuid + getID(); + cacheFactory.getCache().put(new net.sf.ehcache.Element(key, chart)); + } + } + + /** + * @see de.intevation.gnv.state.StateBase#putInputData(java.util.Collection, java.lang.String) + */ + @Override + public void putInputData(Collection inputData, + String uuid) + throws StateException { + log.debug("OutputStateBase.putInputData"); + this.removeChartResult(uuid); + this.removeChart(uuid); + super.putInputData(inputData, uuid); + } + + public void out(String outputMode, Collection inputData, + OutputStream outputStream, String uuid, CallMeta callMeta) + throws StateException { + } + + + protected String getMessage(Locale locale, String key, String value) { + return RessourceFactory.getInstance().getRessource( + locale, + key, + value + ); + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/SingleInputState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/SingleInputState.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,59 @@ +/** + * + */ +package de.intevation.gnv.state; + +import java.util.ArrayList; +import java.util.Collection; + +import org.apache.log4j.Logger; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.describedata.DefaultSingleValueDescribeData; + +/** + * @author Tim Englich + * + */ +public class SingleInputState extends StateBase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(SingleInputState.class); + + /** + * + */ + private static final long serialVersionUID = -6169497306324917318L; + + /** + * Constructor + */ + public SingleInputState() { + } + + /** + * @see de.intevation.gnv.state.StateBase#purifyResult(java.util.Collection, + * java.lang.String) + */ + @Override + protected void purifyResult(Collection result, String uuid) { + log.debug("SingleInputState.purifyResult"); + Collection describeData = this.getDescibeData(uuid); + if (describeData == null) { + describeData = new ArrayList(); + } + String value = null; + if (result != null && result.size() == 1) { + Result tmpItem = result.iterator().next(); + value = tmpItem.getObject("MAX").toString(); + } else { + value = ""; + } + + describeData.add(new DefaultSingleValueDescribeData(this.dataName,value)); + this.setDescibeData(uuid, describeData); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/State.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/State.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,47 @@ +/** + * + */ +package de.intevation.gnv.state; + +import java.io.Serializable; +import java.util.Collection; + +import org.w3c.dom.Document; +import org.w3c.dom.Node; + +import de.intevation.artifacts.CallMeta; +import de.intevation.gnv.state.exception.StateException; + +/** + * @author Tim Englich + * + */ +public interface State extends Serializable { + + public void setup(Node configuration); + + public String getID(); + + public String getDescription(); + + public void describe(Document document, Node rootNode, + CallMeta callMeta, String uuid); + + public void setParent(State state); + + public State getParent(); + + public Collection getRequiredInputValues(); + + public void putInputData(Collection inputData, + String uuid)throws StateException; + + public Collection getInputData() throws StateException; + + public void advance(String uuid, CallMeta callMeta) + throws StateException; + public void initialize(String uuid, CallMeta callMeta) + throws StateException; + + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/StateBase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,727 @@ +/** + * + */ +package de.intevation.gnv.state; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.GregorianCalendar; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Map; +import java.util.Set; + +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.Config; +import de.intevation.artifacts.CallMeta; +import de.intevation.gnv.artifacts.GNVArtifactBase; +import de.intevation.gnv.artifacts.cache.CacheFactory; +import de.intevation.gnv.artifacts.ressource.RessourceFactory; +import de.intevation.gnv.geobackend.base.Result; +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.geobackend.util.DateUtils; +import de.intevation.gnv.state.describedata.DefaultKeyValueDescribeData; +import de.intevation.gnv.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.state.describedata.MinMaxDescribeData; +import de.intevation.gnv.state.describedata.NamedArrayList; +import de.intevation.gnv.state.describedata.NamedCollection; +import de.intevation.gnv.state.describedata.SingleValueDescribeData; +import de.intevation.gnv.state.exception.StateException; +import de.intevation.gnv.utils.ArtifactXMLUtilities; +import de.intevation.gnv.utils.InputValidator; + +/** + * @author Tim Englich + * + */ +public abstract class StateBase implements State { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = 2411169179001645426L; + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(GNVArtifactBase.class); + + private final static String MINVALUEFIELDNAME = "minvalue"; + private final static String MAXVALUEFIELDNAME = "maxvalue"; + + private final static String NODATASELECTIONKEY = "n/n"; + + private final static String DESCRIBEDATAKEY = "_DESCRIBEDATA"; + + private String id = null; + + private String description = null; + + protected String dataName = null; + + protected boolean dataMultiSelect = false; + + protected boolean dataNoSelect = false; + + protected String queryID = null; + + protected Collection inputValueNames = null; + + private Map inputValues = null; + + private State parent = null; + + protected Map inputData = null; + + + /** + * Constructor + */ + public StateBase() { + super(); + } + + /** + * @see de.intevation.gnv.state.State#getID() + */ + public String getID() { + return this.id; + } + + /** + * @see de.intevation.gnv.state.State#getDescription() + */ + public String getDescription() { + return this.description; + } + + + + /** + * @see de.intevation.gnv.state.State#getRequiredInputValues() + */ + public Collection getRequiredInputValues() { + return this.inputValues.values(); + } + + /** + * @see de.intevation.gnv.state.State#setup(org.w3c.dom.Node) + */ + public void setup(Node configuration) { + log.debug("StateBase.setup"); + this.id = ((Element)configuration).getAttribute("id"); + this.description = ((Element)configuration).getAttribute("description"); + + log.info("State-ID = " + this.id); + + NodeList inputValuesNodes = Config.getNodeSetXPath(configuration, + "inputvalues/inputvalue"); + this.inputValues = new HashMap(inputValuesNodes + .getLength()); + this.inputValueNames = new ArrayList(inputValuesNodes + .getLength()); + for (int i = 0; i < inputValuesNodes.getLength(); i++) { + Element inputValueNode = (Element)inputValuesNodes.item(i); + String usedinQueryValue = inputValueNode.getAttribute("usedinquery"); + int usedinQuery = 1; + if (usedinQueryValue != null) { + try { + usedinQuery = Integer.parseInt(usedinQueryValue); + } catch (NumberFormatException e) { + log + .warn("Used in Query Value cannot be transformed into a Number"); + } + } + InputValue inputValue = new DefaultInputValue(inputValueNode.getAttribute("name"), + inputValueNode.getAttribute("type"), + Boolean.parseBoolean(inputValueNode. + getAttribute("multiselect")), usedinQuery); + log.debug(inputValue.toString()); + this.inputValues.put(inputValue.getName(), inputValue); + this.inputValueNames.add(inputValue.getName()); + } + + this.queryID = Config.getStringXPath(configuration, "queryID"); + log.info("QueryID ==> " + this.queryID); + + this.dataName = Config.getStringXPath(configuration, "dataname"); + + String dataMultiSelectValue = Config.getStringXPath(configuration, + "data-multiselect"); + if (dataMultiSelectValue != null) { + this.dataMultiSelect = Boolean.parseBoolean(dataMultiSelectValue); + } + + String dataNoSelectValue =Config.getStringXPath(configuration, + "data-noselect"); + if (dataNoSelectValue != null) { + this. dataNoSelect = Boolean.parseBoolean(dataNoSelectValue); + } + + } + + /** + * @see de.intevation.gnv.state.State#getParent() + */ + public State getParent() { + return this.parent; + } + + /** + * @see de.intevation.gnv.state.State#setParent(de.intevation.gnv.state.State) + */ + public void setParent(State state) { + this.parent = state; + } + + /** + * @see de.intevation.gnv.state.State#putInputData(java.util.Collection) + */ + public void putInputData(Collection inputData, String uuid) + throws StateException { + log.debug("StateBase.putInputData"); + if (inputData != null) { + Iterator it = inputData.iterator(); + InputValidator iv = new InputValidator(); + while (it.hasNext()) { + InputData tmpItem = it.next(); + InputValue inputValue = this.inputValues.get(tmpItem.getName()); + if (inputValue != null) { + if (this.inputData == null) { + this.inputData = new HashMap( + inputData.size()); + } + + boolean valid = iv.isInputValid(tmpItem.getValue(), + inputValue.getType()); + if (valid) { + if (tmpItem.getName().equals(MINVALUEFIELDNAME)){ + String minValue = tmpItem.getValue(); + String maxValue = this.getInputValue4ID(inputData, MAXVALUEFIELDNAME); + valid = iv.isInputValid(maxValue,inputValue.getType()); + if (!valid){ + String errMsg = "Wrong input for " + tmpItem.getValue() + + " is not an " + inputValue.getType() + + " Value."; + log.warn(errMsg); + throw new StateException(errMsg); + } + + valid = iv.isInputValid(minValue, + maxValue, + inputValue.getType()); + if (!valid){ + String errMsg = "MaxValue-Input is less than MinValue-Input "; + log.warn(errMsg); + throw new StateException(errMsg); + } + }else if (tmpItem.getName().equals(MAXVALUEFIELDNAME)){ + String minValue = this.getInputValue4ID(inputData, MINVALUEFIELDNAME); + String maxValue = tmpItem.getValue(); + valid = iv.isInputValid(minValue,inputValue.getType()); + if (!valid){ + String errMsg = "Wrong input for " + tmpItem.getValue() + + " is not an " + inputValue.getType() + + " Value."; + log.warn(errMsg); + throw new StateException(errMsg); + } + + valid = iv.isInputValid(minValue, + maxValue, + inputValue.getType()); + if (!valid){ + String errMsg = "MaxValue-Input is less than MinValue-Input "; + log.warn(errMsg); + throw new StateException(errMsg); + } + } + this.setSelection(tmpItem, uuid); + this.inputData.put(tmpItem.getName(), tmpItem); + } else { + String errMsg = "Wrong input for " + tmpItem.getValue() + + " is not an " + inputValue.getType() + + " Value."; + log.warn(errMsg); + throw new StateException(errMsg); + } + + } else { + String errMsg = "No Inputvalue given for Inputdata " + + tmpItem.getName(); + log.warn(errMsg + "Value will be ignored"); + + } + } + } else { + log.warn("No Inputdata given"); + } + } + + private String getInputValue4ID(Collection inputData, String inputName){ + Iterator it = inputData.iterator(); + while (it.hasNext()) { + InputData tmpItem = it.next(); + if (tmpItem.getName().equals(inputName)){ + return tmpItem.getValue(); + } + } + return null; + } + + private void setSelection(InputData inputData, String uuid) { + log.debug("StateBase.setSelection"); + + Object o = this.getDescribeData(inputData.getName(),uuid); + if (o != null) { + if (o instanceof Collection) { + Collection values = (Collection) o; + + String value = inputData.getValue(); + String[] selectedValues = value.split(","); + Set selectedItems = new HashSet( + selectedValues.length); + for (int i = 0; i < selectedValues.length; i++) { + selectedItems.add(selectedValues[i].trim()); + } + // Selektion umsetzen + Iterator it = values.iterator(); + while (it.hasNext()) { + KeyValueDescibeData data = it.next(); + String key = "" + data.getKey(); + boolean selected = selectedItems.contains(key); + data.setSelected(selected); + } + } else if (o instanceof MinMaxDescribeData) { + MinMaxDescribeData data = (MinMaxDescribeData) o; + if (inputData.getName().equals(MINVALUEFIELDNAME)) { + data.setMinValue(inputData.getValue()); + } + if (inputData.getName().equals(MAXVALUEFIELDNAME)) { + data.setMaxValue(inputData.getValue()); + } + } else if (o instanceof SingleValueDescribeData) { + ((SingleValueDescribeData)o).setValue(inputData.getValue()); + } + } + } + + private Object getDescribeData(String name, String uuid) { + log.debug("StateBase.getDescribeData"); + Collection descibeData = this.getDescibeData(uuid); + if (descibeData != null) { + Iterator it = descibeData.iterator(); + while (it.hasNext()) { + Object o = it.next(); + if (o instanceof NamedCollection) { + if (name.equals(((NamedCollection) o).getName())) { + return o; + } + } else if (o instanceof MinMaxDescribeData) { + if (name.equals(((MinMaxDescribeData) o).getMinName())) { + return o; + } + if (name.equals(((MinMaxDescribeData) o).getMaxName())) { + return o; + } + }else if (o instanceof SingleValueDescribeData) { + if (name.equals(((SingleValueDescribeData)o).getName())){ + return o; + } + } + } + } + return null; + + } + + /** + * @see de.intevation.gnv.state.State#advance(java.lang.String, + * de.intevation.artifacts.CallMeta) + */ + public void advance(String uuid, CallMeta callMeta) + throws StateException { + } + + public void initialize(String uuid, CallMeta callMeta) + throws StateException { + log.debug("StateBase.initialize"); + try { + String[] filterValues = this + .generateFilterValuesFromInputData(); + Collection result = null; + try { + if (this.queryID != null) { + QueryExecutor queryExecutor = QueryExecutorFactory + .getInstance().getQueryExecutor(); + result = queryExecutor.executeQuery(this.queryID, + filterValues); + } + this.purifyResult(result, uuid); + } catch (RuntimeException e) { + log.error(e, e); + } + } catch (QueryException e) { + log.error(e, e); + throw new StateException(e); + } + } + + /** + * @return + */ + protected String[] generateFilterValuesFromInputData() { + List list = new ArrayList(); + Iterator it = this.inputValueNames.iterator(); + while (it.hasNext()) { + String value = it.next(); + 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()) + .getType(); + String requestValue = data.getValue(); + if (type.equalsIgnoreCase("string")) { + requestValue = this + .prepareInputData4DBQuery(requestValue); + } else if (type.equalsIgnoreCase("date")) { + requestValue = this + .prepareInputData4DateDBQuery(requestValue); + } else if (type.equalsIgnoreCase("coordinate")){ + requestValue = this + .prepareInputData4RegionDBQuery(requestValue); + } + for (int j = 0; j < size; j++) { + list.add(requestValue); + } + } + } + String[] filterValues = list.toArray(new String[0]); + return filterValues; + } + + protected String prepareInputData4RegionDBQuery(String value){ + return value; + } + + private String prepareInputData4DateDBQuery(String value) { + log.debug("StateBase.prepareInputData4DateDBQuery"); + if (value != null) { + String[] values = value.split(","); + String newValue = ""; + for (int i = 0; i < values.length; i++) { + if (newValue.length() > 0) { + newValue = newValue + " , "; + } + // TODO JUST HACK FIND A BETTER RESOLUTION + newValue = newValue + "to_date('" + values[i].trim() + + "', 'YYYY.MM.DD HH24:MI:SS')"; + } + return newValue; + } + + return value; + } + + private String prepareInputData4DBQuery(String value) { + log.debug("StateBase.prepareInputData4DBQuery"); + if (value != null) { + String[] values = value.split(","); + String newValue = ""; + for (int i = 0; i < values.length; i++) { + if (newValue.length() > 0) { + newValue = newValue + " , "; + } + newValue = newValue + "'" + values[i].trim() + "'"; + } + return newValue; + } + + return value; + + } + + /** + * @param result + */ + protected void purifyResult(Collection result, String uuid) { + log.debug("StateBase.purifyResult"); + Collection describeData = this.getDescibeData(uuid); + if (describeData == null) { + describeData = new ArrayList(); + } + NamedCollection keyValueDescibeData = extractKVP(result, "KEY", "VALUE"); + describeData.add(keyValueDescibeData); + this.setDescibeData(uuid, describeData); + } + + /** + * @param result + * @return + */ + protected NamedCollection extractKVP(Collection result, + String keyid, + String valueid) { + Iterator rit = result.iterator(); + int dataSize = (this.dataNoSelect ? result.size()+1 : result.size()); + + NamedCollection keyValueDescibeData = new NamedArrayList( + this.dataName, dataSize); + keyValueDescibeData.setMultiSelect(this.dataMultiSelect); + + if (this.dataNoSelect){ + keyValueDescibeData.add(new DefaultKeyValueDescribeData(NODATASELECTIONKEY, + "No Selection")); + } + boolean initialized = false; + int keyPos= 0; + int valuePos = 1; + String previousKey = null; + while (rit.hasNext()) { + Result resultValue = rit.next(); + if (!initialized){ + keyPos = resultValue.getResultDescriptor().getColumnIndex(keyid); + valuePos = resultValue.getResultDescriptor().getColumnIndex(valueid); + if (valuePos < 0){ + valuePos = 1; + } + initialized = true; + } + String tmpKey = resultValue.getString(keyPos); + // TODO: HACK da die ARCSDE kein DISTINCT auf räumlichen Anfragen unterstützt. + if (previousKey == null || !tmpKey.equals(previousKey)){ + previousKey = tmpKey; + keyValueDescibeData.add(new DefaultKeyValueDescribeData(tmpKey, resultValue.getString(valuePos))); + } + } + return keyValueDescibeData; + } + + /** + * @see de.intevation.gnv.state.State#describe(org.w3c.dom.Document, + * org.w3c.dom.Node, de.intevation.artifacts.CallMeta, + * java.lang.String) + */ + public void describe(Document document, Node rootNode, CallMeta callMeta,String uuid) { + log.debug("StateBase.describe"); + Collection descibeData = this.getDescibeData(uuid); + if (descibeData != null) { + ArtifactXMLUtilities xmlutilities = new ArtifactXMLUtilities(); + Iterator it = descibeData.iterator(); + Node staticNode = xmlutilities.createArtifactElement(document, + "static"); + Node dynamic = xmlutilities.createArtifactElement(document, + "dynamic"); + rootNode.appendChild(staticNode); + rootNode.appendChild(dynamic); + while (it.hasNext()) { + + Object o = it.next(); + if (o instanceof Collection) { + String name = null; + boolean multiselect = false; + if (o instanceof NamedCollection) { + NamedCollection nc = ((NamedCollection) o); + name = nc.getName(); + multiselect = nc.isMultiSelect(); + } else { + Object[] names = this.inputValueNames.toArray(); + name = names[names.length - 1].toString(); + } + + Element selectNode = xmlutilities.createXFormElement( + document, multiselect ? "select" : "select1"); + selectNode.setAttribute("ref", name); + + Element lableNode = xmlutilities.createXFormElement( + document, "label"); + lableNode.setTextContent(RessourceFactory.getInstance() + .getRessource(callMeta.getLanguages(), name, name)); + Element choiceNode = xmlutilities.createXFormElement( + document, "choices"); + + Collection values = (Collection) o; + Iterator resultIt = values.iterator(); + while (resultIt.hasNext()) { + KeyValueDescibeData result = resultIt.next(); + Element itemNode = xmlutilities.createXFormElement( + document, "item"); + + if (result.isSelected()) { + itemNode.setAttribute("selected", "true"); + } + + Element choiceLableNode = xmlutilities + .createXFormElement(document, "label"); + choiceLableNode.setTextContent(result.getValue()); + itemNode.appendChild(choiceLableNode); + + Element choicValueNode = xmlutilities + .createXFormElement(document, "value"); + choicValueNode.setTextContent("" + result.getKey()); + itemNode.appendChild(choicValueNode); + choiceNode.appendChild(itemNode); + } + selectNode.appendChild(lableNode); + selectNode.appendChild(choiceNode); + + if (!it.hasNext() && this.dataName != null) { + dynamic.appendChild(selectNode); + } else { + staticNode.appendChild(selectNode); + } + + } else if (o instanceof MinMaxDescribeData) { + MinMaxDescribeData minMaxDescibeData = (MinMaxDescribeData) o; + Object min = minMaxDescibeData.getMinValue(); + Object max = minMaxDescibeData.getMaxValue(); + if (min instanceof GregorianCalendar) { + Date d = ((GregorianCalendar) min).getTime(); + min = DateUtils.getPatternedDateAmer(d); + } + + if (max instanceof GregorianCalendar) { + Date d = ((GregorianCalendar) max).getTime(); + max = DateUtils.getPatternedDateAmer(d); + } + + Element groupNode = xmlutilities.createXFormElement( + document, "group"); + groupNode.setAttribute("ref", minMaxDescibeData.getName()); + Element groupNodeLableNode = xmlutilities + .createXFormElement(document, "label"); + groupNodeLableNode.setTextContent(RessourceFactory + .getInstance().getRessource( + callMeta.getLanguages(), + minMaxDescibeData.getName(), + minMaxDescibeData.getName())); + groupNode.appendChild(groupNodeLableNode); + + Element inputMinNode = xmlutilities.createXFormElement( + document, "input"); + inputMinNode.setAttribute("ref", MINVALUEFIELDNAME); + Element inputMinLableNode = xmlutilities + .createXFormElement(document, "label"); + inputMinLableNode.setTextContent(RessourceFactory + .getInstance().getRessource( + callMeta.getLanguages(), MINVALUEFIELDNAME, + MINVALUEFIELDNAME)); + inputMinNode.appendChild(inputMinLableNode); + + Element inputMinValueNode = xmlutilities + .createXFormElement(document, "value"); + inputMinValueNode.setTextContent(min.toString()); + inputMinNode.appendChild(inputMinValueNode); + + Element inputMaxNode = xmlutilities.createXFormElement( + document, "input"); + inputMaxNode.setAttribute("ref", MAXVALUEFIELDNAME); + Element inputMaxLableNode = xmlutilities + .createXFormElement(document, "label"); + inputMaxLableNode.setTextContent(RessourceFactory + .getInstance().getRessource( + callMeta.getLanguages(), MAXVALUEFIELDNAME, + MAXVALUEFIELDNAME)); + inputMaxNode.appendChild(inputMaxLableNode); + + Element inputMaxValueNode = xmlutilities + .createXFormElement(document, "value"); + inputMaxValueNode.setTextContent(max.toString()); + inputMaxNode.appendChild(inputMaxValueNode); + + groupNode.appendChild(inputMinNode); + groupNode.appendChild(inputMaxNode); + + if (!it.hasNext() && this.dataName != null) { + dynamic.appendChild(groupNode); + } else { + staticNode.appendChild(groupNode); + } + } else if (o instanceof SingleValueDescribeData) { + + SingleValueDescribeData svdb = (SingleValueDescribeData) o; + + Element groupNode = xmlutilities.createXFormElement( + document, "group"); + groupNode.setAttribute("ref", svdb.getName()); + Element groupNodeLableNode = xmlutilities + .createXFormElement(document, "label"); + groupNodeLableNode.setTextContent(RessourceFactory + .getInstance().getRessource( + callMeta.getLanguages(), + svdb.getName(), + svdb.getName())); + groupNode.appendChild(groupNodeLableNode); + + Element inputNode = xmlutilities.createXFormElement( + document, "input"); + inputNode.setAttribute("ref", svdb.getName()); + + Element inputLableNode = xmlutilities.createXFormElement( + document, "label"); + inputLableNode.setTextContent(""); + inputNode.appendChild(inputLableNode); + + Element inputValueNode = xmlutilities.createXFormElement( + document, "value"); + inputValueNode.setTextContent(svdb.getValue()); + inputNode.appendChild(inputValueNode); + + groupNode.appendChild(inputNode); + if (!it.hasNext() && this.dataName != null) { + dynamic.appendChild(groupNode); + } else { + staticNode.appendChild(groupNode); + } + } + + } + } + } + + /** + * @see de.intevation.gnv.state.State#getDescibeData() + */ + protected Collection getDescibeData(String uuid) { + if (CacheFactory.getInstance().isInitialized()) { + String key = uuid + DESCRIBEDATAKEY; + log.debug("Hash for Queryelements: " + key); + net.sf.ehcache.Element value = CacheFactory.getInstance().getCache().get(key); + if (value != null) { + return (Collection) (value.getObjectValue()); + } + } + return null; + } + + /** + * @see de.intevation.gnv.state.State#getDescibeData() + */ + protected void setDescibeData(String uuid, Collection describeData) { + + if (CacheFactory.getInstance().isInitialized()) { + String key = uuid + DESCRIBEDATAKEY; + log.debug("Hash for Queryelements: " + key); + CacheFactory.getInstance().getCache().put(new net.sf.ehcache.Element(key, describeData)); + } + } + + /** + * @see de.intevation.gnv.state.State#getInputData() + */ + public Collection getInputData() throws StateException { + return this.inputData != null ? this.inputData.values() : null; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/StateFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/StateFactory.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,55 @@ +/** + * + */ +package de.intevation.gnv.state; + +import org.apache.log4j.Logger; +import org.w3c.dom.Node; + +import de.intevation.gnv.artifacts.GNVArtifactBase; + +/** + * @author Tim Englich + * + */ +public class StateFactory { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(GNVArtifactBase.class); + + private static StateFactory instance = null; + + /** + * Constructor + */ + public StateFactory() { + super(); + } + + public static StateFactory getInstance() { + if (instance == null) { + instance = new StateFactory(); + } + return instance; + } + + public State createState(Node configuration) { + log.debug("StateFactory.createState"); + State state = null; + try { + String classname = ((org.w3c.dom.Element)configuration).getAttribute("state"); + state = (State) (Class.forName(classname).newInstance()); + state.setup(configuration); + } catch (InstantiationException e) { + log.error(e, e); + } catch (IllegalAccessException e) { + log.error(e, e); + } catch (ClassNotFoundException e) { + log.error(e, e); + } + return state; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultKeyValueDescribeData.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultKeyValueDescribeData.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,57 @@ +/** + * + */ +package de.intevation.gnv.state.describedata; + +/** + * @author Tim Englich + * + */ +public class DefaultKeyValueDescribeData implements KeyValueDescibeData { + + /** + * + */ + private static final long serialVersionUID = -924469415242703108L; + + private String key; + + private String value = null; + + private boolean selected = false; + + public DefaultKeyValueDescribeData(String key, String value) { + super(); + this.key = key; + this.value = value; + } + + /** + * @see de.intevation.gnv.state.describedata.KeyValueDescibeData#getKey() + */ + public String getKey() { + return this.key; + } + + /** + * @see de.intevation.gnv.state.describedata.KeyValueDescibeData#getValue() + */ + public String getValue() { + return this.value; + } + + /** + * @see de.intevation.gnv.state.describedata.KeyValueDescibeData#isSelected() + */ + public boolean isSelected() { + return this.selected; + } + + /** + * @see de.intevation.gnv.state.describedata.KeyValueDescibeData#setSelected(boolean) + */ + public void setSelected(boolean selected) { + this.selected = selected; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultMinMaxDescribeData.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultMinMaxDescribeData.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,92 @@ +/** + * + */ +package de.intevation.gnv.state.describedata; + +/** + * @author Tim Englich + * + */ +public class DefaultMinMaxDescribeData implements MinMaxDescribeData { + + /** + * + */ + private static final long serialVersionUID = -2917176219029052295L; + + private Object minValue = null; + + private Object maxValue = null; + + private String name = null; + + private final static String minName = "minvalue"; + + private final static String maxName = "maxvalue"; + + /** + * Constructor + */ + public DefaultMinMaxDescribeData(String name, Object minValue, Object maxValue) { + super(); + this.name = name; + this.minValue = minValue; + this.maxValue = maxValue; + } + + /** + * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#getMaxValue() + */ + public Object getMaxValue() { + return this.maxValue; + } + + /** + * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#getMinValue() + */ + public Object getMinValue() { + return this.minValue; + } + + /** + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + return "MIN: " + this.minValue.toString() + " ; MAX: " + + this.maxValue.toString(); + } + + /** + * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#getName() + */ + public String getMinName() { + return minName; + } + + /** + * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#getMaxName() + */ + public String getMaxName() { + return maxName; + } + + /** + * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#setMaxValue(java.lang.Object) + */ + public void setMaxValue(Object maxValue) { + this.maxValue = maxValue; + } + + /** + * @see de.intevation.gnv.state.describedata.MinMaxDescribeData#setMinValue(java.lang.Object) + */ + public void setMinValue(Object minValue) { + this.minValue = minValue; + } + + public String getName() { + return this.name; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultSingleValueDescribeData.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DefaultSingleValueDescribeData.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,51 @@ +/** + * + */ +package de.intevation.gnv.state.describedata; + +/** + * @author Tim Englich + * + */ +public class DefaultSingleValueDescribeData implements SingleValueDescribeData { + + /** + * + */ + private static final long serialVersionUID = 3580176842483316917L; + + private String name = null; + + private String value = null; + + /** + * Constructor + * + * @param name + * @param value + */ + public DefaultSingleValueDescribeData(String name, String value) { + super(); + this.name = name; + this.value = value; + } + + /** + * @see de.intevation.gnv.state.describedata.SingleValueDescribeData#getName() + */ + public String getName() { + return this.name; + } + + /** + * @see de.intevation.gnv.state.describedata.SingleValueDescribeData#getValue() + */ + public String getValue() { + return this.value; + } + + public void setValue(String value) { + this.value = value; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DescribeData.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/DescribeData.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,16 @@ +/** + * + */ +package de.intevation.gnv.state.describedata; + +import java.io.Serializable; + +/** + * Markerinterface + * + * @author Tim Englich + * + */ +public interface DescribeData extends Serializable { + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/KeyValueDescibeData.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/KeyValueDescibeData.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,22 @@ +/** + * + */ +package de.intevation.gnv.state.describedata; + +import java.io.Serializable; + +/** + * @author Tim Englich + * + */ +public interface KeyValueDescibeData extends Serializable { + + public String getKey(); + + public String getValue(); + + public boolean isSelected(); + + public void setSelected(boolean selected); + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/MinMaxDescribeData.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/MinMaxDescribeData.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,26 @@ +/** + * + */ +package de.intevation.gnv.state.describedata; + +/** + * @author Tim Englich + * + */ +public interface MinMaxDescribeData extends DescribeData { + + public Object getMinValue(); + + public Object getMaxValue(); + + public void setMinValue(Object minValue); + + public void setMaxValue(Object maxValue); + + public String getName(); + + public String getMinName(); + + public String getMaxName(); + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedArrayList.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedArrayList.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,71 @@ +/** + * + */ +package de.intevation.gnv.state.describedata; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * @author Tim Englich + * + */ +public class NamedArrayList extends ArrayList implements + NamedCollection { + /** + * + */ + private static final long serialVersionUID = 8172229594749676354L; + + private String name = null; + + private boolean multiSelect = false; + + /** + * Constructor + */ + public NamedArrayList(String name) { + this.name = name; + } + + /** + * Constructor + * + * @param initialCapacity + */ + public NamedArrayList(String name, int initialCapacity) { + super(initialCapacity); + this.name = name; + } + + /** + * Constructor + * + * @param c + */ + public NamedArrayList(String name, Collection c) { + super(c); + this.name = name; + } + + /** + * @see de.intevation.gnv.state.describedata.NamedCollection#getName() + */ + public String getName() { + return this.name; + } + + /** + * @see de.intevation.gnv.state.describedata.NamedCollection#isMultiSelect() + */ + public boolean isMultiSelect() { + return multiSelect; + } + + /** + * @see de.intevation.gnv.state.describedata.NamedCollection#setMultiSelect(boolean) + */ + public void setMultiSelect(boolean multiSelect) { + this.multiSelect = multiSelect; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedCollection.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/NamedCollection.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,19 @@ +/** + * + */ +package de.intevation.gnv.state.describedata; + +import java.util.Collection; + +/** + * @author Tim Englich + * + */ +public interface NamedCollection extends Collection { + + public String getName(); + + public boolean isMultiSelect(); + + public void setMultiSelect(boolean multiSelect); +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/SingleValueDescribeData.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/describedata/SingleValueDescribeData.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,17 @@ +/** + * + */ +package de.intevation.gnv.state.describedata; + +/** + * @author Tim Englich + * + */ +public interface SingleValueDescribeData extends DescribeData { + + public String getName(); + + public String getValue(); + + public void setValue(String value); +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/exception/StateException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/exception/StateException.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,52 @@ +/** + * + */ +package de.intevation.gnv.state.exception; + +/** + * @author Tim Englich + * + */ +public class StateException extends Exception { + + /** + * The UID of the Class + */ + private static final long serialVersionUID = -1635921702746050244L; + + /** + * Constructor + */ + public StateException() { + super(); + } + + /** + * Constructor + * + * @param message + */ + public StateException(String message) { + super(message); + } + + /** + * Constructor + * + * @param cause + */ + public StateException(Throwable cause) { + super(cause); + } + + /** + * Constructor + * + * @param message + * @param cause + */ + public StateException(String message, Throwable cause) { + super(message, cause); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileMeshCrossOutputState.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,513 @@ +/** + * + */ +package de.intevation.gnv.state.profile.horizontal; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; +import java.util.Locale; + +import org.apache.log4j.Logger; +import org.w3c.dom.Node; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.geom.LineString; + +import com.vividsolutions.jts.io.ParseException; +import com.vividsolutions.jts.io.WKTReader; + +import de.intevation.artifactdatabase.Config; + +import de.intevation.gnv.artifacts.cache.CacheFactory; + +import de.intevation.gnv.chart.Chart; +import de.intevation.gnv.chart.ChartLabels; +import de.intevation.gnv.chart.HorizontalCrossProfileChart; + +import de.intevation.gnv.geobackend.base.DefaultResultDescriptor; +import de.intevation.gnv.geobackend.base.ResultDescriptor; +import de.intevation.gnv.geobackend.base.DefaultResult; +import de.intevation.gnv.geobackend.base.Result; + +import de.intevation.gnv.math.Point2d; +import de.intevation.gnv.math.Interpolation2D; + +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.geobackend.sde.datasources.ResultSet; + + +import de.intevation.gnv.utils.IndexBuffer; +import de.intevation.gnv.utils.DistanceCalculator; + +import de.intevation.gnv.math.LinearFunction; +import de.intevation.gnv.math.LinearMetrics; + +import org.apache.commons.math.optimization.fitting.CurveFitter; + +import org.apache.commons.math.optimization.general.GaussNewtonOptimizer; +import org.apache.commons.math.optimization.OptimizationException; + +import org.apache.commons.math.FunctionEvaluationException; + +import org.jfree.chart.ChartTheme; + +/** + * @author Tim Englich + * + */ +public class HorizontalProfileMeshCrossOutputState extends + HorizontalProfileOutputState { + + /** + * + */ + private static final long serialVersionUID = 2205958041745637263L; + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = + Logger.getLogger(HorizontalProfileMeshCrossOutputState.class); + + + private String ijkQueryID = null; + + /** + * Constructor + */ + public HorizontalProfileMeshCrossOutputState() { + super(); + } + + /** + * @see de.intevation.gnv.state.timeseries.TimeSeriesOutputState#setup(org.w3c.dom.Node) + */ + @Override + public void setup(Node configuration) { + super.setup(configuration); + this.ijkQueryID = Config.getStringXPath(configuration,"queryID-ijk"); + + } + + + @Override + protected Chart getChart( + ChartLabels chartLables, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Collection result, + Locale locale, + String uuid, + boolean linesVisible, + boolean shapesVisible + ) { + Chart chart = null; + if (CACHE_CHART) { + log.info("Try to get horizontalprofilemeshcross chart from cache."); + chart = (Chart) getChartFromCache(uuid); + } + + if (chart != null) + return chart; + + log.info("Chart not in cache yet."); + chart = new HorizontalCrossProfileChart( + chartLables, + theme, + parameters, + measurements, + dates, + result, + null, + locale, + linesVisible, + shapesVisible + ); + chart.generateChart(); + + if (CACHE_CHART) { + log.info("Put chart into cache."); + purifyChart(chart, uuid); + } + + return chart; + } + + @Override + protected Collection getChartResult(String uuid) { + 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{ + + if (this.inputData.containsKey("mesh_linestring")){ + + try { + // 1. IJK Anfragen für Stuetzpunkte im Netz ausführen. + LineString ls = (LineString)new WKTReader().read(this.inputData + .get("mesh_linestring") + .getValue()); + Coordinate[] coords = ls.getCoordinates(); + + List points = new ArrayList(coords.length); + + String meshid = this.inputData.get("meshid").getValue(); + QueryExecutor queryExecutor = QueryExecutorFactory + .getInstance() + .getQueryExecutor(); + + ArrayList missingPoints = new ArrayList(); + + String additionWhere = "FEATUREID=FEATUREID"; + + for (int i = 0; i < coords.length; i++) { + + String wkt = toWKT(coords[i]); + + result = queryExecutor.executeQuery(this.ijkQueryID, + new String[]{meshid,wkt}); + if (!result.isEmpty()){ + Result resultValue = result.iterator().next(); + int iPos = resultValue.getInteger(1); + int jPos = resultValue.getInteger(0); + log.debug("Found Pos "+iPos+"/"+jPos +" for "+wkt); + points.add(i, new java.awt.Point(iPos,jPos)); + }else{ + log.debug("No i/j Pos found for "+wkt); + missingPoints.add(new Object [] { Integer.valueOf(i), coords[i] }); + points.add(i, null); + // Special Case no i,j found for Coordinate + } + } + + if (missingPoints.size() == coords.length) { + log.debug("cannot create index buffer"); + } + else { // generate index filter + boolean remainsMissingPoints = !missingPoints.isEmpty(); + + if (remainsMissingPoints) { + // try to guess the missing (i, j) + CurveFitter iFitter = new CurveFitter(new GaussNewtonOptimizer(true)); + CurveFitter jFitter = new CurveFitter(new GaussNewtonOptimizer(true)); + + for (int i = 0, N = points.size(); i < N; ++i) { + java.awt.Point p = (java.awt.Point)points.get(i); + if (p != null) { + Coordinate coord = coords[i]; + iFitter.addObservedPoint(coord.x, p.x); + jFitter.addObservedPoint(coord.y, p.y); + } + } + try { + // XXX: Assumption: (i, j) are created by componentwise linear function. + // This is surely not correct because (x, y) are in a ellipsoid projection. + // TODO: use ellipsoid functions and fit with Levenberg Marquardt. + double [] iParams = iFitter.fit( + LinearFunction.INSTANCE, new double [] { 1d, 1d }); + + double [] jParams = jFitter.fit( + LinearFunction.INSTANCE, new double [] { 1d, 1d }); + + for (int i = missingPoints.size()-1; i >= 0; --i) { + Object [] a = (Object [])missingPoints.get(i); + Coordinate coord = (Coordinate)a[1]; + int pi = (int)Math.round(iParams[0]*coord.x + iParams[1]); + int pj = (int)Math.round(jParams[0]*coord.y + jParams[1]); + points.set( + ((Integer)a[0]).intValue(), + new java.awt.Point(pi, pj)); + } + + remainsMissingPoints = false; // we filled the gaps + } + catch (FunctionEvaluationException fee) { + log.error(fee); + } + catch (OptimizationException oe) { + log.error(oe); + } + } + + if (!remainsMissingPoints) { + // TODO: Make Tablenames and Columns Configurable + IndexBuffer ib = new IndexBuffer( + points, + "MEDIAN.MESHPOINT.IPOSITION", + "MEDIAN.MESHPOINT.JPOSITION" ); + additionWhere = ib.toWhereClause(); + log.debug("Additional Where Clause = "+additionWhere); + // 2. Aus diesen Stuetzpunkten den Resultset generieren. + } + } // if generate index filter + + String[] filterValues = this.generateFilterValuesFromInputData(); + String[] addedFilterValues = new String[filterValues.length+1]; + System.arraycopy(filterValues, 0, addedFilterValues, 0, filterValues.length); + addedFilterValues[filterValues.length] = additionWhere; + + result = process( + Arrays.asList(coords), + queryExecutor.executeQuery( + this.queryID, + addedFilterValues)); + + } catch (ParseException e) { + log.error(e,e); + }catch (QueryException e) { + log.error(e,e); + } + }else{ + // TODO: definieren was passiert wenn kein linestring vorhanden ist. + } + + if (CacheFactory.getInstance().isInitialized()) { + CacheFactory.getInstance().getCache().put(new net.sf.ehcache.Element(key, result)); + } + + } + } + return result; + } + + + @Override + protected String createChartSubtitle(Locale locale, String uuid) { + log.debug("create chart subtitle for horizontal crossprofile charts."); + String subtitle = createTimePeriod(locale, uuid); + + return subtitle; + } + + private static final String [] COLUMN_BLACKLIST = { + "MEDIAN.MESHPOINT.JPOSITION", + "MEDIAN.MESHPOINT.IPOSITION" + }; + + private static final boolean blacklisted(String column) { + for (int i = 0; i < COLUMN_BLACKLIST.length; ++i) { + if (COLUMN_BLACKLIST.equals(column)) { + return true; + } + } + return false; + } + + private static boolean different(Result a, Result b, int [] indices) { + for (int i = 0; i < indices.length; ++i) { + String oa = a.getString(indices[i]); + String ob = b.getString(indices[i]); + + if (oa == null && ob == null) { + continue; + } + + if (oa == null || ob == null) { + return true; + } + + if (!oa.equals(ob)) { + log.debug("+++++++++++++++ differs ++++++++++++++"); + log.debug(" " + oa + " != " + ob); + return true; + } + } + return false; + } + + private static final String [] DIFF_COLUMS = { + "GROUP1", + "GROUP2", + "GROUP3" + }; + + public static final class SectionHandler + implements Interpolation2D.Consumer + { + private ArrayList points; + private List path; + private Collection output; + private Result prototyp; + private ResultDescriptor descriptor; + + public SectionHandler() { + } + + public SectionHandler( + List path, + Collection output, + ResultDescriptor descriptor + ) { + this.path = path; + this.output = output; + this.descriptor = descriptor; + points = new ArrayList(); + } + + public void finish() { + if (!points.isEmpty()) { + double distance = toKM( + DistanceCalculator.calculateDistance(path)); + + if (distance > EPSILON) { + + Interpolation2D.interpolate( + path, + points, + 0d, + distance, + INTERPOLATION_STEPS, + LinearMetrics.INSTANCE, + this); + } + + points.clear(); + } + } + + public void setPrototyp(Result prototyp) { + this.prototyp = prototyp; + } + + public void handle(Result result) { + Coordinate coordinate = + toCoordinate(result.getString("SHAPE")); + double value = result.getDouble("YORDINATE"); + int iPos = result.getInteger("MEDIAN.MESHPOINT.JPOSITION"); + int jPos = result.getInteger("MEDIAN.MESHPOINT.JPOSITION"); + Point2d p = new Point2d( + coordinate.x, + coordinate.y, + value, + iPos, jPos); + points.add(p); + } + + public void interpolated(Coordinate coordinate) { + DefaultResult result = new DefaultResult(descriptor); + ResultDescriptor pd = prototyp.getResultDescriptor(); + + int pcolums = pd.getColumnCount(); + for (int i = 0, j = 0; i < pcolums; ++i) { + String colname = pd.getColumnName(i); + if (blacklisted(colname)) { + continue; + } + if (colname.equals("SHAPE")) { + result.addColumnValue(j, toWKT(coordinate)); + } + else if (colname.equals("YORDINATE")) { + result.addColumnValue(j, Double.valueOf(coordinate.z)); + } + else { + result.addColumnValue(j, prototyp.getObject(i)); + } + ++j; + } + output.add(result); + } + } // class SectionHandler + + public static final double NAUTICAL_MILE = 1852.216d; + public static final double KILOMETER = 1000d; + + public static final double toKM(double distance) { + return (distance * NAUTICAL_MILE) / KILOMETER; + } + + public static final double EPSILON = 1e-5d; + public static final int INTERPOLATION_STEPS = + Integer.getInteger("interpolation.steps", 500).intValue(); + + public static Coordinate toCoordinate(String shape) { + try { + return ((Point)(new WKTReader().read(shape))).getCoordinate(); + } + catch (ParseException pe) { + log.error(pe); + } + return null; + } + + public static String toWKT(Coordinate coordinate) { + StringBuilder sb = new StringBuilder("POINT("); + sb.append(coordinate.x) + .append(' ') + .append(coordinate.y) + .append(')'); + return sb.toString(); + } + + protected Collection process( + List path, + Collection input + ) { + log.debug("------ number of points before processing: " + input.size()); + ArrayList output = new ArrayList(); + + + Result last = null; + + int [] diffColums = null; + + SectionHandler sectionHandler = null; + + for (Result result: input) { + + if (sectionHandler == null) { + + ResultDescriptor rd = result.getResultDescriptor(); + diffColums = rd.getColumnIndices(DIFF_COLUMS); + int columns = rd.getColumnCount(); + + DefaultResultDescriptor resultDescriptor = + new DefaultResultDescriptor(); + + for (int j = 0; j < columns; ++j) { + String columnName = rd.getColumnName(j); + if (!blacklisted(columnName)) { + resultDescriptor.addColumn( + columnName, + rd.getColumnClassName(j)); + } + } + + sectionHandler = new SectionHandler( + path, + output, + resultDescriptor); + + sectionHandler.setPrototyp(result); + } + + if (last != null && different(last, result, diffColums)) { + sectionHandler.finish(); + sectionHandler.setPrototyp(result); + } + + sectionHandler.handle(result); + + last = result; + } + + if (sectionHandler != null) { + sectionHandler.finish(); + } + + log.debug("------ number of points after processing: " + output.size()); + + return output; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileOutputState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/HorizontalProfileOutputState.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,344 @@ +/** + * + */ +package de.intevation.gnv.state.profile.horizontal; + +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.io.WKTReader; +import com.vividsolutions.jts.io.ParseException; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.text.SimpleDateFormat; +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 de.intevation.gnv.chart.Chart; +import de.intevation.gnv.chart.ChartLabels; +import de.intevation.gnv.chart.HorizontalProfileChart; +import de.intevation.gnv.exports.DefaultExport; +import de.intevation.gnv.exports.ShapeDataCollector; +import de.intevation.gnv.exports.DefaultProfile; +import de.intevation.gnv.exports.Export.Profile; +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.state.exception.StateException; +import de.intevation.gnv.state.timeseries.TimeSeriesOutputState; +import de.intevation.gnv.statistics.HorizontalProfileStatistics; +import de.intevation.gnv.statistics.Statistics; + +/** + * @author Tim Englich + * + */ +public class HorizontalProfileOutputState +extends TimeSeriesOutputState +{ + public static final String [] HORIZONTAL_PROFILE_COLUMNS = { + "SHAPE", + "YORDINATE", + "GROUP1" + // "GROUP2", + }; + + + public static final String [] HORIZONTAL_MESH_CSV_COLUMN_LABEL = { + "Longitude", + "Latitude", + "Value", + "ParameterID", + //"MeshID" + }; + + + public static final String [] HORIZONTAL_MEASUREMENT_CSV_COLUMN_LABEL = { + "Longitude", + "Latitude", + "Value", + "ParameterID", + //"SurveyID" + }; + /** + * The UID of this class + */ + private static final long serialVersionUID = 4401516087492028840L; + + private static Logger log = Logger + .getLogger(HorizontalProfileOutputState.class); + + public static final String DATE_FORMAT = "yyyy.MM.dd HH:mm:ss"; + + public static final String [] CHART_TITLE_META = { + "CRUISE", + "DEPTH", + "SHAPE" + }; + + + public static final String [] CHART_TITLE_META_RESSOURCES = { + "cruiseid", + "depth", + "coordinate" + }; + + public static final String [] TIMESERIES_CSV_PROFILE_NAMES = { + "SHAPE", + "YORDINATE", + "GROUP1", + "GROUP2", + "GROUP3" + }; + + public static final Profile TIMESERIES_CSV_PROFILE = + new DefaultProfile( + null, + ',', + '"', + '"', + "CSV", + "ISO-8859-1"); + + /** + * Constructor + */ + public HorizontalProfileOutputState() { + super(); + super.domainLable = "chart.horizontalprofile.title.xaxis"; + } + + + @Override + protected Chart getChart( + ChartLabels chartLables, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Collection result, + Locale locale, + String uuid, + boolean linesVisible, + boolean shapesVisible + ) { + Chart chart = null; + + if (CACHE_CHART) { + log.info("Try to get horizontalprofile chart from cache."); + chart = (Chart) getChartFromCache(uuid); + } + + if (chart != null) + return chart; + + log.info("Chart not in cache yet."); + chart = new HorizontalProfileChart( + chartLables, + theme, + parameters, + measurements, + dates, + result, + null, + locale, + linesVisible, + shapesVisible + ); + chart.generateChart(); + + if (CACHE_CHART) { + log.info("Put chart into cache."); + purifyChart(chart, uuid); + } + + return chart; + } + + + /** + * @see de.intevation.gnv.state.timeseries.TimeSeriesOutputState#getStatisticsGenerator() + */ + @Override + protected Statistics getStatisticsGenerator() { + return new HorizontalProfileStatistics(); + } + + + @Override + protected void createCSV(OutputStream out, Collection results) + throws UnsupportedEncodingException, IOException, StateException + { + log.debug("Create csv export for horizontal profiles."); + Iterator iter = results.iterator(); + Result res = iter.hasNext() ? (Result) iter.next() : null; + + if (res == null) + return; + + Profile profile = null; + int dataid = res.getInteger("DATAID").intValue(); + + // on meshes + if (dataid == 2) { + profile = new DefaultProfile( + HORIZONTAL_MESH_CSV_COLUMN_LABEL, + ',', + '"', + '"', + "CSV", + "ISO-8859-1"); + } + + // on measurements + else { + profile = new DefaultProfile( + HORIZONTAL_MEASUREMENT_CSV_COLUMN_LABEL, + ',', + '"', + '"', + "CSV", + "ISO-8859-1"); + } + + DefaultExport export = new DefaultExport( + new ShapeDataCollector(HORIZONTAL_PROFILE_COLUMNS)); + export.create(profile, out, results); + } + + + protected String createChartTitle(Locale locale, String uuid) { + String fisName = getFisName(locale); + log.debug("created title for horizontal profile chart: " + fisName); + + return fisName; + } + + + protected String createChartSubtitle(Locale locale, String uuid) { + log.debug("create chart subtitle."); + String subtitle = createTimePeriod(locale, uuid); + + // ODV results contain meta information about cruise, station and so on + Collection results = getODVResult(uuid); + if (results != null) { + Iterator iter = results.iterator(); + Result result = iter.hasNext() ? (Result) iter.next() : null; + + subtitle += subtitle.length() != 0 ? "\n" : ""; + subtitle += createMetaChartSubtitle(locale, result); + } + + return subtitle; + } + + + protected String createMetaChartSubtitle(Locale locale, Result result) { + log.debug("Fetch meta information and put it into subtitle."); + if (result == null) + return ""; + + StringBuilder meta = new StringBuilder(); + WKTReader wktReader = new WKTReader(); + + + for (int i = 0; i < CHART_TITLE_META.length; i++) { + String qry = CHART_TITLE_META[i]; + + if (qry.equals("SHAPE")) { + try { + Point p = (Point) wktReader.read(result.getString(qry)); + + meta.append(getMessage(locale,"coordinate","coordinate")); + meta.append(": "); + + log.debug( + "Add " + qry + " to meta information of subtitle: " + + p.toString() + ); + meta.append(p.getX() + ", " + p.getY()); + } + catch (ParseException pe) { + log.warn("Error while parsing point.", pe); + } + } + else { + log.debug( + "Add " + qry + " to meta information of subtitle: " + + result.getString(qry) + ); + meta.append(getMessage( + locale, + CHART_TITLE_META_RESSOURCES[i], + CHART_TITLE_META_RESSOURCES[i] + )); + meta.append(": "); + meta.append(result.getString(qry)); + } + + if (i != CHART_TITLE_META.length-1) + meta.append("\n"); + } + + log.debug("Meta title for chart: " + meta.toString()); + return meta.toString(); + } + + + protected String createTimePeriod(Locale locale, String uuid) { + log.debug("create time period for chart subtitle."); + String subTitle = null; + Date startDate = null; + Date endDate = null; + + Collection dates = getDates(uuid); + if (dates == null) { + log.debug("No time period for subtitle."); + return ""; + } + + SimpleDateFormat format = new SimpleDateFormat(DATE_FORMAT); + KeyValueDescibeData data = null; + + Iterator iter = dates.iterator(); + while (iter.hasNext()) { + try { + data = (KeyValueDescibeData)iter.next(); + + if (!data.isSelected()) + continue; + + Date current = format.parse(data.getValue()); + long time = current.getTime(); + + if (startDate == null) { + startDate = current; + endDate = current; + } + else if (time < startDate.getTime()) { + startDate = current; + } + else if (time > endDate.getTime()) { + endDate = current; + } + } + catch (java.text.ParseException pe) { + log.warn("Error while parsing date: " + data.getValue(), pe); + } + } + + if (startDate != null && endDate != null) + subTitle = format.format(startDate)+" - "+format.format(endDate); + + subTitle = subTitle == null ? "" : subTitle; + + log.debug("created title for horizontal profile chart: " + subTitle); + + return subTitle; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/NorthSouthEastWestState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontal/NorthSouthEastWestState.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,67 @@ +/** + * + */ +package de.intevation.gnv.state.profile.horizontal; + +import java.util.ArrayList; +import java.util.Collection; + +import de.intevation.artifacts.CallMeta; +import de.intevation.gnv.artifacts.ressource.RessourceFactory; +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.StateBase; +import de.intevation.gnv.state.describedata.DefaultKeyValueDescribeData; +import de.intevation.gnv.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.state.describedata.NamedArrayList; +import de.intevation.gnv.state.describedata.NamedCollection; +import de.intevation.gnv.state.exception.StateException; + +/** + * @author Tim Englich + * + */ +public class NorthSouthEastWestState extends StateBase { + + + /** + * The UID of this Class + */ + private static final long serialVersionUID = -7989531326553305293L; + + /** + * Constructor + */ + public NorthSouthEastWestState() { + } + + /** + * @see de.intevation.gnv.state.StateBase#purifyResult(java.util.Collection, java.lang.String) + */ + @Override + protected void purifyResult(Collection result, String uuid) { + } + + /** + * @see de.intevation.gnv.state.StateBase#initialize(java.lang.String, de.intevation.artifacts.CallMeta) + */ + @Override + public void initialize(String uuid, CallMeta callMeta) + throws StateException { + Collection describeData = this.getDescibeData(uuid); + if (describeData == null) { + describeData = new ArrayList(); + } + NamedCollection keyValueDescibeData = new NamedArrayList( + this.dataName, 2); + keyValueDescibeData.setMultiSelect(super.dataMultiSelect); + keyValueDescibeData.add(new DefaultKeyValueDescribeData("IPOSITION", + RessourceFactory.getInstance().getRessource( + callMeta.getLanguages(), "iposition", "iposition"))); + keyValueDescibeData.add(new DefaultKeyValueDescribeData("JPOSITION", + RessourceFactory.getInstance().getRessource( + callMeta.getLanguages(), "jposition", "jposition"))); + describeData.add(keyValueDescibeData); + } + + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/horizontalcrosssection/HorizontalCrossSectionMeshOutputState.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,146 @@ +/** + * + */ +package de.intevation.gnv.state.profile.horizontalcrosssection; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.util.Collection; +import java.util.Iterator; +import java.util.Locale; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; + +import au.com.bytecode.opencsv.CSVWriter; +import de.intevation.gnv.chart.Chart; +import de.intevation.gnv.chart.ChartLabels; +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.exception.StateException; +import de.intevation.gnv.state.timeseries.TimeSeriesOutputState; +import de.intevation.gnv.statistics.Statistics; + +/** + * @author Tim Englich + * + */ +public class HorizontalCrossSectionMeshOutputState + extends TimeSeriesOutputState { + + private static Logger log = Logger + .getLogger(HorizontalCrossSectionMeshOutputState.class); + + /** + * The UID of this Class + */ + private static final long serialVersionUID = 3233620652465061860L; + + /** + * Constructor + */ + public HorizontalCrossSectionMeshOutputState() { + super(); + super.domainLable = "chart.horizontalcrosssection.title.xaxis"; + } + + @Override + protected Chart getChart( + ChartLabels chartLables, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Collection result, + Locale locale, + String uuid, + boolean linesVisible, + boolean shapesVisible + ) { + Chart chart = null; + + if (CACHE_CHART) { + log.info("Try to get horizontalcrosssection chart from cache."); + chart = (Chart) getChartFromCache(uuid); + } + + if (chart != null) + return chart; + + log.info("Chart not in cache yet."); + + log.warn("This sort of chart is not implemented yet."); + /* TODO Implement a special chart for this sort of charts. + chart = new HorizontalProfileChart( + chartLables, + chartTheme, + parameters, + measurements, + result, + dates, + locale + ); + chart.generateChart(); + + if (CACHE_CHART) { + log.info("Put chart into cache."); + purifyChart(chart, uuid); + } + */ + + return chart; + } + + + /** + * @see de.intevation.gnv.state.timeseries.TimeSeriesOutputState#getStatisticsGenerator() + */ + @Override + protected Statistics getStatisticsGenerator() { + return null; //Statistiken werden nicht für diesen Out-Typ unterstützt. + } + + /** + * @see de.intevation.gnv.state.timeseries.TimeSeriesOutputState#createCSV(java.io.OutputStream, + * java.util.Collection) + */ + @Override + protected void createCSV(OutputStream outputStream, + Collection chartResult) + throws UnsupportedEncodingException, + IOException, + StateException { + if (chartResult != null) { + try { + CSVWriter writer = new CSVWriter(new OutputStreamWriter( + outputStream, "ISO-8859-1"), ','); + // USE THIS ENCODING BECAUSE OF + // PROBLEMS WITH EXCEL AND UTF-8 + Iterator it = chartResult.iterator(); + while (it.hasNext()) { + Result result = it.next(); + int i = 0; + String[] entries = new String[5]; + entries[i++] = result.getString("SHAPE"); + entries[i++] = result.getString("YORDINATE"); + entries[i++] = result.getString("IPOSITION"); + entries[i++] = result.getString("JPOSITION"); + entries[i++] = result.getString("KPOSITION"); + writer.writeNext(entries); + } + writer.close(); + } catch (Exception e) { + log.error(e,e); + throw new StateException( + "Exception occured while parsing an Point from WKT."); + } + } else { + log.error("No Data given for generating an CSV-File."); + throw new StateException( + "No Data given for generating an CSV-File."); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileOutputState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/vertical/VerticalProfileOutputState.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,202 @@ +/** + * + */ +package de.intevation.gnv.state.profile.vertical; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.UnsupportedEncodingException; +import java.util.Collection; +import java.util.Iterator; +import java.util.Locale; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; + +import de.intevation.gnv.chart.Chart; +import de.intevation.gnv.chart.ChartLabels; +import de.intevation.gnv.chart.VerticalProfileChart; +import de.intevation.gnv.exports.DefaultExport; +import de.intevation.gnv.exports.DefaultDataCollector; +import de.intevation.gnv.exports.DefaultProfile; +import de.intevation.gnv.exports.Export.Profile; +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.exception.StateException; +import de.intevation.gnv.state.timeseries.TimeSeriesOutputState; +import de.intevation.gnv.statistics.Statistics; +import de.intevation.gnv.statistics.VerticalProfileStatistics; + +/** + * @author Tim Englich + * + */ +public class VerticalProfileOutputState extends TimeSeriesOutputState { + + public static final String [] VERTICAL_PROFILE_COLUMNS = { + "XORDINATE", // not quite sure if this is depth + "YORDINATE", + "GROUP1" + // "GROUP2", + // "GROUP3" + }; + + + public static final String [] VERTICAL_MESH_CSV_COLUMN_LABEL = { + "CentralDepth", + "Value", + "ParameterID" + // TODO "FeatureID", + // TODO "MeshID" + }; + + + public static final String [] VERTICAL_TIMESERIES_CSV_COLUMN_LABEL = { + "Depth", + "Value", + "ParameterID" + // TODO FeatureID missing + // TODO TimeseriesID missing + }; + + + public static final String [] VERTICAL_MEASUREMENT_CSV_COLUMN_LABEL = { + "Depth", + "Value", + "ParameterID" + // TODO FeatureID missing + // TODO SeriesID missing + }; + + + /** + * The UID of this class + */ + private static final long serialVersionUID = 4401516087492028840L; + + private static Logger log = Logger + .getLogger(TimeSeriesOutputState.class); + + /** + * Constructor + */ + public VerticalProfileOutputState() { + super(); + super.domainLable = "chart.verticalprofile.title.xaxis"; + } + + + @Override + protected Chart getChart( + ChartLabels chartLables, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Collection result, + Locale locale, + String uuid, + boolean linesVisible, + boolean shapesVisible + ) { + Chart chart = null; + + if (CACHE_CHART) { + log.info("Try to get verticalprofile chart from cache."); + chart = (Chart) getChartFromCache(uuid); + } + + if (chart != null) + return chart; + + log.info("Chart not in cache yet."); + chart = new VerticalProfileChart( + chartLables, + theme, + parameters, + measurements, + dates, + result, + null, + locale, + linesVisible, + shapesVisible + ); + chart.generateChart(); + + if (CACHE_CHART) { + log.info("Put chart into cache."); + purifyChart(chart, uuid); + } + + return chart; + } + + + @Override + protected void createCSV(OutputStream out, Collection results) + throws UnsupportedEncodingException, IOException, StateException + { + Iterator iter = results.iterator(); + Result res = iter.hasNext() ? (Result) iter.next() : null; + + if (res == null) + return; + + Profile profile = null; + int dataid = res.getInteger("DATAID").intValue(); + + // on meshes + if (dataid == 2) { + profile = new DefaultProfile( + VERTICAL_MESH_CSV_COLUMN_LABEL, + ',', + '"', + '"', + "CSV", + "ISO-8859-1"); + } + + // on timeseries + else if (dataid == 1) { + profile = new DefaultProfile( + VERTICAL_TIMESERIES_CSV_COLUMN_LABEL, + ',', + '"', + '"', + "CSV", + "ISO-8859-1"); + } + + // on measurements + else { + profile = new DefaultProfile( + VERTICAL_MEASUREMENT_CSV_COLUMN_LABEL, + ',', + '"', + '"', + "CSV", + "ISO-8859-1"); + } + + DefaultExport export = new DefaultExport( + new DefaultDataCollector(VERTICAL_PROFILE_COLUMNS)); + export.create(profile, out, results); + } + + + protected String createChartSubtitle(Locale locale, String uuid) { + return getSelectedFeatureName(uuid); + } + + + + /** + * @see de.intevation.gnv.state.timeseries.TimeSeriesOutputState#getStatisticsGenerator() + */ + @Override + protected Statistics getStatisticsGenerator() { + return new VerticalProfileStatistics(); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/profile/verticalcrosssection/VerticalCrossSectionOutputState.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,179 @@ +/** + * + */ +package de.intevation.gnv.state.profile.verticalcrosssection; + +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.UnsupportedEncodingException; +import java.util.Collection; +import java.util.Iterator; +import java.util.Locale; + +import org.apache.log4j.Logger; + +import org.jfree.chart.ChartTheme; + +import au.com.bytecode.opencsv.CSVWriter; + +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.io.ParseException; +import com.vividsolutions.jts.io.WKTReader; + +import de.intevation.gnv.chart.Chart; +import de.intevation.gnv.chart.ChartLabels; +import de.intevation.gnv.chart.ChartStyle; +import de.intevation.gnv.chart.exception.TechnicalChartException; +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.state.exception.StateException; +import de.intevation.gnv.state.timeseries.TimeSeriesOutputState; +import de.intevation.gnv.statistics.Statistics; +import de.intevation.gnv.statistics.VerticalProfileStatistics; + +/** + * @author Tim Englich + * + */ +public class VerticalCrossSectionOutputState extends TimeSeriesOutputState { + + private static Logger log = Logger + .getLogger(VerticalCrossSectionOutputState.class); + + /** + * The UID of this Class + */ + private static final long serialVersionUID = 3233620652465061860L; + + /** + * Constructor + */ + public VerticalCrossSectionOutputState() { + super(); + super.domainLable = "chart.verticalcrosssection.title.xaxis"; + } + + @Override + protected Chart getChart( + ChartLabels chartLables, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Collection result, + Locale locale, + String uuid, + boolean linesVisible, + boolean shapesVisible + ) { + Chart chart = null; + + if (CACHE_CHART) { + log.info("Try to get verticalcrosssection chart from cache."); + chart = (Chart) getChartFromCache(uuid); + } + + if (chart != null) + return chart; + + log.info("Chart not in cache yet."); + + log.warn("This sort of chart is not implemented yet."); + /* TODO Implement a special chart for this sort of charts. + chart = new VerticalProfileChart( + chartLables, + chartTheme, + parameters, + measurements, + result, + dates, + locale + ); + chart.generateChart(); + + if (CACHE_CHART) { + log.info("Put chart into cache."); + purifyChart(chart, uuid); + } + */ + + return chart; + } + + /** + * @see de.intevation.gnv.state.timeseries.TimeSeriesOutputState#createChart(java.io.OutputStream, + * java.util.Collection, java.util.Collection, java.lang.String, + * de.intevation.gnv.chart.ChartStyle, + * de.intevation.gnv.chart.ChartLabels) + */ + /* + @Override + protected void createChart(OutputStream outputStream, + Collection parameters, + Collection measurements, + Collection dates, + ChartStyle chartStyle, ChartLabels chartLables, + String uuid) throws IOException, + TechnicalChartException { + new VerticalCrossSectionChartFactory().createProfileChart(chartLables, + chartStyle, parameters, measurements, dates, outputStream, this + .getChartResult(uuid)); + } + */ + + /** + * @see de.intevation.gnv.state.timeseries.TimeSeriesOutputState#getStatisticsGenerator() + */ + @Override + protected Statistics getStatisticsGenerator() { + return new VerticalProfileStatistics(); + } + + /** + * @see de.intevation.gnv.state.timeseries.TimeSeriesOutputState#createCSV(java.io.OutputStream, java.util.Collection) + */ + @Override + protected void createCSV(OutputStream outputStream, + Collection chartResult) + throws UnsupportedEncodingException, + IOException, + StateException { + if (chartResult != null) { + try { + CSVWriter writer = new CSVWriter(new OutputStreamWriter( + outputStream, "ISO-8859-1"), ','); + // USE THIS ENCODING BECAUSE OF + // PROBLEMS WITH EXCEL AND UTF-8 + Iterator it = chartResult.iterator(); + WKTReader wktReader = new WKTReader(); + while (it.hasNext()) { + Result result = it.next(); + int i = 0; + String[] entries = new String[9]; + Point p = (Point)wktReader.read(result.getString("SHAPE")); + entries[i++] = ""+p.getX(); + entries[i++] = ""+p.getY(); + entries[i++] = result.getString("Z"); + entries[i++] = result.getString("YORDINATE"); + entries[i++] = result.getString("GROUP1"); + entries[i++] = result.getString("GROUP2"); + entries[i++] = result.getString("IPOSITION"); + entries[i++] = result.getString("JPOSITION"); + entries[i++] = result.getString("KPOSITION"); + writer.writeNext(entries); + } + writer.close(); + } catch (ParseException e) { + log.error(e,e); + throw new StateException( + "Exception occured while parsing an Point from WKT."); + } + } else { + log.error("No Data given for generating an CSV-File."); + throw new StateException( + "No Data given for generating an CSV-File."); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/state/timeseries/TimeSeriesOutputState.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,888 @@ +/** + * + */ +package de.intevation.gnv.state.timeseries; + +import java.io.IOException; +import java.io.File; +import java.io.OutputStream; +import java.io.FileOutputStream; +import java.io.UnsupportedEncodingException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Vector; + +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 org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import org.jfree.chart.ChartTheme; + +import au.com.bytecode.opencsv.CSVWriter; +import de.intevation.artifactdatabase.Config; +import de.intevation.artifactdatabase.XMLUtils; +import de.intevation.artifacts.CallMeta; +import de.intevation.artifacts.CallContext; +import de.intevation.artifacts.PreferredLocale; +import de.intevation.gnv.artifacts.context.GNVArtifactContext; +import de.intevation.gnv.artifacts.context.GNVArtifactContextFactory; +import de.intevation.gnv.artifacts.ressource.RessourceFactory; +import de.intevation.gnv.chart.Chart; +import de.intevation.gnv.chart.ChartLabels; +import de.intevation.gnv.chart.TimeSeriesChart; +import de.intevation.gnv.chart.XMLChartTheme; +import de.intevation.gnv.chart.exception.TechnicalChartException; +import de.intevation.gnv.exports.ChartExportHelper; +import de.intevation.gnv.exports.DefaultExport; +import de.intevation.gnv.exports.DefaultDataCollector; +import de.intevation.gnv.exports.SimpleOdvDataCollector; +import de.intevation.gnv.exports.DefaultProfile; +import de.intevation.gnv.exports.Export.Profile; +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.InputData; +import de.intevation.gnv.state.OutputStateBase; +import de.intevation.gnv.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.state.describedata.NamedCollection; +import de.intevation.gnv.state.exception.StateException; +import de.intevation.gnv.statistics.Statistic; +import de.intevation.gnv.statistics.StatisticSet; +import de.intevation.gnv.statistics.Statistics; +import de.intevation.gnv.statistics.TimeseriesStatistics; +import de.intevation.gnv.statistics.exception.StatisticsException; +import de.intevation.gnv.timeseries.gap.DefaultTimeGap; +import de.intevation.gnv.timeseries.gap.TimeGap; +import de.intevation.gnv.utils.ArtifactXMLUtilities; + + +/** + * @author Tim Englich + * + */ +public class TimeSeriesOutputState extends OutputStateBase { + + protected static final boolean CACHE_CHART = + Boolean.parseBoolean(System.getProperty("cache.chart", "false")); + + protected static final boolean PDF_FORMAT_LANDSCAPE = + Boolean.parseBoolean(System.getProperty("export.pdf.landscape","true")); + + protected static final String[] IMG_EXPORT_FORMAT = { + "PNG", "JPEG", "GIF" + }; + + /** + * The UID of this Class + */ + private static final long serialVersionUID = 4178407570503098858L; + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(TimeSeriesOutputState.class); + + private static List timeGapDefinitions = null; + + protected String domainLable = "chart.timeseries.title.xaxis"; + + protected String featureValuesName = "featureid"; + protected String parameterValuesName = "parameterid"; + protected String measuremenValueName = "measurementid"; + protected String dateValueName = "dateid"; + + public static final String [] TIMESERIES_CSV_PROFILE_COLUMNS = { + "XORDINATE", + "YORDINATE", + "GROUP1", + "GROUP2", + "GROUP3" + }; + + + public static final String [] TIMESERIES_TIMESERIES_CSV_COLUMN_LABEL = { + "Date/Time", + "Value", + "ParameterID", + "MeasurementID", + "TimeseriesID" + }; + + public static final String [] TIMESERIES_MESH_CSV_COLUMN_LABEL = { + "Date/Time", + "Value", + "ParameterID", + "FeatureID", + "MeshID" + }; + + public static final String [] TIMESERIES_ODV_PROFILE_NAMES = { + "CRUISE", + "STATION", + "TYPE", + "SHAPE", + "BOTDEPTH", + "DEPTH", + "TIMEVALUE", + "DATAVALUE", + "PARAMETER" + }; + + + public static final String [] ODV_COLUMN_HEADER = { + "Cruise", + "Station", + "Type", + "Longitude [deegrees_east]", + "Latitude [deegrees_north]", + "Bot. Depth [m]", + "Depth [m]", + "Date/Time", + "Value", + "Parameterid" + }; + + /** + * Profile for exporting data to odv + * TODO Change TIMESERIES_PROFILE_NAMES, which belong to CSV exports + */ + public static final Profile TIMESERIES_ODV_PROFILE = + new DefaultProfile( + ODV_COLUMN_HEADER, + '\t', + CSVWriter.NO_QUOTE_CHARACTER, + CSVWriter.NO_ESCAPE_CHARACTER, + "ODV", + "ISO-8859-1"); + + /** + * Constructor + */ + public TimeSeriesOutputState() { + super(); + } + + /** + * @see de.intevation.gnv.transition.OutputTransition#out(java.lang.String, + * java.util.Collection, java.io.OutputStream, java.lang.String, + * de.intevation.artifacts.CallMeta) + */ + public void out( + Document format, + Collection inputData, + OutputStream outputStream, + String uuid, + CallContext callContext + ) throws StateException + { + log.debug("TimeSeriesOutputTransition.out"); + + String outputMode = Config.getStringXPath( + format, + "action/out/@name" + ); + String mimeType = Config.getStringXPath( + format, + "action/out/mime-type/@value" + ); + + CallMeta callMeta = callContext.getMeta(); + + try { + if (outputMode.equalsIgnoreCase("chart")) { + log.debug("Chart will be generated."); + int chartWidth = 600; + int chartHeight = 400; + try { + if (inputData != null) { + Iterator it = inputData.iterator(); + while (it.hasNext()) { + InputData ip = it.next(); + if (ip.getName().equalsIgnoreCase("width")) { + chartWidth = Integer.parseInt(ip.getValue()); + } else if (ip.getName().equalsIgnoreCase("height")) { + chartHeight = Integer.parseInt(ip.getValue()); + } + } + } + } catch (NumberFormatException e) { + log.error(e, e); + throw new StateException(e); + } + + PreferredLocale[] locales = callMeta.getLanguages(); + Locale[] serverLocales = + RessourceFactory.getInstance().getLocales(); + Locale locale = + callMeta.getPreferredLocale(serverLocales); + + log.debug( + "Best locale - regarding intersection of server and " + + "browser locales - is " + locale.toString() + ); + + Collection parameters = this.getCleanedParameters(uuid); + Collection measurements = this.getMeasurements(uuid); + Collection dates = this.getDates(uuid); + + ChartLabels chartLables = new ChartLabels( + createChartTitle(locale, uuid), + createChartSubtitle(locale, uuid), + RessourceFactory.getInstance().getRessource( + locale, + domainLable, + domainLable + ) + ); + + String exportFormat = getExportFormat(mimeType); + + // TODO Remove this and parse input data + boolean linesVisible = true; + boolean shapesVisible = true; + + this.createChart( + outputStream, + parameters, + measurements, + dates, + chartLables, + callContext, + uuid, + exportFormat, + locale, + chartWidth, + chartHeight, + linesVisible, + shapesVisible + ); + } + else if (outputMode.equalsIgnoreCase("pdf")) { + log.debug("Output mode == pdf"); + + Locale[] serverLocales = + RessourceFactory.getInstance().getLocales(); + Locale locale = + callMeta.getPreferredLocale(serverLocales); + + // TODO Remove this and parse input data + boolean linesVisible = true; + boolean shapesVisible = true; + + log.debug( + "Best locale - regarding intersection of server and " + + "browser locales - is " + locale.toString() + ); + + createPDF( + outputStream, + getCleanedParameters(uuid), + getMeasurements(uuid), + getDates(uuid), + new ChartLabels( + createChartTitle(locale, uuid), + createChartSubtitle(locale, uuid), + RessourceFactory.getInstance().getRessource( + locale, + domainLable, + domainLable + ) + ), + uuid, + "A4", + true, + linesVisible, + shapesVisible, + locale, + callContext + ); + } + else if (outputMode.equalsIgnoreCase("svg")) { + log.debug("Output mode == svg"); + int width = 600; + int height = 400; + + // TODO Remove this and parse input data + boolean linesVisible = true; + boolean shapesVisible = true; + + Locale[] serverLocales = + RessourceFactory.getInstance().getLocales(); + Locale locale = + callMeta.getPreferredLocale(serverLocales); + + log.debug( + "Best locale - regarding intersection of server and " + + "browser locales - is " + locale.toString() + ); + + createSVG( + outputStream, + getCleanedParameters(uuid), + getMeasurements(uuid), + getDates(uuid), + new ChartLabels( + createChartTitle(locale, uuid), + createChartSubtitle(locale, uuid), + RessourceFactory.getInstance().getRessource( + locale, + domainLable, + domainLable + ) + ), + uuid, + locale, + width, + height, + linesVisible, + shapesVisible, + callContext + ); + } + else if (outputMode.equalsIgnoreCase("csv")) { + log.debug("CSV-File will be generated."); + Collection chartResult = this.getChartResult(uuid); + this.createCSV(outputStream, chartResult); + } else if (outputMode.equalsIgnoreCase("statistics")) { + log.debug("Statistics will be generated."); + Statistics s = getStatisticsGenerator(); + Collection chartResult = this.getChartResult(uuid); + Collection parameters = + this.getParameters(uuid); + Collection measurements = + this.getMeasurements(uuid); + Collection dates = + this.getDates(uuid); + Collection statistics = + s.calculateStatistics(chartResult, + parameters, + measurements, + dates); + Document doc = this.writeStatistics2XML(statistics); + this.writeDocument2OutputStream(doc, outputStream); + } else if (outputMode.equalsIgnoreCase("odv")) { + + Collection odvResult = this.getODVResult(uuid); + this.createODV(outputStream, odvResult); + } + } catch (IOException e) { + log.error(e, e); + throw new StateException(e); + } catch (TechnicalChartException e) { + log.error(e, e); + throw new StateException(e); + } catch (StatisticsException e) { + log.error(e, e); + throw new StateException(e); + } + } + + + protected String getExportFormat(String mime) { + for(int i = 0; i < IMG_EXPORT_FORMAT.length; i++) { + if (mime.trim().toUpperCase().indexOf(IMG_EXPORT_FORMAT[i]) > 0) + return IMG_EXPORT_FORMAT[i]; + } + + // no format found relating to mimeType, default export as PNG + return IMG_EXPORT_FORMAT[0]; + } + + + protected Collection getCleanedParameters(Collection parameters) { + Iterator iter = parameters.iterator(); + Collection parameter = new Vector(parameters); + while (iter.hasNext()) { + KeyValueDescibeData data = (KeyValueDescibeData)iter.next(); + if (!data.isSelected()) + parameter.remove(data); + } + + return parameter; + } + + + protected Collection getCleanedParameters(String uuid) { + return getCleanedParameters(getParameters(uuid)); + } + + + protected void createCSV(OutputStream out, Collection results) + throws UnsupportedEncodingException, IOException, StateException + { + Iterator iter = results.iterator(); + Result res = iter.hasNext() ? (Result) iter.next() : null; + + if (res == null) + return; + + Profile profile = null; + int dataid = res.getInteger("DATAID").intValue(); + + // on meshes + if (dataid == 2) { + profile = new DefaultProfile( + TIMESERIES_MESH_CSV_COLUMN_LABEL, + ',', + '"', + '"', + "CSV", + "ISO-8859-1"); + } + + // on timeseries + else { + profile = new DefaultProfile( + TIMESERIES_TIMESERIES_CSV_COLUMN_LABEL, + ',', + '"', + '"', + "CSV", + "ISO-8859-1"); + } + + DefaultExport export = new DefaultExport( + new DefaultDataCollector(TIMESERIES_CSV_PROFILE_COLUMNS)); + export.create(profile, out, results); + } + + + /** + * TODO Result is not used at the moment. Change result with correct data. + */ + protected void createODV(OutputStream outputStream, Collection result) + throws IOException, StateException { + + DefaultExport export = new DefaultExport(new SimpleOdvDataCollector( + TIMESERIES_ODV_PROFILE_NAMES)); + + if (result == null) + log.error("#################### RESULT == NULL #################"); + export.create(TIMESERIES_ODV_PROFILE, outputStream, result); + } + + /** + * @return + */ + protected Statistics getStatisticsGenerator() { + Statistics s = new TimeseriesStatistics(); + return s; + } + + protected void writeDocument2OutputStream(Document document, OutputStream os) { + + try { + TransformerFactory transformerFactory = TransformerFactory + .newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + DOMSource source = new DOMSource(document); + StreamResult result = new StreamResult(os); + transformer.transform(source, result); + } catch (TransformerConfigurationException e) { + log.error(e, e); + } catch (TransformerFactoryConfigurationError e) { + log.error(e, e); + } catch (TransformerException e) { + log.error(e, e); + } + } + + protected Document writeStatistics2XML( Collection statistic) { + ArtifactXMLUtilities xmlUtilities = new ArtifactXMLUtilities(); + Document doc = XMLUtils.newDocument(); + if (statistic != null) { + Node statisticResults = xmlUtilities.createArtifactElement(doc, + "statistics"); + doc.appendChild(statisticResults); + Iterator it = statistic.iterator(); + while (it.hasNext()) { + StatisticSet set = it.next(); + Element setElement = xmlUtilities.createArtifactElement(doc, + "statistic"); + setElement.setAttribute("name", set.getName()); + + Iterator sit = set.getStatistics().iterator(); + while (sit.hasNext()){ + Statistic s = sit.next(); + Element result = xmlUtilities.createArtifactElement(doc, + "statistic-value"); + result.setAttribute("name", s.getKey()); + result.setAttribute("value", s.getStringValue()); + setElement.appendChild(result); + } + statisticResults.appendChild(setElement); + } + + } + return doc; + } + + + protected String getSelectedFeatureName(String uuid) { + Collection values = getCollection(featureValuesName, uuid); + + if (values != null) { + Iterator it = values.iterator(); + + while (it.hasNext()) { + KeyValueDescibeData data = (KeyValueDescibeData) it.next(); + + if (data.isSelected()) { + return data.getValue(); + } + } + } + return null; + } + + + /** + * @param outputStream + * @param parameters + * @param measurements + * @param timeSeriesName + * @param chartStyle + * @param chartLables + * @throws IOException + * @throws TechnicalChartException + */ + protected void createChart( + OutputStream outputStream, + Collection parameters, + Collection measurements, + Collection dates, + ChartLabels chartLables, + CallContext context, + String uuid, + String exportFormat, + Locale locale, + int width, + int height, + boolean linesVisible, + boolean shapesVisible + ) + throws IOException, TechnicalChartException + { + log.debug("Create chart."); + Chart chart = getChart( + chartLables, + createStyle(context), + parameters, + measurements, + dates, + getChartResult(uuid), + locale, // Locale + uuid, + linesVisible, + shapesVisible + ); + + if (chart == null) { + log.error("Could not initialize chart."); + return; + } + + log.debug( + "export chart as " + exportFormat + + " in " + width + "x" + height + ); + + ChartExportHelper.exportImage( + outputStream, + chart.generateChart(), + exportFormat, + width, + height + ); + } + + + protected void createPDF( + OutputStream outputStream, + Collection parameters, + Collection measurements, + Collection dates, + ChartLabels chartLables, + String uuid, + String exportFormat, + boolean landscape, + boolean linesVisible, + boolean shapesVisible, + Locale locale, + CallContext context + ) { + Chart chart = getChart( + chartLables, + createStyle(context), + parameters, + measurements, + dates, + getChartResult(uuid), + locale, + uuid, + linesVisible, + shapesVisible + ); + + if (chart == null) { + log.error("Could not initialize chart."); + return; + } + + ChartExportHelper.exportPDF( + outputStream, + chart.generateChart(), + "A4", + PDF_FORMAT_LANDSCAPE, + 50F, 50F, 50F, 50F + ); + + try { + OutputStream toFile = new FileOutputStream("/vol1/home/iweinzierl/tmp/test.svg"); + ChartExportHelper.exportSVG( + toFile, + chart.generateChart(), + null, + 600, 400 + ); + toFile.flush(); + toFile.close(); + } + catch(Exception e) { log.debug("ERROR WHLILE TEST."); } + } + + + protected void createSVG( + OutputStream outputStream, + Collection parameters, + Collection measurements, + Collection dates, + ChartLabels chartLables, + String uuid, + Locale locale, + int width, + int height, + boolean linesVisible, + boolean shapesVisible, + CallContext callContext + ) { + Chart chart = getChart( + chartLables, + createStyle(callContext), + parameters, + measurements, + dates, + getChartResult(uuid), + locale, + uuid, + linesVisible, + shapesVisible + ); + + if (chart == null) { + log.error("Could not initialize chart."); + return; + } + + ChartExportHelper.exportSVG( + outputStream, + chart.generateChart(), + null, + 600, 400 + ); + + log.debug("svg export finished."); + } + + + protected Chart getChart( + ChartLabels chartLables, + ChartTheme theme, + Collection parameters, + Collection measurements, + Collection dates, + Collection result, + Locale locale, + String uuid, + boolean linesVisible, + boolean shapesVisible + ) { + Chart chart = null; + + if (CACHE_CHART) { + log.info("Try to get timeseries chart from cache."); + chart = (Chart) getChartFromCache(uuid); + } + + if (chart != null) + return chart; + + log.info("Chart not in cache yet."); + chart = new TimeSeriesChart( + chartLables, + theme, + parameters, + measurements, + dates, + result, + timeGapDefinitions, + locale, + linesVisible, + shapesVisible + ); + chart.generateChart(); + + if (CACHE_CHART) { + log.info("Put chart into cache."); + purifyChart(chart, uuid); + } + + return chart; + } + + protected ChartTheme createStyle(CallContext callContext) { + log.debug("Fetch chart theme from global context"); + + GNVArtifactContext context = + (GNVArtifactContext) callContext.globalContext(); + + XMLChartTheme theme = (XMLChartTheme) context.get( + GNVArtifactContextFactory.CHARTTEMPLATE + ); + + return theme; + } + + + protected String createChartTitle(Locale locale, String uuid) { + return getFisName(locale); + + } + + + protected String createChartSubtitle(Locale locale, String uuid) { + return getSelectedFeatureName(uuid); + } + + + protected String getFisName(Locale locale) { + String returnValue = ""; + InputData input = inputData.get("fisname"); + + if (input != null) { + String value = input.getValue(); + + returnValue = RessourceFactory.getInstance().getRessource( + locale, + value, + value + ); + } + return returnValue; + } + + + protected Collection getParameters(String uuid) { + return this.getCollection(parameterValuesName, uuid); + } + + protected Collection getMeasurements(String uuid) { + return this.getCollection(measuremenValueName, uuid); + } + protected Collection getDates(String uuid) { + return this.getCollection(dateValueName,uuid); + } + + @Override + public void setup(Node configuration) { + super.setup(configuration); + String featureNameValue = Config.getStringXPath(configuration, + "value-names/value-name[@name='feature']/@value"); + if (featureNameValue != null) { + this.featureValuesName = featureNameValue; + } + String parameterNameValue = Config.getStringXPath(configuration, + "value-names/value-name[@name='parameter']/@value"); + if (parameterNameValue != null) { + this.parameterValuesName = parameterNameValue; + } + String measurementNameValue = Config.getStringXPath(configuration, + "value-names/value-name[@name='measurement']/@value"); + if (measurementNameValue != null) { + this.measuremenValueName = measurementNameValue; + } + + String dateNameValue = Config.getStringXPath(configuration, + "value-names/value-name[@name='date']/@value"); + if (dateNameValue != null) { + this.dateValueName = dateNameValue; + } + if (timeGapDefinitions == null){ + Element gapDefinition = (Element)Config.getNodeXPath(configuration, + "time-gap-definition"); + synchronized (this.getClass()) { + if (gapDefinition != null){ + String link = gapDefinition.getAttribute("xlink:href"); + if (link != null ){ + String absolutFileName = Config.replaceConfigDir(link); + gapDefinition = (Element)new ArtifactXMLUtilities(). + readConfiguration(absolutFileName); + } + + NodeList gapDefinitions = Config.getNodeSetXPath(gapDefinition, + "/time-gaps/time-gap"); + if (gapDefinition != null){ + timeGapDefinitions = new ArrayList(gapDefinitions. + getLength()); + for (int i = 0; i < gapDefinitions.getLength(); i++){ + Element gapNode = (Element)gapDefinitions.item(i); + String unit = gapNode.getAttribute("unit"); + int key = Integer.parseInt(gapNode.getAttribute("key")); + int value = Integer.parseInt(gapNode.getAttribute("gap")); + log.info("Add new Timegap: "+key+" "+value+" "+ unit); + timeGapDefinitions.add(new DefaultTimeGap(unit, + key, + value)); + } + } + + } + } + } + } + + /** + * @param collectionName + * @return + */ + protected Collection getCollection( + String collectionName, + String uuid) { + Iterator it = this.getDescibeData(uuid).iterator(); + while (it.hasNext()) { + + Object o = it.next(); + + if (o instanceof NamedCollection) { + NamedCollection nc = (NamedCollection) o; + if (nc.getName().equals(collectionName)) { + return nc; + } + } + } + return null; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/statistics/HorizontalProfileStatistics.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/HorizontalProfileStatistics.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,86 @@ +/** + * + */ +package de.intevation.gnv.statistics; + +import java.sql.SQLException; +import java.util.Collection; + +import org.apache.log4j.Logger; + +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.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.utils.DistanceCalculator; + +/** + * @author Tim Englich + * + */ +public class HorizontalProfileStatistics extends TimeseriesStatistics { + + private static Logger log = Logger.getLogger(HorizontalProfileStatistics.class); + + private WKTReader wktReader = new WKTReader(); + + private DistanceCalculator dc = new DistanceCalculator(); + + private double distance = 0; + + /** + * Constructor + */ + public HorizontalProfileStatistics() { + super(); + } + + /** + * @see de.intevation.gnv.statistics.TimeseriesStatistics#calculateXOrdinateValue(de.intevation.gnv.geobackend.base.Result, de.intevation.gnv.geobackend.base.Result) + */ + @Override + protected double calculateXOrdinateValue(Result previousRow,Result row) + throws SQLException { + try { + Point start = (Point)this.wktReader.read(previousRow.getString("SHAPE")); + Point current = (Point)this.wktReader.read(row.getString("SHAPE")); + double delta = this.dc.calculateDistance(start, current); + + if (!Double.isNaN(delta)){ + this.distance = this.distance + delta; + } + } catch (ParseException e) { + log.error(e,e); + } + return this.distance; + } + + /** + * @see de.intevation.gnv.statistics.TimeseriesStatistics#generateStatisticsName(java.lang.String, java.lang.String, java.lang.String, java.util.Collection, java.util.Collection, java.util.Collection) + */ + @Override + protected String generateStatisticsName( + String break1, + String break2, + String break3, + Collection parameters, + Collection measurements, + Collection dates) { + return (this.findValueTitle(parameters, break1)+ " "+ + this.findValueTitle(measurements,break2)).trim()+" "+ + this.findValueTitle(dates,break3); + } + + /** + * @see de.intevation.gnv.statistics.TimeseriesStatistics#clearStatistics() + */ + @Override + protected void clearStatistics() { + log.debug("HorizontalProfileStatistics.clearStatistics"); + super.clearStatistics(); + this.distance = 0; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/statistics/Statistic.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/Statistic.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,61 @@ +/** + * 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 $ + * created by: Stefan Blume (blume) + * erstellt am: 14.12.2007 + * Copyright: con terra GmbH, 2005 + * + * modified by: $Author: blume $ + * modified on: $Date: 2007/12/21 12:31:15 $ + * Version: $Revision: 1.2 $ + * TAG: $Name: $ + * locked from: $Locker: $ + * CVS State: $State: Exp $ + * Project: $ProjectName$ + */ +package de.intevation.gnv.statistics; + +import org.apache.log4j.Logger; + +/** + * The class Statistic fulfills the following purposes: + *
    + *
  1. + *
+ * + * @author blume + * @version 1.0 + * @serial 1.0 + * @see + * @since 14.12.2007 09:38:18 + */ +public class Statistic { + + /** + * Default Logging instance + */ + private static Logger sLogger = Logger.getLogger(Statistic.class); + private static boolean sDebug = sLogger.isDebugEnabled(); + + private double mValue; + private String mKey; + + public Statistic(String pKey, double pValue) { + mKey = pKey; + mValue = pValue; + } + + public double getValue() { + return mValue; + } + + public String getKey() { + return mKey; + } + + public String getStringValue() { + java.text.DecimalFormat df = new java.text.DecimalFormat("#.##"); + return df.format(mValue); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/statistics/StatisticSet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/StatisticSet.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,40 @@ +/** + * + */ +package de.intevation.gnv.statistics; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * @author Tim Englich + * + */ +public class StatisticSet { + + + private String name = null; + + private Collection statistics = new ArrayList(); + + /** + * Constructor + */ + public StatisticSet(String name) { + this.name = name; + } + + + public void addStatistic(Statistic statistic){ + this.statistics.add(statistic); + } + + public Collection getStatistics(){ + return this.statistics; + } + + public String getName(){ + return this.name; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/statistics/Statistics.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/Statistics.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,55 @@ +/** + * 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 $ + * created by: Stefan Blume (blume) + * erstellt am: 14.12.2007 + * Copyright: con terra GmbH, 2005 + * + * modified by: $Author: blume $ + * modified on: $Date: 2008/01/30 12:38:34 $ + * Version: $Revision: 1.2 $ + * TAG: $Name: $ + * locked from: $Locker: $ + * CVS State: $State: Exp $ + * Project: $ProjectName$ + */ +package de.intevation.gnv.statistics; + +import java.util.Collection; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.statistics.exception.StatisticsException; + +/** + * The interface Statistics fulfills the following purposes: + *
    + *
  1. Providng a marker interface for statistics.
  2. + *
+ * + * @author blume + * @version 1.0 + * @serial 1.0 + * @see + * @since 14.12.2007 09:34:32 + */ +public interface Statistics { + + /** + * + * @param resultSet + * @param parameters + * @param measurements + * @param dates + * @return + * @throws StatisticsException + */ + public Collection calculateStatistics( + Collection resultSet, + Collection parameters, + Collection measurements, + Collection dates + ) + throws StatisticsException; + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/TimeseriesStatistics.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,235 @@ +/** + * 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 $ + * created by: Stefan Blume (blume) + * erstellt am: 06.12.2007 + * Copyright: con terra GmbH, 2005 + * + * modified by: $Author: drewnak $ + * modified on: $Date: 2008/08/18 14:50:33 $ + * Version: $Revision: 1.3 $ + * TAG: $Name: $ + * locked from: $Locker: $ + * CVS State: $State: Exp $ + * Project: $ProjectName$ + */ +package de.intevation.gnv.statistics; + +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; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.describedata.KeyValueDescibeData; +import de.intevation.gnv.statistics.exception.StatisticsException; + +/** + * The class TimeseriesStatistics fulfills the following purposes: + *
    + *
  1. + *
+ * + * @author blume + * @author Tim Englich + * @version 1.0 + * @serial 1.0 + * @see + * @since 06.12.2007 18:02:27 + */ +public class TimeseriesStatistics implements Statistics { + + /** + * Default Logging instance + */ + private static Logger log = Logger.getLogger(TimeseriesStatistics.class); + + /** + * Constructor + */ + public TimeseriesStatistics() { + super(); + } + + /** + * @see de.intevation.gnv.statistics.Statistics#calculateStatistics(java.util.Collection, java.util.Collection, java.util.Collection, java.util.Collection) + */ + public Collection calculateStatistics( + Collection resultSet, + Collection parameters, + Collection measurements, + Collection dates + ) + throws StatisticsException { + this.clearStatistics(); + DescriptiveStatistics lStatistics = null; + SimpleRegression lRegression = null; + Collection statisticSets = new ArrayList(); + String break1, break2, break3; + int lSeries = 1; + try { + + Iterator resultIterator = resultSet.iterator(); + if (resultIterator.hasNext()) { + Result row = resultIterator.next(); + Result previousRow = row; + break1 = row.getString("GROUP1"); + break2 = row.getString("GROUP2"); + break3 = row.getString("GROUP3"); + lRegression = new SimpleRegression(); + lStatistics = new DescriptiveStatistics(); + while (resultIterator.hasNext()) { + + if (!break1.equals(row.getString("GROUP1")) + || !break2.equals(row.getString("GROUP2")) + || !break3.equals(row.getString("GROUP3")) + ) { + String statisticsName = this.generateStatisticsName(break1, break2, + break3, parameters, + measurements, dates); + statisticSets.add(this.generateStatisticsValues(lStatistics, + lRegression, + statisticsName)); + + lStatistics.clear(); + lRegression.clear(); + + this.clearStatistics(); + + lStatistics.addValue(row.getDouble("YORDINATE")); + Double x = this.calculateXOrdinateValue(previousRow,row); + lRegression.addData(x, row.getDouble("YORDINATE")); + + break1 = row.getString("GROUP1"); + break2 = row.getString("GROUP2"); + break3 = row.getString("GROUP3"); + previousRow = row; + row = resultIterator.next(); + lSeries++; + } else { + + lStatistics.addValue(row.getDouble("YORDINATE")); + Double x = this.calculateXOrdinateValue(previousRow, row); + lRegression.addData(x, row.getDouble("YORDINATE")); + previousRow = row; + row = resultIterator.next(); + } + + } + + lStatistics.addValue(row.getDouble("YORDINATE")); + Double x = this.calculateXOrdinateValue(previousRow, row); + lRegression.addData(x, row.getDouble("YORDINATE")); + + String statisticsName = this.generateStatisticsName(break1, break2, + break3, parameters, + measurements, dates); + + statisticSets.add(this.generateStatisticsValues(lStatistics, + lRegression, + statisticsName)); + lStatistics.clear(); + lRegression.clear(); + } + } catch (Exception e) { + log.error(e.getMessage(), e); + } + + return statisticSets; + } + + protected void clearStatistics(){} + + /** + * + * @param break1 + * @param break2 + * @param break3 + * @param parameters + * @param measurements + * @param dates + * @return + */ + protected String generateStatisticsName(String break1, + String break2, + String break3, + Collection parameters, + Collection measurements, + Collection dates){ + log.debug("TimeseriesStatistics.generateStatisticsName"); + return this.findValueTitle(parameters,break1)+ " "+ + this.findValueTitle(measurements,break2) + "m"; + } + + + protected String findValueTitle(Collection values, + String id) { + log.debug("TimeseriesStatistics.findValueTitle "+ id); + if (values != null) { + Iterator it = values.iterator(); + while (it.hasNext()) { + KeyValueDescibeData data = it.next(); + if (id.equals(data.getKey())) { + return data.getValue(); + } + } + } + return ""; + } + protected double calculateXOrdinateValue(Result previousRow, Result row) throws SQLException { + return new Double((row.getDate("XORDINATE")).getTime() / 1000 / 3600); + } + + /** + * @param lStatistics + * @param lRegression + * @param lStats + * @param lSeries + */ + private StatisticSet generateStatisticsValues(DescriptiveStatistics lStatistics, + SimpleRegression lRegression, String statisticName) { + + StatisticSet statisticSet = new StatisticSet(statisticName); + + statisticSet.addStatistic(new Statistic( + "gnviewer.statistics.descriptive.arithmeticMean", lStatistics + .getMean())); + statisticSet.addStatistic(new Statistic( + "gnviewer.statistics.descriptive.kurtosis", lStatistics + .getKurtosis())); + statisticSet.addStatistic(new Statistic("gnviewer.statistics.descriptive.max", + lStatistics.getMax())); + statisticSet.addStatistic(new Statistic("gnviewer.statistics.descriptive.min", + lStatistics.getMin())); + statisticSet.addStatistic(new Statistic("gnviewer.statistics.descriptive.n", + lStatistics.getN())); + statisticSet.addStatistic(new Statistic( + "gnviewer.statistics.descriptive.percentile.90", lStatistics + .getPercentile(90))); + statisticSet.addStatistic(new Statistic( + "gnviewer.statistics.descriptive.percentile.75", lStatistics + .getPercentile(75))); + statisticSet.addStatistic(new Statistic( + "gnviewer.statistics.descriptive.percentile.50", lStatistics + .getPercentile(50))); + statisticSet.addStatistic(new Statistic( + "gnviewer.statistics.descriptive.percentile.10", lStatistics + .getPercentile(10))); + statisticSet.addStatistic(new Statistic( + "gnviewer.statistics.descriptive.deviation", lStatistics + .getStandardDeviation())); + statisticSet.addStatistic(new Statistic( + "gnviewer.statistics.descriptive.variance", lStatistics + .getVariance())); + statisticSet.addStatistic(new Statistic( + "gnviewer.statistics.descriptive.intercept", lRegression + .getIntercept())); + statisticSet.addStatistic(new Statistic("gnviewer.statistics.descriptive.slope", + lRegression.getSlope())); + return statisticSet; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/statistics/VerticalProfileStatistics.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/VerticalProfileStatistics.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,45 @@ +/** + * + */ +package de.intevation.gnv.statistics; + +import java.sql.SQLException; +import java.util.Collection; + +import de.intevation.gnv.geobackend.base.Result; +import de.intevation.gnv.state.describedata.KeyValueDescibeData; + +/** + * @author Tim Englich + * + */ +public class VerticalProfileStatistics extends TimeseriesStatistics { + + /** + * Constructor + */ + public VerticalProfileStatistics() { + super(); + } + + @Override + protected double calculateXOrdinateValue(Result previousRow, Result row) throws SQLException { + return row.getDouble("XORDINATE"); + } + + @Override + protected String generateStatisticsName( + String break1, + String break2, + String break3, + Collection parameters, + Collection measurements, + Collection dates) { + + return (this.findValueTitle(parameters, break1)+ " "+ + this.findValueTitle(measurements,break2)).trim(); + } + + + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/statistics/exception/StatisticsException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/statistics/exception/StatisticsException.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,51 @@ +/** + * + */ +package de.intevation.gnv.statistics.exception; + +/** + * @author Tim Englich + * + */ +public class StatisticsException extends Exception { + + /** + * + */ + private static final long serialVersionUID = -7324280565076343394L; + + /** + * Constructor + */ + public StatisticsException() { + } + + /** + * Constructor + * + * @param arg0 + */ + public StatisticsException(String arg0) { + super(arg0); + } + + /** + * Constructor + * + * @param arg0 + */ + public StatisticsException(Throwable arg0) { + super(arg0); + } + + /** + * Constructor + * + * @param arg0 + * @param arg1 + */ + public StatisticsException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/TimeSeriesArtifact.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,57 @@ +/** + * + */ +package de.intevation.gnv.timeseries; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; +import de.intevation.gnv.artifacts.GNVArtifactBase; + +/** + * @author Tim Englich + * + */ +public class TimeSeriesArtifact extends GNVArtifactBase { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(TimeSeriesArtifact.class); + + /** + * The UID of this class + */ + private static final long serialVersionUID = -8291547966693867205L; + + /** + * Constructor + */ + public TimeSeriesArtifact() { + super(); + log.debug("TimeSeriesArtifact.Constructor"); + this.name = "timeSeries"; + } + + /** + * @see de.intevation.artifactdatabase.DefaultArtifact#describe(org.w3c.dom.Document, de.intevation.artifacts.CallContext) + */ + @Override + public Document describe(Document data, CallContext context) { + log.debug("TimeSeriesArtifact.describe"); + return super.createDescibeOutput(context.getMeta(), + super.identifier, + this.getIncludeUIFromDocument(data)); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactBase#setup(java.lang.String, + * de.intevation.artifacts.ArtifactFactory, java.lang.Object) + */ + @Override + public void setup(String identifier, ArtifactFactory factory, Object context) { + log.debug("TimeSeriesArtifact.setup"); + super.setup(identifier, factory, context); + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/TimeSeriesMeshArtifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/TimeSeriesMeshArtifact.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,19 @@ +package de.intevation.gnv.timeseries; + +public class TimeSeriesMeshArtifact extends TimeSeriesArtifact { + + /** + * + */ + private static final long serialVersionUID = 5680432486700275986L; + + /** + * + * Constructor + */ + public TimeSeriesMeshArtifact() { + super(); + super.name = super.name + "Mesh"; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/gap/DefaultTimeGap.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/gap/DefaultTimeGap.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,64 @@ +/** + * + */ +package de.intevation.gnv.timeseries.gap; +/** + * @author Tim Englich + * + */ +public class DefaultTimeGap implements TimeGap{ + + /** + * The UNIT of the TimeGap + * See the Constants in de.intevation.gnv.timeseries.gap.TimeGap + */ + private String unit; + + /** + * The Key of the TimeGap which must be äquivalent to the + * Key used in the DWH + */ + private int key; + + /** + * The Value of the Gap. + * Use the Unit and the Time Constants to Calculate the + * value in Milliseconds + */ + private int value; + + /** + * Constructor + * @param unit + * @param key + * @param value + */ + public DefaultTimeGap(String unit, int key, int value) { + super(); + this.unit = unit; + this.key = key; + this.value = value; + } + + /** + * @see de.intevation.gnv.timeseries.gap.TimeGap#getUnit() + */ + public String getUnit() { + return this.unit; + } + + /** + * @see de.intevation.gnv.timeseries.gap.TimeGap#getKey() + */ + public int getKey() { + return this.key; + } + + /** + * @see de.intevation.gnv.timeseries.gap.TimeGap#getValue() + */ + public int getValue() { + return this.value; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/gap/TimeGap.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/timeseries/gap/TimeGap.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,35 @@ +package de.intevation.gnv.timeseries.gap; +public interface TimeGap { + + public final static String TIME_UNIT_MINUTE = "m"; + public final static String TIME_UNIT_HOUR = "h"; + public final static String TIME_UNIT_DAY = "D"; + public final static String TIME_UNIT_WEEK = "W"; + public final static String TIME_UNIT_MONTH = "M"; + public final static String TIME_UNIT_YEAR = "Y"; + + public final static long MINUTE_IN_MILLIS = 60 * 1000; + public final static long HOUR_IN_MILLIS = 60 * MINUTE_IN_MILLIS; + public final static long DAY_IN_MILLIS = 24 * HOUR_IN_MILLIS; + public final static long WEEK_IN_MILLIS = 7 * DAY_IN_MILLIS; + + + /** + * Returns the Lookup-Key for the TimeGap + * @return + */ + int getKey(); + + /** + * Returns the Value of the TimeValue in the Unit which is also given. + * @return + */ + int getValue(); + + /** + * Returns the Unit of the Timegap (e.g. Minutes, Hours, Days, Weeks, Months, Years) + * @return + */ + String getUnit(); + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/transition/DefaultTransition.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/DefaultTransition.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,33 @@ +/** + * + */ +package de.intevation.gnv.transition; + +import de.intevation.gnv.state.State; + +/** + * @author Tim Englich + * + */ +public class DefaultTransition extends TransitionBase { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = -2610338646743984581L; + + /** + * Constructor + */ + public DefaultTransition() { + super(); + } + + /** + * @see de.intevation.gnv.transition.Transition#isValid(de.intevation.gnv.state.State) + */ + public boolean isValid(State state) { + return true; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/transition/Transition.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/Transition.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,41 @@ +package de.intevation.gnv.transition; + +import java.io.Serializable; + +import org.w3c.dom.Node; + +import de.intevation.gnv.state.State; + +/** + * + * @author Tim Englich + * + */ +public interface Transition extends Serializable{ + + /** + * Returns the ID of the State from which the Transition could be used + * @return the ID of the State from which the Transition could be used + */ + public String getFrom(); + + /** + * Returns the ID of the State where it is possible to go as next. + * @return the ID of the State where it is possible to go as next. + */ + public String getTo(); + + /** + * Determines if it is possible to go along this Transition or not. + * @param state the current State + * @return + */ + public boolean isValid(State state); + + /** + * Configures the Transition. + * @param configuration + */ + public void setup(Node configuration); + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionBase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,52 @@ +/** + * + */ +package de.intevation.gnv.transition; + +import org.w3c.dom.Node; + +import de.intevation.artifactdatabase.Config; + +/** + * @author Tim Englich + * + */ +public abstract class TransitionBase implements Transition { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = -8542097519466477977L; + + private String from = null; + + private String to = null; + /** + * Constructor + */ + public TransitionBase() { + } + + /** + * @see de.intevation.gnv.transition.Transition#getFrom() + */ + public String getFrom() { + return this.from; + } + + /** + * @see de.intevation.gnv.transition.Transition#getTo() + */ + public String getTo() { + return this.to; + } + + /** + * @see de.intevation.gnv.transition.Transition#setup(org.w3c.dom.Node) + */ + public void setup(Node configuration) { + this.from = Config.getStringXPath(configuration,"from/@state"); + this.to = Config.getStringXPath(configuration,"to/@state"); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/TransitionFactory.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,55 @@ +/** + * + */ +package de.intevation.gnv.transition; + +import org.apache.log4j.Logger; +import org.w3c.dom.Node; + +import de.intevation.gnv.artifacts.GNVArtifactBase; + +/** + * @author Tim Englich + * + */ +public class TransitionFactory { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(GNVArtifactBase.class); + + private static TransitionFactory instance = null; + + /** + * Constructor + */ + public TransitionFactory() { + super(); + } + + public static TransitionFactory getInstance() { + if (instance == null) { + instance = new TransitionFactory(); + } + return instance; + } + + public Transition createTransition(Node configuration) { + log.debug("TransitionFactory.createTransition"); + Transition state = null; + try { + String classname = ((org.w3c.dom.Element)configuration).getAttribute("transition"); + state = (Transition) (Class.forName(classname).newInstance()); + state.setup(configuration); + } catch (InstantiationException e) { + log.error(e, e); + } catch (IllegalAccessException e) { + log.error(e, e); + } catch (ClassNotFoundException e) { + log.error(e, e); + } + return state; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/transition/ValueCompareTransition.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/ValueCompareTransition.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,82 @@ +/** + * + */ +package de.intevation.gnv.transition; + +import java.util.Iterator; + +import org.apache.log4j.Logger; +import org.w3c.dom.Node; + +import de.intevation.artifactdatabase.Config; +import de.intevation.gnv.state.InputData; +import de.intevation.gnv.state.State; +import de.intevation.gnv.state.exception.StateException; + +/** + * @author Tim Englich + * + */ +public class ValueCompareTransition extends TransitionBase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(ValueCompareTransition.class); + + private String dataName = null; + private String dataValue = null; + private String operator = null; + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = -7846722158776823205L; + + /** + * Constructor + */ + public ValueCompareTransition() { + super(); + } + + /** + * @see de.intevation.gnv.transition.Transition#isValid(de.intevation.gnv.state.State) + */ + public boolean isValid(State state) { + + try { + Iterator it = state.getInputData().iterator(); + while (it.hasNext()){ + InputData inputData = it.next(); + if (inputData.getName().equals(this.dataName)){ + boolean returnValue = false; + if (operator.equals("equal")){ + returnValue = this.dataValue.equals(inputData.getValue()); + }else if (operator.equals("notequal")){ + returnValue = !this.dataValue.equals(inputData.getValue()); + } + return returnValue; + } + } + if (operator.equals("notequal")){ + // data is not given. So the constraint not Equals is fullfilled. + return true; + } + } catch (StateException e) { + log.error(e,e); + return false; + } + return false; + } + + @Override + public void setup(Node configuration) { + super.setup(configuration); + this.dataName = Config.getStringXPath(configuration,"condition/@inputvalue"); + this.dataValue = Config.getStringXPath(configuration,"condition/@value"); + this.operator = Config.getStringXPath(configuration,"condition/@operator"); + } + + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/utils/ArtifactFactoryUtilities.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/ArtifactFactoryUtilities.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,55 @@ +/** + * + */ +package de.intevation.gnv.utils; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Node; + +import de.intevation.artifacts.ArtifactFactory; + +/** + * @author Tim Englich + * + */ +public class ArtifactFactoryUtilities { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(ArtifactFactoryUtilities.class); + + /** + * Constructor + */ + public ArtifactFactoryUtilities() { + } + + public ArtifactFactory createArtitfactFactor(Document config, + Node artifactFactoryNode) { + String className = artifactFactoryNode.getTextContent(); + + ArtifactFactory factory = null; + + try { + Class clazz = Class.forName(className); + factory = (ArtifactFactory) clazz.newInstance(); + } catch (ClassNotFoundException cnfe) { + log.error(cnfe.getLocalizedMessage(), cnfe); + } catch (InstantiationException ie) { + log.error(ie.getLocalizedMessage(), ie); + } catch (ClassCastException cce) { + log.error(cce.getLocalizedMessage(), cce); + } catch (IllegalAccessException iae) { + log.error(iae.getLocalizedMessage(), iae); + } + + if (factory != null) { + factory.setup(config, artifactFactoryNode); + log.info("Registering '" + factory.getName() + + "' as artifact factory."); + } + return factory; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/ArtifactXMLUtilities.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,162 @@ +/** + * + */ +package de.intevation.gnv.utils; + +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.Serializable; +import java.io.StringWriter; +import java.io.UnsupportedEncodingException; + +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 org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.xml.sax.SAXException; + +import de.intevation.artifacts.ArtifactNamespaceContext; + +/** + * @author Tim Englich + * + */ +public class ArtifactXMLUtilities implements Serializable { + /** + * + */ + private static final long serialVersionUID = -6236340358303411758L; + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(ArtifactXMLUtilities.class); + + public static final String XFORM_URL = "http://www.w3.org/2002/xforms"; + public static final String XFORM_PREFIX = "xform"; + + /** + * Constructor + */ + public ArtifactXMLUtilities() { + } + + /** + * @param document + * @return + */ + public Element createArtifactElement(Document document, String name) { + Element node = document.createElementNS( + ArtifactNamespaceContext.NAMESPACE_URI, name); + node.setPrefix(ArtifactNamespaceContext.NAMESPACE_PREFIX); + return node; + } + + public String writeDocument2String(Document document) { + try { + TransformerFactory transformerFactory = TransformerFactory + .newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + DOMSource source = new DOMSource(document); + StringWriter sw = new StringWriter(); + StreamResult result = new StreamResult(sw); + transformer.transform(source, result); + return sw.getBuffer().toString(); + } catch (TransformerConfigurationException e) { + log.error(e, e); + } catch (TransformerFactoryConfigurationError e) { + log.error(e, e); + } catch (TransformerException e) { + log.error(e, e); + } + return null; + } + + public static Document readDocument(InputStream inputStream) { + Document returnValue = null; + try { + DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory + .newInstance(); + DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); + returnValue = docBuilder.parse(inputStream); + } catch (ParserConfigurationException e) { + log.error(e, e); + } catch (SAXException e) { + log.error(e, e); + } catch (IOException e) { + log.error(e, e); + } + return returnValue; + } + + public Document reInitDocument(Document document) { + try { + byte[] barray = this.writeDocument2String(document).getBytes( + "UTF-8"); + InputStream inputStream = new ByteArrayInputStream(barray); + return this.readDocument(inputStream); + } catch (UnsupportedEncodingException e) { + log.error(e, e); + } + return document; + } + + public Element createXFormElement(Document document, String name) { + Element node = document.createElementNS(XFORM_URL, name); + node.setPrefix(XFORM_PREFIX); + return node; + } + + public Document createExceptionReport(String message, Document document) { + log.debug("ArtifactXMLUtilities.createExceptionReport"); + Element exceptionReportNode = this.createArtifactElement(document, + "exceptionreport"); + document.appendChild(exceptionReportNode); + Element exceptionNode = this.createArtifactElement(document, + "exception"); + exceptionNode.setTextContent(message); + exceptionReportNode.appendChild(exceptionNode); + return document; + } + + public Document createSuccessReport(String message, Document document) { + log.debug("ArtifactXMLUtilities.creatSuccessReport"); + Element reportNode = this.createArtifactElement(document, "result"); + document.appendChild(reportNode); + Element successNode = this.createArtifactElement(document, "success"); + successNode.setTextContent(message); + reportNode.appendChild(successNode); + return document; + } + + public Node readConfiguration(String fileName){ + try { + DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); + factory.setValidating(false); + return factory.newDocumentBuilder().parse(fileName).getChildNodes().item(0); + } catch (SAXException e) { + log.error(e,e); + return null; + } catch (IOException e) { + log.error(e,e); + return null; + } catch (ParserConfigurationException e) { + log.error(e,e); + return null; + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/utils/DistanceCalculator.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/DistanceCalculator.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,84 @@ +/** + * + */ +package de.intevation.gnv.utils; + +import com.vividsolutions.jts.geom.Point; +import com.vividsolutions.jts.geom.Coordinate; + +import java.util.List; + +/** + * @author Tim Englich + * + */ +public class DistanceCalculator { + + private final static double flattening = 1.0 / 298.257233563; + + private final static double earthRadius = 6378137.0 / 1000.0 ; + + /** + * Constructor + */ + public DistanceCalculator() { + } + + public static double calculateDistance(Point p1, Point p2){ + return calculateDistance(p1.getCoordinate(), p2.getCoordinate()); + } + + public static double calculateDistance(Coordinate p1, Coordinate p2){ + double resultValue = 0.0; + + double b1 = p1.y; + double b2 = p2.y; + + double l1 = p1.x; + double l2 = p2.x; + + + double F = (b1 + b2) / 2.0; + double G = (b1 - b2) / 2.0; + double l = (l1 - l2) / 2.0; + + F = (Math.PI / 180.0) * F; + G = (Math.PI / 180.0) * G; + l = (Math.PI / 180.0) * l; + + double S = ((Math.sin(G) * Math.sin(G)) * ((Math.cos(l) * Math.cos(l))))+ + ((Math.cos(F) * Math.cos(F)) * ((Math.sin(l) * Math.sin(l)))); + + double C = ((Math.cos(G) * Math.cos(G)) * ((Math.cos(l) * Math.cos(l))))+ + ((Math.sin(F) * Math.sin(F)) * ((Math.sin(l) * Math.sin(l)))); + + double w = Math.atan(Math.sqrt((S/C))); + + double D = 2.0 * w * earthRadius; + + double R = Math.sqrt((S*C)) / w; + + double H1 = (3.0 * R - 1.0 ) / (2.0 * C); + double H2 = (3.0 * R + 1.0 ) / (2.0 * S); + + resultValue = D * (1 + (flattening * H1 * (Math.sin(F) * Math.sin(F)) * + (Math.cos(G) * Math.cos(G))) - + (flattening * H2 * (Math.cos(F) * Math.cos(F)) * + (Math.sin(G) * Math.sin(G)))); + + return resultValue; + } + + public static final double calculateDistance(List path) { + int N = path.size(); + if (N < 2) { + return 0d; + } + double sum = 0d; + for (int i = 1; i < N; ++i) { + sum += calculateDistance(path.get(i-1), path.get(i)); + } + return sum; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/utils/IndexBuffer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/IndexBuffer.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,169 @@ +package de.intevation.gnv.utils; + +import java.awt.geom.Point2D; + +import java.awt.Point; + +import java.util.List; + +/** + * Create buffers around integer pairs (i_1..n), j_1..n). + * + * @author Sascha L. Teichmann (sascha.teichmann@intevation.de) + */ +public class IndexBuffer +{ + public static final double EPSILON = 1e-6d; + public static final double OFFSET = 1.0d; + + public static final String I_COLUMN = "IPOSITION"; + public static final String J_COLUMN = "JPOSITION"; + + public static final class Segment { + + private Segment next; + + private Point2D.Double n; + private double d1; + private double d2; + + private int iMin; + private int iMax; + + private int jMin; + private int jMax; + + public Segment(Point a, Point b, Segment next) { + + this.next = next; + + iMin = Math.min(a.x, b.x)-1; + iMax = Math.max(a.x, b.x)+1; + + jMin = Math.min(a.y, b.y)-1; + jMax = Math.max(a.y, b.y)+1; + + if (a.x > b.x) { + Point p = a; a = b; b = p; + } + + Point2D.Double p1, p2, p3; + + if (a.y < b.y) { + p1 = new Point2D.Double(a.x - OFFSET, a.y + 1 + OFFSET); + p2 = new Point2D.Double(b.x - OFFSET, b.y + 1 + OFFSET); + p3 = new Point2D.Double(a.x + 1 + OFFSET, a.y - OFFSET); + } + else { + p1 = new Point2D.Double(a.x + 1 + OFFSET, a.y + 1 + OFFSET); + p2 = new Point2D.Double(b.x + 1 + OFFSET, b.y + 1 + OFFSET); + p3 = new Point2D.Double(b.x - OFFSET, b.y - OFFSET); + } + + n = normalize(orthogonal(sub(p1, p2))); + + d1 = dot(n, p1); + d2 = dot(n, p3); + + if (d1 > d2) { + double d = d1; + d1 = d2; + d2 = d; + } + } + + public boolean check(int i, int j) { + if (i < iMin || i > iMax || j < jMin || j > jMax) { + return false; + } + double v = dot(n, i, j); + return v >= d1 && v <= d2; + } + + public void toWhereClause(StringBuilder sb, String iColumn, String jColumn) { + sb.append('(') + .append(iColumn).append(" >= ").append(iMin).append(" AND ") + .append(iColumn).append(" <= ").append(iMax).append(" AND ") + .append(jColumn).append(" >= ").append(jMin).append(" AND ") + .append(jColumn).append(" <= ").append(jMax).append(" AND (") + .append(n.x).append('*').append(iColumn).append(" + ") + .append(n.y).append('*').append(jColumn) + .append(") BETWEEN ").append(d1).append(" AND ").append(d2).append(')'); + } + } // class Segment + + protected Segment head; + + protected String iColumn; + protected String jColumn; + + public IndexBuffer(List points) { + this(points, I_COLUMN, J_COLUMN); + } + + public IndexBuffer(List points, String iColumn, String jColumn) { + this.iColumn = iColumn; + this.jColumn = jColumn; + + for (int i = 1, N = points.size(); i < N; ++i) { + Point p1 = (Point)points.get(i-1); + Point p2 = (Point)points.get(i); + head = new Segment(p1, p2, head); + } + } + + public boolean check(int i, int j) { + + Segment current = head; + while (current != null) { + if (current.check(i, j)) { + return true; + } + current = current.next; + } + return false; + } + + public String toWhereClause() { + + StringBuilder sb = new StringBuilder(); + + Segment current = head; + + while (current != null) { + if (current != head) { + sb.append(" OR "); + } + current.toWhereClause(sb, iColumn, jColumn); + current = current.next; + } + + return sb.toString(); + } + + public static Point2D.Double sub(Point2D.Double p1, Point2D.Double p2) { + return new Point2D.Double(p1.x - p2.x, p1.y - p2.y); + } + + public static final double dot(Point2D.Double p1, Point2D.Double p2) { + return p1.x*p2.x + p1.y*p2.y; + } + + public static final double dot(Point2D.Double p1, double x, double y) { + return p1.x*x + p1.y*y; + } + + public static final Point2D.Double scale(Point2D.Double p, double s) { + return new Point2D.Double(s*p.x, s*p.y); + } + + public static final Point2D.Double normalize(Point2D.Double p) { + double len2 = Math.sqrt(dot(p, p)); + return len2 > EPSILON ? scale(p, 1d/len2) : p; + } + + public static final Point2D.Double orthogonal(Point2D.Double p) { + return new Point2D.Double(p.y, -p.x); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/InputValidator.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,154 @@ +/** + * + */ +package de.intevation.gnv.utils; + +import java.util.Date; + +import org.apache.commons.validator.GenericValidator; +import org.apache.log4j.Logger; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.vividsolutions.jts.geom.Point; + +import de.intevation.gnv.geobackend.util.DateUtils; +import de.intevation.gnv.utils.exception.ValidationException; + +/** + * @author Tim Englich + * + */ +public class InputValidator { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(InputValidator.class); + + + public final static String NODATASELECTEDVALUE = "n/n"; + + /** + * Constructor + */ + public InputValidator() { + super(); + } + + public boolean isInputValid(String minInput, String maxInput, String type) { + log.debug("InputValidator.isInputValid " + minInput + " " + maxInput + " " +type); + boolean returnValue = false; + if ("Date".equalsIgnoreCase(type)) { + try { + Date min = DateUtils.getDateFromString(minInput,DateUtils.DATE_PATTERN); + Date max = DateUtils.getDateFromString(maxInput,DateUtils.DATE_PATTERN); + int value = max.compareTo(min); + returnValue = value >= 0; + } catch (Exception e) { + log.error(e,e); + } + } else if ("Double".equalsIgnoreCase(type)) { + try { + double min = Double.parseDouble(minInput); + double max = Double.parseDouble(maxInput); + returnValue = max >= min; + } catch (Exception e) { + log.error(e,e); + } + } + log.debug("Is valid? " + returnValue); + return returnValue; + } + + public boolean isInputValid(String input, String type) { + log.debug("InputValidator.isInputValid " + input + " " + type); + boolean returnValue = false; + String[] values = input.split(","); + for (int i = 0; i < values.length; i++) { + boolean valid; + + if (NODATASELECTEDVALUE.equals(values[i].trim())){ + valid = true; + } else if ("Integer".equalsIgnoreCase(type)) { + valid = GenericValidator.isInt(values[i].trim()); + } else if ("Double".equalsIgnoreCase(type)) { + valid = GenericValidator.isDouble(values[i].trim()); + } else if ("String".equalsIgnoreCase(type)) { + valid = GenericValidator.matchRegexp(values[i], "[a-zA-Z0-9]"); // TODO: + // FIXME: + // VALIDATE + // REGEXP + } else if ("Date".equalsIgnoreCase(type)) { + valid = GenericValidator.isDate(values[i].trim(), + DateUtils.DATE_PATTERN, true); + } else if ("Point".equalsIgnoreCase(type)) { + valid = GenericValidator.matchRegexp(values[i], "[0-9]"); // TODO: + // FIXME: + // VALIDATE + // REGEXP + } else if ("AttributeName".equalsIgnoreCase(type)) { + valid = org.apache.commons.validator.GenericValidator + .matchRegexp(values[i], "[a-zA-Z0-9]"); // TODO: FIXME: + // VALIDATE + // REGEXP + } else if ("Coordinate".equalsIgnoreCase(type)) { + try { + valid = this.getPointValue(values[i]) != null; + } catch (ValidationException e) { + log.debug(e.getMessage()); + valid = false; + } + } else { + valid = false; + } + if (!valid) { + returnValue = false; + break; + } else { + returnValue = true; + } + } + log.debug("Is valid? " + returnValue); + return returnValue; + } + + + public Point getPointValue(String value) throws ValidationException{ + log.debug("InputValidator.getPointValue " + value); + String[] s, p; + + double x=0,y=0; + log.info("Position :"+value); + s = value.split(" "); + if (s.length != 2) { + throw new ValidationException("Kein Blank separiert Breite und Länge"); + } + p = s[0].split("[nNsS]"); + try { + if (p.length == 1) + y = new Double(p[0]); + else + y = new Double(p[0]) + new Double(p[1]) / new Double(60.); + if (s[0].toLowerCase().contains("s")) + y = -y; + } + catch (Exception e) { + throw new ValidationException("Kein N|S oder nicht im ersten Substring, zB 56n42"); + + } + p = s[1].split("[eEwW]"); + try { + if (p.length ==1) + x = new Double(p[0]); + else + x = new Double(p[0]) + new Double(p[1]) / new Double(60.) ; + if (s[1].toLowerCase().contains("w")) + x = -x; + } + catch (Exception e) { + throw new ValidationException("Kein E|W oder nicht im zweiten Substring"); + } + return new GeometryFactory().createPoint(new Coordinate(x,y)); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/java/de/intevation/gnv/utils/exception/ValidationException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/java/de/intevation/gnv/utils/exception/ValidationException.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,48 @@ +/** + * + */ +package de.intevation.gnv.utils.exception; +/** + * @author Tim Englich + * + */ +public class ValidationException extends Exception { + + /** + * The Uid of this Class + */ + private static final long serialVersionUID = -6189218101861801079L; + + /** + * Constructor + */ + public ValidationException() { + super(); + } + + /** + * Constructor + * @param arg0 + */ + public ValidationException(String arg0) { + super(arg0); + } + + /** + * Constructor + * @param arg0 + */ + public ValidationException(Throwable arg0) { + super(arg0); + } + + /** + * Constructor + * @param arg0 + * @param arg1 + */ + public ValidationException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/resources/lang/artifactMessages.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages.properties Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,59 @@ +fis_marnet = Marnet +fis_imis = IMIS +fis_staun = STAUN +fis_modeldata = Modeldata +fis_delphin = Delphin +fis_thermosalinograph = Thermosalinograph +fis_chemusurvey = Chemusurvey +fis_gts = GTS +fis_bsh_ctd = CTD +fis_bsh_xbt = XBT +fis_eisklimatologie = Eisklimatologie +fis_sst = SST +fis_seastate = Sea State +fis_seacat = SeaCat +fis_currentmeter = Current Meter +fis_icestations = Ice Station Report + +meshid= Mesh +product= Product +timeSeries= Timeseries +verticalProfile = Verticalprofile +horizontalProfile = Horizontalprofile +horizontalProfileCross = Horizontales Schnittprofil +horizontalCrossSection = Horizontal cross-section +verticalcrosssection = Vertical cross-section +featureid = Station +mesh_coordinate = Geographic position (e.g. 56n30 6e20) +mesh_linestring = Line (WKT) +mesh_point = Mesh Point +measurementid = Measurement depth/height [m] +depthrange = Measurementarea depth/height [m] +mindepthid = Deepest Layer +maxdepthid = Highest Layer +parameterid = Parameter +timeinterval = Time period +minvalue = from +maxvalue = to +dateid = Measurement date +vehicleid = Ship +cruiseid = Cruise +trackid = Track +seriesid = Series +surveyid = Survey Info +axisid = Axis +depthid = Layer and Depth range [m] +iposition = I-Axis +jposition = J-Axis +instantaneouspoint_point = Momentanmesspunkt +areaid=Area +subareaid=Subarea +depth=depth +coordinate=coordinate + +chart.timeseries.date.format=yyyy-MMM-dd +chart.timeseries.title.xaxis=Time [UTC] +chart.verticalprofile.title.xaxis=Depth [m] +chart.verticalcrosssection.title.xaxis=Depth [m] +chart.horizontalprofile.title.xaxis=Distance [km] +chart.horizontalcrosssection.title.xaxis=Latitude [m] diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/resources/lang/artifactMessages_de.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages_de.properties Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,59 @@ +fis_marnet = Marnet +fis_imis = IMIS +fis_staun = STAUN +fis_modeldata = Modelldaten +fis_delphin = Delphin +fis_thermosalinograph = Thermosalinograph +fis_chemusurvey = Chemusurvey +fis_gts = GTS +fis_bsh_ctd = CTD +fis_bsh_xbt = XBT +fis_eisklimatologie = Eisklimatologie +fis_sst = SST +fis_seastate = Seegangsarchiv +fis_seacat = SeaCat +fis_currentmeter = Strommesser +fis_icestations = Eismeldungen + +product= Produkt +timeSeries= Zeitserie +verticalProfile = Vertikalprofil +horizontalProfile = Horizontalprofil +horizontalProfileCross = Horizontales Schnittprofil +horizontalCrossSection = Horizontalschnitt +verticalcrosssection = Profilschnitt +featureid = Station +meshid= Datengitter +mesh_coordinate = Geographische Position (z.B. 56n30 6e20) +mesh_linestring = Linienzug als WKT +mesh_point = Gitterzelle/Knotenpunkt +measurementid = Messung Tiefe/Höhe [m] +depthrange = Messbereich Tiefe/Höhe [m] +mindepthid = Untere Grenzschicht +maxdepthid = Obere Grenzschicht +parameterid = Parameter +timeinterval = Zeitfenster +minvalue = von +maxvalue = bis +dateid = Zeitpunkt +vehicleid = Schiff +cruiseid = Reise +trackid = Track +seriesid = Mess-Serie +surveyid = Messabschnitt +axisid = Achse +depthid = Ebene und Tiefenbereich [m] +iposition = I-Achse +jposition = J-Achse +instantaneouspoint_point = Messpunkt +areaid=Gebiet +subareaid=Teilgebiet +depth=Tiefe +coordinate=Koordinate + +chart.timeseries.date.format=dd-MMM-yyyy +chart.timeseries.title.xaxis=Zeit [UTC] +chart.verticalprofile.title.xaxis=Tiefe [m] +chart.verticalcrosssection.title.xaxis=Tiefe [m] +chart.horizontalprofile.title.xaxis=Distanz [km] +chart.horizontalcrosssection.title.xaxis=Ausdehnung [m] diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/resources/lang/artifactMessages_de_DE.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages_de_DE.properties Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,59 @@ +fis_marnet = Marnet +fis_imis = IMIS +fis_staun = STAUN +fis_modeldata = Modelldaten +fis_delphin = Delphin +fis_thermosalinograph = Thermosalinograph +fis_chemusurvey = Chemusurvey +fis_gts = GTS +fis_bsh_ctd = CTD +fis_bsh_xbt = XBT +fis_eisklimatologie = Eisklimatologie +fis_sst = SST +fis_seastate = Seegangsarchiv +fis_seacat = SeaCat +fis_currentmeter = Strommesser +fis_icestations = Eismeldungen + +product= Produkt +timeSeries= Zeitserie +verticalProfile = Vertikalprofil +horizontalProfile = Horizontalprofil +horizontalProfileCross = Horizontales Schnittprofil +horizontalCrossSection = Horizontalschnitt +verticalcrosssection = Profilschnitt +featureid = Station +meshid= Datengitter +mesh_coordinate = Geographische Position (z.B. 56n30 6e20) +mesh_linestring = Linienzug als WKT +mesh_point = Gitterzelle/Knotenpunkt +measurementid = Messung Tiefe/Höhe [m] +depthrange = Messbereich Tiefe/Höhe [m] +mindepthid = Untere Grenzschicht +maxdepthid = Obere Grenzschicht +parameterid = Parameter +timeinterval = Zeitfenster +minvalue = von +maxvalue = bis +dateid = Zeitpunkt +vehicleid = Schiff +cruiseid = Reise +trackid = Track +seriesid = Mess-Serie +surveyid = Messabschnitt +axisid = Achse +depthid = Ebene und Tiefenbereich [m] +iposition = I-Achse +jposition = J-Achse +instantaneouspoint_point = Messpunkt +areaid=Gebiet +subareaid=Teilgebiet +depth=Tiefe +coordinate=Koordinate + +chart.timeseries.date.format=dd-MMM-yyyy +chart.timeseries.title.xaxis=Zeit [UTC] +chart.verticalprofile.title.xaxis=Tiefe [m] +chart.verticalcrosssection.title.xaxis=Tiefe [m] +chart.horizontalprofile.title.xaxis=Distanz [km] +chart.horizontalcrosssection.title.xaxis=Ausdehnung [m] diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/resources/lang/artifactMessages_en.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/resources/lang/artifactMessages_en.properties Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,60 @@ +fis_marnet = Marnet +fis_imis = IMIS +fis_staun = STAUN +fis_modeldata = Modeldata +fis_delphin = Delphin +fis_thermosalinograph = Thermosalinograph +fis_chemusurvey = Chemusurvey +fis_gts = GTS +fis_bsh_ctd = CTD +fis_bsh_xbt = XBT +fis_eisklimatologie = Iceclimatology +fis_sst = SST +fis_seastate = Sea State +fis_seacat = SeaCat +fis_currentmeter = Current Meter +fis_icestations = Ice Station Report + +meshid= Mesh +product= Product +timeSeries= Timeseries +verticalProfile = Verticalprofile +horizontalProfile = Horizontalprofile +horizontalProfileCross = Horizontales Schnittprofil +horizontalCrossSection = Horizontal cross-section +verticalcrosssection = Vertical cross-section +featureid = Station +mesh_coordinate = Geographic position (e.g. 56n30 6e20) +mesh_linestring = Line (WKT) +mesh_point = Mesh Point +measurementid = Measurement depth/height [m] +depthrange = Measurementarea depth/height [m] +mindepthid = Deepest Layer +maxdepthid = Highest Layer +parameterid = Parameter +timeinterval = Time period +minvalue = from +maxvalue = to +dateid = Measurement date +vehicleid = Ship +cruiseid = Cruise +trackid = Track +seriesid = Series +surveyid = Survey Info +axisid = Axis +depthid = Layer and Depth range [m] +iposition = I-Axis +jposition = J-Axis +instantaneouspoint_point = Instantaneouspoint +areaid=Area +subareaid=Subarea +depth=depth +coordinate=coordinate + + +chart.timeseries.date.format=yyyy-MMM-dd +chart.timeseries.title.xaxis=Time [UTC] +chart.verticalprofile.title.xaxis=Depth [m] +chart.verticalcrosssection.title.xaxis=Depth [m] +chart.horizontalprofile.title.xaxis=Distance [km] +chart.horizontalcrosssection.title.xaxis=Latitude [m] diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/main/resources/lang/lang.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/main/resources/lang/lang.conf Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,3 @@ +de_DE +de +en diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCaseBase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/GNVArtifactsTestCaseBase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,176 @@ +/** + * + */ +package de.intevation.gnv.artifacts; + +import java.io.ByteArrayInputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; + +import javax.xml.parsers.DocumentBuilder; +import javax.xml.parsers.DocumentBuilderFactory; +import javax.xml.parsers.ParserConfigurationException; + +import junit.framework.TestCase; + +import org.apache.log4j.BasicConfigurator; +import org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.xml.sax.SAXException; + +import de.intevation.artifactdatabase.Config; +import de.intevation.artifactdatabase.DefaultCallMeta; +import de.intevation.artifactdatabase.DefaultPreferredLocale; +import de.intevation.artifactdatabase.FactoryBootstrap; +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; +import de.intevation.artifacts.CallMeta; +import de.intevation.artifacts.PreferredLocale; +import de.intevation.gnv.utils.ArtifactXMLUtilities; + +/** + * @author Tim Englich + * + */ +public abstract class GNVArtifactsTestCaseBase extends TestCase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = null; + + static { + BasicConfigurator.configure(); + log = Logger.getLogger(GNVArtifactsTestCaseBase.class); + } + + private String configurationDir = "doc/conf"; + + protected FactoryBootstrap bootstrap = null; + + /** + * Constructor + */ + public GNVArtifactsTestCaseBase() { + } + + /** + * Constructor + * @param name + */ + public GNVArtifactsTestCaseBase(String name) { + super(name); + } + + public abstract void testArtifact(); + /** + * @see junit.framework.TestCase#setUp() + */ + protected void setUp() throws Exception { + log.debug("GNVArtifactsTestCase.setUp"); + super.setUp(); + log.info(Config.CONFIG_DIR + " ==> " + configurationDir); + System.setProperty(Config.CONFIG_DIR, configurationDir); + log.info("Bootstrap wird initialisiert."); + bootstrap = new FactoryBootstrap(); + bootstrap.boot(); + } + + protected void writeDocument2Log(Document document) { + log.debug(new ArtifactXMLUtilities().writeDocument2String(document)); + } + + protected Document readDocument(String fileName) { + Document returnValue = null; + try { + DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory + .newInstance(); + DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); + returnValue = docBuilder.parse(new File(fileName)); + } catch (ParserConfigurationException e) { + log.error(e, e); + } catch (SAXException e) { + log.error(e, e); + } catch (IOException e) { + log.error(e, e); + } + return returnValue; + } + + protected void check4ExceptionReport(Document document) throws Exception { + document = new ArtifactXMLUtilities().reInitDocument(document); + String message = Config.getStringXPath(document, + "/exceptionreport/exception"); + if (message != null) { + throw new Exception(message); + } + } + + /** + * @return + */ + protected CallContext createCallContext() { + CallMeta callMeta = new DefaultCallMeta( + new PreferredLocale[] { new DefaultPreferredLocale("de_DE", + 1.0f) }); + CallContext cc = new TestCallContext(bootstrap.getContext(), callMeta); + return cc; + } + + /** + * @param artifact + * @param cc + * @param describeDocument TODO + * @throws Exception + */ + protected void doNextStep(Artifact artifact, CallContext cc, + String feedDocument, String advanceDocument, Document describeDocument) + throws Exception { + Document outputData = artifact.describe(describeDocument,cc); +// this.writeDocument2Log(outputData); + outputData = artifact.feed(this.readDocument(feedDocument), cc); + this.check4ExceptionReport(outputData); + outputData = artifact.advance(this.readDocument(advanceDocument), cc); +// this.writeDocument2Log(outputData); + this.check4ExceptionReport(outputData); + + } + + protected void createFile(byte[] content, String fileName) { + try { + FileOutputStream fos = new FileOutputStream(new File(fileName)); + ByteArrayInputStream bis = new ByteArrayInputStream(content); + byte[] buf = new byte[4096]; + while (bis.read(buf) > 0) { + fos.write(buf); + } + fos.flush(); + fos.close(); + } catch (FileNotFoundException e) { + log.error(e, e); + } catch (IOException e) { + log.error(e, e); + } + } + + /** + * @param artefactName + */ + protected ArtifactFactory getArtifactFactory(String artefactName) { + log.debug("GNVArtifactsTestCase.getArtifactFactory"); + ArtifactFactory[] artifactFactories = bootstrap.getArtifactFactories(); + for (int i = 0; i < artifactFactories.length; i++) { + if (artifactFactories[i].getName().equals(artefactName)) { + log.debug("ArtifactFactory wurde gefunden."); + return artifactFactories[i]; + } + } + return null; + } + + + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/InstantaneousPointHorizontalProfileTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/InstantaneousPointHorizontalProfileTestCase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,128 @@ +/** + * + */ +package de.intevation.gnv.artifacts; + +import java.io.FileOutputStream; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; + +/** + * @author Tim Englich + * + */ +public class InstantaneousPointHorizontalProfileTestCase extends + GNVArtifactsTestCaseBase { + + private static Logger log = Logger.getLogger(InstantaneousPointHorizontalProfileTestCase.class); + + /** + * Constructor + */ + public InstantaneousPointHorizontalProfileTestCase() { + } + + /** + * Constructor + * @param name + */ + public InstantaneousPointHorizontalProfileTestCase(String name) { + super(name); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactsTestCaseBase#testArtifact() + */ + @Override + public void testArtifact() { + try { + log.debug("GNVArtifactsTestCase." + + "testHorizontalProfileInstantaneousPointArtifact"); + String artefactName = "fis_delphin"; + ArtifactFactory artifactFactory = this + .getArtifactFactory(artefactName); + assertNotNull(artifactFactory); + log.debug("VerticalProfile-ArtifactFactory is available"); + Artifact artifact = artifactFactory.createArtifact( + "" + System.currentTimeMillis(), bootstrap.getContext()); + assertNotNull(artifact); + log.debug("VerticalProfile-Artifact is available"); + + CallContext cc = createCallContext(); + Document describeDocument = this.readDocument("src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_describe.xml"); + + int steps = 9; + + for (int i = 0; i < steps; i++){ + + this.doNextStep( + artifact, + cc, + "src/test/ressources/horizontalProfile_instantaneouspoint/" + + "horizontalprofile_step_0"+i+"_feed.xml", + "src/test/ressources/horizontalProfile_instantaneouspoint/" + + "horizontalprofile_step_0"+i+"_advance.xml", + describeDocument); + } + + Document outputData = artifact.describe(describeDocument, cc); + FileOutputStream fos = null; + FileOutputStream fos2 = null; + FileOutputStream fos3 = null; + FileOutputStream fos4 = null; + try { + fos = new FileOutputStream( + "src/test/results/horizontalprofile_instantaneouspoint" + + System.currentTimeMillis() + ".png"); + fos2 = new FileOutputStream( + "src/test/results/horizontalprofile_instantaneouspoint" + + System.currentTimeMillis() + ".xml"); + fos3 = new FileOutputStream( + "src/test/results/horizontalprofile_instantaneouspoint" + + System.currentTimeMillis() + ".csv"); + fos4 = new FileOutputStream( + "src/test/results/horizontalprofile_instantaneouspoint" + + System.currentTimeMillis() + ".odv"); + artifact.out(this.readDocument("src/test/ressources/" + + "horizontalProfile_instantaneouspoint/" + + "horizontalprofile_step_08_out_statistics.xml"), + fos2,cc); + artifact.out(this.readDocument("src/test/ressources/" + + "horizontalProfile_instantaneouspoint/" + + "horizontalprofile_step_08_out_chart.xml"), + fos,cc); + artifact.out(this.readDocument("src/test/ressources/" + + "horizontalProfile_instantaneouspoint/" + + "horizontalprofile_step_08_out_csv.xml"), + fos3,cc); + artifact.out(this.readDocument("src/test/ressources/" + + "horizontalProfile_instantaneouspoint/" + + "horizontalprofile_step_08_out_odv.xml"), + fos4,cc); + } catch (Exception e) { + log.error(e, e); + fail(); + } finally { + try { + fos.flush(); + fos.close(); + fos2.flush(); + fos2.close(); + fos3.flush(); + fos3.close(); + } catch (Exception e) { + log.error(e, e); + } + } + } catch (Exception e) { + log.error(e, e); + fail(); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/InstantaneousPointVerticalProfileTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/InstantaneousPointVerticalProfileTestCase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,127 @@ +/** + * + */ +package de.intevation.gnv.artifacts; + +import java.io.FileOutputStream; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; + +/** + * @author Tim Englich + * + */ +public class InstantaneousPointVerticalProfileTestCase extends + GNVArtifactsTestCaseBase { + + private static Logger log = Logger.getLogger(InstantaneousPointVerticalProfileTestCase.class); + + /** + * Constructor + */ + public InstantaneousPointVerticalProfileTestCase() { + } + + /** + * Constructor + * @param name + */ + public InstantaneousPointVerticalProfileTestCase(String name) { + super(name); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactsTestCaseBase#testArtifact() + */ + @Override + public void testArtifact() { + try { + log.debug("GNVArtifactsTestCase.testVerticalProfileArtifact"); + String artefactName = "fis_bsh_ctd"; + ArtifactFactory artifactFactory = this + .getArtifactFactory(artefactName); + assertNotNull(artifactFactory); + log.debug("VerticalProfile-ArtifactFactory is available"); + Artifact artifact = artifactFactory.createArtifact( + "" + System.currentTimeMillis(), bootstrap.getContext()); + assertNotNull(artifact); + log.debug("VerticalProfile-Artifact is available"); + + CallContext cc = createCallContext(); + Document describeDocument = this.readDocument("src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_describe.xml"); + + int steps = 5; + + for (int i = 1; i <= steps; i++){ + this.doNextStep( + artifact, + cc, + "src/test/ressources/verticalprofile_instantaneouspoint/" + + "verticalprofile_step_0"+i+"_feed.xml", + "src/test/ressources/verticalprofile_instantaneouspoint/" + + "verticalprofile_step_0"+i+"_advance.xml", + describeDocument); + } + + // Vierter Schritt + Document outputData = artifact.describe(describeDocument,cc); + FileOutputStream fos = null; + FileOutputStream fos2 = null; + FileOutputStream fos3 = null; + FileOutputStream fos4 = null; + try { + fos = new FileOutputStream( + "src/test/results/verticalprofile_instantaneouspoint" + + System.currentTimeMillis() + ".png"); + fos2 = new FileOutputStream( + "src/test/results/verticalprofile_instantaneouspoint" + + System.currentTimeMillis() + ".xml"); + fos3 = new FileOutputStream( + "src/test/results/verticalprofile_instantaneouspoint" + + System.currentTimeMillis() + ".csv"); + fos4 = new FileOutputStream( + "src/test/results/verticalprofile_instantaneouspoint" + + System.currentTimeMillis() + ".odv"); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalprofile_instantaneouspoint/" + + "verticalprofile_step_05_out_statistics.xml"), + fos2, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalprofile_instantaneouspoint/" + + "verticalprofile_step_05_out_chart.xml"), + fos, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalprofile_instantaneouspoint/" + + "verticalprofile_step_05_out_csv.xml"), + fos3, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalprofile_instantaneouspoint/" + + "verticalprofile_step_05_out_odv.xml"), + fos4, cc); + } catch (Exception e) { + log.error(e, e); + fail(); + } finally { + try { + fos.flush(); + fos.close(); + fos2.flush(); + fos2.close(); + fos3.flush(); + fos3.close(); + } catch (Exception e) { + log.error(e, e); + } + } + } catch (Exception e) { + log.error(e, e); + fail(); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshHorizontalCrossSectionTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshHorizontalCrossSectionTestCase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,118 @@ +/** + * + */ +package de.intevation.gnv.artifacts; + +import java.io.FileOutputStream; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; + +/** + * @author Tim Englich + * + */ +public class MeshHorizontalCrossSectionTestCase extends + GNVArtifactsTestCaseBase { + + private static Logger log = Logger.getLogger(MeshHorizontalCrossSectionTestCase.class); + + /** + * Constructor + */ + public MeshHorizontalCrossSectionTestCase() { + } + + /** + * Constructor + * @param name + */ + public MeshHorizontalCrossSectionTestCase(String name) { + super(name); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactsTestCaseBase#testArtifact() + */ + @Override + public void testArtifact() { + try { + log.debug("GNVArtifactsTestCase.testHorizontalCrossSectionMeshArtifact"); + String artefactName = "fis_modeldata"; + ArtifactFactory artifactFactory = this + .getArtifactFactory(artefactName); + assertNotNull(artifactFactory); + log.debug("HorizontalCrossSectionMesh-ArtifactFactory is available"); + Artifact artifact = artifactFactory.createArtifact( + "" + System.currentTimeMillis(), bootstrap.getContext()); + assertNotNull(artifact); + log.debug("HorizontalCrossSectionMesh-Artifact is available"); + + CallContext cc = createCallContext(); + Document describeDocument = this.readDocument("src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_describe.xml"); + int steps = 6; + + for (int i = 1; i <= steps; i++){ + this.doNextStep( + artifact, + cc, + "src/test/ressources/horizontalcrosssection_mesh/" + + "horizontalcrosssection_step_0"+i+"_feed.xml", + "src/test/ressources/horizontalcrosssection_mesh/" + + "horizontalcrosssection_step_0"+i+"_advance.xml", + describeDocument); + } + + Document outputData = artifact.describe(describeDocument,cc); + FileOutputStream fos = null; + FileOutputStream fos2 = null; + FileOutputStream fos3 = null; + try { + fos = new FileOutputStream( + "src/test/results/horizontalcrosssection_mesh" + + System.currentTimeMillis() + ".png"); + + fos2 = new FileOutputStream( + "src/test/results/horizontalcrosssection_mesh" + + System.currentTimeMillis() + ".csv"); + fos3 = new FileOutputStream( + "src/test/results/horizontalcrosssection_mesh" + + System.currentTimeMillis() + ".odv"); + artifact.out(this.readDocument("src/test/ressources/" + + "horizontalcrosssection_mesh/" + + "horizontalcrosssection_step_06_out_chart.xml"), + fos, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "horizontalcrosssection_mesh/" + + "horizontalcrosssection_step_06_out_csv.xml"), + fos2,cc); + artifact.out(this.readDocument("src/test/ressources/" + + "horizontalcrosssection_mesh/" + + "horizontalcrosssection_step_06_out_odv.xml"), + fos3,cc); + } catch (Exception e) { + log.error(e, e); + fail(); + } finally { + try { + fos.flush(); + fos.close(); + fos2.flush(); + fos2.close(); + fos3.flush(); + fos3.close(); + } catch (Exception e) { + log.error(e, e); + } + } + } catch (Exception e) { + log.error(e, e); + fail(); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshHorizontalProfileTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshHorizontalProfileTestCase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,132 @@ +/** + * + */ +package de.intevation.gnv.artifacts; + +import java.io.FileOutputStream; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; + +/** + * @author Tim Englich + * + */ +public class MeshHorizontalProfileTestCase extends GNVArtifactsTestCaseBase { + + private static Logger log = Logger.getLogger(MeshHorizontalProfileTestCase.class); + + /** + * Constructor + */ + public MeshHorizontalProfileTestCase() { + } + + /** + * Constructor + * @param name + */ + public MeshHorizontalProfileTestCase(String name) { + super(name); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactsTestCaseBase#testArtifact() + */ + @Override + public void testArtifact() { + try { + log.debug("GNVArtifactsTestCase." + + "testHorizontalProfileInstantaneousPointArtifact"); + String artefactName = "fis_modeldata"; + ArtifactFactory artifactFactory = this + .getArtifactFactory(artefactName); + assertNotNull(artifactFactory); + log.debug("VerticalProfile-ArtifactFactory is available"); + Artifact artifact = artifactFactory.createArtifact( + "" + System.currentTimeMillis(), bootstrap.getContext()); + assertNotNull(artifact); + log.debug("VerticalProfile-Artifact is available"); + + CallContext cc = createCallContext(); + Document describeDocument = this.readDocument("src/test/ressources/horizontalProfile_mesh/horizontalprofile_describe.xml"); + + int steps = 10; + + for (int i = 1; i <= steps; i++){ + String number = ""+i; + if (i < 10){ + number = "0"+number; + } + this.doNextStep( + artifact, + cc, + "src/test/ressources/horizontalProfile_mesh/" + + "horizontalprofile_step_"+number+"_feed.xml", + "src/test/ressources/horizontalProfile_mesh/" + + "horizontalprofile_step_"+number+"_advance.xml", + describeDocument); + } + + Document outputData = artifact.describe(describeDocument,cc); + FileOutputStream fos = null; + FileOutputStream fos2 = null; + FileOutputStream fos3 = null; + FileOutputStream fos4 = null; + try { + fos = new FileOutputStream( + "src/test/results/horizontalProfile_mesh" + + System.currentTimeMillis() + ".png"); + fos2 = new FileOutputStream( + "src/test/results/horizontalProfile_mesh" + + System.currentTimeMillis() + ".xml"); + fos3 = new FileOutputStream( + "src/test/results/horizontalProfile_mesh" + + System.currentTimeMillis() + ".csv"); + fos4 = new FileOutputStream( + "src/test/results/horizontalProfile_mesh" + + System.currentTimeMillis() + ".odv"); + artifact.out(this.readDocument("src/test/ressources/" + + "horizontalProfile_mesh/" + + "horizontalprofile_step_10_out_statistics.xml"), + fos2, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "horizontalProfile_mesh/" + + "horizontalprofile_step_10_out_chart.xml"), + fos, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "horizontalProfile_mesh/" + + "horizontalprofile_step_10_out_csv.xml"), + fos3, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "horizontalProfile_mesh/" + + "horizontalprofile_step_10_out_odv.xml"), + fos4, cc); + } catch (Exception e) { + log.error(e, e); + fail(); + } finally { + try { + fos.flush(); + fos.close(); + fos2.flush(); + fos2.close(); + fos3.flush(); + fos3.close(); + fos4.flush(); + fos4.close(); + } catch (Exception e) { + log.error(e, e); + } + } + } catch (Exception e) { + log.error(e, e); + fail(); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshTimeSeriesTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshTimeSeriesTestCase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,130 @@ +/** + * + */ +package de.intevation.gnv.artifacts; + +import java.io.FileOutputStream; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; + +/** + * @author Tim Englich + * + */ +public class MeshTimeSeriesTestCase extends GNVArtifactsTestCaseBase { + + private static Logger log = Logger.getLogger(MeshTimeSeriesTestCase.class); + + /** + * Constructor + */ + public MeshTimeSeriesTestCase() { + } + + /** + * Constructor + * @param name + */ + public MeshTimeSeriesTestCase(String name) { + super(name); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactsTestCaseBase#testArtifact() + */ + @Override + public void testArtifact() { + try { + log.debug("GNVArtifactsTestCase.testTimeSeriesMeshArtifact"); + String artefactName = "fis_modeldata"; + ArtifactFactory artifactFactory = this + .getArtifactFactory(artefactName); + assertNotNull(artifactFactory); + log.debug("TimeSeriesMesh-ArtifactFactory is available"); + Artifact artifact = artifactFactory.createArtifact( + "" + System.currentTimeMillis(), bootstrap.getContext()); + assertNotNull(artifact); + log.debug("TimeSeriesMesh-Artifact is available"); + + CallContext cc = createCallContext(); + + Document describeDocument = this.readDocument("src/test/ressources/timeseries_mesh/timeseries_describe.xml"); + + int steps = 8; + + for (int i = 1; i <= steps; i++){ + this.doNextStep( + artifact, + cc, + "src/test/ressources/timeseries_mesh/" + + "timeseries_step_0"+i+"_feed.xml", + "src/test/ressources/timeseries_mesh/" + + "timeseries_step_0"+i+"_advance.xml", + describeDocument); + } + // Achter Schritt + Document outputData = artifact.describe(describeDocument,cc); + FileOutputStream fos = null; + FileOutputStream fos2 = null; + FileOutputStream fos3 = null; + FileOutputStream fos4 = null; + try { + fos = new FileOutputStream("src/test/results/timeseries_mesh" + + System.currentTimeMillis() + + ".png"); + fos2 = new FileOutputStream("src/test/results/timeseries_mesh" + + System.currentTimeMillis() + + ".xml"); + fos3 = new FileOutputStream("src/test/results/timeseries_mesh" + + System.currentTimeMillis() + + ".csv"); + fos4 = new FileOutputStream("src/test/results/timeseries_mesh" + + System.currentTimeMillis() + + ".odv"); + artifact + .out( + this + .readDocument("src/test/ressources/timeseries_mesh/timeseries_step_08_out_statistics.xml"), + fos2, cc); + artifact + .out( + this + .readDocument("src/test/ressources/timeseries_mesh/timeseries_step_08_out_chart.xml"), + fos, cc); + artifact + .out( + this + .readDocument("src/test/ressources/timeseries_mesh/timeseries_step_08_out_csv.xml"), + fos3, cc); + artifact + .out( + this + .readDocument("src/test/ressources/timeseries_mesh/timeseries_step_08_out_odv.xml"), + fos4, cc); + } catch (Exception e) { + log.error(e, e); + fail(); + } finally { + try { + fos.flush(); + fos.close(); + fos2.flush(); + fos2.close(); + fos3.flush(); + fos3.close(); + } catch (Exception e) { + log.error(e, e); + } + } + } catch (Exception e) { + log.error(e, e); + fail(); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshVerticalCrossSectionTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshVerticalCrossSectionTestCase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,121 @@ +/** + * + */ +package de.intevation.gnv.artifacts; + +import java.io.FileOutputStream; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; + +/** + * @author Tim Englich + * + */ +public class MeshVerticalCrossSectionTestCase extends GNVArtifactsTestCaseBase { + + private static Logger log = Logger.getLogger(MeshVerticalCrossSectionTestCase.class); + + /** + * Constructor + */ + public MeshVerticalCrossSectionTestCase() { + } + + /** + * Constructor + * @param name + */ + public MeshVerticalCrossSectionTestCase(String name) { + super(name); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactsTestCaseBase#testArtifact() + */ + @Override + public void testArtifact() { + try { + log.debug("GNVArtifactsTestCase." + + "testHVerticalCrossSectionMeshArtifact"); + String artefactName = "fis_modeldata"; + ArtifactFactory artifactFactory = this + .getArtifactFactory(artefactName); + assertNotNull(artifactFactory); + log.debug("VerticalProfile-ArtifactFactory is available"); + Artifact artifact = artifactFactory.createArtifact( + "" + System.currentTimeMillis(), bootstrap.getContext()); + assertNotNull(artifact); + log.debug("VerticalProfile-Artifact is available"); + + CallContext cc = createCallContext(); + Document describeDocument = this.readDocument("src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_describe.xml"); + + int steps = 8; + + for (int i = 1; i <= steps; i++){ + + this.doNextStep( + artifact, + cc, + "src/test/ressources/verticalcrosssection_mesh/" + + "verticalcrosssection_step_0"+i+"_feed.xml", + "src/test/ressources/verticalcrosssection_mesh/" + + "verticalcrosssection_step_0"+i+"_advance.xml", + describeDocument); + } + + Document outputData = artifact.describe(describeDocument,cc); + FileOutputStream fos = null; + FileOutputStream fos2 = null; + FileOutputStream fos3 = null; + try { + fos = new FileOutputStream( + "src/test/results/verticalcrosssection_mesh" + + System.currentTimeMillis() + ".png"); + + fos2 = new FileOutputStream( + "src/test/results/verticalcrosssection_mesh" + + System.currentTimeMillis() + ".csv"); + fos3 = new FileOutputStream( + "src/test/results/verticalcrosssection_mesh" + + System.currentTimeMillis() + ".odv"); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalcrosssection_mesh/" + + "verticalcrosssection_step_08_out_chart.xml"), + fos, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalcrosssection_mesh/" + + "verticalcrosssection_step_08_out_csv.xml"), + fos2,cc); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalcrosssection_mesh/" + + "verticalcrosssection_step_08_out_odv.xml"), + fos3,cc); + + } catch (Exception e) { + log.error(e, e); + fail(); + } finally { + try { + fos.flush(); + fos.close(); + fos2.flush(); + fos2.close(); + fos3.flush(); + fos3.close(); + } catch (Exception e) { + log.error(e, e); + } + } + } catch (Exception e) { + log.error(e, e); + fail(); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshVerticalProfileTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/MeshVerticalProfileTestCase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,133 @@ +/** + * + */ +package de.intevation.gnv.artifacts; + +import java.io.FileOutputStream; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; + +/** + * @author Tim Englich + * + */ +public class MeshVerticalProfileTestCase extends GNVArtifactsTestCaseBase { + + private static Logger log = Logger.getLogger(MeshVerticalProfileTestCase.class); + + /** + * Constructor + */ + public MeshVerticalProfileTestCase() { + } + + /** + * Constructor + * @param name + */ + public MeshVerticalProfileTestCase(String name) { + super(name); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactsTestCaseBase#testArtifact() + */ + @Override + public void testArtifact() { + try { + log.debug("GNVArtifactsTestCase.testVerticalProfileArtifact"); + String artefactName = "fis_modeldata"; + ArtifactFactory artifactFactory = this + .getArtifactFactory(artefactName); + assertNotNull(artifactFactory); + log.debug("VerticalProfile-ArtifactFactory is available"); + Artifact artifact = artifactFactory.createArtifact( + "" + System.currentTimeMillis(), bootstrap.getContext()); + assertNotNull(artifact); + log.debug("VerticalProfile-Artifact is available"); + + CallContext cc = createCallContext(); + Document describeDocument = this.readDocument("src/test/ressources/" + + "verticalprofile_mesh/" + + "verticalprofile_describe.xml"); + + int steps = 10; + + for (int i = 1; i <= steps; i++){ + String number = ""+i; + if (i < 10){ + number = "0"+number; + } + this.doNextStep( + artifact, + cc, + "src/test/ressources/verticalprofile_mesh/" + + "verticalprofile_step_"+number+"_feed.xml", + "src/test/ressources/verticalprofile_mesh/" + + "verticalprofile_step_"+number+"_advance.xml", + describeDocument); + } + // 10. Schritt + Document outputData = artifact.describe(describeDocument,cc); + FileOutputStream fos = null; + FileOutputStream fos2 = null; + FileOutputStream fos3 = null; + FileOutputStream fos4 = null; + try { + fos = new FileOutputStream( + "src/test/results/verticalprofile_mesh" + + System.currentTimeMillis() + ".png"); + fos2 = new FileOutputStream( + "src/test/results/verticalprofile_mesh" + + System.currentTimeMillis() + ".xml"); + fos3 = new FileOutputStream( + "src/test/results/verticalprofile_mesh" + + System.currentTimeMillis() + ".csv"); + fos4 = new FileOutputStream( + "src/test/results/verticalprofile_mesh" + + System.currentTimeMillis() + ".odv"); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalprofile_mesh/" + + "verticalprofile_step_10_out_statistics.xml"), + fos2, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalprofile_mesh/" + + "verticalprofile_step_10_out_chart.xml"), + fos, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalprofile_mesh/" + + "verticalprofile_step_10_out_csv.xml"), + fos3, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalprofile_mesh/" + + "verticalprofile_step_10_out_odv.xml"), + fos4, cc); + } catch (Exception e) { + log.error(e, e); + fail(); + } finally { + try { + fos.flush(); + fos.close(); + fos2.flush(); + fos2.close(); + fos3.flush(); + fos3.close(); + fos4.flush(); + fos4.close(); + } catch (Exception e) { + log.error(e, e); + } + } + } catch (Exception e) { + log.error(e, e); + fail(); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TestCallContext.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TestCallContext.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,59 @@ +/** + * + */ +package de.intevation.gnv.artifacts; + +import de.intevation.artifacts.CallContext; +import de.intevation.artifacts.CallMeta; + +/** + * @author Tim Englich + * + */ +public class TestCallContext implements CallContext { + + private Object globalContext = null; + private CallMeta callMeta = null; + + /** + * Constructor + */ + public TestCallContext(Object globalContext, CallMeta callMeta) { + this.globalContext = globalContext; + this.callMeta = callMeta; + } + + /** + * @see de.intevation.artifacts.CallContext#afterBackground(int) + */ + public void afterBackground(int action) { + } + + /** + * @see de.intevation.artifacts.CallContext#afterCall(int) + */ + public void afterCall(int action) { + } + + /** + * @see de.intevation.artifacts.CallContext#globalContext() + */ + public Object globalContext() { + return this.globalContext; + } + + public CallMeta getMeta() { + return this.callMeta; + } + + public Object getContextValue(Object key) { + + return null; + } + + public Object putContextValue(Object key, Object value) { + + return null; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointTimeSeriesTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointTimeSeriesTestCase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,126 @@ +/** + * + */ +package de.intevation.gnv.artifacts; + +import java.io.FileOutputStream; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; + +/** + * @author Tim Englich + * + */ +public class TimeSeriesPointTimeSeriesTestCase extends GNVArtifactsTestCaseBase { + + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(TimeSeriesPointTimeSeriesTestCase.class); + + /** + * Constructor + */ + public TimeSeriesPointTimeSeriesTestCase() { + } + + /** + * Constructor + * @param name + */ + public TimeSeriesPointTimeSeriesTestCase(String name) { + super(name); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactsTestCaseBase#testArtifact() + */ + @Override + public void testArtifact() { + log.debug("GNVArtifactsTestCase.testTimeSeriesArtifact"); + try { + String artefactName = "fis_marnet"; + ArtifactFactory artifactFactory = this + .getArtifactFactory(artefactName); + assertNotNull(artifactFactory); + log.debug("TimeSeries-ArtifactFactory is available"); + Artifact artifact = artifactFactory.createArtifact( + "" + System.currentTimeMillis(), bootstrap.getContext()); + assertNotNull(artifact); + log.debug("TimeSeries-Artifact is available"); + + CallContext cc = createCallContext(); + + // Erster Schritt + + Document describeDocument = this.readDocument("src/test/ressources/timeseries/timeseries_describe.xml"); + + int steps = 6; + + for (int i = 1; i <= steps; i++){ + + this.doNextStep( + artifact, + cc, + "src/test/ressources/timeseries/" + + "timeseries_step_0"+i+"_feed.xml", + "src/test/ressources/timeseries/" + + "timeseries_step_0"+i+"_advance.xml", + describeDocument); + } + + Document outputData = artifact.describe(describeDocument,cc); + FileOutputStream fos = null; + FileOutputStream fos2 = null; + FileOutputStream fos3 = null; + FileOutputStream fos4 = null; + try { + fos = new FileOutputStream("src/test/results/timeseries" + + System.currentTimeMillis() + + ".png"); + fos2 = new FileOutputStream("src/test/results/timeseries" + + System.currentTimeMillis() + + ".xml"); + fos3 = new FileOutputStream("src/test/results/timeseries" + + System.currentTimeMillis() + + ".csv"); + fos4 = new FileOutputStream("src/test/results/timeseries" + + System.currentTimeMillis() + + ".odv"); + + artifact.out(this + .readDocument("src/test/ressources/timeseries/timeseries_step_06_out_chart.xml"), + fos, cc); + artifact.out(this + .readDocument("src/test/ressources/timeseries/timeseries_step_06_out_statistics.xml"), + fos2, cc); + artifact.out(this + .readDocument("src/test/ressources/timeseries/timeseries_step_06_out_csv.xml"), + fos3, cc); + artifact.out(this + .readDocument("src/test/ressources/timeseries/timeseries_step_06_out_odv.xml"), + fos4, cc); + } catch (Exception e) { + log.error(e, e); + fail(); + } finally { + try { + fos.flush(); + fos.close(); + } catch (Exception e) { + log.error(e, e); + } + } + } catch (Exception e) { + log.error(e, e); + fail(); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointVerticalProfileTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/TimeSeriesPointVerticalProfileTestCase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,129 @@ +/** + * + */ +package de.intevation.gnv.artifacts; + +import java.io.FileOutputStream; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.artifacts.Artifact; +import de.intevation.artifacts.ArtifactFactory; +import de.intevation.artifacts.CallContext; + +/** + * @author Tim Englich + * + */ +public class TimeSeriesPointVerticalProfileTestCase extends + GNVArtifactsTestCaseBase { + + private static Logger log = Logger.getLogger(TimeSeriesPointVerticalProfileTestCase.class); + + /** + * Constructor + */ + public TimeSeriesPointVerticalProfileTestCase() { + } + + /** + * Constructor + * @param name + */ + public TimeSeriesPointVerticalProfileTestCase(String name) { + super(name); + } + + /** + * @see de.intevation.gnv.artifacts.GNVArtifactsTestCaseBase#testArtifact() + */ + @Override + public void testArtifact() { + try { + log.debug("GNVArtifactsTestCase.testVerticalProfileArtifact"); + String artefactName = "fis_marnet"; + ArtifactFactory artifactFactory = this + .getArtifactFactory(artefactName); + assertNotNull(artifactFactory); + log.debug("VerticalProfile-ArtifactFactory is available"); + Artifact artifact = artifactFactory.createArtifact( + "" + System.currentTimeMillis(), bootstrap.getContext()); + assertNotNull(artifact); + log.debug("VerticalProfile-Artifact is available"); + + CallContext cc = createCallContext(); + + Document describeDocument = this.readDocument("src/test/ressources/verticalprofile/verticalprofile_describe.xml"); + int steps = 6; + + for (int i = 1; i <= steps; i++){ + this.doNextStep( + artifact, + cc, + "src/test/ressources/verticalprofile/" + + "verticalprofile_step_0"+i+"_feed.xml", + "src/test/ressources/verticalprofile/" + + "verticalprofile_step_0"+i+"_advance.xml", + describeDocument); + } + + // Vierter Schritt + Document outputData = artifact.describe(describeDocument,cc); + FileOutputStream fos = null; + FileOutputStream fos2 = null; + FileOutputStream fos3 = null; + FileOutputStream fos4 = null; + try { + fos = new FileOutputStream("src/test/results/verticalprofile" + + System.currentTimeMillis() + + ".png"); + fos2 = new FileOutputStream("src/test/results/verticalprofile" + + System.currentTimeMillis() + + ".xml"); + fos3 = new FileOutputStream("src/test/results/verticalprofile" + + System.currentTimeMillis() + + ".csv"); + fos4 = new FileOutputStream("src/test/results/verticalprofile" + + System.currentTimeMillis() + + ".odv"); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalprofile/" + + "verticalprofile_step_06_out_statistics.xml"), + fos2, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalprofile/" + + "verticalprofile_step_06_out_chart.xml"), + fos, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalprofile/" + + "verticalprofile_step_06_out_csv.xml"), + fos3, cc); + artifact.out(this.readDocument("src/test/ressources/" + + "verticalprofile/" + + "verticalprofile_step_06_out_odv.xml"), + fos4, cc); + } catch (Exception e) { + log.error(e, e); + fail(); + } finally { + try { + fos.flush(); + fos.close(); + fos2.flush(); + fos2.close(); + fos3.flush(); + fos3.close(); + fos4.flush(); + fos4.close(); + } catch (Exception e) { + log.error(e, e); + } + } + } catch (Exception e) { + log.error(e, e); + fail(); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/ressource/RessourceFactoryTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/ressource/RessourceFactoryTestCase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,59 @@ +package de.intevation.gnv.artifacts.ressource; + +import junit.framework.TestCase; + +import org.apache.log4j.BasicConfigurator; +import org.apache.log4j.Logger; + +import de.intevation.artifactdatabase.DefaultPreferredLocale; +import de.intevation.artifacts.PreferredLocale; + +/** + * @author Tim Englich + * + */ +public class RessourceFactoryTestCase extends TestCase { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = null; + + static { + BasicConfigurator.configure(); + log = Logger.getLogger(RessourceFactoryTestCase.class); + } + + /** + * Constructor + * + * @param name + */ + public RessourceFactoryTestCase(String name) { + super(name); + } + + /** + * @see junit.framework.TestCase#setUp() + */ + @Override + protected void setUp() throws Exception { + super.setUp(); + // System.setProperty("artifact.ressource.dir", + // "src/test/ressources/lang"); + } + + public void testRessurceFactoryTestCase() { + ; + String value = RessourceFactory.getInstance() + .getRessource( + new PreferredLocale[] { new DefaultPreferredLocale( + "de", 1.0f) }, "fis_modeldata", "N/N"); + log.debug(value); + value = RessourceFactory.getInstance() + .getRessource( + new PreferredLocale[] { new DefaultPreferredLocale( + "en", 1.0f) }, "fis_modeldata", "N/N"); + log.debug(value); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/util/DistanceCalculatorTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/java/de/intevation/gnv/artifacts/util/DistanceCalculatorTestCase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,30 @@ +package de.intevation.gnv.artifacts.util; + +import com.vividsolutions.jts.geom.Coordinate; +import com.vividsolutions.jts.geom.GeometryFactory; +import com.vividsolutions.jts.geom.Point; + +import de.intevation.gnv.utils.DistanceCalculator; + +import junit.framework.TestCase; + +public class DistanceCalculatorTestCase extends TestCase { + + public DistanceCalculatorTestCase(String name) { + super(name); + } + + public void testDistanceCalculator(){ + + GeometryFactory gf = new GeometryFactory(); + + // Distance between Berlin and Tokio + Point p1 = gf.createPoint(new Coordinate(13.4000, 52.5167)); + Point p2 = gf.createPoint(new Coordinate(139.7667, 35.7000)); + + double s = new DistanceCalculator().calculateDistance(p1, p2); + + assertEquals(8941.201227763724, s); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_describe.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_describe.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + true + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_00_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_00_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_00_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_00_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_01_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_02_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_02_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_02_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_02_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_03_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_03_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_03_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_03_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_04_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_04_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_04_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_04_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_05_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_05_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_05_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_05_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_06_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_07_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_07_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_07_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_07_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_08_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_08_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_08_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_08_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_08_out_chart.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_08_out_chart.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_08_out_csv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_08_out_csv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_08_out_odv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_08_out_odv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_08_out_statistics.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_instantaneouspoint/horizontalprofile_step_08_out_statistics.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_describe.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_describe.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + true + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_01_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_01_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_01_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_01_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_02_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_03_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_03_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_03_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_03_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_04_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_04_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_04_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_04_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_05_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_05_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_05_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_05_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_06_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_06_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_06_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_06_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_07_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_07_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_07_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_07_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_08_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_09_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_09_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_09_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_09_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_chart.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_chart.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_csv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_csv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_odv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_odv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_statistics.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalProfile_mesh/horizontalprofile_step_10_out_statistics.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_describe.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_describe.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + true + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_01_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_02_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_03_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_04_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_05_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_out_chart.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_out_chart.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_out_csv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_out_csv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_out_odv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/horizontalcrosssection_mesh/horizontalcrosssection_step_06_out_odv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/lang/artifactMessages.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/lang/artifactMessages.properties Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,25 @@ +fis_marnet = Marnet +fis_imis = IMIS +fis_staun = STAUN +fis_modeldata = Modeldata +fis_delphin = Delphin +fis_thermosalinograph = Thermosalinograph +fis_chemusurvey = Chemusurvey + +timeSeries= Timeseries +verticalProfile = Verticalprofile +horizontalProfile = Horizontalprofile +featureid = Object +mesh_coordinate = Coordinate Value (x y) +mesh_point = Meshpoint +measurementid = Measurement depth +parameterid = Parameter +minvalue = Minvalue +maxvalue = Maxvalue +dateid = Measurement date +vehicleid = Ship +cruiseid = Cruise +trackid = Track +surveyid = Survey Info +axisid = Axis +depthid = Depth \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/lang/artifactMessages_de_DE.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/lang/artifactMessages_de_DE.properties Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,25 @@ +fis_marnet = Marnet +fis_imis = IMIS +fis_staun = STAUN +fis_modeldata = Modelldaten +fis_delphin = Delphin +fis_thermosalinograph = Thermosalinograph +fis_chemusurvey = Chemusurvey + +timeSeries= Zeitserie +verticalProfile = Vertikalprofil +horizontalProfile = Horizontalprofil +featureid = ObjeKt +mesh_coordinate = Koordinaten Wert (x y) +mesh_point = Messpunkt +measurementid = Messtiefe +parameterid = Parameter +minvalue = Minimalwert +maxvalue = Maximalwert +dateid = Messdatum +vehicleid = Schiff +cruiseid = Reise +trackid = Track +surveyid = Messinformation +axisid = Achse +depthid = Tiefe diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_describe.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_describe.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,8 @@ + + + + + + true + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_01_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_01_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,8 @@ + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_01_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_01_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_02_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_02_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,8 @@ + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_02_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_02_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_03_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_03_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,8 @@ + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_03_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_03_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_04_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_04_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,8 @@ + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_04_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_04_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_05_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_05_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,8 @@ + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_05_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_05_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,8 @@ + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,11 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_out_chart.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_out_chart.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_out_csv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_out_csv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_out_odv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_out_odv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_out_statistics.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries/timeseries_step_06_out_statistics.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_describe.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_describe.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + true + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_01_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_01_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_01_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_01_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_02_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_02_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_02_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_02_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_03_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_03_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_03_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_03_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_04_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_04_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_04_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_04_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_05_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_05_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_05_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_05_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_06_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_06_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_06_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_06_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_07_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_07_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_07_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_07_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_08_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_08_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_08_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_08_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_08_out_chart.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_08_out_chart.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_08_out_csv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_08_out_csv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_08_out_odv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_08_out_odv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_08_out_statistics.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/timeseries_mesh/timeseries_step_08_out_statistics.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_describe.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_describe.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + true + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_01_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_01_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_01_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_01_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_02_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_02_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_02_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_02_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_03_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_03_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_03_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_03_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_04_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_04_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_04_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_04_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_05_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_05_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_05_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_05_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_06_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_06_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_06_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_06_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_07_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_07_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_07_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_07_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_out_chart.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_out_chart.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_out_csv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_out_csv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_out_odv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalcrosssection_mesh/verticalcrosssection_step_08_out_odv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_describe.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_describe.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + true + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_01_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_01_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_01_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_01_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_02_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_02_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_02_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_02_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_03_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_03_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_03_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_03_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_04_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_04_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_04_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_04_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_05_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_05_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_05_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_05_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_out_chart.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_out_chart.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_out_csv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_out_csv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_out_odv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_out_odv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_out_statistics.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile/verticalprofile_step_06_out_statistics.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_describe.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_describe.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + true + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_01_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_01_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_01_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_01_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_02_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_02_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_02_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_02_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_03_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_03_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_03_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_03_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_04_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_04_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_04_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_04_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_out_chart.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_out_chart.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_out_csv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_out_csv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,2 @@ + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_out_odv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_out_odv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_out_statistics.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_instantaneouspoint/verticalprofile_step_05_out_statistics.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_describe.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_describe.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + true + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_01_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_02_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_03_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_04_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_05_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_06_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_07_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_07_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_07_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_07_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_08_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_08_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_08_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_08_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_09_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_09_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_09_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_09_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_advance.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_advance.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_feed.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_feed.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_chart.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_chart.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,13 @@ + + + + + /> + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_csv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_csv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_odv.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_odv.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_statistics.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv-artifacts/src/test/ressources/verticalprofile_mesh/verticalprofile_step_10_out_statistics.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/ChangeLog --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/ChangeLog Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,810 @@ +2009-12-17 Sascha L. Teichmann + + RELEASE 0.3 + + * Changes, NEWS, ChangeLog: Summerized activities + +2009-12-17 Sascha L. Teichmann + + * src/main/resources/applicationMessages.properties: + s/Modeldaten/Modelldaten/ + +2009-12-17 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Added demo wkt linestrings + via xslt and javascript. + +2009-12-17 Hans Plum + + Issue 129: Release 0.2: Verbesserung der Übersetzungen + + * src/main/resources/applicationMessages.properties: + Fixed i18n strings reported by experts + +2009-12-14 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp: + Added switch between boolean and other Values to determin wether a checkbox + is required or an text-field should be used. + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java (execute): + Added parsing of boolean-Option-Values to provide this Feature. + +2009-12-14 Hans Plum + + Issue109: Tomcat: Konfiguration des Kontexts enthält Redundanz + + * src/main/webapp/META-INF/context.xml: + Removed obsolete configuration attributes. + +2009-12-09 Sascha L. Teichmann + + * src/main/resources/applicationMessages.properties: Fixed some + spelling problems. + +2009-12-01 Tim Englich + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute): + Removed feed Call before Chart- and Statisticsgeneration is called, because + it is not longer required by the Artifactdatabase. + + +2009-12-01 Ingo Weinzierl + + * src/main/webapp/WEB-INF/web.xml: Reverted changes in config from last + revision, which have been committed by mistake. + +2009-12-30 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Add svg + extension to file when exporting charts to svg. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for svg + export link. + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: Added link + for svg export in html gui. + +2009-12-30 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: Added + link for pdf export in html gui. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for pdf + export link. + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Added pdf + extension to file when exporting charts as pdf. + + NOTE: Update gnv-artifacts to rev381 which supports pdf export. + +2009-11-23 Tim Englich + + * src/main/resources/applicationMessages*.properties: + Added Properties which hold the Version-information of the + GNV which will be set by te Maven package-process. + * src/main/webapp/WEB-INF/config/struts-config.xml: + Added an Action which make the Version-Information accessible. + Now it is possible to get those Information using /version.do + * src/main/webapp/WEB-INF/jsp/version.jsp: + Added an Page where it is possible to get the Information about the current + Version of the GNV and the ArtifactDatabase + * pom.xml: + Added Plugin for creating the BildTime and BildVersion of the gnv. + Replace Tokens in the /src/main/ressources Files + +2009-11-20 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Removed mistake from xml structure of the artifact protocol. Mime-type + node was 'out' instead of 'mime-type'. + +2009-11-13 Hans Plum + + RELEASE-0.2 + + * Changes, NEWS: + Summerized activities. + +2009-11-13 Hans Plum + + * ChangeLog: + Unified entries with references to issues. + +2009-11-13 Tim Englich + + * src/main/webapp/WEB-INF/web.xml: + Added Documentation of Configuration-Entries. + +2009-11-12 Tim Englich + + * src/main/webapp/styles/default.css: + Added CSS-Entry for the Exception Message Container and + put the div at a proper place. + * src/main/resources/applicationMessages*.properties: + Added localized Exception Messages. + * src/main/webapp/WEB-INF/jsp/header.jsp: + Added the localization of Exception Messages. + +2009-11-12 Tim Englich + + Issue 71: Error while Serialisation of Sessions + + * 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/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Imports organized. + * src/main/java/de/intevation/gnv/artifactdatabase/objects/*.java: + Made all Interfaces Serailizable and add UID to all Objects issue71 + +2009-11-12 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp: + Implemented a better GUI-Structure for displaying the Statisticdata. + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java: + Added new Beanstructur for a better Representation of the Statistics which + is generated by the ArtifactDatabase. + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (calculateStatistics): + Changed the parsing algorithm of the Document which is generated + by the ArtifactDatabase. + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (calculateStatistics): + Changed Return-Value to ArtifacStatisticsSet according to the new Structur of + Statistics that will be generated by the ArtifactDatabase. + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute): + Changed the Resultvalue from ArtifactStatisticValue to ArtifacStatisticsSet according + to API-Changes of the ArtifactDatabaseClient + +2009-11-11 Tim Englich + + Issue 80: Error handling when session got expired + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute): + Catch NPE and tell the user that the Session has expired. issue80 + +2009-11-11 Tim Englich + + Issue 81: Input of coordinate values do not show up after update + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + Remove
Tag after Input-Elements + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Add an
-Tag after the generation of Select-Boxes to get + a better look and feel in the ui. issue81 + * src/main/webapp/WEB-INF/jsp/index.jsp: + Replace NonBreakingSpace-Strings from UI issue81 + +2009-11-11 Tim Englich + + Issue 81: Input of coordinate values do not show up after update + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + BugFix: Text-Inputfields will now be diabaled in static-ui issue81 + +2009-11-06 Ingo Weinzierl + + * src/main/resources/applicationMessages.properties: Replaced german umlaut + witch ascii character. + +2009-11-06 Ingo Weinzierl + + * pom.xml: Changed Restlet repository from M3 to Snapshot. + +2009-11-06 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: Added link + for exporting data in ODV format. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for + odv export and changed label of CSV export. + +2009-11-05 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java (ArtifactDatabaseClientFactory): + Removed some deprecatde TODO-Tasks. + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (getCurrentStepDescription): + Changed the Describe-Call of an Artifact from get to post an add the Flag which + determines if the UI should be delivered to the client. + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (getCurrentStepDescription): + Added the possibility to put an Flag which determines if the UI should be delivered from + the artifact-database to the Metodsignature. + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java (execute), + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute), + src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java (execute), + src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java (testArtifactDatabaseClient): + Added the Flag if the UI should be delivered by the artifact-database to the Method-Call. + +2009-10-28 Tim Englich + + * src/main/resources/applicationMessages*.properties: + Added Ressources for two new FIS. Current Meter and Ice Station Reports + +2009-10-27 Tim Englich + + * src/main/resources/applicationMessages_en.properties: + Added Ressources for two new FIS. Seegangsarchiv and SEACAT + +2009-10-22 Tim Englich + + Issue 58: Behaviour by missing DB connection + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute): + Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58. + +2009-10-21 Tim Englich + + Issue 28: Client is not multi-instance enabled + + * src/main/webapp/META-INF/context.xml: + Added context.xml to permitt cookies to provide + Multisession-Usability for a single Client issue28 + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp: + Added URL-Rewrite to add the SessionID to the requested URL to get + the System work without cookies. issue28 + +2009-10-19 Tim Englich + + Issue 55: Unified input of coordinate input + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl, + src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + Added uniform Visualization of Single Input-Elements in GUI. issue55 + +2009-10-19 Tim Englich + + Issue 51: Translations for diagram options to be improved + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp, + src/main/resources/applicationMessages*.properties: + Integrated Ressouces for OutputOptions issue51 + +2009-10-19 Tim Englich + + Issue 35: Wrong data input forces GNV to start from beginning + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute): + Now the UI will compelte be shown if the User has done an Mistake entering + values to input-fields eg. Coordinates or formatted Date-Strings. issue 35 + +2009-10-19 Tim Englich + + Issue 47: Improving translations in time series + + * src/main/resources/applicationMessages_en.properties: + Changed Lablevalues according to issue47 + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Add the possibility to render XForms-Group-Lables as Legend-Entries of + one Step in the GUI + +2009-10-16 Tim Englich + + Issue 48: Improving translation of statistics panel + + * src/main/resources/applicationMessages_en.properties: + Conformation to the tanslation of the Statisticsdescriptors issue48 + +2009-10-16 Tim Englich + + Issue 49: Integration of FIS to Mesh + + * src/main/resources/applicationMessages_en.properties: + Adding the Names of the two new FIS to the Propertiesfiles issue49 + +2009-10-07 Sascha L. Teichmann + + RELEASE 0.1 + + * Changes, NEWS: Summarized changes. + +2009-10-06 Tim Englich + + * src/main/resources/applicationMessages.properties Edited: + Removed obsolet Entries + * src/main/resources/applicationMessages_en.properties Added: + Added the Support for english-Language + +2009-10-06 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (doGetRequestInternal) Edited: + Read the Status-Code from the Response and throw an Exception + which Message will be visualized in the GUI. gnv/issue18 + +2009-10-08 Sascha L. Teichmann + + * Changelog -> ChangeLog: Moved to make eclipse happier. + +2009-10-08 Sascha L. Teichmann + + * Changelog: Unified changelog style. + +2009-10-08 Sascha L. Teichmann + + * pom.xml: Remove XMLBeans stuff, set filtered resources to UTF-8 + +2009-10-06 Tim Englich + + * src/main/webapp/index.jsp Added: + Added Index-Page for Global-Forward to Start-URL of the Project gnv/issue14 + * src/main/webapp/WEB-INF/config/struts-config.xml Edited: + Added Global Forward to determine the Start-URL of the Project. gnv/issue14 + +2009-10-06 Tim Englich + + * src/main/webapp/WEB-INF/jsp/header.jsp Edited: + Deaktivate Links save Project and load Project gnv/issue12 + +2009-10-05 Tim Englich + + * src/main/resources/applicationMessages.properties Edited: + Added some more FIS-Ressource. + +2009-10-02 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java (getArtifactDatabaseClient): + Putting the ClientLanguage into the getArtifactDatabaseClient-Signature. + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (setLocale) Edited, + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (setLocale) Edited: + Added the Support of Setting the ClientLanguage to the ArtifactDatabaseClient + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java (execute) Edited, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute) Edited, + src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java (execute) Edited, + src/main/java/de/intevation/gnv/action/DoOutputAction.java (execute) Edited, + src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java(execute) Edited: + Put the Locale of the Calling Client to the Communication with the ArtifactDatabase. + + * src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java (testArtifactDatabaseClient) Edited: + Added DefaultLocale German to the ArtfactDataBaseClient call. + +2009-10-02 Tim Englich + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Edited, + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl Edited: + Switched Value for legend from ref-Attribute to Label-Element + * src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp Edited: + Added translation for FIS (ArtifactFactorynames) + * src/main/resources/applicationMessages.properties Edited: + Added Germannameds for FIS. + +2009-10-02 Tim Englich + + * src/**/*.java Edited: + Format Code to max 80 Chars per Row + +2009-10-02 Tim Englich + + * src/main/java/de/intevation/gnv/util/XSLTransformer.java CLEANUP , + src/main/java/de/intevation/gnv/util/XMLUtils.java CLEANUP , + src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java CLEANUP , + src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java CLEANUP , + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java CLEANUP , + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java CLEANUP , + src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java CLEANUP , + src/main/java/de/intevation/gnv/action/DoOutputAction.java CLEANUP: + Change non static accesses to static members using declaring type + Change indirect accesses to static members to direct accesses (accesses through subtypes) + Remove unused imports + Add missing '@Override' annotations + Add missing '@Deprecated' annotations + Remove unnecessary casts + +2009-10-02 Tim Englich + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java (execute) Edited, + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute) Edited, + * src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java (execute) Edited, + * src/main/java/de/intevation/gnv/action/DoOutputAction.java (execute) Edited, + * src/main/java/de/intevation/gnv/action/DoExportAction.java (execute) Edited, + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java (execute) edited: + Added ExceptionHandling to this Actions + * src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java (getExceptionForward) Edited: + Added Method for Resolving the ExceptionForward from the Mapping. + * src/main/webapp/WEB-INF/jsp/header.jsp Edited: + Read ExceptionMessage from RequestAttributes + +2009-09-28 Tim Englich + + * src/main/resources/applicationMessages.properties Edited: + Adding missing StatisticsDescription for Arithmetic Mean. + +2009-09-28 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java Added, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java Added: + Added the Interface and the Defaultimplementation for the Representation of Statistic-Values. + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute) Edited: + Added the Busionesslogic for Calculation the Statistics to the Action. + * src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Edited, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Edited: + Added the Methods for setting and getting the statistics to the SessionModel + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (calculateStatistics) Edited, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (calculateStatistics) Edited: + Added the Method for retrieving the Statistics from the current Artifcat. + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp Edited: + Put the Values of the Statitics into the View. + * src/main/webapp/styles/default.css Edited: + Changed CSS-for Statistics so that it would be displayed. + +2009-09-25 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Edited: + Bug fixed in CSV_Export Link + +2009-09-25 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java Edietd: + Integrated some Method for accessing and Setting OutputModes to an ArtifactDescription. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java Edited: + Adding some Beans and their InterfaceDescription for the Representation of OutputModes + supported by an Artifact + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Edited: + Fetsching the OutputMode-Informations from the Describedocument and put them into a Collection + of OutputModes. + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java Edited: + Restet SessionModel integrated. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Edited: + Cast for ArtifactDescription removed. + + * src/main/java/de/intevation/gnv/action/DoOutputAction.java Edited, + src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Edited: + Dynamical read of OutputParameter for Outputgeneration + + * src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Edited:, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Edited: + Added some Method for retrieving Diagrammoptions and reset the SessionModel + + * src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java Edited: + Dynamic Options Support Added + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp Edited: + Dynamic Rendring of the Outputparameters of an ArtifactoutputType added. + Ath this Moment only The Outputparameter for Chart ist provided. + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Edited : + Integrated dynamic Setting of Diagramm-Parameter to the Link. + Also Read MimeType from the OPutputParameters of the Artifact. + +2009-09-25 Tim Englich + + * src/main/java/de/intevation/gnv/action/DoOutputAction.java Edited: + Some Refactoring work done. + Logging Integrated. Extract Method for setting Responseheader Informations. + + * src/main/java/de/intevation/gnv/action/DoExportAction.java Added: + Action for performing the Exports eg. CSV and Chart + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Added: + Action for do the Bussinesslogic for storing the Diagrammoptions that were + changed by the User. + * src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Edited, + * src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Edited: + Added Accessmethod for the Diagrammoptions. + + * src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java Added: + Bean for the Representation of Diagrammoptions + + * src/main/resources/applicationMessages.properties Edited: + Added som GUI Lables. + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Edited, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp Add, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp Add, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp Add: + Added the GUI for the Statistics and Diagramoptions and tge Export. + + * src/main/webapp/WEB-INF/config/struts-config.xml Edited: + Added Actions for Performing Exports and Changing Diagramoptions. + +2009-09-24 Tim Englich + + * src/main/webapp/scripts/gnviewer.js Edited: + Removed unused Methods from File. + +2009-09-24 Tim Englich + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp Edited: + Obsolet Javascript References Removed + Added Javascript-Reference to the gnviewer.js File + * src/main/webapp/WEB-INF/jsp/index.jsp Edited: + Please Wait Dialog integrated if an Form will be submittend + +2009-09-24 Tim Englich + + * src/main/webapp/scripts/gnviewer.js Added: + Added Javascript-File from Old-Project Revision: 3101 + +2009-09-24 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Edited: + Codecleanup + ExceptionReporthandling integrated + +2009-09-24 Tim Englich + + * src/main/webapp/WEB-INF/config/log4j.properties Added: + Standard Log4J-properties-File which will log all Informations to the Console. + * src/main/webapp/WEB-INF/web.xml Edited: + Added init-Parameter to tell the Application where the Log4J-propertiesfile ist located. + * src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java (init) Edited: + Reading Logging-Properties from Propertiesfile. Path maust beconfigured in the web.xml File + + +2009-09-23 Tim Englich + + * src/main/webapp/WEB-INF/web.xml Edited: + Added Count of ArtifactDatabases and Database-URL to this File + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (ARTIFACTDATABASE_URL_ID) Edited: + Added Static Constants for identifing ArtifactDatabase URLS in PropertiesReader + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (initialize) Edited: + Read ArtifactDatabase URLS from PropertiesReader + +2009-09-23 Tim Englich + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute) Edited: + Removed Image-Element and put it into the jsp-Page + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Edited: + Moved Image-Element from Classfile to this location. + URL will now be encoded for usage without cookies. + * src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp Edited, + src/main/webapp/WEB-INF/jsp/index.jsp Edited: + URL will now be encoded for usage without cookies. + +2009-09-23 Tim Englich + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Edited: + Selection on Input-UI-Data will be fetched from the UI and visualized + in the GUI. + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl Edited: + Single Text Input-Elements now will be surround with an div and an form Element + 2009-09-22 Tim Englich + + * src/main/java/de/intevation/gnv/util/XSLTransformer.java Edited: + Logging reduced for a better Performance. XML-Nodes should not be logged because their size could + cause Problems in Log4J and the ConsoleAppender of Eclipse + +2009-09-21 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Remnoved logging of Resultdocuments becaus it slow down the Application. + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java (execute): + Added support of ArtifactFactory Reload if Session was lost. + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute): + Added Support of more than one Product. + +2009-09-17 Tim Englich + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Some Refactoring work done. + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + Added XSL-Template for Transforming the stazic UI + * src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp: + Refactored FIS Rendering to it's own Include-File + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: + Refactored Diagramm Rendering to it's own Include-File + * src/main/webapp/WEB-INF/jsp/index.jsp: + Some Refactoring Work done. + * src/main/webapp/styles/default.css: + Some Changes in DIV-Formatting to get a propper Layout. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (NextArtifactStepAction): + Static UI integrated + +2009-09-17 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp: + Refactored FIS Rendering to it's own Include-File + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: + Refactored Diagramm Rendering to it's own Include-File + * src/main/webapp/WEB-INF/jsp/index.jsp: + Some Refactoring Work done. + * src/main/webapp/styles/default.css: + Some Changes in DIV-Formatting to get a propper Layout. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (NextArtifactStepAction): + Static UI integrated + +2009-09-16 Tim Englich + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute) Edited: + UI also Rendered when Chart is already visualized. + * src/main/webapp/WEB-INF/jsp/index.jsp: + Some Stylingfixes done. + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Legend-Element for SelectEntries Integrated + +2009-09-16 Tim Englich + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp Edited, + src/main/webapp/WEB-INF/jsp/index.jsp Edited: + Integrate the new Pageinfrastructur into the Mainlayout + + * src/main/webapp/WEB-INF/config/struts-config.xml Edited: + Integrate message-resources into the Strutsconfiguration and change + the mainpage from index.jsp to mainlayout.jsp + +009-09-16 Tim Englich + + * src/main/webapp/WEB-INF/jsp/header.jsp Added, + src/main/webapp/WEB-INF/jsp/footer.jsp Added, + src/main/resources/applicationMessages.properties:Added, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp Added, + src/main/webapp/styles/*, + src/main/webapp/scipts/*, + src/main/webapp/images/*: + Import of MainLayout, Styles, images and Scripts from old System Revision: 3101 Does not compile + +2009-09-16 Tim Englich + + * src/main/webapp/WEB-INF/config/struts-config.xml Edited, + src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Edited, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (doOutput) (doFeed) Edited, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute) Edited, + src/main/java/de/intevation/gnv/action/DoOutputAction.java Added: + Chartoutput Added to the View + +2009-09-16 Tim Englich + + * src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java Edited: + Added Transformerlogic to the Testcase + + * src/main/webapp/WEB-INF/jsp/index.jsp Edited: + Integrated the UI of the Artifact + + * src/main/webapp/WEB-INF/config/struts-config.xml Edited: + Added ActionHandling for managing the next Businesslogic to go to the next Step of an Artifact + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Edited: + Added Transformation-Rules for Input-Elements + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java Added, + src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java Added: + Infrastructur for providing InputParametes as an Object + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java (getInputParameter) (setInputParameter) Edited: + Add Methods for providing the reuired Input-Parametes of the current ArtifactDescription + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (doNextStep) Edited: + Added doNextStep Method for doing all ControllerWork to move the Artifact into the next Step + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Added: + Action for switching to the next Step of an Artifact + +2009-09-15 Tim Englich + + * src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java: + New Testcase for testing the usability of XSL-Transformations + * src/test/ressources/describe-ui-test.xml Added: + An Sample-Document for testing XSL-Transformations + * src/main/webapp/WEB-INF/jsp/index.jsp Edited: + Added the html-Fragment of the transformated Describe-Methode-response to the document. + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Added: + XSL-Template for transforming an Xform-Element to a HTML-Select-Element + * src/main/java/de/intevation/gnv/util/XSLTransformer.java Added: + XSl-Transformer for doing XSL-Transformations of the ResultDocuments of + the ArtifactDatabase + * src/main/java/de/intevation/gnv/util/XMLUtils.java Edited: + Integrate a Method for writing an XML-Node to a String for debugging. + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Some Unused imports removed an select the first Child of the ui Node. + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java (execute) Edited: + Integration of the Describe-Stuff for rendering an GUi + +2009-09-15 Tim Englich + + * src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java (testArtifactDatabaseClient) Edited: + Added "Create Artifact" and "Describe Artifact" to the Testszenario. + +2009-09-14 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java: + Support for Initial DescribeCall to ArtifactDatabase implemented + +2009-09-14 Tim Englich + + * src/main/webapp/WEB-INF/config/struts-config.xml: + Added two ActionMappings: + One for showing all FIS (ArtifactFactories) in an View. + The other for selceting one ArtifactFactory an visualizing the First Step of an Artifact. + * src/main/webapp/WEB-INF/jsp/index.jsp Edited: + Added an Combobox for selecting an FIS + * src/main/webapp/WEB-INF/web.xml: + Added the Servletmapping for the Struts Framework + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java Added, + src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java Added, + src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Edited: + Some ActionHandler added for Handling the different Requests of the GNV. + FetchArtifactFactoriesAction: Will provides the Controllerlogic for Queriing all Reachable ArtifactFactories. + SelectArtifactFactoryAction will select one Specific ArtifactFactory and will create + an Instance in the ArtifactDatabase. + + * src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Added, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java Added, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Added: + Interface and Defaultimplementation of an Model which can store the Session-Specific Informations. + e.g. Reachable ArtifactFactories and the current Artifact which should be used. + +2009-09-14 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Edited: + All Methods for doing the create-Request and reading the Result-Document implemented. + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (createNewArtifact) Edited: + Add Method for creating a new Artifact in the ArtifactDatabase + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java (Artifact): + Added new Class for the Representation of an Artifact + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java (getHash) Edited, + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java (getHash) Edited + getHash Method added. Now it will be possible to read the Hash of an Artifact send by the Artifactdatabase. + * src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java (getInstance) Edited: + Bug Fixed. factory will now be instantiated. + * src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java Edited, + Integration of temporal Basic Log4J Support. + +2009-09-11 Tim Englich + + * pom.xml: Further Dependencies and Plugins added + Deleted some utdated Files + +2009-09-11 Tim Englich + + * src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java Added: + Testcase for querying Artifacfactorydescriptions from the ArtifactDatabase + +2009-09-11 Tim Englich + + * src/main/webapp/WEB-INF/jsp/index.jsp Added , + src/main/webapp/WEB-INF/config/struts-config.xml Added, + src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java Added + src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Added: + Basic Struts-Infrastructur Added + +2009-09-11 Tim Englich + + * src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java Added, + src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java Added, + src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java Added, + src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java Added: + Infrastructur for Reading Properties from a Map or SercletConfig an provide them + to the whole Application. + +2009-09-11 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java Added, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java Added: + ObjectStructor for Representing delivered Objects from the ArtifactDatabase + + * src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java Added, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Added, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java Added, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java Added: + Integrated Interface-Structure to handle the communication to the ArtifactDatabase + +2009-09-10 Tim Englich + + * .svnignore Added: Added Eclipse specific Files and Folders to the Ignorelist + +2009-09-10 Tim Englich + + * pom.xml: Created with maven and put the Moduledependencies into it + * Changes | Changelog | NEWS | README | TODO: Added + * src/**: Added to the Project diff -r 27082b83c267 -r 465e70422e66 gnv/Changes --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/Changes Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,58 @@ +2009-12-17 RELEASE 0.3 + + New: + + * Support for WKT line strings in GUI in form of text fields. + * Added control for boolean values. + * Litte demo WKT line string via Javascrip to demonstrate + new WKT option. + * Drawing of diagrams is to be triggeres explicitly now. + * Added options to export diagrams as PDF and SVG. + * Little info about running version. + + Fixed: + + * Various i18n messages (Issue 129) + * Removed some redundancy from the Tomcat configuration (Issue 109) + * Some communication problems with the artifact database server. + +2009-11-13 RELEASE 0.2 + + New: + + * Enable client for multi-instances in the same browser by using + SessionIDs + + * Added support for all FIS + * Added support for skipping transition steps + * Added support for CSV and ODV formats via a common mechanism + * Updated to a newer version of RESTlet API + * Added first documentation for configuration + + +2009-10-07 RELEASE 0.1 + + New: + + * Initial Struts 1.x based Web-Client for the REST based + artifact database. + + * UI mainly inspired by the prototype from conterra. + + * It implements a runtime system for working with artifacts + by storing a client side proxy model in the session of + the servlet context. The workflow is completely controlled + by the artifact living in the artifact database. + + * The input forms are generated by XSL transformation from + the 'describe' output of the artifact. + + * Output is rendered as PNG, downloadable PNGs, CSV and + statistics all produced serverside in the artifact database. + + * i18n/i10n is done by Struts and broadcasted via REST to + the REST beased artifact database. Supported languages: + German and English + + * The connection to the REST server is configure in web.xml + default: http://localhost:8181 diff -r 27082b83c267 -r 465e70422e66 gnv/NEWS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/NEWS Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,37 @@ +2009-12-17 RELEASE 0.3 + + * PDF and SVG export of diagrams. + * support for WKT line strings + * Fixed some internal communication problems. + + +2009-11-13 RELEASE 0.2 + + * Added support for all required FIS: + Marnet, IMIS, STAUN, Modelldaten, Eisklimatologie, Eismeldungen, SST, + Delphin, Thermosalinograph, Chemusurvey, GTS, CTD, XBT, SeaCat, + Seegangsarchiv, Strommesser (Req. TG_0020.001) + + * Added support for vertical profiles (Chapter 3.3.3.2.2) + + * Added support for horizontal profiles (Chapter 3.3.3.2.3); + part independent of MapViewer + + * Added a first support for ODV format (Req. TG_0040.005) + + * Enabling client for multi-instances (Req. 00_0000.007) + + * Adding of support of internal area filter (Req. TG_0020.012 b) + + * Added more support for internationalization (TG_0050.004) + + * Improved error handling with more user-friendly messages + + * Added required statistical support (Chapter 3.3.3.3.1) + + +2009-10-07 RELEASE 0.1 + + * Initial realease of the web client which is a lightweight + runtime system for artifacts. + diff -r 27082b83c267 -r 465e70422e66 gnv/pom.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/pom.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,158 @@ + + 4.0.0 + de.intevation.bsh + gnv + war + 1.0-SNAPSHOT + gnv + http://maven.apache.org + + UTF-8 + + + + maven-restlet + Public online Restlet repository + http://maven.restlet.org + + + + + junit + junit + 3.8.1 + test + + + org.restlet + org.restlet + 2.0-SNAPSHOT + + + org.restlet + org.restlet.ext.xml + 2.0-SNAPSHOT + + + tomcat + servlet-api + 5.5.15 + provided + + + struts + struts-el + 1.2.9 + runtime + + + struts + struts + 1.2.9 + compile + + + log4j + log4j + [1.2,) + + + + gnv + + + maven-compiler-plugin + + 1.5 + 1.5 + + + + maven-war-plugin + + + + ${basedir}/src/main/webapp + + images/ + WEB-INF/jsp/application/ + + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + de.intevation.artifactdatabase.App + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.1 + + java + + -classpath + + de.intevation.artifactdatabase.App + + + + + + org.apache.maven.plugins + maven-eclipse-plugin + + true + true + 1.5 + + 1.2.3 + + + + + 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 + + + + + + + + + src/main/resources + true + + + + diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,63 @@ +/** + * + */ +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.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +/** + * @author Tim Englich + * + */ +public class ArtifactDatabaseActionBase extends Action { + + protected final static String SUCCSESS_FORWARD_ID = "success"; + protected final static String EXCEPTION_FORWARD_ID = "success"; + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(ArtifactDatabaseActionBase.class); + + /** + * Constructor + */ + public ArtifactDatabaseActionBase() { + super(); + } + + /** + * @see org.apache.struts.action.Action#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, + HttpServletResponse response) throws Exception { + log.debug("ArtifactDatabaseActionBase.execute"); + ActionForward forward = mapping.findForward(SUCCSESS_FORWARD_ID); + return forward; + } + + /** + * Returns the ExceptionForward for the ArtifactDatabaseActions + * + * @param mapping + * @return + */ + protected ActionForward getExceptionForward(ActionMapping mapping) { + log.debug("ArtifactDatabaseActionBase.getExceptionForward"); + ActionForward lForward = mapping.findForward(EXCEPTION_FORWARD_ID); + return lForward; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,123 @@ +/** + * + */ +package de.intevation.gnv.action; + +import java.util.Collection; +import java.util.Iterator; + +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 org.w3c.dom.Node; + +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.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; +import de.intevation.gnv.artifactdatabase.objects.OutputParameter; +import de.intevation.gnv.util.XMLUtils; +import de.intevation.gnv.util.XSLTransformer; + +/** + * @author Tim Englich + * + */ +public class ChangeOptionsAction extends ArtifactDatabaseActionBase { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(ChangeOptionsAction.class); + + /** + * Constructor + */ + public ChangeOptionsAction() { + super(); + } + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + log.debug("NextArtifactStepAction.execute"); + try { + SessionModel sm = SessionModelFactory.getInstance() + .getSessionModel(request); + + String target = request.getParameter("target"); + OutputMode outputMode = sm.getOutputMode(target); + if (outputMode != null) { + + Collection op = outputMode + .getOutputParameters(); + if (op != null) { + Iterator it = op.iterator(); + DiagrammOptions diagrammOptions = new DiagrammOptions(); + while (it.hasNext()) { + OutputParameter parameter = it.next(); + String value = request.getParameter(parameter.getName()); + if (parameter.getType().equalsIgnoreCase("boolean")){ + if (value == null){ + value = "false"; + } + } + diagrammOptions.setValue(parameter.getName(),value); + + } + sm.setDiagrammOptions(diagrammOptions); + } + } + + ArtifactDescription ad = sm.getArtifactDescription(); + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)); + + ArtifactDescription artifactDescription = adc + .getCurrentStepDescription(sm.getSelectedArtifactFactory(), + sm.getCurrentArtifact(), + true); + + Node currentUI = artifactDescription.getCurrentUI(); + XSLTransformer transformer = new XSLTransformer(); + String ui = transformer.transform(new XMLUtils().getNodeXPath( + currentUI, "dynamic"), "UTF-8", request + .getRealPath("WEB-INF/config/templates/describe-ui.xsl")); + + request.setAttribute("ui", ui); + + String staticUI = transformer + .transform( + new XMLUtils().getNodeXPath(currentUI, "static"), + "UTF-8", + request + .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl")); + request.setAttribute("staticui", staticUI); + request.setAttribute("furthertargets", + (ad.getReachableStates() != null && !ad + .getReachableStates().isEmpty())); + + if (ad.getReachableStates() != null + && !ad.getReachableStates().isEmpty()) { + } else { + request.setAttribute("diagramm", true); + } + return super.execute(mapping, form, request, response); + } catch (Exception e) { + log.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e + .getMessage()); + return super.getExceptionForward(mapping); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/action/CommunicationKeys.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/CommunicationKeys.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,13 @@ +package de.intevation.gnv.action; + +/** + * + * @author Tim Englich + * + */ +public class CommunicationKeys { + /** + * The Key which should be used for accessing ExceptionMessages + */ + public final static String REQUEST_EXCEPTION_MESSAGE_ID = "request_exception_message"; +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,60 @@ +/** + * + */ +package de.intevation.gnv.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + +/** + * @author Tim Englich + * + */ +public class DoExportAction extends DoOutputAction { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(DoExportAction.class); + + /** + * Constructor + */ + public DoExportAction() { + super(); + } + + @Override + protected void setHeaders(String target, String mimeType, + HttpServletResponse response, + HttpServletRequest request) { + log.debug("DoExportAction.setHeaders"); + try { + super.setHeaders(target, mimeType, response, request); + String fileName = "GNVEXPORT_" + System.currentTimeMillis() + "."; + + if (target.equalsIgnoreCase("chart")) { + fileName = fileName + + mimeType.substring(mimeType.indexOf("/") + 1); + } + else if (target.equalsIgnoreCase("pdf")) { + fileName = fileName + "pdf"; + } + else if (target.equalsIgnoreCase("svg")) { + fileName = fileName + "svg"; + } else if (target.equalsIgnoreCase("CSV")) { + fileName = fileName + "csv"; + } else { + fileName = fileName + "txt"; + } + log.debug("FileName for Export: " + fileName); + response.setHeader("Content-Disposition", "attachment;filename=" + + fileName); + } catch (Exception e) { + log.error(e, e); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/action/DoOutputAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoOutputAction.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,123 @@ +/** + * + */ +package de.intevation.gnv.action; + +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; + +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.DefaultInputParameter; +import de.intevation.gnv.artifactdatabase.objects.InputParameter; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; +import de.intevation.gnv.artifactdatabase.objects.OutputParameter; + +/** + * @author Tim Englich + * + */ +public class DoOutputAction extends ArtifactDatabaseActionBase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(DoOutputAction.class); + + /** + * Constructor + */ + public DoOutputAction() { + 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, + HttpServletResponse response) throws Exception { + log.debug("DoOutputAction.execute"); + try { + String target = request.getParameter("target"); + String mimeType = request.getParameter("mimetype"); + + log.debug("Target: " + target); + log.debug("MimeType: " + mimeType); + + // TODO Check if is propper; + + SessionModel sm = SessionModelFactory.getInstance() + .getSessionModel(request); + OutputMode outputMode = sm.getOutputMode(target); + if (outputMode != null && outputMode.getMimeType().equals(mimeType)) { + Collection inputParameter = outputMode + .getOutputParameters(); + Collection ips = null; + if (inputParameter != null) { + ips = new ArrayList(inputParameter.size()); + Iterator it = inputParameter.iterator(); + while (it.hasNext()) { + String name = it.next().getName(); + String[] values = request.getParameterValues(name); + InputParameter ip = new DefaultInputParameter(name, + values); + ips.add(ip); + } + } + + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)); + + this.setHeaders(target, mimeType, response, request); + + OutputStream outputStream = response.getOutputStream(); + adc.doOutput(sm.getSelectedArtifactFactory(), sm + .getCurrentArtifact(), outputStream, target, mimeType, + ips); + + outputStream.flush(); + outputStream.close(); + } else { + if (outputMode == null) { + log.error("Outputmode wird nicht unterstützt."); + } else if (!outputMode.getMimeType().equals(mimeType)) { + log.error("MimeType " + mimeType + + " wird nicht unterstützt."); + } + // TODO FIXME: Fehlerbehandlung + } + return super.execute(mapping, form, request, response); + } catch (Exception e) { + log.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e + .getMessage()); + return super.getExceptionForward(mapping); + } + } + + protected void setHeaders(String target, String mimeType, + HttpServletResponse response, + HttpServletRequest request) { + response.setHeader("Content-Type", mimeType); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,63 @@ +/** + * + */ +package de.intevation.gnv.action; + +import java.util.Collection; + +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.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; + +/** + * @author Tim Englich + * + */ +public class FetchArtifactFactoriesAction extends ArtifactDatabaseActionBase { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(FetchArtifactFactoriesAction.class); + + public FetchArtifactFactoriesAction() { + 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, + HttpServletResponse response) throws Exception { + log.debug("ArtifactDatabaseActionBase.execute"); + try { + Collection artifactFactories = ArtifactDatabaseClientFactory + .getInstance().getArtifactDatabaseClient(getLocale(request)) + .getArtifactFactories(); + SessionModel sm = SessionModelFactory.getInstance() + .getSessionModel(request); + sm.setArtifacteFactories(artifactFactories); + return super.execute(mapping, form, request, response); + } catch (Exception e) { + log.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e + .getMessage()); + return super.getExceptionForward(mapping); + } + } +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,198 @@ +/** + * + */ +package de.intevation.gnv.action; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; + +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 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.ArtifactStatisticsSet; +import de.intevation.gnv.artifactdatabase.objects.DefaultInputParameter; +import de.intevation.gnv.artifactdatabase.objects.InputParameter; +import de.intevation.gnv.util.XMLUtils; +import de.intevation.gnv.util.XSLTransformer; + +/** + * @author Tim Englich + * + */ +public class NextArtifactStepAction extends ArtifactDatabaseActionBase { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(SelectArtifactFactoryAction.class); + + /** + * Constructor + */ + public NextArtifactStepAction() { + 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, + HttpServletResponse response) throws Exception { + log.debug("NextArtifactStepAction.execute"); + SessionModel sm = SessionModelFactory.getInstance() + .getSessionModel(request); + ArtifactDescription ad = sm.getArtifactDescription(); + if (ad != null){ + Collection inputParameter = ad.getInputParameter(); + Collection ips = null; + if (inputParameter != null) { + ips = new ArrayList(inputParameter.size()); + Iterator it = inputParameter.iterator(); + while (it.hasNext()) { + String name = it.next(); + String[] values = request.getParameterValues(name); + InputParameter ip = new DefaultInputParameter(name, values); + ips.add(ip); + } + } + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)); + if (ad.getReachableStates() != null + && !ad.getReachableStates().isEmpty()) { + // TODO: Woher kommt der zu erreichende Status; + String target = null; + if (ad.getReachableStates().size() > 1) { + target = request.getParameter("product"); // TODO HACK for + // Propducts every + // other Step has + // currently only + // one reachable + // state. + } else { + target = ad.getReachableStates().iterator().next(); + } + + ArtifactDescription artifactDescription; + try { + artifactDescription = adc.doNextStep(sm.getSelectedArtifactFactory(), + sm.getCurrentArtifact(), + target, ips); + } catch (Exception e) { + log.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e + .getMessage()); + artifactDescription = sm.getArtifactDescription(); + } + + Node currentUI = artifactDescription.getCurrentUI(); + if (currentUI != null){ + XSLTransformer transformer = new XSLTransformer(); + Node dynamicUINode = new XMLUtils().getNodeXPath(currentUI,"dynamic"); + if (dynamicUINode != null){ + String ui = transformer + .transform( + dynamicUINode, + "UTF-8", + request + .getRealPath("WEB-INF/config/templates/describe-ui.xsl")); + + request.setAttribute("ui", ui); + } + + Node staticUINode = new XMLUtils().getNodeXPath(currentUI, "static"); + if (staticUINode != null){ + String staticUI = transformer + .transform( + staticUINode, + "UTF-8", + request + .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl")); + request.setAttribute("staticui", staticUI); + } + } + request.setAttribute("furthertargets", + (ad.getReachableStates() != null && !ad + .getReachableStates().isEmpty())); + + } else { + // statistic abholen und in das sessionmodell schreiben. + ArtifactDescription artifactDescription; + try{ + + Collection statistics = adc + .calculateStatistics(sm.getSelectedArtifactFactory(), + sm.getCurrentArtifact()); + sm.setStatistics(statistics); + artifactDescription = adc + .getCurrentStepDescription(sm + .getSelectedArtifactFactory(), sm + .getCurrentArtifact(), + true); + + request.setAttribute("diagramm", true); + + } catch (Exception e) { + log.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e + .getMessage()); + artifactDescription = sm.getArtifactDescription(); + } + + Node currentUI = artifactDescription.getCurrentUI(); + if (currentUI != null){ + XSLTransformer transformer = new XSLTransformer(); + Node dynamicUINode = new XMLUtils().getNodeXPath(currentUI,"dynamic"); + if (dynamicUINode != null){ + String ui = transformer + .transform( + dynamicUINode, + "UTF-8", + request + .getRealPath("WEB-INF/config/templates/describe-ui.xsl")); + + request.setAttribute("ui", ui); + } + + Node staticUINode = new XMLUtils().getNodeXPath(currentUI, "static"); + if (staticUINode != null){ + String staticUI = transformer + .transform( + staticUINode, + "UTF-8", + request + .getRealPath("WEB-INF/config/templates/describe-ui-static.xsl")); + request.setAttribute("staticui", staticUI); + } + } + request.setAttribute("furthertargets", false); + } + }else{ + log.warn("SessionTimeout has occured"); + request.setAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + "SessionTimeout has occured"); + new FetchArtifactFactoriesAction().execute(mapping, form, request, response); + } + return super.execute(mapping, form, request, response); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,99 @@ +/** + * + */ +package de.intevation.gnv.action; + +import java.util.Collection; + +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; +import de.intevation.gnv.util.XSLTransformer; + +/** + * @author Tim Englich + * + */ +public class SelectArtifactFactoryAction extends ArtifactDatabaseActionBase { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(SelectArtifactFactoryAction.class); + + /** + * @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, + HttpServletResponse response) throws Exception { + log.debug("SelectArtifactFactoryAction.execute"); + String selectedArtifactFactoryID = request + .getParameter("artifactFactory"); + log.debug("Selected ArtifactFactory ==> " + selectedArtifactFactoryID); + + try { + SessionModel sm = SessionModelFactory.getInstance() + .getSessionModel(request); + Collection artifactFactories = sm + .getArtifactFactories(); + // Löscht die Artifactspezifischen Attribute am Sessionmodel + sm.resetModel(); + if (artifactFactories == null || artifactFactories.isEmpty()) { + new FetchArtifactFactoriesAction().execute(mapping, form, + request, response); + + } + + sm.selectArtifactFactory(selectedArtifactFactoryID); + ArtifactObject af = sm.getSelectedArtifactFactory(); + ; + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)); + ArtifactObject artifact = adc.createNewArtifact(af); + sm.setCurrentArtifact(artifact); + + ArtifactDescription artifactdescription = adc + .getCurrentStepDescription(af, artifact,true); + + XSLTransformer transformer = new XSLTransformer(); + String ui = transformer.transform(artifactdescription + .getCurrentUI(), "UTF-8", request + .getRealPath("WEB-INF/config/templates/describe-ui.xsl")); + + request.setAttribute("ui", ui); + + // return succsess + return super.execute(mapping, form, request, response); + } catch (Exception e) { + log.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e + .getMessage()); + return super.getExceptionForward(mapping); + } + } + + /** + * Constructor + */ + public SelectArtifactFactoryAction() { + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,168 @@ +/** + * + */ +package de.intevation.gnv.action.sessionmodel; + +import java.util.Collection; +import java.util.Iterator; + +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; + +/** + * @author Tim Englich + * + */ +public class DefaultSessionModel implements SessionModel { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(DefaultSessionModel.class); + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 3431484439985158311L; + + private Collection artifactFactories = null; + + private ArtifactObject selectedArtifactFactory = null; + + private ArtifactObject currentArtifact = null; + + private DiagrammOptions diagrammOptions = null; + + private Collection statistics = null; + + /** + * Constructor + */ + public DefaultSessionModel() { + super(); + } + + /** + * @see de.intevation.gnv.action.sessionmodel.SessionModel#selectArtifactFactory(java.lang.String) + */ + public void selectArtifactFactory(String artiFactFactoryId) { + Collection artifactObjects = this + .getArtifactFactories(); + if (artifactObjects != null) { + Iterator unselect = artifactObjects.iterator(); + this.selectedArtifactFactory = null; + while (unselect.hasNext()) { + unselect.next().setSelected(false); + } + Iterator it = artifactObjects.iterator(); + while (it.hasNext()) { + ArtifactObject obj = it.next(); + if (obj.getId().equals(artiFactFactoryId)) { + obj.setSelected(true); + this.selectedArtifactFactory = obj; + break; + } + } + } + } + + /** + * @see de.intevation.gnv.action.sessionmodel.SessionModel#setArtifacteFactories(java.util.Collection) + */ + public void setArtifacteFactories( + Collection artifactFactories) { + this.artifactFactories = artifactFactories; + } + + /** + * @see de.intevation.gnv.action.sessionmodel.SessionModel#getAttributeFactories() + */ + public Collection getArtifactFactories() { + return this.artifactFactories; + } + + /** + * @see de.intevation.gnv.action.sessionmodel.SessionModel#getSelectedArtifactFactory() + */ + public ArtifactObject getSelectedArtifactFactory() { + return this.selectedArtifactFactory; + } + + /** + * @see de.intevation.gnv.action.sessionmodel.SessionModel#getCurrentArtifact() + */ + public ArtifactObject getCurrentArtifact() { + return this.currentArtifact; + } + + /** + * @see de.intevation.gnv.action.sessionmodel.SessionModel#setCurrentArtifact(de.intevation.gnv.artifactdatabase.objects.ArtifactObject) + */ + public void setCurrentArtifact(ArtifactObject artifact) { + this.currentArtifact = artifact; + } + + /** + * @see de.intevation.gnv.action.sessionmodel.SessionModel#getDiagrammOptions() + */ + public DiagrammOptions getDiagrammOptions() { + return this.diagrammOptions; + } + + /** + * @see de.intevation.gnv.action.sessionmodel.SessionModel#setDiagrammOptions(de.intevation.gnv.action.sessionmodel.DiagrammOptions) + */ + public void setDiagrammOptions(DiagrammOptions diagrammOptions) { + this.diagrammOptions = diagrammOptions; + } + + /** + * @see de.intevation.gnv.action.sessionmodel.SessionModel#getArtifactDescription() + */ + public ArtifactDescription getArtifactDescription() { + if (this.currentArtifact != null) { + return (ArtifactDescription) this.currentArtifact; + } + return null; + } + + /** + * @see de.intevation.gnv.action.sessionmodel.SessionModel#getOutputMode(java.lang.String) + */ + public OutputMode getOutputMode(String name) { + ArtifactDescription ad = this.getArtifactDescription(); + if (ad != null) { + if (ad.getOutputModes() != null) { + return ad.getOutputModes().get(name); + } + } + return null; + } + + /** + * @see de.intevation.gnv.action.sessionmodel.SessionModel#resetModel() + */ + public void resetModel() { + log.debug("DefaultSessionModel.resetModel"); + this.selectedArtifactFactory = null; + this.currentArtifact = null; + this.diagrammOptions = null; + this.statistics = null; + + } + + /**b + * @see de.intevation.gnv.action.sessionmodel.SessionModel#getStatistics() + */ + public Collection getStatistics() { + return this.statistics; + } + + public void setStatistics(Collection statistics) { + this.statistics = statistics; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,38 @@ +/** + * + */ +package de.intevation.gnv.action.sessionmodel; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author Tim Englich + * + */ +public class DiagrammOptions { + + private Map values = new HashMap(); + + /** + * Constructor + */ + public DiagrammOptions() { + super(); + } + + /** + * @return + */ + public String getValue(String key) { + return this.values.get(key); + } + + /** + * @param width + */ + public void setValue(String key, String value) { + this.values.put(key, value); + } + +} \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,46 @@ +/** + * + */ +package de.intevation.gnv.action.sessionmodel; + +import java.io.Serializable; +import java.util.Collection; + +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; + +/** + * @author Tim Englich + * + */ +public interface SessionModel extends Serializable { + + Collection getArtifactFactories(); + + void setArtifacteFactories(Collection artifactFactories); + + void selectArtifactFactory(String artiFactFactoryId); + + ArtifactObject getSelectedArtifactFactory(); + + ArtifactObject getCurrentArtifact(); + + void setCurrentArtifact(ArtifactObject artifact); + + void setDiagrammOptions(DiagrammOptions diagrammOptions); + + DiagrammOptions getDiagrammOptions(); + + OutputMode getOutputMode(String name); + + ArtifactDescription getArtifactDescription(); + + void resetModel(); + + void setStatistics(Collection statistics); + + Collection getStatistics(); + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,67 @@ +/** + * + */ +package de.intevation.gnv.action.sessionmodel; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.log4j.Logger; + +/** + * @author Tim Englich + * + */ +public class SessionModelFactory { + + public final static String SESSION_MODEL_ID = "de.intevation.gnv.action.sessionmodel.SessionModel.ID"; + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(SessionModelFactory.class); + + /** + * The singleton Instance of this Factory. + */ + private static SessionModelFactory instance = null; + + /** + * Constructor + */ + private SessionModelFactory() { + super(); + } + + /** + * This Method provides an singleton Instance of this Class. + * + * @return an singleton Instance of this Class + */ + public static SessionModelFactory getInstance() { + if (instance == null) { + instance = new SessionModelFactory(); + } + return instance; + } + + /** + * Getting the ArtifactDatabaseClient + * + * @return the ArtifactDatabaseClient + */ + public SessionModel getSessionModel(HttpServletRequest request) { + synchronized (this.getClass()) { + SessionModel sm = null; + if (request.getSession().getAttribute(SESSION_MODEL_ID) != null) { + sm = (SessionModel) request.getSession().getAttribute( + SESSION_MODEL_ID); + ; + } else { + sm = new DefaultSessionModel(); + request.getSession().setAttribute(SESSION_MODEL_ID, sm); + } + + return sm; + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,111 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.client; + +import java.io.OutputStream; +import java.util.Collection; +import java.util.Locale; + +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; +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.InputParameter; + +/** + * @author Tim Englich + * + */ +public interface ArtifactDatabaseClient { + + public final static String ARTIFACTDATABASE_COUNT_ID = "de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.count"; + + public final static String ARTIFACTDATABASE_URL_ID = "de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.url"; + + /** + * Return the Artifactfactories which can be resolved. + * + * @return the Artifactfactories which can be resolved. + * @throws ArtifactDatabaseClientException + */ + public Collection getArtifactFactories() + throws ArtifactDatabaseClientException; + + /** + * + * @param artifactFactory + * @return the new Artifact + * @throws ArtifactDatabaseClientException + */ + public ArtifactObject createNewArtifact(ArtifactObject artifactFactory) + throws ArtifactDatabaseClientException; + + /** + * + * @param currentArtifact + * @return the Current Artifact + * @throws ArtifactDatabaseClientException + */ + public ArtifactDescription getCurrentStepDescription( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + boolean includeUI) + throws ArtifactDatabaseClientException; + + /** + * + * @param artifactFactory + * @param currentArtifact + * @param target + * @param inputParameter + * @return + * @throws ArtifactDatabaseClientException + */ + public ArtifactDescription doNextStep( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + String target, + Collection inputParameter) + throws ArtifactDatabaseClientException; + + /** + * @param artifactFactory + * @param currentArtifact + * @param inputParameter + * @return + * @throws ArtifactDatabaseClientException + */ + public void doFeed(ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + Collection inputParameter) + throws ArtifactDatabaseClientException; + + /** + * + * @param artifactFactory + * @param currentArtifact + * @param stream + * @param targetName + * @param mimeType + * @throws ArtifactDatabaseClientException + */ + public void doOutput(ArtifactObject artifactFactory, + ArtifactObject currentArtifact, OutputStream stream, + String targetName, String mimeType, + Collection inputParameter) + throws ArtifactDatabaseClientException; + + /** + * @param artifactFactory + * @param currentArtifact + * @return + * @throws ArtifactDatabaseClientException + */ + public Collection calculateStatistics( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact) + throws ArtifactDatabaseClientException; + + public void setLocale(Locale locale); +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,58 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.client; + +import org.apache.log4j.Logger; + +import java.util.Locale; + +/** + * @author Tim Englich + * + */ +public class ArtifactDatabaseClientFactory { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(ArtifactDatabaseClientFactory.class); + + /** + * The singleton Instance of this Factory. + */ + private static ArtifactDatabaseClientFactory instance = null; + + /** + * Constructor + */ + private ArtifactDatabaseClientFactory() { + super(); + } + + /** + * This Method provides an singleton Instance of this Class. + * + * @return an singleton Instance of this Class + */ + public static synchronized ArtifactDatabaseClientFactory getInstance() { + if (instance == null) { + instance = new ArtifactDatabaseClientFactory(); + } + return instance; + } + + /** + * Getting the ArtifactDatabaseClient + * @param locale teh Local that should be used for the Communication + * @return the ArtifactDatabaseClient + */ + public ArtifactDatabaseClient getArtifactDatabaseClient(Locale locale) { + DefaultArtifactDatabaseClient adc = new DefaultArtifactDatabaseClient(); + adc.setLocale(locale); + return adc; + + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,746 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.client; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; +import java.util.List; +import java.util.Locale; + +import org.apache.log4j.Logger; + +import org.restlet.Client; + +import org.restlet.data.Method; +import org.restlet.data.Protocol; +import org.restlet.data.Request; +import org.restlet.data.Response; +import org.restlet.data.Preference; +import org.restlet.data.Language; +import org.restlet.data.ClientInfo; + +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.objects.Artifact; +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.DefaultArtifactStatisticValue; +import de.intevation.gnv.artifactdatabase.objects.DefaultArtifactStatisticsSet; +import de.intevation.gnv.artifactdatabase.objects.DefaultOutputMode; +import de.intevation.gnv.artifactdatabase.objects.DefaultOutputParameter; +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.propertiesreader.PropertiesReader; +import de.intevation.gnv.propertiesreader.PropertiesReaderFactory; +import de.intevation.gnv.util.XMLUtils; + +/** + * @author Tim Englich + * + */ +public class DefaultArtifactDatabaseClient implements ArtifactDatabaseClient { + /** + * The URI of the namespace of the artifacts. + */ + public final static String NAMESPACE_URI = "http://www.intevation.de/2009/artifacts"; + + /** + * The XML prefix for the artifacts namespace. + */ + public final static String NAMESPACE_PREFIX = "art"; + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(DefaultArtifactDatabaseClient.class); + + /** + * The Databases which could be used + */ + private static Collection artifactDatabases = null; + + /** + * Is the Class initialized? + */ + private static boolean initialized = false; + + /** + * Request locale + */ + private Locale locale; + + + /** + * Constructor + */ + public DefaultArtifactDatabaseClient() { + + } + + /** + * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#getArtifactFactories() + */ + public Collection getArtifactFactories() + throws ArtifactDatabaseClientException { + Collection resultValues = null; + if (!initialized) { + this.initialize(); + } + try { + log.debug("DefaultArtifactDatabaseClient.getArtifactFactories"); + Iterator it = artifactDatabases.iterator(); + while (it.hasNext()) { + String server = it.next(); + String url = server + "/factories"; + Document document = this.doGetRequest(url); + if (resultValues == null) { + resultValues = this.getArtifactFactories(document, server); + } else { + resultValues.addAll(this.getArtifactFactories(document, + server)); + } + } + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + return resultValues; + } + + private Collection getArtifactFactories(Document document, + String server) { + XMLUtils xmlUtils = new XMLUtils(); + NodeList artifactFactories = xmlUtils.getNodeSetXPath(document, + "/result/factories/factory"); + Collection resultValues = new ArrayList( + artifactFactories.getLength()); + if (artifactFactories != null) { + for (int i = 0; i < artifactFactories.getLength(); i++) { + Node artifactFactoryNode = artifactFactories.item(i); + String name = xmlUtils.getStringXPath(artifactFactoryNode, + "@name"); + String description = xmlUtils.getStringXPath( + artifactFactoryNode, "@description"); + ArtifactFactory artifactFactory = new ArtifactFactory(name, + description, server); + resultValues.add(artifactFactory); + } + } + return resultValues; + } + + /** + * @throws IOException + */ + private Document doGetRequest(String requestUrl) throws IOException, + ArtifactDatabaseClientException { + return this.doGetRequest(requestUrl, null); + } + + /** + * @throws IOException + */ + private Document doGetRequest(String requestUrl, Document requestBody) + throws IOException, + ArtifactDatabaseClientException { + XMLUtils xmlUtils = new XMLUtils(); + Representation output = doGetRequestInternal(requestUrl, requestBody); + Document document = xmlUtils.readDocument(output.getStream()); + this.check4ExceptionReport(document); + return document; + } + + protected Request initialize(Request request) { + return initialize(request, locale); + } + + protected Request initialize(Request request, Locale locale) { + if (locale != null) { + ClientInfo clientInfo = request.getClientInfo(); + String lang = locale.getLanguage(); + Language language = new Language(lang); + List> acceptedLanguages = + new ArrayList>(2); + acceptedLanguages.add(new Preference(language, 1.0f)); + acceptedLanguages.add(new Preference(Language.ALL, 0.5f)); + clientInfo.setAcceptedLanguages(acceptedLanguages); + } + return request; + } + + /** + * @param requestUrl + * @param requestBody + * @return + */ + private Representation doGetRequestInternal(String requestUrl, + Document requestBody) throws IOException { + Client client = new Client(Protocol.HTTP); + Request request = initialize(new Request(Method.GET, requestUrl)); + if (requestBody != null) { + String documentBody = new XMLUtils() + .writeDocument2String(requestBody); + Representation representation = new StringRepresentation( + documentBody); + request.setEntity(representation); + } + Response response = client.handle(request); + if (response.getStatus().getCode() != 200){ + throw new IOException(response.getStatus().getDescription()); + } + Representation output = response.getEntity(); + return output; + } + + /** + * @throws IOException + */ + private InputStream doPostRequest(String requestUrl, Document requestBody) + throws IOException { + log.debug("##################################################"); + log.debug(new XMLUtils().writeDocument2String(requestBody)); + log.debug("##################################################"); + Client client = new Client(Protocol.HTTP); + Request request = initialize(new Request(Method.POST, requestUrl)); + String documentBody = new XMLUtils().writeDocument2String(requestBody); + Representation representation = new StringRepresentation(documentBody); + request.setEntity(representation); + Response response = client.handle(request); + if (response.getStatus().getCode() != 200){ + throw new IOException(response.getStatus().getDescription()); + } + Representation output = response.getEntity(); + return output.getStream(); + } + + private synchronized void initialize() { + if (!initialized) { + PropertiesReader pr = PropertiesReaderFactory.getInstance() + .getPropertiesReader(); + int count = Integer.parseInt(pr.getPropertieValue( + ARTIFACTDATABASE_COUNT_ID, "0")); + artifactDatabases = new ArrayList(count); + for (int i = 0; i < count; i++) { + artifactDatabases.add(pr.getPropertieValue( + ARTIFACTDATABASE_URL_ID + "." + (i + 1), "N/N")); + } + initialized = true; + } + + } + + /** + * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#createNewArtifact(de.intevation.gnv.artifactdatabase.objects.ArtifactObject) + */ + public ArtifactObject createNewArtifact(ArtifactObject artifactFactory) + throws ArtifactDatabaseClientException { + + try { + Document request = this.createCreateRequestBody(artifactFactory + .getId()); + Document result = doPostRequest(artifactFactory, request, "create"); + return this.getArtifact(result); + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + } + + private ArtifactObject getArtifact(Document document) { + XMLUtils xmlUtils = new XMLUtils(); + String uuid = xmlUtils.getStringXPath(document, "/result/uuid/@value"); + String hash = xmlUtils.getStringXPath(document, "/result/hash/@value"); + log.info("NEW Artifact: " + uuid + " / " + hash); + return new Artifact(uuid, hash); + } + + private Document createCreateRequestBody(String artifactFactoryName) { + Document document = new XMLUtils().newDocument(); + Node rootNode = this.createRootNode(document); + Element typeNode = this.createArtifactElement(document, "type"); + typeNode.setAttribute("name", "create"); + rootNode.appendChild(typeNode); + + Element factoyNode = this.createArtifactElement(document, "factory"); + factoyNode.setAttribute("name", artifactFactoryName); + rootNode.appendChild(factoyNode); + + return document; + } + + private Element createRootNode(Document document) { + Element rootNode = this.createArtifactElement(document, "action"); + document.appendChild(rootNode); + return rootNode; + } + + /** + * @param document + * @return + */ + private Element createArtifactElement(Document document, String name) { + Element node = document.createElementNS(NAMESPACE_URI, name); + node.setPrefix(NAMESPACE_PREFIX); + return node; + } + + /** + * @param artifactFactory + * @param xmlUtils + * @param request + * @throws IOException + */ + private Document doPostRequest(ArtifactObject artifactFactory, + Document request, String suburl) + throws IOException, + ArtifactDatabaseClientException { + XMLUtils xmlUtils = new XMLUtils(); + String url = ((ArtifactFactory) artifactFactory).getDataBaseUrl(); + InputStream is = this.doPostRequest(url + "/" + suburl, request); + Document result = xmlUtils.readDocument(is); + this.check4ExceptionReport(result); + return result; + } + + /** + * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#getCurrentStepDescription(de.intevation.gnv.artifactdatabase.objects.ArtifactFactory, + * de.intevation.gnv.artifactdatabase.objects.ArtifactObject) + */ + public ArtifactDescription getCurrentStepDescription( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + boolean includeUI) + throws ArtifactDatabaseClientException { + try { + String url = this.getArtifactUrl(artifactFactory, currentArtifact); + Document request = this.createDescribeRequestBody(currentArtifact, + includeUI); + InputStream describeResult = this.doPostRequest(url, request); + + return this.readDescription(new XMLUtils().readDocument(describeResult), + currentArtifact); + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + } + + + private Document createDescribeRequestBody(ArtifactObject currentArtifact, + boolean includeUI){ + + Document document = new XMLUtils().newDocument(); + Node rootNode = this.createRootNode(document); + + Element typeNode = this.createArtifactElement(document, "type"); + typeNode.setAttribute("name", "describe"); + rootNode.appendChild(typeNode); + + Element uuidNode = this.createArtifactElement(document, "uuid"); + uuidNode.setAttribute("value", currentArtifact.getId()); + rootNode.appendChild(uuidNode); + + Element hashNode = this.createArtifactElement(document, "hash"); + hashNode.setAttribute("value", currentArtifact.getHash()); + rootNode.appendChild(hashNode); + Element includeUINode = this.createArtifactElement(document, "include-ui"); + includeUINode.appendChild(document.createTextNode(""+includeUI)); + rootNode.appendChild(includeUINode); + return document; + } + + /** + * @param artifactFactory + * @param currentArtifact + * @return + */ + private String getArtifactUrl(ArtifactObject artifactFactory, + ArtifactObject currentArtifact) { + String url = ((ArtifactFactory) artifactFactory).getDataBaseUrl() + + "/artifact/" + currentArtifact.getId(); + return url; + } + + private ArtifactDescription readDescription(Document document, + ArtifactObject artifact) + throws ArtifactDatabaseClientException { + // Check if there was an Error or Exception reported from the + // ArtifactDatabase + this.check4ExceptionReport(document); + XMLUtils xmlUtils = new XMLUtils(); + if (artifact instanceof ArtifactDescription) { + ArtifactDescription ad = (ArtifactDescription) artifact; + Node uiNode = xmlUtils.getNodeXPath(document, "/result/ui"); + Node outputNode = xmlUtils + .getNodeXPath(document, "/result/outputs"); + + Map outputModes = null; + if (outputNode != null) { + NodeList outputModesNodes = xmlUtils.getNodeSetXPath( + outputNode, "output"); + if (outputModesNodes != null) { + outputModes = new HashMap( + outputModesNodes.getLength()); + for (int i = 0; i < outputModesNodes.getLength(); i++) { + Node outputModeNode = outputModesNodes.item(i); + String name = xmlUtils.getStringXPath(outputModeNode, + "@name"); + String mimeType = xmlUtils.getStringXPath( + outputModeNode, "@mime-type"); + + NodeList parameterNodes = xmlUtils.getNodeSetXPath( + outputModeNode, "parameter/parameter"); + Collection parameter = null; + if (parameterNodes != null) { + parameter = new ArrayList( + parameterNodes.getLength()); + for (int j = 0; j < parameterNodes.getLength(); j++) { + Node outputParameterNode = parameterNodes + .item(j); + parameter.add(new DefaultOutputParameter( + xmlUtils.getStringXPath( + outputParameterNode, "@name"), + xmlUtils.getStringXPath( + outputParameterNode, "@value"), + xmlUtils.getStringXPath( + outputParameterNode, "@name"), + xmlUtils.getStringXPath( + outputParameterNode, "@type"))); + } + } + outputModes.put(name, new DefaultOutputMode(name, + mimeType, parameter)); + } + + } + } + + String currentState = xmlUtils.getStringXPath(document, + "/result/state/@name"); + NodeList statesList = xmlUtils.getNodeSetXPath(document, + "/result/reachable-states/state/@name"); + Collection reachableStates = new ArrayList( + statesList.getLength()); + for (int i = 0; i < statesList.getLength(); i++) { + reachableStates.add(statesList.item(i).getNodeValue()); + } + + NodeList inputNodes = xmlUtils.getNodeSetXPath(document, + "/result/model/input"); + if (inputNodes != null) { + Collection inputParameter = new ArrayList( + inputNodes.getLength()); + for (int i = 0; i < inputNodes.getLength(); i++) { + Node inputNode = inputNodes.item(i); + String name = xmlUtils.getStringXPath(inputNode, "@name"); + inputParameter.add(name); + } + ad.setInputParameter(inputParameter); + } + + ad.setOutputModes(outputModes); + ad.setCurrentOut(outputNode); + ad.setCurrentUI(uiNode); + ad.setCurrentState(currentState); + ad.setReachableStates(reachableStates); + return ad; + } else { + log.error("Artifact must be Instance of ArtifactDescription"); + throw new ArtifactDatabaseClientException( + "Artifact must be Instance of ArtifactDescription"); + } + + } + + /** + * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#doNextStep(de.intevation.gnv.artifactdatabase.objects.ArtifactObject, + * de.intevation.gnv.artifactdatabase.objects.ArtifactObject, + * java.lang.String, java.util.Collection) + */ + public ArtifactDescription doNextStep( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + String target, + Collection inputParameter) + throws ArtifactDatabaseClientException { + + try { + // 1 Feed + this.doFeed(artifactFactory, currentArtifact, inputParameter); + + // 2. Noch einmal Describe um das jetzt zu erreichende Ziel zu ermitteln + ArtifactDescription ad = this.getCurrentStepDescription(artifactFactory, + new Artifact(currentArtifact.getId(), + currentArtifact.getHash()), + false); + target = ad.getReachableStates().iterator().next(); + + // 3 Advance + String url = this.getArtifactUrl(artifactFactory, currentArtifact); + Document advanceDocument = this.createAdvanceRequestBody( + currentArtifact, target); + InputStream advanceResult = this + .doPostRequest(url, advanceDocument); + this.check4ExceptionReport(new XMLUtils() + .readDocument(advanceResult)); + // 3 Describe + return this.getCurrentStepDescription(artifactFactory, + currentArtifact,true); + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + } + + private Document createFeedRequestBody( + ArtifactObject currentArtifact, + Collection inputParameter) { + Document document = new XMLUtils().newDocument(); + Node rootNode = this.createRootNode(document); + + Element typeNode = this.createArtifactElement(document, "type"); + typeNode.setAttribute("name", "feed"); + rootNode.appendChild(typeNode); + + Element uuidNode = this.createArtifactElement(document, "uuid"); + uuidNode.setAttribute("value", currentArtifact.getId()); + rootNode.appendChild(uuidNode); + + Element hashNode = this.createArtifactElement(document, "hash"); + hashNode.setAttribute("value", currentArtifact.getHash()); + rootNode.appendChild(hashNode); + + Node dataNode = this.createParameterNodes(inputParameter, document, + "data"); + rootNode.appendChild(dataNode); + + return document; + } + + /** + * @param inputParameter + * @param document + * @param rootNode + */ + private Node createParameterNodes( + Collection inputParameter, + Document document, String nodeName) { + Element dataNode = this.createArtifactElement(document, nodeName); + + if (inputParameter != null) { + Iterator it = inputParameter.iterator(); + while (it.hasNext()) { + InputParameter ip = it.next(); + String name = ip.getName(); + String[] values = ip.getValues(); + if (values != null) { + for (int i = 0; i < values.length; i++) { + String value = values[i]; + Element inputNode = this.createArtifactElement( + document, "input"); + inputNode.setAttribute("name", name); + inputNode.setAttribute("value", value); + dataNode.appendChild(inputNode); + } + } + } + } + return dataNode; + } + + private Document createAdvanceRequestBody(ArtifactObject currentArtifact, + String target) { + Document document = new XMLUtils().newDocument(); + Node rootNode = this.createRootNode(document); + + Element typeNode = this.createArtifactElement(document, "type"); + typeNode.setAttribute("name", "advance"); + rootNode.appendChild(typeNode); + + Element uuidNode = this.createArtifactElement(document, "uuid"); + uuidNode.setAttribute("value", currentArtifact.getId()); + rootNode.appendChild(uuidNode); + + Element hashNode = this.createArtifactElement(document, "hash"); + hashNode.setAttribute("value", currentArtifact.getHash()); + rootNode.appendChild(hashNode); + Element targetNode = this.createArtifactElement(document, "target"); + targetNode.setAttribute("name", target); + rootNode.appendChild(targetNode); + return document; + } + + /** + * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#doOutput(de.intevation.gnv.artifactdatabase.objects.ArtifactObject, + * de.intevation.gnv.artifactdatabase.objects.ArtifactObject, + * java.io.OutputStream, java.lang.String, java.lang.String, + * java.util.Collection) + */ + public void doOutput(ArtifactObject artifactFactory, + ArtifactObject currentArtifact, OutputStream stream, + String targetName, String mimeType, + Collection inputParameter) + throws ArtifactDatabaseClientException { + try { + Document requestBody = this.createOutRequestBody(currentArtifact, + targetName, mimeType, inputParameter); + + String requestUrl = this.getArtifactUrl(artifactFactory, + currentArtifact) + + "/" + targetName; + InputStream is = this.doPostRequest(requestUrl, requestBody); + + byte[] b = new byte[4096]; + int i = -1; + while ((i = is.read(b)) > 0) { + stream.write(b, 0, i); + } + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + } + + private Document createOutRequestBody( + ArtifactObject currentArtifact, + String target, + String mimeType, + Collection inputParameter) { + Document document = new XMLUtils().newDocument(); + Node rootNode = this.createRootNode(document); + + Element typeNode = this.createArtifactElement(document, "type"); + typeNode.setAttribute("name", "out"); + rootNode.appendChild(typeNode); + + Element uuidNode = this.createArtifactElement(document, "uuid"); + uuidNode.setAttribute("value", currentArtifact.getId()); + rootNode.appendChild(uuidNode); + + Element hashNode = this.createArtifactElement(document, "hash"); + hashNode.setAttribute("value", currentArtifact.getHash()); + rootNode.appendChild(hashNode); + + Element outNode = this.createArtifactElement(document, "out"); + outNode.setAttribute("name", target); + rootNode.appendChild(outNode); + + Element mimeTypeNode = this.createArtifactElement(document, "mime-type"); + mimeTypeNode.setAttribute("value", mimeType); + outNode.appendChild(mimeTypeNode); + + Node parameterNode = this.createParameterNodes(inputParameter, + document, "params"); + outNode.appendChild(parameterNode); + + return document; + } + + /** + * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#doFeed(de.intevation.gnv.artifactdatabase.objects.ArtifactObject, + * de.intevation.gnv.artifactdatabase.objects.ArtifactObject, + * java.util.Collection) + */ + public void doFeed(ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + Collection inputParameter) + throws ArtifactDatabaseClientException { + + try { + Document feedDocument = this.createFeedRequestBody(currentArtifact, + inputParameter); + String url = this.getArtifactUrl(artifactFactory, currentArtifact); + InputStream feedResult = this.doPostRequest(url, feedDocument); + Document feedResultDocument = new XMLUtils() + .readDocument(feedResult); + this.check4ExceptionReport(feedResultDocument); + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + } + + private void check4ExceptionReport(Document document) + throws ArtifactDatabaseClientException { + + String message = new XMLUtils().getStringXPath(document, + "/exceptionreport/exception"); + if (message != null) { + throw new ArtifactDatabaseClientException(message); + } + + } + + public Collection calculateStatistics( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact) + throws ArtifactDatabaseClientException { + log.debug("DefaultArtifactDatabaseClient.calculateStatistics"); + Collection resultValues = null; + + try { + String targetName = "statistics"; + String requestUrl = this.getArtifactUrl(artifactFactory, + currentArtifact) + "/" + targetName; + Document requestBody = this.createOutRequestBody(currentArtifact, + targetName, "text/xml", null); + XMLUtils xmlUtils = new XMLUtils(); + InputStream is = this.doPostRequest(requestUrl, requestBody); + Document resultDocument = xmlUtils.readDocument(is); + if (resultDocument != null) { + + NodeList statisticSetNodes = xmlUtils.getNodeSetXPath(resultDocument, + "/statistics/statistic"); + resultValues = new ArrayList + (statisticSetNodes.getLength()); + for (int i = 0; i < statisticSetNodes.getLength(); i++) { + Element statisticSetNode = (Element)statisticSetNodes.item(i); + String name = statisticSetNode.getAttribute("name"); + ArtifactStatisticsSet set = + new DefaultArtifactStatisticsSet(name); + NodeList resultNodes = xmlUtils.getNodeSetXPath(statisticSetNode, + "statistic-value"); + if (resultNodes != null) { + for (int j = 0; j < resultNodes.getLength(); j++) { + Element statisticNode = (Element)resultNodes.item(j); + String statisticName = statisticNode. + getAttribute("name"); + String statisticValue = statisticNode. + getAttribute("value"); + set.addStatisticValues( + new DefaultArtifactStatisticValue + (statisticName,statisticValue)); + } + } + resultValues.add(set); + } + } + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + + return resultValues; + } + + public void setLocale(Locale locale) { + this.locale = locale; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,52 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.client.exception; + +/** + * @author Tim Englich + * + */ +public class ArtifactDatabaseClientException extends Exception { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = -8979622024425251952L; + + /** + * Constructor + */ + public ArtifactDatabaseClientException() { + super(); + } + + /** + * Constructor + * + * @param arg0 + */ + public ArtifactDatabaseClientException(String arg0) { + super(arg0); + } + + /** + * Constructor + * + * @param arg0 + */ + public ArtifactDatabaseClientException(Throwable arg0) { + super(arg0); + } + + /** + * Constructor + * + * @param arg0 + * @param arg1 + */ + public ArtifactDatabaseClientException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,179 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.Collection; +import java.util.Map; + +import org.w3c.dom.Node; + +/** + * @author Tim Englich + * + */ +public class Artifact implements ArtifactObject, ArtifactDescription { + + + /** + * The UID of this Class + */ + private static final long serialVersionUID = 8606869493141810364L; + + private String id = null; + private String hash = null; + private boolean selected = false; + + private Node currentUI = null; + private Node currentOut = null; + + private Collection reachableStates; + private Collection inputParameter; + private Map outputModes; + private String currentState = null; + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#getCurrentUI() + */ + public Node getCurrentUI() { + return currentUI; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#setCurrentUI(org.w3c.dom.Node) + */ + public void setCurrentUI(Node currentUI) { + this.currentUI = currentUI; + } + + /** + * @return the currentOut + */ + public Node getCurrentOut() { + return currentOut; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#setCurrentOut(org.w3c.dom.Node) + */ + public void setCurrentOut(Node currentOut) { + this.currentOut = currentOut; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#getReachableStates() + */ + public Collection getReachableStates() { + return reachableStates; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#setReachableStates(java.util.Collection) + */ + public void setReachableStates(Collection reachableStates) { + this.reachableStates = reachableStates; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#getCurrentState() + */ + public String getCurrentState() { + return currentState; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#setCurrentState(java.lang.String) + */ + public void setCurrentState(String currentState) { + this.currentState = currentState; + } + + /** + * Constructor + */ + public Artifact(String uuid, String hash) { + + this.id = uuid; + this.hash = hash; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getHash() + */ + public String getHash() { + return this.hash; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getDescription() + */ + public String getDescription() { + return this.id; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getId() + */ + public String getId() { + return this.id; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getName() + */ + public String getName() { + return this.id; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#isSelected() + */ + public boolean isSelected() { + return this.selected; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#setSelected(boolean) + */ + public void setSelected(boolean selected) { + this.selected = selected; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#getInputParameter() + */ + public Collection getInputParameter() { + return this.inputParameter; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#setInputParameter(java.util.Collection) + */ + public void setInputParameter(Collection inputParameter) { + this.inputParameter = inputParameter; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#getOutputModes() + */ + public Map getOutputModes() { + return this.outputModes; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#getOutputModesAsCollection() + */ + public Collection getOutputModesAsCollection() { + if (this.outputModes != null) { + return this.outputModes.values(); + } + return null; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactDescription#setOutputModes(java.util.Map) + */ + public void setOutputModes(Map outputModes) { + this.outputModes = outputModes; + } +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,82 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Map; + +import org.w3c.dom.Node; + +/** + * @author Tim Englich + * + */ +public interface ArtifactDescription extends Serializable { + + /** + * @return the currentUI + */ + public Node getCurrentUI(); + + /** + * @param currentUI + * the currentUI to set + */ + public void setCurrentUI(Node currentUI); + + /** + * @param currentOut + * the currentOut to set + */ + public void setCurrentOut(Node currentOut); + + /** + * @return the reachableStates + */ + public Collection getReachableStates(); + + /** + * @param reachableStates + * the reachableStates to set + */ + public void setReachableStates(Collection reachableStates); + + /** + * @return the currentState + */ + public String getCurrentState(); + + /** + * @param currentState + * the currentState to set + */ + public void setCurrentState(String currentState); + + /** + * @return the reachableStates + */ + public Collection getInputParameter(); + + /** + * @param inputParameter + */ + public void setInputParameter(Collection inputParameter); + + /** + * @return the reachableStates + */ + public Map getOutputModes(); + + /** + * @return the reachableStates + */ + public Collection getOutputModesAsCollection(); + + /** + * @param outputParameter + */ + public void setOutputModes(Map outputModes); + +} \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,89 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +/** + * @author Tim Englich + * + */ +public class ArtifactFactory implements ArtifactObject { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 5453748230625831527L; + + private String name = null; + + private String description = null; + + private boolean selected = false; + + private String dataBaseUrl = null; + + /** + * @return the dataBaseUrl + */ + public String getDataBaseUrl() { + return dataBaseUrl; + } + + /** + * Constructor + * + * @param name + * @param description + * @param dataBaseUrl + */ + public ArtifactFactory(String name, String description, String dataBaseUrl) { + super(); + this.name = name; + this.description = description; + this.dataBaseUrl = dataBaseUrl; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getId() + */ + public String getId() { + return this.name; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#isSelected() + */ + public boolean isSelected() { + + return this.selected; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#setSelected(boolean) + */ + public void setSelected(boolean selected) { + this.selected = selected; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getName() + */ + public String getName() { + return name; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getDescription() + */ + public String getDescription() { + return description; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactObject#getHash() + */ + public String getHash() { + return null; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,26 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * @author Tim Englich + * + */ +public interface ArtifactObject extends Serializable { + + public String getId(); + + public boolean isSelected(); + + public void setSelected(boolean selected); + + public String getName(); + + public String getDescription(); + + public String getHash(); + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,18 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * @author Tim Englich + * + */ +public interface ArtifactStatisticValue extends Serializable { + + String getKey(); + + String getValue(); + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,22 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; +import java.util.Collection; + +/** + * @author Tim Englich + * + */ +public interface ArtifactStatisticsSet extends Serializable { + + + String getName(); + + Collection getStatisticValues(); + + void addStatisticValues(ArtifactStatisticValue value); + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,35 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +/** + * @author Tim Englich + * + */ +public class DefaultArtifactStatisticValue implements ArtifactStatisticValue { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = -8409111023127835398L; + + private String key = null; + + private String value = null; + + public DefaultArtifactStatisticValue(String key, String value) { + super(); + this.key = key; + this.value = value; + } + + public String getKey() { + return this.key; + } + + public String getValue() { + return this.value; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,52 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * @author Tim Englich + * + */ +public class DefaultArtifactStatisticsSet implements ArtifactStatisticsSet{ + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 6738878381515708602L; + + private String name = null; + + private Collection statisticValues = + new ArrayList(); + /** + * Constructor + */ + public DefaultArtifactStatisticsSet(String name) { + this.name = name; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet#addStatisticValues(de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticValue) + */ + public void addStatisticValues(ArtifactStatisticValue value) { + this.statisticValues.add(value); + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet#getName() + */ + public String getName() { + return this.name; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet#getStatisticValues() + */ + public Collection getStatisticValues() { + return this.statisticValues; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,47 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +/** + * @author Tim Englich + * + */ +public class DefaultInputParameter implements InputParameter { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 6597439837482244211L; + + private String name = null; + + private String[] values = null; + + /** + * Constructor + * + * @param name + * @param values + */ + public DefaultInputParameter(String name, String[] values) { + super(); + this.name = name; + this.values = values; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.InputParameter#getName() + */ + public String getName() { + return this.name; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.InputParameter#getValues() + */ + public String[] getValues() { + return this.values; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,54 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.Collection; + +/** + * @author Tim Englich + * + */ +public class DefaultOutputMode implements OutputMode { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 7487880486604174521L; + + private String name = null; + + private String mimeType = null; + + private Collection outputParameter = null; + + public DefaultOutputMode(String name, String mimeType, + Collection outputParameter) { + super(); + this.name = name; + this.mimeType = mimeType; + this.outputParameter = outputParameter; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.OutputMode#getMimeType() + */ + public String getMimeType() { + return this.mimeType; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.OutputMode#getName() + */ + public String getName() { + return this.name; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.OutputMode#getOutputParameters() + */ + public Collection getOutputParameters() { + return this.outputParameter; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,63 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +/** + * @author Tim Englich + * + */ +public class DefaultOutputParameter implements OutputParameter { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = -8416057640116638152L; + + private String name = null; + + private String value = null; + + private String description = null; + + private String type = null; + + /** + * Constructor + * + * @param name + * @param value + * @param description + */ + public DefaultOutputParameter(String name, String value, + String description, String type) { + super(); + this.name = name; + this.value = value; + this.description = description; + this.type = type; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.OutputParameter#getName() + */ + public String getName() { + return this.name; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.OutputParameter#getValue() + */ + public String getValue() { + return this.value; + } + + public String getDescription() { + return this.description; + } + + public String getType() { + return this.type; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,18 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * @author Tim Englich + * + */ +public interface InputParameter extends Serializable { + + public String getName(); + + public String[] getValues(); + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,21 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; +import java.util.Collection; + +/** + * @author Tim Englich + * + */ +public interface OutputMode extends Serializable{ + + public String getName(); + + public String getMimeType(); + + public Collection getOutputParameters(); + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,22 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * @author Tim Englich + * + */ +public interface OutputParameter extends Serializable{ + + String getName(); + + String getValue(); + + String getDescription(); + + String getType(); + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,42 @@ +/** + * + */ +package de.intevation.gnv.propertiesreader; + +import java.util.Map; + +import org.apache.log4j.Logger; + +/** + * @author Tim Englich + * + */ +public class MapPropertiesReader implements PropertiesReader { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(MapPropertiesReader.class); + + private Map properties = null; + + /** + * Constructor + */ + public MapPropertiesReader(Map properties) { + super(); + this.properties = properties; + } + + /** + * @see de.intevation.gnv.propertiesreader.PropertiesReader#getPropertieValue(java.lang.String, + * java.lang.String) + */ + public String getPropertieValue(String key, String defaultValue) { + String value = this.properties.get(key); + if (value == null) { + value = defaultValue; + } + return value; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,14 @@ +/** + * + */ +package de.intevation.gnv.propertiesreader; + +/** + * @author Tim Englich + * + */ +public interface PropertiesReader { + + public String getPropertieValue(String key, String defaultValue); + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,81 @@ +/** + * + */ +package de.intevation.gnv.propertiesreader; + +import java.util.Map; + +import javax.servlet.ServletConfig; + +import org.apache.log4j.Logger; + +/** + * @author Tim Englich + * + */ +public class PropertiesReaderFactory { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(PropertiesReaderFactory.class); + + /** + * The singleton Instance of this Factory. + */ + private static PropertiesReaderFactory instance = null; + + /** + * The ConnectionPool providing the Connections to the DatabaseBackends + */ + private PropertiesReader propertiesReader = null; + + /** + * Constructor + */ + private PropertiesReaderFactory() { + super(); + } + + /** + * This Method provides an singleton Instance of this Class. + * + * @return an singleton Instance of this Class + */ + public static PropertiesReaderFactory getInstance() { + if (instance == null) { + instance = new PropertiesReaderFactory(); + } + return instance; + } + + /** + * Getting the ConnectionPool + * + * @return the ConnectionPool + */ + public PropertiesReader getPropertiesReader() { + return this.propertiesReader; + } + + /** + * Getting the ConnectionPool + * + * @param config + * The Config that should be read + */ + public void initPropertiesReader(Object config) { + if (config instanceof ServletConfig) { + this.propertiesReader = new ServletPropertiesReader( + (ServletConfig) config); + } else if (config instanceof Map) { + this.propertiesReader = new MapPropertiesReader( + (Map) config); + } else { + log.error("No PropertiesReader for Instance " + + config.getClass().getName()); + } + + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,58 @@ +/** + * + */ +package de.intevation.gnv.propertiesreader; + +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.ServletConfig; + +import org.apache.log4j.Logger; + +/** + * @author Tim Englich + * + */ +public class ServletPropertiesReader implements PropertiesReader { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(ServletPropertiesReader.class); + + private Map properties = null; + + /** + * Constructor + */ + public ServletPropertiesReader(ServletConfig config) { + super(); + log.info("ServletPropertiesReader will be initialized"); + if (config != null) { + + Enumeration keys = config.getInitParameterNames(); + properties = new HashMap(); + while (keys.hasMoreElements()) { + String key = keys.nextElement(); + String value = config.getInitParameter(key); + log.info("New ConbfigurationValue; " + key + " ==> " + value); + this.properties.put(key, value); + } + } + } + + /** + * @see de.intevation.gnv.propertiesreader.PropertiesReader#getPropertieValue(java.lang.String, + * java.lang.String) + */ + public String getPropertieValue(String key, String defaultValue) { + String value = this.properties.get(key); + if (value == null) { + value = defaultValue; + } + return value; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,55 @@ +/* + * + */ +package de.intevation.gnv.servlet; + +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 de.intevation.gnv.propertiesreader.PropertiesReaderFactory; + +/** + * + * @author Tim Englich + * + */ +public class GNVActionServlet extends ActionServlet { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = null; + + static { + // BasicConfigurator.configure(); + + } + + static String LOGGINIG_CONFIG_FILE_ID = "de.intevation.gnv.servlet.log4j.configuration"; + + /** + * The UID of this Class + */ + private static final long serialVersionUID = 3597396283436383943L; + + /** + * @see javax.servlet.GenericServlet#init(javax.servlet.ServletConfig) + */ + @Override + public void init(ServletConfig config) throws ServletException { + super.init(config); + try { + String path = config.getServletContext().getRealPath("/") + + config.getInitParameter(LOGGINIG_CONFIG_FILE_ID); + PropertyConfigurator.configure(path); + log = Logger.getLogger(GNVActionServlet.class); + } catch (Exception e) { + log.error(e, e); + } + log.info("PropertiesReader will be configured."); + PropertiesReaderFactory.getInstance().initPropertiesReader(config); + } +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/util/XMLUtils.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/util/XMLUtils.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,216 @@ +package de.intevation.gnv.util; + +import java.io.IOException; +import java.io.InputStream; +import java.io.StringBufferInputStream; +import java.io.StringWriter; + +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 + */ +public class XMLUtils { + private static Logger logger = Logger.getLogger(XMLUtils.class); + + public XMLUtils() { + } + + public static class ElementCreator { + protected Document document; + protected String ns; + protected String prefix; + + public ElementCreator(Document document, String ns, String prefix) { + this.document = document; + this.ns = ns; + this.prefix = prefix; + } + + public Element create(String name) { + Element element = document.createElementNS(ns, name); + element.setPrefix(prefix); + return element; + } + + public void addAttr(Element element, String name, String value) { + Attr attr = document.createAttributeNS(ns, name); + attr.setValue(value); + attr.setPrefix(prefix); + element.setAttributeNode(attr); + } + } // class ElementCreator + + public Document newDocument() { + try { + return DocumentBuilderFactory.newInstance().newDocumentBuilder() + .newDocument(); + } catch (ParserConfigurationException pce) { + logger.error(pce.getLocalizedMessage(), pce); + } + return null; + } + + public XPath newXPath() { + return newXPath(null); + } + + public XPath newXPath(NamespaceContext namespaceContext) { + XPathFactory factory = XPathFactory.newInstance(); + XPath xpath = factory.newXPath(); + if (namespaceContext != null) { + xpath.setNamespaceContext(namespaceContext); + } + return xpath; + } + + public Object xpath(Object root, String query, QName returnTyp) { + return xpath(root, query, returnTyp, null); + } + + public final String xpathString(Object root, String query, + NamespaceContext namespaceContext) { + return (String) xpath(root, query, XPathConstants.STRING, + namespaceContext); + } + + 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); + if (xpath != null) { + return xpath.evaluate(query, root, returnType); + } + } catch (XPathExpressionException xpee) { + logger.error(xpee.getLocalizedMessage(), xpee); + } + + return null; + } + + public Object getXPath(Object root, String query, QName returnType) { + return xpath(root, query, returnType); + } + + public String getStringXPath(String xpath) { + return getStringXPath(xpath, null); + } + + public NodeList getNodeSetXPath(Object root, String query) { + return (NodeList) getXPath(root, query, XPathConstants.NODESET); + } + + public Node getNodeXPath(Object root, String query) { + return (Node) getXPath(root, query, XPathConstants.NODE); + } + + public String getStringXPath(Object root, String xpath) { + return getStringXPath(root, xpath, null); + } + + public String getStringXPath(Object root, String query, String def) { + String s = (String) getXPath(root, query, XPathConstants.STRING); + return s == null || s.length() == 0 ? def : s; + } + + public Document readDocument(InputStream inputStream) { + Document returnValue = null; + try { + DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory + .newInstance(); + DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder(); + returnValue = docBuilder.parse(inputStream); + } catch (ParserConfigurationException e) { + logger.error(e, e); + } catch (SAXException e) { + logger.error(e, e); + } catch (IOException e) { + logger.error(e, e); + } + return returnValue; + } + + public String writeNode2String(Node node) { + try { + DOMSource source = new DOMSource(node); + return writeDOMSource2String(source); + } catch (TransformerConfigurationException e) { + logger.error(e, e); + } catch (TransformerFactoryConfigurationError e) { + logger.error(e, e); + } catch (TransformerException e) { + logger.error(e, e); + } + return null; + } + + public Document reInitDocument(Document document) { + + StringBufferInputStream inputStream = new StringBufferInputStream(this + .writeDocument2String(document)); + return this.readDocument(inputStream); + } + + public String writeDocument2String(Document document) { + try { + DOMSource source = new DOMSource(document); + return writeDOMSource2String(source); + } catch (TransformerConfigurationException e) { + logger.error(e, e); + } catch (TransformerFactoryConfigurationError e) { + logger.error(e, e); + } catch (TransformerException e) { + logger.error(e, e); + } + return null; + } + + /** + * @param source + * @return + * @throws TransformerFactoryConfigurationError + * @throws TransformerConfigurationException + * @throws TransformerException + */ + private String writeDOMSource2String(DOMSource source) + throws TransformerFactoryConfigurationError, + TransformerConfigurationException, + TransformerException { + TransformerFactory transformerFactory = TransformerFactory + .newInstance(); + Transformer transformer = transformerFactory.newTransformer(); + StringWriter sw = new StringWriter(); + StreamResult result = new StreamResult(sw); + transformer.transform(source, result); + return sw.getBuffer().toString(); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,68 @@ +/** + * + */ +package de.intevation.gnv.util; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.UnsupportedEncodingException; + +import javax.xml.transform.Source; +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.transform.stream.StreamSource; + +import org.apache.log4j.Logger; +import org.w3c.dom.Node; + +/** + * @author Tim Englich + * + */ +public class XSLTransformer { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(XSLTransformer.class); + + /** + * Constructor + */ + public XSLTransformer() { + super(); + } + + public String transform(Node toTransform, String encoding, + String templateFileName) { + String resultValue = null; + try { + XMLUtils xmlUtils = new XMLUtils(); + Source templateSource = new StreamSource(new File(templateFileName)); + TransformerFactory xformFactory = TransformerFactory.newInstance(); + Transformer transformer = xformFactory + .newTransformer(templateSource); + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + StreamResult scrResult = new StreamResult(baos); + // log.debug(xmlUtils.writeNode2String(toTransform)); + DOMSource source = new DOMSource(toTransform); + transformer.transform(source, scrResult); + resultValue = new String(baos.toByteArray(), encoding); + } catch (TransformerConfigurationException e) { + log.error(e, e); + } catch (UnsupportedEncodingException e) { + log.error(e, e); + } catch (TransformerFactoryConfigurationError e) { + log.error(e, e); + } catch (TransformerException e) { + log.error(e, e); + } + + return resultValue; + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/resources/applicationMessages.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/resources/applicationMessages.properties Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,81 @@ +# application.properties +application.name=${pom.name} +application.version=${pom.version} +application.releasedate=${timestamp} + +gnviewer.app.title = BSH-GDI genericViewer + +gnviewer.project.save = Projekt speichern +gnviewer.project.load = Projekt laden +gnviewer.project.load.button = Laden + +gnviewer.fis.fis_marnet = Marnet +gnviewer.fis.fis_imis = IMIS +gnviewer.fis.fis_staun = STAUN +gnviewer.fis.fis_modeldata = Modelldaten +gnviewer.fis.fis_delphin = Delphin +gnviewer.fis.fis_thermosalinograph = Thermosalinograph +gnviewer.fis.fis_chemusurvey = Chemusurvey +gnviewer.fis.fis_gts = GTS +gnviewer.fis.fis_bsh_ctd = CTD +gnviewer.fis.fis_bsh_xbt = XBT +gnviewer.fis.fis_eisklimatologie = Eisklimatologie +gnviewer.fis.fis_sst = SST +gnviewer.fis.fis_seastate = Seegangsarchiv +gnviewer.fis.fis_seacat = SeaCat +gnviewer.fis.fis_currentmeter = Strommesser +gnviewer.fis.fis_icestations = Eismeldungen + +gnviewer.select.button = Ausw\u00e4hlen +gnviewer.draw.button = Zeichnen + +gnviewer.productselection.overlay.title = Die Anfrage wird bearbeitet, bitte gedulden Sie sich einen Moment. +gnviewer.productselection.fisselection.title = Fachinformationssystem + +# Statistik +gnviewer.statistics.header.title=Datenstatistik +gnviewer.statistics.table.header.param=Parameter +gnviewer.statistics.table.header.value=Wert +gnviewer.statistics.series=Series +gnviewer.statistics.descriptive.arithmeticMean=Arithmetisches Mittel +gnviewer.statistics.descriptive.geometricMean=Geometrisches Mittel +gnviewer.statistics.descriptive.kurtosis=Kurtosis +gnviewer.statistics.descriptive.kurtosisClass=kurtosisClass +gnviewer.statistics.descriptive.max=Maximum +gnviewer.statistics.descriptive.min=Minimum +gnviewer.statistics.descriptive.n=Anzahl Werte +gnviewer.statistics.descriptive.percentile.90=Perzentil (90/10) +gnviewer.statistics.descriptive.percentile.75=Perzentil (75/25) +gnviewer.statistics.descriptive.percentile.50=Perzentil (50/50) +gnviewer.statistics.descriptive.percentile.10=Perzentil (10/90) +gnviewer.statistics.descriptive.deviation=Standardabweichung +gnviewer.statistics.descriptive.variance=Varianz +gnviewer.statistics.descriptive.intercept=Intercept +gnviewer.statistics.descriptive.slope=Steigung + +# diagram options dialog +gnviewer.diagram.options.header.title=Diagrammoptionen + + +# attachedOutputOptions +gnviewer.output.options.diagramm.alt=Diagramm +gnviewer.output.options.save.title=Diagramm speichern +gnviewer.output.options.export.csv.title=Daten als CSV exportieren +gnviewer.output.options.export.odv.title=Daten als ODV exportieren +gnviewer.output.options.export.pdf.title=Diagramm als PDF exportieren +gnviewer.output.options.export.svg.title=Diagramm als SVG exportieren + +height=H\u00f6he +width=Breite + + + +# Fehlermeldungen: + +java.io.ioexception..connection.refused=Die Verbindung zur Artifaktdatenbank ist unterbrochen. Bitte probieren Sie es zu einem sp\u00e4teren Zeitpunkt erneut. +java.io.ioexception..unable.to.parse.the.response.http.version..end.of.stream.reached.too.early=Die Verbindung zur Artifaktdatenbank wurde unerwartet unterbrochen. +no.inputdata.given..please.select.at.least.one.entry=Es wurde kein Eintrag ausgew\u00e4hlt. Bitte w\u00e4hlen sie mindestens einen Eintrag aus. +de.intevation.gnv.geobackend.base.query.exception.queryexception..java.sql.sqlexception =Es ist ein interner Serverfehler aufgetreten. Bitte benachrichtigen Sie den Support. +java.io.ioexception..the.server.encountered.an.unexpected.condition.which.prevented.it.from.fulfilling.the.request=Es ist ein interner Serverfehler aufgetreten. Bitte benachrichtigen Sie den Support. +java.lang.illegalargumentexception..inputstream.cannot.be.null=Es ist ein interner Serverfehler aufgetreten. Bitte benachrichtigen Sie den Support. + diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/resources/applicationMessages_en.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/resources/applicationMessages_en.properties Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,76 @@ +# application.properties +application.name=${pom.name} +application.version=${pom.version} +application.releasedate=${timestamp} + +gnviewer.app.title = BSH-GDI genericViewer + +gnviewer.project.save = Save Project +gnviewer.project.load = Load Project +gnviewer.project.load.button = Load + +gnviewer.fis.fis_marnet = Marnet +gnviewer.fis.fis_imis = IMIS +gnviewer.fis.fis_staun = STAUN +gnviewer.fis.fis_modeldata = Modeldata +gnviewer.fis.fis_delphin = Delphin +gnviewer.fis.fis_thermosalinograph = Thermosalinograph +gnviewer.fis.fis_chemusurvey = Chemusurvey +gnviewer.fis.fis_gts = GTS +gnviewer.fis.fis_bsh_ctd = CTD +gnviewer.fis.fis_bsh_xbt = XBT +gnviewer.fis.fis_eisklimatologie = Iceclimatology +gnviewer.fis.fis_sst = SST +gnviewer.fis.fis_seastate = Sea State +gnviewer.fis.fis_seacat = SeaCat +gnviewer.fis.fis_currentmeter = Current Meter +gnviewer.fis.fis_icestations = Ice Station Report + +gnviewer.select.button = Choose +gnviewer.draw.button = Draw + +gnviewer.productselection.overlay.title = Your request will be processed. Please wait... +gnviewer.productselection.fisselection.title = Data set + +# Statistik +gnviewer.statistics.header.title=Statistics +gnviewer.statistics.table.header.param=Parameter +gnviewer.statistics.table.header.value=Value +gnviewer.statistics.series=Series +gnviewer.statistics.descriptive.arithmeticMean=Arithmetic mean +gnviewer.statistics.descriptive.geometricMean=Geometric Mean +gnviewer.statistics.descriptive.kurtosis=Kurtosis +gnviewer.statistics.descriptive.kurtosisClass=kurtosisClass +gnviewer.statistics.descriptive.max=Maximum +gnviewer.statistics.descriptive.min=Minimum +gnviewer.statistics.descriptive.n=Number of Values +gnviewer.statistics.descriptive.percentile.90=Percentile (90/10) +gnviewer.statistics.descriptive.percentile.75=Percentile (75/25) +gnviewer.statistics.descriptive.percentile.50=Percentile (50/50) +gnviewer.statistics.descriptive.percentile.10=Percentile (90/10) +gnviewer.statistics.descriptive.deviation=Standard deviation +gnviewer.statistics.descriptive.variance=Variance +gnviewer.statistics.descriptive.intercept=Intercept +gnviewer.statistics.descriptive.slope=Increase + +# diagram options dialog +gnviewer.diagram.options.header.title=Diagram options + + +# attachedOutputOptions +gnviewer.output.options.diagramm.alt=Diagram +gnviewer.output.options.save.title=Save Diagram +gnviewer.output.options.export.csv.title=Export Data as CSV +gnviewer.output.options.export.odv.title=Export Data as ODV +gnviewer.output.options.export.pdf.title=Export chart as PDF +gnviewer.output.options.export.svg.title=Export chart as SVG + +height=Height +width=Width + +java.io.ioexception..connection.refused = 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. diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/META-INF/context.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/META-INF/context.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,2 @@ + + diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/config/log4j.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/config/log4j.properties Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,13 @@ +# Set root logger level to DEBUG and its only appender to A1. +log4j.rootLogger=DEBUG, A1 + +# A1 is set to be a ConsoleAppender. +log4j.appender.A1=org.apache.log4j.ConsoleAppender + +# A1 uses PatternLayout. +log4j.appender.A1.layout=org.apache.log4j.PatternLayout +log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n + +# Abschalten des geschwätzigen Loggings in dre Klasse JspServlet +log4j.category.org.apache.jasper.servlet.JspServlet=WARN +log4j.category.org.apache.catalina.core.ContainerBase=WARN \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/config/struts-config.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/config/struts-config.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,69 @@ + + + + + + +
+
+
+ + +
+
+
  +
+ + +
+
+
+ + +
+
+
+
+ + + + + + + + + + + + + + + +
+
+
+ + +
+
+
+
+ + + + + + + : + + + + + + + +
\ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,58 @@ + + + + + + + + +
+    
+ + + + +
+    
+ + + + + + + + + + + + + + + + +     + + + + + + + Beispiel WKT-Linestring einfügen:
+
+ + + + : + + + +
+
+ + + +
diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/jsp/footer.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/footer.jsp Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,6 @@ +<%@ 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" %> + +<%--div style="clear: left; margin-top: 40px;"/--%> \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/jsp/header.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/header.jsp Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,43 @@ +<%@ 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://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles"%> +<% Object exceptionMessage = request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID); + exceptionMessage = (exceptionMessage != null ? exceptionMessage.toString().replaceAll(" ", ".").replaceAll(":",".").toLowerCase() : null); + exceptionMessage = (exceptionMessage != null && exceptionMessage.toString().endsWith(".") ? exceptionMessage.toString().substring(0,exceptionMessage.toString().length()-1) : exceptionMessage); + +%> +<%@page import="de.intevation.gnv.action.CommunicationKeys"%> + + + diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,4 @@ +
+ + +
\ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,85 @@ +<%@ 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"%> +<%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> +<%@page import="java.util.Collection"%> +<%@page import="java.util.Iterator"%> +<%@page import="java.net.URLEncoder"%> +<%Object diagramm = request.getAttribute("diagramm"); +SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); +if (diagramm != null){ + String target = "chart"; + String targetCSV = "csv"; + String targetODV = "odv"; + String targetPDF = "pdf"; + String targetSVG = "svg"; + boolean supportChart = sm.getOutputMode(target) != null; + boolean supportCSV = sm.getOutputMode(targetCSV) != null; + boolean supportODV = sm.getOutputMode(targetODV) != null; + boolean supportPDF = sm.getOutputMode(targetPDF) != null; + boolean supportSVG = sm.getOutputMode(targetSVG) != null; + String mimeType = null; + String parameterString = ""; + if (supportChart){ + mimeType = sm.getOutputMode(target).getMimeType(); + DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); + Collection op = sm.getOutputMode(target).getOutputParameters(); + if (op != null){ + Iterator it = op.iterator(); + while (it.hasNext()){ + OutputParameter parameter = it.next(); + parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); + } + } + } + String mimeTypePDF = null; + if (supportPDF) { + mimeTypePDF = sm.getOutputMode(targetPDF).getMimeType(); + } + String mimeTypeSVG = null; + if (supportSVG) { + mimeTypeSVG = sm.getOutputMode(targetSVG).getMimeType(); + mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8"); + } + String mimeTypeCSV = null; + if (supportCSV){ + mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); + } + + String mimeTypeODV = null; + if (supportODV){ + mimeTypeODV = sm.getOutputMode(targetODV).getMimeType(); + } +%> +
+ <bean:message key="gnviewer.output.options.diagramm.alt"/> +
+
+ "> + + + <%if (supportPDF) { %> + "> + + + <%}%> + <%if (supportSVG) { %> + "> + + + <%}%> + <%if (supportCSV) { %> + "> + + + <%}%> + <%if (supportODV) { %> + "> + + + <%}%> +
+ +
+<%}%> diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,51 @@ +<%@ 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.DiagrammOptions"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.OutputMode"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@page import="java.util.Collection"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> +<%@page import="java.util.Iterator"%> +<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); + boolean useDiagrammOptions = diagrammOptions != null; + String target = "chart"; + OutputMode outputMode = sm.getOutputMode(target); +%> +
+
+ + + +
"> + + <%if (outputMode != null && outputMode.getOutputParameters() != null && !outputMode.getOutputParameters().isEmpty()){ + Iterator it = outputMode.getOutputParameters().iterator(); + while (it.hasNext()){ + OutputParameter om = it.next(); %> + + + + + <%}%> +
+ + + <%if (om.getType().equalsIgnoreCase("boolean")){ + boolean checked = useDiagrammOptions ? "true".equalsIgnoreCase(diagrammOptions.getValue(om.getName())) : om.getValue().equalsIgnoreCase("true"); + %> + /> + <%}else{%> + + <%}%> +
+ + "/> + <%}%> +
+
+
\ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,43 @@ +<%@ 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"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="java.util.Collection"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticValue"%> +<%@page import="java.util.Iterator"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet"%>
+<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + Collection statistics = sm.getStatistics(); +%> +
+ + + + <%if (statistics != null){ + Iterator it = statistics.iterator(); + while (it.hasNext()){ + ArtifactStatisticsSet set = it.next(); + %> +
+

<%=set.getName()%>

+ + + + + + <% Iterator sit = set.getStatisticValues().iterator(); + while (sit.hasNext()){ + ArtifactStatisticValue asv = sit.next(); + %> + + + + + <%}%> +
<%=asv.getValue()%>
+ <%} %> +
+ <%}%> +
+
\ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,31 @@ +<%@ 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"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="java.util.Collection"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.ArtifactObject"%> +<%@page import="java.util.Iterator"%> +<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + Collection artifactFactories = sm.getArtifactFactories(); + String prefix = "gnviewer.fis."; +%> +
+
" method="post"> +
+ + <%if (artifactFactories != null){%> + + + <%}%> +
+ " /> +
+
+
\ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/jsp/index.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/index.jsp Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,38 @@ +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@page import="java.util.Collection"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.ArtifactObject"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="java.util.Iterator"%> +<%Object ui = request.getAttribute("ui"); + Object staticui = request.getAttribute("staticui"); + boolean furthertargets = true; + + Object furthertargetsObject = request.getAttribute("furthertargets"); + if (furthertargetsObject != null){ + furthertargets = ((Boolean)furthertargetsObject).booleanValue(); + } +%> +
+ + <%if (staticui != null){ %> + <%=staticui.toString()%> + <%}%> + + <%if (ui != null){%> +
+
") method="post"> +
+ <%=ui != null ? ui.toString().replaceAll(" ", "") : "" %> + + <%if(furthertargets){%> + "/> + <%}else{%> + "/> + <%}%> +
+
+
+ <%}%> +
+ \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,49 @@ + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> + + + + <bean:message key="gnviewer.app.title"/> + + + + + + + + + + + + + + +
+
+
+

+ +

+
+
+
+ + + +
+ + diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/jsp/version.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/version.jsp Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,45 @@ + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> + + + + <bean:message key="gnviewer.app.title"/> + + + + + + + + + + + + + +
+
+
+

+ +

+
+
+
+ +
+
+

Generischer Viewer

+ Name:
+ Version:
+ Date:
+

Artifaktdatenbank

+ Name: N/N
+ Version: N/N
+ Date: N/N
+
+ +
+ + \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/WEB-INF/web.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/web.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,52 @@ + + + + Archetype Created Web Application + + action + de.intevation.gnv.servlet.GNVActionServlet + + + + config + /WEB-INF/config/struts-config.xml + + + + + de.intevation.gnv.servlet.log4j.configuration + WEB-INF/config/log4j.properties + + + + + de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.count + 1 + + + + + de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.url.1 + http://localhost:8181 + + + + 1 + + + + + action + *.do + + diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/images/bg_fieldset.gif Binary file gnv/src/main/webapp/images/bg_fieldset.gif has changed diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/images/bg_fieldset_ie6.gif Binary file gnv/src/main/webapp/images/bg_fieldset_ie6.gif has changed diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/images/bsh_logo.gif Binary file gnv/src/main/webapp/images/bsh_logo.gif has changed diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/images/data_export.png Binary file gnv/src/main/webapp/images/data_export.png has changed diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/images/diagram_export.png Binary file gnv/src/main/webapp/images/diagram_export.png has changed diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/images/img.gif Binary file gnv/src/main/webapp/images/img.gif has changed diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/images/list-item.gif Binary file gnv/src/main/webapp/images/list-item.gif has changed diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/images/stock_data-save.png Binary file gnv/src/main/webapp/images/stock_data-save.png has changed diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/index.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/index.jsp Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,2 @@ +<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> + diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/scripts/calendar-de.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/calendar-de.js Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,129 @@ +// ** I18N + +// Calendar DE language +// Author: Jack (tR), +// Encoding: any +// Distributed under the same terms as the calendar itself. + +// For translators: please use UTF-8 if possible. We strongly believe that +// Unicode is the answer to a real internationalized world. Also please +// include your contact information in the header, as can be seen above. + +// full day names +Calendar._DN = new Array +("Sonntag", + "Montag", + "Dienstag", + "Mittwoch", + "Donnerstag", + "Freitag", + "Samstag", + "Sonntag"); + +// Please note that the following array of short day names (and the same goes +// for short month names, _SMN) isn't absolutely necessary. We give it here +// for exemplification on how one can customize the short day names, but if +// they are simply the first N letters of the full name you can simply say: +// +// Calendar._SDN_len = N; // short day name length +// Calendar._SMN_len = N; // short month name length +// +// If N = 3 then this is not needed either since we assume a value of 3 if not +// present, to be compatible with translation files that were written before +// this feature. + +// short day names +Calendar._SDN = new Array +("So", + "Mo", + "Di", + "Mi", + "Do", + "Fr", + "Sa", + "So"); + + // First day of the week. "0" means display Sunday first, "1" means display +// Monday first, etc. +Calendar._FD = 0; + + +// full month names +Calendar._MN = new Array +("Januar", + "Februar", + "M\u00e4rz", + "April", + "Mai", + "Juni", + "Juli", + "August", + "September", + "Oktober", + "November", + "Dezember"); + +// short month names +Calendar._SMN = new Array +("Jan", + "Feb", + "M\u00e4r", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Okt", + "Nov", + "Dez"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["INFO"] = "\u00DCber dieses Kalendarmodul"; + +Calendar._TT["ABOUT"] = +"DHTML Date/Time Selector\n" + +"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this ;-) +"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + +"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + +"\n\n" + +"Datum ausw\u00e4hlen:\n" + +"- Benutzen Sie die \xab, \xbb Buttons um das Jahr zu w\u00e4hlen\n" + +"- Benutzen Sie die " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " Buttons um den Monat zu w\u00e4hlen\n" + +"- F\u00fcr eine Schnellauswahl halten Sie die Maustaste \u00fcber diesen Buttons fest."; +Calendar._TT["ABOUT_TIME"] = "\n\n" + +"Zeit ausw\u00e4hlen:\n" + +"- Klicken Sie auf die Teile der Uhrzeit, um diese zu erh\u00F6hen\n" + +"- oder klicken Sie mit festgehaltener Shift-Taste um diese zu verringern\n" + +"- oder klicken und festhalten f\u00fcr Schnellauswahl."; + +Calendar._TT["TOGGLE"] = "Ersten Tag der Woche w\u00e4hlen"; +Calendar._TT["PREV_YEAR"] = "Voriges Jahr (Festhalten f\u00fcr Schnellauswahl)"; +Calendar._TT["PREV_MONTH"] = "Voriger Monat (Festhalten f\u00fcr Schnellauswahl)"; +Calendar._TT["GO_TODAY"] = "Heute ausw\u00e4hlen"; +Calendar._TT["NEXT_MONTH"] = "N\u00e4chst. Monat (Festhalten f\u00fcr Schnellauswahl)"; +Calendar._TT["NEXT_YEAR"] = "N\u00e4chst. Jahr (Festhalten f\u00fcr Schnellauswahl)"; +Calendar._TT["SEL_DATE"] = "Datum ausw\u00e4hlen"; +Calendar._TT["DRAG_TO_MOVE"] = "Zum Bewegen festhalten"; +Calendar._TT["PART_TODAY"] = " (Heute)"; + +// the following is to inform that "%s" is to be the first day of week +// %s will be replaced with the day name. +Calendar._TT["DAY_FIRST"] = "Woche beginnt mit %s "; + +// This may be locale-dependent. It specifies the week-end days, as an array +// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 +// means Monday, etc. +Calendar._TT["WEEKEND"] = "0,6"; + +Calendar._TT["CLOSE"] = "Schlie\u00dfen"; +Calendar._TT["TODAY"] = "Heute"; +Calendar._TT["TIME_PART"] = "(Shift-)Klick oder Festhalten und Ziehen um den Wert zu \u00e4ndern"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "%d.%m.%Y"; +Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; + +Calendar._TT["WK"] = "wk"; +Calendar._TT["TIME"] = "Zeit:"; diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/scripts/calendar-en.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/calendar-en.js Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,127 @@ +// ** I18N + +// Calendar EN language +// Author: Mihai Bazon, +// Encoding: any +// Distributed under the same terms as the calendar itself. + +// For translators: please use UTF-8 if possible. We strongly believe that +// Unicode is the answer to a real internationalized world. Also please +// include your contact information in the header, as can be seen above. + +// full day names +Calendar._DN = new Array +("Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", + "Sunday"); + +// Please note that the following array of short day names (and the same goes +// for short month names, _SMN) isn't absolutely necessary. We give it here +// for exemplification on how one can customize the short day names, but if +// they are simply the first N letters of the full name you can simply say: +// +// Calendar._SDN_len = N; // short day name length +// Calendar._SMN_len = N; // short month name length +// +// If N = 3 then this is not needed either since we assume a value of 3 if not +// present, to be compatible with translation files that were written before +// this feature. + +// short day names +Calendar._SDN = new Array +("Sun", + "Mon", + "Tue", + "Wed", + "Thu", + "Fri", + "Sat", + "Sun"); + +// First day of the week. "0" means display Sunday first, "1" means display +// Monday first, etc. +Calendar._FD = 0; + +// full month names +Calendar._MN = new Array +("January", + "February", + "March", + "April", + "May", + "June", + "July", + "August", + "September", + "October", + "November", + "December"); + +// short month names +Calendar._SMN = new Array +("Jan", + "Feb", + "Mar", + "Apr", + "May", + "Jun", + "Jul", + "Aug", + "Sep", + "Oct", + "Nov", + "Dec"); + +// tooltips +Calendar._TT = {}; +Calendar._TT["INFO"] = "About the calendar"; + +Calendar._TT["ABOUT"] = +"DHTML Date/Time Selector\n" + +"(c) dynarch.com 2002-2005 / Author: Mihai Bazon\n" + // don't translate this this ;-) +"For latest version visit: http://www.dynarch.com/projects/calendar/\n" + +"Distributed under GNU LGPL. See http://gnu.org/licenses/lgpl.html for details." + +"\n\n" + +"Date selection:\n" + +"- Use the \xab, \xbb buttons to select year\n" + +"- Use the " + String.fromCharCode(0x2039) + ", " + String.fromCharCode(0x203a) + " buttons to select month\n" + +"- Hold mouse button on any of the above buttons for faster selection."; +Calendar._TT["ABOUT_TIME"] = "\n\n" + +"Time selection:\n" + +"- Click on any of the time parts to increase it\n" + +"- or Shift-click to decrease it\n" + +"- or click and drag for faster selection."; + +Calendar._TT["PREV_YEAR"] = "Prev. year (hold for menu)"; +Calendar._TT["PREV_MONTH"] = "Prev. month (hold for menu)"; +Calendar._TT["GO_TODAY"] = "Go Today"; +Calendar._TT["NEXT_MONTH"] = "Next month (hold for menu)"; +Calendar._TT["NEXT_YEAR"] = "Next year (hold for menu)"; +Calendar._TT["SEL_DATE"] = "Select date"; +Calendar._TT["DRAG_TO_MOVE"] = "Drag to move"; +Calendar._TT["PART_TODAY"] = " (today)"; + +// the following is to inform that "%s" is to be the first day of week +// %s will be replaced with the day name. +Calendar._TT["DAY_FIRST"] = "Display %s first"; + +// This may be locale-dependent. It specifies the week-end days, as an array +// of comma-separated numbers. The numbers are from 0 to 6: 0 means Sunday, 1 +// means Monday, etc. +Calendar._TT["WEEKEND"] = "0,6"; + +Calendar._TT["CLOSE"] = "Close"; +Calendar._TT["TODAY"] = "Today"; +Calendar._TT["TIME_PART"] = "(Shift-)Click or drag to change value"; + +// date formats +Calendar._TT["DEF_DATE_FORMAT"] = "%Y-%m-%d"; +Calendar._TT["TT_DATE_FORMAT"] = "%a, %b %e"; + +Calendar._TT["WK"] = "wk"; +Calendar._TT["TIME"] = "Time:"; diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/scripts/calendar-setup.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/calendar-setup.js Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,200 @@ +/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ + * --------------------------------------------------------------------------- + * + * The DHTML Calendar + * + * Details and latest version at: + * http://dynarch.com/mishoo/calendar.epl + * + * This script is distributed under the GNU Lesser General Public License. + * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html + * + * This file defines helper functions for setting up the calendar. They are + * intended to help non-programmers get a working calendar on their site + * quickly. This script should not be seen as part of the calendar. It just + * shows you what one can do with the calendar, while in the same time + * providing a quick and simple method for setting it up. If you need + * exhaustive customization of the calendar creation process feel free to + * modify this code to suit your needs (this is recommended and much better + * than modifying calendar.js itself). + */ + +// $Id: calendar-setup.js,v 1.1 2007/12/06 13:55:16 drewnak Exp $ + +/** + * This function "patches" an input field (or other element) to use a calendar + * widget for date selection. + * + * The "params" is a single object that can have the following properties: + * + * prop. name | description + * ------------------------------------------------------------------------------------------------- + * inputField | the ID of an input field to store the date + * displayArea | the ID of a DIV or other element to show the date + * button | ID of a button or other element that will trigger the calendar + * eventName | event that will trigger the calendar, without the "on" prefix (default: "click") + * ifFormat | date format that will be stored in the input field + * daFormat | the date format that will be used to display the date in displayArea + * singleClick | (true/false) wether the calendar is in single click mode or not (default: true) + * firstDay | numeric: 0 to 6. "0" means display Sunday first, "1" means display Monday first, etc. + * align | alignment (default: "Br"); if you don't know what's this see the calendar documentation + * range | array with 2 elements. Default: [1900, 2999] -- the range of years available + * weekNumbers | (true/false) if it's true (default) the calendar will display week numbers + * flat | null or element ID; if not null the calendar will be a flat calendar having the parent with the given ID + * flatCallback | function that receives a JS Date object and returns an URL to point the browser to (for flat calendar) + * disableFunc | function that receives a JS Date object and should return true if that date has to be disabled in the calendar + * onSelect | function that gets called when a date is selected. You don't _have_ to supply this (the default is generally okay) + * onClose | function that gets called when the calendar is closed. [default] + * onUpdate | function that gets called after the date is updated in the input field. Receives a reference to the calendar. + * date | the date that the calendar will be initially displayed to + * showsTime | default: false; if true the calendar will include a time selector + * timeFormat | the time format; can be "12" or "24", default is "12" + * electric | if true (default) then given fields/date areas are updated for each move; otherwise they're updated only on close + * step | configures the step of the years in drop-down boxes; default: 2 + * position | configures the calendar absolute position; default: null + * cache | if "true" (but default: "false") it will reuse the same calendar object, where possible + * showOthers | if "true" (but default: "false") it will show days from other months too + * + * None of them is required, they all have default values. However, if you + * pass none of "inputField", "displayArea" or "button" you'll get a warning + * saying "nothing to setup". + */ +Calendar.setup = function (params) { + function param_default(pname, def) { if (typeof params[pname] == "undefined") { params[pname] = def; } }; + + param_default("inputField", null); + param_default("displayArea", null); + param_default("button", null); + param_default("eventName", "click"); + param_default("ifFormat", "%Y/%m/%d"); + param_default("daFormat", "%Y/%m/%d"); + param_default("singleClick", true); + param_default("disableFunc", null); + param_default("dateStatusFunc", params["disableFunc"]); // takes precedence if both are defined + param_default("dateText", null); + param_default("firstDay", null); + param_default("align", "Br"); + param_default("range", [1900, 2999]); + param_default("weekNumbers", true); + param_default("flat", null); + param_default("flatCallback", null); + param_default("onSelect", null); + param_default("onClose", null); + param_default("onUpdate", null); + param_default("date", null); + param_default("showsTime", false); + param_default("timeFormat", "24"); + param_default("electric", true); + param_default("step", 2); + param_default("position", null); + param_default("cache", false); + param_default("showOthers", false); + param_default("multiple", null); + + var tmp = ["inputField", "displayArea", "button"]; + for (var i in tmp) { + if (typeof params[tmp[i]] == "string") { + params[tmp[i]] = document.getElementById(params[tmp[i]]); + } + } + if (!(params.flat || params.multiple || params.inputField || params.displayArea || params.button)) { + alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code"); + return false; + } + + function onSelect(cal) { + var p = cal.params; + var update = (cal.dateClicked || p.electric); + if (update && p.inputField) { + p.inputField.value = cal.date.print(p.ifFormat); + if (typeof p.inputField.onchange == "function") + p.inputField.onchange(); + } + if (update && p.displayArea) + p.displayArea.innerHTML = cal.date.print(p.daFormat); + if (update && typeof p.onUpdate == "function") + p.onUpdate(cal); + if (update && p.flat) { + if (typeof p.flatCallback == "function") + p.flatCallback(cal); + } + if (update && p.singleClick && cal.dateClicked) + cal.callCloseHandler(); + }; + + if (params.flat != null) { + if (typeof params.flat == "string") + params.flat = document.getElementById(params.flat); + if (!params.flat) { + alert("Calendar.setup:\n Flat specified but can't find parent."); + return false; + } + var cal = new Calendar(params.firstDay, params.date, params.onSelect || onSelect); + cal.showsOtherMonths = params.showOthers; + cal.showsTime = params.showsTime; + cal.time24 = (params.timeFormat == "24"); + cal.params = params; + cal.weekNumbers = params.weekNumbers; + cal.setRange(params.range[0], params.range[1]); + cal.setDateStatusHandler(params.dateStatusFunc); + cal.getDateText = params.dateText; + if (params.ifFormat) { + cal.setDateFormat(params.ifFormat); + } + if (params.inputField && typeof params.inputField.value == "string") { + cal.parseDate(params.inputField.value); + } + cal.create(params.flat); + cal.show(); + return false; + } + + var triggerEl = params.button || params.displayArea || params.inputField; + triggerEl["on" + params.eventName] = function() { + var dateEl = params.inputField || params.displayArea; + var dateFmt = params.inputField ? params.ifFormat : params.daFormat; + var mustCreate = false; + var cal = window.calendar; + if (dateEl) + params.date = Date.parseDate(dateEl.value || dateEl.innerHTML, dateFmt); + if (!(cal && params.cache)) { + window.calendar = cal = new Calendar(params.firstDay, + params.date, + params.onSelect || onSelect, + params.onClose || function(cal) { cal.hide(); }); + cal.showsTime = params.showsTime; + cal.time24 = (params.timeFormat == "24"); + cal.weekNumbers = params.weekNumbers; + mustCreate = true; + } else { + if (params.date) + cal.setDate(params.date); + cal.hide(); + } + if (params.multiple) { + cal.multiple = {}; + for (var i = params.multiple.length; --i >= 0;) { + var d = params.multiple[i]; + var ds = d.print("%Y%m%d"); + cal.multiple[ds] = d; + } + } + cal.showsOtherMonths = params.showOthers; + cal.yearStep = params.step; + cal.setRange(params.range[0], params.range[1]); + cal.params = params; + cal.setDateStatusHandler(params.dateStatusFunc); + cal.getDateText = params.dateText; + cal.setDateFormat(dateFmt); + if (mustCreate) + cal.create(); + cal.refresh(); + if (!params.position) + cal.showAtElement(params.button || params.displayArea || params.inputField, params.align); + else + cal.showAt(params.position[0], params.position[1]); + return false; + }; + + return cal; +}; diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/scripts/calendar-setup_stripped.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/calendar-setup_stripped.js Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,21 @@ +/* Copyright Mihai Bazon, 2002, 2003 | http://dynarch.com/mishoo/ + * --------------------------------------------------------------------------- + * + * The DHTML Calendar + * + * Details and latest version at: + * http://dynarch.com/mishoo/calendar.epl + * + * This script is distributed under the GNU Lesser General Public License. + * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html + * + * This file defines helper functions for setting up the calendar. They are + * intended to help non-programmers get a working calendar on their site + * quickly. This script should not be seen as part of the calendar. It just + * shows you what one can do with the calendar, while in the same time + * providing a quick and simple method for setting it up. If you need + * exhaustive customization of the calendar creation process feel free to + * modify this code to suit your needs (this is recommended and much better + * than modifying calendar.js itself). + */ + Calendar.setup=function(params){function param_default(pname,def){if(typeof params[pname]=="undefined"){params[pname]=def;}};param_default("inputField",null);param_default("displayArea",null);param_default("button",null);param_default("eventName","click");param_default("ifFormat","%Y/%m/%d");param_default("daFormat","%Y/%m/%d");param_default("singleClick",true);param_default("disableFunc",null);param_default("dateStatusFunc",params["disableFunc"]);param_default("dateText",null);param_default("firstDay",null);param_default("align","Br");param_default("range",[1900,2999]);param_default("weekNumbers",true);param_default("flat",null);param_default("flatCallback",null);param_default("onSelect",null);param_default("onClose",null);param_default("onUpdate",null);param_default("date",null);param_default("showsTime",false);param_default("timeFormat","24");param_default("electric",true);param_default("step",2);param_default("position",null);param_default("cache",false);param_default("showOthers",false);param_default("multiple",null);var tmp=["inputField","displayArea","button"];for(var i in tmp){if(typeof params[tmp[i]]=="string"){params[tmp[i]]=document.getElementById(params[tmp[i]]);}}if(!(params.flat||params.multiple||params.inputField||params.displayArea||params.button)){alert("Calendar.setup:\n Nothing to setup (no fields found). Please check your code");return false;}function onSelect(cal){var p=cal.params;var update=(cal.dateClicked||p.electric);if(update&&p.inputField){p.inputField.value=cal.date.print(p.ifFormat);if(typeof p.inputField.onchange=="function")p.inputField.onchange();}if(update&&p.displayArea)p.displayArea.innerHTML=cal.date.print(p.daFormat);if(update&&typeof p.onUpdate=="function")p.onUpdate(cal);if(update&&p.flat){if(typeof p.flatCallback=="function")p.flatCallback(cal);}if(update&&p.singleClick&&cal.dateClicked)cal.callCloseHandler();};if(params.flat!=null){if(typeof params.flat=="string")params.flat=document.getElementById(params.flat);if(!params.flat){alert("Calendar.setup:\n Flat specified but can't find parent.");return false;}var cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect);cal.showsOtherMonths=params.showOthers;cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.params=params;cal.weekNumbers=params.weekNumbers;cal.setRange(params.range[0],params.range[1]);cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;if(params.ifFormat){cal.setDateFormat(params.ifFormat);}if(params.inputField&&typeof params.inputField.value=="string"){cal.parseDate(params.inputField.value);}cal.create(params.flat);cal.show();return false;}var triggerEl=params.button||params.displayArea||params.inputField;triggerEl["on"+params.eventName]=function(){var dateEl=params.inputField||params.displayArea;var dateFmt=params.inputField?params.ifFormat:params.daFormat;var mustCreate=false;var cal=window.calendar;if(dateEl)params.date=Date.parseDate(dateEl.value||dateEl.innerHTML,dateFmt);if(!(cal&¶ms.cache)){window.calendar=cal=new Calendar(params.firstDay,params.date,params.onSelect||onSelect,params.onClose||function(cal){cal.hide();});cal.showsTime=params.showsTime;cal.time24=(params.timeFormat=="24");cal.weekNumbers=params.weekNumbers;mustCreate=true;}else{if(params.date)cal.setDate(params.date);cal.hide();}if(params.multiple){cal.multiple={};for(var i=params.multiple.length;--i>=0;){var d=params.multiple[i];var ds=d.print("%Y%m%d");cal.multiple[ds]=d;}}cal.showsOtherMonths=params.showOthers;cal.yearStep=params.step;cal.setRange(params.range[0],params.range[1]);cal.params=params;cal.setDateStatusHandler(params.dateStatusFunc);cal.getDateText=params.dateText;cal.setDateFormat(dateFmt);if(mustCreate)cal.create();cal.refresh();if(!params.position)cal.showAtElement(params.button||params.displayArea||params.inputField,params.align);else cal.showAt(params.position[0],params.position[1]);return false;};return cal;}; \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/scripts/calendar.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/calendar.js Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,1806 @@ +/* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo + * ----------------------------------------------------------- + * + * The DHTML Calendar, version 1.0 "It is happening again" + * + * Details and latest version at: + * www.dynarch.com/projects/calendar + * + * This script is developed by Dynarch.com. Visit us at www.dynarch.com. + * + * This script is distributed under the GNU Lesser General Public License. + * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html + */ + +// $Id: calendar.js,v 1.1 2007/12/06 13:55:16 drewnak Exp $ + +/** The Calendar object constructor. */ +Calendar = function (firstDayOfWeek, dateStr, onSelected, onClose) { + // member variables + this.activeDiv = null; + this.currentDateEl = null; + this.getDateStatus = null; + this.getDateToolTip = null; + this.getDateText = null; + this.timeout = null; + this.onSelected = onSelected || null; + this.onClose = onClose || null; + this.dragging = false; + this.hidden = false; + this.minYear = 1970; + this.maxYear = 2050; + this.dateFormat = Calendar._TT["DEF_DATE_FORMAT"]; + this.ttDateFormat = Calendar._TT["TT_DATE_FORMAT"]; + this.isPopup = true; + this.weekNumbers = true; + this.firstDayOfWeek = typeof firstDayOfWeek == "number" ? firstDayOfWeek : Calendar._FD; // 0 for Sunday, 1 for Monday, etc. + this.showsOtherMonths = false; + this.dateStr = dateStr; + this.ar_days = null; + this.showsTime = false; + this.time24 = true; + this.yearStep = 2; + this.hiliteToday = true; + this.multiple = null; + // HTML elements + this.table = null; + this.element = null; + this.tbody = null; + this.firstdayname = null; + // Combo boxes + this.monthsCombo = null; + this.yearsCombo = null; + this.hilitedMonth = null; + this.activeMonth = null; + this.hilitedYear = null; + this.activeYear = null; + // Information + this.dateClicked = false; + + // one-time initializations + if (typeof Calendar._SDN == "undefined") { + // table of short day names + if (typeof Calendar._SDN_len == "undefined") + Calendar._SDN_len = 3; + var ar = new Array(); + for (var i = 8; i > 0;) { + ar[--i] = Calendar._DN[i].substr(0, Calendar._SDN_len); + } + Calendar._SDN = ar; + // table of short month names + if (typeof Calendar._SMN_len == "undefined") + Calendar._SMN_len = 3; + ar = new Array(); + for (var i = 12; i > 0;) { + ar[--i] = Calendar._MN[i].substr(0, Calendar._SMN_len); + } + Calendar._SMN = ar; + } +}; + +// ** constants + +/// "static", needed for event handlers. +Calendar._C = null; + +/// detect a special case of "web browser" +Calendar.is_ie = ( /msie/i.test(navigator.userAgent) && + !/opera/i.test(navigator.userAgent) ); + +Calendar.is_ie5 = ( Calendar.is_ie && /msie 5\.0/i.test(navigator.userAgent) ); + +/// detect Opera browser +Calendar.is_opera = /opera/i.test(navigator.userAgent); + +/// detect KHTML-based browsers +Calendar.is_khtml = /Konqueror|Safari|KHTML/i.test(navigator.userAgent); + +// BEGIN: UTILITY FUNCTIONS; beware that these might be moved into a separate +// library, at some point. + +Calendar.getAbsolutePos = function(el) { + var SL = 0, ST = 0; + var is_div = /^div$/i.test(el.tagName); + if (is_div && el.scrollLeft) + SL = el.scrollLeft; + if (is_div && el.scrollTop) + ST = el.scrollTop; + var r = { x: el.offsetLeft - SL, y: el.offsetTop - ST }; + if (el.offsetParent) { + var tmp = this.getAbsolutePos(el.offsetParent); + r.x += tmp.x; + r.y += tmp.y; + } + return r; +}; + +Calendar.isRelated = function (el, evt) { + var related = evt.relatedTarget; + if (!related) { + var type = evt.type; + if (type == "mouseover") { + related = evt.fromElement; + } else if (type == "mouseout") { + related = evt.toElement; + } + } + while (related) { + if (related == el) { + return true; + } + related = related.parentNode; + } + return false; +}; + +Calendar.removeClass = function(el, className) { + if (!(el && el.className)) { + return; + } + var cls = el.className.split(" "); + var ar = new Array(); + for (var i = cls.length; i > 0;) { + if (cls[--i] != className) { + ar[ar.length] = cls[i]; + } + } + el.className = ar.join(" "); +}; + +Calendar.addClass = function(el, className) { + Calendar.removeClass(el, className); + el.className += " " + className; +}; + +// FIXME: the following 2 functions totally suck, are useless and should be replaced immediately. +Calendar.getElement = function(ev) { + var f = Calendar.is_ie ? window.event.srcElement : ev.currentTarget; + while (f.nodeType != 1 || /^div$/i.test(f.tagName)) + f = f.parentNode; + return f; +}; + +Calendar.getTargetElement = function(ev) { + var f = Calendar.is_ie ? window.event.srcElement : ev.target; + while (f.nodeType != 1) + f = f.parentNode; + return f; +}; + +Calendar.stopEvent = function(ev) { + ev || (ev = window.event); + if (Calendar.is_ie) { + ev.cancelBubble = true; + ev.returnValue = false; + } else { + ev.preventDefault(); + ev.stopPropagation(); + } + return false; +}; + +Calendar.addEvent = function(el, evname, func) { + if (el.attachEvent) { // IE + el.attachEvent("on" + evname, func); + } else if (el.addEventListener) { // Gecko / W3C + el.addEventListener(evname, func, true); + } else { + el["on" + evname] = func; + } +}; + +Calendar.removeEvent = function(el, evname, func) { + if (el.detachEvent) { // IE + el.detachEvent("on" + evname, func); + } else if (el.removeEventListener) { // Gecko / W3C + el.removeEventListener(evname, func, true); + } else { + el["on" + evname] = null; + } +}; + +Calendar.createElement = function(type, parent) { + var el = null; + if (document.createElementNS) { + // use the XHTML namespace; IE won't normally get here unless + // _they_ "fix" the DOM2 implementation. + el = document.createElementNS("http://www.w3.org/1999/xhtml", type); + } else { + el = document.createElement(type); + } + if (typeof parent != "undefined") { + parent.appendChild(el); + } + return el; +}; + +// END: UTILITY FUNCTIONS + +// BEGIN: CALENDAR STATIC FUNCTIONS + +/** Internal -- adds a set of events to make some element behave like a button. */ +Calendar._add_evs = function(el) { + with (Calendar) { + addEvent(el, "mouseover", dayMouseOver); + addEvent(el, "mousedown", dayMouseDown); + addEvent(el, "mouseout", dayMouseOut); + if (is_ie) { + addEvent(el, "dblclick", dayMouseDblClick); + el.setAttribute("unselectable", true); + } + } +}; + +Calendar.findMonth = function(el) { + if (typeof el.month != "undefined") { + return el; + } else if (typeof el.parentNode.month != "undefined") { + return el.parentNode; + } + return null; +}; + +Calendar.findYear = function(el) { + if (typeof el.year != "undefined") { + return el; + } else if (typeof el.parentNode.year != "undefined") { + return el.parentNode; + } + return null; +}; + +Calendar.showMonthsCombo = function () { + var cal = Calendar._C; + if (!cal) { + return false; + } + var cal = cal; + var cd = cal.activeDiv; + var mc = cal.monthsCombo; + if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + if (cal.activeMonth) { + Calendar.removeClass(cal.activeMonth, "active"); + } + var mon = cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()]; + Calendar.addClass(mon, "active"); + cal.activeMonth = mon; + var s = mc.style; + s.display = "block"; + if (cd.navtype < 0) + s.left = cd.offsetLeft + "px"; + else { + var mcw = mc.offsetWidth; + if (typeof mcw == "undefined") + // Konqueror brain-dead techniques + mcw = 50; + s.left = (cd.offsetLeft + cd.offsetWidth - mcw) + "px"; + } + s.top = (cd.offsetTop + cd.offsetHeight) + "px"; +}; + +Calendar.showYearsCombo = function (fwd) { + var cal = Calendar._C; + if (!cal) { + return false; + } + var cal = cal; + var cd = cal.activeDiv; + var yc = cal.yearsCombo; + if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + if (cal.activeYear) { + Calendar.removeClass(cal.activeYear, "active"); + } + cal.activeYear = null; + var Y = cal.date.getFullYear() + (fwd ? 1 : -1); + var yr = yc.firstChild; + var show = false; + for (var i = 12; i > 0; --i) { + if (Y >= cal.minYear && Y <= cal.maxYear) { + yr.innerHTML = Y; + yr.year = Y; + yr.style.display = "block"; + show = true; + } else { + yr.style.display = "none"; + } + yr = yr.nextSibling; + Y += fwd ? cal.yearStep : -cal.yearStep; + } + if (show) { + var s = yc.style; + s.display = "block"; + if (cd.navtype < 0) + s.left = cd.offsetLeft + "px"; + else { + var ycw = yc.offsetWidth; + if (typeof ycw == "undefined") + // Konqueror brain-dead techniques + ycw = 50; + s.left = (cd.offsetLeft + cd.offsetWidth - ycw) + "px"; + } + s.top = (cd.offsetTop + cd.offsetHeight) + "px"; + } +}; + +// event handlers + +Calendar.tableMouseUp = function(ev) { + var cal = Calendar._C; + if (!cal) { + return false; + } + if (cal.timeout) { + clearTimeout(cal.timeout); + } + var el = cal.activeDiv; + if (!el) { + return false; + } + var target = Calendar.getTargetElement(ev); + ev || (ev = window.event); + Calendar.removeClass(el, "active"); + if (target == el || target.parentNode == el) { + Calendar.cellClick(el, ev); + } + var mon = Calendar.findMonth(target); + var date = null; + if (mon) { + date = new Date(cal.date); + if (mon.month != date.getMonth()) { + date.setMonth(mon.month); + cal.setDate(date); + cal.dateClicked = false; + cal.callHandler(); + } + } else { + var year = Calendar.findYear(target); + if (year) { + date = new Date(cal.date); + if (year.year != date.getFullYear()) { + date.setFullYear(year.year); + cal.setDate(date); + cal.dateClicked = false; + cal.callHandler(); + } + } + } + with (Calendar) { + removeEvent(document, "mouseup", tableMouseUp); + removeEvent(document, "mouseover", tableMouseOver); + removeEvent(document, "mousemove", tableMouseOver); + cal._hideCombos(); + _C = null; + return stopEvent(ev); + } +}; + +Calendar.tableMouseOver = function (ev) { + var cal = Calendar._C; + if (!cal) { + return; + } + var el = cal.activeDiv; + var target = Calendar.getTargetElement(ev); + if (target == el || target.parentNode == el) { + Calendar.addClass(el, "hilite active"); + Calendar.addClass(el.parentNode, "rowhilite"); + } else { + if (typeof el.navtype == "undefined" || (el.navtype != 50 && (el.navtype == 0 || Math.abs(el.navtype) > 2))) + Calendar.removeClass(el, "active"); + Calendar.removeClass(el, "hilite"); + Calendar.removeClass(el.parentNode, "rowhilite"); + } + ev || (ev = window.event); + if (el.navtype == 50 && target != el) { + var pos = Calendar.getAbsolutePos(el); + var w = el.offsetWidth; + var x = ev.clientX; + var dx; + var decrease = true; + if (x > pos.x + w) { + dx = x - pos.x - w; + decrease = false; + } else + dx = pos.x - x; + + if (dx < 0) dx = 0; + var range = el._range; + var current = el._current; + var count = Math.floor(dx / 10) % range.length; + for (var i = range.length; --i >= 0;) + if (range[i] == current) + break; + while (count-- > 0) + if (decrease) { + if (--i < 0) + i = range.length - 1; + } else if ( ++i >= range.length ) + i = 0; + var newval = range[i]; + el.innerHTML = newval; + + cal.onUpdateTime(); + } + var mon = Calendar.findMonth(target); + if (mon) { + if (mon.month != cal.date.getMonth()) { + if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + Calendar.addClass(mon, "hilite"); + cal.hilitedMonth = mon; + } else if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + } else { + if (cal.hilitedMonth) { + Calendar.removeClass(cal.hilitedMonth, "hilite"); + } + var year = Calendar.findYear(target); + if (year) { + if (year.year != cal.date.getFullYear()) { + if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + Calendar.addClass(year, "hilite"); + cal.hilitedYear = year; + } else if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + } else if (cal.hilitedYear) { + Calendar.removeClass(cal.hilitedYear, "hilite"); + } + } + return Calendar.stopEvent(ev); +}; + +Calendar.tableMouseDown = function (ev) { + if (Calendar.getTargetElement(ev) == Calendar.getElement(ev)) { + return Calendar.stopEvent(ev); + } +}; + +Calendar.calDragIt = function (ev) { + var cal = Calendar._C; + if (!(cal && cal.dragging)) { + return false; + } + var posX; + var posY; + if (Calendar.is_ie) { + posY = window.event.clientY + document.body.scrollTop; + posX = window.event.clientX + document.body.scrollLeft; + } else { + posX = ev.pageX; + posY = ev.pageY; + } + cal.hideShowCovered(); + var st = cal.element.style; + st.left = (posX - cal.xOffs) + "px"; + st.top = (posY - cal.yOffs) + "px"; + return Calendar.stopEvent(ev); +}; + +Calendar.calDragEnd = function (ev) { + var cal = Calendar._C; + if (!cal) { + return false; + } + cal.dragging = false; + with (Calendar) { + removeEvent(document, "mousemove", calDragIt); + removeEvent(document, "mouseup", calDragEnd); + tableMouseUp(ev); + } + cal.hideShowCovered(); +}; + +Calendar.dayMouseDown = function(ev) { + var el = Calendar.getElement(ev); + if (el.disabled) { + return false; + } + var cal = el.calendar; + cal.activeDiv = el; + Calendar._C = cal; + if (el.navtype != 300) with (Calendar) { + if (el.navtype == 50) { + el._current = el.innerHTML; + addEvent(document, "mousemove", tableMouseOver); + } else + addEvent(document, Calendar.is_ie5 ? "mousemove" : "mouseover", tableMouseOver); + addClass(el, "hilite active"); + addEvent(document, "mouseup", tableMouseUp); + } else if (cal.isPopup) { + cal._dragStart(ev); + } + if (el.navtype == -1 || el.navtype == 1) { + if (cal.timeout) clearTimeout(cal.timeout); + cal.timeout = setTimeout("Calendar.showMonthsCombo()", 250); + } else if (el.navtype == -2 || el.navtype == 2) { + if (cal.timeout) clearTimeout(cal.timeout); + cal.timeout = setTimeout((el.navtype > 0) ? "Calendar.showYearsCombo(true)" : "Calendar.showYearsCombo(false)", 250); + } else { + cal.timeout = null; + } + return Calendar.stopEvent(ev); +}; + +Calendar.dayMouseDblClick = function(ev) { + Calendar.cellClick(Calendar.getElement(ev), ev || window.event); + if (Calendar.is_ie) { + document.selection.empty(); + } +}; + +Calendar.dayMouseOver = function(ev) { + var el = Calendar.getElement(ev); + if (Calendar.isRelated(el, ev) || Calendar._C || el.disabled) { + return false; + } + if (el.ttip) { + if (el.ttip.substr(0, 1) == "_") { + el.ttip = el.caldate.print(el.calendar.ttDateFormat) + el.ttip.substr(1); + } + el.calendar.tooltips.innerHTML = el.ttip; + } + if (el.navtype != 300) { + Calendar.addClass(el, "hilite"); + if (el.caldate) { + Calendar.addClass(el.parentNode, "rowhilite"); + } + } + return Calendar.stopEvent(ev); +}; + +Calendar.dayMouseOut = function(ev) { + with (Calendar) { + var el = getElement(ev); + if (isRelated(el, ev) || _C || el.disabled) + return false; + removeClass(el, "hilite"); + if (el.caldate) + removeClass(el.parentNode, "rowhilite"); + if (el.calendar) + el.calendar.tooltips.innerHTML = _TT["SEL_DATE"]; + return stopEvent(ev); + } +}; + +/** + * A generic "click" handler :) handles all types of buttons defined in this + * calendar. + */ +Calendar.cellClick = function(el, ev) { + var cal = el.calendar; + var closing = false; + var newdate = false; + var date = null; + if (typeof el.navtype == "undefined") { + if (cal.currentDateEl) { + Calendar.removeClass(cal.currentDateEl, "selected"); + Calendar.addClass(el, "selected"); + closing = (cal.currentDateEl == el); + if (!closing) { + cal.currentDateEl = el; + } + } + cal.date.setDateOnly(el.caldate); + date = cal.date; + var other_month = !(cal.dateClicked = !el.otherMonth); + if (!other_month && !cal.currentDateEl) + cal._toggleMultipleDate(new Date(date)); + else + newdate = !el.disabled; + // a date was clicked + if (other_month) + cal._init(cal.firstDayOfWeek, date); + } else { + if (el.navtype == 200) { + Calendar.removeClass(el, "hilite"); + cal.callCloseHandler(); + return; + } + date = new Date(cal.date); + if (el.navtype == 0) + date.setDateOnly(new Date()); // TODAY + // unless "today" was clicked, we assume no date was clicked so + // the selected handler will know not to close the calenar when + // in single-click mode. + // cal.dateClicked = (el.navtype == 0); + cal.dateClicked = false; + var year = date.getFullYear(); + var mon = date.getMonth(); + function setMonth(m) { + var day = date.getDate(); + var max = date.getMonthDays(m); + if (day > max) { + date.setDate(max); + } + date.setMonth(m); + }; + switch (el.navtype) { + case 400: + Calendar.removeClass(el, "hilite"); + var text = Calendar._TT["ABOUT"]; + if (typeof text != "undefined") { + text += cal.showsTime ? Calendar._TT["ABOUT_TIME"] : ""; + } else { + // FIXME: this should be removed as soon as lang files get updated! + text = "Help and about box text is not translated into this language.\n" + + "If you know this language and you feel generous please update\n" + + "the corresponding file in \"lang\" subdir to match calendar-en.js\n" + + "and send it back to to get it into the distribution ;-)\n\n" + + "Thank you!\n" + + "http://dynarch.com/mishoo/calendar.epl\n"; + } + alert(text); + return; + case -2: + if (year > cal.minYear) { + date.setFullYear(year - 1); + } + break; + case -1: + if (mon > 0) { + setMonth(mon - 1); + } else if (year-- > cal.minYear) { + date.setFullYear(year); + setMonth(11); + } + break; + case 1: + if (mon < 11) { + setMonth(mon + 1); + } else if (year < cal.maxYear) { + date.setFullYear(year + 1); + setMonth(0); + } + break; + case 2: + if (year < cal.maxYear) { + date.setFullYear(year + 1); + } + break; + case 100: + cal.setFirstDayOfWeek(el.fdow); + return; + case 50: + var range = el._range; + var current = el.innerHTML; + for (var i = range.length; --i >= 0;) + if (range[i] == current) + break; + if (ev && ev.shiftKey) { + if (--i < 0) + i = range.length - 1; + } else if ( ++i >= range.length ) + i = 0; + var newval = range[i]; + el.innerHTML = newval; + cal.onUpdateTime(); + return; + case 0: + // TODAY will bring us here + if ((typeof cal.getDateStatus == "function") && + cal.getDateStatus(date, date.getFullYear(), date.getMonth(), date.getDate())) { + return false; + } + break; + } + if (!date.equalsTo(cal.date)) { + cal.setDate(date); + newdate = true; + } else if (el.navtype == 0) + newdate = closing = true; + } + if (newdate) { + ev && cal.callHandler(); + } + if (closing) { + Calendar.removeClass(el, "hilite"); + ev && cal.callCloseHandler(); + } +}; + +// END: CALENDAR STATIC FUNCTIONS + +// BEGIN: CALENDAR OBJECT FUNCTIONS + +/** + * This function creates the calendar inside the given parent. If _par is + * null than it creates a popup calendar inside the BODY element. If _par is + * an element, be it BODY, then it creates a non-popup calendar (still + * hidden). Some properties need to be set before calling this function. + */ +Calendar.prototype.create = function (_par) { + var parent = null; + if (! _par) { + // default parent is the document body, in which case we create + // a popup calendar. + parent = document.getElementsByTagName("body")[0]; + this.isPopup = true; + } else { + parent = _par; + this.isPopup = false; + } + this.date = this.dateStr ? new Date(this.dateStr) : new Date(); + + var table = Calendar.createElement("table"); + this.table = table; + table.cellSpacing = 0; + table.cellPadding = 0; + table.calendar = this; + Calendar.addEvent(table, "mousedown", Calendar.tableMouseDown); + + var div = Calendar.createElement("div"); + this.element = div; + div.className = "calendar"; + if (this.isPopup) { + div.style.position = "absolute"; + div.style.display = "none"; + } + div.appendChild(table); + + var thead = Calendar.createElement("thead", table); + var cell = null; + var row = null; + + var cal = this; + var hh = function (text, cs, navtype) { + cell = Calendar.createElement("td", row); + cell.colSpan = cs; + cell.className = "button"; + if (navtype != 0 && Math.abs(navtype) <= 2) + cell.className += " nav"; + Calendar._add_evs(cell); + cell.calendar = cal; + cell.navtype = navtype; + cell.innerHTML = "
" + text + "
"; + return cell; + }; + + row = Calendar.createElement("tr", thead); + var title_length = 6; + (this.isPopup) && --title_length; + (this.weekNumbers) && ++title_length; + + hh("?", 1, 400).ttip = Calendar._TT["INFO"]; + this.title = hh("", title_length, 300); + this.title.className = "title"; + if (this.isPopup) { + this.title.ttip = Calendar._TT["DRAG_TO_MOVE"]; + this.title.style.cursor = "move"; + hh("×", 1, 200).ttip = Calendar._TT["CLOSE"]; + } + + row = Calendar.createElement("tr", thead); + row.className = "headrow"; + + this._nav_py = hh("«", 1, -2); + this._nav_py.ttip = Calendar._TT["PREV_YEAR"]; + + this._nav_pm = hh("‹", 1, -1); + this._nav_pm.ttip = Calendar._TT["PREV_MONTH"]; + + this._nav_now = hh(Calendar._TT["TODAY"], this.weekNumbers ? 4 : 3, 0); + this._nav_now.ttip = Calendar._TT["GO_TODAY"]; + + this._nav_nm = hh("›", 1, 1); + this._nav_nm.ttip = Calendar._TT["NEXT_MONTH"]; + + this._nav_ny = hh("»", 1, 2); + this._nav_ny.ttip = Calendar._TT["NEXT_YEAR"]; + + // day names + row = Calendar.createElement("tr", thead); + row.className = "daynames"; + if (this.weekNumbers) { + cell = Calendar.createElement("td", row); + cell.className = "name wn"; + cell.innerHTML = Calendar._TT["WK"]; + } + for (var i = 7; i > 0; --i) { + cell = Calendar.createElement("td", row); + if (!i) { + cell.navtype = 100; + cell.calendar = this; + Calendar._add_evs(cell); + } + } + this.firstdayname = (this.weekNumbers) ? row.firstChild.nextSibling : row.firstChild; + this._displayWeekdays(); + + var tbody = Calendar.createElement("tbody", table); + this.tbody = tbody; + + for (i = 6; i > 0; --i) { + row = Calendar.createElement("tr", tbody); + if (this.weekNumbers) { + cell = Calendar.createElement("td", row); + } + for (var j = 7; j > 0; --j) { + cell = Calendar.createElement("td", row); + cell.calendar = this; + Calendar._add_evs(cell); + } + } + + if (this.showsTime) { + row = Calendar.createElement("tr", tbody); + row.className = "time"; + + cell = Calendar.createElement("td", row); + cell.className = "time"; + cell.colSpan = 2; + cell.innerHTML = Calendar._TT["TIME"] || " "; + + cell = Calendar.createElement("td", row); + cell.className = "time"; + cell.colSpan = this.weekNumbers ? 4 : 3; + + (function(){ + function makeTimePart(className, init, range_start, range_end) { + var part = Calendar.createElement("span", cell); + part.className = className; + part.innerHTML = init; + part.calendar = cal; + part.ttip = Calendar._TT["TIME_PART"]; + part.navtype = 50; + part._range = []; + if (typeof range_start != "number") + part._range = range_start; + else { + for (var i = range_start; i <= range_end; ++i) { + var txt; + if (i < 10 && range_end >= 10) txt = '0' + i; + else txt = '' + i; + part._range[part._range.length] = txt; + } + } + Calendar._add_evs(part); + return part; + }; + var hrs = cal.date.getHours(); + var mins = cal.date.getMinutes(); + var t12 = !cal.time24; + var pm = (hrs > 12); + if (t12 && pm) hrs -= 12; + var H = makeTimePart("hour", hrs, t12 ? 1 : 0, t12 ? 12 : 23); + var span = Calendar.createElement("span", cell); + span.innerHTML = ":"; + span.className = "colon"; + var M = makeTimePart("minute", mins, 0, 59); + var AP = null; + cell = Calendar.createElement("td", row); + cell.className = "time"; + cell.colSpan = 2; + if (t12) + AP = makeTimePart("ampm", pm ? "pm" : "am", ["am", "pm"]); + else + cell.innerHTML = " "; + + cal.onSetTime = function() { + var pm, hrs = this.date.getHours(), + mins = this.date.getMinutes(); + if (t12) { + pm = (hrs >= 12); + if (pm) hrs -= 12; + if (hrs == 0) hrs = 12; + AP.innerHTML = pm ? "pm" : "am"; + } + H.innerHTML = (hrs < 10) ? ("0" + hrs) : hrs; + M.innerHTML = (mins < 10) ? ("0" + mins) : mins; + }; + + cal.onUpdateTime = function() { + var date = this.date; + var h = parseInt(H.innerHTML, 10); + if (t12) { + if (/pm/i.test(AP.innerHTML) && h < 12) + h += 12; + else if (/am/i.test(AP.innerHTML) && h == 12) + h = 0; + } + var d = date.getDate(); + var m = date.getMonth(); + var y = date.getFullYear(); + date.setHours(h); + date.setMinutes(parseInt(M.innerHTML, 10)); + date.setFullYear(y); + date.setMonth(m); + date.setDate(d); + this.dateClicked = false; + this.callHandler(); + }; + })(); + } else { + this.onSetTime = this.onUpdateTime = function() {}; + } + + var tfoot = Calendar.createElement("tfoot", table); + + row = Calendar.createElement("tr", tfoot); + row.className = "footrow"; + + cell = hh(Calendar._TT["SEL_DATE"], this.weekNumbers ? 8 : 7, 300); + cell.className = "ttip"; + if (this.isPopup) { + cell.ttip = Calendar._TT["DRAG_TO_MOVE"]; + cell.style.cursor = "move"; + } + this.tooltips = cell; + + div = Calendar.createElement("div", this.element); + this.monthsCombo = div; + div.className = "combo"; + for (i = 0; i < Calendar._MN.length; ++i) { + var mn = Calendar.createElement("div"); + mn.className = Calendar.is_ie ? "label-IEfix" : "label"; + mn.month = i; + mn.innerHTML = Calendar._SMN[i]; + div.appendChild(mn); + } + + div = Calendar.createElement("div", this.element); + this.yearsCombo = div; + div.className = "combo"; + for (i = 12; i > 0; --i) { + var yr = Calendar.createElement("div"); + yr.className = Calendar.is_ie ? "label-IEfix" : "label"; + div.appendChild(yr); + } + + this._init(this.firstDayOfWeek, this.date); + parent.appendChild(this.element); +}; + +/** keyboard navigation, only for popup calendars */ +Calendar._keyEvent = function(ev) { + var cal = window._dynarch_popupCalendar; + if (!cal || cal.multiple) + return false; + (Calendar.is_ie) && (ev = window.event); + var act = (Calendar.is_ie || ev.type == "keypress"), + K = ev.keyCode; + if (ev.ctrlKey) { + switch (K) { + case 37: // KEY left + act && Calendar.cellClick(cal._nav_pm); + break; + case 38: // KEY up + act && Calendar.cellClick(cal._nav_py); + break; + case 39: // KEY right + act && Calendar.cellClick(cal._nav_nm); + break; + case 40: // KEY down + act && Calendar.cellClick(cal._nav_ny); + break; + default: + return false; + } + } else switch (K) { + case 32: // KEY space (now) + Calendar.cellClick(cal._nav_now); + break; + case 27: // KEY esc + act && cal.callCloseHandler(); + break; + case 37: // KEY left + case 38: // KEY up + case 39: // KEY right + case 40: // KEY down + if (act) { + var prev, x, y, ne, el, step; + prev = K == 37 || K == 38; + step = (K == 37 || K == 39) ? 1 : 7; + function setVars() { + el = cal.currentDateEl; + var p = el.pos; + x = p & 15; + y = p >> 4; + ne = cal.ar_days[y][x]; + };setVars(); + function prevMonth() { + var date = new Date(cal.date); + date.setDate(date.getDate() - step); + cal.setDate(date); + }; + function nextMonth() { + var date = new Date(cal.date); + date.setDate(date.getDate() + step); + cal.setDate(date); + }; + while (1) { + switch (K) { + case 37: // KEY left + if (--x >= 0) + ne = cal.ar_days[y][x]; + else { + x = 6; + K = 38; + continue; + } + break; + case 38: // KEY up + if (--y >= 0) + ne = cal.ar_days[y][x]; + else { + prevMonth(); + setVars(); + } + break; + case 39: // KEY right + if (++x < 7) + ne = cal.ar_days[y][x]; + else { + x = 0; + K = 40; + continue; + } + break; + case 40: // KEY down + if (++y < cal.ar_days.length) + ne = cal.ar_days[y][x]; + else { + nextMonth(); + setVars(); + } + break; + } + break; + } + if (ne) { + if (!ne.disabled) + Calendar.cellClick(ne); + else if (prev) + prevMonth(); + else + nextMonth(); + } + } + break; + case 13: // KEY enter + if (act) + Calendar.cellClick(cal.currentDateEl, ev); + break; + default: + return false; + } + return Calendar.stopEvent(ev); +}; + +/** + * (RE)Initializes the calendar to the given date and firstDayOfWeek + */ +Calendar.prototype._init = function (firstDayOfWeek, date) { + var today = new Date(), + TY = today.getFullYear(), + TM = today.getMonth(), + TD = today.getDate(); + this.table.style.visibility = "hidden"; + var year = date.getFullYear(); + if (year < this.minYear) { + year = this.minYear; + date.setFullYear(year); + } else if (year > this.maxYear) { + year = this.maxYear; + date.setFullYear(year); + } + this.firstDayOfWeek = firstDayOfWeek; + this.date = new Date(date); + var month = date.getMonth(); + var mday = date.getDate(); + var no_days = date.getMonthDays(); + + // calendar voodoo for computing the first day that would actually be + // displayed in the calendar, even if it's from the previous month. + // WARNING: this is magic. ;-) + date.setDate(1); + var day1 = (date.getDay() - this.firstDayOfWeek) % 7; + if (day1 < 0) + day1 += 7; + date.setDate(-day1); + date.setDate(date.getDate() + 1); + + var row = this.tbody.firstChild; + var MN = Calendar._SMN[month]; + var ar_days = this.ar_days = new Array(); + var weekend = Calendar._TT["WEEKEND"]; + var dates = this.multiple ? (this.datesCells = {}) : null; + for (var i = 0; i < 6; ++i, row = row.nextSibling) { + var cell = row.firstChild; + if (this.weekNumbers) { + cell.className = "day wn"; + cell.innerHTML = date.getWeekNumber(); + cell = cell.nextSibling; + } + row.className = "daysrow"; + var hasdays = false, iday, dpos = ar_days[i] = []; + for (var j = 0; j < 7; ++j, cell = cell.nextSibling, date.setDate(iday + 1)) { + iday = date.getDate(); + var wday = date.getDay(); + cell.className = "day"; + cell.pos = i << 4 | j; + dpos[j] = cell; + var current_month = (date.getMonth() == month); + if (!current_month) { + if (this.showsOtherMonths) { + cell.className += " othermonth"; + cell.otherMonth = true; + } else { + cell.className = "emptycell"; + cell.innerHTML = " "; + cell.disabled = true; + continue; + } + } else { + cell.otherMonth = false; + hasdays = true; + } + cell.disabled = false; + cell.innerHTML = this.getDateText ? this.getDateText(date, iday) : iday; + if (dates) + dates[date.print("%Y%m%d")] = cell; + if (this.getDateStatus) { + var status = this.getDateStatus(date, year, month, iday); + if (this.getDateToolTip) { + var toolTip = this.getDateToolTip(date, year, month, iday); + if (toolTip) + cell.title = toolTip; + } + if (status === true) { + cell.className += " disabled"; + cell.disabled = true; + } else { + if (/disabled/i.test(status)) + cell.disabled = true; + cell.className += " " + status; + } + } + if (!cell.disabled) { + cell.caldate = new Date(date); + cell.ttip = "_"; + if (!this.multiple && current_month + && iday == mday && this.hiliteToday) { + cell.className += " selected"; + this.currentDateEl = cell; + } + if (date.getFullYear() == TY && + date.getMonth() == TM && + iday == TD) { + cell.className += " today"; + cell.ttip += Calendar._TT["PART_TODAY"]; + } + if (weekend.indexOf(wday.toString()) != -1) + cell.className += cell.otherMonth ? " oweekend" : " weekend"; + } + } + if (!(hasdays || this.showsOtherMonths)) + row.className = "emptyrow"; + } + this.title.innerHTML = Calendar._MN[month] + ", " + year; + this.onSetTime(); + this.table.style.visibility = "visible"; + this._initMultipleDates(); + // PROFILE + // this.tooltips.innerHTML = "Generated in " + ((new Date()) - today) + " ms"; +}; + +Calendar.prototype._initMultipleDates = function() { + if (this.multiple) { + for (var i in this.multiple) { + var cell = this.datesCells[i]; + var d = this.multiple[i]; + if (!d) + continue; + if (cell) + cell.className += " selected"; + } + } +}; + +Calendar.prototype._toggleMultipleDate = function(date) { + if (this.multiple) { + var ds = date.print("%Y%m%d"); + var cell = this.datesCells[ds]; + if (cell) { + var d = this.multiple[ds]; + if (!d) { + Calendar.addClass(cell, "selected"); + this.multiple[ds] = date; + } else { + Calendar.removeClass(cell, "selected"); + delete this.multiple[ds]; + } + } + } +}; + +Calendar.prototype.setDateToolTipHandler = function (unaryFunction) { + this.getDateToolTip = unaryFunction; +}; + +/** + * Calls _init function above for going to a certain date (but only if the + * date is different than the currently selected one). + */ +Calendar.prototype.setDate = function (date) { + if (!date.equalsTo(this.date)) { + this._init(this.firstDayOfWeek, date); + } +}; + +/** + * Refreshes the calendar. Useful if the "disabledHandler" function is + * dynamic, meaning that the list of disabled date can change at runtime. + * Just * call this function if you think that the list of disabled dates + * should * change. + */ +Calendar.prototype.refresh = function () { + this._init(this.firstDayOfWeek, this.date); +}; + +/** Modifies the "firstDayOfWeek" parameter (pass 0 for Synday, 1 for Monday, etc.). */ +Calendar.prototype.setFirstDayOfWeek = function (firstDayOfWeek) { + this._init(firstDayOfWeek, this.date); + this._displayWeekdays(); +}; + +/** + * Allows customization of what dates are enabled. The "unaryFunction" + * parameter must be a function object that receives the date (as a JS Date + * object) and returns a boolean value. If the returned value is true then + * the passed date will be marked as disabled. + */ +Calendar.prototype.setDateStatusHandler = Calendar.prototype.setDisabledHandler = function (unaryFunction) { + this.getDateStatus = unaryFunction; +}; + +/** Customization of allowed year range for the calendar. */ +Calendar.prototype.setRange = function (a, z) { + this.minYear = a; + this.maxYear = z; +}; + +/** Calls the first user handler (selectedHandler). */ +Calendar.prototype.callHandler = function () { + if (this.onSelected) { + this.onSelected(this, this.date.print(this.dateFormat)); + } +}; + +/** Calls the second user handler (closeHandler). */ +Calendar.prototype.callCloseHandler = function () { + if (this.onClose) { + this.onClose(this); + } + this.hideShowCovered(); +}; + +/** Removes the calendar object from the DOM tree and destroys it. */ +Calendar.prototype.destroy = function () { + var el = this.element.parentNode; + el.removeChild(this.element); + Calendar._C = null; + window._dynarch_popupCalendar = null; +}; + +/** + * Moves the calendar element to a different section in the DOM tree (changes + * its parent). + */ +Calendar.prototype.reparent = function (new_parent) { + var el = this.element; + el.parentNode.removeChild(el); + new_parent.appendChild(el); +}; + +// This gets called when the user presses a mouse button anywhere in the +// document, if the calendar is shown. If the click was outside the open +// calendar this function closes it. +Calendar._checkCalendar = function(ev) { + var calendar = window._dynarch_popupCalendar; + if (!calendar) { + return false; + } + var el = Calendar.is_ie ? Calendar.getElement(ev) : Calendar.getTargetElement(ev); + for (; el != null && el != calendar.element; el = el.parentNode); + if (el == null) { + // calls closeHandler which should hide the calendar. + window._dynarch_popupCalendar.callCloseHandler(); + return Calendar.stopEvent(ev); + } +}; + +/** Shows the calendar. */ +Calendar.prototype.show = function () { + var rows = this.table.getElementsByTagName("tr"); + for (var i = rows.length; i > 0;) { + var row = rows[--i]; + Calendar.removeClass(row, "rowhilite"); + var cells = row.getElementsByTagName("td"); + for (var j = cells.length; j > 0;) { + var cell = cells[--j]; + Calendar.removeClass(cell, "hilite"); + Calendar.removeClass(cell, "active"); + } + } + this.element.style.display = "block"; + this.hidden = false; + if (this.isPopup) { + window._dynarch_popupCalendar = this; + Calendar.addEvent(document, "keydown", Calendar._keyEvent); + Calendar.addEvent(document, "keypress", Calendar._keyEvent); + Calendar.addEvent(document, "mousedown", Calendar._checkCalendar); + } + this.hideShowCovered(); +}; + +/** + * Hides the calendar. Also removes any "hilite" from the class of any TD + * element. + */ +Calendar.prototype.hide = function () { + if (this.isPopup) { + Calendar.removeEvent(document, "keydown", Calendar._keyEvent); + Calendar.removeEvent(document, "keypress", Calendar._keyEvent); + Calendar.removeEvent(document, "mousedown", Calendar._checkCalendar); + } + this.element.style.display = "none"; + this.hidden = true; + this.hideShowCovered(); +}; + +/** + * Shows the calendar at a given absolute position (beware that, depending on + * the calendar element style -- position property -- this might be relative + * to the parent's containing rectangle). + */ +Calendar.prototype.showAt = function (x, y) { + var s = this.element.style; + s.left = x + "px"; + s.top = y + "px"; + this.show(); +}; + +/** Shows the calendar near a given element. */ +Calendar.prototype.showAtElement = function (el, opts) { + var self = this; + var p = Calendar.getAbsolutePos(el); + if (!opts || typeof opts != "string") { + this.showAt(p.x, p.y + el.offsetHeight); + return true; + } + function fixPosition(box) { + if (box.x < 0) + box.x = 0; + if (box.y < 0) + box.y = 0; + var cp = document.createElement("div"); + var s = cp.style; + s.position = "absolute"; + s.right = s.bottom = s.width = s.height = "0px"; + document.body.appendChild(cp); + var br = Calendar.getAbsolutePos(cp); + document.body.removeChild(cp); + if (Calendar.is_ie) { + br.y += document.body.scrollTop; + br.x += document.body.scrollLeft; + } else { + br.y += window.scrollY; + br.x += window.scrollX; + } + var tmp = box.x + box.width - br.x; + if (tmp > 0) box.x -= tmp; + tmp = box.y + box.height - br.y; + if (tmp > 0) box.y -= tmp; + }; + this.element.style.display = "block"; + Calendar.continuation_for_the_fucking_khtml_browser = function() { + var w = self.element.offsetWidth; + var h = self.element.offsetHeight; + self.element.style.display = "none"; + var valign = opts.substr(0, 1); + var halign = "l"; + if (opts.length > 1) { + halign = opts.substr(1, 1); + } + // vertical alignment + switch (valign) { + case "T": p.y -= h; break; + case "B": p.y += el.offsetHeight; break; + case "C": p.y += (el.offsetHeight - h) / 2; break; + case "t": p.y += el.offsetHeight - h; break; + case "b": break; // already there + } + // horizontal alignment + switch (halign) { + case "L": p.x -= w; break; + case "R": p.x += el.offsetWidth; break; + case "C": p.x += (el.offsetWidth - w) / 2; break; + case "l": p.x += el.offsetWidth - w; break; + case "r": break; // already there + } + p.width = w; + p.height = h + 40; + self.monthsCombo.style.display = "none"; + fixPosition(p); + self.showAt(p.x, p.y); + }; + if (Calendar.is_khtml) + setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()", 10); + else + Calendar.continuation_for_the_fucking_khtml_browser(); +}; + +/** Customizes the date format. */ +Calendar.prototype.setDateFormat = function (str) { + this.dateFormat = str; +}; + +/** Customizes the tooltip date format. */ +Calendar.prototype.setTtDateFormat = function (str) { + this.ttDateFormat = str; +}; + +/** + * Tries to identify the date represented in a string. If successful it also + * calls this.setDate which moves the calendar to the given date. + */ +Calendar.prototype.parseDate = function(str, fmt) { + if (!fmt) + fmt = this.dateFormat; + this.setDate(Date.parseDate(str, fmt)); +}; + +Calendar.prototype.hideShowCovered = function () { + if (!Calendar.is_ie && !Calendar.is_opera) + return; + function getVisib(obj){ + var value = obj.style.visibility; + if (!value) { + if (document.defaultView && typeof (document.defaultView.getComputedStyle) == "function") { // Gecko, W3C + if (!Calendar.is_khtml) + value = document.defaultView. + getComputedStyle(obj, "").getPropertyValue("visibility"); + else + value = ''; + } else if (obj.currentStyle) { // IE + value = obj.currentStyle.visibility; + } else + value = ''; + } + return value; + }; + + var tags = new Array("applet", "iframe", "select"); + var el = this.element; + + var p = Calendar.getAbsolutePos(el); + var EX1 = p.x; + var EX2 = el.offsetWidth + EX1; + var EY1 = p.y; + var EY2 = el.offsetHeight + EY1; + + for (var k = tags.length; k > 0; ) { + var ar = document.getElementsByTagName(tags[--k]); + var cc = null; + + for (var i = ar.length; i > 0;) { + cc = ar[--i]; + + p = Calendar.getAbsolutePos(cc); + var CX1 = p.x; + var CX2 = cc.offsetWidth + CX1; + var CY1 = p.y; + var CY2 = cc.offsetHeight + CY1; + + if (this.hidden || (CX1 > EX2) || (CX2 < EX1) || (CY1 > EY2) || (CY2 < EY1)) { + if (!cc.__msh_save_visibility) { + cc.__msh_save_visibility = getVisib(cc); + } + cc.style.visibility = cc.__msh_save_visibility; + } else { + if (!cc.__msh_save_visibility) { + cc.__msh_save_visibility = getVisib(cc); + } + cc.style.visibility = "hidden"; + } + } + } +}; + +/** Internal function; it displays the bar with the names of the weekday. */ +Calendar.prototype._displayWeekdays = function () { + var fdow = this.firstDayOfWeek; + var cell = this.firstdayname; + var weekend = Calendar._TT["WEEKEND"]; + for (var i = 0; i < 7; ++i) { + cell.className = "day name"; + var realday = (i + fdow) % 7; + if (i) { + cell.ttip = Calendar._TT["DAY_FIRST"].replace("%s", Calendar._DN[realday]); + cell.navtype = 100; + cell.calendar = this; + cell.fdow = realday; + Calendar._add_evs(cell); + } + if (weekend.indexOf(realday.toString()) != -1) { + Calendar.addClass(cell, "weekend"); + } + cell.innerHTML = Calendar._SDN[(i + fdow) % 7]; + cell = cell.nextSibling; + } +}; + +/** Internal function. Hides all combo boxes that might be displayed. */ +Calendar.prototype._hideCombos = function () { + this.monthsCombo.style.display = "none"; + this.yearsCombo.style.display = "none"; +}; + +/** Internal function. Starts dragging the element. */ +Calendar.prototype._dragStart = function (ev) { + if (this.dragging) { + return; + } + this.dragging = true; + var posX; + var posY; + if (Calendar.is_ie) { + posY = window.event.clientY + document.body.scrollTop; + posX = window.event.clientX + document.body.scrollLeft; + } else { + posY = ev.clientY + window.scrollY; + posX = ev.clientX + window.scrollX; + } + var st = this.element.style; + this.xOffs = posX - parseInt(st.left); + this.yOffs = posY - parseInt(st.top); + with (Calendar) { + addEvent(document, "mousemove", calDragIt); + addEvent(document, "mouseup", calDragEnd); + } +}; + +// BEGIN: DATE OBJECT PATCHES + +/** Adds the number of days array to the Date object. */ +Date._MD = new Array(31,28,31,30,31,30,31,31,30,31,30,31); + +/** Constants used for time computations */ +Date.SECOND = 1000 /* milliseconds */; +Date.MINUTE = 60 * Date.SECOND; +Date.HOUR = 60 * Date.MINUTE; +Date.DAY = 24 * Date.HOUR; +Date.WEEK = 7 * Date.DAY; + +Date.parseDate = function(str, fmt) { + var today = new Date(); + var y = 0; + var m = -1; + var d = 0; + var a = str.split(/\W+/); + var b = fmt.match(/%./g); + var i = 0, j = 0; + var hr = 0; + var min = 0; + for (i = 0; i < a.length; ++i) { + if (!a[i]) + continue; + switch (b[i]) { + case "%d": + case "%e": + d = parseInt(a[i], 10); + break; + + case "%m": + m = parseInt(a[i], 10) - 1; + break; + + case "%Y": + case "%y": + y = parseInt(a[i], 10); + (y < 100) && (y += (y > 29) ? 1900 : 2000); + break; + + case "%b": + case "%B": + for (j = 0; j < 12; ++j) { + if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { m = j; break; } + } + break; + + case "%H": + case "%I": + case "%k": + case "%l": + hr = parseInt(a[i], 10); + break; + + case "%P": + case "%p": + if (/pm/i.test(a[i]) && hr < 12) + hr += 12; + else if (/am/i.test(a[i]) && hr >= 12) + hr -= 12; + break; + + case "%M": + min = parseInt(a[i], 10); + break; + } + } + if (isNaN(y)) y = today.getFullYear(); + if (isNaN(m)) m = today.getMonth(); + if (isNaN(d)) d = today.getDate(); + if (isNaN(hr)) hr = today.getHours(); + if (isNaN(min)) min = today.getMinutes(); + if (y != 0 && m != -1 && d != 0) + return new Date(y, m, d, hr, min, 0); + y = 0; m = -1; d = 0; + for (i = 0; i < a.length; ++i) { + if (a[i].search(/[a-zA-Z]+/) != -1) { + var t = -1; + for (j = 0; j < 12; ++j) { + if (Calendar._MN[j].substr(0, a[i].length).toLowerCase() == a[i].toLowerCase()) { t = j; break; } + } + if (t != -1) { + if (m != -1) { + d = m+1; + } + m = t; + } + } else if (parseInt(a[i], 10) <= 12 && m == -1) { + m = a[i]-1; + } else if (parseInt(a[i], 10) > 31 && y == 0) { + y = parseInt(a[i], 10); + (y < 100) && (y += (y > 29) ? 1900 : 2000); + } else if (d == 0) { + d = a[i]; + } + } + if (y == 0) + y = today.getFullYear(); + if (m != -1 && d != 0) + return new Date(y, m, d, hr, min, 0); + return today; +}; + +/** Returns the number of days in the current month */ +Date.prototype.getMonthDays = function(month) { + var year = this.getFullYear(); + if (typeof month == "undefined") { + month = this.getMonth(); + } + if (((0 == (year%4)) && ( (0 != (year%100)) || (0 == (year%400)))) && month == 1) { + return 29; + } else { + return Date._MD[month]; + } +}; + +/** Returns the number of day in the year. */ +Date.prototype.getDayOfYear = function() { + var now = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); + var then = new Date(this.getFullYear(), 0, 0, 0, 0, 0); + var time = now - then; + return Math.floor(time / Date.DAY); +}; + +/** Returns the number of the week in year, as defined in ISO 8601. */ +Date.prototype.getWeekNumber = function() { + var d = new Date(this.getFullYear(), this.getMonth(), this.getDate(), 0, 0, 0); + var DoW = d.getDay(); + d.setDate(d.getDate() - (DoW + 6) % 7 + 3); // Nearest Thu + var ms = d.valueOf(); // GMT + d.setMonth(0); + d.setDate(4); // Thu in Week 1 + return Math.round((ms - d.valueOf()) / (7 * 864e5)) + 1; +}; + +/** Checks date and time equality */ +Date.prototype.equalsTo = function(date) { + return ((this.getFullYear() == date.getFullYear()) && + (this.getMonth() == date.getMonth()) && + (this.getDate() == date.getDate()) && + (this.getHours() == date.getHours()) && + (this.getMinutes() == date.getMinutes())); +}; + +/** Set only the year, month, date parts (keep existing time) */ +Date.prototype.setDateOnly = function(date) { + var tmp = new Date(date); + this.setDate(1); + this.setFullYear(tmp.getFullYear()); + this.setMonth(tmp.getMonth()); + this.setDate(tmp.getDate()); +}; + +/** Prints the date in a string according to the given format. */ +Date.prototype.print = function (str) { + var m = this.getMonth(); + var d = this.getDate(); + var y = this.getFullYear(); + var wn = this.getWeekNumber(); + var w = this.getDay(); + var s = {}; + var hr = this.getHours(); + var pm = (hr >= 12); + var ir = (pm) ? (hr - 12) : hr; + var dy = this.getDayOfYear(); + if (ir == 0) + ir = 12; + var min = this.getMinutes(); + var sec = this.getSeconds(); + s["%a"] = Calendar._SDN[w]; // abbreviated weekday name [FIXME: I18N] + s["%A"] = Calendar._DN[w]; // full weekday name + s["%b"] = Calendar._SMN[m]; // abbreviated month name [FIXME: I18N] + s["%B"] = Calendar._MN[m]; // full month name + // FIXME: %c : preferred date and time representation for the current locale + s["%C"] = 1 + Math.floor(y / 100); // the century number + s["%d"] = (d < 10) ? ("0" + d) : d; // the day of the month (range 01 to 31) + s["%e"] = d; // the day of the month (range 1 to 31) + // FIXME: %D : american date style: %m/%d/%y + // FIXME: %E, %F, %G, %g, %h (man strftime) + s["%H"] = (hr < 10) ? ("0" + hr) : hr; // hour, range 00 to 23 (24h format) + s["%I"] = (ir < 10) ? ("0" + ir) : ir; // hour, range 01 to 12 (12h format) + s["%j"] = (dy < 100) ? ((dy < 10) ? ("00" + dy) : ("0" + dy)) : dy; // day of the year (range 001 to 366) + s["%k"] = hr; // hour, range 0 to 23 (24h format) + s["%l"] = ir; // hour, range 1 to 12 (12h format) + s["%m"] = (m < 9) ? ("0" + (1+m)) : (1+m); // month, range 01 to 12 + s["%M"] = (min < 10) ? ("0" + min) : min; // minute, range 00 to 59 + s["%n"] = "\n"; // a newline character + s["%p"] = pm ? "PM" : "AM"; + s["%P"] = pm ? "pm" : "am"; + // FIXME: %r : the time in am/pm notation %I:%M:%S %p + // FIXME: %R : the time in 24-hour notation %H:%M + s["%s"] = Math.floor(this.getTime() / 1000); + s["%S"] = (sec < 10) ? ("0" + sec) : sec; // seconds, range 00 to 59 + s["%t"] = "\t"; // a tab character + // FIXME: %T : the time in 24-hour notation (%H:%M:%S) + s["%U"] = s["%W"] = s["%V"] = (wn < 10) ? ("0" + wn) : wn; + s["%u"] = w + 1; // the day of the week (range 1 to 7, 1 = MON) + s["%w"] = w; // the day of the week (range 0 to 6, 0 = SUN) + // FIXME: %x : preferred date representation for the current locale without the time + // FIXME: %X : preferred time representation for the current locale without the date + s["%y"] = ('' + y).substr(2, 2); // year without the century (range 00 to 99) + s["%Y"] = y; // year with the century + s["%%"] = "%"; // a literal '%' character + + var re = /%./g; + if (!Calendar.is_ie5 && !Calendar.is_khtml) + return str.replace(re, function (par) { return s[par] || par; }); + + var a = str.match(re); + for (var i = 0; i < a.length; i++) { + var tmp = s[a[i]]; + if (tmp) { + re = new RegExp(a[i], 'g'); + str = str.replace(re, tmp); + } + } + + return str; +}; + +Date.prototype.__msh_oldSetFullYear = Date.prototype.setFullYear; +Date.prototype.setFullYear = function(y) { + var d = new Date(this); + d.__msh_oldSetFullYear(y); + if (d.getMonth() != this.getMonth()) + this.setDate(28); + this.__msh_oldSetFullYear(y); +}; + +// END: DATE OBJECT PATCHES + + +// global object that remembers the calendar +window._dynarch_popupCalendar = null; diff -r 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/scripts/calendar_stripped.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/calendar_stripped.js Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,14 @@ +/* Copyright Mihai Bazon, 2002-2005 | www.bazon.net/mishoo + * ----------------------------------------------------------- + * + * The DHTML Calendar, version 1.0 "It is happening again" + * + * Details and latest version at: + * www.dynarch.com/projects/calendar + * + * This script is developed by Dynarch.com. Visit us at www.dynarch.com. + * + * This script is distributed under the GNU Lesser General Public License. + * Read the entire license text here: http://www.gnu.org/licenses/lgpl.html + */ + Calendar=function(firstDayOfWeek,dateStr,onSelected,onClose){this.activeDiv=null;this.currentDateEl=null;this.getDateStatus=null;this.getDateToolTip=null;this.getDateText=null;this.timeout=null;this.onSelected=onSelected||null;this.onClose=onClose||null;this.dragging=false;this.hidden=false;this.minYear=1970;this.maxYear=2050;this.dateFormat=Calendar._TT["DEF_DATE_FORMAT"];this.ttDateFormat=Calendar._TT["TT_DATE_FORMAT"];this.isPopup=true;this.weekNumbers=true;this.firstDayOfWeek=typeof firstDayOfWeek=="number"?firstDayOfWeek:Calendar._FD;this.showsOtherMonths=false;this.dateStr=dateStr;this.ar_days=null;this.showsTime=false;this.time24=true;this.yearStep=2;this.hiliteToday=true;this.multiple=null;this.table=null;this.element=null;this.tbody=null;this.firstdayname=null;this.monthsCombo=null;this.yearsCombo=null;this.hilitedMonth=null;this.activeMonth=null;this.hilitedYear=null;this.activeYear=null;this.dateClicked=false;if(typeof Calendar._SDN=="undefined"){if(typeof Calendar._SDN_len=="undefined")Calendar._SDN_len=3;var ar=new Array();for(var i=8;i>0;){ar[--i]=Calendar._DN[i].substr(0,Calendar._SDN_len);}Calendar._SDN=ar;if(typeof Calendar._SMN_len=="undefined")Calendar._SMN_len=3;ar=new Array();for(var i=12;i>0;){ar[--i]=Calendar._MN[i].substr(0,Calendar._SMN_len);}Calendar._SMN=ar;}};Calendar._C=null;Calendar.is_ie=(/msie/i.test(navigator.userAgent)&&!/opera/i.test(navigator.userAgent));Calendar.is_ie5=(Calendar.is_ie&&/msie 5\.0/i.test(navigator.userAgent));Calendar.is_opera=/opera/i.test(navigator.userAgent);Calendar.is_khtml=/Konqueror|Safari|KHTML/i.test(navigator.userAgent);Calendar.getAbsolutePos=function(el){var SL=0,ST=0;var is_div=/^div$/i.test(el.tagName);if(is_div&&el.scrollLeft)SL=el.scrollLeft;if(is_div&&el.scrollTop)ST=el.scrollTop;var r={x:el.offsetLeft-SL,y:el.offsetTop-ST};if(el.offsetParent){var tmp=this.getAbsolutePos(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y;}return r;};Calendar.isRelated=function(el,evt){var related=evt.relatedTarget;if(!related){var type=evt.type;if(type=="mouseover"){related=evt.fromElement;}else if(type=="mouseout"){related=evt.toElement;}}while(related){if(related==el){return true;}related=related.parentNode;}return false;};Calendar.removeClass=function(el,className){if(!(el&&el.className)){return;}var cls=el.className.split(" ");var ar=new Array();for(var i=cls.length;i>0;){if(cls[--i]!=className){ar[ar.length]=cls[i];}}el.className=ar.join(" ");};Calendar.addClass=function(el,className){Calendar.removeClass(el,className);el.className+=" "+className;};Calendar.getElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.currentTarget;while(f.nodeType!=1||/^div$/i.test(f.tagName))f=f.parentNode;return f;};Calendar.getTargetElement=function(ev){var f=Calendar.is_ie?window.event.srcElement:ev.target;while(f.nodeType!=1)f=f.parentNode;return f;};Calendar.stopEvent=function(ev){ev||(ev=window.event);if(Calendar.is_ie){ev.cancelBubble=true;ev.returnValue=false;}else{ev.preventDefault();ev.stopPropagation();}return false;};Calendar.addEvent=function(el,evname,func){if(el.attachEvent){el.attachEvent("on"+evname,func);}else if(el.addEventListener){el.addEventListener(evname,func,true);}else{el["on"+evname]=func;}};Calendar.removeEvent=function(el,evname,func){if(el.detachEvent){el.detachEvent("on"+evname,func);}else if(el.removeEventListener){el.removeEventListener(evname,func,true);}else{el["on"+evname]=null;}};Calendar.createElement=function(type,parent){var el=null;if(document.createElementNS){el=document.createElementNS("http://www.w3.org/1999/xhtml",type);}else{el=document.createElement(type);}if(typeof parent!="undefined"){parent.appendChild(el);}return el;};Calendar._add_evs=function(el){with(Calendar){addEvent(el,"mouseover",dayMouseOver);addEvent(el,"mousedown",dayMouseDown);addEvent(el,"mouseout",dayMouseOut);if(is_ie){addEvent(el,"dblclick",dayMouseDblClick);el.setAttribute("unselectable",true);}}};Calendar.findMonth=function(el){if(typeof el.month!="undefined"){return el;}else if(typeof el.parentNode.month!="undefined"){return el.parentNode;}return null;};Calendar.findYear=function(el){if(typeof el.year!="undefined"){return el;}else if(typeof el.parentNode.year!="undefined"){return el.parentNode;}return null;};Calendar.showMonthsCombo=function(){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var mc=cal.monthsCombo;if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}if(cal.activeMonth){Calendar.removeClass(cal.activeMonth,"active");}var mon=cal.monthsCombo.getElementsByTagName("div")[cal.date.getMonth()];Calendar.addClass(mon,"active");cal.activeMonth=mon;var s=mc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var mcw=mc.offsetWidth;if(typeof mcw=="undefined")mcw=50;s.left=(cd.offsetLeft+cd.offsetWidth-mcw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";};Calendar.showYearsCombo=function(fwd){var cal=Calendar._C;if(!cal){return false;}var cal=cal;var cd=cal.activeDiv;var yc=cal.yearsCombo;if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}if(cal.activeYear){Calendar.removeClass(cal.activeYear,"active");}cal.activeYear=null;var Y=cal.date.getFullYear()+(fwd?1:-1);var yr=yc.firstChild;var show=false;for(var i=12;i>0;--i){if(Y>=cal.minYear&&Y<=cal.maxYear){yr.innerHTML=Y;yr.year=Y;yr.style.display="block";show=true;}else{yr.style.display="none";}yr=yr.nextSibling;Y+=fwd?cal.yearStep:-cal.yearStep;}if(show){var s=yc.style;s.display="block";if(cd.navtype<0)s.left=cd.offsetLeft+"px";else{var ycw=yc.offsetWidth;if(typeof ycw=="undefined")ycw=50;s.left=(cd.offsetLeft+cd.offsetWidth-ycw)+"px";}s.top=(cd.offsetTop+cd.offsetHeight)+"px";}};Calendar.tableMouseUp=function(ev){var cal=Calendar._C;if(!cal){return false;}if(cal.timeout){clearTimeout(cal.timeout);}var el=cal.activeDiv;if(!el){return false;}var target=Calendar.getTargetElement(ev);ev||(ev=window.event);Calendar.removeClass(el,"active");if(target==el||target.parentNode==el){Calendar.cellClick(el,ev);}var mon=Calendar.findMonth(target);var date=null;if(mon){date=new Date(cal.date);if(mon.month!=date.getMonth()){date.setMonth(mon.month);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}else{var year=Calendar.findYear(target);if(year){date=new Date(cal.date);if(year.year!=date.getFullYear()){date.setFullYear(year.year);cal.setDate(date);cal.dateClicked=false;cal.callHandler();}}}with(Calendar){removeEvent(document,"mouseup",tableMouseUp);removeEvent(document,"mouseover",tableMouseOver);removeEvent(document,"mousemove",tableMouseOver);cal._hideCombos();_C=null;return stopEvent(ev);}};Calendar.tableMouseOver=function(ev){var cal=Calendar._C;if(!cal){return;}var el=cal.activeDiv;var target=Calendar.getTargetElement(ev);if(target==el||target.parentNode==el){Calendar.addClass(el,"hilite active");Calendar.addClass(el.parentNode,"rowhilite");}else{if(typeof el.navtype=="undefined"||(el.navtype!=50&&(el.navtype==0||Math.abs(el.navtype)>2)))Calendar.removeClass(el,"active");Calendar.removeClass(el,"hilite");Calendar.removeClass(el.parentNode,"rowhilite");}ev||(ev=window.event);if(el.navtype==50&&target!=el){var pos=Calendar.getAbsolutePos(el);var w=el.offsetWidth;var x=ev.clientX;var dx;var decrease=true;if(x>pos.x+w){dx=x-pos.x-w;decrease=false;}else dx=pos.x-x;if(dx<0)dx=0;var range=el._range;var current=el._current;var count=Math.floor(dx/10)%range.length;for(var i=range.length;--i>=0;)if(range[i]==current)break;while(count-->0)if(decrease){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();}var mon=Calendar.findMonth(target);if(mon){if(mon.month!=cal.date.getMonth()){if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}Calendar.addClass(mon,"hilite");cal.hilitedMonth=mon;}else if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}}else{if(cal.hilitedMonth){Calendar.removeClass(cal.hilitedMonth,"hilite");}var year=Calendar.findYear(target);if(year){if(year.year!=cal.date.getFullYear()){if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}Calendar.addClass(year,"hilite");cal.hilitedYear=year;}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}else if(cal.hilitedYear){Calendar.removeClass(cal.hilitedYear,"hilite");}}return Calendar.stopEvent(ev);};Calendar.tableMouseDown=function(ev){if(Calendar.getTargetElement(ev)==Calendar.getElement(ev)){return Calendar.stopEvent(ev);}};Calendar.calDragIt=function(ev){var cal=Calendar._C;if(!(cal&&cal.dragging)){return false;}var posX;var posY;if(Calendar.is_ie){posY=window.event.clientY+document.body.scrollTop;posX=window.event.clientX+document.body.scrollLeft;}else{posX=ev.pageX;posY=ev.pageY;}cal.hideShowCovered();var st=cal.element.style;st.left=(posX-cal.xOffs)+"px";st.top=(posY-cal.yOffs)+"px";return Calendar.stopEvent(ev);};Calendar.calDragEnd=function(ev){var cal=Calendar._C;if(!cal){return false;}cal.dragging=false;with(Calendar){removeEvent(document,"mousemove",calDragIt);removeEvent(document,"mouseup",calDragEnd);tableMouseUp(ev);}cal.hideShowCovered();};Calendar.dayMouseDown=function(ev){var el=Calendar.getElement(ev);if(el.disabled){return false;}var cal=el.calendar;cal.activeDiv=el;Calendar._C=cal;if(el.navtype!=300)with(Calendar){if(el.navtype==50){el._current=el.innerHTML;addEvent(document,"mousemove",tableMouseOver);}else addEvent(document,Calendar.is_ie5?"mousemove":"mouseover",tableMouseOver);addClass(el,"hilite active");addEvent(document,"mouseup",tableMouseUp);}else if(cal.isPopup){cal._dragStart(ev);}if(el.navtype==-1||el.navtype==1){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout("Calendar.showMonthsCombo()",250);}else if(el.navtype==-2||el.navtype==2){if(cal.timeout)clearTimeout(cal.timeout);cal.timeout=setTimeout((el.navtype>0)?"Calendar.showYearsCombo(true)":"Calendar.showYearsCombo(false)",250);}else{cal.timeout=null;}return Calendar.stopEvent(ev);};Calendar.dayMouseDblClick=function(ev){Calendar.cellClick(Calendar.getElement(ev),ev||window.event);if(Calendar.is_ie){document.selection.empty();}};Calendar.dayMouseOver=function(ev){var el=Calendar.getElement(ev);if(Calendar.isRelated(el,ev)||Calendar._C||el.disabled){return false;}if(el.ttip){if(el.ttip.substr(0,1)=="_"){el.ttip=el.caldate.print(el.calendar.ttDateFormat)+el.ttip.substr(1);}el.calendar.tooltips.innerHTML=el.ttip;}if(el.navtype!=300){Calendar.addClass(el,"hilite");if(el.caldate){Calendar.addClass(el.parentNode,"rowhilite");}}return Calendar.stopEvent(ev);};Calendar.dayMouseOut=function(ev){with(Calendar){var el=getElement(ev);if(isRelated(el,ev)||_C||el.disabled)return false;removeClass(el,"hilite");if(el.caldate)removeClass(el.parentNode,"rowhilite");if(el.calendar)el.calendar.tooltips.innerHTML=_TT["SEL_DATE"];return stopEvent(ev);}};Calendar.cellClick=function(el,ev){var cal=el.calendar;var closing=false;var newdate=false;var date=null;if(typeof el.navtype=="undefined"){if(cal.currentDateEl){Calendar.removeClass(cal.currentDateEl,"selected");Calendar.addClass(el,"selected");closing=(cal.currentDateEl==el);if(!closing){cal.currentDateEl=el;}}cal.date.setDateOnly(el.caldate);date=cal.date;var other_month=!(cal.dateClicked=!el.otherMonth);if(!other_month&&!cal.currentDateEl)cal._toggleMultipleDate(new Date(date));else newdate=!el.disabled;if(other_month)cal._init(cal.firstDayOfWeek,date);}else{if(el.navtype==200){Calendar.removeClass(el,"hilite");cal.callCloseHandler();return;}date=new Date(cal.date);if(el.navtype==0)date.setDateOnly(new Date());cal.dateClicked=false;var year=date.getFullYear();var mon=date.getMonth();function setMonth(m){var day=date.getDate();var max=date.getMonthDays(m);if(day>max){date.setDate(max);}date.setMonth(m);};switch(el.navtype){case 400:Calendar.removeClass(el,"hilite");var text=Calendar._TT["ABOUT"];if(typeof text!="undefined"){text+=cal.showsTime?Calendar._TT["ABOUT_TIME"]:"";}else{text="Help and about box text is not translated into this language.\n"+"If you know this language and you feel generous please update\n"+"the corresponding file in \"lang\" subdir to match calendar-en.js\n"+"and send it back to to get it into the distribution ;-)\n\n"+"Thank you!\n"+"http://dynarch.com/mishoo/calendar.epl\n";}alert(text);return;case-2:if(year>cal.minYear){date.setFullYear(year-1);}break;case-1:if(mon>0){setMonth(mon-1);}else if(year-->cal.minYear){date.setFullYear(year);setMonth(11);}break;case 1:if(mon<11){setMonth(mon+1);}else if(year=0;)if(range[i]==current)break;if(ev&&ev.shiftKey){if(--i<0)i=range.length-1;}else if(++i>=range.length)i=0;var newval=range[i];el.innerHTML=newval;cal.onUpdateTime();return;case 0:if((typeof cal.getDateStatus=="function")&&cal.getDateStatus(date,date.getFullYear(),date.getMonth(),date.getDate())){return false;}break;}if(!date.equalsTo(cal.date)){cal.setDate(date);newdate=true;}else if(el.navtype==0)newdate=closing=true;}if(newdate){ev&&cal.callHandler();}if(closing){Calendar.removeClass(el,"hilite");ev&&cal.callCloseHandler();}};Calendar.prototype.create=function(_par){var parent=null;if(!_par){parent=document.getElementsByTagName("body")[0];this.isPopup=true;}else{parent=_par;this.isPopup=false;}this.date=this.dateStr?new Date(this.dateStr):new Date();var table=Calendar.createElement("table");this.table=table;table.cellSpacing=0;table.cellPadding=0;table.calendar=this;Calendar.addEvent(table,"mousedown",Calendar.tableMouseDown);var div=Calendar.createElement("div");this.element=div;div.className="calendar";if(this.isPopup){div.style.position="absolute";div.style.display="none";}div.appendChild(table);var thead=Calendar.createElement("thead",table);var cell=null;var row=null;var cal=this;var hh=function(text,cs,navtype){cell=Calendar.createElement("td",row);cell.colSpan=cs;cell.className="button";if(navtype!=0&&Math.abs(navtype)<=2)cell.className+=" nav";Calendar._add_evs(cell);cell.calendar=cal;cell.navtype=navtype;cell.innerHTML="
"+text+"
";return cell;};row=Calendar.createElement("tr",thead);var title_length=6;(this.isPopup)&&--title_length;(this.weekNumbers)&&++title_length;hh("?",1,400).ttip=Calendar._TT["INFO"];this.title=hh("",title_length,300);this.title.className="title";if(this.isPopup){this.title.ttip=Calendar._TT["DRAG_TO_MOVE"];this.title.style.cursor="move";hh("×",1,200).ttip=Calendar._TT["CLOSE"];}row=Calendar.createElement("tr",thead);row.className="headrow";this._nav_py=hh("«",1,-2);this._nav_py.ttip=Calendar._TT["PREV_YEAR"];this._nav_pm=hh("‹",1,-1);this._nav_pm.ttip=Calendar._TT["PREV_MONTH"];this._nav_now=hh(Calendar._TT["TODAY"],this.weekNumbers?4:3,0);this._nav_now.ttip=Calendar._TT["GO_TODAY"];this._nav_nm=hh("›",1,1);this._nav_nm.ttip=Calendar._TT["NEXT_MONTH"];this._nav_ny=hh("»",1,2);this._nav_ny.ttip=Calendar._TT["NEXT_YEAR"];row=Calendar.createElement("tr",thead);row.className="daynames";if(this.weekNumbers){cell=Calendar.createElement("td",row);cell.className="name wn";cell.innerHTML=Calendar._TT["WK"];}for(var i=7;i>0;--i){cell=Calendar.createElement("td",row);if(!i){cell.navtype=100;cell.calendar=this;Calendar._add_evs(cell);}}this.firstdayname=(this.weekNumbers)?row.firstChild.nextSibling:row.firstChild;this._displayWeekdays();var tbody=Calendar.createElement("tbody",table);this.tbody=tbody;for(i=6;i>0;--i){row=Calendar.createElement("tr",tbody);if(this.weekNumbers){cell=Calendar.createElement("td",row);}for(var j=7;j>0;--j){cell=Calendar.createElement("td",row);cell.calendar=this;Calendar._add_evs(cell);}}if(this.showsTime){row=Calendar.createElement("tr",tbody);row.className="time";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;cell.innerHTML=Calendar._TT["TIME"]||" ";cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=this.weekNumbers?4:3;(function(){function makeTimePart(className,init,range_start,range_end){var part=Calendar.createElement("span",cell);part.className=className;part.innerHTML=init;part.calendar=cal;part.ttip=Calendar._TT["TIME_PART"];part.navtype=50;part._range=[];if(typeof range_start!="number")part._range=range_start;else{for(var i=range_start;i<=range_end;++i){var txt;if(i<10&&range_end>=10)txt='0'+i;else txt=''+i;part._range[part._range.length]=txt;}}Calendar._add_evs(part);return part;};var hrs=cal.date.getHours();var mins=cal.date.getMinutes();var t12=!cal.time24;var pm=(hrs>12);if(t12&&pm)hrs-=12;var H=makeTimePart("hour",hrs,t12?1:0,t12?12:23);var span=Calendar.createElement("span",cell);span.innerHTML=":";span.className="colon";var M=makeTimePart("minute",mins,0,59);var AP=null;cell=Calendar.createElement("td",row);cell.className="time";cell.colSpan=2;if(t12)AP=makeTimePart("ampm",pm?"pm":"am",["am","pm"]);else cell.innerHTML=" ";cal.onSetTime=function(){var pm,hrs=this.date.getHours(),mins=this.date.getMinutes();if(t12){pm=(hrs>=12);if(pm)hrs-=12;if(hrs==0)hrs=12;AP.innerHTML=pm?"pm":"am";}H.innerHTML=(hrs<10)?("0"+hrs):hrs;M.innerHTML=(mins<10)?("0"+mins):mins;};cal.onUpdateTime=function(){var date=this.date;var h=parseInt(H.innerHTML,10);if(t12){if(/pm/i.test(AP.innerHTML)&&h<12)h+=12;else if(/am/i.test(AP.innerHTML)&&h==12)h=0;}var d=date.getDate();var m=date.getMonth();var y=date.getFullYear();date.setHours(h);date.setMinutes(parseInt(M.innerHTML,10));date.setFullYear(y);date.setMonth(m);date.setDate(d);this.dateClicked=false;this.callHandler();};})();}else{this.onSetTime=this.onUpdateTime=function(){};}var tfoot=Calendar.createElement("tfoot",table);row=Calendar.createElement("tr",tfoot);row.className="footrow";cell=hh(Calendar._TT["SEL_DATE"],this.weekNumbers?8:7,300);cell.className="ttip";if(this.isPopup){cell.ttip=Calendar._TT["DRAG_TO_MOVE"];cell.style.cursor="move";}this.tooltips=cell;div=Calendar.createElement("div",this.element);this.monthsCombo=div;div.className="combo";for(i=0;i0;--i){var yr=Calendar.createElement("div");yr.className=Calendar.is_ie?"label-IEfix":"label";div.appendChild(yr);}this._init(this.firstDayOfWeek,this.date);parent.appendChild(this.element);};Calendar._keyEvent=function(ev){var cal=window._dynarch_popupCalendar;if(!cal||cal.multiple)return false;(Calendar.is_ie)&&(ev=window.event);var act=(Calendar.is_ie||ev.type=="keypress"),K=ev.keyCode;if(ev.ctrlKey){switch(K){case 37:act&&Calendar.cellClick(cal._nav_pm);break;case 38:act&&Calendar.cellClick(cal._nav_py);break;case 39:act&&Calendar.cellClick(cal._nav_nm);break;case 40:act&&Calendar.cellClick(cal._nav_ny);break;default:return false;}}else switch(K){case 32:Calendar.cellClick(cal._nav_now);break;case 27:act&&cal.callCloseHandler();break;case 37:case 38:case 39:case 40:if(act){var prev,x,y,ne,el,step;prev=K==37||K==38;step=(K==37||K==39)?1:7;function setVars(){el=cal.currentDateEl;var p=el.pos;x=p&15;y=p>>4;ne=cal.ar_days[y][x];};setVars();function prevMonth(){var date=new Date(cal.date);date.setDate(date.getDate()-step);cal.setDate(date);};function nextMonth(){var date=new Date(cal.date);date.setDate(date.getDate()+step);cal.setDate(date);};while(1){switch(K){case 37:if(--x>=0)ne=cal.ar_days[y][x];else{x=6;K=38;continue;}break;case 38:if(--y>=0)ne=cal.ar_days[y][x];else{prevMonth();setVars();}break;case 39:if(++x<7)ne=cal.ar_days[y][x];else{x=0;K=40;continue;}break;case 40:if(++ythis.maxYear){year=this.maxYear;date.setFullYear(year);}this.firstDayOfWeek=firstDayOfWeek;this.date=new Date(date);var month=date.getMonth();var mday=date.getDate();var no_days=date.getMonthDays();date.setDate(1);var day1=(date.getDay()-this.firstDayOfWeek)%7;if(day1<0)day1+=7;date.setDate(-day1);date.setDate(date.getDate()+1);var row=this.tbody.firstChild;var MN=Calendar._SMN[month];var ar_days=this.ar_days=new Array();var weekend=Calendar._TT["WEEKEND"];var dates=this.multiple?(this.datesCells={}):null;for(var i=0;i<6;++i,row=row.nextSibling){var cell=row.firstChild;if(this.weekNumbers){cell.className="day wn";cell.innerHTML=date.getWeekNumber();cell=cell.nextSibling;}row.className="daysrow";var hasdays=false,iday,dpos=ar_days[i]=[];for(var j=0;j<7;++j,cell=cell.nextSibling,date.setDate(iday+1)){iday=date.getDate();var wday=date.getDay();cell.className="day";cell.pos=i<<4|j;dpos[j]=cell;var current_month=(date.getMonth()==month);if(!current_month){if(this.showsOtherMonths){cell.className+=" othermonth";cell.otherMonth=true;}else{cell.className="emptycell";cell.innerHTML=" ";cell.disabled=true;continue;}}else{cell.otherMonth=false;hasdays=true;}cell.disabled=false;cell.innerHTML=this.getDateText?this.getDateText(date,iday):iday;if(dates)dates[date.print("%Y%m%d")]=cell;if(this.getDateStatus){var status=this.getDateStatus(date,year,month,iday);if(this.getDateToolTip){var toolTip=this.getDateToolTip(date,year,month,iday);if(toolTip)cell.title=toolTip;}if(status===true){cell.className+=" disabled";cell.disabled=true;}else{if(/disabled/i.test(status))cell.disabled=true;cell.className+=" "+status;}}if(!cell.disabled){cell.caldate=new Date(date);cell.ttip="_";if(!this.multiple&¤t_month&&iday==mday&&this.hiliteToday){cell.className+=" selected";this.currentDateEl=cell;}if(date.getFullYear()==TY&&date.getMonth()==TM&&iday==TD){cell.className+=" today";cell.ttip+=Calendar._TT["PART_TODAY"];}if(weekend.indexOf(wday.toString())!=-1)cell.className+=cell.otherMonth?" oweekend":" weekend";}}if(!(hasdays||this.showsOtherMonths))row.className="emptyrow";}this.title.innerHTML=Calendar._MN[month]+", "+year;this.onSetTime();this.table.style.visibility="visible";this._initMultipleDates();};Calendar.prototype._initMultipleDates=function(){if(this.multiple){for(var i in this.multiple){var cell=this.datesCells[i];var d=this.multiple[i];if(!d)continue;if(cell)cell.className+=" selected";}}};Calendar.prototype._toggleMultipleDate=function(date){if(this.multiple){var ds=date.print("%Y%m%d");var cell=this.datesCells[ds];if(cell){var d=this.multiple[ds];if(!d){Calendar.addClass(cell,"selected");this.multiple[ds]=date;}else{Calendar.removeClass(cell,"selected");delete this.multiple[ds];}}}};Calendar.prototype.setDateToolTipHandler=function(unaryFunction){this.getDateToolTip=unaryFunction;};Calendar.prototype.setDate=function(date){if(!date.equalsTo(this.date)){this._init(this.firstDayOfWeek,date);}};Calendar.prototype.refresh=function(){this._init(this.firstDayOfWeek,this.date);};Calendar.prototype.setFirstDayOfWeek=function(firstDayOfWeek){this._init(firstDayOfWeek,this.date);this._displayWeekdays();};Calendar.prototype.setDateStatusHandler=Calendar.prototype.setDisabledHandler=function(unaryFunction){this.getDateStatus=unaryFunction;};Calendar.prototype.setRange=function(a,z){this.minYear=a;this.maxYear=z;};Calendar.prototype.callHandler=function(){if(this.onSelected){this.onSelected(this,this.date.print(this.dateFormat));}};Calendar.prototype.callCloseHandler=function(){if(this.onClose){this.onClose(this);}this.hideShowCovered();};Calendar.prototype.destroy=function(){var el=this.element.parentNode;el.removeChild(this.element);Calendar._C=null;window._dynarch_popupCalendar=null;};Calendar.prototype.reparent=function(new_parent){var el=this.element;el.parentNode.removeChild(el);new_parent.appendChild(el);};Calendar._checkCalendar=function(ev){var calendar=window._dynarch_popupCalendar;if(!calendar){return false;}var el=Calendar.is_ie?Calendar.getElement(ev):Calendar.getTargetElement(ev);for(;el!=null&&el!=calendar.element;el=el.parentNode);if(el==null){window._dynarch_popupCalendar.callCloseHandler();return Calendar.stopEvent(ev);}};Calendar.prototype.show=function(){var rows=this.table.getElementsByTagName("tr");for(var i=rows.length;i>0;){var row=rows[--i];Calendar.removeClass(row,"rowhilite");var cells=row.getElementsByTagName("td");for(var j=cells.length;j>0;){var cell=cells[--j];Calendar.removeClass(cell,"hilite");Calendar.removeClass(cell,"active");}}this.element.style.display="block";this.hidden=false;if(this.isPopup){window._dynarch_popupCalendar=this;Calendar.addEvent(document,"keydown",Calendar._keyEvent);Calendar.addEvent(document,"keypress",Calendar._keyEvent);Calendar.addEvent(document,"mousedown",Calendar._checkCalendar);}this.hideShowCovered();};Calendar.prototype.hide=function(){if(this.isPopup){Calendar.removeEvent(document,"keydown",Calendar._keyEvent);Calendar.removeEvent(document,"keypress",Calendar._keyEvent);Calendar.removeEvent(document,"mousedown",Calendar._checkCalendar);}this.element.style.display="none";this.hidden=true;this.hideShowCovered();};Calendar.prototype.showAt=function(x,y){var s=this.element.style;s.left=x+"px";s.top=y+"px";this.show();};Calendar.prototype.showAtElement=function(el,opts){var self=this;var p=Calendar.getAbsolutePos(el);if(!opts||typeof opts!="string"){this.showAt(p.x,p.y+el.offsetHeight);return true;}function fixPosition(box){if(box.x<0)box.x=0;if(box.y<0)box.y=0;var cp=document.createElement("div");var s=cp.style;s.position="absolute";s.right=s.bottom=s.width=s.height="0px";document.body.appendChild(cp);var br=Calendar.getAbsolutePos(cp);document.body.removeChild(cp);if(Calendar.is_ie){br.y+=document.body.scrollTop;br.x+=document.body.scrollLeft;}else{br.y+=window.scrollY;br.x+=window.scrollX;}var tmp=box.x+box.width-br.x;if(tmp>0)box.x-=tmp;tmp=box.y+box.height-br.y;if(tmp>0)box.y-=tmp;};this.element.style.display="block";Calendar.continuation_for_the_fucking_khtml_browser=function(){var w=self.element.offsetWidth;var h=self.element.offsetHeight;self.element.style.display="none";var valign=opts.substr(0,1);var halign="l";if(opts.length>1){halign=opts.substr(1,1);}switch(valign){case "T":p.y-=h;break;case "B":p.y+=el.offsetHeight;break;case "C":p.y+=(el.offsetHeight-h)/2;break;case "t":p.y+=el.offsetHeight-h;break;case "b":break;}switch(halign){case "L":p.x-=w;break;case "R":p.x+=el.offsetWidth;break;case "C":p.x+=(el.offsetWidth-w)/2;break;case "l":p.x+=el.offsetWidth-w;break;case "r":break;}p.width=w;p.height=h+40;self.monthsCombo.style.display="none";fixPosition(p);self.showAt(p.x,p.y);};if(Calendar.is_khtml)setTimeout("Calendar.continuation_for_the_fucking_khtml_browser()",10);else Calendar.continuation_for_the_fucking_khtml_browser();};Calendar.prototype.setDateFormat=function(str){this.dateFormat=str;};Calendar.prototype.setTtDateFormat=function(str){this.ttDateFormat=str;};Calendar.prototype.parseDate=function(str,fmt){if(!fmt)fmt=this.dateFormat;this.setDate(Date.parseDate(str,fmt));};Calendar.prototype.hideShowCovered=function(){if(!Calendar.is_ie&&!Calendar.is_opera)return;function getVisib(obj){var value=obj.style.visibility;if(!value){if(document.defaultView&&typeof(document.defaultView.getComputedStyle)=="function"){if(!Calendar.is_khtml)value=document.defaultView. getComputedStyle(obj,"").getPropertyValue("visibility");else value='';}else if(obj.currentStyle){value=obj.currentStyle.visibility;}else value='';}return value;};var tags=new Array("applet","iframe","select");var el=this.element;var p=Calendar.getAbsolutePos(el);var EX1=p.x;var EX2=el.offsetWidth+EX1;var EY1=p.y;var EY2=el.offsetHeight+EY1;for(var k=tags.length;k>0;){var ar=document.getElementsByTagName(tags[--k]);var cc=null;for(var i=ar.length;i>0;){cc=ar[--i];p=Calendar.getAbsolutePos(cc);var CX1=p.x;var CX2=cc.offsetWidth+CX1;var CY1=p.y;var CY2=cc.offsetHeight+CY1;if(this.hidden||(CX1>EX2)||(CX2EY2)||(CY229)?1900:2000);break;case "%b":case "%B":for(j=0;j<12;++j){if(Calendar._MN[j].substr(0,a[i].length).toLowerCase()==a[i].toLowerCase()){m=j;break;}}break;case "%H":case "%I":case "%k":case "%l":hr=parseInt(a[i],10);break;case "%P":case "%p":if(/pm/i.test(a[i])&&hr<12)hr+=12;else if(/am/i.test(a[i])&&hr>=12)hr-=12;break;case "%M":min=parseInt(a[i],10);break;}}if(isNaN(y))y=today.getFullYear();if(isNaN(m))m=today.getMonth();if(isNaN(d))d=today.getDate();if(isNaN(hr))hr=today.getHours();if(isNaN(min))min=today.getMinutes();if(y!=0&&m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);y=0;m=-1;d=0;for(i=0;i31&&y==0){y=parseInt(a[i],10);(y<100)&&(y+=(y>29)?1900:2000);}else if(d==0){d=a[i];}}if(y==0)y=today.getFullYear();if(m!=-1&&d!=0)return new Date(y,m,d,hr,min,0);return today;};Date.prototype.getMonthDays=function(month){var year=this.getFullYear();if(typeof month=="undefined"){month=this.getMonth();}if(((0==(year%4))&&((0!=(year%100))||(0==(year%400))))&&month==1){return 29;}else{return Date._MD[month];}};Date.prototype.getDayOfYear=function(){var now=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var then=new Date(this.getFullYear(),0,0,0,0,0);var time=now-then;return Math.floor(time/Date.DAY);};Date.prototype.getWeekNumber=function(){var d=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0);var DoW=d.getDay();d.setDate(d.getDate()-(DoW+6)%7+3);var ms=d.valueOf();d.setMonth(0);d.setDate(4);return Math.round((ms-d.valueOf())/(7*864e5))+1;};Date.prototype.equalsTo=function(date){return((this.getFullYear()==date.getFullYear())&&(this.getMonth()==date.getMonth())&&(this.getDate()==date.getDate())&&(this.getHours()==date.getHours())&&(this.getMinutes()==date.getMinutes()));};Date.prototype.setDateOnly=function(date){var tmp=new Date(date);this.setDate(1);this.setFullYear(tmp.getFullYear());this.setMonth(tmp.getMonth());this.setDate(tmp.getDate());};Date.prototype.print=function(str){var m=this.getMonth();var d=this.getDate();var y=this.getFullYear();var wn=this.getWeekNumber();var w=this.getDay();var s={};var hr=this.getHours();var pm=(hr>=12);var ir=(pm)?(hr-12):hr;var dy=this.getDayOfYear();if(ir==0)ir=12;var min=this.getMinutes();var sec=this.getSeconds();s["%a"]=Calendar._SDN[w];s["%A"]=Calendar._DN[w];s["%b"]=Calendar._SMN[m];s["%B"]=Calendar._MN[m];s["%C"]=1+Math.floor(y/100);s["%d"]=(d<10)?("0"+d):d;s["%e"]=d;s["%H"]=(hr<10)?("0"+hr):hr;s["%I"]=(ir<10)?("0"+ir):ir;s["%j"]=(dy<100)?((dy<10)?("00"+dy):("0"+dy)):dy;s["%k"]=hr;s["%l"]=ir;s["%m"]=(m<9)?("0"+(1+m)):(1+m);s["%M"]=(min<10)?("0"+min):min;s["%n"]="\n";s["%p"]=pm?"PM":"AM";s["%P"]=pm?"pm":"am";s["%s"]=Math.floor(this.getTime()/1000);s["%S"]=(sec<10)?("0"+sec):sec;s["%t"]="\t";s["%U"]=s["%W"]=s["%V"]=(wn<10)?("0"+wn):wn;s["%u"]=w+1;s["%w"]=w;s["%y"]=(''+y).substr(2,2);s["%Y"]=y;s["%%"]="%";var re=/%./g;if(!Calendar.is_ie5&&!Calendar.is_khtml)return str.replace(re,function(par){return s[par]||par;});var a=str.match(re);for(var i=0;i", ">>" 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 27082b83c267 -r 465e70422e66 gnv/src/main/webapp/styles/default.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/styles/default.css Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,355 @@ +@charset +"ISO-8859-1" +; + +body { + background-color: #FFFFFF; + font-family: verdana, arial, Helvetica, sans-serif; + + height: 100%; + margin: 0; + padding: 0; +} + +br { + padding: 0; + margin: 0; + font-size: 0; + clear: both; +} + +form { + margin: 0; + padding: 0; +} + +h1 { + font-weight: bold; + font-size: 0.9em; + color: #00416B; +} + +h2 { + font-weight: bold; + font-size: 0.8em; + color: #00416B; +} + +a { + color: #00416B; + text-decoration: none; +} + +legend { + border: 1px solid #CCD5DE; + padding: 4px 5px; + margin: 0 0 0 0; + background-color: white; + font-weight: bolder; + color: #00416B; + clear: both; +} + +fieldset { + margin: 5px 0 0 10px; + padding-left: 10px; + padding-right: 10px; + border: 1px solid #CCD5DE; + background-image: url( ../images/bg_fieldset_ie6.gif ); + background-repeat: repeat-x; + background-position: top left; + display: block; +} + +html > body fieldset { + background-image: url( ../images/bg_fieldset.gif ); +} + +div { + margin: 0; + padding: 0; +} + +p, li, dl, input, select, address, legend, label, fieldset span { + font-size: 0.7em; +} + +legend.expandableFieldset { + cursor: pointer; +} + +select, textarea { + width: 250px; +} + +input.textinput { + width: 250px; +} + + +textarea { + font-family: verdana, arial, Helvetica, sans-serif; + font-size: 0.7em; +} + +table, th, td { + margin: 0; + padding: 0; + font-size: 0.8em; +} +.submitbutton{ + cursor:pointer; + border:outset 1px #ccc; + background:#ffffff; + color:#666; + font-weight:bold; + padding: 1px 2px; + +} + +.error { + color: #CD3426; + font-size: 10px; + font-weight: bold; + margin: 2px 2px; +} + +.errormsg { + + color: red; + font-weight: bold; +} + +/* ====================== Header ============================= */ +#head { + + height: 25px; + margin: 0; + padding: 0; + background-color: #103D64; +} + +#logo { + float:right; + background-image: url( ../images/bsh_logo.gif ); + background-repeat: no-repeat; + + top:0px; + height: 170px; + width: 75px; + +} +#head a { + clear:left; + +} +#project { + position:absolute; + top:27px; + left:10px; + width: 400px; + text-align: left; + +} + +#load_error { + position:absolute; + top:27px; + left:425px; + width: 400px; + text-align: left; + +} + +#project_load { + position:absolute; + top: 0px; + left: 250px; + width: 277px; + border: 1px solid lightgray; + visibility: hidden; + padding: 5px; +} + + +#head h1, #head h2 { + display: block; + color: white; + font-size: large; + padding-left: 300px; + margin: 0; + + +} + +div#header { + background-color: #143B62; + margin: 0; + padding: 0; + height: 50px; +} + +div#header img { + padding: 0; + margin: 0; + border-width: 0; +} + +div#page { + position: absolute; + top: 0; + left: 0; + width: 100%; + +} + +.showContent { + display: block; +} + +.hideContent { + display: none; +} + +div#selection { + float: left; + width: 300px; + margin-top: 30px; +} + +div#diagram { +/*POSITION DEFINIEREN*/ +/* border: 1px solid crimson;*/ + position: absolute; + top: 65px; + left: 350px; +} + +div#export { + padding-left: 7px; +} + +/* this is a wrapper for diagramoptions and statistics*/ +div#diagrammAddOns { + position: absolute; + top: 600px; + left: 300px; +} + +div#diagramoptions { +/*POSITION DEFINIEREN*/ +/*border: 1px solid blue;*/ + position: relative; + width: 600px; +} + +div#diagramOptionsContent { +/*display: none;*/ +} + +div#statistics { +/*POSITION DEFINIEREN*/ +/*border: 1px solid Red;*/ + position: relative; + width: 600px; +} + +div#statisticValues { + width: 100%; +} + +table#statistik_tab_0{ + position:relative; + top:0px; + left:0px; +} +table#statistik_tab_1{ + position:absolute; + top:30px; + left:230px; +} +table#statistik_tab_2{ + position:relative; + top:-210px; + left:410px; +} +table#statistik_tab_3{ + position:relative; + top:-195px; + left:0px; +} +table#statistik_tab_4{ + position:absolute; + top:260px; + left:230px; +} +table#statistik_tab_5{ + position:absolute; + top:260px; + left:410px; +} +table#statistik_tab_6{ + position:relative; + top:-180px; + left:0px; +} +table#statistik_tab_7{ + position:absolute; + top:485px; + left:230px; +} +table#statistik_tab_8{ + position:absolute; + top:485px; + left:410px; +} + +div#basefilter { + margin-top: 30px; + width: 325px; +} + +div#timeseriesfilter { + margin-top: 1px; + padding: 0px; + width: 325px; +} + +#timeRangeForm label { + float: left; + margin-right: 5px; + text-align: left; + width: 20px; +} + +/* ---------- OVERLAY ------------------------- */ +#overlay { + visibility: hidden; + position: absolute; + left: 0; + top: 0; + width: 100%; + height: 100%; + text-align: center; + z-index: 100; + background-color: white; + -moz-opacity: 0.5; + opacity: 0.5; +} + +#overlayContent { + visibility: hidden; + position: relative; + z-index: 101; + width: 300px; + margin: 150px auto; + background-color: #fff; + border: 1px solid #000; + padding: 75px; + text-align: right; + background-image: url( ../images/bsh_logo.gif ); + background-repeat: no-repeat; + +} + +/* ----------------------------------- */ \ No newline at end of file diff -r 27082b83c267 -r 465e70422e66 gnv/src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,102 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.client; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.Locale; + +import junit.framework.TestCase; + +import org.apache.log4j.BasicConfigurator; +import org.apache.log4j.Logger; + +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +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.util.XSLTransformer; + +/** + * @author Tim Englich + * + */ +public class ArtifactDatabaseClientTestCase extends TestCase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = null; + + static { + BasicConfigurator.configure(); + log = Logger.getLogger(DefaultArtifactDatabaseClient.class); + } + + /** + * Constructor + * + * @param namemessage + */ + public ArtifactDatabaseClientTestCase(String name) { + super(name); + } + + /** + * @see junit.framework.TestCase#setUp() + */ + @Override + protected void setUp() throws Exception { + super.setUp(); + } + + public void testArtifactDatabaseClient() { + + try { + ArtifactDatabaseClient artifactDatabaseClient = ArtifactDatabaseClientFactory + .getInstance().getArtifactDatabaseClient(Locale.GERMAN); + Collection factories = artifactDatabaseClient + .getArtifactFactories(); + if (factories != null && !factories.isEmpty()) { + Iterator it = factories.iterator(); + while (it.hasNext()) { + ArtifactObject aof = it.next(); + ArtifactObject artifact = artifactDatabaseClient + .createNewArtifact(aof); + ArtifactDescription ad = artifactDatabaseClient + .getCurrentStepDescription(aof, artifact,true); + log.debug("Artifact aktualisert."); + XSLTransformer transformer = new XSLTransformer(); + String transformedUI = transformer + .transform( + ad.getCurrentUI(), + "UTF-8", + ("src/main/webapp/WEB-INF/config/templates/describe-ui.xsl")); + log.debug(transformedUI); + + Collection inputParameter = new ArrayList( + 1); + inputParameter.add(new DefaultInputParameter("product", + new String[] { "timeSeries" })); + ad = artifactDatabaseClient.doNextStep(aof, artifact, + "timeSeries", inputParameter); + + transformedUI = transformer + .transform( + ad.getCurrentUI(), + "UTF-8", + ("src/main/webapp/WEB-INF/config/templates/describe-ui.xsl")); + log.debug(transformedUI); + } + } + + } catch (ArtifactDatabaseClientException e) { + log.error(e, e); + fail(); + } + } + +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,57 @@ +/** + * + */ +package de.intevation.gnv.util; + +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; + +import junit.framework.TestCase; + +import org.apache.log4j.BasicConfigurator; +import org.apache.log4j.Logger; +import org.w3c.dom.Document; + +import de.intevation.gnv.artifactdatabase.client.DefaultArtifactDatabaseClient; + +/** + * @author Tim Englich + * + */ +public class XSLTransformerTestCase extends TestCase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = null; + + static { + BasicConfigurator.configure(); + log = Logger.getLogger(DefaultArtifactDatabaseClient.class); + } + + public XSLTransformerTestCase() { + super(); + } + + public XSLTransformerTestCase(String name) { + super(name); + } + + public void testDescribeUI() { + + try { + // System.setProperty("javax.xml.transform.TransformerFactory","com.icl.saxon.TransformerFactoryImpl"); + Document document = new XMLUtils() + .readDocument(new FileInputStream(new File( + "src/test/ressources/describe-ui-test.xml"))); + XSLTransformer transformer = new XSLTransformer(); + String value = transformer.transform(document, "UTF-8", + "src/main/webapp/WEB-INF/config/templates/describe-ui.xsl"); + log.debug(value); + } catch (FileNotFoundException e) { + log.error(e, e); + } + } +} diff -r 27082b83c267 -r 465e70422e66 gnv/src/test/ressources/describe-ui-test.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/ressources/describe-ui-test.xml Fri Sep 28 12:13:47 2012 +0200 @@ -0,0 +1,10 @@ + + + product + + + timeSeries + timeSeries + + +