changeset 166:c5edd8fcae8c

Added localized Exception Messages. Added CSS-Entry for the Exception Message Container and put the div at a proper place. gnv/trunk@331 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Thu, 12 Nov 2009 15:30:28 +0000
parents 183850730a90
children 1857273577e3
files gnv/ChangeLog gnv/src/main/resources/applicationMessages.properties gnv/src/main/resources/applicationMessages_en.properties gnv/src/main/webapp/WEB-INF/jsp/header.jsp gnv/src/main/webapp/styles/default.css
diffstat 5 files changed, 51 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Thu Nov 12 11:03:11 2009 +0000
+++ b/gnv/ChangeLog	Thu Nov 12 15:30:28 2009 +0000
@@ -1,3 +1,13 @@
+2009-11-12  Tim Englich  <tim.englich@intevation.de>
+
+	* src/main/webapp/styles/default.css: 
+	  Added CSS-Entry for the Exception Message Container and
+	  put the div at a proper place.
+	* src/main/resources/applicationMessages*.properties: 
+	  Added localized Exception Messages.
+	* src/main/webapp/WEB-INF/jsp/header.jsp:
+	  Added the localization of Exception Messages. 
+
 2009-11-12  Tim Englich  <tim.englich@intevation.de>
 
 	* src/main/java/de/intevation/gnv/action/sessionmodel/SessionModel.java,
--- a/gnv/src/main/resources/applicationMessages.properties	Thu Nov 12 11:03:11 2009 +0000
+++ b/gnv/src/main/resources/applicationMessages.properties	Thu Nov 12 15:30:28 2009 +0000
@@ -60,3 +60,15 @@
 
 height=H\u00f6he
 width=Breite
+
+
+
+# Fehlermeldungen:
+
+java.io.ioexception..connection.refused = Die Verbindung zur Artifaktdatenbank ist unterbrochen. Bitte probieren Sie es zu einem späteren 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ählt. Bitte wählen 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.
+ 
--- a/gnv/src/main/resources/applicationMessages_en.properties	Thu Nov 12 11:03:11 2009 +0000
+++ b/gnv/src/main/resources/applicationMessages_en.properties	Thu Nov 12 15:30:28 2009 +0000
@@ -60,3 +60,10 @@
 
 height=Height
 width=Width
+
+java.io.ioexception..connection.refused = The Connection to the ArtifactDatabase is interrupted. Please try again later.
+java.io.ioexception..unable.to.parse.the.response.http.version..end.of.stream.reached.too.early= The Connection to the ArtifactDatabase was interrupted unexpected.
+no.inputdata.given..please.select.at.least.one.entry = No Entry was chosen. Please select at least one entry.
+de.intevation.gnv.geobackend.base.query.exception.queryexception..java.sql.sqlexception: A internal Server error has occurred. Please contact the Support.
+java.io.ioexception..the.server.encountered.an.unexpected.condition.which.prevented.it.from.fulfilling.the.request = A internal Server error has occurred. Please contact the Support.
+java.lang.illegalargumentexception..inputstream.cannot.be.null = A internal Server error has occurred. Please contact the Support.
\ No newline at end of file
--- a/gnv/src/main/webapp/WEB-INF/jsp/header.jsp	Thu Nov 12 11:03:11 2009 +0000
+++ b/gnv/src/main/webapp/WEB-INF/jsp/header.jsp	Thu Nov 12 15:30:28 2009 +0000
@@ -1,10 +1,14 @@
-<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
-	language="java"%>
+<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" language="java"%>
 <%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
 <%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
+<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean-el" prefix="bean-el" %>
 <%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
 <%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles"%>
-<% Object exceptionMessage = request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID);%>
+<% Object exceptionMessage = request.getAttribute(CommunicationKeys.REQUEST_EXCEPTION_MESSAGE_ID);
+    exceptionMessage = (exceptionMessage != null ? exceptionMessage.toString().replaceAll(" ", ".").replaceAll(":",".").toLowerCase() : null);
+    exceptionMessage = (exceptionMessage != null && exceptionMessage.toString().endsWith(".") ? exceptionMessage.toString().substring(0,exceptionMessage.toString().length()-1) : exceptionMessage);
+    
+%>
 <%@page import="de.intevation.gnv.action.CommunicationKeys"%><html:xhtml />
 <!-- Kopfleiste-->
 <div id="head" title="GDI BSH genericViewer"> 
@@ -28,9 +32,12 @@
 			
 		</div>
 		<br/>
-		<div class="errormsg" id="load_error">
-			<%=exceptionMessage != null ? exceptionMessage.toString():"" %>
-		</div>
+		
 	</div>
+	<div class="errormsg" id="load_error">
+         <%if (exceptionMessage != null){ %>
+            <bean-el:message key="<%=exceptionMessage.toString()%>"/>
+         <%}%>
+     </div>
 </div>
 
--- a/gnv/src/main/webapp/styles/default.css	Thu Nov 12 11:03:11 2009 +0000
+++ b/gnv/src/main/webapp/styles/default.css	Thu Nov 12 15:30:28 2009 +0000
@@ -152,6 +152,15 @@
 	
 }
 
+#load_error {
+    position:absolute;
+    top:27px;   
+    left:425px;
+    width: 400px;
+    text-align: left;
+    
+}
+
 #project_load {
 	position:absolute;
 	top: 0px;

http://dive4elements.wald.intevation.org