# HG changeset patch # User Thomas Arendsen Hein # Date 1348827240 -7200 # Node ID 7c4f81f74c47c3b8b08ca7c90b637f5f518084bd # Parent fca4b5eb8d2f10667919c90dfea693d999e1ed2a# Parent c01c220312d02d5e983817e0776102baf235a4d1 merged gnv-artifacts diff -r c01c220312d0 -r 7c4f81f74c47 gnv/ChangeLog --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/ChangeLog Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,3374 @@ +2011-02-01 Ingo Weinzierl + + * pom.xml: Upgraded the Restlet version from 2.0-SNAPSHOT to 2.0.4 which is + the current stable release. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Renamed the packages of Request and Response that have been changed from + Restlet 2.0-SNAPSHOT to 2.0.4. + +2010-11-30 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java: + Bugfix: if debug logging was disabled for this class, a Nullpointer + exception would have been thrown. + +2010-11-29 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/util/CaptureInputStream.java: New. This + class makes it possible to capture incoming data (InputStream) in a proper + way. + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java: + Improved the mechanism to print the incoming data to log by using the + CaptureInputStream class. + +2010-11-26 Ingo Weinzierl + + ISSUE #323 + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java: + In addition to the last revision: XML documents of HTTP Post request are + also logged to the logfile. + +2010-11-26 Ingo Weinzierl + + ISSUE #323 + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java: + Log the xml document of the MapViewer call (DEBUG). + + * src/main/webapp/WEB-INF/classes/log4j.properties: Enabled the DEBUG + output of the MapViewerCallAction logging, so that the MapViewer call xml + document can be found in the log file. + +2010-11-02 Ingo Weinzierl + + * src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java, + src/test/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserTestCase.java, + src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java, + src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java, + src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java, + src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java, + src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseInputException.java, + src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java, + src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java, + src/main/java/de/intevation/gnv/action/CommunicationKeys.java, + src/main/java/de/intevation/gnv/action/DoExportAction.java, + src/main/java/de/intevation/gnv/action/SwitchLanguageAction.java, + src/main/java/de/intevation/gnv/action/WMSAction.java, + src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java, + src/main/java/de/intevation/gnv/action/ShowStatisticAction.java, + src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java, + src/main/java/de/intevation/gnv/action/LoadAction.java, + src/main/java/de/intevation/gnv/action/SelectFisAction.java, + src/main/java/de/intevation/gnv/action/CreateHistogramAction.java, + src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java, + src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java, + src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserException.java, + src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParser.java, + src/main/java/de/intevation/gnv/action/mapviewer/parser/XMLExternalCallParser.java, + src/main/java/de/intevation/gnv/action/DoOutputAction.java, + src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java, + src/main/java/de/intevation/gnv/action/MapClientStandaloneAction.java, + src/main/java/de/intevation/gnv/action/CreateChartAction.java, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java, + src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/StoreAction.java, + src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java, + src/main/java/de/intevation/gnv/util/XMLUtils.java, + src/main/java/de/intevation/gnv/util/XSLTransformer.java, + src/main/webapp/images/bfg-logo.gif, + src/main/webapp/WEB-INF/jsp/wmslayout.jsp, + src/main/webapp/WEB-INF/jsp/version.jsp, + src/main/webapp/WEB-INF/jsp/index.jsp, + src/main/webapp/WEB-INF/jsp/header.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_wms_basic_informations.jsp, + src/main/webapp/WEB-INF/jsp/includes/info_german.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_wms_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/info_english.jsp, + src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp, + src/main/webapp/WEB-INF/jsp/info.jsp, + src/main/webapp/WEB-INF/jsp/footer.jsp, + src/main/webapp/WEB-INF/jsp/wmsstandalone.jsp, + src/main/webapp/WEB-INF/jsp/imprint.jsp, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Added a license header to each + of these files. + + * LGPL.txt: Added the license text of the GNU LGPL. + +2010-07-05 Hans Plum + + * src/main/webapp/WEB-INF/jsp/includes/info_german.jsp: + Made name more precise. + +2010-07-01 Ingo Weinzierl + + RELEASE 1.1 + + * src/main/webapp/styles/gnv.css: Some style adjustments for the info pages. + + * src/main/webapp/WEB-INF/jsp/info.jsp: The outer info page. It handles the + different languages (german, english) and includes the localized info page + corresponding the current locale. + + * src/main/webapp/WEB-INF/jsp/includes/info_german.jsp, + src/main/webapp/WEB-INF/jsp/includes/info_english.jsp: German and english + info pages. Currently, just the german page is filled with content. + + * pom.xml: Do not check if there are local changes before writing + buildnumber into MANIFEST. Local changes would stop the build process. + +2010-06-30 Ingo Weinzierl + + * Changes, NEWS, ChangeLog: Summarized changes + +2010-06-30 Ingo Weinzierl + + Issue311 + + * src/main/webapp/scripts/viewport.jsp: Changed OpenLayers MouseDefault + control with a Navigation control which is initially disabled. Users need + to activate the navigation control for panning expicitly before panning. + +2010-06-30 Ingo Weinzierl + + Issue307 + + * src/main/webapp/scripts/viewport.jsp: Added a 'resize' listener for the + browser window. If the browser window is resized, the size of the map + panel is adapted. For example, you have a small browser window at the + beginning and resize it later to its maximal size, the map panel takes all + the place it can get. Currently, just the width is adapted, because outer + div container has a fix height that doesn't change. + +2010-06-29 Tim Englich + + ISSU317 + + * src/main/resources/applicationMessages*.properties: + Added i18n support for the Name of the GNV Web Map Service. + + * src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp: + Added variable capfile to be able to reference the combobox directly. + + * src/main/webapp/WEB-INF/config/reachable-servers.conf: + Added configurationfile to fill the combobox with WMS. + + * src/main/webapp/scripts/olutils.jsp: + Read URL to Capabilities-Document from selected Item in Combobox. + Also switched to singleTile mode for inserted Layers. + + * src/main/webapp/scripts/viewport.jsp: + Switched Inputfile for GetCapabilities URl to an Combobox. + +2010-06-29 Tim Englich + + * src/main/webapp/images/ol/cloud-popup-relative.png: + Added missing Image for the PopupWindow of GetFeatureInforRequests. + +2010-06-28 Tim Englich + + ISSUE308 + + * src/main/webapp/styles/ol_style.css: + Removed unused CSS .title + + * src/main/webapp/images/ol/wvHeaderBG.gif: + Removed unused Image. + +2010-06-28 Tim Englich + + ISSUE311 + + * src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp: + Syncronized size of the headline of fullscreen-mode of the map-client + to the size of the headline of the web-client. + +2010-06-28 Tim Englich + + ISSUE311 + + * src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp: + Syncronized size of the headline of fullscreen-mode of the map-client + to the size of the headline of the web-client. + +2010-06-28 Tim Englich + + ISSUE311 + + * src/main/webapp/images/ol/slider.png: + Added missing Image slider.png using the colors of the BSH. + + * src/main/webapp/styles/ol_style.css: + Added CSS for Zoombox. Modified CSS for Mouseposition. The background now + is gray with opacity 0.75 + + * src/main/webapp/scripts/viewport.jsp: + Switched order of Controls to tree, legend, add layers. + +2010-06-28 Tim Englich + + ISSUE 306 + + * src/main/webapp/scripts/viewport.jsp: + Removed ScaleLine from Viewport + +2010-06-28 Tim Englich + + ISSUE 305 + + * src/main/webapp/scripts/viewport.jsp: + Removed store.load() because calling this function without a given + url to a capabilities-file will cause that the complete page, where the + Web-Client is placed in, will be loaded using the proxy without the post- + Parameter. + +2010-06-28 Tim Englich + + ISSUE 305 + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties, + src/main/webapp/WEB-INF/jsp/includes/display_wms_basic_informations.jsp: + Removed duplicate Information about Layernames / Layertitle from GUI. + Also removed unused resources. + +2010-06-25 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/util/XSLTransformer.java, + src/main/webapp/styles/gnv.css, + src/main/webapp/WEB-INF/config/struts-config.xml, + src/main/webapp/WEB-INF/config/templates/describe-ui.xsl, + src/main/webapp/WEB-INF/jsp/index.jsp: Removed the changes of rev1214 and + rev1206. + +2010-06-15 Tim Englich + + * src/main/webapp/WEB-INF/jsp/wmsstandalone.jsp, + src/main/webapp/WEB-INF/jsp/version.jsp, + src/main/webapp/WEB-INF/jsp/info.jsp, + src/main/webapp/WEB-INF/jsp/imprint.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp: + Fixed some more XHTML-Mistakes. + +2010-06-15 Tim Englich + + * src/main/webapp/scripts/olutils.js: + Removed file which was commited in r1202 by mistake + +2010-06-15 Tim Englich + + ISSUE 278: Again: Because something was wrong with r1202. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Prevent NPE if the Mapviewer has delivered no Geometry. + +2010-06-15 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Render direct links as list. + +2010-06-14 Ingo Weinzierl + + * pom.xml: The svn revision number is written to MANIFEST.MF while creating + war archive. + +2010-06-10 Sascha L. Teichmann + + Issue 219 + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java: + Broke over long line. + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Fed + more parameters into XSL transformation to allow better form rendering. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: + use explicit boolean to indicate that we are still able to advance. + + * src/main/java/de/intevation/gnv/util/XSLTransformer.java: Removed + stupid initial size of hash map. + + * src/main/webapp/styles/gnv.css: Added style to render direct + links to look like buttons. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added a few + forwards. The log is full of unresolvable forwards. TODO: This + needs to be checked and is not a problem introduced by direct + link feature. + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Render + the direct links if there are less than six item in a single + select list. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Cleanup a bit. Removed + form rendering here and moved it into the dynamic XSL transformation. + +2010-06-11 Tim Englich + + Issue278 + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Prevent NPE if the Mapviewer has delivered no Geometry. + + +2010-06-11 Tim Englich + + Customize Look and Feel to styleguide of the bsh. + + * src/main/webapp/scripts/viewport.jsp: + Link OpenLayers image-folder to images/ol to get the navigation-bar in + a customize look and feel. + + * src/main/webapp/styles/ol_style.css: + Added missing styles of Openlayer that must be overriden. + + * src/main/webapp/images/ol/east-mini.png, + src/main/webapp/images/ol/feature_info_off.png, + src/main/webapp/images/ol/feature_info_on.png, + src/main/webapp/images/ol/folder-open.gif, + src/main/webapp/images/ol/folder.gif, + src/main/webapp/images/ol/leaf.gif, + src/main/webapp/images/ol/navigation_history.png, + src/main/webapp/images/ol/north-mini.png, + src/main/webapp/images/ol/pan_off.png, + src/main/webapp/images/ol/pan_on.png, + src/main/webapp/images/ol/south-mini.png, + src/main/webapp/images/ol/tool-sprites.gif, + src/main/webapp/images/ol/west-mini.png, + src/main/webapp/images/ol/wvHeaderBG.gif, + src/main/webapp/images/ol/zoom_box_off.png, + src/main/webapp/images/ol/zoom_box_on.png, + src/main/webapp/images/ol/zoom-minus-mini.png, + src/main/webapp/images/ol/zoom-plus-mini.png, + src/main/webapp/images/ol/zoom-world-mini.png, + src/main/webapp/images/ol/zoombar.png: + Added missing icons and put an blue-filter to all icons. + +2010-06-11 Tim Englich + + * src/main/webapp/images/ol/measure_line_off.png, + src/main/webapp/images/ol/measure_line_on.png, + src/main/webapp/images/ol/measure_polygon_off.png, + src/main/webapp/images/ol/measure_polygon_on.png: + Removed unused Icons. + +2010-06-11 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/util/XSLTransformer.java, + src/main/webapp/styles/gnv.css, + src/main/webapp/WEB-INF/config/struts-config.xml, + src/main/webapp/WEB-INF/config/templates/describe-ui.xsl, + src/main/webapp/WEB-INF/jsp/index.jsp: Reverted the changes of rev1194 - + the feature implemented in rev1194 has not been finished so far. + +2010-06-11 Tim Englich + + * src/main/webapp/scripts/viewport.jsp, + src/main/webapp/scripts/olutils.jsp: + Modified output of the GetfeatureInfo-request. + All attributes of each feature which was returned by the request will be + put in one separte Table. + +2010-06-11 Tim Englich + + * src/main/resources/applicationMessages*.properties: + Added localized message if no layer were created. + +2010-06-11 Tim Englich + + * src/main/webapp/scripts/layers.jsp: + Bugfix: All Layer will only use one single Tile for displaying it. + +2010-06-11 Tim Englich + + Added the informations about how the WMS which was published during the + Workflow to the GUI. The URL to the capablities-documenet, the names of + the layer and the ttl will be listed. + + * src/main/java/de/intevation/gnv/action/WMSAction.java (execute): + Write the TTL to the Mapservice which is published. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java: + Added Getter for the Attribute TTL. Which shows how long the Layer of this + Service will be available. + + * src/main/webapp/WEB-INF/jsp/includes/display_wms_basic_informations.jsp: + Added new JSP-File for publishing the Basic-Informations of the WMS. + The URL which will deliver the Capablities is shown. + Also the Names of the Layers are listed. + At least the Time untiƶl teh Layers are available is displayed. + + * src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp: + Included Informationblock for the WMS which was produced in the workflow + before and now is published in the map. + +2010-06-10 Sascha L. Teichmann + + Issue 219 + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java: + Broke over long line. + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Fed + more parameters into XSL transformation to allow better form rendering. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: + use explicit boolean to indicate that we are still able to advance. + + * src/main/java/de/intevation/gnv/util/XSLTransformer.java: Removed + stupid initial size of hash map. + + * src/main/webapp/styles/gnv.css: Added style to render direct + links to look like buttons. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added a few + forwards. The log is full of unresolvable forwards. TODO: This + needs to be checked and is not a problem introduced by direct + link feature. + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Render + the direct links if there are less than six item in a single + select list. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Cleanup a bit. Removed + form rendering here and moved it into the dynamic XSL transformation. + +2010-06-10 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Removed some + code for testing that have been commited by mistaken. + +2010-06-10 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java: + New methods for session validation. Method isSessionExhausted(.) returns + true, if the session of the user is new. Another medhod returns the + ActionForward for selecting a fis - which is the start point of our + application. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java, + src/main/java/de/intevation/gnv/action/DoExportAction.java, + src/main/java/de/intevation/gnv/action/SwitchLanguageAction.java, + src/main/java/de/intevation/gnv/action/WMSAction.java, + src/main/java/de/intevation/gnv/action/ShowStatisticAction.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java, + src/main/java/de/intevation/gnv/action/LoadAction.java, + src/main/java/de/intevation/gnv/action/CreateHistogramAction.java, + src/main/java/de/intevation/gnv/action/DoOutputAction.java, + src/main/java/de/intevation/gnv/action/CreateChartAction.java, + src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/StoreAction.java: Validate the + session before doing some other stuff. If the session is exhausted, we + will return to the start point - the fis selection. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Renders an error message if the + session of the user is exhausted. There will be no link to return to the + last point in the parameterization. + + * src/main/java/de/intevation/gnv/action/CommunicationKeys.java: A new key + for session errors. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: An error message for + a session that timed out. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added a new forward to + the export action that makes it possible to step back to the fis + selection. + +2010-06-10 Ingo Weinzierl + + Issue177 - Messages for Java heap size errors. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added an error + message for Java heap size errors. + +2010-06-08 Tim Englich + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: + Added localization for the message that will be displayed if no + layer where found. + + * src/main/webapp/scripts/olutils.jsp: + Improved the workflow for inserting new layer into the client. + If no layer are found using the given url an exceptionmessage will be + displayed using an ext-window. + Now it is also possible to add more than one layer at once. + +2010-06-08 Tim Englich + + * src/main/webapp/scripts/layers.jsp: + Switched from Untiled Layer to standard layer objects to fix a bug + in the drag and drop function of the layertree and to enable the output + of the LegendGraphicPanel. + +2010-06-08 Tim Englich + + * src/main/webapp/scripts/olutils.jsp: + Rename olutils.js to olutils.jsp to enable possibility of i18n in this file. + Added references to resources in in Method addLayer. + + * src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp: + Replace linkt to olutils.js to olutils.jsp. + + +2010-06-08 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp: + Added reference to the new css-file extjs-override.css + + * src/main/webapp/images/folder-open.gif, + src/main/webapp/images/folder.gif, + src/main/webapp/images/leaf.gif, + src/main/webapp/images/tool-sprites.gif, + src/main/webapp/styles/extjs-override.css: + Customize Look and Feel to the css of this project. + +2010-06-08 Tim Englich + + * src/main/webapp/styles/ol_style.css: + Switch color of coordinate display of mousposition and scalebar from + black to white. + +2010-06-07 Tim Englich + + * src/main/webapp/scripts/viewport.jsp: + Put the bboxx from the mapservice-object and write it to an + javascript-variable. This variable will be used to center the map to + the extend of the data which should be visualized. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java (getBBoxValue), + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java (getBBoxValue): + Added a method for getting the bbox as a string from the mapservice-object. + + * src/main/java/de/intevation/gnv/action/WMSAction.java (execute): + Read the bbox from the retrieved meta-document and out it into the + mapservice-object which is used to represent the WMS in the client. + +2010-06-07 Tim Englich + + * src/main/webapp/scripts/viewport.jsp: + Switch the URl for the GetFeatureInfor Control to the URL of the WMS which + provide the generated Data of the GNV. + Also switch the Format of the Responsdata of the GetFeatureInfor-request to + GML. + +2010-06-07 Tim Englich + + * src/main/webapp/WEB-INF/config/struts-config.xml: + Added the Action "mapclient" for switching to the FullScreen-Mode of the + MapClient. + + * src/main/webapp/scripts/viewport.jsp: + Integrated the Viewport to render tne Mapclient in FullScreen-Mode. + + * src/main/java/de/intevation/gnv/action/MapClientStandaloneAction.java : + Added Action for handling the businesslogic to switch the Mapclient to the + FullScreen-Mode. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: + Added i18n for the Link-labeling for switching to the FullScreen-Mode. + + * src/main/webapp/WEB-INF/jsp/wmsstandalone.jsp: + Added JSP-Page wich will be used to render the gui for the + FullScreen-Mode of the Mapclient. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp, + src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp: + Extracted header for the html-page whcih will contain the mapclient so + that it could be used in several pages. + + * src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp: + Added JSP-Fragment which contains the gui for the FullScreen-Mode of the + Mapclient. + + * src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp: + Added link for switching to the fullscreenmode + +2010-06-04 Tim Englich + + * src/main/resources/applicationMessages.properties: + Replaced incompatible Umlauts + +2010-06-04 Tim Englich + + + * src/main/webapp/scripts/viewport.jsp, + src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: + Added i18n support to the mapclient. + +2010-06-04 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp, + /src/main/webapp/scripts/olutils.js: + Fixed bug that the "Add Layer"-Button was not correctly displayed if a + new WMS-Capabilities-Document was loaded. + Also improved the GUI that it is now Possible to load a WMS with a lot of + layer which could not be displayed in the GUI without uisng a scrollbar. + +2010-06-04 Ingo Weinzierl + + Issue275 + + * src/main/webapp/WEB-INF/jsp/index.jsp, + src/main/webapp/WEB-INF/jsp/header.jsp, + src/main/webapp/WEB-INF/jsp/footer.jsp, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Removed (X)HTML + errors/warnings. + +2010-06-04 Ingo Weinzierl + + Issue293 + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added strings for + refresh-button tooltip and png export-button. + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp: + Changed and added some tooltips. + +2010-06-01 Tim Englich + + + Checkin of changes which are necessary for the checkin of Revision 1139. + + * src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java (selectArtifactFactory), + src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java (selectedArtifactFactory): + Added functions for getting and setting a Mapservice to the SessionModel. + + * src/main/java/de/intevation/gnv/action/WMSAction.java : + Integrated the possibility to read all Layes from Metafile. + +2010-06-01 Tim Englich + + Providing functionality to read an WMS-Capabilities-Documnet and list all + layers which are include. This is the first step to provide the requested + function to integrate external WMS-Layers. + + To read the XML-Documents it is required to integrate the proxy.cgi script + into the Apache Webserver. for this you have to copy the proxy.cgi script + to /usr/lib/cgi-bin. + + You might have to change the allowedHosts in this script. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: + Integrated link to JavaScript-file olutils.js + + * /src/main/webapp/scripts/olutils.js: + Integrate Utilities-javaScript-fiel from Demonstrator to provide + JavaScript-Functions for handling WMS-Capabilities-Requests. + * src/main/webapp/scripts/viewport.jsp: + Integrated JavaScript-Elements for WMS-Capabilities Request. + + * src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp: + Integrated HTML-Elements for the WMS-Capabilities Request. + +2010-06-01 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + Implemented a N-step back history. There is a back-button besides every + parameter in the static ui part now. + +2010-06-01 Tim Englich + + * src/main/webapp/scripts/viewport.jsp: + Removed som obsolet Code. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: + Added reference to the new css-file. + + * src/main/webapp/images/ol/*.png: + Added Icons for an customized Toolbar. + + * src/main/webapp/styles/ol_style.css: + Added separat CSS-File for create own Style of the Buttons of the + OL-Buttonbar. + +2010-06-01 Tim Englich + + * src/main/webapp/scripts/openlayers, + src/main/webapp/scripts/geoext/, + src/main/webapp/scripts/ext/: + Added subfolders of third party libraries to svn-ignore. + +2010-06-01 Tim Englich + + Integrated the Openlayers-libraray according to the Intevation-Demonstrator + into the GUI. Now it is also possible to see all layers which are put into + the WMS by the user. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: + Removed the old JavaScript-references to the OpenLayers-Library and + put the references to the JavaScript-Files and CSS-files for + OpenLayers, ext and geoext into it. + + * src/main/webapp/WEB-INF/jsp/index.jsp: + Removed the html-elements which are required to render the MapClient and + put them into the file includes/display_map_inc.jsp. + + * src/main/webapp/WEB-INF/jsp/includes/display_map_inc.jsp: + Added own include-file for all html-elements which are required to render + the Mapclient. + + * src/main/webapp/scripts/viewport.jsp: + Added a JSP-file which creats an JavaScript-file which includes the + informations how to create the GUI of the WMS-Client.A JSP-file is required + because we have to insert dynamic usespecific Data into the file. + + * src/main/webapp/scripts/layers.jsp: + Added a JSP-file which creats an JavaScript-file which includes all + layers which should be displayed by OpenLayers. A JSP-file is required + because we have to insert dynamic usespecific Data into the file. + + * src/main/webapp/scripts/openlayers: + Folder for storing the JavaScript-Library Openlayers. + * src/main/webapp/scripts/openlayers/readme: + Readme-File which explains which steps must be done to provide the + required Version of the Openlayers-Library. + + * src/main/webapp/scripts/geoext/: + Folder for storing the JavaScript-Library geoext. + * src/main/webapp/scripts/geoext/readme: + Readme-File which explains which steps must be done to provide the + required Version of the GeoExt-Library. + + * src/main/webapp/scripts/ext/: + Folder for storing the JavaScript-Library Ext. + * src/main/webapp/scripts/ext/readme: + Readme-File which explains which steps must be done to provide the + required Version of the Ext-Library. + + +2010-05-27 Ingo Weinzierl + + Issue198 + + * src/main/java/de/intevation/gnv/action/WMSAction.java: Changed the XPath + of the layer name and the time to live. Rev1134 introduced a title for wms + layers - the title has been used before to specify a wms layer. The time + to live moved from layer node to abstract meta information. + + NOTE: Just the first layer of a wms request is visible in the OL + application currently, because there is no group-layer anymore. + +2010-05-27 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/includes/display_wms_options_inc.jsp: Make use + of the new method of DiagrammOptions to retrieve the value of an option as + string that have been introduced in rev1129. + +2010-05-27 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/header.jsp: Don't use the old session id when + restarting the application - start the application without old id. + +2010-05-26 Ingo Weinzierl + + Issue289 + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Store + chart/histogram options inserted by the user in the SessionModel. In the + case of a wrong input we are able to reuse the previous value. Options + inserted by the user are stored as native objects - no longer as string. + + * src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java: + Store options as Object instead of String to keep the information about + the type of the option (string, integer, double, etc). Furthermore there + is a new method getValue(String key, Locale locale) that returns the value + as string. Double values are formatted using the locale object. This + method is used in the gui to display a well formatted i18n string. + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp: + Make use of the new method in DiagrammOptions to retrieve the value as + formatted string. + +2010-05-25 Ingo Weinzierl + + Issue272 + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Read strings + for example linestring/polygon from resource bundle and put them into the + XSL-transformator. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added labels for + links to insert example linestring/polygon. + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Don't use static + strings for example linestring/polygon links but use the parameter that + have been added in DescribeUIAction - which are i18n. + +2010-05-25 Ingo Weinzierl + + Issue266 + + * src/main/java/de/intevation/gnv/action/SwitchLanguageAction.java: + Switching the language in the initial state will not throw an exception + anymore, but the language is toggled. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java (getValue), + src/main/java/de/intevation/gnv/util/XMLUtils.java (getXPath): + Fixed some warnings which are displaied during the javadoc-generation. + +namespaceContext + + * src/main/java/de/intevation/gnv/action/StoreAction.java, + src/main/java/de/intevation/gnv/action/ShowStatisticAction.java, + src/main/java/de/intevation/gnv/action/SelectFisAction.java, + src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java, + src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/LoadAction.java, + src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java, + src/main/java/de/intevation/gnv/action/DescribeUIAction.java, + src/main/java/de/intevation/gnv/action/CreateHistogramAction.java, + src/main/java/de/intevation/gnv/action/CreateChartAction.java, + src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java: + Added more Javadocs. Did some Codeformatting. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/util/XSLTransformer.java: + * src/main/java/de/intevation/gnv/util/XMLUtils.java: + * src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java: + Added more Javadocs. Did some Codeformatting. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java, + src/main/java/de/intevation/gnv/servlet/package.html: + Added more Javadocs. Did some Codeformatting. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/propertiesreader/package.html, + src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java, + src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java: + Added more Javadocs. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java: + Added more Javadocs. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java: + Added more Javadocs. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (doAdvance): + Added more Javadoc. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/package.html: + Added more Javadoc. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/action/sessionmodel/package.html: + Removed duplicate documentation from file. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/action/sessionmodel/package.html, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java: + Added more Javadocs. + +2010-05-18 Tim Englich + + * src/main/java/de/intevation/gnv/action/mapviewer/parser/package.html, + src/main/java/de/intevation/gnv/action/mapviewer/parser/XMLExternalCallParser.java, + src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserException.java, + src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParser.java: + Added more Javadocs. Format some Linees of code which are longer than 80 Chars. + +2010-05-17 Tim Englich + + * src/main/java/de/intevation/gnv/action/mapviewer/package.html, + src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java, + src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java: + Added more Javadocs. + +2010-05-09 Sascha L. Teichmann + + * src/main/webapp/styles/calendar-blue.css: Deleted. Not needed any more. + +2010-05-05 Ingo Weinzierl + + * src/main/webapp/WEB-INF/web.xml: Removed useless log4j configuration + section. + + * src/main/webapp/WEB-INF/classes/log4j.properties: Adapted logging + configuration for a productive system. + +2010-04-28 Ingo Weinzierl + + RELEASE 1.0 + + * Changes, NEWS, ChangeLog: Summarized changes. + +2010-04-28 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java: Removed + trailing whitespace. + +2010-04-28 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Removed + duplicated and unused imports. + +2010-04-27 Ingo Weinzierl + + 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 + + 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 + + * 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 + + * 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 + + 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 + + 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 + + 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 + elements to the request object which is sent to the server. + +2010-04-26 Ingo Weinzierl + + Issue225 + + * src/main/webapp/styles/gnv.css: Reduced the size of links in header and + footer. + +2010-04-26 Ingo Weinzierl + + 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 + + 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 + + Issue225 + + * src/main/webapp/styles/default.css: Adapted some font size in the + parameter panel. + +2010-04-23 Ingo Weinzierl + + 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 + + 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 + + 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 + + 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 + + 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 + + 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 + + * src/main/resources/applicationMessages.properties: Forgot a dot. ;-) + +2010-04-19 Ingo Weinzierl + + Issue224 + + * src/main/resources/applicationMessages.properties: Fixed a typo in the + german text of the overlay display. + +2010-04-18 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/**/*.java: + Using unix line endings only. + +2010-04-17 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/**/*.java: + Removed trailing whitespace. + +2010-04-14 Hans Plum + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * 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 + + 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 + + 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 + + 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 + + * src/main/java/de/intevation/gnv/**/package.html: New. + Added package description with text 'DOCUMENT ME!'. + +2010-03-29 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/**/*.java: + Bring @author javadoc tags in form '@author John Doe' + + find -name \*.java | \ + xargs sed -i \ + -e 's/@author[ ]\+\([^(<]\+\)[<(]\([^>)]\+\)[>)]/@author \1<\/a>/g' \ + -e 's@[ ]\+@@g' + +2010-03-29 Sascha L. Teichmann + + * rc/main/java/de/intevation/gnv/**/*.java: + Ordered imports. Removed needless imports. Removed empty headers. + +2010-03-29 Ingo Weinzierl + + 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 + + * src/main/java/de/intevation/gnv/**/*.java: + Removed trailing whitespace. + find -name \*.java | xargs sed -i 's/[ \t]\+$//' + +2010-03-26 Ingo Weinzierl + + 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 + + * 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 + + * 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 + + * 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 + + * 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 + + * src/main/resources/applicationMessages.properties: + Added new German resource for fis_marinefeatures according to msg1067 + of Issue2005. + +2010-03-19 Tim Englich + + * src/main/resources/applicationMessages*.properties: + Added Ressources for new FIS Marine Features. + +2010-03-19 Ingo Weinzierl + + * 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 + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java (addParameters): + Some Codecleanup done. + +2010-03-19 Tim Englich + + * 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 + + 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 + + * 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 + + 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 + + * 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 + + * src/main/resources/applicationMessages*.properties: + Integrated Resource for FIS Contis and Nauthis. + +2010-03-10 Ingo Weinzierl + + * 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 + + * 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 + + * 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 + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Adjusted xpath expression to find exception nodes in xml documents again. + The prefix 'art:' has been missing. + +2010-03-08 Ingo Weinzierl + + Issue187 + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Exports with + target 'img' will get a file extension that corresponds to their + mime-type. There was no code path for 'img' before, which caused the + problem, that 'img'-exports had a '.txt'-file extension. + +2010-03-06 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: + Removed duplicated imports. + +2010-03-05 Ingo Weinzierl + + Issue190 + + * src/main/java/de/intevation/gnv/action/CreateHistogramAction.java, + src/main/java/de/intevation/gnv/action/CreateChartAction.java: Reset + diagram options. Switching between chart and histogram caused some 'null' + values in text fields. After resetting these options, we don't have these + problems anymore - text fields will be filled with default values in this + case. + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp: + Removed useless file. + +2010-03-05 Tim Englich + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + ISSUE 181: Removed duplicate Drawaing of the Lengendvalue of Groupelements + for choosing different heights for several Parameters + +2010-03-05 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + 'publishWMS' returns a whole document which contains meta information used + for mapfile generation - not just a string. These information contain + MapServer URL and the path to its mapfile. + + * src/main/java/de/intevation/gnv/action/WMSAction.java: Fetch MapServer + settings from resulting document after wms-publishing to display these + values in gui. + + * src/main/java/de/intevation/gnv/util/XMLUtils.java: Converted class + methods into static methods to use them without initializing an object of + XMLUtils. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: Show MapServer and layer + information in gui and use MapServer settings to feed OpenLayers client. + + * src/main/webapp/styles/default.css: Added some classes to adjust style of + information table (wms service, layer name) and map area. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added column labels + for displaying MapServer information. + +2010-03-04 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/index.jsp, + src/main/webapp/WEB-INF/jsp/wmslayout.jsp: Removed map-div from index.jsp + and moved it to wmslayout. So, we don't have an empty div with grey border + in our application if there is no map currently existing. Load images from + MapServer as 'image/png'. + + * src/main/webapp/styles/default.css: Adjusted style for customizing + map-div. + +2010-03-02 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Added export mode to 'out'-xml document. + + * src/main/java/de/intevation/gnv/action/DoOutputAction.java, + src/main/java/de/intevation/gnv/action/DoExportAction.java: Call + 'doOutput' for triggering an output like chart, histogram, csv or odv with + a new parameter export mode which contains the export format (img, pdf, + svg). + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Added export + mode to HTTP-Get requests. + +2010-03-02 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + Implemented a One-Step-Back-History. The user is able to step back to + the last state and to the state for choosing the fis. + +2010-03-02 Ingo Weinzierl + + Issue184 + + * src/main/webapp/WEB-INF/jsp/index.jsp: Display chart per default, when + reaching a final state, which doesn't need any further user input. + +2010-03-01 Ingo Weinzierl + + Issue183 + + * src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java: + Take care on exceptions and render an error message if an exception + occured. + +2010-03-01 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Removed little + copy-paste mistake while setting file-extension for exports. + +2010-03-01 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Set + file-extension according to mime type for histogram exports. + +2010-02-26 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Render a matrix + for measurement selection. + + * src/main/webapp/styles/default.css: Added new css class to adjust the + matrix' column headers. + +2010-02-25 Ingo Weinzierl + + Issue178 + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Added a code + path for export actions, where no export mode is given. + +2010-02-24 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Added + user selected type of bin setting (number of bins, bin width) to diagram + options and request object which are used to create links for chart + images. + + * src/main/java/de/intevation/gnv/action/DoOutputAction.java: Added user + selected type of bin setting to InputParameters which are used to create + xml documents for 'out' target. + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp: Added + checkboxes to select the field to adjust bins in histogram charts (bin + width or number of bins). When selecting a checkbox, the other box becomes + disabled. + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: JavaScript function to toggle + checkboxes. + +2010-02-24 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp: Append + user inserted parameter from histogram options (width, height, bin width, + number of bins) to http request when fetching the histogram image. + +2010-02-23 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java: + New method returning export modes. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java: + Object storing information about mime-type, description and name of an + export mode. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Parse export modes from describe document and put them into OutputMode + objects. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Now, this + action is able to adjust histogram parameter as well. + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: An export is + triggered regarding a new parameter 'mode' which value can be 'pdf', + 'svg' or 'img'. Before, we just took care on 'target' parameter. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Transformed draw + button into an update button. + + * src/main/webapp/images/arrow_refresh.png: Icon for update button. (source: + famfamfam) + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Moved + exports from action panel into options panel. Actions (chart, histogram, + etc) are devided from exports (png, pdf, svg). + +2010-02-23 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/struts-config.xml: Foward to wmslayout.jsp + instead of mainlayout.jsp if the user selected wms target. + + * src/main/webapp/WEB-INF/jsp/wmslayout.jsp: New page for rendering a wms + client (OpenLayers). JavaScript loading take place in this page. If the + user select the wms target, a forward to this page will be done. + + TODO: Include OpenLayers library from local filesystem instead of loading + it from openlayers.org! + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Removed OpenLayers JavaScript + library and function to initialize OpenLayers. This reduces traffic while + parameterization. + +2010-02-23 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/CreateChartAction.java: Class to + trigger chart rendering. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Changed + request parameter from 'diagram' (deprecated) to 'chart'. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added title and + labels for histogram options. + + * src/main/webapp/images/chart_curve.png: Chart icon (source: famfamfam) + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added new action to + trigger chart rendering analog to histogram action. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Render chart option panel only if + the user already selected charts. + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: Show + diagram/chart options panel only if the user chose one of them. Placed + these option panels beneath the action panel. + + * src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Added new + icon for chart rendering. + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Removed js debug output. + +2010-02-22 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/struts-config.xml: New action 'WMSAction'. + It triggers the generation of shapefiles and mapfile and sets an internal + flag to intialize an OpenLayers map. + + * src/main/java/de/intevation/gnv/action/WMSAction.java: Action which + triggers the creation of shapefiles and mapfile. An internal flag is set + to initialize an OpenLayers map with the layer even published. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java: + Added a new method to send a request to the artifact server and start + shapefile and mapfile creation. + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Added javascript functions to + read url parameters and initialize OpenLayers. + + * src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Call 'wms.do' + after clicking WMS button which triggers WMSAction. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Added a div-container for rendering + an OpenLayers map. + + * src/main/webapp/styles/default.css: New class for styling map + div-container. + + * src/main/java/de/intevation/gnv/util/XMLUtils.java: Made method static to + be able to use it without creating an object of this class. + + +2010-02-15 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added an action + 'histogram' to render histograms. + + * src/main/java/de/intevation/gnv/action/CreateHistogramAction.java: Added a + new action for rendering histograms. + + * src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Display an + icon for histograms if this output mode is present for this artifact. + + * src/main/webapp/images/chart_bar.png: Icon for histograms from famfamfam + iconset. + + * src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp: JSP for + rendering histograms. + + * src/main/webapp/styles/default.css: Added a style class for adapting + histogram div. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Include display_histogram_inc if + histogram action have been chosen by user. + + * src/main/resources/applicationMessages_en.properties, + src/main/resources/applicationMessages.properties: Button label and + alternative image text for histograms. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Removed + comment lines at the beginning of the file. These empty comment lines + would cause trouble later, when inserting GPL text automatically with a + script. + +2010-02-12 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Render an + icon to trigger a step-back in history for each state. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added missing forwards + used for stepping back to former states. + +2010-02-12 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp: + Added further XML-Nodes for simulating the MapViewer-Call more detailed. + +2010-02-12 Tim Englich + + * src/main/webapp/WEB-INF/config/struts-config.xml: + Added new Action for Calling the Page with the Form for simmulating + the MapViewer-Interface-request. + Using the URL + http://localhost:8080/gnv/mvcall.do + you will retrieve the Formular with the MapViewer-Interface-Request-body + + * src/main/webapp/WEB-INF/jsp/header.jsp: + Added an Switch that will manage that the GUI with the Form of the + MapViewer-Interface-Document only will be displaied if it is requested. + + * src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java (execute): + Added new Action for handling the Request that should show the Form + for insterting the MapViewer-Interface-Document. + +2010-02-12 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Modified the Create-Artifact-Request-Body that a Geometry will be put into + the Parameter if one is given e.g. using the MapViewer-Interface request. + +2010-02-09 Tim Englich + + * src/test/ressources/externalinterfacecall_curl.xml, + src/test/ressources/samplecall.txt: + Added Sampledata and a sample how to call the MapViewer-Interface using CURL. + +2010-02-09 Tim Englich + + * src/main/webapp/styles/default.css: + Added some stylinginformation for the Textarea for the XML-Document. + * src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp: + Integrated an Textarea so that is possible to manipulate the XML-Document + which simulates the MapViewer-Interface-Body. + +2010-02-09 Tim Englich + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java (execute): + Removed trailing and leading Whitespaces from the Parametervalue which + contains the XML-Document to avoid XML-Parsingerrors. + +2010-02-09 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (createMetaDataRequestBody): + Fixed a NPE. Now it is possible to put an Mapservice without an Layer into + the Request-Document of am Mapviewer-Interface-Call. + +2010-02-05 Ingo Weinzierl + + Issue170 + + * pom.xml: Changed log4j version to 1.2.14 (later version causes errors and + breaks maven build process). + +2010-02-02 Tim Englich + + * src/main/webapp/WEB-INF/jsp/header.jsp: + Added temporally Include of includes/display_mapviewercall_inc.jsp for the + Simulation of the MapViewer-Interface-Request. + + * src/main/webapp/WEB-INF/jsp/includes/display_mapviewercall_inc.jsp: + Added new Includefile with the Formular which includes the Data for the + Simulation of the MapViewer-Interface-Request. + +2010-02-01 Tim Englich + + * src/main/webapp/WEB-INF/config/struts-config.xml: + Added am Action for handling the MapViewer-Interface. + if /gnv/extcall.do is called the processing of the defined + Information will be done and the GUI will be displayed. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java: + Implementation of the interface ParametrizedArtifactObject fro the + representation of ArtifactFactories which has further Information. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java (addParameters): + Added new Interfacedefinition ParametrizedArtifactObjects for representing those + ArtifactObjects which includes further Informations. E.g. for creating an + new Artifact. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java (equals): + Override equals-method to get ap proper comparisons of the kinds of objects. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (getArtifactFactoryMetaInformation): + Added Method to retrieve Metainformations form the ArtifactDatabases. + Also added the possibility to send further Informations (e.g: Parameters) + in the Request-body of an Create-Artifact-Call. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (getArtifactFactoryMetaInformation): + Added Method to retrieve Metainformations form the ArtifactDatabases. + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java (execute): + Added further Businesslogic to the Action which will handle the MapViewer- + InterfaceCall. Now the retrieved Informations will be sent to the + ArtifactDatabase an the retrieved Informations will be used to reduce + the displayed "Fachinformationssysteme". And also will be used to + send these Informations (e.g: Parameters) during the creation of an + new Artifact. + +2010-01-27 Hans Plum + + RELEASE 0.3 + + * Changes, NEWS, ChangeLog: Summerized activities + +2010-01-27 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Added a + workarround to avoid input failures caused by multi select boxes with only + one entry. They look like text input fields and don't force the user to + select a row. In this case, the single entry is selected automatically. + +2010-01-25 Ingo Weinzierl + + * src/main/webapp/styles/default.css: Added a class for dynamic tables + - enabled input fields - to adjust font size of input fields. + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: Removed + local-name() method, inserted a table for 'group' items (like input fields + of dates) and resized the height of multi select boxes - max 5 items or + less. + + * src/main/webapp/WEB-INF/jsp/index.jsp: Removed a typo which made the html + output invalid. + +2010-01-22 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Add width, + height and the boolean value to adjust the visibility of points in charts + to the pdf and svg export links. + +2010-01-22 Ingo Weinzierl + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added legend for + summary box. + + * src/main/webapp/styles/default.css: Adapted some css classes regarding the + position of boxes and removed background image in fieldsets. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Removed + useless div container (div container is now outside the xsl sheet). + + * src/main/webapp/WEB-INF/jsp/index.jsp: Moved former parameter into a + fieldset and added a label to this fieldset. + +2010-01-22 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/ShowStatisticAction.java: This + action 'calculates' the statistic and shows the result in the gui. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added controller and + forwards. + + * src/main/webapp/images/statistics.png: Statistic icon. FIXME: Give a Source here! + + * src/main/webapp/WEB-INF/jsp/index.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp: Added symbol + in action box to show the statistic. + + * src/main/webapp/styles/default.css: Adjusted some parameter for a proper + placement of the statistic box. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for + statistic icon. + +2010-01-22 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/DescribeUIAction.java: New action. + The only task of this action is to parse the describe document and create + static and dynamic user interface out of it. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java, + src/main/java/de/intevation/gnv/action/DoOutputAction.java, + src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java: + Removed xsl transformation. Classes which needs xsl transformation inherit + from DescribeUIAction which does the transformation. Now, it is much + easier to write new actions, because they do not need to parse the + describe document and create static and dynamic user interfaces. + + Removed some useless imports. + +2010-01-22 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/index.jsp, + src/main/webapp/WEB-INF/jsp/header.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp: + - Improved the design and the usibility concept ("Bedienkonzept"). + Removed the useless "draw" button after reaching the last state which + has some output modes. + - Render chart options - if chart creation is possible for this state - and show + export actions. + - Moved chart options and export actions to the left side beneath the + static and dynamic panals for parameterization. + - Removed some warnings and errors regaring html conformance. + + * src/main/webapp/styles/default.css: Made some necessary adjustments + regarding the movement of chart option and action boxes. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for + action box. + + * src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java: + Removed pathes of xsl sheets from code and put them to a central place. + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Added + urls to xsl transformer for step-back links and create a dynamic ui only + if there is content for it - avoid creation of empty boxes. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: Write + dynamic ui only if there is content. Some code formatting done. + + * src/main/webapp/images/back_button.png: Button to step back to a previous + state. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added forwards to fis + selection and previous states. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Enabled + link to step back to fis selection. + +2010-01-20 Ingo Weinzierl + + Issue149 + + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Show + chart if there are output modes existing for this state. Set internal + value of checkboxes to 'true' if they are selected. + + TODO: We should check if there is an output mode named 'chart' before + rendering a chart. + +2010-01-20 Ingo Weinzierl + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for + char option 'draw data points'. + +2010-01-20 Ingo Weinzierl + + * src/main/webapp/styles/default.css, + src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Adapted + style of static ui to bsh style. Improved indentation. + +2010-01-19 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl, + src/main/webapp/WEB-INF/jsp/index.jsp: Commented links to step back in + history out and always render a fis select box (reason for this is the + next release and a too buggy 'step-back-history'). + +2010-01-19 Tim Englich + + * src/test/ressources/externalinterfacecall.xml: + Added an Request-Document which contains an Call which might be + send from the MapViewer to the GNV. + + * src/test/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserTestCase.java: + Added TestCase for testing the functionality of the XMLExternalCallParser-Implementation. + +2010-01-19 Tim Englich + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java: + DefaultImplementation of the Interface MapService. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java : + Added a new Interfacespecification for representing an MapService retrieved + by an MapViewer-Call + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java: + DefaultImplementation of the Interface Layer. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java: + Added a new Interfacespecification for representing an Layer retrieved + by an MapViewer-Call + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java + (getArtifactFactoryMetaInformation), src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java + (getArtifactFactoryMetaInformation): + Added new Method for retrieving Metainformation for the ArtifactFactories using + the Data which is parsed using the ExternalCallParser. + + * src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserException.java (ExternalCallParserException): + New ExceptionClass which is used to specify Exception which occurs during parsing + an ExternalCallParser. + + * src/main/java/de/intevation/gnv/action/mapviewer/parser/XMLExternalCallParser.java : + Added an Implementation of the Inteface ExternalCallParser which is able to parse + an XML-Document. + + * src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParser.java : + Added a new Interface which provides the required Methods for parsing an + Request from the MapViewer an provide the parsed Data. + + * src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java: + Added new Action which provied the reauired logic for Implementing the + Interface to the MapViewer. + +2010-01-18 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added a new controller + which causes a return to the point, where the user can choose a fis. + + * src/main/java/de/intevation/gnv/action/SelectFisAction.java: Controller to + reset the SessionModel and to jump back to fis selection. + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: Made + the link to return to the fis select box available in XSL. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Check the + 'fis' attribute is contained in select1 nodes and create a link in this + case. + +2010-01-18 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java: + Render the static part of the gui as well - not just the dynamic part. + + * src/main/webapp/WEB-INF/jsp/index.js: Do not include the fis combo box if + the describe document contains a static part, which means that the user + already selected a fis. + + * src/main/webapp/styles/default.css: Added 20px space at the top of the + static table. Otherwise the table hides the links to load and save + projects. + +2010-01-17 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Simpler + demo WKT polygon. + +2010-01-17 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: + Only render chart addons when we have a chart. + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: + Set right file extensions if we have WMS or ZIP export. + +2010-01-17 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: + Add links to download zip files and WMS layers if they are + available. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: + Added i10n for new download link types. + + * src/main/webapp/images/svg.png: New. Gimp rendered PNG + of official SVG logo. Creative Commons license. + + * src/main/webapp/images/pdf.png: New. Crystal pdf icon. + LGPLv2 license. + + * src/main/webapp/images/disk.png, src/main/webapp/images/map_go.png: + famfamfam icons for disk and map. Creative Commons license. + +2010-01-15 Sascha L. Teichmann + + * src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java, + src/main/java/de/intevation/gnv/util/XSLTransformer.java: + Cleanup imports. + +2010-01-14 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: + Fixed a bug which caused that the user was not able to draw charts + anymore. Query the 'output' node of the describe document and render a + 'draw'-button if existing. If 'output' is not existing, render a 'select' + button to step forward to the next step. + +2010-01-13 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Added 'doAdvance' method to be able to advance only - without feed or + describe. We need this method to step back to previous states. Advance was + bundled with feed and describe, before. + + * src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java: + Some code refactoring. + + * src/main/java/de/intevation/gnv/util/XSLTransformer.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: Set + parameter of xsl transformer which contains the url to step back to a + previous state. This parameter is used in xsl sheet to render a + link into the user interface. + + * src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java: + New controller to step back to a previous state. + + * src/main/webapp/WEB-INF/config/struts-config.xml: Added a new action which + calls PreviousArtifactStepAction to step back to previous states. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + Refactored gui rendering. The static part of the parameter list is + rendered in a table with three columns (icon to step back, parameter name, + selected value). The target state to step back to is contained as + attribute 'art:state' in 'xform:select', 'xfom:select1' and 'xform:group' + nodes. + + * src/main/webapp/styles/default.css: Added a style class to adapt the first + column of the static part's table. + +2009-01-13 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Shortened + fractions digits to four places to be displayable in static + ui description. + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Fixed target id of text input field. + +2009-01-13 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp, + src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Added demo wkt polygon to test the "Horizontalschitt". + Remove this when we have the GIS interface. + +2010-01-09 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Use XMLUtils.ElementCreator to create new elements for xml documents. + +2010-01-08 Tim Englich + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java (execute), + src/main/java/de/intevation/gnv/action/DoOutputAction.java (execute): + Removed Encodingerrors from listed Files. All Files are now UTF-8 compliant. + +2010-01-05 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java: + NamespaceContext class used by gnv artifacts. + + * src/main/java/de/intevation/gnv/util/XMLUtils.java: Added + ArtifactNamespaceContext as default namespace context while creating + XPath objects. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Removed + local-name() methods. + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java: Adjust + xpathes regarding namespace changes. + +2010-01-05 Ingo Weinzierl + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Removed + for-each statements and replaced them with templates. + +2010-01-04 Ingo Weinzierl + + * src/main/webapp/styles/default.css: Added new classes for displaying + parameters and values in left panel. + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Static + nodes will be rendered as text instead of disabled xforms. + +2009-12-17 Sascha L. Teichmann + + RELEASE 0.3 + + * Changes, NEWS, ChangeLog: Summerized activities + +2009-12-17 Sascha L. Teichmann + + * src/main/resources/applicationMessages.properties: + s/Modeldaten/Modelldaten/ + +2009-12-17 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp: Added demo wkt linestrings + via xslt and javascript. + +2009-12-17 Hans Plum + + Issue 129: Release 0.2: Verbesserung der ļæ½bersetzungen + + * src/main/resources/applicationMessages.properties: + Fixed i18n strings reported by experts + +2009-12-14 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp: + Added switch between boolean and other Values to determin wether a checkbox + is required or an text-field should be used. + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java (execute): + Added parsing of boolean-Option-Values to provide this Feature. + +2009-12-14 Hans Plum + + Issue109: Tomcat: Konfiguration des Kontexts enthļæ½lt Redundanz + + * src/main/webapp/META-INF/context.xml: + Removed obsolete configuration attributes. + +2009-12-09 Sascha L. Teichmann + + * src/main/resources/applicationMessages.properties: Fixed some + spelling problems. + +2009-12-01 Tim Englich + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute): + Removed feed Call before Chart- and Statisticsgeneration is called, because + it is not longer required by the Artifactdatabase. + + +2009-12-01 Ingo Weinzierl + + * src/main/webapp/WEB-INF/web.xml: Reverted changes in config from last + revision, which have been committed by mistake. + +2009-12-30 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Add svg + extension to file when exporting charts to svg. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for svg + export link. + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: Added link + for svg export in html gui. + +2009-12-30 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: Added + link for pdf export in html gui. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for pdf + export link. + + * src/main/java/de/intevation/gnv/action/DoExportAction.java: Added pdf + extension to file when exporting charts as pdf. + + NOTE: Update gnv-artifacts to rev381 which supports pdf export. + +2009-11-23 Tim Englich + + * src/main/resources/applicationMessages*.properties: + Added Properties which hold the Version-information of the + GNV which will be set by te Maven package-process. + * src/main/webapp/WEB-INF/config/struts-config.xml: + Added an Action which make the Version-Information accessible. + Now it is possible to get those Information using /version.do + * src/main/webapp/WEB-INF/jsp/version.jsp: + Added an Page where it is possible to get the Information about the current + Version of the GNV and the ArtifactDatabase + * pom.xml: + Added Plugin for creating the BildTime and BildVersion of the gnv. + Replace Tokens in the /src/main/ressources Files + +2009-11-20 Ingo Weinzierl + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Removed mistake from xml structure of the artifact protocol. Mime-type + node was 'out' instead of 'mime-type'. + +2009-11-13 Hans Plum + + RELEASE-0.2 + + * Changes, NEWS: + Summerized activities. + +2009-11-13 Hans Plum + + * ChangeLog: + Unified entries with references to issues. + +2009-11-13 Tim Englich + + * src/main/webapp/WEB-INF/web.xml: + Added Documentation of Configuration-Entries. + +2009-11-12 Tim Englich + + * src/main/webapp/styles/default.css: + Added CSS-Entry for the Exception Message Container and + put the div at a proper place. + * src/main/resources/applicationMessages*.properties: + Added localized Exception Messages. + * src/main/webapp/WEB-INF/jsp/header.jsp: + Added the localization of Exception Messages. + +2009-11-12 Tim Englich + + Issue 71: Error while Serialisation of Sessions + + * src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java, + src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Imports organized. + * src/main/java/de/intevation/gnv/artifactdatabase/objects/*.java: + Made all Interfaces Serailizable and add UID to all Objects issue71 + +2009-11-12 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp: + Implemented a better GUI-Structure for displaying the Statisticdata. + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java: + Added new Beanstructur for a better Representation of the Statistics which + is generated by the ArtifactDatabase. + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (calculateStatistics): + Changed the parsing algorithm of the Document which is generated + by the ArtifactDatabase. + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (calculateStatistics): + Changed Return-Value to ArtifacStatisticsSet according to the new Structur of + Statistics that will be generated by the ArtifactDatabase. + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute): + Changed the Resultvalue from ArtifactStatisticValue to ArtifacStatisticsSet according + to API-Changes of the ArtifactDatabaseClient + +2009-11-11 Tim Englich + + Issue 80: Error handling when session got expired + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute): + Catch NPE and tell the user that the Session has expired. issue80 + +2009-11-11 Tim Englich + + Issue 81: Input of coordinate values do not show up after update + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + Remove
Tag after Input-Elements + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Add an
-Tag after the generation of Select-Boxes to get + a better look and feel in the ui. issue81 + * src/main/webapp/WEB-INF/jsp/index.jsp: + Replace NonBreakingSpace-Strings from UI issue81 + +2009-11-11 Tim Englich + + Issue 81: Input of coordinate values do not show up after update + + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + BugFix: Text-Inputfields will now be diabaled in static-ui issue81 + +2009-11-06 Ingo Weinzierl + + * src/main/resources/applicationMessages.properties: Replaced german umlaut + witch ascii character. + +2009-11-06 Ingo Weinzierl + + * pom.xml: Changed Restlet repository from M3 to Snapshot. + +2009-11-06 Ingo Weinzierl + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: Added link + for exporting data in ODV format. + + * src/main/resources/applicationMessages.properties, + src/main/resources/applicationMessages_en.properties: Added label for + odv export and changed label of CSV export. + +2009-11-05 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java (ArtifactDatabaseClientFactory): + Removed some deprecatde TODO-Tasks. + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (getCurrentStepDescription): + Changed the Describe-Call of an Artifact from get to post an add the Flag which + determines if the UI should be delivered to the client. + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (getCurrentStepDescription): + Added the possibility to put an Flag which determines if the UI should be delivered from + the artifact-database to the Metodsignature. + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java (execute), + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute), + src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java (execute), + src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java (testArtifactDatabaseClient): + Added the Flag if the UI should be delivered by the artifact-database to the Method-Call. + +2009-10-28 Tim Englich + + * src/main/resources/applicationMessages*.properties: + Added Ressources for two new FIS. Current Meter and Ice Station Reports + +2009-10-27 Tim Englich + + * src/main/resources/applicationMessages_en.properties: + Added Ressources for two new FIS. Seegangsarchiv and SEACAT + +2009-10-22 Tim Englich + + Issue 58: Behaviour by missing DB connection + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute): + Bugfix NPE was thrown when an Exception occured in the Called ArtifactDatabase-Server issue58. + +2009-10-21 Tim Englich + + Issue 28: Client is not multi-instance enabled + + * src/main/webapp/META-INF/context.xml: + Added context.xml to permitt cookies to provide + Multisession-Usability for a single Client issue28 + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp: + Added URL-Rewrite to add the SessionID to the requested URL to get + the System work without cookies. issue28 + +2009-10-19 Tim Englich + + Issue 55: Unified input of coordinate input + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl, + src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + Added uniform Visualization of Single Input-Elements in GUI. issue55 + +2009-10-19 Tim Englich + + Issue 51: Translations for diagram options to be improved + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp, + src/main/resources/applicationMessages*.properties: + Integrated Ressouces for OutputOptions issue51 + +2009-10-19 Tim Englich + + Issue 35: Wrong data input forces GNV to start from beginning + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute): + Now the UI will compelte be shown if the User has done an Mistake entering + values to input-fields eg. Coordinates or formatted Date-Strings. issue 35 + +2009-10-19 Tim Englich + + Issue 47: Improving translations in time series + + * src/main/resources/applicationMessages_en.properties: + Changed Lablevalues according to issue47 + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Add the possibility to render XForms-Group-Lables as Legend-Entries of + one Step in the GUI + +2009-10-16 Tim Englich + + Issue 48: Improving translation of statistics panel + + * src/main/resources/applicationMessages_en.properties: + Conformation to the tanslation of the Statisticsdescriptors issue48 + +2009-10-16 Tim Englich + + Issue 49: Integration of FIS to Mesh + + * src/main/resources/applicationMessages_en.properties: + Adding the Names of the two new FIS to the Propertiesfiles issue49 + +2009-10-07 Sascha L. Teichmann + + RELEASE 0.1 + + * Changes, NEWS: Summarized changes. + +2009-10-06 Tim Englich + + * src/main/resources/applicationMessages.properties Edited: + Removed obsolet Entries + * src/main/resources/applicationMessages_en.properties Added: + Added the Support for english-Language + +2009-10-06 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (doGetRequestInternal) Edited: + Read the Status-Code from the Response and throw an Exception + which Message will be visualized in the GUI. gnv/issue18 + +2009-10-08 Sascha L. Teichmann + + * Changelog -> ChangeLog: Moved to make eclipse happier. + +2009-10-08 Sascha L. Teichmann + + * Changelog: Unified changelog style. + +2009-10-08 Sascha L. Teichmann + + * pom.xml: Remove XMLBeans stuff, set filtered resources to UTF-8 + +2009-10-06 Tim Englich + + * src/main/webapp/index.jsp Added: + Added Index-Page for Global-Forward to Start-URL of the Project gnv/issue14 + * src/main/webapp/WEB-INF/config/struts-config.xml Edited: + Added Global Forward to determine the Start-URL of the Project. gnv/issue14 + +2009-10-06 Tim Englich + + * src/main/webapp/WEB-INF/jsp/header.jsp Edited: + Deaktivate Links save Project and load Project gnv/issue12 + +2009-10-05 Tim Englich + + * src/main/resources/applicationMessages.properties Edited: + Added some more FIS-Ressource. + +2009-10-02 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java (getArtifactDatabaseClient): + Putting the ClientLanguage into the getArtifactDatabaseClient-Signature. + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (setLocale) Edited, + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (setLocale) Edited: + Added the Support of Setting the ClientLanguage to the ArtifactDatabaseClient + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java (execute) Edited, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute) Edited, + src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java (execute) Edited, + src/main/java/de/intevation/gnv/action/DoOutputAction.java (execute) Edited, + src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java(execute) Edited: + Put the Locale of the Calling Client to the Communication with the ArtifactDatabase. + + * src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java (testArtifactDatabaseClient) Edited: + Added DefaultLocale German to the ArtfactDataBaseClient call. + +2009-10-02 Tim Englich + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Edited, + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl Edited: + Switched Value for legend from ref-Attribute to Label-Element + * src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp Edited: + Added translation for FIS (ArtifactFactorynames) + * src/main/resources/applicationMessages.properties Edited: + Added Germannameds for FIS. + +2009-10-02 Tim Englich + + * src/**/*.java Edited: + Format Code to max 80 Chars per Row + +2009-10-02 Tim Englich + + * src/main/java/de/intevation/gnv/util/XSLTransformer.java CLEANUP , + src/main/java/de/intevation/gnv/util/XMLUtils.java CLEANUP , + src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java CLEANUP , + src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java CLEANUP , + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java CLEANUP , + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java CLEANUP , + src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java CLEANUP , + src/main/java/de/intevation/gnv/action/DoOutputAction.java CLEANUP: + Change non static accesses to static members using declaring type + Change indirect accesses to static members to direct accesses (accesses through subtypes) + Remove unused imports + Add missing '@Override' annotations + Add missing '@Deprecated' annotations + Remove unnecessary casts + +2009-10-02 Tim Englich + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java (execute) Edited, + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute) Edited, + * src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java (execute) Edited, + * src/main/java/de/intevation/gnv/action/DoOutputAction.java (execute) Edited, + * src/main/java/de/intevation/gnv/action/DoExportAction.java (execute) Edited, + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java (execute) edited: + Added ExceptionHandling to this Actions + * src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java (getExceptionForward) Edited: + Added Method for Resolving the ExceptionForward from the Mapping. + * src/main/webapp/WEB-INF/jsp/header.jsp Edited: + Read ExceptionMessage from RequestAttributes + +2009-09-28 Tim Englich + + * src/main/resources/applicationMessages.properties Edited: + Adding missing StatisticsDescription for Arithmetic Mean. + +2009-09-28 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java Added, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java Added: + Added the Interface and the Defaultimplementation for the Representation of Statistic-Values. + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute) Edited: + Added the Busionesslogic for Calculation the Statistics to the Action. + * src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Edited, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Edited: + Added the Methods for setting and getting the statistics to the SessionModel + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (calculateStatistics) Edited, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (calculateStatistics) Edited: + Added the Method for retrieving the Statistics from the current Artifcat. + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp Edited: + Put the Values of the Statitics into the View. + * src/main/webapp/styles/default.css Edited: + Changed CSS-for Statistics so that it would be displayed. + +2009-09-25 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Edited: + Bug fixed in CSV_Export Link + +2009-09-25 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java Edietd: + Integrated some Method for accessing and Setting OutputModes to an ArtifactDescription. + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java Edited: + Adding some Beans and their InterfaceDescription for the Representation of OutputModes + supported by an Artifact + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Edited: + Fetsching the OutputMode-Informations from the Describedocument and put them into a Collection + of OutputModes. + + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java Edited: + Restet SessionModel integrated. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Edited: + Cast for ArtifactDescription removed. + + * src/main/java/de/intevation/gnv/action/DoOutputAction.java Edited, + src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Edited: + Dynamical read of OutputParameter for Outputgeneration + + * src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Edited:, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Edited: + Added some Method for retrieving Diagrammoptions and reset the SessionModel + + * src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java Edited: + Dynamic Options Support Added + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp Edited: + Dynamic Rendring of the Outputparameters of an ArtifactoutputType added. + Ath this Moment only The Outputparameter for Chart ist provided. + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Edited : + Integrated dynamic Setting of Diagramm-Parameter to the Link. + Also Read MimeType from the OPutputParameters of the Artifact. + +2009-09-25 Tim Englich + + * src/main/java/de/intevation/gnv/action/DoOutputAction.java Edited: + Some Refactoring work done. + Logging Integrated. Extract Method for setting Responseheader Informations. + + * src/main/java/de/intevation/gnv/action/DoExportAction.java Added: + Action for performing the Exports eg. CSV and Chart + * src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Added: + Action for do the Bussinesslogic for storing the Diagrammoptions that were + changed by the User. + * src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Edited, + * src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Edited: + Added Accessmethod for the Diagrammoptions. + + * src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java Added: + Bean for the Representation of Diagrammoptions + + * src/main/resources/applicationMessages.properties Edited: + Added som GUI Lables. + + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Edited, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp Add, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp Add, + src/main/webapp/WEB-INF/jsp/includes/display_diagramm_adons_inc.jsp Add: + Added the GUI for the Statistics and Diagramoptions and tge Export. + + * src/main/webapp/WEB-INF/config/struts-config.xml Edited: + Added Actions for Performing Exports and Changing Diagramoptions. + +2009-09-24 Tim Englich + + * src/main/webapp/scripts/gnviewer.js Edited: + Removed unused Methods from File. + +2009-09-24 Tim Englich + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp Edited: + Obsolet Javascript References Removed + Added Javascript-Reference to the gnviewer.js File + * src/main/webapp/WEB-INF/jsp/index.jsp Edited: + Please Wait Dialog integrated if an Form will be submittend + +2009-09-24 Tim Englich + + * src/main/webapp/scripts/gnviewer.js Added: + Added Javascript-File from Old-Project Revision: 3101 + +2009-09-24 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Edited: + Codecleanup + ExceptionReporthandling integrated + +2009-09-24 Tim Englich + + * src/main/webapp/WEB-INF/config/log4j.properties Added: + Standard Log4J-properties-File which will log all Informations to the Console. + * src/main/webapp/WEB-INF/web.xml Edited: + Added init-Parameter to tell the Application where the Log4J-propertiesfile ist located. + * src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java (init) Edited: + Reading Logging-Properties from Propertiesfile. Path maust beconfigured in the web.xml File + + +2009-09-23 Tim Englich + + * src/main/webapp/WEB-INF/web.xml Edited: + Added Count of ArtifactDatabases and Database-URL to this File + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (ARTIFACTDATABASE_URL_ID) Edited: + Added Static Constants for identifing ArtifactDatabase URLS in PropertiesReader + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java (initialize) Edited: + Read ArtifactDatabase URLS from PropertiesReader + +2009-09-23 Tim Englich + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute) Edited: + Removed Image-Element and put it into the jsp-Page + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Edited: + Moved Image-Element from Classfile to this location. + URL will now be encoded for usage without cookies. + * src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp Edited, + src/main/webapp/WEB-INF/jsp/index.jsp Edited: + URL will now be encoded for usage without cookies. + +2009-09-23 Tim Englich + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Edited: + Selection on Input-UI-Data will be fetched from the UI and visualized + in the GUI. + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl Edited: + Single Text Input-Elements now will be surround with an div and an form Element + 2009-09-22 Tim Englich + + * src/main/java/de/intevation/gnv/util/XSLTransformer.java Edited: + Logging reduced for a better Performance. XML-Nodes should not be logged because their size could + cause Problems in Log4J and the ConsoleAppender of Eclipse + +2009-09-21 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Remnoved logging of Resultdocuments becaus it slow down the Application. + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java (execute): + Added support of ArtifactFactory Reload if Session was lost. + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute): + Added Support of more than one Product. + +2009-09-17 Tim Englich + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Some Refactoring work done. + * src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: + Added XSL-Template for Transforming the stazic UI + * src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp: + Refactored FIS Rendering to it's own Include-File + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: + Refactored Diagramm Rendering to it's own Include-File + * src/main/webapp/WEB-INF/jsp/index.jsp: + Some Refactoring Work done. + * src/main/webapp/styles/default.css: + Some Changes in DIV-Formatting to get a propper Layout. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (NextArtifactStepAction): + Static UI integrated + +2009-09-17 Tim Englich + + * src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp: + Refactored FIS Rendering to it's own Include-File + * src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp: + Refactored Diagramm Rendering to it's own Include-File + * src/main/webapp/WEB-INF/jsp/index.jsp: + Some Refactoring Work done. + * src/main/webapp/styles/default.css: + Some Changes in DIV-Formatting to get a propper Layout. + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (NextArtifactStepAction): + Static UI integrated + +2009-09-16 Tim Englich + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute) Edited: + UI also Rendered when Chart is already visualized. + * src/main/webapp/WEB-INF/jsp/index.jsp: + Some Stylingfixes done. + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl: + Legend-Element for SelectEntries Integrated + +2009-09-16 Tim Englich + + * src/main/webapp/WEB-INF/jsp/mainlayout.jsp Edited, + src/main/webapp/WEB-INF/jsp/index.jsp Edited: + Integrate the new Pageinfrastructur into the Mainlayout + + * src/main/webapp/WEB-INF/config/struts-config.xml Edited: + Integrate message-resources into the Strutsconfiguration and change + the mainpage from index.jsp to mainlayout.jsp + +009-09-16 Tim Englich + + * src/main/webapp/WEB-INF/jsp/header.jsp Added, + src/main/webapp/WEB-INF/jsp/footer.jsp Added, + src/main/resources/applicationMessages.properties:Added, + src/main/webapp/WEB-INF/jsp/mainlayout.jsp Added, + src/main/webapp/styles/*, + src/main/webapp/scipts/*, + src/main/webapp/images/*: + Import of MainLayout, Styles, images and Scripts from old System Revision: 3101 Does not compile + +2009-09-16 Tim Englich + + * src/main/webapp/WEB-INF/config/struts-config.xml Edited, + src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Edited, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (doOutput) (doFeed) Edited, + src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java (execute) Edited, + src/main/java/de/intevation/gnv/action/DoOutputAction.java Added: + Chartoutput Added to the View + +2009-09-16 Tim Englich + + * src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java Edited: + Added Transformerlogic to the Testcase + + * src/main/webapp/WEB-INF/jsp/index.jsp Edited: + Integrated the UI of the Artifact + + * src/main/webapp/WEB-INF/config/struts-config.xml Edited: + Added ActionHandling for managing the next Businesslogic to go to the next Step of an Artifact + + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Edited: + Added Transformation-Rules for Input-Elements + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java Added, + src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java Added: + Infrastructur for providing InputParametes as an Object + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java (getInputParameter) (setInputParameter) Edited: + Add Methods for providing the reuired Input-Parametes of the current ArtifactDescription + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Edited, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (doNextStep) Edited: + Added doNextStep Method for doing all ControllerWork to move the Artifact into the next Step + + * src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Added: + Action for switching to the next Step of an Artifact + +2009-09-15 Tim Englich + + * src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java: + New Testcase for testing the usability of XSL-Transformations + * src/test/ressources/describe-ui-test.xml Added: + An Sample-Document for testing XSL-Transformations + * src/main/webapp/WEB-INF/jsp/index.jsp Edited: + Added the html-Fragment of the transformated Describe-Methode-response to the document. + * src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Added: + XSL-Template for transforming an Xform-Element to a HTML-Select-Element + * src/main/java/de/intevation/gnv/util/XSLTransformer.java Added: + XSl-Transformer for doing XSL-Transformations of the ResultDocuments of + the ArtifactDatabase + * src/main/java/de/intevation/gnv/util/XMLUtils.java Edited: + Integrate a Method for writing an XML-Node to a String for debugging. + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java: + Some Unused imports removed an select the first Child of the ui Node. + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java (execute) Edited: + Integration of the Describe-Stuff for rendering an GUi + +2009-09-15 Tim Englich + + * src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java (testArtifactDatabaseClient) Edited: + Added "Create Artifact" and "Describe Artifact" to the Testszenario. + +2009-09-14 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java, + src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java, + src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java: + Support for Initial DescribeCall to ArtifactDatabase implemented + +2009-09-14 Tim Englich + + * src/main/webapp/WEB-INF/config/struts-config.xml: + Added two ActionMappings: + One for showing all FIS (ArtifactFactories) in an View. + The other for selceting one ArtifactFactory an visualizing the First Step of an Artifact. + * src/main/webapp/WEB-INF/jsp/index.jsp Edited: + Added an Combobox for selecting an FIS + * src/main/webapp/WEB-INF/web.xml: + Added the Servletmapping for the Struts Framework + * src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java Added, + src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java Added, + src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Edited: + Some ActionHandler added for Handling the different Requests of the GNV. + FetchArtifactFactoriesAction: Will provides the Controllerlogic for Queriing all Reachable ArtifactFactories. + SelectArtifactFactoryAction will select one Specific ArtifactFactory and will create + an Instance in the ArtifactDatabase. + + * src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Added, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java Added, + src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Added: + Interface and Defaultimplementation of an Model which can store the Session-Specific Informations. + e.g. Reachable ArtifactFactories and the current Artifact which should be used. + +2009-09-14 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Edited: + All Methods for doing the create-Request and reading the Result-Document implemented. + * src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java (createNewArtifact) Edited: + Add Method for creating a new Artifact in the ArtifactDatabase + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java (Artifact): + Added new Class for the Representation of an Artifact + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java (getHash) Edited, + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java (getHash) Edited + getHash Method added. Now it will be possible to read the Hash of an Artifact send by the Artifactdatabase. + * src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java (getInstance) Edited: + Bug Fixed. factory will now be instantiated. + * src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java Edited, + Integration of temporal Basic Log4J Support. + +2009-09-11 Tim Englich + + * pom.xml: Further Dependencies and Plugins added + Deleted some utdated Files + +2009-09-11 Tim Englich + + * src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java Added: + Testcase for querying Artifacfactorydescriptions from the ArtifactDatabase + +2009-09-11 Tim Englich + + * src/main/webapp/WEB-INF/jsp/index.jsp Added , + src/main/webapp/WEB-INF/config/struts-config.xml Added, + src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java Added + src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Added: + Basic Struts-Infrastructur Added + +2009-09-11 Tim Englich + + * src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java Added, + src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java Added, + src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java Added, + src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java Added: + Infrastructur for Reading Properties from a Map or SercletConfig an provide them + to the whole Application. + +2009-09-11 Tim Englich + + * src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java Added, + src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java Added: + ObjectStructor for Representing delivered Objects from the ArtifactDatabase + + * src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java Added, + src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Added, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java Added, + src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java Added: + Integrated Interface-Structure to handle the communication to the ArtifactDatabase + +2009-09-10 Tim Englich + + * .svnignore Added: Added Eclipse specific Files and Folders to the Ignorelist + +2009-09-10 Tim Englich + + * pom.xml: Created with maven and put the Moduledependencies into it + * Changes | Changelog | NEWS | README | TODO: Added + * src/**: Added to the Project diff -r c01c220312d0 -r 7c4f81f74c47 gnv/Changes --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/Changes Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,146 @@ +2010-06-30 RELEASE 1.1 + + NEW: + + * Integrated an enhanced map client for working with gnv internal and + external wms layers + * N-Step back history for parameterization + * Added JavaDoc + + FIXES: + + * Input validation corresponding the current locale (#289) + * Fixed broken XPathes while wms publishing + * Removed duplicated layernames from gui (#305) + * Missing i18n for gui elements (#227, #272, #297, #177) + * Typos (#293) + + + +2010-04-28 RELEASE 1.0 + + NEW: + + * 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 diff -r c01c220312d0 -r 7c4f81f74c47 gnv/LGPL.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/LGPL.txt Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,502 @@ + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! diff -r c01c220312d0 -r 7c4f81f74c47 gnv/NEWS --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/NEWS Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,92 @@ +2010-06-30 RELEASE 1.1 + + * Integrated an enhanced map client for working with gnv internal and + external wms layers + + * N-Step back history for parameterization + + + +2010-04-28 RELEASE 1.0 + + NEW: + + * 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. + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/pom.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/pom.xml Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,165 @@ + + 4.0.0 + de.intevation.bsh + gnv + war + 1.0-SNAPSHOT + gnv + http://maven.apache.org + + scm:svn:svn+ssh://${user}@thoe.intevation.de/home/projects/Geospatial/bsh-generischer-viewer/Material/SVN/gnv + scm:svn:svn+ssh://${user}@thoe.intevation.de/home/projects/Geospatial/bsh-generischer-viewer/Material/SVN/gnv + scm:svn:svn+ssh://${user}@thoe.intevation.de/home/projects/Geospatial/bsh-generischer-viewer/Material/SVN/gnv + + + UTF-8 + + + + maven-restlet + Public online Restlet repository + http://maven.restlet.org + + + + + commons-fileupload + commons-fileupload + 1.2.1 + + + junit + junit + 3.8.1 + test + + + org.restlet.jse + org.restlet + 2.0.4 + + + org.restlet.jse + org.restlet.ext.xml + 2.0.4 + + + tomcat + servlet-api + 5.5.15 + provided + + + struts + struts-el + 1.2.9 + runtime + + + struts + struts + 1.2.9 + compile + + + log4j + log4j + 1.2.14 + + + + gnv + + + maven-compiler-plugin + + 1.5 + 1.5 + + + + maven-war-plugin + + + + ${basedir}/src/main/webapp + + images/ + WEB-INF/jsp/application/ + + + + + + true + + + ${buildNumber} + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2 + + + + de.intevation.artifactdatabase.App + + + + + + org.codehaus.mojo + exec-maven-plugin + 1.1 + + java + + -classpath + + de.intevation.artifactdatabase.App + + + + + + org.apache.maven.plugins + maven-eclipse-plugin + + true + true + 1.5 + + 1.2.3 + + + + + org.codehaus.mojo + buildnumber-maven-plugin + + + validate + + create + + + + + false + false + + + + + + src/main/resources + true + + + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ArtifactDatabaseActionBase.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,129 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; + +import org.apache.log4j.Logger; +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +/** + * Basicimplemantation for all Actions which should serv request for + * the GNV. + * @author Tim Englich + * + */ +public class ArtifactDatabaseActionBase extends Action { + + /** + * The id of the action which should used if the execution + * of the action was successful. + */ + protected final static String SUCCSESS_FORWARD_ID = "success"; + + /** + * The id of the action which should be used if an exception has occurred + * during the execution. + */ + protected final static String EXCEPTION_FORWARD_ID = "success"; + + /** + * 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; + } + + /** + * Returns the Action that should be used if an exception has occurred. + * @param mapping the mapping which holds all available Actions + * @return the Action that should be used. + */ + protected ActionForward getExceptionForward(ActionMapping mapping) { + log.debug("ArtifactDatabaseActionBase.getExceptionForward"); + ActionForward lForward = mapping.findForward(EXCEPTION_FORWARD_ID); + return lForward; + } + + /** + * Encodes the String to prevent cross-site-scripting + * @param s the string that should be encoded + * @return the encoded string + */ + protected String encode(String s) { + log.debug("String to encode: " + s); + s = s.replaceAll("<", "<"); + s = s.replaceAll(">", ">"); + s = s.replaceAll("\"", """); + s = s.replaceAll("&", "&"); + + log.debug("Encoded string: " + s); + return s; + } + + /** + * Encodes the StringArray to prevent cross-site-scripting + * @param s the stringarray that should be encoded + * @return the encoded stringarray + */ + protected String[] encode(String[] s) { + if (s == null) + return null; + + String[] good = new String[s.length]; + for (int i = 0; i < good.length; i++) { + good[i] = encode(s[i]); + } + + return good; + } + + + protected boolean isSessionExhausted(HttpServletRequest request) { + HttpSession session = request.getSession(); + return session.isNew(); + } + + + protected ActionForward sessionExhaustedForward( + ActionMapping mapping, ActionForm form, + HttpServletRequest request, HttpServletResponse response) + throws Exception + { + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_SESSION_ID, + "SessionTimeout has occured"); + + log.warn("Session timed out."); + + return new FetchArtifactFactoriesAction().execute( + mapping, form, request, response); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,211 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import de.intevation.gnv.action.sessionmodel.DiagrammOptions; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + +import de.intevation.gnv.artifactdatabase.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 Tim Englich + */ +public class ChangeOptionsAction extends DescribeUIAction { + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(ChangeOptionsAction.class); + + /** + * Constructor + */ + public ChangeOptionsAction() { + super(); + } + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + + 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); + Locale locale = sm.getCurrentLocale(); + + if (outputMode != null) { + Collection op = outputMode + .getOutputParameters(); + if (op != null) { + Iterator it = op.iterator(); + DiagrammOptions oldOptions = sm.getDiagrammOptions(); + DiagrammOptions diagrammOptions = new DiagrammOptions(); + while (it.hasNext()) { + OutputParameter parameter = it.next(); + String name = parameter.getName(); + Object old = oldOptions != null + ? oldOptions.getValue(name) + : 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")) { + try { + double val = parseDoubleValue(locale, value); + String valStr = Double.toString(val); + log.debug("Change diagram options [" + + name +"] to " + val); + diagrammOptions.setValue(name, val); + } + catch (ParseException pe) { + 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 double parseDoubleValue(Locale locale, String value) + throws ParseException + { + log.error("LOCALE FOR DOUBLE PARSING: " + locale.toString()); + NumberFormat format = NumberFormat.getNumberInstance(locale); + Number number = format.parse(value); + + return number.doubleValue(); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/CommunicationKeys.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/CommunicationKeys.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +/** + * This class defines some keys used to store different exception types in the + * session. + * + * @author Tim Englich + */ +public class CommunicationKeys { + /** + * The Key which should be used for accessing ExceptionMessages + */ + public final static String REQUEST_EXCEPTION_MESSAGE_ID = "request_exception_message_id"; + + + public final static String REQUEST_EXCEPTION_SESSION_ID = "request_exception_session_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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/CreateChartAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/CreateChartAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + +/** + * This controller is called to display charts.
+ * An attribute 'chart' on the request object is activated which inserts an + * image calling a chart output of the server. + * + * @author Ingo Weinzierl + */ +public class CreateChartAction extends DescribeUIAction { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger logger = Logger.getLogger(CreateChartAction.class); + + + /** + * Constructor + */ + public CreateChartAction() { + super(); + } + + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) + throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + + logger.debug("Create chart."); + + SessionModel sm = SessionModelFactory.getInstance().getSessionModel( + request); + sm.setDiagrammOptions(null); + request.setAttribute("chart", true); + + return super.execute(mapping, form, request, response); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/CreateHistogramAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/CreateHistogramAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,66 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + +/** + * This controller is called to display histograms.
+ * An attribute 'histogram' on the request object is activated which inserts an + * image calling a histogram output of the server. + * + * @author Ingo Weinzierl + */ +public class CreateHistogramAction extends DescribeUIAction { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger logger = Logger.getLogger(CreateHistogramAction.class); + + + /** + * Constructor + */ + public CreateHistogramAction() { + super(); + } + + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) + throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + + logger.debug("Create histogram."); + + SessionModel sm = SessionModelFactory.getInstance().getSessionModel( + request); + sm.setDiagrammOptions(null); + request.setAttribute("histogram", true); + + return super.execute(mapping, form, request, response); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,183 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import java.util.Locale; +import java.util.ResourceBundle; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import javax.servlet.http.HttpSession; +import javax.xml.xpath.XPathConstants; + +import org.apache.log4j.Logger; +import org.apache.struts.Globals; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; +import org.w3c.dom.Node; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.util.ArtifactNamespaceContext; +import de.intevation.gnv.util.XMLUtils; +import de.intevation.gnv.util.XSLTransformer; + +/** + * This controller is called to fetch the current artifact description using the + * 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 Ingo Weinzierl + */ +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"; + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger logger = Logger.getLogger(DescribeUIAction.class); + + + /** + * Constructor + */ + public DescribeUIAction() { + super(); + } + + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response + ) throws Exception + { + if (isSessionExhausted(request)) { + // session timed out before + return sessionExhaustedForward(mapping, form, request, response); + } + + logger.info("describe user interface"); + try { + // render describe document and create user interface + 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"); + String exampleLinestring = res.getString( + "gnviewer.example.linestring"); + String examplePolygon = res.getString( + "gnviewer.example.polygon"); + + XSLTransformer transformer = new XSLTransformer(); + + String url = response.encodeURL( + mapping.findForward("back").getPath()); + transformer.addParameter("back-url", url); + transformer.addParameter("edit", editText); + transformer.addParameter("example-polygon", examplePolygon); + transformer.addParameter( + "example-linestring", + exampleLinestring); + + String fisUrl = response.encodeURL( + mapping.findForward("selectfis").getPath()); + transformer.addParameter("selectfis", fisUrl); + + // fetch dynamic part from describe document and transform it + Node dynamicNode = (Node) XMLUtils.xpath( + currentUI, + XPATH_DYNAMIC_UI, + XPathConstants.NODE, + ArtifactNamespaceContext.INSTANCE + ); + + String ui = transformer.transform( + dynamicNode, + "UTF-8", + request.getRealPath(XSL_SHEET_DYNAMIC + )); + + if (ui != null && ui.length() > 1) + request.setAttribute("ui", ui); + + // fetch static part from describe document and transform it + Node staticNode = (Node) XMLUtils.xpath( + currentUI, + XPATH_STATIC_UI, + XPathConstants.NODE, + ArtifactNamespaceContext.INSTANCE + ); + + String staticUI = transformer.transform( + staticNode, + "UTF-8", + request.getRealPath(XSL_SHEET_STATIC)); + + if (staticUI != null && staticUI.length() > 1) + request.setAttribute("staticui", staticUI); + } + + return super.execute(mapping, form, request, response); + } + catch (Exception e) { + logger.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + e.getMessage()); + + return super.getExceptionForward(mapping); + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoExportAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.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 Tim Englich + */ +public class DoExportAction extends ArtifactDatabaseActionBase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(DoExportAction.class); + + /** + * Constructor + */ + public DoExportAction() { + super(); + } + + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) + throws Exception + { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + + try { + String target = request.getParameter("target"); + String mimeType = request.getParameter("mimetype"); + String mode = request.getParameter("mode"); + + log.debug("Target: " + target); + log.debug("MimeType: " + mimeType); + log.debug("ExportMode: " + mode); + + SessionModel sm = SessionModelFactory.getInstance() + .getSessionModel(request); + OutputMode outputMode = sm.getOutputMode(target); + if (outputMode != null) { + ExportMode exportMode = outputMode.getExportMode(mode); + + if (target.equals(mode) || (exportMode != null + && exportMode.getMimeType().equals(mimeType))) + { + Collection inputParameter = outputMode + .getOutputParameters(); + Collection ips = null; + if (inputParameter != null) { + ips = new ArrayList(inputParameter.size()); + Iterator it = inputParameter.iterator(); + while (it.hasNext()) { + String name = it.next().getName(); + String[] values = request.getParameterValues(name); + InputParameter ip = new DefaultInputParameter(name, + values); + ips.add(ip); + } + } + + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)); + + this.setHeaders(mode, mimeType, response, request); + + OutputStream outputStream = response.getOutputStream(); + adc.doOutput( + sm.getSelectedArtifactFactory(), + sm.getCurrentArtifact(), + outputStream, + target, + mode, + mimeType, + ips); + + outputStream.flush(); + outputStream.close(); + } + else if (exportMode == null) { + Collection inputParameter = outputMode + .getOutputParameters(); + Collection ips = null; + if (inputParameter != null) { + ips = new ArrayList(inputParameter.size()); + Iterator it = inputParameter.iterator(); + while (it.hasNext()) { + String name = it.next().getName(); + String[] values = request.getParameterValues(name); + InputParameter ip = new DefaultInputParameter(name, + values); + ips.add(ip); + } + } + + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)); + + this.setHeaders(target, mimeType, response, request); + + OutputStream outputStream = response.getOutputStream(); + adc.doOutput( + sm.getSelectedArtifactFactory(), + sm.getCurrentArtifact(), + outputStream, + target, + mode, + mimeType, + ips); + + outputStream.flush(); + outputStream.close(); + } + else { + if (outputMode == null) { + log.error("Outputmode is not supported."); + } + else if (!exportMode.getMimeType().equals(mimeType)) { + log.error("MimeType "+mimeType+" wis not supported."); + } + // TODO FIXME: Fehlerbehandlung + } + } + return super.execute(mapping, form, request, response); + } catch (Exception e) { + log.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e + .getMessage()); + return super.getExceptionForward(mapping); + } + } + + protected void setHeaders(String target, String mimeType, + HttpServletResponse response, + HttpServletRequest request) { + log.debug("DoExportAction.setHeaders"); + try { + response.setHeader("Content-Type", mimeType); + String fileName = "GNVEXPORT_" + System.currentTimeMillis() + "."; + + target = target.toLowerCase(); + log.debug("******************************************************"); + log.debug("TARGET: " + target); + log.debug("MIMETYPE: " + mimeType); + + if (target.equals("chart")) { + fileName = fileName + + mimeType.substring(mimeType.indexOf("/") + 1); + } + else if (target.equals("histogram")) { + fileName = fileName + + mimeType.substring(mimeType.indexOf("/") + 1); + } + else if (target.equals("img")) { + fileName = fileName + + mimeType.substring(mimeType.indexOf("/") + 1); + } + else if (target.equals("pdf")) { + fileName = fileName + "pdf"; + } else if (target.equals("svg")) { + fileName = fileName + "svg"; + } else if (target.equals("csv")) { + fileName = fileName + "csv"; + } else if (target.equals("zip")) { + fileName = fileName + "zip"; + } else if (target.equals("wms")) { + fileName = fileName + "xml"; + } else { + fileName = fileName + "txt"; + } + log.debug("FileName for Export: " + fileName); + response.setHeader("Content-Disposition", "attachment;filename=" + + fileName); + } catch (Exception e) { + log.error(e, e); + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/DoOutputAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/DoOutputAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,148 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.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 Tim Englich + * + */ +public class DoOutputAction extends ArtifactDatabaseActionBase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(DoOutputAction.class); + + /** + * Constructor + */ + public DoOutputAction() { + super(); + } + + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + + log.debug("DoOutputAction.execute"); + try { + String target = request.getParameter("target"); + String mimeType = request.getParameter("mimetype"); + String mode = request.getParameter("mode"); + + log.debug("Target: " + target); + log.debug("MimeType: " + mimeType); + log.debug("ExportMode: " + mode); + + // TODO Check if is propper; + + SessionModel sm = SessionModelFactory.getInstance() + .getSessionModel(request); + OutputMode outputMode = sm.getOutputMode(target); + if (outputMode != null && outputMode.getMimeType().equals(mimeType)) { + Collection inputParameter = outputMode + .getOutputParameters(); + Collection ips = null; + if (inputParameter != null) { + ips = new ArrayList(inputParameter.size()+1); + Iterator it = inputParameter.iterator(); + while (it.hasNext()) { + String name = it.next().getName(); + String[] values = request.getParameterValues(name); + InputParameter ip = new DefaultInputParameter(name, + values); + ips.add(ip); + } + + if (request.getParameter("bintype") != null) { + InputParameter ip = new DefaultInputParameter( + "bintype", request.getParameterValues("bintype")); + ips.add(ip); + } + } + + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)); + + this.setHeaders(target, mimeType, response, request); + + OutputStream outputStream = response.getOutputStream(); + adc.doOutput( + sm.getSelectedArtifactFactory(), + sm.getCurrentArtifact(), + outputStream, + target, + mode, + mimeType, + ips); + + outputStream.flush(); + outputStream.close(); + } else { + if (outputMode == null) { + log.error("Outputmode is not supported."); + } else if (!outputMode.getMimeType().equals(mimeType)) { + log.error("MimeType " + mimeType + + " wis not supported."); + } + // TODO FIXME: Fehlerbehandlung + } + return super.execute(mapping, form, request, response); + } catch (Exception e) { + log.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e + .getMessage()); + return super.getExceptionForward(mapping); + } + } + + protected void setHeaders(String target, String mimeType, + HttpServletResponse response, + HttpServletRequest request) { + response.setHeader("Content-Type", mimeType); + } + +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/FetchArtifactFactoriesAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,86 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import java.util.Collection; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; + +/** + * This controller fetches artifact factories from artifact server and stores + * them on a SessionModel object. + * + * @author Tim Englich + * @author Ingo Weinzierl + */ +public class FetchArtifactFactoriesAction extends ArtifactDatabaseActionBase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(FetchArtifactFactoriesAction.class); + + /** + * Constructor + */ + public FetchArtifactFactoriesAction() { + super(); + } + + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + log.debug("ArtifactDatabaseActionBase.execute"); + try { + Collection artifactFactories = + ArtifactDatabaseClientFactory.getInstance() + .getArtifactDatabaseClient(getLocale(request)) + .getArtifactFactories(); + + SessionModel sm = SessionModelFactory.getInstance().getSessionModel( + request); + + sm.setArtifacteFactories(artifactFactories); + + return super.execute(mapping, form, request, response); + } + catch (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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/LoadAction.java --- /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:14:00 2012 +0200 @@ -0,0 +1,177 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import 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; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; +import de.intevation.gnv.artifactdatabase.objects.Artifact; +import de.intevation.gnv.artifactdatabase.objects.ArtifactFactory; +import de.intevation.gnv.util.ArtifactNamespaceContext; +import de.intevation.gnv.util.XMLUtils; + +/** + * This controller is called for reloading projects from xml files. It waits for + * 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 Ingo Weinzierl + */ +public class LoadAction extends ArtifactDatabaseActionBase { + + public static final String RESOURCE_UPLOAD_FAILURE = "upload.failure"; + public static final String RESOURCE_INVALID_ARTIFACT = "invalid.artifact"; + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger logger = Logger.getLogger(LoadAction.class); + + /** + * Constructor + */ + public LoadAction() { + super(); + } + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) + throws Exception + { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + + 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/MapClientStandaloneAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/MapClientStandaloneAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +/** + * + */ +package de.intevation.gnv.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +/** + * @author Tim Englich + * + */ +public class MapClientStandaloneAction extends ArtifactDatabaseActionBase { + + public final static String MAPCLIENTSTANDALONE_KEY = + "de.intevation.gnv.action.MapClientStandaloneAction"; + /** + * Constructor + */ + public MapClientStandaloneAction() { + super(); + } + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + + request.setAttribute(MAPCLIENTSTANDALONE_KEY, true); + return super.execute(mapping, form, request, response); + } + + +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/NextArtifactStepAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,160 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import 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; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseInputException; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.DefaultInputParameter; +import de.intevation.gnv.artifactdatabase.objects.InputParameter; + +/** + * This controller feeds the artifact server with the current input data and + * refreshes the gui with the current artifact description after the next state + * is reached. + * + * @author Tim Englich + * @author Ingo Weinzierl + */ +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(); + } + + @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 inputParameter = ad.getInputParameter(); + Collection ips = null; + if (inputParameter != null) { + ips = new ArrayList(inputParameter.size()); + Iterator it = inputParameter.iterator(); + while (it.hasNext()) { + String name = it.next(); + String[] values = request.getParameterValues(name); + InputParameter ip = new DefaultInputParameter(name, values); + ips.add(ip); + } + } + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory + .getInstance().getArtifactDatabaseClient(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.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"); + return sessionExhaustedForward(mapping, form, request, response); + } + return super.execute(mapping, form, request, response); + } + +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/PreviousArtifactStepAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,105 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; + +/** + * This controller is used to step back to a previous state of the current + * artifact. After calling the advance operation of the artifact server have + * been called successfully, the describe document of the current artifact is + * fetched and a new gui is rendered. + * + * @author Ingo Weinzierl + */ +public class PreviousArtifactStepAction extends DescribeUIAction { + + + public static final String URL_STATE_KEY = "target"; + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger logger = + Logger.getLogger(PreviousArtifactStepAction.class); + + + /** + * Constructor + */ + public PreviousArtifactStepAction() { + super(); + } + + + @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_SESSION_ID, + "SessionTimeout has occured"); + return new FetchArtifactFactoriesAction().execute( + mapping, form, request, response); + } + + // TODO check if target is reachable + + ArtifactDatabaseClientFactory f = + ArtifactDatabaseClientFactory.getInstance(); + ArtifactDatabaseClient client = + f.getArtifactDatabaseClient(getLocale(request)); + + ArtifactObject artifactFactory = session.getSelectedArtifactFactory(); + ArtifactObject currentArtifact = session.getCurrentArtifact(); + + String target = (String) request.getParameter(URL_STATE_KEY); + logger.debug("Step back to previous state: " + target); + + try { + client.doAdvance( + artifactFactory, + currentArtifact, + target + ); + } + catch (Exception e) { + logger.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + e.getMessage()); + } + + return super.execute(mapping, form, request, response); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/SelectArtifactFactoryAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,88 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import java.util.Collection; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; + +/** + * This controller is called to select a specific fis. + * + * @author Tim Englich + */ +public class SelectArtifactFactoryAction extends DescribeUIAction { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(SelectArtifactFactoryAction.class); + + /** + * Constructor + */ + public SelectArtifactFactoryAction() { + super(); + } + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + log.debug("SelectArtifactFactoryAction.execute"); + String selectedArtifactFactoryID = request + .getParameter("artifactFactory"); + log.debug("Selected ArtifactFactory ==> " + selectedArtifactFactoryID); + + try { + SessionModel sm = SessionModelFactory.getInstance() + .getSessionModel(request); + Collection artifactFactories = sm + .getArtifactFactories(); + // Removes the Artifactspecific Attributes from the SessionModel- + sm.resetModel(); + if (artifactFactories == null || artifactFactories.isEmpty()) { + new FetchArtifactFactoriesAction().execute(mapping, form, + request, response); + + } + + sm.selectArtifactFactory(selectedArtifactFactoryID); + ArtifactObject af = sm.getSelectedArtifactFactory(); + + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)); + ArtifactObject artifact = adc.createNewArtifact(af); + sm.setCurrentArtifact(artifact); + + return super.execute(mapping, form, request, response); + } catch (Exception e) { + log.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, e + .getMessage()); + return super.getExceptionForward(mapping); + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/SelectFisAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/SelectFisAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; + +/** + * This controller is used to step back to the fis selection. It is called when + * pushing the step-back button besides the currently selected fis. + * + * @author Ingo Weinzierl + */ +public class SelectFisAction extends ArtifactDatabaseActionBase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger logger = Logger.getLogger(SelectFisAction.class); + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response + ) { + logger.info("Goto fis selection."); + + try { + + SessionModelFactory fac = SessionModelFactory.getInstance(); + SessionModel sm = fac.getSessionModel(request); + + sm.resetModel(); + + return new FetchArtifactFactoriesAction().execute( + mapping, form, request, response); + } + catch (Exception e) { + logger.error(e, e); + + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + e.getMessage()); + + return super.getExceptionForward(mapping); + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/ShowStatisticAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/ShowStatisticAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import java.util.Collection; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; + +/** + * This controller is used to display to statistic of the current + * parameterization. + * + * @author Ingo Weinzierl + */ +public class ShowStatisticAction extends DescribeUIAction { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger logger = Logger.getLogger(ShowStatisticAction.class); + + + /** + * Constructor + */ + public ShowStatisticAction() { + super(); + } + + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response + ) throws Exception + { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + + logger.info("show statistic"); + SessionModel sm = SessionModelFactory.getInstance().getSessionModel( + request); + + ArtifactDatabaseClient adc = ArtifactDatabaseClientFactory.getInstance() + .getArtifactDatabaseClient(getLocale(request)); + + try{ + Collection statistics = + adc.calculateStatistics(sm.getSelectedArtifactFactory(), + sm.getCurrentArtifact()); + + sm.setStatistics(statistics); + + request.setAttribute("statistic", true); + } + catch (Exception e) { + logger.error(e, e); + } + + return super.execute(mapping, form, request, response); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/StoreAction.java --- /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:14:00 2012 +0200 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import 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; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; + +/** + * This controller is used to save the current artifact to an xml file. A file + * dialog is opened to save the file to the local disk. + * + * @author Ingo Weinzierl + */ +public class StoreAction extends ArtifactDatabaseActionBase { + + public static final String RESOURCE_DOWNLOAD_FAILURE = "no.artifact.chosen"; + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger logger = Logger.getLogger(StoreAction.class); + + /** + * Constructor + */ + public StoreAction() { + super(); + } + + @Override + public ActionForward execute( + ActionMapping mapping, + ActionForm form, + HttpServletRequest request, + HttpServletResponse response) + throws Exception + { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + + 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; + } + + /** + * Sets the header of the response. + * @param response the response + * @param uuid the uuid of the artifact + */ + protected void setHeaders(HttpServletResponse response, String uuid) { + String filename = "GNVArtefakt_" + uuid + ".xml"; + + 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/SwitchLanguageAction.java --- /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:14:00 2012 +0200 @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; + +import java.util.Locale; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +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; + +/** + * Toggle the current language used to create the user interface. Two + * languages are available now - german and english. + * + * @author Ingo Weinzierl + */ +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 + { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + + SessionModelFactory factory = SessionModelFactory.getInstance(); + SessionModel sm = factory.getSessionModel(request); + Locale locale = switchLanguage(sm.getCurrentLocale()); + + sm.setCurrentLocale(locale); + ArtifactObject artifactFactory = sm.getSelectedArtifactFactory(); + + if (artifactFactory == null) { + request.getSession().setAttribute(Globals.LOCALE_KEY, locale); + return mapping.findForward(SUCCSESS_FORWARD_ID); + } + + return super.execute(mapping, form, request, response); + } + + + /** + * 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/WMSAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/WMSAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,225 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action; + +import 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; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import de.intevation.gnv.action.sessionmodel.DiagrammOptions; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClient; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.DefaultInputParameter; +import de.intevation.gnv.artifactdatabase.objects.InputParameter; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; +import de.intevation.gnv.artifactdatabase.objects.OutputParameter; +import de.intevation.gnv.artifactdatabase.objects.map.DefaultLayer; +import de.intevation.gnv.artifactdatabase.objects.map.DefaultMapService; +import de.intevation.gnv.artifactdatabase.objects.map.Layer; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; +import de.intevation.gnv.util.XMLUtils; + +/** + * This controller is used to publish the results of the current artifact as + * 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 Ingo Weinzierl + */ +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_LAYERNODESET = + "/art:meta/art:layer"; + + public static final String XPATH_LAYER_TITLE = + "art:title/text()"; + + public static final String XPATH_LAYER_NAME = + "art:name/text()"; + + public static final String XPATH_TTL = + "/art:meta/art:mapserver/art:ttl/text()"; + + public static final String XPATH_BBOX = + "/art:meta/art:mapserver/art:Box/art:coordinates/text()"; + + /** + * the logger, used to log exceptions and additonaly information + */ + 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 { + if (isSessionExhausted(request)) { + return sessionExhaustedForward(mapping, form, request, response); + } + + logger.debug("WMSAction.execute"); + try { + SessionModel sm = SessionModelFactory.getInstance().getSessionModel( + request); + + OutputMode outputMode = sm.getOutputMode("wms"); + Collection ips = null; + if (outputMode != null) { + Collection inputParameter = + outputMode.getOutputParameters(); + + if (inputParameter != null) { + ips = new ArrayList(inputParameter.size()); + Iterator 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); + + // read the Server-information + String mapserverPath = XMLUtils.getStringXPath( + meta, XPATH_MAPSERVER_PATH); + String mapfilePath = XMLUtils.getStringXPath( + meta, XPATH_MAPSERVER_MAPFILE); + String tmpTTL = XMLUtils.getStringXPath( + meta, XPATH_TTL); + + String bbox = XMLUtils.getStringXPath(meta, XPATH_BBOX); + 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 ttl: " + ttl); + } + // read the layer information + + NodeList layerNodes = XMLUtils.getNodeSetXPath(meta, + XPATH_LAYERNODESET); + Collection layers = null; + if (layerNodes != null && layerNodes.getLength() > 0){ + layers = new ArrayList(layerNodes.getLength()); + for (int i = 0 ; i < layerNodes.getLength(); i++){ + Node tmpLayerNode = layerNodes.item(i); + String layerName = XMLUtils.getStringXPath( + tmpLayerNode, XPATH_LAYER_NAME); + String layerTitle = XMLUtils.getStringXPath( + tmpLayerNode, XPATH_LAYER_TITLE); + // TODO: write layerTitle to title and not to id + Layer currentLayer = new DefaultLayer(layerTitle, layerName, + false, null); + layers.add(currentLayer); + } + } + + + + + // TODO PUT MAPFILEPATH AND TTL to MapServiceObject + + if (mapserverPath != null && + mapfilePath != null) { + request.setAttribute("wms_published", Boolean.TRUE); + + MapService mapService = new DefaultMapService("0815", layers, + "UMN", mapserverPath, + bbox,ttl); + sm.setLocalMapService(mapService); + return super.execute(mapping, form, request, response); + }else{ + return super.execute(mapping, form, request, response); + } + } + catch (Exception e) { + logger.error(e, e); + request.setAttribute( + CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID, + e.getMessage()); + + return super.getExceptionForward(mapping); + } + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/MapViewerCallAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,135 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action.mapviewer; + +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Iterator; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import de.intevation.gnv.action.ArtifactDatabaseActionBase; +import de.intevation.gnv.action.mapviewer.parser.ExternalCallParser; +import de.intevation.gnv.action.mapviewer.parser.XMLExternalCallParser; +import de.intevation.gnv.action.sessionmodel.SessionModel; +import de.intevation.gnv.action.sessionmodel.SessionModelFactory; +import de.intevation.gnv.artifactdatabase.client.ArtifactDatabaseClientFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; +import de.intevation.gnv.util.CaptureInputStream; + +/** + * This class provides the businesslogic for handling an + * MV-GNV-Interface-call. + * This call can be done in two ways. + * First is to put the requestbody into the body of the http-post-request. + * Second to put the requestbody to the parameter "document" of the + * http-post-request. + * @author Tim Englich + */ +public class MapViewerCallAction extends ArtifactDatabaseActionBase { + + /** + * 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){ + CaptureInputStream capture = log.isDebugEnabled() + ? new CaptureInputStream(inputStream) + : null; + + try { + ExternalCallParser ecp = new XMLExternalCallParser( + capture != null ? capture : inputStream); + ecp.parse(); + + // print incoming data to log + if (capture != null) { + log.debug("REQUEST DOCUMENT: " + capture.copyToString()); + } + + String geometry = ecp.getGeometry(); + String srs = ecp.getSRS(); + Collection mapServices = ecp.getMapServices(); + + Collection availableFactories = + ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)) + .getArtifactFactoryMetaInformation(mapServices, + geometry, + srs); + + Collection providedFactories = + ArtifactDatabaseClientFactory + .getInstance() + .getArtifactDatabaseClient(getLocale(request)) + .getArtifactFactories(); + + // Sort out which ArtifactFactories should not be used. + Collection usedFactories = + new ArrayList(availableFactories.size()); + + Iterator it = availableFactories.iterator(); + while (it.hasNext()){ + ArtifactObject ao = it.next(); + if (providedFactories.contains(ao)){ + usedFactories.add(ao); + } + } + + SessionModel sm = SessionModelFactory + .getInstance() + .getSessionModel(request); + sm.resetModel(); + sm.setArtifacteFactories(usedFactories); + } catch (Exception e) { + log.error(e,e); + } + }else{ + log.error("Kein Anfragedokument Ć¼bergeben."); + } + return super.execute(mapping, form, request, response); + } + +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/ShowMapViewerCallBodyAction.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action.mapviewer; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.log4j.Logger; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import de.intevation.gnv.action.ArtifactDatabaseActionBase; + +/** + * This class provides the businesslogic to show the demo GUI for + * testing the MV-GNV-Interface. + * @author Tim Englich + */ +public class ShowMapViewerCallBodyAction extends ArtifactDatabaseActionBase { + + /** + * the logger, used to log exceptions and additionally information + */ + private static Logger log = Logger + .getLogger(ShowMapViewerCallBodyAction.class); + + /** + * Constructor + */ + public ShowMapViewerCallBodyAction() { + super(); + } + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, + HttpServletRequest request, + HttpServletResponse response) throws Exception { + log.debug("ShowMapViewerCallBodyAction.execute"); + request.setAttribute("MAPVIEWERCALL", new Boolean(true)); + return super.execute(mapping, form, request, response); + } +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/mapviewer/package.html --- /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:14:00 2012 +0200 @@ -0,0 +1,8 @@ + + + + + +This package provides actions for handling the MV-GNV-Interface calls. + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParser.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParser.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,45 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action.mapviewer.parser; + +import java.util.Collection; + +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + +/** + * Interfacedefinition for an XMl-parser of the MV-GNV-Interface requestdocument. + * @author Tim Englich + */ +public interface ExternalCallParser { + + + /** + * Returns the geometry which was parsed from the XML-document. + * @return the geometry. + */ + String getGeometry(); + + /** + * Returns the srid which was parsed from the XML-document. + * @return the srid. + */ + String getSRS(); + + /** + * Returns the mapservices which was parsed from the XML-document. + * @return the mapservices. + */ + Collection getMapServices(); + + /** + * Does the parsing work. + * @throws ExternalCallParserException + */ + void parse() throws ExternalCallParserException; +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserException.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action.mapviewer.parser; + +/** + * Exceptionclass for qualifying exception which were caused by the + * ExternalCallParser. + * @author Tim Englich + * + */ +public class ExternalCallParserException extends Exception { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = -4917914097058485262L; + + /** + * Constructor + */ + public ExternalCallParserException() { + } + + /** + * Constructor + * @param arg0 + */ + public ExternalCallParserException(String arg0) { + super(arg0); + } + + /** + * Constructor + * @param arg0 + */ + public ExternalCallParserException(Throwable arg0) { + super(arg0); + } + + /** + * Constructor + * @param arg0 + * @param arg1 + */ + public ExternalCallParserException(String arg0, Throwable arg1) { + super(arg0, arg1); + } + +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/XMLExternalCallParser.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/XMLExternalCallParser.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,171 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action.mapviewer.parser; + +import java.io.InputStream; +import java.util.ArrayList; +import java.util.Collection; + +import org.apache.log4j.Logger; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.NodeList; + +import de.intevation.gnv.artifactdatabase.objects.map.DefaultLayer; +import de.intevation.gnv.artifactdatabase.objects.map.DefaultMapService; +import de.intevation.gnv.artifactdatabase.objects.map.Layer; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; +import de.intevation.gnv.util.XMLUtils; + +/** + * This class provides an XMl-Parser which try's to create an DOM from + * an given Inputstream. Is this is possible it try to read the required + * informations e.g. Mapservices, Layer, SRID and Geometry from the + * document. + * @author Tim Englich + */ +public class XMLExternalCallParser implements ExternalCallParser { + + /** + * 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"; + + /** + * The geometry which was parsed from the document. + */ + private String geometry = null; + + /** + * The srid which was parsed from the document. + */ + private String srs = null; + + /** + * The mapservices that were parsed from the document. + */ + private Collection mapServices = null; + + /** + * The inputstream where the data should be read from. + */ + private InputStream inputStream = null; + + /** + * Constructor + * @param inputStream The stream where the data should be read from + */ + public XMLExternalCallParser(InputStream inputStream) { + this.inputStream = inputStream; + } + + public String getGeometry() { + return this.geometry; + } + + public Collection getMapServices() { + return this.mapServices; + } + + public void parse() throws ExternalCallParserException { + if (inputStream != null){ + XMLUtils xmlUtils = new XMLUtils(); + Document document = xmlUtils.readDocument(this.inputStream); + if (document != null){ + + this.geometry = xmlUtils.getStringXPath(document, + XPATH_GEOMETRY); + this.srs = xmlUtils.getStringXPath(document, XPATH_SRS); + NodeList mapservicesNodes = + xmlUtils.getNodeSetXPath(document, + XPATH_MAPSERVICES_NODESET); + if (mapservicesNodes != null){ + this.mapServices = new ArrayList(mapservicesNodes.getLength()); + for (int i = 0; i < mapservicesNodes.getLength(); i++){ + Element mapserviceNode = (Element)mapservicesNodes.item(i); + String mapserviceID = mapserviceNode.getAttribute(ATTRIBUTE_ID); + String mapserviceType = mapserviceNode.getAttribute(ATTRIBUTE_TYPE); + String mapserviceUrl = mapserviceNode.getAttribute(ATTRIBUTE_URL); + NodeList layerNodes = xmlUtils.getNodeSetXPath(mapserviceNode, XPATH_LAYER); + Collection layer = null; + if (layerNodes != null && layerNodes.getLength() > 0){ + layer = new ArrayList(layerNodes.getLength()); + layer = this.extractLayer(layer, null, layerNodes); + }else{ + log.debug("No Layer given for this Mapservice"); + } + MapService mapService = + new DefaultMapService(mapserviceID, layer, + mapserviceType, mapserviceUrl); + this.mapServices.add(mapService); + } + + }else{ + String errMsg = "XML-Document does not contain any " + + "Mapservices which are required."; + log.error(errMsg); + throw new ExternalCallParserException(errMsg); + } + + }else{ + String errMsg = "XML-Document could not " + + "be read from InputStream."; + log.error(errMsg); + throw new ExternalCallParserException(errMsg); + } + }else{ + String errMsg = "No InputStream given for parsing the Call."; + log.error(errMsg); + throw new ExternalCallParserException(errMsg); + } + } + + /** + * This Method extracts all Layers and put them into the Collection. + * @param layer the collection where the layer should be add to. + * @param groupId the id of the group of the layers + * @param layerNodes the Nodes which should contain the intormations + * about layers + * @return the layer + */ + private Collection extractLayer(Collection layer, + String groupId, + NodeList layerNodes){ + 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; + } + + public String getSRS() { + return this.srs; + } + +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/mapviewer/parser/package.html --- /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:14:00 2012 +0200 @@ -0,0 +1,9 @@ + + + + + +This package provides the XML-parser for parsing the XML-Documents which +were send by the MapViewer to the GMV-WebClient. + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/package.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:14:00 2012 +0200 @@ -0,0 +1,8 @@ + + + + + +Controller triggered after user interactions. + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DefaultSessionModel.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,205 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action.sessionmodel; + +import java.util.Collection; +import java.util.Iterator; +import java.util.Locale; + +import org.apache.log4j.Logger; + +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + +/** + * The default implementation of SessionModel which stores the + * current artifact object and the digram options selected by the user. + * + * @author Tim Englich + * + */ +public class DefaultSessionModel implements SessionModel { + + + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(DefaultSessionModel.class); + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 3431484439985158311L; + + /** + * Container for ArtifactFactory-objects. + */ + private Collection artifactFactories = null; + + /** + * The selected ArtifactFactory + */ + private ArtifactObject selectedArtifactFactory = null; + + /** + * The currently used artifact. + */ + private ArtifactObject currentArtifact = null; + + /** + * The Diagrammoptions. + */ + private DiagrammOptions diagrammOptions = null; + + /** + * The Container for statistic-values. + */ + private Collection statistics = null; + + /** + * The Locale that currently should be used. + */ + private Locale currentLocale; + + /** + * The Mapservice containing all Layers that should be displayed. + */ + private MapService localMapService = null; + /** + * Constructor + */ + public DefaultSessionModel() { + 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 artifactObjects = this + .getArtifactFactories(); + if (artifactObjects != null) { + Iterator unselect = artifactObjects.iterator(); + this.selectedArtifactFactory = null; + while (unselect.hasNext()) { + unselect.next().setSelected(false); + } + Iterator it = artifactObjects.iterator(); + while (it.hasNext()) { + ArtifactObject obj = it.next(); + if (obj.getId().equals(artiFactFactoryId)) { + obj.setSelected(true); + this.selectedArtifactFactory = obj; + break; + } + } + } + } + + + public void setArtifacteFactories( + Collection artifactFactories) { + this.artifactFactories = artifactFactories; + } + + + public Collection 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 getStatistics() { + return this.statistics; + } + + public void setStatistics(Collection statistics) { + this.statistics = statistics; + } + + public Locale getCurrentLocale() { + return currentLocale; + } + + public void setCurrentLocale(Locale currentLocale) { + this.currentLocale = currentLocale; + } + + public MapService getLocalMapService() { + return this.localMapService; + } + + public void setLocalMapService(MapService mapService) { + this.localMapService = mapService; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/DiagrammOptions.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,73 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action.sessionmodel; + +import java.text.NumberFormat; + +import java.util.HashMap; +import java.util.Locale; +import java.util.Map; + +/** + * Stores key-value pairs used to save user input for changing diagram + * attributes. + * + * @author Tim Englich + */ +public class DiagrammOptions { + + private Map values = new HashMap(); + + /** + * Constructor + */ + public DiagrammOptions() { + super(); + } + + /** + * Returns the Value to a given Key + * @param key The key of the value that should be returned. + * @return the value. + */ + public Object getValue(String key) { + return this.values.get(key); + } + + + /** + * Returns the value as string. + * @param key The key of the value that should be returned. + * @param locale A locale object used to format numbers. + * @return the value as string. + */ + public String getValue(String key, Locale locale) { + Object obj = values.get(key); + + if (obj instanceof Double && locale != null) { + Double value = (Double) obj; + NumberFormat format = NumberFormat.getNumberInstance(locale); + + return format.format(value); + } + + return (String) obj; + } + + /** + * Set a value with the given key. + * + * @param key The given key. + * @param value The value to be stored. + */ + public void setValue(String key, Object value) { + values.put(key, value); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,141 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action.sessionmodel; + +import java.io.Serializable; +import java.util.Collection; +import java.util.Locale; + +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; +import de.intevation.gnv.artifactdatabase.objects.OutputMode; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + +/** + * 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 Tim Englich + * + */ +public interface SessionModel extends Serializable { + + /** + * Returns all Artifactfactories which were retrieved from the + * Artifactdatabases which are connected to the Client. + * @return the artifactfactories. + */ + Collection getArtifactFactories(); + + /** + * Sets all Artifactfactories which were retieved from the Artifactdatabases + * to the SessionModel. + * @param artifactFactories the artifactfactories. + */ + void setArtifacteFactories(Collection artifactFactories); + + /** + * Set the Artifactfactory which match to the given id to selected. + * @param artiFactFactoryId the id of the artifactfactory which should + * be selected. + */ + void selectArtifactFactory(String artiFactFactoryId); + + /** + * Returns the Artifactfactory which is selected. + * @return the artifactfactory which is selected. + */ + ArtifactObject getSelectedArtifactFactory(); + + /** + * Returns the currently used artifact. + * This Artifact will retrieved from the selected artifactfactory and will + * be used to do handle the special businesslogic. + * @return the artifact which is currently used. + */ + ArtifactObject getCurrentArtifact(); + + /** + * Sets a new Artifact as the artifact that should be used. + * @param artifact the new artifact which should be used. + */ + void setCurrentArtifact(ArtifactObject artifact); + + /** + * Sets the currently used diagrammoptions to the Sessionmodel. + * Diagrammoptions will be used to manipulate the look of diagramms + * and render the GUI so that the user is enabled to switch the options. + * Diagrammoptions are also used for Histogram, all Exports and WMS + * @param diagrammOptions the Options that should be used. + */ + void setDiagrammOptions(DiagrammOptions diagrammOptions); + + /** + * Returns the diagrammoptions that currently set to the SessionModel. + * @return the diagrammoptions that currently set to the SessionModel. + */ + DiagrammOptions getDiagrammOptions(); + + /** + * Returns the Outputmode that matches to the given name of an mode. + * Outputmodes are used to define which kind of modes are defined to + * generate an result for a given Artifact (chart, export, wms,...) + * @param name the name of the OutputMode that should be used + * @return the OutputMode that matches to the given name. + */ + OutputMode getOutputMode(String name); + + /** + * Returns the description to the currently used Artifact. + * The description can be used to retrieve the supported OutputModes, + * the parameters that could be feed, ... + * @return the description of the artifact which is currently used. + */ + ArtifactDescription getArtifactDescription(); + + /** + * Reset the Model. So that it will have the status as no Artifactfactory + * was selected. + */ + void resetModel(); + + /** + * Sets the Statistics that were retrieved from the currently used Artifact + * to the SessionModel. + * @param statistics the Statistics that should be shown in the GUI. + */ + void setStatistics(Collection statistics); + + /** + * Returns the statistics that are currently set to the SessionModel + * @return the statistics that are currently set to the SessionModel + */ + Collection getStatistics(); + + /** + * Sets the locale that should be used. + * The loacle will be used to customize the GUI for a language that matches + * to the locale or it will be used to tell the Artifactdatabase which locale + * has to be used. + * @param locale the locale that should be used. + */ + void setCurrentLocale(Locale locale); + + /** + * Returns the currently used locale. + * @return the locale that is currently used. + */ + Locale getCurrentLocale(); + + void setLocalMapService(MapService mapService); + + MapService getLocalMapService(); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/action/sessionmodel/SessionModelFactory.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action.sessionmodel; + +import javax.servlet.http.HttpServletRequest; + +import org.apache.log4j.Logger; + +/** + * Creates and restores SessionModel objects from + * HttpServletRequest. + * + * @author Tim Englich + */ +public class SessionModelFactory { + + /** + * The id of the SessionModel that must be used to lookup the + * model from the given HttpSession of the request. + */ + public final static String SESSION_MODEL_ID = "de.intevation.gnv.action." + + "sessionmodel.SessionModel.ID"; + + /** + * the logger, used to log exceptions and additonaly information + */ + 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() { + log.debug("SessionModelFactory.getInstance"); + if (instance == null) { + instance = new SessionModelFactory(); + } + return instance; + } + + /** + * Getting the ArtifactDatabaseClient + * @param request the tequest from which the SessionModel should be read. + * @return the ArtifactDatabaseClient + */ + public SessionModel getSessionModel(HttpServletRequest request) { + log.debug("SessionModelFactory.getSessionModel"); + synchronized (request) { + SessionModel sm = null; + Object obj = request.getSession().getAttribute(SESSION_MODEL_ID); + 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/action/sessionmodel/package.html --- /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:14:00 2012 +0200 @@ -0,0 +1,10 @@ + + + + + +This package provides the classes and interface-definitions for providing an +SessionModel for storing Information which can be reused during a session. + + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,246 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.client; + +import java.io.IOException; +import java.io.OutputStream; +import java.util.Collection; +import java.util.Locale; + +import org.w3c.dom.Document; + +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseInputException; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactFactory; +import de.intevation.gnv.artifactdatabase.objects.ArtifactObject; +import de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet; +import de.intevation.gnv.artifactdatabase.objects.InputParameter; +import de.intevation.gnv.artifactdatabase.objects.map.MapService; + +/** + * This interface describes basic methods for the communication between artifact + * server and this client. + * + * @author Tim Englich + * @author Ingo Weinzierl + */ +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 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) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; + + /** + * Calls the advancecommand for the given Artifact at the Artifactdatabase. + * Stepping to the given target using the given Artifactfactory + * @param factory the Factory which provide the information about which + * Artifactdatabase has to be called. + * @param artifact the Artifact which should be moved to the next state. + * @param target the Id of the next State which should the artifact should + * be moved to. + * @throws IOException + * @throws ArtifactDatabaseClientException + * @throws ArtifactDatabaseInputException + */ + public void doAdvance( + ArtifactObject factory, + ArtifactObject artifact, + String target) + throws IOException, + ArtifactDatabaseClientException, + ArtifactDatabaseInputException; + + /** + * @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) + 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) + 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 + )throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; + + + /** + * Start statistics calculation. + * + * @param artifactFactory + * @param currentArtifact + * @return the calculated statistic. + * @throws ArtifactDatabaseClientException + */ + public Collection 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 getArtifactFactoryMetaInformation( + Collection mapServices, + String geometry, + String srs) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException; + +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientFactory.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,65 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.client; + +import java.util.Locale; + +import org.apache.log4j.Logger; + +/** + * Used to start a session with a new artifact. A new + * DefaultArtifactDatabaseClient is created. + * + * @author Tim Englich + * + */ +public class ArtifactDatabaseClientFactory { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger + .getLogger(ArtifactDatabaseClientFactory.class); + + /** + * The singleton Instance of this Factory. + */ + private static ArtifactDatabaseClientFactory instance = null; + + /** + * Constructor + */ + private ArtifactDatabaseClientFactory() { + super(); + } + + /** + * This Method provides an singleton Instance of this Class. + * + * @return an singleton Instance of this Class + */ + public static synchronized ArtifactDatabaseClientFactory getInstance() { + if (instance == null) { + instance = new ArtifactDatabaseClientFactory(); + } + return instance; + } + + /** + * Getting the ArtifactDatabaseClient + * @param locale teh Local that should be used for the Communication + * @return the ArtifactDatabaseClient + */ + public ArtifactDatabaseClient getArtifactDatabaseClient(Locale locale) { + DefaultArtifactDatabaseClient adc = new DefaultArtifactDatabaseClient(); + adc.setLocale(locale); + return adc; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,1134 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.client; + +import java.io.IOException; +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.Locale; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.restlet.Client; +import org.restlet.Request; +import org.restlet.Response; +import org.restlet.data.ClientInfo; +import org.restlet.data.Language; +import org.restlet.data.Method; +import org.restlet.data.Preference; +import org.restlet.data.Protocol; +import org.restlet.representation.Representation; +import org.restlet.representation.StringRepresentation; +import org.w3c.dom.Document; +import org.w3c.dom.Element; +import org.w3c.dom.Node; +import org.w3c.dom.NodeList; + +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseClientException; +import de.intevation.gnv.artifactdatabase.client.exception.ArtifactDatabaseInputException; +import de.intevation.gnv.artifactdatabase.objects.Artifact; +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +import de.intevation.gnv.artifactdatabase.objects.ArtifactFactory; +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; + +/** + * The default implementation of ArtifactDatabaseClient which + * implements methods to communicate via HTTP protocol with the artifact server. + * + * @author Tim Englich + * @author Ingo Weinzierl + */ +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 artifactDatabases = null; + + /** + * Is the Class initialized? + */ + private static boolean initialized = false; + + /** + * Request locale + */ + private Locale locale; + + + /** + * Constructor + */ + public DefaultArtifactDatabaseClient() { + + } + + public Collection getArtifactFactories() + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { + Collection resultValues = null; + if (!initialized) { + this.initialize(); + } + try { + log.debug("DefaultArtifactDatabaseClient.getArtifactFactories"); + Iterator it = artifactDatabases.iterator(); + while (it.hasNext()) { + String server = it.next(); + String url = server + "/factories"; + Document document = this.doGetRequest(url); + if (resultValues == null) { + resultValues = this.getArtifactFactories(document, server,null); + } else { + resultValues.addAll(this.getArtifactFactories(document, + server,null)); + } + } + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + return resultValues; + } + + + /** + * Returns a collection of artifact factories retrieved by server. + * + * @param document + * @param server + * @param geometry + * @return a collection of factories. + */ + private Collection getArtifactFactories(Document document, + String server, + String geometry) { + NodeList artifactFactories = XMLUtils.getNodeSetXPath(document, + "/art:result/art:factories/art:factory"); + Collection resultValues = new ArrayList( + artifactFactories.getLength()); + if (artifactFactories != null) { + for (int i = 0; i < artifactFactories.getLength(); i++) { + Node artifactFactoryNode = artifactFactories.item(i); + String name = XMLUtils.getStringXPath(artifactFactoryNode, + "@art:name"); + String description = XMLUtils.getStringXPath( + artifactFactoryNode, "@art:description"); + + NodeList parameterNodeList = XMLUtils.getNodeSetXPath( + artifactFactoryNode, + "art:parameter"); + + if ((parameterNodeList != null && + parameterNodeList.getLength() > 0) || + geometry != null){ + Collection parameters = + new ArrayList(parameterNodeList.getLength()); + for (int j = 0; j < parameterNodeList.getLength(); j++){ + Element parameterNode = (Element)parameterNodeList.item(j); + parameters.add(parameterNode.getAttribute("id")); + } + ParametrizedArtifactObject pao = + new ParametrizedArtifactFactory(name, + description, + server); + pao.addParameters("parameter", parameters); + resultValues.add(pao); + if (geometry != null){ + Collection geometryList = new ArrayList(1); + geometryList.add(geometry); + pao.addParameters("geometry",geometryList); + } + }else{ + ArtifactObject artifactFactory = new ArtifactFactory(name, + description, + server); + resultValues.add(artifactFactory); + } + } + } + log.debug("Artifact Factories: " + resultValues.size()); + return resultValues; + } + + + 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 ClientInfo object of request with the + * given locale. + * + * @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> acceptedLanguages = + new ArrayList>(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 { + + log.debug("URL: "+ requestUrl); + log.debug("Body"); + log.debug(XMLUtils.writeDocument2String(requestBody)); + + Client client = new Client(Protocol.HTTP); + Request request = initialize(new Request(Method.POST, requestUrl)); + String documentBody = XMLUtils.writeDocument2String(requestBody); + Representation representation = new StringRepresentation(documentBody); + request.setEntity(representation); + Response response = client.handle(request); + if (response.getStatus().getCode() != 200){ + throw new IOException(response.getStatus().getDescription()); + } + Representation output = response.getEntity(); + return output.getStream(); + } + + private synchronized void initialize() { + if (!initialized) { + PropertiesReader pr = PropertiesReaderFactory.getInstance() + .getPropertiesReader(); + int count = Integer.parseInt(pr.getPropertieValue( + ARTIFACTDATABASE_COUNT_ID, "0")); + artifactDatabases = new ArrayList(count); + for (int i = 0; i < count; i++) { + artifactDatabases.add(pr.getPropertieValue( + ARTIFACTDATABASE_URL_ID + "." + (i + 1), "N/N")); + } + initialized = true; + } + + } + + + /** + * Creates a new artifact with the given artifactFactory. 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> parameterMap = + ((ParametrizedArtifactObject)artifactFactory).getParameters(); + if (parameterMap != null && !parameterMap.isEmpty() ){ + Iterator keyIt = parameterMap.keySet().iterator(); + while (keyIt.hasNext()){ + String key = keyIt.next(); + Iterator valueIt = parameterMap.get(key).iterator(); + while (valueIt.hasNext()){ + String value = valueIt.next(); + Element parameterNode = + this.createArtifactElement(document, "parameter"); + parameterNode.setAttribute("name", key); + parameterNode.setAttribute("value", value); + factoryNode.appendChild(parameterNode); + } + } + } + } + return document; + } + + private Element createRootNode(Document document) { + Element rootNode = this.createArtifactElement(document, "action"); + document.appendChild(rootNode); + return rootNode; + } + + + 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 outputModes = null; + if (outputNode != null) { + NodeList outputModesNodes = XMLUtils.getNodeSetXPath( + outputNode, "art:output"); + if (outputModesNodes != null) { + outputModes = new HashMap( + outputModesNodes.getLength()); + for (int i = 0; i < outputModesNodes.getLength(); i++) { + Node outputModeNode = outputModesNodes.item(i); + String name = XMLUtils.getStringXPath(outputModeNode, + "@name"); + String mimeType = XMLUtils.getStringXPath( + outputModeNode, "@mime-type"); + + NodeList parameterNodes = XMLUtils.getNodeSetXPath( + outputModeNode, "art:parameter/art:parameter"); + Collection parameter = null; + if (parameterNodes != null) { + parameter = new ArrayList( + parameterNodes.getLength()); + for (int j = 0; j < parameterNodes.getLength(); j++) { + Node outputParameterNode = parameterNodes + .item(j); + parameter.add(new DefaultOutputParameter( + XMLUtils.getStringXPath( + outputParameterNode, "@name"), + XMLUtils.getStringXPath( + outputParameterNode, "@value"), + XMLUtils.getStringXPath( + outputParameterNode, "@name"), + XMLUtils.getStringXPath( + outputParameterNode, "@type"))); + } + } + + NodeList exportNodes = XMLUtils.getNodeSetXPath( + outputModeNode, "art:exports/art:export"); + Map exports = null; + + if (exportNodes != null) { + int size = exportNodes.getLength(); + exports = new HashMap(size); + + for (int k = 0; k < size; k++) { + Node export = exportNodes.item(k); + String expName = XMLUtils.getStringXPath( + export, "@name"); + exports.put(expName, new DefaultExportMode( + expName, + XMLUtils.getStringXPath(export, "@description"), + XMLUtils.getStringXPath(export, "@mime-type"))); + } + } + + outputModes.put(name, new DefaultOutputMode(name, + mimeType, parameter, exports)); + } + + } + } + + String currentState = XMLUtils.getStringXPath(document, + "/art:result/art:state/@name"); + NodeList statesList = XMLUtils.getNodeSetXPath(document, + "/art:result/art:reachable-states/art:state/@name"); + Collection reachableStates = new ArrayList( + statesList.getLength()); + for (int i = 0; i < statesList.getLength(); i++) { + reachableStates.add(statesList.item(i).getNodeValue()); + } + + NodeList inputNodes = XMLUtils.getNodeSetXPath(document, + "/art:result/art:model/art:input"); + if (inputNodes != null) { + Collection inputParameter = new ArrayList( + inputNodes.getLength()); + for (int i = 0; i < inputNodes.getLength(); i++) { + Node inputNode = inputNodes.item(i); + String name = XMLUtils.getStringXPath(inputNode, "@name"); + inputParameter.add(name); + } + ad.setInputParameter(inputParameter); + } + + ad.setOutputModes(outputModes); + ad.setCurrentOut(outputNode); + ad.setCurrentUI(uiNode); + ad.setCurrentState(currentState); + ad.setReachableStates(reachableStates); + return ad; + } else { + log.error("Artifact must be Instance of ArtifactDescription"); + throw new ArtifactDatabaseClientException( + "Artifact must be Instance of ArtifactDescription"); + } + + } + + + /** + * 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) + 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) { + 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, + Document document, String nodeName) { + Element dataNode = this.createArtifactElement(document, nodeName); + + if (inputParameter != null) { + Iterator it = inputParameter.iterator(); + while (it.hasNext()) { + InputParameter ip = it.next(); + String name = ip.getName(); + String[] values = ip.getValues(); + if (values != null) { + for (int i = 0; i < values.length; i++) { + String value = values[i]; + Element inputNode = this.createArtifactElement( + document, "input"); + inputNode.setAttribute("name", name); + inputNode.setAttribute("value", value); + dataNode.appendChild(inputNode); + } + } + } + } + return dataNode; + } + + + /** + * 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 + * stream. + * + * @param exportMode + * @param inputParameter + */ + public void doOutput( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact, + OutputStream stream, + String targetName, + String exportMode, + String mimeType, + Collection inputParameter) + throws ArtifactDatabaseClientException + { + try { + Document requestBody = this.createOutRequestBody( + currentArtifact, + targetName, + exportMode, + mimeType, + inputParameter); + + String requestUrl = this.getArtifactUrl(artifactFactory, + currentArtifact) + + "/" + targetName; + InputStream is = this.doPostRequest(requestUrl, requestBody); + + byte[] b = new byte[4096]; + int i = -1; + while ((i = is.read(b)) > 0) { + stream.write(b, 0, i); + } + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + } + + + /** + * 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) + { + 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) + 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 + ) 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 calculateStatistics( + ArtifactObject artifactFactory, + ArtifactObject currentArtifact) + throws ArtifactDatabaseClientException + { + log.debug("DefaultArtifactDatabaseClient.calculateStatistics"); + Collection resultValues = null; + + try { + String targetName = "statistics"; + String requestUrl = this.getArtifactUrl(artifactFactory, + currentArtifact) + "/" + targetName; + Document requestBody = this.createOutRequestBody(currentArtifact, + targetName, "", "text/xml", null); + XMLUtils xmlUtils = new XMLUtils(); + InputStream is = this.doPostRequest(requestUrl, requestBody); + Document resultDocument = XMLUtils.readDocument(is); + if (resultDocument != null) { + + NodeList statisticSetNodes = XMLUtils.getNodeSetXPath(resultDocument, + "/art:statistics/art:statistic"); + resultValues = new ArrayList + (statisticSetNodes.getLength()); + for (int i = 0; i < statisticSetNodes.getLength(); i++) { + Element statisticSetNode = (Element)statisticSetNodes.item(i); + String name = statisticSetNode.getAttribute("name"); + ArtifactStatisticsSet set = + new DefaultArtifactStatisticsSet(name); + NodeList resultNodes = XMLUtils.getNodeSetXPath(statisticSetNode, + "art:statistic-value"); + if (resultNodes != null) { + for (int j = 0; j < resultNodes.getLength(); j++) { + Element statisticNode = (Element)resultNodes.item(j); + String statisticName = statisticNode. + getAttribute("name"); + String statisticValue = statisticNode. + getAttribute("value"); + set.addStatisticValues( + new DefaultArtifactStatisticValue + (statisticName,statisticValue)); + } + } + resultValues.add(set); + } + } + } catch (IOException e) { + log.error(e, e); + throw new ArtifactDatabaseClientException(e); + } + + return resultValues; + } + + public void setLocale(Locale locale) { + this.locale = locale; + } + + public Locale getLocale() { + return locale; + } + + + public Collection getArtifactFactoryMetaInformation( + Collection mapServices, + String geometry, + String srs) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { + log.debug("DefaultArtifactDatabaseClient.getArtifactFactories"); + Collection resultValues = null; + try { + this.initialize(); + Iterator it = artifactDatabases.iterator(); + Document requestBody = this.createMetaDataRequestBody(mapServices, + geometry, + srs); + while (it.hasNext()) { + String server = it.next(); + String url = server + "/service/metadata/"; + log.debug(url); + + InputStream resultStream = this.doPostRequest(url, requestBody); + resultValues = this.parseMetaDataResult(resultStream, server,geometry); + } + } catch (IOException e) { + log.error(e,e); + } + return resultValues; + } + + private Collection parseMetaDataResult( + InputStream inputStream, + String server, + String geometry) + throws ArtifactDatabaseClientException, ArtifactDatabaseInputException { + XMLUtils xmlUtils = new XMLUtils(); + Document document = XMLUtils.readDocument(inputStream); + this.check4ExceptionReport(document); + return this.getArtifactFactories(document, server,geometry); + } + + private Document createMetaDataRequestBody(Collection mapServices, + String geometry, + String srs){ + log.debug("DefaultArtifactDatabaseClient.createMetaDataRequestBody"); + Document document = XMLUtils.newDocument(); + Node rootNode = this.createArtifactElement(document, "GetMetaData"); + document.appendChild(rootNode); + + if (geometry != null){ + Element locationNode = this.createArtifactElement(document, "location"); + locationNode.setAttribute("srs", srs); + locationNode.appendChild(document.createTextNode(geometry)); + rootNode.appendChild(locationNode); + } + Element mapServicesNode = this.createArtifactElement(document, + "mapservices"); + Iterator it = mapServices.iterator(); + while (it.hasNext()){ + MapService mapService = it.next(); + Element mapServiceNode = this.createArtifactElement(document, + "mapservice"); + mapServiceNode.setAttribute("id", mapService.getID()); + mapServiceNode.setAttribute("type", mapService.getType()); + mapServiceNode.setAttribute("url", mapService.getURL()); + if (mapService.getLayer() != null){ + Iterator layer = mapService.getLayer().iterator(); + while (layer.hasNext()){ + Layer tmpLayer = layer.next(); + Element layerNode = this.createArtifactElement(document, + "layer"); + layerNode.setAttribute("id", tmpLayer.getID()); + layerNode.setAttribute("name", tmpLayer.getName()); + layerNode.setAttribute("isgrouplayer", + ""+tmpLayer.isGroupLayer()); + layerNode.setAttribute("parentid", tmpLayer.parentID()); + mapServiceNode.appendChild(layerNode); + } + } + mapServicesNode.appendChild(mapServiceNode); + } + rootNode.appendChild(mapServicesNode); + return document; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseClientException.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.client.exception; + +/** + * Exception used for general errors in the artifact server. + * + * @author Tim Englich + * + */ +public class ArtifactDatabaseClientException extends Exception { + + /** + * The UID of this Class + */ + private static final long serialVersionUID = -8979622024425251952L; + + /** + * Constructor + */ + public ArtifactDatabaseClientException() { + super(); + } + + /** + * Constructor + * + * @param arg0 + */ + public ArtifactDatabaseClientException(String arg0) { + super(arg0); + } + + /** + * Constructor + * + * @param arg0 + */ + public ArtifactDatabaseClientException(Throwable arg0) { + super(arg0); + } + + /** + * Constructor + * + * @param arg0 + * @param arg1 + */ + public ArtifactDatabaseClientException(String arg0, Throwable arg1) { + super(arg0, arg1); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/ArtifactDatabaseInputException.java --- /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:14:00 2012 +0200 @@ -0,0 +1,59 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.client.exception; + +/** + * Exception used if an error occured caused by invalid input. + * + * @author Ingo Weinzierl + */ +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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/exception/package.html --- /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:14:00 2012 +0200 @@ -0,0 +1,8 @@ + + + + + +Exceptions that are thrown if server side errors occur. + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/package.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:14:00 2012 +0200 @@ -0,0 +1,9 @@ + + + + + +The communication between this client and an artifact server is defined in the +classes and interfaces of this package. + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/Artifact.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,184 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.Collection; +import java.util.Map; + +import org.w3c.dom.Node; + +/** + * An ArtifactObject representing an artifact. + * + * @author Tim Englich + * + */ +public class Artifact implements ArtifactObject, ArtifactDescription { + + + /** + * The UID of this Class + */ + private static final long serialVersionUID = 8606869493141810364L; + + /** + * The uuid of this Artifact which must be used to identify + * the artifact at the ArtifactDatabase. + */ + private String id = null; + + /** + * The hash of the artifact which was send be the ArtifactDatabase. + */ + private String hash = null; + + /** + * Flag which marks if the Artifact is currently selected or not. + */ + private boolean selected = false; + + /** + * The XML-Node of the current User-Interface + */ + private Node currentUI = null; + + /** + * The XML-Nodes of the OutputModes. + */ + private Node currentOut = null; + + /** + * The ids of the states which could be reached. + */ + private Collection reachableStates; + + /** + * The parameters whcih could be feed to the artifact at the current state. + */ + private Collection inputParameter; + + /** + * The OutputModes that could be reached at the current state. + */ + private Map outputModes; + + /** + * The id of the state which is currently used. + */ + private String currentState = null; + + /** + * Constructor + * @param uuid the uuid of this Artifact which must be used to identify + * the artifact at the ArtifactDatabase + * @param hash the hash of the artifact which was send be the + * ArtifactDatabase + */ + public Artifact(String uuid, String hash) { + this.id = uuid; + this.hash = hash; + } + + public Node getCurrentUI() { + return currentUI; + } + + + public void setCurrentUI(Node currentUI) { + this.currentUI = currentUI; + } + + + public Node getCurrentOut() { + return currentOut; + } + + + public void setCurrentOut(Node currentOut) { + this.currentOut = currentOut; + } + + + public Collection getReachableStates() { + return reachableStates; + } + + + public void setReachableStates(Collection reachableStates) { + this.reachableStates = reachableStates; + } + + + public String getCurrentState() { + return currentState; + } + + + public void setCurrentState(String currentState) { + this.currentState = currentState; + } + + 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 getInputParameter() { + return this.inputParameter; + } + + + public void setInputParameter(Collection inputParameter) { + this.inputParameter = inputParameter; + } + + + public Map getOutputModes() { + return this.outputModes; + } + + + public Collection getOutputModesAsCollection() { + if (this.outputModes != null) { + return this.outputModes.values(); + } + return null; + } + + + public void setOutputModes(Map outputModes) { + this.outputModes = outputModes; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactDescription.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,110 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +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 Tim Englich + */ +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 getReachableStates(); + + /** + * Set the reachable states. + * + * @param reachableStates the reachableStates to set + */ + public void setReachableStates(Collection 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 getInputParameter(); + + /** + * Set a collection of input parameters. + * + * @param inputParameter + */ + public void setInputParameter(Collection inputParameter); + + /** + * Retrieves a map of available output modes. + * + * @return the available output modes. + */ + public Map getOutputModes(); + + /** + * Retrieves a collection of available output modes. + * + * @return the available output modes. + */ + public Collection getOutputModesAsCollection(); + + /** + * Set the available output modes. + * + * @param outputModes A map that contains output modes. + */ + public void setOutputModes(Map outputModes); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactFactory.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,121 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +/** + * Implementation of an ArtifactObject> which represents an + * ArtifactFactory + * This Class provides the name, the description, the URL where the + * the ArtifactDatabase the factory belongs to could be reached + * and if the ArtifacFactory is currently selected or not. + * + * @author Tim Englich + */ +public class ArtifactFactory implements ArtifactObject { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 5453748230625831527L; + + /** + * The name of the factory. + */ + private String name = null; + + /** + * The description of the Factory. + */ + private String description = null; + + /** + * Flag which mark the Artifactfactory as selected if value is true + * unselected if value is false. + */ + private boolean selected = false; + + /** + * The URL where the Factory could be reached. + */ + private String dataBaseUrl = null; + + /** + * 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactObject.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * The ArtifactObject provides some information about an artifact. + * + * @author Tim Englich + */ +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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticValue.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,33 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * This is the Interfacedefinition for Statistic values that belongs + * to an Artifact. + * @author Tim Englich + * + */ +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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ArtifactStatisticsSet.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +import java.util.Collection; + +/** + * An inteface description for a container storing statistics. + * + * @author Tim Englich + */ +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 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticValue.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,51 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +/** + * The Defaultimplementation of ArtifactStatisticValue + * @author Tim Englich + * + */ +public class DefaultArtifactStatisticValue implements ArtifactStatisticValue { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = -8409111023127835398L; + + /** + * The key of the new Value. + */ + private String key = null; + + /** + * The value of the Object. + */ + private String value = null; + + /** + * 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; + } +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultArtifactStatisticsSet.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.ArrayList; +import java.util.Collection; + +/** + * The default implementation of ArtifactStatisticsSet. + * + * @author Tim Englich + * + */ +public class DefaultArtifactStatisticsSet implements ArtifactStatisticsSet{ + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 6738878381515708602L; + + /** + * The name of the StatisticsSet. + */ + private String name = null; + + /** + * The statisticsvalues which belong to this set. + */ + private Collection statisticValues = + new ArrayList(); + /** + * Constructor + * @param name the name of the StatisticsSet + */ + public DefaultArtifactStatisticsSet(String name) { + this.name = name; + } + + + public void addStatisticValues(ArtifactStatisticValue value) { + this.statisticValues.add(value); + } + + + public String getName() { + return this.name; + } + + + public Collection getStatisticValues() { + return this.statisticValues; + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf-8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultExportMode.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,62 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +/** + * This is the default implementation of ExportMode which stores + * information about a specific output target (e.g. pdf, svg, image). + * + * @author Ingo Weinzierl + */ +public class DefaultExportMode +implements ExportMode +{ + /** + * The name of this parameter. + */ + protected String name; + + /** + * The description of this mode. + */ + protected String description; + + /** + * The mimetype used for this mode. + */ + protected String mimeType; + + /** + * Creates a new ExportMode. + * + * @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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultInputParameter.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,53 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +/** + * The default implementation of InputParameter. + * + * @author Tim Englich + * + */ +public class DefaultInputParameter implements InputParameter { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 6597439837482244211L; + + /** + * The name of this parameter. + */ + private String name = null; + + /** + * The values of this parameter. + */ + private String[] values = null; + + /** + * Constructor + * @param name The name of this parameter. + * @param values The values of this parameter. + */ + 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputMode.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.Collection; +import java.util.Map; + +/** + * The default implementation of an OutputMode. + * + * @author Tim Englich + */ +public class DefaultOutputMode implements OutputMode { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = 7487880486604174521L; + + /** + * The name of the OutputMode + */ + private String name = null; + + /** + * The mimetype of the OutputMode + */ + private String mimeType = null; + + /** + * The parameters that could be used for this OutputMode + */ + private Collection outputParameter = null; + + /** + * The exports that can be called using this outputMode + */ + private Map exports; + + /** + * Constructor + * @param name The name of the OutputMode + * @param mimeType The mimetype of the OutputMode + * @param outputParameter The parameters that could be used for this OutputMode + * @param exports The exports that can be called using this outputMode + */ + public DefaultOutputMode( + String name, + String mimeType, + Collection outputParameter, + Map 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 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/DefaultOutputParameter.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,76 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +/** + * The default implementation of OutputParameter. + * + * @author Tim Englich + */ +public class DefaultOutputParameter implements OutputParameter { + + /** + * The UID of this Class. + */ + private static final long serialVersionUID = -8416057640116638152L; + + /** + * The name of the parameter + */ + private String name = null; + + /** + * The value of the parameter + */ + private String value = null; + + /** + * The description of the parameter + */ + private String description = null; + + /** + * The type of the parameter + */ + private String type = null; + + /** + * Constructor + * + * @param name The name of the parameter + * @param value The value of the parameter + * @param description The description of the parameter + * @param type The type of the parameter + */ + public DefaultOutputParameter(String name, String value, + String description, String type) { + 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ExportMode.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,43 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * An ExportMode describes a specific format of an output mode + * (e.g. pdf, svg, image). + * + * @author Ingo Weinzierl + */ +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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/InputParameter.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,35 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * InputParameter objects are used to store multiple values for a + * single key. + * + * @author Tim Englich + */ +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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputMode.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,54 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +import java.util.Collection; + +/** + * OutputMode objects give information possible types of exports + * for an artifact (e.g. chart, histogram, csv, odv, statistic). + * + * @author Tim Englich + * + */ +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 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/OutputParameter.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +import java.io.Serializable; + +/** + * An OutputParameter describes the input for an export mode and + * stores the value inserted by the user. + * + * @author Tim Englich + */ +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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactFactory.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,55 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.Collection; +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 Tim Englich + */ +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> 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>(); + } + + public Map> getParameters() { + return parameters; + } + + public void addParameters(String key, Collection values) { + this.parameters.put(key, values); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/ParametrizedArtifactObject.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,37 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects; + +import java.util.Collection; +import java.util.Map; + +/** + * Interface which extends the funtionality of the Interface + * ArtifactObject with methods for storing and retrieving + * optional Parameters. + * @author Tim Englich + */ +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> 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 values); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultLayer.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects.map; + +/** + * The default implementation of Layer. + * + * @author Tim Englich + */ +public class DefaultLayer implements Layer { + + + /** + * The id of this layer. + */ + private String id = null; + + /** + * The name of this layer. + */ + private String name = null; + + /** + * Flag which defines if this layer is an grouplayer. + */ + private boolean groupLayer = false; + + /** + * The id of the parent layer or null if this layer is an rootlayer. + */ + private String parentId = null; + + /** + * Constructor + * + * @param id the id of this layer + * @param name the name of this layer + * @param groupLayer flag which defines if this layer is an grouplayer + * @param parentId the id of the parent layer or null if this layer is an + * rootlayer + */ + public DefaultLayer(String id,String name, + boolean groupLayer,String parentId) { + 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/DefaultMapService.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects.map; + +import java.util.Collection; + +/** + * The default implementation of MapService. + * + * @author Tim Englich + */ +public class DefaultMapService implements MapService { + + /** + * The id of this mapservice. + */ + private String id = null; + + /** + * The layer which are provided by this mapservice. + */ + private Collection layer = null; + + /** + * The type of this mapservice. + */ + private String type = null; + + /** + * The URl of this mapservice. + */ + private String url = null; + + /** + * The Bbox which surrounds the data of the Mapservice + */ + private String bbox = null; + + /** + * The time until the server will provide the data. + */ + private String ttl = null; + + /** + * Constructor + * + * @param id the id of this mapservice + * @param layer the layer which are provided by this mapservice + * @param type the type of this mapservice + * @param url the URl of this mapservice + */ + public DefaultMapService(String id, Collection layer, + String type, String url) { + super(); + this.id = id; + this.layer = layer; + this.type = type; + this.url = url; + } + + /** + * Constructor + * + * @param id the id of this mapservice + * @param layer the layer which are provided by this mapservice + * @param type the type of this mapservice + * @param url the URl of this mapservice + * @param bbox the Bbox which surrounds the data of the Mapservice + * @param ttl the time until the server will provide the data. + */ + public DefaultMapService(String id, Collection layer, + String type, String url, String bbox, String ttl) { + this(id,layer,type,url); + this.bbox = bbox; + this.ttl = ttl; + } + + + public String getID() { + return this.id; + } + + + public Collection getLayer() { + return this.layer; + } + + + public String getType() { + return this.type; + } + + + public String getURL() { + return this.url; + } + + public String getBBoxValue() { + return this.bbox; + } + public String getTtl() { + return this.ttl; +} +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/Layer.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,47 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects.map; + +/** + * This interface defines some basic methods providing information about a map + * layer. + * + * @author Tim Englich + */ +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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/MapService.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.objects.map; + +import java.util.Collection; + +/** + * This interface defines some basic methods to provide information about a map + * service. + * + * @author Tim Englich + */ +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 getLayer(); + + /** + * Retrieves the bboxvalue served by a map service. + * @return the bboxvalue + */ + String getBBoxValue (); + + /** + * Returns the Time until the Service will provide the Data. + * @return the Time until the Service will provide the Data. + */ + String getTtl(); +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/map/package.html --- /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:14:00 2012 +0200 @@ -0,0 +1,8 @@ + + + + + +Objects used to store information about map services and provided layers. + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/objects/package.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:14:00 2012 +0200 @@ -0,0 +1,8 @@ + + + + + +Objects used to represent an artifact in this client. + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/artifactdatabase/package.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:14:00 2012 +0200 @@ -0,0 +1,9 @@ + + + + + +This package and it's subpackages provides the required infrastructure to +communicate with the ArtifactDatabase. + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/MapPropertiesReader.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,49 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.propertiesreader; + +import java.util.Map; + +import org.apache.log4j.Logger; + +/** + * A PropertiesReader storing properties in a Map. + * + * @author Tim Englich + * + */ +public class MapPropertiesReader implements PropertiesReader { + + private static Logger log = Logger.getLogger(MapPropertiesReader.class); + + /** + * The properties which are served by this PropertiesReader. + */ + private Map properties = null; + + /** + * Constructs a new MapPropertiesReader with an initial map. + * + * @param properties the properties which should be served by this + * PropertiesReader. + */ + public MapPropertiesReader(Map properties) { + super(); + 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReader.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.propertiesreader; + +/** + * An interface that defines a single method to retrieve properties specified by + * a key. + * + * @author Tim Englich + */ +public interface PropertiesReader { + + /** + * Retrieves a property by the given ke<. + * + * @param key The key of a property. + * @param defaultValue The default value which is returned if no property + * is found by key. + * @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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/PropertiesReaderFactory.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,85 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.propertiesreader; + +import java.util.Map; + +import javax.servlet.ServletConfig; + +import org.apache.log4j.Logger; + +/** + * @author Tim Englich + * + */ +public class PropertiesReaderFactory { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(PropertiesReaderFactory.class); + + /** + * The singleton Instance of this Factory. + */ + private static PropertiesReaderFactory instance = null; + + /** + * The ConnectionPool providing the Connections to the DatabaseBackends + */ + private PropertiesReader propertiesReader = null; + + /** + * Constructor + */ + private PropertiesReaderFactory() { + super(); + } + + /** + * This Method provides an singleton Instance of this Class. + * + * @return an singleton Instance of this Class + */ + public static PropertiesReaderFactory getInstance() { + if (instance == null) { + instance = new PropertiesReaderFactory(); + } + return instance; + } + + /** + * Getting the ConnectionPool + * + * @return the ConnectionPool + */ + public PropertiesReader getPropertiesReader() { + return this.propertiesReader; + } + + /** + * Getting the ConnectionPool + * + * @param config The Config that should be read + */ + public void initPropertiesReader(Object config) { + if (config instanceof ServletConfig) { + this.propertiesReader = new ServletPropertiesReader( + (ServletConfig) config); + } else if (config instanceof Map) { + this.propertiesReader = new MapPropertiesReader( + (Map) config); + } else { + log.error("No PropertiesReader for Instance " + + config.getClass().getName()); + } + + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/propertiesreader/ServletPropertiesReader.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.propertiesreader; + +import java.util.Enumeration; +import java.util.HashMap; +import java.util.Map; + +import javax.servlet.ServletConfig; + +import org.apache.log4j.Logger; + +/** + * This reader fetches the properties it will provide from the + * ServletConfig of an Context. + * It will read the InitParameters which could be configured using + * the web.xmlcontext. + * + * @author Tim Englich + * + */ +public class ServletPropertiesReader implements PropertiesReader { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(ServletPropertiesReader.class); + + /** + * The properties which are read from the ServletConfig. + */ + private Map properties = null; + + /** + * Constructor + * + * @param config the ServletConfig where + * the properties should be read from. + */ + public ServletPropertiesReader(ServletConfig config) { + super(); + log.info("ServletPropertiesReader will be initialized"); + if (config != null) { + + Enumeration keys = config.getInitParameterNames(); + properties = new HashMap(); + while (keys.hasMoreElements()) { + String key = keys.nextElement(); + String value = config.getInitParameter(key); + log.info("New ConbfigurationValue; " + key + " ==> " + value); + this.properties.put(key, value); + } + } + } + + + 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/propertiesreader/package.html --- /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:14:00 2012 +0200 @@ -0,0 +1,9 @@ + + + + + +This package provides reader and factories which will provide properties which +are configured in different files (e.g. web.xml) in the whole system. + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/servlet/GNVActionServlet.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.servlet; + +import javax.servlet.ServletConfig; +import javax.servlet.ServletException; + +import org.apache.log4j.Logger; +import org.apache.log4j.PropertyConfigurator; +import org.apache.struts.action.ActionServlet; + +import de.intevation.gnv.propertiesreader.PropertiesReaderFactory; + +/** + * The GNV ActionServlet. + * This Servelt will be used to handle all requests which are + * send to the GNV-WebClient. + * + * @author Tim Englich + */ +public class GNVActionServlet extends ActionServlet { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = null; + + /** + * The id which must be used to lookup the path to the + * log4j.properties file which is configured + * in the web.xml + */ + private final static String LOGGINIG_CONFIG_FILE_ID = "de.intevation.gnv." + + "servlet.log4j.configuration"; + + /** + * The UID of this class. + */ + 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 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/servlet/package.html --- /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:14:00 2012 +0200 @@ -0,0 +1,9 @@ + + + + + +This package provides the Servlet which will be used to handle +all requests which are send to the GNV-WebClient. + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/util/ArtifactNamespaceContext.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,72 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.util; + +import java.util.Iterator; + +import javax.xml.XMLConstants; +import javax.xml.namespace.NamespaceContext; + +/** + * The namespacecontext object used in xml documents retrieved by the artifact + * server. + * + * @author Sascha L. Teichmann + */ +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"; + + /** + * The singleton instance of this NamespaceContext + */ + public static final ArtifactNamespaceContext INSTANCE = + new ArtifactNamespaceContext(); + + /** + * Constructor + */ + public ArtifactNamespaceContext() { + } + + public String getNamespaceURI(String prefix) { + + if (prefix == null) { + throw new NullPointerException("Null prefix"); + } + + if (NAMESPACE_PREFIX.equals(prefix)) { + return NAMESPACE_URI; + } + + if ("xml".equals(prefix)) { + return XMLConstants.XML_NS_URI; + } + + return XMLConstants.NULL_NS_URI; + } + + public String getPrefix(String uri) { + throw new UnsupportedOperationException(); + } + + public Iterator getPrefixes(String uri) { + throw new UnsupportedOperationException(); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/util/CaptureInputStream.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/util/CaptureInputStream.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,71 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.util; + +import java.io.FilterInputStream; +import java.io.ByteArrayOutputStream; +import java.io.InputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; + +/** + * @author Sascha Teichmann + */ +public class CaptureInputStream +extends FilterInputStream +{ + protected ByteArrayOutputStream copy; + + public CaptureInputStream(InputStream in) { + super(in); + copy = new ByteArrayOutputStream(10*1024); + } + + public int read() throws IOException { + int x = in.read(); + if (x != -1) { + copy.write(x); + } + return x; + } + + public int read(byte [] b, int off, int len) throws IOException { + int r = in.read(b, off, len); + if (r > 0) { + copy.write(b, off, r); + } + return r; + } + + public long skip(long n) throws IOException { + long m = in.skip(n); + for (long i = m; i > 0L; --i) { // simulate gab + copy.write(0); + } + return m; + } + + public String copyToString() { + return copy.toString(); + } + + public String copyToString(String charsetName) + throws UnsupportedEncodingException + { + return copy.toString(charsetName); + } + + public byte [] toByteArray() { + return copy.toByteArray(); + } + + public void clear() { + copy.reset(); + } +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/util/XMLUtils.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/util/XMLUtils.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,395 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.util; + +import java.io.IOException; +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; + +/** + * This class provides many helper-Methods for handling different kinds of + * XML-stuff. + * @author Tim Englich + * @author Sascha L. Teichmann + */ +public class XMLUtils { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger logger = Logger.getLogger(XMLUtils.class); + + /** + * Constructor + */ + public XMLUtils() { + } + + /** + * Class which could be used to create XML-Elements + * @author Sascha L. Teichmann + * + */ + public static class ElementCreator { + + /** + * The document the elements should be placed in. + */ + protected Document document; + + /** + * The namespace that should be used. + */ + protected String ns; + + /** + * The prefix of the namespace that should be used. + */ + protected String prefix; + + /** + * Constructor + * @param document the document the elements should be placed in + * @param ns the namespace that should be used + * @param prefix the prefix of the namespace that should be used + */ + public ElementCreator(Document document, String ns, String prefix) { + this.document = document; + this.ns = ns; + this.prefix = prefix; + } + + /** + * Creates a new element using the given name. + * @param name the name of the new element. + * @return the new element + */ + public Element create(String name) { + Element element = document.createElementNS(ns, name); + element.setPrefix(prefix); + return element; + } + + /** + * Adds a new attribute to the given element. + * @param element the element where the attribute should be placed in. + * @param name the name of the attribute + * @param value the value of the attribute + */ + public void addAttr(Element element, String name, String value) { + Attr attr = document.createAttributeNS(ns, name); + attr.setValue(value); + attr.setPrefix(prefix); + element.setAttributeNode(attr); + } + } // class ElementCreator + + /** + * Creates a new document. + * @return the new document + */ + public static Document newDocument() { + try { + return DocumentBuilderFactory.newInstance().newDocumentBuilder() + .newDocument(); + } catch (ParserConfigurationException pce) { + logger.error(pce.getLocalizedMessage(), pce); + } + return null; + } + + /** + * Creates a new XPath-expression + * @return the new XPath-expression + */ + public static XPath newXPath() { + return newXPath(null); + } + + /** + * Creates a new XPath-expression + * @param namespaceContext the namespacecontext that should be used. + * @return the new XPath-expression + */ + public static XPath newXPath(NamespaceContext namespaceContext) { + XPathFactory factory = XPathFactory.newInstance(); + XPath xpath = factory.newXPath(); + if (namespaceContext != null) { + xpath.setNamespaceContext(namespaceContext); + } + return xpath; + } + + /** + * Fetch the value of an element or attribute from the given resource + * using the query. + * @param root the source where the value should be fetch from + * @param query the query that should be used to fetch the value + * @param namespaceContext the namespacecontext that must match to + * fetch the value. + * @return the value + */ + public static final String xpathString(Object root, String query, + NamespaceContext namespaceContext) { + return (String) xpath(root, query, XPathConstants.STRING, + namespaceContext); + } + + /** + * Fetch the object rom the given resource using the query. + * @param root the source where the value should be fetch from + * @param query the query that should be used to fetch the object + * @param returnType the Type that must be used to return the object, + * @param namespaceContext the namespacecontext that must match to + * fetch the object. + * @return the value + */ + public static final Object xpath(Object root, String query, + QName returnType, + NamespaceContext namespaceContext) { + if (root == null) { + return null; + } + try { + XPath xpath = XMLUtils.newXPath(namespaceContext); + if (xpath != null) { + return xpath.evaluate(query, root, returnType); + } + } catch (XPathExpressionException xpee) { + logger.error(xpee.getLocalizedMessage(), xpee); + } + return null; + } + + /** + * Fetch the object rom the given resource using the query + * and the default ArtifactNamespaceContext + * @param root the source where the value should be fetch from + * @param query the query that should be used to fetch the object + * @param returnType the Type that must be used to return the object + * @return the value + */ + public static Object getXPath(Object root, String query, QName returnType) { + return getXPath(root,query,returnType,ArtifactNamespaceContext.INSTANCE); + } + + /** + * Fetch the object rom the given resource using the query + * and the default ArtifactNamespaceContext + * @param root the source where the value should be fetch from + * @param query the query that should be used to fetch the object + * @param returnType the Type that must be used to return the object. + * @param context the namespacecontext that must match to + * fetch the object. + * @return the value + */ + public static Object getXPath( + Object root, String query, QName returnType, NamespaceContext context + ) { + return xpath(root, query, returnType, context); + } + + /** + * Fetch a Nodeset value from a XML-Fragment or XML-Document using the + * given query. + * @param root the source where the String should be fetched from + * @param query the query that should be used, + * @return the Nodeset fetched from the source + */ + public static NodeList getNodeSetXPath(Object root, String query) { + return (NodeList) getXPath(root, query, XPathConstants.NODESET); + } + + /** + * Fetch a Node from a XML-Fragment or XML-Document using the + * given query. + * @param root the source where the Node should be fetched from + * @param query the query that should be used, + * @return the Node fetched from the source + */ + public static Node getNodeXPath(Object root, String query) { + return (Node) getXPath(root, query, XPathConstants.NODE); + } + + /** + * Fetch a String value from a XML-Fragment or XML-Document using the + * given query. + * @param root the source where the String should be fetched from + * @param xpath the query that should be used, + * @return the String fetched from the source + */ + public static String getStringXPath(Object root, String xpath) { + return getStringXPath(root, xpath, null); + } + + /** + * Fetch a String value from a XML-Fragment or XML-Document using the + * given query. + * @param root the source where the String should be fetched from + * @param query the query that should be used, + * @param def the default-value that will be returned id no value was found + * @return the String fetched from the source + */ + public static String getStringXPath(Object root, String query, String def) { + String s = (String) getXPath(root, query, XPathConstants.STRING); + return s == null || s.length() == 0 ? def : s; + } + + /** + * Reads an XML-document from a given InputStream + * @param inputStream the InputStream where the document + * should be read from + * @return the document that could be read. + */ + public static Document readDocument(InputStream inputStream) { + Document returnValue = null; + try { + 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; + } + + /** + * Writes an single XML-Node to a string + * @param node the XML-Node that should be written + * @return the encoded XML-Node + */ + public static String writeNode2String(Node node) { + try { + DOMSource source = new DOMSource(node); + 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; + } + + /** + * Reinitialize the doument. + * This is neccessary because the namespace sometimes is invalid + * using a document which was created and used in the same step. + * @param document the document which should be reinitialize + * @return the document + */ + public static Document reInitDocument(Document document) { + StringBufferInputStream inputStream = new StringBufferInputStream( + writeDocument2String(document)); + return readDocument(inputStream); + } + + /** + * Writes the given Document into a String. + * This is very helpful for debugging. + * @param document the document which should be written to the string. + * @return the encoded xml-document. + */ + public static String writeDocument2String(Document document) { + try { + DOMSource source = new DOMSource(document); + 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; + } + + /** + * Writes a given DOMSource into a String + * @param source the source that should be written to string + * @return the encoded DOMSource + * @throws TransformerFactoryConfigurationError + * @throws TransformerConfigurationException + * @throws TransformerException + */ + 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(); + } + + /** + * Writes a given Document to an OutputStream + * @param document the document that should be written + * @param out the stream where the document should be written to, + * @return true if it was successful, false if not. + */ + public static boolean toStream(Document document, OutputStream out) { + try { + Transformer transformer = + TransformerFactory.newInstance().newTransformer(); + 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: diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/java/de/intevation/gnv/util/XSLTransformer.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,115 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.util; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.UnsupportedEncodingException; +import java.util.HashMap; +import java.util.Map; + +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 Tim Englich + */ +public class XSLTransformer { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = Logger.getLogger(XSLTransformer.class); + + /** + * The parameter that is required in the XSL sheet. + */ + private Map params; + + /** + * Constructor + */ + public XSLTransformer() { + super(); + } + + /** + * Turns toTransform into another format using the template + * templateFileName with the encoding. 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 { + Source templateSource = new StreamSource(new File(templateFileName)); + TransformerFactory xformFactory = TransformerFactory.newInstance(); + Transformer transformer = xformFactory + .newTransformer(templateSource); + + if (params != null) { + for(Map.Entry entry: params.entrySet()) { + transformer.setParameter(entry.getKey(), entry.getValue()); + } + } + + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + StreamResult scrResult = new StreamResult(baos); + // log.debug(xmlUtils.writeNode2String(toTransform)); + DOMSource source = new DOMSource(toTransform); + transformer.transform(source, scrResult); + resultValue = new String(baos.toByteArray(), encoding); + } catch (TransformerConfigurationException e) { + log.error(e, e); + } catch (UnsupportedEncodingException e) { + log.error(e, e); + } catch (TransformerFactoryConfigurationError e) { + log.error(e, e); + } catch (TransformerException e) { + log.error(e, e); + } + + return resultValue; + } + + + /** + * 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(3); + } + + params.put(name, value); + } +} +// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/java/de/intevation/gnv/util/package.html --- /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:14:00 2012 +0200 @@ -0,0 +1,8 @@ + + + + + +Some helper classes mainly used to work with XML documents. + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/resources/applicationMessages.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/resources/applicationMessages.properties Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,150 @@ +# 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.example.linestring=Beispiel WKT-Linestring einf\u00fcgen +gnviewer.example.polygon=Beispiel WKT-Polygon einf\u00fcgen + +gnviewer.productselection.overlay.title = Die Anfrage wird bearbeitet. Bitte gedulden Sie sich einen Moment. +gnviewer.productselection.fisselection.title = Fachinformationssystem + +# 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.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.refresh.title=Diagramm aktualisieren +gnviewer.output.options.export.csv.title=Daten als CSV exportieren +gnviewer.output.options.export.odv.title=Daten als ODV exportieren +gnviewer.output.options.export.png.title=Diagramm als PNG exportieren +gnviewer.output.options.export.pdf.title=Diagramm als PDF exportieren +gnviewer.output.options.export.svg.title=Diagramm als SVG exportieren +gnviewer.output.options.export.zip.title=ZIP-Archiv exportieren +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. +java.io.ioexception..java.heap.space =Es ist ein interner Serverfehler aufgetreten. Bitte benachrichtigen Sie den Support. +sessiontimeout.has.occured=Ihre Sitzung ist abgelaufen. + +# the map client +gnvview.mapclient.fullscreen = Vollbild +gnviewer.mapclient.layercontrol = Layerkontrolle +gnviewer.mapclient.layercontrol.baselayer = Hintergrundlayer +gnviewer.mapclient.layercontrol.overlay = Generierte Layer +gnviewer.mapclient.legend = Legende +gnviewer.mapclient.wms.load.title = Weitere Layer hinzuf\u00fcgen +gnviewer.mapclient.wms.load.addlayer = Layer hinzuf\u00fcgen +gnviewer.mapclient.wms.load.grid.name = Name +gnviewer.mapclient.wms.load.grid.title = Titel +gnviewer.mapclient.wms.load.bt.text = Laden +gnviewer.mapclient.wms.load.bt.tooltip = L\u00e4d das Capabilities Dokument vom angegebenen Server +gnviewer.mapclient.wms.load.grid.error.title = Fehler +gnviewer.mapclient.wms.load.grid.error.message = Unter der angegebenen Url konnten keine Layer ermittelt werden. +gnviewer.mapclient.controls.nav.previous.title = Springt zum letzten Kartenausschnitt +gnviewer.mapclient.controls.nav.next.title = Springt zum vorherigen Kartenausschnitt +gnviewer.mapclient.controls.navigate.title = Verschieben der Karte +gnviewer.mapclient.controls.zoombox.title = Zum Zoomen ziehen Sie eine Box auf, indem Sie klicken und ziehen +gnviewer.mapclient.controls.info.title = Detailinformationen zu Objekten durch Klicken in die Karte +gnviewer.mapclient.wms.local.service.name = GNV Web Map Service diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/resources/applicationMessages_en.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/resources/applicationMessages_en.properties Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,148 @@ +# 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.example.linestring=Insert an example linestring as wkt +gnviewer.example.polygon=Insert an example polygon as wkt + +gnviewer.productselection.overlay.title = Your request will be processed. Please wait... +gnviewer.productselection.fisselection.title = Data set + +# 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.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.refresh.title=Refresh chart +gnviewer.output.options.export.csv.title=Export Data as CSV +gnviewer.output.options.export.odv.title=Export Data as ODV +gnviewer.output.options.export.png.title=Export chart as PNG +gnviewer.output.options.export.pdf.title=Export chart as PDF +gnviewer.output.options.export.svg.title=Export chart as SVG +gnviewer.output.options.export.zip.title=Export as ZIP archive +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=An internal server error has occurred. Please contact the support. +java.io.ioexception..the.server.encountered.an.unexpected.condition.which.prevented.it.from.fulfilling.the.request=An internal server error has occurred. Please contact the support. +java.lang.illegalargumentexception..inputstream.cannot.be.null = An internal server error has occurred. Please contact the support. +input.is.not.valid.for.this.state=You entered an invalid value. Please try again. +input.not.a.integer= is not a valid integer. Please try again. +input.not.a.double= is not a valid floating-point number. Please try again. +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. +java.io.ioexception..java.heap.space = An internal server error has occurred. Please contact the support. +sessiontimeout.has.occured=Your session timed out. + +# the map client +gnvview.mapclient.fullscreen = Full screen +gnviewer.mapclient.layercontrol = Layercontrol +gnviewer.mapclient.layercontrol.baselayer = Baselayer +gnviewer.mapclient.layercontrol.overlay = Overlay +gnviewer.mapclient.legend = Legend +gnviewer.mapclient.wms.load.title = Add further Layer +gnviewer.mapclient.wms.load.addlayer = Add Layer +gnviewer.mapclient.wms.load.grid.name = Name +gnviewer.mapclient.wms.load.grid.title = Title +gnviewer.mapclient.wms.load.bt.text = Load +gnviewer.mapclient.wms.load.bt.tooltip = Load the Capabilities document from the given destination. +gnviewer.mapclient.wms.load.grid.error.title = Error +gnviewer.mapclient.wms.load.grid.error.message = No layer could be determined under the given url. +gnviewer.mapclient.controls.nav.previous.title = Jumps to the last Mapview +gnviewer.mapclient.controls.nav.next.title = Jumps to the last Mapview +gnviewer.mapclient.controls.navigate.title = Moves the map +gnviewer.mapclient.controls.zoombox.title = Zoom by clicking an moving the mouse to generate a box +gnviewer.mapclient.controls.info.title = Identify features by clicking +gnviewer.mapclient.wms.local.service.name = GNV Web Map Service diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/META-INF/context.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/META-INF/context.xml Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,2 @@ + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/classes/log4j.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/classes/log4j.properties Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,19 @@ +#### Log just errors and warnings to a file. +log4j.rootLogger=WARN, BSH + +## The following line enables the output of the MapViewer call document. +log4j.category.de.intevation.gnv.action.mapviewer.MapViewerCallAction=DEBUG + +#### Log everything to a file. +#log4j.rootLogger=DEBUG, BSH + +log4j.appender.BSH=org.apache.log4j.RollingFileAppender +log4j.appender.BSH.File=${catalina.base}/logs/gnv.log +log4j.appender.BSH.layout=org.apache.log4j.PatternLayout +log4j.appender.BSH.layout.ConversionPattern=%d [%t] %-5p %c - %m%n + +# set WARN log level for following packages to reduce output. +log4j.category.org.apache.jasper=WARN +log4j.category.org.apache.catalina=WARN +log4j.category.org.apache.commons=WARN +log4j.category.org.apache.struts=WARN diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/config/reachable-servers.conf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/config/reachable-servers.conf Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,34 @@ +['BSH WMS Background','http://gdisrv.bsh.de/arcgis/services/Background/Background/MapServer/WMSServer'], +['BSH WMS CONTIS Administration','http://gdisrv.bsh.de/arcgis/services/CONTIS/Administration/MapServer/WMSServer'], +['BSH WMS CONTIS Facilities','http://gdisrv.bsh.de/arcgis/services/CONTIS/Facilities/MapServer/WMSServer'], +['BSH WMS NAUTHIS Skin of the Earth','http://gdisrv.bsh.de/arcgis/services/Nauthis/SkinOfTheEarth/MapServer/WMSServer '], +['BSH WMS NAUTHIS Navigational Aids','http://gdisrv.bsh.de/arcgis/services/Nauthis/NavigationalAids/MapServer/WMSServer '], +['BSH WMS NAUTHIS Seawards Limits','http://gdisrv.bsh.de/arcgis/services/Nauthis/SeawardsLimits/MapServer/WMSServer'], +['BSH WMS NAUTHIS Rocks Wrecks Obstructions','http://gdisrv.bsh.de/arcgis/services/Nauthis/RocksWrecksObstructions/MapServer/WMSServer'], +['BSH WMS NAUTHIS Hydrography','http://gdisrv.bsh.de/arcgis/services/Nauthis/Hydrography/MapServer/WMSServer'], +['BSH WMS NAUTHIS Topography','http://gdisrv.bsh.de/arcgis/services/Nauthis/Topography/MapServer/WMSServer'], +['BSH WMS Water Pollution Reports','http://gdisrv.bsh.de/arcgis/services/WaterPollution/WaterPollution/MapServer/WMSServer'], +['BSH WMS Marine Environmental Monitoring Network','http://gdisrv.bsh.de/arcgis/services/MARNET/MARNET/MapServer/WMSServer'], +['BSH WMS Remote Sensing Sea Surface Temperature','http://gdisrv.bsh.de/arcgis/services/RemoteSensing/SeaSurfaceTemperature/MapServer/WMSServer'], +['BSH WMS Sea Surface Temperature Analysis','http://gdisrv.bsh.de/arcgis/services/SeaSurfaceTemperature/SeaSurfaceTemperature/MapServer/WMSServer'], +['BSH WMS Prediction Model Current','http://gdisrv.bsh.de/arcgis/services/PredictionModel/WaterCurrent/MapServer/WMSServer'], +['BSH WMS Prediction Model Water Level NN','http://gdisrv.bsh.de/arcgis/services/PredictionModel/WaterLevelNN/MapServer/WMSServer'], +['BSH WMS Prediction Model Water Temperature','http://gdisrv.bsh.de/arcgis/services/PredictionModel/WaterTemperature/MapServer/WMSServer'], +['BSH WMS Prediction Model Salinity','http://gdisrv.bsh.de/arcgis/services/PredictionModel/WaterSalinity/MapServer/WMSServer'], +['BSH WMS SGE Additional Information','http://gdisrv.bsh.de/arcgis/services/SGE/AdditionalInformation/MapServer/WMSServer'], +['BSH WMS SGE Seabed Sediments','http://gdisrv.bsh.de/arcgis/services/SGE/SeabedSediments/MapServer/WMSServer'], +['BSH WMS SGE Subsurface Sediments','http://gdisrv.bsh.de/arcgis/services/SGE/SubsurfaceSediments/MapServer/WMSServer'], +['BSH WMS SGE Survey','http://gdisrv.bsh.de/arcgis/services/SGE/Survey/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Sediment PCB','http://gdisrv.bsh.de/arcgis/services/MUDAB/SedimentPCB/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Sediment Metalle','http://gdisrv.bsh.de/arcgis/services/MUDAB/SedimentMetals/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Sediment HCH','http://gdisrv.bsh.de/arcgis/services/MUDAB/SedimentHCH/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser PCB','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterPCB/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser NƤhrstoffe','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterNutrients/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser Metalle','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterMetals/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser HCH','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterHCH/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser Physik','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterPhysical/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser PAH','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterPAH/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Wasser Pestizide','http://gdisrv.bsh.de/arcgis/services/MUDAB/WaterPesticide/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Biota PCB','http://gdisrv.bsh.de/arcgis/services/MUDAB/BiotaPCB/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Biota Metalle','http://gdisrv.bsh.de/arcgis/services/MUDAB/BiotaMetals/MapServer/WMSServer'], +['BSH WMS MUDAB BLMP Biota HCH','http://gdisrv.bsh.de/arcgis/services/MUDAB/BiotaHCH/MapServer/WMSServer'] \ No newline at end of file diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/config/struts-config.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/config/struts-config.xml Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + {$edit} + + + + {$edit} + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + + + +
+ + + + + + + + + +
+ + + + + +   + + + +
diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui.xsl Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,188 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + + + + + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + :
+
+ + :
+
+
+ + + + + : + + + + +
+ + +
+ + + + + + +
diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/footer.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/footer.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,35 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" language="java" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %> + + + + + + + + +
Ā© 2010 Bundesamt fĆ¼r Seeschifffahrt und Hydrographie
+ + + + + + +
+<%--div style="clear: left; margin-top: 40px;"/--%> diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/header.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/header.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,33 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ 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"%> + +
+

BSH Generischer Viewer

+
+ +
+ + + + + + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/imprint.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/imprint.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,50 @@ + + +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> + + + + + <bean:message key="gnviewer.app.title"/> + + + + + +
+
+

BSH Generischer Viewer

+
+ +
+ +
+ + + + + + +
+
+ TODO: Impressum. +
+
+ +
+
+ + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_inc.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,46 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> +<%@page import="java.util.Collection"%> +<%@page import="java.util.Iterator"%> +<%@page import="java.net.URLEncoder"%> +<% + // fetch diagramm parameter from request if the user clicked 'draw' + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + + String target = "chart"; + String mimeType = null; + String parameterString = ""; + + boolean supportChart = sm.getOutputMode(target) != null; + + if (supportChart){ + mimeType = sm.getOutputMode(target).getMimeType(); + DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); + Collection op = sm.getOutputMode(target).getOutputParameters(); + + if (op != null){ + Iterator it = op.iterator(); + while (it.hasNext()){ + OutputParameter parameter = it.next(); + parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); + } + } + } +%> + +<%-- diagramm is not null if the user clicked the 'draw' button --%> +
+ <bean:message key="gnviewer.output.options.diagramm.alt"/> +
+
diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_options_inc.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,120 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> +<%@page import="de.intevation.gnv.action.CommunicationKeys"%> +<%@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.util.Locale"%> +<%@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); + Locale locale = sm.getCurrentLocale(); + OutputMode outputMode = sm.getOutputMode(target); + DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); + + boolean useDiagrammOptions = diagrammOptions != null; + ExportMode supportIMG = outputMode.getExportMode(targetIMG); + ExportMode supportPDF = outputMode.getExportMode(targetPDF); + ExportMode supportSVG = outputMode.getExportMode(targetSVG); + + String mimeType = outputMode.getMimeType(); + String parameterString = ""; + Collection op = outputMode.getOutputParameters(); + + if (op != null){ + Iterator it = op.iterator(); + while (it.hasNext()){ + OutputParameter parameter = it.next(); + parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); + } + } + + + String mimeTypeIMG = null; + if (supportIMG != null) { + mimeTypeIMG = supportIMG.getMimeType(); + } + String mimeTypePDF = null; + if (supportPDF != null) { + mimeTypePDF = supportPDF.getMimeType(); + } + String mimeTypeSVG = null; + if (supportSVG != null) { + mimeTypeSVG = supportSVG.getMimeType(); + mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8"); + } +%> +
+
+ + + + + <% if (exceptionMsg != null) {%> +
+ '<%=exceptionValue%>' +
+ <%}%> + +
+ + <%if (outputMode != null && outputMode.getOutputParameters() != null && !outputMode.getOutputParameters().isEmpty()){ + Iterator it = outputMode.getOutputParameters().iterator(); + while (it.hasNext()){ + OutputParameter om = it.next(); %> + + + + + <%}%> +
+ + + <%if (om.getType().equalsIgnoreCase("boolean")){ + boolean checked = useDiagrammOptions ? "true".equalsIgnoreCase(diagrammOptions.getValue(om.getName(), locale)) : om.getValue().equalsIgnoreCase("true"); + %> + /> + <%}else{%> + + <%}%> +
+
+ " title=""/> + <%}%> + <%if (supportIMG != null) { %> + "> + + <%}%> + <%if (supportPDF != null) { %> + "> + + <%}%> + <%if (supportSVG != null) { %> + "> + + <%}%> +
+
+
+
diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_diagramm_statistics_inc.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,51 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="java.util.Collection"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticValue"%> +<%@page import="java.util.Iterator"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.ArtifactStatisticsSet"%> +
+<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + Collection statistics = sm.getStatistics(); +%> +
+ + + + <%if (statistics != null){ + Iterator it = statistics.iterator(); + while (it.hasNext()){ + ArtifactStatisticsSet set = it.next(); + %> +

<%=set.getName()%>

+ + + + + + <% + Iterator sit = set.getStatisticValues().iterator(); + while (sit.hasNext()){ + ArtifactStatisticValue asv = sit.next(); + %> + + + + + <%}%> +
<%=asv.getValue()%>
+ <%} %> + <%}%> +
+
diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_export_inc.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,114 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.ArtifactObject"%> +<%@page import="java.util.Collection"%> +<%@page import="java.util.Iterator"%> +<%@page import="java.net.URLEncoder"%> +<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + ArtifactObject artifact = sm.getCurrentArtifact(); + String mimeType = null; + String wmslayer = null; + String parameterString = ""; + + String target = "chart"; + String targetCSV = "csv"; + String targetODV = "odv"; + String targetZIP = "zip"; + String targetWMS = "wms"; + String targetSta = "statistics"; + String targetHis = "histogram"; + + boolean supportChart = sm.getOutputMode(target) != null; + boolean supportCSV = sm.getOutputMode(targetCSV) != null; + boolean supportODV = sm.getOutputMode(targetODV) != null; + boolean supportZIP = sm.getOutputMode(targetZIP) != null; + boolean supportWMS = sm.getOutputMode(targetWMS) != null; + boolean supportSta = sm.getOutputMode(targetSta) != null; + boolean supportHis = sm.getOutputMode(targetHis) != null; + + if (supportChart){ + mimeType = sm.getOutputMode(target).getMimeType(); + DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); + Collection op = sm.getOutputMode(target).getOutputParameters(); + + if (op != null){ + Iterator it = op.iterator(); + while (it.hasNext()){ + OutputParameter parameter = it.next(); + parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); + } + } + } + + String mimeTypeCSV = null; + if (supportCSV){ + mimeTypeCSV = sm.getOutputMode(targetCSV).getMimeType(); + } + + String mimeTypeODV = null; + if (supportODV){ + mimeTypeODV = sm.getOutputMode(targetODV).getMimeType(); + } + + String mimeTypeZIP = null; + if (supportZIP) { + mimeTypeZIP = sm.getOutputMode(targetZIP).getMimeType(); + } + + String mimeTypeWMS = null; + if (supportWMS) { + mimeTypeWMS = sm.getOutputMode(targetWMS).getMimeType(); + wmslayer = artifact.getId(); + } +%> + +<%-- display export options if one is supported in this state --%> +<% if (supportChart || supportCSV || supportODV || supportWMS || supportZIP) { %> +
+
+ + <%if (supportChart) { %> + " title=""> + + <%}%> + <%if (supportWMS) { %> + "> + + <%}%> + <%if (supportZIP) { %> + "> + + <%}%> + + <%if (supportSta) { %> + " title=""> + + <%}%> + + <%if (supportHis) { %> + " title=""> + + <%}%> + <%if (supportCSV) { %> + "> + + <%}%> + <%if (supportODV) { %> + "> + + <%}%> +
+
+<%}%> diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_fis_inc.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,39 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="java.util.Collection"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.ArtifactObject"%> +<%@page import="java.util.Iterator"%> +<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + Collection artifactFactories = sm.getArtifactFactories(); + String prefix = "gnviewer.fis."; +%> +
+
" method="post"> +
+ + <%if (artifactFactories != null){%> + + + <%}%> +
+ "/> +
+
+
diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_inc.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,40 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="de.intevation.gnv.action.sessionmodel.DiagrammOptions"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.OutputParameter"%> +<%@page import="java.util.Collection"%> +<%@page import="java.util.Iterator"%> +<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + + String parameterString = ""; + String target = "histogram"; + String mimeType = sm.getOutputMode(target).getMimeType(); + + DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); + Collection op = sm.getOutputMode(target).getOutputParameters(); + + if (op != null){ + Iterator it = op.iterator(); + while (it.hasNext()){ + OutputParameter parameter = it.next(); + parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); + } + + parameterString += "&bintype="+request.getAttribute("bintype"); + } +%> + +
+ <bean:message key="gnviewer.output.options.histogram.alt"/> +
diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_histogram_options_inc.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,143 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> +<%@page import="de.intevation.gnv.action.CommunicationKeys"%> +<%@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.util.Locale"%> +<%@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); + Locale locale = sm.getCurrentLocale(); + OutputMode outputMode = sm.getOutputMode(target); + DiagrammOptions diagrammOptions = sm.getDiagrammOptions(); + + boolean useDiagrammOptions = diagrammOptions != null; + ExportMode supportIMG = outputMode.getExportMode(targetIMG); + ExportMode supportPDF = outputMode.getExportMode(targetPDF); + ExportMode supportSVG = outputMode.getExportMode(targetSVG); + + String mimeType = outputMode.getMimeType(); + String parameterString = ""; + Collection op = outputMode.getOutputParameters(); + + if (op != null){ + Iterator it = op.iterator(); + while (it.hasNext()){ + OutputParameter parameter = it.next(); + parameterString = parameterString +"&"+parameter.getName()+"="+(diagrammOptions != null ? diagrammOptions.getValue(parameter.getName()): parameter.getValue()); + } + } + + String mimeTypeIMG = null; + if (supportIMG != null) { + mimeTypeIMG = supportIMG.getMimeType(); + } + String mimeTypePDF = null; + if (supportPDF != null) { + mimeTypePDF = supportPDF.getMimeType(); + } + String mimeTypeSVG = null; + if (supportSVG != null) { + mimeTypeSVG = supportSVG.getMimeType(); + mimeTypeSVG = URLEncoder.encode(mimeTypeSVG, "UTF-8"); + } +%> +
+
+ + + + + <% if (exceptionMsg != null) {%> +
+ '<%=exceptionValue%>' +
+ <%}%> + +
+ + <%if (outputMode != null && outputMode.getOutputParameters() != null && !outputMode.getOutputParameters().isEmpty()){ + Iterator it = outputMode.getOutputParameters().iterator(); + while (it.hasNext()){ + OutputParameter om = it.next(); + String diaOpts = null; + if (diagrammOptions != null) { + diaOpts = request.getParameter("bintype"); + }%> + + + + + + <%}%> +
+ <%if (om.getName().equals("bincount")) { + String check = ""; + if (diaOpts != null && diaOpts.equalsIgnoreCase("binwidth")) { + check = ""; + } + else { + check = "checked=\"checked\""; + }%> + name="bintype" value="bincount" id="checkCount" onClick="toggleBinType('checkWidth')"/> + <%}%> + <%if (om.getName().equals("binwidth")) { + String check = ""; + if (diaOpts != null && diaOpts.equalsIgnoreCase("binwidth")) { + check = "checked=\"checked\""; + } + else if (diaOpts == null) { + check = ""; + }%> + name="bintype" value="binwidth" id="checkWidth" onClick="toggleBinType('checkCount')"/> + <%}%> + + + + <%if (om.getType().equalsIgnoreCase("boolean")){ + boolean checked = useDiagrammOptions ? "true".equalsIgnoreCase(diagrammOptions.getValue(om.getName(), locale)) : om.getValue().equalsIgnoreCase("true"); + %> + /> + <%}else{%> + + <%}%> +
+ "/> + <%}%> + <%if (supportIMG != null) { %> + "> + + <%}%> + <%if (supportPDF != null) { %> + "> + + <%}%> + <%if (supportSVG != null) { %> + "> + + <%}%> +
+
+
diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/display_map_fullscreen_inc.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,19 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%> +
+

BSH Generischer Viewer

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

+ +

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

Informationen über den Generischen Viewer in der GDI BSH

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

Kontakt

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

+ Fachliche Fragen Jürgen Schulz-Ohlberg +

+ Technische Fragen Jörg Gerdes +

+

Über Generischen Viewer (GNV)

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

Umsetzung

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

Lizenz

+ + Die Software wird voraussichtlich im Sommer 2010 als Freie Software veröffentlicht. +
diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/includes/wms_header_inc.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,48 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@page import="de.intevation.gnv.action.MapClientStandaloneAction"%> +<% +boolean standalone = request.getAttribute(MapClientStandaloneAction.MAPCLIENTSTANDALONE_KEY) != null; +%> + + + + <bean:message key="gnviewer.app.title"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/index.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/index.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,180 @@ +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %> +<%@page import="java.util.Collection"%> +<%@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_published = request.getAttribute("wms_published"); + boolean furthertargets = true; + + if (chart == null && statistic == null && histogram == null && wms_published == 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); + + Object sessionException = request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_SESSION_ID); + sessionException = (sessionException != null ? sessionException.toString().replaceAll(" ", ".").replaceAll(":",".").toLowerCase() : null); + sessionException = (sessionException != null && sessionException.toString().endsWith(".") ? sessionException.toString().substring(0,sessionException.toString().length()-1) : sessionException); + + boolean showmapviewercallBody = request.getAttribute("MAPVIEWERCALL") != null; + + String exceptionProject = (String) request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_PROJECT); + exceptionProject = exceptionProject != null ? exceptionProject.toLowerCase() : null; + exceptionProject = exceptionProject != null ? exceptionProject.replaceAll(" ", ".") : null; +%> + + <%-- div container for project loading/saving and error messages related to this --%> +
+ + + + + +
+ "> + | + + +
+
" method="post" enctype="multipart/form-data"> +
+
"/>
+
+
+
+ <%if (exceptionProject != null) {%> +
+ +
+ "> + + +
+ <%}%> + <%if (showmapviewercallBody){ %> + + <%}%> +
+ + + + + + +
+ <%-- the parameter panel is following --%> +
+ <%if (staticui == null){ %> + + <%} else {%> +
+
+ + <%=staticui.toString()%> +
+
+ <%}%> + + <%-- render the dynamic part to feed the state and advance to the next state --%> + <%if (ui != null){%> +
+
" method="post"> +
+ + <%-- error message, if user input was not valid --%> + <%if (exception != null) {%> +
<%=exception%>
+ <%}%> + <%=ui != null ? ui.toString().replaceAll(" ", "") : "" %> + + <%if(furthertargets){%> +
+ "/> + <%}%> +
+
+
+ <%}%> + + <%-- render export options if existing for this state --%> + + + <%if (chart != null) {%> + + <%}%> + + + <%if (histogram != null) {%> + + <%}%> + + <%-- render wms options --%> + <%if (wms_published != null) {%> + + <%}%> +
+
+ <%if (exceptionMessage != null){ %> +
+ +

+ "> + + +

+
+ <%}%> + <%if (sessionException != null){ %> +
+ +
+ <%}%> + <%if (chart != null) {%> + <%-- render chart options if existing for this state --%> + + <%}%> + + <%-- render statistic --%> + <%if (statistic != null) {%> + + <%}%> + + <%-- render histogram --%> + <%if (histogram != null) {%> + + <%}%> + + <%-- render wms layer --%> + <%if (wms_published != null) {%> + + <%}%> +
diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/info.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/info.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,69 @@ + + +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<%@ page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@ page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@ page import="java.util.Locale"%> + +<% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + Locale locale = sm.getCurrentLocale(); +%> + + + + + <bean:message key="gnviewer.app.title"/> + + + + + +
+
+

BSH Generischer Viewer

+
+ +
+ +
+ + + + + + +
+
+ <% + if (locale.getLanguage().equals(Locale.GERMAN.getLanguage())) { + %> + + <% + } + else { + %> + + <% + } + %> +
+
+ +
+
+ + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/mainlayout.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,101 @@ + + +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> + + + + <bean:message key="gnviewer.app.title"/> + + + + + + + + + + + + + + +
+
+
+ +

+ "> + + +

+
+
+
+
+ +
+
+ +
+
+ +
+
+ + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/version.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/version.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,54 @@ + + +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> + + + + <bean:message key="gnviewer.app.title"/> + + + + + + + + + + + + + +
+
+
+

+ +

+
+
+
+ +
+
+

Generischer Viewer

+ Name:
+ Version:
+ Date:
+

Artifaktdatenbank

+ Name: N/N
+ Version: N/N
+ Date: N/N
+
+ +
+ + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/wmslayout.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,39 @@ + + +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> + + + +
+
+
+

+ +

+
+
+
+
+ +
+
+ +
+
+
+ +
+
+ + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/jsp/wmsstandalone.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/jsp/wmsstandalone.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,16 @@ + + +<%-- + Copyright (c) 2010 by Intevation GmbH + + This program is free software under the LGPL (>=v2.1) + Read the file LGPL.txt coming with the software for details + or visit http://www.gnu.org/licenses/ if it does not exist. +--%> + + + + + + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/WEB-INF/web.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/WEB-INF/web.xml Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,45 @@ + + + + Archetype Created Web Application + + action + de.intevation.gnv.servlet.GNVActionServlet + + + + config + /WEB-INF/config/struts-config.xml + + + + + de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.count + 1 + + + + + de.intevation.gnv.artifactdatabase.client.ArtifactDatabase.url.1 + http://localhost:8181 + + + + 1 + + + + + action + *.do + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/arrow_refresh.png Binary file gnv/src/main/webapp/images/arrow_refresh.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/auswaehlen.png Binary file gnv/src/main/webapp/images/auswaehlen.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/back_button.png Binary file gnv/src/main/webapp/images/back_button.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/bsh_logo.gif Binary file gnv/src/main/webapp/images/bsh_logo.gif has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/chart_bar.png Binary file gnv/src/main/webapp/images/chart_bar.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/chart_curve.png Binary file gnv/src/main/webapp/images/chart_curve.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/choose.png Binary file gnv/src/main/webapp/images/choose.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/data_export.png Binary file gnv/src/main/webapp/images/data_export.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/delete.png Binary file gnv/src/main/webapp/images/delete.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/diagram_export.png Binary file gnv/src/main/webapp/images/diagram_export.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/disk.png Binary file gnv/src/main/webapp/images/disk.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/laden.png Binary file gnv/src/main/webapp/images/laden.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/load.png Binary file gnv/src/main/webapp/images/load.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/map_go.png Binary file gnv/src/main/webapp/images/map_go.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/cloud-popup-relative.png Binary file gnv/src/main/webapp/images/ol/cloud-popup-relative.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/east-mini.png Binary file gnv/src/main/webapp/images/ol/east-mini.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/feature_info_off.png Binary file gnv/src/main/webapp/images/ol/feature_info_off.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/feature_info_on.png Binary file gnv/src/main/webapp/images/ol/feature_info_on.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/folder-open.gif Binary file gnv/src/main/webapp/images/ol/folder-open.gif has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/folder.gif Binary file gnv/src/main/webapp/images/ol/folder.gif has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/leaf.gif Binary file gnv/src/main/webapp/images/ol/leaf.gif has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/navigation_history.png Binary file gnv/src/main/webapp/images/ol/navigation_history.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/north-mini.png Binary file gnv/src/main/webapp/images/ol/north-mini.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/pan_off.png Binary file gnv/src/main/webapp/images/ol/pan_off.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/pan_on.png Binary file gnv/src/main/webapp/images/ol/pan_on.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/slider.png Binary file gnv/src/main/webapp/images/ol/slider.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/south-mini.png Binary file gnv/src/main/webapp/images/ol/south-mini.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/tool-sprites.gif Binary file gnv/src/main/webapp/images/ol/tool-sprites.gif has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/west-mini.png Binary file gnv/src/main/webapp/images/ol/west-mini.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/zoom-minus-mini.png Binary file gnv/src/main/webapp/images/ol/zoom-minus-mini.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/zoom-plus-mini.png Binary file gnv/src/main/webapp/images/ol/zoom-plus-mini.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/zoom-world-mini.png Binary file gnv/src/main/webapp/images/ol/zoom-world-mini.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/zoom_box_off.png Binary file gnv/src/main/webapp/images/ol/zoom_box_off.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/zoom_box_on.png Binary file gnv/src/main/webapp/images/ol/zoom_box_on.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/ol/zoombar.png Binary file gnv/src/main/webapp/images/ol/zoombar.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/pdf.png Binary file gnv/src/main/webapp/images/pdf.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/statistics.png Binary file gnv/src/main/webapp/images/statistics.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/svg.png Binary file gnv/src/main/webapp/images/svg.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/images/tick.png Binary file gnv/src/main/webapp/images/tick.png has changed diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/index.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/index.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,2 @@ +<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/scripts/ext/readme --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/ext/readme Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,3 @@ +curl "http://www.extjs.com/deploy/ext-2.3.0.zip" > ext-2.3.0.zip +unzip ext-2.3.0.zip +rm ext-2.3.0.zip \ No newline at end of file diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/scripts/geoext/readme --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/geoext/readme Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,4 @@ +curl "http://trac.geoext.org/attachment/wiki/Download/GeoExt-release-0.6.zip?format=raw" > GeoExt-release-0.6.zip +unzip GeoExt-release-0.6.zip +mv GeoExt geoext-0.6 +rm GeoExt-release-0.6.zip \ No newline at end of file diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/scripts/gnviewer.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/gnviewer.js Fri Sep 28 12:14:00 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"; +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/scripts/layers.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/layers.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,62 @@ + +<%@page import="java.util.Iterator"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.map.Layer"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.map.MapService"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModel"%>/** + * This function is called while initializing the application. You are allowed + * to change/add/remove layers. But be are of the comments inline this code! + */ +function initLayers() { + /** + * XXX This application needs a layer that is stored in a variable called + * 'layer'. So do not change the name of this variable. Just change the WMS + * layer itself. + */ + layer = new OpenLayers.Layer.WMS( + "Background1", + "http://gdisrv.bsh.de/arcgis/services/Background/Background/MapServer/WMSServer?", + { + layers: '0', + format: 'image/png', + transparent: false + }, + { + isBaseLayer: true, + singleTile: true + } + + ); + /** + * XXX This application needs an ARRAY that stores some layers (or a single + * layer). Do not change the name of the following variable 'layers'. + */ + layers = []; + layers[0] = layer; + + <% + SessionModel sm = SessionModelFactory.getInstance().getSessionModel(request); + MapService localMapService = sm.getLocalMapService(); + Iterator it = localMapService.getLayer().iterator(); + int i = 1; + while (it.hasNext()){ + Layer layer = it.next(); + %> + layer<%=i%> = new OpenLayers.Layer.WMS( + "<%=layer.getID() %>", + "<%=localMapService.getURL() %>", + { + layers: '<%=layer.getName()%>', + format: 'image/png', + transparent: true + }, + { + isBaseLayer: false, + singleTile: true + } + + ); + layers[<%=i%>] = layer<%=i++%>; + <%}%> + +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/scripts/olutils.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/olutils.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,238 @@ +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +function handleMeasurements(event) { + var geometry = event.geometry; + var units = event.units; + var order = event.order; + var measure = event.measure; + var element = document.getElementById('measurements'); + + var out = ""; + if(order == 1) { + out += "L\u00e4nge: " + measure.toFixed(3) + " " + units; + } else { + out += "Fl\u00e4che: " + measure.toFixed(3) + " " + units + "2"; + } + + element.innerHTML=out; +}; + + + +function readWMC(merge) { + var layers = mapPanel.layers; + map = mapPanel.map; + + var format = new OpenLayers.Format.WMC({'layerOptions': {buffer: 0}}); + var text = document.getElementById("wmc").value; + + merge = true; + if(merge) { + try { + map = format.read(text, {map: map}); + } catch(err) { + document.getElementById("wmc").value = err; + } + } else { + map.destroy(); + try { + var jsonFormat = new OpenLayers.Format.JSON(); + var mapOptions = jsonFormat.read(); + map = format.read(text, {map: mapOptions}); + } catch(err) { + document.getElementById("wmc").value = err; + } + } + + // create MapPanel + mapPanel = new GeoExt.MapPanel({ + border: true, + title: "Karte", + region: "center", + map: map, + zoom: 1, + layers: map.layers + }); +} + + +function writeWMC(merge) { + var format = new OpenLayers.Format.WMC({'layerOptions': {buffer: 0}}); + + try { + var text = format.write(map); + document.getElementById("wmc").value = text; + } catch(err) { + document.getElementById("wmc").value = err; + } +} + + + +function toggleGetFeatureInfo(evt) { + if (infoActive) { + infoControls.click.deactivate(); + infoActive = false; + } + else { + infoControls.click.activate(); + infoActive = true; + } +} + + +function showInfo(evt) { +} + + +function addLayer() { + var records = grid.getSelectionModel().getSelections(); + for (rec in records){ + + var record = records[rec]; + // TODO: Look for something better than object + if (typeof record == "object"){ + var copy = record.copy(); + copy.set("layer", record.get("layer")); + copy.get("layer").mergeNewParams({ + format: "image/png", + transparent: true + }); + mapPanel.layers.add(copy); + } + } + +} + + +// this is just copied from OpenLayers.Util +function urlAppend(url, paramStr) { + var newUrl = url; + if(paramStr) { + var parts = (url + " ").split(/[?&]/); + newUrl += (parts.pop() === " " ? + paramStr : + parts.length ? "&" + paramStr : "?" + paramStr); + } + return newUrl; +} + +function showWarning(){ + if (store.data.length == 0){ + Ext.MessageBox.alert("", '', grid); + return; + } +} + + +function updateCapabilities() { + + var url = capfield.getValue(); + var service = "SERVICE=WMS"; + var request = "REQUEST=GetCapabilities"; + var version = "VERSION=1.1.1"; + url = urlAppend(url, service); + url = urlAppend(url, request); + url = urlAppend(url, version); + + store = new GeoExt.data.WMSCapabilitiesStore({ + url: url, + layerOptions: {singleTile: true} + }); + store.load({ + callback: showWarning + }); + + grid.destroy(); + grid = new Ext.grid.GridPanel({ + id: 'wmsgrid', + collapsible: false, + split: false, + border: true, + // TODO: autoHeight might cause trouble + autoHeight: true, + overflow: 'auto', + store: store, + cm: new Ext.grid.ColumnModel([ + { + header: '', + dataIndex: 'name', + sortable: true + }, + { + id: 'title', + header: '', + dataIndex: 'title', + sortable: true + }]), + renderTo: 'capgrid', + bbar: [{ + text: '', + handler: addLayer + }] + }); +} + + +function editFeature(e) { + var feature = e.feature; + + // TODO SET FEATURE ATTRIBUTES + //feature.attributes['lawa'] = 999; + //feature.attributes['lawa_id'] = 999; + //feature.attributes['w_gwk_lawa'] = 999; + //feature.attributes['w_wrrl'] = 999; + //feature.attributes['length_fee'] = 999; +} + +function updateControls() { + var controls = panel.controls; + + controls.remove(drawPointControl); + controls.remove(drawPathControl); + controls.remove(drawPolygonControl); + + panel.destroy(); + panel = new OpenLayers.Control.Panel(); + panel.addControls(controls); + + if (points.getVisibility()) + panel.addControls(drawPointControl); + if (lines.getVisibility()) + panel.addControls(drawPathControl); + if (polygons.getVisibility()) + panel.addControls(drawPolygonControl); + + map.addControl(panel); +} +function parseGetFeatureInfoData(event) { + var contentHTML = "
"; + var features = event.features; + var first = true; + for (feat in features){ + if (feat != 'remove'){ + var feature = features[feat]; + var attributes = feature.attributes; + if (first){ + first = false; + }else{ + contentHTML += "
"; + } + contentHTML += ""; + for (att in attributes){ + contentHTML += ""; + } + contentHTML += "
"+att+":" + attributes[att] + "
"; + } + + } + contentHTML += "
"; + + mapPanel.map.addPopup(new OpenLayers.Popup.FramedCloud( + "chicken", + mapPanel.map.getLonLatFromPixel(event.xy), + null, + contentHTML, + null, + true + )); +} \ No newline at end of file diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/scripts/openlayers/readme --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/openlayers/readme Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,3 @@ +curl "http://www.openlayers.org/download/OpenLayers-2.9.zip" > OpenLayers.zip +unzip OpenLayers.zip +rm OpenLayers.zip \ No newline at end of file diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/scripts/viewport.jsp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/scripts/viewport.jsp Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,301 @@ +<%@page import="de.intevation.gnv.action.sessionmodel.SessionModelFactory"%> +<%@page import="de.intevation.gnv.action.MapClientStandaloneAction"%> +<%@page import="de.intevation.gnv.artifactdatabase.objects.map.MapService"%> +<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %> +<% +boolean standalone = request.getParameter(MapClientStandaloneAction.MAPCLIENTSTANDALONE_KEY) != null && +request.getParameter(MapClientStandaloneAction.MAPCLIENTSTANDALONE_KEY).equals("true"); +MapService mapService = SessionModelFactory.getInstance().getSessionModel(request).getLocalMapService(); +%> +OpenLayers.ImgPath = "images/ol/"; +OpenLayers.ProxyHost= "/cgi-bin/proxy.cgi?url="; +OpenLayers.Lang.setCode('<%=SessionModelFactory.getInstance().getSessionModel(request).getCurrentLocale().getLanguage() %>'); +Ext.BLANK_IMAGE_URL = "scripts/openlayers/OpenLayers-2.9/theme/default/img/blank.gif"; + +/** + * XXX + * Change specific attributes for map, wfs-t, etc here. Do not change these + * settings inline the code! + */ +PROJECTION = "EPSG:4326"; +MAX_EXTENT = new OpenLayers.Bounds(-90,-180,90,180); +CURRENT_EXTENT = new OpenLayers.Bounds(<%=mapService.getBBoxValue().replace(' ',',')%>); +INITIAL_CENTER = new OpenLayers.LonLat(5, 55); +GETFEATUREINFO_URL = "<%=mapService.getURL()%>"; + +Ext.onReady(function() { + + /* this function call initialized the layers that are defined by the user. + * The variable 'layer' and 'layers' are initialized in this function as + * well, that are used in the following code! So do not remove this function + * call. + */ + initLayers(); + + var options = { + maxExtent: MAX_EXTENT, + projection: PROJECTION, + controls: [], + units: 'm' + }; + + +/* ------------------------ Create map and add controls ---------------------*/ + // create map + map = new OpenLayers.Map(options); + map.displayProjection = new OpenLayers.Projection(PROJECTION); + + // add controls + + + var nav = new OpenLayers.Control.NavigationHistory(); + nav.previous.title = ""; + nav.next.title = ""; + map.addControl(nav); + + panel = new OpenLayers.Control.Panel(); + controls = { + previous: nav.previous, + next : nav.next, + navigate: new OpenLayers.Control.Navigation( + { + displayClass: 'olControlPan', + autoActivate: 'false', + title:'' + } + ), + zoombox: new OpenLayers.Control.ZoomBox( + { + displayClass: 'olControlZoomBox', + title: '' + } + ), + info : new OpenLayers.Control.WMSGetFeatureInfo({ + displayClass: "olControlFeatureInfo", + url: GETFEATUREINFO_URL, + title: '', + queryVisible: true, + infoFormat: 'application/vnd.ogc.gml', + eventListeners: { + getfeatureinfo: parseGetFeatureInfoData + } + }) + }; + + for (var key in controls) { + panel.addControls([controls[key]]); + } + + map.addControl(panel); + map.addControl(new OpenLayers.Control.PanZoomBar({zoomWorldIcon: 'true'})); + // Displaying the mouse postion + mousePosition = new OpenLayers.Control.MousePosition(); + map.addControl(mousePosition); + +/* --------------------------------------------------------------------------- */ + + // create MapPanel + mapPanel = new GeoExt.MapPanel({ + border: true, + region: "center", + map: map, + layers: layers + }); + + //map.setCenter(INITIAL_CENTER); + + + store = new GeoExt.data.WMSCapabilitiesStore({ + }); + + grid = new Ext.grid.GridPanel({ + id: 'wmsgrid', + collapsible: false, + split: false, + border: true, + //height: 400, + autoHeight: true, + store: store, + cm: new Ext.grid.ColumnModel([ + { + header: '', + dataIndex: 'name', + sortable: true + }, + { + id: 'title', + header: '', + dataIndex: 'title', + sortable: true + }]), + renderTo: 'capgrid', + bbar: [{ + text: '', + handler: addLayer + }] + }); + var cap = new Ext.Panel({ + id: 'wmspanel', + border: true, + region: 'east', + title: '', + collapsible: false, + split: false, + height: 400, + contentEl: 'cap' + + }); + + var capstore = new Ext.data.SimpleStore({ + fields: ['name','url'], + data : [['','<%=mapService.getURL()%>'],] + }); + capfield = new Ext.form.ComboBox({ + id: 'capfield', + store: capstore, + displayField:'name', + width: 245, + valueField: 'url', + mode: 'local', + triggerAction: 'all', + selectOnFocus: true, + renderTo: 'urlinput', + editable: false, + value: '<%=mapService.getURL()%>' + + }); + + + + var capbutton = new Ext.Button({ + id: 'capbutton', + region: 'west', + handler: updateCapabilities, + text: '', + tooltip: '', + renderTo: 'urlbutton' + }); + + + + +/* --------------------------- Layer Tree ----------------------------------- */ + + + // LayerTree + var tree = new Ext.tree.TreePanel({ + border: true, + enableDD: true, + region: "east", + title: "", + width: 200, + split: true, + collapsible: false, + collapseMode: "mini", + autoScroll: true, + loader: new Ext.tree.TreeLoader({ + applyLoader: false, + }), + root: { + nodeType: "async", + children: [{ + nodeType: "gx_baselayercontainer", + text: "", + expanded: true + }, { + nodeType: "gx_overlaylayercontainer", + text: "", + expanded: true, + loader: { + filter: function(record) { + var layer = record.get("layer"); + return layer.displayInLayerSwitcher === true && + layer.isBaseLayer === false; + } + } + }] + }, + rootVisible: false, + lines: false + }); + +/*-------------------------------- Feature grid -------------------------------*/ + + // create legend paneclass="headerLineLinksl + legendPanel = new GeoExt.LegendPanel({ + id: 'legendpanel', + dynamic: true, + border: true, + title: '', + collapsible: false, + split: false, + defaults: { + labelCls: 'legend', + style: 'padding: 5px' + }, + bodyStyle: 'padding:5px', + width: 250, + autoScroll: true, + region: 'east', + }); + + +// use separate panels + // Create GUI + + var mylegend = new Ext.Panel( + { + region: "west", + title: '', + split: true, + width: 250, + minSize: 225, + maxSize: 400, + collapsible: false, + overflow: 'auto', + margins: '0 0 0 5', + layout: 'accordion', + layoutConfig: { + animate: true, + activeOnTop: false + }, + items: [ + tree, + legendPanel, + cap + ] + } + ); + <%if (!standalone){%> + // The main panel + new Ext.Panel({ + renderTo: "mapcontainer", + layout: "border", + height: 400, + items: [mapPanel, mylegend] + }); + <%}else{ %> + // Create GUI + new Ext.Viewport({ + layout: "border", + items: [ + { + region: "north", + contentEl: "headline", + cls: 'title', + height: 40 + }, + mylegend, + mapPanel + ] + }); + <%}%> + map.zoomToExtent(CURRENT_EXTENT); + + // some code for automatically resizing the map panel if the window size + // changes + window.onresize=function() { + var mapcontainer = Ext.get('mapcontainer'); + mapPanel.setSize(mapcontainer.getSize()); + } +}); diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/styles/default.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/styles/default.css Fri Sep 28 12:14:00 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; + +} + +/* ----------------------------------- */ diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/styles/extjs-override.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/styles/extjs-override.css Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,35 @@ +.x-panel-header { + background: #F2F1F5; + border:1px solid #003A66; + color:#003A66; +} + +.x-border-layout-ct { + background:#F2F1F5; +} + +.x-panel-body { + border:1px solid #003A66; +} + +.x-toolbar{ + background:#F2F1F5; +} + +.x-panel-bbar .x-toolbar { + border:1px solid #003A66; +} + +.x-tool { + background:transparent url(../images/ol/tool-sprites.gif) no-repeat; +} + +.x-tree-node-expanded .x-tree-node-icon{ + background-image:url(../images/ol/folder-open.gif); +} +.x-tree-node-leaf .x-tree-node-icon{ + background-image:url(../images/ol/leaf.gif); +} +.x-tree-node-collapsed .x-tree-node-icon{ + background-image:url(../images/ol/folder.gif); +} \ No newline at end of file diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/styles/gnv.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/styles/gnv.css Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,301 @@ +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; +} + +.infoheadline { + border: 0; + color: #4C7594; + font-family: "Arial Black",Arial,Helvetica,sans-serif; + padding: 0; +} + +.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; +} + +.info-content { + padding-left : 15px; + padding-right: 15px; +} + +#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; +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/main/webapp/styles/ol_style.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/main/webapp/styles/ol_style.css Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,69 @@ +.wmcbox { + width: 100%; + height: 480px; +} + +.olControlPanel div { + background-color: white; + float: left; + display: block; + position: relative; + left: 80px; + margin: 5px; + width: 24px; + height: 24px; +} + +.olControlPanel .olControlFeatureInfoItemActive { + width: 22px; + height: 22px; + background-image: url("../images/ol/feature_info_on.png"); +} +.olControlPanel .olControlFeatureInfoItemInactive { + width: 22px; + height: 22px; + background-image: url("../images/ol/feature_info_off.png"); +} + + +.olControlNavigationHistory { + background-image: url("../images/ol/navigation_history.png"); + background-repeat: no-repeat; + width: 22px; + height: 22px; + +} + +.olControlPanel .olControlPanItemActive { + width: 22px; + height: 22px; + background-image: url("../images/ol/pan_on.png"); +} +.olControlPanel .olControlPanItemInactive { + width: 22px; + height: 22px; + background-image: url("../images/ol/pan_off.png"); +} + +.olControlPanel .olControlZoomBoxItemActive { + width: 22px; + height: 22px; + background-image: url("../images/ol/zoom_box_on.png"); +} +.olControlPanel .olControlZoomBoxItemInactive { + width: 22px; + height: 22px; + background-image: url("../images/ol/zoom_box_off.png"); +} + +div.olControlMousePosition { + color:#003A66; + background-color: #F2F1F5; + filter: alpha(opacity=75); + opacity: 0.75 +} + +.olHandlerBoxZoomBox { + border: 2px solid #003A66; + background-color: #F2F1F5;; +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/test/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/java/de/intevation/gnv/action/mapviewer/parser/ExternalCallParserTestCase.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.action.mapviewer.parser; + +import de.intevation.gnv.artifactdatabase.objects.map.Layer; +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 mapServices = ecp.getMapServices(); + assertNotNull(mapServices); + log.debug(mapServices.size()+"Mapservices parsed"); + assertEquals(2, mapServices.size()); + Iterator it = mapServices.iterator(); + MapService mapService1 = it.next(); + MapService mapService2 = it.next(); + + log.debug("MapService 1"); + log.debug("ID: "+mapService1.getID()); + log.debug("URL: "+mapService1.getURL()); + log.debug("TYPE: "+mapService1.getType()); + Collection layer1 = mapService1.getLayer(); + log.debug("Layer parsed: "+layer1.size()); + assertEquals(5, layer1.size()); + Iterator layerIt1 = layer1.iterator(); + while(layerIt1.hasNext()){ + log.debug(layerIt1.next().toString()); + } + + log.debug("MapService 2"); + log.debug("ID: "+mapService2.getID()); + log.debug("URL: "+mapService2.getURL()); + log.debug("TYPE: "+mapService2.getType()); + Collection layer2 = mapService2.getLayer(); + log.debug("Layer parsed: "+layer2.size()); + assertEquals(2, layer2.size()); + Iterator layerIt2 = layer2.iterator(); + while(layerIt2.hasNext()){ + log.debug(layerIt2.next().toString()); + } + + } catch (Exception e) { + log.error(e,e); + fail(); + } + + } + +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClientTestCase.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,107 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.artifactdatabase.client; + +import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription; +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 Tim Englich + * + */ +public class ArtifactDatabaseClientTestCase extends TestCase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = null; + + static { + BasicConfigurator.configure(); + log = Logger.getLogger(DefaultArtifactDatabaseClient.class); + } + + /** + * Constructor + * + * @param namemessage + */ + public ArtifactDatabaseClientTestCase(String name) { + super(name); + } + + /** + * @see junit.framework.TestCase#setUp() + */ + @Override + protected void setUp() throws Exception { + super.setUp(); + } + + public void testArtifactDatabaseClient() { + + try { + ArtifactDatabaseClient artifactDatabaseClient = ArtifactDatabaseClientFactory + .getInstance().getArtifactDatabaseClient(Locale.GERMAN); + Collection factories = artifactDatabaseClient + .getArtifactFactories(); + if (factories != null && !factories.isEmpty()) { + Iterator it = factories.iterator(); + while (it.hasNext()) { + ArtifactObject aof = it.next(); + ArtifactObject artifact = artifactDatabaseClient + .createNewArtifact(aof); + ArtifactDescription ad = artifactDatabaseClient + .getCurrentStepDescription(aof, artifact,true); + log.debug("Artifact aktualisert."); + XSLTransformer transformer = new XSLTransformer(); + String transformedUI = transformer + .transform( + ad.getCurrentUI(), + "UTF-8", + ("src/main/webapp/WEB-INF/config/templates/describe-ui.xsl")); + log.debug(transformedUI); + + Collection inputParameter = new ArrayList( + 1); + inputParameter.add(new DefaultInputParameter("product", + new String[] { "timeSeries" })); + ad = artifactDatabaseClient.doNextStep(aof, artifact, + "timeSeries", inputParameter); + + transformedUI = transformer + .transform( + ad.getCurrentUI(), + "UTF-8", + ("src/main/webapp/WEB-INF/config/templates/describe-ui.xsl")); + log.debug(transformedUI); + } + } + + } catch (Exception e) { + log.error(e, e); + fail(); + } + } + +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/java/de/intevation/gnv/util/XSLTransformerTestCase.java Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,63 @@ +/* + * Copyright (c) 2010 by Intevation GmbH + * + * This program is free software under the LGPL (>=v2.1) + * Read the file LGPL.txt coming with the software for details + * or visit http://www.gnu.org/licenses/ if it does not exist. + */ + +package de.intevation.gnv.util; + +import de.intevation.gnv.artifactdatabase.client.DefaultArtifactDatabaseClient; + +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 Tim Englich + * + */ +public class XSLTransformerTestCase extends TestCase { + + /** + * the logger, used to log exceptions and additonaly information + */ + private static Logger log = null; + + static { + BasicConfigurator.configure(); + log = Logger.getLogger(DefaultArtifactDatabaseClient.class); + } + + public XSLTransformerTestCase() { + super(); + } + + public XSLTransformerTestCase(String name) { + super(name); + } + + public void testDescribeUI() { + + try { + // System.setProperty("javax.xml.transform.TransformerFactory","com.icl.saxon.TransformerFactoryImpl"); + Document document = new XMLUtils() + .readDocument(new FileInputStream(new File( + "src/test/ressources/describe-ui-test.xml"))); + XSLTransformer transformer = new XSLTransformer(); + String value = transformer.transform(document, "UTF-8", + "src/main/webapp/WEB-INF/config/templates/describe-ui.xsl"); + log.debug(value); + } catch (FileNotFoundException e) { + log.error(e, e); + } + } +} diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/test/ressources/describe-ui-test.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/ressources/describe-ui-test.xml Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,10 @@ + + + product + + + timeSeries + timeSeries + + + diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/test/ressources/externalinterfacecall.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/ressources/externalinterfacecall.xml Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + EPSG:4324 + POINT(8.6 56.0) + + \ No newline at end of file diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/test/ressources/externalinterfacecall_curl.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/ressources/externalinterfacecall_curl.xml Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EPSG:4324 + POINT(8.6 56.0) + + \ No newline at end of file diff -r c01c220312d0 -r 7c4f81f74c47 gnv/src/test/ressources/samplecall.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gnv/src/test/ressources/samplecall.txt Fri Sep 28 12:14:00 2012 +0200 @@ -0,0 +1,1 @@ +curl -v -X POST -H "Content-type: text/xml" http://localhost:8080/gnv/extcall.do -d @externalinterfacecall_curl.xml \ No newline at end of file