svn commit: r550675 - in /activemq/camel/trunk/tooling: camel-book/pom.xml maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r550675 - in /activemq/camel/trunk/tooling: camel-book/pom.xml maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java

jlim-2
Author: jlim
Date: Mon Jun 25 21:10:28 2007
New Revision: 550675

URL: http://svn.apache.org/viewvc?view=rev&rev=550675
Log:
keep the extracted html for debugging https://issues.apache.org/activemq/browse/CAMEL-52

Modified:
    activemq/camel/trunk/tooling/camel-book/pom.xml
    activemq/camel/trunk/tooling/maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java

Modified: activemq/camel/trunk/tooling/camel-book/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/camel-book/pom.xml?view=diff&rev=550675&r1=550674&r2=550675
==============================================================================
--- activemq/camel/trunk/tooling/camel-book/pom.xml (original)
+++ activemq/camel/trunk/tooling/camel-book/pom.xml Mon Jun 25 21:10:28 2007
@@ -120,7 +120,7 @@
           <!--<xincludeSupport>true</xincludeSupport>-->
 
           
-          <sourceDirectory>${basedir}/target/docbkx/source</sourceDirectory>
+          <sourceDirectory>${basedir}/target/docbkx/docbkx-source</sourceDirectory>
           <!--
           
           <preProcess>

Modified: activemq/camel/trunk/tooling/maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java?view=diff&rev=550675&r1=550674&r2=550675
==============================================================================
--- activemq/camel/trunk/tooling/maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java (original)
+++ activemq/camel/trunk/tooling/maven/maven-html-to-docbook/src/main/java/org/apache/camel/maven/GenerateDocBookMojo.java Mon Jun 25 21:10:28 2007
@@ -95,9 +95,16 @@
  /**
  * Location of the output directory.
  *
- * @parameter expression="${project.build.directory}/docbkx/source"
+ * @parameter expression="${project.build.directory}/docbkx/docbkx-source"
  */
  private String outputPath;
+
+ /**
+ * Location of the output directory for wiki source.
+ *
+ * @parameter expression="${project.build.directory}/docbkx/wiki-source"
+ */
+ private String wikiOutputPath;
 
  /**
  * @parameter expression="${title}"
@@ -133,10 +140,12 @@
 
  public void execute() throws MojoExecutionException {
  File outputDir = new File(outputPath);
+ File wikiOutputDir = new File(wikiOutputPath);
  File imageDir = new File(imageLocation);
  if (!outputDir.exists()) {
  outputDir.mkdirs();
  imageDir.mkdirs();
+ wikiOutputDir.mkdirs();
  }
  this.createMainXML();
 
@@ -157,7 +166,9 @@
  public void process(String resource) {
 
  Tidy tidy = new Tidy();
- ByteArrayOutputStream out;
+ ByteArrayOutputStream out = null;
+ BufferedOutputStream output = null;
+ BufferedOutputStream wikiOutput = null;
 
  tidy.setXmlOut(true);
  try {
@@ -188,7 +199,7 @@
  DOMSource source = new DOMSource(node);
 
 
- BufferedOutputStream output = new BufferedOutputStream(
+ output = new BufferedOutputStream(
  new FileOutputStream(outputPath + File.separator
  + removeExtension(resource) + ".xml"));
  StreamResult result = new StreamResult(output);
@@ -198,6 +209,14 @@
  .newTransformer(new StreamSource(xslFile));
  transformer.transform(source, result);
 
+ // generate the wiki source for debugging
+ wikiOutput = new BufferedOutputStream(
+ new FileOutputStream(wikiOutputPath + File.separator
+ + removeExtension(resource) + ".html"));
+ result = new StreamResult(wikiOutput);
+ transformer = tFactory.newTransformer();
+        transformer.transform(source, result);
+
  break;
  }
 
@@ -205,6 +224,14 @@
 
  } catch (Exception e) {
  e.printStackTrace();
+ }finally {
+ try {
+ if(output != null)
+ output.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
  }
  }