changeset 607:3acc631efdf0

Escape project's names in the project list. flys-client/trunk@2214 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 23 Jun 2011 10:07:52 +0000
parents 69c0a6ecad57
children ee40f86dd009
files flys-client/ChangeLog flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionRecord.java
diffstat 3 files changed, 20 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/flys-client/ChangeLog	Thu Jun 23 09:29:46 2011 +0000
+++ b/flys-client/ChangeLog	Thu Jun 23 10:07:52 2011 +0000
@@ -1,3 +1,12 @@
+2011-06-23  Ingo Weinzierl <ingo@intevation.de>
+
+	* src/main/java/de/intevation/flys/client/shared/model/CollectionRecord.java:
+	  Store Html escaped strings as names.
+
+	* src/main/java/de/intevation/flys/client/client/ui/ProjectList.java:
+	  Display the project's name stored at the CollectionRecord which is Html
+	  escaped.
+
 2011-06-23  Ingo Weinzierl <ingo@intevation.de>
 
 	  flys/issue165 (Projektliste: Einige Auffälligkeiten nach Neuimplementierung)
--- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java	Thu Jun 23 09:29:46 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/ProjectList.java	Thu Jun 23 10:07:52 2011 +0000
@@ -535,7 +535,7 @@
                 CollectionRecord r = (CollectionRecord) record;
                 Collection       c = r.getCollection();
 
-                String name = c.getName();
+                String name = r.getName();
 
                 return name != null && name.length() > 0
                     ? name
--- a/flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionRecord.java	Thu Jun 23 09:29:46 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/shared/model/CollectionRecord.java	Thu Jun 23 10:07:52 2011 +0000
@@ -2,6 +2,10 @@
 
 import java.util.Date;
 
+import com.google.gwt.safehtml.shared.SafeHtml;
+import com.google.gwt.safehtml.shared.SafeHtmlBuilder;
+import com.google.gwt.safehtml.shared.SafeHtmlUtils;
+
 import com.smartgwt.client.widgets.grid.ListGridRecord;
 
 
@@ -61,7 +65,12 @@
      * @return the name of the collection.
      */
     public void setName(String name) {
-        setAttribute("name", name);
+        SafeHtmlBuilder b = new SafeHtmlBuilder();
+        b.appendEscaped(name);
+
+        SafeHtml html = b.toSafeHtml();
+
+        setAttribute("name", html.asString());
     }
 
 

http://dive4elements.wald.intevation.org