UIB: fixed the problem META tag is added when we save on source tab. 41/21641/1
authoryoungduk.hwang <youngduk.hwang@samsung.com>
Mon, 26 May 2014 02:05:54 +0000 (11:05 +0900)
committeryoungduk.hwang <youngduk.hwang@samsung.com>
Mon, 26 May 2014 02:05:54 +0000 (11:05 +0900)
Added xalan library. HtmlWriter use it.

Change-Id: I3b6bd7509f9a8cf5395c66ff4fb823f54cd15fb6
Signed-off-by: youngduk.hwang <youngduk.hwang@samsung.com>
org.tizen.webuibuilder/.classpath
org.tizen.webuibuilder/META-INF/MANIFEST.MF
org.tizen.webuibuilder/build.properties
org.tizen.webuibuilder/lib/serializer.jar [new file with mode: 0644]
org.tizen.webuibuilder/lib/xalan.jar [new file with mode: 0644]
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/html/io/HtmlWriter.java
org.tizen.webuibuilder/src/org/tizen/webuibuilder/model/page/PageDataForHTML.java

index b353d12..b25686e 100644 (file)
@@ -1,5 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
+       <classpathentry exported="true" kind="lib" path="lib/serializer.jar"/>
+       <classpathentry exported="true" kind="lib" path="lib/xalan.jar" sourcepath="C:/Users/Administrator/Downloads/xalan-j_2_7_1-src/xalan-j_2_7_1"/>
        <classpathentry exported="true" kind="lib" path="lib/js-14.jar" sourcepath="D:/__WORK/chagall/tizenpublic/develop/rhino/src"/>
        <classpathentry exported="true" kind="lib" path="lib/nekohtml-1.9.18.jar"/>
        <classpathentry exported="true" kind="lib" path="lib/json-simple-1.1.1.jar"/>
@@ -15,5 +17,7 @@
        <classpathentry kind="lib" path="lib/flute-1.2.8-sources.jar"/>
        <classpathentry kind="lib" path="lib/phloc-css-3.5.5.jar" sourcepath="lib/phloc-css-3.5.5-sources.jar"/>
        <classpathentry kind="lib" path="lib/phloc-commons-4.0.8.jar"/>
+       <classpathentry kind="lib" path="D:/git/public/web-ui-builder-eplugin/org.tizen.webuibuilder/lib/serializer.jar"/>
+       <classpathentry kind="lib" path="D:/git/public/web-ui-builder-eplugin/org.tizen.webuibuilder/lib/xalan.jar"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>
index 3c7bfd1..97a3620 100644 (file)
@@ -56,4 +56,6 @@ Bundle-ClassPath: .,
  lib/phloc-commons-4.0.8.jar,
  lib/nekohtml-1.9.18.jar,
  lib/json-simple-1.1.1.jar,
- lib/js-14.jar
+ lib/js-14.jar,
+ lib/xalan.jar,
+ lib/serializer.jar
index ae5a972..4ac4d94 100644 (file)
@@ -8,5 +8,7 @@ bin.includes = .,\
                about.properties,\
                plugin.properties,\
                plugin.xml,\
-               lib/
+               lib/,\
+               lib/xalan.jar,\
+               lib/serializer.jar
 bin.excludes = res/descriptors/
diff --git a/org.tizen.webuibuilder/lib/serializer.jar b/org.tizen.webuibuilder/lib/serializer.jar
new file mode 100644 (file)
index 0000000..99f98db
Binary files /dev/null and b/org.tizen.webuibuilder/lib/serializer.jar differ
diff --git a/org.tizen.webuibuilder/lib/xalan.jar b/org.tizen.webuibuilder/lib/xalan.jar
new file mode 100644 (file)
index 0000000..458fa73
Binary files /dev/null and b/org.tizen.webuibuilder/lib/xalan.jar differ
index 561a33c..331c932 100644 (file)
@@ -66,8 +66,8 @@ public class HtmlWriter {
      *            a writer
      */
     public static void writeTo(Element element, Writer writer) {
-        TransformerFactory transformerFactory = TransformerFactory.newInstance();
-        transformerFactory.setAttribute("indent-number", new Integer(4)); //$NON-NLS-1$
+        TransformerFactory transformerFactory = TransformerFactory.newInstance("org.apache.xalan.processor.TransformerFactoryImpl", null);
+//        transformerFactory.setAttribute("indent-number", new Integer(4)); //$NON-NLS-1$
         try {
             // String xslt =
             // "<xsl:stylesheet version='1.0'\n"
@@ -78,9 +78,18 @@ public class HtmlWriter {
             // Transformer transformer = transformerFactory.newTransformer(new
             // StreamSource(new StringBufferInputStream(xslt)));
             Transformer transformer = transformerFactory.newTransformer();
+            transformer.setOutputProperty(OutputKeys.VERSION, "4.0");
+            
+            transformer.setOutputProperty(OutputKeys.MEDIA_TYPE, "text/html");
+            transformer.setOutputProperty("{http://xml.apache.org/xalan}content-handler", "org.apache.xml.serializer.ToHTMLStream");
+            transformer.setOutputProperty("{http://xml.apache.org/xalan}entities", "org/apache/xml/serializer/HTMLEntities");
+            transformer.setOutputProperty("{http://xml.apache.org/xalan}use-url-escaping", BuilderConstants.YES);
+            transformer.setOutputProperty("{http://xml.apache.org/xalan}omit-meta-tag", BuilderConstants.YES);
+            transformer.setOutputProperty("{http://xml.apache.org/xalan}indext-amount", "0");
+            
             transformer.setOutputProperty(OutputKeys.METHOD, BuilderConstants.HTML);
             transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, BuilderConstants.YES);
-            transformer.setOutputProperty(OutputKeys.INDENT, BuilderConstants.YES);
+            transformer.setOutputProperty(OutputKeys.INDENT, BuilderConstants.NO);
             DOMSource source = new DOMSource(element);
             StreamResult result = new StreamResult(writer);
             transformer.transform(source, result);
index 611f65b..1b71470 100644 (file)
@@ -181,7 +181,7 @@ public class PageDataForHTML extends PageData {
                     transformerFactory.newTransformer(new DOMSource(getDescriptorManager()
                             .getXsltDocument()));
             transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, BuilderConstants.YES);
-            transformer.setOutputProperty(OutputKeys.INDENT, BuilderConstants.NO);
+            transformer.setOutputProperty(OutputKeys.INDENT, BuilderConstants.YES);
             transformer.setOutputProperty(OutputKeys.ENCODING, BuilderConstants.ENCODING);
             transformer.setOutputProperty(OutputKeys.METHOD, BuilderConstants.HTML);
         } catch (TransformerConfigurationException e) {