Mercurial > dive4elements > gnv-client
changeset 875:5e9efdda6894
merged gnv-artifacts/1.0
author | Thomas Arendsen Hein <thomas@intevation.de> |
---|---|
date | Fri, 28 Sep 2012 12:13:56 +0200 |
parents | bb3ffe7d719e (diff) f08908d4df50 (current diff) |
children | 3f9fc88aec2b |
files | |
diffstat | 133 files changed, 12351 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/ChangeLog Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,2396 @@ +2010-04-28 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * Changes, NEWS, ChangeLog: Summarized changes. + +2010-04-28 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java: Removed + trailing whitespace. + +2010-04-28 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Removed + duplicated and unused imports. + +2010-04-27 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue225 + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added global forwards + for imprint and info. + + * src/main/webapp/WEB-INF/jsp/header.jsp, + src/main/webapp/WEB-INF/jsp/footer.jsp: Adapted links for imprint and info + pages. + + * src/main/webapp/WEB-INF/jsp/imprint.jsp, + src/main/webapp/WEB-INF/jsp/info.jsp: New pages for imprint and an info + page. + + * src/main/resources/applicationMessages_en.properties: Renamed 'about' -> + 'imprint'. + +2010-04-27 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue225 + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Render a + parameter matrix if there is just a single parameter as well. This allows + us to render a legend for multi select boxes at another place - this fixes + the missing legend for parameter select boxes. + +2010-04-26 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/webapp/images/img.gif, + src/main/webapp/images/stock_data-save.png, + src/main/webapp/images/bg_fieldset.gif, + src/main/webapp/images/list-item.gif, + src/main/webapp/images/bg_fieldset_ie6.gif, + src/main/webapp/scripts/calendar-setup.js, + src/main/webapp/scripts/calendar-en.js, + src/main/webapp/scripts/calendar.js, + src/main/webapp/scripts/calendar-de.js, + src/main/webapp/scripts/calendar-setup_stripped.js, + src/main/webapp/scripts/jquery-1.4.2.min.js, + src/main/webapp/scripts/calendar_stripped.js: Removed JavaScript files and + images that are not used anymore. + +2010-04-26 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added an error + message if that should be displayed if an artifact is out of date. + +2010-04-26 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue236 & Issue242 + + * src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Display + error messages if the artifact server is down - this have been broken. + +2010-04-26 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue258 + + * src/main/java/de/intevation/gnv/action/LoadAction.java: An error message + is displayed if the user tried to load an existing project and the + artifact server is down. + +2010-04-26 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue259 + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp: + Added target 'chart' as url request parameter when performing the html + form to change the chart output. The reason for doing this is, that the + InternetExplorer seems no to add the value of <input type="image"...> + elements to the request object which is sent to the server. + +2010-04-26 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue225 + + * src/main/webapp/styles/gnv.css: Reduced the size of links in header and + footer. + +2010-04-26 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue225 + + * src/main/webapp/styles/gnv.css: Adjusted the style of fieldsets - there is + a gap between the fieldset border and input elements in IE now as well. + The size of select boxes and textareas is fixed now. + +2010-04-25 Ingo Weinzierl <ingo_weinzierl@web.de> + + Issue225 + + * src/main/webapp/styles/gnv.css: A new style class. Most of this is copied + from default.css but a lot of content which is not used anymore has been + removed. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Restructuring. The parameter panel + and the content div container are placed in a table row now. Very wide + html elements in the content div container don't break the layout anymore. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: Moved html elements to render + OpenLayers into index.jsp. Removed JavaScript code to adjust layout. + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp: + Added style class to the table that contains the chart options. + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Removed JavaScript code to + adjust layout. + + * src/main/webapp/scripts/jquery-1.4.2.min.js: Removed. Not used anymore. + +2010-04-23 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue225 + + * src/main/webapp/styles/default.css: Adapted some font size in the + parameter panel. + +2010-04-23 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue225 + + * src/main/webapp/WEB-INF/jsp/index.jsp: Replaced the standard html input + button with an image as the choose button. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added specific + strings that represent pathes to german and english load button images. + + * src/main/webapp/styles/default.css: New styles to adjust the upload box + and the load button. + + + * src/main/webapp/images/load.png, + src/main/webapp/images/laden.png: Images for project load button. + +2010-04-23 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue237 + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: Added http request parameter to + the mapserver path to simplify the GetCapabilities call for the user. + +2010-04-23 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue254 + + * src/main/java/de/intevation/gnv/action/SwitchLanguageAction.java: New + controller to toggle between german and english language. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Use the + locale stored in the artifact to create the user interface. At the + beginning, this will be the locale of the request object. If the user + chooses another language by calling the SwitchLanguageAction controller, + this locale becomes the prefered locale, and the browser settings are no + more relevant. + + * src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java: + Now, the SessionModel has two methods to set and retrieve the current + locale which is used to create a language specific user interface. + + * src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java: + Initial creation of the SessionModel gets the locale of the request + object. If this locale is changed by the user via SwitchLanguageAction + controller, changes in the browser settings won't have an effect anymore. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Add the controller to + switch between languages. + + * src/main/webapp/WEB-INF/jsp/header.jsp: The header contains a link to + toggle between german and english language - a click on it will trigger + the SwitchLanguageAction. + +2010-04-22 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue221 + + * src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java: + Added methods to quote html characters in strings. + + * src/main/java/de/intevation/gnv/action/WMSAction.java: Call methods to + quote html characters in strings inserted by the user. Used to be safe + from html injections. + +2010-04-19 Hans Plum <hans@intevation.de> + + Issue 241: Set Path to Tomcat Standard Logging + + * src/main/webapp/WEB-INF/classes/log4j.properties: + Adapted logging path for webclient gnv to the central tomcat mechamism + in order to resolve the dependency to the artefact-server directory + layout. + +2010-04-19 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue227 + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Added a new method to retrieve the current locale. + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Feed the xsl + transformer with a tooltip text for the back-button. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added a tooltip text + for the back-button. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Use the + tooltip text that is fed in DescribeUIAction. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Removed a + PropertiesReader which isn't used there. + +2010-04-19 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/resources/applicationMessages.properties: Forgot a dot. ;-) + +2010-04-19 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue224 + + * src/main/resources/applicationMessages.properties: Fixed a typo in the + german text of the overlay display. + +2010-04-18 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/gnv/**/*.java: + Using unix line endings only. + +2010-04-17 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/gnv/**/*.java: + Removed trailing whitespace. + +2010-04-14 Hans Plum <hans@intevation.de> + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: + Adapted background layers to a global and local visibale layer (World + Relief (2 Minute Raster) + +2010-04-14 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Changed language + strings. + + * src/main/webapp/styles/default.css: Adapted css classes. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp, + src/main/webapp/WEB-INF/jsp/header.jsp, + 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, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Adapeted design. + + * src/main/webapp/scripts/gnviewer.js: Added javascript methods to adapt the + size of the content panel. + + * src/main/webapp/scripts/jquery-1.4.2.min.js: JavaScript library doing + general javascript stuff. + +2010-04-13 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added resource + pointing to the image of the 'choose'-button. + + * src/main/webapp/images/auswaehlen.png, + src/main/webapp/images/choose.png: Selfmade 'choose'-buttons for english + and german language. + + * src/main/webapp/WEB-INF/jsp/index.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp: Removed standard + html input buttons with selfmade ones. + +2010-04-13 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/webapp/styles/default.css: Adapted style of links. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Replaced input buttons for + loading/saving projects with links. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Added javascript function to + toggle the visibility of the file upload button/chooser. + +2010-04-13 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Fixed a display + bug in the measurement panel for one parameter. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: New strings for + header and footer links. + + * src/main/webapp/styles/default.css: Added and adapted style classes. + + * src/main/webapp/WEB-INF/jsp/header.jsp: Added links for restarting the app, + retrieving information about it and switching the current language. + + * src/main/webapp/WEB-INF/jsp/footer.jsp: Added navigation links to 'home', + a contact page and an about page. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp, + src/main/webapp/WEB-INF/jsp/index.jsp, + 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_wms_options_inc.jsp: Changed + the design of the whole application regarding the bsh styleguide. + +2010-04-13 Tim Englich <tim.englich@intevation.de> + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java : + Added more Javadocs. + +2010-04-13 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/package.html, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/package.html, + src/main/java/de/intevation/gnv/artifactdatabase/client/exception/package.html, + src/main/java/de/intevation/gnv/artifactdatabase/client/package.html, + src/main/java/de/intevation/gnv/action/package.html, + src/main/java/de/intevation/gnv/action/sessionmodel/package.html, + src/main/java/de/intevation/gnv/util/package.html: Added first part of + package descriptions. + +2010-04-13 Hans Plum <hans@intevation.de> + + * src/main/webapp/images/svg.png, + src/main/webapp/images/delete.png, + src/main/webapp/images/map_go.png, + src/main/webapp/images/diagram_export.png, + src/main/webapp/images/chart_curve.png, + src/main/webapp/images/arrow_refresh.png, + src/main/webapp/images/pdf.png, + src/main/webapp/images/data_export.png, + src/main/webapp/images/chart_bar.png, + src/main/webapp/images/statistics.png, + src/main/webapp/images/disk.png, + src/main/webapp/images/tick.png, + src/main/webapp/images/back_button.png: + Converted relevant icons to the requirements of BSH Corporate Design, + 19.06.2009, S. 172: Hue: 172; Saturation: 34; Brightness: 28. + +2010-04-12 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java, + src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java, + src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java, + src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseInputException.java, + src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java, + src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java, + src/main/java/de/intevation/gnv/action/CommunicationKeys.java, + src/main/java/de/intevation/gnv/action/DoExportAction.java, + src/main/java/de/intevation/gnv/action/WMSAction.java, + src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java, + src/main/java/de/intevation/gnv/action/ShowStatisticAction.java, + src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java, + src/main/java/de/intevation/gnv/action/LoadAction.java, + src/main/java/de/intevation/gnv/action/CreateHistogramAction.java, + src/main/java/de/intevation/gnv/action/SelectFisAction.java, + src/main/java/de/intevation/gnv/action/DoOutputAction.java, + src/main/java/de/intevation/gnv/action/CreateChartAction.java, + src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java, + src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/StoreAction.java, + src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java, + src/main/java/de/intevation/gnv/util/XSLTransformer.java: Added JavaDoc + comments. + +2010-04-12 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for + chart button in actions panel. + + * src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Changed the + label of the chart button in the actions panel ('Diagramm speichern' -> + 'Diagramm'). + +2010-04-09 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue210 + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Changed the + parameter-measurement matrix rendering. Its content is no more selectable + - it is just to inform the user about the existence of a measurement for a + given parameter. Instead, there is a new row with a checkbox for each + measurement in the header of the matrix. So, the user is able to select a + measurement without a relation to a specific parameter - all parameters + which are available for this measurement are effected by this choice in + future outputs. + + * src/main/webapp/styles/default.css: New classes for styling the + parameter-measurement matrix. + + * src/main/webapp/images/delete.png, + src/main/webapp/images/tick.png: New icons to inform the user about the + existence of a measurement for a given parameter. + +2010-04-09 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue216 + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp: + Added a missing character to the url of the image export. + +2010-03-29 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue13 & Issue18 + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp, + src/main/webapp/WEB-INF/jsp/header.jsp: Added a reload link. A click on + this link rebuilds the ui with the description of the current artifact. + + Note: If the artifact server ist down, nothing happens when using this + link. A click on this link triggers a controller which sends a + describe-request to the artifact server. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added a new controller + to build the current user interface. This could be used if the artifact + server is down and the ui brakes after an user interaction. After the + artifact server being restarted, this controller can be called to rebuild + the ui with the current artifact description. + + * src/main/webapp/styles/default.css: Moved exception message and reload + link a bit to avoid overlapping elements. Added a new class to adjust the + style of the reload link. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added strings for + reload-link. + +2010-03-29 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/gnv/**/package.html: New. + Added package description with text 'DOCUMENT ME!'. + +2010-03-29 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/gnv/**/*.java: + Bring @author javadoc tags in form '@author <a href="john.doe@example.com">John Doe</a>' + + find -name \*.java | \ + xargs sed -i \ + -e 's/@author[ ]\+\([^(<]\+\)[<(]\([^>)]\+\)[>)]/@author <a href="mailto:\2">\1<\/a>/g' \ + -e 's@[ ]\+</a>@</a>@g' + +2010-03-29 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * rc/main/java/de/intevation/gnv/**/*.java: + Ordered imports. Removed needless imports. Removed empty headers. + +2010-03-29 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue30 + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Use the + correct locale for i18n supported by HttpServletRequest object. The + application language is switched after the next server round-trip if the + user changes the preferred browser language. + Hint: Struts' Action class has a method getLocale(HttpServletRequest) + which should return the currently selected locale. This method seems to be + buggy - returns session's initial locale. + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java: + Inherit from DescribeUIAction. The rendering stuff is now done by + DescribeUIAction. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added missing forward + used for stepping back to a previous state in SelectArtifactFactory + action. + +2010-03-29 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/gnv/**/*.java: + Removed trailing whitespace. + find -name \*.java | xargs sed -i 's/[ \t]\+$//' + +2010-03-26 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue197 + + * src/main/java/de/intevation/gnv/action/WMSAction.java: Parse the time to + live of an artifact from meta document and set an attribute 'ttl' of the + request object. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: Added a new row showing + the time to live beneath the layer name and wms url. + + * src/main/resources/applicationMessages_en.properties, + src/main/resources/applicationMessages.properties: Added new label for + availability of an artifact/wms-layer. + + * src/main/webapp/styles/default.css: Moved OpenLayers map a bit south. + +2010-03-22 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Improved the copying of input stream to output stream a bit. + +2010-03-22 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/action/LoadAction.java: Just copy the + input stream to the output stream without parsing it and without creating + a temporary xml document. + +2010-03-22 Tim Englich <tim.englich@intevation.de> + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp, + src/main/java/de/intevation/gnv/action/WMSAction.java (execute): + Improved ExceptionHandling during WMS-Publishing. + Now the OL-GUI will only be shown if the WMS was published succsessfull. + +2010-03-19 Tim Englich <tim.englich@intevation.de> + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (publishWMS), + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (publishWMS), + src/main/java/de/intevation/gnv/action/WMSAction.java (execute): + Improved ExceptionHandling during WMS-Publishing. + The responsedocument will be scanned for Exceptionreports. + Also if no URL, Mapfile or Layer was retrieved from the Responsedocument + the Exceptionpage will be visualized instead an corrupt Openlayersclient. + +2010-03-19 Tim Englich <tim.englich@intevation.de> + + * src/main/resources/applicationMessages.properties: + Added new German resource for fis_marinefeatures according to msg1067 + of Issue2005. + +2010-03-19 Tim Englich <tim.englich@intevation.de> + + * src/main/resources/applicationMessages*.properties: + Added Ressources for new FIS Marine Features. + +2010-03-19 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/action/LoadAction.java: Use the uploaded + file to start an artifact import. Create a new Artifact object if the + import was successful and fetch the current artifact description with user + interface part to restore the gui. Display an error message if something + failed while importing. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java: + Added a new method doImport to import artifacts from xml documents. A + describe document without ui part is returned if an import was successful. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added error messages + for the case that something failed while importing artifacts from xml + documents. + + * src/main/webapp/WEB-INF/jsp/header.jsp: Replace whitespaces from exception + request parameter with dots. Exceptions thrown by the artifact server + corresponds to a specific resource key. Failures coming from the artifact + server are displayed language specific on this way. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added missing forwards + to import action. + +2010-03-19 Tim Englich <tim.englich@intevation.de> + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java (addParameters): + Some Codecleanup done. + +2010-03-19 Tim Englich <tim.englich@intevation.de> + + * src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp: + Integrated a Switch will be load different Geometries into the + Requestbody of an Mapviewercall. + You cann add gt=POINT , gt=LINESTRING or gt=POLYGON to the URL to switch + between the different Geometries. + The Values of the Geometries are the same as used in the GUI of the GNV. + +2010-03-17 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue208 First steps for exporting artifacts. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java: + New method to export an artifact. + + * pom.xml: Added Apache common-fileupload 1.2.1 lib. + + * src/main/java/de/intevation/gnv/action/CommunicationKeys.java: Further + error message key added which is displayed beneath project load/store + buttons if an error occured while these operations. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added error messages + for errors which occure while loading/storing projects. + + * src/main/webapp/styles/default.css: Added a new style class to adjust + error messages which may occur while loading/storing projects. + + * src/main/java/de/intevation/gnv/action/StoreAction.java: New controller + which triggers an artifact export. After pushing the corresponding button, + the artifact is returned as xml document and a file dialog is displayed. + + * src/main/java/de/intevation/gnv/action/LoadAction.java: New controller to + import artifacts which have former been exported. XML documents are + successfully read from fileupload. + TODO: Use these documents to create artifacts. No artifacts are loaded + yet! + + * src/main/java/de/intevation/gnv/util/XMLUtils.java: Added a method to + write documents to a stream. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added LoadAction and + StoreAction. The controller are available under /gnv/load and /gnv/store. + + * src/main/webapp/WEB-INF/jsp/header.jsp: Removed placeholder string for + storing/loading the current project state and added buttons to start + an export of the current project's state (the current artifact) or reload + an artifact from a xml document. + +2010-03-16 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Changed the + rendering of measurement/parameter matrix. The matrix will now look like + this: + + | measurement label | measurement label + ------------------------------------------------------- + parameter label | measurement value | measurement value + parameter label | measurement value | measurement value + +2010-03-15 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + Issue198 + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Added the method signature for publishing wms layers. 'publishWMS' + requires a collection of InputParameters which are used to create the + request xml document. These input parameters can be used to adjust some + wms settings. At the moment, the only parameter which written to the + request xml document is the title for a wms layer. + + * src/main/java/de/intevation/gnv/action/WMSAction.java: Search for user + input and append given input values to request xml document. Put the layer + title into request object to be accessible in jsp files. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Render wms option panel if wms is + requested. + + * src/main/webapp/WEB-INF/jsp/includes/display_wms_options_inc.jsp: New. + Option panel for wms customization. At the moment, the user has the + possibility to adjust wms layers' title. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added some labels + for wms options. + +2010-03-12 Tim Englich <tim.englich@intevation.de> + + * src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java (testArtifactDatabaseClient): + Fixed Compilation-Error because of InterfaceChanges of the + ArtifactDatabaseClient-Interface. + +2010-03-12 Tim Englich <tim.englich@intevation.de> + + * src/main/resources/applicationMessages*.properties: + Integrated Resource for FIS Contis and Nauthis. + +2010-03-10 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Throw different exceptions if an error occured in the artifact server. + On this way, we are able to distinguish between general server errors or + errors caused by an invalid user input. + + * src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: + Catch the exceptions thrown by DefaultArtifactDatabaseClient and set an + attribute at the request object for each exception type. The attributes + will take effect on different places in the user interface. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseInputException.java: + Exception used to be thrown if an invalid user input error occured. + + * src/main/java/de/intevation/gnv/action/CommunicationKeys.java: Added some + keys to store different error messages in the Http session. + + * src/main/webapp/styles/default.css: Added new style class to adjust the + style of error messages caused by invalid user input. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Display invalid input errors at + the top of the input area. + +2010-03-09 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/webapp/WEB-INF/config/log4j.properties, + src/main/webapp/WEB-INF/classes/log4j.properties: Moved logging + configuration. The config file did not have any effect in config + directory. In classes directory, it has. + + * src/main/webapp/WEB-INF/web.xml: Removed logging section which is no more + necessary anymore. + +2010-03-09 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Parse + user input from chart/histogram options panel and check if integer and + doubles are valid - if we find a value which is not valid for the + configured type, we set an exception message which is displayed in the + chart/histogram options panel and sets the corresponding parameter to its + default value. + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp: + Display error message in options panel if there is one. + + * src/main/resources/applicationMessages_en.properties, + src/main/resources/applicationMessages.properties: + Added strings to display error messages when the user entered a bad + formatted number in chart/histogram options panel. + + * src/main/java/de/intevation/gnv/action/CommunicationKeys.java: Added two + further error message keys used to store error messages for + chart/histogram options. + + * src/main/webapp/styles/default.css: Added a new class 'chartException' to + adjust the style of an error message in chart/histogram options panel. + +2010-03-08 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + 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 <sascha.teichmann@intevation.de> + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: + Removed duplicated imports. + +2010-03-05 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + 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 <tim.englich@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + 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 <ingo.weinzierl@intevation.de> + + 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Set + file-extension according to mime type for histogram exports. + +2010-02-26 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + Issue170 + + * pom.xml: Changed log4j version to 1.2.14 (later version causes errors and + breaks maven build process). + +2010-02-02 Tim Englich <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <hans@intevation.de> + + RELEASE 0.3 + + * Changes, NEWS, ChangeLog: Summerized activities + +2010-01-27 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + 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 <ingo.weinzierl@intevation.de> + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for + char option 'draw data points'. + +2010-01-20 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <sascha.teichmann@intevation.de> + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Simpler + demo WKT polygon. + +2010-01-17 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * 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 <sascha.teichmann@intevation.de> + + * 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 <sascha.teichmann@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <sascha.teichmann@intevation.de> + + * 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 <sascha.teichmann@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <sascha.teichmann@intevation.de> + + RELEASE 0.3 + + * Changes, NEWS, ChangeLog: Summerized activities + +2009-12-17 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * src/main/resources/applicationMessages.properties: + s/Modeldaten/Modelldaten/ + +2009-12-17 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * 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 <hans@intevation.de> + + Issue 129: Release 0.2: Verbesserung der �bersetzungen + + * src/main/resources/applicationMessages.properties: + Fixed i18n strings reported by experts + +2009-12-14 Tim Englich <tim.englich@intevation.de> + + * 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 <hans@intevation.de> + + 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 <sascha.teichmann@intevation.de> + + * src/main/resources/applicationMessages.properties: Fixed some + spelling problems. + +2009-12-01 Tim Englich <tim.englich@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <ingo.weinzierl@intevation.de> + + * 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 <hans@intevation.de> + + RELEASE-0.2 + + * Changes, NEWS: + Summerized activities. + +2009-11-13 Hans Plum <hans@intevation.de> + + * ChangeLog: + Unified entries with references to issues. + +2009-11-13 Tim Englich <tim.englich@intevation.de> + + * src/main/webapp/WEB-INF/web.xml: + Added Documentation of Configuration-Entries. + +2009-11-12 Tim Englich <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + 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 <tim.englich@intevation.de> + + Issue 81: Input of coordinate values do not show up after update + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + Remove <br/> Tag after Input-Elements + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Add an <br/>-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 <tim.englich@intevation.de> + + 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 <ingo.weinzierl@intevation.de> + + * src/main/resources/applicationMessages.properties: Replaced german umlaut + witch ascii character. + +2009-11-06 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * pom.xml: Changed Restlet repository from M3 to Snapshot. + +2009-11-06 Ingo Weinzierl <ingo.weinzierl@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * src/main/resources/applicationMessages*.properties: + Added Ressources for two new FIS. Current Meter and Ice Station Reports + +2009-10-27 Tim Englich <tim.englich@intevation.de> + + * src/main/resources/applicationMessages_en.properties: + Added Ressources for two new FIS. Seegangsarchiv and SEACAT + +2009-10-22 Tim Englich <tim.englich@intevation.de> + + 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 <tim.englich@intevation.de> + + 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 <tim.englich@intevation.de> + + 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 <tim.englich@intevation.de> + + 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 <tim.englich@intevation.de> + + 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 <tim.englich@intevation.de> + + 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 <tim.englich@intevaion.de> + + 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 <tim.englich@intevation.de> + + 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 <sascha.teichmann@intevation.de> + + RELEASE 0.1 + + * Changes, NEWS: Summarized changes. + +2009-10-06 Tim Englich <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <sascha.teichmann@intevation.de> + + * Changelog -> ChangeLog: Moved to make eclipse happier. + +2009-10-08 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * Changelog: Unified changelog style. + +2009-10-08 Sascha L. Teichmann <sascha.teichmann@intevation.de> + + * pom.xml: Remove XMLBeans stuff, set filtered resources to UTF-8 + +2009-10-06 Tim Englich <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * src/main/webapp/WEB-INF/jsp/header.jsp Edited: + Deaktivate Links save Project and load Project gnv/issue12 + +2009-10-05 Tim Englich <tim.englich@intevation.de> + + * src/main/resources/applicationMessages.properties Edited: + Added some more FIS-Ressource. + +2009-10-02 Tim Englich <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * src/**/*.java Edited: + Format Code to max 80 Chars per Row + +2009-10-02 Tim Englich <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * src/main/resources/applicationMessages.properties Edited: + Adding missing StatisticsDescription for Arithmetic Mean. + +2009-09-28 Tim Englich <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Edited: + Bug fixed in CSV_Export Link + +2009-09-25 Tim Englich <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * src/main/webapp/scripts/gnviewer.js Edited: + Removed unused Methods from File. + +2009-09-24 Tim Englich <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * src/main/webapp/scripts/gnviewer.js Added: + Added Javascript-File from Old-Project Revision: 3101 + +2009-09-24 Tim Englich <tim.englich@intevation.de> + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Edited: + Codecleanup + ExceptionReporthandling integrated + +2009-09-24 Tim Englich <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * pom.xml: Further Dependencies and Plugins added + Deleted some utdated Files + +2009-09-11 Tim Englich <tim.englich@intevation.de> + + * src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java Added: + Testcase for querying Artifacfactorydescriptions from the ArtifactDatabase + +2009-09-11 Tim Englich <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * 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 <tim.englich@intevation.de> + + * .svnignore Added: Added Eclipse specific Files and Folders to the Ignorelist + +2009-09-10 Tim Englich <tim.englich@intevation.de> + + * pom.xml: Created with maven and put the Moduledependencies into it + * Changes | Changelog | NEWS | README | TODO: Added + * src/**: Added to the Project
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/Changes Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,127 @@ +2010-04-28 RELEASE 1.0 + + NEW: + + * Support for renaming wms layers (#198) + + * Added control elements for saving and loading artifacts (#208). + Apache's commons.file-updload library is used for file upload. + + * Support for changing the language between german and english via + button in the gui. The intial language is determined by browser + settings. After the user changes this settings by clicking the button + in the gui, the browser locale is ignored in future (#30, #254) + + * Improved error handling. The user is able to reload the current + parameterization with the help of a link shown in the gui if an error + occured (#13). After clicking that link, the describe document of the + current artifact is requested and the gui is created again (#13, #18, + #236). + + * Improve input validation in chart/histogram panels. + + * Improve the design of the gui according to BSH style guides. + + FIXES: + + * Adjusted file extension of image exports (#187) + * Display time to live of an artifact (#197) + * Added missing character in the link to trigger an image export of + charts (#216) + * Restructuring of parameter-measurement matrix. Just the selection of + different depths is possible (#210) + * Added tooltip text for the step-back button (#227) + * Replace html characters to avoid html injections (#221) + * Adapted the MapServer path shown in the gui (#237) + * Fixed a bug in IE that avoided exporting charts as image (#259). + * Loading an artifact without running artifact server ends with a + warning and a message to try it later again (#258) + * Display an error message if the user tries to work with an outdated + artifact (#242) + * Repaired logging with log4j + + +2010-03-08 RELEASE 0.5 + + + +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
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/NEWS Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,83 @@ +2010-04-28 RELEASE 1.0 + + NEW: + + * Support for renaming wms layers + + * Added control elements in the gui for saving and loading projects + + * Support for changing the language between german and english via + button in the gui. + + * Improved error handling. The user is able to reload the current + parameterization with the help of a link shown in the gui if an error + occured. + + * Improve the design of the gui according to BSH style guides. + + +2010-03-08 RELEASE 0.5 + + +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. +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/pom.xml Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,163 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + <groupId>de.intevation.bsh</groupId> + <artifactId>gnv</artifactId> + <packaging>war</packaging> + <version>1.0-SNAPSHOT</version> + <name>gnv</name> + <url>http://maven.apache.org</url> + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + </properties> + <repositories> + <repository> + <id>maven-restlet</id> + <name>Public online Restlet repository</name> + <url>http://maven.restlet.org</url> + </repository> + </repositories> + <dependencies> + <dependency> + <groupId>commons-fileupload</groupId> + <artifactId>commons-fileupload</artifactId> + <version>1.2.1</version> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>3.8.1</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.restlet</groupId> + <artifactId>org.restlet</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>org.restlet</groupId> + <artifactId>org.restlet.ext.xml</artifactId> + <version>2.0-SNAPSHOT</version> + </dependency> + <dependency> + <groupId>tomcat</groupId> + <artifactId>servlet-api</artifactId> + <version>5.5.15</version> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>struts</groupId> + <artifactId>struts-el</artifactId> + <version>1.2.9</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>struts</groupId> + <artifactId>struts</artifactId> + <version>1.2.9</version> + <scope>compile</scope> + </dependency> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.14</version> + </dependency> + </dependencies> + <build> + <finalName>gnv</finalName> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <configuration> + <source>1.5</source> + <target>1.5</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-war-plugin</artifactId> + <configuration> + <webResources> + <resource> + <directory>${basedir}/src/main/webapp</directory> + <excludes> + <exclude>images/</exclude> + <exclude>WEB-INF/jsp/application/</exclude> + </excludes> + </resource> + </webResources> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-jar-plugin</artifactId> + <version>2.2</version> + <configuration> + <archive> + <manifest> + <mainClass>de.intevation.artifactdatabase.App</mainClass> + </manifest> + </archive> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>1.1</version> + <configuration> + <executable>java</executable> + <arguments> + <argument>-classpath</argument> + <classpath/> + <argument>de.intevation.artifactdatabase.App</argument> + </arguments> + </configuration> + </plugin> + + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-eclipse-plugin</artifactId> + <configuration> + <m2eclipse>true</m2eclipse> + <downloadSources>true</downloadSources> + <wtpversion>1.5</wtpversion> + <additionalProjectFacets> + <jst.web.xdoclet>1.2.3</jst.web.xdoclet> + </additionalProjectFacets> + </configuration> + </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>buildnumber-maven-plugin</artifactId> + <version>1.0-beta-2</version> + <executions> + <execution> + <phase>initialize</phase> + <goals> + <goal>create</goal> + </goals> + </execution> + </executions> + <configuration> + <doCheck>false</doCheck> + <doUpdate>false</doUpdate> + <timestampFormat>{0, date, yyyy-MM-dd HH:mm:ss}</timestampFormat> + <format>{0,date,yyyy-MM-dd HH:mm:ss}</format> + <items> + <item>timestamp</item> + </items> + + <revisionOnScmFailure>no_revision</revisionOnScmFailure> + </configuration> + </plugin> + + + + </plugins> + <resources> + <resource> + <directory>src/main/resources</directory> + <filtering>true</filtering> + </resource> + </resources> + </build> +</project>
--- /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:56 2012 +0200 @@ -0,0 +1,78 @@ +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 <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +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(); + } + + + @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; + } + + + protected ActionForward getExceptionForward(ActionMapping mapping) { + log.debug("ArtifactDatabaseActionBase.getExceptionForward"); + ActionForward lForward = mapping.findForward(EXCEPTION_FORWARD_ID); + return lForward; + } + + + protected String encode(String s) { + log.debug("String to encode: " + s); + s = s.replaceAll("<", "<"); + s = s.replaceAll(">", ">"); + s = s.replaceAll("\"", """); + s = s.replaceAll("&", "&"); + + log.debug("Encoded string: " + s); + return s; + } + + + protected String[] encode(String[] s) { + if (s == null) + return null; + + String[] good = new String[s.length]; + for (int i = 0; i < good.length; i++) { + good[i] = encode(s[i]); + } + + return good; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,196 @@ +package de.intevation.gnv.action; + +import de.intevation.gnv.action.sessionmodel.DiagrammOptions; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; +import de.intevation.gnv.artifactdatabase.objects.OutputParameter; + +import java.text.NumberFormat; +import java.text.ParseException; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Locale; +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; + +/** + * This controller is called to change options used in charts and histograms + * (e.g. width, height, etc). + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +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<OutputParameter> op = outputMode + .getOutputParameters(); + if (op != null) { + Iterator<OutputParameter> it = op.iterator(); + DiagrammOptions diagrammOptions = new DiagrammOptions(); + while (it.hasNext()) { + OutputParameter parameter = it.next(); + String name = parameter.getName(); + String old = parameter.getValue(); + String value = request.getParameter(name); + String type = parameter.getType(); + + if (log.isDebugEnabled()) { + log.debug("Change chart options now..."); + log.debug("Parameter name: " + name); + log.debug("Parameter type: " + type); + log.debug("Parameter value: " + value); + } + + if (type.equalsIgnoreCase("boolean")){ + if (value == null){ + value = "false"; + } + else { + value = "true"; + } + + diagrammOptions.setValue(name,value); + } + else if (type.equalsIgnoreCase("integer")) { + if (validInteger(request.getLocale(), value)) { + diagrammOptions.setValue(name, value); + } + else { + log.warn("Text is not a valid integer: "+value); + diagrammOptions.setValue(name, old); + + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE, + "input.not.a.integer" + ); + + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_VALUE, + value + ); + } + } + else if (type.equalsIgnoreCase("double")) { + if (validDouble(request.getLocale(), value)) { + diagrammOptions.setValue(name, value); + } + else { + log.warn("Text is not a valid double: "+value); + diagrammOptions.setValue(name, old); + + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE, + "input.not.a.double" + ); + + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_VALUE, + 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); + } + } + + protected boolean validInteger(Locale locale, String value) { + try { + if (value.split("\\.").length > 1 || value.split("\\,").length > 1){ + return false; + } + + NumberFormat format = NumberFormat.getIntegerInstance(locale); + format.setParseIntegerOnly(true); + Number number = format.parse(value); + + if (number.longValue() < 0) + return false; + + return (number instanceof Integer) || (number instanceof Long); + } + catch (ParseException pe) { + return false; + } + } + + protected boolean validDouble(Locale locale, String value) { + try { + NumberFormat format = NumberFormat.getInstance(locale); + Number number = format.parse(value); + + if (number.doubleValue() < 0) + return false; + + return (number instanceof Double) || validInteger(locale, value); + } + catch (ParseException pe) { + return false; + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,36 @@ +package de.intevation.gnv.action; + +/** + * This class defines some keys used to store different exception types in the + * session. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public class CommunicationKeys { + /** + * The Key which should be used for accessing ExceptionMessages + */ + public final static String REQUEST_EXCEPTION_MESSAGE_ID = "request_exception_message_id"; + + /** + * Key used to store exceptions relating to wrong user input. + */ + public final static String REQUEST_EXCEPTION_INPUT_ID = "request_exception_input_id"; + + /** + * Key used to store exceptions relating to more general errors occured in + * the server. + */ + public final static String REQUEST_EXCEPTION_MESSAGE = "request_exception_message"; + + /** + * Key used to store exceptions relating to an invalid input format. + */ + public final static String REQUEST_EXCEPTION_VALUE = "request_exception_value"; + + /** + * Key used to store exceptions relating to a load/save project error. + */ + public final static String REQUEST_EXCEPTION_PROJECT = "request_exception_project"; +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,49 @@ +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; + +/** + * This controller is called to display charts.<br> + * An attribute 'chart' on the request object is activated which inserts an + * image calling a chart output of the server. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +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 :
--- /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:56 2012 +0200 @@ -0,0 +1,49 @@ +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; + +/** + * This controller is called to display histograms.<br> + * An attribute 'histogram' on the request object is activated which inserts an + * image calling a histogram output of the server. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +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 :
--- /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:56 2012 +0200 @@ -0,0 +1,161 @@ +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 de.intevation.gnv.util.ArtifactNamespaceContext; +import de.intevation.gnv.util.XMLUtils; +import de.intevation.gnv.util.XSLTransformer; + +import java.util.Locale; +import java.util.ResourceBundle; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import javax.xml.xpath.XPathConstants; + +import org.apache.log4j.Logger; + +import org.apache.struts.Globals; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.w3c.dom.Node; + +/** + * This controller is called to fetch the current artifact description using the + * describe operation. The describe document is used to feed an XSL transformer + * that parses the xml and creats html output representing the parameter panel. + * The html code is stored as attribute on the request object which is queried + * in a jsp page later. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +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); + Locale tmp = sm.getCurrentLocale(); + Locale locale = tmp != null ? tmp : request.getLocale(); + + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory + .getInstance().getArtifactDatabaseClient(locale); + request.getSession().setAttribute(Globals.LOCALE_KEY, locale); + ArtifactObject artifactFactory = sm.getSelectedArtifactFactory(); + + if (artifactFactory == null) { + logger.error("No connection to artifact server."); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + "java.io.ioexception..connection.refused"); + + return super.getExceptionForward(mapping); + } + + ArtifactDescription artifactDescription = + adc.getCurrentStepDescription( + artifactFactory, + sm.getCurrentArtifact(), + true); + + Node currentUI = artifactDescription.getCurrentUI(); + if (currentUI != null) { + ResourceBundle res = ResourceBundle.getBundle( + "applicationMessages", locale); + String editText = res.getString("gnviewer.history.back.button"); + + XSLTransformer transformer = new XSLTransformer(); + + String url = response.encodeURL( + mapping.findForward("back").getPath()); + transformer.addParameter("back-url", url); + transformer.addParameter("edit", editText); + + 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 :
--- /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:56 2012 +0200 @@ -0,0 +1,212 @@ +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; + +/** + * This controller is called to trigger an export (e.g. pdf, svg, image). A + * 'save-file' dialog is opened to save the export. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +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(); + } + + + @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<OutputParameter> inputParameter = outputMode + .getOutputParameters(); + Collection<InputParameter> ips = null; + if (inputParameter != null) { + ips = new ArrayList<InputParameter>(inputParameter.size()); + Iterator<OutputParameter> 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<OutputParameter> inputParameter = outputMode + .getOutputParameters(); + Collection<InputParameter> ips = null; + if (inputParameter != null) { + ips = new ArrayList<InputParameter>(inputParameter.size()); + Iterator<OutputParameter> 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); + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,136 @@ +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; + +/** + * This controller calls the out operation of the server directly. Html img-tags + * in jsp pages use this action to fetch charts and histograms. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +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(); + } + + + @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<OutputParameter> inputParameter = outputMode + .getOutputParameters(); + Collection<InputParameter> ips = null; + if (inputParameter != null) { + ips = new ArrayList<InputParameter>(inputParameter.size()+1); + Iterator<OutputParameter> 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 :
--- /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:56 2012 +0200 @@ -0,0 +1,78 @@ +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.client.exception.ArtifactDatabaseClientException; + +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; + +/** + * This controller fetches artifact factories from artifact server and stores + * them on a <code>SessionModel</code> object. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +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(); + } + + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + log.debug("ArtifactDatabaseActionBase.execute"); + try { + Collection<ArtifactObject> artifactFactories = + ArtifactDatabaseClientFactory.getInstance() + .getArtifactDatabaseClient(getLocale(request)) + .getArtifactFactories(); + + SessionModel sm = SessionModelFactory.getInstance().getSessionModel( + request); + + sm.setArtifacteFactories(artifactFactories); + + return super.execute(mapping, form, request, response); + } + catch (ArtifactDatabaseClientException e) { + log.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + e.getMessage()); + + return super.getExceptionForward(mapping); + } + 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 :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/LoadAction.java Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,167 @@ +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.client.exception.ArtifactDatabaseClientException; + +import de.intevation.gnv.artifactdatabase.objects.Artifact; +import de.intevation.gnv.artifactdatabase.objects.ArtifactFactory; + +import de.intevation.gnv.util.ArtifactNamespaceContext; +import de.intevation.gnv.util.XMLUtils; + +import java.io.IOException; +import java.io.InputStream; + +import java.util.List; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.commons.fileupload.FileItemIterator; +import org.apache.commons.fileupload.FileItemStream; + +import org.apache.commons.fileupload.servlet.ServletFileUpload; + +import org.apache.log4j.Logger; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.w3c.dom.Document; + +/** + * This controller is called for reloading projects from xml files. It waits for + * an xml document named 'document' and feeds the artifact server with this + * document. After a successful feed, the artifact description is fetched and + * displayed in the gui. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +public class LoadAction extends ArtifactDatabaseActionBase { + + public static final String RESOURCE_UPLOAD_FAILURE = "upload.failure"; + public static final String RESOURCE_INVALID_ARTIFACT = "invalid.artifact"; + + private static Logger logger = Logger.getLogger(LoadAction.class); + + public LoadAction() { + super(); + } + + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) + throws Exception + { + logger.info("Import artifact."); + + ServletFileUpload upload = new ServletFileUpload(); + Document artifactDocument = null; + + try { + FileItemIterator iter = upload.getItemIterator(request); + while (iter.hasNext()) { + FileItemStream item = (FileItemStream) iter.next(); + String name = item.getFieldName(); + + // the file input field of our form is named 'document' + if (name.equals("document")) { + InputStream stream = item.openStream(); + + if (stream.available() == 0) { + logger.error("No artifact document found."); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_PROJECT, + RESOURCE_UPLOAD_FAILURE); + + return super.getExceptionForward(mapping); + } + + artifactDocument = XMLUtils.readDocument(stream); + if (artifactDocument == null) { + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_PROJECT, + RESOURCE_INVALID_ARTIFACT); + + return super.getExceptionForward(mapping); + } + + try { + ArtifactDatabaseClientFactory adcf = + ArtifactDatabaseClientFactory.getInstance(); + ArtifactDatabaseClient adc = + adcf.getArtifactDatabaseClient(getLocale(request)); + ArtifactFactory factory = (ArtifactFactory) + (( List)adc.getArtifactFactories()).get(0); + + SessionModelFactory sf = + SessionModelFactory.getInstance(); + SessionModel sm = sf.getSessionModel(request); + sm.selectArtifactFactory(factory.getId()); + + Document describe = adc.doImport( + factory, + artifactDocument); + + String uuid = XMLUtils.xpathString( + describe, + "/art:result/art:uuid/@value", + ArtifactNamespaceContext.INSTANCE); + String hash = XMLUtils.xpathString( + describe, + "/art:result/art:hash/@value", + ArtifactNamespaceContext.INSTANCE); + + Artifact artifact = new Artifact(uuid, hash); + sm.setCurrentArtifact(artifact); + + if (logger.isDebugEnabled()) { + logger.debug( + "Imported artifact UUID: "+artifact.getId()); + logger.debug( + "Imported artifact HASH: "+artifact.getHash()); + } + } + catch (ArtifactDatabaseClientException adce) { + logger.error(adce, adce); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + adce.getMessage()); + + // XXX + return super.getExceptionForward(mapping); + } + + return new DescribeUIAction().execute( + mapping, form, request, response); + } + } + } + catch (IOException ioe) { + logger.error(ioe, ioe); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_PROJECT, + ioe.getMessage()); + + return super.getExceptionForward(mapping); + } + + // no document found or not valid + logger.error("Upload failure: No document found or invalid."); + + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_PROJECT, + RESOURCE_UPLOAD_FAILURE); + + return super.getExceptionForward(mapping); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,166 @@ +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.client.exception.ArtifactDatabaseInputException; + +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.Locale; +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; + +/** + * This controller feeds the artifact server with the current input data and + * refreshes the gui with the current artifact description after the next state + * is reached. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +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(); + + Locale tmp = sm.getCurrentLocale(); + Locale locale = tmp != null ? tmp : request.getLocale(); + + if (ad != null){ + Collection<String> inputParameter = ad.getInputParameter(); + Collection<InputParameter> ips = null; + if (inputParameter != null) { + ips = new ArrayList<InputParameter>(inputParameter.size()); + Iterator<String> 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(locale); + + 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 (ArtifactDatabaseInputException e) { + log.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_INPUT_ID, + e.getMessage()); + } + 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 (ArtifactDatabaseInputException e) { + log.debug("================ CATCH ME ======================"); + log.debug("===== ERROR MSG: " + e.getMessage()); + log.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_INPUT_ID, + e.getMessage()); + } + 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 :
--- /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:56 2012 +0200 @@ -0,0 +1,96 @@ +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; + +/** + * This controller is used to step back to a previous state of the current + * artifact. After calling the advance operation of the artifact server have + * been called successfully, the describe document of the current artifact is + * fetched and a new gui is rendered. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +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 { + + 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 :
--- /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:56 2012 +0200 @@ -0,0 +1,82 @@ +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.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; + +/** + * This controller is called to select a specific fis. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public class SelectArtifactFactoryAction extends DescribeUIAction { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(SelectArtifactFactoryAction.class); + + + @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<ArtifactObject> 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); + + 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() { + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,55 @@ +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; + +/** + * This controller is used to step back to the fis selection. It is called when + * pushing the step-back button besides the currently selected fis. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +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 :
--- /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:56 2012 +0200 @@ -0,0 +1,69 @@ +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.ArtifactStatisticsSet; + +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; + +/** + * This controller is used to display to statistic of the current + * parameterization. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +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<ArtifactStatisticsSet> 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); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/StoreAction.java Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,90 @@ +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.ArtifactObject; + +import java.io.OutputStream; + +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; + +/** + * This controller is used to save the current artifact to an xml file. A file + * dialog is opened to save the file to the local disk. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +public class StoreAction extends ArtifactDatabaseActionBase { + + public static final String RESOURCE_DOWNLOAD_FAILURE = "no.artifact.chosen"; + + private static Logger logger = Logger.getLogger(StoreAction.class); + + public StoreAction() { + super(); + } + + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) + throws Exception + { + SessionModelFactory sf = SessionModelFactory.getInstance(); + SessionModel sm = sf.getSessionModel(request); + + ArtifactDatabaseClientFactory adcf = + ArtifactDatabaseClientFactory.getInstance(); + ArtifactDatabaseClient adc = + adcf.getArtifactDatabaseClient(getLocale(request)); + ArtifactObject artifact = sm.getCurrentArtifact(); + + // no artifact set at the moment (which means, the user didn't select a + // fis yet. + if (artifact == null) { + logger.warn("No artifact/fis selected yet."); + + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_PROJECT, + RESOURCE_DOWNLOAD_FAILURE); + + return super.execute(mapping, form, request, response); + } + + logger.info("Export artifact " + artifact.getId()); + setHeaders(response, artifact.getId()); + + OutputStream out = response.getOutputStream(); + adc.doExport( + sm.getSelectedArtifactFactory(), + artifact, + out); + + out.flush(); + out.close(); + + return null; + } + + protected void setHeaders(HttpServletResponse response, String uuid) { + String filename = "GNVArtefakt_" + uuid + ".xml"; + + response.setHeader("Content-Type", "application/xml"); + response.setHeader( + "Content-Disposition", + "attachment;filename=" + filename); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/SwitchLanguageAction.java Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,62 @@ +package de.intevation.gnv.action; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + +import java.util.Locale; + +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; + +/** + * Toggle the current language used to create the user interface. Two + * languages are available now - german and english. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +public class SwitchLanguageAction extends DescribeUIAction { + + public static Logger logger = Logger.getLogger(SwitchLanguageAction.class); + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response + ) throws Exception + { + SessionModelFactory factory = SessionModelFactory.getInstance(); + SessionModel sm = factory.getSessionModel(request); + + sm.setCurrentLocale(switchLanguage(sm.getCurrentLocale())); + + return super.execute(mapping, form, request, response); + } + + + /** + * This method toggles between german and english language. + * + * @param currentLocale The locale which is currently used. + * @return an english locale, if the current locale is german - otherwise + * a german locale. + */ + protected Locale switchLanguage(Locale currentLocale) { + if (currentLocale.getLanguage().equals(Locale.GERMAN.getLanguage())) { + logger.info("Switch from german to english locale."); + return Locale.ENGLISH; + } + else { + logger.info("Switch from english to german locale."); + return Locale.GERMAN; + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,182 @@ +package de.intevation.gnv.action; + +import de.intevation.gnv.action.sessionmodel.DiagrammOptions; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; + +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.DefaultInputParameter; +import de.intevation.gnv.artifactdatabase.objects.InputParameter; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; +import de.intevation.gnv.artifactdatabase.objects.OutputParameter; + +import de.intevation.gnv.util.XMLUtils; + +import java.text.DateFormat; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Date; +import java.util.Iterator; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import org.w3c.dom.Document; + +/** + * This controller is used to publish the results of the current artifact as + * WMS. The wms export mode of the artifact server is triggered which feeds a + * MapServer with the given shapefiles (path to the shapefiles is stored in the + * artifact). After calling this controller, the shapefiles are ready to be + * queried as WMS layers. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +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()"; + + public static final String XPATH_LAYER_TITLE = + "/art:meta/art:layer/art:title/text()"; + + public static final String XPATH_LAYER_TTL = + "/art:meta/art:layer/art:ttl/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); + + OutputMode outputMode = sm.getOutputMode("wms"); + Collection<InputParameter> ips = null; + if (outputMode != null) { + Collection<OutputParameter> inputParameter = + outputMode.getOutputParameters(); + + if (inputParameter != null) { + ips = new ArrayList<InputParameter>(inputParameter.size()); + Iterator<OutputParameter> it = inputParameter.iterator(); + DiagrammOptions diagrammOptions = new DiagrammOptions(); + + int params = 0; + while (it.hasNext()) { + String name = it.next().getName(); + String[] values = request.getParameterValues(name); + String value = request.getParameter(name); + InputParameter ip = new DefaultInputParameter(name, + encode(values)); + ips.add(ip); + + if (value != null) { + ++params; + diagrammOptions.setValue(name, encode(value)); + } + } + + if (params > 0) { + sm.setDiagrammOptions(diagrammOptions); + } + } + } + + 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,ips); + String mapserverPath = XMLUtils.getStringXPath( + meta, XPATH_MAPSERVER_PATH); + String mapfilePath = XMLUtils.getStringXPath( + meta, XPATH_MAPSERVER_MAPFILE); + String layer = XMLUtils.getStringXPath( + meta, XPATH_LAYER_TITLE); + String tmpTTL = XMLUtils.getStringXPath( + meta, XPATH_LAYER_TTL); + layer = layer != null ? layer : artifact.getId(); + + String ttl = null; + if (tmpTTL != null) { + DateFormat df = DateFormat.getDateTimeInstance( + DateFormat.LONG, + DateFormat.LONG, + request.getLocale()); + + try { + long tmp = Long.parseLong(tmpTTL); + ttl = df.format(new Date(tmp)); + } + catch (NumberFormatException nfe) { + logger.error("Error while parsing time to live."); + logger.error(nfe,nfe); + + ttl = ""; + } + } + + if (logger.isDebugEnabled()) { + logger.debug("Mapserver path: " + mapserverPath); + logger.debug("Mapfile path: " + mapfilePath); + logger.debug("Layer title: " + layer); + logger.debug("Layer ttl: " + ttl); + } + + request.setAttribute("wms", true); + request.setAttribute("mapserver", mapserverPath); + request.setAttribute("mapfile", mapfilePath); + request.setAttribute("layer", layer); + request.setAttribute("ttl", ttl); + if (mapserverPath != null && + mapfilePath != null && + layer != null){ + request.setAttribute("wms_published", Boolean.TRUE); + return super.execute(mapping, form, request, response); + }else{ + return super.getExceptionForward(mapping); + } + } + 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 :
--- /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:56 2012 +0200 @@ -0,0 +1,115 @@ +package de.intevation.gnv.action.mapviewer; + +import de.intevation.gnv.action.ArtifactDatabaseActionBase; + +import de.intevation.gnv.action.mapviewer.parser.ExternalCallParser; +import de.intevation.gnv.action.mapviewer.parser.XMLExternalCallParser; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; + +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; + +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + +import java.io.ByteArrayInputStream; +import java.io.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; + +/** + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +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<MapService> mapServices = ecp.getMapServices(); + + Collection<ArtifactObject> availableFactories = + ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)) + .getArtifactFactoryMetaInformation(mapServices, + geometry, + srs); + + Collection<ArtifactObject> providedFactories = + ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)) + .getArtifactFactories(); + + // Sort out which ArtifactFactories should not be used. + Collection<ArtifactObject> usedFactories = + new ArrayList<ArtifactObject>(availableFactories.size()); + + Iterator<ArtifactObject> 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); + } + +}
--- /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:56 2012 +0200 @@ -0,0 +1,40 @@ +package de.intevation.gnv.action.mapviewer; + +import de.intevation.gnv.action.ArtifactDatabaseActionBase; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +/** + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +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); + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/package.html Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,8 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body> +DOCUMENT ME! +</body> +</html>
--- /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:56 2012 +0200 @@ -0,0 +1,20 @@ +package de.intevation.gnv.action.mapviewer.parser; + +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + +import java.util.Collection; + +/** + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public interface ExternalCallParser { + + + String getGeometry(); + + String getSRS(); + + Collection<MapService> getMapServices(); + + void parse() throws ExternalCallParserException; +}
--- /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:56 2012 +0200 @@ -0,0 +1,45 @@ +package de.intevation.gnv.action.mapviewer.parser; + +/** + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +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); + } + +}
--- /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:56 2012 +0200 @@ -0,0 +1,153 @@ +package de.intevation.gnv.action.mapviewer.parser; + +import de.intevation.gnv.artifactdatabase.objects.map.DefaultLayer; +import de.intevation.gnv.artifactdatabase.objects.map.DefaultMapService; +import de.intevation.gnv.artifactdatabase.objects.map.Layer; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + +import de.intevation.gnv.util.XMLUtils; + +import java.io.InputStream; + +import java.util.ArrayList; +import java.util.Collection; + +import org.apache.log4j.Logger; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +/** + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +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<MapService> 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<MapService> 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<MapService>(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> layer = null; + if (layerNodes != null && layerNodes.getLength() > 0){ + layer = new ArrayList<Layer>(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<Layer> extractLayer(Collection<Layer> 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; + } + +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/package.html Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,8 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body> +DOCUMENT ME! +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/package.html Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,8 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body> +Controller triggered after user interactions. +</body> +</html>
--- /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:56 2012 +0200 @@ -0,0 +1,165 @@ +package de.intevation.gnv.action.sessionmodel; + +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Locale; + +import org.apache.log4j.Logger; + +/** + * The default implementation of <code>SessionModel</code> which stores the + * current artifact object and the digram options selected by the user. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +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<ArtifactObject> artifactFactories = null; + + private ArtifactObject selectedArtifactFactory = null; + + private ArtifactObject currentArtifact = null; + + private DiagrammOptions diagrammOptions = null; + + private Collection<ArtifactStatisticsSet> statistics = null; + + private Locale currentLocale; + + /** + * Constructor + */ + public DefaultSessionModel() { + this(null); + } + + /** + * Constructor + * + * @param currentLocale A locale used to create the user interface. + */ + public DefaultSessionModel(Locale currentLocale) { + this.currentLocale = currentLocale; + } + + + public void selectArtifactFactory(String artiFactFactoryId) { + Collection<ArtifactObject> artifactObjects = this + .getArtifactFactories(); + if (artifactObjects != null) { + Iterator<ArtifactObject> unselect = artifactObjects.iterator(); + this.selectedArtifactFactory = null; + while (unselect.hasNext()) { + unselect.next().setSelected(false); + } + Iterator<ArtifactObject> it = artifactObjects.iterator(); + while (it.hasNext()) { + ArtifactObject obj = it.next(); + if (obj.getId().equals(artiFactFactoryId)) { + obj.setSelected(true); + this.selectedArtifactFactory = obj; + break; + } + } + } + } + + + public void setArtifacteFactories( + Collection<ArtifactObject> artifactFactories) { + this.artifactFactories = artifactFactories; + } + + + public Collection<ArtifactObject> getArtifactFactories() { + return this.artifactFactories; + } + + + public ArtifactObject getSelectedArtifactFactory() { + return this.selectedArtifactFactory; + } + + + public ArtifactObject getCurrentArtifact() { + return this.currentArtifact; + } + + + public void setCurrentArtifact(ArtifactObject artifact) { + this.currentArtifact = artifact; + } + + + public DiagrammOptions getDiagrammOptions() { + return this.diagrammOptions; + } + + + public void setDiagrammOptions(DiagrammOptions diagrammOptions) { + this.diagrammOptions = diagrammOptions; + } + + + public ArtifactDescription getArtifactDescription() { + if (this.currentArtifact != null) { + return (ArtifactDescription) this.currentArtifact; + } + return null; + } + + + public OutputMode getOutputMode(String name) { + ArtifactDescription ad = this.getArtifactDescription(); + if (ad != null) { + if (ad.getOutputModes() != null) { + return ad.getOutputModes().get(name); + } + } + return null; + } + + + public void resetModel() { + log.debug("DefaultSessionModel.resetModel"); + this.selectedArtifactFactory = null; + this.currentArtifact = null; + this.diagrammOptions = null; + this.statistics = null; + + } + + + public Collection<ArtifactStatisticsSet> getStatistics() { + return this.statistics; + } + + public void setStatistics(Collection<ArtifactStatisticsSet> statistics) { + this.statistics = statistics; + } + + public Locale getCurrentLocale() { + return currentLocale; + } + + public void setCurrentLocale(Locale currentLocale) { + this.currentLocale = currentLocale; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,41 @@ +package de.intevation.gnv.action.sessionmodel; + +import java.util.HashMap; +import java.util.Map; + +/** + * Stores key-value pairs used to save user input for changing diagram + * attributes. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public class DiagrammOptions { + + private Map<String, String> values = new HashMap<String, String>(); + + /** + * Constructor + */ + public DiagrammOptions() { + super(); + } + + /** + * @return the value. + */ + public String getValue(String key) { + return this.values.get(key); + } + + + /** + * Set a value with the given key. + * + * @param key The given key. + * @param value The value to be stored. + */ + public void setValue(String key, String value) { + this.values.put(key, value); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,52 @@ +package de.intevation.gnv.action.sessionmodel; + +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; + +import java.io.Serializable; + +import java.util.Collection; +import java.util.Locale; + +/** + * This interface describe basic methods to store artifacts and diagram options. + * The SessionModel is saved in the session, which keeps alive during the work. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +public interface SessionModel extends Serializable { + + Collection<ArtifactObject> getArtifactFactories(); + + void setArtifacteFactories(Collection<ArtifactObject> 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<ArtifactStatisticsSet> statistics); + + Collection<ArtifactStatisticsSet> getStatistics(); + + void setCurrentLocale(Locale locale); + + Locale getCurrentLocale(); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,65 @@ +package de.intevation.gnv.action.sessionmodel; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.log4j.Logger; + +/** + * Creates and restores <code>SessionModel</code> objects from <code> + * HttpServletRequest</code>. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +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.getLocale()); + request.getSession().setAttribute(SESSION_MODEL_ID, sm); + } + + return sm; + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/package.html Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,9 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body> +Store important values in the session using classes and interfaces in this +package. +</body> +</html>
--- /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:56 2012 +0200 @@ -0,0 +1,227 @@ +package de.intevation.gnv.artifactdatabase.client; + +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseInputException; + +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; +import de.intevation.gnv.artifactdatabase.objects.InputParameter; + +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + +import java.io.IOException; +import java.io.OutputStream; + +import java.util.Collection; +import java.util.Locale; + +import org.w3c.dom.Document; + +/** + * This interface describes basic methods for the communication between artifact + * server and this client. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +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 if a general error occured in the + * artifact server. + * @throws ArtifactDatabaseInputException if the input data was valid. + */ + public Collection<ArtifactObject> getArtifactFactories() + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; + + /** + * Call the create operation of the artifact server and returns a new + * artifact with the information returned by the artifact server. + * + * @param artifactFactory + * @return the new Artifact + * @throws ArtifactDatabaseClientException if a general error occured in the + * artifact server. + * @throws ArtifactDatabaseInputException if the input data was valid. + */ + public ArtifactObject createNewArtifact(ArtifactObject artifactFactory) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; + + /** + * Call the describe operation of the artifact server. + * + * @param artifactFactory + * @param currentArtifact + * @param includeUI + * @return the Current Artifact + * @throws ArtifactDatabaseClientException if a general error occured in the + * artifact server. + * @throws ArtifactDatabaseInputException if the input data was valid. + */ + public ArtifactDescription getCurrentStepDescription( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + boolean includeUI) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; + + /** + * + * @param artifactFactory + * @param currentArtifact + * @param target + * @param inputParameter + * @return the artifact description. + * @throws ArtifactDatabaseClientException if a general error occured in the + * artifact server. + * @throws ArtifactDatabaseInputException if the input data was valid. + */ + public ArtifactDescription doNextStep( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + String target, + Collection<InputParameter> inputParameter) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; + + public void doAdvance( + ArtifactObject factory, + ArtifactObject artifact, + String target) + throws IOException, ArtifactDatabaseClientException, ArtifactDatabaseInputException; + + /** + * @param artifactFactory + * @param currentArtifact + * @param inputParameter + * @throws ArtifactDatabaseClientException if a general error occured in the + * artifact server. + * @throws ArtifactDatabaseInputException if the input data was valid. + */ + public void doFeed(ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + Collection<InputParameter> inputParameter) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; + + /** + * Call the out operation of the artifact server. + * + * @param artifactFactory + * @param currentArtifact + * @param stream + * @param targetName + * @param exportMode + * @param mimeType + * @param inputParameter + * @throws ArtifactDatabaseClientException + */ + public void doOutput( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + OutputStream stream, + String targetName, + String exportMode, + String mimeType, + Collection<InputParameter> inputParameter) + throws ArtifactDatabaseClientException; + + + /** + * Write the current artifact to an xml file. + * + * @param artifactFactory + * @param currentArtifact + * @param out + * @throws ArtifactDatabaseClientException + */ + public void doExport( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + OutputStream out) + throws ArtifactDatabaseClientException; + + + /** + * Import an artifact from xml file. + * + * @param factory + * @param document + * @return a status message. If the import was successful, it contains + * information about the imported artifact, otherwise a failure is + * contained. + * @throws ArtifactDatabaseClientException + * @throws IOException + */ + public Document doImport( + ArtifactFactory factory, + Document document) + throws ArtifactDatabaseClientException, IOException; + + /** + * Publish shapefiles of an artifact as WMS layer. + * + * @param factory + * @param artifact + * @param inputParameter + * @return URL to wms service as string + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException + */ + public Document publishWMS( + ArtifactObject factory, + ArtifactObject artifact, + Collection<InputParameter> inputParameter + )throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; + + + /** + * Start statistics calculation. + * + * @param artifactFactory + * @param currentArtifact + * @return the calculated statistic. + * @throws ArtifactDatabaseClientException + */ + public Collection<ArtifactStatisticsSet> calculateStatistics( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact) + throws ArtifactDatabaseClientException; + + /** + * Set the current locale. + * @param locale + */ + public void setLocale(Locale locale); + + /** + * Get the current locale. + * @return the current locale. + */ + public Locale getLocale(); + + /** + * Returns some meta information about the currently selected + * ArtifactFactory. + * + * @param mapServices + * @param geometry + * @param srs + * @return the information. + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException + */ + public Collection<ArtifactObject> getArtifactFactoryMetaInformation( + Collection<MapService> mapServices, + String geometry, + String srs) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; + +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,57 @@ +package de.intevation.gnv.artifactdatabase.client; + +import java.util.Locale; + +import org.apache.log4j.Logger; + +/** + * Used to start a session with a new artifact. A new + * <code>DefaultArtifactDatabaseClient</code> is created. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +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; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,1129 @@ +package de.intevation.gnv.artifactdatabase.client; + +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseInputException; + +import de.intevation.gnv.artifactdatabase.objects.Artifact; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactFactory; +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; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import org.apache.log4j.Logger; + +import org.restlet.Client; + +import org.restlet.data.ClientInfo; +import org.restlet.data.Language; +import org.restlet.data.Method; +import org.restlet.data.Preference; +import org.restlet.data.Protocol; +import org.restlet.data.Request; +import org.restlet.data.Response; + +import org.restlet.representation.Representation; +import org.restlet.representation.StringRepresentation; + +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +/** + * The default implementation of <code>ArtifactDatabaseClient</code> which + * implements methods to communicate via HTTP protocol with the artifact server. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +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"; + + /** + * Xpath expression to get general exception messages related to server + * errors. + */ + public static final String EXCEPTION_GENERAL = + "/art:exceptionreport/art:exception/text()"; + + /** + * Xpath expression to get exception messages related to invalid user input. + */ + public static final String EXCEPTION_USER_INPUT = + "/art:exceptionreport/art:exception/art:input/text()"; + + /** + * 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<String> artifactDatabases = null; + + /** + * Is the Class initialized? + */ + private static boolean initialized = false; + + /** + * Request locale + */ + private Locale locale; + + + /** + * Constructor + */ + public DefaultArtifactDatabaseClient() { + + } + + public Collection<ArtifactObject> getArtifactFactories() + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { + Collection<ArtifactObject> resultValues = null; + if (!initialized) { + this.initialize(); + } + try { + log.debug("DefaultArtifactDatabaseClient.getArtifactFactories"); + Iterator<String> 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; + } + + + /** + * Returns a collection of artifact factories retrieved by <i>server</i>. + * + * @param document + * @param server + * @param geometry + * @return a collection of factories. + */ + private Collection<ArtifactObject> getArtifactFactories(Document document, + String server, + String geometry) { + NodeList artifactFactories = XMLUtils.getNodeSetXPath(document, + "/art:result/art:factories/art:factory"); + Collection<ArtifactObject> resultValues = new ArrayList<ArtifactObject>( + 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<String> parameters = + new ArrayList<String>(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<String> geometryList = new ArrayList<String>(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; + } + + + private Document doGetRequest(String requestUrl) + throws IOException, ArtifactDatabaseClientException, ArtifactDatabaseInputException { + return this.doGetRequest(requestUrl, null); + } + + + private Document doGetRequest(String requestUrl, Document requestBody) + throws IOException, ArtifactDatabaseClientException, ArtifactDatabaseInputException { + 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); + } + + /** + * Initialize the <code>ClientInfo</code> object of <i>request</i> with the + * given <i>locale</i>. + * + * @param request The request object. + * @param locale The locale. + * @return the prepared request object. + */ + protected Request initialize(Request request, Locale locale) { + if (locale != null) { + ClientInfo clientInfo = request.getClientInfo(); + String lang = locale.getLanguage(); + Language language = new Language(lang); + List<Preference<Language>> acceptedLanguages = + new ArrayList<Preference<Language>>(2); + acceptedLanguages.add(new Preference(language, 1.0f)); + acceptedLanguages.add(new Preference(Language.ALL, 0.5f)); + clientInfo.setAcceptedLanguages(acceptedLanguages); + } + return request; + } + + + 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 = 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; + } + + + private InputStream doPostRequest(String requestUrl, Document requestBody) + throws IOException { + Client client = new Client(Protocol.HTTP); + Request request = initialize(new Request(Method.POST, requestUrl)); + String documentBody = 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<String>(count); + for (int i = 0; i < count; i++) { + artifactDatabases.add(pr.getPropertieValue( + ARTIFACTDATABASE_URL_ID + "." + (i + 1), "N/N")); + } + initialized = true; + } + + } + + + /** + * Creates a new artifact with the given <i>artifactFactory</i>. A POST call + * is sent to the artifact server which creates a new artifact. + * + * @param artifactFactory The artifact factory used to create a new + * artifact. + * @return the created artifact of the artifact server. + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException + */ + public ArtifactObject createNewArtifact(ArtifactObject artifactFactory) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { + + 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); + } + } + + /** + * Returns a new artifact defined by uuid and hash values of the document + * returned by the artifact server after creating a new artifact. + * + * @param document Contains information about the server-side created + * artifact. + * @return a new artifact object. + */ + 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 = 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<String, Collection<String>> parameterMap = + ((ParametrizedArtifactObject)artifactFactory).getParameters(); + if (parameterMap != null && !parameterMap.isEmpty() ){ + Iterator<String> keyIt = parameterMap.keySet().iterator(); + while (keyIt.hasNext()){ + String key = keyIt.next(); + Iterator<String> 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; + } + + + private Element createArtifactElement(Document document, String name) { + XMLUtils.ElementCreator creator = new XMLUtils.ElementCreator( + document, + NAMESPACE_URI, + NAMESPACE_PREFIX + ); + + return creator.create(name); + } + + + private Document doPostRequest(ArtifactObject artifactFactory, + Document request, String suburl) + throws IOException, ArtifactDatabaseClientException, ArtifactDatabaseInputException { + 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; + } + + + /** + * Retrieve the current artifact description after calling the describe + * operation of the artifact server. + * + * @param artifactFactory + * @param currentArtifact + * @param includeUI Set this option to true, if the user interface + * description is required. + * @return the artifact description. + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException + */ + public ArtifactDescription getCurrentStepDescription( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + boolean includeUI) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { + try { + String url = this.getArtifactUrl(artifactFactory, currentArtifact); + Document request = this.createDescribeRequestBody(currentArtifact, + includeUI); + InputStream describeResult = this.doPostRequest(url, request); + + return this.readDescription(XMLUtils.readDocument(describeResult), + currentArtifact); + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + } + + + private Document createDescribeRequestBody(ArtifactObject currentArtifact, + boolean includeUI){ + Document document = 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; + } + + + 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, ArtifactDatabaseInputException { + // Check if there was an Error or Exception reported from the + // ArtifactDatabase + this.check4ExceptionReport(document); + 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<String, OutputMode> outputModes = null; + if (outputNode != null) { + NodeList outputModesNodes = XMLUtils.getNodeSetXPath( + outputNode, "art:output"); + if (outputModesNodes != null) { + outputModes = new HashMap<String, OutputMode>( + 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<OutputParameter> parameter = null; + if (parameterNodes != null) { + parameter = new ArrayList<OutputParameter>( + 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<String, ExportMode>(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<String> reachableStates = new ArrayList<String>( + 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<String> inputParameter = new ArrayList<String>( + 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"); + } + + } + + + /** + * Feed, advance and describe in one single method. + * + * @param artifactFactory The factory which created the current artifact. + * @param currentArtifact The current artifact. + * @param target The target state for advance. + * @param inputParameter Input data for feed. + * @return the artifact description after calling feed and advance. + * @throws ArtifactDatabaseClientException if a general error occured in + * the artifact server. + * @throws ArtifactDatabaseInputException if the input data was invalid used + * for feed. + */ + public ArtifactDescription doNextStep( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + String target, + Collection<InputParameter> inputParameter) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { + + 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); + } + } + + + /** + * Call the advance operation of the artifact server to step to the next + * step of the parameterization. + * + * @param factory The artifact factory which created the current artifact. + * @param artifact The current artifact. + * @param target The target state. + * @throws IOException if an error occured while reading/writing from/to + * stream. + * @throws ArtifactDatabaseClientException if a general error occured in + * the artifact server. + * @throws ArtifactDatabaseInputException if the input data was invalid. + */ + public void doAdvance( + ArtifactObject factory, + ArtifactObject artifact, + String target) + throws IOException, ArtifactDatabaseClientException, ArtifactDatabaseInputException { + String url = getArtifactUrl(factory, artifact); + Document advanceDocument = createAdvanceRequestBody(artifact, target); + InputStream advanceResult = doPostRequest(url, advanceDocument); + check4ExceptionReport(XMLUtils.readDocument(advanceResult)); + } + + private Document createFeedRequestBody( + ArtifactObject currentArtifact, + Collection<InputParameter> inputParameter) { + Document document = 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; + } + + + private Node createParameterNodes( + Collection<InputParameter> inputParameter, + Document document, String nodeName) { + Element dataNode = this.createArtifactElement(document, nodeName); + + if (inputParameter != null) { + Iterator<InputParameter> 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; + } + + + /** + * Creates the xml body for the advance request. + * + * @param currentArtifact + * @param target + * @return the advance xml document. + */ + private Document createAdvanceRequestBody(ArtifactObject currentArtifact, + String target) { + Document document = 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; + } + + /** + * Call the out operation of the artifact server and writes the result to + * <i>stream</i>. + * + * @param exportMode + * @param inputParameter + */ + public void doOutput( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + OutputStream stream, + String targetName, + String exportMode, + String mimeType, + Collection<InputParameter> 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); + } + } + + + /** + * Call the out method of the artifact server with a specific export mode. + * + * @param artifactFactory + * @param currentArtifact + * @param out + * @throws ArtifactDatabaseClientException if an error occured while + * reading/writing from/to stream. + */ + public void doExport( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + OutputStream out) + throws ArtifactDatabaseClientException + { + InputStreamReader reader = null; + OutputStreamWriter writer = null; + + try { + String url = ((ArtifactFactory) artifactFactory).getDataBaseUrl(); + url += "/export/" + currentArtifact.getId(); + + Representation response = doGetRequestInternal(url, null); + InputStream in = response.getStream(); + + reader = new InputStreamReader(in); + writer = new OutputStreamWriter(out); + + int c; + char[] buffer = new char[512]; + while ((c = reader.read(buffer)) > 0) { + writer.write(buffer, 0, c); + } + + } + catch (Exception e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + finally { + try { + reader.close(); + } catch (IOException ioe) {} + + try { + writer.flush(); + } catch (IOException ioe) {} + + try { + writer.close(); + } catch (IOException ioe) {} + } + } + + + /** + * Start to import an artifact from xml document. + * + * @param factory + * @param document The artifact as xml document. + * @return A status description of the operation (success or failure). + * @throws ArtifactDatabaseClientException + * @throws IOException + */ + public Document doImport( + ArtifactFactory factory, + Document document) + throws ArtifactDatabaseClientException, IOException + { + String url = factory.getDataBaseUrl() + "/import"; + InputStream response = doPostRequest(url, document); + + return XMLUtils.readDocument(response); + } + + + /** + * Creates the xml request body used for an out-call of the artifact server. + * + * @param currentArtifact + * @param target + * @param exportMode + * @param mimeType + * @param inputParameter + * @return the request body. + */ + private Document createOutRequestBody( + ArtifactObject currentArtifact, + String target, + String exportMode, + String mimeType, + Collection<InputParameter> inputParameter) + { + Document document = 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; + } + + + /** + * Calls the feed operation of the artifact server. + * + * @param artifactFactory The artifact factory which created the current + * artifact. + * @param currentArtifact The current artifact. + * @param inputParameter The user input. + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException + */ + public void doFeed( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + Collection<InputParameter> inputParameter) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { + + try { + Document feedDocument = this.createFeedRequestBody(currentArtifact, + inputParameter); + String url = this.getArtifactUrl(artifactFactory, currentArtifact); + InputStream feedResult = this.doPostRequest(url, feedDocument); + Document feedResultDocument = XMLUtils + .readDocument(feedResult); + this.check4ExceptionReport(feedResultDocument); + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + } + + private void check4ExceptionReport(Document document) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { + String message = XMLUtils.getStringXPath(document, + EXCEPTION_GENERAL); + if (message != null) { + throw new ArtifactDatabaseClientException(message); + } + + String input = XMLUtils.getStringXPath(document, EXCEPTION_USER_INPUT); + if (input != null) { + throw new ArtifactDatabaseInputException(input); + } + } + + + /** + * Call the specific wms export mode of the out operation of the artifact + * server. + * + * @param factory + * @param artifact + * @param inputParameter + * @return a document that contains information about the wms service and + * the created layer. + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException + */ + public Document publishWMS( + ArtifactObject factory, + ArtifactObject artifact, + Collection<InputParameter> inputParameter + ) throws ArtifactDatabaseClientException, ArtifactDatabaseInputException{ + log.debug("Start wms publishing..."); + + String target = "wms"; + String requestURL = getArtifactUrl(factory, artifact) + "/" + target; + Document request = createOutRequestBody( + artifact, target, "", "text/xml", inputParameter); + try { + InputStream input = doPostRequest(requestURL, request); + Document result = XMLUtils.readDocument(input); + this.check4ExceptionReport(result); + return result; + } + catch (IOException ioe) { + log.error(ioe, ioe); + throw new ArtifactDatabaseClientException(ioe); + } + } + + + public Collection<ArtifactStatisticsSet> calculateStatistics( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact) + throws ArtifactDatabaseClientException + { + log.debug("DefaultArtifactDatabaseClient.calculateStatistics"); + Collection<ArtifactStatisticsSet> 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<ArtifactStatisticsSet> + (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; + } + + public Locale getLocale() { + return locale; + } + + + public Collection<ArtifactObject> getArtifactFactoryMetaInformation( + Collection<MapService> mapServices, + String geometry, + String srs) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { + log.debug("DefaultArtifactDatabaseClient.getArtifactFactories"); + Collection<ArtifactObject> resultValues = null; + try { + this.initialize(); + Iterator<String> 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<ArtifactObject> parseMetaDataResult( + InputStream inputStream, + String server, + String geometry) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { + XMLUtils xmlUtils = new XMLUtils(); + Document document = XMLUtils.readDocument(inputStream); + this.check4ExceptionReport(document); + return this.getArtifactFactories(document, server,geometry); + } + + private Document createMetaDataRequestBody(Collection<MapService> mapServices, + String geometry, + String srs){ + log.debug("DefaultArtifactDatabaseClient.createMetaDataRequestBody"); + Document document = 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<MapService> 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> 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; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,51 @@ +package de.intevation.gnv.artifactdatabase.client.exception; + +/** + * Exception used for general errors in the artifact server. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +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); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseInputException.java Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,51 @@ +package de.intevation.gnv.artifactdatabase.client.exception; + +/** + * Exception used if an error occured caused by invalid input. + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +public class ArtifactDatabaseInputException extends Exception { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = -8979622024425251952L; + + /** + * Constructor + */ + public ArtifactDatabaseInputException() { + super(); + } + + /** + * Constructor + * + * @param arg0 + */ + public ArtifactDatabaseInputException(String arg0) { + super(arg0); + } + + /** + * Constructor + * + * @param arg0 + */ + public ArtifactDatabaseInputException(Throwable arg0) { + super(arg0); + } + + /** + * Constructor + * + * @param arg0 + * @param arg1 + */ + public ArtifactDatabaseInputException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/package.html Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,8 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body> +Exceptions that are thrown if server side errors occur. +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/package.html Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,9 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body> +The communication between this client and an artifact server is defined in the +classes and interfaces of this package. +</body> +</html>
--- /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:56 2012 +0200 @@ -0,0 +1,141 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.Collection; +import java.util.Map; + +import org.w3c.dom.Node; + +/** + * An <code>ArtifactObject</code> representing an artifact. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +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<String> reachableStates; + private Collection<String> inputParameter; + private Map<String, OutputMode> outputModes; + private String currentState = null; + + + public Node getCurrentUI() { + return currentUI; + } + + + public void setCurrentUI(Node currentUI) { + this.currentUI = currentUI; + } + + + public Node getCurrentOut() { + return currentOut; + } + + + public void setCurrentOut(Node currentOut) { + this.currentOut = currentOut; + } + + + public Collection<String> getReachableStates() { + return reachableStates; + } + + + public void setReachableStates(Collection<String> reachableStates) { + this.reachableStates = reachableStates; + } + + + public String getCurrentState() { + return currentState; + } + + + public void setCurrentState(String currentState) { + this.currentState = currentState; + } + + /** + * Constructor + */ + public Artifact(String uuid, String hash) { + + this.id = uuid; + this.hash = hash; + } + + + public String getHash() { + return this.hash; + } + + + public String getDescription() { + return this.id; + } + + + public String getId() { + return this.id; + } + + + public String getName() { + return this.id; + } + + + public boolean isSelected() { + return this.selected; + } + + + public void setSelected(boolean selected) { + this.selected = selected; + } + + + public Collection<String> getInputParameter() { + return this.inputParameter; + } + + + public void setInputParameter(Collection<String> inputParameter) { + this.inputParameter = inputParameter; + } + + + public Map<String, OutputMode> getOutputModes() { + return this.outputModes; + } + + + public Collection<OutputMode> getOutputModesAsCollection() { + if (this.outputModes != null) { + return this.outputModes.values(); + } + return null; + } + + + public void setOutputModes(Map<String, OutputMode> outputModes) { + this.outputModes = outputModes; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,102 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +import java.util.Collection; +import java.util.Map; + +import org.w3c.dom.Node; + +/** + * This interface describes basic methods to describe the user interface of an + * artifact. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public interface ArtifactDescription extends Serializable { + + /** + * Retrieves the xml node of the current user interface. + * + * @return the currentUI + */ + public Node getCurrentUI(); + + /** + * Set the xml node of the current user interface. + * + * @param currentUI the currentUI to set + */ + public void setCurrentUI(Node currentUI); + + /** + * Set the xml node of the possible output modes. + * + * @param currentOut the currentOut to set + */ + public void setCurrentOut(Node currentOut); + + /** + * Retrieves a collection of reachable states. + * + * @return the reachableStates + */ + public Collection<String> getReachableStates(); + + /** + * Set the reachable states. + * + * @param reachableStates the reachableStates to set + */ + public void setReachableStates(Collection<String> reachableStates); + + /** + * Retrieves the current state. + * + * @return the currentState + */ + public String getCurrentState(); + + /** + * Set the current state. + * + * @param currentState the currentState to set + */ + public void setCurrentState(String currentState); + + /** + * Get a collection of input parameters. + * + * @return the reachableStates + */ + public Collection<String> getInputParameter(); + + /** + * Set a collection of input parameters. + * + * @param inputParameter + */ + public void setInputParameter(Collection<String> inputParameter); + + /** + * Retrieves a map of available output modes. + * + * @return the available output modes. + */ + public Map<String, OutputMode> getOutputModes(); + + /** + * Retrieves a collection of available output modes. + * + * @return the available output modes. + */ + public Collection<OutputMode> getOutputModesAsCollection(); + + /** + * Set the available output modes. + * + * @param outputModes A map that contains output modes. + */ + public void setOutputModes(Map<String, OutputMode> outputModes); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,92 @@ +package de.intevation.gnv.artifactdatabase.objects; + +/** + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +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; + + /** + * Returns the url of the artifact server. + * + * @return the dataBaseUrl + */ + public String getDataBaseUrl() { + return dataBaseUrl; + } + + /** + * Constructor + * @param name the name of the factory + * @param description the description of the Factory + * @param dataBaseUrl the URL where the Factory could be reached. + */ + public ArtifactFactory(String name, String description, String dataBaseUrl) { + super(); + this.name = name; + this.description = description; + this.dataBaseUrl = dataBaseUrl; + } + + + public String getId() { + return this.name; + } + + + public boolean isSelected() { + + return this.selected; + } + + + public void setSelected(boolean selected) { + this.selected = selected; + } + + + public String getName() { + return name; + } + + + public String getDescription() { + return description; + } + + + public String getHash() { + return null; + } + + /** + * Two ArtifactFactories are equal, if the name and the url to the artifact + * server are equal. + * + * @param obj + * @return true, if the factories are equal - otherwise false. + */ + @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; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,54 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * The <code>ArtifactObject</code> provides some information about an artifact. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public interface ArtifactObject extends Serializable { + + /** + * Retrieves the id of this object. + * + * @return the id. + */ + public String getId(); + + /** + * Retrieves information about the selection state of this object. + * + * @return true, if this object is selected - otherwise false. + */ + public boolean isSelected(); + + /** + * Set the selection of this object. + * + * @param selected the new selection. + */ + public void setSelected(boolean selected); + + /** + * Retrieves the name of this object. + * + * @return the name. + */ + public String getName(); + + /** + * Retrieves the description of the object. + * + * @return the description. + */ + public String getDescription(); + + /** + * Retrieves the hash value of this object. + * + * @return the hash value. + */ + public String getHash(); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,25 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * This is the Interfacedefinition for Statistic values that belongs + * to an Artifact. + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +public interface ArtifactStatisticValue extends Serializable { + + /** + * Returns the Key of the Object + * @return the Key of the Object + */ + String getKey(); + + /** + * Returns the stored Value + * @return the stored Value + */ + String getValue(); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,35 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +import java.util.Collection; + +/** + * An inteface description for a container storing statistics. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public interface ArtifactStatisticsSet extends Serializable { + + /** + * Retrieves the name of this container. + * + * @return the name. + */ + String getName(); + + /** + * Retrieves the statistics as collection. + * + * @return the statistics. + */ + Collection<ArtifactStatisticValue> getStatisticValues(); + + /** + * Add a new statistic to this container. + * + * @param value A statistic. + */ + void addStatisticValues(ArtifactStatisticValue value); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,37 @@ +package de.intevation.gnv.artifactdatabase.objects; + +/** + * The Defaultimplementation of <code>ArtifactStatisticValue</code> + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +public class DefaultArtifactStatisticValue implements ArtifactStatisticValue { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = -8409111023127835398L; + + private String key = null; + + private String value = null; + + /** + * Constructor + * @param key the key of the new Value + * @param value the value of the Object. + */ + 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; + } +}
--- /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:56 2012 +0200 @@ -0,0 +1,45 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * The default implementation of <code>ArtifactStatisticsSet</code>. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +public class DefaultArtifactStatisticsSet implements ArtifactStatisticsSet{ + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 6738878381515708602L; + + private String name = null; + + private Collection<ArtifactStatisticValue> statisticValues = + new ArrayList<ArtifactStatisticValue>(); + /** + * Constructor + */ + public DefaultArtifactStatisticsSet(String name) { + this.name = name; + } + + + public void addStatisticValues(ArtifactStatisticValue value) { + this.statisticValues.add(value); + } + + + public String getName() { + return this.name; + } + + + public Collection<ArtifactStatisticValue> getStatisticValues() { + return this.statisticValues; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 :
--- /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:56 2012 +0200 @@ -0,0 +1,43 @@ +package de.intevation.gnv.artifactdatabase.objects; + +/** + * This is the default implementation of <code>ExportMode</code> which stores + * information about a specific output target (e.g. pdf, svg, image). + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +public class DefaultExportMode +implements ExportMode +{ + protected String name; + protected String description; + protected String mimeType; + + /** + * Creates a new <code>ExportMode</code>. + * + * @param name The name of the mode. + * @param description A description of this mode. + * @param mimeType The mimetype used for this mode. + */ + 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 :
--- /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:56 2012 +0200 @@ -0,0 +1,37 @@ +package de.intevation.gnv.artifactdatabase.objects; + +/** + * The default implementation of <code>InputParameter</code>. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +public class DefaultInputParameter implements InputParameter { + + private static final long serialVersionUID = 6597439837482244211L; + + private String name = null; + + private String[] values = null; + + /** + * Constructor + * + * @param name The name of this parameter. + * @param values The values of this parameter. + */ + public DefaultInputParameter(String name, String[] values) { + super(); + this.name = name; + this.values = values; + } + + public String getName() { + return this.name; + } + + public String[] getValues() { + return this.values; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,55 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.Collection; +import java.util.Map; + +/** + * The default implementation of an <code>OutputMode</code>. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +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> outputParameter = null; + + private Map<String, ExportMode> exports; + + public DefaultOutputMode( + String name, + String mimeType, + Collection<OutputParameter> outputParameter, + Map<String, ExportMode> exports) + { + super(); + this.name = name; + this.mimeType = mimeType; + this.outputParameter = outputParameter; + this.exports = exports; + } + + public String getMimeType() { + return this.mimeType; + } + + public String getName() { + return this.name; + } + + public Collection<OutputParameter> getOutputParameters() { + return this.outputParameter; + } + + public ExportMode getExportMode(String mode) { + return exports.get(mode); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,55 @@ +package de.intevation.gnv.artifactdatabase.objects; + +/** + * The default implementation of <code>OutputParameter</code>. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +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; + } + + public String getName() { + return this.name; + } + + public String getValue() { + return this.value; + } + + public String getDescription() { + return this.description; + } + + public String getType() { + return this.type; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,35 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * An <code>ExportMode</code> describes a specific format of an output mode + * (e.g. pdf, svg, image). + * + * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> + */ +public interface ExportMode +extends Serializable +{ + /** + * Returns the name of this export mode. + * + * @return the name. + */ + public String getName(); + + /** + * Returns the description of this export mode. + * + * @return the description. + */ + public String getDescription(); + + /** + * Returns the mimetype used for this export mode. + * + * @return the mimetype. + */ + public String getMimeType(); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,27 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * <code>InputParameter</code> objects are used to store multiple values for a + * single key. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public interface InputParameter extends Serializable { + + /** + * Returns the name of the input parameter. + * + * @return the name. + */ + public String getName(); + + /** + * Returns the values of this input parameter as array. + * + * @return the values as array. + */ + public String[] getValues(); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,46 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +import java.util.Collection; + +/** + * <code>OutputMode</code> objects give information possible types of exports + * for an artifact (e.g. chart, histogram, csv, odv, statistic). + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +public interface OutputMode extends Serializable{ + + /** + * Retrieve the name of an output mode. + * + * @return the name. + */ + public String getName(); + + /** + * Retrieve the mimetype of an output mode. + * + * @return the mimetype. + */ + public String getMimeType(); + + /** + * Retrieve the output parameters available to adjust the output. + * + * @return the output parameters. + */ + public Collection<OutputParameter> getOutputParameters(); + + /** + * Retrieve possible export modes which describe specific output modes + * (e.g. pdf, svg, image). + * + * @param mode The export mode's name. + * @return the export mode. + */ + public ExportMode getExportMode(String mode); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,41 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * An <code>OutputParameter</code> describes the input for an export mode and + * stores the value inserted by the user. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public interface OutputParameter extends Serializable{ + + /** + * Retrieves the name of the parameter. + * + * @return the name. + */ + String getName(); + + /** + * Retrieves the value of this parameters. + * + * @return the value. + */ + String getValue(); + + /** + * Retrieves the description of this parameter. + * + * @return the description. + */ + String getDescription(); + + /** + * Retrieves the type of this parameter (e.g. String, Integer, Double, Date). + * + * @return the type. + */ + String getType(); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,47 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +/** + * This Class is an Extention of the Class ArtifactFactory. + * Its only job is to store optional Parameters that might be + * used to instantiate a new Artifact. + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public class ParametrizedArtifactFactory +extends ArtifactFactory implements ParametrizedArtifactObject { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = 4516368434861819032L; + + /** + * The Parameters that belongs to the Artifactfactory and might be used + * during the Initializationprocess of an Artifact. + */ + private Map<String, Collection<String>> parameters = null; + + /** + * Constructor + * @param name the name of the factory + * @param description the description of the Factory + * @param dataBaseUrl the URL where the Factory could be reached. + */ + public ParametrizedArtifactFactory(String name, String description, + String dataBaseUrl) { + super(name, description, dataBaseUrl); + this.parameters = new HashMap<String, Collection<String>>(); + } + + public Map<String, Collection<String>> getParameters() { + return parameters; + } + + public void addParameters(String key, Collection<String> values) { + this.parameters.put(key, values); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,29 @@ +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.Collection; +import java.util.Map; + +/** + * Interface which extends the funtionality of the Interface + * <code>ArtifactObject</code> with methods for storing and retrieving + * optional Parameters. + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public interface ParametrizedArtifactObject extends ArtifactObject { + + /** + * Returns the Parameters which could be used to manage (e.g. create) an + * ArtifactObject. + * @return a map storing parameters. + */ + Map<String, Collection<String>> getParameters(); + + /** + * Add a further parameter to the parameter map. + * + * @param key the Key of the Parameter (unique) + * @param values the Values of the Parameter + */ + void addParameters(String key, Collection<String> values); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,57 @@ +package de.intevation.gnv.artifactdatabase.objects.map; + +/** + * The default implementation of <code>Layer</code>. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +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; + } + + + public String getID() { + return this.id; + } + + + public String getName() { + return this.name; + } + + + public boolean isGroupLayer() { + return this.groupLayer; + } + + + public String parentID() { + return this.parentId; + } + + @Override + public String toString() { + return "ID: "+ this.id + " Name: "+this.name+ + " IsGroupLayer: "+this.groupLayer+ + " ParentID: "+this.parentId; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,52 @@ +package de.intevation.gnv.artifactdatabase.objects.map; + +import java.util.Collection; + +/** + * The default implementation of <code>MapService</code>. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public class DefaultMapService implements MapService { + + private String id = null; + + private Collection<Layer> layer = null; + + private String type = null; + + private String url = null; + + /** + * Constructor + */ + public DefaultMapService(String id, Collection<Layer> layer, + String type, String url) { + super(); + this.id = id; + this.layer = layer; + this.type = type; + this.url = url; + } + + + public String getID() { + return this.id; + } + + + public Collection<Layer> getLayer() { + return this.layer; + } + + + public String getType() { + return this.type; + } + + + public String getURL() { + return this.url; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,39 @@ +package de.intevation.gnv.artifactdatabase.objects.map; + +/** + * This interface defines some basic methods providing information about a map + * layer. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public interface Layer { + + /** + * Retrieves the name of a layer. + * + * @return the name of a layer. + */ + String getName(); + + /** + * Retrieves the id of a layer. + * + * @return the id of a layer. + */ + String getID(); + + /** + * Retrieves true, if this layer is a group layer - otherwise false. + * + * @return true, if this layer is a group layer - otherwise false. + */ + boolean isGroupLayer(); + + /** + * Retrieves the id of the parent layer. + * + * @return the id of the parent layer. + */ + String parentID(); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,43 @@ +package de.intevation.gnv.artifactdatabase.objects.map; + +import java.util.Collection; + +/** + * This interface defines some basic methods to provide information about a map + * service. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public interface MapService { + + /** + * Retrieves the id of a map service. + * + * @return the id of a map service. + */ + String getID(); + + + /** + * Retrieves the URL of a map service. + * + * @return the URL of a map service. + */ + String getURL(); + + + /** + * Retrieves the type of a map service. + * + * @return the type of a map service. + */ + String getType(); + + /** + * Retrieves the layers served by a map service. + * + * @return the layers served by a map service. + */ + Collection<Layer> getLayer(); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/package.html Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,8 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body> +Objects used to store information about map services and provided layers. +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/package.html Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,8 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body> +Objects used to represent an artifact in this client. +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/package.html Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,8 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body> +DOCUMENT ME! +</body> +</html>
--- /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:56 2012 +0200 @@ -0,0 +1,35 @@ +package de.intevation.gnv.propertiesreader; + +import java.util.Map; + +import org.apache.log4j.Logger; + +/** + * A <code>PropertiesReader</code> storing properties in a <code>Map</code>. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +public class MapPropertiesReader implements PropertiesReader { + + private static Logger log = Logger.getLogger(MapPropertiesReader.class); + + private Map<String, String> properties = null; + + /** + * Constructs a new MapPropertiesReader with an initial map. + */ + public MapPropertiesReader(Map<String, String> properties) { + super(); + this.properties = properties; + } + + public String getPropertieValue(String key, String defaultValue) { + String value = this.properties.get(key); + if (value == null) { + value = defaultValue; + } + return value; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,21 @@ +package de.intevation.gnv.propertiesreader; + +/** + * An interface that defines a single method to retrieve properties specified by + * a key. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public interface PropertiesReader { + + /** + * Retrieves a property by the given <i>ke<</i>. + * + * @param key The key of a property. + * @param defaultValue The default value which is returned if no property + * is found by <i>key</i>. + * @return the value of a property. + */ + public String getPropertieValue(String key, String defaultValue); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,77 @@ +package de.intevation.gnv.propertiesreader; + +import java.util.Map; + +import javax.servlet.ServletConfig; + +import org.apache.log4j.Logger; + +/** + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +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<String, String>) config); + } else { + log.error("No PropertiesReader for Instance " + + config.getClass().getName()); + } + + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /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:56 2012 +0200 @@ -0,0 +1,52 @@ +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 <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +public class ServletPropertiesReader implements PropertiesReader { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(ServletPropertiesReader.class); + + private Map<String, String> properties = null; + + /** + * Constructor + */ + public ServletPropertiesReader(ServletConfig config) { + super(); + log.info("ServletPropertiesReader will be initialized"); + if (config != null) { + + Enumeration<String> keys = config.getInitParameterNames(); + properties = new HashMap<String, String>(); + while (keys.hasMoreElements()) { + String key = keys.nextElement(); + String value = config.getInitParameter(key); + log.info("New ConbfigurationValue; " + key + " ==> " + value); + this.properties.put(key, value); + } + } + } + + + public String getPropertieValue(String key, String defaultValue) { + String value = this.properties.get(key); + if (value == null) { + value = defaultValue; + } + return value; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/package.html Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,8 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body> +DOCUMENT ME! +</body> +</html>
--- /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:56 2012 +0200 @@ -0,0 +1,49 @@ +package de.intevation.gnv.servlet; + +import de.intevation.gnv.propertiesreader.PropertiesReaderFactory; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; + +import org.apache.log4j.Logger; +import org.apache.log4j.PropertyConfigurator; + +import org.apache.struts.action.ActionServlet; + +/** + * The GNV ActionServlet. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +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"; + + private static final long serialVersionUID = 3597396283436383943L; + + + @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); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/servlet/package.html Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,8 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body> +DOCUMENT ME! +</body> +</html>
--- /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:56 2012 +0200 @@ -0,0 +1,59 @@ +package de.intevation.gnv.util; + +import java.util.Iterator; + +import javax.xml.XMLConstants; + +import javax.xml.namespace.NamespaceContext; + +/** + * The namespacecontext object used in xml documents retrieved by the artifact + * server. + * + * @author <a href="mailto:sascha.teichmann@intevation">Sascha L. Teichmann</a> + */ +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 :
--- /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:56 2012 +0200 @@ -0,0 +1,253 @@ +package de.intevation.gnv.util; + +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; +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(); + } + + public static boolean toStream(Document document, OutputStream out) { + try { + Transformer transformer = + TransformerFactory.newInstance().newTransformer(); + DOMSource source = new DOMSource(document); + StreamResult result = new StreamResult(out); + transformer.transform(source, result); + return true; + } + catch (TransformerConfigurationException tce) { + logger.error(tce.getLocalizedMessage(), tce); + } + catch (TransformerFactoryConfigurationError tfce) { + logger.error(tfce.getLocalizedMessage(), tfce); + } + catch (TransformerException te) { + logger.error(te.getLocalizedMessage(), te); + } + + return false; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8:
--- /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:56 2012 +0200 @@ -0,0 +1,109 @@ +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; + +/** + * This xsl transformer is used to transform incoming xml documents with the + * help of templates into a html representation. + * + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + */ +public class XSLTransformer { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(XSLTransformer.class); + + + private Map<String, String> params; + + /** + * Constructor + */ + public XSLTransformer() { + super(); + } + + /** + * Turns <i>toTransform</i> into another format using the template <i> + * templateFileName</i> with the <i>encoding</i>. The parameters added in + * {@link #addParameter(java.lang.String, java.lang.String)} are available + * in the transformer. + * + * @param toTransform The node to be transformed. + * @param encoding The encoding to be used. + * @param templateFileName The template used for transformation. + * @return the transformed document as string. + */ + 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<String, String> 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; + } + + + /** + * Add a parameter that is required in the XSL sheet. + * + * @param name The name of the parameter. + * @param value The value of the parameter. + */ + public void addParameter(String name, String value) { + if (params == null) { + params = new HashMap<String, String>(3); + } + + params.put(name, value); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/util/package.html Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,8 @@ +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> +<html> +<head> +</head> +<body> +Some helper classes mainly used to work with XML documents. +</body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/resources/applicationMessages.properties Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,125 @@ +# application.properties +application.name=${pom.name} +application.version=${pom.version} +application.releasedate=${timestamp} +application.reload=Klicken Sie hier, um es erneut zu versuchen. + +gnviewer.footer.home = Home +gnviewer.footer.contact = Kontakt +gnviewer.footer.about = Impressum + +gnviewer.header.restart = Neustart +gnviewer.header.language = Englisch +gnviewer.header.info = Info + +gnviewer.app.title = BSH-GDI genericViewer + +gnviewer.project.save = Projekt speichern +gnviewer.project.load = Projekt laden +gnviewer.project.load.button.src = ./images/laden.png + +gnviewer.history.title=\u00dcberblick +gnviewer.history.back.button=Bearbeiten + +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.fis.fis_nauthis = Nauthis +gnviewer.fis.fis_contis=Contis +gnviewer.fis.fis_marinefeatures = Marine Basisdaten + +gnviewer.select.button = Ausw\u00e4hlen +gnviewer.select.button.src = ./images/auswaehlen.png +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.button=Diagramm +gnviewer.diagram.options.header.title=Diagrammoptionen + +# wms +gnviewer.wms.server.path=URL des WMS +gnviewer.wms.server.layer=Name des Layers +gnviewer.wms.layer.ttl=Layer ist g\u00fcltig bis +gnviewer.wms.options.header.title=WMS Optionen + +# attachedOutputOptions +gnviewer.output.options.diagramm.alt=Diagramm +gnviewer.output.options.histogram.alt=Histogramm +gnviewer.output.options.save.title=Diagramm speichern +gnviewer.output.options.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 +title=Titel + +# 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..connection.reset=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. +input.is.not.valid.for.this.state=Der von Ihnen eingegebene Wert ist ung\u00fcltig. Bitte versuchen Sie es erneut. +input.not.a.integer= ist keine g\u00fcltige Ganzzahl. Bitte versuchen Sie es erneut. +input.not.a.double= ist keine g\u00fcltige Flie\u00dfkommazahl. Bitte versuchen Sie es erneut. +upload.failure=Beim Hochladen der Datei ist ein Fehler aufgetreten. +no.artifact.chosen=Es ist noch kein FIS gew\u00e4hlt. +invalid.artifact=Ung\u00fcltiges Artefakt Dokument gefunden. +mismatching.checksum=Ung\u00fcltiges Artefakt Dokument gefunden. +no.such.factory=Ung\u00fcltiges Artefakt Dokument gefunden. +java.io.ioexception..no.such.artifact=Ihr Artefakt ist ung\u00fcltig oder bereits abgelaufen.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/resources/applicationMessages_en.properties Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,123 @@ +# application.properties +application.name=${pom.name} +application.version=${pom.version} +application.releasedate=${timestamp} +application.reload=Click here to try again + +gnviewer.footer.home = Home +gnviewer.footer.contact = Contact +gnviewer.footer.about = Imprint + +gnviewer.header.restart = Restart +gnviewer.header.language = German +gnviewer.header.info = Info + +gnviewer.app.title = BSH-GDI genericViewer + +gnviewer.history.title=Summary +gnviewer.history.back.button=Change + +gnviewer.project.save = Save Project +gnviewer.project.load = Load Project +gnviewer.project.load.button.src = ./images/load.png + +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.fis.fis_nauthis = Nauthis +gnviewer.fis.fis_contis=Contis +gnviewer.fis.fis_marinefeatures = Marine Features + +gnviewer.select.button = Choose +gnviewer.select.button.src = ./images/choose.png +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.button=Diagram +gnviewer.diagram.options.header.title=Diagram options + +# wms +gnviewer.wms.server.path=WMS URL +gnviewer.wms.server.layer=Layername +gnviewer.wms.layer.ttl=Layer is valid to +gnviewer.wms.options.header.title=WMS Optionen + +# attachedOutputOptions +gnviewer.output.options.diagramm.alt=Diagram +gnviewer.output.options.histogram.alt=Histogram +gnviewer.output.options.save.title=Save Diagram +gnviewer.output.options.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 +title=Title + +java.io.ioexception..connection.refused = The Connection to the ArtifactDatabase is interrupted. Please try again later. +java.io.ioexception..connection.reset = The Connection to the ArtifactDatabase is interrupted. Please try again later. +java.io.ioexception..unable.to.parse.the.response.http.version..end.of.stream.reached.too.early= The Connection to the ArtifactDatabase was interrupted unexpected. +no.inputdata.given..please.select.at.least.one.entry = No Entry was chosen. Please select at least one entry. +de.intevation.gnv.geobackend.base.query.exception.queryexception..java.sql.sqlexception: A internal Server error has occurred. Please contact the Support. +java.io.ioexception..the.server.encountered.an.unexpected.condition.which.prevented.it.from.fulfilling.the.request = A internal Server error has occurred. Please contact the Support. +java.lang.illegalargumentexception..inputstream.cannot.be.null = A internal Server error has occurred. Please contact the Support. +input.is.not.valid.for.this.state=You entered an invalid value. Please try again. +input.not.a.integer= is not a valid integer. Please try again. +input.not.a.double= is not a valid floating-point number. Please try again. +upload.failure=An error occured while uploading file. +no.artifact.chosen=No fis selected yet. +invalid.artifact=Invalid artifact found. +mismatching.checksum=Invalid artifact found. +no.such.factory=Invalid artifact found. +java.io.ioexception..no.such.artifact=Your artifact is invalid or out of date.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/META-INF/context.xml Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,2 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<Context cookies="false" reloadable="true"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/classes/log4j.properties Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,21 @@ +# Set root logger level to DEBUG and its only appender to A1. +log4j.rootLogger=DEBUG, A1 +log4j.rootLogger=DEBUG, BSH + +# 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 + +log4j.appender.BSH=org.apache.log4j.RollingFileAppender +log4j.appender.BSH.File=${catalina.base}/logs/gnv.log +log4j.appender.BSH.layout=org.apache.log4j.PatternLayout +log4j.appender.BSH.layout.ConversionPattern=%d [%t] %-5p %c - %m%n + +# Abschalten des geschwätzigen Loggings in dre Klasse JspServlet +log4j.category.org.apache.jasper=WARN +log4j.category.org.apache.catalina=WARN +log4j.category.org.apache.commons=WARN +log4j.category.org.apache.struts=WARN
--- /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:56 2012 +0200 @@ -0,0 +1,252 @@ +<?xml version="1.0" encoding="ISO-8859-1" ?> +<!DOCTYPE struts-config PUBLIC + "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" + "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd"> +<struts-config> + <global-exceptions/> + <global-forwards> + <forward name="entrance" path="/start.do"/> + <forward name="imprint" path="/imprint.do"/> + <forward name="info" path="/info.do"/> + </global-forwards> + + <action-mappings> + <action path="/imprint" + type="org.apache.struts.actions.ForwardAction" + parameter="/WEB-INF/jsp/imprint.jsp" + scope="request" + validate="false" /> + <action path="/info" + type="org.apache.struts.actions.ForwardAction" + parameter="/WEB-INF/jsp/info.jsp" + scope="request" + validate="false" /> + <action path="/version" + type="de.intevation.gnv.action.ArtifactDatabaseActionBase" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/version.jsp"/> + </action> + <action path="/extcall" + type="de.intevation.gnv.action.mapviewer.MapViewerCallAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + </action> + <action path="/mvcall" + type="de.intevation.gnv.action.mapviewer.ShowMapViewerCallBodyAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + </action> + <action path="/store" + type="de.intevation.gnv.action.StoreAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + <forward + name="failure" + path="/WEB-INF/jsp/mainlayout.jsp"/> + </action> + <action path="/load" + type="de.intevation.gnv.action.LoadAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + <forward + name="failure" + path="/WEB-INF/jsp/mainlayout.jsp"/> + <forward + name="back" + path="/gnv/back.do"/> + <forward + name="selectfis" + path="/gnv/selectFis.do"/> + </action> + <action path="/start" + type="de.intevation.gnv.action.FetchArtifactFactoriesAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + </action> + <action path="/selectArtifactFactory" + type="de.intevation.gnv.action.SelectArtifactFactoryAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + <forward + name="back" + path="/gnv/back.do"/> + <forward + name="selectfis" + path="/gnv/selectFis.do"/> + </action> + <action path="/back" + type="de.intevation.gnv.action.PreviousArtifactStepAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + <forward + name="back" + path="/gnv/back.do"/> + <forward + name="selectfis" + path="/gnv/selectFis.do"/> + </action> + <action path="/selectFis" + type="de.intevation.gnv.action.SelectFisAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + </action> + <action path="/next" + type="de.intevation.gnv.action.NextArtifactStepAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + <forward + name="back" + path="/gnv/back.do"/> + <forward + name="selectfis" + path="/gnv/selectFis.do"/> + <forward + name="store" + path="/gnv/store.do"/> + <forward + name="load" + path="/gnv/load.do"/> + </action> + <action path="/out" + type="de.intevation.gnv.action.DoOutputAction" + scope="request" + validate="false"> + </action> + <action path="/wms" + type="de.intevation.gnv.action.WMSAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/wmslayout.jsp"/> + <forward + name="back" + path="/gnv/back.do"/> + <forward + name="selectfis" + path="/gnv/selectFis.do"/> + </action> + <action path="/export" + type="de.intevation.gnv.action.DoExportAction" + scope="request" + validate="false"> + </action> + <action path="/changeOptions" + type="de.intevation.gnv.action.ChangeOptionsAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + <forward + name="back" + path="/gnv/back.do"/> + <forward + name="selectfis" + path="/gnv/selectFis.do"/> + </action> + <action path="/histogram" + type="de.intevation.gnv.action.CreateHistogramAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + <forward + name="back" + path="/gnv/back.do"/> + <forward + name="selectfis" + path="/gnv/selectFis.do"/> + </action> + <action path="/chart" + type="de.intevation.gnv.action.CreateChartAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + <forward + name="back" + path="/gnv/back.do"/> + <forward + name="selectfis" + path="/gnv/selectFis.do"/> + </action> + <action path="/statistic" + type="de.intevation.gnv.action.ShowStatisticAction" + scope="request" + validate="false"> + <forward + name="back" + path="/gnv/back.do"/> + <forward + name="selectfis" + path="/gnv/selectFis.do"/> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + </action> + <action path="/describe" + type="de.intevation.gnv.action.DescribeUIAction" + scope="request" + validate="false"> + <forward + name="back" + path="/gnv/back.do"/> + <forward + name="selectfis" + path="/gnv/selectFis.do"/> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + </action> + <action path="/language" + type="de.intevation.gnv.action.SwitchLanguageAction" + scope="request" + validate="false"> + <forward + name="success" + path="/WEB-INF/jsp/mainlayout.jsp"/> + <forward + name="back" + path="/gnv/back.do"/> + <forward + name="selectfis" + path="/gnv/selectFis.do"/> + </action> + </action-mappings> + + <message-resources parameter="applicationMessages" null="false"/> +</struts-config> +
--- /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:56 2012 +0200 @@ -0,0 +1,113 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns="http://www.w3.org/2002/xforms" + xmlns:xform="http://www.w3.org/2002/xforms" + xmlns:art="http://www.intevation.de/2009/artifacts" + exclude-result-prefixes="xform art"> + + <xsl:output + method="html" version="1.0" encoding="UTF-8" omit-xml-declaration="no" /> + + <xsl:param name="back-url"/> + <xsl:param name="selectfis"/> + <xsl:param name="edit"></xsl:param> + <xsl:param name="total"><xsl:value-of select="count(*)"/></xsl:param> + + <!-- start parsing document --> + <xsl:template match="*"> + <table class="static"> + <xsl:apply-templates /> + </table> + </xsl:template> + + + <!-- match multi select boxes --> + <xsl:template match="xform:select"> + <tr> + <th class="parameter"><xsl:value-of select="xform:label" /></th> + <td><xsl:apply-templates select="xform:choices" /></td> + <td class="historyback"> + <xsl:call-template name="InsertEdit"> + <xsl:with-param name="state" select="@art:state" /> + <xsl:with-param name="index" select="position()" /> + <xsl:with-param name="fis" select="@art:fis" /> + </xsl:call-template> + </td> + </tr> + </xsl:template> + + + <xsl:template name="InsertEdit"> + <xsl:param name="state" /> + <xsl:param name="index" /> + <xsl:param name="fis" /> + <xsl:if test="$state != ''"> + <xsl:if test="$index = $total"> + <a href="{$back-url}?target={$state}"> + <img title="{$edit}" alt="{$edit}" src="images/back_button.png"/> + </a> + </xsl:if> + </xsl:if> + <xsl:if test="$fis"> + <a href="{$selectfis}"><img title="{$edit}" alt="{$edit}" src="images/back_button.png"/></a> + </xsl:if> + </xsl:template> + + + <!-- match select boxes --> + <xsl:template match="xform:select1"> + <tr> + <th class="parameter"><xsl:value-of select="xform:label" /></th> + <td><xsl:apply-templates select="xform:choices" /></td> + <td class="historyback"> + <xsl:call-template name="InsertEdit"> + <xsl:with-param name="state" select="@art:state" /> + <xsl:with-param name="index" select="position()" /> + <xsl:with-param name="fis" select="@art:fis" /> + </xsl:call-template> + </td> + </tr> + </xsl:template> + + + <!-- match item list of select boxes or multi select boxes --> + <xsl:template match="xform:choices"> + <table class="choices"><xsl:apply-templates select="xform:item" /></table> + </xsl:template> + + + <!-- match item of select boxes or multi select boxes --> + <xsl:template match="xform:item"> + <tr> + <td class="value"><xsl:value-of select="xform:label" /></td> + </tr> + </xsl:template> + + + <!-- match group items --> + <xsl:template match="xform:group"> + <tr> + <th class="parameter"><xsl:value-of select="xform:label" /></th> + <td> + <table><xsl:apply-templates select="xform:input" /></table> + </td> + <td class="historyback"> + <xsl:call-template name="InsertEdit"> + <xsl:with-param name="state" select="@art:state" /> + <xsl:with-param name="index" select="position()" /> + <xsl:with-param name="fis" select="@art:fis" /> + </xsl:call-template> + </td> + </tr> + </xsl:template> + + + <!-- match single group item --> + <xsl:template match="xform:input"> + <tr> + <td class="value"><xsl:value-of select="xform:label" /> <xsl:value-of select="xform:value" /></td> + </tr> + </xsl:template> + +</xsl:stylesheet>
--- /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:56 2012 +0200 @@ -0,0 +1,185 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet version="1.0" + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns="http://www.w3.org/2002/xforms" + xmlns:xform="http://www.w3.org/2002/xforms" + xmlns:art="http://www.intevation.de/2009/artifacts" + exclude-result-prefixes="xform art"> + + <xsl:output + method="html" version="1.0" encoding="UTF-8" omit-xml-declaration="no" /> + + <!-- single select --> + <xsl:template match="xform:select1"> + <xsl:variable name="selectName" select="@ref"/> + <legend><xsl:value-of select="xform:label"/></legend> + <select name="{$selectName}"> + <xsl:apply-templates /> + </select> + </xsl:template> + + + <!-- multi select --> + <xsl:template match="xform:select"> + <xsl:variable name="selectName" select="@ref"/> + <xsl:variable name="items" select="count(//xform:item)"/> + <legend> + <xsl:value-of select="xform:label"/> + </legend> + + <xsl:choose> + <xsl:when test="$items = 1"> + <select name="{$selectName}" multiple="multiple" size="{$items}"> + <xsl:apply-templates mode="selected"/> + </select> + </xsl:when> + <xsl:when test="$items < 5"> + <select name="{$selectName}" multiple="multiple" size="{$items}"> + <xsl:apply-templates/> + </select> + </xsl:when> + <xsl:otherwise> + <select name="{$selectName}" multiple="multiple" size="5"> + <xsl:apply-templates /> + </select> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <!-- options for select --> + <xsl:template match="xform:item"> + <xsl:variable name="optionValue" select="xform:value"/> + <xsl:choose> + <xsl:when test="@selected = 'true'"> + <option value="{$optionValue}" selected="selected"> + <xsl:value-of select="xform:label"/> + </option> + </xsl:when> + <xsl:otherwise> + <option value="{$optionValue}"> + <xsl:value-of select="xform:label"/> + </option> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + + <xsl:template match="xform:item" mode="selected"> + <xsl:variable name="optionValue" select="xform:value"/> + <option value="{$optionValue}" selected="selected"> + <xsl:value-of select="xform:label"/> + </option> + </xsl:template> + + + + <xsl:template match="xform:group"> + <xsl:variable name="selectcount" select="count(xform:select)"/> + + <legend> + <xsl:value-of select="xform:label"/> + </legend> + + <xsl:choose> + <xsl:when test="$selectcount < '1'"> + <table class="dynamic"> + <xsl:apply-templates/> + </table> + </xsl:when> + <xsl:otherwise> + <table class="static"> + <tr> + <td><!-- nothing here --></td> + <!-- take the first select node to render column labels --> + <xsl:apply-templates select="xform:select[1]/xform:item" mode="matrixHeader"/> + </tr> + <tr> + <td><!-- nothing here --></td> + <xsl:apply-templates select="xform:select[1]/xform:item" mode="matrixSelectable"/> + </tr> + <!-- render matrix' body --> + <xsl:apply-templates select="xform:select" mode="matrix" /> + </table> + </xsl:otherwise> + </xsl:choose> + </xsl:template> + + <!-- rendering column headers (measurements) --> + <xsl:template match="xform:item" mode="matrixHeader"> + <td class="matrixHeader"> + <xsl:value-of select="xform:label/text()"/> + </td> + </xsl:template> + + <!-- --> + <xsl:template match="xform:item" mode="matrixSelectable"> + <xsl:variable name="value" select="xform:value/text()"/> + <xsl:variable name="name" select="@ref"/> + <td class="matrixSelectableHeader"> + <input type="checkbox" name="{$name}" value="{$value}" /> + </td> + </xsl:template> + + + <!-- render the first column with parameter names into matrix --> + <xsl:template match="xform:select" mode="matrix"> + <tr> + <td><xsl:value-of select="@label" /></td> + <xsl:apply-templates mode="matrix" /> + </tr> + </xsl:template> + + + <!-- render checkboxes and disable checkboxes for invalid parameter + measurements --> + <xsl:template match="xform:item" mode="matrix"> + <xsl:variable name="value" select="xform:value/text()"/> + <xsl:variable name="name" select="@ref"/> + <td class="matrixContent"> + <xsl:choose> + <xsl:when test="@disabled = 'true'"> + <img src="./images/delete.png"/> + </xsl:when> + <xsl:otherwise> + <img src="./images/tick.png"/> + </xsl:otherwise> + </xsl:choose> + </td> + </xsl:template> + + + <xsl:template match="xform:input"> + <xsl:variable name="inputValue" select="xform:value"/> + <xsl:variable name="inputName" select="@ref"/> + <xsl:variable name="label" select="xform:label"/> + + <!-- TODO: Remove this when we have the GIS interface. (slt) --> + <xsl:choose> + <xsl:when test="$inputName = 'mesh_linestring'"> + <a href="javascript:copy_demo_wkt_line();"><xsl:text>Beispiel WKT-Linestring einfügen:</xsl:text></a><br/> + </xsl:when> + <xsl:when test="$inputName = 'mesh_polygon'"> + <a href="javascript:copy_demo_wkt_polygon();"><xsl:text>Beispiel WKT-Polygon einfügen:</xsl:text></a><br/> + </xsl:when> + </xsl:choose> + + <tr> + <xsl:choose> + <xsl:when test="$label != ''"> + <td class="parameter"><xsl:value-of select="$label"/>:</td> + </xsl:when> + </xsl:choose> + + <td> + <input type="text" id="{$inputName}" name="{$inputName}" value="{$inputValue}" /><br/> + </td> + </tr> + </xsl:template> + + + <xsl:template match="xform:label"> + <!-- do nothing here --> + </xsl:template> + +</xsl:stylesheet>
--- /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:56 2012 +0200 @@ -0,0 +1,29 @@ +<%@ 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" %> +<html> + <table class="footerTable"> + <tr> + <td class="footerLine">© 2010 Bundesamt für Seeschifffahrt und Hydrographie</td> + <td></td> + </tr> + <tr> + <td colspan="2"> + <table class="footerTableLinks"> + <tr> + <td align="left"></td> + <td align="right"> + <html:link styleClass="footerLineLinks" href="http://www.bsh.de"><bean:message key="gnviewer.footer.home"/></html:link> + <font size="1.5em" color="white">·</font> + <html:link styleClass="footerLineLinks" href="mailto:"><bean:message key="gnviewer.footer.contact"/></html:link> + <font size="1.5em" color="white">·</font> + <html:link styleClass="footerLineLinks" page="/imprint.do"><bean:message key="gnviewer.footer.about"/></html:link> + </td> + </tr> + </table> + </td> + </tr> + </table> +</html> +<%--div style="clear: left; margin-top: 40px;"/--%>
--- /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:56 2012 +0200 @@ -0,0 +1,25 @@ +<%@ 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"%> + +<div id="headline"> + <h1 class="headline">BSH Generischer Viewer</h1> +</div> + +<br> + +<table class="headerTableLinks"> + <tr> + <td align="left"></td> + <td align="right"> + <html:link styleClass="headerLineLinks" page="/start.do"><bean:message key="gnviewer.header.restart"/></html:link> + <font size="1.5em" color="white">·</font> + <a class="headerLineLinks" href="<%=response.encodeURL("language.do?uid="+System.currentTimeMillis())%>"><bean:message key="gnviewer.header.language"/></a> + <font size="1.5em" color="white">·</font> + <html:link styleClass="headerLineLinks" page="/info.do"><bean:message key="gnviewer.header.info"/></html:link> + </td> + </tr> +</table>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/imprint.jsp Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,41 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title> + <bean:message key="gnviewer.app.title"/> + </title> + <link href="styles/gnv.css" rel="stylesheet" type="text/css"/> + </head> + + <body id="gnviewerbody"> + <div id="page"> + <div id="headline"> + <h1 class="headline">BSH Generischer Viewer</h1> + </div> + + <br> + + <div id="headerElement"> + <table class="headerTableLinks"> + <tr> + <td align="left"></td> + <td align="right"> + <html:link styleClass="headerLineLinks" page="/start.do"><bean:message key="gnviewer.header.restart"/></html:link> + <font size="1.5em" color="white">·</font> + <html:link styleClass="headerLineLinks" page="/info.do"><bean:message key="gnviewer.header.info"/></html:link> + </td> + </tr> + </table> + </div> + <div id="contentElement" class="contentElement"> + TODO: Impressum. + </div> + <div id="footerElement"> + <jsp:include page="footer.jsp" /> + </div> + </div> + </body> +</html>
--- /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:56 2012 +0200 @@ -0,0 +1,38 @@ +<%@ 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<OutputParameter> op = sm.getOutputMode(target).getOutputParameters(); + + if (op != null){ + Iterator<OutputParameter> 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 --%> +<div id="diagram"> + <img src='<%=response.encodeURL("out.do?mimetype="+mimeType+"&target="+target+"&mode=img"+parameterString+"&uid="+System.currentTimeMillis())%>' alt='<bean:message key="gnviewer.output.options.diagramm.alt"/>'/> + <br/> +</div>
--- /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:56 2012 +0200 @@ -0,0 +1,110 @@ +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> +<%@page import="de.intevation.gnv.action.CommunicationKeys"%> +<%@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 exceptionMsg = (String)request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE); + String exceptionValue = (String)request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_VALUE); + 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<OutputParameter> op = outputMode.getOutputParameters(); + + if (op != null){ + Iterator<OutputParameter> 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"); + } +%> +<div id="diagramOptionsContent"> + <fieldset> + <legend onmousedown="displayDiv('diagramOptionsContent');" class="expandableFieldset"> + <bean:message key="gnviewer.diagram.options.header.title"/> + </legend> + + <% if (exceptionMsg != null) {%> + <div id="chartException" class="chartException"> + '<%=exceptionValue%>' <bean-el:message key="<%=exceptionMsg%>"/> + </div> + <%}%> + + <form id="outputOptionsForm" method="post" action="<%=response.encodeURL("changeOptions.do?target="+target)%>"> + <table class="static"> + <%if (outputMode != null && outputMode.getOutputParameters() != null && !outputMode.getOutputParameters().isEmpty()){ + Iterator<OutputParameter> it = outputMode.getOutputParameters().iterator(); + while (it.hasNext()){ + OutputParameter om = it.next(); %> + <tr> + <td class="parameter"> + <bean-el:message key="<%=om.getName()%>"/> + </td> + <td> + <%if (om.getType().equalsIgnoreCase("boolean")){ + boolean checked = useDiagrammOptions ? "true".equalsIgnoreCase(diagrammOptions.getValue(om.getName())) : om.getValue().equalsIgnoreCase("true"); + %> + <input type="checkbox" + name="<%=om.getName() %>" + <%=checked ? " value=\"true\" checked=\"checked\"": "" %>/> + <%}else{%> + <input type="text" name="<%=om.getName() %>" value="<%=useDiagrammOptions ? diagrammOptions.getValue(om.getName()): om.getValue()%>"/> + <%}%> + </td> + </tr> + <%}%> + </table> + <div class="exportBar"> + <input type="image" name="target" value="chart" src="images/arrow_refresh.png" alt="<bean:message key="gnviewer.draw.button"/>"/> + <%}%> + <%if (supportIMG != null) { %> + <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeIMG+"&target="+target+"&mode="+targetIMG+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.save.title"/>"> + <img src="images/diagram_export.png" border="0"/></a> + <%}%> + <%if (supportPDF != null) { %> + <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypePDF+"&target="+target+"&mode="+targetPDF+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.pdf.title"/>"> + <img src="images/pdf.png" border="0"/></a> + <%}%> + <%if (supportSVG != null) { %> + <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeSVG+"&target="+target+"&mode="+targetSVG+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.svg.title"/>"> + <img src="images/svg.png" border="0"/></a> + <%}%> + </div> + </form> + </fieldset> +</div>
--- /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:56 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"%> +<div class="statistics"> +<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + Collection<ArtifactStatisticsSet> statistics = sm.getStatistics(); +%> + <fieldset> + <legend class="expandableFieldset"> + <bean:message key="gnviewer.statistics.header.title"/> + </legend> + <%if (statistics != null){ + Iterator<ArtifactStatisticsSet> it = statistics.iterator(); + while (it.hasNext()){ + ArtifactStatisticsSet set = it.next(); + %> + <h1><%=set.getName()%></h1> + <table class="statistics"> + <tr> + <th><bean:message key="gnviewer.statistics.table.header.param"/></th> + <th><bean:message key="gnviewer.statistics.table.header.value"/></th> + </tr> + <% + Iterator<ArtifactStatisticValue> sit = set.getStatisticValues().iterator(); + while (sit.hasNext()){ + ArtifactStatisticValue asv = sit.next(); + %> + <tr> + <td><bean-el:message key="<%=asv.getKey()%>"/></td> + <td><%=asv.getValue()%></td> + </tr> + <%}%> + </table> + <%} %> + <%}%> + </fieldset> +</div>
--- /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:56 2012 +0200 @@ -0,0 +1,106 @@ +<%@ 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<OutputParameter> op = sm.getOutputMode(target).getOutputParameters(); + + if (op != null){ + Iterator<OutputParameter> 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) { %> + <div id="export"> + <fieldset> + <legend><bean:message key="gnviewer.export.fieldset.title"/></legend> + <%if (supportChart) { %> + <a href="<%=response.encodeURL("chart.do?mimetype="+mimeType+"&target="+target+"&mode=img"+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.diagram.button"/>"> + <img src="images/chart_curve.png" border="0"/></a> + <%}%> + <%if (supportWMS) { %> + <a href="<%=response.encodeURL("wms.do?mimetype="+mimeTypeWMS+"&target="+targetWMS+"&uid="+System.currentTimeMillis()+"&layer="+wmslayer)%>" title="<bean:message key="gnviewer.output.options.export.wms.title"/>"> + <img src="images/map_go.png" border="0"/></a> + <%}%> + <%if (supportZIP) { %> + <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeZIP+"&target="+targetZIP+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.zip.title"/>"> + <img src="images/disk.png" border="0"/></a> + <%}%> + + <%if (supportSta) { %> + <a href="<%=response.encodeURL("statistic.do")%>" title="<bean:message key="gnviewer.statistic.button"/>"> + <img src="images/statistics.png" border="0"/></a> + <%}%> + + <%if (supportHis) { %> + <a href="<%=response.encodeURL("histogram.do")%>" title="<bean:message key="gnviewer.histogram.button"/>"> + <img src="images/chart_bar.png" border="0"/></a> + <%}%> + <%if (supportCSV) { %> + <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeCSV+"&target="+targetCSV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.csv.title"/>"> + <img src="images/data_export.png" border="0"/></a> + <%}%> + <%if (supportODV) { %> + <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeODV+"&target="+targetODV+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.odv.title"/>"> + <img src="images/data_export.png" border="0"/></a> + <%}%> + </fieldset> + </div> +<%}%>
--- /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:56 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<ArtifactObject> artifactFactories = sm.getArtifactFactories(); + String prefix = "gnviewer.fis."; +%> +<div id="basefilter"> + <form id="fisSelectionForm" action="<%=response.encodeURL("selectArtifactFactory.do")%>" method="post"> + <fieldset> + <legend><bean:message key="gnviewer.productselection.fisselection.title"/></legend> + <%if (artifactFactories != null){%> + + <select name="artifactFactory"> + <%Iterator<ArtifactObject> it = artifactFactories.iterator(); + while (it.hasNext()){ + ArtifactObject ao = it.next();%> + <option value="<%=ao.getId()%>" <%=(ao.isSelected() ? "selected=\"selected\"" : "")%> ><bean-el:message key="<%=(prefix+ao.getName())%>"/></option> + <%}%> + </select> + <%}%> + <br/> + <input style="margin-top: 5px;" type="image" src="<bean:message key="gnviewer.select.button.src"/>"/> + </fieldset> + </form> +</div>
--- /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:56 2012 +0200 @@ -0,0 +1,32 @@ +<%@ 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<OutputParameter> op = sm.getOutputMode(target).getOutputParameters(); + + if (op != null){ + Iterator<OutputParameter> 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"); + } +%> + +<div class="histogram"> + <img src='<%=response.encodeURL("out.do?mimetype="+mimeType+"&target="+target+"&mode=img"+parameterString+"&uid="+System.currentTimeMillis())%>' alt='<bean:message key="gnviewer.output.options.histogram.alt"/>'/> +</div>
--- /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:56 2012 +0200 @@ -0,0 +1,133 @@ +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> +<%@page import="de.intevation.gnv.action.CommunicationKeys"%> +<%@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 exceptionMsg = (String)request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE); + String exceptionValue = (String)request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_VALUE); + 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<OutputParameter> op = outputMode.getOutputParameters(); + + if (op != null){ + Iterator<OutputParameter> 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"); + } +%> +<div id="diagramOptionsContent"> + <fieldset> + <legend onmousedown="displayDiv('histogramOptionsContent');" class="expandableFieldset"> + <bean:message key="gnviewer.histogram.options.header.title"/> + </legend> + + <% if (exceptionMsg != null) {%> + <div id="chartException" class="chartException"> + '<%=exceptionValue%>' <bean-el:message key="<%=exceptionMsg%>"/> + </div> + <%}%> + + <form id="outputOptionsForm" method="post" action="<%=response.encodeURL("changeOptions.do?target="+target)%>"> + <table> + <%if (outputMode != null && outputMode.getOutputParameters() != null && !outputMode.getOutputParameters().isEmpty()){ + Iterator<OutputParameter> it = outputMode.getOutputParameters().iterator(); + while (it.hasNext()){ + OutputParameter om = it.next(); + String diaOpts = null; + if (diagrammOptions != null) { + diaOpts = request.getParameter("bintype"); + }%> + <tr> + <td> + <%if (om.getName().equals("bincount")) { + String check = ""; + if (diaOpts != null && diaOpts.equalsIgnoreCase("binwidth")) { + check = ""; + } + else { + check = "checked=\"checked\""; + }%> + <input type="checkbox" <%= check %> name="bintype" value="bincount" id="checkCount" onClick="toggleBinType('checkWidth')"> </input> + <%}%> + <%if (om.getName().equals("binwidth")) { + String check = ""; + if (diaOpts != null && diaOpts.equalsIgnoreCase("binwidth")) { + check = "checked=\"checked\""; + } + else if (diaOpts == null) { + check = ""; + }%> + <input type="checkbox" <%= check %> name="bintype" value="binwidth" id="checkWidth" onClick="toggleBinType('checkCount')"> </input> + <%}%> + </td> + <td class="parameter"> + <bean-el:message key="<%=om.getName()%>"/> + </td> + <td> + <%if (om.getType().equalsIgnoreCase("boolean")){ + boolean checked = useDiagrammOptions ? "true".equalsIgnoreCase(diagrammOptions.getValue(om.getName())) : om.getValue().equalsIgnoreCase("true"); + %> + <input type="checkbox" + name="<%=om.getName() %>" + <%=checked ? " value=\"true\" checked=\"checked\"": "" %>/> + <%}else{%> + <input type="text" name="<%=om.getName() %>" value="<%=useDiagrammOptions ? diagrammOptions.getValue(om.getName()): om.getValue()%>"/> + <%}%> + </td> + </tr> + <%}%> + </table> + <input type="image" name="target" value="histogram" src="images/arrow_refresh.png" alt="<bean:message key="gnviewer.draw.button"/>"/> + <%}%> + <%if (supportIMG != null) { %> + <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeIMG+"&target="+target+"&mode="+targetIMG+parameterString+"uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.save.title"/>"> + <img src="images/diagram_export.png" border="0"/></a> + <%}%> + <%if (supportPDF != null) { %> + <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypePDF+"&target="+target+"&mode="+targetPDF+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.pdf.title"/>"> + <img src="images/pdf.png" border="0"/></a> + <%}%> + <%if (supportSVG != null) { %> + <a href="<%=response.encodeURL("export.do?mimetype="+mimeTypeSVG+"&target="+target+"&mode="+targetSVG+parameterString+"&uid="+System.currentTimeMillis())%>" title="<bean:message key="gnviewer.output.options.export.svg.title"/>"> + <img src="images/svg.png" border="0"/></a> + <%}%> + </form> + </fieldset> +</div>
--- /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:56 2012 +0200 @@ -0,0 +1,66 @@ +<% +String geometry = "POINT (6.3333 56.5)"; +String geometrytype = request.getParameter("gt"); +if(geometrytype != null){ + if (geometrytype.equals("POINT")){ + geometry = "POINT (6.3333 56.5)"; + }else if (geometrytype.equals("LINESTRING")){ + geometry = "LINESTRING (0.4911 56.2489,10.4464 58.1608,12.2321 56.4127,13.1250 54.8832,15.4018 54.5008,19.6875 56.4127,20.6250 59.0349,28.1250 60.2640)"; + }else if (geometrytype.equals("POLYGON")){ + geometry = "POLYGON ((-1.5763 58.3616, 0.7526 53.8428, 4.2686 53.1972, 7.9217 54.1441, 7.6020 56.2959, 11.5747 57.2857, 0.4788 58.4908, 4.2686 58.8996, 0.0219 58.5768, -1.5763 58.3616))"; + } +} +%> + +<div id="basefilter" style="left:310px;position:absolute;width:350px"> + <form action="<%=response.encodeURL("extcall.do")%>" method="post"> + <fieldset> + <legend>Kartenviewer Request</legend> + <textarea id="mapviewer" class="mapviewer" name="document" rows="25" cols="80"> + <?xml version='1.0' encoding='UTF-8'?> + <gnviewer> + <mapservices> + <mapservice id='BSH_IMS_Prediction_Model_Current' type='arcims' url='http://foo.bar.de'> + <Modeldata /> + <layer id='3' name='Speed Today 00:00 (Surface)'/> + <layer id='146' name='Surface Current Day After Tomorrow'> + <layer id='207' name='Day After Tomorrow 20:00 (Surface)'> + <layer id='208' name='Speed Day After Tomorrow 21:00 (Surface)'/> + <layer id='209' name='Speed Day After Tomorrow 20:00 (Surface)'/> + </layer> + </layer> + </mapservice> + <mapservice id='BSH_IMS_Marine_Environmental_Monitoring_Network' type='wms' url='http://foo1.bar.de'> + <MARNET/> + <layer id='26' name='Air'> + <layer id='27' name='Temperature'/> + </layer> + <layer id='9' name='Salinity'> + <layer id='10' name='depth: (0m- -6m)'/> + </layer> + <layer id='13' name='OxygenSaturation'> + <layer id='14' name='depth: (0m- -6m)'/> + <layer id='15' name='depth: (-6m- -20m)'/> + <layer id='16' name='depth: (-20m- -50m)'/> + </layer> + </mapservice> + <mapservice id='BSH_IMS_Sea_Surface_Temperature_Analysis' type='arcims' url='http://foo.bar.de'> + <SST/> + </mapservice> + <mapservice id='BSH_IMS_Prediction_Model_Salinity' type='arcims' url='http://foo.bar.de'> + <Modeldata /> + </mapservice> + <mapservice id='BSH_IMS_CONTIS_Resources' type='arcims' url='http://foo.bar.de'> + <Contis /> + </mapservice> + </mapservices> + <location> + <srs>EPSG:4324</srs> + <data><%=geometry%></data> + </location> + </gnviewer> + </textarea> + <input type="submit" name="btClick" value="Ausführen" /> + </fieldset> + </form> +</div> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_wms_options_inc.jsp Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,66 @@ +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> +<%@page import="de.intevation.gnv.action.CommunicationKeys"%> +<%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.OutputMode"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> +<%@page import="java.util.Collection"%> +<%@page import="java.util.Iterator"%> +<%@page import="java.net.URLEncoder"%> +<% + String exceptionMsg = (String) request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE); + String exceptionValue= (String) request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_VALUE); + String layer = (String) request.getAttribute("layer"); + String target = "wms"; + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + OutputMode om = sm.getOutputMode(target); + DiagrammOptions opts = sm.getDiagrammOptions(); + String uuid = sm.getCurrentArtifact().getId(); +%> + +<div id="diagramOptionsContent"> + <fieldset> + <legend onmousedown="displayDiv('diagramOptionsContent');" class="expandableFieldset"> + <bean:message key="gnviewer.wms.options.header.title"/> + </legend> + + <% if (exceptionMsg != null) {%> + <div id="chartException" class="chartException"> + '<%=exceptionValue%>' <bean-el:message key="<%=exceptionMsg%>"/> + </div> + <%}%> + + <form id="outputOptionsForm" method="POST" action="<%=response.encodeURL("wms.do")%>"> + <table> + <% Collection<OutputParameter> params = om.getOutputParameters(); + if (om != null && params != null && !params.isEmpty()) { + Iterator<OutputParameter> iter = params.iterator(); + while (iter.hasNext()) { + OutputParameter param = iter.next(); %> + + <tr> + <td class="parameter"><bean-el:message key="<%=param.getName()%>"/></td> + <td> + <%if (param.getType().equalsIgnoreCase("boolean")) { + boolean checked = (opts != null) ? "true".equalsIgnoreCase(opts.getValue(param.getName())) : param.getValue().equalsIgnoreCase("true"); + %> + <input type="checkbox" name="<%=param.getName()%>" <%=checked ? " value=\"true\" checked=\"checked\"": "" %>/> + <%} + else {%> + <input type="text" name="<%=param.getName() %>" value="<%= (opts != null) ? opts.getValue(param.getName()) : param.getValue()%>"/> + <%}%> + </td> + </tr> + <%} + }%> + <tr> + <td> + <input type="image" name="target" value="wms" src="images/arrow_refresh.png" alt="<bean:message key="gnviewer.draw.button"/>"/> + </td> + </tr> + </table> + </form> + </fieldset> +</div>
--- /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:56 2012 +0200 @@ -0,0 +1,186 @@ +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> +<%@page import="java.util.Collection"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.ArtifactObject"%> +<%@page import="de.intevation.gnv.action.CommunicationKeys"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="java.util.Iterator"%> +<% + String exception = (String)request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_INPUT_ID); + 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"); + Object wms_published = request.getAttribute("wms_published"); + String serverPath = (String) request.getAttribute("mapserver"); + String mapfilePath = (String) request.getAttribute("mapfile"); + String layerName = (String) request.getAttribute("layer"); + String timeToLive = (String) request.getAttribute("ttl"); + boolean furthertargets = true; + + if (chart == null && statistic == null && histogram == null && wms == null) { + boolean supportChart = sm.getOutputMode("chart") != null; + if (supportChart) { + chart = "true"; + } + } + + Object furthertargetsObject = request.getAttribute("furthertargets"); + if (furthertargetsObject != null){ + furthertargets = ((Boolean)furthertargetsObject).booleanValue(); + } + + 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; + + String exceptionProject = (String) request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_PROJECT); + exceptionProject = exceptionProject != null ? exceptionProject.toLowerCase() : null; + exceptionProject = exceptionProject != null ? exceptionProject.replaceAll(" ", ".") : null; +%> + + <%-- div container for project loading/saving and error messages related to this --%> + <div id="project"> + <table width="100%"> + <tr> + <td style="float: left; width: 225px;"> + <a href="<%=response.encodeURL("store.do")%>"><bean:message key="gnviewer.project.save"/></a> + | + <a href="#" onclick="toggle('projectload');"><bean:message key="gnviewer.project.load"/></a> + </td> + <td style="float: left; width: 400px;"> + <div id="projectload"> + <form id="loadProject" action="<%=response.encodeURL("load.do")%>" method="post" enctype="multipart/form-data"> + <div id="browseDiv"><input type="file" name="document" accept="application/xml"/></div> + <div id="loadDiv"><input type="image" src="<bean:message key="gnviewer.project.load.button.src"/>"/></div> + </form> + </div> + </td> + </tr> + </table> + <%if (exceptionProject != null) {%> + <div class="projectException"> + <bean:message key="<%=exceptionProject%>"/> + <br/> + <a href="<%=response.encodeURL("describe.do?uid="+System.currentTimeMillis())%>" title="<bean:message key="application.reload"/>"> + <bean:message key="application.reload"/> + </a> + </div> + <%}%> + <%if (showmapviewercallBody){ %> + <jsp:include page="includes/display_mapviewercall_inc.jsp" /> + <%}%> + </div> + + <table style="width:100%;"> + <tr id="contentRow"> + <td id="parameterColumn"> + <%-- the parameter panel is following --%> + <div id="parameterPanel"> + <%if (staticui == null){ %> + <jsp:include page="includes/display_fis_inc.jsp"></jsp:include> + <%} else {%> + <div class="down"> + <fieldset> + <legend><bean:message key="gnviewer.history.title"/></legend> + <%=staticui.toString()%> + </fieldset> + </div> + <%}%> + + <%-- render the dynamic part to feed the state and advance to the next state --%> + <%if (ui != null){%> + <div id="timeseriesfilter"> + <form id="fisSelectionForm" onsubmit="displayOverlay()" action="<%=response.encodeURL("next.do")%>" method="post"> + <fieldset> + + <%-- error message, if user input was not valid --%> + <%if (exception != null) {%> + <div class="inputException"><%=exception%></div> + <%}%> + <%=ui != null ? ui.toString().replaceAll(" ", "") : "" %> + + <%if(furthertargets){%> + <br> + <input style="margin-top: 5px;" type="image" src="<bean:message key="gnviewer.select.button.src"/>"/> + <%}%> + </fieldset> + </form> + </div> + <%}%> + + <%-- render export options if existing for this state --%> + <jsp:include page="includes/display_export_inc.jsp"></jsp:include> + + <%if (chart != null) {%> + <jsp:include page="/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp"></jsp:include> + <%}%> + + + <%if (histogram != null) {%> + <jsp:include page="/WEB-INF/jsp/includes/display_histogram_options_inc.jsp"></jsp:include> + <%}%> + + <%-- render wms options --%> + <%if (wms != null) {%> + <jsp:include page="/WEB-INF/jsp/includes/display_wms_options_inc.jsp"></jsp:include> + <%}%> + </div> + </td> + <td id="contentColumn"> + <%if (exceptionMessage != null){ %> + <div class="errormsg" id="load_error"> + <bean-el:message key="<%=exceptionMessage.toString()%>"/> + <p class="reload"> + <a href="<%=response.encodeURL("describe.do?uid="+System.currentTimeMillis())%>" title="<bean:message key="application.reload"/>"> + <bean:message key="application.reload"/> + </a> + </p> + </div> + <%}%> + <%if (chart != null) {%> + <%-- render chart options if existing for this state --%> + <jsp:include page="includes/display_diagramm_inc.jsp"></jsp:include> + <%}%> + + <%-- render statistic --%> + <%if (statistic != null) {%> + <jsp:include page="includes/display_diagramm_statistics_inc.jsp"></jsp:include> + <%}%> + + <%-- render histogram --%> + <%if (histogram != null) {%> + <jsp:include page="includes/display_histogram_inc.jsp"></jsp:include> + <%}%> + + <%-- render wms layer --%> + <%if (wms_published != null) {%> + <div class="outerMap"> + <div id="wms"> + <table> + <tr> + <td class="parameter"><bean:message key="gnviewer.wms.server.path"/>:</td> + <td class="wmsvalue"><%=serverPath%>?SERVICE=WMS&REQUEST=GetCapabilities</td> + </tr> + <tr> + <td class="parameter"><bean:message key="gnviewer.wms.server.layer"/>:</td> + <td class="wmsvalue"><%=layerName%></td> + </tr> + <tr> + <td class="parameter"><bean:message key="gnviewer.wms.layer.ttl"/>:</td> + <td class="wmsvalue"><%=timeToLive%></td> + </tr> + </table> + </div> + <div id="map"></div> + </div> + <%}%> + </td> + </tr> + </table>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/info.jsp Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,41 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title> + <bean:message key="gnviewer.app.title"/> + </title> + <link href="styles/gnv.css" rel="stylesheet" type="text/css"/> + </head> + + <body id="gnviewerbody"> + <div id="page"> + <div id="headline"> + <h1 class="headline">BSH Generischer Viewer</h1> + </div> + + <br> + + <div id="headerElement"> + <table class="headerTableLinks"> + <tr> + <td align="left"></td> + <td align="right"> + <html:link styleClass="headerLineLinks" page="/start.do"><bean:message key="gnviewer.header.restart"/></html:link> + <font size="1.5em" color="white">·</font> + <html:link styleClass="headerLineLinks" page="/info.do"><bean:message key="gnviewer.header.info"/></html:link> + </td> + </tr> + </table> + </div> + <div id="contentElement" class="contentElement"> + TODO: Info + </div> + <div id="footerElement"> + <jsp:include page="footer.jsp" /> + </div> + </div> + </body> +</html>
--- /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:56 2012 +0200 @@ -0,0 +1,94 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title> + <bean:message key="gnviewer.app.title"/> + </title> + <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> + <meta http-equiv="Content-Script-Type" content="text/javascript"/> + <meta http-equiv="Content-Style-Type" content="text/css"/> + <meta http-equiv="Expires" content="Mon, 01 Jan 1990 00:00:01 GMT"/> + <meta http-equiv="pragma" content="no-cache"/> + <meta http-equiv="cache-control" content="no-cache"/> + <meta name="robots" content="noindex"/> + <link href="styles/gnv.css" rel="stylesheet" type="text/css"/> + <script type="text/javascript" src="scripts/gnviewer.js"></script> + <script type="text/javascript"> + function copy_demo_wkt_line() { + document.getElementById('mesh_linestring').value = + "LINESTRING (" + + "0.4911 56.2489, " + + "10.4464 58.1608, " + + "12.2321 56.4127, " + + "13.1250 54.8832, " + + "15.4018 54.5008, " + + "19.6875 56.4127, " + + "20.6250 59.0349, " + + "28.1250 60.2640)"; + } + function copy_demo_wkt_polygon() { + document.getElementById('mesh_polygon').value = +"POLYGON ((" + +"-1.5763 58.3616, " + +" 0.7526 53.8428, " + +" 4.2686 53.1972, " + +" 7.9217 54.1441, " + +" 7.6020 56.2959, " + +"11.5747 57.2857, " + +"10.4788 58.4908, " + +" 4.2686 58.8996, " + +" 0.0219 58.5768, " + +"-1.5763 58.3616))"; + } + + function toggleBinType(toDeactivate) { + var ele = document.getElementById(toDeactivate); + + if (ele != null) { + ele.checked = false; + } + } + +function toggle(element) { + var ele = document.getElementById(element); + var vis = ele.style.visibility; + if (vis != "visible") { + ele.style.visibility = "visible"; + } + else { + ele.style.visibility = "hidden"; + } +} + + </script> + </head> + + <body id="gnviewerbody"> + <div id="overlay"></div> + <div style="width:100%;left:0;top:0;width:100%;height:100%;position:absolute;visibility:hidden;"> + <div id="overlayContent"> + <p> + <bean:message key="gnviewer.productselection.overlay.title"/> + <p class="reload"> + <a href="<%=response.encodeURL("describe.do?uid="+System.currentTimeMillis())%>" title="<bean:message key="application.reload"/>"> + <bean:message key="application.reload"/> + </a> + </p> + </p> + </div> + </div> + <div id="page"> + <div id="headerElement"> + <jsp:include page="header.jsp" /> + </div> + <div id="contentElement" class="contentElement"> + <jsp:include page="index.jsp" /> + </div> + <div id="footerElement"> + <jsp:include page="footer.jsp" /> + </div> + </div> + </body> +</html>
--- /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:56 2012 +0200 @@ -0,0 +1,45 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<html xhtml="true" locale="true"> + <head> + <title> + <bean:message key="gnviewer.app.title"/> + </title> + <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> + <meta http-equiv="Content-Script-Type" content="text/javascript"/> + <meta http-equiv="Content-Style-Type" content="text/css"/> + <meta http-equiv="Expires" content="Mon, 01 Jan 1990 00:00:01 GMT"/> + <meta http-equiv="pragma" content="no-cache"/> + <meta http-equiv="cache-control" content="no-cache"/> + <meta name="robots" content="noindex"/> + <link href="styles/default.css" rel="stylesheet" type="text/css"/> + <script type="text/javascript" src="scripts/gnviewer.js"></script> + </head> + + <body id="gnviewerbody"> + <div id="overlay"></div> + <div style="width:100%;left:0;top:0;width:100%;height:100%;position:absolute"> + <div id="overlayContent"> + <p> + <bean:message key="gnviewer.productselection.overlay.title"/> + </p> + </div> + </div> + <div id="page"> + <jsp:include page="header.jsp" /> + <div id="basefilter"> + <br/> + <h1> Generischer Viewer </h1> + <b>Name:</b> <bean:message key="application.name"/><br/> + <b>Version:</b> <bean:message key="application.version"/><br/> + <b>Date:</b> <bean:message key="application.releasedate"/><br/> + <h1> Artifaktdatenbank </h1> + <b>Name:</b> N/N<br/> + <b>Version:</b> N/N<br/> + <b>Date:</b> N/N<br/> + </div> + <jsp:include page="footer.jsp" /> + </div> + </body> +</html> \ No newline at end of file
--- /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:56 2012 +0200 @@ -0,0 +1,103 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<% + String serverPath = (String) request.getAttribute("mapserver"); + String mapfilePath = (String) request.getAttribute("mapfile"); + String layerName = (String) request.getAttribute("layer"); + String timeToLive = (String) request.getAttribute("ttl"); +%> + +<html xmlns="http://www.w3.org/1999/xhtml"> + <head> + <title> + <bean:message key="gnviewer.app.title"/> + </title> + <meta http-equiv="content-type" content="text/html; charset=UTF-8"/> + <meta http-equiv="Content-Script-Type" content="text/javascript"/> + <meta http-equiv="Content-Style-Type" content="text/css"/> + <meta http-equiv="Expires" content="Mon, 01 Jan 1990 00:00:01 GMT"/> + <meta http-equiv="pragma" content="no-cache"/> + <meta http-equiv="cache-control" content="no-cache"/> + <meta name="robots" content="noindex"/> + <link href="styles/gnv.css" rel="stylesheet" type="text/css"/> + <script type="text/javascript" src="http://www.openlayers.org/api/OpenLayers.js"></script> + <script type="text/javascript"> + var lon = 5; + var lat = 55; + var zoom = 5; + var map, layer; + + function init() { + <%if(request.getAttribute("wms_published") != null){ %> + map = new OpenLayers.Map('map'); + var server = '<%=serverPath%>'; + var back1 = new OpenLayers.Layer.WMS( + "Background1", + "http://gdisrv.bsh.de/arcgis/services/Background/Background/MapServer/WMSServer?", + { + layers: '0', + format: 'image/png', + transparent: false + }, + { + isBaseLayer: 'true', + singleTile: 'true' + } + ); + + layer = new OpenLayers.Layer.WMS( + "MyWMS", + server, + { + layers: '<%=layerName%>', + format: 'image/png', + transparent: 'true' + }, + { + singleTile: 'true' + } + ); + + map.addLayers([back1, layer]); + map.setCenter(new OpenLayers.LonLat(lon, lat), zoom); + <%}%> + } + + function toggle(element) { + var ele = document.getElementById(element); + var vis = ele.style.visibility; + if (vis != "visible") { + ele.style.visibility = "visible"; + } + else { + ele.style.visibility = "hidden"; + } + } + + </script> + </head> + + <body id="gnviewerbody" onLoad="init()"> + <div id="overlay"></div> + <div style="width:100%;left:0;top:0;width:100%;height:100%;position:absolute;visibility:hidden;"> + <div id="overlayContent"> + <p> + <bean:message key="gnviewer.productselection.overlay.title"/> + </p> + </div> + </div> + <div id="page"> + <div id="headerElement"> + <jsp:include page="header.jsp" /> + </div> + <div id="contentElement" class="contentElement"> + <jsp:include page="index.jsp" /> + </div> + <br> + <div id="footerElement"> + <jsp:include page="footer.jsp" /> + </div> + </div> + </body> +</html>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/web.xml Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,54 @@ +<!DOCTYPE web-app PUBLIC + "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" + "http://java.sun.com/dtd/web-app_2_3.dtd" > + +<web-app> + <display-name>Archetype Created Web Application</display-name> + <servlet> + <servlet-name>action</servlet-name> + <servlet-class>de.intevation.gnv.servlet.GNVActionServlet</servlet-class> + + <!-- The Struts Configuration, relative to the Project-Folder, + which should be used to configure this Project. --> + <init-param> + <param-name>config</param-name> + <param-value>/WEB-INF/config/struts-config.xml</param-value> + </init-param> + + <!-- The Log4J Configuration, relative to the Project-Folder, + which should be used in this Project. --> + <!-- + <init-param> + <param-name>de.intevation.gnv.servlet.log4j.configuration</param-name> + <param-value>WEB-INF/config/log4j.properties</param-value> + </init-param> + --> + + <!-- The Number of ArtifacDatabases which are configured in this Document. --> + <init-param> + <param-name>de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.count</param-name> + <param-value>1</param-value> + </init-param> + + <!-- One URL to an ArtifactDatabase which should be used in this Project. + It is possible to define several Artifactdatabases according to the + Number which is configured above. It is necessary to change the Count + - Number in param-name - for each Artifactdatabase. + The first one must be 1 --> + <init-param> + <param-name>de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.url.1</param-name> + <param-value>http://localhost:8181</param-value> + </init-param> + + <!-- Load the Servlet once on Systemstartup. + This should be done to configure the GNV at startup + and not if the first user will call a Page. --> + <load-on-startup>1</load-on-startup> + + </servlet> + <!-- Standard Action Servlet Mapping --> + <servlet-mapping> + <servlet-name>action</servlet-name> + <url-pattern>*.do</url-pattern> + </servlet-mapping> +</web-app>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/index.jsp Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,2 @@ +<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> +<logic:redirect forward="entrance"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/gnviewer.js Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,17 @@ +function displayOverlay() { + adjustOverlaySize(); + showDiv("overlay"); + showDiv("overlayContent"); +} + +function adjustOverlaySize() { + var lHeight = document.getElementById("page").scrollHeight; + //alert(lHeight); + var lOverlay = document.getElementById("overlay"); + lOverlay.style.height = lHeight + 'px'; +} + +function showDiv(pName) { + var el = document.getElementById(pName); + el.style.visibility = (el.style.visibility == "visible") ? "hidden" : "visible"; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/styles/calendar-blue.css Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,232 @@ +/* The main calendar widget. DIV containing a table. */ + +div.calendar { position: relative; } + +.calendar, .calendar table { + border: 1px solid #556; + font-size: 11px; + color: #000; + cursor: default; + background: #eef; + font-family: tahoma,verdana,sans-serif; +} + +/* Header part -- contains navigation buttons and day names. */ + +.calendar .button { /* "<<", "<", ">", ">>" buttons have this class */ + text-align: center; /* They are the navigation buttons */ + padding: 2px; /* Make the buttons seem like they're pressing */ +} + +.calendar .nav { + background: #778 url(menuarrow.gif) no-repeat 100% 100%; +} + +.calendar thead .title { /* This holds the current "month, year" */ + font-weight: bold; /* Pressing it will take you to the current date */ + text-align: center; + background: #fff; + color: #000; + padding: 2px; +} + +.calendar thead .headrow { /* Row <TR> containing navigation buttons */ + background: #778; + color: #fff; +} + +.calendar thead .daynames { /* Row <TR> containing the day names */ + background: #bdf; +} + +.calendar thead .name { /* Cells <TD> 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 <TD> 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 <TD> */ + background: #def; + padding: 1px 3px 1px 1px; + border: 1px solid #bbb; +} + +.calendar tbody td.active { /* Active (pressed) cells <TD> */ + 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 <TR> in footer (only one right now) */ + text-align: center; + background: #556; + color: #fff; +} + +.calendar tfoot .ttip { /* Tooltip (status bar) cell <TD> */ + 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; +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/styles/default.css Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,600 @@ +@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: #FF6600; + text-decoration: underline; +} + +legend { + border: 1px solid #003A66; + padding: 4px 5px; + margin: 0 0 0 0; + background-color: white; + font-weight: bolder; + color: #003A66; + clear: both; +} + +fieldset { + margin: 5px 0 0 10px; + padding-left: 10px; + padding-right: 10px; + border: 1px solid #003A66; + background-color: #F2F1F5; + background-repeat: repeat-x; + background-position: top left; + display: block; +} + +div { + margin: 0; + padding: 0; +} + +#browseDiv { + float: left; + margin-top: 1px; +} + +#loadDiv { + float: right; + margin-left: 5px; +} + +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; +} + +/* styles used in footer.jsp */ +.footerTable { + width: 100%; + background-color: white; +} + +.footerLine { + color: #003A66; + font-family: Arial,Helvetica,sans-serif; + font-size: 0.95em; + line-height: 1.1em; + padding-left: 1px; +} + +.footerTableLinks { + width: 100%; + background-color: #003a66; +} + +.footerLineLinks { + color: #FFFFFF; + font-family: Arial,Helvetica,sans-serif; + font-size: 1.5em; + text-decoration:none; +} + +.headerTableLinks { + width: 100%; + background-color: #003a66; +} + +.headerLineLinks { + color: #FFFFFF; + font-family: Arial,Helvetica,sans-serif; + font-size: 1em; + text-decoration:none; +} + +/* styles used content */ +#contentElement { + height: 80%; + position: absolute; + top: 85px; + width: 100%; + margin: 0px 0px 10px 0px; + overflow: auto; +} + +.bgblue2 { + background-color: #F7F7F9; +} + +#footerElement { + position: absolute; + bottom: 0px; + margin-top: 10px; + width: 100%; + height: 20px; +} + +.down { + padding-top: 15px; + width: 315px; +} + +.historyback { + padding-left: 10px; + vertical-align: top; + text-align: right; +} + +#parameterPanel { + position: absolute; + float: left; + left: 0px; + top: 5%; + width: 400px; + height: 95%; +} + +td.parameter { + font-size: 0.6em; +} + +.parameter { + color: #003A66; + font-size: 0.8em; + font-weight: bold; + padding-left: 5px; + text-align: left; + vertical-align: top; + width: 110px; +} + +.matrixHeader { + padding-left: 5px; + text-align: center; +} + +.matrixSelectableHeader { + padding-left: 5px; + text-align: left; +} + +.matrixContent { + text-align: center; +} + +.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-bottom: 2px; + border: 2px solid red; + padding: 2px; +} + +.errormsg { + color: red; + font-weight: bold; +} + +.chartException { + color: red; + font-size: 10px; + font-weight: bold; + margin-bottom: 2px; + border: 2px solid red; + padding: 2px; +} + +.inputException { + color: red; + font-size: 10px; + font-weight: bold; + margin-bottom: 2px; + border: 2px solid red; + padding: 2px; +} + +/* ====================== Header ============================= */ +#head { + height: 25px; + margin: 0; + padding: 0; + background-color: #103D64; +} + +#headline { + color: #4C7594; + font-family: "Arial Black",Arial,Helvetica,sans-serif; + font-weight: bold; + line-height: 1.1em; + padding-left: 5px; + width: 533px; +} + +.headline { + border-top: 2px solid #CCe0f4; + border-bottom: 2px solid #CCe0f4; + color: #4C7594; + /*font-weight: bold;*/ + font-size: 1.2em; + padding: 10px; +} + +#logo { + float:right; + background-image: url( ../images/bsh_logo.gif ); + background-repeat: no-repeat; + + top:0px; + height: 170px; + width: 75px; + +} +#head a { + clear:left; +} + +.reload { + margin-top: 10px; +} + +#project { + padding: 0px; + text-align: left; + font-size: 1.2em; + background-color: #e9e8f0; + position: absolute; + top: 0px; + left: 0px; + width: 100%; + height: 5%; +} + +#projectload { + float: left; + padding-left: 5px; + visibility: hidden; +} + +.devide { + width: 100%; + height: 2px; +} + +.projectException { + color: red; + font-size: 10px; + font-weight: bold; + margin-bottom: 2px; + border: 2px solid red; + padding: 2px; +} + +#load_error { + position:absolute; + top:175px; + left:375px; + 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#headerElement { + height: 85px; + position: absolute; + width: 100%; +} + +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%; + height: 100%; +} + +.showContent { + display: block; +} + +.hideContent { + display: none; +} + +div#selection { + float: left; + width: 300px; + margin-top: 30px; +} + +div#diagram { + float: left; + position: absolute; + top: 10%; + left: 330px; +} + +div.outerMap { + position: absolute; + top: 12%; + left: 350px; + width: 555px; + height: 436px; + margin: 0 0 0 0; + padding: 0 0 0 0; +} + +div.wms { + position: absolute; + top: 10%; + left: 0px; + height: 30px; + border: 1px solid red; +} + +div#map { + position: absolute; + top: 65px; + left: 0px; + width: 555px; + height: 381px; + border: 1px solid #CCD5DE; +} + +div.histogram { + float: left; + position: absolute; + top: 10%; + left: 330px; +} + +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 { + float: left; + position: absolute; + top: 10%; + left: 330px; + 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: 50px; + 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; + +} + +/* ----------------------------------- */
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/styles/gnv.css Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,289 @@ +body { + background-color: #FFFFFF; + font-family: verdana, arial, Helvetica, sans-serif; + font-size: 0.7em; + height: 100%; + margin: 0; + padding: 0; +} + +fieldset { + margin: 5px 0 0 10px; + padding-left: 10px; + padding-right: 10px; + padding-bottom: 5px; + padding-top: 5px; + border: 1px solid #003A66; + background-color: #F2F1F5; + background-repeat: repeat-x; + background-position: top left; + display: block; +} + +legend { + border: 1px solid #003A66; + padding: 4px 5px; + margin: 0 0 0 0; + background-color: white; + font-weight: bolder; + color: #003A66; + clear: both; +} + +input { + font-family: verdana, arial, Helvetica, sans-serif; + font-size: 0.9em; +} + +select, textarea { + font-size: 0.9em; + width: 250px; +} + +img { + border: 0px; +} + +a { + color: #FF6600; + font-size: 1.2em; + text-decoration: underline; +} + +/* Some classes for the header */ +#headerElement { + float: left; + top: 0px; + width: 100%; +} + +#header { + background-color: #143B62; + margin: 0; + padding: 0; + height: 50px; +} + +#headline { + color: #4C7594; + font-family: "Arial Black",Arial,Helvetica,sans-serif; + font-weight: bold; + line-height: 1.1em; + padding-left: 5px; + width: 533px; +} + +.headline { + border-top: 2px solid #CCe0f4; + border-bottom: 2px solid #CCe0f4; + color: #4C7594; + padding: 10px; +} + +.headerTableLinks { + width: 100%; + background-color: #003a66; +} + +.headerLineLinks { + color: #FFFFFF; + font-family: Arial,Helvetica,sans-serif; + font-size: 0.9em; + text-decoration:none; +} + +/* Some classes for the project load/save bar */ +#project { + background-color: #e9e8f0; + height: 5%; + left: 0px; + padding: 0px; + text-align: left; + top: 0px; + width: 100%; +} + +#projectload { + visibility: hidden; +} + +#browseDiv { + float: left; +} + +#loadDiv { + float: left; + margin-left: 5px; +} + +/* Some classes for the content */ +#contentElement { + float: left; + height: 90%; + width: 100%; + margin: 0px 0px 10px 0px; +} + +#contentRow { + vertical-align: top; +} + +#parameterColumn { + width: 400px; +} + +#parameterPanel { + float: left; + width: 350px; +} + +.static { + background-color: #F2F1F5; + width: 300px; +} + +.parameter { + color: #003A66; + font-weight: bold; + padding-left: 5px; + text-align: left; + vertical-align: top; + width: 110px; +} + +.historyback { + padding-left: 10px; + vertical-align: top; + text-align: right; +} + +.statistics { + width: 350px; +} + +div.outerMap { + float: left; + width: 555px; + height: 436px; +} + +div.wms { + top: 10%; + left: 0px; + height: 30px; + border: 1px solid red; +} + +div#map { + top: 65px; + left: 0px; + width: 555px; + height: 381px; + border: 1px solid #CCD5DE; +} + + +/* Some classes for the footer */ +#footerElement { + clear: left; + bottom: 20px; + width: 100%; + height: 20px; +} + +.footerTable { + width: 100%; + background-color: white; +} + +.footerLine { + color: #003A66; + font-family: Arial,Helvetica,sans-serif; + line-height: 1.1em; + padding-left: 1px; +} + +.footerTableLinks { + width: 100%; + background-color: #003a66; +} + +.footerLineLinks { + color: #FFFFFF; + font-family: Arial,Helvetica,sans-serif; + font-size: 0.9em; + text-decoration:none; +} + + +/* ---------- 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; +} + + +/* warnings and errors */ +.projectException { + color: red; + font-size: 10px; + font-weight: bold; + margin-bottom: 2px; + border: 2px solid red; + padding: 2px; +} + +.chartException { + color: red; + font-size: 10px; + font-weight: bold; + margin-bottom: 2px; + border: 2px solid red; + padding: 2px; +} + +.inputException { + color: red; + font-size: 10px; + font-weight: bold; + margin-bottom: 2px; + border: 2px solid red; + padding: 2px; +} + +.error { + color: #CD3426; + font-size: 10px; + font-weight: bold; + margin-bottom: 2px; + border: 2px solid red; + padding: 2px; +} + +.errormsg { + color: red; + font-weight: bold; +}
--- /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:56 2012 +0200 @@ -0,0 +1,90 @@ +package de.intevation.gnv.action.mapviewer.parser; + +import de.intevation.gnv.artifactdatabase.objects.map.Layer; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + +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; + +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<MapService> mapServices = ecp.getMapServices(); + assertNotNull(mapServices); + log.debug(mapServices.size()+"Mapservices parsed"); + assertEquals(2, mapServices.size()); + Iterator<MapService> 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<Layer> layer1 = mapService1.getLayer(); + log.debug("Layer parsed: "+layer1.size()); + assertEquals(5, layer1.size()); + Iterator<Layer> 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<Layer> layer2 = mapService2.getLayer(); + log.debug("Layer parsed: "+layer2.size()); + assertEquals(2, layer2.size()); + Iterator<Layer> layerIt2 = layer2.iterator(); + while(layerIt2.hasNext()){ + log.debug(layerIt2.next().toString()); + } + + } catch (Exception e) { + log.error(e,e); + fail(); + } + + } + +}
--- /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:56 2012 +0200 @@ -0,0 +1,99 @@ +package de.intevation.gnv.artifactdatabase.client; + +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; + +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; + +/** + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +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<ArtifactObject> factories = artifactDatabaseClient + .getArtifactFactories(); + if (factories != null && !factories.isEmpty()) { + Iterator<ArtifactObject> 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> inputParameter = new ArrayList<InputParameter>( + 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 (Exception e) { + log.error(e, e); + fail(); + } + } + +}
--- /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:56 2012 +0200 @@ -0,0 +1,55 @@ +package de.intevation.gnv.util; + +import de.intevation.gnv.artifactdatabase.client.DefaultArtifactDatabaseClient; + +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; + +/** + * @author <a href="mailto:tim.englich@intevation.de">Tim Englich</a> + * + */ +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); + } + } +}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/ressources/describe-ui-test.xml Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,10 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xform:select xmlns:xform="http://www.w3.org/2002/xforms" ref="product"> + <xform:label>product</xform:label> + <xform:choices> + <xform:item> + <xform:label>timeSeries</xform:label> + <xform:value>timeSeries</xform:value> + </xform:item> + </xform:choices> +</xform:select>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/ressources/externalinterfacecall.xml Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<gnviewer> + <mapservices> + <mapservice id="foo" type="arcims" url="http://foo.bar.de"> + <layer id="layer0" name="Layer 0"/> + <layer id="layer1" name="Layer 1"> + <layer id="layer2" name="Layer 2"/> + <layer id="layer3" name="Layer 3"/> + </layer> + <layer id="layern" name="Layer N"/> + </mapservice> + <mapservice id="foo1" type="wms" url="http://foo1.bar.de"> + <layer id="layer0" name="Layer 0"/> + <layer id="layer1" name="Layer 1"/> + </mapservice> + </mapservices> + <location> + <srs>EPSG:4324</srs> + <data>POINT(8.6 56.0)</data> + </location> +</gnviewer> \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/ressources/externalinterfacecall_curl.xml Fri Sep 28 12:13:56 2012 +0200 @@ -0,0 +1,37 @@ +<?xml version='1.0' encoding='UTF-8'?> +<gnviewer> + <mapservices> + <mapservice id='BSH_IMS_Prediction_Model_Current' type='arcims' + url='http://foo.bar.de'> + <Modeldata /> + <layer id='3' name='Speed Today 00:00 (Surface)' /> + <layer id='146' name='Surface Current Day After Tomorrow'> + <layer id='207' name='Day After Tomorrow 20:00 (Surface)'> + <layer id='208' name='Speed Day After Tomorrow 21:00 (Surface)' /> + <layer id='209' name='Speed Day After Tomorrow 20:00 (Surface)' /> + </layer> + </layer> + </mapservice> + <mapservice id='BSH_IMS_Marine_Environmental_Monitoring_Network' + type='wms' url='http://foo1.bar.de'> + <MARNET /> + <layer id='26' name='Air'> + <layer id='27' name='Temperature' /> + </layer> + <layer id='9' name='Salinity'> + <layer id='10' name='depth: (0m- -6m)' /> + </layer> + <layer id='13' name='OxygenSaturation'> + <layer id='14' name='depth: (0m- -6m)' /> + <layer id='15' name='depth: (-6m- -20m)' /> + <layer id='16' name='depth: (-20m- -50m)' /> + </layer> + </mapservice> + <mapservice id='BSH_IMS_Sea_Surface_Temperature_Analysis' + type='arcims' url='http://foo.bar.de' /> + </mapservices> + <location> + <srs>EPSG:4324</srs> + <data>POINT(8.6 56.0)</data> + </location> +</gnviewer> \ No newline at end of file