axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r375986 - in /webservices/axis2/trunk/java/modules: codegen/src/org/apache/axis2/util/XSLTTemplateProcessor.java codegen/src/org/apache/axis2/wsdl/codegen/writer/AntBuildWriter.java samples/maven.xml
Date Wed, 08 Feb 2006 15:59:39 GMT
Author: dims
Date: Wed Feb  8 07:59:35 2006
New Revision: 375986

URL: http://svn.apache.org/viewcvs?rev=375986&view=rev
Log:
fix 'maven war -Dmaven.test.skip=true' to work even after a clean

Modified:
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/XSLTTemplateProcessor.java
    webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/AntBuildWriter.java
    webservices/axis2/trunk/java/modules/samples/maven.xml

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/XSLTTemplateProcessor.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/XSLTTemplateProcessor.java?rev=375986&r1=375985&r2=375986&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/XSLTTemplateProcessor.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/util/XSLTTemplateProcessor.java
Wed Feb  8 07:59:35 2006
@@ -112,14 +112,43 @@
                              InputStream xsltStream,
                              URIResolver customResolver)
             throws TransformerFactoryConfigurationError, TransformerException {
+        parse(out, document, xsltStream, customResolver, false);
+    }
+
+    /**
+     * @param out
+     * @param document
+     * @param xsltStream
+     * @throws TransformerFactoryConfigurationError
+     *
+     * @throws TransformerException
+     */
+    public static void parse(OutputStream out,
+                             Document document,
+                             InputStream xsltStream,
+                             URIResolver customResolver,
+                             boolean pretty)
+            throws TransformerFactoryConfigurationError, TransformerException {
         Source xsltSource = new StreamSource(xsltStream);
         TransformerFactory transformerFactory = TransformerFactory.newInstance();
+        if(pretty) {
+            try {
+                transformerFactory.setAttribute("indent-number", new Integer(2));
+            } catch (Exception e) {
+            }
+        }
         if (customResolver!=null){
              transformerFactory.setURIResolver(customResolver);
         }
        
         Transformer transformer = transformerFactory
                 .newTransformer(xsltSource);
+        if(pretty) {
+            try {
+                transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount",
"2");
+            } catch (Exception e) {
+            }
+        }
 
         parse(out, document, transformer);
 

Modified: webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/AntBuildWriter.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/AntBuildWriter.java?rev=375986&r1=375985&r2=375986&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/AntBuildWriter.java
(original)
+++ webservices/axis2/trunk/java/modules/codegen/src/org/apache/axis2/wsdl/codegen/writer/AntBuildWriter.java
Wed Feb  8 07:59:35 2006
@@ -1,8 +1,11 @@
 package org.apache.axis2.wsdl.codegen.writer;
 
 import org.apache.axis2.util.FileWriter;
+import org.apache.axis2.util.XSLTTemplateProcessor;
 import org.apache.axis2.wsdl.util.ConfigPropertyFileLoader;
+import org.w3c.dom.Document;
 
+import javax.xml.transform.URIResolver;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.util.Iterator;
@@ -78,5 +81,22 @@
         }
 
         return templateName;
+    }
+
+    /**
+     * Writes the output file.
+     *
+     * @param doc
+     * @throws Exception
+     */
+    public void parse(Document doc, URIResolver resolver) throws Exception {
+        if (!fileExists) {
+            XSLTTemplateProcessor.parse(this.stream,
+                    doc,
+                    this.xsltStream,
+                    resolver);
+            this.stream.flush();
+            this.stream.close();
+        }
     }
 }

Modified: webservices/axis2/trunk/java/modules/samples/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/samples/maven.xml?rev=375986&r1=375985&r2=375986&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/samples/maven.xml (original)
+++ webservices/axis2/trunk/java/modules/samples/maven.xml Wed Feb  8 07:59:35 2006
@@ -11,9 +11,9 @@
     <j:set var="samples.dir" value="target/samples"/>
 
     <postGoal name="test:test">
-      <j:if test="${context.getVariable('maven.test.skip') != 'true'}">
+      <!-- <j:if test="${context.getVariable('maven.test.skip') != 'true'}"> -->
         <attainGoal name="create-samples"/>
-      </j:if>
+      <!-- </j:if> -->
     </postGoal>
     
     <goal name="mail-tests">



Mime
View raw message