# HG changeset patch # User Thomas Arendsen Hein # Date 1348827233 -7200 # Node ID af3f56758f59055f8815b00ea82a53c63830d4d1 # Parent 5f5f273c8566e3aa9e93ebc60f6dfa498c9aaf8d# Parent b98d1adee7a60a5c13c336a54992f6429376bef5 merged gnv-artifacts/0.5 diff -r b98d1adee7a6 -r af3f56758f59 gnv/ChangeLog --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/ChangeLog Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,1611 @@ +2010-03-08 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Adjusted xpath expression to find exception nodes in xml documents again. + The prefix 'art:' has been missing. + +2010-03-08 Ingo Weinzierl + + Issue187 + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Exports with + target 'img' will get a file extension that corresponds to their + mime-type. There was no code path for 'img' before, which caused the + problem, that 'img'-exports had a '.txt'-file extension. + +2010-03-06 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: + Removed duplicated imports. + +2010-03-05 Ingo Weinzierl + + Issue190 + + * src/main/java/de/intevation/gnv/action/CreateHistogramAction.java, + src/main/java/de/intevation/gnv/action/CreateChartAction.java: Reset + diagram options. Switching between chart and histogram caused some 'null' + values in text fields. After resetting these options, we don't have these + problems anymore - text fields will be filled with default values in this + case. + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp: + Removed useless file. + +2010-03-05 Tim Englich + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + ISSUE 181: Removed duplicate Drawaing of the Lengendvalue of Groupelements + for choosing different heights for several Parameters + +2010-03-05 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + 'publishWMS' returns a whole document which contains meta information used + for mapfile generation - not just a string. These information contain + MapServer URL and the path to its mapfile. + + * src/main/java/de/intevation/gnv/action/WMSAction.java: Fetch MapServer + settings from resulting document after wms-publishing to display these + values in gui. + + * src/main/java/de/intevation/gnv/util/XMLUtils.java: Converted class + methods into static methods to use them without initializing an object of + XMLUtils. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: Show MapServer and layer + information in gui and use MapServer settings to feed OpenLayers client. + + * src/main/webapp/styles/default.css: Added some classes to adjust style of + information table (wms service, layer name) and map area. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added column labels + for displaying MapServer information. + +2010-03-04 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/index.jsp, + src/main/webapp/WEB-INF/jsp/wmslayout.jsp: Removed map-div from index.jsp + and moved it to wmslayout. So, we don't have an empty div with grey border + in our application if there is no map currently existing. Load images from + MapServer as 'image/png'. + + * src/main/webapp/styles/default.css: Adjusted style for customizing + map-div. + +2010-03-02 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Added export mode to 'out'-xml document. + + * src/main/java/de/intevation/gnv/action/DoOutputAction.java, + src/main/java/de/intevation/gnv/action/DoExportAction.java: Call + 'doOutput' for triggering an output like chart, histogram, csv or odv with + a new parameter export mode which contains the export format (img, pdf, + svg). + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Added export + mode to HTTP-Get requests. + +2010-03-02 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + Implemented a One-Step-Back-History. The user is able to step back to + the last state and to the state for choosing the fis. + +2010-03-02 Ingo Weinzierl + + Issue184 + + * src/main/webapp/WEB-INF/jsp/index.jsp: Display chart per default, when + reaching a final state, which doesn't need any further user input. + +2010-03-01 Ingo Weinzierl + + Issue183 + + * src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java: + Take care on exceptions and render an error message if an exception + occured. + +2010-03-01 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Removed little + copy-paste mistake while setting file-extension for exports. + +2010-03-01 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Set + file-extension according to mime type for histogram exports. + +2010-02-26 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Render a matrix + for measurement selection. + + * src/main/webapp/styles/default.css: Added new css class to adjust the + matrix' column headers. + +2010-02-25 Ingo Weinzierl + + Issue178 + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Added a code + path for export actions, where no export mode is given. + +2010-02-24 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Added + user selected type of bin setting (number of bins, bin width) to diagram + options and request object which are used to create links for chart + images. + + * src/main/java/de/intevation/gnv/action/DoOutputAction.java: Added user + selected type of bin setting to InputParameters which are used to create + xml documents for 'out' target. + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp: Added + checkboxes to select the field to adjust bins in histogram charts (bin + width or number of bins). When selecting a checkbox, the other box becomes + disabled. + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: JavaScript function to toggle + checkboxes. + +2010-02-24 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp: Append + user inserted parameter from histogram options (width, height, bin width, + number of bins) to http request when fetching the histogram image. + +2010-02-23 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java: + New method returning export modes. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java: + Object storing information about mime-type, description and name of an + export mode. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Parse export modes from describe document and put them into OutputMode + objects. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Now, this + action is able to adjust histogram parameter as well. + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: An export is + triggered regarding a new parameter 'mode' which value can be 'pdf', + 'svg' or 'img'. Before, we just took care on 'target' parameter. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Transformed draw + button into an update button. + + * src/main/webapp/images/arrow_refresh.png: Icon for update button. (source: + famfamfam) + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Moved + exports from action panel into options panel. Actions (chart, histogram, + etc) are devided from exports (png, pdf, svg). + +2010-02-23 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/struts-config.xml: Foward to wmslayout.jsp + instead of mainlayout.jsp if the user selected wms target. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: New page for rendering a wms + client (OpenLayers). JavaScript loading take place in this page. If the + user select the wms target, a forward to this page will be done. + + TODO: Include OpenLayers library from local filesystem instead of loading + it from openlayers.org! + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Removed OpenLayers JavaScript + library and function to initialize OpenLayers. This reduces traffic while + parameterization. + +2010-02-23 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/CreateChartAction.java: Class to + trigger chart rendering. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Changed + request parameter from 'diagram' (deprecated) to 'chart'. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added title and + labels for histogram options. + + * src/main/webapp/images/chart_curve.png: Chart icon (source: famfamfam) + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added new action to + trigger chart rendering analog to histogram action. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Render chart option panel only if + the user already selected charts. + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: Show + diagram/chart options panel only if the user chose one of them. Placed + these option panels beneath the action panel. + + * src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Added new + icon for chart rendering. + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Removed js debug output. + +2010-02-22 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/struts-config.xml: New action 'WMSAction'. + It triggers the generation of shapefiles and mapfile and sets an internal + flag to intialize an OpenLayers map. + + * src/main/java/de/intevation/gnv/action/WMSAction.java: Action which + triggers the creation of shapefiles and mapfile. An internal flag is set + to initialize an OpenLayers map with the layer even published. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java: + Added a new method to send a request to the artifact server and start + shapefile and mapfile creation. + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Added javascript functions to + read url parameters and initialize OpenLayers. + + * src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Call 'wms.do' + after clicking WMS button which triggers WMSAction. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Added a div-container for rendering + an OpenLayers map. + + * src/main/webapp/styles/default.css: New class for styling map + div-container. + + * src/main/java/de/intevation/gnv/util/XMLUtils.java: Made method static to + be able to use it without creating an object of this class. + + +2010-02-15 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added an action + 'histogram' to render histograms. + + * src/main/java/de/intevation/gnv/action/CreateHistogramAction.java: Added a + new action for rendering histograms. + + * src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Display an + icon for histograms if this output mode is present for this artifact. + + * src/main/webapp/images/chart_bar.png: Icon for histograms from famfamfam + iconset. + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp: JSP for + rendering histograms. + + * src/main/webapp/styles/default.css: Added a style class for adapting + histogram div. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Include display_histogram_inc if + histogram action have been chosen by user. + + * src/main/resources/applicationMessages_en.properties, + src/main/resources/applicationMessages.properties: Button label and + alternative image text for histograms. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Removed + comment lines at the beginning of the file. These empty comment lines + would cause trouble later, when inserting GPL text automatically with a + script. + +2010-02-12 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Render an + icon to trigger a step-back in history for each state. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added missing forwards + used for stepping back to former states. + +2010-02-12 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp: + Added further XML-Nodes for simulating the MapViewer-Call more detailed. + +2010-02-12 Tim Englich + + * src/main/webapp/WEB-INF/config/struts-config.xml: + Added new Action for Calling the Page with the Form for simmulating + the MapViewer-Interface-request. + Using the URL + http://localhost:8080/gnv/mvcall.do + you will retrieve the Formular with the MapViewer-Interface-Request-body + + * src/main/webapp/WEB-INF/jsp/header.jsp: + Added an Switch that will manage that the GUI with the Form of the + MapViewer-Interface-Document only will be displaied if it is requested. + + * src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java (execute): + Added new Action for handling the Request that should show the Form + for insterting the MapViewer-Interface-Document. + +2010-02-12 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Modified the Create-Artifact-Request-Body that a Geometry will be put into + the Parameter if one is given e.g. using the MapViewer-Interface request. + +2010-02-09 Tim Englich + + * src/test/ressources/externalinterfacecall_curl.xml, + src/test/ressources/samplecall.txt: + Added Sampledata and a sample how to call the MapViewer-Interface using CURL. + +2010-02-09 Tim Englich + + * src/main/webapp/styles/default.css: + Added some stylinginformation for the Textarea for the XML-Document. + * src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp: + Integrated an Textarea so that is possible to manipulate the XML-Document + which simulates the MapViewer-Interface-Body. + +2010-02-09 Tim Englich + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java (execute): + Removed trailing and leading Whitespaces from the Parametervalue which + contains the XML-Document to avoid XML-Parsingerrors. + +2010-02-09 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (createMetaDataRequestBody): + Fixed a NPE. Now it is possible to put an Mapservice without an Layer into + the Request-Document of am Mapviewer-Interface-Call. + +2010-02-05 Ingo Weinzierl + + Issue170 + + * pom.xml: Changed log4j version to 1.2.14 (later version causes errors and + breaks maven build process). + +2010-02-02 Tim Englich + + * src/main/webapp/WEB-INF/jsp/header.jsp: + Added temporally Include of includes/display_mapviewercall_inc.jsp for the + Simulation of the MapViewer-Interface-Request. + + * src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp: + Added new Includefile with the Formular which includes the Data for the + Simulation of the MapViewer-Interface-Request. + +2010-02-01 Tim Englich + + * src/main/webapp/WEB-INF/config/struts-config.xml: + Added am Action for handling the MapViewer-Interface. + if /gnv/extcall.do is called the processing of the defined + Information will be done and the GUI will be displayed. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java: + Implementation of the interface ParametrizedArtifactObject fro the + representation of ArtifactFactories which has further Information. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java (addParameters): + Added new Interfacedefinition ParametrizedArtifactObjects for representing those + ArtifactObjects which includes further Informations. E.g. for creating an + new Artifact. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java (equals): + Override equals-method to get ap proper comparisons of the kinds of objects. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (getArtifactFactoryMetaInformation): + Added Method to retrieve Metainformations form the ArtifactDatabases. + Also added the possibility to send further Informations (e.g: Parameters) + in the Request-body of an Create-Artifact-Call. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (getArtifactFactoryMetaInformation): + Added Method to retrieve Metainformations form the ArtifactDatabases. + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java (execute): + Added further Businesslogic to the Action which will handle the MapViewer- + InterfaceCall. Now the retrieved Informations will be sent to the + ArtifactDatabase an the retrieved Informations will be used to reduce + the displayed "Fachinformationssysteme". And also will be used to + send these Informations (e.g: Parameters) during the creation of an + new Artifact. + +2010-01-27 Hans Plum + + RELEASE 0.3 + + * Changes, NEWS, ChangeLog: Summerized activities + +2010-01-27 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Added a + workarround to avoid input failures caused by multi select boxes with only + one entry. They look like text input fields and don't force the user to + select a row. In this case, the single entry is selected automatically. + +2010-01-25 Ingo Weinzierl + + * src/main/webapp/styles/default.css: Added a class for dynamic tables + - enabled input fields - to adjust font size of input fields. + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Removed + local-name() method, inserted a table for 'group' items (like input fields + of dates) and resized the height of multi select boxes - max 5 items or + less. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Removed a typo which made the html + output invalid. + +2010-01-22 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Add width, + height and the boolean value to adjust the visibility of points in charts + to the pdf and svg export links. + +2010-01-22 Ingo Weinzierl + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added legend for + summary box. + + * src/main/webapp/styles/default.css: Adapted some css classes regarding the + position of boxes and removed background image in fieldsets. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Removed + useless div container (div container is now outside the xsl sheet). + + * src/main/webapp/WEB-INF/jsp/index.jsp: Moved former parameter into a + fieldset and added a label to this fieldset. + +2010-01-22 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/ShowStatisticAction.java: This + action 'calculates' the statistic and shows the result in the gui. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added controller and + forwards. + + * src/main/webapp/images/statistics.png: Statistic icon. FIXME: Give a Source here! + + * src/main/webapp/WEB-INF/jsp/index.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Added symbol + in action box to show the statistic. + + * src/main/webapp/styles/default.css: Adjusted some parameter for a proper + placement of the statistic box. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for + statistic icon. + +2010-01-22 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: New action. + The only task of this action is to parse the describe document and create + static and dynamic user interface out of it. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java, + src/main/java/de/intevation/gnv/action/DoOutputAction.java, + src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java: + Removed xsl transformation. Classes which needs xsl transformation inherit + from DescribeUIAction which does the transformation. Now, it is much + easier to write new actions, because they do not need to parse the + describe document and create static and dynamic user interfaces. + + Removed some useless imports. + +2010-01-22 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/index.jsp, + src/main/webapp/WEB-INF/jsp/header.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp: + - Improved the design and the usibility concept ("Bedienkonzept"). + Removed the useless "draw" button after reaching the last state which + has some output modes. + - Render chart options - if chart creation is possible for this state - and show + export actions. + - Moved chart options and export actions to the left side beneath the + static and dynamic panals for parameterization. + - Removed some warnings and errors regaring html conformance. + + * src/main/webapp/styles/default.css: Made some necessary adjustments + regarding the movement of chart option and action boxes. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for + action box. + + * src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java: + Removed pathes of xsl sheets from code and put them to a central place. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Added + urls to xsl transformer for step-back links and create a dynamic ui only + if there is content for it - avoid creation of empty boxes. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: Write + dynamic ui only if there is content. Some code formatting done. + + * src/main/webapp/images/back_button.png: Button to step back to a previous + state. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added forwards to fis + selection and previous states. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Enabled + link to step back to fis selection. + +2010-01-20 Ingo Weinzierl + + Issue149 + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Show + chart if there are output modes existing for this state. Set internal + value of checkboxes to 'true' if they are selected. + + TODO: We should check if there is an output mode named 'chart' before + rendering a chart. + +2010-01-20 Ingo Weinzierl + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for + char option 'draw data points'. + +2010-01-20 Ingo Weinzierl + + * src/main/webapp/styles/default.css, + src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Adapted + style of static ui to bsh style. Improved indentation. + +2010-01-19 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl, + src/main/webapp/WEB-INF/jsp/index.jsp: Commented links to step back in + history out and always render a fis select box (reason for this is the + next release and a too buggy 'step-back-history'). + +2010-01-19 Tim Englich + + * src/test/ressources/externalinterfacecall.xml: + Added an Request-Document which contains an Call which might be + send from the MapViewer to the GNV. + + * src/test/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserTestCase.java: + Added TestCase for testing the functionality of the XMLExternalCallParser-Implementation. + +2010-01-19 Tim Englich + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java: + DefaultImplementation of the Interface MapService. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java : + Added a new Interfacespecification for representing an MapService retrieved + by an MapViewer-Call + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java: + DefaultImplementation of the Interface Layer. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java: + Added a new Interfacespecification for representing an Layer retrieved + by an MapViewer-Call + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java + (getArtifactFactoryMetaInformation), src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java + (getArtifactFactoryMetaInformation): + Added new Method for retrieving Metainformation for the ArtifactFactories using + the Data which is parsed using the ExternalCallParser. + + * src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserException.java (ExternalCallParserException): + New ExceptionClass which is used to specify Exception which occurs during parsing + an ExternalCallParser. + + * src/main/java/de/intevation/gnv/action/mapviewer/parser/XMLExternalCallParser.java : + Added an Implementation of the Inteface ExternalCallParser which is able to parse + an XML-Document. + + * src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParser.java : + Added a new Interface which provides the required Methods for parsing an + Request from the MapViewer an provide the parsed Data. + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java: + Added new Action which provied the reauired logic for Implementing the + Interface to the MapViewer. + +2010-01-18 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added a new controller + which causes a return to the point, where the user can choose a fis. + + * src/main/java/de/intevation/gnv/action/SelectFisAction.java: Controller to + reset the SessionModel and to jump back to fis selection. + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: Made + the link to return to the fis select box available in XSL. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Check the + 'fis' attribute is contained in select1 nodes and create a link in this + case. + +2010-01-18 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java: + Render the static part of the gui as well - not just the dynamic part. + + * src/main/webapp/WEB-INF/jsp/index.js: Do not include the fis combo box if + the describe document contains a static part, which means that the user + already selected a fis. + + * src/main/webapp/styles/default.css: Added 20px space at the top of the + static table. Otherwise the table hides the links to load and save + projects. + +2010-01-17 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Simpler + demo WKT polygon. + +2010-01-17 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: + Only render chart addons when we have a chart. + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: + Set right file extensions if we have WMS or ZIP export. + +2010-01-17 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: + Add links to download zip files and WMS layers if they are + available. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: + Added i10n for new download link types. + + * src/main/webapp/images/svg.png: New. Gimp rendered PNG + of official SVG logo. Creative Commons license. + + * src/main/webapp/images/pdf.png: New. Crystal pdf icon. + LGPLv2 license. + + * src/main/webapp/images/disk.png, src/main/webapp/images/map_go.png: + famfamfam icons for disk and map. Creative Commons license. + +2010-01-15 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java, + src/main/java/de/intevation/gnv/util/XSLTransformer.java: + Cleanup imports. + +2010-01-14 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: + Fixed a bug which caused that the user was not able to draw charts + anymore. Query the 'output' node of the describe document and render a + 'draw'-button if existing. If 'output' is not existing, render a 'select' + button to step forward to the next step. + +2010-01-13 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Added 'doAdvance' method to be able to advance only - without feed or + describe. We need this method to step back to previous states. Advance was + bundled with feed and describe, before. + + * src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java: + Some code refactoring. + + * src/main/java/de/intevation/gnv/util/XSLTransformer.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: Set + parameter of xsl transformer which contains the url to step back to a + previous state. This parameter is used in xsl sheet to render a + link into the user interface. + + * src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java: + New controller to step back to a previous state. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added a new action which + calls PreviousArtifactStepAction to step back to previous states. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + Refactored gui rendering. The static part of the parameter list is + rendered in a table with three columns (icon to step back, parameter name, + selected value). The target state to step back to is contained as + attribute 'art:state' in 'xform:select', 'xfom:select1' and 'xform:group' + nodes. + + * src/main/webapp/styles/default.css: Added a style class to adapt the first + column of the static part's table. + +2009-01-13 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Shortened + fractions digits to four places to be displayable in static + ui description. + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Fixed target id of text input field. + +2009-01-13 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp, + src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Added demo wkt polygon to test the "Horizontalschitt". + Remove this when we have the GIS interface. + +2010-01-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Use XMLUtils.ElementCreator to create new elements for xml documents. + +2010-01-08 Tim Englich + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java (execute), + src/main/java/de/intevation/gnv/action/DoOutputAction.java (execute): + Removed Encodingerrors from listed Files. All Files are now UTF-8 compliant. + +2010-01-05 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java: + NamespaceContext class used by gnv artifacts. + + * src/main/java/de/intevation/gnv/util/XMLUtils.java: Added + ArtifactNamespaceContext as default namespace context while creating + XPath objects. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Removed + local-name() methods. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: Adjust + xpathes regarding namespace changes. + +2010-01-05 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Removed + for-each statements and replaced them with templates. + +2010-01-04 Ingo Weinzierl + + * src/main/webapp/styles/default.css: Added new classes for displaying + parameters and values in left panel. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Static + nodes will be rendered as text instead of disabled xforms. + +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 b98d1adee7a6 -r af3f56758f59 gnv/Changes --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/Changes Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,80 @@ +2010-01-27 RELEASE 0.4 + + New: + + * Improved internal handling of each selection state and + moved calculation step before rendering (instead of one step) + + * Internal Preparation of 1-step-back history: Split up in + static (Summary of parameters ) and dynamic section + (Selectable parameters) + + * Added support for Shapefile and WMS Handling if they are available + + * First implementation of MapViewer Interface + + * Improved structure of div-containers + + Fixed: + + * Width and height of diagramm made changeable for user (#149) + + +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 b98d1adee7a6 -r af3f56758f59 gnv/NEWS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/NEWS Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,62 @@ +2010-01-27 RELEASE 0.4 + + * Adapted GUI to new concept + * handling selected parameters in a central summary to make GUI + more compact + * Splitting date selections into 2 steps: yearly and + exact point of time + * Enabling Point-Rendering for rendering in diagrams + * arranging productspecific actions (Exports, Statistics) + in a central field in order to have direct access to end products + at one place + + * Added support for Shapefile Download + + * Added first mechanism for publishing as Cross-sections as WMS + + * Reworked HTML to be HTML standard compatible + + * Added some new icons + + * Integrated basic styling of BSH + + * Added WKT-Line and Polygon Input for (temporary testing only) + + +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 b98d1adee7a6 -r af3f56758f59 gnv/pom.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/pom.xml Fri Sep 28 12:13:53 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.14 + + + + 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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,65 @@ +/** + * + */ +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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,105 @@ +package de.intevation.gnv.action; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Map; + +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.DiagrammOptions; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; +import de.intevation.gnv.artifactdatabase.objects.OutputParameter; + +/** + * @author Tim Englich + * + */ +public class ChangeOptionsAction extends DescribeUIAction { + /** + * 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); + + ArtifactDescription ad = sm.getArtifactDescription(); + + 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"; + } + else { + value = "true"; + } + } + diagrammOptions.setValue(parameter.getName(),value); + + } + sm.setDiagrammOptions(diagrammOptions); + + // XXX Little workarround. We should implement a 'choice' type, + // if we need further choice elements! (iw) + String bintype = request.getParameter("bintype"); + if (bintype != null) { + diagrammOptions.setValue("bintype", bintype); + sm.setDiagrammOptions(diagrammOptions); + request.setAttribute("bintype", bintype); + } + } + } + + Map tmpOuts = ad.getOutputModes(); + if (tmpOuts == null || tmpOuts.isEmpty()) { + request.setAttribute("furthertargets", true); + } + else { + request.setAttribute(target, 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); + } + } + +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/action/CreateChartAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/CreateChartAction.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,46 @@ +package de.intevation.gnv.action; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + +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; + + +/** + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +public class CreateChartAction extends DescribeUIAction { + + private static Logger logger = Logger.getLogger(CreateChartAction.class); + + + public CreateChartAction() { + super(); + } + + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) + throws Exception { + logger.debug("Create chart."); + + SessionModel sm = SessionModelFactory.getInstance().getSessionModel( + request); + sm.setDiagrammOptions(null); + request.setAttribute("chart", true); + + return super.execute(mapping, form, request, response); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/action/CreateHistogramAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/CreateHistogramAction.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,46 @@ +package de.intevation.gnv.action; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + +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; + + +/** + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +public class CreateHistogramAction extends DescribeUIAction { + + private static Logger logger = Logger.getLogger(CreateHistogramAction.class); + + + public CreateHistogramAction() { + super(); + } + + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) + throws Exception { + logger.debug("Create histogram."); + + SessionModel sm = SessionModelFactory.getInstance().getSessionModel( + request); + sm.setDiagrammOptions(null); + request.setAttribute("histogram", true); + + return super.execute(mapping, form, request, response); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,131 @@ +package de.intevation.gnv.action; + +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.util.ArtifactNamespaceContext; +import de.intevation.gnv.util.XMLUtils; +import de.intevation.gnv.util.XSLTransformer; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import javax.xml.xpath.XPathConstants; + +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; + +/** + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +public class DescribeUIAction extends ArtifactDatabaseActionBase { + + public static final String XPATH_DYNAMIC_UI = "art:dynamic"; + public static final String XPATH_STATIC_UI = "art:static"; + + public static final String XSL_SHEET_DYNAMIC = + "WEB-INF/config/templates/describe-ui.xsl"; + + public static final String XSL_SHEET_STATIC = + "WEB-INF/config/templates/describe-ui-static.xsl"; + + private static Logger logger = Logger.getLogger(DescribeUIAction.class); + + + public DescribeUIAction() { + super(); + } + + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response + ) throws Exception + { + logger.info("describe user interface"); + try { + // render describe document and create user interface + SessionModel sm = SessionModelFactory.getInstance().getSessionModel( + request); + + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory + .getInstance().getArtifactDatabaseClient(getLocale(request)); + + ArtifactDescription artifactDescription = + adc.getCurrentStepDescription( + sm.getSelectedArtifactFactory(), + sm.getCurrentArtifact(), + true); + + Node currentUI = artifactDescription.getCurrentUI(); + if (currentUI != null) { + XSLTransformer transformer = new XSLTransformer(); + + String url = response.encodeURL( + mapping.findForward("back").getPath()); + transformer.addParameter("back-url", url); + + String fisUrl = response.encodeURL( + mapping.findForward("selectfis").getPath()); + transformer.addParameter("selectfis", fisUrl); + + // fetch dynamic part from describe document and transform it + Node dynamicNode = (Node) XMLUtils.xpath( + currentUI, + XPATH_DYNAMIC_UI, + XPathConstants.NODE, + ArtifactNamespaceContext.INSTANCE + ); + + String ui = transformer.transform( + dynamicNode, + "UTF-8", + request.getRealPath(XSL_SHEET_DYNAMIC + )); + + if (ui != null && ui.length() > 1) + request.setAttribute("ui", ui); + + // fetch static part from describe document and transform it + Node staticNode = (Node) XMLUtils.xpath( + currentUI, + XPATH_STATIC_UI, + XPathConstants.NODE, + ArtifactNamespaceContext.INSTANCE + ); + + String staticUI = transformer.transform( + staticNode, + "UTF-8", + request.getRealPath(XSL_SHEET_STATIC)); + + if (staticUI != null && staticUI.length() > 1) + request.setAttribute("staticui", staticUI); + } + + return super.execute(mapping, form, request, response); + } + catch (Exception e) { + logger.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + e.getMessage()); + + return super.getExceptionForward(mapping); + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,217 @@ +/** + * + */ +package de.intevation.gnv.action; + +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.ExportMode; +import de.intevation.gnv.artifactdatabase.objects.InputParameter; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; +import de.intevation.gnv.artifactdatabase.objects.OutputParameter; + +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; + +/** + * @author Tim Englich + * + */ +public class DoExportAction extends ArtifactDatabaseActionBase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(DoExportAction.class); + + /** + * Constructor + */ + public DoExportAction() { + 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 + { + try { + String target = request.getParameter("target"); + String mimeType = request.getParameter("mimetype"); + String mode = request.getParameter("mode"); + + log.debug("Target: " + target); + log.debug("MimeType: " + mimeType); + log.debug("ExportMode: " + mode); + + SessionModel sm = SessionModelFactory.getInstance() + .getSessionModel(request); + OutputMode outputMode = sm.getOutputMode(target); + if (outputMode != null) { + ExportMode exportMode = outputMode.getExportMode(mode); + + if (target.equals(mode) || (exportMode != null + && exportMode.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(mode, mimeType, response, request); + + OutputStream outputStream = response.getOutputStream(); + adc.doOutput( + sm.getSelectedArtifactFactory(), + sm.getCurrentArtifact(), + outputStream, + target, + mode, + mimeType, + ips); + + outputStream.flush(); + outputStream.close(); + } + else if (exportMode == null) { + 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, + mode, + mimeType, + ips); + + outputStream.flush(); + outputStream.close(); + } + else { + if (outputMode == null) { + log.error("Outputmode is not supported."); + } + else if (!exportMode.getMimeType().equals(mimeType)) { + log.error("MimeType "+mimeType+" wis not supported."); + } + // 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) { + log.debug("DoExportAction.setHeaders"); + try { + response.setHeader("Content-Type", mimeType); + String fileName = "GNVEXPORT_" + System.currentTimeMillis() + "."; + + target = target.toLowerCase(); + log.debug("******************************************************"); + log.debug("TARGET: " + target); + log.debug("MIMETYPE: " + mimeType); + + if (target.equals("chart")) { + fileName = fileName + + mimeType.substring(mimeType.indexOf("/") + 1); + } + else if (target.equals("histogram")) { + fileName = fileName + + mimeType.substring(mimeType.indexOf("/") + 1); + } + else if (target.equals("img")) { + fileName = fileName + + mimeType.substring(mimeType.indexOf("/") + 1); + } + else if (target.equals("pdf")) { + fileName = fileName + "pdf"; + } else if (target.equals("svg")) { + fileName = fileName + "svg"; + } else if (target.equals("csv")) { + fileName = fileName + "csv"; + } else if (target.equals("zip")) { + fileName = fileName + "zip"; + } else if (target.equals("wms")) { + fileName = fileName + "xml"; + } 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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,141 @@ +/** + * + */ +package de.intevation.gnv.action; + +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; + +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; + +/** + * @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"); + String mode = request.getParameter("mode"); + + log.debug("Target: " + target); + log.debug("MimeType: " + mimeType); + log.debug("ExportMode: " + mode); + + // 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()+1); + 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); + } + + if (request.getParameter("bintype") != null) { + InputParameter ip = new DefaultInputParameter( + "bintype", request.getParameterValues("bintype")); + 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, + mode, + mimeType, + ips); + + outputStream.flush(); + outputStream.close(); + } else { + if (outputMode == null) { + log.error("Outputmode is not supported."); + } else if (!outputMode.getMimeType().equals(mimeType)) { + log.error("MimeType " + mimeType + + " wis not supported."); + } + // 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); + } + +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,74 @@ +/** + * + */ +package de.intevation.gnv.action; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; + +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; + +import 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; + +/** + * @author Tim Englich + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + * + */ +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); + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,143 @@ +/** + * + */ +package de.intevation.gnv.action; +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.DefaultInputParameter; +import de.intevation.gnv.artifactdatabase.objects.InputParameter; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; +import java.util.Map; + +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; + + +/** + * @author Tim Englich + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + * + */ +public class NextArtifactStepAction extends DescribeUIAction { + + /** + * 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)); + Map outs = ad.getOutputModes(); + if (outs == null || outs.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(); + } + + try { + adc.doNextStep( + sm.getSelectedArtifactFactory(), + sm.getCurrentArtifact(), + target, + ips + ); + } catch (Exception e) { + log.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e + .getMessage()); + } + + Map tmpOuts = ad.getOutputModes(); + request.setAttribute( + "furthertargets", + tmpOuts == null || tmpOuts.isEmpty() + ); + } else { + try{ + 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()); + } + + 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); + } + +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,95 @@ +package de.intevation.gnv.action; + +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 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; + + +/** + * @author Ingo Weinzierl + * + */ +public class PreviousArtifactStepAction extends DescribeUIAction { + + + public static final String URL_STATE_KEY = "target"; + + private static Logger logger = + Logger.getLogger(PreviousArtifactStepAction.class); + + + public PreviousArtifactStepAction() { + super(); + } + + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response + ) throws Exception { + + String id = request.getSession().getId(); + + SessionModel session = SessionModelFactory.getInstance().getSessionModel( + request); + + ArtifactDescription ad = session.getArtifactDescription(); + if (ad == null) { + logger.warn("Session timed out."); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + "SessionTimeout has occured"); + new FetchArtifactFactoriesAction().execute( + mapping, form, request, response); + + return super.execute(mapping, form, request, response); + } + + // TODO check if target is reachable + + ArtifactDatabaseClientFactory f = + ArtifactDatabaseClientFactory.getInstance(); + ArtifactDatabaseClient client = + f.getArtifactDatabaseClient(getLocale(request)); + + ArtifactObject artifactFactory = session.getSelectedArtifactFactory(); + ArtifactObject currentArtifact = session.getCurrentArtifact(); + + String target = (String) request.getParameter(URL_STATE_KEY); + logger.debug("Step back to previous state: " + target); + + try { + client.doAdvance( + artifactFactory, + currentArtifact, + target + ); + } + catch (Exception e) { + logger.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + e.getMessage()); + } + + return super.execute(mapping, form, request, response); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,126 @@ +/** + * + */ +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 org.w3c.dom.Node; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.util.XMLUtils; +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(); + // Removes the Artifactspecific Attributes from the 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); + + String fisUrl = response.encodeURL( + mapping.findForward("selectfis").getPath()); + + XSLTransformer transformer = new XSLTransformer(); + transformer.addParameter("selectfis", fisUrl); + + Node dynamicUINode = new XMLUtils().getNodeXPath( + artifactdescription.getCurrentUI(), "art: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( + artifactdescription.getCurrentUI(), "art: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); + } + + // 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 b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/action/SelectFisAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/SelectFisAction.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,53 @@ +package de.intevation.gnv.action; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + +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; + + +/** + * @author Ingo Weinzierl + */ +public class SelectFisAction extends ArtifactDatabaseActionBase { + + private static Logger logger = Logger.getLogger(SelectFisAction.class); + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response + ) { + logger.info("Goto fis selection."); + + try { + + SessionModelFactory fac = SessionModelFactory.getInstance(); + SessionModel sm = fac.getSessionModel(request); + + sm.resetModel(); + + return new FetchArtifactFactoriesAction().execute( + mapping, form, request, response); + } + catch (Exception e) { + logger.error(e, e); + + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + e.getMessage()); + + return super.getExceptionForward(mapping); + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/action/ShowStatisticAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ShowStatisticAction.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,62 @@ +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.ArtifactStatisticsSet; + +/** + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +public class ShowStatisticAction extends DescribeUIAction { + + private static Logger logger = Logger.getLogger(ShowStatisticAction.class); + + + public ShowStatisticAction() { + super(); + } + + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response + ) throws Exception + { + logger.info("show statistic"); + SessionModel sm = SessionModelFactory.getInstance().getSessionModel( + request); + + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory.getInstance() + .getArtifactDatabaseClient(getLocale(request)); + + try{ + Collection statistics = + adc.calculateStatistics(sm.getSelectedArtifactFactory(), + sm.getCurrentArtifact()); + + sm.setStatistics(statistics); + + request.setAttribute("statistic", true); + } + catch (Exception e) { + logger.error(e, e); + } + + return super.execute(mapping, form, request, response); + } +} diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/action/WMSAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/WMSAction.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,83 @@ +package de.intevation.gnv.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.w3c.dom.Document; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.util.XMLUtils; + +/** + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +public class WMSAction extends DescribeUIAction { + + public static final String XPATH_MAPSERVER_PATH = + "/art:meta/art:mapserver/art:server/text()"; + + public static final String XPATH_MAPSERVER_MAPFILE = + "/art:meta/art:mapserver/art:map/text()"; + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger logger = Logger.getLogger(WMSAction.class); + + /** + * Constructor + */ + public WMSAction() { + super(); + } + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + logger.debug("WMSAction.execute"); + try { + SessionModel sm = SessionModelFactory.getInstance().getSessionModel( + request); + ArtifactObject artifact = sm.getCurrentArtifact(); + + ArtifactDatabaseClientFactory factory = + ArtifactDatabaseClientFactory.getInstance(); + ArtifactDatabaseClient adc = factory.getArtifactDatabaseClient( + getLocale(request)); + ArtifactObject artifactfactory = sm.getSelectedArtifactFactory(); + + // do wms publishing + Document meta = adc.publishWMS(artifactfactory, artifact); + String mapserverPath = XMLUtils.getStringXPath( + meta, XPATH_MAPSERVER_PATH); + String mapfilePath = XMLUtils.getStringXPath( + meta, XPATH_MAPSERVER_MAPFILE); + + request.setAttribute("mapserver", mapserverPath); + request.setAttribute("mapfile", mapfilePath); + request.setAttribute("layer", artifact.getId()); + + return super.execute(mapping, form, request, response); + } + catch (Exception e) { + logger.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + e.getMessage()); + + return super.getExceptionForward(mapping); + } + } + +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,110 @@ +package de.intevation.gnv.action.mapviewer; + +import java.io.ByteArrayInputStream; +import java.io.InputStream; +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.ArtifactDatabaseActionBase; +import de.intevation.gnv.action.mapviewer.parser.ExternalCallParser; +import de.intevation.gnv.action.mapviewer.parser.XMLExternalCallParser; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + +/** + * + * @author Tim Englich + * + */ +public class MapViewerCallAction extends ArtifactDatabaseActionBase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(MapViewerCallAction.class); + + /** + * Constructor + */ + public MapViewerCallAction() { + 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("MapViewerCallAction.execute"); + InputStream inputStream = null; + String documentvalue = request.getParameter("document"); + if (documentvalue != null){ + documentvalue = documentvalue.trim(); + inputStream = new ByteArrayInputStream(documentvalue.getBytes()); + }else{ + inputStream = request.getInputStream(); + } + + if (inputStream != null){ + try { + ExternalCallParser ecp = new XMLExternalCallParser(inputStream); + ecp.parse(); + String geometry = ecp.getGeometry(); + String srs = ecp.getSRS(); + Collection mapServices = ecp.getMapServices(); + + Collection availableFactories = + ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)) + .getArtifactFactoryMetaInformation(mapServices, + geometry, + srs); + + Collection providedFactories = + ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)) + .getArtifactFactories(); + + // Sort out which ArtifactFactories should not be used. + Collection usedFactories = + new ArrayList(availableFactories.size()); + + Iterator it = availableFactories.iterator(); + while (it.hasNext()){ + ArtifactObject ao = it.next(); + if (providedFactories.contains(ao)){ + usedFactories.add(ao); + } + } + + SessionModel sm = SessionModelFactory + .getInstance() + .getSessionModel(request); + sm.resetModel(); + sm.setArtifacteFactories(usedFactories); + } catch (Exception e) { + log.error(e,e); + } + }else{ + log.error("Kein Anfragedokument übergeben."); + } + return super.execute(mapping, form, request, response); + } + +} diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,46 @@ +/** + * + */ +package de.intevation.gnv.action.mapviewer; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import de.intevation.gnv.action.ArtifactDatabaseActionBase; + +/** + * @author Tim Englich + * + */ +public class ShowMapViewerCallBodyAction extends ArtifactDatabaseActionBase { + + /** + * the logger, used to log exceptions and additionally information + */ + private static Logger log = Logger + .getLogger(ShowMapViewerCallBodyAction.class); + + /** + * Constructor + */ + public ShowMapViewerCallBodyAction() { + super(); + } + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + log.debug("ShowMapViewerCallBodyAction.execute"); + request.setAttribute("MAPVIEWERCALL", new Boolean(true)); + return super.execute(mapping, form, request, response); + } + + + +} diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParser.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParser.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,24 @@ +/** + * + */ +package de.intevation.gnv.action.mapviewer.parser; + +import java.util.Collection; + +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + +/** + * @author Tim Englich + * + */ +public interface ExternalCallParser { + + + String getGeometry(); + + String getSRS(); + + Collection getMapServices(); + + void parse() throws ExternalCallParserException; +} diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserException.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,47 @@ +/** + * + */ +package de.intevation.gnv.action.mapviewer.parser; +/** + * @author Tim Englich + * + */ +public class ExternalCallParserException extends Exception { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = -4917914097058485262L; + + /** + * Constructor + */ + public ExternalCallParserException() { + } + + /** + * Constructor + * @param arg0 + */ + public ExternalCallParserException(String arg0) { + super(arg0); + } + + /** + * Constructor + * @param arg0 + */ + public ExternalCallParserException(Throwable arg0) { + super(arg0); + } + + /** + * Constructor + * @param arg0 + * @param arg1 + */ + public ExternalCallParserException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + +} diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/XMLExternalCallParser.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/XMLExternalCallParser.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,155 @@ +/** + * + */ +package de.intevation.gnv.action.mapviewer.parser; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; + + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import de.intevation.gnv.artifactdatabase.objects.map.DefaultLayer; +import de.intevation.gnv.artifactdatabase.objects.map.DefaultMapService; +import de.intevation.gnv.artifactdatabase.objects.map.Layer; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; +import de.intevation.gnv.util.XMLUtils; + +/** + * @author Tim Englich + * + */ +public class XMLExternalCallParser implements ExternalCallParser { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(XMLExternalCallParser.class); + + private static String XPATH_GEOMETRY = "/gnviewer/location/data"; + private static String XPATH_SRS = "/gnviewer/location/srs"; + private static String XPATH_MAPSERVICES_NODESET = "/gnviewer/mapservices/mapservice"; + private static String XPATH_LAYER = "layer"; + private static String ATTRIBUTE_ID = "id"; + private static String ATTRIBUTE_NAME = "name"; + private static String ATTRIBUTE_TYPE = "type"; + private static String ATTRIBUTE_URL = "url"; + + private String geometry = null; + private String srs = null; + + private Collection mapServices = null; + + private InputStream inputStream = null; + + /** + * Constructor + */ + public XMLExternalCallParser(InputStream inputStream) { + this.inputStream = inputStream; + } + + /** + * @see de.intevation.gnv.action.mapviewer.parser.ExternalCallParser#getGeometry() + */ + public String getGeometry() { + return this.geometry; + } + + /** + * @see de.intevation.gnv.action.mapviewer.parser.ExternalCallParser#getMapServices() + */ + public Collection getMapServices() { + return this.mapServices; + } + + /** + * @see de.intevation.gnv.action.mapviewer.parser.ExternalCallParser#parse() + */ + public void parse() throws ExternalCallParserException { + if (inputStream != null){ + XMLUtils xmlUtils = new XMLUtils(); + Document document = xmlUtils.readDocument(this.inputStream); + if (document != null){ + + this.geometry = xmlUtils.getStringXPath(document, XPATH_GEOMETRY); + this.srs = xmlUtils.getStringXPath(document, XPATH_SRS); + NodeList mapservicesNodes = + xmlUtils.getNodeSetXPath(document, XPATH_MAPSERVICES_NODESET); + if (mapservicesNodes != null){ + this.mapServices = new ArrayList(mapservicesNodes.getLength()); + for (int i = 0; i < mapservicesNodes.getLength(); i++){ + Element mapserviceNode = (Element)mapservicesNodes.item(i); + String mapserviceID = mapserviceNode.getAttribute(ATTRIBUTE_ID); + String mapserviceType = mapserviceNode.getAttribute(ATTRIBUTE_TYPE); + String mapserviceUrl = mapserviceNode.getAttribute(ATTRIBUTE_URL); + NodeList layerNodes = xmlUtils.getNodeSetXPath(mapserviceNode, XPATH_LAYER); + Collection layer = null; + if (layerNodes != null && layerNodes.getLength() > 0){ + layer = new ArrayList(layerNodes.getLength()); + layer = this.extractLayer(layer, null, layerNodes); + }else{ + log.debug("No Layer given for this Mapservice"); + } + MapService mapService = + new DefaultMapService(mapserviceID, layer, + mapserviceType, mapserviceUrl); + this.mapServices.add(mapService); + } + + }else{ + String errMsg = "XML-Document does not contain any Mapservices which are required."; + log.error(errMsg); + throw new ExternalCallParserException(errMsg); + } + + }else{ + String errMsg = "XML-Document could not be read from InputStream."; + log.error(errMsg); + throw new ExternalCallParserException(errMsg); + } + }else{ + String errMsg = "No InputStream given for parsing the Call."; + log.error(errMsg); + throw new ExternalCallParserException(errMsg); + } + } + + /** + * This Method extracts all Layers and put them into the Collection. + * @param layer + * @param groupId + * @param layerNodes + * @return + */ + private Collection extractLayer(Collection layer, String groupId, NodeList layerNodes){ + XMLUtils xmlUtils = new XMLUtils(); + for (int i = 0; i < layerNodes.getLength(); i++){ + Element layerNode = (Element)layerNodes.item(i); + String id = layerNode.getAttribute(ATTRIBUTE_ID); + String name = layerNode.getAttribute(ATTRIBUTE_NAME); + NodeList localLayerNodes = xmlUtils.getNodeSetXPath(layerNode, XPATH_LAYER); + Layer tmpLayer = new DefaultLayer(id, name, + (localLayerNodes != null && + localLayerNodes.getLength() > 0), + groupId); + layer.add(tmpLayer); + if (localLayerNodes != null && localLayerNodes.getLength() > 0){ + layer = this.extractLayer(layer, id, localLayerNodes); + } + } + return layer; + } + + /** + * @see de.intevation.gnv.action.mapviewer.parser.ExternalCallParser#getSRS() + */ + public String getSRS() { + return this.srs; + } + +} diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,66 @@ +/** + * + */ +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 synchronized static SessionModelFactory getInstance() { + if (instance == null) { + instance = new SessionModelFactory(); + } + return instance; + } + + /** + * Getting the ArtifactDatabaseClient + * + * @return the ArtifactDatabaseClient + */ + public SessionModel getSessionModel(HttpServletRequest request) { + synchronized (request) { + SessionModel sm = null; + Object obj = request.getSession().getAttribute(SESSION_MODEL_ID); + if (obj instanceof SessionModel) { + sm = (SessionModel) obj; + } else { + sm = new DefaultSessionModel(); + request.getSession().setAttribute(SESSION_MODEL_ID, sm); + } + + return sm; + } + } + +} diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,136 @@ +package de.intevation.gnv.artifactdatabase.client; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.Collection; +import java.util.Locale; + +import org.w3c.dom.Document; + +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; +import de.intevation.gnv.artifactdatabase.objects.InputParameter; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + +/** + * @author Tim Englich (tim.englich@intevation.de) + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +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; + + public void doAdvance( + ArtifactObject factory, + ArtifactObject artifact, + String target + ) throws IOException, 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 exportMode, + String mimeType, + Collection inputParameter) + throws ArtifactDatabaseClientException; + + /** + * @param factory + * @param artifact + * @return URL to wms service as string + */ + public Document publishWMS(ArtifactObject factory, ArtifactObject artifact); + + + /** + * @param artifactFactory + * @param currentArtifact + * @return + * @throws ArtifactDatabaseClientException + */ + public Collection calculateStatistics( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact) + throws ArtifactDatabaseClientException; + + public void setLocale(Locale locale); + + public Collection getArtifactFactoryMetaInformation(Collection mapServices, + String geometry, + String srs) + throws ArtifactDatabaseClientException; + +} diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,949 @@ +/** + * + */ +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.List; +import java.util.Locale; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.restlet.Client; +import org.restlet.data.ClientInfo; +import org.restlet.data.Language; +import org.restlet.data.Method; +import org.restlet.data.Preference; +import org.restlet.data.Protocol; +import org.restlet.data.Request; +import org.restlet.data.Response; +import org.restlet.representation.Representation; +import org.restlet.representation.StringRepresentation; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +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.DefaultExportMode; +import de.intevation.gnv.artifactdatabase.objects.DefaultOutputMode; +import de.intevation.gnv.artifactdatabase.objects.DefaultOutputParameter; +import de.intevation.gnv.artifactdatabase.objects.ExportMode; +import de.intevation.gnv.artifactdatabase.objects.InputParameter; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; +import de.intevation.gnv.artifactdatabase.objects.OutputParameter; +import de.intevation.gnv.artifactdatabase.objects.ParametrizedArtifactFactory; +import de.intevation.gnv.artifactdatabase.objects.ParametrizedArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.map.Layer; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; +import de.intevation.gnv.propertiesreader.PropertiesReader; +import de.intevation.gnv.propertiesreader.PropertiesReaderFactory; +import de.intevation.gnv.util.XMLUtils; + +/** + * @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,null); + } else { + resultValues.addAll(this.getArtifactFactories(document, + server,null)); + } + } + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + return resultValues; + } + + private Collection getArtifactFactories(Document document, + String server, + String geometry) { + XMLUtils xmlUtils = new XMLUtils(); + NodeList artifactFactories = xmlUtils.getNodeSetXPath(document, + "/art:result/art:factories/art: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, + "@art:name"); + String description = xmlUtils.getStringXPath( + artifactFactoryNode, "@art:description"); + + NodeList parameterNodeList = xmlUtils.getNodeSetXPath( + artifactFactoryNode, + "art:parameter"); + + if ((parameterNodeList != null && + parameterNodeList.getLength() > 0) || + geometry != null){ + Collection parameters = + new ArrayList(parameterNodeList.getLength()); + for (int j = 0; j < parameterNodeList.getLength(); j++){ + Element parameterNode = (Element)parameterNodeList.item(j); + parameters.add(parameterNode.getAttribute("id")); + } + ParametrizedArtifactObject pao = + new ParametrizedArtifactFactory(name, + description, + server); + pao.addParameters("parameter", parameters); + resultValues.add(pao); + if (geometry != null){ + Collection geometryList = new ArrayList(1); + geometryList.add(geometry); + pao.addParameters("geometry",geometryList); + } + }else{ + ArtifactObject artifactFactory = new ArtifactFactory(name, + description, + server); + resultValues.add(artifactFactory); + } + } + } + log.debug("Artifact Factories: " + resultValues.size()); + 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); + 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, "/art:result/art:uuid/@value"); + String hash = xmlUtils.getStringXPath(document, "/art:result/art:hash/@value"); + log.info("NEW Artifact: " + uuid + " / " + hash); + return new Artifact(uuid, hash); + } + + private Document createCreateRequestBody(ArtifactObject artifactFactory) { + Document document = new XMLUtils().newDocument(); + Node rootNode = this.createRootNode(document); + Element typeNode = this.createArtifactElement(document, "type"); + typeNode.setAttribute("name", "create"); + rootNode.appendChild(typeNode); + + Element factoryNode = this.createArtifactElement(document, "factory"); + factoryNode.setAttribute("name", artifactFactory.getId()); + rootNode.appendChild(factoryNode); + + if (artifactFactory instanceof ParametrizedArtifactObject){ + Map> parameterMap = + ((ParametrizedArtifactObject)artifactFactory).getParameters(); + if (parameterMap != null && !parameterMap.isEmpty() ){ + Iterator keyIt = parameterMap.keySet().iterator(); + while (keyIt.hasNext()){ + String key = keyIt.next(); + Iterator valueIt = parameterMap.get(key).iterator(); + while (valueIt.hasNext()){ + String value = valueIt.next(); + Element parameterNode = + this.createArtifactElement(document, "parameter"); + parameterNode.setAttribute("name", key); + parameterNode.setAttribute("value", value); + factoryNode.appendChild(parameterNode); + } + } + } + } + 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) { + XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( + document, + NAMESPACE_URI, + NAMESPACE_PREFIX + ); + + return creator.create(name); + } + + /** + * @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, "/art:result/art:ui"); + Node outputNode = xmlUtils + .getNodeXPath(document, "/art:result/art:outputs"); + + Map outputModes = null; + if (outputNode != null) { + NodeList outputModesNodes = xmlUtils.getNodeSetXPath( + outputNode, "art: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, "art:parameter/art: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"))); + } + } + + NodeList exportNodes = xmlUtils.getNodeSetXPath( + outputModeNode, "art:exports/art:export"); + Map exports = null; + + if (exportNodes != null) { + int size = exportNodes.getLength(); + exports = new HashMap(size); + + for (int k = 0; k < size; k++) { + Node export = exportNodes.item(k); + String expName = xmlUtils.getStringXPath( + export, "@name"); + exports.put(expName, new DefaultExportMode( + expName, + xmlUtils.getStringXPath(export, "@description"), + xmlUtils.getStringXPath(export, "@mime-type"))); + } + } + + outputModes.put(name, new DefaultOutputMode(name, + mimeType, parameter, exports)); + } + + } + } + + String currentState = xmlUtils.getStringXPath(document, + "/art:result/art:state/@name"); + NodeList statesList = xmlUtils.getNodeSetXPath(document, + "/art:result/art:reachable-states/art: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, + "/art:result/art:model/art: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 = getCurrentStepDescription( + artifactFactory, + new Artifact(currentArtifact.getId(), + currentArtifact.getHash()), + false + ); + + target = ad.getReachableStates().iterator().next(); + + // 3 Advance + doAdvance(artifactFactory, currentArtifact, target); + + // 3 Describe + return this.getCurrentStepDescription(artifactFactory, + currentArtifact,true); + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + } + + + public void doAdvance( + ArtifactObject factory, + ArtifactObject artifact, + String target + ) throws IOException, ArtifactDatabaseClientException { + String url = getArtifactUrl(factory, artifact); + Document advanceDocument = createAdvanceRequestBody(artifact, target); + InputStream advanceResult = doPostRequest(url, advanceDocument); + check4ExceptionReport(new XMLUtils().readDocument(advanceResult)); + } + + 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 exportMode, + String mimeType, + Collection inputParameter) + throws ArtifactDatabaseClientException + { + try { + Document requestBody = this.createOutRequestBody( + currentArtifact, + targetName, + exportMode, + 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 exportMode, + 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 exportNode = this.createArtifactElement(document, "export"); + exportNode.setAttribute("name", exportMode); + outNode.appendChild(exportNode); + + 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, + "/art:exceptionreport/art:exception"); + if (message != null) { + throw new ArtifactDatabaseClientException(message); + } + + } + + public Document publishWMS(ArtifactObject factory, ArtifactObject artifact) { + log.debug("Start wms publishing..."); + + String target = "wms"; + String requestURL = getArtifactUrl(factory, artifact) + "/" + target; + Document request = createOutRequestBody( + artifact, target, "", "text/xml", null); + try { + InputStream input = doPostRequest(requestURL, request); + Document result = XMLUtils.readDocument(input); + + return result; + } + catch (IOException ioe) { + log.error(ioe, ioe); + return null; + } + } + + 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, + "/art:statistics/art: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, + "art: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; + } + + /** + * @see de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient#getArtifactFactoryMetaInformation(java.util.Collection, java.lang.String, java.lang.String) + */ + public Collection getArtifactFactoryMetaInformation( + Collection mapServices, + String geometry, + String srs) + throws ArtifactDatabaseClientException { + log.debug("DefaultArtifactDatabaseClient.getArtifactFactories"); + Collection resultValues = null; + try { + this.initialize(); + Iterator it = artifactDatabases.iterator(); + Document requestBody = this.createMetaDataRequestBody(mapServices, + geometry, + srs); + while (it.hasNext()) { + String server = it.next(); + String url = server + "/service/metadata/"; + log.debug(url); + + InputStream resultStream = this.doPostRequest(url, requestBody); + resultValues = this.parseMetaDataResult(resultStream, server,geometry); + } + } catch (IOException e) { + log.error(e,e); + } + return resultValues; + } + + private Collection parseMetaDataResult( + InputStream inputStream, + String server, + String geometry) throws ArtifactDatabaseClientException{ + XMLUtils xmlUtils = new XMLUtils(); + Document document = xmlUtils.readDocument(inputStream); + this.check4ExceptionReport(document); + return this.getArtifactFactories(document, server,geometry); + } + + private Document createMetaDataRequestBody(Collection mapServices, + String geometry, + String srs){ + log.debug("DefaultArtifactDatabaseClient.createMetaDataRequestBody"); + Document document = new XMLUtils().newDocument(); + Node rootNode = this.createArtifactElement(document, "GetMetaData"); + document.appendChild(rootNode); + + Element locationNode = this.createArtifactElement(document, "location"); + locationNode.setAttribute("srs", srs); + locationNode.appendChild(document.createTextNode(geometry)); + rootNode.appendChild(locationNode); + + Element mapServicesNode = this.createArtifactElement(document, + "mapservices"); + Iterator it = mapServices.iterator(); + while (it.hasNext()){ + MapService mapService = it.next(); + Element mapServiceNode = this.createArtifactElement(document, + "mapservice"); + mapServiceNode.setAttribute("id", mapService.getID()); + mapServiceNode.setAttribute("type", mapService.getType()); + mapServiceNode.setAttribute("url", mapService.getURL()); + if (mapService.getLayer() != null){ + Iterator layer = mapService.getLayer().iterator(); + while (layer.hasNext()){ + Layer tmpLayer = layer.next(); + Element layerNode = this.createArtifactElement(document, + "layer"); + layerNode.setAttribute("id", tmpLayer.getID()); + layerNode.setAttribute("name", tmpLayer.getName()); + layerNode.setAttribute("isgrouplayer", + ""+tmpLayer.isGroupLayer()); + layerNode.setAttribute("parentid", tmpLayer.parentID()); + mapServiceNode.appendChild(layerNode); + } + } + mapServicesNode.appendChild(mapServiceNode); + } + rootNode.appendChild(mapServicesNode); + return document; + } +} diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,100 @@ +/** + * + */ +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; + } + + @Override + public boolean equals(Object obj) { + boolean returnValue = false; + if (obj instanceof ArtifactFactory){ + ArtifactFactory af = (ArtifactFactory)obj; + returnValue = this.getName().equals(af.getName()) && + this.getDataBaseUrl().equals(af.getDataBaseUrl()); + } + return returnValue; + } + +} diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,31 @@ +package de.intevation.gnv.artifactdatabase.objects; + +/** + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +public class DefaultExportMode +implements ExportMode +{ + protected String name; + protected String description; + protected String mimeType; + + public DefaultExportMode(String name, String description, String mimeType){ + this.name = name; + this.description = description; + this.mimeType = mimeType; + } + + public String getName() { + return name; + } + + public String getDescription() { + return description; + } + + public String getMimeType() { + return mimeType; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,65 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.Collection; +import java.util.Map; + +/** + * @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; + + private Map exports; + + public DefaultOutputMode( + String name, + String mimeType, + Collection outputParameter, + Map exports) + { + super(); + this.name = name; + this.mimeType = mimeType; + this.outputParameter = outputParameter; + this.exports = exports; + } + + /** + * @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; + } + + public ExportMode getExportMode(String mode) { + return exports.get(mode); + } +} diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,15 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * @author Ingo Weinzierl (ingo.weinzierl@intevation.de) + */ +public interface ExportMode +extends Serializable +{ + public String getName(); + public String getDescription(); + public String getMimeType(); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 OutputMode extends Serializable{ + + public String getName(); + + public String getMimeType(); + + public Collection getOutputParameters(); + + public ExportMode getExportMode(String mode); +} diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,49 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +/** + * @author Tim Englich + * + */ +public class ParametrizedArtifactFactory extends ArtifactFactory implements + ParametrizedArtifactObject { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = 4516368434861819032L; + + private Map> parameters = null; + + /** + * Constructor + * @param name + * @param description + * @param dataBaseUrl + */ + public ParametrizedArtifactFactory(String name, String description, + String dataBaseUrl) { + super(name, description, dataBaseUrl); + this.parameters = new HashMap>(); + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.ParametrizedArtifactObject#getParameters() + */ + @Override + public Map> getParameters() { + return parameters; + } + + @Override + public void addParameters(String key, Collection values) { + this.parameters.put(key, values); + } + +} diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,24 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.Collection; +import java.util.Map; + +/** + * @author Tim Englich + * + */ +public interface ParametrizedArtifactObject extends ArtifactObject { + + /** + * Returns the Parameters which could be used to manage (e.g. create) an + * ArtifactObject. + * @return + */ + Map> getParameters(); + + void addParameters(String key, Collection values); + +} diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,67 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects.map; +/** + * @author Tim Englich + * + */ +public class DefaultLayer implements Layer { + + + private String id = null; + + private String name = null; + + private boolean groupLayer = false; + + private String parentId = null; + /** + * Constructor + */ + public DefaultLayer(String id,String name, + boolean groupLayer,String parentId) { + this.id = id; + this.name = name; + this.groupLayer = groupLayer; + this.parentId = parentId; + } + + + + /** + * @see de.intevation.gnv.artifactdatabase.objects.map.Layer#getID() + */ + public String getID() { + return this.id; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.map.Layer#getName() + */ + public String getName() { + return this.name; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.map.Layer#isGroupLayer() + */ + public boolean isGroupLayer() { + return this.groupLayer; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.map.Layer#parentID() + */ + public String parentID() { + return this.parentId; + } + + @Override + public String toString() { + return "ID: "+ this.id + " Name: "+this.name+ + " IsGroupLayer: "+this.groupLayer+ + " ParentID: "+this.parentId; + } + +} diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,63 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects.map; + +import java.util.Collection; + +/** + * @author Tim Englich + * + */ +public class DefaultMapService implements MapService { + + private String id = null; + + + + private Collection layer = null; + + private String type = null; + + private String url = null; + /** + * Constructor + */ + public DefaultMapService(String id, Collection layer, + String type, String url) { + super(); + this.id = id; + this.layer = layer; + this.type = type; + this.url = url; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.map.MapService#getID() + */ + public String getID() { + return this.id; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.map.MapService#getLayer() + */ + public Collection getLayer() { + return this.layer; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.map.MapService#getType() + */ + public String getType() { + return this.type; + } + + /** + * @see de.intevation.gnv.artifactdatabase.objects.map.MapService#getURL() + */ + public String getURL() { + return this.url; + } + +} diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,16 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects.map; +/** + * @author Tim Englich + * + */ +public interface Layer { + + String getName(); + String getID(); + boolean isGroupLayer(); + String parentID(); + +} diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,23 @@ +/** + * + */ +package de.intevation.gnv.artifactdatabase.objects.map; + +import java.util.Collection; + +/** + * @author Tim Englich + * + */ +public interface MapService { + + + String getID(); + + String getURL(); + + String getType(); + + Collection getLayer(); + +} diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 gnv/src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,56 @@ +package de.intevation.gnv.util; + +import javax.xml.XMLConstants; + +import javax.xml.namespace.NamespaceContext; + +import java.util.Iterator; + +/** + * @author Sascha L. Teichmann (sascha.teichmann@intevation) + */ +public class ArtifactNamespaceContext +implements NamespaceContext +{ + /** + * 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"; + + public static final ArtifactNamespaceContext INSTANCE = + new ArtifactNamespaceContext(); + + public ArtifactNamespaceContext() { + } + + public String getNamespaceURI(String prefix) { + + if (prefix == null) { + throw new NullPointerException("Null prefix"); + } + + if (NAMESPACE_PREFIX.equals(prefix)) { + return NAMESPACE_URI; + } + + if ("xml".equals(prefix)) { + return XMLConstants.XML_NS_URI; + } + + return XMLConstants.NULL_NS_URI; + } + + public String getPrefix(String uri) { + throw new UnsupportedOperationException(); + } + + public Iterator getPrefixes(String uri) { + throw new UnsupportedOperationException(); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8: diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,223 @@ +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 static Document newDocument() { + try { + return DocumentBuilderFactory.newInstance().newDocumentBuilder() + .newDocument(); + } catch (ParserConfigurationException pce) { + logger.error(pce.getLocalizedMessage(), pce); + } + return null; + } + + public static XPath newXPath() { + return newXPath(null); + } + + public static XPath newXPath(NamespaceContext namespaceContext) { + XPathFactory factory = XPathFactory.newInstance(); + XPath xpath = factory.newXPath(); + if (namespaceContext != null) { + xpath.setNamespaceContext(namespaceContext); + } + return xpath; + } + + public static Object xpath(Object root, String query, QName returnTyp) { + return xpath(root, query, returnTyp, null); + } + + public static 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 static Object getXPath(Object root, String query, QName returnType) { + return getXPath(root,query,returnType,ArtifactNamespaceContext.INSTANCE); + } + + public static Object getXPath( + Object root, String query, QName returnType, NamespaceContext context + ) { + return xpath(root, query, returnType, context); + } + + public static String getStringXPath(String xpath) { + return getStringXPath(xpath, null); + } + + public static NodeList getNodeSetXPath(Object root, String query) { + return (NodeList) getXPath(root, query, XPathConstants.NODESET); + } + + public static Node getNodeXPath(Object root, String query) { + return (Node) getXPath(root, query, XPathConstants.NODE); + } + + public static String getStringXPath(Object root, String xpath) { + return getStringXPath(root, xpath, null); + } + + public static String getStringXPath(Object root, String query, String def) { + String s = (String) getXPath(root, query, XPathConstants.STRING); + return s == null || s.length() == 0 ? def : s; + } + + public static Document readDocument(InputStream inputStream) { + Document returnValue = null; + try { + DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory + .newInstance(); + docBuilderFactory.setNamespaceAware(true); + 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 static 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 static Document reInitDocument(Document document) { + + StringBufferInputStream inputStream = new StringBufferInputStream( + writeDocument2String(document)); + return readDocument(inputStream); + } + + public static 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 static 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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,92 @@ +/** + * + */ +package de.intevation.gnv.util; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.UnsupportedEncodingException; + +import java.util.HashMap; +import java.util.Map; + +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); + + + private Map params; + + /** + * 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); + + if (params != null) { + for(Map.Entry entry: params.entrySet()) { + transformer.setParameter(entry.getKey(), entry.getValue()); + } + } + + 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; + } + + + public void addParameter(String name, String value) { + if (params == null) { + params = new HashMap(3); + } + + params.put(name, value); + } +} diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,98 @@ +# 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.history.title=\u00dcberblick + +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 = Aktualisieren + +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 +gnviewer.statistic.button = Statistik + +# Histogramm +gnviewer.histogram.button=Histogramm +gnviewer.histogram.options.header.title=Histogrammoptionen +bincount=Anzahl der Klassen +binwidth=Breite einer Klasse + +# diagram options dialog +gnviewer.diagram.options.header.title=Diagrammoptionen + +# wms +gnviewer.wms.server.path=URL des WMS +gnviewer.wms.server.layer=Name des Layers + +# attachedOutputOptions +gnviewer.output.options.diagramm.alt=Diagramm +gnviewer.output.options.histogram.alt=Histogramm +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 +gnviewer.output.options.export.zip.title=ZIP-Archiv exportieren +gnviewer.output.options.export.wms.title=WMS-Layer bereitstellen + +# export options +gnviewer.export.fieldset.title=Aktionen + +height=H\u00f6he +width=Breite +points=Zeichne Datenpunkte + +# 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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,95 @@ +# application.properties +application.name=${pom.name} +application.version=${pom.version} +application.releasedate=${timestamp} + +gnviewer.app.title = BSH-GDI genericViewer + +gnviewer.history.title=Summary + +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 = Update + +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 +gnviewer.statistic.button = Statistic + +# Histogramm +gnviewer.histogram.button=Histogram +gnviewer.histogram.options.header.title=Histogram Options +bincount=Number of classes +binwidth=Class width + +# diagram options dialog +gnviewer.diagram.options.header.title=Diagram options + +# wms +gnviewer.wms.server.path=WMS URL +gnviewer.wms.server.layer=Layername + +# attachedOutputOptions +gnviewer.output.options.diagramm.alt=Diagram +gnviewer.output.options.histogram.alt=Histogram +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 +gnviewer.output.options.export.zip.title=Export as ZIP archive +gnviewer.output.options.export.wms.title=Serve as WMS layer + +# export options +gnviewer.export.fieldset.title=Actions + +height=Height +width=Width +points=Draw data points + +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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,2 @@ + + diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,113 @@ + + + + + + + + bearbeiten + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + {$edit} + + + + + {$edit} + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + +   + + + +
diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,173 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + +
.
+ +
+
+
+ + + + + + + + + + + + + + + + + + +
.:
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + Beispiel WKT-Linestring einfügen:
+
+ + Beispiel WKT-Polygon einfügen:
+
+
+ + + + + : + + + + +
+ + +
+ + + + + + +
diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,47 @@ +<%@ 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); + + boolean showmapviewercallBody = request.getAttribute("MAPVIEWERCALL") != null; + +%> +<%@page import="de.intevation.gnv.action.CommunicationKeys"%> + + + diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,39 @@ +<%@ 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"%> +<% + // fetch diagramm parameter from request if the user clicked 'draw' + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + + String target = "chart"; + String mimeType = null; + String parameterString = ""; + + boolean supportChart = sm.getOutputMode(target) != null; + + 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()); + } + } + } +%> + +<%-- diagramm is not null if the user clicked the 'draw' button --%> + +
+ <bean:message key="gnviewer.output.options.diagramm.alt"/> +
+
diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,103 @@ +<%@ 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="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.ExportMode"%> +<%@page import="java.util.Collection"%> +<%@page import="java.util.Iterator"%> +<%@page import="java.net.URLEncoder"%> +<% + String target = "chart"; + String targetPDF = "pdf"; + String targetSVG = "svg"; + String targetIMG = "img"; + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + OutputMode outputMode = sm.getOutputMode(target); + DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); + + boolean useDiagrammOptions = diagrammOptions != null; + ExportMode supportIMG = outputMode.getExportMode(targetIMG); + ExportMode supportPDF = outputMode.getExportMode(targetPDF); + ExportMode supportSVG = outputMode.getExportMode(targetSVG); + + String mimeType = outputMode.getMimeType(); + String parameterString = ""; + Collection op = outputMode.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 mimeTypeIMG = null; + if (supportIMG != null) { + mimeTypeIMG = supportIMG.getMimeType(); + } + String mimeTypePDF = null; + if (supportPDF != null) { + mimeTypePDF = supportPDF.getMimeType(); + } + String mimeTypeSVG = null; + if (supportSVG != null) { + mimeTypeSVG = supportSVG.getMimeType(); + mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8"); + } +%> +
+
+ + + +
"> + + <%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{%> + + <%}%> +
+
+ "/> + <%}%> + <%if (supportIMG != null) { %> + "> + + + <%}%> + <%if (supportPDF != null) { %> + "> + + + <%}%> + <%if (supportSVG != null) { %> + "> + + + <%}%> +
+
+
+
diff -r b98d1adee7a6 -r af3f56758f59 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:53 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()%>
+ <%} %> + <%}%> +
+
diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,113 @@ +<%@ 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="de.intevation.gnv.artifactdatabase.objects.ArtifactObject"%> +<%@page import="java.util.Collection"%> +<%@page import="java.util.Iterator"%> +<%@page import="java.net.URLEncoder"%> +<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + ArtifactObject artifact = sm.getCurrentArtifact(); + String mimeType = null; + String wmslayer = null; + String parameterString = ""; + + String target = "chart"; + String targetCSV = "csv"; + String targetODV = "odv"; + String targetZIP = "zip"; + String targetWMS = "wms"; + String targetSta = "statistics"; + String targetHis = "histogram"; + + boolean supportChart = sm.getOutputMode(target) != null; + boolean supportCSV = sm.getOutputMode(targetCSV) != null; + boolean supportODV = sm.getOutputMode(targetODV) != null; + boolean supportZIP = sm.getOutputMode(targetZIP) != null; + boolean supportWMS = sm.getOutputMode(targetWMS) != null; + boolean supportSta = sm.getOutputMode(targetSta) != null; + boolean supportHis = sm.getOutputMode(targetHis) != null; + + 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 mimeTypeCSV = null; + if (supportCSV){ + mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); + } + + String mimeTypeODV = null; + if (supportODV){ + mimeTypeODV = sm.getOutputMode(targetODV).getMimeType(); + } + + String mimeTypeZIP = null; + if (supportZIP) { + mimeTypeZIP = sm.getOutputMode(targetZIP).getMimeType(); + } + + String mimeTypeWMS = null; + if (supportWMS) { + mimeTypeWMS = sm.getOutputMode(targetWMS).getMimeType(); + wmslayer = artifact.getId(); + } +%> + +<%-- display export options if one is supported in this state --%> +<% if (supportChart || supportCSV || supportODV || supportWMS || supportZIP) { %> +
+
+ + <%if (supportChart) { %> + " title=""> + + + <%}%> + <%if (supportWMS) { %> + "> + + + <%}%> + <%if (supportZIP) { %> + "> + + + <%}%> + + <%if (supportSta) { %> + " title=""> + + + <%}%> + + <%if (supportHis) { %> + " title=""> + + + <%}%> + <%if (supportCSV) { %> + "> + + + <%}%> + <%if (supportODV) { %> + "> + + + <%}%> +
+
+<%}%> diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,33 @@ +<%@ 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="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> +<%@page import="java.util.Collection"%> +<%@page import="java.util.Iterator"%> +<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + + String parameterString = ""; + String target = "histogram"; + String 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()); + } + + parameterString += "&bintype="+request.getAttribute("bintype"); + } +%> + + +
+ <bean:message key="gnviewer.output.options.histogram.alt"/> +
diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,126 @@ +<%@ 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="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.ExportMode"%> +<%@page import="java.util.Collection"%> +<%@page import="java.util.Iterator"%> +<%@page import="java.net.URLEncoder"%> +<% + String target = "histogram"; + String targetPDF = "pdf"; + String targetSVG = "svg"; + String targetIMG = "img"; + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + OutputMode outputMode = sm.getOutputMode(target); + DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); + + boolean useDiagrammOptions = diagrammOptions != null; + ExportMode supportIMG = outputMode.getExportMode(targetIMG); + ExportMode supportPDF = outputMode.getExportMode(targetPDF); + ExportMode supportSVG = outputMode.getExportMode(targetSVG); + + String mimeType = outputMode.getMimeType(); + String parameterString = ""; + Collection op = outputMode.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 mimeTypeIMG = null; + if (supportIMG != null) { + mimeTypeIMG = supportIMG.getMimeType(); + } + String mimeTypePDF = null; + if (supportPDF != null) { + mimeTypePDF = supportPDF.getMimeType(); + } + String mimeTypeSVG = null; + if (supportSVG != null) { + mimeTypeSVG = supportSVG.getMimeType(); + mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8"); + } +%> +
+
+ + + +
+ + <%if (outputMode != null && outputMode.getOutputParameters() != null && !outputMode.getOutputParameters().isEmpty()){ + Iterator it = outputMode.getOutputParameters().iterator(); + while (it.hasNext()){ + OutputParameter om = it.next(); + String diaOpts = null; + if (diagrammOptions != null) { + diaOpts = request.getParameter("bintype"); + }%> + + + + + + <%}%> +
+ <%if (om.getName().equals("bincount")) { + String check = ""; + if (diaOpts != null && diaOpts.equalsIgnoreCase("binwidth")) { + check = ""; + } + else { + check = "checked=\"checked\""; + }%> + name="bintype" value="bincount" id="checkCount" onClick="toggleBinType('checkWidth')">  + <%}%> + <%if (om.getName().equals("binwidth")) { + String check = ""; + if (diaOpts != null && diaOpts.equalsIgnoreCase("binwidth")) { + check = "checked=\"checked\""; + } + else if (diaOpts == null) { + check = ""; + }%> + name="bintype" value="binwidth" id="checkWidth" onClick="toggleBinType('checkCount')">  + <%}%> + + + + <%if (om.getType().equalsIgnoreCase("boolean")){ + boolean checked = useDiagrammOptions ? "true".equalsIgnoreCase(diagrammOptions.getValue(om.getName())) : om.getValue().equalsIgnoreCase("true"); + %> + /> + <%}else{%> + + <%}%> +
+ "/> + <%}%> + <%if (supportIMG != null) { %> + "> + + + <%}%> + <%if (supportPDF != null) { %> + "> + + + <%}%> + <%if (supportSVG != null) { %> + "> + + + <%}%> +
+
+
diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,49 @@ +
+
" method="post"> +
+ Kartenviewer Request + + +
+
+
\ No newline at end of file diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,73 @@ +<%@ 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"%> +<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + Object ui = request.getAttribute("ui"); + Object staticui = request.getAttribute("staticui"); + Object chart = request.getAttribute("chart"); + Object statistic = request.getAttribute("statistic"); + Object histogram = request.getAttribute("histogram"); + Object wms = request.getAttribute("wms"); + boolean furthertargets = true; + + if (chart == null && statistic == null && histogram == null && wms == null) { + boolean supportChart = sm.getOutputMode("chart") != null; + if (supportChart) { + chart = "true"; + } + } + + Object furthertargetsObject = request.getAttribute("furthertargets"); + if (furthertargetsObject != null){ + furthertargets = ((Boolean)furthertargetsObject).booleanValue(); + } +%> +
+ <%if (staticui == null){ %> + + <%} else {%> +
+
+ + <%=staticui.toString()%> +
+
+ <%}%> + + <%-- render the dynamic part to feed the state and advance to the next state --%> + <%if (ui != null){%> +
+
" method="post"> +
+ <%=ui != null ? ui.toString().replaceAll(" ", "") : "" %> + + <%if(furthertargets){%> + "/> + <%}%> +
+
+
+ <%}%> +
+ + <%-- render export options if existing for this state --%> + + + <%if (chart != null) {%> + <%-- render chart options if existing for this state --%> + + <%}%> + + <%-- render statistic --%> + <%if (statistic != null) {%> + + <%}%> + + <%-- render histogram --%> + <%if (histogram != null) {%> + + <%}%> diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,71 @@ + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> + + + + <bean:message key="gnviewer.app.title"/> + + + + + + + + + + + + + + +
+
+
+

+ +

+
+
+
+ + + +
+ + diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,83 @@ + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<% + String serverPath = (String) request.getAttribute("mapserver"); + String mapfilePath = (String) request.getAttribute("mapfile"); + String layerName = (String) request.getAttribute("layer"); +%> + + + + + <bean:message key="gnviewer.app.title"/> + + + + + + + + + + + + + + + +
+
+
+

+ +

+
+
+
+ + + + +
+
+ + + + + + + + + +
:<%=serverPath%>?MAP=<%=mapfilePath%>
:<%=layerName%>
+
+
+
+
+ + diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/arrow_refresh.png Binary file gnv/src/main/webapp/images/arrow_refresh.png has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/back_button.png Binary file gnv/src/main/webapp/images/back_button.png has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/bg_fieldset.gif Binary file gnv/src/main/webapp/images/bg_fieldset.gif has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/bg_fieldset_ie6.gif Binary file gnv/src/main/webapp/images/bg_fieldset_ie6.gif has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/bsh_logo.gif Binary file gnv/src/main/webapp/images/bsh_logo.gif has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/chart_bar.png Binary file gnv/src/main/webapp/images/chart_bar.png has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/chart_curve.png Binary file gnv/src/main/webapp/images/chart_curve.png has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/data_export.png Binary file gnv/src/main/webapp/images/data_export.png has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/diagram_export.png Binary file gnv/src/main/webapp/images/diagram_export.png has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/disk.png Binary file gnv/src/main/webapp/images/disk.png has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/img.gif Binary file gnv/src/main/webapp/images/img.gif has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/list-item.gif Binary file gnv/src/main/webapp/images/list-item.gif has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/map_go.png Binary file gnv/src/main/webapp/images/map_go.png has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/pdf.png Binary file gnv/src/main/webapp/images/pdf.png has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/statistics.png Binary file gnv/src/main/webapp/images/statistics.png has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/stock_data-save.png Binary file gnv/src/main/webapp/images/stock_data-save.png has changed diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/main/webapp/images/svg.png Binary file gnv/src/main/webapp/images/svg.png has changed diff -r b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,2 @@ +<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> + diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,434 @@ +@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-repeat: repeat-x; + background-position: top left; + display: block; +} + +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; +} + +textarea.mapviewer { + width: 450px; +} + +input.textinput { + width: 250px; +} + + +textarea { + font-family: verdana, arial, Helvetica, sans-serif; + font-size: 0.7em; +} + +table.dynamic { + font-size: 1.2em; +} + +table.static { + margin: 0 0 0 0; + width: 293px; +} + +table.wms { + font-size: 0.8em; + margin: 0 0 0 0; +} + +table, th, td { + margin: 0; + padding: 0; + font-size: 0.8em; +} + +img { + border: 0px; +} + +.down { + padding-top: 20px; + width: 315px; +} + +.historyback { + padding-left: 10px; + vertical-align: top; + text-align: right; +} + +.parameter { + color: #00416B; + font-size: 0.8em; + font-weight: bold; + padding-left: 5px; + text-align: left; + vertical-align: top; + width: 110px; +} + +.matrixHeader { + padding-left: 5px; +} + +.wmsvalue { +} + +.value { + font-size: 1.2em; +} + +.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: absolute; + top: 33px; + left: 350px; +} + +div.outerMap { + position: absolute; + top: 62px; + left: 350px; + width: 555px; + height: 436px; + margin: 0 0 0 0; + padding: 0 0 0 0; +} + +div.wms { + position: relative; + top: 0px; + left: 0px; + height: 30px; + border: 1px solid red; +} + +div#map { + position: absolute; + top: 55px; + left: 0px; + width: 555px; + height: 381px; + border: 1px solid #CCD5DE; +} + +div.histogram { + position: absolute; + top: 33px; + left: 350px; +} + +div#export { + width: 325px; +} + +/* this is a wrapper for diagramoptions and statistics*/ +div#diagrammAddOns { + position: absolute; + top: 600px; + left: 300px; +} + +div#diagramoptions { + position: relative; + width: 325px; +} + +div#diagramOptionsContent { + width : 325px; +} + +div.statistics { + position: absolute; + top : 33px; + left : 350px; + width : 325px; +} + +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; + +} + +/* ----------------------------------- */ diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/test/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserTestCase.java Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,89 @@ +package de.intevation.gnv.action.mapviewer.parser; + +import java.io.File; +import java.io.FileInputStream; +import java.io.InputStream; +import java.util.Collection; +import java.util.Iterator; + +import junit.framework.TestCase; + +import org.apache.log4j.BasicConfigurator; +import org.apache.log4j.Logger; + +import de.intevation.gnv.artifactdatabase.objects.map.Layer; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + +public class ExternalCallParserTestCase extends TestCase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = null; + + static { + BasicConfigurator.configure(); + log = Logger.getLogger(ExternalCallParserTestCase.class); + } + + public ExternalCallParserTestCase() { + super(); + } + + public ExternalCallParserTestCase(String name) { + super(name); + } + + public void testParseExternalCall() { + log.debug("Execute testParseExternalCall"); + try { + InputStream inputStream = new FileInputStream( + new File("src/test/ressources/externalinterfacecall.xml")); + ExternalCallParser ecp = new XMLExternalCallParser(inputStream); + ecp.parse(); + String geometry = ecp.getGeometry(); + assertNotNull(geometry); + log.debug("Parsed Geometry: "+geometry); + String srs = ecp.getSRS(); + assertNotNull(srs); + log.debug("Parsed SRS: "+srs); + Collection mapServices = ecp.getMapServices(); + assertNotNull(mapServices); + log.debug(mapServices.size()+"Mapservices parsed"); + assertEquals(2, mapServices.size()); + Iterator it = mapServices.iterator(); + MapService mapService1 = it.next(); + MapService mapService2 = it.next(); + + log.debug("MapService 1"); + log.debug("ID: "+mapService1.getID()); + log.debug("URL: "+mapService1.getURL()); + log.debug("TYPE: "+mapService1.getType()); + Collection layer1 = mapService1.getLayer(); + log.debug("Layer parsed: "+layer1.size()); + assertEquals(5, layer1.size()); + Iterator layerIt1 = layer1.iterator(); + while(layerIt1.hasNext()){ + log.debug(layerIt1.next().toString()); + } + + log.debug("MapService 2"); + log.debug("ID: "+mapService2.getID()); + log.debug("URL: "+mapService2.getURL()); + log.debug("TYPE: "+mapService2.getType()); + Collection layer2 = mapService2.getLayer(); + log.debug("Layer parsed: "+layer2.size()); + assertEquals(2, layer2.size()); + Iterator layerIt2 = layer2.iterator(); + while(layerIt2.hasNext()){ + log.debug(layerIt2.next().toString()); + } + + } catch (Exception e) { + log.error(e,e); + fail(); + } + + } + +} diff -r b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 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 b98d1adee7a6 -r af3f56758f59 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:53 2012 +0200 @@ -0,0 +1,10 @@ + + + product + + + timeSeries + timeSeries + + + diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/test/ressources/externalinterfacecall.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/ressources/externalinterfacecall.xml Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + EPSG:4324 + POINT(8.6 56.0) + + \ No newline at end of file diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/test/ressources/externalinterfacecall_curl.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/ressources/externalinterfacecall_curl.xml Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EPSG:4324 + POINT(8.6 56.0) + + \ No newline at end of file diff -r b98d1adee7a6 -r af3f56758f59 gnv/src/test/ressources/samplecall.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/ressources/samplecall.txt Fri Sep 28 12:13:53 2012 +0200 @@ -0,0 +1,1 @@ +curl -v -X POST -H "Content-type: text/xml" http://localhost:8080/gnv/extcall.do -d @externalinterfacecall_curl.xml \ No newline at end of file