changeset 703:21ad44ccdb84

Tooltip text of the back-button became language specific (issue227). gnv/trunk@943 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Mon, 19 Apr 2010 08:37:35 +0000
parents acb0cea94258
children ae946acba005
files gnv/ChangeLog gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java gnv/src/main/resources/applicationMessages.properties gnv/src/main/resources/applicationMessages_en.properties gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl
diffstat 8 files changed, 44 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/gnv/ChangeLog	Mon Apr 19 08:00:05 2010 +0000
+++ b/gnv/ChangeLog	Mon Apr 19 08:37:35 2010 +0000
@@ -1,3 +1,24 @@
+2010-04-19  Ingo Weinzierl <ingo.weinzierl@intevation.de>
+
+	  Issue227
+
+	* src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java,
+	  src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java:
+	  Added a new method to retrieve the current locale.
+
+	* src/main/java/de/intevation/gnv/action/DescribeUIAction.java: Feed the xsl
+	  transformer with a tooltip text for the back-button.
+
+	* src/main/resources/applicationMessages.properties,
+	  src/main/resources/applicationMessages_en.properties: Added a tooltip text
+	  for the back-button.
+
+	* src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl: Use the
+	  tooltip text that is fed in DescribeUIAction.
+
+	* src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java: Removed a
+	  PropertiesReader which isn't used there.
+
 2010-04-19	Sascha L. Teichmann	<sascha.teichmann@intevation.de>
 
 	* src/main/resources/applicationMessages.properties: Forgot a dot. ;-)
--- a/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java	Mon Apr 19 08:00:05 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/ChangeOptionsAction.java	Mon Apr 19 08:37:35 2010 +0000
@@ -8,9 +8,6 @@
 import de.intevation.gnv.artifactdatabase.objects.OutputMode;
 import de.intevation.gnv.artifactdatabase.objects.OutputParameter;
 
-import de.intevation.gnv.propertiesreader.PropertiesReader;
-import de.intevation.gnv.propertiesreader.PropertiesReaderFactory;
-
 import java.text.NumberFormat;
 import java.text.ParseException;
 
@@ -53,8 +50,6 @@
                                  HttpServletResponse response) throws Exception {
         log.debug("NextArtifactStepAction.execute");
         try {
-            PropertiesReaderFactory fac = PropertiesReaderFactory.getInstance();
-            PropertiesReader reader     = fac.getPropertiesReader();
             SessionModel sm = SessionModelFactory.getInstance()
                     .getSessionModel(request);
 
--- a/gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java	Mon Apr 19 08:00:05 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/action/DescribeUIAction.java	Mon Apr 19 08:37:35 2010 +0000
@@ -8,10 +8,15 @@
 
 import de.intevation.gnv.artifactdatabase.objects.ArtifactDescription;
 
+import de.intevation.gnv.propertiesreader.PropertiesReader;
+import de.intevation.gnv.propertiesreader.PropertiesReaderFactory;
+
 import de.intevation.gnv.util.ArtifactNamespaceContext;
 import de.intevation.gnv.util.XMLUtils;
 import de.intevation.gnv.util.XSLTransformer;
 
+import java.util.ResourceBundle;
+
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
@@ -81,11 +86,16 @@
 
             Node currentUI = artifactDescription.getCurrentUI();
             if (currentUI != null) {
+                ResourceBundle res = ResourceBundle.getBundle(
+                    "applicationMessages", adc.getLocale());
+                String editText = res.getString("gnviewer.history.back.button");
+
                 XSLTransformer transformer = new XSLTransformer();
 
                 String url = response.encodeURL(
                     mapping.findForward("back").getPath());
                 transformer.addParameter("back-url", url);
+                transformer.addParameter("edit", editText);
 
                 String fisUrl = response.encodeURL(
                     mapping.findForward("selectfis").getPath());
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java	Mon Apr 19 08:00:05 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/ArtifactDatabaseClient.java	Mon Apr 19 08:37:35 2010 +0000
@@ -201,6 +201,12 @@
     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.
      *
--- a/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java	Mon Apr 19 08:00:05 2010 +0000
+++ b/gnv/src/main/java/de/intevation/gnv/artifactdatabase/client/DefaultArtifactDatabaseClient.java	Mon Apr 19 08:37:35 2010 +0000
@@ -1040,6 +1040,10 @@
         this.locale = locale;
     }
 
+    public Locale getLocale() {
+        return locale;
+    }
+
 
     public Collection<ArtifactObject> getArtifactFactoryMetaInformation(
         Collection<MapService> mapServices,
--- a/gnv/src/main/resources/applicationMessages.properties	Mon Apr 19 08:00:05 2010 +0000
+++ b/gnv/src/main/resources/applicationMessages.properties	Mon Apr 19 08:37:35 2010 +0000
@@ -19,6 +19,7 @@
 gnviewer.project.load.button = Laden
 
 gnviewer.history.title=\u00dcberblick
+gnviewer.history.back.button=Bearbeiten
 
 gnviewer.fis.fis_marnet = Marnet
 gnviewer.fis.fis_imis = IMIS
--- a/gnv/src/main/resources/applicationMessages_en.properties	Mon Apr 19 08:00:05 2010 +0000
+++ b/gnv/src/main/resources/applicationMessages_en.properties	Mon Apr 19 08:37:35 2010 +0000
@@ -15,6 +15,7 @@
 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
--- a/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl	Mon Apr 19 08:00:05 2010 +0000
+++ b/gnv/src/main/webapp/WEB-INF/config/templates/describe-ui-static.xsl	Mon Apr 19 08:37:35 2010 +0000
@@ -11,7 +11,7 @@
 
     <xsl:param name="back-url"/>
     <xsl:param name="selectfis"/>
-    <xsl:param name="edit">bearbeiten</xsl:param>
+    <xsl:param name="edit"></xsl:param>
     <xsl:param name="total"><xsl:value-of select="count(*)"/></xsl:param>
 
     <!-- start parsing document -->

http://dive4elements.wald.intevation.org