Author: johnh
Date: Wed Mar 10 23:31:29 2010
New Revision: 921625

URL: http://svn.apache.org/viewvc?rev=921625&view=rev
Log:
Provide dual bindings for old and new SanitizingGadgetRewriter during 
transition time.


Modified:
    
shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/render/RenderModule.java

Modified: 
shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/render/RenderModule.java
URL: 
http://svn.apache.org/viewvc/shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/render/RenderModule.java?rev=921625&r1=921624&r2=921625&view=diff
==============================================================================
--- 
shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/render/RenderModule.java
 (original)
+++ 
shindig/trunk/java/gadgets/src/main/java/org/apache/shindig/gadgets/render/RenderModule.java
 Wed Mar 10 23:31:29 2010
@@ -20,8 +20,6 @@ package org.apache.shindig.gadgets.rende
 
 import java.util.Set;
 
-import org.apache.shindig.gadgets.render.old.SanitizingGadgetRewriter;
-
 import com.google.common.collect.ImmutableSet;
 import com.google.inject.AbstractModule;
 import com.google.inject.TypeLiteral;
@@ -36,24 +34,31 @@ public class RenderModule extends Abstra
 
     // NOTE: Sanitization only works when using the "full" Neko HTML parser. 
It is not recommended
     // that you attempt to use sanitization without it.
+    Set<String> allowedTags = ImmutableSet.of("a", "abbr", "acronym", "area", 
"b", "bdo", "big", "blockquote",
+        "body", "br", "caption", "center", "cite", "code", "col", "colgroup", 
"dd", "del",
+        "dfn", "div", "dl", "dt", "em", "font", "h1", "h2", "h3", "h4", "h5", 
"h6", "head",
+        "hr", "html", "i", "img", "ins", "legend", "li", "link", "map", "ol", 
"p", "pre",
+        "q", "s", "samp", "small", "span", "strike", "strong", "style", "sub", 
"sup", "table",
+        "tbody", "td", "tfoot", "th", "thead", "tr", "tt", "u", "ul");
     bind(setLiteral)
-        .annotatedWith(SanitizingGadgetRewriter.AllowedTags.class)
-        .toInstance(ImmutableSet.of("a", "abbr", "acronym", "area", "b", 
"bdo", "big", "blockquote",
-            "body", "br", "caption", "center", "cite", "code", "col", 
"colgroup", "dd", "del",
-            "dfn", "div", "dl", "dt", "em", "font", "h1", "h2", "h3", "h4", 
"h5", "h6", "head",
-            "hr", "html", "i", "img", "ins", "legend", "li", "link", "map", 
"ol", "p", "pre",
-            "q", "s", "samp", "small", "span", "strike", "strong", "style", 
"sub", "sup", "table",
-            "tbody", "td", "tfoot", "th", "thead", "tr", "tt", "u", "ul"));
-
+        
.annotatedWith(org.apache.shindig.gadgets.render.old.SanitizingGadgetRewriter.AllowedTags.class)
+        .toInstance(allowedTags);
     bind(setLiteral)
-        .annotatedWith(SanitizingGadgetRewriter.AllowedAttributes.class)
-        .toInstance(ImmutableSet.of("abbr", "align", "alt", "axis", "bgcolor", 
"border",
-            "cellpadding", "cellspacing", "char", "charoff", "cite", "class", 
"clear", "color",
-            "cols", "colspan", "compact", "coords", "datetime", "dir", "face", 
"headers", "height",
-            "href", "hreflang", "hspace", "id", "ismap", "lang", "longdesc", 
"name", "nohref",
-            "noshade", "nowrap", "rel", "rev", "rowspan", "rules", "scope", 
"shape", "size", "span",
-            "src", "start", "style", "summary", "title", "type", "usemap", 
"valign", "value",
-            "vspace", "width"));
+        
.annotatedWith(org.apache.shindig.gadgets.render.SanitizingGadgetRewriter.AllowedTags.class)
+        .toInstance(allowedTags);
 
+    Set<String> allowedAttributes = ImmutableSet.of("abbr", "align", "alt", 
"axis", "bgcolor", "border",
+        "cellpadding", "cellspacing", "char", "charoff", "cite", "class", 
"clear", "color",
+        "cols", "colspan", "compact", "coords", "datetime", "dir", "face", 
"headers", "height",
+        "href", "hreflang", "hspace", "id", "ismap", "lang", "longdesc", 
"name", "nohref",
+        "noshade", "nowrap", "rel", "rev", "rowspan", "rules", "scope", 
"shape", "size", "span",
+        "src", "start", "style", "summary", "title", "type", "usemap", 
"valign", "value",
+        "vspace", "width");
+    bind(setLiteral)
+        
.annotatedWith(org.apache.shindig.gadgets.render.old.SanitizingGadgetRewriter.AllowedAttributes.class)
+        .toInstance(allowedAttributes);
+    bind(setLiteral)
+        
.annotatedWith(org.apache.shindig.gadgets.render.SanitizingGadgetRewriter.AllowedAttributes.class)
+        .toInstance(allowedAttributes);
   }
 }


Reply via email to