myfaces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lof...@apache.org
Subject svn commit: r1455954 - /myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java
Date Wed, 13 Mar 2013 14:28:25 GMT
Author: lofwyr
Date: Wed Mar 13 14:28:25 2013
New Revision: 1455954

URL: http://svn.apache.org/r1455954
Log:
TOBAGO-1229: Using Facelets 2.0 from JSF 2.0 instead of Facelets 1.1 from Sun
- not writing the tags "description" and "display-name" in the root tag, because of SAXParser
exception (see MYFACES-3537)

Modified:
    myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java

Modified: myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java
URL: http://svn.apache.org/viewvc/myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java?rev=1455954&r1=1455953&r2=1455954&view=diff
==============================================================================
--- myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java
(original)
+++ myfaces/tobago/trunk/tobago-tool/tobago-tool-apt/src/main/java/org/apache/myfaces/tobago/apt/processor/TaglibGenerator.java
Wed Mar 13 14:28:25 2013
@@ -27,14 +27,15 @@ import org.apache.myfaces.tobago.apt.ann
 import org.apache.myfaces.tobago.apt.annotation.ExtensionTag;
 import org.apache.myfaces.tobago.apt.annotation.Facet;
 import org.apache.myfaces.tobago.apt.annotation.Preliminary;
+import org.apache.myfaces.tobago.apt.annotation.SimpleTag;
 import org.apache.myfaces.tobago.apt.annotation.Tag;
 import org.apache.myfaces.tobago.apt.annotation.TagAttribute;
-import org.apache.myfaces.tobago.apt.annotation.SimpleTag;
 import org.apache.myfaces.tobago.apt.annotation.Taglib;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTag;
 import org.apache.myfaces.tobago.apt.annotation.UIComponentTagAttribute;
 import org.apache.myfaces.tobago.apt.annotation.ValidatorTag;
 import org.apache.myfaces.tobago.apt.generate.ClassUtils;
+import org.w3c.dom.Comment;
 import org.w3c.dom.Document;
 import org.w3c.dom.Element;
 
@@ -118,10 +119,20 @@ public class TaglibGenerator extends Abs
 
     Element taglib = type.createTaglib(document);
     String description = processingEnv.getElementUtils().getDocComment(packageElement);
+
+    addComment("The next tags are commented because of MYFACES-3537. "
+        + "The application will not run with MyFaces before 2.0.14/2.1.8. "
+        + "This also affects WebSphere 8.5", taglib, document);
+    addComment("<description>" + description + "</description>", taglib, document);
+    addComment("<display-name>" + taglibAnnotation.displayName() + "</display-name>",
taglib, document);
+
+/* XXX disabled, because of the bug explained in the comment above.
     if (description != null) {
       addLeafCDATAElement(description, "description", taglib, document);
     }
     addLeafTextElement(taglibAnnotation.displayName(), "display-name", taglib, document);
+*/
+
     type.addMisc(taglib, document, taglibAnnotation);
 
     type.addListeners(taglib, document, taglibAnnotation);
@@ -406,6 +417,11 @@ public class TaglibGenerator extends Abs
     }
   }
 
+  protected static void addComment(String text, org.w3c.dom.Element parent, Document document)
{
+    Comment comment = document.createComment(text);
+    parent.appendChild(comment);
+  }
+
   protected static void addLeafTextElement(String text, String node, org.w3c.dom.Element
parent, Document document) {
     org.w3c.dom.Element element = document.createElement(node);
     element.appendChild(document.createTextNode(text));



Mime
View raw message