You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2008/12/10 15:51:39 UTC

svn commit: r725302 - in /activemq/camel/trunk/tooling: camel-manual/pom.xml maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java

Author: janstey
Date: Wed Dec 10 06:51:38 2008
New Revision: 725302

URL: http://svn.apache.org/viewvc?rev=725302&view=rev
Log:
CAMEL-1165 - Add pom version as the guide version so we don't have to update every time.

Modified:
    activemq/camel/trunk/tooling/camel-manual/pom.xml
    activemq/camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java

Modified: activemq/camel/trunk/tooling/camel-manual/pom.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/camel-manual/pom.xml?rev=725302&r1=725301&r2=725302&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/camel-manual/pom.xml (original)
+++ activemq/camel/trunk/tooling/camel-manual/pom.xml Wed Dec 10 06:51:38 2008
@@ -59,6 +59,12 @@
                 }
               </style>
           ]]></head>
+          <replaceToken><![CDATA[
+              <h3 id="replaceme">.*</h3>
+          ]]></replaceToken>
+          <replaceValue><![CDATA[
+              <h3>Version ${pom.version}</h3>
+          ]]></replaceValue>
         </configuration>
       </plugin>
       <plugin>

Modified: activemq/camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java?rev=725302&r1=725301&r2=725302&view=diff
==============================================================================
--- activemq/camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java (original)
+++ activemq/camel/trunk/tooling/maven/maven-html-to-pdf/src/main/java/org/apache/camel/maven/HtmlToPdfMojo.java Wed Dec 10 06:51:38 2008
@@ -93,6 +93,21 @@
     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.
@@ -247,6 +262,11 @@
             }
         }
         out.println("</head>");
+        
+        if (replaceToken != null && replaceValue != null) {
+            content = content.replaceAll(replaceToken, replaceValue);
+        }
+        
         out.println("<body>" + content + "</body>");
         out.close();
         getLog().info("Stored: " + getHTMLFileName());