camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cmuel...@apache.org
Subject git commit: merged commit 247ced1dcb787db2faf325e253f9af8907581881 - Change to just generate an HTML manual
Date Sun, 30 Jun 2013 21:48:42 GMT
Updated Branches:
  refs/heads/camel-2.11.x cc54c81f2 -> f2f1d1d36


merged commit 247ced1dcb787db2faf325e253f9af8907581881 - Change to just generate an HTML manual


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/f2f1d1d3
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/f2f1d1d3
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/f2f1d1d3

Branch: refs/heads/camel-2.11.x
Commit: f2f1d1d361db314f0b1349b85daf7df519bb6298
Parents: cc54c81
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Jun 28 14:29:00 2013 -0400
Committer: cmueller <cmueller@apache.org>
Committed: Sun Jun 30 23:47:06 2013 +0200

----------------------------------------------------------------------
 apache-camel/src/main/descriptors/unix-bin.xml  |   1 -
 .../src/main/descriptors/windows-bin.xml        |   1 -
 tooling/camel-manual/pom.xml                    |  90 +++--
 .../apache/camel/manual/ManualGenerator.java    | 190 +++++++++++
 tooling/maven/maven-html-to-pdf/pom.xml         |  56 ---
 .../org/apache/camel/maven/HtmlToPdfMojo.java   | 342 -------------------
 .../src/main/resources/META-INF/LICENSE.txt     | 203 -----------
 .../src/main/resources/META-INF/NOTICE.txt      |  12 -
 tooling/maven/pom.xml                           |   1 -
 9 files changed, 244 insertions(+), 652 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/f2f1d1d3/apache-camel/src/main/descriptors/unix-bin.xml
----------------------------------------------------------------------
diff --git a/apache-camel/src/main/descriptors/unix-bin.xml b/apache-camel/src/main/descriptors/unix-bin.xml
index 9972b11..ce0850e 100644
--- a/apache-camel/src/main/descriptors/unix-bin.xml
+++ b/apache-camel/src/main/descriptors/unix-bin.xml
@@ -60,7 +60,6 @@
       <directory>${basedir}/../tooling/camel-manual/target/site/manual/</directory>
       <outputDirectory>/doc/manual</outputDirectory>
       <includes>
-        <include>*.pdf</include>
         <include>*.html</include>
       </includes>
     </fileSet>

http://git-wip-us.apache.org/repos/asf/camel/blob/f2f1d1d3/apache-camel/src/main/descriptors/windows-bin.xml
----------------------------------------------------------------------
diff --git a/apache-camel/src/main/descriptors/windows-bin.xml b/apache-camel/src/main/descriptors/windows-bin.xml
index 2517c7d..d088456 100644
--- a/apache-camel/src/main/descriptors/windows-bin.xml
+++ b/apache-camel/src/main/descriptors/windows-bin.xml
@@ -60,7 +60,6 @@
       <directory>${basedir}/../tooling/camel-manual/target/site/manual/</directory>
       <outputDirectory>/doc/manual</outputDirectory>
       <includes>
-        <include>*.pdf</include>
         <include>*.html</include>
       </includes>
     </fileSet>

http://git-wip-us.apache.org/repos/asf/camel/blob/f2f1d1d3/tooling/camel-manual/pom.xml
----------------------------------------------------------------------
diff --git a/tooling/camel-manual/pom.xml b/tooling/camel-manual/pom.xml
index 84066eb..1f38502 100644
--- a/tooling/camel-manual/pom.xml
+++ b/tooling/camel-manual/pom.xml
@@ -27,46 +27,65 @@
   </parent>
 
   <artifactId>camel-manual</artifactId>
-  <packaging>pom</packaging>
+  <packaging>jar</packaging>
   <name>Camel :: Manual</name>
   <description>The Camel Manual which generates a HTML and PDF representation of the
manual.</description>
 
+  <dependencies>
+      <dependency>
+          <groupId>org.ccil.cowan.tagsoup</groupId>
+          <artifactId>tagsoup</artifactId>
+      </dependency>
+  </dependencies>
+
   <build>
     <plugins>
-     <plugin>
-        <groupId>org.apache.camel</groupId>
-        <artifactId>maven-html-to-pdf</artifactId>
-        <version>${project.version}</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>compile</goal>
-            </goals>
-            <phase>compile</phase>
-          </execution>
-        </executions>    
-        <configuration>
-          <page>http://camel.apache.org/book-in-one-page.html</page>
-          <contentDivClass>wiki-content maincontent</contentDivClass>
-          <head><![CDATA[ 
-              <link href="file:${basedir}/src/styles/print.css" rel="stylesheet" type="text/css"
/>
-              <style type="text/css">
-                @page :left {
-                  @top-left {
-                    content: "Apache Camel ${project.version} Developer's Manual";
-                  }
-                }
-              </style>
-          ]]></head>
-          <replaceToken><![CDATA[
-              <h3 id="replaceme">.*</h3>
-          ]]></replaceToken>
-          <replaceValue><![CDATA[
-              <h3>Version ${project.version}</h3>
-          ]]></replaceValue>
-          <transformerFactoryClassName>org.apache.xalan.xsltc.trax.TransformerFactoryImpl</transformerFactoryClassName>
-        </configuration>
-      </plugin>
+        <plugin>
+            <groupId>org.codehaus.mojo</groupId>
+            <artifactId>exec-maven-plugin</artifactId>
+            <version>1.2.1</version>
+            <executions>
+                <execution>
+                    <id>generate-manual</id>
+                    <phase>process-classes</phase>
+                    <goals>
+                        <goal>java</goal>
+                    </goals>
+                    <configuration>
+                        <mainClass>org.apache.camel.manual.ManualGenerator</mainClass>
+                        <arguments>
+                            <argument>http://camel.apache.org/book-in-one-page.html</argument>
+                            <argument>${project.build.directory}/site/manual/camel-manual-${project.version}.html</argument>
+                            <argument>${project.version}</argument>
+                            <argument><![CDATA[
+                                <link href="http://camel.apache.org/styles/camel-manual.css"
rel="stylesheet" type="text/css" />
+                                <style type="text/css">
+                                @page :left {
+                                @top-left {
+                                content: "Apache Camel ${project.version} Developer's Manual";
+                                }
+                                }
+                                </style>
+                                
+                                <link href='http://camel.apache.org/styles/highlighter/styles/shCoreCamel.css'
rel='stylesheet' type='text/css' />
+                                <link href='http://camel.apache.org/styles/highlighter/styles/shThemeCamel.css'
rel='stylesheet' type='text/css' />
+                                <script src='http://camel.apache.org/styles/highlighter/scripts/shCore.js'
type='text/javascript'></script>
+                                <script src='http://camel.apache.org/styles/highlighter/scripts/shBrushSql.js'
type='text/javascript'></script>
+                                <script src='http://camel.apache.org/styles/highlighter/scripts/shBrushJava.js'
type='text/javascript'></script>
+                                <script src='http://camel.apache.org/styles/highlighter/scripts/shBrushXml.js'
type='text/javascript'></script>
+                                <script src='http://camel.apache.org/styles/highlighter/scripts/shBrushPlain.js'
type='text/javascript'></script>
+                                
+                                <script type="text/javascript">
+                                SyntaxHighlighter.defaults['toolbar'] = false;
+                                SyntaxHighlighter.all();
+                                </script>
+                            ]]></argument>
+                            <argument>${project.build.directory}</argument>
+                        </arguments>
+                    </configuration>
+                </execution>
+            </executions>
+        </plugin>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>build-helper-maven-plugin</artifactId>
@@ -79,7 +98,6 @@
             </goals>
             <configuration>
               <artifacts>
-                <!-- Don't need to attach PDF here because the html-to-pdf plugin did
that already -->
                 <artifact>
                   <file>${project.build.directory}/site/manual/camel-manual-${project.version}.html</file>
                   <type>html</type>

http://git-wip-us.apache.org/repos/asf/camel/blob/f2f1d1d3/tooling/camel-manual/src/main/java/org/apache/camel/manual/ManualGenerator.java
----------------------------------------------------------------------
diff --git a/tooling/camel-manual/src/main/java/org/apache/camel/manual/ManualGenerator.java
b/tooling/camel-manual/src/main/java/org/apache/camel/manual/ManualGenerator.java
new file mode 100644
index 0000000..0cc3083
--- /dev/null
+++ b/tooling/camel-manual/src/main/java/org/apache/camel/manual/ManualGenerator.java
@@ -0,0 +1,190 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.manual;
+
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.xml.sax.Attributes;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.XMLReader;
+
+import org.ccil.cowan.tagsoup.Parser;
+import org.ccil.cowan.tagsoup.XMLWriter;
+
+public class ManualGenerator {
+
+    String page;
+    String output;
+    String head;
+    String version;
+    String targetDir;
+    
+    public ManualGenerator(String[] args) {
+        page = args[0];
+        output = args[1];
+        version = args[2];
+        head = args[3];
+        targetDir = args[4];
+    }
+    
+    public void run() {
+        try {
+            if (doGenerate()) {
+                String content = grabBodyContent();
+                storeHTMLFile(content);
+            }
+        } catch (MalformedURLException e) {
+            throw new RuntimeException(e);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+    }
+    
+    private void storeHTMLFile(String content) throws IOException {
+        String replaceToken = "<h3 id=\"replaceme\">.*</h3>";
+        String replaceValue = "<h3>Version " + version + "</h3>";
+        
+        File outFile = new File(output);
+        outFile.getParentFile().mkdirs();
+        PrintWriter out = new PrintWriter(new BufferedOutputStream(new FileOutputStream(outFile)));
+        out.println("<html>");
+        out.println("<head>");
+        if (head != null) {
+            out.println(head);
+        }
+        out.println("</head>");
+        
+        if (replaceToken != null && replaceValue != null) {
+            content = content.replaceAll(replaceToken, replaceValue);
+        }
+        
+        out.print("<body>");
+        out.print(content);
+        out.println("</body>");
+        out.close();
+    }
+    private boolean doGenerate() throws MalformedURLException, IOException {
+        URL url = new URL(page);
+        File file = new File(targetDir, ".manualCache-" + url.getFile().substring(1));
+        if (file.exists()) {
+            HttpURLConnection con = (HttpURLConnection)url.openConnection();
+            con.setRequestMethod("HEAD");
+            long date = con.getLastModified();
+            
+            FileReader reader = new FileReader(file);
+            char chars[] = new char[1000];
+            int i = reader.read(chars);
+            reader.close();
+
+            long lastDate = Long.parseLong(new String(chars, 0, i).trim());
+            if (date <= lastDate) {
+                return false;
+            }
+        }
+        return true;
+    }
+    private String grabBodyContent() throws MalformedURLException, IOException {
+        URL url = new URL(page);
+        File file = new File(targetDir, ".manualCache-" + url.getFile().substring(1));
+        
+        try {
+            HttpURLConnection con = (HttpURLConnection)url.openConnection();
+            XMLReader parser = new Parser();
+            parser.setFeature(Parser.namespacesFeature, false);
+            parser.setFeature(Parser.namespacePrefixesFeature, false);
+            parser.setProperty(Parser.schemaProperty, new org.ccil.cowan.tagsoup.HTMLSchema()
{
+                {
+                    //problem with nested lists that the confluence {toc} macro creates
+                    elementType("ul", M_LI, M_BLOCK | M_LI, 0);
+                }
+            });
+            
+            StringWriter w = new StringWriter();
+            XMLWriter xmlWriter = new XMLWriter(w) {
+                int inDiv = Integer.MAX_VALUE;
+                int count;
+                public void characters(char ch[], int start, int len)
+                    throws SAXException {
+                    if (inDiv <= count) {
+                        super.characters(ch, start, len);
+                    }
+                }
+                public void startElement(String uri, String localName, String qName, Attributes
atts)
+                    throws SAXException {
+                    count++;
+                    if ("div".equalsIgnoreCase(qName)
+                        && "wiki-content maincontent".equalsIgnoreCase(atts.getValue("class")))
{
+                        inDiv = count;
+                    }
+                    if (inDiv <= count) {
+                        super.startElement(uri, localName, qName, atts);
+                    }
+                }
+                public void endElement(String uri, String localName, String qName) throws
SAXException {
+                    if (inDiv <= count) {
+                        super.endElement(uri, localName, qName);
+                    }
+                    count--;
+                    if (inDiv > count) {
+                        inDiv = Integer.MAX_VALUE;
+                    }
+                }
+            };
+            xmlWriter.setOutputProperty(XMLWriter.OMIT_XML_DECLARATION, "yes");
+            xmlWriter.setOutputProperty(XMLWriter.METHOD, "html");
+            parser.setContentHandler(xmlWriter);
+            long date = con.getLastModified();
+            parser.parse(new InputSource(new BufferedInputStream(con.getInputStream())));
+
+            
+            FileWriter writer = new FileWriter(file);
+            writer.write(Long.toString(date));
+            writer.close();
+            return w.toString();
+        } catch (Throwable e) {
+            e.printStackTrace();
+            throw new RuntimeException("Failed", e);
+        }
+    }
+    
+
+    /**
+     * @param args
+     */
+    public static void main(String[] args) {
+        /*args = new String[] {
+            "http://camel.apache.org/book-in-one-page.html",
+            "/tmp/foo.html",
+            "1.0",
+            ""
+        };*/
+        new ManualGenerator(args).run();
+    }
+
+}

http://git-wip-us.apache.org/repos/asf/camel/blob/f2f1d1d3/tooling/maven/maven-html-to-pdf/pom.xml
----------------------------------------------------------------------
diff --git a/tooling/maven/maven-html-to-pdf/pom.xml b/tooling/maven/maven-html-to-pdf/pom.xml
deleted file mode 100644
index 5e03d07..0000000
--- a/tooling/maven/maven-html-to-pdf/pom.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-   
-    http://www.apache.org/licenses/LICENSE-2.0
-   
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>org.apache.camel</groupId>
-    <artifactId>maven-plugins</artifactId>
-    <version>2.11.1-SNAPSHOT</version>
-  </parent>
-
-  <artifactId>maven-html-to-pdf</artifactId>
-  <packaging>maven-plugin</packaging>
-  <name>Camel :: Maven Plugins :: Camel Manual</name>
-  <description>Maven plugin to generate the Camel manual by converting html to pdf
document</description>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.camel</groupId>
-      <artifactId>camel-tagsoup</artifactId>
-    </dependency>    
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-utils</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.slf4j</groupId>
-      <artifactId>slf4j-log4j12</artifactId>
-    </dependency>
-	<dependency>
-      <groupId>xalan</groupId>
-      <artifactId>xalan</artifactId>
-      <exclusions>
-        <exclusion>
-          <groupId>xml-apis</groupId>
-          <artifactId>xml-apis</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-  </dependencies>
-</project>

http://git-wip-us.apache.org/repos/asf/camel/blob/f2f1d1d3/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java
----------------------------------------------------------------------
diff --git a/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java
b/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java
deleted file mode 100644
index a95989c..0000000
--- a/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.maven;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.PrintWriter;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathFactory;
-
-import org.w3c.dom.Node;
-
-import org.apache.camel.converter.jaxp.XmlConverter;
-import org.apache.camel.dataformat.tagsoup.TidyMarkupDataFormat;
-import org.apache.camel.util.IOHelper;
-
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectHelper;
-
-import org.codehaus.plexus.util.cli.CommandLineException;
-import org.codehaus.plexus.util.cli.CommandLineUtils;
-import org.codehaus.plexus.util.cli.Commandline;
-import org.codehaus.plexus.util.cli.Commandline.Argument;
-import org.codehaus.plexus.util.cli.StreamConsumer;
-
-/**
- * Goal which extracts the content div from the html page and converts to PDF
- * using Prince
- *
- * @goal compile
- * @phase compile
- */
-public class HtmlToPdfMojo extends AbstractMojo {
-
-    private static final String XSLT_SYSTEM_PROPERTY_KEY = "javax.xml.transform.TransformerFactory";
-
-    /**
-     * The URL to the confluence page to convert.
-     *
-     * @parameter property="page"
-     * @required
-     */
-    private String page;
-
-    /**
-     * The output file name for the pdf.
-     *
-     * @parameter property="pdf"
-     *            default-value="${project.build.directory}/site/manual/${project.artifactId}-${project.version}.pdf"
-     */
-    private String pdf;
-
-    /**
-     * The css style sheets that should be linked.
-     *
-     * @parameter
-     */
-    private String[] styleSheets;
-
-    /**
-     * Content that should be added in the head element of the html file.
-     *
-     * @parameter
-     */
-    private String head;
-
-    /**
-     * Regex to search for in the html file. This will be replaced with the value of the

-     * replaceValue parameter.
-     *
-     * @parameter
-     */
-    private String replaceToken;    
-
-    /**
-     * String that the replaceToken will be replaced with.
-     *
-     * @parameter
-     */
-    private String replaceValue;        
-    
-    /**
-     * The first div with who's class matches the contentDivClass will be
-     * assumed to be the content section of the HTML and is what will be used as
-     * the content in the PDF.
-     *
-     * @parameter default-value="wiki-content"
-     */
-    private String contentDivClass = "wiki-content";
-
-    /**
-     * Arguments that should be passed to the prince html to pdf processor.
-     *
-     * @parameter
-     */
-    private String[] princeArgs;
-
-    /**
-     * If there is an error converting the HTML to PDF should the build fail?
-     * default to false since this requires the prince tool to be installed and
-     * on the PATH of the system.
-     *
-     * @parameter default-value="false"
-     */
-    private boolean errorOnConverionFailure;
-
-    /**
-     * If there is an error downloading the HTML should the build fail? default
-     * to false since this usually requires the user to be online.
-     *
-     * @parameter default-value="false"
-     */
-    private boolean errorOnDownloadFailure;
-
-    /**
-     * The maven project.
-     *
-     * @parameter property="project"
-     * @required
-     * @readonly
-     */
-    private MavenProject project;
-
-    /**
-     * @component
-     */
-    private MavenProjectHelper projectHelper;
-
-    /**
-     * The type used when attaching the artifact to the deployment.
-     *
-     * @parameter default-value="pdf"
-     */
-    private String type;
-
-    /**
-     * Classifier to add to the artifact generated.
-     *
-     * @parameter
-     */
-    private String classifier;
-
-    /**
-     * The XSL transformer factory class name to be used which will be set through the <code>javax.xml.transform.TransformerFactory</code>
system property.
-     *
-     * @parameter
-     */
-    private String transformerFactoryClassName;
-
-
-    public void execute() throws MojoExecutionException {
-        File outputDir = new File(pdf).getParentFile();
-        if (!outputDir.exists()) {
-            outputDir.mkdirs();
-        }
-        try {
-            // Download
-            String content = downloadContent();
-            if (content == null) {
-                // create dummy file so the build can continue
-                storeDummyFile();
-                return;
-            }
-
-            // Store
-            storeHTMLFile(content);
-
-            // Run Prince
-            if (convert() == 0) {
-                File pdfFile = new File(getPDFFileName());
-                projectHelper.attachArtifact(project, type, classifier, pdfFile);
-            }
-
-        } catch (MojoExecutionException e) {
-            throw e;
-        } catch (Exception e) {
-            throw new MojoExecutionException("Download of '" + page + "' failed: " + e.getMessage(),
e);
-        }
-    }
-
-    private int convert() throws CommandLineException, MojoExecutionException {
-        getLog().info("Converting to PDF with prince...");
-        Commandline cl = new Commandline("prince");
-        Argument arg;
-
-        if (princeArgs != null) {
-            for (String princeArg : princeArgs) {
-                arg = new Argument();
-                arg.setValue(princeArg);
-                cl.addArg(arg);
-            }
-        }
-
-        arg = new Argument();
-        arg.setValue(getHTMLFileName());
-        cl.addArg(arg);
-        arg = new Argument();
-        arg.setValue(getPDFFileName());
-        cl.addArg(arg);
-
-        StreamConsumer out = new StreamConsumer() {
-            public void consumeLine(String line) {
-                getLog().info("[prince] " + line);
-            }
-        };
-
-        getLog().info("About to execute PrinceXml (see www.princexml.com)");
-        String[] lines = cl.getCommandline();
-        StringBuilder buffer = new StringBuilder();
-        for (String line : lines) {
-            buffer.append(" ");
-            buffer.append(line);
-        }
-        getLog().info(buffer);
-
-        int rc = CommandLineUtils.executeCommandLine(cl, out, out);
-        if (rc == 0) {
-            getLog().info("Stored: " + getPDFFileName());
-        } else {
-            if (errorOnConverionFailure) {
-                throw new MojoExecutionException("PDF Conversion failed rc=" + rc);
-            } else {
-                getLog().error("PDF Conversion failed due to return code: " + rc);
-            }
-        }
-        return rc;
-    }
-
-    private String getPDFFileName() {
-        return pdf;
-    }
-
-    private void storeDummyFile() throws FileNotFoundException {
-        PrintWriter out = new PrintWriter(IOHelper.buffered(new FileOutputStream(getHTMLFileName())));
-        out.println("<html>");
-        out.println("<body>Generation of the offline PDF version of the manual failed,
however you could try "
-                    + "<a href=\"http://camel.apache.org/book-in-one-page.html\">the
online HTML version</a>.</body>");
-        out.println("</html>");
-        out.close();
-        getLog().info("Stored dummy file: " + getHTMLFileName() + " since download of " +
page + " failed.");
-    }
-
-    private void storeHTMLFile(String content) throws FileNotFoundException {
-        PrintWriter out = new PrintWriter(IOHelper.buffered(new FileOutputStream(getHTMLFileName())));
-        out.println("<html>");
-        out.println("<head>");
-        out.println("   <base href=\"" + page + "\"/>");
-        if (head != null) {
-            out.println(head);
-        }
-        if (styleSheets != null) {
-            for (String styleSheet : styleSheets) {
-                out.println("   <link href=\"" + styleSheet + "\" rel=\"stylesheet\" type=\"text/css\"/>");
-            }
-        }
-        out.println("</head>");
-        
-        if (replaceToken != null && replaceValue != null) {
-            content = content.replaceAll(replaceToken, replaceValue);
-        }
-        
-        out.println("<body>" + content + "</body>");
-        out.close();
-        getLog().info("Stored: " + getHTMLFileName());
-    }
-
-    private String getHTMLFileName() {
-        String name = getPDFFileName();
-        if (name.endsWith(".pdf")) {
-            name = name.substring(0, name.length() - 4);
-        }
-        return name + ".html";
-    }
-
-    private String downloadContent() throws MalformedURLException, MojoExecutionException
{
-        // avoid the usage of default xslt by jdk as that could cause problems
-        String previousTransformerFactoryClassName = null;
-        if (transformerFactoryClassName != null) {
-            previousTransformerFactoryClassName = System.setProperty(XSLT_SYSTEM_PROPERTY_KEY,
transformerFactoryClassName);
-            getLog().info("Set the XSLT factory class name to be '" + transformerFactoryClassName
+ "'");
-        }
-
-        String contentTag = "<div class=\"" + contentDivClass + "\"";
-
-        getLog().info("Downloading: " + page);
-        URL url = new URL(page);        
-        
-        try {
-            TidyMarkupDataFormat dataFormat = new TidyMarkupDataFormat();
-            dataFormat.setMethod("html");
-            Node doc = dataFormat.asNodeTidyMarkup(IOHelper.buffered(url.openStream()));
-            XPath xpath = XPathFactory.newInstance().newXPath();
-            Node nd = (Node)xpath.evaluate("//div[@class='" + contentDivClass + "']", doc,
XPathConstants.NODE);
-            if (nd != null) {
-                return  new XmlConverter().toString(nd, null);
-            }
-        } catch (Throwable e) {
-            if (errorOnDownloadFailure) {
-                throw new MojoExecutionException("Download or validation of '" + page + "'
failed: " + e);
-            } else {
-                getLog().error("Download or validation of '" + page + "' failed: " + e);
-                return null;
-            }
-        } finally {
-            // avoid any side effects by other camel modules (for example while running the
tests) and reset the system property 
-            if (transformerFactoryClassName != null) {
-                if (previousTransformerFactoryClassName == null) {
-                    // remove the set system property
-                    System.getProperties().remove(XSLT_SYSTEM_PROPERTY_KEY);
-                    getLog().info("Removed the set XSLT factory class name '" + transformerFactoryClassName
+ "' from the system properties");
-                } else {
-                    // reset the previous system property value to whatever it was before
-                    System.setProperty(XSLT_SYSTEM_PROPERTY_KEY, previousTransformerFactoryClassName);
-                    getLog().info("Resetted the XSLT factory class name to be '" + previousTransformerFactoryClassName
+ "'");
-                }
-            }
-        }
-        throw new MojoExecutionException("The '" + page + "' page did not have a " + contentTag
+ " element.");
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/camel/blob/f2f1d1d3/tooling/maven/maven-html-to-pdf/src/main/resources/META-INF/LICENSE.txt
----------------------------------------------------------------------
diff --git a/tooling/maven/maven-html-to-pdf/src/main/resources/META-INF/LICENSE.txt b/tooling/maven/maven-html-to-pdf/src/main/resources/META-INF/LICENSE.txt
deleted file mode 100755
index 6b0b127..0000000
--- a/tooling/maven/maven-html-to-pdf/src/main/resources/META-INF/LICENSE.txt
+++ /dev/null
@@ -1,203 +0,0 @@
-
-                                 Apache License
-                           Version 2.0, January 2004
-                        http://www.apache.org/licenses/
-
-   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
-   1. Definitions.
-
-      "License" shall mean the terms and conditions for use, reproduction,
-      and distribution as defined by Sections 1 through 9 of this document.
-
-      "Licensor" shall mean the copyright owner or entity authorized by
-      the copyright owner that is granting the License.
-
-      "Legal Entity" shall mean the union of the acting entity and all
-      other entities that control, are controlled by, or are under common
-      control with that entity. For the purposes of this definition,
-      "control" means (i) the power, direct or indirect, to cause the
-      direction or management of such entity, whether by contract or
-      otherwise, or (ii) ownership of fifty percent (50%) or more of the
-      outstanding shares, or (iii) beneficial ownership of such entity.
-
-      "You" (or "Your") shall mean an individual or Legal Entity
-      exercising permissions granted by this License.
-
-      "Source" form shall mean the preferred form for making modifications,
-      including but not limited to software source code, documentation
-      source, and configuration files.
-
-      "Object" form shall mean any form resulting from mechanical
-      transformation or translation of a Source form, including but
-      not limited to compiled object code, generated documentation,
-      and conversions to other media types.
-
-      "Work" shall mean the work of authorship, whether in Source or
-      Object form, made available under the License, as indicated by a
-      copyright notice that is included in or attached to the work
-      (an example is provided in the Appendix below).
-
-      "Derivative Works" shall mean any work, whether in Source or Object
-      form, that is based on (or derived from) the Work and for which the
-      editorial revisions, annotations, elaborations, or other modifications
-      represent, as a whole, an original work of authorship. For the purposes
-      of this License, Derivative Works shall not include works that remain
-      separable from, or merely link (or bind by name) to the interfaces of,
-      the Work and Derivative Works thereof.
-
-      "Contribution" shall mean any work of authorship, including
-      the original version of the Work and any modifications or additions
-      to that Work or Derivative Works thereof, that is intentionally
-      submitted to Licensor for inclusion in the Work by the copyright owner
-      or by an individual or Legal Entity authorized to submit on behalf of
-      the copyright owner. For the purposes of this definition, "submitted"
-      means any form of electronic, verbal, or written communication sent
-      to the Licensor or its representatives, including but not limited to
-      communication on electronic mailing lists, source code control systems,
-      and issue tracking systems that are managed by, or on behalf of, the
-      Licensor for the purpose of discussing and improving the Work, but
-      excluding communication that is conspicuously marked or otherwise
-      designated in writing by the copyright owner as "Not a Contribution."
-
-      "Contributor" shall mean Licensor and any individual or Legal Entity
-      on behalf of whom a Contribution has been received by Licensor and
-      subsequently incorporated within the Work.
-
-   2. Grant of Copyright License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      copyright license to reproduce, prepare Derivative Works of,
-      publicly display, publicly perform, sublicense, and distribute the
-      Work and such Derivative Works in Source or Object form.
-
-   3. Grant of Patent License. Subject to the terms and conditions of
-      this License, each Contributor hereby grants to You a perpetual,
-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
-      (except as stated in this section) patent license to make, have made,
-      use, offer to sell, sell, import, and otherwise transfer the Work,
-      where such license applies only to those patent claims licensable
-      by such Contributor that are necessarily infringed by their
-      Contribution(s) alone or by combination of their Contribution(s)
-      with the Work to which such Contribution(s) was submitted. If You
-      institute patent litigation against any entity (including a
-      cross-claim or counterclaim in a lawsuit) alleging that the Work
-      or a Contribution incorporated within the Work constitutes direct
-      or contributory patent infringement, then any patent licenses
-      granted to You under this License for that Work shall terminate
-      as of the date such litigation is filed.
-
-   4. Redistribution. You may reproduce and distribute copies of the
-      Work or Derivative Works thereof in any medium, with or without
-      modifications, and in Source or Object form, provided that You
-      meet the following conditions:
-
-      (a) You must give any other recipients of the Work or
-          Derivative Works a copy of this License; and
-
-      (b) You must cause any modified files to carry prominent notices
-          stating that You changed the files; and
-
-      (c) You must retain, in the Source form of any Derivative Works
-          that You distribute, all copyright, patent, trademark, and
-          attribution notices from the Source form of the Work,
-          excluding those notices that do not pertain to any part of
-          the Derivative Works; and
-
-      (d) If the Work includes a "NOTICE" text file as part of its
-          distribution, then any Derivative Works that You distribute must
-          include a readable copy of the attribution notices contained
-          within such NOTICE file, excluding those notices that do not
-          pertain to any part of the Derivative Works, in at least one
-          of the following places: within a NOTICE text file distributed
-          as part of the Derivative Works; within the Source form or
-          documentation, if provided along with the Derivative Works; or,
-          within a display generated by the Derivative Works, if and
-          wherever such third-party notices normally appear. The contents
-          of the NOTICE file are for informational purposes only and
-          do not modify the License. You may add Your own attribution
-          notices within Derivative Works that You distribute, alongside
-          or as an addendum to the NOTICE text from the Work, provided
-          that such additional attribution notices cannot be construed
-          as modifying the License.
-
-      You may add Your own copyright statement to Your modifications and
-      may provide additional or different license terms and conditions
-      for use, reproduction, or distribution of Your modifications, or
-      for any such Derivative Works as a whole, provided Your use,
-      reproduction, and distribution of the Work otherwise complies with
-      the conditions stated in this License.
-
-   5. Submission of Contributions. Unless You explicitly state otherwise,
-      any Contribution intentionally submitted for inclusion in the Work
-      by You to the Licensor shall be under the terms and conditions of
-      this License, without any additional terms or conditions.
-      Notwithstanding the above, nothing herein shall supersede or modify
-      the terms of any separate license agreement you may have executed
-      with Licensor regarding such Contributions.
-
-   6. Trademarks. This License does not grant permission to use the trade
-      names, trademarks, service marks, or product names of the Licensor,
-      except as required for reasonable and customary use in describing the
-      origin of the Work and reproducing the content of the NOTICE file.
-
-   7. Disclaimer of Warranty. Unless required by applicable law or
-      agreed to in writing, Licensor provides the Work (and each
-      Contributor provides its Contributions) on an "AS IS" BASIS,
-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
-      implied, including, without limitation, any warranties or conditions
-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
-      PARTICULAR PURPOSE. You are solely responsible for determining the
-      appropriateness of using or redistributing the Work and assume any
-      risks associated with Your exercise of permissions under this License.
-
-   8. Limitation of Liability. In no event and under no legal theory,
-      whether in tort (including negligence), contract, or otherwise,
-      unless required by applicable law (such as deliberate and grossly
-      negligent acts) or agreed to in writing, shall any Contributor be
-      liable to You for damages, including any direct, indirect, special,
-      incidental, or consequential damages of any character arising as a
-      result of this License or out of the use or inability to use the
-      Work (including but not limited to damages for loss of goodwill,
-      work stoppage, computer failure or malfunction, or any and all
-      other commercial damages or losses), even if such Contributor
-      has been advised of the possibility of such damages.
-
-   9. Accepting Warranty or Additional Liability. While redistributing
-      the Work or Derivative Works thereof, You may choose to offer,
-      and charge a fee for, acceptance of support, warranty, indemnity,
-      or other liability obligations and/or rights consistent with this
-      License. However, in accepting such obligations, You may act only
-      on Your own behalf and on Your sole responsibility, not on behalf
-      of any other Contributor, and only if You agree to indemnify,
-      defend, and hold each Contributor harmless for any liability
-      incurred by, or claims asserted against, such Contributor by reason
-      of your accepting any such warranty or additional liability.
-
-   END OF TERMS AND CONDITIONS
-
-   APPENDIX: How to apply the Apache License to your work.
-
-      To apply the Apache License to your work, attach the following
-      boilerplate notice, with the fields enclosed by brackets "[]"
-      replaced with your own identifying information. (Don't include
-      the brackets!)  The text should be enclosed in the appropriate
-      comment syntax for the file format. We also recommend that a
-      file or class name and description of purpose be included on the
-      same "printed page" as the copyright notice for easier
-      identification within third-party archives.
-
-   Copyright [yyyy] [name of copyright owner]
-
-   Licensed under the Apache License, Version 2.0 (the "License");
-   you may not use this file except in compliance with the License.
-   You may obtain a copy of the License at
-
-       http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing, software
-   distributed under the License is distributed on an "AS IS" BASIS,
-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-   See the License for the specific language governing permissions and
-   limitations under the License.
-

http://git-wip-us.apache.org/repos/asf/camel/blob/f2f1d1d3/tooling/maven/maven-html-to-pdf/src/main/resources/META-INF/NOTICE.txt
----------------------------------------------------------------------
diff --git a/tooling/maven/maven-html-to-pdf/src/main/resources/META-INF/NOTICE.txt b/tooling/maven/maven-html-to-pdf/src/main/resources/META-INF/NOTICE.txt
deleted file mode 100644
index 5731318..0000000
--- a/tooling/maven/maven-html-to-pdf/src/main/resources/META-INF/NOTICE.txt
+++ /dev/null
@@ -1,12 +0,0 @@
-=========================================================================
-==  NOTICE file corresponding to the section 4 d of                    ==
-==  the Apache License, Version 2.0,                                   ==
-==  in this case for the Apache ActiveMQ distribution.                 ==
-=========================================================================
-
-Apache Camel
-Copyright 2005-2006 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-

http://git-wip-us.apache.org/repos/asf/camel/blob/f2f1d1d3/tooling/maven/pom.xml
----------------------------------------------------------------------
diff --git a/tooling/maven/pom.xml b/tooling/maven/pom.xml
index 7e76300..de80bf6 100644
--- a/tooling/maven/pom.xml
+++ b/tooling/maven/pom.xml
@@ -33,7 +33,6 @@
     <module>camel-package-maven-plugin</module>
     <module>camel-maven-plugin</module>
     <module>guice-maven-plugin</module>
-    <module>maven-html-to-pdf</module>
   </modules>
 
   <dependencies>


Mime
View raw message